Showing error 2192

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


Source:

   1# 1 "indexer.c"
   2# 1 "<built-in>"
   3# 1 "<command-line>"
   4# 1 "indexer.c"
   5# 1 "/usr/include/stdlib.h" 1 3 4
   6# 25 "/usr/include/stdlib.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# 26 "/usr/include/stdlib.h" 2 3 4
  27
  28
  29
  30
  31
  32
  33
  34# 1 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 1 3 4
  35# 212 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 3 4
  36typedef unsigned int size_t;
  37# 324 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 3 4
  38typedef long int wchar_t;
  39# 34 "/usr/include/stdlib.h" 2 3 4
  40
  41
  42
  43
  44
  45
  46
  47
  48# 1 "/usr/include/bits/waitflags.h" 1 3 4
  49# 43 "/usr/include/stdlib.h" 2 3 4
  50# 1 "/usr/include/bits/waitstatus.h" 1 3 4
  51# 65 "/usr/include/bits/waitstatus.h" 3 4
  52# 1 "/usr/include/endian.h" 1 3 4
  53# 37 "/usr/include/endian.h" 3 4
  54# 1 "/usr/include/bits/endian.h" 1 3 4
  55# 38 "/usr/include/endian.h" 2 3 4
  56# 61 "/usr/include/endian.h" 3 4
  57# 1 "/usr/include/bits/byteswap.h" 1 3 4
  58# 62 "/usr/include/endian.h" 2 3 4
  59# 66 "/usr/include/bits/waitstatus.h" 2 3 4
  60
  61union wait
  62  {
  63    int w_status;
  64    struct
  65      {
  66
  67 unsigned int __w_termsig:7;
  68 unsigned int __w_coredump:1;
  69 unsigned int __w_retcode:8;
  70 unsigned int:16;
  71
  72
  73
  74
  75
  76
  77
  78      } __wait_terminated;
  79    struct
  80      {
  81
  82 unsigned int __w_stopval:8;
  83 unsigned int __w_stopsig:8;
  84 unsigned int:16;
  85
  86
  87
  88
  89
  90
  91      } __wait_stopped;
  92  };
  93# 44 "/usr/include/stdlib.h" 2 3 4
  94# 68 "/usr/include/stdlib.h" 3 4
  95typedef union
  96  {
  97    union wait *__uptr;
  98    int *__iptr;
  99  } __WAIT_STATUS __attribute__ ((__transparent_union__));
 100# 96 "/usr/include/stdlib.h" 3 4
 101
 102
 103typedef struct
 104  {
 105    int quot;
 106    int rem;
 107  } div_t;
 108
 109
 110
 111typedef struct
 112  {
 113    long int quot;
 114    long int rem;
 115  } ldiv_t;
 116
 117
 118
 119
 120
 121
 122
 123__extension__ typedef struct
 124  {
 125    long long int quot;
 126    long long int rem;
 127  } lldiv_t;
 128
 129
 130# 140 "/usr/include/stdlib.h" 3 4
 131extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__)) ;
 132
 133
 134
 135
 136extern double atof (__const char *__nptr)
 137     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
 138
 139extern int atoi (__const char *__nptr)
 140     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
 141
 142extern long int atol (__const char *__nptr)
 143     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
 144
 145
 146
 147
 148
 149__extension__ extern long long int atoll (__const char *__nptr)
 150     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
 151
 152
 153
 154
 155
 156extern double strtod (__const char *__restrict __nptr,
 157        char **__restrict __endptr)
 158     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
 159
 160
 161
 162
 163
 164extern float strtof (__const char *__restrict __nptr,
 165       char **__restrict __endptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
 166
 167extern long double strtold (__const char *__restrict __nptr,
 168       char **__restrict __endptr)
 169     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
 170
 171
 172
 173
 174
 175extern long int strtol (__const char *__restrict __nptr,
 176   char **__restrict __endptr, int __base)
 177     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
 178
 179extern unsigned long int strtoul (__const char *__restrict __nptr,
 180      char **__restrict __endptr, int __base)
 181     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
 182
 183
 184
 185
 186__extension__
 187extern long long int strtoq (__const char *__restrict __nptr,
 188        char **__restrict __endptr, int __base)
 189     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
 190
 191__extension__
 192extern unsigned long long int strtouq (__const char *__restrict __nptr,
 193           char **__restrict __endptr, int __base)
 194     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
 195
 196
 197
 198
 199
 200__extension__
 201extern long long int strtoll (__const char *__restrict __nptr,
 202         char **__restrict __endptr, int __base)
 203     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
 204
 205__extension__
 206extern unsigned long long int strtoull (__const char *__restrict __nptr,
 207     char **__restrict __endptr, int __base)
 208     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
 209
 210# 311 "/usr/include/stdlib.h" 3 4
 211extern char *l64a (long int __n) __attribute__ ((__nothrow__)) ;
 212
 213
 214extern long int a64l (__const char *__s)
 215     __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
 216
 217
 218
 219
 220# 1 "/usr/include/sys/types.h" 1 3 4
 221# 28 "/usr/include/sys/types.h" 3 4
 222
 223
 224# 1 "/usr/include/bits/types.h" 1 3 4
 225# 28 "/usr/include/bits/types.h" 3 4
 226# 1 "/usr/include/bits/wordsize.h" 1 3 4
 227# 29 "/usr/include/bits/types.h" 2 3 4
 228
 229
 230typedef unsigned char __u_char;
 231typedef unsigned short int __u_short;
 232typedef unsigned int __u_int;
 233typedef unsigned long int __u_long;
 234
 235
 236typedef signed char __int8_t;
 237typedef unsigned char __uint8_t;
 238typedef signed short int __int16_t;
 239typedef unsigned short int __uint16_t;
 240typedef signed int __int32_t;
 241typedef unsigned int __uint32_t;
 242
 243
 244
 245
 246__extension__ typedef signed long long int __int64_t;
 247__extension__ typedef unsigned long long int __uint64_t;
 248
 249
 250
 251
 252
 253
 254
 255__extension__ typedef long long int __quad_t;
 256__extension__ typedef unsigned long long int __u_quad_t;
 257# 131 "/usr/include/bits/types.h" 3 4
 258# 1 "/usr/include/bits/typesizes.h" 1 3 4
 259# 132 "/usr/include/bits/types.h" 2 3 4
 260
 261
 262__extension__ typedef __u_quad_t __dev_t;
 263__extension__ typedef unsigned int __uid_t;
 264__extension__ typedef unsigned int __gid_t;
 265__extension__ typedef unsigned long int __ino_t;
 266__extension__ typedef __u_quad_t __ino64_t;
 267__extension__ typedef unsigned int __mode_t;
 268__extension__ typedef unsigned int __nlink_t;
 269__extension__ typedef long int __off_t;
 270__extension__ typedef __quad_t __off64_t;
 271__extension__ typedef int __pid_t;
 272__extension__ typedef struct { int __val[2]; } __fsid_t;
 273__extension__ typedef long int __clock_t;
 274__extension__ typedef unsigned long int __rlim_t;
 275__extension__ typedef __u_quad_t __rlim64_t;
 276__extension__ typedef unsigned int __id_t;
 277__extension__ typedef long int __time_t;
 278__extension__ typedef unsigned int __useconds_t;
 279__extension__ typedef long int __suseconds_t;
 280
 281__extension__ typedef int __daddr_t;
 282__extension__ typedef long int __swblk_t;
 283__extension__ typedef int __key_t;
 284
 285
 286__extension__ typedef int __clockid_t;
 287
 288
 289__extension__ typedef void * __timer_t;
 290
 291
 292__extension__ typedef long int __blksize_t;
 293
 294
 295
 296
 297__extension__ typedef long int __blkcnt_t;
 298__extension__ typedef __quad_t __blkcnt64_t;
 299
 300
 301__extension__ typedef unsigned long int __fsblkcnt_t;
 302__extension__ typedef __u_quad_t __fsblkcnt64_t;
 303
 304
 305__extension__ typedef unsigned long int __fsfilcnt_t;
 306__extension__ typedef __u_quad_t __fsfilcnt64_t;
 307
 308__extension__ typedef int __ssize_t;
 309
 310
 311
 312typedef __off64_t __loff_t;
 313typedef __quad_t *__qaddr_t;
 314typedef char *__caddr_t;
 315
 316
 317__extension__ typedef int __intptr_t;
 318
 319
 320__extension__ typedef unsigned int __socklen_t;
 321# 31 "/usr/include/sys/types.h" 2 3 4
 322
 323
 324
 325typedef __u_char u_char;
 326typedef __u_short u_short;
 327typedef __u_int u_int;
 328typedef __u_long u_long;
 329typedef __quad_t quad_t;
 330typedef __u_quad_t u_quad_t;
 331typedef __fsid_t fsid_t;
 332
 333
 334
 335
 336typedef __loff_t loff_t;
 337
 338
 339
 340typedef __ino_t ino_t;
 341# 61 "/usr/include/sys/types.h" 3 4
 342typedef __dev_t dev_t;
 343
 344
 345
 346
 347typedef __gid_t gid_t;
 348
 349
 350
 351
 352typedef __mode_t mode_t;
 353
 354
 355
 356
 357typedef __nlink_t nlink_t;
 358
 359
 360
 361
 362typedef __uid_t uid_t;
 363
 364
 365
 366
 367
 368typedef __off_t off_t;
 369# 99 "/usr/include/sys/types.h" 3 4
 370typedef __pid_t pid_t;
 371
 372
 373
 374
 375
 376typedef __id_t id_t;
 377
 378
 379
 380
 381typedef __ssize_t ssize_t;
 382
 383
 384
 385
 386
 387typedef __daddr_t daddr_t;
 388typedef __caddr_t caddr_t;
 389
 390
 391
 392
 393
 394typedef __key_t key_t;
 395# 133 "/usr/include/sys/types.h" 3 4
 396# 1 "/usr/include/time.h" 1 3 4
 397# 58 "/usr/include/time.h" 3 4
 398
 399
 400typedef __clock_t clock_t;
 401
 402
 403
 404# 74 "/usr/include/time.h" 3 4
 405
 406
 407typedef __time_t time_t;
 408
 409
 410
 411# 92 "/usr/include/time.h" 3 4
 412typedef __clockid_t clockid_t;
 413# 104 "/usr/include/time.h" 3 4
 414typedef __timer_t timer_t;
 415# 134 "/usr/include/sys/types.h" 2 3 4
 416# 147 "/usr/include/sys/types.h" 3 4
 417# 1 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 1 3 4
 418# 148 "/usr/include/sys/types.h" 2 3 4
 419
 420
 421
 422typedef unsigned long int ulong;
 423typedef unsigned short int ushort;
 424typedef unsigned int uint;
 425# 195 "/usr/include/sys/types.h" 3 4
 426typedef int int8_t __attribute__ ((__mode__ (__QI__)));
 427typedef int int16_t __attribute__ ((__mode__ (__HI__)));
 428typedef int int32_t __attribute__ ((__mode__ (__SI__)));
 429typedef int int64_t __attribute__ ((__mode__ (__DI__)));
 430
 431
 432typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
 433typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
 434typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
 435typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
 436
 437typedef int register_t __attribute__ ((__mode__ (__word__)));
 438# 220 "/usr/include/sys/types.h" 3 4
 439# 1 "/usr/include/sys/select.h" 1 3 4
 440# 31 "/usr/include/sys/select.h" 3 4
 441# 1 "/usr/include/bits/select.h" 1 3 4
 442# 32 "/usr/include/sys/select.h" 2 3 4
 443
 444
 445# 1 "/usr/include/bits/sigset.h" 1 3 4
 446# 24 "/usr/include/bits/sigset.h" 3 4
 447typedef int __sig_atomic_t;
 448
 449
 450
 451
 452typedef struct
 453  {
 454    unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
 455  } __sigset_t;
 456# 35 "/usr/include/sys/select.h" 2 3 4
 457
 458
 459
 460typedef __sigset_t sigset_t;
 461
 462
 463
 464
 465
 466# 1 "/usr/include/time.h" 1 3 4
 467# 120 "/usr/include/time.h" 3 4
 468struct timespec
 469  {
 470    __time_t tv_sec;
 471    long int tv_nsec;
 472  };
 473# 45 "/usr/include/sys/select.h" 2 3 4
 474
 475# 1 "/usr/include/bits/time.h" 1 3 4
 476# 31 "/usr/include/bits/time.h" 3 4
 477struct timeval
 478  {
 479    __time_t tv_sec;
 480    __suseconds_t tv_usec;
 481  };
 482# 47 "/usr/include/sys/select.h" 2 3 4
 483
 484
 485typedef __suseconds_t suseconds_t;
 486
 487
 488
 489
 490
 491typedef long int __fd_mask;
 492# 65 "/usr/include/sys/select.h" 3 4
 493typedef struct
 494  {
 495
 496
 497
 498
 499
 500
 501    __fd_mask __fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];
 502
 503
 504  } fd_set;
 505
 506
 507
 508
 509
 510
 511typedef __fd_mask fd_mask;
 512# 97 "/usr/include/sys/select.h" 3 4
 513
 514# 107 "/usr/include/sys/select.h" 3 4
 515extern int select (int __nfds, fd_set *__restrict __readfds,
 516     fd_set *__restrict __writefds,
 517     fd_set *__restrict __exceptfds,
 518     struct timeval *__restrict __timeout);
 519# 119 "/usr/include/sys/select.h" 3 4
 520extern int pselect (int __nfds, fd_set *__restrict __readfds,
 521      fd_set *__restrict __writefds,
 522      fd_set *__restrict __exceptfds,
 523      const struct timespec *__restrict __timeout,
 524      const __sigset_t *__restrict __sigmask);
 525# 132 "/usr/include/sys/select.h" 3 4
 526
 527# 221 "/usr/include/sys/types.h" 2 3 4
 528
 529
 530# 1 "/usr/include/sys/sysmacros.h" 1 3 4
 531# 30 "/usr/include/sys/sysmacros.h" 3 4
 532
 533
 534__extension__
 535extern unsigned int gnu_dev_major (unsigned long long int __dev)
 536     __attribute__ ((__nothrow__)) __attribute__ ((__const__));
 537__extension__
 538extern unsigned int gnu_dev_minor (unsigned long long int __dev)
 539     __attribute__ ((__nothrow__)) __attribute__ ((__const__));
 540__extension__
 541extern unsigned long long int gnu_dev_makedev (unsigned int __major,
 542            unsigned int __minor)
 543     __attribute__ ((__nothrow__)) __attribute__ ((__const__));
 544# 64 "/usr/include/sys/sysmacros.h" 3 4
 545
 546# 224 "/usr/include/sys/types.h" 2 3 4
 547
 548
 549
 550
 551
 552typedef __blksize_t blksize_t;
 553
 554
 555
 556
 557
 558
 559typedef __blkcnt_t blkcnt_t;
 560
 561
 562
 563typedef __fsblkcnt_t fsblkcnt_t;
 564
 565
 566
 567typedef __fsfilcnt_t fsfilcnt_t;
 568# 271 "/usr/include/sys/types.h" 3 4
 569# 1 "/usr/include/bits/pthreadtypes.h" 1 3 4
 570# 36 "/usr/include/bits/pthreadtypes.h" 3 4
 571typedef unsigned long int pthread_t;
 572
 573
 574typedef union
 575{
 576  char __size[36];
 577  long int __align;
 578} pthread_attr_t;
 579
 580
 581typedef struct __pthread_internal_slist
 582{
 583  struct __pthread_internal_slist *__next;
 584} __pthread_slist_t;
 585
 586
 587
 588
 589typedef union
 590{
 591  struct __pthread_mutex_s
 592  {
 593    int __lock;
 594    unsigned int __count;
 595    int __owner;
 596
 597
 598    int __kind;
 599    unsigned int __nusers;
 600    __extension__ union
 601    {
 602      int __spins;
 603      __pthread_slist_t __list;
 604    };
 605  } __data;
 606  char __size[24];
 607  long int __align;
 608} pthread_mutex_t;
 609
 610typedef union
 611{
 612  char __size[4];
 613  long int __align;
 614} pthread_mutexattr_t;
 615
 616
 617
 618
 619typedef union
 620{
 621  struct
 622  {
 623    int __lock;
 624    unsigned int __futex;
 625    __extension__ unsigned long long int __total_seq;
 626    __extension__ unsigned long long int __wakeup_seq;
 627    __extension__ unsigned long long int __woken_seq;
 628    void *__mutex;
 629    unsigned int __nwaiters;
 630    unsigned int __broadcast_seq;
 631  } __data;
 632  char __size[48];
 633  __extension__ long long int __align;
 634} pthread_cond_t;
 635
 636typedef union
 637{
 638  char __size[4];
 639  long int __align;
 640} pthread_condattr_t;
 641
 642
 643
 644typedef unsigned int pthread_key_t;
 645
 646
 647
 648typedef int pthread_once_t;
 649
 650
 651
 652
 653
 654typedef union
 655{
 656  struct
 657  {
 658    int __lock;
 659    unsigned int __nr_readers;
 660    unsigned int __readers_wakeup;
 661    unsigned int __writer_wakeup;
 662    unsigned int __nr_readers_queued;
 663    unsigned int __nr_writers_queued;
 664
 665
 666    unsigned char __flags;
 667    unsigned char __shared;
 668    unsigned char __pad1;
 669    unsigned char __pad2;
 670    int __writer;
 671  } __data;
 672  char __size[32];
 673  long int __align;
 674} pthread_rwlock_t;
 675
 676typedef union
 677{
 678  char __size[8];
 679  long int __align;
 680} pthread_rwlockattr_t;
 681
 682
 683
 684
 685
 686typedef volatile int pthread_spinlock_t;
 687
 688
 689
 690
 691typedef union
 692{
 693  char __size[20];
 694  long int __align;
 695} pthread_barrier_t;
 696
 697typedef union
 698{
 699  char __size[4];
 700  int __align;
 701} pthread_barrierattr_t;
 702# 272 "/usr/include/sys/types.h" 2 3 4
 703
 704
 705
 706# 321 "/usr/include/stdlib.h" 2 3 4
 707
 708
 709
 710
 711
 712
 713extern long int random (void) __attribute__ ((__nothrow__));
 714
 715
 716extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__));
 717
 718
 719
 720
 721
 722extern char *initstate (unsigned int __seed, char *__statebuf,
 723   size_t __statelen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
 724
 725
 726
 727extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 728
 729
 730
 731
 732
 733
 734
 735struct random_data
 736  {
 737    int32_t *fptr;
 738    int32_t *rptr;
 739    int32_t *state;
 740    int rand_type;
 741    int rand_deg;
 742    int rand_sep;
 743    int32_t *end_ptr;
 744  };
 745
 746extern int random_r (struct random_data *__restrict __buf,
 747       int32_t *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
 748
 749extern int srandom_r (unsigned int __seed, struct random_data *__buf)
 750     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
 751
 752extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
 753   size_t __statelen,
 754   struct random_data *__restrict __buf)
 755     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4)));
 756
 757extern int setstate_r (char *__restrict __statebuf,
 758         struct random_data *__restrict __buf)
 759     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
 760
 761
 762
 763
 764
 765
 766extern int rand (void) __attribute__ ((__nothrow__));
 767
 768extern void srand (unsigned int __seed) __attribute__ ((__nothrow__));
 769
 770
 771
 772
 773extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__));
 774
 775
 776
 777
 778
 779
 780
 781extern double drand48 (void) __attribute__ ((__nothrow__));
 782extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 783
 784
 785extern long int lrand48 (void) __attribute__ ((__nothrow__));
 786extern long int nrand48 (unsigned short int __xsubi[3])
 787     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 788
 789
 790extern long int mrand48 (void) __attribute__ ((__nothrow__));
 791extern long int jrand48 (unsigned short int __xsubi[3])
 792     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 793
 794
 795extern void srand48 (long int __seedval) __attribute__ ((__nothrow__));
 796extern unsigned short int *seed48 (unsigned short int __seed16v[3])
 797     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 798extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 799
 800
 801
 802
 803
 804struct drand48_data
 805  {
 806    unsigned short int __x[3];
 807    unsigned short int __old_x[3];
 808    unsigned short int __c;
 809    unsigned short int __init;
 810    unsigned long long int __a;
 811  };
 812
 813
 814extern int drand48_r (struct drand48_data *__restrict __buffer,
 815        double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
 816extern int erand48_r (unsigned short int __xsubi[3],
 817        struct drand48_data *__restrict __buffer,
 818        double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
 819
 820
 821extern int lrand48_r (struct drand48_data *__restrict __buffer,
 822        long int *__restrict __result)
 823     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
 824extern int nrand48_r (unsigned short int __xsubi[3],
 825        struct drand48_data *__restrict __buffer,
 826        long int *__restrict __result)
 827     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
 828
 829
 830extern int mrand48_r (struct drand48_data *__restrict __buffer,
 831        long int *__restrict __result)
 832     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
 833extern int jrand48_r (unsigned short int __xsubi[3],
 834        struct drand48_data *__restrict __buffer,
 835        long int *__restrict __result)
 836     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
 837
 838
 839extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
 840     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
 841
 842extern int seed48_r (unsigned short int __seed16v[3],
 843       struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
 844
 845extern int lcong48_r (unsigned short int __param[7],
 846        struct drand48_data *__buffer)
 847     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
 858
 859extern void *calloc (size_t __nmemb, size_t __size)
 860     __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871extern void *realloc (void *__ptr, size_t __size)
 872     __attribute__ ((__nothrow__)) __attribute__ ((__warn_unused_result__));
 873
 874extern void free (void *__ptr) __attribute__ ((__nothrow__));
 875
 876
 877
 878
 879extern void cfree (void *__ptr) __attribute__ ((__nothrow__));
 880
 881
 882
 883# 1 "/usr/include/alloca.h" 1 3 4
 884# 25 "/usr/include/alloca.h" 3 4
 885# 1 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 1 3 4
 886# 26 "/usr/include/alloca.h" 2 3 4
 887
 888
 889
 890
 891
 892
 893
 894extern void *alloca (size_t __size) __attribute__ ((__nothrow__));
 895
 896
 897
 898
 899
 900
 901# 498 "/usr/include/stdlib.h" 2 3 4
 902
 903
 904
 905
 906
 907extern void *valloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ;
 908
 909
 910
 911
 912extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
 913     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
 914
 915
 916
 917
 918extern void abort (void) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
 919
 920
 921
 922extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 923# 531 "/usr/include/stdlib.h" 3 4
 924
 925
 926
 927
 928
 929extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
 930     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 931
 932
 933
 934
 935
 936
 937extern void exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
 938# 554 "/usr/include/stdlib.h" 3 4
 939
 940
 941
 942
 943
 944
 945extern void _Exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__));
 946
 947
 948
 949
 950
 951
 952extern char *getenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
 953
 954
 955
 956
 957extern char *__secure_getenv (__const char *__name)
 958     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
 959
 960
 961
 962
 963
 964extern int putenv (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 965
 966
 967
 968
 969
 970extern int setenv (__const char *__name, __const char *__value, int __replace)
 971     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
 972
 973
 974extern int unsetenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
 975
 976
 977
 978
 979
 980
 981extern int clearenv (void) __attribute__ ((__nothrow__));
 982# 606 "/usr/include/stdlib.h" 3 4
 983extern char *mktemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
 984# 620 "/usr/include/stdlib.h" 3 4
 985extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ;
 986# 642 "/usr/include/stdlib.h" 3 4
 987extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) ;
 988# 663 "/usr/include/stdlib.h" 3 4
 989extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
 990# 712 "/usr/include/stdlib.h" 3 4
 991
 992
 993
 994
 995
 996extern int system (__const char *__command) ;
 997
 998# 734 "/usr/include/stdlib.h" 3 4
 999extern char *realpath (__const char *__restrict __name,
1000         char *__restrict __resolved) __attribute__ ((__nothrow__)) ;
1001
1002
1003
1004
1005
1006
1007typedef int (*__compar_fn_t) (__const void *, __const void *);
1008# 752 "/usr/include/stdlib.h" 3 4
1009
1010
1011
1012extern void *bsearch (__const void *__key, __const void *__base,
1013        size_t __nmemb, size_t __size, __compar_fn_t __compar)
1014     __attribute__ ((__nonnull__ (1, 2, 5))) ;
1015
1016
1017
1018extern void qsort (void *__base, size_t __nmemb, size_t __size,
1019     __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
1020# 771 "/usr/include/stdlib.h" 3 4
1021extern int abs (int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
1022extern long int labs (long int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
1023
1024
1025
1026__extension__ extern long long int llabs (long long int __x)
1027     __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
1028
1029
1030
1031
1032
1033
1034
1035extern div_t div (int __numer, int __denom)
1036     __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
1037extern ldiv_t ldiv (long int __numer, long int __denom)
1038     __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
1039
1040
1041
1042
1043__extension__ extern lldiv_t lldiv (long long int __numer,
1044        long long int __denom)
1045     __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ;
1046
1047# 808 "/usr/include/stdlib.h" 3 4
1048extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
1049     int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ;
1050
1051
1052
1053
1054extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
1055     int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ;
1056
1057
1058
1059
1060extern char *gcvt (double __value, int __ndigit, char *__buf)
1061     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ;
1062
1063
1064
1065
1066extern char *qecvt (long double __value, int __ndigit,
1067      int *__restrict __decpt, int *__restrict __sign)
1068     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ;
1069extern char *qfcvt (long double __value, int __ndigit,
1070      int *__restrict __decpt, int *__restrict __sign)
1071     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ;
1072extern char *qgcvt (long double __value, int __ndigit, char *__buf)
1073     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ;
1074
1075
1076
1077
1078extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
1079     int *__restrict __sign, char *__restrict __buf,
1080     size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
1081extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
1082     int *__restrict __sign, char *__restrict __buf,
1083     size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
1084
1085extern int qecvt_r (long double __value, int __ndigit,
1086      int *__restrict __decpt, int *__restrict __sign,
1087      char *__restrict __buf, size_t __len)
1088     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
1089extern int qfcvt_r (long double __value, int __ndigit,
1090      int *__restrict __decpt, int *__restrict __sign,
1091      char *__restrict __buf, size_t __len)
1092     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5)));
1093
1094
1095
1096
1097
1098
1099
1100extern int mblen (__const char *__s, size_t __n) __attribute__ ((__nothrow__)) ;
1101
1102
1103extern int mbtowc (wchar_t *__restrict __pwc,
1104     __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)) ;
1105
1106
1107extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__)) ;
1108
1109
1110
1111extern size_t mbstowcs (wchar_t *__restrict __pwcs,
1112   __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__));
1113
1114extern size_t wcstombs (char *__restrict __s,
1115   __const wchar_t *__restrict __pwcs, size_t __n)
1116     __attribute__ ((__nothrow__));
1117
1118
1119
1120
1121
1122
1123
1124
1125extern int rpmatch (__const char *__response) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;
1126# 896 "/usr/include/stdlib.h" 3 4
1127extern int getsubopt (char **__restrict __optionp,
1128        char *__const *__restrict __tokens,
1129        char **__restrict __valuep)
1130     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;
1131# 948 "/usr/include/stdlib.h" 3 4
1132extern int getloadavg (double __loadavg[], int __nelem)
1133     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1134# 964 "/usr/include/stdlib.h" 3 4
1135
1136# 2 "indexer.c" 2
1137# 1 "/usr/include/pthread.h" 1 3 4
1138# 25 "/usr/include/pthread.h" 3 4
1139# 1 "/usr/include/sched.h" 1 3 4
1140# 30 "/usr/include/sched.h" 3 4
1141# 1 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 1 3 4
1142# 31 "/usr/include/sched.h" 2 3 4
1143
1144
1145
1146# 1 "/usr/include/time.h" 1 3 4
1147# 35 "/usr/include/sched.h" 2 3 4
1148# 43 "/usr/include/sched.h" 3 4
1149# 1 "/usr/include/bits/sched.h" 1 3 4
1150# 74 "/usr/include/bits/sched.h" 3 4
1151struct sched_param
1152  {
1153    int __sched_priority;
1154  };
1155
1156
1157# 97 "/usr/include/bits/sched.h" 3 4
1158
1159
1160
1161
1162
1163
1164
1165
1166struct __sched_param
1167  {
1168    int __sched_priority;
1169  };
1170# 120 "/usr/include/bits/sched.h" 3 4
1171typedef unsigned long int __cpu_mask;
1172
1173
1174
1175
1176
1177
1178typedef struct
1179{
1180  __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))];
1181} cpu_set_t;
1182# 203 "/usr/include/bits/sched.h" 3 4
1183
1184
1185extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
1186  __attribute__ ((__nothrow__));
1187extern cpu_set_t *__sched_cpualloc (size_t __count) __attribute__ ((__nothrow__)) ;
1188extern void __sched_cpufree (cpu_set_t *__set) __attribute__ ((__nothrow__));
1189
1190
1191# 44 "/usr/include/sched.h" 2 3 4
1192
1193
1194
1195
1196
1197
1198
1199extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param)
1200     __attribute__ ((__nothrow__));
1201
1202
1203extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __attribute__ ((__nothrow__));
1204
1205
1206extern int sched_setscheduler (__pid_t __pid, int __policy,
1207          __const struct sched_param *__param) __attribute__ ((__nothrow__));
1208
1209
1210extern int sched_getscheduler (__pid_t __pid) __attribute__ ((__nothrow__));
1211
1212
1213extern int sched_yield (void) __attribute__ ((__nothrow__));
1214
1215
1216extern int sched_get_priority_max (int __algorithm) __attribute__ ((__nothrow__));
1217
1218
1219extern int sched_get_priority_min (int __algorithm) __attribute__ ((__nothrow__));
1220
1221
1222extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __attribute__ ((__nothrow__));
1223# 126 "/usr/include/sched.h" 3 4
1224
1225# 26 "/usr/include/pthread.h" 2 3 4
1226# 1 "/usr/include/time.h" 1 3 4
1227# 30 "/usr/include/time.h" 3 4
1228
1229
1230
1231
1232
1233
1234
1235
1236# 1 "/usr/lib/gcc/i686-redhat-linux/4.6.3/include/stddef.h" 1 3 4
1237# 39 "/usr/include/time.h" 2 3 4
1238
1239
1240
1241# 1 "/usr/include/bits/time.h" 1 3 4
1242# 43 "/usr/include/time.h" 2 3 4
1243# 131 "/usr/include/time.h" 3 4
1244
1245
1246struct tm
1247{
1248  int tm_sec;
1249  int tm_min;
1250  int tm_hour;
1251  int tm_mday;
1252  int tm_mon;
1253  int tm_year;
1254  int tm_wday;
1255  int tm_yday;
1256  int tm_isdst;
1257
1258
1259  long int tm_gmtoff;
1260  __const char *tm_zone;
1261
1262
1263
1264
1265};
1266
1267
1268
1269
1270
1271
1272
1273
1274struct itimerspec
1275  {
1276    struct timespec it_interval;
1277    struct timespec it_value;
1278  };
1279
1280
1281struct sigevent;
1282# 180 "/usr/include/time.h" 3 4
1283
1284
1285
1286extern clock_t clock (void) __attribute__ ((__nothrow__));
1287
1288
1289extern time_t time (time_t *__timer) __attribute__ ((__nothrow__));
1290
1291
1292extern double difftime (time_t __time1, time_t __time0)
1293     __attribute__ ((__nothrow__)) __attribute__ ((__const__));
1294
1295
1296extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__));
1297
1298
1299
1300
1301
1302extern size_t strftime (char *__restrict __s, size_t __maxsize,
1303   __const char *__restrict __format,
1304   __const struct tm *__restrict __tp) __attribute__ ((__nothrow__));
1305
1306# 215 "/usr/include/time.h" 3 4
1307# 1 "/usr/include/xlocale.h" 1 3 4
1308# 28 "/usr/include/xlocale.h" 3 4
1309typedef struct __locale_struct
1310{
1311
1312  struct __locale_data *__locales[13];
1313
1314
1315  const unsigned short int *__ctype_b;
1316  const int *__ctype_tolower;
1317  const int *__ctype_toupper;
1318
1319
1320  const char *__names[13];
1321} *__locale_t;
1322
1323
1324typedef __locale_t locale_t;
1325# 216 "/usr/include/time.h" 2 3 4
1326
1327extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
1328     __const char *__restrict __format,
1329     __const struct tm *__restrict __tp,
1330     __locale_t __loc) __attribute__ ((__nothrow__));
1331# 230 "/usr/include/time.h" 3 4
1332
1333
1334
1335extern struct tm *gmtime (__const time_t *__timer) __attribute__ ((__nothrow__));
1336
1337
1338
1339extern struct tm *localtime (__const time_t *__timer) __attribute__ ((__nothrow__));
1340
1341
1342
1343
1344
1345extern struct tm *gmtime_r (__const time_t *__restrict __timer,
1346       struct tm *__restrict __tp) __attribute__ ((__nothrow__));
1347
1348
1349
1350extern struct tm *localtime_r (__const time_t *__restrict __timer,
1351          struct tm *__restrict __tp) __attribute__ ((__nothrow__));
1352
1353
1354
1355
1356
1357extern char *asctime (__const struct tm *__tp) __attribute__ ((__nothrow__));
1358
1359
1360extern char *ctime (__const time_t *__timer) __attribute__ ((__nothrow__));
1361
1362
1363
1364
1365
1366
1367
1368extern char *asctime_r (__const struct tm *__restrict __tp,
1369   char *__restrict __buf) __attribute__ ((__nothrow__));
1370
1371
1372extern char *ctime_r (__const time_t *__restrict __timer,
1373        char *__restrict __buf) __attribute__ ((__nothrow__));
1374
1375
1376
1377
1378extern char *__tzname[2];
1379extern int __daylight;
1380extern long int __timezone;
1381
1382
1383
1384
1385extern char *tzname[2];
1386
1387
1388
1389extern void tzset (void) __attribute__ ((__nothrow__));
1390
1391
1392
1393extern int daylight;
1394extern long int timezone;
1395
1396
1397
1398
1399
1400extern int stime (__const time_t *__when) __attribute__ ((__nothrow__));
1401# 313 "/usr/include/time.h" 3 4
1402extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__));
1403
1404
1405extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__));
1406
1407
1408extern int dysize (int __year) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
1409# 328 "/usr/include/time.h" 3 4
1410extern int nanosleep (__const struct timespec *__requested_time,
1411        struct timespec *__remaining);
1412
1413
1414
1415extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__));
1416
1417
1418extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__));
1419
1420
1421extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
1422     __attribute__ ((__nothrow__));
1423
1424
1425
1426
1427
1428
1429extern int clock_nanosleep (clockid_t __clock_id, int __flags,
1430       __const struct timespec *__req,
1431       struct timespec *__rem);
1432
1433
1434extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__));
1435
1436
1437
1438
1439extern int timer_create (clockid_t __clock_id,
1440    struct sigevent *__restrict __evp,
1441    timer_t *__restrict __timerid) __attribute__ ((__nothrow__));
1442
1443
1444extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__));
1445
1446
1447extern int timer_settime (timer_t __timerid, int __flags,
1448     __const struct itimerspec *__restrict __value,
1449     struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__));
1450
1451
1452extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
1453     __attribute__ ((__nothrow__));
1454
1455
1456extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__));
1457# 417 "/usr/include/time.h" 3 4
1458
1459# 27 "/usr/include/pthread.h" 2 3 4
1460
1461
1462# 1 "/usr/include/bits/setjmp.h" 1 3 4
1463# 29 "/usr/include/bits/setjmp.h" 3 4
1464typedef int __jmp_buf[6];
1465# 30 "/usr/include/pthread.h" 2 3 4
1466# 1 "/usr/include/bits/wordsize.h" 1 3 4
1467# 31 "/usr/include/pthread.h" 2 3 4
1468
1469
1470
1471enum
1472{
1473  PTHREAD_CREATE_JOINABLE,
1474
1475  PTHREAD_CREATE_DETACHED
1476
1477};
1478
1479
1480
1481enum
1482{
1483  PTHREAD_MUTEX_TIMED_NP,
1484  PTHREAD_MUTEX_RECURSIVE_NP,
1485  PTHREAD_MUTEX_ERRORCHECK_NP,
1486  PTHREAD_MUTEX_ADAPTIVE_NP
1487
1488  ,
1489  PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
1490  PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
1491  PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
1492  PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
1493
1494
1495
1496
1497
1498};
1499
1500
1501
1502
1503enum
1504{
1505  PTHREAD_MUTEX_STALLED,
1506  PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED,
1507  PTHREAD_MUTEX_ROBUST,
1508  PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST
1509};
1510# 115 "/usr/include/pthread.h" 3 4
1511enum
1512{
1513  PTHREAD_RWLOCK_PREFER_READER_NP,
1514  PTHREAD_RWLOCK_PREFER_WRITER_NP,
1515  PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
1516  PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
1517};
1518# 147 "/usr/include/pthread.h" 3 4
1519enum
1520{
1521  PTHREAD_INHERIT_SCHED,
1522
1523  PTHREAD_EXPLICIT_SCHED
1524
1525};
1526
1527
1528
1529enum
1530{
1531  PTHREAD_SCOPE_SYSTEM,
1532
1533  PTHREAD_SCOPE_PROCESS
1534
1535};
1536
1537
1538
1539enum
1540{
1541  PTHREAD_PROCESS_PRIVATE,
1542
1543  PTHREAD_PROCESS_SHARED
1544
1545};
1546# 182 "/usr/include/pthread.h" 3 4
1547struct _pthread_cleanup_buffer
1548{
1549  void (*__routine) (void *);
1550  void *__arg;
1551  int __canceltype;
1552  struct _pthread_cleanup_buffer *__prev;
1553};
1554
1555
1556enum
1557{
1558  PTHREAD_CANCEL_ENABLE,
1559
1560  PTHREAD_CANCEL_DISABLE
1561
1562};
1563enum
1564{
1565  PTHREAD_CANCEL_DEFERRED,
1566
1567  PTHREAD_CANCEL_ASYNCHRONOUS
1568
1569};
1570# 220 "/usr/include/pthread.h" 3 4
1571
1572
1573
1574
1575
1576extern int pthread_create (pthread_t *__restrict __newthread,
1577      __const pthread_attr_t *__restrict __attr,
1578      void *(*__start_routine) (void *),
1579      void *__restrict __arg) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3)));
1580
1581
1582
1583
1584
1585extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
1586
1587
1588
1589
1590
1591
1592
1593extern int pthread_join (pthread_t __th, void **__thread_return);
1594# 263 "/usr/include/pthread.h" 3 4
1595extern int pthread_detach (pthread_t __th) __attribute__ ((__nothrow__));
1596
1597
1598
1599extern pthread_t pthread_self (void) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
1600
1601
1602extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __attribute__ ((__nothrow__));
1603
1604
1605
1606
1607
1608
1609
1610extern int pthread_attr_init (pthread_attr_t *__attr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1611
1612
1613extern int pthread_attr_destroy (pthread_attr_t *__attr)
1614     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1615
1616
1617extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
1618     int *__detachstate)
1619     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1620
1621
1622extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
1623     int __detachstate)
1624     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1625
1626
1627
1628extern int pthread_attr_getguardsize (__const pthread_attr_t *__attr,
1629          size_t *__guardsize)
1630     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1631
1632
1633extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
1634          size_t __guardsize)
1635     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1636
1637
1638
1639extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict
1640           __attr,
1641           struct sched_param *__restrict __param)
1642     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1643
1644
1645extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
1646           __const struct sched_param *__restrict
1647           __param) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1648
1649
1650extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict
1651     __attr, int *__restrict __policy)
1652     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1653
1654
1655extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
1656     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1657
1658
1659extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict
1660      __attr, int *__restrict __inherit)
1661     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1662
1663
1664extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
1665      int __inherit)
1666     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1667
1668
1669
1670extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr,
1671      int *__restrict __scope)
1672     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1673
1674
1675extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
1676     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1677
1678
1679extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict
1680          __attr, void **__restrict __stackaddr)
1681     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__deprecated__));
1682
1683
1684
1685
1686
1687extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
1688          void *__stackaddr)
1689     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__));
1690
1691
1692extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict
1693          __attr, size_t *__restrict __stacksize)
1694     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1695
1696
1697
1698
1699extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
1700          size_t __stacksize)
1701     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1702
1703
1704
1705extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
1706      void **__restrict __stackaddr,
1707      size_t *__restrict __stacksize)
1708     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3)));
1709
1710
1711
1712
1713extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
1714      size_t __stacksize) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1715# 413 "/usr/include/pthread.h" 3 4
1716extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
1717      __const struct sched_param *__param)
1718     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3)));
1719
1720
1721extern int pthread_getschedparam (pthread_t __target_thread,
1722      int *__restrict __policy,
1723      struct sched_param *__restrict __param)
1724     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
1725
1726
1727extern int pthread_setschedprio (pthread_t __target_thread, int __prio)
1728     __attribute__ ((__nothrow__));
1729# 478 "/usr/include/pthread.h" 3 4
1730extern int pthread_once (pthread_once_t *__once_control,
1731    void (*__init_routine) (void)) __attribute__ ((__nonnull__ (1, 2)));
1732# 490 "/usr/include/pthread.h" 3 4
1733extern int pthread_setcancelstate (int __state, int *__oldstate);
1734
1735
1736
1737extern int pthread_setcanceltype (int __type, int *__oldtype);
1738
1739
1740extern int pthread_cancel (pthread_t __th);
1741
1742
1743
1744
1745extern void pthread_testcancel (void);
1746
1747
1748
1749
1750typedef struct
1751{
1752  struct
1753  {
1754    __jmp_buf __cancel_jmp_buf;
1755    int __mask_was_saved;
1756  } __cancel_jmp_buf[1];
1757  void *__pad[4];
1758} __pthread_unwind_buf_t __attribute__ ((__aligned__));
1759# 524 "/usr/include/pthread.h" 3 4
1760struct __pthread_cleanup_frame
1761{
1762  void (*__cancel_routine) (void *);
1763  void *__cancel_arg;
1764  int __do_it;
1765  int __cancel_type;
1766};
1767# 664 "/usr/include/pthread.h" 3 4
1768extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf)
1769     __attribute__ ((__regparm__ (1)));
1770# 676 "/usr/include/pthread.h" 3 4
1771extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf)
1772  __attribute__ ((__regparm__ (1)));
1773# 717 "/usr/include/pthread.h" 3 4
1774extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
1775     __attribute__ ((__regparm__ (1))) __attribute__ ((__noreturn__))
1776
1777     __attribute__ ((__weak__))
1778
1779     ;
1780
1781
1782
1783struct __jmp_buf_tag;
1784extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __attribute__ ((__nothrow__));
1785
1786
1787
1788
1789
1790extern int pthread_mutex_init (pthread_mutex_t *__mutex,
1791          __const pthread_mutexattr_t *__mutexattr)
1792     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1793
1794
1795extern int pthread_mutex_destroy (pthread_mutex_t *__mutex)
1796     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1797
1798
1799extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
1800     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1801
1802
1803extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
1804     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1805
1806
1807
1808extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
1809        __const struct timespec *__restrict
1810        __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1811
1812
1813
1814extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
1815     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1816
1817
1818
1819extern int pthread_mutex_getprioceiling (__const pthread_mutex_t *
1820      __restrict __mutex,
1821      int *__restrict __prioceiling)
1822     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1823
1824
1825
1826extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
1827      int __prioceiling,
1828      int *__restrict __old_ceiling)
1829     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3)));
1830
1831
1832
1833
1834extern int pthread_mutex_consistent (pthread_mutex_t *__mutex)
1835     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1836# 790 "/usr/include/pthread.h" 3 4
1837extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr)
1838     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1839
1840
1841extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr)
1842     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1843
1844
1845extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *
1846      __restrict __attr,
1847      int *__restrict __pshared)
1848     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1849
1850
1851extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
1852      int __pshared)
1853     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1854
1855
1856
1857extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict
1858          __attr, int *__restrict __kind)
1859     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1860
1861
1862
1863
1864extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
1865     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1866
1867
1868
1869extern int pthread_mutexattr_getprotocol (__const pthread_mutexattr_t *
1870       __restrict __attr,
1871       int *__restrict __protocol)
1872     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1873
1874
1875
1876extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr,
1877       int __protocol)
1878     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1879
1880
1881extern int pthread_mutexattr_getprioceiling (__const pthread_mutexattr_t *
1882          __restrict __attr,
1883          int *__restrict __prioceiling)
1884     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1885
1886
1887extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr,
1888          int __prioceiling)
1889     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1890
1891
1892
1893extern int pthread_mutexattr_getrobust (__const pthread_mutexattr_t *__attr,
1894     int *__robustness)
1895     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1896
1897
1898
1899
1900
1901
1902
1903extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
1904     int __robustness)
1905     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1906# 872 "/usr/include/pthread.h" 3 4
1907extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
1908    __const pthread_rwlockattr_t *__restrict
1909    __attr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1910
1911
1912extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
1913     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1914
1915
1916extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
1917     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1918
1919
1920extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
1921  __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1922
1923
1924
1925extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
1926           __const struct timespec *__restrict
1927           __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1928
1929
1930
1931extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
1932     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1933
1934
1935extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
1936     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1937
1938
1939
1940extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
1941           __const struct timespec *__restrict
1942           __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1943
1944
1945
1946extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
1947     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1948
1949
1950
1951
1952
1953extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr)
1954     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1955
1956
1957extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr)
1958     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1959
1960
1961extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t *
1962       __restrict __attr,
1963       int *__restrict __pshared)
1964     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1965
1966
1967extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
1968       int __pshared)
1969     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1970
1971
1972extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *
1973       __restrict __attr,
1974       int *__restrict __pref)
1975     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1976
1977
1978extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
1979       int __pref) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1980
1981
1982
1983
1984
1985
1986
1987extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
1988         __const pthread_condattr_t *__restrict
1989         __cond_attr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1990
1991
1992extern int pthread_cond_destroy (pthread_cond_t *__cond)
1993     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1994
1995
1996extern int pthread_cond_signal (pthread_cond_t *__cond)
1997     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1998
1999
2000extern int pthread_cond_broadcast (pthread_cond_t *__cond)
2001     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2002
2003
2004
2005
2006
2007
2008extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
2009         pthread_mutex_t *__restrict __mutex)
2010     __attribute__ ((__nonnull__ (1, 2)));
2011# 984 "/usr/include/pthread.h" 3 4
2012extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
2013       pthread_mutex_t *__restrict __mutex,
2014       __const struct timespec *__restrict
2015       __abstime) __attribute__ ((__nonnull__ (1, 2, 3)));
2016
2017
2018
2019
2020extern int pthread_condattr_init (pthread_condattr_t *__attr)
2021     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2022
2023
2024extern int pthread_condattr_destroy (pthread_condattr_t *__attr)
2025     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2026
2027
2028extern int pthread_condattr_getpshared (__const pthread_condattr_t *
2029     __restrict __attr,
2030     int *__restrict __pshared)
2031     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2032
2033
2034extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
2035     int __pshared) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2036
2037
2038
2039extern int pthread_condattr_getclock (__const pthread_condattr_t *
2040          __restrict __attr,
2041          __clockid_t *__restrict __clock_id)
2042     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2043
2044
2045extern int pthread_condattr_setclock (pthread_condattr_t *__attr,
2046          __clockid_t __clock_id)
2047     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2048# 1028 "/usr/include/pthread.h" 3 4
2049extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
2050     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2051
2052
2053extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
2054     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2055
2056
2057extern int pthread_spin_lock (pthread_spinlock_t *__lock)
2058     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2059
2060
2061extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
2062     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2063
2064
2065extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
2066     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2067
2068
2069
2070
2071
2072
2073extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
2074     __const pthread_barrierattr_t *__restrict
2075     __attr, unsigned int __count)
2076     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2077
2078
2079extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
2080     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2081
2082
2083extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
2084     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2085
2086
2087
2088extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr)
2089     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2090
2091
2092extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr)
2093     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2094
2095
2096extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t *
2097        __restrict __attr,
2098        int *__restrict __pshared)
2099     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
2100
2101
2102extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
2103        int __pshared)
2104     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2105# 1095 "/usr/include/pthread.h" 3 4
2106extern int pthread_key_create (pthread_key_t *__key,
2107          void (*__destr_function) (void *))
2108     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
2109
2110
2111extern int pthread_key_delete (pthread_key_t __key) __attribute__ ((__nothrow__));
2112
2113
2114extern void *pthread_getspecific (pthread_key_t __key) __attribute__ ((__nothrow__));
2115
2116
2117extern int pthread_setspecific (pthread_key_t __key,
2118    __const void *__pointer) __attribute__ ((__nothrow__)) ;
2119
2120
2121
2122
2123extern int pthread_getcpuclockid (pthread_t __thread_id,
2124      __clockid_t *__clock_id)
2125     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
2126# 1129 "/usr/include/pthread.h" 3 4
2127extern int pthread_atfork (void (*__prepare) (void),
2128      void (*__parent) (void),
2129      void (*__child) (void)) __attribute__ ((__nothrow__));
2130# 1143 "/usr/include/pthread.h" 3 4
2131
2132# 3 "indexer.c" 2
2133
2134
2135
2136
2137
2138int table[128];
2139pthread_mutex_t cas_mutex[128];
2140
2141pthread_t tids[13];
2142
2143
2144int cas(int * tab, int h, int val, int new_val)
2145{
2146  int ret_val = 0;
2147  pthread_mutex_lock(&cas_mutex[h]);
2148
2149
2150  if ( tab[h] == val ) {
2151    tab[h] = new_val;
2152    ret_val = 1;
2153  }
2154
2155  pthread_mutex_unlock(&cas_mutex[h]);
2156
2157
2158  return ret_val;
2159}
2160
2161
2162
2163void * thread_routine(void * arg)
2164{
2165  int tid;
2166  int m = 0, w, h;
2167  tid = *((int *)arg);
2168
2169  while(1){
2170    if ( m < 4 ){
2171      w = (++m) * 11 + tid;
2172    }
2173    else{
2174      pthread_exit(((void *)0));
2175    }
2176
2177    h = (w * 7) % 128;
2178
2179    if (h<0)
2180    {
2181      ERROR: goto ERROR;
2182      ;
2183    }
2184
2185    while ( cas(table, h, 0, w) == 0){
2186      h = (h+1) % 128;
2187    }
2188  }
2189
2190}
2191
2192
2193int main()
2194{
2195  int i, arg;
2196
2197  for (i = 0; i < 128; i++)
2198    pthread_mutex_init(&cas_mutex[i], ((void *)0));
2199
2200  for (i = 0; i < 13; i++){
2201    arg=i;
2202    pthread_create(&tids[i], ((void *)0), thread_routine, &arg);
2203  }
2204
2205  for (i = 0; i < 13; i++){
2206    pthread_join(tids[i], ((void *)0));
2207  }
2208
2209  for (i = 0; i < 128; i++){
2210    pthread_mutex_destroy(&cas_mutex[i]);
2211  }
2212
2213}