| 1 | extern void __VERIFIER_error() __attribute__ ((__noreturn__));
|
|---|
| 2 |
|
|---|
| 3 | extern void __VERIFIER_assume(int);
|
|---|
| 4 | typedef long unsigned int size_t;
|
|---|
| 5 | typedef int wchar_t;
|
|---|
| 6 |
|
|---|
| 7 | union wait
|
|---|
| 8 | {
|
|---|
| 9 | int w_status;
|
|---|
| 10 | struct
|
|---|
| 11 | {
|
|---|
| 12 | unsigned int __w_termsig:7;
|
|---|
| 13 | unsigned int __w_coredump:1;
|
|---|
| 14 | unsigned int __w_retcode:8;
|
|---|
| 15 | unsigned int:16;
|
|---|
| 16 | } __wait_terminated;
|
|---|
| 17 | struct
|
|---|
| 18 | {
|
|---|
| 19 | unsigned int __w_stopval:8;
|
|---|
| 20 | unsigned int __w_stopsig:8;
|
|---|
| 21 | unsigned int:16;
|
|---|
| 22 | } __wait_stopped;
|
|---|
| 23 | };
|
|---|
| 24 | typedef union
|
|---|
| 25 | {
|
|---|
| 26 | union wait *__uptr;
|
|---|
| 27 | int *__iptr;
|
|---|
| 28 | } __WAIT_STATUS __attribute__ ((__transparent_union__));
|
|---|
| 29 |
|
|---|
| 30 | typedef struct
|
|---|
| 31 | {
|
|---|
| 32 | int quot;
|
|---|
| 33 | int rem;
|
|---|
| 34 | } div_t;
|
|---|
| 35 | typedef struct
|
|---|
| 36 | {
|
|---|
| 37 | long int quot;
|
|---|
| 38 | long int rem;
|
|---|
| 39 | } ldiv_t;
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 | __extension__ typedef struct
|
|---|
| 43 | {
|
|---|
| 44 | long long int quot;
|
|---|
| 45 | long long int rem;
|
|---|
| 46 | } lldiv_t;
|
|---|
| 47 |
|
|---|
| 48 | extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 49 |
|
|---|
| 50 | extern double atof (__const char *__nptr)
|
|---|
| 51 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 52 | extern int atoi (__const char *__nptr)
|
|---|
| 53 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 54 | extern long int atol (__const char *__nptr)
|
|---|
| 55 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 | __extension__ extern long long int atoll (__const char *__nptr)
|
|---|
| 59 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 | extern double strtod (__const char *__restrict __nptr,
|
|---|
| 63 | char **__restrict __endptr)
|
|---|
| 64 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 | extern float strtof (__const char *__restrict __nptr,
|
|---|
| 68 | char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 69 | extern long double strtold (__const char *__restrict __nptr,
|
|---|
| 70 | char **__restrict __endptr)
|
|---|
| 71 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 | extern long int strtol (__const char *__restrict __nptr,
|
|---|
| 75 | char **__restrict __endptr, int __base)
|
|---|
| 76 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 77 | extern unsigned long int strtoul (__const char *__restrict __nptr,
|
|---|
| 78 | char **__restrict __endptr, int __base)
|
|---|
| 79 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 80 |
|
|---|
| 81 | __extension__
|
|---|
| 82 | extern long long int strtoq (__const char *__restrict __nptr,
|
|---|
| 83 | char **__restrict __endptr, int __base)
|
|---|
| 84 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 85 | __extension__
|
|---|
| 86 | extern unsigned long long int strtouq (__const char *__restrict __nptr,
|
|---|
| 87 | char **__restrict __endptr, int __base)
|
|---|
| 88 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 89 |
|
|---|
| 90 | __extension__
|
|---|
| 91 | extern long long int strtoll (__const char *__restrict __nptr,
|
|---|
| 92 | char **__restrict __endptr, int __base)
|
|---|
| 93 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 94 | __extension__
|
|---|
| 95 | extern unsigned long long int strtoull (__const char *__restrict __nptr,
|
|---|
| 96 | char **__restrict __endptr, int __base)
|
|---|
| 97 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 98 |
|
|---|
| 99 | extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 100 | extern long int a64l (__const char *__s)
|
|---|
| 101 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 102 |
|
|---|
| 103 | typedef unsigned char __u_char;
|
|---|
| 104 | typedef unsigned short int __u_short;
|
|---|
| 105 | typedef unsigned int __u_int;
|
|---|
| 106 | typedef unsigned long int __u_long;
|
|---|
| 107 | typedef signed char __int8_t;
|
|---|
| 108 | typedef unsigned char __uint8_t;
|
|---|
| 109 | typedef signed short int __int16_t;
|
|---|
| 110 | typedef unsigned short int __uint16_t;
|
|---|
| 111 | typedef signed int __int32_t;
|
|---|
| 112 | typedef unsigned int __uint32_t;
|
|---|
| 113 | typedef signed long int __int64_t;
|
|---|
| 114 | typedef unsigned long int __uint64_t;
|
|---|
| 115 | typedef long int __quad_t;
|
|---|
| 116 | typedef unsigned long int __u_quad_t;
|
|---|
| 117 | typedef unsigned long int __dev_t;
|
|---|
| 118 | typedef unsigned int __uid_t;
|
|---|
| 119 | typedef unsigned int __gid_t;
|
|---|
| 120 | typedef unsigned long int __ino_t;
|
|---|
| 121 | typedef unsigned long int __ino64_t;
|
|---|
| 122 | typedef unsigned int __mode_t;
|
|---|
| 123 | typedef unsigned long int __nlink_t;
|
|---|
| 124 | typedef long int __off_t;
|
|---|
| 125 | typedef long int __off64_t;
|
|---|
| 126 | typedef int __pid_t;
|
|---|
| 127 | typedef struct { int __val[2]; } __fsid_t;
|
|---|
| 128 | typedef long int __clock_t;
|
|---|
| 129 | typedef unsigned long int __rlim_t;
|
|---|
| 130 | typedef unsigned long int __rlim64_t;
|
|---|
| 131 | typedef unsigned int __id_t;
|
|---|
| 132 | typedef long int __time_t;
|
|---|
| 133 | typedef unsigned int __useconds_t;
|
|---|
| 134 | typedef long int __suseconds_t;
|
|---|
| 135 | typedef int __daddr_t;
|
|---|
| 136 | typedef long int __swblk_t;
|
|---|
| 137 | typedef int __key_t;
|
|---|
| 138 | typedef int __clockid_t;
|
|---|
| 139 | typedef void * __timer_t;
|
|---|
| 140 | typedef long int __blksize_t;
|
|---|
| 141 | typedef long int __blkcnt_t;
|
|---|
| 142 | typedef long int __blkcnt64_t;
|
|---|
| 143 | typedef unsigned long int __fsblkcnt_t;
|
|---|
| 144 | typedef unsigned long int __fsblkcnt64_t;
|
|---|
| 145 | typedef unsigned long int __fsfilcnt_t;
|
|---|
| 146 | typedef unsigned long int __fsfilcnt64_t;
|
|---|
| 147 | typedef long int __ssize_t;
|
|---|
| 148 | typedef __off64_t __loff_t;
|
|---|
| 149 | typedef __quad_t *__qaddr_t;
|
|---|
| 150 | typedef char *__caddr_t;
|
|---|
| 151 | typedef long int __intptr_t;
|
|---|
| 152 | typedef unsigned int __socklen_t;
|
|---|
| 153 | typedef __u_char u_char;
|
|---|
| 154 | typedef __u_short u_short;
|
|---|
| 155 | typedef __u_int u_int;
|
|---|
| 156 | typedef __u_long u_long;
|
|---|
| 157 | typedef __quad_t quad_t;
|
|---|
| 158 | typedef __u_quad_t u_quad_t;
|
|---|
| 159 | typedef __fsid_t fsid_t;
|
|---|
| 160 | typedef __loff_t loff_t;
|
|---|
| 161 | typedef __ino_t ino_t;
|
|---|
| 162 | typedef __dev_t dev_t;
|
|---|
| 163 | typedef __gid_t gid_t;
|
|---|
| 164 | typedef __mode_t mode_t;
|
|---|
| 165 | typedef __nlink_t nlink_t;
|
|---|
| 166 | typedef __uid_t uid_t;
|
|---|
| 167 | typedef __off_t off_t;
|
|---|
| 168 | typedef __pid_t pid_t;
|
|---|
| 169 | typedef __id_t id_t;
|
|---|
| 170 | typedef __ssize_t ssize_t;
|
|---|
| 171 | typedef __daddr_t daddr_t;
|
|---|
| 172 | typedef __caddr_t caddr_t;
|
|---|
| 173 | typedef __key_t key_t;
|
|---|
| 174 |
|
|---|
| 175 | typedef __clock_t clock_t;
|
|---|
| 176 |
|
|---|
| 177 |
|
|---|
| 178 |
|
|---|
| 179 | typedef __time_t time_t;
|
|---|
| 180 |
|
|---|
| 181 |
|
|---|
| 182 | typedef __clockid_t clockid_t;
|
|---|
| 183 | typedef __timer_t timer_t;
|
|---|
| 184 | typedef unsigned long int ulong;
|
|---|
| 185 | typedef unsigned short int ushort;
|
|---|
| 186 | typedef unsigned int uint;
|
|---|
| 187 | typedef int int8_t __attribute__ ((__mode__ (__QI__)));
|
|---|
| 188 | typedef int int16_t __attribute__ ((__mode__ (__HI__)));
|
|---|
| 189 | typedef int int32_t __attribute__ ((__mode__ (__SI__)));
|
|---|
| 190 | typedef int int64_t __attribute__ ((__mode__ (__DI__)));
|
|---|
| 191 | typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
|
|---|
| 192 | typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
|
|---|
| 193 | typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
|
|---|
| 194 | typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
|
|---|
| 195 | typedef int register_t __attribute__ ((__mode__ (__word__)));
|
|---|
| 196 | typedef int __sig_atomic_t;
|
|---|
| 197 | typedef struct
|
|---|
| 198 | {
|
|---|
| 199 | unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
|
|---|
| 200 | } __sigset_t;
|
|---|
| 201 | typedef __sigset_t sigset_t;
|
|---|
| 202 | struct timespec
|
|---|
| 203 | {
|
|---|
| 204 | __time_t tv_sec;
|
|---|
| 205 | long int tv_nsec;
|
|---|
| 206 | };
|
|---|
| 207 | struct timeval
|
|---|
| 208 | {
|
|---|
| 209 | __time_t tv_sec;
|
|---|
| 210 | __suseconds_t tv_usec;
|
|---|
| 211 | };
|
|---|
| 212 | typedef __suseconds_t suseconds_t;
|
|---|
| 213 | typedef long int __fd_mask;
|
|---|
| 214 | typedef struct
|
|---|
| 215 | {
|
|---|
| 216 | __fd_mask __fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];
|
|---|
| 217 | } fd_set;
|
|---|
| 218 | typedef __fd_mask fd_mask;
|
|---|
| 219 |
|
|---|
| 220 | extern int select (int __nfds, fd_set *__restrict __readfds,
|
|---|
| 221 | fd_set *__restrict __writefds,
|
|---|
| 222 | fd_set *__restrict __exceptfds,
|
|---|
| 223 | struct timeval *__restrict __timeout);
|
|---|
| 224 | extern int pselect (int __nfds, fd_set *__restrict __readfds,
|
|---|
| 225 | fd_set *__restrict __writefds,
|
|---|
| 226 | fd_set *__restrict __exceptfds,
|
|---|
| 227 | const struct timespec *__restrict __timeout,
|
|---|
| 228 | const __sigset_t *__restrict __sigmask);
|
|---|
| 229 |
|
|---|
| 230 |
|
|---|
| 231 | __extension__
|
|---|
| 232 | extern unsigned int gnu_dev_major (unsigned long long int __dev)
|
|---|
| 233 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
|
|---|
| 234 | __extension__
|
|---|
| 235 | extern unsigned int gnu_dev_minor (unsigned long long int __dev)
|
|---|
| 236 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
|
|---|
| 237 | __extension__
|
|---|
| 238 | extern unsigned long long int gnu_dev_makedev (unsigned int __major,
|
|---|
| 239 | unsigned int __minor)
|
|---|
| 240 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
|
|---|
| 241 |
|
|---|
| 242 | typedef __blksize_t blksize_t;
|
|---|
| 243 | typedef __blkcnt_t blkcnt_t;
|
|---|
| 244 | typedef __fsblkcnt_t fsblkcnt_t;
|
|---|
| 245 |
|
|---|
| 246 |
|
|---|
| 247 | typedef __fsfilcnt_t fsfilcnt_t;
|
|---|
| 248 | typedef unsigned long int pthread_t;
|
|---|
| 249 | typedef union
|
|---|
| 250 | {
|
|---|
| 251 | char __size[56];
|
|---|
| 252 | long int __align;
|
|---|
| 253 | } pthread_attr_t;
|
|---|
| 254 | typedef struct __pthread_internal_list
|
|---|
| 255 | {
|
|---|
| 256 | struct __pthread_internal_list *__prev;
|
|---|
| 257 | struct __pthread_internal_list *__next;
|
|---|
| 258 | } __pthread_list_t;
|
|---|
| 259 | typedef union
|
|---|
| 260 | {
|
|---|
| 261 | struct __pthread_mutex_s
|
|---|
| 262 | {
|
|---|
| 263 | int __lock;
|
|---|
| 264 | unsigned int __count;
|
|---|
| 265 | int __owner;
|
|---|
| 266 | unsigned int __nusers;
|
|---|
| 267 | int __kind;
|
|---|
| 268 | int __spins;
|
|---|
| 269 | __pthread_list_t __list;
|
|---|
| 270 | } __data;
|
|---|
| 271 | char __size[40];
|
|---|
| 272 | long int __align;
|
|---|
| 273 | } pthread_mutex_t;
|
|---|
| 274 | typedef union
|
|---|
| 275 | {
|
|---|
| 276 | char __size[4];
|
|---|
| 277 | int __align;
|
|---|
| 278 | } pthread_mutexattr_t;
|
|---|
| 279 | typedef union
|
|---|
| 280 | {
|
|---|
| 281 | struct
|
|---|
| 282 | {
|
|---|
| 283 | int __lock;
|
|---|
| 284 | unsigned int __futex;
|
|---|
| 285 | __extension__ unsigned long long int __total_seq;
|
|---|
| 286 | __extension__ unsigned long long int __wakeup_seq;
|
|---|
| 287 | __extension__ unsigned long long int __woken_seq;
|
|---|
| 288 | void *__mutex;
|
|---|
| 289 | unsigned int __nwaiters;
|
|---|
| 290 | unsigned int __broadcast_seq;
|
|---|
| 291 | } __data;
|
|---|
| 292 | char __size[48];
|
|---|
| 293 | __extension__ long long int __align;
|
|---|
| 294 | } pthread_cond_t;
|
|---|
| 295 | typedef union
|
|---|
| 296 | {
|
|---|
| 297 | char __size[4];
|
|---|
| 298 | int __align;
|
|---|
| 299 | } pthread_condattr_t;
|
|---|
| 300 | typedef unsigned int pthread_key_t;
|
|---|
| 301 | typedef int pthread_once_t;
|
|---|
| 302 | typedef union
|
|---|
| 303 | {
|
|---|
| 304 | struct
|
|---|
| 305 | {
|
|---|
| 306 | int __lock;
|
|---|
| 307 | unsigned int __nr_readers;
|
|---|
| 308 | unsigned int __readers_wakeup;
|
|---|
| 309 | unsigned int __writer_wakeup;
|
|---|
| 310 | unsigned int __nr_readers_queued;
|
|---|
| 311 | unsigned int __nr_writers_queued;
|
|---|
| 312 | int __writer;
|
|---|
| 313 | int __shared;
|
|---|
| 314 | unsigned long int __pad1;
|
|---|
| 315 | unsigned long int __pad2;
|
|---|
| 316 | unsigned int __flags;
|
|---|
| 317 | } __data;
|
|---|
| 318 | char __size[56];
|
|---|
| 319 | long int __align;
|
|---|
| 320 | } pthread_rwlock_t;
|
|---|
| 321 | typedef union
|
|---|
| 322 | {
|
|---|
| 323 | char __size[8];
|
|---|
| 324 | long int __align;
|
|---|
| 325 | } pthread_rwlockattr_t;
|
|---|
| 326 | typedef volatile int pthread_spinlock_t;
|
|---|
| 327 | typedef union
|
|---|
| 328 | {
|
|---|
| 329 | char __size[32];
|
|---|
| 330 | long int __align;
|
|---|
| 331 | } pthread_barrier_t;
|
|---|
| 332 | typedef union
|
|---|
| 333 | {
|
|---|
| 334 | char __size[4];
|
|---|
| 335 | int __align;
|
|---|
| 336 | } pthread_barrierattr_t;
|
|---|
| 337 |
|
|---|
| 338 | extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 339 | extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 340 | extern char *initstate (unsigned int __seed, char *__statebuf,
|
|---|
| 341 | size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
|
|---|
| 342 |
|
|---|
| 343 |
|
|---|
| 344 | extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 345 |
|
|---|
| 346 |
|
|---|
| 347 |
|
|---|
| 348 |
|
|---|
| 349 |
|
|---|
| 350 |
|
|---|
| 351 |
|
|---|
| 352 | struct random_data
|
|---|
| 353 | {
|
|---|
| 354 | int32_t *fptr;
|
|---|
| 355 | int32_t *rptr;
|
|---|
| 356 | int32_t *state;
|
|---|
| 357 | int rand_type;
|
|---|
| 358 | int rand_deg;
|
|---|
| 359 | int rand_sep;
|
|---|
| 360 | int32_t *end_ptr;
|
|---|
| 361 | };
|
|---|
| 362 |
|
|---|
| 363 | extern int random_r (struct random_data *__restrict __buf,
|
|---|
| 364 | int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 365 |
|
|---|
| 366 | extern int srandom_r (unsigned int __seed, struct random_data *__buf)
|
|---|
| 367 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
|
|---|
| 368 |
|
|---|
| 369 | extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
|
|---|
| 370 | size_t __statelen,
|
|---|
| 371 | struct random_data *__restrict __buf)
|
|---|
| 372 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
|
|---|
| 373 |
|
|---|
| 374 | extern int setstate_r (char *__restrict __statebuf,
|
|---|
| 375 | struct random_data *__restrict __buf)
|
|---|
| 376 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 377 |
|
|---|
| 378 |
|
|---|
| 379 |
|
|---|
| 380 |
|
|---|
| 381 |
|
|---|
| 382 |
|
|---|
| 383 | extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 384 |
|
|---|
| 385 | extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 386 |
|
|---|
| 387 |
|
|---|
| 388 |
|
|---|
| 389 |
|
|---|
| 390 | extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 391 |
|
|---|
| 392 |
|
|---|
| 393 |
|
|---|
| 394 |
|
|---|
| 395 |
|
|---|
| 396 |
|
|---|
| 397 |
|
|---|
| 398 | extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 399 | extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 400 |
|
|---|
| 401 |
|
|---|
| 402 | extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 403 | extern long int nrand48 (unsigned short int __xsubi[3])
|
|---|
| 404 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 405 |
|
|---|
| 406 |
|
|---|
| 407 | extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 408 | extern long int jrand48 (unsigned short int __xsubi[3])
|
|---|
| 409 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 410 |
|
|---|
| 411 |
|
|---|
| 412 | extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 413 | extern unsigned short int *seed48 (unsigned short int __seed16v[3])
|
|---|
| 414 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 415 | extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 416 |
|
|---|
| 417 |
|
|---|
| 418 |
|
|---|
| 419 |
|
|---|
| 420 |
|
|---|
| 421 | struct drand48_data
|
|---|
| 422 | {
|
|---|
| 423 | unsigned short int __x[3];
|
|---|
| 424 | unsigned short int __old_x[3];
|
|---|
| 425 | unsigned short int __c;
|
|---|
| 426 | unsigned short int __init;
|
|---|
| 427 | unsigned long long int __a;
|
|---|
| 428 | };
|
|---|
| 429 |
|
|---|
| 430 |
|
|---|
| 431 | extern int drand48_r (struct drand48_data *__restrict __buffer,
|
|---|
| 432 | double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 433 | extern int erand48_r (unsigned short int __xsubi[3],
|
|---|
| 434 | struct drand48_data *__restrict __buffer,
|
|---|
| 435 | double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 436 |
|
|---|
| 437 |
|
|---|
| 438 | extern int lrand48_r (struct drand48_data *__restrict __buffer,
|
|---|
| 439 | long int *__restrict __result)
|
|---|
| 440 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 441 | extern int nrand48_r (unsigned short int __xsubi[3],
|
|---|
| 442 | struct drand48_data *__restrict __buffer,
|
|---|
| 443 | long int *__restrict __result)
|
|---|
| 444 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 445 |
|
|---|
| 446 |
|
|---|
| 447 | extern int mrand48_r (struct drand48_data *__restrict __buffer,
|
|---|
| 448 | long int *__restrict __result)
|
|---|
| 449 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 450 | extern int jrand48_r (unsigned short int __xsubi[3],
|
|---|
| 451 | struct drand48_data *__restrict __buffer,
|
|---|
| 452 | long int *__restrict __result)
|
|---|
| 453 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 454 |
|
|---|
| 455 |
|
|---|
| 456 | extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
|
|---|
| 457 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
|
|---|
| 458 |
|
|---|
| 459 | extern int seed48_r (unsigned short int __seed16v[3],
|
|---|
| 460 | struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 461 |
|
|---|
| 462 | extern int lcong48_r (unsigned short int __param[7],
|
|---|
| 463 | struct drand48_data *__buffer)
|
|---|
| 464 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
|
|---|
| 465 |
|
|---|
| 466 |
|
|---|
| 467 |
|
|---|
| 468 |
|
|---|
| 469 |
|
|---|
| 470 |
|
|---|
| 471 |
|
|---|
| 472 |
|
|---|
| 473 |
|
|---|
| 474 | extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;
|
|---|
| 475 |
|
|---|
| 476 | extern void *calloc (size_t __nmemb, size_t __size)
|
|---|
| 477 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;
|
|---|
| 478 |
|
|---|
| 479 |
|
|---|
| 480 |
|
|---|
| 481 |
|
|---|
| 482 |
|
|---|
| 483 |
|
|---|
| 484 |
|
|---|
| 485 |
|
|---|
| 486 |
|
|---|
| 487 |
|
|---|
| 488 | extern void *realloc (void *__ptr, size_t __size)
|
|---|
| 489 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__));
|
|---|
| 490 |
|
|---|
| 491 | extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 492 |
|
|---|
| 493 |
|
|---|
| 494 |
|
|---|
| 495 |
|
|---|
| 496 | extern void cfree (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 497 |
|
|---|
| 498 | extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 499 |
|
|---|
| 500 |
|
|---|
| 501 |
|
|---|
| 502 |
|
|---|
| 503 |
|
|---|
| 504 |
|
|---|
| 505 |
|
|---|
| 506 | extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;
|
|---|
| 507 |
|
|---|
| 508 |
|
|---|
| 509 |
|
|---|
| 510 |
|
|---|
| 511 | extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
|
|---|
| 512 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 513 |
|
|---|
| 514 |
|
|---|
| 515 |
|
|---|
| 516 |
|
|---|
| 517 | extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
|
|---|
| 518 |
|
|---|
| 519 |
|
|---|
| 520 |
|
|---|
| 521 | extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 522 |
|
|---|
| 523 | extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
|
|---|
| 524 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 525 |
|
|---|
| 526 | extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
|
|---|
| 527 |
|
|---|
| 528 |
|
|---|
| 529 | extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
|
|---|
| 530 |
|
|---|
| 531 |
|
|---|
| 532 | extern char *getenv (__const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 533 |
|
|---|
| 534 | extern char *__secure_getenv (__const char *__name)
|
|---|
| 535 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 536 | extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 537 | extern int setenv (__const char *__name, __const char *__value, int __replace)
|
|---|
| 538 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
|
|---|
| 539 | extern int unsetenv (__const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 540 | extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 541 | extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 542 | extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 543 | extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 544 | extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 545 |
|
|---|
| 546 | extern int system (__const char *__command) ;
|
|---|
| 547 |
|
|---|
| 548 | extern char *realpath (__const char *__restrict __name,
|
|---|
| 549 | char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 550 | typedef int (*__compar_fn_t) (__const void *, __const void *);
|
|---|
| 551 |
|
|---|
| 552 | extern void *bsearch (__const void *__key, __const void *__base,
|
|---|
| 553 | size_t __nmemb, size_t __size, __compar_fn_t __compar)
|
|---|
| 554 | __attribute__ ((__nonnull__ (1, 2, 5))) ;
|
|---|
| 555 | extern void qsort (void *__base, size_t __nmemb, size_t __size,
|
|---|
| 556 | __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
|
|---|
| 557 | extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
|
|---|
| 558 | extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
|
|---|
| 559 |
|
|---|
| 560 | __extension__ extern long long int llabs (long long int __x)
|
|---|
| 561 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
|
|---|
| 562 |
|
|---|
| 563 | extern div_t div (int __numer, int __denom)
|
|---|
| 564 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
|
|---|
| 565 | extern ldiv_t ldiv (long int __numer, long int __denom)
|
|---|
| 566 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
|
|---|
| 567 |
|
|---|
| 568 |
|
|---|
| 569 | __extension__ extern lldiv_t lldiv (long long int __numer,
|
|---|
| 570 | long long int __denom)
|
|---|
| 571 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
|
|---|
| 572 |
|
|---|
| 573 | extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
|
|---|
| 574 | int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
|
|---|
| 575 | extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
|
|---|
| 576 | int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
|
|---|
| 577 | extern char *gcvt (double __value, int __ndigit, char *__buf)
|
|---|
| 578 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;
|
|---|
| 579 | extern char *qecvt (long double __value, int __ndigit,
|
|---|
| 580 | int *__restrict __decpt, int *__restrict __sign)
|
|---|
| 581 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
|
|---|
| 582 | extern char *qfcvt (long double __value, int __ndigit,
|
|---|
| 583 | int *__restrict __decpt, int *__restrict __sign)
|
|---|
| 584 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
|
|---|
| 585 | extern char *qgcvt (long double __value, int __ndigit, char *__buf)
|
|---|
| 586 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;
|
|---|
| 587 | extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
|
|---|
| 588 | int *__restrict __sign, char *__restrict __buf,
|
|---|
| 589 | size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
|
|---|
| 590 | extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
|
|---|
| 591 | int *__restrict __sign, char *__restrict __buf,
|
|---|
| 592 | size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
|
|---|
| 593 | extern int qecvt_r (long double __value, int __ndigit,
|
|---|
| 594 | int *__restrict __decpt, int *__restrict __sign,
|
|---|
| 595 | char *__restrict __buf, size_t __len)
|
|---|
| 596 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
|
|---|
| 597 | extern int qfcvt_r (long double __value, int __ndigit,
|
|---|
| 598 | int *__restrict __decpt, int *__restrict __sign,
|
|---|
| 599 | char *__restrict __buf, size_t __len)
|
|---|
| 600 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
|
|---|
| 601 |
|
|---|
| 602 | extern int mblen (__const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 603 | extern int mbtowc (wchar_t *__restrict __pwc,
|
|---|
| 604 | __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 605 | extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__)) ;
|
|---|
| 606 | extern size_t mbstowcs (wchar_t *__restrict __pwcs,
|
|---|
| 607 | __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 608 | extern size_t wcstombs (char *__restrict __s,
|
|---|
| 609 | __const wchar_t *__restrict __pwcs, size_t __n)
|
|---|
| 610 | __attribute__ ((__nothrow__ , __leaf__));
|
|---|
| 611 |
|
|---|
| 612 | extern int rpmatch (__const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
|
|---|
| 613 | extern int getsubopt (char **__restrict __optionp,
|
|---|
| 614 | char *__const *__restrict __tokens,
|
|---|
| 615 | char **__restrict __valuep)
|
|---|
| 616 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;
|
|---|
| 617 | extern int getloadavg (double __loadavg[], int __nelem)
|
|---|
| 618 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
|
|---|
| 619 |
|
|---|
| 620 |
|
|---|
| 621 | extern void __assert_fail (__const char *__assertion, __const char *__file,
|
|---|
| 622 | unsigned int __line, __const char *__function)
|
|---|
| 623 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
|
|---|
| 624 | extern void __assert_perror_fail (int __errnum, __const char *__file,
|
|---|
| 625 | unsigned int __line,
|
|---|
| 626 | __const char *__function)
|
|---|
| 627 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
|
|---|
| 628 | extern void __assert (const char *__assertion, const char *__file, int __line)
|
|---|
| 629 | __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
|
|---|
| 630 |
|
|---|
| 631 | void __VERIFIER_assert(int cond) {
|
|---|
| 632 | if (!(cond)) {
|
|---|
| 633 | ERROR: __VERIFIER_error();
|
|---|
| 634 | }
|
|---|
| 635 | return;
|
|---|
| 636 | }
|
|---|
| 637 |
|
|---|
| 638 | unsigned char __CS_round = 0;
|
|---|
| 639 | unsigned char __CS_ret = 0;
|
|---|
| 640 | const unsigned char __CS_ret_PREEMPTED = 0x01;
|
|---|
| 641 | const unsigned char __CS_ret_ERROR = 0x02;
|
|---|
| 642 | const unsigned char __CS_ret_FINISHED = 0x04;
|
|---|
| 643 | unsigned char __CS_error = 0;
|
|---|
| 644 | unsigned char __CS_error_detail = 0;
|
|---|
| 645 | const unsigned char __ERR_MAXTHREADS_REACHED = 0x01;
|
|---|
| 646 | const unsigned char __ERR_ERROR_LABEL_REACHED = 0x02;
|
|---|
| 647 | const unsigned char __ERR_ASSERT_FAILURE = 0x04;
|
|---|
| 648 | const unsigned char __ERR_UNLOCK_ATTEMPT = 0x08;
|
|---|
| 649 | const unsigned char __ERR_JOIN_FAILED_WRONG_THREAD_ID = 0x10;
|
|---|
| 650 | const unsigned char __ERR_JOIN_FAILED_THREAD_NOT_CREATED = 0x20;
|
|---|
| 651 | const unsigned char __ERR_COND_WAIT_MUTEX_NOT_OWNED = 0x30;
|
|---|
| 652 | const unsigned char __ERR_MUTEX_DESTROY = 0x40;
|
|---|
| 653 | const unsigned char __ERR_MUTEX_NOT_OWNED = 0x80;
|
|---|
| 654 | unsigned char __CS_thread_index;
|
|---|
| 655 | unsigned char __CS_thread_allocated[2 +1];
|
|---|
| 656 | unsigned char __CS_thread_born_round[2 +1];
|
|---|
| 657 | void *(*__CS_thread[2 +1])(void *);
|
|---|
| 658 | unsigned char __CS_thread_status[6][2 +1];
|
|---|
| 659 | const unsigned char __THREAD_UNUSED = 0x00;
|
|---|
| 660 | const unsigned char __THREAD_RUNNING = 0x01;
|
|---|
| 661 | const unsigned char __THREAD_FINISHED = 0x02;
|
|---|
| 662 | unsigned char *__CS_thread_lockedon[6][2 +1];
|
|---|
| 663 | int nondet_int();
|
|---|
| 664 | void __CS_cs(void)
|
|---|
| 665 | {
|
|---|
| 666 | unsigned char k;
|
|---|
| 667 | __VERIFIER_assume(__CS_round+k < 6);
|
|---|
| 668 | __CS_round += k;
|
|---|
| 669 | __CS_ret = (nondet_int() && __CS_round == 6 -1)?__CS_ret_PREEMPTED:__CS_ret;
|
|---|
| 670 | }
|
|---|
| 671 | int __CS_pthread_mutex_init(unsigned char *mutex, void *attr)
|
|---|
| 672 | {
|
|---|
| 673 | return 0;
|
|---|
| 674 | }
|
|---|
| 675 | int __CS_pthread_mutex_destroy(unsigned char *lock)
|
|---|
| 676 | {
|
|---|
| 677 | if (*lock != __CS_thread_index && *lock != 0) {
|
|---|
| 678 | __CS_error = 1;
|
|---|
| 679 | __CS_ret = __CS_ret_ERROR;
|
|---|
| 680 | __CS_error_detail = __ERR_MUTEX_DESTROY;
|
|---|
| 681 | }
|
|---|
| 682 | else *lock = 0;
|
|---|
| 683 | return 0;
|
|---|
| 684 | }
|
|---|
| 685 | int __CS_pthread_mutex_lock(unsigned char *lock)
|
|---|
| 686 | {
|
|---|
| 687 | if (*lock == 0) *lock = (__CS_thread_index+1);
|
|---|
| 688 | else { __CS_ret = __CS_ret_PREEMPTED; return 1; }
|
|---|
| 689 | return 0;
|
|---|
| 690 | }
|
|---|
| 691 | int __CS_pthread_mutex_unlock(unsigned char *lock)
|
|---|
| 692 | {
|
|---|
| 693 | if (*lock != (__CS_thread_index+1)) {
|
|---|
| 694 | __CS_error = 1;
|
|---|
| 695 | __CS_ret = __CS_ret_ERROR;
|
|---|
| 696 | __CS_error_detail = __ERR_UNLOCK_ATTEMPT;
|
|---|
| 697 | return 1;
|
|---|
| 698 | } else *lock = 0;
|
|---|
| 699 | return 0;
|
|---|
| 700 | }
|
|---|
| 701 | int __CS_pthread_cond_init(unsigned char *cond, void *attr)
|
|---|
| 702 | {
|
|---|
| 703 | return 0;
|
|---|
| 704 | }
|
|---|
| 705 | int __CS_pthread_cond_signal(unsigned char *cond)
|
|---|
| 706 | {
|
|---|
| 707 | int j;
|
|---|
| 708 | for (j=0; j<=2; j++)
|
|---|
| 709 | if (__CS_thread_lockedon[__CS_round][j] == cond)
|
|---|
| 710 | __CS_thread_lockedon[__CS_round][j] = 0;
|
|---|
| 711 | return 0;
|
|---|
| 712 | }
|
|---|
| 713 | int __CS_pthread_cond_broadcast(unsigned char *cond)
|
|---|
| 714 | {
|
|---|
| 715 | int j;
|
|---|
| 716 | for (j=0; j<=2; j++)
|
|---|
| 717 | if (__CS_thread_lockedon[__CS_round][j] == cond)
|
|---|
| 718 | __CS_thread_lockedon[__CS_round][j] = 0;
|
|---|
| 719 | return 0;
|
|---|
| 720 | }
|
|---|
| 721 | int __CS_pthread_cond_wait(unsigned char *cond, unsigned char *lock)
|
|---|
| 722 | {
|
|---|
| 723 | if (*lock != (__CS_thread_index+1)) {
|
|---|
| 724 | __CS_error = 1;
|
|---|
| 725 | __CS_ret = __CS_ret_ERROR;
|
|---|
| 726 | __CS_error_detail = __ERR_COND_WAIT_MUTEX_NOT_OWNED;
|
|---|
| 727 | return 1;
|
|---|
| 728 | }
|
|---|
| 729 | else *lock = 0;
|
|---|
| 730 | __CS_thread_lockedon[__CS_round][__CS_thread_index] = cond;
|
|---|
| 731 | __CS_ret = __CS_ret_PREEMPTED;
|
|---|
| 732 | if (*lock == 0) *lock = __CS_thread_index+1;
|
|---|
| 733 | else { __CS_ret = __CS_ret_PREEMPTED; return 1; }
|
|---|
| 734 | return 0;
|
|---|
| 735 | }
|
|---|
| 736 | void __CS_assert(int expr)
|
|---|
| 737 | {
|
|---|
| 738 | if (!expr) {
|
|---|
| 739 | __CS_error = 1;
|
|---|
| 740 | __CS_error_detail = __ERR_ASSERT_FAILURE;
|
|---|
| 741 | __CS_ret = __CS_ret_ERROR;
|
|---|
| 742 | }
|
|---|
| 743 | }
|
|---|
| 744 | void __CS_assume(int expr)
|
|---|
| 745 | {
|
|---|
| 746 | if (!expr) __CS_ret = __CS_ret_PREEMPTED;
|
|---|
| 747 | }
|
|---|
| 748 | int __CS_pthread_join(unsigned char thread, void **value_ptr)
|
|---|
| 749 | {
|
|---|
| 750 | if (thread != 123 && thread > 2 +1)
|
|---|
| 751 | {
|
|---|
| 752 | __CS_error = 1;
|
|---|
| 753 | __CS_error_detail = __ERR_JOIN_FAILED_WRONG_THREAD_ID;
|
|---|
| 754 | __CS_ret = __CS_ret_ERROR;
|
|---|
| 755 | return 0;
|
|---|
| 756 | }
|
|---|
| 757 | if ( thread == 123 || __CS_thread_status[__CS_round][thread] == __THREAD_RUNNING )
|
|---|
| 758 | {
|
|---|
| 759 | __CS_ret = __CS_ret_PREEMPTED;
|
|---|
| 760 | return 0;
|
|---|
| 761 | }
|
|---|
| 762 | if (__CS_thread_status[__CS_round][thread] == __THREAD_UNUSED)
|
|---|
| 763 | {
|
|---|
| 764 | __CS_error = 1;
|
|---|
| 765 | __CS_error_detail = __ERR_JOIN_FAILED_THREAD_NOT_CREATED;
|
|---|
| 766 | __CS_ret = __CS_ret_ERROR;
|
|---|
| 767 | return 0;
|
|---|
| 768 | }
|
|---|
| 769 | __VERIFIER_assume( __CS_thread_status[__CS_round][thread] == __THREAD_FINISHED );
|
|---|
| 770 | return 0;
|
|---|
| 771 | }
|
|---|
| 772 | int __CS_pthread_create(unsigned char *id1, void *attr, void *(*t1)(void*), void *arg)
|
|---|
| 773 | {
|
|---|
| 774 | if (__CS_thread_index == 2) {
|
|---|
| 775 | *id1 = 123;
|
|---|
| 776 | return -1;
|
|---|
| 777 | }
|
|---|
| 778 | __CS_thread_index++;
|
|---|
| 779 | __CS_thread_allocated[__CS_thread_index] = 1;
|
|---|
| 780 | __CS_thread_born_round[__CS_thread_index] = __CS_round;
|
|---|
| 781 | __CS_thread[__CS_thread_index] = t1;
|
|---|
| 782 | __CS_thread_status[__CS_round][__CS_thread_index] = __THREAD_RUNNING;
|
|---|
| 783 | *id1 = __CS_thread_index;
|
|---|
| 784 | return __CS_thread_index;
|
|---|
| 785 | }
|
|---|
| 786 | int i[6] = {1};
|
|---|
| 787 | int j[6] = {1};
|
|---|
| 788 | union __CS__u {
|
|---|
| 789 | int i[6];
|
|---|
| 790 | int j[6];
|
|---|
| 791 | };
|
|---|
| 792 | union __CS__u __CS_u;
|
|---|
| 793 | void *t1(void *arg)
|
|---|
| 794 | {
|
|---|
| 795 | int k = 0;
|
|---|
| 796 | __CS_cs(); if (__CS_ret != 0) return 0;
|
|---|
| 797 | for (k = 0; k < 5; k++)
|
|---|
| 798 | {
|
|---|
| 799 | __CS_cs(); if (__CS_ret != 0) return 0;
|
|---|
| 800 | __CS_u.i[__CS_round] = i[__CS_round];
|
|---|
| 801 | i[__CS_round] += j[__CS_round];
|
|---|
| 802 | if (__CS_ret) i[__CS_round]= __CS_u.i[__CS_round];
|
|---|
| 803 | }
|
|---|
| 804 | __CS_cs(); if (__CS_ret != 0) return 0;
|
|---|
| 805 | ;
|
|---|
| 806 | __CS_cs(); if (__CS_ret != 0) return 0;
|
|---|
| 807 | }
|
|---|
| 808 | void *t2(void *arg)
|
|---|
| 809 | {
|
|---|
| 810 | int k = 0;
|
|---|
| 811 | __CS_cs(); if (__CS_ret != 0) return 0;
|
|---|
| 812 | for (k = 0; k < 5; k++)
|
|---|
| 813 | {
|
|---|
| 814 | __CS_cs(); if (__CS_ret != 0) return 0;
|
|---|
| 815 | __CS_u.j[__CS_round] = j[__CS_round];
|
|---|
| 816 | j[__CS_round] += i[__CS_round];
|
|---|
| 817 | if (__CS_ret) j[__CS_round]= __CS_u.j[__CS_round];
|
|---|
| 818 | }
|
|---|
| 819 | __CS_cs(); if (__CS_ret != 0) return 0;
|
|---|
| 820 | ;
|
|---|
| 821 | __CS_cs(); if (__CS_ret != 0) return 0;
|
|---|
| 822 | }
|
|---|
| 823 | void *main_thread(void *arg)
|
|---|
| 824 | {
|
|---|
| 825 | int __CS_main_arg_argc;
|
|---|
| 826 | char **argv;
|
|---|
| 827 | unsigned char id1;
|
|---|
| 828 | unsigned char id2;
|
|---|
| 829 | __CS_cs(); if (__CS_ret != 0) return 0;
|
|---|
| 830 | __CS_pthread_create(&id1, 0, t1, 0);
|
|---|
| 831 | __CS_cs(); if (__CS_ret != 0) return 0;
|
|---|
| 832 | __CS_pthread_create(&id2, 0, t2, 0);
|
|---|
| 833 | __CS_cs(); if (__CS_ret != 0) return 0;
|
|---|
| 834 | if ((i[__CS_round] >= 144) || (j[__CS_round] >= 144))
|
|---|
| 835 | {
|
|---|
| 836 | __CS_cs(); if (__CS_ret != 0) return 0;
|
|---|
| 837 | goto __CS_ERROR;
|
|---|
| 838 | __CS_cs(); if (__CS_ret != 0) return 0;
|
|---|
| 839 | __CS_ERROR: __CS_error = 1; __CS_ret = __CS_ret_ERROR; __CS_error_detail = __ERR_ERROR_LABEL_REACHED; return 0;
|
|---|
| 840 | __CS_cs(); if (__CS_ret != 0) return 0;
|
|---|
| 841 | ;
|
|---|
| 842 | __CS_cs(); if (__CS_ret != 0) return 0;
|
|---|
| 843 | }
|
|---|
| 844 | __CS_cs(); if (__CS_ret != 0) return 0;
|
|---|
| 845 | }
|
|---|
| 846 | int main(int argc, char **argv)
|
|---|
| 847 | {
|
|---|
| 848 | unsigned char __CS_cp___CS_thread_status[6][2 +1];
|
|---|
| 849 | unsigned char *__CS_cp___CS_thread_lockedon[6][2 +1];
|
|---|
| 850 | int __CS_cp_i[6];
|
|---|
| 851 | int __CS_cp_j[6];
|
|---|
| 852 | __CS_thread_status[1][0] = __CS_cp___CS_thread_status[1][0];
|
|---|
| 853 | __CS_thread_status[2][0] = __CS_cp___CS_thread_status[2][0];
|
|---|
| 854 | __CS_thread_status[3][0] = __CS_cp___CS_thread_status[3][0];
|
|---|
| 855 | __CS_thread_status[4][0] = __CS_cp___CS_thread_status[4][0];
|
|---|
| 856 | __CS_thread_status[5][0] = __CS_cp___CS_thread_status[5][0];
|
|---|
| 857 | __CS_thread_status[1][1] = __CS_cp___CS_thread_status[1][1];
|
|---|
| 858 | __CS_thread_status[2][1] = __CS_cp___CS_thread_status[2][1];
|
|---|
| 859 | __CS_thread_status[3][1] = __CS_cp___CS_thread_status[3][1];
|
|---|
| 860 | __CS_thread_status[4][1] = __CS_cp___CS_thread_status[4][1];
|
|---|
| 861 | __CS_thread_status[5][1] = __CS_cp___CS_thread_status[5][1];
|
|---|
| 862 | __CS_thread_status[1][2] = __CS_cp___CS_thread_status[1][2];
|
|---|
| 863 | __CS_thread_status[2][2] = __CS_cp___CS_thread_status[2][2];
|
|---|
| 864 | __CS_thread_status[3][2] = __CS_cp___CS_thread_status[3][2];
|
|---|
| 865 | __CS_thread_status[4][2] = __CS_cp___CS_thread_status[4][2];
|
|---|
| 866 | __CS_thread_status[5][2] = __CS_cp___CS_thread_status[5][2];
|
|---|
| 867 | __CS_thread_lockedon[1][0] = __CS_cp___CS_thread_lockedon[1][0];
|
|---|
| 868 | __CS_thread_lockedon[2][0] = __CS_cp___CS_thread_lockedon[2][0];
|
|---|
| 869 | __CS_thread_lockedon[3][0] = __CS_cp___CS_thread_lockedon[3][0];
|
|---|
| 870 | __CS_thread_lockedon[4][0] = __CS_cp___CS_thread_lockedon[4][0];
|
|---|
| 871 | __CS_thread_lockedon[5][0] = __CS_cp___CS_thread_lockedon[5][0];
|
|---|
| 872 | __CS_thread_lockedon[1][1] = __CS_cp___CS_thread_lockedon[1][1];
|
|---|
| 873 | __CS_thread_lockedon[2][1] = __CS_cp___CS_thread_lockedon[2][1];
|
|---|
| 874 | __CS_thread_lockedon[3][1] = __CS_cp___CS_thread_lockedon[3][1];
|
|---|
| 875 | __CS_thread_lockedon[4][1] = __CS_cp___CS_thread_lockedon[4][1];
|
|---|
| 876 | __CS_thread_lockedon[5][1] = __CS_cp___CS_thread_lockedon[5][1];
|
|---|
| 877 | __CS_thread_lockedon[1][2] = __CS_cp___CS_thread_lockedon[1][2];
|
|---|
| 878 | __CS_thread_lockedon[2][2] = __CS_cp___CS_thread_lockedon[2][2];
|
|---|
| 879 | __CS_thread_lockedon[3][2] = __CS_cp___CS_thread_lockedon[3][2];
|
|---|
| 880 | __CS_thread_lockedon[4][2] = __CS_cp___CS_thread_lockedon[4][2];
|
|---|
| 881 | __CS_thread_lockedon[5][2] = __CS_cp___CS_thread_lockedon[5][2];
|
|---|
| 882 | i[1] = __CS_cp_i[1];
|
|---|
| 883 | i[2] = __CS_cp_i[2];
|
|---|
| 884 | i[3] = __CS_cp_i[3];
|
|---|
| 885 | i[4] = __CS_cp_i[4];
|
|---|
| 886 | i[5] = __CS_cp_i[5];
|
|---|
| 887 | j[1] = __CS_cp_j[1];
|
|---|
| 888 | j[2] = __CS_cp_j[2];
|
|---|
| 889 | j[3] = __CS_cp_j[3];
|
|---|
| 890 | j[4] = __CS_cp_j[4];
|
|---|
| 891 | j[5] = __CS_cp_j[5];
|
|---|
| 892 | __CS_round = 0;
|
|---|
| 893 | __CS_thread_index = 0;
|
|---|
| 894 | __CS_thread_born_round[0] = __CS_round;
|
|---|
| 895 | __CS_thread_status[0][0] = __THREAD_RUNNING;
|
|---|
| 896 | __CS_thread[0] = main_thread;
|
|---|
| 897 | __CS_thread_allocated[0] = 1;
|
|---|
| 898 | if (__CS_thread_allocated[0] == 1) {
|
|---|
| 899 | __CS_round = __CS_thread_born_round[0];
|
|---|
| 900 | __CS_ret = 0;
|
|---|
| 901 | __CS_thread[0](0);
|
|---|
| 902 | if (__CS_ret!=__CS_ret_PREEMPTED) __CS_thread_status[__CS_round][0] = __THREAD_FINISHED;
|
|---|
| 903 | }
|
|---|
| 904 | if (__CS_thread_allocated[1] == 1) {
|
|---|
| 905 | __CS_round = __CS_thread_born_round[1];
|
|---|
| 906 | __CS_ret = 0;
|
|---|
| 907 | __CS_thread[1](0);
|
|---|
| 908 | if (__CS_ret!=__CS_ret_PREEMPTED) __CS_thread_status[__CS_round][1] = __THREAD_FINISHED;
|
|---|
| 909 | }
|
|---|
| 910 | if (__CS_thread_allocated[2] == 1) {
|
|---|
| 911 | __CS_round = __CS_thread_born_round[2];
|
|---|
| 912 | __CS_ret = 0;
|
|---|
| 913 | __CS_thread[2](0);
|
|---|
| 914 | if (__CS_ret!=__CS_ret_PREEMPTED) __CS_thread_status[__CS_round][2] = __THREAD_FINISHED;
|
|---|
| 915 | }
|
|---|
| 916 | __VERIFIER_assume(__CS_thread_status[0][0] == __CS_cp___CS_thread_status[1][0]);
|
|---|
| 917 | __VERIFIER_assume(__CS_thread_status[1][0] == __CS_cp___CS_thread_status[2][0]);
|
|---|
| 918 | __VERIFIER_assume(__CS_thread_status[2][0] == __CS_cp___CS_thread_status[3][0]);
|
|---|
| 919 | __VERIFIER_assume(__CS_thread_status[3][0] == __CS_cp___CS_thread_status[4][0]);
|
|---|
| 920 | __VERIFIER_assume(__CS_thread_status[4][0] == __CS_cp___CS_thread_status[5][0]);
|
|---|
| 921 | __VERIFIER_assume(__CS_thread_status[0][1] == __CS_cp___CS_thread_status[1][1]);
|
|---|
| 922 | __VERIFIER_assume(__CS_thread_status[1][1] == __CS_cp___CS_thread_status[2][1]);
|
|---|
| 923 | __VERIFIER_assume(__CS_thread_status[2][1] == __CS_cp___CS_thread_status[3][1]);
|
|---|
| 924 | __VERIFIER_assume(__CS_thread_status[3][1] == __CS_cp___CS_thread_status[4][1]);
|
|---|
| 925 | __VERIFIER_assume(__CS_thread_status[4][1] == __CS_cp___CS_thread_status[5][1]);
|
|---|
| 926 | __VERIFIER_assume(__CS_thread_status[0][2] == __CS_cp___CS_thread_status[1][2]);
|
|---|
| 927 | __VERIFIER_assume(__CS_thread_status[1][2] == __CS_cp___CS_thread_status[2][2]);
|
|---|
| 928 | __VERIFIER_assume(__CS_thread_status[2][2] == __CS_cp___CS_thread_status[3][2]);
|
|---|
| 929 | __VERIFIER_assume(__CS_thread_status[3][2] == __CS_cp___CS_thread_status[4][2]);
|
|---|
| 930 | __VERIFIER_assume(__CS_thread_status[4][2] == __CS_cp___CS_thread_status[5][2]);
|
|---|
| 931 | __VERIFIER_assume(__CS_thread_lockedon[0][0] == __CS_cp___CS_thread_lockedon[1][0]);
|
|---|
| 932 | __VERIFIER_assume(__CS_thread_lockedon[1][0] == __CS_cp___CS_thread_lockedon[2][0]);
|
|---|
| 933 | __VERIFIER_assume(__CS_thread_lockedon[2][0] == __CS_cp___CS_thread_lockedon[3][0]);
|
|---|
| 934 | __VERIFIER_assume(__CS_thread_lockedon[3][0] == __CS_cp___CS_thread_lockedon[4][0]);
|
|---|
| 935 | __VERIFIER_assume(__CS_thread_lockedon[4][0] == __CS_cp___CS_thread_lockedon[5][0]);
|
|---|
| 936 | __VERIFIER_assume(__CS_thread_lockedon[0][1] == __CS_cp___CS_thread_lockedon[1][1]);
|
|---|
| 937 | __VERIFIER_assume(__CS_thread_lockedon[1][1] == __CS_cp___CS_thread_lockedon[2][1]);
|
|---|
| 938 | __VERIFIER_assume(__CS_thread_lockedon[2][1] == __CS_cp___CS_thread_lockedon[3][1]);
|
|---|
| 939 | __VERIFIER_assume(__CS_thread_lockedon[3][1] == __CS_cp___CS_thread_lockedon[4][1]);
|
|---|
| 940 | __VERIFIER_assume(__CS_thread_lockedon[4][1] == __CS_cp___CS_thread_lockedon[5][1]);
|
|---|
| 941 | __VERIFIER_assume(__CS_thread_lockedon[0][2] == __CS_cp___CS_thread_lockedon[1][2]);
|
|---|
| 942 | __VERIFIER_assume(__CS_thread_lockedon[1][2] == __CS_cp___CS_thread_lockedon[2][2]);
|
|---|
| 943 | __VERIFIER_assume(__CS_thread_lockedon[2][2] == __CS_cp___CS_thread_lockedon[3][2]);
|
|---|
| 944 | __VERIFIER_assume(__CS_thread_lockedon[3][2] == __CS_cp___CS_thread_lockedon[4][2]);
|
|---|
| 945 | __VERIFIER_assume(__CS_thread_lockedon[4][2] == __CS_cp___CS_thread_lockedon[5][2]);
|
|---|
| 946 | __VERIFIER_assume(i[0] == __CS_cp_i[1]);
|
|---|
| 947 | __VERIFIER_assume(i[1] == __CS_cp_i[2]);
|
|---|
| 948 | __VERIFIER_assume(i[2] == __CS_cp_i[3]);
|
|---|
| 949 | __VERIFIER_assume(i[3] == __CS_cp_i[4]);
|
|---|
| 950 | __VERIFIER_assume(i[4] == __CS_cp_i[5]);
|
|---|
| 951 | __VERIFIER_assume(j[0] == __CS_cp_j[1]);
|
|---|
| 952 | __VERIFIER_assume(j[1] == __CS_cp_j[2]);
|
|---|
| 953 | __VERIFIER_assume(j[2] == __CS_cp_j[3]);
|
|---|
| 954 | __VERIFIER_assume(j[3] == __CS_cp_j[4]);
|
|---|
| 955 | __VERIFIER_assume(j[4] == __CS_cp_j[5]);
|
|---|
| 956 | __VERIFIER_assert(__CS_error_detail != __ERR_MAXTHREADS_REACHED);
|
|---|
| 957 | __VERIFIER_assert(__CS_error_detail != __ERR_ASSERT_FAILURE);
|
|---|
| 958 | __VERIFIER_assert(__CS_error_detail != __ERR_ERROR_LABEL_REACHED);
|
|---|
| 959 | __VERIFIER_assert(__CS_error_detail != __ERR_UNLOCK_ATTEMPT);
|
|---|
| 960 | __VERIFIER_assert(__CS_error_detail != __ERR_JOIN_FAILED_WRONG_THREAD_ID);
|
|---|
| 961 | __VERIFIER_assert(__CS_error_detail != __ERR_JOIN_FAILED_THREAD_NOT_CREATED);
|
|---|
| 962 | __VERIFIER_assert(__CS_error != 1);
|
|---|
| 963 | }
|
|---|