; GNU C version 3.4-llvm 20030530 (experimental) (i686-pc-linux-gnu)
;	compiled by GNU C version 3.2.
; GGC heuristics: --param ggc-min-expand=90 --param ggc-min-heapsize=113090
; options passed:  -E -iprefix -DSPEC_CPU2000 -ansi -O0
; options enabled:  -feliminate-unused-debug-types -fpeephole
; -ffunction-cse -fkeep-static-consts -fpcc-struct-return -fgcse-lm
; -fgcse-sm -fsched-interblock -fsched-spec -fbranch-count-reg -fcommon
; -fgnu-linker -fargument-alias -fzero-initialized-in-bss -fident
; -fmath-errno -ftrapping-math -m80387 -mhard-float -mno-soft-float
; -mieee-fp -mfp-ret-in-387 -maccumulate-outgoing-args -mno-red-zone
; -mtune=pentiumpro -march=i386

target pointersize = 32
target endian = little
nclude/bits/types.h" 1 3 4
# 28 "/usr/include/bits/types.h" 3 4
# 1 "/usr/include/bits/wordsize.h" 1 3 4
# 29 "/usr/include/bits/types.h" 2 3 4


# 1 "/home/dcrowe/llvm/cfrontend/x86/llvm-gcc/lib/gcc-lib/i686-pc-linux-gnu/3.4-llvm/include/stddef.h" 1 3 4
# 32 "/usr/include/bits/types.h" 2 3 4


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;
# 128 "/usr/include/bits/types.h" 3 4
# 1 "/usr/include/bits/typesizes.h" 1 3 4
# 129 "/usr/include/bits/types.h" 2 3 4


typedef unsigned long long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned int __nlink_t;
typedef long int __off_t;
typedef long long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;

typedef int __daddr_t;
typedef long int __swblk_t;
typedef int __key_t;


typedef int __clockid_t;


typedef int __timer_t;


typedef long int __blksize_t;




typedef long int __blkcnt_t;
typedef long long int __blkcnt64_t;


typedef unsigned long int __fsblkcnt_t;
typedef unsigned long long int __fsblkcnt64_t;


typedef unsigned long int __fsfilcnt_t;
typedef unsigned long long int __fsfilcnt64_t;




typedef int __ssize_t;
typedef __off64_t __loff_t;
typedef __quad_t *__qaddr_t;
typedef char *__caddr_t;


typedef int __intptr_t;


typedef unsigned int __socklen_t;
# 37 "/usr/include/stdio.h" 2 3 4









typedef struct _IO_FILE FILE;

# 62 "/usr/include/stdio.h" 3 4
typedef struct _IO_FILE __FILE;
# 72 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/libio.h" 1 3 4
# 32 "/usr/include/libio.h" 3 4
# 1 "/usr/include/_G_config.h" 1 3 4
# 14 "/usr/include/_G_config.h" 3 4
# 1 "/home/dcrowe/llvm/cfrontend/x86/llvm-gcc/lib/gcc-lib/i686-pc-linux-gnu/3.4-llvm/include/stddef.h" 1 3 4
# 325 "/home/dcrowe/llvm/cfrontend/x86/llvm-gcc/lib/gcc-lib/i686-pc-linux-gnu/3.4-llvm/include/stddef.h" 3 4
typedef long int wchar_t;
# 354 "/home/dcrowe/llvm/cfrontend/x86/llvm-gcc/lib/gcc-lib/i686-pc-linux-gnu/3.4-llvm/include/stddef.h" 3 4
typedef unsigned int wint_t;
# 15 "/usr/include/_G_config.h" 2 3 4
# 24 "/usr/include/_G_config.h" 3 4
# 1 "/usr/include/wchar.h" 1 3 4
# 48 "/usr/include/wchar.h" 3 4
# 1 "/home/dcrowe/llvm/cfrontend/x86/llvm-gcc/lib/gcc-lib/i686-pc-linux-gnu/3.4-llvm/include/stddef.h" 1 3 4
# 49 "/usr/include/wchar.h" 2 3 4

# 1 "/usr/include/bits/wchar.h" 1 3 4
# 51 "/usr/include/wchar.h" 2 3 4
# 71 "/usr/include/wchar.h" 3 4
typedef struct
{
  int __count;
  union
  {
    wint_t __wch;
    char __wchb[4];
  } __value;
} __mbstate_t;
# 25 "/usr/include/_G_config.h" 2 3 4

typedef struct
{
  __off_t __pos;
  __mbstate_t __state;
} _G_fpos_t;
typedef struct
{
  __off64_t __pos;
  __mbstate_t __state;
} _G_fpos64_t;
# 44 "/usr/include/_G_config.h" 3 4
# 1 "/usr/include/gconv.h" 1 3 4
# 28 "/usr/include/gconv.h" 3 4
# 1 "/usr/include/wchar.h" 1 3 4
# 48 "/usr/include/wchar.h" 3 4
# 1 "/home/dcrowe/llvm/cfrontend/x86/llvm-gcc/lib/gcc-lib/i686-pc-linux-gnu/3.4-llvm/include/stddef.h" 1 3 4
# 49 "/usr/include/wchar.h" 2 3 4
# 29 "/usr/include/gconv.h" 2 3 4


# 1 "/home/dcrowe/llvm/cfrontend/x86/llvm-gcc/lib/gcc-lib/i686-pc-linux-gnu/3.4-llvm/include/stddef.h" 1 3 4
# 32 "/usr/include/gconv.h" 2 3 4





enum
{
  __GCONV_OK = 0,
  __GCONV_NOCONV,
  __GCONV_NODB,
  __GCONV_NOMEM,

  __GCONV_EMPTY_INPUT,
  __GCONV_FULL_OUTPUT,
  __GCONV_ILLEGAL_INPUT,
  __GCONV_INCOMPLETE_INPUT,

  __GCONV_ILLEGAL_DESCRIPTOR,
  __GCONV_INTERNAL_ERROR
};



enum
{
  __GCONV_IS_LAST = 0x0001,
  __GCONV_IGNORE_ERRORS = 0x0002
};



struct __gconv_step;
struct __gconv_step_data;
struct __gconv_loaded_object;
struct __gconv_trans_data;



typedef int (*__gconv_fct) (struct __gconv_step *, struct __gconv_step_data *,
       __const unsigned char **, __const unsigned char *,
       unsigned char **, size_t *, int, int);


typedef wint_t (*__gconv_btowc_fct) (struct __gconv_step *, unsigned char);


typedef int (*__gconv_init_fct) (struct __gconv_step *);
typedef void (*__gconv_end_fct) (struct __gconv_step *);



typedef int (*__gconv_trans_fct) (struct __gconv_step *,
      struct __gconv_step_data *, void *,
      __const unsigned char *,
      __const unsigned char **,
      __const unsigned char *, unsigned char **,
      size_t *);


typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *,
       __const unsigned char *,
       unsigned char *, unsigned char *);


typedef int (*__gconv_trans_query_fct) (__const char *, __const char ***,
     size_t *);


typedef int (*__gconv_trans_init_fct) (void **, const char *);
typedef void (*__gconv_trans_end_fct) (void *);

struct __gconv_trans_data
{

  __gconv_trans_fct __trans_fct;
  __gconv_trans_context_fct __trans_context_fct;
  __gconv_trans_end_fct __trans_end_fct;
  void *__data;
  struct __gconv_trans_data *__next;
};



struct __gconv_step
{
  struct __gconv_loaded_object *__shlib_handle;
  __const char *__modname;

  int __counter;

  char *__from_name;
  char *__to_name;

  __gconv_fct __fct;
  __gconv_btowc_fct __btowc_fct;
  __gconv_init_fct __init_fct;
  __gconv_end_fct __end_fct;



  int __min_needed_from;
  int __max_needed_from;
  int __min_needed_to;
  int __max_needed_to;


  int __stateful;

  void *__data;
};



struct __gconv_step_data
{
  unsigned char *__outbuf;
  unsigned char *__outbufend;



  int __flags;



  int __invocation_counter;



  int __internal_use;

  __mbstate_t *__statep;
  __mbstate_t __state;



  struct __gconv_trans_data *__trans;
};



typedef struct __gconv_info
{
  size_t __nsteps;
  struct __gconv_step *__steps;
  __extension__ struct __gconv_step_data __data [];
} *__gconv_t;
# 45 "/usr/include/_G_config.h" 2 3 4
typedef union
{
  struct __gconv_info __cd;
  struct
  {
    struct __gconv_info __cd;
    struct __gconv_step_data __data;
  } __combined;
} _G_iconv_t;

typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
# 33 "/usr/include/libio.h" 2 3 4
# 53 "/usr/include/libio.h" 3 4
# 1 "/home/dcrowe/llvm/cfrontend/x86/llvm-gcc/lib/gcc-lib/i686-pc-linux-gnu/3.4-llvm/include/stdarg.h" 1 3 4
# 43 "/home/dcrowe/llvm/cfrontend/x86/llvm-gcc/lib/gcc-lib/i686-pc-linux-gnu/3.4-llvm/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 54 "/usr/include/libio.h" 2 3 4
# 162 "/usr/include/libio.h" 3 4
struct _IO_jump_t; struct _IO_FILE;
# 172 "/usr/include/libio.h" 3 4
typedef void _IO_lock_t;





struct _IO_marker {
  struct _IO_marker *_next;
  struct _IO_FILE *_sbuf;



  int _pos;
# 195 "/usr/include/libio.h" 3 4
};


enum __codecvt_result
{
  __codecvt_ok,
  __codecvt_partial,
  __codecvt_error,
  __codecvt_noconv
};
# 263 "/usr/include/libio.h" 3 4
struct _IO_FILE {
  int _flags;




  char* _IO_read_ptr;
  char* _IO_read_end;
  char* _IO_read_base;
  char* _IO_write_base;
  char* _IO_write_ptr;
  char* _IO_write_end;
  char* _IO_buf_base;
  char* _IO_buf_end;

  char *_IO_save_base;
  char *_IO_backup_base;
  char *_IO_save_end;

  struct _IO_marker *_markers;

  struct _IO_FILE *_chain;

  int _fileno;



  int _flags2;

  __off_t _old_offset;



  unsigned short _cur_column;
  signed char _vtable_offset;
  char _shortbuf[1];



  _IO_lock_t *_lock;
# 311 "/usr/include/libio.h" 3 4
  __off64_t _offset;





  void *__pad1;
  void *__pad2;

  int _mode;

  char _unused2[15 * sizeof (int) - 2 * sizeof (void *)];

};


typedef struct _IO_FILE _IO_FILE;


struct _IO_FILE_plus;

extern struct _IO_FILE_plus _IO_2_1_stdin_;
extern struct _IO_FILE_plus _IO_2_1_stdout_;
extern struct _IO_FILE_plus _IO_2_1_stderr_;
# 350 "/usr/include/libio.h" 3 4
typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);







typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
     size_t __n);







typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);


typedef int __io_close_fn (void *__cookie);
# 402 "/usr/include/libio.h" 3 4
extern int __underflow (_IO_FILE *) ;
extern int __uflow (_IO_FILE *) ;
extern int __overflow (_IO_FILE *, int) ;
extern wint_t __wunderflow (_IO_FILE *) ;
extern wint_t __wuflow (_IO_FILE *) ;
extern wint_t __woverflow (_IO_FILE *, wint_t) ;
# 432 "/usr/include/libio.h" 3 4
extern int _IO_getc (_IO_FILE *__fp) ;
extern int _IO_putc (int __c, _IO_FILE *__fp) ;
extern int _IO_feof (_IO_FILE *__fp) ;
extern int _IO_ferror (_IO_FILE *__fp) ;

extern int _IO_peekc_locked (_IO_FILE *__fp) ;





extern void _IO_flockfile (_IO_FILE *) ;
extern void _IO_funlockfile (_IO_FILE *) ;
extern int _IO_ftrylockfile (_IO_FILE *) ;
# 462 "/usr/include/libio.h" 3 4
extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
   __gnuc_va_list, int *__restrict) ;
extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
    __gnuc_va_list) ;
extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t) ;
extern size_t _IO_sgetn (_IO_FILE *, void *, size_t) ;

extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int) ;
extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int) ;

extern void _IO_free_backup_area (_IO_FILE *) ;
# 73 "/usr/include/stdio.h" 2 3 4
# 86 "/usr/include/stdio.h" 3 4


typedef _G_fpos_t fpos_t;




# 138 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/bits/stdio_lim.h" 1 3 4
# 139 "/usr/include/stdio.h" 2 3 4



extern struct _IO_FILE *stdin;
extern struct _IO_FILE *stdout;
extern struct _IO_FILE *stderr;







extern int remove (__const char *__filename) ;

extern int rename (__const char *__old, __const char *__new) ;






extern FILE *tmpfile (void) ;
# 171 "/usr/include/stdio.h" 3 4
extern char *tmpnam (char *__s) ;

# 198 "/usr/include/stdio.h" 3 4


extern int fclose (FILE *__stream) ;

extern int fflush (FILE *__stream) ;

# 216 "/usr/include/stdio.h" 3 4



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) ;
# 239 "/usr/include/stdio.h" 3 4

# 271 "/usr/include/stdio.h" 3 4



extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) ;



extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
      int __modes, size_t __n) ;

# 293 "/usr/include/stdio.h" 3 4


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, ...) ;


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) ;

# 349 "/usr/include/stdio.h" 3 4


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, ...) ;

# 379 "/usr/include/stdio.h" 3 4


extern int fgetc (FILE *__stream) ;
extern int getc (FILE *__stream) ;


extern int getchar (void) ;

# 404 "/usr/include/stdio.h" 3 4


extern int fputc (int __c, FILE *__stream) ;
extern int putc (int __c, FILE *__stream) ;


extern int putchar (int __c) ;

# 438 "/usr/include/stdio.h" 3 4


extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
     ;



extern char *gets (char *__s) ;

# 475 "/usr/include/stdio.h" 3 4


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) ;

# 511 "/usr/include/stdio.h" 3 4


extern int fseek (FILE *__stream, long int __off, int __whence) ;

extern long int ftell (FILE *__stream) ;

extern void rewind (FILE *__stream) ;

# 544 "/usr/include/stdio.h" 3 4



extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos)
     ;

extern int fsetpos (FILE *__stream, __const fpos_t *__pos) ;
# 563 "/usr/include/stdio.h" 3 4

# 573 "/usr/include/stdio.h" 3 4


extern void clearerr (FILE *__stream) ;

extern int feof (FILE *__stream) ;

extern int ferror (FILE *__stream) ;

# 590 "/usr/include/stdio.h" 3 4


extern void perror (__const char *__s) ;






# 1 "/usr/include/bits/sys_errlist.h" 1 3 4
# 600 "/usr/include/stdio.h" 2 3 4
# 677 "/usr/include/stdio.h" 3 4

# 2 "main.c" 2
# 1 "/usr/include/stdlib.h" 1 3 4
# 33 "/usr/include/stdlib.h" 3 4
# 1 "/home/dcrowe/llvm/cfrontend/x86/llvm-gcc/lib/gcc-lib/i686-pc-linux-gnu/3.4-llvm/include/stddef.h" 1 3 4
# 34 "/usr/include/stdlib.h" 2 3 4


# 93 "/usr/include/stdlib.h" 3 4


typedef struct
  {
    int quot;
    int rem;
  } div_t;



typedef struct
  {
    long int quot;
    long int rem;
  } ldiv_t;



# 137 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) ;




extern double atof (__const char *__nptr) __attribute__ ((__pure__));

extern int atoi (__const char *__nptr) __attribute__ ((__pure__));

extern long int atol (__const char *__nptr) __attribute__ ((__pure__));

# 157 "/usr/include/stdlib.h" 3 4


extern double strtod (__const char *__restrict __nptr,
        char **__restrict __endptr) ;

# 174 "/usr/include/stdlib.h" 3 4


extern long int strtol (__const char *__restrict __nptr,
   char **__restrict __endptr, int __base) ;

extern unsigned long int strtoul (__const char *__restrict __nptr,
      char **__restrict __endptr, int __base)
     ;

# 264 "/usr/include/stdlib.h" 3 4
extern double __strtod_internal (__const char *__restrict __nptr,
     char **__restrict __endptr, int __group)
     ;
extern float __strtof_internal (__const char *__restrict __nptr,
    char **__restrict __endptr, int __group)
     ;
extern long double __strtold_internal (__const char *__restrict __nptr,
           char **__restrict __endptr,
           int __group) ;

extern long int __strtol_internal (__const char *__restrict __nptr,
       char **__restrict __endptr,
       int __base, int __group) ;



extern unsigned long int __strtoul_internal (__const char *__restrict __nptr,
          char **__restrict __endptr,
          int __base, int __group) ;




__extension__
extern long long int __strtoll_internal (__const char *__restrict __nptr,
      char **__restrict __endptr,
      int __base, int __group) ;



__extension__
extern unsigned long long int __strtoull_internal (__const char *
         __restrict __nptr,
         char **__restrict __endptr,
         int __base, int __group)
     ;
# 469 "/usr/include/stdlib.h" 3 4


extern int rand (void) ;

extern void srand (unsigned int __seed) ;

# 552 "/usr/include/stdlib.h" 3 4


extern void *malloc (size_t __size) __attribute__ ((__malloc__));

extern void *calloc (size_t __nmemb, size_t __size)
     __attribute__ ((__malloc__));







extern void *realloc (void *__ptr, size_t __size) __attribute__ ((__malloc__));

extern void free (void *__ptr) ;

# 590 "/usr/include/stdlib.h" 3 4


extern void abort (void) __attribute__ ((__noreturn__));



extern int atexit (void (*__func) (void)) ;

# 606 "/usr/include/stdlib.h" 3 4




extern void exit (int __status) __attribute__ ((__noreturn__));

# 622 "/usr/include/stdlib.h" 3 4


extern char *getenv (__const char *__name) ;




extern char *__secure_getenv (__const char *__name) ;
# 692 "/usr/include/stdlib.h" 3 4


extern int system (__const char *__command) ;

# 720 "/usr/include/stdlib.h" 3 4
typedef int (*__compar_fn_t) (__const void *, __const void *);









extern void *bsearch (__const void *__key, __const void *__base,
        size_t __nmemb, size_t __size, __compar_fn_t __compar);



extern void qsort (void *__base, size_t __nmemb, size_t __size,
     __compar_fn_t __compar);



extern int abs (int __x) __attribute__ ((__const__));
extern long int labs (long int __x) __attribute__ ((__const__));












extern div_t div (int __numer, int __denom)
     __attribute__ ((__const__));
extern ldiv_t ldiv (long int __numer, long int __denom)
     __attribute__ ((__const__));

# 819 "/usr/include/stdlib.h" 3 4



extern int mblen (__const char *__s, size_t __n) ;


extern int mbtowc (wchar_t *__restrict __pwc,
     __const char *__restrict __s, size_t __n) ;


extern int wctomb (char *__s, wchar_t __wchar) ;



extern size_t mbstowcs (wchar_t *__restrict __pwcs,
   __const char *__restrict __s, size_t __n) ;

extern size_t wcstombs (char *__restrict __s,
   __const wchar_t *__restrict __pwcs, size_t __n)
     ;

# 914 "/usr/include/stdlib.h" 3 4

# 3 "main.c" 2
# 1 "/usr/include/string.h" 1 3 4
# 28 "/usr/include/string.h" 3 4





# 1 "/home/dcrowe/llvm/cfrontend/x86/llvm-gcc/lib/gcc-lib/i686-pc-linux-gnu/3.4-llvm/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4




extern void *memcpy (void *__restrict __dest,
       __const void *__restrict __src, size_t __n) ;


extern void *memmove (void *__dest, __const void *__src, size_t __n)
     ;

# 56 "/usr/include/string.h" 3 4


extern void *memset (void *__s, int __c, size_t __n) ;


extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
     __attribute__ ((__pure__));


extern void *memchr (__const void *__s, int __c, size_t __n)
      __attribute__ ((__pure__));

# 80 "/usr/include/string.h" 3 4


extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
     ;

extern char *strncpy (char *__restrict __dest,
        __const char *__restrict __src, size_t __n) ;


extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
     ;

extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
        size_t __n) ;


extern int strcmp (__const char *__s1, __const char *__s2)
     __attribute__ ((__pure__));

extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
     __attribute__ ((__pure__));


extern int strcoll (__const char *__s1, __const char *__s2)
     __attribute__ ((__pure__));

extern size_t strxfrm (char *__restrict __dest,
         __const char *__restrict __src, size_t __n) ;

# 160 "/usr/include/string.h" 3 4


extern char *strchr (__const char *__s, int __c) __attribute__ ((__pure__));

extern char *strrchr (__const char *__s, int __c) __attribute__ ((__pure__));











extern size_t strcspn (__const char *__s, __const char *__reject)
     __attribute__ ((__pure__));


extern size_t strspn (__const char *__s, __const char *__accept)
     __attribute__ ((__pure__));

extern char *strpbrk (__const char *__s, __const char *__accept)
     __attribute__ ((__pure__));

extern char *strstr (__const char *__haystack, __const char *__needle)
     __attribute__ ((__pure__));



extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
     ;




extern char *__strtok_r (char *__restrict __s,
    __const char *__restrict __delim,
    char **__restrict __save_ptr) ;
# 228 "/usr/include/string.h" 3 4


extern size_t strlen (__const char *__s) __attribute__ ((__pure__));

# 241 "/usr/include/string.h" 3 4


extern char *strerror (int __errnum) ;

# 253 "/usr/include/string.h" 3 4
extern void __bzero (void *__s, size_t __n) ;
# 379 "/usr/include/string.h" 3 4

# 4 "main.c" 2
# 1 "chess.h" 1
# 176 "chess.h"
       typedef unsigned long long BITBOARD;



# 1 "/usr/include/time.h" 1 3 4
# 30 "/usr/include/time.h" 3 4








# 1 "/home/dcrowe/llvm/cfrontend/x86/llvm-gcc/lib/gcc-lib/i686-pc-linux-gnu/3.4-llvm/include/stddef.h" 1 3 4
# 39 "/usr/include/time.h" 2 3 4



# 1 "/usr/include/bits/time.h" 1 3 4
# 43 "/usr/include/time.h" 2 3 4
# 58 "/usr/include/time.h" 3 4


typedef __clock_t clock_t;

# 74 "/usr/include/time.h" 3 4


typedef __time_t time_t;

# 129 "/usr/include/time.h" 3 4


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;

};

# 178 "/usr/include/time.h" 3 4



extern clock_t clock (void) ;


extern time_t time (time_t *__timer) ;


extern double difftime (time_t __time1, time_t __time0)
     __attribute__ ((__const__));


extern time_t mktime (struct tm *__tp) ;





extern size_t strftime (char *__restrict __s, size_t __maxsize,
   __const char *__restrict __format,
   __const struct tm *__restrict __tp) ;

# 226 "/usr/include/time.h" 3 4



extern struct tm *gmtime (__const time_t *__timer) ;



extern struct tm *localtime (__const time_t *__timer) ;

# 248 "/usr/include/time.h" 3 4



extern char *asctime (__const struct tm *__tp) ;


extern char *ctime (__const time_t *__timer) ;

# 272 "/usr/include/time.h" 3 4
extern char *__tzname[2];
extern int __daylight;
extern long int __timezone;
# 399 "/usr/include/time.h" 3 4

# 181 "chess.h" 2



  typedef enum { A1,B1,C1,D1,E1,F1,G1,H1,
                 A2,B2,C2,D2,E2,F2,G2,H2,
                 A3,B3,C3,D3,E3,F3,G3,H3,
                 A4,B4,C4,D4,E4,F4,G4,H4,
                 A5,B5,C5,D5,E5,F5,G5,H5,
                 A6,B6,C6,D6,E6,F6,G6,H6,
                 A7,B7,C7,D7,E7,F7,G7,H7,
                 A8,B8,C8,D8,E8,F8,G8,H8,
                 BAD_SQUARE } squares;

  typedef enum {FILEA, FILEB, FILEC, FILED, FILEE, FILEF, FILEG, FILEH} files;

  typedef enum {RANK1, RANK2, RANK3, RANK4, RANK5, RANK6, RANK7, RANK8} ranks;

  typedef enum {empty=0, pawn=1, knight=2, king=3,
                bishop=5, rook=6, queen=7} PIECE;

  typedef enum {empty_v=0, pawn_v=1, knight_v=2,
                bishop_v=3, rook_v=5, queen_v=9} PIECE_V;

  typedef enum {no_extension=0, check_extension=1, recapture_extension=2,
                passed_pawn_extension=4, one_reply_extension=8} EXTENSIONS;

  typedef enum {cpu, elapsed, microseconds} TIME_TYPE;

  typedef enum {think=1, puzzle=2, book=3, annotate=4} SEARCH_TYPE;

  typedef enum {normal_mode, tournament_mode} PLAYING_MODE;

  typedef enum {crafty, opponent} PLAYER;

  typedef enum {book_learning=1, position_learning=2} LEARNING_MODE;

  typedef struct {
    unsigned char enpassant_target;
    signed char w_castle;
    signed char b_castle;
    unsigned char rule_50_moves;
  } SEARCH_POSITION;

  typedef struct {
    BITBOARD w_occupied;
    BITBOARD b_occupied;
    BITBOARD occupied_rl90;
    BITBOARD occupied_rl45;
    BITBOARD occupied_rr45;
    BITBOARD rooks_queens;
    BITBOARD bishops_queens;
    BITBOARD w_pawn;
    BITBOARD w_knight;
    BITBOARD w_bishop;
    BITBOARD w_rook;
    BITBOARD w_queen;
    BITBOARD b_pawn;
    BITBOARD b_knight;
    BITBOARD b_bishop;
    BITBOARD b_rook;
    BITBOARD b_queen;
    BITBOARD hash_key;
    unsigned int pawn_hash_key;
    int material_evaluation;
    signed char white_king;
    signed char black_king;
    signed char board[64];
    signed char white_pieces;
    signed char white_pawns;
    signed char black_pieces;
    signed char black_pawns;
    signed char total_pieces;
  } CHESS_POSITION;

  typedef struct {
    BITBOARD word1;
    BITBOARD word2;
  } HASH_ENTRY;

  typedef struct {
    unsigned int key;
    short p_score;
    unsigned char black_protected;
    unsigned char black_pof;
    unsigned char weak_b;
    unsigned char passed_b;
    unsigned char black_defects_k;
    unsigned char black_defects_q;
    unsigned char white_protected;
    unsigned char white_pof;
    unsigned char weak_w;
    unsigned char passed_w;
    unsigned char white_defects_k;
    unsigned char white_defects_q;
    unsigned char outside;
  } PAWN_HASH_ENTRY;

  typedef struct {
    int path[65];
    unsigned char path_hashed;
    unsigned char path_length;
    unsigned char path_iteration_depth;
  } CHESS_PATH;

  typedef struct {
    int phase;
    int remaining;
    int *last;
  } NEXT_MOVE;

  typedef struct {
    BITBOARD position;
    BITBOARD status;
    int learn;
  } BOOK_POSITION;
# 327 "chess.h"
    BITBOARD Mask(int);
    int PopCnt(BITBOARD);
    int FirstOne(BITBOARD);
    int LastOne(BITBOARD);


  void Analyze();
  void Annotate();
  int Attacked(int, int);
  BITBOARD AttacksFrom(int, int);
  BITBOARD AttacksTo(int);
  int Book(int,int);
  int BookMask(char*);
  void BookUp(char*,int,char**);



    int BookUpCompare(const void *, const void *);

  int CheckInput(void);
  void ClearHashTables(void);
  void ComputeAttacksAndMobility(void);
  void Delay(int);
  void DisplayBitBoard(BITBOARD);
  void DisplayChessBoard(FILE*, CHESS_POSITION);
  char* DisplayEvaluation(int);
  char* DisplayEvaluationWhisper(int);
  void DisplayFT(int, int, int);
  char* DisplayHHMM(unsigned int);
  void DisplayPieceBoards(int*, int*);
  char* DisplayTime(unsigned int);
  char* DisplayTimeWhisper(unsigned int);
  void Display2BitBoards(BITBOARD, BITBOARD);
  void DisplayChessMove(char*, int);
  int DrawScore(void);
  int Drawn(int);
  void Edit(void);
  int EnPrise(int, int);
  int Evaluate(int, int, int, int);
  int EvaluateDevelopment(int);
  int EvaluateDraws();
  int EvaluateMate(void);
  int EvaluatePassedPawns(void);
  int EvaluatePassedPawnRaces(int);
  int EvaluatePawns(void);
  int* GenerateCaptures(int, int, int*);
  int* GenerateCheckEvasions(int, int, int*);
  int* GenerateNonCaptures(int, int, int*);
  unsigned int GetTime(TIME_TYPE);
  int HasOpposition(int, int, int);
  void HistoryBest(int, int, int);
  void HistoryRefutation(int, int, int);
  void Initialize(int);
  void InitializeAttackBoards(void);
  void InitializeChessBoard(SEARCH_POSITION*);
  int InitializeFindAttacks(int, int, int);
  void InitializeHashTables(void);
  void InitializeMasks(void);
  void InitializePawnMasks(void);
  void InitializePieceMasks(void);
  void InitializeRandomHash(void);
  void InitializeZeroMasks(void);
  int InputMove(char*, int, int, int, int);
  int InputMoveICS(char*, int, int, int, int);
  BITBOARD InterposeSquares(int, int, int);
  void Interrupt(int);
  int Iterate(int, int, int);
  int KingPawnSquare(int, int, int, int);
  int LookUp(int, int, int, int*, int*);
  void MakeMove(int, int, int);
  void MakeMoveRoot(int, int);
  void NewGame(int);
  int NextEvasion(int, int);
  int NextMove(int, int);
  int NextRootMove(int);
  char* Normal(void);
  int Option(void);
  int OptionMatch(char*, char*);
  void OptionPerft(int,int,int);
  char* OutputMove(int*, int, int);
  char* OutputMoveICS(int*);
  int OutputGood(char*, int, int);
  int ParseTime(char*);
  void Phase(void);
  int PinnedOnKing(int,int);
  int Ponder(int);
  void PreEvaluate(int);
  int Quiesce(int, int, int, int);
  unsigned int Random32(void);
  BITBOARD Random64(void);
  int Read(int, char*);
  int ReadChessMove(FILE*, int, int);
  void ReadClear();
  int ReadNextMove(char*, int, int);
  int ReadParse(char*, char *args[], char*);
  int SpecReadRaw();
  int RepetitionCheck(int,int);
  int RepetitionDraw(int);
  void ResignOrDraw(int,int);
  char* Reverse(void);
  void RootMoveList(int);
  int Search(int, int, int, int, int, int);
  void SearchOutput(int,int);
  int SearchRoot(int, int, int, int);
  void SearchTrace(int,int,int,int,int,char*,int);
  void SetBoard(int,char**,int);
  void SetChessBitBoards(SEARCH_POSITION*);
  void StoreBest(int,int,int,int,int);
  void StorePV(int,int);
  void StoreRefutation(int,int,int,int);
  int Swap(int, int, int);
  BITBOARD SwapXray(BITBOARD, int, int);
  void TimeAdjust(int,PLAYER);
  int TimeCheck(int);
  void TimeSet(int);
  void UnMakeMove(int, int, int);
  void ValidatePosition(int,int,char*);
  BITBOARD ValidateComputeBishopAttacks(int);
  BITBOARD ValidateComputeRookAttacks(int);
  int ValidMove(int, int, int);
  void Whisper(int, int, int, int, unsigned int, int, char*);
# 5 "main.c" 2
# 1 "initdata.h" 1
# 10 "initdata.h"
# 1 "data.c" 1



# 1 "evaluate.h" 1
# 5 "data.c" 2


  char version[6] = {"14.3"};

  PLAYING_MODE mode = normal_mode;

  int batch_mode = 0;
  int crafty_rating = 2500;
  int opponent_rating = 2500;
  char pgn_event[32] = {"Private Match"};
  char pgn_site[32] = {"Birmingham, AL"};
  char pgn_date[32] = {"????.??.??"};
  char pgn_round[32] = {"1"};
  char pgn_white[64] = {"unknown"};
  char pgn_white_elo[32] = {""};
  char pgn_black[64] = {"Crafty " "14.3"};
  char pgn_black_elo[32] = {""};
  char pgn_result[32] = {"*"};

  int number_auto_kibitzers = 8;

  char auto_kibitz_list[100][20] = {
                                      {"diepx"},
                                      {"ferret"},
                                      {"knightc"},
                                      {"knightcap"},
                                      {"nowx"},
                                      {"rajah"},
                                      {"tcb"},
                                      {"zarkovx"}};


  int number_of_computers = 80;
  char computer_list[100][20] = {
                                      {"abner"},
                                      {"aragorn"},
                                      {"babyblue"},
                                      {"ban"},
                                      {"bigblue"},
                                      {"bikerbabe"},
                                      {"bobbyfischer"},
                                      {"braincan"},
                                      {"brause"},
                                      {"carokann"},
                                      {"chameleon"},
                                      {"chesskid"},
                                      {"chesst"},
                                      {"chessica"},
                                      {"chesscomputer"},
                                      {"chinook"},
                                      {"crazyknight"},
                                      {"cstal-x"},
                                      {"deep-modem"},
                                      {"deepviolet"},
                                      {"diep"},
                                      {"diepx"},
                                      {"destroyer"},
                                      {"doctorwho"},
                                      {"dominator"},
                                      {"dustbin"},
                                      {"ego-crusher"},
                                      {"ferret"},
                                      {"fitter"},
                                      {"fritzpentium"},
                                      {"futuregm"},
                                      {"gammaray"},
                                      {"gazaboy"},
                                      {"gballa"},
                                      {"gnusurf"},
                                      {"hiarcs"},
                                      {"kerrigan"},
                                      {"knightc"},
                                      {"knightcap"},
                                      {"kingtwoft"},
                                      {"killerchess"},
                                      {"killergrob"},
                                      {"klamath"},
                                      {"lightpurple"},
                                      {"lonnie"},
                                      {"lynnett"},
                                      {"mchesspro"},
                                      {"mephistoiii"},
                                      {"netsurfer"},
                                      {"norpico"},
                                      {"nowx"},
                                      {"otter"},
                                      {"pecabale"},
                                      {"phibs"},
                                      {"rajah"},
                                      {"ratbert"},
                                      {"rdx"},
                                      {"rebel"},
                                      {"rebel8"},
                                      {"robocop"},
                                      {"roborvl"},
                                      {"selectric"},
                                      {"shredder"},
                                      {"silmaril"},
                                      {"spectronic"},
                                      {"stobor"},
                                      {"tcb"},
                                      {"theextreme"},
                                      {"tingle"},
                                      {"turbocrafty"},
                                      {"turbogm"},
                                      {"ultragnu"},
                                      {"viktor2000"},
                                      {"virtualmachine"},
                                      {"wchess"},
                                      {"wchessx"},
                                      {"wheeler"},
                                      {"whoknows"},
                                      {"zarkovx"},
                                      {"zuntsu"}};

  int number_of_GMs = 27;
  char GM_list[100][20] = {
                                      {"anat"},
                                      {"badviking"},
                                      {"devin"},
                                      {"cleaner"},
                                      {"dgurevich"},
                                      {"dlugy"},
                                      {"flamingskull"},
                                      {"gum"},
                                      {"gmsoffer"},
                                      {"junior"},
                                      {"kaidanov"},
                                      {"kc"},
                                      {"kevlar"},
                                      {"kingloek"},
                                      {"kudrin"},
                                      {"logofet"},
                                      {"lombardy"},
                                      {"mohegan"},
                                      {"pnin"},
                                      {"psakhis"},
                                      {"roman"},
                                      {"sagalchik"},
                                      {"securitron"},
                                      {"smirin"},
                                      {"stefansson"},
                                      {"silvester"},
                                      {"wbrowne"}};

  int number_of_IMs = 11;
  char IM_list[100][20] = {
                                      {"adolf"},
                                      {"badviking"},
                                      {"bandora"},
                                      {"imorlov"},
                                      {"impolzin"},
                                      {"laflair"},
                                      {"lsokol"},
                                      {"oed"},
                                      {"thutters"},
                                      {"thumpster"},
                                      {"tim"}};

  int ics = 0;
  int output_format = 0;
  int EGTBlimit = 5;
  int xboard = 0;
  int whisper = 0;
  int channel = 0;
  int early_exit = 99;
  int new_game = 0;
  char channel_title[32] = {""};
  int initialized = 0;
  int kibitz = 0;
  int post = 0;
  int log_id = 1;
  int move_number = 1;
  int wtm = 1;
  int crafty_is_white = 0;
  int last_opponent_move = 0;
  int largest_positional_score = 100;
  int search_depth = 0;
  int search_move = 0;
  TIME_TYPE time_type = elapsed;
  int nodes_between_time_checks = 10000;
  int nodes_per_second = 10000;
  int predicted = 0;

  int time_used = 0;
  int time_used_opponent = 0;
  int auto_kibitzing = 0;
  signed char transposition_id = 0;

  int opening = 1;
  int middle_game = 0;
  int end_game = 0;
  signed char thinking = 0;
  signed char pondering = 0;
  signed char puzzling = 0;
  signed char booking = 0;
  int analyze_mode = 0;
  int annotate_mode = 0;
  int test_mode = 0;
  int analyze_move_read = 0;
  signed char resign = 5;
  signed char resign_counter = 0;
  signed char resign_count = 5;
  signed char draw_counter = 0;
  signed char draw_count = 10;
  int tc_moves = 60;
  int tc_time = 180000;
  int tc_time_remaining = 180000;
  int tc_time_remaining_opponent = 180000;
  int tc_moves_remaining = 60;
  int tc_secondary_moves = 30;
  int tc_secondary_time = 90000;
  int tc_increment = 0;
  int tc_sudden_death = 0;
  int tc_operator_time = 0;
  int tc_safety_margin = 0;
  int time_limit = 100;
  int force = 0;
  char initial_position[80] = {""};
  int over = 0;
  int draw_score_is_zero = 0;
  int usage_level = 0;
  char audible_alarm = 0;
  int ansi = 1;
  int book_accept_mask = ~03;
  int book_reject_mask = 3;
  int book_random = 3;
  int book_search_trigger = 20;
  int learning = 3;
  int moves_out_of_book = 0;
  int show_book = 0;
  int book_selection_width = 5;
  int ponder = 1;
  int trace_level = 0;
  int verbosity_level = 9;
  unsigned int noise_level = 10000;

  int hash_table_size = 8192;
  int log_hash = 13;
  int pawn_hash_table_size = 4096;
  int log_pawn_hash = 12;

  int default_draw_score = (0);

  int passed_pawn_value[8] = { 0,
                                     (4)*2, (4)*3,
                                     (4)*4, (4)*6,
                                     (4)*9, (4)*12,
                                     0};

  int supported_passer[8] = { 0,
                                     (0),
                                     (0),
                                     (0),
                                     (8),
                                     (20),
                                     (40),
                                     0};

  int reduced_material_passer[20] = { 10,10,9,9,8,8,7,7,6,6,
                                             5,5,4,4,3,3,2,2,1,1};

  int outside_passed[128] = { 30, 30, 27, 27, 27, 25, 24, 23,
                                    22, 21, 20, 19, 18, 17, 16, 15,
                                    14, 13, 12, 11, 10, 9, 8, 7,
                                     6, 5, 4, 3, 2, 1, 1, 1,
                                     1, 1, 1, 1, 1, 1, 1, 1,
                                     1, 1, 1, 1, 1, 1, 1, 1,
                                     1, 1, 1, 1, 1, 1, 1, 1,
                                     1, 1, 1, 1, 1, 1, 1, 1,
                                     1, 1, 1, 1, 1, 1, 1, 1,
                                     1, 1, 1, 1, 1, 1, 1, 1,
                                     1, 1, 1, 1, 1, 1, 1, 1,
                                     1, 1, 1, 1, 1, 1, 1, 1,
                                     1, 1, 1, 1, 1, 1, 1, 1,
                                     1, 1, 1, 1, 1, 1, 1, 1,
                                     1, 1, 1, 1, 1, 1, 1, 1,
                                     1, 1, 1, 1, 1, 1, 1, 1};

  char square_color[64] = { 1, 0, 1, 0, 1, 0, 1, 0,
                                  0, 1, 0, 1, 0, 1, 0, 1,
                                  1, 0, 1, 0, 1, 0, 1, 0,
                                  0, 1, 0, 1, 0, 1, 0, 1,
                                  1, 0, 1, 0, 1, 0, 1, 0,
                                  0, 1, 0, 1, 0, 1, 0, 1,
                                  1, 0, 1, 0, 1, 0, 1, 0,
                                  0, 1, 0, 1, 0, 1, 0, 1 };

  int b_n_mate_dark_squares[64] =
                             { 20, 15, 10, 5, -5,-10,-15,-20,
                               15, 15, 10, 5, -5,-10,-15,-15,
                               10, 10, 10, 5, -5,-10,-10,-10,
                                5, 5, 5, 5, -5, -5, -5, -5,
                               -5, -5, -5, -5, 5, 5, 5, 5,
                              -10,-10,-10, -5, 5, 10, 10, 10,
                              -15,-15,-10, -5, 5, 10, 15, 15,
                              -20,-15,-10, -5, 5, 10, 15, 20};

  int b_n_mate_light_squares[64] =
                             {-20,-15,-10, -5, 5, 10, 15, 20,
                              -15,-15,-10, -5, 5, 10, 15, 15,
                              -10,-10,-10, -5, 5, 10, 10, 10,
                               -5, -5, -5, -5, 5, 5, 5, 5,
                                5, 5, 5, 5, -5, -5, -5, -5,
                               10, 10, 10, 5, -5,-10,-10,-10,
                               15, 15, 10, 5, -5,-10,-15,-15,
                               20, 15, 10, 5, -5,-10,-15,-20};

  int mate[64] = {28, 26, 24, 22, 22, 24, 26, 28,
                               26, 16, 14, 12, 12, 14, 16, 26,
                               24, 14, 4, 2, 2, 4, 14, 24,
                               22, 12, 2, 0, 0, 2, 12, 22,
                               22, 12, 2, 0, 0, 2, 12, 22,
                               24, 14, 4, 2, 2, 4, 14, 24,
                               26, 16, 14, 12, 12, 14, 16, 26,
                               28, 26, 24, 22, 22, 24, 26, 28};

  char white_outpost[64] = { 0, 0, 0, 0, 0, 0, 0, 0,
                                        0, 0, 0, 0, 0, 0, 0, 0,
                                        0, 0, 0, 0, 0, 0, 0, 0,
                                        0, 0, 0, 2, 2, 0, 0, 0,
                                        0, 0, 4, 5, 5, 4, 0, 0,
                                        0, 0, 3, 6, 6, 3, 0, 0,
                                        0, 0, 0, 1, 1, 0, 0, 0,
                                        0, 0, 0, 0, 0, 0, 0, 0 };

  char black_outpost[64] = { 0, 0, 0, 0, 0, 0, 0, 0,
                                        0, 0, 0, 1, 1, 0, 0, 0,
                                        0, 0, 3, 6, 6, 3, 0, 0,
                                        0, 0, 4, 5, 5, 4, 0, 0,
                                        0, 0, 0, 2, 2, 0, 0, 0,
                                        0, 0, 0, 0, 0, 0, 0, 0,
                                        0, 0, 0, 0, 0, 0, 0, 0,
                                        0, 0, 0, 0, 0, 0, 0, 0 };

  char push_extensions[64] = { 0, 0, 0, 0, 0, 0, 0, 0,
                                         1, 1, 1, 1, 1, 1, 1, 1,
                                         0, 0, 0, 0, 0, 0, 0, 0,
                                         0, 0, 0, 0, 0, 0, 0, 0,
                                         0, 0, 0, 0, 0, 0, 0, 0,
                                         0, 0, 0, 0, 0, 0, 0, 0,
                                         1, 1, 1, 1, 1, 1, 1, 1,
                                         0, 0, 0, 0, 0, 0, 0, 0 };

  int pawn_value_b[64] = { 0, 0, 0, 0, 0, 0, 0, 0,
                              0, 0, 0, 0, 0, 0, 0, 0,
                              0, 0, 3, 3, 3, 3, 0, 0,
                              0, 0, 3, 3, 3, 3, 0, 0,
                              0, 0, 0, 3, 3, 0, 0, 0,
                              0, 0, 0, 0, 0, 0, 0, 0,
                              0, 0, 0, 0, 0, 0, 0, 0,
                              0, 0, 0, 0, 0, 0, 0, 0};

  int pawn_value_w[64] = { 0, 0, 0, 0, 0, 0, 0, 0,
                              0, 0, 0, 0, 0, 0, 0, 0,
                              0, 0, 0, 0, 0, 0, 0, 0,
                              0, 0, 0, 3, 3, 0, 0, 0,
                              0, 0, 3, 3, 3, 3, 0, 0,
                              0, 0, 3, 3, 3, 3, 0, 0,
                              0, 0, 0, 0, 0, 0, 0, 0,
                              0, 0, 0, 0, 0, 0, 0, 0};

  int knight_value_w[64] = { -9, -3, -3, -2, -2, -3, -3, -9,
                              -5, -3, -1, 0, 0, -1, -3, -5,
                              -6, 0, 1, 1, 1, 1, 0, -6,
                              -5, 0, 1, 2, 2, 1, 0, -5,
                              -5, 0, 1, 2, 2, 1, 0, -5,
                              -5, 0, 1, 1, 1, 1, 0, -5,
                              -5, 0, 0, 0, 0, 0, 0, -5,
                             -10, -5, -5, -5, -5, -5, -5, -10};

  int knight_value_b[64] ={ -10, -5, -5, -5, -5, -5, -5, -10,
                              -5, 0, 0, 0, 0, 0, 0, -5,
                              -5, 0, 1, 1, 1, 1, 0, -5,
                              -5, 0, 1, 2, 2, 1, 0, -5,
                              -5, 0, 1, 2, 2, 1, 0, -5,
                              -6, 0, 1, 1, 1, 1, 0, -6,
                              -5, -3, -1, 0, 0, -1, -3, -5,
                              -9, -3, -3, -2, -2, -3, -3, -9};

  int bishop_value_w[64] = { -3, -3, -3, -3, -3, -3, -3, -3,
                              -3, 0, 0, 0, 0, 0, 0, -3,
                              -3, 0, 2, 2, 2, 2, 0, -2,
                              -3, 0, 2, 3, 3, 2, 0, -3,
                              -3, 0, 2, 3, 3, 2, 0, -3,
                              -3, 0, 2, 2, 2, 2, 0, -3,
                              -3, 0, 0, 0, 0, 0, 0, -3,
                              -3, -3, -3, -3, -3, -3, -3, -3};

  int bishop_value_b[64] = { -3, -3, -3, -3, -3, -3, -3, -3,
                              -3, 0, 0, 0, 0, 0, 0, -3,
                              -3, 0, 2, 2, 2, 2, 0, -3,
                              -3, 0, 2, 3, 3, 2, 0, -3,
                              -3, 0, 2, 3, 3, 2, 0, -3,
                              -3, 0, 2, 2, 2, 2, 0, -3,
                              -3, 0, 0, 0, 0, 0, 0, -3,
                              -3, -3, -3, -3, -3, -3, -3, -3};

  int rook_value_w[64] = { 0, 2, 3, 4, 4, 3, 2, 0,
                              -4, 2, 3, 4, 4, 3, 2, -4,
                              -4, 2, 3, 4, 4, 3, 2, -4,
                              -4, 2, 3, 4, 4, 3, 2, -4,
                               0, 2, 3, 4, 4, 3, 2, 0,
                               0, 2, 3, 4, 4, 3, 2, 0,
                               0, 2, 3, 4, 4, 3, 2, 0,
                               0, 2, 3, 4, 4, 3, 2, 0};

  int rook_value_b[64] = { 0, 2, 3, 4, 4, 3, 2, 0,
                               0, 2, 3, 4, 4, 3, 2, 0,
                               0, 2, 3, 4, 4, 3, 2, 0,
                               0, 2, 3, 4, 4, 3, 2, 0,
                              -4, 2, 3, 4, 4, 3, 2, -4,
                              -4, 2, 3, 4, 4, 3, 2, -4,
                              -4, 2, 3, 4, 4, 3, 2, -4,
                               0, 2, 3, 4, 4, 3, 2, 0};

  int queen_value_w[64] = { 0, 0, 0, 0, 0, 0, 0, 0,
                               0, 2, 2, 2, 2, 2, 2, 0,
                               0, 2, 4, 5, 5, 4, 2, 0,
                               0, 2, 4, 6, 6, 4, 2, 0,
                               0, 2, 4, 6, 6, 4, 2, 0,
                               0, 2, 4, 6, 6, 4, 2, 0,
                               0, 2, 4, 5, 5, 4, 2, 0,
                               0, 0, 0, 0, 0, 0, 0, 0};

  int queen_value_b[64] = { 0, 0, 0, 0, 0, 0, 0, 0,
                               0, 2, 4, 5, 5, 4, 2, 0,
                               0, 2, 4, 6, 6, 4, 2, 0,
                               0, 2, 4, 6, 6, 4, 2, 0,
                               0, 2, 4, 6, 6, 4, 2, 0,
                               0, 2, 4, 5, 5, 4, 2, 0,
                               0, 2, 2, 2, 2, 2, 2, 0,
                               0, 0, 0, 0, 0, 0, 0, 0};

  int king_value_w[64] = { -3, 0, 0, 0, 0, 0, 0, -3,
                               0, 0, 3, 3, 3, 3, 0, 0,
                               0, 3, 3, 5, 5, 3, 3, 0,
                               0, 3, 5, 8, 8, 5, 3, 0,
                               0, 3, 5, 8, 8, 5, 3, 0,
                               0, 3, 3, 5, 5, 3, 3, 0,
                               0, 0, 3, 3, 3, 3, 0, 0,
                              -3, 0, 0, 0, 0, 0, 0, -3};

  int king_value_b[64] = { -3, 0, 0, 0, 0, 0, 0, -3,
                               0, 0, 3, 3, 3, 3, 0, 0,
                               0, 3, 3, 5, 5, 3, 3, 0,
                               0, 3, 5, 8, 8, 5, 3, 0,
                               0, 3, 5, 8, 8, 5, 3, 0,
                               0, 3, 3, 5, 5, 3, 3, 0,
                               0, 0, 3, 3, 3, 3, 0, 0,
                              -3, 0, 0, 0, 0, 0, 0, -3};

   char king_defects_w[64]= { 4, 3, 2, 3, 3, 1, 1, 2,
                              4, 3, 3, 7, 7, 3, 2, 2,
                              6, 4, 6, 7, 7, 6, 4, 6,
                              8, 5, 6, 8, 8, 6, 5, 8,
                              8, 5, 6, 8, 8, 6, 5, 8,
                              8, 5, 6, 8, 8, 6, 5, 8,
                              8, 5, 6, 8, 8, 6, 5, 8,
                              8, 5, 6, 8, 8, 6, 5, 8};

   char king_defects_b[64]= { 8, 5, 6, 8, 8, 6, 5, 8,
                              8, 5, 6, 8, 8, 6, 5, 8,
                              8, 5, 6, 8, 8, 6, 5, 8,
                              8, 5, 6, 8, 8, 6, 5, 8,
                              8, 5, 6, 8, 8, 6, 5, 8,
                              6, 4, 6, 7, 7, 6, 4, 6,
                              4, 3, 3, 7, 7, 3, 2, 2,
                              4, 3, 2, 3, 3, 1, 1, 2};

  int p_values[15] = {980,520,330,0,
                                  40000,330,100,
                                  0,100,330,40000,
                                  0, 330,520,980};

  int unblocked_pawns[9] = {-(4)*2,0,(4),
                                   (4)*2, (4)*3,
                                   (4)*4, (4)*5,
                                   (4)*6, (4)*7};

  int bishop_shift_rl45[64] = { 63, 61, 58, 54, 49, 43, 36, 28,
                                           61, 58, 54, 49, 43, 36, 28, 21,
                                           58, 54, 49, 43, 36, 28, 21, 15,
                                           54, 49, 43, 36, 28, 21, 15, 10,
                                           49, 43, 36, 28, 21, 15, 10, 6,
                                           43, 36, 28, 21, 15, 10, 6, 3,
                                           36, 28, 21, 15, 10, 6, 3, 1,
                                           28, 21, 15, 10, 6, 3, 1, 0 };

  int bishop_shift_rr45[64] = { 28, 36, 43, 49, 54, 58, 61, 63,
                                           21, 28, 36, 43, 49, 54, 58, 61,
                                           15, 21, 28, 36, 43, 49, 54, 58,
                                           10, 15, 21, 28, 36, 43, 49, 54,
                                            6, 10, 15, 21, 28, 36, 43, 49,
                                            3, 6, 10, 15, 21, 28, 36, 43,
                                            1, 3, 6, 10, 15, 21, 28, 36,
                                            0, 1, 3, 6, 10, 15, 21, 28 };
# 11 "initdata.h" 2





   extern char version[6];
# 29 "initdata.h"
   int total_moves;







   FILE *input_stream;
   FILE *book_file;
   FILE *books_file;
   FILE *history_file;
   FILE *log_file;
   FILE *auto_file;
   FILE *book_lrn_file;
   FILE *position_file;
   FILE *position_lrn_file;



   char whisper_text[500];
   int whisper_value;
   int whisper_depth;
   int last_mate_score;
# 64 "initdata.h"
   char log_filename[64];
   char history_filename[64];

   int number_of_solutions;
   int solutions[10];
   int solution_type;



   int auto232;
   int auto232_delay;




   char book_path[128];
   char log_path[128];
   char tb_path[128];
   char cmd_buffer[512];
   char *args[32];
   char buffer[512];
   int nargs;




   int iteration_depth;
   int last_search_value;
   int previous_search_value;
   int search_failed_high;
   int search_failed_low;

   int root_alpha;
   int root_beta;
   int root_value;
   int root_wtm;
   int root_move;
   int root_total_white_pieces;
   int root_total_white_pawns;
   int root_total_black_pieces;
   int root_total_black_pawns;

   int cpu_percent;

   int tb_probes;
   int tb_probes_successful;
# 124 "initdata.h"
   char hint[16];



   int easy_move;


   int absolute_time_limit;
   int search_time_limit;

   int next_time_check;

   int time_abort;
# 145 "initdata.h"
   signed char abort_search;

   int ponder_move;
   int made_predicted_move;

   int ponder_moves[220];
   int num_ponder_moves;


   unsigned int opponent_start_time, opponent_end_time;
   unsigned int program_start_time, program_end_time;
   unsigned int start_time, end_time;
   unsigned int elapsed_start, elapsed_end;
   unsigned int nodes_searched;
   unsigned int evaluations;


   int transposition_probes;
   int transposition_hits;
   int pawn_probes;
   int pawn_hits;
   int check_extensions_done;
   int recapture_extensions_done;
   int passed_pawn_extensions_done;
   int one_reply_extensions_done;




   int burp;


   int book_move;
# 201 "initdata.h"
   int log_hash;


   int pawn_hash_table_size;

   int hash_maska;
   int hash_maskb;
   unsigned int pawn_hash_mask;
   HASH_ENTRY *trans_ref_wa;
   HASH_ENTRY *trans_ref_wb;
   HASH_ENTRY *trans_ref_ba;
   HASH_ENTRY *trans_ref_bb;
   PAWN_HASH_ENTRY *pawn_hash_table;

   int hash_move[65];
   int history_w[4096], history_b[4096];
   int killer_move1[65];
   int killer_move2[65];
   int killer_count1[65];
   int killer_count2[65];
   BITBOARD replist_w[50+65/2];
   BITBOARD replist_b[50+65/2];
   BITBOARD *rephead_w;
   BITBOARD *rephead_b;

   int unblocked_pawns[9];
   int p_values[15];
   int current_move[65];
   int *last[65];
   signed char in_check[65];
   signed char extended_reason[65];
   signed char current_phase[65];
   int move_list[5120];
   int sort_value[256];
   signed char searched_this_root_move[256];
   unsigned int root_nodes[256];
   CHESS_PATH pv[65];
   CHESS_PATH last_pv;
   int last_value;
   NEXT_MOVE next_status[65];
   SEARCH_POSITION position[65 +2];
   BITBOARD save_hash_key[65 +2];
   unsigned int save_pawn_hash_key[65 +2];

   char white_outpost[64];
   char black_outpost[64];
   char square_color[64];
   int passed_pawn_value[8];
   int supported_passer[8];
   int reduced_material_passer[20];
   int pawn_advance[8];
   int outside_passed[128];
   int pawn_value_w[64];
   int pawn_value_b[64];
   int knight_value_w[64];
   int knight_value_b[64];
   int bishop_value_w[64];
   int bishop_value_b[64];
   int rook_value_w[64];
   int rook_value_b[64];
   int queen_value_w[64];
   int queen_value_b[64];
   int king_value_w[64];
   int king_value_b[64];
   char king_defects_w[64];
   char king_defects_b[64];

   int b_n_mate_dark_squares[64];
   int b_n_mate_light_squares[64];
   int mate[64];

   char push_extensions[64];

   signed char directions[64][64];
   BITBOARD w_pawn_attacks[64];
   BITBOARD b_pawn_attacks[64];
   BITBOARD knight_attacks[64];
   BITBOARD bishop_attacks[64];
   BITBOARD bishop_attacks_rl45[64][256];
   BITBOARD bishop_attacks_rr45[64][256];
   int bishop_mobility_rl45[64][256];
   int bishop_mobility_rr45[64][256];
   int bishop_shift_rl45[64];
   int bishop_shift_rr45[64];
   BITBOARD rook_attacks[64];
   BITBOARD rook_attacks_r0[64][256];
   BITBOARD rook_attacks_rl90[64][256];
   int rook_mobility_r0[64][256];
   int rook_mobility_rl90[64][256];

   CHESS_POSITION search;
   CHESS_POSITION display;

   BITBOARD queen_attacks[64];
   BITBOARD king_attacks[64];
   BITBOARD king_attacks_1[64];
   BITBOARD king_attacks_2[64];
   BITBOARD obstructed[64][64];

   unsigned int w_pawn_random32[64];
   unsigned int b_pawn_random32[64];
   BITBOARD w_pawn_random[64];
   BITBOARD b_pawn_random[64];
   BITBOARD w_knight_random[64];
   BITBOARD b_knight_random[64];
   BITBOARD w_bishop_random[64];
   BITBOARD b_bishop_random[64];
   BITBOARD w_rook_random[64];
   BITBOARD b_rook_random[64];
   BITBOARD w_queen_random[64];
   BITBOARD b_queen_random[64];
   BITBOARD w_king_random[64];
   BITBOARD b_king_random[64];
   BITBOARD enpassant_random[65];
   BITBOARD castle_random_w[2];
   BITBOARD castle_random_b[2];
   BITBOARD wtm_random[2];
   BITBOARD endgame_random_w;
   BITBOARD endgame_random_b;
   BITBOARD w_rooks_random;
   BITBOARD b_rooks_random;

   BITBOARD clear_mask[65];
   BITBOARD clear_mask_rl45[65];
   BITBOARD clear_mask_rr45[65];
   BITBOARD clear_mask_rl90[65];
   BITBOARD set_mask[65];
   BITBOARD set_mask_rl45[65];
   BITBOARD set_mask_rr45[65];
   BITBOARD set_mask_rl90[65];
   BITBOARD file_mask[8];
   BITBOARD rank_mask[8];
   BITBOARD mask_not_rank8;
   BITBOARD mask_not_rank1;
   BITBOARD right_side_mask[8];
   BITBOARD left_side_mask[8];
   BITBOARD right_side_empty_mask[8];
   BITBOARD left_side_empty_mask[8];
   BITBOARD right_half_mask, left_half_mask;
   BITBOARD mask_abs7_w, mask_abs7_b;
   BITBOARD pawns_cramp_black;
   BITBOARD pawns_cramp_white;
   BITBOARD mask_advance_2_w;
   BITBOARD mask_advance_2_b;
   BITBOARD mask_left_edge;
   BITBOARD mask_right_edge;
   BITBOARD mask_corner_squares;
   BITBOARD promote_mask_w;
   BITBOARD promote_mask_b;
   BITBOARD mask_G2G3;
   BITBOARD mask_B2B3;
   BITBOARD mask_G6G7;
   BITBOARD mask_B6B7;
   BITBOARD mask_F3H3;
   BITBOARD mask_F6H6;
   BITBOARD mask_A3C3;
   BITBOARD mask_A6C6;
   BITBOARD mask_A7H7;
   BITBOARD mask_A2H2;
   BITBOARD center;

   BITBOARD stonewall_white;
   BITBOARD stonewall_black;

   BITBOARD mask_kr_trapped_w[3];
   BITBOARD mask_qr_trapped_w[3];
   BITBOARD mask_kr_trapped_b[3];
   BITBOARD mask_qr_trapped_b[3];

   BITBOARD good_bishop_kw;
   BITBOARD good_bishop_qw;
   BITBOARD good_bishop_kb;
   BITBOARD good_bishop_qb;

   BITBOARD light_squares;
   BITBOARD dark_squares;
   BITBOARD not_rook_pawns;

   BITBOARD plus1dir[65];
   BITBOARD plus7dir[65];
   BITBOARD plus8dir[65];
   BITBOARD plus9dir[65];
   BITBOARD minus1dir[65];
   BITBOARD minus7dir[65];
   BITBOARD minus8dir[65];
   BITBOARD minus9dir[65];

   BITBOARD mask_eptest[64];

     BITBOARD mask_1;
     BITBOARD mask_2;
     BITBOARD mask_3;
     BITBOARD mask_4;
     BITBOARD mask_8;
     BITBOARD mask_16;
     BITBOARD mask_32;
     BITBOARD mask_72;
     BITBOARD mask_80;
     BITBOARD mask_85;
     BITBOARD mask_96;
     BITBOARD mask_107;
     BITBOARD mask_108;
     BITBOARD mask_112;
     BITBOARD mask_118;
     BITBOARD mask_120;
     BITBOARD mask_121;
     BITBOARD mask_127;

   BITBOARD mask_clear_entry;

     unsigned char first_ones[65536];
     unsigned char last_ones[65536];

   unsigned char first_ones_8bit[256];
   unsigned char last_ones_8bit[256];
   unsigned char connected_passed[256];

   BITBOARD mask_kingside_attack_w1;
   BITBOARD mask_kingside_attack_w2;
   BITBOARD mask_kingside_attack_b1;
   BITBOARD mask_kingside_attack_b2;
   BITBOARD mask_queenside_attack_w1;
   BITBOARD mask_queenside_attack_w2;
   BITBOARD mask_queenside_attack_b1;
   BITBOARD mask_queenside_attack_b2;

   BITBOARD mask_pawn_protected_b[64];
   BITBOARD mask_pawn_protected_w[64];
   BITBOARD mask_pawn_isolated[64];
   BITBOARD mask_pawn_passed_w[64];
   BITBOARD mask_pawn_passed_b[64];
   BITBOARD mask_promotion_threat_w[64];
   BITBOARD mask_promotion_threat_b[64];
   BITBOARD mask_pawn_connected[64];
   BITBOARD mask_no_pawn_attacks_w[64];
   BITBOARD mask_no_pawn_attacks_b[64];
   BITBOARD mask_a1_corner;
   BITBOARD mask_a8_corner;
   BITBOARD mask_h1_corner;
   BITBOARD mask_h8_corner;
   BITBOARD white_minor_pieces;
   BITBOARD black_minor_pieces;
   BITBOARD white_center_pawns;
   BITBOARD black_center_pawns;
   BITBOARD white_pawn_race_wtm[64];
   BITBOARD white_pawn_race_btm[64];
   BITBOARD black_pawn_race_wtm[64];
   BITBOARD black_pawn_race_btm[64];

   BITBOARD mask_wk_4th, mask_wq_4th, mask_bk_4th, mask_bq_4th;
   BITBOARD mask_wk_5th, mask_wq_5th, mask_bk_5th, mask_bq_5th;
# 6 "main.c" 2





# 1 "/usr/include/signal.h" 1 3 4
# 31 "/usr/include/signal.h" 3 4


# 1 "/usr/include/bits/sigset.h" 1 3 4
# 23 "/usr/include/bits/sigset.h" 3 4
typedef int __sig_atomic_t;




typedef struct
  {
    unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
  } __sigset_t;
# 103 "/usr/include/bits/sigset.h" 3 4
extern int __sigismember (__const __sigset_t *, int);
extern int __sigaddset (__sigset_t *, int);
extern int __sigdelset (__sigset_t *, int);
# 34 "/usr/include/signal.h" 2 3 4







typedef __sig_atomic_t sig_atomic_t;

# 58 "/usr/include/signal.h" 3 4
# 1 "/usr/include/bits/signum.h" 1 3 4
# 59 "/usr/include/signal.h" 2 3 4
# 73 "/usr/include/signal.h" 3 4
typedef void (*__sighandler_t) (int);




extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
     ;
# 88 "/usr/include/signal.h" 3 4






extern __sighandler_t signal (int __sig, __sighandler_t __handler) __asm__ ("" "__sysv_signal");








# 124 "/usr/include/signal.h" 3 4


extern int raise (int __sig) ;

# 146 "/usr/include/signal.h" 3 4
extern int __sigpause (int __sig_or_mask, int __is_sig) ;
# 373 "/usr/include/signal.h" 3 4
extern int __libc_current_sigrtmin (void) ;

extern int __libc_current_sigrtmax (void) ;




# 12 "main.c" 2
# 1881 "main.c"
int main(int argc, char **argv)
{
  int move, presult, readstat;
  int value=0, i, cont=0, result;
  char *targs[32];



  extern void SignalInterrupt(int);
# 1904 "main.c"
  input_stream=stdin;
  for (i=0;i<32;i++) args[i]=malloc(128);
  if (argc > 1) {
    for (i=0;i<32;i++) targs[i]=malloc(128);
    for (i=1;i<argc;i++) {
      if (!strcmp(argv[i],"c")) cont=1;
      else if (argv[i][0]>='0' && argv[i][0] <= '9' && i+1<argc) {
        tc_moves=atoi(argv[i]);
        tc_time=atoi(argv[i+1]);
        tc_increment=0;
        tc_secondary_moves=tc_moves;
        tc_secondary_time=tc_time;
        tc_time*=60;
        tc_time_remaining=tc_time;
        tc_secondary_time*=60;
        i++;
      }
      else if (strstr(argv[i],"path")) {
        strcpy(buffer,argv[i]);
        result=Option();
        if (result == 0)
          printf("ERROR \"%s\" is unknown command-line option\n",buffer);
        display=search;
      }
    }
  }
# 1939 "main.c"
  if (cont) Initialize(1);
  else Initialize(0);
  printf("\nCrafty v%s\n\n",version);
# 1951 "main.c"
  if (argc > 1) {
    for (i=1;i<argc;i++) if (strcmp(argv[i],"c"))
      if ((argv[i][0]<'0' || argv[i][0] > '9') &&
          !strstr(argv[i],"path")) {
        strcpy(buffer,argv[i]);
        result=Option();
        if (result == 0)
          printf("ERROR \"%s\" is unknown command-line option\n",buffer);
      }
    for (i=0;i<32;i++) free(targs[i]);
  }
  display=search;
  initialized=1;
# 2022 "main.c"
  while (1) {
    presult=0;
    do {
      if (new_game) NewGame(0);
      opponent_start_time=GetTime(elapsed);
      made_predicted_move=0;
      display=search;
      move=0;
      presult=0;
      do {
        if (presult != 2) presult=0;
        result=0;
        display=search;
        if (presult !=2 && (move_number!=1 || !wtm)) presult=Ponder(wtm);
        if (presult==0 || presult==2) {
          if (!ics && !xboard) {
            if (wtm) printf("White(%d): ",move_number);
            else printf("Black(%d): ",move_number);
            fflush(stdout);
          }
          readstat=Read(1,buffer);
          if (log_file) {
            if (wtm) fprintf(log_file,"White(%d): %s\n",move_number,buffer);
            else fprintf(log_file,"Black(%d): %s\n",move_number,buffer);
          }
          if (readstat<0 && input_stream==stdin) {
            strcpy(buffer,"end");
            (void) Option();
          }
        }
        if (presult == 1) break;
        opponent_end_time=GetTime(elapsed);
        result=Option();
        if (result == 0) {
          nargs=ReadParse(buffer,args," 	;");
          move=InputMove(args[0],0,wtm,0,0);
          last_opponent_move=move;
          if (auto232 && presult!=3) {
            char *mv=OutputMoveICS(&move);
            Delay(auto232_delay);
            if (!wtm) fprintf(auto_file,"\t");
            fprintf(auto_file, " %c%c-%c%c", mv[0], mv[1], mv[2], mv[3]);
            if ((mv[4] != ' ') && (mv[4] != 0))
            fprintf(auto_file, "/%c", mv[4]);
            fprintf(auto_file, "\n");
            fflush(auto_file);
          }
          result=!move;
        }
        else if (result == 3) presult=0;
      } while (result > 0);
      if (presult == 1) move=ponder_move;
# 2082 "main.c"
      if(result == 0) {
        fseek(history_file,((move_number-1)*2+1-wtm)*10,0);
        fprintf(history_file,"%9s\n",OutputMove(&move,0,wtm));
        MakeMoveRoot(move,wtm);
        if (RepetitionDraw(((wtm)^1))==1) {
          printf("%sgame is a draw by repetition.%s\n",Reverse(),Normal());
          value=DrawScore();
          if (xboard) printf("Draw\n");
        }
        if (RepetitionDraw(((wtm)^1))==2) {
          printf("%sgame is a draw by the 50 move rule.%s\n",Reverse(),Normal());
          value=DrawScore();
        }
        wtm=((wtm)^1);
        if (wtm) move_number++;
        time_used_opponent=opponent_end_time-opponent_start_time;
        if (!force)
          printf("              time used: %s\n",
                DisplayTime(time_used_opponent));
        TimeAdjust(time_used_opponent,opponent);
      }
      else {
        position[1]=position[0];
        presult=0;
      }
      ValidatePosition(0,move,"Main(1)");
    } while(force);
# 2118 "main.c"
    crafty_is_white=wtm;
    if (presult == 2) {
      if((((ponder_move)&63) == ((move)&63)) &&
         ((((ponder_move)>>6)&63) == (((move)>>6)&63)) &&
         ((((ponder_move)>>12)&7) == (((move)>>12)&7)) &&
         ((((ponder_move)>>15)&7) == (((move)>>15)&7)) &&
         ((((ponder_move)>>18)&7) == (((move)>>18)&7))) {
        presult=1;
        if (!book_move) predicted++;
      }
      else presult=0;
    }
    ponder_move=0;
    thinking=1;
    if (presult == 1) value=last_search_value;
    else {
      strcpy(whisper_text,"n/a");
      last_pv.path_iteration_depth=0;
      last_pv.path_length=0;
      display=search;
      value=Iterate(wtm,think,0);
    }
# 2148 "main.c"
    last_pv=pv[0];
    last_value=value;
    if (abs(last_value) > (32768 -100)) last_mate_score=last_value;
    thinking=0;
    if (!last_pv.path_length) {
      if (value == -32768 +1) {
        over=1;
        printf("%s",Reverse());
        printf("checkmate\n");
        printf("%s",Normal());
        if (xboard)
          if(wtm) printf("Black mates\n");
          else printf("White mates\n");
      }
    }
    else {
      if ((value > 32768 -100) && (value < 32768 -2)) {
        printf("\nCrafty will mate in %d moves.\n\n",(32768 -value)/2);
        Whisper(1,0,0,(32768 -value)/2,nodes_searched,0," ");
      }
      else if ((-value > 32768 -100) && (-value < 32768 -1)) {
        printf("\nmated in %d moves.\n\n",(32768 +value)/2);
        Whisper(1,0,0,-(32768 +value)/2,nodes_searched,0," ");
      }
      if (wtm) {
        if (!xboard && !ics) {
          printf("\n");
          printf("%s",Reverse());
          if (audible_alarm) printf("%c",audible_alarm);
          printf("White(%d): %s ",move_number,
                OutputMove(&last_pv.path[1],0,wtm));
          printf("%s",Normal());
          printf("\n");
          if (auto232) {
            char *mv=OutputMoveICS(&last_pv.path[1]);
            Delay(auto232_delay);
            fprintf(auto_file, " %c%c-%c%c", mv[0],mv[1],mv[2],mv[3]);
            if ((mv[4]!=' ') && (mv[4]!=0))
              fprintf(auto_file, "/%c", mv[4]);
            fprintf(auto_file, "\n");
            fflush(auto_file);
          }
        }
        else if (xboard) {
          if (log_file) fprintf(log_file,"White(%d): %s\n",move_number,
                                OutputMove(&last_pv.path[1],0,wtm));
          printf("%d. ... %s\n",move_number,OutputMoveICS(&last_pv.path[1]));
        }
        else printf("*%s\n",OutputMove(&last_pv.path[1],0,wtm));
      }
      else {
        if (!xboard && !ics) {
          printf("\n");
          printf("%s",Reverse());
          if (audible_alarm) printf("%c",audible_alarm);
          printf("Black(%d): %s ",move_number,OutputMove(&last_pv.path[1],0,wtm));
          printf("%s",Normal());
          printf("\n");
          if (auto232) {
            char *mv=OutputMoveICS(&last_pv.path[1]);
            Delay(auto232_delay);
            fprintf(auto_file, "\t %c%c-%c%c", mv[0],mv[1],mv[2],mv[3]);
            if ((mv[4]!=' ') && (mv[4]!=0))
              fprintf(auto_file, "/%c", mv[4]);
            fprintf(auto_file, "\n");
            fflush(auto_file);
          }
        }
        else {
          if (log_file) fprintf(log_file,"Black(%d): %s\n",move_number,
                                OutputMove(&last_pv.path[1],0,wtm));
          printf("%d. ... %s\n",move_number,OutputMoveICS(&last_pv.path[1]));
        }
      }
      if (value == 32768 -2) {
        printf("checkmate\n");
        if (xboard)
          if(wtm) printf("White mates\n");
          else printf("Black mates\n");
      }
      time_used=program_end_time-program_start_time;
      printf("              time used: %s\n",DisplayTime(time_used));
      TimeAdjust(time_used,crafty);
      fseek(history_file,((move_number-1)*2+1-wtm)*10,0);
      fprintf(history_file,"%9s\n",OutputMove(&last_pv.path[1],0,wtm));
      previous_search_value=last_search_value;
      MakeMoveRoot(last_pv.path[1],wtm);
      if (RepetitionDraw(((wtm)^1))==1) {
        printf("%sgame is a draw by repetition.%s\n",Reverse(),Normal());
        value=DrawScore();
      }
      if (RepetitionDraw(((wtm)^1))==2) {
        printf("%sgame is a draw by the 50 move rule.%s\n",Reverse(),Normal());
        value=DrawScore();
      }
      if (log_file && time_limit > 500) DisplayChessBoard(log_file,search);
# 2254 "main.c"
      if (last_pv.path_length>1 &&
          ValidMove(0,((wtm)^1),last_pv.path[2])) {
        ponder_move=last_pv.path[2];
        for (i=1;i<=(int) last_pv.path_length-2;i++)
          last_pv.path[i]=last_pv.path[i+2];
        last_pv.path_length=(last_pv.path_length > 2) ? last_pv.path_length-2 : 0;
        last_pv.path_iteration_depth-=2;
        if (last_pv.path_iteration_depth > last_pv.path_length)
          last_pv.path_iteration_depth=last_pv.path_length;
        if (last_pv.path_length == 0) last_pv.path_iteration_depth=0;
      }
      else {
        last_pv.path_iteration_depth=0;
        last_pv.path_length=0;
        ponder_move=0;
      }
    }
    if (book_move) {
      moves_out_of_book=0;
      predicted++;
    }
    else moves_out_of_book++;
    wtm=((wtm)^1);
    if (wtm) move_number++;
    ValidatePosition(0,last_pv.path[1],"Main(2)");
    if (kibitz || whisper) {
      if (nodes_searched)
        Whisper(2,whisper_depth,end_time-start_time,whisper_value,
                nodes_searched,cpu_percent,whisper_text);
    }
    for (i=0;i<4096;i++) {
      history_w[i]=history_w[i]>>8;
      history_b[i]=history_b[i]>>8;
    }
    for (i=0;i<65;i++) {
      killer_count1[i]=0;
      killer_count2[i]=0;
    }
    if (mode == tournament_mode) {
      strcpy(buffer,"clock");
      Option();
      printf("if clocks are wrong, use 'clock' command to adjust them\n");
    }
  }
  return 0;
}
