int __cs_cond_wait_2(__cs_cond_t *__cs_cond_to_wait_for, __cs_mutex_t *__cs_m)
 {
 __CPROVER_assume((*__cs_cond_to_wait_for) == 1);
 __cs_mutex_lock(__cs_m);
 return 0;
 }
                                        void *t2_0(void *__cs_param_t2_arg)
                                        {
                                        static int __cs_local_t2_i;
IF(2,0,tt2_0_1)
                                        __cs_init_scalar(&__cs_local_t2_i, sizeof(int));
                                        __cs_local_t2_i = 0;
                                        		{
tt2_0_1: IF(2,1,tt2_0_2)
                                        __cs_mutex_lock(&m);
                                        static _Bool __cs_local_t2___cs_tmp_if_cond_3;
                                        __cs_init_scalar(&__cs_local_t2___cs_tmp_if_cond_3, sizeof(_Bool));
tt2_0_2: IF(2,2,tt2_0_3)
                                        __cs_local_t2___cs_tmp_if_cond_3 = flag;
                                        if (__cs_local_t2___cs_tmp_if_cond_3)
                                        				{
                                        static _Bool __cs_local_t2___cs_tmp_if_cond_4;
                                        __cs_init_scalar(&__cs_local_t2___cs_tmp_if_cond_4, sizeof(_Bool));
                                        static int __cs_retval__pop_1;
                                        						{
                                        static unsigned int *__cs_param_pop_stack;
tt2_0_3: IF(2,3,tt2_0_4)
                                        __cs_param_pop_stack = arr;
                                        static _Bool __cs_local_pop___cs_tmp_if_cond_1;
                                        __cs_init_scalar(&__cs_local_pop___cs_tmp_if_cond_1, sizeof(_Bool));
                                        static int __cs_retval__get_top_2;
                                        								{
tt2_0_4: IF(2,4,tt2_0_5)
                                        __cs_retval__get_top_2 = top;
                                        goto __exit__get_top_2_0;
                                        										;
                                        __exit__get_top_2_0:
                                        										__CPROVER_assume(__cs_pc_cs[2] >= 5);
                                        										;
                                        										;
                                        								}
                                        								;
                                        __cs_local_pop___cs_tmp_if_cond_1 = __cs_retval__get_top_2 == 0;
                                        if (__cs_local_pop___cs_tmp_if_cond_1)
                                        								{
                                        printf("stack underflow\n");
                                        __cs_retval__pop_1 = -2;
                                        goto __exit__pop_1_0;
                                        										;
                                        								}
                                        								else
                                        								{
                                        										{
tt2_0_5: IF(2,5,tt2_0_6)
                                        top--;
                                        __exit__dec_top_1_0:
                                        												__CPROVER_assume(__cs_pc_cs[2] >= 6);
                                        												;
                                        												;
                                        										}
                                        										;
                                        static int __cs_retval__get_top_3;
                                        										{
tt2_0_6: IF(2,6,tt2_0_7)
                                        __cs_retval__get_top_3 = top;
                                        goto __exit__get_top_3_0;
                                        												;
                                        __exit__get_top_3_0:
                                        												__CPROVER_assume(__cs_pc_cs[2] >= 7);
                                        												;
                                        												;
                                        										}
                                        										;
tt2_0_7: IF(2,7,tt2_0_8)
                                        __cs_retval__pop_1 = __cs_param_pop_stack[__cs_retval__get_top_3];
                                        goto __exit__pop_1_0;
                                        										;
                                        								}
                                        __CPROVER_assume(__cs_pc_cs[2] >= 8);
                                        								;
                                        __cs_retval__pop_1 = 0;
                                        goto __exit__pop_1_0;
                                        								;
                                        __exit__pop_1_0:
                                        								__CPROVER_assume(__cs_pc_cs[2] >= 8);
                                        								;
                                        								;
                                        						}
                                        						;
                                        __cs_local_t2___cs_tmp_if_cond_4 = !(__cs_retval__pop_1 != (-2));
                                        if (__cs_local_t2___cs_tmp_if_cond_4)
                                        						{
                                        								{
                                        assert(0);
                                        goto __exit__error_2_0;
                                        										;
                                        __exit__error_2_0:
                                        										__CPROVER_assume(__cs_pc_cs[2] >= 8);
                                        										;
                                        										;
                                        								}
                                        								;
                                        						}
                                        						;
                                        				}
                                        __CPROVER_assume(__cs_pc_cs[2] >= 8);
                                        				;
tt2_0_8: IF(2,8,tt2_0_9)
                                        __cs_mutex_unlock(&m);
                                        		}
                                        		;
                                        __cs_local_t2_i++;
                                        		{
tt2_0_9: IF(2,9,tt2_0_10)
                                        __cs_mutex_lock(&m);
                                        static _Bool __cs_local_t2___cs_tmp_if_cond_3;
                                        __cs_init_scalar(&__cs_local_t2___cs_tmp_if_cond_3, sizeof(_Bool));
tt2_0_10: IF(2,10,tt2_0_11)
                                        __cs_local_t2___cs_tmp_if_cond_3 = flag;
                                        if (__cs_local_t2___cs_tmp_if_cond_3)
                                        				{
                                        static _Bool __cs_local_t2___cs_tmp_if_cond_4;
                                        __cs_init_scalar(&__cs_local_t2___cs_tmp_if_cond_4, sizeof(_Bool));
                                        static int __cs_retval__pop_1;
                                        						{
                                        static unsigned int *__cs_param_pop_stack;
tt2_0_11: IF(2,11,tt2_0_12)
                                        __cs_param_pop_stack = arr;
                                        static _Bool __cs_local_pop___cs_tmp_if_cond_1;
                                        __cs_init_scalar(&__cs_local_pop___cs_tmp_if_cond_1, sizeof(_Bool));
                                        static int __cs_retval__get_top_2;
                                        								{
tt2_0_12: IF(2,12,tt2_0_13)
                                        __cs_retval__get_top_2 = top;
                                        goto __exit__get_top_2_1;
                                        										;
                                        __exit__get_top_2_1:
                                        										__CPROVER_assume(__cs_pc_cs[2] >= 13);
                                        										;
                                        										;
                                        								}
                                        								;
                                        __cs_local_pop___cs_tmp_if_cond_1 = __cs_retval__get_top_2 == 0;
                                        if (__cs_local_pop___cs_tmp_if_cond_1)
                                        								{
                                        printf("stack underflow\n");
                                        __cs_retval__pop_1 = -2;
                                        goto __exit__pop_1_1;
                                        										;
                                        								}
                                        								else
                                        								{
                                        										{
tt2_0_13: IF(2,13,tt2_0_14)
                                        top--;
                                        __exit__dec_top_1_1:
                                        												__CPROVER_assume(__cs_pc_cs[2] >= 14);
                                        												;
                                        												;
                                        										}
                                        										;
                                        static int __cs_retval__get_top_3;
                                        										{
tt2_0_14: IF(2,14,tt2_0_15)
                                        __cs_retval__get_top_3 = top;
                                        goto __exit__get_top_3_1;
                                        												;
                                        __exit__get_top_3_1:
                                        												__CPROVER_assume(__cs_pc_cs[2] >= 15);
                                        												;
                                        												;
                                        										}
                                        										;
tt2_0_15: IF(2,15,tt2_0_16)
                                        __cs_retval__pop_1 = __cs_param_pop_stack[__cs_retval__get_top_3];
                                        goto __exit__pop_1_1;
                                        										;
                                        								}
                                        __CPROVER_assume(__cs_pc_cs[2] >= 16);
                                        								;
                                        __cs_retval__pop_1 = 0;
                                        goto __exit__pop_1_1;
                                        								;
                                        __exit__pop_1_1:
                                        								__CPROVER_assume(__cs_pc_cs[2] >= 16);
                                        								;
                                        								;
                                        						}
                                        						;
                                        __cs_local_t2___cs_tmp_if_cond_4 = !(__cs_retval__pop_1 != (-2));
                                        if (__cs_local_t2___cs_tmp_if_cond_4)
                                        						{
                                        								{
                                        assert(0);
                                        goto __exit__error_2_1;
                                        										;
                                        __exit__error_2_1:
                                        										__CPROVER_assume(__cs_pc_cs[2] >= 16);
                                        										;
                                        										;
                                        								}
                                        								;
                                        						}
                                        						;
                                        				}
                                        __CPROVER_assume(__cs_pc_cs[2] >= 16);
                                        				;
tt2_0_16: IF(2,16,tt2_0_17)
                                        __cs_mutex_unlock(&m);
                                        		}
                                        		;
                                        __cs_local_t2_i++;
tt2_0_17: IF(2,17,tt2_0_18)
                                        __CPROVER_assume(!(__cs_local_t2_i < 800));
                                        __exit_loop_2:
                                        		__CPROVER_assume(__cs_pc_cs[2] >= 18);
                                        		;
                                        		;
                                        __exit_t2:
                                        		__CPROVER_assume(__cs_pc_cs[2] >= 18);
                                        		;
                                        		;
tt2_0_18: 
                                        STOP_NONVOID(18);
                                        }
                                        void *t1_0(void *__cs_param_t1_arg)
                                        {
                                        static int __cs_local_t1_i;
IF(1,0,tt1_0_1)
                                        __cs_init_scalar(&__cs_local_t1_i, sizeof(int));
                                        static unsigned int __cs_local_t1_tmp;
                                        __cs_init_scalar(&__cs_local_t1_tmp, sizeof(unsigned int));
                                        __cs_local_t1_i = 0;
                                        		{
tt1_0_1: IF(1,1,tt1_0_2)
                                        __cs_mutex_lock(&m);
                                        __cs_local_t1_tmp = __VERIFIER_nondet_uint() % 800;
                                        static _Bool __cs_local_t1___cs_tmp_if_cond_2;
                                        __cs_init_scalar(&__cs_local_t1___cs_tmp_if_cond_2, sizeof(_Bool));
                                        static int __cs_retval__push_1;
                                        				{
                                        static unsigned int *__cs_param_push_stack;
tt1_0_2: IF(1,2,tt1_0_3)
                                        __cs_param_push_stack = arr;
                                        static int __cs_param_push_x;
                                        __cs_param_push_x = __cs_local_t1_tmp;
                                        static _Bool __cs_local_push___cs_tmp_if_cond_0;
                                        __cs_init_scalar(&__cs_local_push___cs_tmp_if_cond_0, sizeof(_Bool));
tt1_0_3: IF(1,3,tt1_0_4)
                                        __cs_local_push___cs_tmp_if_cond_0 = top == 800;
                                        if (__cs_local_push___cs_tmp_if_cond_0)
                                        						{
                                        printf("stack overflow\n");
                                        __cs_retval__push_1 = -1;
                                        goto __exit__push_1_0;
                                        								;
                                        						}
                                        						else
                                        						{
                                        static int __cs_retval__get_top_1;
                                        								{
tt1_0_4: IF(1,4,tt1_0_5)
                                        __cs_retval__get_top_1 = top;
                                        goto __exit__get_top_1_0;
                                        										;
                                        __exit__get_top_1_0:
                                        										__CPROVER_assume(__cs_pc_cs[1] >= 5);
                                        										;
                                        										;
                                        								}
                                        								;
tt1_0_5: IF(1,5,tt1_0_6)
                                        __cs_param_push_stack[__cs_retval__get_top_1] = __cs_param_push_x;
                                        								{
tt1_0_6: IF(1,6,tt1_0_7)
                                        top++;
                                        __exit__inc_top_1_0:
                                        										__CPROVER_assume(__cs_pc_cs[1] >= 7);
                                        										;
                                        										;
                                        								}
                                        								;
                                        						}
                                        __CPROVER_assume(__cs_pc_cs[1] >= 7);
                                        						;
                                        __cs_retval__push_1 = 0;
                                        goto __exit__push_1_0;
                                        						;
                                        __exit__push_1_0:
                                        						__CPROVER_assume(__cs_pc_cs[1] >= 7);
                                        						;
                                        						;
                                        				}
                                        				;
                                        __cs_local_t1___cs_tmp_if_cond_2 = __cs_retval__push_1 == (-1);
                                        if (__cs_local_t1___cs_tmp_if_cond_2)
                                        				{
                                        						{
                                        assert(0);
                                        goto __exit__error_1_0;
                                        								;
                                        __exit__error_1_0:
                                        								__CPROVER_assume(__cs_pc_cs[1] >= 7);
                                        								;
                                        								;
                                        						}
                                        						;
                                        				}
                                        				;
tt1_0_7: IF(1,7,tt1_0_8)
                                        flag = 1;
tt1_0_8: IF(1,8,tt1_0_9)
                                        __cs_mutex_unlock(&m);
                                        		}
                                        		;
                                        __cs_local_t1_i++;
                                        		{
tt1_0_9: IF(1,9,tt1_0_10)
                                        __cs_mutex_lock(&m);
                                        __cs_local_t1_tmp = __VERIFIER_nondet_uint() % 800;
                                        static _Bool __cs_local_t1___cs_tmp_if_cond_2;
                                        __cs_init_scalar(&__cs_local_t1___cs_tmp_if_cond_2, sizeof(_Bool));
                                        static int __cs_retval__push_1;
                                        				{
                                        static unsigned int *__cs_param_push_stack;
tt1_0_10: IF(1,10,tt1_0_11)
                                        __cs_param_push_stack = arr;
                                        static int __cs_param_push_x;
                                        __cs_param_push_x = __cs_local_t1_tmp;
                                        static _Bool __cs_local_push___cs_tmp_if_cond_0;
                                        __cs_init_scalar(&__cs_local_push___cs_tmp_if_cond_0, sizeof(_Bool));
tt1_0_11: IF(1,11,tt1_0_12)
                                        __cs_local_push___cs_tmp_if_cond_0 = top == 800;
                                        if (__cs_local_push___cs_tmp_if_cond_0)
                                        						{
                                        printf("stack overflow\n");
                                        __cs_retval__push_1 = -1;
                                        goto __exit__push_1_1;
                                        								;
                                        						}
                                        						else
                                        						{
                                        static int __cs_retval__get_top_1;
                                        								{
tt1_0_12: IF(1,12,tt1_0_13)
                                        __cs_retval__get_top_1 = top;
                                        goto __exit__get_top_1_1;
                                        										;
                                        __exit__get_top_1_1:
                                        										__CPROVER_assume(__cs_pc_cs[1] >= 13);
                                        										;
                                        										;
                                        								}
                                        								;
tt1_0_13: IF(1,13,tt1_0_14)
                                        __cs_param_push_stack[__cs_retval__get_top_1] = __cs_param_push_x;
                                        								{
tt1_0_14: IF(1,14,tt1_0_15)
                                        top++;
                                        __exit__inc_top_1_1:
                                        										__CPROVER_assume(__cs_pc_cs[1] >= 15);
                                        										;
                                        										;
                                        								}
                                        								;
                                        						}
                                        __CPROVER_assume(__cs_pc_cs[1] >= 15);
                                        						;
                                        __cs_retval__push_1 = 0;
                                        goto __exit__push_1_1;
                                        						;
                                        __exit__push_1_1:
                                        						__CPROVER_assume(__cs_pc_cs[1] >= 15);
                                        						;
                                        						;
                                        				}
                                        				;
                                        __cs_local_t1___cs_tmp_if_cond_2 = __cs_retval__push_1 == (-1);
                                        if (__cs_local_t1___cs_tmp_if_cond_2)
                                        				{
                                        						{
                                        assert(0);
                                        goto __exit__error_1_1;
                                        								;
                                        __exit__error_1_1:
                                        								__CPROVER_assume(__cs_pc_cs[1] >= 15);
                                        								;
                                        								;
                                        						}
                                        						;
                                        				}
                                        				;
tt1_0_15: IF(1,15,tt1_0_16)
                                        flag = 1;
tt1_0_16: IF(1,16,tt1_0_17)
                                        __cs_mutex_unlock(&m);
                                        		}
                                        		;
                                        __cs_local_t1_i++;
tt1_0_17: IF(1,17,tt1_0_18)
                                        __CPROVER_assume(!(__cs_local_t1_i < 800));
                                        __exit_loop_1:
                                        		__CPROVER_assume(__cs_pc_cs[1] >= 18);
                                        		;
                                        		;
                                        __exit_t1:
                                        		__CPROVER_assume(__cs_pc_cs[1] >= 18);
                                        		;
                                        		;
tt1_0_18: 
                                        STOP_NONVOID(18);
                                        }
int __cs_cond_wait_2(__cs_cond_t *__cs_cond_to_wait_for, __cs_mutex_t *__cs_m, unsigned int __cs_thread_index) {
	__CSEQ_assume(*__cs_cond_to_wait_for == 1);
	__cs_mutex_lock(__cs_m, __cs_thread_index);
	return 0;
}
int __cs_cond_wait(__cs_cond_t *cond, __cs_mutex_t *mutex) { __cs_mutex_unlock(mutex); assume(*cond != -1); __cs_mutex_lock(mutex); return 0; }
Exemple #6
0
int __cs_cond_wait_2(__cs_cond_t *__cs_cond_to_wait_for, __cs_mutex_t *__cs_m) {
	__CSEQ_assume(*__cs_cond_to_wait_for == 1);
	__cs_mutex_lock(__cs_m);
	return 0;
}