Showing error 2204

User: Jiri Slaby
Error type: Reachable Error Location
Error type description: A specified error location is reachable in some program path
File location: pthread/reorder_2_unsafe.i
Line in file: 2912
Project: SV-COMP 2013
Project version: 2.6.28
Tools: Manual Work
Entered: 2013-01-17 16:57:54 UTC


Source:

   1# 1 "reorder.c"
   2# 1 "<built-in>"
   3# 1 "<command-line>"
   4# 1 "reorder.c"
   5# 1 "/usr/include/stdio.h" 1 3 4
   6# 28 "/usr/include/stdio.h" 3 4
   7# 1 "/usr/include/features.h" 1 3 4
   8# 363 "/usr/include/features.h" 3 4
   9# 1 "/usr/include/sys/cdefs.h" 1 3 4
  10# 372 "/usr/include/sys/cdefs.h" 3 4
  11# 1 "/usr/include/bits/wordsize.h" 1 3 4
  12# 373 "/usr/include/sys/cdefs.h" 2 3 4
  13# 364 "/usr/include/features.h" 2 3 4
  14# 387 "/usr/include/features.h" 3 4
  15# 1 "/usr/include/gnu/stubs.h" 1 3 4
  16
  17
  18
  19# 1 "/usr/include/bits/wordsize.h" 1 3 4
  20# 5 "/usr/include/gnu/stubs.h" 2 3 4
  21
  22
  23# 1 "/usr/include/gnu/stubs-32.h" 1 3 4
  24# 8 "/usr/include/gnu/stubs.h" 2 3 4
  25# 388 "/usr/include/features.h" 2 3 4
  26# 29 "/usr/include/stdio.h" 2 3 4
  27
  28
  29
  30
  31
  32# 1 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 1 3 4
  33# 212 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 3 4
  34typedef unsigned int size_t;
  35# 35 "/usr/include/stdio.h" 2 3 4
  36
  37# 1 "/usr/include/bits/types.h" 1 3 4
  38# 28 "/usr/include/bits/types.h" 3 4
  39# 1 "/usr/include/bits/wordsize.h" 1 3 4
  40# 29 "/usr/include/bits/types.h" 2 3 4
  41
  42
  43typedef unsigned char __u_char;
  44typedef unsigned short int __u_short;
  45typedef unsigned int __u_int;
  46typedef unsigned long int __u_long;
  47
  48
  49typedef signed char __int8_t;
  50typedef unsigned char __uint8_t;
  51typedef signed short int __int16_t;
  52typedef unsigned short int __uint16_t;
  53typedef signed int __int32_t;
  54typedef unsigned int __uint32_t;
  55
  56
  57
  58
  59__extension__ typedef signed long long int __int64_t;
  60__extension__ typedef unsigned long long int __uint64_t;
  61
  62
  63
  64
  65
  66
  67
  68__extension__ typedef long long int __quad_t;
  69__extension__ typedef unsigned long long int __u_quad_t;
  70# 131 "/usr/include/bits/types.h" 3 4
  71# 1 "/usr/include/bits/typesizes.h" 1 3 4
  72# 132 "/usr/include/bits/types.h" 2 3 4
  73
  74
  75__extension__ typedef __u_quad_t __dev_t;
  76__extension__ typedef unsigned int __uid_t;
  77__extension__ typedef unsigned int __gid_t;
  78__extension__ typedef unsigned long int __ino_t;
  79__extension__ typedef __u_quad_t __ino64_t;
  80__extension__ typedef unsigned int __mode_t;
  81__extension__ typedef unsigned int __nlink_t;
  82__extension__ typedef long int __off_t;
  83__extension__ typedef __quad_t __off64_t;
  84__extension__ typedef int __pid_t;
  85__extension__ typedef struct { int __val[2]; } __fsid_t;
  86__extension__ typedef long int __clock_t;
  87__extension__ typedef unsigned long int __rlim_t;
  88__extension__ typedef __u_quad_t __rlim64_t;
  89__extension__ typedef unsigned int __id_t;
  90__extension__ typedef long int __time_t;
  91__extension__ typedef unsigned int __useconds_t;
  92__extension__ typedef long int __suseconds_t;
  93
  94__extension__ typedef int __daddr_t;
  95__extension__ typedef long int __swblk_t;
  96__extension__ typedef int __key_t;
  97
  98
  99__extension__ typedef int __clockid_t;
 100
 101
 102__extension__ typedef void * __timer_t;
 103
 104
 105__extension__ typedef long int __blksize_t;
 106
 107
 108
 109
 110__extension__ typedef long int __blkcnt_t;
 111__extension__ typedef __quad_t __blkcnt64_t;
 112
 113
 114__extension__ typedef unsigned long int __fsblkcnt_t;
 115__extension__ typedef __u_quad_t __fsblkcnt64_t;
 116
 117
 118__extension__ typedef unsigned long int __fsfilcnt_t;
 119__extension__ typedef __u_quad_t __fsfilcnt64_t;
 120
 121__extension__ typedef int __ssize_t;
 122
 123
 124
 125typedef __off64_t __loff_t;
 126typedef __quad_t *__qaddr_t;
 127typedef char *__caddr_t;
 128
 129
 130__extension__ typedef int __intptr_t;
 131
 132
 133__extension__ typedef unsigned int __socklen_t;
 134# 37 "/usr/include/stdio.h" 2 3 4
 135# 45 "/usr/include/stdio.h" 3 4
 136struct _IO_FILE;
 137
 138
 139
 140typedef struct _IO_FILE FILE;
 141
 142
 143
 144
 145
 146# 65 "/usr/include/stdio.h" 3 4
 147typedef struct _IO_FILE __FILE;
 148# 75 "/usr/include/stdio.h" 3 4
 149# 1 "/usr/include/libio.h" 1 3 4
 150# 32 "/usr/include/libio.h" 3 4
 151# 1 "/usr/include/_G_config.h" 1 3 4
 152# 15 "/usr/include/_G_config.h" 3 4
 153# 1 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 1 3 4
 154# 16 "/usr/include/_G_config.h" 2 3 4
 155
 156
 157
 158
 159# 1 "/usr/include/wchar.h" 1 3 4
 160# 83 "/usr/include/wchar.h" 3 4
 161typedef struct
 162{
 163  int __count;
 164  union
 165  {
 166
 167    unsigned int __wch;
 168
 169
 170
 171    char __wchb[4];
 172  } __value;
 173} __mbstate_t;
 174# 21 "/usr/include/_G_config.h" 2 3 4
 175
 176typedef struct
 177{
 178  __off_t __pos;
 179  __mbstate_t __state;
 180} _G_fpos_t;
 181typedef struct
 182{
 183  __off64_t __pos;
 184  __mbstate_t __state;
 185} _G_fpos64_t;
 186# 53 "/usr/include/_G_config.h" 3 4
 187typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
 188typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
 189typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
 190typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
 191# 33 "/usr/include/libio.h" 2 3 4
 192# 53 "/usr/include/libio.h" 3 4
 193# 1 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stdarg.h" 1 3 4
 194# 40 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stdarg.h" 3 4
 195typedef __builtin_va_list __gnuc_va_list;
 196# 54 "/usr/include/libio.h" 2 3 4
 197# 172 "/usr/include/libio.h" 3 4
 198struct _IO_jump_t; struct _IO_FILE;
 199# 182 "/usr/include/libio.h" 3 4
 200typedef void _IO_lock_t;
 201
 202
 203
 204
 205
 206struct _IO_marker {
 207  struct _IO_marker *_next;
 208  struct _IO_FILE *_sbuf;
 209
 210
 211
 212  int _pos;
 213# 205 "/usr/include/libio.h" 3 4
 214};
 215
 216
 217enum __codecvt_result
 218{
 219  __codecvt_ok,
 220  __codecvt_partial,
 221  __codecvt_error,
 222  __codecvt_noconv
 223};
 224# 273 "/usr/include/libio.h" 3 4
 225struct _IO_FILE {
 226  int _flags;
 227
 228
 229
 230
 231  char* _IO_read_ptr;
 232  char* _IO_read_end;
 233  char* _IO_read_base;
 234  char* _IO_write_base;
 235  char* _IO_write_ptr;
 236  char* _IO_write_end;
 237  char* _IO_buf_base;
 238  char* _IO_buf_end;
 239
 240  char *_IO_save_base;
 241  char *_IO_backup_base;
 242  char *_IO_save_end;
 243
 244  struct _IO_marker *_markers;
 245
 246  struct _IO_FILE *_chain;
 247
 248  int _fileno;
 249
 250
 251
 252  int _flags2;
 253
 254  __off_t _old_offset;
 255
 256
 257
 258  unsigned short _cur_column;
 259  signed char _vtable_offset;
 260  char _shortbuf[1];
 261
 262
 263
 264  _IO_lock_t *_lock;
 265# 321 "/usr/include/libio.h" 3 4
 266  __off64_t _offset;
 267# 330 "/usr/include/libio.h" 3 4
 268  void *__pad1;
 269  void *__pad2;
 270  void *__pad3;
 271  void *__pad4;
 272  size_t __pad5;
 273
 274  int _mode;
 275
 276  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
 277
 278};
 279
 280
 281typedef struct _IO_FILE _IO_FILE;
 282
 283
 284struct _IO_FILE_plus;
 285
 286extern struct _IO_FILE_plus _IO_2_1_stdin_;
 287extern struct _IO_FILE_plus _IO_2_1_stdout_;
 288extern struct _IO_FILE_plus _IO_2_1_stderr_;
 289# 366 "/usr/include/libio.h" 3 4
 290typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
 291
 292
 293
 294
 295
 296
 297
 298typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
 299     size_t __n);
 300
 301
 302
 303
 304
 305
 306
 307typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
 308
 309
 310typedef int __io_close_fn (void *__cookie);
 311# 418 "/usr/include/libio.h" 3 4
 312extern int __underflow (_IO_FILE *);
 313extern int __uflow (_IO_FILE *);
 314extern int __overflow (_IO_FILE *, int);
 315# 462 "/usr/include/libio.h" 3 4
 316extern int _IO_getc (_IO_FILE *__fp);
 317extern int _IO_putc (int __c, _IO_FILE *__fp);
 318extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__));
 319extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__));
 320
 321extern int _IO_peekc_locked (_IO_FILE *__fp);
 322
 323
 324
 325
 326
 327extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__));
 328extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__));
 329extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__));
 330# 492 "/usr/include/libio.h" 3 4
 331extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
 332   __gnuc_va_list, int *__restrict);
 333extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
 334    __gnuc_va_list);
 335extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t);
 336extern size_t _IO_sgetn (_IO_FILE *, void *, size_t);
 337
 338extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int);
 339extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int);
 340
 341extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__));
 342# 76 "/usr/include/stdio.h" 2 3 4
 343
 344
 345
 346
 347typedef __gnuc_va_list va_list;
 348# 91 "/usr/include/stdio.h" 3 4
 349typedef __off_t off_t;
 350# 103 "/usr/include/stdio.h" 3 4
 351typedef __ssize_t ssize_t;
 352
 353
 354
 355
 356
 357
 358
 359typedef _G_fpos_t fpos_t;
 360
 361
 362
 363
 364# 165 "/usr/include/stdio.h" 3 4
 365# 1 "/usr/include/bits/stdio_lim.h" 1 3 4
 366# 166 "/usr/include/stdio.h" 2 3 4
 367
 368
 369
 370extern struct _IO_FILE *stdin;
 371extern struct _IO_FILE *stdout;
 372extern struct _IO_FILE *stderr;
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382extern int remove (__const char *__filename) __attribute__ ((__nothrow__));
 383
 384extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__));
 385
 386
 387
 388
 389extern int renameat (int __oldfd, __const char *__old, int __newfd,
 390       __const char *__new) __attribute__ ((__nothrow__));
 391
 392
 393
 394
 395
 396
 397
 398
 399extern FILE *tmpfile (void) ;
 400# 212 "/usr/include/stdio.h" 3 4
 401extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)) ;
 402
 403
 404
 405
 406
 407extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)) ;
 408# 230 "/usr/include/stdio.h" 3 4
 409extern char *tempnam (__const char *__dir, __const char *__pfx)
 410     __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
 411
 412
 413
 414
 415
 416
 417
 418
 419extern int fclose (FILE *__stream);
 420
 421
 422
 423
 424extern int fflush (FILE *__stream);
 425
 426# 255 "/usr/include/stdio.h" 3 4
 427extern int fflush_unlocked (FILE *__stream);
 428# 269 "/usr/include/stdio.h" 3 4
 429
 430
 431
 432
 433
 434
 435extern FILE *fopen (__const char *__restrict __filename,
 436      __const char *__restrict __modes) ;
 437
 438
 439
 440
 441extern FILE *freopen (__const char *__restrict __filename,
 442        __const char *__restrict __modes,
 443        FILE *__restrict __stream) ;
 444# 298 "/usr/include/stdio.h" 3 4
 445
 446# 309 "/usr/include/stdio.h" 3 4
 447extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__)) ;
 448# 322 "/usr/include/stdio.h" 3 4
 449extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes)
 450  __attribute__ ((__nothrow__)) ;
 451
 452
 453
 454
 455extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__)) ;
 456
 457
 458
 459
 460
 461
 462extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__));
 463
 464
 465
 466extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
 467      int __modes, size_t __n) __attribute__ ((__nothrow__));
 468
 469
 470
 471
 472
 473extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
 474         size_t __size) __attribute__ ((__nothrow__));
 475
 476
 477extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__));
 478
 479
 480
 481
 482
 483
 484
 485
 486extern int fprintf (FILE *__restrict __stream,
 487      __const char *__restrict __format, ...);
 488
 489
 490
 491
 492extern int printf (__const char *__restrict __format, ...);
 493
 494extern int sprintf (char *__restrict __s,
 495      __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
 496
 497
 498
 499
 500
 501extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
 502       __gnuc_va_list __arg);
 503
 504
 505
 506
 507extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
 508
 509extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
 510       __gnuc_va_list __arg) __attribute__ ((__nothrow__));
 511
 512
 513
 514
 515
 516extern int snprintf (char *__restrict __s, size_t __maxlen,
 517       __const char *__restrict __format, ...)
 518     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));
 519
 520extern int vsnprintf (char *__restrict __s, size_t __maxlen,
 521        __const char *__restrict __format, __gnuc_va_list __arg)
 522     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0)));
 523
 524# 420 "/usr/include/stdio.h" 3 4
 525extern int vdprintf (int __fd, __const char *__restrict __fmt,
 526       __gnuc_va_list __arg)
 527     __attribute__ ((__format__ (__printf__, 2, 0)));
 528extern int dprintf (int __fd, __const char *__restrict __fmt, ...)
 529     __attribute__ ((__format__ (__printf__, 2, 3)));
 530
 531
 532
 533
 534
 535
 536
 537
 538extern int fscanf (FILE *__restrict __stream,
 539     __const char *__restrict __format, ...) ;
 540
 541
 542
 543
 544extern int scanf (__const char *__restrict __format, ...) ;
 545
 546extern int sscanf (__const char *__restrict __s,
 547     __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
 548# 451 "/usr/include/stdio.h" 3 4
 549extern int fscanf (FILE *__restrict __stream, __const char *__restrict __format, ...) __asm__ ("" "__isoc99_fscanf")
 550
 551                               ;
 552extern int scanf (__const char *__restrict __format, ...) __asm__ ("" "__isoc99_scanf")
 553                              ;
 554extern int sscanf (__const char *__restrict __s, __const char *__restrict __format, ...) __asm__ ("" "__isoc99_sscanf") __attribute__ ((__nothrow__))
 555
 556                      ;
 557# 471 "/usr/include/stdio.h" 3 4
 558
 559
 560
 561
 562
 563
 564
 565
 566extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format,
 567      __gnuc_va_list __arg)
 568     __attribute__ ((__format__ (__scanf__, 2, 0))) ;
 569
 570
 571
 572
 573
 574extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg)
 575     __attribute__ ((__format__ (__scanf__, 1, 0))) ;
 576
 577
 578extern int vsscanf (__const char *__restrict __s,
 579      __const char *__restrict __format, __gnuc_va_list __arg)
 580     __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__scanf__, 2, 0)));
 581# 502 "/usr/include/stdio.h" 3 4
 582extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vfscanf")
 583
 584
 585
 586     __attribute__ ((__format__ (__scanf__, 2, 0))) ;
 587extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vscanf")
 588
 589     __attribute__ ((__format__ (__scanf__, 1, 0))) ;
 590extern int vsscanf (__const char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vsscanf") __attribute__ ((__nothrow__))
 591
 592
 593
 594     __attribute__ ((__format__ (__scanf__, 2, 0)));
 595# 530 "/usr/include/stdio.h" 3 4
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605extern int fgetc (FILE *__stream);
 606extern int getc (FILE *__stream);
 607
 608
 609
 610
 611
 612extern int getchar (void);
 613
 614# 558 "/usr/include/stdio.h" 3 4
 615extern int getc_unlocked (FILE *__stream);
 616extern int getchar_unlocked (void);
 617# 569 "/usr/include/stdio.h" 3 4
 618extern int fgetc_unlocked (FILE *__stream);
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630extern int fputc (int __c, FILE *__stream);
 631extern int putc (int __c, FILE *__stream);
 632
 633
 634
 635
 636
 637extern int putchar (int __c);
 638
 639# 602 "/usr/include/stdio.h" 3 4
 640extern int fputc_unlocked (int __c, FILE *__stream);
 641
 642
 643
 644
 645
 646
 647
 648extern int putc_unlocked (int __c, FILE *__stream);
 649extern int putchar_unlocked (int __c);
 650
 651
 652
 653
 654
 655
 656extern int getw (FILE *__stream);
 657
 658
 659extern int putw (int __w, FILE *__stream);
 660
 661
 662
 663
 664
 665
 666
 667
 668extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
 669     ;
 670
 671
 672
 673
 674
 675
 676extern char *gets (char *__s) ;
 677
 678# 664 "/usr/include/stdio.h" 3 4
 679extern __ssize_t __getdelim (char **__restrict __lineptr,
 680          size_t *__restrict __n, int __delimiter,
 681          FILE *__restrict __stream) ;
 682extern __ssize_t getdelim (char **__restrict __lineptr,
 683        size_t *__restrict __n, int __delimiter,
 684        FILE *__restrict __stream) ;
 685
 686
 687
 688
 689
 690
 691
 692extern __ssize_t getline (char **__restrict __lineptr,
 693       size_t *__restrict __n,
 694       FILE *__restrict __stream) ;
 695
 696
 697
 698
 699
 700
 701
 702
 703extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
 704
 705
 706
 707
 708
 709extern int puts (__const char *__s);
 710
 711
 712
 713
 714
 715
 716extern int ungetc (int __c, FILE *__stream);
 717
 718
 719
 720
 721
 722
 723extern size_t fread (void *__restrict __ptr, size_t __size,
 724       size_t __n, FILE *__restrict __stream) ;
 725
 726
 727
 728
 729extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
 730        size_t __n, FILE *__restrict __s) ;
 731
 732# 736 "/usr/include/stdio.h" 3 4
 733extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
 734         size_t __n, FILE *__restrict __stream) ;
 735extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
 736          size_t __n, FILE *__restrict __stream) ;
 737
 738
 739
 740
 741
 742
 743
 744
 745extern int fseek (FILE *__stream, long int __off, int __whence);
 746
 747
 748
 749
 750extern long int ftell (FILE *__stream) ;
 751
 752
 753
 754
 755extern void rewind (FILE *__stream);
 756
 757# 772 "/usr/include/stdio.h" 3 4
 758extern int fseeko (FILE *__stream, __off_t __off, int __whence);
 759
 760
 761
 762
 763extern __off_t ftello (FILE *__stream) ;
 764# 791 "/usr/include/stdio.h" 3 4
 765
 766
 767
 768
 769
 770
 771extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
 772
 773
 774
 775
 776extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
 777# 814 "/usr/include/stdio.h" 3 4
 778
 779# 823 "/usr/include/stdio.h" 3 4
 780
 781
 782extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__));
 783
 784extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) ;
 785
 786extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) ;
 787
 788
 789
 790
 791extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__));
 792extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
 793extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
 794
 795
 796
 797
 798
 799
 800
 801
 802extern void perror (__const char *__s);
 803
 804
 805
 806
 807
 808
 809# 1 "/usr/include/bits/sys_errlist.h" 1 3 4
 810# 27 "/usr/include/bits/sys_errlist.h" 3 4
 811extern int sys_nerr;
 812extern __const char *__const sys_errlist[];
 813# 853 "/usr/include/stdio.h" 2 3 4
 814
 815
 816
 817
 818extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) ;
 819
 820
 821
 822
 823extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
 824# 872 "/usr/include/stdio.h" 3 4
 825extern FILE *popen (__const char *__command, __const char *__modes) ;
 826
 827
 828
 829
 830
 831extern int pclose (FILE *__stream);
 832
 833
 834
 835
 836
 837extern char *ctermid (char *__s) __attribute__ ((__nothrow__));
 838# 912 "/usr/include/stdio.h" 3 4
 839extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__));
 840
 841
 842
 843extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) ;
 844
 845
 846extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__));
 847# 942 "/usr/include/stdio.h" 3 4
 848
 849# 2 "reorder.c" 2
 850# 1 "/usr/include/stdlib.h" 1 3 4
 851# 33 "/usr/include/stdlib.h" 3 4
 852# 1 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 1 3 4
 853# 324 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 3 4
 854typedef long int wchar_t;
 855# 34 "/usr/include/stdlib.h" 2 3 4
 856
 857
 858
 859
 860
 861
 862
 863
 864# 1 "/usr/include/bits/waitflags.h" 1 3 4
 865# 43 "/usr/include/stdlib.h" 2 3 4
 866# 1 "/usr/include/bits/waitstatus.h" 1 3 4
 867# 65 "/usr/include/bits/waitstatus.h" 3 4
 868# 1 "/usr/include/endian.h" 1 3 4
 869# 37 "/usr/include/endian.h" 3 4
 870# 1 "/usr/include/bits/endian.h" 1 3 4
 871# 38 "/usr/include/endian.h" 2 3 4
 872# 61 "/usr/include/endian.h" 3 4
 873# 1 "/usr/include/bits/byteswap.h" 1 3 4
 874# 62 "/usr/include/endian.h" 2 3 4
 875# 66 "/usr/include/bits/waitstatus.h" 2 3 4
 876
 877union wait
 878  {
 879    int w_status;
 880    struct
 881      {
 882
 883 unsigned int __w_termsig:7;
 884 unsigned int __w_coredump:1;
 885 unsigned int __w_retcode:8;
 886 unsigned int:16;
 887
 888
 889
 890
 891
 892
 893
 894      } __wait_terminated;
 895    struct
 896      {
 897
 898 unsigned int __w_stopval:8;
 899 unsigned int __w_stopsig:8;
 900 unsigned int:16;
 901
 902
 903
 904
 905
 906
 907      } __wait_stopped;
 908  };
 909# 44 "/usr/include/stdlib.h" 2 3 4
 910# 68 "/usr/include/stdlib.h" 3 4
 911typedef union
 912  {
 913    union wait *__uptr;
 914    int *__iptr;
 915  } __WAIT_STATUS __attribute__ ((__transparent_union__));
 916# 96 "/usr/include/stdlib.h" 3 4
 917
 918
 919typedef struct
 920  {
 921    int quot;
 922    int rem;
 923  } div_t;
 924
 925
 926
 927typedef struct
 928  {
 929    long int quot;
 930    long int rem;
 931  } ldiv_t;
 932
 933
 934
 935
 936
 937
 938
 939__extension__ typedef struct
 940  {
 941    long long int quot;
 942    long long int rem;
 943  } lldiv_t;
 944
 945
 946# 140 "/usr/include/stdlib.h" 3 4
 947extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__)) ;
 948
 949
 950
 951
 952extern double atof (__const char *__nptr)
 953     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
 954
 955extern int atoi (__const char *__nptr)
 956     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
 957
 958extern long int atol (__const char *__nptr)
 959     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
 960
 961
 962
 963
 964
 965__extension__ extern long long int atoll (__const char *__nptr)
 966     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
 967
 968
 969
 970
 971
 972extern double strtod (__const char *__restrict __nptr,
 973        char **__restrict __endptr)
 974     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
 975
 976
 977
 978
 979
 980extern float strtof (__const char *__restrict __nptr,
 981       char **__restrict __endptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
 982
 983extern long double strtold (__const char *__restrict __nptr,
 984       char **__restrict __endptr)
 985     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
 986
 987
 988
 989
 990
 991extern long int strtol (__const char *__restrict __nptr,
 992   char **__restrict __endptr, int __base)
 993     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
 994
 995extern unsigned long int strtoul (__const char *__restrict __nptr,
 996      char **__restrict __endptr, int __base)
 997     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
 998
 999
1000
1001
1002__extension__
1003extern long long int strtoq (__const char *__restrict __nptr,
1004        char **__restrict __endptr, int __base)
1005     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
1006
1007__extension__
1008extern unsigned long long int strtouq (__const char *__restrict __nptr,
1009           char **__restrict __endptr, int __base)
1010     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
1011
1012
1013
1014
1015
1016__extension__
1017extern long long int strtoll (__const char *__restrict __nptr,
1018         char **__restrict __endptr, int __base)
1019     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
1020
1021__extension__
1022extern unsigned long long int strtoull (__const char *__restrict __nptr,
1023     char **__restrict __endptr, int __base)
1024     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
1025
1026# 311 "/usr/include/stdlib.h" 3 4
1027extern char *l64a (long int __n) __attribute__ ((__nothrow__)) ;
1028
1029
1030extern long int a64l (__const char *__s)
1031     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
1032
1033
1034
1035
1036# 1 "/usr/include/sys/types.h" 1 3 4
1037# 28 "/usr/include/sys/types.h" 3 4
1038
1039
1040
1041
1042
1043
1044typedef __u_char u_char;
1045typedef __u_short u_short;
1046typedef __u_int u_int;
1047typedef __u_long u_long;
1048typedef __quad_t quad_t;
1049typedef __u_quad_t u_quad_t;
1050typedef __fsid_t fsid_t;
1051
1052
1053
1054
1055typedef __loff_t loff_t;
1056
1057
1058
1059typedef __ino_t ino_t;
1060# 61 "/usr/include/sys/types.h" 3 4
1061typedef __dev_t dev_t;
1062
1063
1064
1065
1066typedef __gid_t gid_t;
1067
1068
1069
1070
1071typedef __mode_t mode_t;
1072
1073
1074
1075
1076typedef __nlink_t nlink_t;
1077
1078
1079
1080
1081typedef __uid_t uid_t;
1082# 99 "/usr/include/sys/types.h" 3 4
1083typedef __pid_t pid_t;
1084
1085
1086
1087
1088
1089typedef __id_t id_t;
1090# 116 "/usr/include/sys/types.h" 3 4
1091typedef __daddr_t daddr_t;
1092typedef __caddr_t caddr_t;
1093
1094
1095
1096
1097
1098typedef __key_t key_t;
1099# 133 "/usr/include/sys/types.h" 3 4
1100# 1 "/usr/include/time.h" 1 3 4
1101# 58 "/usr/include/time.h" 3 4
1102
1103
1104typedef __clock_t clock_t;
1105
1106
1107
1108# 74 "/usr/include/time.h" 3 4
1109
1110
1111typedef __time_t time_t;
1112
1113
1114
1115# 92 "/usr/include/time.h" 3 4
1116typedef __clockid_t clockid_t;
1117# 104 "/usr/include/time.h" 3 4
1118typedef __timer_t timer_t;
1119# 134 "/usr/include/sys/types.h" 2 3 4
1120# 147 "/usr/include/sys/types.h" 3 4
1121# 1 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 1 3 4
1122# 148 "/usr/include/sys/types.h" 2 3 4
1123
1124
1125
1126typedef unsigned long int ulong;
1127typedef unsigned short int ushort;
1128typedef unsigned int uint;
1129# 195 "/usr/include/sys/types.h" 3 4
1130typedef int int8_t __attribute__ ((__mode__ (__QI__)));
1131typedef int int16_t __attribute__ ((__mode__ (__HI__)));
1132typedef int int32_t __attribute__ ((__mode__ (__SI__)));
1133typedef int int64_t __attribute__ ((__mode__ (__DI__)));
1134
1135
1136typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
1137typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
1138typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
1139typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
1140
1141typedef int register_t __attribute__ ((__mode__ (__word__)));
1142# 220 "/usr/include/sys/types.h" 3 4
1143# 1 "/usr/include/sys/select.h" 1 3 4
1144# 31 "/usr/include/sys/select.h" 3 4
1145# 1 "/usr/include/bits/select.h" 1 3 4
1146# 32 "/usr/include/sys/select.h" 2 3 4
1147
1148
1149# 1 "/usr/include/bits/sigset.h" 1 3 4
1150# 24 "/usr/include/bits/sigset.h" 3 4
1151typedef int __sig_atomic_t;
1152
1153
1154
1155
1156typedef struct
1157  {
1158    unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
1159  } __sigset_t;
1160# 35 "/usr/include/sys/select.h" 2 3 4
1161
1162
1163
1164typedef __sigset_t sigset_t;
1165
1166
1167
1168
1169
1170# 1 "/usr/include/time.h" 1 3 4
1171# 120 "/usr/include/time.h" 3 4
1172struct timespec
1173  {
1174    __time_t tv_sec;
1175    long int tv_nsec;
1176  };
1177# 45 "/usr/include/sys/select.h" 2 3 4
1178
1179# 1 "/usr/include/bits/time.h" 1 3 4
1180# 31 "/usr/include/bits/time.h" 3 4
1181struct timeval
1182  {
1183    __time_t tv_sec;
1184    __suseconds_t tv_usec;
1185  };
1186# 47 "/usr/include/sys/select.h" 2 3 4
1187
1188
1189typedef __suseconds_t suseconds_t;
1190
1191
1192
1193
1194
1195typedef long int __fd_mask;
1196# 65 "/usr/include/sys/select.h" 3 4
1197typedef struct
1198  {
1199
1200
1201
1202
1203
1204
1205    __fd_mask __fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];
1206
1207
1208  } fd_set;
1209
1210
1211
1212
1213
1214
1215typedef __fd_mask fd_mask;
1216# 97 "/usr/include/sys/select.h" 3 4
1217
1218# 107 "/usr/include/sys/select.h" 3 4
1219extern int select (int __nfds, fd_set *__restrict __readfds,
1220     fd_set *__restrict __writefds,
1221     fd_set *__restrict __exceptfds,
1222     struct timeval *__restrict __timeout);
1223# 119 "/usr/include/sys/select.h" 3 4
1224extern int pselect (int __nfds, fd_set *__restrict __readfds,
1225      fd_set *__restrict __writefds,
1226      fd_set *__restrict __exceptfds,
1227      const struct timespec *__restrict __timeout,
1228      const __sigset_t *__restrict __sigmask);
1229# 132 "/usr/include/sys/select.h" 3 4
1230
1231# 221 "/usr/include/sys/types.h" 2 3 4
1232
1233
1234# 1 "/usr/include/sys/sysmacros.h" 1 3 4
1235# 30 "/usr/include/sys/sysmacros.h" 3 4
1236
1237
1238__extension__
1239extern unsigned int gnu_dev_major (unsigned long long int __dev)
1240     __attribute__ ((__nothrow__)) __attribute__ ((__const__));
1241__extension__
1242extern unsigned int gnu_dev_minor (unsigned long long int __dev)
1243     __attribute__ ((__nothrow__)) __attribute__ ((__const__));
1244__extension__
1245extern unsigned long long int gnu_dev_makedev (unsigned int __major,
1246            unsigned int __minor)
1247     __attribute__ ((__nothrow__)) __attribute__ ((__const__));
1248# 64 "/usr/include/sys/sysmacros.h" 3 4
1249
1250# 224 "/usr/include/sys/types.h" 2 3 4
1251
1252
1253
1254
1255
1256typedef __blksize_t blksize_t;
1257
1258
1259
1260
1261
1262
1263typedef __blkcnt_t blkcnt_t;
1264
1265
1266
1267typedef __fsblkcnt_t fsblkcnt_t;
1268
1269
1270
1271typedef __fsfilcnt_t fsfilcnt_t;
1272# 271 "/usr/include/sys/types.h" 3 4
1273# 1 "/usr/include/bits/pthreadtypes.h" 1 3 4
1274# 36 "/usr/include/bits/pthreadtypes.h" 3 4
1275typedef unsigned long int pthread_t;
1276
1277
1278typedef union
1279{
1280  char __size[36];
1281  long int __align;
1282} pthread_attr_t;
1283
1284
1285typedef struct __pthread_internal_slist
1286{
1287  struct __pthread_internal_slist *__next;
1288} __pthread_slist_t;
1289
1290
1291
1292
1293typedef union
1294{
1295  struct __pthread_mutex_s
1296  {
1297    int __lock;
1298    unsigned int __count;
1299    int __owner;
1300
1301
1302    int __kind;
1303    unsigned int __nusers;
1304    __extension__ union
1305    {
1306      int __spins;
1307      __pthread_slist_t __list;
1308    };
1309  } __data;
1310  char __size[24];
1311  long int __align;
1312} pthread_mutex_t;
1313
1314typedef union
1315{
1316  char __size[4];
1317  long int __align;
1318} pthread_mutexattr_t;
1319
1320
1321
1322
1323typedef union
1324{
1325  struct
1326  {
1327    int __lock;
1328    unsigned int __futex;
1329    __extension__ unsigned long long int __total_seq;
1330    __extension__ unsigned long long int __wakeup_seq;
1331    __extension__ unsigned long long int __woken_seq;
1332    void *__mutex;
1333    unsigned int __nwaiters;
1334    unsigned int __broadcast_seq;
1335  } __data;
1336  char __size[48];
1337  __extension__ long long int __align;
1338} pthread_cond_t;
1339
1340typedef union
1341{
1342  char __size[4];
1343  long int __align;
1344} pthread_condattr_t;
1345
1346
1347
1348typedef unsigned int pthread_key_t;
1349
1350
1351
1352typedef int pthread_once_t;
1353
1354
1355
1356
1357
1358typedef union
1359{
1360  struct
1361  {
1362    int __lock;
1363    unsigned int __nr_readers;
1364    unsigned int __readers_wakeup;
1365    unsigned int __writer_wakeup;
1366    unsigned int __nr_readers_queued;
1367    unsigned int __nr_writers_queued;
1368
1369
1370    unsigned char __flags;
1371    unsigned char __shared;
1372    unsigned char __pad1;
1373    unsigned char __pad2;
1374    int __writer;
1375  } __data;
1376  char __size[32];
1377  long int __align;
1378} pthread_rwlock_t;
1379
1380typedef union
1381{
1382  char __size[8];
1383  long int __align;
1384} pthread_rwlockattr_t;
1385
1386
1387
1388
1389
1390typedef volatile int pthread_spinlock_t;
1391
1392
1393
1394
1395typedef union
1396{
1397  char __size[20];
1398  long int __align;
1399} pthread_barrier_t;
1400
1401typedef union
1402{
1403  char __size[4];
1404  int __align;
1405} pthread_barrierattr_t;
1406# 272 "/usr/include/sys/types.h" 2 3 4
1407
1408
1409
1410# 321 "/usr/include/stdlib.h" 2 3 4
1411
1412
1413
1414
1415
1416
1417extern long int random (void) __attribute__ ((__nothrow__));
1418
1419
1420extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__));
1421
1422
1423
1424
1425
1426extern char *initstate (unsigned int __seed, char *__statebuf,
1427   size_t __statelen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
1428
1429
1430
1431extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1432
1433
1434
1435
1436
1437
1438
1439struct random_data
1440  {
1441    int32_t *fptr;
1442    int32_t *rptr;
1443    int32_t *state;
1444    int rand_type;
1445    int rand_deg;
1446    int rand_sep;
1447    int32_t *end_ptr;
1448  };
1449
1450extern int random_r (struct random_data *__restrict __buf,
1451       int32_t *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1452
1453extern int srandom_r (unsigned int __seed, struct random_data *__buf)
1454     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
1455
1456extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
1457   size_t __statelen,
1458   struct random_data *__restrict __buf)
1459     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4)));
1460
1461extern int setstate_r (char *__restrict __statebuf,
1462         struct random_data *__restrict __buf)
1463     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1464
1465
1466
1467
1468
1469
1470extern int rand (void) __attribute__ ((__nothrow__));
1471
1472extern void srand (unsigned int __seed) __attribute__ ((__nothrow__));
1473
1474
1475
1476
1477extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__));
1478
1479
1480
1481
1482
1483
1484
1485extern double drand48 (void) __attribute__ ((__nothrow__));
1486extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1487
1488
1489extern long int lrand48 (void) __attribute__ ((__nothrow__));
1490extern long int nrand48 (unsigned short int __xsubi[3])
1491     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1492
1493
1494extern long int mrand48 (void) __attribute__ ((__nothrow__));
1495extern long int jrand48 (unsigned short int __xsubi[3])
1496     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1497
1498
1499extern void srand48 (long int __seedval) __attribute__ ((__nothrow__));
1500extern unsigned short int *seed48 (unsigned short int __seed16v[3])
1501     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1502extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1503
1504
1505
1506
1507
1508struct drand48_data
1509  {
1510    unsigned short int __x[3];
1511    unsigned short int __old_x[3];
1512    unsigned short int __c;
1513    unsigned short int __init;
1514    unsigned long long int __a;
1515  };
1516
1517
1518extern int drand48_r (struct drand48_data *__restrict __buffer,
1519        double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1520extern int erand48_r (unsigned short int __xsubi[3],
1521        struct drand48_data *__restrict __buffer,
1522        double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1523
1524
1525extern int lrand48_r (struct drand48_data *__restrict __buffer,
1526        long int *__restrict __result)
1527     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1528extern int nrand48_r (unsigned short int __xsubi[3],
1529        struct drand48_data *__restrict __buffer,
1530        long int *__restrict __result)
1531     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1532
1533
1534extern int mrand48_r (struct drand48_data *__restrict __buffer,
1535        long int *__restrict __result)
1536     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1537extern int jrand48_r (unsigned short int __xsubi[3],
1538        struct drand48_data *__restrict __buffer,
1539        long int *__restrict __result)
1540     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1541
1542
1543extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
1544     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
1545
1546extern int seed48_r (unsigned short int __seed16v[3],
1547       struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1548
1549extern int lcong48_r (unsigned short int __param[7],
1550        struct drand48_data *__buffer)
1551     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
1562
1563extern void *calloc (size_t __nmemb, size_t __size)
1564     __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575extern void *realloc (void *__ptr, size_t __size)
1576     __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
1577
1578extern void free (void *__ptr) __attribute__ ((__nothrow__));
1579
1580
1581
1582
1583extern void cfree (void *__ptr) __attribute__ ((__nothrow__));
1584
1585
1586
1587# 1 "/usr/include/alloca.h" 1 3 4
1588# 25 "/usr/include/alloca.h" 3 4
1589# 1 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 1 3 4
1590# 26 "/usr/include/alloca.h" 2 3 4
1591
1592
1593
1594
1595
1596
1597
1598extern void *alloca (size_t __size) __attribute__ ((__nothrow__));
1599
1600
1601
1602
1603
1604
1605# 498 "/usr/include/stdlib.h" 2 3 4
1606
1607
1608
1609
1610
1611extern void *valloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
1612
1613
1614
1615
1616extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
1617     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
1618
1619
1620
1621
1622extern void abort (void) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
1623
1624
1625
1626extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1627# 531 "/usr/include/stdlib.h" 3 4
1628
1629
1630
1631
1632
1633extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
1634     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1635
1636
1637
1638
1639
1640
1641extern void exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
1642# 554 "/usr/include/stdlib.h" 3 4
1643
1644
1645
1646
1647
1648
1649extern void _Exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
1650
1651
1652
1653
1654
1655
1656extern char *getenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
1657
1658
1659
1660
1661extern char *__secure_getenv (__const char *__name)
1662     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
1663
1664
1665
1666
1667
1668extern int putenv (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1669
1670
1671
1672
1673
1674extern int setenv (__const char *__name, __const char *__value, int __replace)
1675     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
1676
1677
1678extern int unsetenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1679
1680
1681
1682
1683
1684
1685extern int clearenv (void) __attribute__ ((__nothrow__));
1686# 606 "/usr/include/stdlib.h" 3 4
1687extern char *mktemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
1688# 620 "/usr/include/stdlib.h" 3 4
1689extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ;
1690# 642 "/usr/include/stdlib.h" 3 4
1691extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) ;
1692# 663 "/usr/include/stdlib.h" 3 4
1693extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
1694# 712 "/usr/include/stdlib.h" 3 4
1695
1696
1697
1698
1699
1700extern int system (__const char *__command) ;
1701
1702# 734 "/usr/include/stdlib.h" 3 4
1703extern char *realpath (__const char *__restrict __name,
1704         char *__restrict __resolved) __attribute__ ((__nothrow__)) ;
1705
1706
1707
1708
1709
1710
1711typedef int (*__compar_fn_t) (__const void *, __const void *);
1712# 752 "/usr/include/stdlib.h" 3 4
1713
1714
1715
1716extern void *bsearch (__const void *__key, __const void *__base,
1717        size_t __nmemb, size_t __size, __compar_fn_t __compar)
1718     __attribute__ ((__nonnull__ (1, 2, 5))) ;
1719
1720
1721
1722extern void qsort (void *__base, size_t __nmemb, size_t __size,
1723     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
1724# 771 "/usr/include/stdlib.h" 3 4
1725extern int abs (int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
1726extern long int labs (long int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
1727
1728
1729
1730__extension__ extern long long int llabs (long long int __x)
1731     __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
1732
1733
1734
1735
1736
1737
1738
1739extern div_t div (int __numer, int __denom)
1740     __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
1741extern ldiv_t ldiv (long int __numer, long int __denom)
1742     __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
1743
1744
1745
1746
1747__extension__ extern lldiv_t lldiv (long long int __numer,
1748        long long int __denom)
1749     __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
1750
1751# 808 "/usr/include/stdlib.h" 3 4
1752extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
1753     int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ;
1754
1755
1756
1757
1758extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
1759     int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ;
1760
1761
1762
1763
1764extern char *gcvt (double __value, int __ndigit, char *__buf)
1765     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ;
1766
1767
1768
1769
1770extern char *qecvt (long double __value, int __ndigit,
1771      int *__restrict __decpt, int *__restrict __sign)
1772     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ;
1773extern char *qfcvt (long double __value, int __ndigit,
1774      int *__restrict __decpt, int *__restrict __sign)
1775     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ;
1776extern char *qgcvt (long double __value, int __ndigit, char *__buf)
1777     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ;
1778
1779
1780
1781
1782extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
1783     int *__restrict __sign, char *__restrict __buf,
1784     size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
1785extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
1786     int *__restrict __sign, char *__restrict __buf,
1787     size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
1788
1789extern int qecvt_r (long double __value, int __ndigit,
1790      int *__restrict __decpt, int *__restrict __sign,
1791      char *__restrict __buf, size_t __len)
1792     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
1793extern int qfcvt_r (long double __value, int __ndigit,
1794      int *__restrict __decpt, int *__restrict __sign,
1795      char *__restrict __buf, size_t __len)
1796     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
1797
1798
1799
1800
1801
1802
1803
1804extern int mblen (__const char *__s, size_t __n) __attribute__ ((__nothrow__)) ;
1805
1806
1807extern int mbtowc (wchar_t *__restrict __pwc,
1808     __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)) ;
1809
1810
1811extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__)) ;
1812
1813
1814
1815extern size_t mbstowcs (wchar_t *__restrict __pwcs,
1816   __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__));
1817
1818extern size_t wcstombs (char *__restrict __s,
1819   __const wchar_t *__restrict __pwcs, size_t __n)
1820     __attribute__ ((__nothrow__));
1821
1822
1823
1824
1825
1826
1827
1828
1829extern int rpmatch (__const char *__response) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
1830# 896 "/usr/include/stdlib.h" 3 4
1831extern int getsubopt (char **__restrict __optionp,
1832        char *__const *__restrict __tokens,
1833        char **__restrict __valuep)
1834     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;
1835# 948 "/usr/include/stdlib.h" 3 4
1836extern int getloadavg (double __loadavg[], int __nelem)
1837     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1838# 964 "/usr/include/stdlib.h" 3 4
1839
1840# 3 "reorder.c" 2
1841# 1 "/usr/include/pthread.h" 1 3 4
1842# 25 "/usr/include/pthread.h" 3 4
1843# 1 "/usr/include/sched.h" 1 3 4
1844# 30 "/usr/include/sched.h" 3 4
1845# 1 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 1 3 4
1846# 31 "/usr/include/sched.h" 2 3 4
1847
1848
1849
1850# 1 "/usr/include/time.h" 1 3 4
1851# 35 "/usr/include/sched.h" 2 3 4
1852# 43 "/usr/include/sched.h" 3 4
1853# 1 "/usr/include/bits/sched.h" 1 3 4
1854# 74 "/usr/include/bits/sched.h" 3 4
1855struct sched_param
1856  {
1857    int __sched_priority;
1858  };
1859
1860
1861# 97 "/usr/include/bits/sched.h" 3 4
1862
1863
1864
1865
1866
1867
1868
1869
1870struct __sched_param
1871  {
1872    int __sched_priority;
1873  };
1874# 120 "/usr/include/bits/sched.h" 3 4
1875typedef unsigned long int __cpu_mask;
1876
1877
1878
1879
1880
1881
1882typedef struct
1883{
1884  __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))];
1885} cpu_set_t;
1886# 203 "/usr/include/bits/sched.h" 3 4
1887
1888
1889extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
1890  __attribute__ ((__nothrow__));
1891extern cpu_set_t *__sched_cpualloc (size_t __count) __attribute__ ((__nothrow__)) ;
1892extern void __sched_cpufree (cpu_set_t *__set) __attribute__ ((__nothrow__));
1893
1894
1895# 44 "/usr/include/sched.h" 2 3 4
1896
1897
1898
1899
1900
1901
1902
1903extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param)
1904     __attribute__ ((__nothrow__));
1905
1906
1907extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __attribute__ ((__nothrow__));
1908
1909
1910extern int sched_setscheduler (__pid_t __pid, int __policy,
1911          __const struct sched_param *__param) __attribute__ ((__nothrow__));
1912
1913
1914extern int sched_getscheduler (__pid_t __pid) __attribute__ ((__nothrow__));
1915
1916
1917extern int sched_yield (void) __attribute__ ((__nothrow__));
1918
1919
1920extern int sched_get_priority_max (int __algorithm) __attribute__ ((__nothrow__));
1921
1922
1923extern int sched_get_priority_min (int __algorithm) __attribute__ ((__nothrow__));
1924
1925
1926extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __attribute__ ((__nothrow__));
1927# 126 "/usr/include/sched.h" 3 4
1928
1929# 26 "/usr/include/pthread.h" 2 3 4
1930# 1 "/usr/include/time.h" 1 3 4
1931# 30 "/usr/include/time.h" 3 4
1932
1933
1934
1935
1936
1937
1938
1939
1940# 1 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 1 3 4
1941# 39 "/usr/include/time.h" 2 3 4
1942
1943
1944
1945# 1 "/usr/include/bits/time.h" 1 3 4
1946# 43 "/usr/include/time.h" 2 3 4
1947# 131 "/usr/include/time.h" 3 4
1948
1949
1950struct tm
1951{
1952  int tm_sec;
1953  int tm_min;
1954  int tm_hour;
1955  int tm_mday;
1956  int tm_mon;
1957  int tm_year;
1958  int tm_wday;
1959  int tm_yday;
1960  int tm_isdst;
1961
1962
1963  long int tm_gmtoff;
1964  __const char *tm_zone;
1965
1966
1967
1968
1969};
1970
1971
1972
1973
1974
1975
1976
1977
1978struct itimerspec
1979  {
1980    struct timespec it_interval;
1981    struct timespec it_value;
1982  };
1983
1984
1985struct sigevent;
1986# 180 "/usr/include/time.h" 3 4
1987
1988
1989
1990extern clock_t clock (void) __attribute__ ((__nothrow__));
1991
1992
1993extern time_t time (time_t *__timer) __attribute__ ((__nothrow__));
1994
1995
1996extern double difftime (time_t __time1, time_t __time0)
1997     __attribute__ ((__nothrow__)) __attribute__ ((__const__));
1998
1999
2000extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__));
2001
2002
2003
2004
2005
2006extern size_t strftime (char *__restrict __s, size_t __maxsize,
2007   __const char *__restrict __format,
2008   __const struct tm *__restrict __tp) __attribute__ ((__nothrow__));
2009
2010# 215 "/usr/include/time.h" 3 4
2011# 1 "/usr/include/xlocale.h" 1 3 4
2012# 28 "/usr/include/xlocale.h" 3 4
2013typedef struct __locale_struct
2014{
2015
2016  struct __locale_data *__locales[13];
2017
2018
2019  const unsigned short int *__ctype_b;
2020  const int *__ctype_tolower;
2021  const int *__ctype_toupper;
2022
2023
2024  const char *__names[13];
2025} *__locale_t;
2026
2027
2028typedef __locale_t locale_t;
2029# 216 "/usr/include/time.h" 2 3 4
2030
2031extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
2032     __const char *__restrict __format,
2033     __const struct tm *__restrict __tp,
2034     __locale_t __loc) __attribute__ ((__nothrow__));
2035# 230 "/usr/include/time.h" 3 4
2036
2037
2038
2039extern struct tm *gmtime (__const time_t *__timer) __attribute__ ((__nothrow__));
2040
2041
2042
2043extern struct tm *localtime (__const time_t *__timer) __attribute__ ((__nothrow__));
2044
2045
2046
2047
2048
2049extern struct tm *gmtime_r (__const time_t *__restrict __timer,
2050       struct tm *__restrict __tp) __attribute__ ((__nothrow__));
2051
2052
2053
2054extern struct tm *localtime_r (__const time_t *__restrict __timer,
2055          struct tm *__restrict __tp) __attribute__ ((__nothrow__));
2056
2057
2058
2059
2060
2061extern char *asctime (__const struct tm *__tp) __attribute__ ((__nothrow__));
2062
2063
2064extern char *ctime (__const time_t *__timer) __attribute__ ((__nothrow__));
2065
2066
2067
2068
2069
2070
2071
2072extern char *asctime_r (__const struct tm *__restrict __tp,
2073   char *__restrict __buf) __attribute__ ((__nothrow__));
2074
2075
2076extern char *ctime_r (__const time_t *__restrict __timer,
2077        char *__restrict __buf) __attribute__ ((__nothrow__));
2078
2079
2080
2081
2082extern char *__tzname[2];
2083extern int __daylight;
2084extern long int __timezone;
2085
2086
2087
2088
2089extern char *tzname[2];
2090
2091
2092
2093extern void tzset (void) __attribute__ ((__nothrow__));
2094
2095
2096
2097extern int daylight;
2098extern long int timezone;
2099
2100
2101
2102
2103
2104extern int stime (__const time_t *__when) __attribute__ ((__nothrow__));
2105# 313 "/usr/include/time.h" 3 4
2106extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__));
2107
2108
2109extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__));
2110
2111
2112extern int dysize (int __year) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
2113# 328 "/usr/include/time.h" 3 4
2114extern int nanosleep (__const struct timespec *__requested_time,
2115        struct timespec *__remaining);
2116
2117
2118
2119extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__));
2120
2121
2122extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__));
2123
2124
2125extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
2126     __attribute__ ((__nothrow__));
2127
2128
2129
2130
2131
2132
2133extern int clock_nanosleep (clockid_t __clock_id, int __flags,
2134       __const struct timespec *__req,
2135       struct timespec *__rem);
2136
2137
2138extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__));
2139
2140
2141
2142
2143extern int timer_create (clockid_t __clock_id,
2144    struct sigevent *__restrict __evp,
2145    timer_t *__restrict __timerid) __attribute__ ((__nothrow__));
2146
2147
2148extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__));
2149
2150
2151extern int timer_settime (timer_t __timerid, int __flags,
2152     __const struct itimerspec *__restrict __value,
2153     struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__));
2154
2155
2156extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
2157     __attribute__ ((__nothrow__));
2158
2159
2160extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__));
2161# 417 "/usr/include/time.h" 3 4
2162
2163# 27 "/usr/include/pthread.h" 2 3 4
2164
2165
2166# 1 "/usr/include/bits/setjmp.h" 1 3 4
2167# 29 "/usr/include/bits/setjmp.h" 3 4
2168typedef int __jmp_buf[6];
2169# 30 "/usr/include/pthread.h" 2 3 4
2170# 1 "/usr/include/bits/wordsize.h" 1 3 4
2171# 31 "/usr/include/pthread.h" 2 3 4
2172
2173
2174
2175enum
2176{
2177  PTHREAD_CREATE_JOINABLE,
2178
2179  PTHREAD_CREATE_DETACHED
2180
2181};
2182
2183
2184
2185enum
2186{
2187  PTHREAD_MUTEX_TIMED_NP,
2188  PTHREAD_MUTEX_RECURSIVE_NP,
2189  PTHREAD_MUTEX_ERRORCHECK_NP,
2190  PTHREAD_MUTEX_ADAPTIVE_NP
2191
2192  ,
2193  PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
2194  PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
2195  PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
2196  PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
2197
2198
2199
2200
2201
2202};
2203
2204
2205
2206
2207enum
2208{
2209  PTHREAD_MUTEX_STALLED,
2210  PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED,
2211  PTHREAD_MUTEX_ROBUST,
2212  PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST
2213};
2214# 115 "/usr/include/pthread.h" 3 4
2215enum
2216{
2217  PTHREAD_RWLOCK_PREFER_READER_NP,
2218  PTHREAD_RWLOCK_PREFER_WRITER_NP,
2219  PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
2220  PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
2221};
2222# 147 "/usr/include/pthread.h" 3 4
2223enum
2224{
2225  PTHREAD_INHERIT_SCHED,
2226
2227  PTHREAD_EXPLICIT_SCHED
2228
2229};
2230
2231
2232
2233enum
2234{
2235  PTHREAD_SCOPE_SYSTEM,
2236
2237  PTHREAD_SCOPE_PROCESS
2238
2239};
2240
2241
2242
2243enum
2244{
2245  PTHREAD_PROCESS_PRIVATE,
2246
2247  PTHREAD_PROCESS_SHARED
2248
2249};
2250# 182 "/usr/include/pthread.h" 3 4
2251struct _pthread_cleanup_buffer
2252{
2253  void (*__routine) (void *);
2254  void *__arg;
2255  int __canceltype;
2256  struct _pthread_cleanup_buffer *__prev;
2257};
2258
2259
2260enum
2261{
2262  PTHREAD_CANCEL_ENABLE,
2263
2264  PTHREAD_CANCEL_DISABLE
2265
2266};
2267enum
2268{
2269  PTHREAD_CANCEL_DEFERRED,
2270
2271  PTHREAD_CANCEL_ASYNCHRONOUS
2272
2273};
2274# 220 "/usr/include/pthread.h" 3 4
2275
2276
2277
2278
2279
2280extern int pthread_create (pthread_t *__restrict __newthread,
2281      __const pthread_attr_t *__restrict __attr,
2282      void *(*__start_routine) (void *),
2283      void *__restrict __arg) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3)));
2284
2285
2286
2287
2288
2289extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
2290
2291
2292
2293
2294
2295
2296
2297extern int pthread_join (pthread_t __th, void **__thread_return);
2298# 263 "/usr/include/pthread.h" 3 4
2299extern int pthread_detach (pthread_t __th) __attribute__ ((__nothrow__));
2300
2301
2302
2303extern pthread_t pthread_self (void) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
2304
2305
2306extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __attribute__ ((__nothrow__));
2307
2308
2309
2310
2311
2312
2313
2314extern int pthread_attr_init (pthread_attr_t *__attr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2315
2316
2317extern int pthread_attr_destroy (pthread_attr_t *__attr)
2318     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2319
2320
2321extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
2322     int *__detachstate)
2323     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2324
2325
2326extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
2327     int __detachstate)
2328     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2329
2330
2331
2332extern int pthread_attr_getguardsize (__const pthread_attr_t *__attr,
2333          size_t *__guardsize)
2334     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2335
2336
2337extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
2338          size_t __guardsize)
2339     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2340
2341
2342
2343extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict
2344           __attr,
2345           struct sched_param *__restrict __param)
2346     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2347
2348
2349extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
2350           __const struct sched_param *__restrict
2351           __param) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2352
2353
2354extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict
2355     __attr, int *__restrict __policy)
2356     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2357
2358
2359extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
2360     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2361
2362
2363extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict
2364      __attr, int *__restrict __inherit)
2365     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2366
2367
2368extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
2369      int __inherit)
2370     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2371
2372
2373
2374extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr,
2375      int *__restrict __scope)
2376     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2377
2378
2379extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
2380     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2381
2382
2383extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict
2384          __attr, void **__restrict __stackaddr)
2385     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__deprecated__));
2386
2387
2388
2389
2390
2391extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
2392          void *__stackaddr)
2393     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__));
2394
2395
2396extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict
2397          __attr, size_t *__restrict __stacksize)
2398     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2399
2400
2401
2402
2403extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
2404          size_t __stacksize)
2405     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2406
2407
2408
2409extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
2410      void **__restrict __stackaddr,
2411      size_t *__restrict __stacksize)
2412     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3)));
2413
2414
2415
2416
2417extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
2418      size_t __stacksize) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2419# 413 "/usr/include/pthread.h" 3 4
2420extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
2421      __const struct sched_param *__param)
2422     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3)));
2423
2424
2425extern int pthread_getschedparam (pthread_t __target_thread,
2426      int *__restrict __policy,
2427      struct sched_param *__restrict __param)
2428     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
2429
2430
2431extern int pthread_setschedprio (pthread_t __target_thread, int __prio)
2432     __attribute__ ((__nothrow__));
2433# 478 "/usr/include/pthread.h" 3 4
2434extern int pthread_once (pthread_once_t *__once_control,
2435    void (*__init_routine) (void)) __attribute__ ((__nonnull__ (1, 2)));
2436# 490 "/usr/include/pthread.h" 3 4
2437extern int pthread_setcancelstate (int __state, int *__oldstate);
2438
2439
2440
2441extern int pthread_setcanceltype (int __type, int *__oldtype);
2442
2443
2444extern int pthread_cancel (pthread_t __th);
2445
2446
2447
2448
2449extern void pthread_testcancel (void);
2450
2451
2452
2453
2454typedef struct
2455{
2456  struct
2457  {
2458    __jmp_buf __cancel_jmp_buf;
2459    int __mask_was_saved;
2460  } __cancel_jmp_buf[1];
2461  void *__pad[4];
2462} __pthread_unwind_buf_t __attribute__ ((__aligned__));
2463# 524 "/usr/include/pthread.h" 3 4
2464struct __pthread_cleanup_frame
2465{
2466  void (*__cancel_routine) (void *);
2467  void *__cancel_arg;
2468  int __do_it;
2469  int __cancel_type;
2470};
2471# 664 "/usr/include/pthread.h" 3 4
2472extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf)
2473     __attribute__ ((__regparm__ (1)));
2474# 676 "/usr/include/pthread.h" 3 4
2475extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf)
2476  __attribute__ ((__regparm__ (1)));
2477# 717 "/usr/include/pthread.h" 3 4
2478extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
2479     __attribute__ ((__regparm__ (1))) __attribute__ ((__noreturn__))
2480
2481     __attribute__ ((__weak__))
2482
2483     ;
2484
2485
2486
2487struct __jmp_buf_tag;
2488extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __attribute__ ((__nothrow__));
2489
2490
2491
2492
2493
2494extern int pthread_mutex_init (pthread_mutex_t *__mutex,
2495          __const pthread_mutexattr_t *__mutexattr)
2496     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2497
2498
2499extern int pthread_mutex_destroy (pthread_mutex_t *__mutex)
2500     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2501
2502
2503extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
2504     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2505
2506
2507extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
2508     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2509
2510
2511
2512extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
2513        __const struct timespec *__restrict
2514        __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2515
2516
2517
2518extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
2519     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2520
2521
2522
2523extern int pthread_mutex_getprioceiling (__const pthread_mutex_t *
2524      __restrict __mutex,
2525      int *__restrict __prioceiling)
2526     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2527
2528
2529
2530extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
2531      int __prioceiling,
2532      int *__restrict __old_ceiling)
2533     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3)));
2534
2535
2536
2537
2538extern int pthread_mutex_consistent (pthread_mutex_t *__mutex)
2539     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2540# 790 "/usr/include/pthread.h" 3 4
2541extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr)
2542     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2543
2544
2545extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr)
2546     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2547
2548
2549extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *
2550      __restrict __attr,
2551      int *__restrict __pshared)
2552     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2553
2554
2555extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
2556      int __pshared)
2557     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2558
2559
2560
2561extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict
2562          __attr, int *__restrict __kind)
2563     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2564
2565
2566
2567
2568extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
2569     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2570
2571
2572
2573extern int pthread_mutexattr_getprotocol (__const pthread_mutexattr_t *
2574       __restrict __attr,
2575       int *__restrict __protocol)
2576     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2577
2578
2579
2580extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr,
2581       int __protocol)
2582     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2583
2584
2585extern int pthread_mutexattr_getprioceiling (__const pthread_mutexattr_t *
2586          __restrict __attr,
2587          int *__restrict __prioceiling)
2588     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2589
2590
2591extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr,
2592          int __prioceiling)
2593     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2594
2595
2596
2597extern int pthread_mutexattr_getrobust (__const pthread_mutexattr_t *__attr,
2598     int *__robustness)
2599     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2600
2601
2602
2603
2604
2605
2606
2607extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
2608     int __robustness)
2609     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2610# 872 "/usr/include/pthread.h" 3 4
2611extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
2612    __const pthread_rwlockattr_t *__restrict
2613    __attr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2614
2615
2616extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
2617     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2618
2619
2620extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
2621     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2622
2623
2624extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
2625  __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2626
2627
2628
2629extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
2630           __const struct timespec *__restrict
2631           __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2632
2633
2634
2635extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
2636     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2637
2638
2639extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
2640     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2641
2642
2643
2644extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
2645           __const struct timespec *__restrict
2646           __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2647
2648
2649
2650extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
2651     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2652
2653
2654
2655
2656
2657extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr)
2658     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2659
2660
2661extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr)
2662     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2663
2664
2665extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t *
2666       __restrict __attr,
2667       int *__restrict __pshared)
2668     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2669
2670
2671extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
2672       int __pshared)
2673     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2674
2675
2676extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *
2677       __restrict __attr,
2678       int *__restrict __pref)
2679     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2680
2681
2682extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
2683       int __pref) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2684
2685
2686
2687
2688
2689
2690
2691extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
2692         __const pthread_condattr_t *__restrict
2693         __cond_attr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2694
2695
2696extern int pthread_cond_destroy (pthread_cond_t *__cond)
2697     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2698
2699
2700extern int pthread_cond_signal (pthread_cond_t *__cond)
2701     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2702
2703
2704extern int pthread_cond_broadcast (pthread_cond_t *__cond)
2705     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2706
2707
2708
2709
2710
2711
2712extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
2713         pthread_mutex_t *__restrict __mutex)
2714     __attribute__ ((__nonnull__ (1, 2)));
2715# 984 "/usr/include/pthread.h" 3 4
2716extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
2717       pthread_mutex_t *__restrict __mutex,
2718       __const struct timespec *__restrict
2719       __abstime) __attribute__ ((__nonnull__ (1, 2, 3)));
2720
2721
2722
2723
2724extern int pthread_condattr_init (pthread_condattr_t *__attr)
2725     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2726
2727
2728extern int pthread_condattr_destroy (pthread_condattr_t *__attr)
2729     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2730
2731
2732extern int pthread_condattr_getpshared (__const pthread_condattr_t *
2733     __restrict __attr,
2734     int *__restrict __pshared)
2735     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2736
2737
2738extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
2739     int __pshared) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2740
2741
2742
2743extern int pthread_condattr_getclock (__const pthread_condattr_t *
2744          __restrict __attr,
2745          __clockid_t *__restrict __clock_id)
2746     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2747
2748
2749extern int pthread_condattr_setclock (pthread_condattr_t *__attr,
2750          __clockid_t __clock_id)
2751     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2752# 1028 "/usr/include/pthread.h" 3 4
2753extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
2754     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2755
2756
2757extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
2758     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2759
2760
2761extern int pthread_spin_lock (pthread_spinlock_t *__lock)
2762     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2763
2764
2765extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
2766     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2767
2768
2769extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
2770     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2771
2772
2773
2774
2775
2776
2777extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
2778     __const pthread_barrierattr_t *__restrict
2779     __attr, unsigned int __count)
2780     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2781
2782
2783extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
2784     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2785
2786
2787extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
2788     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2789
2790
2791
2792extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr)
2793     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2794
2795
2796extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr)
2797     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2798
2799
2800extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t *
2801        __restrict __attr,
2802        int *__restrict __pshared)
2803     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2804
2805
2806extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
2807        int __pshared)
2808     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2809# 1095 "/usr/include/pthread.h" 3 4
2810extern int pthread_key_create (pthread_key_t *__key,
2811          void (*__destr_function) (void *))
2812     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2813
2814
2815extern int pthread_key_delete (pthread_key_t __key) __attribute__ ((__nothrow__));
2816
2817
2818extern void *pthread_getspecific (pthread_key_t __key) __attribute__ ((__nothrow__));
2819
2820
2821extern int pthread_setspecific (pthread_key_t __key,
2822    __const void *__pointer) __attribute__ ((__nothrow__)) ;
2823
2824
2825
2826
2827extern int pthread_getcpuclockid (pthread_t __thread_id,
2828      __clockid_t *__clock_id)
2829     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2830# 1129 "/usr/include/pthread.h" 3 4
2831extern int pthread_atfork (void (*__prepare) (void),
2832      void (*__parent) (void),
2833      void (*__child) (void)) __attribute__ ((__nothrow__));
2834# 1143 "/usr/include/pthread.h" 3 4
2835
2836# 4 "reorder.c" 2
2837
2838
2839
2840static int iSet = 2;
2841static int iCheck = 2;
2842
2843static int a = 0;
2844static int b = 0;
2845
2846void *setThread(void *param);
2847void *checkThread(void *param);
2848void set();
2849int check();
2850
2851int main(int argc, char *argv[]) {
2852    int i, err;
2853
2854    if (argc != 1) {
2855        if (argc != 3) {
2856            fprintf(stderr, "./reorder <param1> <param2>\n");
2857            exit(-1);
2858        } else {
2859            sscanf(argv[1], "%d", &iSet);
2860            sscanf(argv[2], "%d", &iCheck);
2861        }
2862    }
2863
2864
2865
2866    pthread_t setPool[iSet];
2867    pthread_t checkPool[iCheck];
2868
2869    for (i = 0; i < iSet; i++) {
2870        if (0 != (err = pthread_create(&setPool[i], ((void *)0), &setThread, ((void *)0)))) {
2871            fprintf(stderr, "Error [%d] found creating set thread.\n", err);
2872            exit(-1);
2873        }
2874    }
2875
2876    for (i = 0; i < iCheck; i++) {
2877        if (0 != (err = pthread_create(&checkPool[i], ((void *)0), &checkThread,
2878                                       ((void *)0)))) {
2879            fprintf(stderr, "Error [%d] found creating check thread.\n", err);
2880            exit(-1);
2881        }
2882    }
2883
2884    for (i = 0; i < iSet; i++) {
2885        if (0 != (err = pthread_join(setPool[i], ((void *)0)))) {
2886            fprintf(stderr, "pthread join error: %d\n", err);
2887            exit(-1);
2888        }
2889    }
2890
2891    for (i = 0; i < iCheck; i++) {
2892        if (0 != (err = pthread_join(checkPool[i], ((void *)0)))) {
2893            fprintf(stderr, "pthread join error: %d\n", err);
2894            exit(-1);
2895        }
2896    }
2897
2898    return 0;
2899}
2900
2901void *setThread(void *param) {
2902    a = 1;
2903    b = -1;
2904
2905    return ((void *)0);
2906}
2907
2908void *checkThread(void *param) {
2909    if (! ((a == 0 && b == 0) || (a == 1 && b == -1))) {
2910        fprintf(stderr, "Bug found!\n");
2911     goto ERROR;
2912     ERROR:
2913       ;
2914    }
2915
2916    return ((void *)0);
2917}