6 # 1 "/usr/include/stdio.h" 1 3 4
7 # 28 "/usr/include/stdio.h" 3 4
8 # 1 "/usr/include/features.h" 1 3 4
9 # 347 "/usr/include/features.h" 3 4
10 # 1 "/usr/include/sys/cdefs.h" 1 3 4
11 # 353 "/usr/include/sys/cdefs.h" 3 4
12 # 1 "/usr/include/bits/wordsize.h" 1 3 4
13 # 354 "/usr/include/sys/cdefs.h" 2 3 4
14 # 348 "/usr/include/features.h" 2 3 4
15 # 371 "/usr/include/features.h" 3 4
16 # 1 "/usr/include/gnu/stubs.h" 1 3 4
20 # 1 "/usr/include/bits/wordsize.h" 1 3 4
21 # 5 "/usr/include/gnu/stubs.h" 2 3 4
24 # 1 "/usr/include/gnu/stubs-32.h" 1 3 4
25 # 8 "/usr/include/gnu/stubs.h" 2 3 4
26 # 372 "/usr/include/features.h" 2 3 4
27 # 29 "/usr/include/stdio.h" 2 3 4
33 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/include/stddef.h" 1 3 4
34 # 211 "/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/include/stddef.h" 3 4
35 typedef unsigned int size_t;
36 # 35 "/usr/include/stdio.h" 2 3 4
38 # 1 "/usr/include/bits/types.h" 1 3 4
39 # 28 "/usr/include/bits/types.h" 3 4
40 # 1 "/usr/include/bits/wordsize.h" 1 3 4
41 # 29 "/usr/include/bits/types.h" 2 3 4
44 typedef unsigned char __u_char;
45 typedef unsigned short int __u_short;
46 typedef unsigned int __u_int;
47 typedef unsigned long int __u_long;
50 typedef signed char __int8_t;
51 typedef unsigned char __uint8_t;
52 typedef signed short int __int16_t;
53 typedef unsigned short int __uint16_t;
54 typedef signed int __int32_t;
55 typedef unsigned int __uint32_t;
60 __extension__ typedef signed long long int __int64_t;
61 __extension__ typedef unsigned long long int __uint64_t;
69 __extension__ typedef long long int __quad_t;
70 __extension__ typedef unsigned long long int __u_quad_t;
71 # 131 "/usr/include/bits/types.h" 3 4
72 # 1 "/usr/include/bits/typesizes.h" 1 3 4
73 # 132 "/usr/include/bits/types.h" 2 3 4
76 __extension__ typedef __u_quad_t __dev_t;
77 __extension__ typedef unsigned int __uid_t;
78 __extension__ typedef unsigned int __gid_t;
79 __extension__ typedef unsigned long int __ino_t;
80 __extension__ typedef __u_quad_t __ino64_t;
81 __extension__ typedef unsigned int __mode_t;
82 __extension__ typedef unsigned int __nlink_t;
83 __extension__ typedef long int __off_t;
84 __extension__ typedef __quad_t __off64_t;
85 __extension__ typedef int __pid_t;
86 __extension__ typedef struct { int __val[2]; } __fsid_t;
87 __extension__ typedef long int __clock_t;
88 __extension__ typedef unsigned long int __rlim_t;
89 __extension__ typedef __u_quad_t __rlim64_t;
90 __extension__ typedef unsigned int __id_t;
91 __extension__ typedef long int __time_t;
92 __extension__ typedef unsigned int __useconds_t;
93 __extension__ typedef long int __suseconds_t;
95 __extension__ typedef int __daddr_t;
96 __extension__ typedef long int __swblk_t;
97 __extension__ typedef int __key_t;
100 __extension__ typedef int __clockid_t;
103 __extension__ typedef void * __timer_t;
106 __extension__ typedef long int __blksize_t;
111 __extension__ typedef long int __blkcnt_t;
112 __extension__ typedef __quad_t __blkcnt64_t;
115 __extension__ typedef unsigned long int __fsblkcnt_t;
116 __extension__ typedef __u_quad_t __fsblkcnt64_t;
119 __extension__ typedef unsigned long int __fsfilcnt_t;
120 __extension__ typedef __u_quad_t __fsfilcnt64_t;
122 __extension__ typedef int __ssize_t;
126 typedef __off64_t __loff_t;
127 typedef __quad_t *__qaddr_t;
128 typedef char *__caddr_t;
131 __extension__ typedef int __intptr_t;
134 __extension__ typedef unsigned int __socklen_t;
135 # 37 "/usr/include/stdio.h" 2 3 4
136 # 45 "/usr/include/stdio.h" 3 4
141 typedef struct _IO_FILE FILE;
147 # 65 "/usr/include/stdio.h" 3 4
148 typedef struct _IO_FILE __FILE;
149 # 75 "/usr/include/stdio.h" 3 4
150 # 1 "/usr/include/libio.h" 1 3 4
151 # 32 "/usr/include/libio.h" 3 4
152 # 1 "/usr/include/_G_config.h" 1 3 4
153 # 15 "/usr/include/_G_config.h" 3 4
154 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/include/stddef.h" 1 3 4
155 # 16 "/usr/include/_G_config.h" 2 3 4
160 # 1 "/usr/include/wchar.h" 1 3 4
161 # 83 "/usr/include/wchar.h" 3 4
175 # 21 "/usr/include/_G_config.h" 2 3 4
187 # 53 "/usr/include/_G_config.h" 3 4
188 typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
189 typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
190 typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
191 typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
192 # 33 "/usr/include/libio.h" 2 3 4
193 # 53 "/usr/include/libio.h" 3 4
194 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/include/stdarg.h" 1 3 4
195 # 40 "/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/include/stdarg.h" 3 4
196 typedef __builtin_va_list __gnuc_va_list;
197 # 54 "/usr/include/libio.h" 2 3 4
198 # 170 "/usr/include/libio.h" 3 4
199 struct _IO_jump_t; struct _IO_FILE;
200 # 180 "/usr/include/libio.h" 3 4
201 typedef void _IO_lock_t;
208 struct _IO_marker *_next;
209 struct _IO_FILE *_sbuf;
214 # 203 "/usr/include/libio.h" 3 4
218 enum __codecvt_result
225 # 271 "/usr/include/libio.h" 3 4
235 char* _IO_write_base;
242 char *_IO_backup_base;
245 struct _IO_marker *_markers;
247 struct _IO_FILE *_chain;
259 unsigned short _cur_column;
260 signed char _vtable_offset;
266 # 319 "/usr/include/libio.h" 3 4
268 # 328 "/usr/include/libio.h" 3 4
277 char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
282 typedef struct _IO_FILE _IO_FILE;
285 struct _IO_FILE_plus;
287 extern struct _IO_FILE_plus _IO_2_1_stdin_;
288 extern struct _IO_FILE_plus _IO_2_1_stdout_;
289 extern struct _IO_FILE_plus _IO_2_1_stderr_;
290 # 364 "/usr/include/libio.h" 3 4
291 typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
299 typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
308 typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
311 typedef int __io_close_fn (void *__cookie);
316 typedef __io_read_fn cookie_read_function_t;
317 typedef __io_write_fn cookie_write_function_t;
318 typedef __io_seek_fn cookie_seek_function_t;
319 typedef __io_close_fn cookie_close_function_t;
325 __io_write_fn *write;
327 __io_close_fn *close;
328 } _IO_cookie_io_functions_t;
329 typedef _IO_cookie_io_functions_t cookie_io_functions_t;
331 struct _IO_cookie_file;
334 extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write,
335 void *__cookie, _IO_cookie_io_functions_t __fns);
343 extern int __underflow (_IO_FILE *);
344 extern int __uflow (_IO_FILE *);
345 extern int __overflow (_IO_FILE *, int);
346 # 460 "/usr/include/libio.h" 3 4
347 extern int _IO_getc (_IO_FILE *__fp);
348 extern int _IO_putc (int __c, _IO_FILE *__fp);
349 extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__));
350 extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__));
352 extern int _IO_peekc_locked (_IO_FILE *__fp);
358 extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__));
359 extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__));
360 extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__));
361 # 490 "/usr/include/libio.h" 3 4
362 extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
363 __gnuc_va_list, int *__restrict);
364 extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
366 extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t);
367 extern size_t _IO_sgetn (_IO_FILE *, void *, size_t);
369 extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int);
370 extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int);
372 extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__));
373 # 76 "/usr/include/stdio.h" 2 3 4
378 typedef __gnuc_va_list va_list;
379 # 89 "/usr/include/stdio.h" 3 4
382 typedef _G_fpos_t fpos_t;
388 typedef _G_fpos64_t fpos64_t;
389 # 141 "/usr/include/stdio.h" 3 4
390 # 1 "/usr/include/bits/stdio_lim.h" 1 3 4
391 # 142 "/usr/include/stdio.h" 2 3 4
395 extern struct _IO_FILE *stdin;
396 extern struct _IO_FILE *stdout;
397 extern struct _IO_FILE *stderr;
405 extern int remove (__const char *__filename) __attribute__ ((__nothrow__));
407 extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__));
412 extern int renameat (int __oldfd, __const char *__old, int __newfd,
413 __const char *__new) __attribute__ ((__nothrow__));
422 extern FILE *tmpfile (void) __attribute__ ((__warn_unused_result__));
423 # 182 "/usr/include/stdio.h" 3 4
424 extern FILE *tmpfile64 (void) __attribute__ ((__warn_unused_result__));
428 extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
434 extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
435 # 204 "/usr/include/stdio.h" 3 4
436 extern char *tempnam (__const char *__dir, __const char *__pfx)
437 __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
446 extern int fclose (FILE *__stream);
451 extern int fflush (FILE *__stream);
453 # 229 "/usr/include/stdio.h" 3 4
454 extern int fflush_unlocked (FILE *__stream);
455 # 239 "/usr/include/stdio.h" 3 4
456 extern int fcloseall (void);
466 extern FILE *fopen (__const char *__restrict __filename,
467 __const char *__restrict __modes) __attribute__ ((__warn_unused_result__));
472 extern FILE *freopen (__const char *__restrict __filename,
473 __const char *__restrict __modes,
474 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
475 # 272 "/usr/include/stdio.h" 3 4
478 extern FILE *fopen64 (__const char *__restrict __filename,
479 __const char *__restrict __modes) __attribute__ ((__warn_unused_result__));
480 extern FILE *freopen64 (__const char *__restrict __filename,
481 __const char *__restrict __modes,
482 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
487 extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
493 extern FILE *fopencookie (void *__restrict __magic_cookie,
494 __const char *__restrict __modes,
495 _IO_cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
500 extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes)
501 __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
506 extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
513 extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__));
517 extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
518 int __modes, size_t __n) __attribute__ ((__nothrow__));
524 extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
525 size_t __size) __attribute__ ((__nothrow__));
528 extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__));
537 extern int fprintf (FILE *__restrict __stream,
538 __const char *__restrict __format, ...);
543 extern int printf (__const char *__restrict __format, ...);
545 extern int sprintf (char *__restrict __s,
546 __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
552 extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
553 __gnuc_va_list __arg);
558 extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
560 extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
561 __gnuc_va_list __arg) __attribute__ ((__nothrow__));
567 extern int snprintf (char *__restrict __s, size_t __maxlen,
568 __const char *__restrict __format, ...)
569 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));
571 extern int vsnprintf (char *__restrict __s, size_t __maxlen,
572 __const char *__restrict __format, __gnuc_va_list __arg)
573 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0)));
580 extern int vasprintf (char **__restrict __ptr, __const char *__restrict __f,
581 __gnuc_va_list __arg)
582 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) __attribute__ ((__warn_unused_result__));
583 extern int __asprintf (char **__restrict __ptr,
584 __const char *__restrict __fmt, ...)
585 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) __attribute__ ((__warn_unused_result__));
586 extern int asprintf (char **__restrict __ptr,
587 __const char *__restrict __fmt, ...)
588 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) __attribute__ ((__warn_unused_result__));
589 # 394 "/usr/include/stdio.h" 3 4
590 extern int vdprintf (int __fd, __const char *__restrict __fmt,
591 __gnuc_va_list __arg)
592 __attribute__ ((__format__ (__printf__, 2, 0)));
593 extern int dprintf (int __fd, __const char *__restrict __fmt, ...)
594 __attribute__ ((__format__ (__printf__, 2, 3)));
603 extern int fscanf (FILE *__restrict __stream,
604 __const char *__restrict __format, ...) __attribute__ ((__warn_unused_result__));
609 extern int scanf (__const char *__restrict __format, ...) __attribute__ ((__warn_unused_result__));
611 extern int sscanf (__const char *__restrict __s,
612 __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
613 # 445 "/usr/include/stdio.h" 3 4
622 extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format,
623 __gnuc_va_list __arg)
624 __attribute__ ((__format__ (__scanf__, 2, 0))) __attribute__ ((__warn_unused_result__));
630 extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg)
631 __attribute__ ((__format__ (__scanf__, 1, 0))) __attribute__ ((__warn_unused_result__));
634 extern int vsscanf (__const char *__restrict __s,
635 __const char *__restrict __format, __gnuc_va_list __arg)
636 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__scanf__, 2, 0)));
637 # 504 "/usr/include/stdio.h" 3 4
647 extern int fgetc (FILE *__stream);
648 extern int getc (FILE *__stream);
654 extern int getchar (void);
656 # 532 "/usr/include/stdio.h" 3 4
657 extern int getc_unlocked (FILE *__stream);
658 extern int getchar_unlocked (void);
659 # 543 "/usr/include/stdio.h" 3 4
660 extern int fgetc_unlocked (FILE *__stream);
672 extern int fputc (int __c, FILE *__stream);
673 extern int putc (int __c, FILE *__stream);
679 extern int putchar (int __c);
681 # 576 "/usr/include/stdio.h" 3 4
682 extern int fputc_unlocked (int __c, FILE *__stream);
690 extern int putc_unlocked (int __c, FILE *__stream);
691 extern int putchar_unlocked (int __c);
698 extern int getw (FILE *__stream);
701 extern int putw (int __w, FILE *__stream);
710 extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
711 __attribute__ ((__warn_unused_result__));
718 extern char *gets (char *__s) __attribute__ ((__warn_unused_result__));
720 # 622 "/usr/include/stdio.h" 3 4
721 extern char *fgets_unlocked (char *__restrict __s, int __n,
722 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
723 # 638 "/usr/include/stdio.h" 3 4
724 extern __ssize_t __getdelim (char **__restrict __lineptr,
725 size_t *__restrict __n, int __delimiter,
726 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
727 extern __ssize_t getdelim (char **__restrict __lineptr,
728 size_t *__restrict __n, int __delimiter,
729 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
737 extern __ssize_t getline (char **__restrict __lineptr,
738 size_t *__restrict __n,
739 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
748 extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
754 extern int puts (__const char *__s);
761 extern int ungetc (int __c, FILE *__stream);
768 extern size_t fread (void *__restrict __ptr, size_t __size,
769 size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
774 extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
775 size_t __n, FILE *__restrict __s) __attribute__ ((__warn_unused_result__));
777 # 699 "/usr/include/stdio.h" 3 4
778 extern int fputs_unlocked (__const char *__restrict __s,
779 FILE *__restrict __stream);
780 # 710 "/usr/include/stdio.h" 3 4
781 extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
782 size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
783 extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
784 size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
793 extern int fseek (FILE *__stream, long int __off, int __whence);
798 extern long int ftell (FILE *__stream) __attribute__ ((__warn_unused_result__));
803 extern void rewind (FILE *__stream);
805 # 746 "/usr/include/stdio.h" 3 4
806 extern int fseeko (FILE *__stream, __off_t __off, int __whence);
811 extern __off_t ftello (FILE *__stream) __attribute__ ((__warn_unused_result__));
812 # 765 "/usr/include/stdio.h" 3 4
819 extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
824 extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
825 # 788 "/usr/include/stdio.h" 3 4
829 extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
830 extern __off64_t ftello64 (FILE *__stream) __attribute__ ((__warn_unused_result__));
831 extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
832 extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos);
837 extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__));
839 extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
841 extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
846 extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__));
847 extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
848 extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
857 extern void perror (__const char *__s);
864 # 1 "/usr/include/bits/sys_errlist.h" 1 3 4
865 # 27 "/usr/include/bits/sys_errlist.h" 3 4
867 extern __const char *__const sys_errlist[];
870 extern int _sys_nerr;
871 extern __const char *__const _sys_errlist[];
872 # 827 "/usr/include/stdio.h" 2 3 4
877 extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
882 extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
883 # 846 "/usr/include/stdio.h" 3 4
884 extern FILE *popen (__const char *__command, __const char *__modes) __attribute__ ((__warn_unused_result__));
890 extern int pclose (FILE *__stream);
896 extern char *ctermid (char *__s) __attribute__ ((__nothrow__));
902 extern char *cuserid (char *__s);
910 extern int obstack_printf (struct obstack *__restrict __obstack,
911 __const char *__restrict __format, ...)
912 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3)));
913 extern int obstack_vprintf (struct obstack *__restrict __obstack,
914 __const char *__restrict __format,
915 __gnuc_va_list __args)
916 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0)));
924 extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__));
928 extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
931 extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__));
932 # 907 "/usr/include/stdio.h" 3 4
933 # 1 "/usr/include/bits/stdio.h" 1 3 4
934 # 44 "/usr/include/bits/stdio.h" 3 4
938 return _IO_getc (stdin);
945 fgetc_unlocked (FILE *__fp)
947 return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
955 getc_unlocked (FILE *__fp)
957 return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++);
962 getchar_unlocked (void)
964 return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++);
973 return _IO_putc (__c, stdout);
980 fputc_unlocked (int __c, FILE *__stream)
982 return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
990 putc_unlocked (int __c, FILE *__stream)
992 return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c)));
997 putchar_unlocked (int __c)
999 return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c)));
1006 extern __inline __ssize_t
1007 getline (char **__lineptr, size_t *__n, FILE *__stream)
1009 return __getdelim (__lineptr, __n, '\n', __stream);
1017 __attribute__ ((__nothrow__)) feof_unlocked (FILE *__stream)
1019 return (((__stream)->_flags & 0x10) != 0);
1024 __attribute__ ((__nothrow__)) ferror_unlocked (FILE *__stream)
1026 return (((__stream)->_flags & 0x20) != 0);
1028 # 908 "/usr/include/stdio.h" 2 3 4
1031 # 1 "/usr/include/bits/stdio2.h" 1 3 4
1032 # 24 "/usr/include/bits/stdio2.h" 3 4
1033 extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen,
1034 __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
1035 extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen,
1036 __const char *__restrict __format,
1037 __gnuc_va_list __ap) __attribute__ ((__nothrow__));
1040 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int
1041 __attribute__ ((__nothrow__)) sprintf (char *__restrict __s, __const char *__restrict __fmt, ...)
1043 return __builtin___sprintf_chk (__s, 2 - 1,
1044 __builtin_object_size (__s, 2 > 1), __fmt, __builtin_va_arg_pack ());
1052 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int
1053 __attribute__ ((__nothrow__)) vsprintf (char *__restrict __s, __const char *__restrict __fmt, __gnuc_va_list __ap)
1056 return __builtin___vsprintf_chk (__s, 2 - 1,
1057 __builtin_object_size (__s, 2 > 1), __fmt, __ap);
1062 extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag,
1063 size_t __slen, __const char *__restrict __format,
1064 ...) __attribute__ ((__nothrow__));
1065 extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag,
1066 size_t __slen, __const char *__restrict __format,
1067 __gnuc_va_list __ap) __attribute__ ((__nothrow__));
1070 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int
1071 __attribute__ ((__nothrow__)) snprintf (char *__restrict __s, size_t __n, __const char *__restrict __fmt, ...)
1074 return __builtin___snprintf_chk (__s, __n, 2 - 1,
1075 __builtin_object_size (__s, 2 > 1), __fmt, __builtin_va_arg_pack ());
1083 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int
1084 __attribute__ ((__nothrow__)) vsnprintf (char *__restrict __s, size_t __n, __const char *__restrict __fmt, __gnuc_va_list __ap)
1087 return __builtin___vsnprintf_chk (__s, __n, 2 - 1,
1088 __builtin_object_size (__s, 2 > 1), __fmt, __ap);
1095 extern int __fprintf_chk (FILE *__restrict __stream, int __flag,
1096 __const char *__restrict __format, ...);
1097 extern int __printf_chk (int __flag, __const char *__restrict __format, ...);
1098 extern int __vfprintf_chk (FILE *__restrict __stream, int __flag,
1099 __const char *__restrict __format, __gnuc_va_list __ap);
1100 extern int __vprintf_chk (int __flag, __const char *__restrict __format,
1101 __gnuc_va_list __ap);
1104 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int
1105 fprintf (FILE *__restrict __stream, __const char *__restrict __fmt, ...)
1107 return __fprintf_chk (__stream, 2 - 1, __fmt,
1108 __builtin_va_arg_pack ());
1111 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int
1112 printf (__const char *__restrict __fmt, ...)
1114 return __printf_chk (2 - 1, __fmt, __builtin_va_arg_pack ());
1123 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int
1124 vprintf (__const char *__restrict __fmt, __gnuc_va_list __ap)
1127 return __vfprintf_chk (stdout, 2 - 1, __fmt, __ap);
1133 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int
1134 vfprintf (FILE *__restrict __stream,
1135 __const char *__restrict __fmt, __gnuc_va_list __ap)
1137 return __vfprintf_chk (__stream, 2 - 1, __fmt, __ap);
1142 extern int __asprintf_chk (char **__restrict __ptr, int __flag,
1143 __const char *__restrict __fmt, ...)
1144 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4))) __attribute__ ((__warn_unused_result__));
1145 extern int __vasprintf_chk (char **__restrict __ptr, int __flag,
1146 __const char *__restrict __fmt, __gnuc_va_list __arg)
1147 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0))) __attribute__ ((__warn_unused_result__));
1148 extern int __dprintf_chk (int __fd, int __flag, __const char *__restrict __fmt,
1149 ...) __attribute__ ((__format__ (__printf__, 3, 4)));
1150 extern int __vdprintf_chk (int __fd, int __flag,
1151 __const char *__restrict __fmt, __gnuc_va_list __arg)
1152 __attribute__ ((__format__ (__printf__, 3, 0)));
1153 extern int __obstack_printf_chk (struct obstack *__restrict __obstack,
1154 int __flag, __const char *__restrict __format,
1156 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));
1157 extern int __obstack_vprintf_chk (struct obstack *__restrict __obstack,
1159 __const char *__restrict __format,
1160 __gnuc_va_list __args)
1161 __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0)));
1164 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int
1165 __attribute__ ((__nothrow__)) asprintf (char **__restrict __ptr, __const char *__restrict __fmt, ...)
1167 return __asprintf_chk (__ptr, 2 - 1, __fmt,
1168 __builtin_va_arg_pack ());
1171 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int
1172 __attribute__ ((__nothrow__)) __asprintf (char **__restrict __ptr, __const char *__restrict __fmt, ...)
1175 return __asprintf_chk (__ptr, 2 - 1, __fmt,
1176 __builtin_va_arg_pack ());
1179 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int
1180 dprintf (int __fd, __const char *__restrict __fmt, ...)
1182 return __dprintf_chk (__fd, 2 - 1, __fmt,
1183 __builtin_va_arg_pack ());
1186 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int
1187 __attribute__ ((__nothrow__)) obstack_printf (struct obstack *__restrict __obstack, __const char *__restrict __fmt, ...)
1190 return __obstack_printf_chk (__obstack, 2 - 1, __fmt,
1191 __builtin_va_arg_pack ());
1193 # 195 "/usr/include/bits/stdio2.h" 3 4
1194 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int
1195 __attribute__ ((__nothrow__)) vasprintf (char **__restrict __ptr, __const char *__restrict __fmt, __gnuc_va_list __ap)
1198 return __vasprintf_chk (__ptr, 2 - 1, __fmt, __ap);
1201 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int
1202 vdprintf (int __fd, __const char *__restrict __fmt, __gnuc_va_list __ap)
1204 return __vdprintf_chk (__fd, 2 - 1, __fmt, __ap);
1207 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int
1208 __attribute__ ((__nothrow__)) obstack_vprintf (struct obstack *__restrict __obstack, __const char *__restrict __fmt, __gnuc_va_list __ap)
1211 return __obstack_vprintf_chk (__obstack, 2 - 1, __fmt,
1219 extern char *__gets_chk (char *__str, size_t) __attribute__ ((__warn_unused_result__));
1220 extern char *__gets_warn (char *__str) __asm__ ("" "gets")
1221 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("please use fgets or getline instead, gets can't " "specify buffer size")))
1224 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) char *
1227 if (__builtin_object_size (__str, 2 > 1) != (size_t) -1)
1228 return __gets_chk (__str, __builtin_object_size (__str, 2 > 1));
1229 return __gets_warn (__str);
1232 extern char *__fgets_chk (char *__restrict __s, size_t __size, int __n,
1233 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
1234 extern char *__fgets_alias (char *__restrict __s, int __n, FILE *__restrict __stream) __asm__ ("" "fgets")
1236 __attribute__ ((__warn_unused_result__));
1237 extern char *__fgets_chk_warn (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __asm__ ("" "__fgets_chk")
1240 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fgets called with bigger size than length " "of destination buffer")))
1243 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) char *
1244 fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
1246 if (__builtin_object_size (__s, 2 > 1) != (size_t) -1)
1248 if (!__builtin_constant_p (__n) || __n <= 0)
1249 return __fgets_chk (__s, __builtin_object_size (__s, 2 > 1), __n, __stream);
1251 if ((size_t) __n > __builtin_object_size (__s, 2 > 1))
1252 return __fgets_chk_warn (__s, __builtin_object_size (__s, 2 > 1), __n, __stream);
1254 return __fgets_alias (__s, __n, __stream);
1257 extern size_t __fread_chk (void *__restrict __ptr, size_t __ptrlen,
1258 size_t __size, size_t __n,
1259 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
1260 extern size_t __fread_alias (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "fread")
1263 __attribute__ ((__warn_unused_result__));
1264 extern size_t __fread_chk_warn (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "__fread_chk")
1269 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fread called with bigger size * nmemb than length " "of destination buffer")))
1272 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) size_t
1273 fread (void *__restrict __ptr, size_t __size, size_t __n,
1274 FILE *__restrict __stream)
1276 if (__builtin_object_size (__ptr, 0) != (size_t) -1)
1278 if (!__builtin_constant_p (__size)
1279 || !__builtin_constant_p (__n)
1280 || (__size | __n) >= (((size_t) 1) << (8 * sizeof (size_t) / 2)))
1281 return __fread_chk (__ptr, __builtin_object_size (__ptr, 0), __size, __n, __stream);
1283 if (__size * __n > __builtin_object_size (__ptr, 0))
1284 return __fread_chk_warn (__ptr, __builtin_object_size (__ptr, 0), __size, __n, __stream);
1286 return __fread_alias (__ptr, __size, __n, __stream);
1290 extern char *__fgets_unlocked_chk (char *__restrict __s, size_t __size,
1291 int __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
1292 extern char *__fgets_unlocked_alias (char *__restrict __s, int __n, FILE *__restrict __stream) __asm__ ("" "fgets_unlocked")
1294 __attribute__ ((__warn_unused_result__));
1295 extern char *__fgets_unlocked_chk_warn (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __asm__ ("" "__fgets_unlocked_chk")
1298 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fgets_unlocked called with bigger size than length " "of destination buffer")))
1301 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) char *
1302 fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream)
1304 if (__builtin_object_size (__s, 2 > 1) != (size_t) -1)
1306 if (!__builtin_constant_p (__n) || __n <= 0)
1307 return __fgets_unlocked_chk (__s, __builtin_object_size (__s, 2 > 1), __n, __stream);
1309 if ((size_t) __n > __builtin_object_size (__s, 2 > 1))
1310 return __fgets_unlocked_chk_warn (__s, __builtin_object_size (__s, 2 > 1), __n, __stream);
1312 return __fgets_unlocked_alias (__s, __n, __stream);
1318 extern size_t __fread_unlocked_chk (void *__restrict __ptr, size_t __ptrlen,
1319 size_t __size, size_t __n,
1320 FILE *__restrict __stream) __attribute__ ((__warn_unused_result__));
1321 extern size_t __fread_unlocked_alias (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "fread_unlocked")
1324 __attribute__ ((__warn_unused_result__));
1325 extern size_t __fread_unlocked_chk_warn (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "__fread_unlocked_chk")
1330 __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fread_unlocked called with bigger size * nmemb than " "length of destination buffer")))
1333 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) size_t
1334 fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n,
1335 FILE *__restrict __stream)
1337 if (__builtin_object_size (__ptr, 0) != (size_t) -1)
1339 if (!__builtin_constant_p (__size)
1340 || !__builtin_constant_p (__n)
1341 || (__size | __n) >= (((size_t) 1) << (8 * sizeof (size_t) / 2)))
1342 return __fread_unlocked_chk (__ptr, __builtin_object_size (__ptr, 0), __size, __n,
1345 if (__size * __n > __builtin_object_size (__ptr, 0))
1346 return __fread_unlocked_chk_warn (__ptr, __builtin_object_size (__ptr, 0), __size, __n,
1351 if (__builtin_constant_p (__size)
1352 && __builtin_constant_p (__n)
1353 && (__size | __n) < (((size_t) 1) << (8 * sizeof (size_t) / 2))
1354 && __size * __n <= 8)
1356 size_t __cnt = __size * __n;
1357 char *__cptr = (char *) __ptr;
1361 for (; __cnt > 0; --__cnt)
1363 int __c = (__builtin_expect (((__stream)->_IO_read_ptr >= (__stream)->_IO_read_end), 0) ? __uflow (__stream) : *(unsigned char *) (__stream)->_IO_read_ptr++);
1368 return (__cptr - (char *) __ptr) / __size;
1371 return __fread_unlocked_alias (__ptr, __size, __n, __stream);
1373 # 911 "/usr/include/stdio.h" 2 3 4
1380 # 19 "scenarios.c" 2
1381 # 1 "/usr/include/stdlib.h" 1 3 4
1382 # 33 "/usr/include/stdlib.h" 3 4
1383 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/include/stddef.h" 1 3 4
1384 # 323 "/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/include/stddef.h" 3 4
1385 typedef long int wchar_t;
1386 # 34 "/usr/include/stdlib.h" 2 3 4
1395 # 1 "/usr/include/bits/waitflags.h" 1 3 4
1396 # 43 "/usr/include/stdlib.h" 2 3 4
1397 # 1 "/usr/include/bits/waitstatus.h" 1 3 4
1398 # 65 "/usr/include/bits/waitstatus.h" 3 4
1399 # 1 "/usr/include/endian.h" 1 3 4
1400 # 37 "/usr/include/endian.h" 3 4
1401 # 1 "/usr/include/bits/endian.h" 1 3 4
1402 # 38 "/usr/include/endian.h" 2 3 4
1403 # 61 "/usr/include/endian.h" 3 4
1404 # 1 "/usr/include/bits/byteswap.h" 1 3 4
1405 # 62 "/usr/include/endian.h" 2 3 4
1406 # 66 "/usr/include/bits/waitstatus.h" 2 3 4
1414 unsigned int __w_termsig:7;
1415 unsigned int __w_coredump:1;
1416 unsigned int __w_retcode:8;
1425 } __wait_terminated;
1429 unsigned int __w_stopval:8;
1430 unsigned int __w_stopsig:8;
1440 # 44 "/usr/include/stdlib.h" 2 3 4
1441 # 68 "/usr/include/stdlib.h" 3 4
1446 } __WAIT_STATUS __attribute__ ((__transparent_union__));
1447 # 96 "/usr/include/stdlib.h" 3 4
1470 __extension__ typedef struct
1477 # 140 "/usr/include/stdlib.h" 3 4
1478 extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
1483 extern double atof (__const char *__nptr)
1484 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
1486 extern int atoi (__const char *__nptr)
1487 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
1489 extern long int atol (__const char *__nptr)
1490 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
1496 __extension__ extern long long int atoll (__const char *__nptr)
1497 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
1503 extern double strtod (__const char *__restrict __nptr,
1504 char **__restrict __endptr)
1505 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
1511 extern float strtof (__const char *__restrict __nptr,
1512 char **__restrict __endptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
1514 extern long double strtold (__const char *__restrict __nptr,
1515 char **__restrict __endptr)
1516 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
1522 extern long int strtol (__const char *__restrict __nptr,
1523 char **__restrict __endptr, int __base)
1524 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
1526 extern unsigned long int strtoul (__const char *__restrict __nptr,
1527 char **__restrict __endptr, int __base)
1528 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
1534 extern long long int strtoq (__const char *__restrict __nptr,
1535 char **__restrict __endptr, int __base)
1536 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
1539 extern unsigned long long int strtouq (__const char *__restrict __nptr,
1540 char **__restrict __endptr, int __base)
1541 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
1548 extern long long int strtoll (__const char *__restrict __nptr,
1549 char **__restrict __endptr, int __base)
1550 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
1553 extern unsigned long long int strtoull (__const char *__restrict __nptr,
1554 char **__restrict __endptr, int __base)
1555 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
1557 # 236 "/usr/include/stdlib.h" 3 4
1558 # 1 "/usr/include/xlocale.h" 1 3 4
1559 # 28 "/usr/include/xlocale.h" 3 4
1560 typedef struct __locale_struct
1563 struct locale_data *__locales[13];
1566 const unsigned short int *__ctype_b;
1567 const int *__ctype_tolower;
1568 const int *__ctype_toupper;
1571 const char *__names[13];
1575 typedef __locale_t locale_t;
1576 # 237 "/usr/include/stdlib.h" 2 3 4
1580 extern long int strtol_l (__const char *__restrict __nptr,
1581 char **__restrict __endptr, int __base,
1582 __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) __attribute__ ((__warn_unused_result__));
1584 extern unsigned long int strtoul_l (__const char *__restrict __nptr,
1585 char **__restrict __endptr,
1586 int __base, __locale_t __loc)
1587 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) __attribute__ ((__warn_unused_result__));
1590 extern long long int strtoll_l (__const char *__restrict __nptr,
1591 char **__restrict __endptr, int __base,
1593 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) __attribute__ ((__warn_unused_result__));
1596 extern unsigned long long int strtoull_l (__const char *__restrict __nptr,
1597 char **__restrict __endptr,
1598 int __base, __locale_t __loc)
1599 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) __attribute__ ((__warn_unused_result__));
1601 extern double strtod_l (__const char *__restrict __nptr,
1602 char **__restrict __endptr, __locale_t __loc)
1603 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) __attribute__ ((__warn_unused_result__));
1605 extern float strtof_l (__const char *__restrict __nptr,
1606 char **__restrict __endptr, __locale_t __loc)
1607 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) __attribute__ ((__warn_unused_result__));
1609 extern long double strtold_l (__const char *__restrict __nptr,
1610 char **__restrict __endptr,
1612 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) __attribute__ ((__warn_unused_result__));
1618 extern __inline double
1619 __attribute__ ((__nothrow__)) atof (__const char *__nptr)
1621 return strtod (__nptr, (char **) ((void *)0));
1624 __attribute__ ((__nothrow__)) atoi (__const char *__nptr)
1626 return (int) strtol (__nptr, (char **) ((void *)0), 10);
1628 extern __inline long int
1629 __attribute__ ((__nothrow__)) atol (__const char *__nptr)
1631 return strtol (__nptr, (char **) ((void *)0), 10);
1637 __extension__ extern __inline long long int
1638 __attribute__ ((__nothrow__)) atoll (__const char *__nptr)
1640 return strtoll (__nptr, (char **) ((void *)0), 10);
1643 # 311 "/usr/include/stdlib.h" 3 4
1644 extern char *l64a (long int __n) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
1647 extern long int a64l (__const char *__s)
1648 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
1653 # 1 "/usr/include/sys/types.h" 1 3 4
1654 # 29 "/usr/include/sys/types.h" 3 4
1661 typedef __u_char u_char;
1662 typedef __u_short u_short;
1663 typedef __u_int u_int;
1664 typedef __u_long u_long;
1665 typedef __quad_t quad_t;
1666 typedef __u_quad_t u_quad_t;
1667 typedef __fsid_t fsid_t;
1672 typedef __loff_t loff_t;
1676 typedef __ino_t ino_t;
1683 typedef __ino64_t ino64_t;
1688 typedef __dev_t dev_t;
1693 typedef __gid_t gid_t;
1698 typedef __mode_t mode_t;
1703 typedef __nlink_t nlink_t;
1708 typedef __uid_t uid_t;
1714 typedef __off_t off_t;
1721 typedef __off64_t off64_t;
1726 typedef __pid_t pid_t;
1731 typedef __id_t id_t;
1736 typedef __ssize_t ssize_t;
1742 typedef __daddr_t daddr_t;
1743 typedef __caddr_t caddr_t;
1749 typedef __key_t key_t;
1750 # 133 "/usr/include/sys/types.h" 3 4
1751 # 1 "/usr/include/time.h" 1 3 4
1752 # 58 "/usr/include/time.h" 3 4
1755 typedef __clock_t clock_t;
1759 # 74 "/usr/include/time.h" 3 4
1762 typedef __time_t time_t;
1766 # 92 "/usr/include/time.h" 3 4
1767 typedef __clockid_t clockid_t;
1768 # 104 "/usr/include/time.h" 3 4
1769 typedef __timer_t timer_t;
1770 # 134 "/usr/include/sys/types.h" 2 3 4
1774 typedef __useconds_t useconds_t;
1778 typedef __suseconds_t suseconds_t;
1784 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/include/stddef.h" 1 3 4
1785 # 148 "/usr/include/sys/types.h" 2 3 4
1789 typedef unsigned long int ulong;
1790 typedef unsigned short int ushort;
1791 typedef unsigned int uint;
1792 # 195 "/usr/include/sys/types.h" 3 4
1793 typedef int int8_t __attribute__ ((__mode__ (__QI__)));
1794 typedef int int16_t __attribute__ ((__mode__ (__HI__)));
1795 typedef int int32_t __attribute__ ((__mode__ (__SI__)));
1796 typedef int int64_t __attribute__ ((__mode__ (__DI__)));
1799 typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
1800 typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
1801 typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
1802 typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
1804 typedef int register_t __attribute__ ((__mode__ (__word__)));
1805 # 220 "/usr/include/sys/types.h" 3 4
1806 # 1 "/usr/include/sys/select.h" 1 3 4
1807 # 31 "/usr/include/sys/select.h" 3 4
1808 # 1 "/usr/include/bits/select.h" 1 3 4
1809 # 32 "/usr/include/sys/select.h" 2 3 4
1812 # 1 "/usr/include/bits/sigset.h" 1 3 4
1813 # 24 "/usr/include/bits/sigset.h" 3 4
1814 typedef int __sig_atomic_t;
1821 unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
1823 # 35 "/usr/include/sys/select.h" 2 3 4
1827 typedef __sigset_t sigset_t;
1833 # 1 "/usr/include/time.h" 1 3 4
1834 # 120 "/usr/include/time.h" 3 4
1840 # 45 "/usr/include/sys/select.h" 2 3 4
1842 # 1 "/usr/include/bits/time.h" 1 3 4
1843 # 69 "/usr/include/bits/time.h" 3 4
1847 __suseconds_t tv_usec;
1849 # 47 "/usr/include/sys/select.h" 2 3 4
1850 # 55 "/usr/include/sys/select.h" 3 4
1851 typedef long int __fd_mask;
1852 # 67 "/usr/include/sys/select.h" 3 4
1858 __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];
1871 typedef __fd_mask fd_mask;
1872 # 99 "/usr/include/sys/select.h" 3 4
1874 # 109 "/usr/include/sys/select.h" 3 4
1875 extern int select (int __nfds, fd_set *__restrict __readfds,
1876 fd_set *__restrict __writefds,
1877 fd_set *__restrict __exceptfds,
1878 struct timeval *__restrict __timeout);
1879 # 121 "/usr/include/sys/select.h" 3 4
1880 extern int pselect (int __nfds, fd_set *__restrict __readfds,
1881 fd_set *__restrict __writefds,
1882 fd_set *__restrict __exceptfds,
1883 const struct timespec *__restrict __timeout,
1884 const __sigset_t *__restrict __sigmask);
1888 # 221 "/usr/include/sys/types.h" 2 3 4
1891 # 1 "/usr/include/sys/sysmacros.h" 1 3 4
1892 # 30 "/usr/include/sys/sysmacros.h" 3 4
1894 extern unsigned int gnu_dev_major (unsigned long long int __dev)
1895 __attribute__ ((__nothrow__));
1897 extern unsigned int gnu_dev_minor (unsigned long long int __dev)
1898 __attribute__ ((__nothrow__));
1900 extern unsigned long long int gnu_dev_makedev (unsigned int __major,
1901 unsigned int __minor)
1902 __attribute__ ((__nothrow__));
1905 __extension__ extern __inline unsigned int
1906 __attribute__ ((__nothrow__)) gnu_dev_major (unsigned long long int __dev)
1908 return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
1911 __extension__ extern __inline unsigned int
1912 __attribute__ ((__nothrow__)) gnu_dev_minor (unsigned long long int __dev)
1914 return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
1917 __extension__ extern __inline unsigned long long int
1918 __attribute__ ((__nothrow__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor)
1920 return ((__minor & 0xff) | ((__major & 0xfff) << 8)
1921 | (((unsigned long long int) (__minor & ~0xff)) << 12)
1922 | (((unsigned long long int) (__major & ~0xfff)) << 32));
1924 # 224 "/usr/include/sys/types.h" 2 3 4
1929 typedef __blksize_t blksize_t;
1936 typedef __blkcnt_t blkcnt_t;
1940 typedef __fsblkcnt_t fsblkcnt_t;
1944 typedef __fsfilcnt_t fsfilcnt_t;
1945 # 262 "/usr/include/sys/types.h" 3 4
1946 typedef __blkcnt64_t blkcnt64_t;
1947 typedef __fsblkcnt64_t fsblkcnt64_t;
1948 typedef __fsfilcnt64_t fsfilcnt64_t;
1954 # 1 "/usr/include/bits/pthreadtypes.h" 1 3 4
1955 # 36 "/usr/include/bits/pthreadtypes.h" 3 4
1956 typedef unsigned long int pthread_t;
1966 typedef struct __pthread_internal_slist
1968 struct __pthread_internal_slist *__next;
1969 } __pthread_slist_t;
1976 struct __pthread_mutex_s
1979 unsigned int __count;
1984 unsigned int __nusers;
1988 __pthread_slist_t __list;
1999 } pthread_mutexattr_t;
2009 unsigned int __futex;
2010 __extension__ unsigned long long int __total_seq;
2011 __extension__ unsigned long long int __wakeup_seq;
2012 __extension__ unsigned long long int __woken_seq;
2014 unsigned int __nwaiters;
2015 unsigned int __broadcast_seq;
2018 __extension__ long long int __align;
2025 } pthread_condattr_t;
2029 typedef unsigned int pthread_key_t;
2033 typedef int pthread_once_t;
2044 unsigned int __nr_readers;
2045 unsigned int __readers_wakeup;
2046 unsigned int __writer_wakeup;
2047 unsigned int __nr_readers_queued;
2048 unsigned int __nr_writers_queued;
2051 unsigned char __flags;
2052 unsigned char __shared;
2053 unsigned char __pad1;
2054 unsigned char __pad2;
2065 } pthread_rwlockattr_t;
2071 typedef volatile int pthread_spinlock_t;
2080 } pthread_barrier_t;
2086 } pthread_barrierattr_t;
2087 # 271 "/usr/include/sys/types.h" 2 3 4
2091 # 321 "/usr/include/stdlib.h" 2 3 4
2098 extern long int random (void) __attribute__ ((__nothrow__));
2101 extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__));
2107 extern char *initstate (unsigned int __seed, char *__statebuf,
2108 size_t __statelen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2112 extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2131 extern int random_r (struct random_data *__restrict __buf,
2132 int32_t *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2134 extern int srandom_r (unsigned int __seed, struct random_data *__buf)
2135 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2137 extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
2139 struct random_data *__restrict __buf)
2140 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4)));
2142 extern int setstate_r (char *__restrict __statebuf,
2143 struct random_data *__restrict __buf)
2144 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2151 extern int rand (void) __attribute__ ((__nothrow__));
2153 extern void srand (unsigned int __seed) __attribute__ ((__nothrow__));
2158 extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__));
2166 extern double drand48 (void) __attribute__ ((__nothrow__));
2167 extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2170 extern long int lrand48 (void) __attribute__ ((__nothrow__));
2171 extern long int nrand48 (unsigned short int __xsubi[3])
2172 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2175 extern long int mrand48 (void) __attribute__ ((__nothrow__));
2176 extern long int jrand48 (unsigned short int __xsubi[3])
2177 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2180 extern void srand48 (long int __seedval) __attribute__ ((__nothrow__));
2181 extern unsigned short int *seed48 (unsigned short int __seed16v[3])
2182 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2183 extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2191 unsigned short int __x[3];
2192 unsigned short int __old_x[3];
2193 unsigned short int __c;
2194 unsigned short int __init;
2195 unsigned long long int __a;
2199 extern int drand48_r (struct drand48_data *__restrict __buffer,
2200 double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2201 extern int erand48_r (unsigned short int __xsubi[3],
2202 struct drand48_data *__restrict __buffer,
2203 double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2206 extern int lrand48_r (struct drand48_data *__restrict __buffer,
2207 long int *__restrict __result)
2208 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2209 extern int nrand48_r (unsigned short int __xsubi[3],
2210 struct drand48_data *__restrict __buffer,
2211 long int *__restrict __result)
2212 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2215 extern int mrand48_r (struct drand48_data *__restrict __buffer,
2216 long int *__restrict __result)
2217 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2218 extern int jrand48_r (unsigned short int __xsubi[3],
2219 struct drand48_data *__restrict __buffer,
2220 long int *__restrict __result)
2221 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2224 extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
2225 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2227 extern int seed48_r (unsigned short int __seed16v[3],
2228 struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2230 extern int lcong48_r (unsigned short int __param[7],
2231 struct drand48_data *__buffer)
2232 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2242 extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
2244 extern void *calloc (size_t __nmemb, size_t __size)
2245 __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
2256 extern void *realloc (void *__ptr, size_t __size)
2257 __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2259 extern void free (void *__ptr) __attribute__ ((__nothrow__));
2264 extern void cfree (void *__ptr) __attribute__ ((__nothrow__));
2268 # 1 "/usr/include/alloca.h" 1 3 4
2269 # 25 "/usr/include/alloca.h" 3 4
2270 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/include/stddef.h" 1 3 4
2271 # 26 "/usr/include/alloca.h" 2 3 4
2279 extern void *alloca (size_t __size) __attribute__ ((__nothrow__));
2286 # 498 "/usr/include/stdlib.h" 2 3 4
2291 extern void *valloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__));
2296 extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
2297 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2302 extern void abort (void) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
2306 extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2307 # 527 "/usr/include/stdlib.h" 3 4
2308 extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2316 extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
2317 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2324 extern void exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
2332 extern void quick_exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
2340 extern void _Exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
2347 extern char *getenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2352 extern char *__secure_getenv (__const char *__name)
2353 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2359 extern int putenv (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2365 extern int setenv (__const char *__name, __const char *__value, int __replace)
2366 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2369 extern int unsetenv (__const char *__name) __attribute__ ((__nothrow__));
2376 extern int clearenv (void) __attribute__ ((__nothrow__));
2377 # 604 "/usr/include/stdlib.h" 3 4
2378 extern char *mktemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2379 # 615 "/usr/include/stdlib.h" 3 4
2380 extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2381 # 625 "/usr/include/stdlib.h" 3 4
2382 extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2383 # 637 "/usr/include/stdlib.h" 3 4
2384 extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2385 # 647 "/usr/include/stdlib.h" 3 4
2386 extern int mkstemps64 (char *__template, int __suffixlen)
2387 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2388 # 658 "/usr/include/stdlib.h" 3 4
2389 extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2390 # 669 "/usr/include/stdlib.h" 3 4
2391 extern int mkostemp (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2392 # 679 "/usr/include/stdlib.h" 3 4
2393 extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2394 # 689 "/usr/include/stdlib.h" 3 4
2395 extern int mkostemps (char *__template, int __suffixlen, int __flags)
2396 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2397 # 701 "/usr/include/stdlib.h" 3 4
2398 extern int mkostemps64 (char *__template, int __suffixlen, int __flags)
2399 __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2409 extern int system (__const char *__command) __attribute__ ((__warn_unused_result__));
2416 extern char *canonicalize_file_name (__const char *__name)
2417 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2418 # 729 "/usr/include/stdlib.h" 3 4
2419 extern char *realpath (__const char *__restrict __name,
2420 char *__restrict __resolved) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2427 typedef int (*__compar_fn_t) (__const void *, __const void *);
2430 typedef __compar_fn_t comparison_fn_t;
2434 typedef int (*__compar_d_fn_t) (__const void *, __const void *, void *);
2440 extern void *bsearch (__const void *__key, __const void *__base,
2441 size_t __nmemb, size_t __size, __compar_fn_t __compar)
2442 __attribute__ ((__nonnull__ (1, 2, 5))) __attribute__ ((__warn_unused_result__));
2446 extern void qsort (void *__base, size_t __nmemb, size_t __size,
2447 __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
2449 extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
2450 __compar_d_fn_t __compar, void *__arg)
2451 __attribute__ ((__nonnull__ (1, 4)));
2456 extern int abs (int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
2457 extern long int labs (long int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
2461 __extension__ extern long long int llabs (long long int __x)
2462 __attribute__ ((__nothrow__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
2470 extern div_t div (int __numer, int __denom)
2471 __attribute__ ((__nothrow__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
2472 extern ldiv_t ldiv (long int __numer, long int __denom)
2473 __attribute__ ((__nothrow__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
2478 __extension__ extern lldiv_t lldiv (long long int __numer,
2479 long long int __denom)
2480 __attribute__ ((__nothrow__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__));
2482 # 802 "/usr/include/stdlib.h" 3 4
2483 extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
2484 int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__));
2489 extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
2490 int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__));
2495 extern char *gcvt (double __value, int __ndigit, char *__buf)
2496 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) __attribute__ ((__warn_unused_result__));
2501 extern char *qecvt (long double __value, int __ndigit,
2502 int *__restrict __decpt, int *__restrict __sign)
2503 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__));
2504 extern char *qfcvt (long double __value, int __ndigit,
2505 int *__restrict __decpt, int *__restrict __sign)
2506 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__));
2507 extern char *qgcvt (long double __value, int __ndigit, char *__buf)
2508 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) __attribute__ ((__warn_unused_result__));
2513 extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
2514 int *__restrict __sign, char *__restrict __buf,
2515 size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
2516 extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
2517 int *__restrict __sign, char *__restrict __buf,
2518 size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
2520 extern int qecvt_r (long double __value, int __ndigit,
2521 int *__restrict __decpt, int *__restrict __sign,
2522 char *__restrict __buf, size_t __len)
2523 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
2524 extern int qfcvt_r (long double __value, int __ndigit,
2525 int *__restrict __decpt, int *__restrict __sign,
2526 char *__restrict __buf, size_t __len)
2527 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
2535 extern int mblen (__const char *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2538 extern int mbtowc (wchar_t *__restrict __pwc,
2539 __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2542 extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2546 extern size_t mbstowcs (wchar_t *__restrict __pwcs,
2547 __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__));
2549 extern size_t wcstombs (char *__restrict __s,
2550 __const wchar_t *__restrict __pwcs, size_t __n)
2551 __attribute__ ((__nothrow__));
2560 extern int rpmatch (__const char *__response) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
2561 # 890 "/usr/include/stdlib.h" 3 4
2562 extern int getsubopt (char **__restrict __optionp,
2563 char *__const *__restrict __tokens,
2564 char **__restrict __valuep)
2565 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__warn_unused_result__));
2571 extern void setkey (__const char *__key) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2579 extern int posix_openpt (int __oflag) __attribute__ ((__warn_unused_result__));
2587 extern int grantpt (int __fd) __attribute__ ((__nothrow__));
2591 extern int unlockpt (int __fd) __attribute__ ((__nothrow__));
2596 extern char *ptsname (int __fd) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2603 extern int ptsname_r (int __fd, char *__buf, size_t __buflen)
2604 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2607 extern int getpt (void);
2614 extern int getloadavg (double __loadavg[], int __nelem)
2615 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2621 # 1 "/usr/include/bits/stdlib.h" 1 3 4
2622 # 24 "/usr/include/bits/stdlib.h" 3 4
2623 extern char *__realpath_chk (__const char *__restrict __name,
2624 char *__restrict __resolved,
2625 size_t __resolvedlen) __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2626 extern char *__realpath_alias (__const char *__restrict __name, char *__restrict __resolved) __asm__ ("" "realpath") __attribute__ ((__nothrow__))
2628 __attribute__ ((__warn_unused_result__));
2629 extern char *__realpath_chk_warn (__const char *__restrict __name, char *__restrict __resolved, size_t __resolvedlen) __asm__ ("" "__realpath_chk") __attribute__ ((__nothrow__))
2632 __attribute__ ((__warn_unused_result__))
2633 __attribute__((__warning__ ("second argument of realpath must be either NULL or at " "least PATH_MAX bytes long buffer")))
2636 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) char *
2637 __attribute__ ((__nothrow__)) realpath (__const char *__restrict __name, char *__restrict __resolved)
2639 if (__builtin_object_size (__resolved, 2 > 1) != (size_t) -1)
2645 return __realpath_chk (__name, __resolved, __builtin_object_size (__resolved, 2 > 1));
2648 return __realpath_alias (__name, __resolved);
2652 extern int __ptsname_r_chk (int __fd, char *__buf, size_t __buflen,
2653 size_t __nreal) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2654 extern int __ptsname_r_alias (int __fd, char *__buf, size_t __buflen) __asm__ ("" "ptsname_r") __attribute__ ((__nothrow__))
2656 __attribute__ ((__nonnull__ (2)));
2657 extern int __ptsname_r_chk_warn (int __fd, char *__buf, size_t __buflen, size_t __nreal) __asm__ ("" "__ptsname_r_chk") __attribute__ ((__nothrow__))
2660 __attribute__ ((__nonnull__ (2))) __attribute__((__warning__ ("ptsname_r called with buflen bigger than " "size of buf")))
2663 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) int
2664 __attribute__ ((__nothrow__)) ptsname_r (int __fd, char *__buf, size_t __buflen)
2666 if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1)
2668 if (!__builtin_constant_p (__buflen))
2669 return __ptsname_r_chk (__fd, __buf, __buflen, __builtin_object_size (__buf, 2 > 1));
2670 if (__buflen > __builtin_object_size (__buf, 2 > 1))
2671 return __ptsname_r_chk_warn (__fd, __buf, __buflen, __builtin_object_size (__buf, 2 > 1));
2673 return __ptsname_r_alias (__fd, __buf, __buflen);
2677 extern int __wctomb_chk (char *__s, wchar_t __wchar, size_t __buflen)
2678 __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
2679 extern int __wctomb_alias (char *__s, wchar_t __wchar) __asm__ ("" "wctomb") __attribute__ ((__nothrow__))
2680 __attribute__ ((__warn_unused_result__));
2682 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) int
2683 __attribute__ ((__nothrow__)) wctomb (char *__s, wchar_t __wchar)
2692 if (__builtin_object_size (__s, 2 > 1) != (size_t) -1 && 16 > __builtin_object_size (__s, 2 > 1))
2693 return __wctomb_chk (__s, __wchar, __builtin_object_size (__s, 2 > 1));
2694 return __wctomb_alias (__s, __wchar);
2698 extern size_t __mbstowcs_chk (wchar_t *__restrict __dst,
2699 __const char *__restrict __src,
2700 size_t __len, size_t __dstlen) __attribute__ ((__nothrow__));
2701 extern size_t __mbstowcs_alias (wchar_t *__restrict __dst, __const char *__restrict __src, size_t __len) __asm__ ("" "mbstowcs") __attribute__ ((__nothrow__))
2705 extern size_t __mbstowcs_chk_warn (wchar_t *__restrict __dst, __const char *__restrict __src, size_t __len, size_t __dstlen) __asm__ ("" "__mbstowcs_chk") __attribute__ ((__nothrow__))
2709 __attribute__((__warning__ ("mbstowcs called with dst buffer smaller than len " "* sizeof (wchar_t)")))
2712 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) size_t
2713 __attribute__ ((__nothrow__)) mbstowcs (wchar_t *__restrict __dst, __const char *__restrict __src, size_t __len)
2716 if (__builtin_object_size (__dst, 2 > 1) != (size_t) -1)
2718 if (!__builtin_constant_p (__len))
2719 return __mbstowcs_chk (__dst, __src, __len,
2720 __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t));
2722 if (__len > __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t))
2723 return __mbstowcs_chk_warn (__dst, __src, __len,
2724 __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t));
2726 return __mbstowcs_alias (__dst, __src, __len);
2730 extern size_t __wcstombs_chk (char *__restrict __dst,
2731 __const wchar_t *__restrict __src,
2732 size_t __len, size_t __dstlen) __attribute__ ((__nothrow__));
2733 extern size_t __wcstombs_alias (char *__restrict __dst, __const wchar_t *__restrict __src, size_t __len) __asm__ ("" "wcstombs") __attribute__ ((__nothrow__))
2737 extern size_t __wcstombs_chk_warn (char *__restrict __dst, __const wchar_t *__restrict __src, size_t __len, size_t __dstlen) __asm__ ("" "__wcstombs_chk") __attribute__ ((__nothrow__))
2741 __attribute__((__warning__ ("wcstombs called with dst buffer smaller than len")));
2743 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) size_t
2744 __attribute__ ((__nothrow__)) wcstombs (char *__restrict __dst, __const wchar_t *__restrict __src, size_t __len)
2747 if (__builtin_object_size (__dst, 2 > 1) != (size_t) -1)
2749 if (!__builtin_constant_p (__len))
2750 return __wcstombs_chk (__dst, __src, __len, __builtin_object_size (__dst, 2 > 1));
2751 if (__len > __builtin_object_size (__dst, 2 > 1))
2752 return __wcstombs_chk_warn (__dst, __src, __len, __builtin_object_size (__dst, 2 > 1));
2754 return __wcstombs_alias (__dst, __src, __len);
2756 # 950 "/usr/include/stdlib.h" 2 3 4
2757 # 958 "/usr/include/stdlib.h" 3 4
2759 # 20 "scenarios.c" 2
2760 # 1 "/usr/include/string.h" 1 3 4
2761 # 28 "/usr/include/string.h" 3 4
2767 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/include/stddef.h" 1 3 4
2768 # 34 "/usr/include/string.h" 2 3 4
2778 extern void *memcpy (void *__restrict __dest,
2779 __const void *__restrict __src, size_t __n)
2780 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2783 extern void *memmove (void *__dest, __const void *__src, size_t __n)
2784 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2791 extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
2792 int __c, size_t __n)
2793 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2799 extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2802 extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
2803 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2804 # 94 "/usr/include/string.h" 3 4
2805 extern void *memchr (__const void *__s, int __c, size_t __n)
2806 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2809 # 108 "/usr/include/string.h" 3 4
2810 extern void *rawmemchr (__const void *__s, int __c)
2811 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2812 # 119 "/usr/include/string.h" 3 4
2813 extern void *memrchr (__const void *__s, int __c, size_t __n)
2814 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2821 extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
2822 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2824 extern char *strncpy (char *__restrict __dest,
2825 __const char *__restrict __src, size_t __n)
2826 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2829 extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
2830 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2832 extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
2833 size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2836 extern int strcmp (__const char *__s1, __const char *__s2)
2837 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2839 extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
2840 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2843 extern int strcoll (__const char *__s1, __const char *__s2)
2844 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2846 extern size_t strxfrm (char *__restrict __dest,
2847 __const char *__restrict __src, size_t __n)
2848 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2850 # 164 "/usr/include/string.h" 3 4
2851 extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l)
2852 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
2854 extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n,
2855 __locale_t __l) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4)));
2860 extern char *strdup (__const char *__s)
2861 __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
2868 extern char *strndup (__const char *__string, size_t __n)
2869 __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
2870 # 208 "/usr/include/string.h" 3 4
2872 # 233 "/usr/include/string.h" 3 4
2873 extern char *strchr (__const char *__s, int __c)
2874 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2875 # 260 "/usr/include/string.h" 3 4
2876 extern char *strrchr (__const char *__s, int __c)
2877 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2880 # 274 "/usr/include/string.h" 3 4
2881 extern char *strchrnul (__const char *__s, int __c)
2882 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2889 extern size_t strcspn (__const char *__s, __const char *__reject)
2890 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2893 extern size_t strspn (__const char *__s, __const char *__accept)
2894 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2895 # 312 "/usr/include/string.h" 3 4
2896 extern char *strpbrk (__const char *__s, __const char *__accept)
2897 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2898 # 340 "/usr/include/string.h" 3 4
2899 extern char *strstr (__const char *__haystack, __const char *__needle)
2900 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2905 extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
2906 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2911 extern char *__strtok_r (char *__restrict __s,
2912 __const char *__restrict __delim,
2913 char **__restrict __save_ptr)
2914 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
2916 extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
2917 char **__restrict __save_ptr)
2918 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
2919 # 371 "/usr/include/string.h" 3 4
2920 extern char *strcasestr (__const char *__haystack, __const char *__needle)
2921 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2929 extern void *memmem (__const void *__haystack, size_t __haystacklen,
2930 __const void *__needle, size_t __needlelen)
2931 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3)));
2935 extern void *__mempcpy (void *__restrict __dest,
2936 __const void *__restrict __src, size_t __n)
2937 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2938 extern void *mempcpy (void *__restrict __dest,
2939 __const void *__restrict __src, size_t __n)
2940 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2946 extern size_t strlen (__const char *__s)
2947 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2953 extern size_t strnlen (__const char *__string, size_t __maxlen)
2954 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2960 extern char *strerror (int __errnum) __attribute__ ((__nothrow__));
2962 # 436 "/usr/include/string.h" 3 4
2963 extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
2964 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2970 extern char *strerror_l (int __errnum, __locale_t __l) __attribute__ ((__nothrow__));
2976 extern void __bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2980 extern void bcopy (__const void *__src, void *__dest, size_t __n)
2981 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2984 extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2987 extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
2988 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
2989 # 487 "/usr/include/string.h" 3 4
2990 extern char *index (__const char *__s, int __c)
2991 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2992 # 515 "/usr/include/string.h" 3 4
2993 extern char *rindex (__const char *__s, int __c)
2994 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
2999 extern int ffs (int __i) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
3004 extern int ffsl (long int __l) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
3006 __extension__ extern int ffsll (long long int __ll)
3007 __attribute__ ((__nothrow__)) __attribute__ ((__const__));
3012 extern int strcasecmp (__const char *__s1, __const char *__s2)
3013 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
3016 extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
3017 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
3023 extern int strcasecmp_l (__const char *__s1, __const char *__s2,
3025 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
3027 extern int strncasecmp_l (__const char *__s1, __const char *__s2,
3028 size_t __n, __locale_t __loc)
3029 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));
3035 extern char *strsep (char **__restrict __stringp,
3036 __const char *__restrict __delim)
3037 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
3042 extern char *strsignal (int __sig) __attribute__ ((__nothrow__));
3045 extern char *__stpcpy (char *__restrict __dest, __const char *__restrict __src)
3046 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
3047 extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src)
3048 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
3052 extern char *__stpncpy (char *__restrict __dest,
3053 __const char *__restrict __src, size_t __n)
3054 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
3055 extern char *stpncpy (char *__restrict __dest,
3056 __const char *__restrict __src, size_t __n)
3057 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
3062 extern int strverscmp (__const char *__s1, __const char *__s2)
3063 __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
3066 extern char *strfry (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3069 extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3070 # 604 "/usr/include/string.h" 3 4
3071 extern char *basename (__const char *__filename) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3072 # 632 "/usr/include/string.h" 3 4
3073 # 1 "/usr/include/bits/string.h" 1 3 4
3074 # 633 "/usr/include/string.h" 2 3 4
3077 # 1 "/usr/include/bits/string2.h" 1 3 4
3078 # 394 "/usr/include/bits/string2.h" 3 4
3079 extern void *__rawmemchr (const void *__s, int __c);
3080 # 969 "/usr/include/bits/string2.h" 3 4
3081 extern __inline size_t __strcspn_c1 (__const char *__s, int __reject);
3082 extern __inline size_t
3083 __strcspn_c1 (__const char *__s, int __reject)
3085 register size_t __result = 0;
3086 while (__s[__result] != '\0' && __s[__result] != __reject)
3091 extern __inline size_t __strcspn_c2 (__const char *__s, int __reject1,
3093 extern __inline size_t
3094 __strcspn_c2 (__const char *__s, int __reject1, int __reject2)
3096 register size_t __result = 0;
3097 while (__s[__result] != '\0' && __s[__result] != __reject1
3098 && __s[__result] != __reject2)
3103 extern __inline size_t __strcspn_c3 (__const char *__s, int __reject1,
3104 int __reject2, int __reject3);
3105 extern __inline size_t
3106 __strcspn_c3 (__const char *__s, int __reject1, int __reject2,
3109 register size_t __result = 0;
3110 while (__s[__result] != '\0' && __s[__result] != __reject1
3111 && __s[__result] != __reject2 && __s[__result] != __reject3)
3115 # 1045 "/usr/include/bits/string2.h" 3 4
3116 extern __inline size_t __strspn_c1 (__const char *__s, int __accept);
3117 extern __inline size_t
3118 __strspn_c1 (__const char *__s, int __accept)
3120 register size_t __result = 0;
3122 while (__s[__result] == __accept)
3127 extern __inline size_t __strspn_c2 (__const char *__s, int __accept1,
3129 extern __inline size_t
3130 __strspn_c2 (__const char *__s, int __accept1, int __accept2)
3132 register size_t __result = 0;
3134 while (__s[__result] == __accept1 || __s[__result] == __accept2)
3139 extern __inline size_t __strspn_c3 (__const char *__s, int __accept1,
3140 int __accept2, int __accept3);
3141 extern __inline size_t
3142 __strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3)
3144 register size_t __result = 0;
3146 while (__s[__result] == __accept1 || __s[__result] == __accept2
3147 || __s[__result] == __accept3)
3151 # 1121 "/usr/include/bits/string2.h" 3 4
3152 extern __inline char *__strpbrk_c2 (__const char *__s, int __accept1,
3154 extern __inline char *
3155 __strpbrk_c2 (__const char *__s, int __accept1, int __accept2)
3158 while (*__s != '\0' && *__s != __accept1 && *__s != __accept2)
3160 return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s;
3163 extern __inline char *__strpbrk_c3 (__const char *__s, int __accept1,
3164 int __accept2, int __accept3);
3165 extern __inline char *
3166 __strpbrk_c3 (__const char *__s, int __accept1, int __accept2,
3170 while (*__s != '\0' && *__s != __accept1 && *__s != __accept2
3171 && *__s != __accept3)
3173 return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s;
3175 # 1172 "/usr/include/bits/string2.h" 3 4
3176 extern __inline char *__strtok_r_1c (char *__s, char __sep, char **__nextp);
3177 extern __inline char *
3178 __strtok_r_1c (char *__s, char __sep, char **__nextp)
3181 if (__s == ((void *)0))
3183 while (*__s == __sep)
3185 __result = ((void *)0);
3189 while (*__s != '\0')
3190 if (*__s++ == __sep)
3199 # 1204 "/usr/include/bits/string2.h" 3 4
3200 extern char *__strsep_g (char **__stringp, __const char *__delim);
3201 # 1222 "/usr/include/bits/string2.h" 3 4
3202 extern __inline char *__strsep_1c (char **__s, char __reject);
3203 extern __inline char *
3204 __strsep_1c (char **__s, char __reject)
3206 register char *__retval = *__s;
3207 if (__retval != ((void *)0) && (*__s = (__extension__ (__builtin_constant_p (__reject) && !__builtin_constant_p (__retval) && (__reject) == '\0' ? (char *) __rawmemchr (__retval, __reject) : __builtin_strchr (__retval, __reject)))) != ((void *)0))
3212 extern __inline char *__strsep_2c (char **__s, char __reject1, char __reject2);
3213 extern __inline char *
3214 __strsep_2c (char **__s, char __reject1, char __reject2)
3216 register char *__retval = *__s;
3217 if (__retval != ((void *)0))
3219 register char *__cp = __retval;
3227 if (*__cp == __reject1 || *__cp == __reject2)
3239 extern __inline char *__strsep_3c (char **__s, char __reject1, char __reject2,
3241 extern __inline char *
3242 __strsep_3c (char **__s, char __reject1, char __reject2, char __reject3)
3244 register char *__retval = *__s;
3245 if (__retval != ((void *)0))
3247 register char *__cp = __retval;
3255 if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3)
3266 # 1303 "/usr/include/bits/string2.h" 3 4
3267 extern char *__strdup (__const char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__));
3268 # 1322 "/usr/include/bits/string2.h" 3 4
3269 extern char *__strndup (__const char *__string, size_t __n)
3270 __attribute__ ((__nothrow__)) __attribute__ ((__malloc__));
3271 # 636 "/usr/include/string.h" 2 3 4
3276 # 1 "/usr/include/bits/string3.h" 1 3 4
3277 # 23 "/usr/include/bits/string3.h" 3 4
3278 extern void __warn_memset_zero_len (void) __attribute__((__warning__ ("memset used with constant zero length parameter; this could be due to transposed parameters")))
3280 # 48 "/usr/include/bits/string3.h" 3 4
3281 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) void *
3282 __attribute__ ((__nothrow__)) memcpy (void *__restrict __dest, __const void *__restrict __src, size_t __len)
3285 return __builtin___memcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
3288 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) void *
3289 __attribute__ ((__nothrow__)) memmove (void *__restrict __dest, __const void *__restrict __src, size_t __len)
3292 return __builtin___memmove_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
3296 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) void *
3297 __attribute__ ((__nothrow__)) mempcpy (void *__restrict __dest, __const void *__restrict __src, size_t __len)
3300 return __builtin___mempcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
3302 # 77 "/usr/include/bits/string3.h" 3 4
3303 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) void *
3304 __attribute__ ((__nothrow__)) memset (void *__dest, int __ch, size_t __len)
3306 if (__builtin_constant_p (__len) && __len == 0
3307 && (!__builtin_constant_p (__ch) || __ch != 0))
3309 __warn_memset_zero_len ();
3312 return __builtin___memset_chk (__dest, __ch, __len, __builtin_object_size (__dest, 0));
3316 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) void
3317 __attribute__ ((__nothrow__)) bcopy (__const void *__restrict __src, void *__restrict __dest, size_t __len)
3320 (void) __builtin___memmove_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
3323 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) void
3324 __attribute__ ((__nothrow__)) bzero (void *__dest, size_t __len)
3326 (void) __builtin___memset_chk (__dest, '\0', __len, __builtin_object_size (__dest, 0));
3330 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) char *
3331 __attribute__ ((__nothrow__)) strcpy (char *__restrict __dest, __const char *__restrict __src)
3333 return __builtin___strcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
3337 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) char *
3338 __attribute__ ((__nothrow__)) stpcpy (char *__restrict __dest, __const char *__restrict __src)
3340 return __builtin___stpcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
3345 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) char *
3346 __attribute__ ((__nothrow__)) strncpy (char *__restrict __dest, __const char *__restrict __src, size_t __len)
3349 return __builtin___strncpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 2 > 1));
3353 extern char *__stpncpy_chk (char *__dest, __const char *__src, size_t __n,
3354 size_t __destlen) __attribute__ ((__nothrow__));
3355 extern char *__stpncpy_alias (char *__dest, __const char *__src, size_t __n) __asm__ ("" "stpncpy") __attribute__ ((__nothrow__))
3359 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) char *
3360 __attribute__ ((__nothrow__)) stpncpy (char *__dest, __const char *__src, size_t __n)
3362 if (__builtin_object_size (__dest, 2 > 1) != (size_t) -1
3363 && (!__builtin_constant_p (__n) || __n <= __builtin_object_size (__dest, 2 > 1)))
3364 return __stpncpy_chk (__dest, __src, __n, __builtin_object_size (__dest, 2 > 1));
3365 return __stpncpy_alias (__dest, __src, __n);
3369 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) char *
3370 __attribute__ ((__nothrow__)) strcat (char *__restrict __dest, __const char *__restrict __src)
3372 return __builtin___strcat_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
3376 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__artificial__)) char *
3377 __attribute__ ((__nothrow__)) strncat (char *__restrict __dest, __const char *__restrict __src, size_t __len)
3380 return __builtin___strncat_chk (__dest, __src, __len, __builtin_object_size (__dest, 2 > 1));
3382 # 641 "/usr/include/string.h" 2 3 4
3387 # 21 "scenarios.c" 2
3389 # 1 "/usr/include/sys/stat.h" 1 3 4
3390 # 39 "/usr/include/sys/stat.h" 3 4
3391 # 1 "/usr/include/time.h" 1 3 4
3392 # 40 "/usr/include/sys/stat.h" 2 3 4
3393 # 105 "/usr/include/sys/stat.h" 3 4
3396 # 1 "/usr/include/bits/stat.h" 1 3 4
3397 # 36 "/usr/include/bits/stat.h" 3 4
3401 unsigned short int __pad1;
3412 unsigned short int __pad2;
3418 __blksize_t st_blksize;
3421 __blkcnt_t st_blocks;
3422 # 70 "/usr/include/bits/stat.h" 3 4
3423 struct timespec st_atim;
3424 struct timespec st_mtim;
3425 struct timespec st_ctim;
3426 # 85 "/usr/include/bits/stat.h" 3 4
3427 unsigned long int __unused4;
3428 unsigned long int __unused5;
3438 unsigned int __pad1;
3446 unsigned int __pad2;
3448 __blksize_t st_blksize;
3450 __blkcnt64_t st_blocks;
3458 struct timespec st_atim;
3459 struct timespec st_mtim;
3460 struct timespec st_ctim;
3461 # 127 "/usr/include/bits/stat.h" 3 4
3464 # 108 "/usr/include/sys/stat.h" 2 3 4
3465 # 209 "/usr/include/sys/stat.h" 3 4
3466 extern int stat (__const char *__restrict __file,
3467 struct stat *__restrict __buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
3471 extern int fstat (int __fd, struct stat *__buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
3472 # 228 "/usr/include/sys/stat.h" 3 4
3473 extern int stat64 (__const char *__restrict __file,
3474 struct stat64 *__restrict __buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
3475 extern int fstat64 (int __fd, struct stat64 *__buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
3483 extern int fstatat (int __fd, __const char *__restrict __file,
3484 struct stat *__restrict __buf, int __flag)
3485 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
3486 # 253 "/usr/include/sys/stat.h" 3 4
3487 extern int fstatat64 (int __fd, __const char *__restrict __file,
3488 struct stat64 *__restrict __buf, int __flag)
3489 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
3497 extern int lstat (__const char *__restrict __file,
3498 struct stat *__restrict __buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
3499 # 276 "/usr/include/sys/stat.h" 3 4
3500 extern int lstat64 (__const char *__restrict __file,
3501 struct stat64 *__restrict __buf)
3502 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
3508 extern int chmod (__const char *__file, __mode_t __mode)
3509 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3515 extern int lchmod (__const char *__file, __mode_t __mode)
3516 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3521 extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__));
3527 extern int fchmodat (int __fd, __const char *__file, __mode_t __mode,
3529 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))) __attribute__ ((__warn_unused_result__));
3536 extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__));
3541 extern __mode_t getumask (void) __attribute__ ((__nothrow__));
3545 extern int mkdir (__const char *__path, __mode_t __mode)
3546 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3552 extern int mkdirat (int __fd, __const char *__path, __mode_t __mode)
3553 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
3560 extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev)
3561 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3567 extern int mknodat (int __fd, __const char *__path, __mode_t __mode,
3568 __dev_t __dev) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
3574 extern int mkfifo (__const char *__path, __mode_t __mode)
3575 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
3581 extern int mkfifoat (int __fd, __const char *__path, __mode_t __mode)
3582 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
3588 extern int utimensat (int __fd, __const char *__path,
3589 __const struct timespec __times[2],
3591 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
3596 extern int futimens (int __fd, __const struct timespec __times[2]) __attribute__ ((__nothrow__));
3597 # 399 "/usr/include/sys/stat.h" 3 4
3598 extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf)
3599 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3)));
3600 extern int __xstat (int __ver, __const char *__filename,
3601 struct stat *__stat_buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
3602 extern int __lxstat (int __ver, __const char *__filename,
3603 struct stat *__stat_buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
3604 extern int __fxstatat (int __ver, int __fildes, __const char *__filename,
3605 struct stat *__stat_buf, int __flag)
3606 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4)));
3607 # 432 "/usr/include/sys/stat.h" 3 4
3608 extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf)
3609 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3)));
3610 extern int __xstat64 (int __ver, __const char *__filename,
3611 struct stat64 *__stat_buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
3612 extern int __lxstat64 (int __ver, __const char *__filename,
3613 struct stat64 *__stat_buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
3614 extern int __fxstatat64 (int __ver, int __fildes, __const char *__filename,
3615 struct stat64 *__stat_buf, int __flag)
3616 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4)));
3618 extern int __xmknod (int __ver, __const char *__path, __mode_t __mode,
3619 __dev_t *__dev) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4)));
3621 extern int __xmknodat (int __ver, int __fd, __const char *__path,
3622 __mode_t __mode, __dev_t *__dev)
3623 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 5)));
3629 __attribute__ ((__nothrow__)) stat (__const char *__path, struct stat *__statbuf)
3631 return __xstat (3, __path, __statbuf);
3636 __attribute__ ((__nothrow__)) lstat (__const char *__path, struct stat *__statbuf)
3638 return __lxstat (3, __path, __statbuf);
3643 __attribute__ ((__nothrow__)) fstat (int __fd, struct stat *__statbuf)
3645 return __fxstat (3, __fd, __statbuf);
3650 __attribute__ ((__nothrow__)) fstatat (int __fd, __const char *__filename, struct stat *__statbuf, int __flag)
3653 return __fxstatat (3, __fd, __filename, __statbuf, __flag);
3659 __attribute__ ((__nothrow__)) mknod (__const char *__path, __mode_t __mode, __dev_t __dev)
3661 return __xmknod (1, __path, __mode, &__dev);
3667 __attribute__ ((__nothrow__)) mknodat (int __fd, __const char *__path, __mode_t __mode, __dev_t __dev)
3670 return __xmknodat (1, __fd, __path, __mode, &__dev);
3678 __attribute__ ((__nothrow__)) stat64 (__const char *__path, struct stat64 *__statbuf)
3680 return __xstat64 (3, __path, __statbuf);
3685 __attribute__ ((__nothrow__)) lstat64 (__const char *__path, struct stat64 *__statbuf)
3687 return __lxstat64 (3, __path, __statbuf);
3692 __attribute__ ((__nothrow__)) fstat64 (int __fd, struct stat64 *__statbuf)
3694 return __fxstat64 (3, __fd, __statbuf);
3699 __attribute__ ((__nothrow__)) fstatat64 (int __fd, __const char *__filename, struct stat64 *__statbuf, int __flag)
3702 return __fxstatat64 (3, __fd, __filename, __statbuf, __flag);
3711 # 23 "scenarios.c" 2
3712 # 1 "/usr/include/SDL/SDL_endian.h" 1
3713 # 31 "/usr/include/SDL/SDL_endian.h"
3714 # 1 "/usr/include/SDL/SDL_stdinc.h" 1
3715 # 30 "/usr/include/SDL/SDL_stdinc.h"
3716 # 1 "/usr/include/SDL/SDL_config.h" 1
3717 # 30 "/usr/include/SDL/SDL_config.h"
3718 # 1 "/usr/include/SDL/SDL_platform.h" 1
3719 # 31 "/usr/include/SDL/SDL_config.h" 2
3720 # 31 "/usr/include/SDL/SDL_stdinc.h" 2
3721 # 41 "/usr/include/SDL/SDL_stdinc.h"
3722 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/include/stddef.h" 1 3 4
3723 # 149 "/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/include/stddef.h" 3 4
3724 typedef int ptrdiff_t;
3725 # 42 "/usr/include/SDL/SDL_stdinc.h" 2
3726 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/include/stdarg.h" 1 3 4
3727 # 43 "/usr/include/SDL/SDL_stdinc.h" 2
3728 # 63 "/usr/include/SDL/SDL_stdinc.h"
3729 # 1 "/usr/include/strings.h" 1 3 4
3730 # 64 "/usr/include/SDL/SDL_stdinc.h" 2
3733 # 1 "/usr/include/inttypes.h" 1 3 4
3734 # 28 "/usr/include/inttypes.h" 3 4
3735 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/include/stdint.h" 1 3 4
3738 # 1 "/usr/include/stdint.h" 1 3 4
3739 # 27 "/usr/include/stdint.h" 3 4
3740 # 1 "/usr/include/bits/wchar.h" 1 3 4
3741 # 28 "/usr/include/stdint.h" 2 3 4
3742 # 1 "/usr/include/bits/wordsize.h" 1 3 4
3743 # 29 "/usr/include/stdint.h" 2 3 4
3744 # 49 "/usr/include/stdint.h" 3 4
3745 typedef unsigned char uint8_t;
3746 typedef unsigned short int uint16_t;
3748 typedef unsigned int uint32_t;
3755 typedef unsigned long long int uint64_t;
3762 typedef signed char int_least8_t;
3763 typedef short int int_least16_t;
3764 typedef int int_least32_t;
3769 typedef long long int int_least64_t;
3773 typedef unsigned char uint_least8_t;
3774 typedef unsigned short int uint_least16_t;
3775 typedef unsigned int uint_least32_t;
3780 typedef unsigned long long int uint_least64_t;
3787 typedef signed char int_fast8_t;
3793 typedef int int_fast16_t;
3794 typedef int int_fast32_t;
3796 typedef long long int int_fast64_t;
3800 typedef unsigned char uint_fast8_t;
3806 typedef unsigned int uint_fast16_t;
3807 typedef unsigned int uint_fast32_t;
3809 typedef unsigned long long int uint_fast64_t;
3810 # 126 "/usr/include/stdint.h" 3 4
3811 typedef int intptr_t;
3814 typedef unsigned int uintptr_t;
3815 # 138 "/usr/include/stdint.h" 3 4
3817 typedef long long int intmax_t;
3819 typedef unsigned long long int uintmax_t;
3820 # 4 "/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/include/stdint.h" 2 3 4
3821 # 29 "/usr/include/inttypes.h" 2 3 4
3828 typedef long int __gwchar_t;
3829 # 274 "/usr/include/inttypes.h" 3 4
3831 # 288 "/usr/include/inttypes.h" 3 4
3842 extern intmax_t imaxabs (intmax_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
3845 extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom)
3846 __attribute__ ((__nothrow__)) __attribute__ ((__const__));
3849 extern intmax_t strtoimax (__const char *__restrict __nptr,
3850 char **__restrict __endptr, int __base) __attribute__ ((__nothrow__));
3853 extern uintmax_t strtoumax (__const char *__restrict __nptr,
3854 char ** __restrict __endptr, int __base) __attribute__ ((__nothrow__));
3857 extern intmax_t wcstoimax (__const __gwchar_t *__restrict __nptr,
3858 __gwchar_t **__restrict __endptr, int __base)
3859 __attribute__ ((__nothrow__));
3862 extern uintmax_t wcstoumax (__const __gwchar_t *__restrict __nptr,
3863 __gwchar_t ** __restrict __endptr, int __base)
3864 __attribute__ ((__nothrow__));
3865 # 379 "/usr/include/inttypes.h" 3 4
3867 extern long long int __strtoll_internal (__const char *__restrict __nptr,
3868 char **__restrict __endptr,
3869 int __base, int __group)
3870 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3872 extern __inline intmax_t
3873 __attribute__ ((__nothrow__)) strtoimax (__const char *__restrict nptr, char **__restrict endptr, int base)
3876 return __strtoll_internal (nptr, endptr, base, 0);
3880 extern unsigned long long int __strtoull_internal (__const char *
3883 __restrict __endptr,
3886 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3888 extern __inline uintmax_t
3889 __attribute__ ((__nothrow__)) strtoumax (__const char *__restrict nptr, char **__restrict endptr, int base)
3892 return __strtoull_internal (nptr, endptr, base, 0);
3896 extern long long int __wcstoll_internal (__const __gwchar_t *
3898 __gwchar_t **__restrict __endptr,
3899 int __base, int __group)
3900 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3902 extern __inline intmax_t
3903 __attribute__ ((__nothrow__)) wcstoimax (__const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base)
3906 return __wcstoll_internal (nptr, endptr, base, 0);
3911 extern unsigned long long int __wcstoull_internal (__const __gwchar_t *
3914 __restrict __endptr,
3917 __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__));
3919 extern __inline uintmax_t
3920 __attribute__ ((__nothrow__)) wcstoumax (__const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base)
3923 return __wcstoull_internal (nptr, endptr, base, 0);
3930 # 67 "/usr/include/SDL/SDL_stdinc.h" 2
3935 # 1 "/usr/include/ctype.h" 1 3 4
3936 # 30 "/usr/include/ctype.h" 3 4
3938 # 48 "/usr/include/ctype.h" 3 4
3941 _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)),
3942 _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)),
3943 _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)),
3944 _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)),
3945 _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)),
3946 _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)),
3947 _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)),
3948 _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)),
3949 _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)),
3950 _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)),
3951 _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)),
3952 _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8))
3954 # 81 "/usr/include/ctype.h" 3 4
3955 extern __const unsigned short int **__ctype_b_loc (void)
3956 __attribute__ ((__nothrow__)) __attribute__ ((__const));
3957 extern __const __int32_t **__ctype_tolower_loc (void)
3958 __attribute__ ((__nothrow__)) __attribute__ ((__const));
3959 extern __const __int32_t **__ctype_toupper_loc (void)
3960 __attribute__ ((__nothrow__)) __attribute__ ((__const));
3961 # 96 "/usr/include/ctype.h" 3 4
3968 extern int isalnum (int) __attribute__ ((__nothrow__));
3969 extern int isalpha (int) __attribute__ ((__nothrow__));
3970 extern int iscntrl (int) __attribute__ ((__nothrow__));
3971 extern int isdigit (int) __attribute__ ((__nothrow__));
3972 extern int islower (int) __attribute__ ((__nothrow__));
3973 extern int isgraph (int) __attribute__ ((__nothrow__));
3974 extern int isprint (int) __attribute__ ((__nothrow__));
3975 extern int ispunct (int) __attribute__ ((__nothrow__));
3976 extern int isspace (int) __attribute__ ((__nothrow__));
3977 extern int isupper (int) __attribute__ ((__nothrow__));
3978 extern int isxdigit (int) __attribute__ ((__nothrow__));
3982 extern int tolower (int __c) __attribute__ ((__nothrow__));
3985 extern int toupper (int __c) __attribute__ ((__nothrow__));
3994 extern int isblank (int) __attribute__ ((__nothrow__));
4001 extern int isctype (int __c, int __mask) __attribute__ ((__nothrow__));
4008 extern int isascii (int __c) __attribute__ ((__nothrow__));
4012 extern int toascii (int __c) __attribute__ ((__nothrow__));
4016 extern int _toupper (int) __attribute__ ((__nothrow__));
4017 extern int _tolower (int) __attribute__ ((__nothrow__));
4018 # 190 "/usr/include/ctype.h" 3 4
4020 __attribute__ ((__nothrow__)) tolower (int __c)
4022 return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c;
4026 __attribute__ ((__nothrow__)) toupper (int __c)
4028 return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c;
4030 # 247 "/usr/include/ctype.h" 3 4
4031 extern int isalnum_l (int, __locale_t) __attribute__ ((__nothrow__));
4032 extern int isalpha_l (int, __locale_t) __attribute__ ((__nothrow__));
4033 extern int iscntrl_l (int, __locale_t) __attribute__ ((__nothrow__));
4034 extern int isdigit_l (int, __locale_t) __attribute__ ((__nothrow__));
4035 extern int islower_l (int, __locale_t) __attribute__ ((__nothrow__));
4036 extern int isgraph_l (int, __locale_t) __attribute__ ((__nothrow__));
4037 extern int isprint_l (int, __locale_t) __attribute__ ((__nothrow__));
4038 extern int ispunct_l (int, __locale_t) __attribute__ ((__nothrow__));
4039 extern int isspace_l (int, __locale_t) __attribute__ ((__nothrow__));
4040 extern int isupper_l (int, __locale_t) __attribute__ ((__nothrow__));
4041 extern int isxdigit_l (int, __locale_t) __attribute__ ((__nothrow__));
4043 extern int isblank_l (int, __locale_t) __attribute__ ((__nothrow__));
4047 extern int __tolower_l (int __c, __locale_t __l) __attribute__ ((__nothrow__));
4048 extern int tolower_l (int __c, __locale_t __l) __attribute__ ((__nothrow__));
4051 extern int __toupper_l (int __c, __locale_t __l) __attribute__ ((__nothrow__));
4052 extern int toupper_l (int __c, __locale_t __l) __attribute__ ((__nothrow__));
4053 # 323 "/usr/include/ctype.h" 3 4
4055 # 72 "/usr/include/SDL/SDL_stdinc.h" 2
4058 # 1 "/usr/include/iconv.h" 1 3 4
4059 # 24 "/usr/include/iconv.h" 3 4
4060 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.5.0/include/stddef.h" 1 3 4
4061 # 25 "/usr/include/iconv.h" 2 3 4
4067 typedef void *iconv_t;
4075 extern iconv_t iconv_open (__const char *__tocode, __const char *__fromcode);
4080 extern size_t iconv (iconv_t __cd, char **__restrict __inbuf,
4081 size_t *__restrict __inbytesleft,
4082 char **__restrict __outbuf,
4083 size_t *__restrict __outbytesleft);
4089 extern int iconv_close (iconv_t __cd);
4092 # 75 "/usr/include/SDL/SDL_stdinc.h" 2
4093 # 93 "/usr/include/SDL/SDL_stdinc.h"
4099 typedef int8_t Sint8;
4100 typedef uint8_t Uint8;
4101 typedef int16_t Sint16;
4102 typedef uint16_t Uint16;
4103 typedef int32_t Sint32;
4104 typedef uint32_t Uint32;
4107 typedef int64_t Sint64;
4109 typedef uint64_t Uint64;
4110 # 125 "/usr/include/SDL/SDL_stdinc.h"
4111 typedef int SDL_dummy_uint8[(sizeof(Uint8) == 1) * 2 - 1];
4112 typedef int SDL_dummy_sint8[(sizeof(Sint8) == 1) * 2 - 1];
4113 typedef int SDL_dummy_uint16[(sizeof(Uint16) == 2) * 2 - 1];
4114 typedef int SDL_dummy_sint16[(sizeof(Sint16) == 2) * 2 - 1];
4115 typedef int SDL_dummy_uint32[(sizeof(Uint32) == 4) * 2 - 1];
4116 typedef int SDL_dummy_sint32[(sizeof(Sint32) == 4) * 2 - 1];
4117 typedef int SDL_dummy_uint64[(sizeof(Uint64) == 8) * 2 - 1];
4118 typedef int SDL_dummy_sint64[(sizeof(Sint64) == 8) * 2 - 1];
4119 # 146 "/usr/include/SDL/SDL_stdinc.h"
4125 typedef int SDL_dummy_enum[(sizeof(SDL_DUMMY_ENUM) == sizeof(int)) * 2 - 1];
4129 # 1 "/usr/include/SDL/begin_code.h" 1
4130 # 156 "/usr/include/SDL/SDL_stdinc.h" 2
4131 # 403 "/usr/include/SDL/SDL_stdinc.h"
4132 extern __attribute__ ((visibility("default"))) size_t SDL_strlcpy(char *dst, const char *src, size_t maxlen);
4138 extern __attribute__ ((visibility("default"))) size_t SDL_strlcat(char *dst, const char *src, size_t maxlen);
4139 # 421 "/usr/include/SDL/SDL_stdinc.h"
4140 extern __attribute__ ((visibility("default"))) char * SDL_strrev(char *string);
4146 extern __attribute__ ((visibility("default"))) char * SDL_strupr(char *string);
4152 extern __attribute__ ((visibility("default"))) char * SDL_strlwr(char *string);
4153 # 467 "/usr/include/SDL/SDL_stdinc.h"
4154 extern __attribute__ ((visibility("default"))) char * SDL_ltoa(long value, char *string, int radix);
4155 # 479 "/usr/include/SDL/SDL_stdinc.h"
4156 extern __attribute__ ((visibility("default"))) char * SDL_ultoa(unsigned long value, char *string, int radix);
4157 # 499 "/usr/include/SDL/SDL_stdinc.h"
4158 extern __attribute__ ((visibility("default"))) char* SDL_lltoa(Sint64 value, char *string, int radix);
4164 extern __attribute__ ((visibility("default"))) char* SDL_ulltoa(Uint64 value, char *string, int radix);
4165 # 605 "/usr/include/SDL/SDL_stdinc.h"
4166 extern __attribute__ ((visibility("default"))) size_t SDL_iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
4170 extern __attribute__ ((visibility("default"))) char * SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft);
4171 # 618 "/usr/include/SDL/SDL_stdinc.h"
4172 # 1 "/usr/include/SDL/close_code.h" 1
4173 # 619 "/usr/include/SDL/SDL_stdinc.h" 2
4174 # 32 "/usr/include/SDL/SDL_endian.h" 2
4175 # 54 "/usr/include/SDL/SDL_endian.h"
4176 # 1 "/usr/include/SDL/begin_code.h" 1
4177 # 55 "/usr/include/SDL/SDL_endian.h" 2
4178 # 70 "/usr/include/SDL/SDL_endian.h"
4179 static __inline__ Uint16 SDL_Swap16(Uint16 x)
4181 __asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x));
4184 # 103 "/usr/include/SDL/SDL_endian.h"
4185 static __inline__ Uint32 SDL_Swap32(Uint32 x)
4187 __asm__("bswap %0" : "=r" (x) : "0" (x));
4190 # 139 "/usr/include/SDL/SDL_endian.h"
4191 static __inline__ Uint64 SDL_Swap64(Uint64 x)
4194 struct { Uint32 a,b; } s;
4198 __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
4199 : "=r" (v.s.a), "=r" (v.s.b)
4200 : "0" (v.s.a), "1" (v.s.b));
4203 # 207 "/usr/include/SDL/SDL_endian.h"
4204 # 1 "/usr/include/SDL/close_code.h" 1
4205 # 208 "/usr/include/SDL/SDL_endian.h" 2
4206 # 24 "scenarios.c" 2
4209 int units_find_panzequp();
4216 int units_find_tacicons();
4224 int units_convert_database( char *tac_icons );
4232 int units_convert_graphics( char *tac_icons );
4233 # 25 "scenarios.c" 2
4245 inline void set_delay( Delay *delay, int ms );
4248 inline void reset_delay( Delay *delay );
4251 inline int timed_out( Delay *delay, int ms );
4254 int get_dist( int x1, int y1, int x2, int y2 );
4257 void set_random_seed();
4260 void get_coord( char *str, int *x, int *y );
4268 Text* create_text( char *str, int char_width );
4270 void delete_text( Text *text );
4277 void delete_string_list( char ***list, int *count );
4285 typedef struct { char *string; int flag; } StrToFlag;
4292 int check_flag( char *name, StrToFlag *fct );
4299 int get_close_hex_pos( int x, int y, int id, int *dest_x, int *dest_y );
4306 int is_close( int x1, int y1, int x2, int y2 );
4313 void strcpy_lt( char *dest, char *src, int limit );
4320 char *strlower( const char *str );
4327 FILE *open_file( const char *name );
4334 void copy( char *sname, char *dname );
4335 int copy_pg_bmp( char *src, char *dest );
4342 const char *get_gamedir(void);
4343 # 26 "scenarios.c" 2
4346 int scenarios_convert( int scen_id );
4347 # 27 "scenarios.c" 2
4352 typedef struct _List_Entry {
4353 struct _List_Entry *next;
4354 struct _List_Entry *prev;
4362 void (*callback)(void*);
4363 List_Entry *cur_entry;
4366 enum { LIST_NO_AUTO_DELETE = 0, LIST_AUTO_DELETE };
4367 enum { LIST_NO_CALLBACK = 0 };
4368 List *list_create( int auto_delete, void (*callback)(void*) );
4374 void list_delete( List *list );
4381 void list_clear( List *list );
4388 int list_insert( List *list, void *item, int pos );
4394 int list_add( List *list, void *item );
4402 int list_delete_pos( List *list, int pos );
4410 int list_delete_item( List *list, void *item );
4416 int list_delete_entry( List *list, List_Entry *entry );
4423 void* list_get( List *list, int pos );
4430 int list_check( List *list, void *item );
4438 void* list_first( List *list );
4446 void* list_last( List *list );
4453 void* list_current( List *list );
4459 void list_reset( List *list );
4466 void* list_next( List *list );
4473 void* list_prev( List *list );
4481 int list_delete_current( List *list );
4488 int list_empty( List *list );
4495 List_Entry *list_entry( List *list, void *item );
4503 void list_transfer( List *source, List *dest, void *item );
4509 void *list_dequeue( List *list );
4518 List* parser_split_string( char *string, char *symbols );
4526 List *parser_explode_string( char *string, char c );
4528 PData* parser_read_file( char *tree_name, char *fname );
4535 void parser_free( PData **pdata );
4537 int parser_get_pdata ( PData *pd, char *name, PData **result );
4538 int parser_get_entries( PData *pd, char *name, List **result );
4539 int parser_get_values ( PData *pd, char *name, List **result );
4540 int parser_get_value ( PData *pd, char *name, char **result, int index );
4541 int parser_get_int ( PData *pd, char *name, int *result );
4542 int parser_get_double ( PData *pd, char *name, double *result );
4543 int parser_get_string ( PData *pd, char *name, char **result );
4550 char* parser_get_error( void );
4551 # 28 "scenarios.c" 2
4558 extern char *source_path;
4559 extern char *dest_path;
4560 extern char *custom_name;
4561 extern int nation_count;
4562 extern char *nations[];
4564 int unit_entry_used[1000];
4612 char *ai_modules[] = {
4614 "default", "default",
4615 "default", "default",
4616 "default", "default",
4617 "default", "default",
4618 "default", "default",
4619 "default", "default",
4620 "default", "default",
4621 "default", "default",
4622 "default", "default",
4623 "default", "default",
4624 "default", "default",
4625 "default", "default",
4626 "default", "default",
4627 "default", "default",
4628 "default", "default",
4629 "default", "default",
4630 "default", "default",
4631 "default", "default",
4632 "default", "default",
4633 "default", "default",
4634 "default", "default",
4635 "default", "default",
4636 "default", "default",
4637 "default", "default",
4638 "default", "default",
4639 "default", "default",
4640 "default", "default",
4641 "default", "default",
4642 "default", "default",
4643 "default", "default",
4644 "default", "default",
4645 "default", "default",
4646 "default", "default",
4647 "default", "default",
4648 "default", "default",
4649 "default", "default",
4650 "default", "default",
4651 "default", "default",
4652 "default", "default"
4659 int prestige_per_turn[] = {
4702 void random_seed( int _seed )
4706 int random_get( int low, int high )
4708 int p1 = 1103515245;
4710 seed = ( seed * p1 + p2 ) % 2147483647;
4711 return ( ( abs( seed ) / 3 ) % ( high - low + 1 ) ) + low;
4714 int scen_add_flags( FILE *dest_file, FILE *scen_file, int id )
4718 int width, height, ibuf;
4723 memset( vic_hexes, 0, sizeof(int) * 40 );
4724 fseek( scen_file, 37, 0 );
4725 for ( i = 0; i < 20; i++ ) {
4726 fread( &vic_hexes[i * 2], 2, 1, scen_file );
4727 vic_hexes[i * 2] = (vic_hexes[i * 2]);
4728 fread( &vic_hexes[i * 2 + 1], 2, 1, scen_file );
4729 vic_hexes[i * 2 + 1] = (vic_hexes[i * 2 + 1]);
4730 if ( vic_hexes[i * 2] >= 1000 || vic_hexes[i * 2] < 0 )
4735 sprintf( path, "%s/MAP%02i.SET", source_path, id );
4736 if ( ( map_file = fopen( path, "r" ) ) == 0 ) {
4737 sprintf( path, "%s/map%02i.set", source_path, id );
4738 if ( ( map_file = fopen( path, "r" ) ) == 0 ) {
4739 fprintf( stderr, "%s: file not found\n", path );
4745 fseek( map_file, 101, 0 );
4746 fread( &width, 2, 1, map_file );
4748 fseek( map_file, 103, 0 );
4749 fread( &height, 2, 1, map_file );
4753 fseek( map_file, 123 + 3 * width * height, 0 );
4754 for ( y = 0; y < height; y++ ) {
4755 for ( x = 0; x < width; x++ ) {
4756 ibuf = 0; fread( &ibuf, 1, 1, map_file );
4759 for ( i = 0; i < obj_count; i++ )
4760 if ( vic_hexes[i * 2] == x && vic_hexes[i * 2 + 1] == y ) {
4763 fprintf( dest_file, "<flag\nx»%i\ny»%i\nnation»%s\nobj»%i\n>\n", x, y, nations[(ibuf - 1) * 3], obj );
4770 void scen_create_random_weather( FILE *dest_file, FILE *scen_file, int month, int turns )
4772 float month_mod[13] = { 0, 1.7, 1.6, 1.0, 2.0, 1.2, 0.7, 0.5, 0.6, 1.4, 1.7, 2.2, 1.7 };
4773 int med_weather[4] = { 0, 16, 24, 36 };
4774 int bad_weather[4] = { 0, 8, 12, 18 };
4776 int init_cond = 0, region = 0;
4778 memset( weather, 0, sizeof( int ) * turns );
4780 fseek( scen_file, 16, 0 );
4781 fread( &init_cond, 1, 1, scen_file );
4782 fread( ®ion, 1, 1, scen_file );
4785 random_seed( month * turns + ( region + 1 ) * ( init_cond + 1 ) );
4786 for ( i = 0; i < turns; i++ ) {
4787 result = random_get( 1, 100 );
4788 if ( result <= (int)( month_mod[month] * bad_weather[region] ) )
4791 if ( result <= (int)( month_mod[month] * med_weather[region] ) )
4796 weather[0] = (init_cond==1)?0:2;
4798 if ( month < 3 || month == 12 ) {
4799 for ( i = 0; i < turns; i++ )
4800 if ( weather[i] == 2 )
4805 fprintf( dest_file, "weather»" );
4807 while ( i < turns ) {
4808 fprintf( dest_file, "%s", weather[i]==0?"fair":weather[i]==1?"clouds":weather[i]==2?"rain":"snow" );
4809 if ( i < turns - 1 )
4810 fprintf( dest_file, "°" );
4813 fprintf( dest_file, "\n" );
4822 void scen_create_pg_weather( FILE *dest_file, int scen_id, FILE *scen_file, int turns )
4825 char *weathers[] = {
4827 "ffffffffffffrooorRff",
4828 "fffforRRRmfffforRROffffff",
4829 "fffffffrROooffffffffffooroffff",
4830 "ffffffffffffoorfffffffffff",
4835 "ffffffffffffffrooooofffsoSISSi",
4838 "ffffffffooorRffffffff",
4841 "ooofffffffforRoffffffff",
4842 "SISSSSSSSIISISSiffsSSSSISSSISSII",
4843 "ffffffffffffffrooffffffff",
4846 "ffffffffffforooffffffffoo",
4848 "ffffffffoorofffffffffff",
4849 "fffffffffoorofffffffffffrooo",
4850 "fffffsooSSSiffffsSffff",
4851 "ffffffffffforofff",
4852 "fffooooosSfffsoSIffffoo",
4853 "ffffffffffffforoooffffffffffffo",
4854 "ffsoSSiffroooroRffffsS",
4855 "fffffffffffffoorofff",
4856 "ffffooosfffffosSSSIif",
4857 "ffffffffffffffrooffffff",
4858 "fffffoorRRRmffffosSf",
4861 "fffffffffffffrffffffff",
4862 "ffffffffffsooofffffoosos",
4867 if (strlen(weathers[scen_id])>0&&strlen(weathers[scen_id])!=turns)
4868 fprintf(stderr,"ERROR: scen %d: mismatch in length of weather (%d) and turn number (%d)\n",
4869 scen_id,strlen(weathers[scen_id]),turns);
4871 fprintf( dest_file, "weather»" );
4873 while ( i < turns ) {
4878 w[0] = weathers[scen_id][i]; w[1] = 0;
4879 if (w[0]=='f') strcpy(w,"fair");
4880 else if (w[0]=='o') strcpy(w,"clouds");
4881 else if (w[0]=='R') strcpy(w,"rain");
4882 else if (w[0]=='S') strcpy(w,"snow");
4884 fprintf( dest_file, "%s", w );
4885 if ( i < turns - 1 )
4886 fprintf( dest_file, "°" );
4889 fprintf( dest_file, "\n" );
4897 void scen_create_unit( int scen_id, FILE *dest_file, FILE *scen_file )
4899 int id = 0, nation = 0, x = 0, y = 0, str = 0, entr = 0, exp = 0, trsp_id = 0, org_trsp_id = 0;
4902 fread( &id, 2, 1, scen_file );
4904 fread( &org_trsp_id, 2, 1, scen_file );
4905 org_trsp_id = (org_trsp_id);
4906 fread( &nation, 1, 1, scen_file ); nation--;
4907 fread( &trsp_id, 2, 1, scen_file );
4908 trsp_id = (trsp_id);
4909 fread( &x, 2, 1, scen_file );
4911 fread( &y, 2, 1, scen_file );
4913 fread( &str, 1, 1, scen_file );
4914 fread( &entr, 1, 1, scen_file );
4915 fread( &exp, 1, 1, scen_file );
4919 if (x==7&&y==14) trsp_id = 86;
4920 if (x==8&&y==23) trsp_id = 86;
4923 unit_entry_used[id - 1] = 1;
4925 unit_entry_used[trsp_id - 1] = 1;
4928 unit_entry_used[org_trsp_id - 1] = 1;
4930 fprintf( dest_file, "<unit\n" );
4931 fprintf( dest_file, "id»%i\nnation»%s\n", id - 1, nations[nation * 3] );
4932 fprintf( dest_file, "x»%i\ny»%i\n", x, y );
4933 fprintf( dest_file, "str»%i\nentr»%i\nexp»%i\n", str, entr, exp );
4934 if ( trsp_id == 0 && org_trsp_id == 0 )
4935 fprintf( dest_file, "trsp»none\n" );
4938 fprintf( dest_file, "trsp»%i\n", trsp_id - 1 );
4940 fprintf( dest_file, "trsp»%i\n", org_trsp_id - 1 );
4942 fprintf( dest_file, ">\n" );
4950 int major_limits[] = {
4998 void scen_add_vic_conds( FILE *file, int id )
5001 if ( id == 15 || id == 16 || id == 17 )
5002 fprintf( file, "<result\ncheck»last_turn\n" );
5004 fprintf( file, "<result\ncheck»every_turn\n" );
5006 if ( major_limits[id] != -1 ) {
5007 fprintf( file, "<cond\n" );
5008 fprintf( file, "<and\n<control_all_hexes\nplayer»axis\n>\n<turns_left\ncount»%i\n>\n>\n", major_limits[id] );
5009 fprintf( file, "result»%s\n", "major" );
5010 fprintf( file, "message»%s\n", "Axis Major Victory" );
5011 fprintf( file, ">\n" );
5012 fprintf( file, "<cond\n" );
5013 fprintf( file, "<and\n<control_all_hexes\nplayer»axis\n>\n>\n" );
5014 fprintf( file, "result»%s\n", "minor" );
5015 fprintf( file, "message»%s\n", "Axis Minor Victory" );
5016 fprintf( file, ">\n" );
5017 fprintf( file, "<else\n" );
5018 fprintf( file, "result»%s\n", "defeat" );
5019 fprintf( file, "message»%s\n", "Axis Defeat" );
5020 fprintf( file, ">\n" );
5025 fprintf( file, "<cond\n" );
5026 fprintf( file, "<and\n"
5027 "<control_hex\nplayer»axis\nx»16\ny»16\n>\n"
5028 "<control_hex\nplayer»axis\nx»26\ny»4\n>\n"
5029 "<control_hex\nplayer»axis\nx»27\ny»21\n>\n"
5030 "<control_hex\nplayer»axis\nx»39\ny»21\n>\n"
5031 "<control_hex\nplayer»axis\nx»48\ny»8\n>\n"
5032 "<control_hex\nplayer»axis\nx»54\ny»14\n>\n"
5033 "<control_hex\nplayer»axis\nx»59\ny»18\n>\n"
5035 fprintf( file, "result»%s\n", "minor" );
5036 fprintf( file, "message»%s\n", "Axis Minor Victory" );
5037 fprintf( file, ">\n" );
5039 fprintf( file, "<cond\n" );
5040 fprintf( file, "<or\n<control_all_hexes\nplayer»axis\n>\n>\n" );
5041 fprintf( file, "result»%s\n", "major" );
5042 fprintf( file, "message»%s\n", "Axis Major Victory" );
5043 fprintf( file, ">\n" );
5045 fprintf( file, "<else\n" );
5046 fprintf( file, "result»%s\n", "defeat" );
5047 fprintf( file, "message»%s\n", "Axis Defeat" );
5048 fprintf( file, ">\n" );
5052 fprintf( file, "<cond\n" );
5055 fprintf( file, "<or\n<control_hex\nplayer»allies\nx»27\ny»5\n>\n<control_hex_num\nplayer»allies\ncount»6\n>\n>\n" );
5058 fprintf( file, "<or\n<control_hex_num\nplayer»allies\ncount»14\n>\n>\n" );
5061 fprintf( file, "<or\n<control_hex\nplayer»allies\nx»13\ny»17\n>\n<control_hex_num\nplayer»allies\ncount»5\n>\n>\n" );
5064 fprintf( file, "<or\n<control_hex_num\nplayer»allies\ncount»4\n>\n>\n" );
5067 fprintf( file, "<or\n<control_hex_num\nplayer»allies\ncount»5\n>\n>\n" );
5070 fprintf( file, "<or\n<control_hex_num\nplayer»allies\ncount»5\n>\n>\n" );
5073 fprintf( file, "<and\n<control_hex\nplayer»allies\nx»37\ny»10\n>\n>\n" );
5076 fprintf( file, "<or\n<control_hex\nplayer»allies\nx»36\ny»14\n>\n<control_hex_num\nplayer»allies\ncount»5\n>\n>\n" );
5079 fprintf( file, "<or\n<control_all_hexes\nplayer»allies\n>\n>\n" );
5082 fprintf( file, "<or\n<control_hex\nplayer»allies\nx»3\ny»12\n>\n>\n" );
5085 fprintf( file, "<or\n<control_hex\nplayer»allies\nx»36\ny»14\n>\n<control_hex_num\nplayer»allies\ncount»8\n>\n>\n" );
5088 fprintf( file, "<or\n<control_hex\nplayer»allies\nx»36\ny»14\n>\n>\n" );
5091 fprintf( file, "result»%s\n", "defeat" );
5092 fprintf( file, "message»%s\n", "Axis Defeat" );
5093 fprintf( file, ">\n" );
5095 fprintf( file, "<cond\n" );
5099 fprintf( file, "<and\n"
5100 "<control_hex\nplayer»axis\nx»11\ny»7\n>\n"
5101 "<control_hex\nplayer»axis\nx»22\ny»28\n>\n"
5102 "<control_hex\nplayer»axis\nx»43\ny»27\n>\n"
5105 else if ( id == 16 )
5108 fprintf( file, "<and\n"
5109 "<control_hex\nplayer»axis\nx»7\ny»3\n>\n"
5110 "<control_hex\nplayer»axis\nx»15\ny»4\n>\n"
5111 "<control_hex\nplayer»axis\nx»5\ny»22\n>\n"
5112 "<control_hex\nplayer»axis\nx»12\ny»27\n>\n"
5113 "<control_hex\nplayer»axis\nx»31\ny»21\n>\n"
5119 fprintf( file, "<or\n<control_all_hexes\nplayer»axis\n>\n>\n" );
5121 fprintf( file, "result»%s\n", "major" );
5122 fprintf( file, "message»%s\n", "Axis Major Victory" );
5123 fprintf( file, ">\n" );
5124 fprintf( file, "<else\n" );
5125 fprintf( file, "result»%s\n", "minor" );
5126 fprintf( file, "message»%s\n", "Axis Minor Victory" );
5127 fprintf( file, ">\n" );
5130 fprintf( file, ">\n" );
5133 int scenarios_convert( int scen_id )
5137 int day, month, year, turns, turns_per_day, days_per_turn, ibuf;
5138 int unit_offset, unit_count;
5139 int axis_orient, axis_strat, allied_strat;
5140 int deploy_fields_count;
5141 int prest_bucket[2], prest_int[2], prest_start[2], prest_per_turn[2];
5143 FILE *dest_file = 0, *scen_file = 0, *aux_file = 0;
5144 PData *pd = 0, *reinf, *unit;
5145 int def_str, def_exp, def_entr;
5147 printf( " scenarios...\n" );
5148 sprintf( path, "%s/scenarios/pg", dest_path );
5149 mkdir( path, (0400|0200|0100) | (0400 >> 3) | (0100 >> 3) | ((0400 >> 3) >> 3) | ((0100 >> 3) >> 3) );
5150 if ( scen_id == -1 ) {
5152 sprintf( path, "%s/scenarios/pg/.order", dest_path );
5153 aux_file = fopen( path, "w" );
5155 for (i = 0; i < sizeof fnames/sizeof fnames[0]; i++)
5156 fprintf( aux_file, "%s\n", fnames[i] );
5159 fprintf( stderr, "Could not write sort order to %s\n", path );
5162 sprintf( path, "%s/convdata/reinf", get_gamedir() );
5163 if ( ( pd = parser_read_file( "reinforcements", path ) ) == 0 ) {
5164 fprintf( stderr, "%s\n", parser_get_error() );
5170 for ( i = (( scen_id == -1 ) ? 1 : scen_id);
5171 i < (( scen_id == -1 ) ? 38 : scen_id) + 1; i++ ) {
5173 if ( scen_id == -1 )
5174 sprintf( path, "%s/scenarios/pg/%s", dest_path, fnames[i - 1] );
5176 sprintf( path, "%s/scenarios/pg/%s", dest_path, custom_name );
5177 if ( ( dest_file = fopen( path, "w" ) ) == 0 ) {
5178 fprintf( stderr, "%s: access denied\n", path );
5182 fprintf( dest_file, "@\n" );
5183 if ( scen_id == -1 ) {
5184 if ( ( aux_file = open_file( "SCENSTAT.BIN" ) ) == 0 )
5186 fseek( aux_file, 40 + (i - 1) * 14, 0 );
5187 fread( dummy, 14, 1, aux_file );
5188 fprintf( dest_file, "name»%s\n", dummy );
5189 fseek( aux_file, 600 + (i - 1) * 160 , 0 );
5190 fread( dummy, 160, 1, aux_file );
5191 fprintf( dest_file, "desc»%s\n", dummy );
5192 fprintf( dest_file, "authors»Strategic Simulation Inc.\n" );
5196 fprintf( dest_file, "name»%s\n", custom_name );
5197 fprintf( dest_file, "desc»none\n" );
5198 fprintf( dest_file, "authors»nobody\n" );
5201 sprintf( path, "GAME%03i.SCN", i );
5202 if ( ( scen_file = open_file( path ) ) == 0 )
5205 fseek( scen_file, 22, 0 );
5206 day = 0; fread( &day, 1, 1, scen_file );
5207 month = 0; fread( &month, 1, 1, scen_file );
5208 year = 0; fread( &year, 1, 1, scen_file );
5209 fprintf( dest_file, "date»%02i.%02i.19%i\n", day, month, year );
5211 fseek( scen_file, 21, 0 );
5212 turns = 0; fread( &turns, 1, 1, scen_file );
5213 fprintf( dest_file, "turns»%i\n", turns );
5214 fseek( scen_file, 25, 0 );
5215 turns_per_day = 0; fread( &turns_per_day, 1, 1, scen_file );
5216 fprintf( dest_file, "turns_per_day»%i\n", turns_per_day );
5217 days_per_turn = 0; fread( &days_per_turn, 1, 1, scen_file );
5218 if ( turns_per_day == 0 && days_per_turn == 0 )
5220 fprintf( dest_file, "days_per_turn»%i\n", days_per_turn );
5222 fprintf( dest_file, "domain»pg\n" );
5224 fprintf( dest_file, "nation_db»pg.ndb\n" );
5226 if ( scen_id == -1 || !units_find_panzequp() )
5227 fprintf( dest_file, "<unit_db\nmain»pg.udb\n>\n" );
5235 if ( scen_id == -1 )
5236 fprintf( dest_file, "map»pg/map%02i\n", i );
5239 scen_create_pg_weather( dest_file, i-1, scen_file, turns );
5241 scen_create_random_weather( dest_file, scen_file, month, turns );
5243 fprintf( dest_file, "<flags\n" );
5244 if ( !scen_add_flags( dest_file, scen_file, i ) ) goto failure;
5245 fprintf( dest_file, ">\n" );
5247 fseek( scen_file, 117, 0 );
5248 ibuf = 0; fread( &ibuf, 1, 1, scen_file );
5249 unit_offset = ibuf * 4 + 135;
5251 if ( scen_id == -1 )
5253 fseek( scen_file, 27, 0 ); fread( &dummy, 6, 1, scen_file );
5254 prest_bucket[0] = dummy[0] + 256*dummy[1];
5255 prest_bucket[1] = dummy[2] + 256*dummy[3];
5256 prest_int[0] = dummy[4];
5257 prest_int[1] = dummy[5];
5258 fseek( scen_file, 0x75, 0 ); fread( &dummy, 1, 1, scen_file );
5259 fseek( scen_file, dummy[0]*4+0x77, 0 ); fread( &dummy, 4, 1, scen_file );
5260 prest_start[0] = dummy[0] + 256 * dummy[1];
5261 prest_start[1] = dummy[2] + 256 * dummy[3];
5267 prest_per_turn[0] = prestige_per_turn[(i-1)*2];
5268 prest_per_turn[1] = prestige_per_turn[(i-1)*2+1];
5270 prest_start[0] += prest_per_turn[0];
5271 prest_start[1] += prest_per_turn[1];
5275 prest_bucket[0] = prest_bucket[1] = 0;
5276 prest_int[0] = prest_int[1] = 0;
5277 prest_start[0] = prest_start[1] = 0;
5278 prest_per_turn[0] = prest_per_turn[1] = 0;
5281 fprintf( dest_file, "<players\n" );
5283 fseek( scen_file, 12, 0 );
5285 axis_orient = 0; fread( &axis_orient, 1, 1, scen_file );
5286 if ( axis_orient == 1 )
5287 sprintf( dummy, "right" );
5289 sprintf( dummy, "left" );
5291 fseek( scen_file, 15, 0 );
5292 axis_strat = 0; fread( &axis_strat, 1, 1, scen_file );
5293 if ( axis_strat == 0 )
5298 fprintf( dest_file, "<axis\nname»Axis\n" );
5299 fprintf( dest_file, "nations»ger°aus°it°hun°bul°rum°fin°esp\n" );
5300 fprintf( dest_file, "allied_players»\n" );
5301 fprintf( dest_file, "orientation»%s\ncontrol»human\nstrategy»%i\n", dummy, axis_strat );
5302 fprintf( dest_file, "start_prestige»%d\nprestige_per_turn»%d\n", prest_start[0], prest_per_turn[0] );
5303 if ( scen_id == -1 )
5304 fprintf( dest_file, "ai_module»%s\n", ai_modules[i*2] );
5306 fprintf( dest_file, "ai_module»default\n" );
5308 fprintf( dest_file, "<transporters\n" );
5310 fseek( scen_file, unit_offset - 8, 0 );
5311 ibuf = 0; fread( &ibuf, 2, 1, scen_file );
5314 fprintf( dest_file, "<air\nunit»%i\ncount»50\n>\n", ibuf - 1 );
5316 fseek( scen_file, unit_offset - 4, 0 );
5317 ibuf = 0; fread( &ibuf, 2, 1, scen_file );
5320 fprintf( dest_file, "<sea\nunit»%i\ncount»50\n>\n", ibuf - 1 );
5321 fprintf( dest_file, ">\n" );
5322 fprintf( dest_file, ">\n" );
5324 if ( axis_orient == 1 )
5325 sprintf( dummy, "left" );
5327 sprintf( dummy, "right" );
5328 if ( axis_strat == 1 )
5332 fprintf( dest_file, "<allies\nname»Allies\n" );
5333 fprintf( dest_file, "nations»bel°lux°den°fra°gre°usa°tur°net°nor°pol°por°so°swe°swi°eng°yug\n" );
5334 fprintf( dest_file, "allied_players»\n" );
5335 fprintf( dest_file, "orientation»%s\ncontrol»cpu\nstrategy»%i\n", dummy, allied_strat );
5336 fprintf( dest_file, "start_prestige»%d\nprestige_per_turn»%d\n", prest_start[1], prest_per_turn[1] );
5337 if ( scen_id == -1 )
5338 fprintf( dest_file, "ai_module»%s\n", ai_modules[i*2 + 1] );
5340 fprintf( dest_file, "ai_module»default\n" );
5342 fprintf( dest_file, "<transporters\n" );
5344 fseek( scen_file, unit_offset - 6, 0 );
5345 ibuf = 0; fread( &ibuf, 2, 1, scen_file );
5348 fprintf( dest_file, "<air\nunit»%i\ncount»50\n>\n", ibuf - 1 );
5350 fseek( scen_file, unit_offset - 2, 0 );
5351 ibuf = 0; fread( &ibuf, 2, 1, scen_file );
5354 fprintf( dest_file, "<sea\nunit»%i\ncount»50\n>\n", ibuf - 1 );
5355 fprintf( dest_file, ">\n" );
5356 fprintf( dest_file, ">\n" );
5357 fprintf( dest_file, ">\n" );
5359 if ( scen_id == -1 )
5360 scen_add_vic_conds( dest_file, i );
5364 fprintf( dest_file, "<result\ncheck»every_turn\n" );
5365 fprintf( dest_file, "<cond\n" );
5366 fprintf( dest_file, "<and\n<control_all_hexes\nplayer»%s\n>\n>\n",
5367 (axis_strat > 0) ? "axis" : "allies" );
5368 fprintf( dest_file, "result»victory\n" );
5369 fprintf( dest_file, "message»%s\n",
5370 (axis_strat > 0) ? "Axis Victory" : "Allied Victory" );
5371 fprintf( dest_file, ">\n" );
5372 fprintf( dest_file, "<else\n" );
5373 fprintf( dest_file, "result»defeat\n" );
5374 fprintf( dest_file, "message»%s\n",
5375 (axis_strat > 0) ? "Axis Defeat" : "Allied Defeat" );
5376 fprintf( dest_file, ">\n" );
5377 fprintf( dest_file, ">\n" );
5380 fseek( scen_file, 117, 0 );
5381 ibuf = 0; fread( &ibuf, 2, 1, scen_file );
5382 deploy_fields_count = (ibuf);
5383 fprintf( dest_file, "<deployfields\n<player\nid»axis\ncoordinates»default°" );
5385 for (j = 0; j < deploy_fields_count - 1; j++) {
5387 ibuf = 0; fread( &ibuf, 2, 1, scen_file );
5389 ibuf = 0; fread( &ibuf, 2, 1, scen_file );
5391 fprintf( dest_file, "%s%d,%d", j ? "°" : "", x, y );
5393 fprintf( dest_file, "\n>\n" );
5394 if (scen_id==-1&&i==19)
5395 fprintf( dest_file, "<player\nid»allies\ncoordinates»none\n>\n" );
5397 fprintf( dest_file, "<player\nid»allies\ncoordinates»default\n>\n" );
5398 fprintf( dest_file, ">\n" );
5402 memset( unit_entry_used, 0, sizeof( unit_entry_used ) );
5404 fseek( scen_file, 33, 0 );
5405 ibuf = 0; fread( &ibuf, 1, 1, scen_file );
5407 ibuf = 0; fread( &ibuf, 1, 1, scen_file );
5409 ibuf = 0; fread( &ibuf, 1, 1, scen_file );
5412 fseek( scen_file, unit_offset, 0 );
5413 fprintf( dest_file, "<units\n" );
5414 for ( j = 0; j < unit_count; j++ )
5415 scen_create_unit( (scen_id!=-1)?(-1):(i-1), dest_file, scen_file );
5417 if ( scen_id == -1 ) {
5418 if ( parser_get_pdata( pd, fnames[i - 1], &reinf ) ) {
5421 def_str = 10; def_exp = 0; def_entr = 0;
5422 list_reset( reinf->entries );
5423 while ( ( unit = list_next( reinf->entries ) ) )
5424 if ( !__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ("unit") && __builtin_constant_p (unit->name) && (__s1_len = strlen ("unit"), __s2_len = strlen (unit->name), (!((size_t)(const void *)(("unit") + 1) - (size_t)(const void *)("unit") == 1) || __s1_len >= 4) && (!((size_t)(const void *)((unit->name) + 1) - (size_t)(const void *)(unit->name) == 1) || __s2_len >= 4)) ? __builtin_strcmp ("unit", unit->name) : (__builtin_constant_p ("unit") && ((size_t)(const void *)(("unit") + 1) - (size_t)(const void *)("unit") == 1) && (__s1_len = strlen ("unit"), __s1_len < 4) ? (__builtin_constant_p (unit->name) && ((size_t)(const void *)((unit->name) + 1) - (size_t)(const void *)(unit->name) == 1) ? __builtin_strcmp ("unit", unit->name) : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) (unit->name); register int __result = (((__const unsigned char *) (__const char *) ("unit"))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ("unit"))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ("unit"))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ("unit"))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (unit->name) && ((size_t)(const void *)((unit->name) + 1) - (size_t)(const void *)(unit->name) == 1) && (__s2_len = strlen (unit->name), __s2_len < 4) ? (__builtin_constant_p ("unit") && ((size_t)(const void *)(("unit") + 1) - (size_t)(const void *)("unit") == 1) ? __builtin_strcmp ("unit", unit->name) : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) ("unit"); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) (unit->name))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) (unit->name))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) (unit->name))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) (unit->name))[3]); } } __result; }))) : __builtin_strcmp ("unit", unit->name)))); }) ) {
5426 fprintf( dest_file, "<unit\n" );
5427 if ( !parser_get_value( unit, "nation", &str, 0 ) )
5429 fprintf( dest_file, "nation»%s\n", str );
5430 if ( !parser_get_int( unit, "id", &ibuf ) )
5432 fprintf( dest_file, "id»%i\n", ibuf );
5433 ibuf = def_str; parser_get_int( unit, "str", &ibuf );
5434 fprintf( dest_file, "str»%i\n", ibuf );
5435 ibuf = def_exp; parser_get_int( unit, "exp", &ibuf );
5436 fprintf( dest_file, "exp»%i\n", ibuf );
5437 fprintf( dest_file, "entr»0\n" );
5438 if ( parser_get_value( unit, "trsp", &str, 0 ) )
5439 fprintf( dest_file, "trsp»%s\n", str );
5440 if ( !parser_get_int( unit, "delay", &ibuf ) )
5442 fprintf( dest_file, "delay»%i\n", ibuf );
5443 fprintf( dest_file, ">\n" );
5447 fprintf( dest_file, ">\n" );
5448 fclose( scen_file );
5449 fclose( dest_file );
5455 if ( aux_file ) fclose( aux_file );
5456 if ( scen_file ) fclose( scen_file );
5457 if ( dest_file ) fclose( dest_file );