typedef long unsigned int size_t; typedef unsigned short __kernel_dev_t; typedef unsigned long __kernel_ino_t; typedef unsigned short __kernel_mode_t; typedef unsigned short __kernel_nlink_t; typedef long __kernel_off_t; typedef int __kernel_pid_t; typedef unsigned int __kernel_ipc_pid_t; typedef unsigned int __kernel_uid_t; typedef unsigned int __kernel_gid_t; typedef unsigned int __kernel_size_t; typedef int __kernel_ssize_t; typedef int __kernel_ptrdiff_t; typedef long __kernel_time_t; typedef long __kernel_suseconds_t; typedef long __kernel_clock_t; typedef int __kernel_daddr_t; typedef char * __kernel_caddr_t; typedef unsigned short __kernel_uid16_t; typedef unsigned short __kernel_gid16_t; typedef unsigned int __kernel_uid32_t; typedef unsigned int __kernel_gid32_t; typedef unsigned short __kernel_old_uid_t; typedef unsigned short __kernel_old_gid_t; typedef long long __kernel_loff_t; typedef __kernel_dev_t __kernel_old_dev_t; typedef struct { int __val[2]; } __kernel_fsid_t; typedef unsigned char __u_char; typedef unsigned short int __u_short; typedef unsigned int __u_int; typedef unsigned long int __u_long; typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef signed short int __int16_t; typedef unsigned short int __uint16_t; typedef signed int __int32_t; typedef unsigned int __uint32_t; __extension__ typedef signed long long int __int64_t; __extension__ typedef unsigned long long int __uint64_t; __extension__ typedef long long int __quad_t; __extension__ typedef unsigned long long int __u_quad_t; __extension__ typedef __u_quad_t __dev_t; __extension__ typedef unsigned int __uid_t; __extension__ typedef unsigned int __gid_t; __extension__ typedef unsigned long int __ino_t; __extension__ typedef __u_quad_t __ino64_t; __extension__ typedef unsigned int __mode_t; __extension__ typedef unsigned int __nlink_t; __extension__ typedef long int __off_t; __extension__ typedef __quad_t __off64_t; __extension__ typedef int __pid_t; __extension__ typedef struct { int __val[2]; } __fsid_t; __extension__ typedef long int __clock_t; __extension__ typedef unsigned long int __rlim_t; __extension__ typedef __u_quad_t __rlim64_t; __extension__ typedef unsigned int __id_t; __extension__ typedef long int __time_t; __extension__ typedef unsigned int __useconds_t; __extension__ typedef long int __suseconds_t; __extension__ typedef int __daddr_t; __extension__ typedef long int __swblk_t; __extension__ typedef int __key_t; __extension__ typedef int __clockid_t; __extension__ typedef void * __timer_t; __extension__ typedef long int __blksize_t; __extension__ typedef long int __blkcnt_t; __extension__ typedef __quad_t __blkcnt64_t; __extension__ typedef unsigned long int __fsblkcnt_t; __extension__ typedef __u_quad_t __fsblkcnt64_t; __extension__ typedef unsigned long int __fsfilcnt_t; __extension__ typedef __u_quad_t __fsfilcnt64_t; __extension__ typedef long int __ssize_t; typedef __off64_t __loff_t; typedef __quad_t *__qaddr_t; typedef char *__caddr_t; __extension__ typedef int __intptr_t; __extension__ typedef unsigned int __socklen_t; typedef __kernel_ipc_pid_t __ipc_pid_t; struct __sched_param { int __sched_priority; }; struct _pthread_fastlock { long int __status; int __spinlock; }; typedef struct _pthread_descr_struct *_pthread_descr; typedef struct __pthread_attr_s { int __detachstate; int __schedpolicy; struct __sched_param __schedparam; int __inheritsched; int __scope; size_t __guardsize; int __stackaddr_set; void *__stackaddr; size_t __stacksize; } pthread_attr_t; typedef struct { struct _pthread_fastlock __c_lock; _pthread_descr __c_waiting; } pthread_cond_t; typedef struct { int __dummy; } pthread_condattr_t; typedef unsigned int pthread_key_t; typedef struct { int __m_reserved; int __m_count; _pthread_descr __m_owner; int __m_kind; struct _pthread_fastlock __m_lock; } pthread_mutex_t; typedef struct { int __mutexkind; } pthread_mutexattr_t; typedef int pthread_once_t; typedef unsigned long int pthread_t; typedef struct __STDIO_FILE_STRUCT FILE; typedef struct __STDIO_FILE_STRUCT __FILE; struct timespec { __time_t tv_sec; long int tv_nsec; }; struct sched_param { int __sched_priority; }; extern int clone (int (*__fn) (void *__arg), void *__child_stack, int __flags, void *__arg, ...) __attribute__ ((__nothrow__)); typedef unsigned long int __cpu_mask; typedef struct { __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))]; } cpu_set_t; extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param) __attribute__ ((__nothrow__)); extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __attribute__ ((__nothrow__)); extern int sched_setscheduler (__pid_t __pid, int __policy, __const struct sched_param *__param) __attribute__ ((__nothrow__)); extern int sched_getscheduler (__pid_t __pid) __attribute__ ((__nothrow__)); extern int sched_yield (void) __attribute__ ((__nothrow__)); extern int sched_get_priority_max (int __algorithm) __attribute__ ((__nothrow__)); extern int sched_get_priority_min (int __algorithm) __attribute__ ((__nothrow__)); extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __attribute__ ((__nothrow__)); typedef __clock_t clock_t; typedef __time_t time_t; typedef __clockid_t clockid_t; typedef __timer_t timer_t; struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; long int tm_gmtoff; __const char *tm_zone; }; struct itimerspec { struct timespec it_interval; struct timespec it_value; }; struct sigevent; extern clock_t clock (void) __attribute__ ((__nothrow__)); extern time_t time (time_t *__timer) __attribute__ ((__nothrow__)); extern double difftime (time_t __time1, time_t __time0) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__)); extern size_t strftime (char *__restrict __s, size_t __maxsize, __const char *__restrict __format, __const struct tm *__restrict __tp) __attribute__ ((__nothrow__)); extern struct tm *gmtime (__const time_t *__timer) __attribute__ ((__nothrow__)); extern struct tm *localtime (__const time_t *__timer) __attribute__ ((__nothrow__)); extern struct tm *gmtime_r (__const time_t *__restrict __timer, struct tm *__restrict __tp) __attribute__ ((__nothrow__)); extern struct tm *localtime_r (__const time_t *__restrict __timer, struct tm *__restrict __tp) __attribute__ ((__nothrow__)); extern char *asctime (__const struct tm *__tp) __attribute__ ((__nothrow__)); extern char *ctime (__const time_t *__timer) __attribute__ ((__nothrow__)); extern char *asctime_r (__const struct tm *__restrict __tp, char *__restrict __buf) __attribute__ ((__nothrow__)); extern char *ctime_r (__const time_t *__restrict __timer, char *__restrict __buf) __attribute__ ((__nothrow__)); extern char *tzname[2]; extern void tzset (void) __attribute__ ((__nothrow__)); extern int daylight; extern long int timezone; extern int stime (__const time_t *__when) __attribute__ ((__nothrow__)); extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__)); extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__)); extern int dysize (int __year) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int nanosleep (__const struct timespec *__requested_time, struct timespec *__remaining); extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__)); extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__)); extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp) __attribute__ ((__nothrow__)); extern int timer_create (clockid_t __clock_id, struct sigevent *__restrict __evp, timer_t *__restrict __timerid) __attribute__ ((__nothrow__)); extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__)); extern int timer_settime (timer_t __timerid, int __flags, __const struct itimerspec *__restrict __value, struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__)); extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) __attribute__ ((__nothrow__)); extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__)); typedef int __sig_atomic_t; typedef struct { unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; } __sigset_t; typedef __sigset_t sigset_t; enum { PTHREAD_CREATE_JOINABLE, PTHREAD_CREATE_DETACHED }; enum { PTHREAD_INHERIT_SCHED, PTHREAD_EXPLICIT_SCHED }; enum { PTHREAD_SCOPE_SYSTEM, PTHREAD_SCOPE_PROCESS }; enum { PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_TIMED_NP }; enum { PTHREAD_PROCESS_PRIVATE, PTHREAD_PROCESS_SHARED }; struct _pthread_cleanup_buffer { void (*__routine) (void *); void *__arg; int __canceltype; struct _pthread_cleanup_buffer *__prev; }; enum { PTHREAD_CANCEL_ENABLE, PTHREAD_CANCEL_DISABLE }; enum { PTHREAD_CANCEL_DEFERRED, PTHREAD_CANCEL_ASYNCHRONOUS }; extern int pthread_create (pthread_t *__restrict __threadp, __const pthread_attr_t *__restrict __attr, void *(*__start_routine) (void *), void *__restrict __arg) __attribute__ ((__nothrow__)); extern pthread_t pthread_self (void) __attribute__ ((__nothrow__)); extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __attribute__ ((__nothrow__)); extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__)); extern int pthread_join (pthread_t __th, void **__thread_return); extern int pthread_detach (pthread_t __th) __attribute__ ((__nothrow__)); extern int pthread_attr_init (pthread_attr_t *__attr) __attribute__ ((__nothrow__)); extern int pthread_attr_destroy (pthread_attr_t *__attr) __attribute__ ((__nothrow__)); extern int pthread_attr_setdetachstate (pthread_attr_t *__attr, int __detachstate) __attribute__ ((__nothrow__)); extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr, int *__detachstate) __attribute__ ((__nothrow__)); extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, __const struct sched_param *__restrict __param) __attribute__ ((__nothrow__)); extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict __attr, struct sched_param *__restrict __param) __attribute__ ((__nothrow__)); extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy) __attribute__ ((__nothrow__)); extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict __attr, int *__restrict __policy) __attribute__ ((__nothrow__)); extern int pthread_attr_setinheritsched (pthread_attr_t *__attr, int __inherit) __attribute__ ((__nothrow__)); extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict __attr, int *__restrict __inherit) __attribute__ ((__nothrow__)); extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope) __attribute__ ((__nothrow__)); extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr, int *__restrict __scope) __attribute__ ((__nothrow__)); extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, void *__stackaddr) __attribute__ ((__nothrow__)); extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr) __attribute__ ((__nothrow__)); extern int pthread_attr_setstacksize (pthread_attr_t *__attr, size_t __stacksize) __attribute__ ((__nothrow__)); extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict __attr, size_t *__restrict __stacksize) __attribute__ ((__nothrow__)); extern int pthread_setschedparam (pthread_t __target_thread, int __policy, __const struct sched_param *__param) __attribute__ ((__nothrow__)); extern int pthread_getschedparam (pthread_t __target_thread, int *__restrict __policy, struct sched_param *__restrict __param) __attribute__ ((__nothrow__)); extern int pthread_mutex_init (pthread_mutex_t *__restrict __mutex, __const pthread_mutexattr_t *__restrict __mutex_attr) __attribute__ ((__nothrow__)); extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) __attribute__ ((__nothrow__)); extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) __attribute__ ((__nothrow__)); extern int pthread_mutex_lock (pthread_mutex_t *__mutex) __attribute__ ((__nothrow__)); extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) __attribute__ ((__nothrow__)); extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) __attribute__ ((__nothrow__)); extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) __attribute__ ((__nothrow__)); extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t * __restrict __attr, int *__restrict __pshared) __attribute__ ((__nothrow__)); extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr, int __pshared) __attribute__ ((__nothrow__)); extern int pthread_cond_init (pthread_cond_t *__restrict __cond, __const pthread_condattr_t *__restrict __cond_attr) __attribute__ ((__nothrow__)); extern int pthread_cond_destroy (pthread_cond_t *__cond) __attribute__ ((__nothrow__)); extern int pthread_cond_signal (pthread_cond_t *__cond) __attribute__ ((__nothrow__)); extern int pthread_cond_broadcast (pthread_cond_t *__cond) __attribute__ ((__nothrow__)); extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex); extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex, __const struct timespec *__restrict __abstime); extern int pthread_condattr_init (pthread_condattr_t *__attr) __attribute__ ((__nothrow__)); extern int pthread_condattr_destroy (pthread_condattr_t *__attr) __attribute__ ((__nothrow__)); extern int pthread_condattr_getpshared (__const pthread_condattr_t * __restrict __attr, int *__restrict __pshared) __attribute__ ((__nothrow__)); extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, int __pshared) __attribute__ ((__nothrow__)); extern int pthread_key_create (pthread_key_t *__key, void (*__destr_function) (void *)) __attribute__ ((__nothrow__)); extern int pthread_key_delete (pthread_key_t __key) __attribute__ ((__nothrow__)); extern int pthread_setspecific (pthread_key_t __key, __const void *__pointer) __attribute__ ((__nothrow__)); extern void *pthread_getspecific (pthread_key_t __key) __attribute__ ((__nothrow__)); extern int pthread_once (pthread_once_t *__once_control, void (*__init_routine) (void)); extern int pthread_setcancelstate (int __state, int *__oldstate); extern int pthread_setcanceltype (int __type, int *__oldtype); extern int pthread_cancel (pthread_t __cancelthread); extern void pthread_testcancel (void); extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *__buffer, void (*__routine) (void *), void *__arg) __attribute__ ((__nothrow__)); extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *__buffer, int __execute) __attribute__ ((__nothrow__)); extern int pthread_sigmask (int __how, __const __sigset_t *__restrict __newmask, __sigset_t *__restrict __oldmask)__attribute__ ((__nothrow__)); extern int pthread_kill (pthread_t __threadid, int __signo) __attribute__ ((__nothrow__)); extern int pthread_atfork (void (*__prepare) (void), void (*__parent) (void), void (*__child) (void)) __attribute__ ((__nothrow__)); extern void pthread_kill_other_threads_np (void) __attribute__ ((__nothrow__)); typedef struct { __off_t __pos; } __STDIO_fpos_t; typedef struct { __off64_t __pos; } __STDIO_fpos64_t; typedef __off64_t __offmax_t; struct __STDIO_FILE_STRUCT { unsigned short __modeflags; unsigned char __ungot[2]; int __filedes; unsigned char *__bufstart; unsigned char *__bufend; unsigned char *__bufpos; unsigned char *__bufread; unsigned char *__bufgetc_u; unsigned char *__bufputc_u; struct __STDIO_FILE_STRUCT *__nextopen; int __user_locking; pthread_mutex_t __lock; }; extern int __fgetc_unlocked(FILE *__stream); extern int __fputc_unlocked(int __c, FILE *__stream); extern FILE *__stdin; extern FILE *__stdout; typedef __builtin_va_list __gnuc_va_list; typedef __STDIO_fpos_t fpos_t; extern FILE *stdin; extern FILE *stdout; extern FILE *stderr; extern int remove (__const char *__filename) __attribute__ ((__nothrow__)); extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__)); extern FILE *tmpfile (void); extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)); extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)); extern char *tempnam (__const char *__dir, __const char *__pfx) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); extern int fclose (FILE *__stream); extern int fflush (FILE *__stream); extern int fflush_unlocked (FILE *__stream); extern FILE *fopen (__const char *__restrict __filename, __const char *__restrict __modes); extern FILE *freopen (__const char *__restrict __filename, __const char *__restrict __modes, FILE *__restrict __stream); extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__)); extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__)); extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, int __modes, size_t __n) __attribute__ ((__nothrow__)); extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, size_t __size) __attribute__ ((__nothrow__)); extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__)); extern int fprintf (FILE *__restrict __stream, __const char *__restrict __format, ...); extern int printf (__const char *__restrict __format, ...); extern int sprintf (char *__restrict __s, __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg); extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg); extern int vsprintf (char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__)); extern int snprintf (char *__restrict __s, size_t __maxlen, __const char *__restrict __format, ...) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4))); extern int vsnprintf (char *__restrict __s, size_t __maxlen, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0))); extern int fscanf (FILE *__restrict __stream, __const char *__restrict __format, ...); extern int scanf (__const char *__restrict __format, ...); extern int sscanf (__const char *__restrict __s, __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); extern int fgetc (FILE *__stream); extern int getc (FILE *__stream); extern int getchar (void); extern int getc_unlocked (FILE *__stream); extern int getchar_unlocked (void); extern int fgetc_unlocked (FILE *__stream); extern int fputc (int __c, FILE *__stream); extern int putc (int __c, FILE *__stream); extern int putchar (int __c); extern int fputc_unlocked (int __c, FILE *__stream); extern int putc_unlocked (int __c, FILE *__stream); extern int putchar_unlocked (int __c); extern int getw (FILE *__stream); extern int putw (int __w, FILE *__stream); extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream); extern char *gets (char *__s); extern int fputs (__const char *__restrict __s, FILE *__restrict __stream); extern int puts (__const char *__s); extern int ungetc (int __c, FILE *__stream); extern size_t fread (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream); extern size_t fwrite (__const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __s); extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream); extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream); extern int fseek (FILE *__stream, long int __off, int __whence); extern long int ftell (FILE *__stream); extern void rewind (FILE *__stream); extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos); extern int fsetpos (FILE *__stream, __const fpos_t *__pos); extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__)); extern int feof (FILE *__stream) __attribute__ ((__nothrow__)); extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)); extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__)); extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)); extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)); extern void perror (__const char *__s); extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)); extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)); extern FILE *popen (__const char *__command, __const char *__modes); extern int pclose (FILE *__stream); extern char *ctermid (char *__s) __attribute__ ((__nothrow__)); extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__)); extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)); extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__)); extern void *memcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memmove (void *__dest, __const void *__src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memccpy (void *__restrict __dest, __const void *__restrict __src, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int memcmp (__const void *__s1, __const void *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memchr (__const void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *strcpy (char *__restrict __dest, __const char *__restrict __src) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strncpy (char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strcat (char *__restrict __dest, __const char *__restrict __src) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strncat (char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcmp (__const char *__s1, __const char *__s2) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncmp (__const char *__s1, __const char *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcoll (__const char *__s1, __const char *__s2) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strxfrm (char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern char *strdup (__const char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); extern char *strchr (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *strrchr (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern size_t strcspn (__const char *__s, __const char *__reject) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strspn (__const char *__s, __const char *__accept) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strpbrk (__const char *__s, __const char *__accept) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strstr (__const char *__haystack, __const char *__needle) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strtok (char *__restrict __s, __const char *__restrict __delim) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); extern size_t strlen (__const char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *strerror (int __errnum) __attribute__ ((__nothrow__)); extern char *__glibc_strerror_r (int __errnum, char *__buf, size_t __buflen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern char * strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("_" "__glibc_strerror_r") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern void bcopy (__const void *__src, void *__dest, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int bcmp (__const void *__s1, __const void *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *index (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *rindex (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern int ffs (int __i) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int strcasecmp (__const char *__s1, __const char *__s2) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strsep (char **__restrict __stringp, __const char *__restrict __delim) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strlcat(char *__restrict dst, const char *__restrict src, size_t n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strlcpy(char *__restrict dst, const char *__restrict src, size_t n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); const char *it = ""; size_t errors = 0; char one[50]; char two[50]; static void check (int thing, int number) { if (!thing) { printf("%s flunked test %d\n", it, number); ++errors; } else if (0) { printf("%s test %d ok\n", it, number); } } static void equal (const char *a, const char *b, int number) { check(a != ((void *)0) && b != ((void *)0) && (strcmp((a), (b)) == 0), number); } int _strcmp(const char *cs, const char *ct) { int __res1, __res2; __asm__ ("1:\t%2 = B[%0++] (Z);\n\t" "%3 = B[%1++] (Z);\n\t" "CC = %2 == %3;\n\t" "if ! cc jump 2f;\n\t" "CC = %2;\n\t" "if cc jump 1b (bp);\n\t" "jump.s 3f;\n" "2:\t%2 = %2 - %3;\n" "3:\n" : "+&a" (cs), "+&a" (ct), "=&d" (__res1), "=&d" (__res2) : : "CC"); return __res1; } void test_strcmp (void) { it = "strcmp"; { char buf1[0x40], buf2[0x40]; int i, j; j = i = 0; { int k; buf1[i] = buf1[0x3f] = 0; buf2[j] = buf2[0x3f] = 0; k = 0; { ; ; buf1[i+k] = 'A' + i + k; buf1[i+k+1] = 0; ; ; check (_strcmp (buf1+i,buf2+j) > 0, 2); return; } } } } int main(int argc, char *argv[]) { int status; test_strcmp (); if (errors == 0) { status = 0; printf("TEST PASS.\n"); } else { status = 1; printf("%Zd errors.\n", errors); printf("TEST FAIL.\n"); } return status; }