1extern int __VERIFIER_nondet_int(void);
2
3
4
5#line 2 "libacc.c"
6struct JoinPoint {
7 void **(*fp)(struct JoinPoint * ) ;
8 void **args ;
9 int argsCount ;
10 char const **argsType ;
11 void *(*arg)(int , struct JoinPoint * ) ;
12 char const *(*argType)(int , struct JoinPoint * ) ;
13 void **retValue ;
14 char const *retType ;
15 char const *funcName ;
16 char const *targetName ;
17 char const *fileName ;
18 char const *kind ;
19 void *excep_return ;
20};
21#line 18 "libacc.c"
22struct __UTAC__CFLOW_FUNC {
23 int (*func)(int , int ) ;
24 int val ;
25 struct __UTAC__CFLOW_FUNC *next ;
26};
27#line 18 "libacc.c"
28struct __UTAC__EXCEPTION {
29 void *jumpbuf ;
30 unsigned long long prtValue ;
31 int pops ;
32 struct __UTAC__CFLOW_FUNC *cflowfuncs ;
33};
34#line 211 "/usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h"
35typedef unsigned long size_t;
36#line 76 "libacc.c"
37struct __ACC__ERR {
38 void *v ;
39 struct __ACC__ERR *next ;
40};
41#line 1 "libacc.o"
42#pragma merger(0,"libacc.i","")
43#line 73 "/usr/include/assert.h"
44extern __attribute__((__nothrow__, __noreturn__)) void __assert_fail(char const *__assertion ,
45 char const *__file ,
46 unsigned int __line ,
47 char const *__function ) ;
48#line 471 "/usr/include/stdlib.h"
49extern __attribute__((__nothrow__)) void *malloc(size_t __size ) __attribute__((__malloc__)) ;
50#line 488
51extern __attribute__((__nothrow__)) void free(void *__ptr ) ;
52#line 32 "libacc.c"
53void __utac__exception__cf_handler_set(void *exception , int (*cflow_func)(int ,
54 int ) ,
55 int val )
56{ struct __UTAC__EXCEPTION *excep ;
57 struct __UTAC__CFLOW_FUNC *cf ;
58 void *tmp ;
59 unsigned long __cil_tmp7 ;
60 unsigned long __cil_tmp8 ;
61 unsigned long __cil_tmp9 ;
62 unsigned long __cil_tmp10 ;
63 unsigned long __cil_tmp11 ;
64 unsigned long __cil_tmp12 ;
65 unsigned long __cil_tmp13 ;
66 unsigned long __cil_tmp14 ;
67 int (**mem_15)(int , int ) ;
68 int *mem_16 ;
69 struct __UTAC__CFLOW_FUNC **mem_17 ;
70 struct __UTAC__CFLOW_FUNC **mem_18 ;
71 struct __UTAC__CFLOW_FUNC **mem_19 ;
72
73 {
74 {
75#line 33
76 excep = (struct __UTAC__EXCEPTION *)exception;
77#line 34
78 tmp = malloc(24UL);
79#line 34
80 cf = (struct __UTAC__CFLOW_FUNC *)tmp;
81#line 36
82 mem_15 = (int (**)(int , int ))cf;
83#line 36
84 *mem_15 = cflow_func;
85#line 37
86 __cil_tmp7 = (unsigned long )cf;
87#line 37
88 __cil_tmp8 = __cil_tmp7 + 8;
89#line 37
90 mem_16 = (int *)__cil_tmp8;
91#line 37
92 *mem_16 = val;
93#line 38
94 __cil_tmp9 = (unsigned long )cf;
95#line 38
96 __cil_tmp10 = __cil_tmp9 + 16;
97#line 38
98 __cil_tmp11 = (unsigned long )excep;
99#line 38
100 __cil_tmp12 = __cil_tmp11 + 24;
101#line 38
102 mem_17 = (struct __UTAC__CFLOW_FUNC **)__cil_tmp10;
103#line 38
104 mem_18 = (struct __UTAC__CFLOW_FUNC **)__cil_tmp12;
105#line 38
106 *mem_17 = *mem_18;
107#line 39
108 __cil_tmp13 = (unsigned long )excep;
109#line 39
110 __cil_tmp14 = __cil_tmp13 + 24;
111#line 39
112 mem_19 = (struct __UTAC__CFLOW_FUNC **)__cil_tmp14;
113#line 39
114 *mem_19 = cf;
115 }
116#line 654 "libacc.c"
117 return;
118}
119}
120#line 44 "libacc.c"
121void __utac__exception__cf_handler_free(void *exception )
122{ struct __UTAC__EXCEPTION *excep ;
123 struct __UTAC__CFLOW_FUNC *cf ;
124 struct __UTAC__CFLOW_FUNC *tmp ;
125 unsigned long __cil_tmp5 ;
126 unsigned long __cil_tmp6 ;
127 struct __UTAC__CFLOW_FUNC *__cil_tmp7 ;
128 unsigned long __cil_tmp8 ;
129 unsigned long __cil_tmp9 ;
130 unsigned long __cil_tmp10 ;
131 unsigned long __cil_tmp11 ;
132 void *__cil_tmp12 ;
133 unsigned long __cil_tmp13 ;
134 unsigned long __cil_tmp14 ;
135 struct __UTAC__CFLOW_FUNC **mem_15 ;
136 struct __UTAC__CFLOW_FUNC **mem_16 ;
137 struct __UTAC__CFLOW_FUNC **mem_17 ;
138
139 {
140#line 45
141 excep = (struct __UTAC__EXCEPTION *)exception;
142#line 46
143 __cil_tmp5 = (unsigned long )excep;
144#line 46
145 __cil_tmp6 = __cil_tmp5 + 24;
146#line 46
147 mem_15 = (struct __UTAC__CFLOW_FUNC **)__cil_tmp6;
148#line 46
149 cf = *mem_15;
150 {
151#line 49
152 while (1) {
153 while_0_continue: ;
154 {
155#line 49
156 __cil_tmp7 = (struct __UTAC__CFLOW_FUNC *)0;
157#line 49
158 __cil_tmp8 = (unsigned long )__cil_tmp7;
159#line 49
160 __cil_tmp9 = (unsigned long )cf;
161#line 49
162 if (__cil_tmp9 != __cil_tmp8) {
163
164 } else {
165 goto while_0_break;
166 }
167 }
168 {
169#line 50
170 tmp = cf;
171#line 51
172 __cil_tmp10 = (unsigned long )cf;
173#line 51
174 __cil_tmp11 = __cil_tmp10 + 16;
175#line 51
176 mem_16 = (struct __UTAC__CFLOW_FUNC **)__cil_tmp11;
177#line 51
178 cf = *mem_16;
179#line 52
180 __cil_tmp12 = (void *)tmp;
181#line 52
182 free(__cil_tmp12);
183 }
184 }
185 while_0_break: ;
186 }
187#line 55
188 __cil_tmp13 = (unsigned long )excep;
189#line 55
190 __cil_tmp14 = __cil_tmp13 + 24;
191#line 55
192 mem_17 = (struct __UTAC__CFLOW_FUNC **)__cil_tmp14;
193#line 55
194 *mem_17 = (struct __UTAC__CFLOW_FUNC *)0;
195#line 694 "libacc.c"
196 return;
197}
198}
199#line 59 "libacc.c"
200void __utac__exception__cf_handler_reset(void *exception )
201{ struct __UTAC__EXCEPTION *excep ;
202 struct __UTAC__CFLOW_FUNC *cf ;
203 unsigned long __cil_tmp5 ;
204 unsigned long __cil_tmp6 ;
205 struct __UTAC__CFLOW_FUNC *__cil_tmp7 ;
206 unsigned long __cil_tmp8 ;
207 unsigned long __cil_tmp9 ;
208 int (*__cil_tmp10)(int , int ) ;
209 unsigned long __cil_tmp11 ;
210 unsigned long __cil_tmp12 ;
211 int __cil_tmp13 ;
212 unsigned long __cil_tmp14 ;
213 unsigned long __cil_tmp15 ;
214 struct __UTAC__CFLOW_FUNC **mem_16 ;
215 int (**mem_17)(int , int ) ;
216 int *mem_18 ;
217 struct __UTAC__CFLOW_FUNC **mem_19 ;
218
219 {
220#line 60
221 excep = (struct __UTAC__EXCEPTION *)exception;
222#line 61
223 __cil_tmp5 = (unsigned long )excep;
224#line 61
225 __cil_tmp6 = __cil_tmp5 + 24;
226#line 61
227 mem_16 = (struct __UTAC__CFLOW_FUNC **)__cil_tmp6;
228#line 61
229 cf = *mem_16;
230 {
231#line 64
232 while (1) {
233 while_1_continue: ;
234 {
235#line 64
236 __cil_tmp7 = (struct __UTAC__CFLOW_FUNC *)0;
237#line 64
238 __cil_tmp8 = (unsigned long )__cil_tmp7;
239#line 64
240 __cil_tmp9 = (unsigned long )cf;
241#line 64
242 if (__cil_tmp9 != __cil_tmp8) {
243
244 } else {
245 goto while_1_break;
246 }
247 }
248 {
249#line 65
250 mem_17 = (int (**)(int , int ))cf;
251#line 65
252 __cil_tmp10 = *mem_17;
253#line 65
254 __cil_tmp11 = (unsigned long )cf;
255#line 65
256 __cil_tmp12 = __cil_tmp11 + 8;
257#line 65
258 mem_18 = (int *)__cil_tmp12;
259#line 65
260 __cil_tmp13 = *mem_18;
261#line 65
262 (*__cil_tmp10)(4, __cil_tmp13);
263#line 66
264 __cil_tmp14 = (unsigned long )cf;
265#line 66
266 __cil_tmp15 = __cil_tmp14 + 16;
267#line 66
268 mem_19 = (struct __UTAC__CFLOW_FUNC **)__cil_tmp15;
269#line 66
270 cf = *mem_19;
271 }
272 }
273 while_1_break: ;
274 }
275 {
276#line 69
277 __utac__exception__cf_handler_free(exception);
278 }
279#line 732 "libacc.c"
280 return;
281}
282}
283#line 80 "libacc.c"
284void *__utac__error_stack_mgt(void *env , int mode , int count ) ;
285#line 80 "libacc.c"
286static struct __ACC__ERR *head = (struct __ACC__ERR *)0;
287#line 79 "libacc.c"
288void *__utac__error_stack_mgt(void *env , int mode , int count )
289{ void *retValue_acc ;
290 struct __ACC__ERR *new ;
291 void *tmp ;
292 struct __ACC__ERR *temp ;
293 struct __ACC__ERR *next ;
294 void *excep ;
295 unsigned long __cil_tmp10 ;
296 unsigned long __cil_tmp11 ;
297 unsigned long __cil_tmp12 ;
298 unsigned long __cil_tmp13 ;
299 void *__cil_tmp14 ;
300 unsigned long __cil_tmp15 ;
301 unsigned long __cil_tmp16 ;
302 void *__cil_tmp17 ;
303 void **mem_18 ;
304 struct __ACC__ERR **mem_19 ;
305 struct __ACC__ERR **mem_20 ;
306 void **mem_21 ;
307 struct __ACC__ERR **mem_22 ;
308 void **mem_23 ;
309 void **mem_24 ;
310
311 {
312#line 82 "libacc.c"
313 if (count == 0) {
314#line 758 "libacc.c"
315 return (retValue_acc);
316 } else {
317
318 }
319#line 86 "libacc.c"
320 if (mode == 0) {
321 {
322#line 87
323 tmp = malloc(16UL);
324#line 87
325 new = (struct __ACC__ERR *)tmp;
326#line 88
327 mem_18 = (void **)new;
328#line 88
329 *mem_18 = env;
330#line 89
331 __cil_tmp10 = (unsigned long )new;
332#line 89
333 __cil_tmp11 = __cil_tmp10 + 8;
334#line 89
335 mem_19 = (struct __ACC__ERR **)__cil_tmp11;
336#line 89
337 *mem_19 = head;
338#line 90
339 head = new;
340#line 776 "libacc.c"
341 retValue_acc = (void *)new;
342 }
343#line 778
344 return (retValue_acc);
345 } else {
346
347 }
348#line 94 "libacc.c"
349 if (mode == 1) {
350#line 95
351 temp = head;
352 {
353#line 98
354 while (1) {
355 while_2_continue: ;
356#line 98
357 if (count > 1) {
358
359 } else {
360 goto while_2_break;
361 }
362 {
363#line 99
364 __cil_tmp12 = (unsigned long )temp;
365#line 99
366 __cil_tmp13 = __cil_tmp12 + 8;
367#line 99
368 mem_20 = (struct __ACC__ERR **)__cil_tmp13;
369#line 99
370 next = *mem_20;
371#line 100
372 mem_21 = (void **)temp;
373#line 100
374 excep = *mem_21;
375#line 101
376 __cil_tmp14 = (void *)temp;
377#line 101
378 free(__cil_tmp14);
379#line 102
380 __utac__exception__cf_handler_reset(excep);
381#line 103
382 temp = next;
383#line 104
384 count = count - 1;
385 }
386 }
387 while_2_break: ;
388 }
389 {
390#line 107
391 __cil_tmp15 = (unsigned long )temp;
392#line 107
393 __cil_tmp16 = __cil_tmp15 + 8;
394#line 107
395 mem_22 = (struct __ACC__ERR **)__cil_tmp16;
396#line 107
397 head = *mem_22;
398#line 108
399 mem_23 = (void **)temp;
400#line 108
401 excep = *mem_23;
402#line 109
403 __cil_tmp17 = (void *)temp;
404#line 109
405 free(__cil_tmp17);
406#line 110
407 __utac__exception__cf_handler_reset(excep);
408#line 820 "libacc.c"
409 retValue_acc = excep;
410 }
411#line 822
412 return (retValue_acc);
413 } else {
414
415 }
416#line 114
417 if (mode == 2) {
418#line 118 "libacc.c"
419 if (head) {
420#line 831
421 mem_24 = (void **)head;
422#line 831
423 retValue_acc = *mem_24;
424#line 833
425 return (retValue_acc);
426 } else {
427#line 837 "libacc.c"
428 retValue_acc = (void *)0;
429#line 839
430 return (retValue_acc);
431 }
432 } else {
433
434 }
435#line 846 "libacc.c"
436 return (retValue_acc);
437}
438}
439#line 122 "libacc.c"
440void *__utac__get_this_arg(int i , struct JoinPoint *this )
441{ void *retValue_acc ;
442 unsigned long __cil_tmp4 ;
443 unsigned long __cil_tmp5 ;
444 int __cil_tmp6 ;
445 int __cil_tmp7 ;
446 unsigned long __cil_tmp8 ;
447 unsigned long __cil_tmp9 ;
448 void **__cil_tmp10 ;
449 void **__cil_tmp11 ;
450 int *mem_12 ;
451 void ***mem_13 ;
452
453 {
454#line 123
455 if (i > 0) {
456 {
457#line 123
458 __cil_tmp4 = (unsigned long )this;
459#line 123
460 __cil_tmp5 = __cil_tmp4 + 16;
461#line 123
462 mem_12 = (int *)__cil_tmp5;
463#line 123
464 __cil_tmp6 = *mem_12;
465#line 123
466 if (i <= __cil_tmp6) {
467
468 } else {
469 {
470#line 123
471 __assert_fail("i > 0 && i <= this->argsCount", "libacc.c",
472 123U, "__utac__get_this_arg");
473 }
474 }
475 }
476 } else {
477 {
478#line 123
479 __assert_fail("i > 0 && i <= this->argsCount", "libacc.c",
480 123U, "__utac__get_this_arg");
481 }
482 }
483#line 870 "libacc.c"
484 __cil_tmp7 = i - 1;
485#line 870
486 __cil_tmp8 = (unsigned long )this;
487#line 870
488 __cil_tmp9 = __cil_tmp8 + 8;
489#line 870
490 mem_13 = (void ***)__cil_tmp9;
491#line 870
492 __cil_tmp10 = *mem_13;
493#line 870
494 __cil_tmp11 = __cil_tmp10 + __cil_tmp7;
495#line 870
496 retValue_acc = *__cil_tmp11;
497#line 872
498 return (retValue_acc);
499#line 879
500 return (retValue_acc);
501}
502}
503#line 129 "libacc.c"
504char const *__utac__get_this_argtype(int i , struct JoinPoint *this )
505{ char const *retValue_acc ;
506 unsigned long __cil_tmp4 ;
507 unsigned long __cil_tmp5 ;
508 int __cil_tmp6 ;
509 int __cil_tmp7 ;
510 unsigned long __cil_tmp8 ;
511 unsigned long __cil_tmp9 ;
512 char const **__cil_tmp10 ;
513 char const **__cil_tmp11 ;
514 int *mem_12 ;
515 char const ***mem_13 ;
516
517 {
518#line 131
519 if (i > 0) {
520 {
521#line 131
522 __cil_tmp4 = (unsigned long )this;
523#line 131
524 __cil_tmp5 = __cil_tmp4 + 16;
525#line 131
526 mem_12 = (int *)__cil_tmp5;
527#line 131
528 __cil_tmp6 = *mem_12;
529#line 131
530 if (i <= __cil_tmp6) {
531
532 } else {
533 {
534#line 131
535 __assert_fail("i > 0 && i <= this->argsCount", "libacc.c",
536 131U, "__utac__get_this_argtype");
537 }
538 }
539 }
540 } else {
541 {
542#line 131
543 __assert_fail("i > 0 && i <= this->argsCount", "libacc.c",
544 131U, "__utac__get_this_argtype");
545 }
546 }
547#line 903 "libacc.c"
548 __cil_tmp7 = i - 1;
549#line 903
550 __cil_tmp8 = (unsigned long )this;
551#line 903
552 __cil_tmp9 = __cil_tmp8 + 24;
553#line 903
554 mem_13 = (char const ***)__cil_tmp9;
555#line 903
556 __cil_tmp10 = *mem_13;
557#line 903
558 __cil_tmp11 = __cil_tmp10 + __cil_tmp7;
559#line 903
560 retValue_acc = *__cil_tmp11;
561#line 905
562 return (retValue_acc);
563#line 912
564 return (retValue_acc);
565}
566}
567#line 1 "ClientLib.o"
568#pragma merger(0,"ClientLib.i","")
569#line 4 "ClientLib.h"
570int initClient(void) ;
571#line 6
572char *getClientName(int handle ) ;
573#line 8
574void setClientName(int handle , char *value ) ;
575#line 10
576int getClientOutbuffer(int handle ) ;
577#line 12
578void setClientOutbuffer(int handle , int value ) ;
579#line 14
580int getClientAddressBookSize(int handle ) ;
581#line 16
582void setClientAddressBookSize(int handle , int value ) ;
583#line 18
584int createClientAddressBookEntry(int handle ) ;
585#line 20
586int getClientAddressBookAlias(int handle , int index ) ;
587#line 22
588void setClientAddressBookAlias(int handle , int index , int value ) ;
589#line 24
590int getClientAddressBookAddress(int handle , int index ) ;
591#line 26
592void setClientAddressBookAddress(int handle , int index , int value ) ;
593#line 29
594int getClientAutoResponse(int handle ) ;
595#line 31
596void setClientAutoResponse(int handle , int value ) ;
597#line 33
598int getClientPrivateKey(int handle ) ;
599#line 35
600void setClientPrivateKey(int handle , int value ) ;
601#line 37
602int getClientKeyringSize(int handle ) ;
603#line 39
604int createClientKeyringEntry(int handle ) ;
605#line 41
606int getClientKeyringUser(int handle , int index ) ;
607#line 43
608void setClientKeyringUser(int handle , int index , int value ) ;
609#line 45
610int getClientKeyringPublicKey(int handle , int index ) ;
611#line 47
612void setClientKeyringPublicKey(int handle , int index , int value ) ;
613#line 49
614int getClientForwardReceiver(int handle ) ;
615#line 51
616void setClientForwardReceiver(int handle , int value ) ;
617#line 53
618int getClientId(int handle ) ;
619#line 55
620void setClientId(int handle , int value ) ;
621#line 57
622int findPublicKey(int handle , int userid ) ;
623#line 59
624int findClientAddressBookAlias(int handle , int userid ) ;
625#line 5 "ClientLib.c"
626int __ste_Client_counter = 0;
627#line 7 "ClientLib.c"
628int initClient(void)
629{ int retValue_acc ;
630
631 {
632#line 12 "ClientLib.c"
633 if (__ste_Client_counter < 3) {
634#line 684
635 __ste_Client_counter = __ste_Client_counter + 1;
636#line 684
637 retValue_acc = __ste_Client_counter;
638#line 686
639 return (retValue_acc);
640 } else {
641#line 692 "ClientLib.c"
642 retValue_acc = -1;
643#line 694
644 return (retValue_acc);
645 }
646#line 701 "ClientLib.c"
647 return (retValue_acc);
648}
649}
650#line 15 "ClientLib.c"
651char *__ste_client_name0 = (char *)0;
652#line 17 "ClientLib.c"
653char *__ste_client_name1 = (char *)0;
654#line 19 "ClientLib.c"
655char *__ste_client_name2 = (char *)0;
656#line 22 "ClientLib.c"
657char *getClientName(int handle )
658{ char *retValue_acc ;
659 void *__cil_tmp3 ;
660
661 {
662#line 31 "ClientLib.c"
663 if (handle == 1) {
664#line 732
665 retValue_acc = __ste_client_name0;
666#line 734
667 return (retValue_acc);
668 } else {
669#line 736
670 if (handle == 2) {
671#line 741
672 retValue_acc = __ste_client_name1;
673#line 743
674 return (retValue_acc);
675 } else {
676#line 745
677 if (handle == 3) {
678#line 750
679 retValue_acc = __ste_client_name2;
680#line 752
681 return (retValue_acc);
682 } else {
683#line 758 "ClientLib.c"
684 __cil_tmp3 = (void *)0;
685#line 758
686 retValue_acc = (char *)__cil_tmp3;
687#line 760
688 return (retValue_acc);
689 }
690 }
691 }
692#line 767 "ClientLib.c"
693 return (retValue_acc);
694}
695}
696#line 34 "ClientLib.c"
697void setClientName(int handle , char *value )
698{
699
700 {
701#line 42
702 if (handle == 1) {
703#line 36
704 __ste_client_name0 = value;
705 } else {
706#line 37
707 if (handle == 2) {
708#line 38
709 __ste_client_name1 = value;
710 } else {
711#line 39
712 if (handle == 3) {
713#line 40
714 __ste_client_name2 = value;
715 } else {
716
717 }
718 }
719 }
720#line 802 "ClientLib.c"
721 return;
722}
723}
724#line 44 "ClientLib.c"
725int __ste_client_outbuffer0 = 0;
726#line 46 "ClientLib.c"
727int __ste_client_outbuffer1 = 0;
728#line 48 "ClientLib.c"
729int __ste_client_outbuffer2 = 0;
730#line 50 "ClientLib.c"
731int __ste_client_outbuffer3 = 0;
732#line 53 "ClientLib.c"
733int getClientOutbuffer(int handle )
734{ int retValue_acc ;
735
736 {
737#line 62 "ClientLib.c"
738 if (handle == 1) {
739#line 831
740 retValue_acc = __ste_client_outbuffer0;
741#line 833
742 return (retValue_acc);
743 } else {
744#line 835
745 if (handle == 2) {
746#line 840
747 retValue_acc = __ste_client_outbuffer1;
748#line 842
749 return (retValue_acc);
750 } else {
751#line 844
752 if (handle == 3) {
753#line 849
754 retValue_acc = __ste_client_outbuffer2;
755#line 851
756 return (retValue_acc);
757 } else {
758#line 857 "ClientLib.c"
759 retValue_acc = 0;
760#line 859
761 return (retValue_acc);
762 }
763 }
764 }
765#line 866 "ClientLib.c"
766 return (retValue_acc);
767}
768}
769#line 65 "ClientLib.c"
770void setClientOutbuffer(int handle , int value )
771{
772
773 {
774#line 73
775 if (handle == 1) {
776#line 67
777 __ste_client_outbuffer0 = value;
778 } else {
779#line 68
780 if (handle == 2) {
781#line 69
782 __ste_client_outbuffer1 = value;
783 } else {
784#line 70
785 if (handle == 3) {
786#line 71
787 __ste_client_outbuffer2 = value;
788 } else {
789
790 }
791 }
792 }
793#line 901 "ClientLib.c"
794 return;
795}
796}
797#line 77 "ClientLib.c"
798int __ste_ClientAddressBook_size0 = 0;
799#line 79 "ClientLib.c"
800int __ste_ClientAddressBook_size1 = 0;
801#line 81 "ClientLib.c"
802int __ste_ClientAddressBook_size2 = 0;
803#line 84 "ClientLib.c"
804int getClientAddressBookSize(int handle )
805{ int retValue_acc ;
806
807 {
808#line 93 "ClientLib.c"
809 if (handle == 1) {
810#line 928
811 retValue_acc = __ste_ClientAddressBook_size0;
812#line 930
813 return (retValue_acc);
814 } else {
815#line 932
816 if (handle == 2) {
817#line 937
818 retValue_acc = __ste_ClientAddressBook_size1;
819#line 939
820 return (retValue_acc);
821 } else {
822#line 941
823 if (handle == 3) {
824#line 946
825 retValue_acc = __ste_ClientAddressBook_size2;
826#line 948
827 return (retValue_acc);
828 } else {
829#line 954 "ClientLib.c"
830 retValue_acc = 0;
831#line 956
832 return (retValue_acc);
833 }
834 }
835 }
836#line 963 "ClientLib.c"
837 return (retValue_acc);
838}
839}
840#line 96 "ClientLib.c"
841void setClientAddressBookSize(int handle , int value )
842{
843
844 {
845#line 104
846 if (handle == 1) {
847#line 98
848 __ste_ClientAddressBook_size0 = value;
849 } else {
850#line 99
851 if (handle == 2) {
852#line 100
853 __ste_ClientAddressBook_size1 = value;
854 } else {
855#line 101
856 if (handle == 3) {
857#line 102
858 __ste_ClientAddressBook_size2 = value;
859 } else {
860
861 }
862 }
863 }
864#line 998 "ClientLib.c"
865 return;
866}
867}
868#line 106 "ClientLib.c"
869int createClientAddressBookEntry(int handle )
870{ int retValue_acc ;
871 int size ;
872 int tmp ;
873 int __cil_tmp5 ;
874
875 {
876 {
877#line 107
878 tmp = getClientAddressBookSize(handle);
879#line 107
880 size = tmp;
881 }
882#line 108 "ClientLib.c"
883 if (size < 3) {
884 {
885#line 109 "ClientLib.c"
886 __cil_tmp5 = size + 1;
887#line 109
888 setClientAddressBookSize(handle, __cil_tmp5);
889#line 1025 "ClientLib.c"
890 retValue_acc = size + 1;
891 }
892#line 1027
893 return (retValue_acc);
894 } else {
895#line 1031 "ClientLib.c"
896 retValue_acc = -1;
897#line 1033
898 return (retValue_acc);
899 }
900#line 1040 "ClientLib.c"
901 return (retValue_acc);
902}
903}
904#line 115 "ClientLib.c"
905int __ste_Client_AddressBook0_Alias0 = 0;
906#line 117 "ClientLib.c"
907int __ste_Client_AddressBook0_Alias1 = 0;
908#line 119 "ClientLib.c"
909int __ste_Client_AddressBook0_Alias2 = 0;
910#line 121 "ClientLib.c"
911int __ste_Client_AddressBook1_Alias0 = 0;
912#line 123 "ClientLib.c"
913int __ste_Client_AddressBook1_Alias1 = 0;
914#line 125 "ClientLib.c"
915int __ste_Client_AddressBook1_Alias2 = 0;
916#line 127 "ClientLib.c"
917int __ste_Client_AddressBook2_Alias0 = 0;
918#line 129 "ClientLib.c"
919int __ste_Client_AddressBook2_Alias1 = 0;
920#line 131 "ClientLib.c"
921int __ste_Client_AddressBook2_Alias2 = 0;
922#line 134 "ClientLib.c"
923int getClientAddressBookAlias(int handle , int index )
924{ int retValue_acc ;
925
926 {
927#line 167
928 if (handle == 1) {
929#line 144 "ClientLib.c"
930 if (index == 0) {
931#line 1086
932 retValue_acc = __ste_Client_AddressBook0_Alias0;
933#line 1088
934 return (retValue_acc);
935 } else {
936#line 1090
937 if (index == 1) {
938#line 1095
939 retValue_acc = __ste_Client_AddressBook0_Alias1;
940#line 1097
941 return (retValue_acc);
942 } else {
943#line 1099
944 if (index == 2) {
945#line 1104
946 retValue_acc = __ste_Client_AddressBook0_Alias2;
947#line 1106
948 return (retValue_acc);
949 } else {
950#line 1112
951 retValue_acc = 0;
952#line 1114
953 return (retValue_acc);
954 }
955 }
956 }
957 } else {
958#line 1116 "ClientLib.c"
959 if (handle == 2) {
960#line 154 "ClientLib.c"
961 if (index == 0) {
962#line 1124
963 retValue_acc = __ste_Client_AddressBook1_Alias0;
964#line 1126
965 return (retValue_acc);
966 } else {
967#line 1128
968 if (index == 1) {
969#line 1133
970 retValue_acc = __ste_Client_AddressBook1_Alias1;
971#line 1135
972 return (retValue_acc);
973 } else {
974#line 1137
975 if (index == 2) {
976#line 1142
977 retValue_acc = __ste_Client_AddressBook1_Alias2;
978#line 1144
979 return (retValue_acc);
980 } else {
981#line 1150
982 retValue_acc = 0;
983#line 1152
984 return (retValue_acc);
985 }
986 }
987 }
988 } else {
989#line 1154 "ClientLib.c"
990 if (handle == 3) {
991#line 164 "ClientLib.c"
992 if (index == 0) {
993#line 1162
994 retValue_acc = __ste_Client_AddressBook2_Alias0;
995#line 1164
996 return (retValue_acc);
997 } else {
998#line 1166
999 if (index == 1) {
1000#line 1171
1001 retValue_acc = __ste_Client_AddressBook2_Alias1;
1002#line 1173
1003 return (retValue_acc);
1004 } else {
1005#line 1175
1006 if (index == 2) {
1007#line 1180
1008 retValue_acc = __ste_Client_AddressBook2_Alias2;
1009#line 1182
1010 return (retValue_acc);
1011 } else {
1012#line 1188
1013 retValue_acc = 0;
1014#line 1190
1015 return (retValue_acc);
1016 }
1017 }
1018 }
1019 } else {
1020#line 1196 "ClientLib.c"
1021 retValue_acc = 0;
1022#line 1198
1023 return (retValue_acc);
1024 }
1025 }
1026 }
1027#line 1205 "ClientLib.c"
1028 return (retValue_acc);
1029}
1030}
1031#line 171 "ClientLib.c"
1032int findClientAddressBookAlias(int handle , int userid )
1033{ int retValue_acc ;
1034
1035 {
1036#line 204
1037 if (handle == 1) {
1038#line 181 "ClientLib.c"
1039 if (userid == __ste_Client_AddressBook0_Alias0) {
1040#line 1233
1041 retValue_acc = 0;
1042#line 1235
1043 return (retValue_acc);
1044 } else {
1045#line 1237
1046 if (userid == __ste_Client_AddressBook0_Alias1) {
1047#line 1242
1048 retValue_acc = 1;
1049#line 1244
1050 return (retValue_acc);
1051 } else {
1052#line 1246
1053 if (userid == __ste_Client_AddressBook0_Alias2) {
1054#line 1251
1055 retValue_acc = 2;
1056#line 1253
1057 return (retValue_acc);
1058 } else {
1059#line 1259
1060 retValue_acc = -1;
1061#line 1261
1062 return (retValue_acc);
1063 }
1064 }
1065 }
1066 } else {
1067#line 1263 "ClientLib.c"
1068 if (handle == 2) {
1069#line 191 "ClientLib.c"
1070 if (userid == __ste_Client_AddressBook1_Alias0) {
1071#line 1271
1072 retValue_acc = 0;
1073#line 1273
1074 return (retValue_acc);
1075 } else {
1076#line 1275
1077 if (userid == __ste_Client_AddressBook1_Alias1) {
1078#line 1280
1079 retValue_acc = 1;
1080#line 1282
1081 return (retValue_acc);
1082 } else {
1083#line 1284
1084 if (userid == __ste_Client_AddressBook1_Alias2) {
1085#line 1289
1086 retValue_acc = 2;
1087#line 1291
1088 return (retValue_acc);
1089 } else {
1090#line 1297
1091 retValue_acc = -1;
1092#line 1299
1093 return (retValue_acc);
1094 }
1095 }
1096 }
1097 } else {
1098#line 1301 "ClientLib.c"
1099 if (handle == 3) {
1100#line 201 "ClientLib.c"
1101 if (userid == __ste_Client_AddressBook2_Alias0) {
1102#line 1309
1103 retValue_acc = 0;
1104#line 1311
1105 return (retValue_acc);
1106 } else {
1107#line 1313
1108 if (userid == __ste_Client_AddressBook2_Alias1) {
1109#line 1318
1110 retValue_acc = 1;
1111#line 1320
1112 return (retValue_acc);
1113 } else {
1114#line 1322
1115 if (userid == __ste_Client_AddressBook2_Alias2) {
1116#line 1327
1117 retValue_acc = 2;
1118#line 1329
1119 return (retValue_acc);
1120 } else {
1121#line 1335
1122 retValue_acc = -1;
1123#line 1337
1124 return (retValue_acc);
1125 }
1126 }
1127 }
1128 } else {
1129#line 1343 "ClientLib.c"
1130 retValue_acc = -1;
1131#line 1345
1132 return (retValue_acc);
1133 }
1134 }
1135 }
1136#line 1352 "ClientLib.c"
1137 return (retValue_acc);
1138}
1139}
1140#line 208 "ClientLib.c"
1141void setClientAddressBookAlias(int handle , int index , int value )
1142{
1143
1144 {
1145#line 234
1146 if (handle == 1) {
1147#line 217
1148 if (index == 0) {
1149#line 211
1150 __ste_Client_AddressBook0_Alias0 = value;
1151 } else {
1152#line 212
1153 if (index == 1) {
1154#line 213
1155 __ste_Client_AddressBook0_Alias1 = value;
1156 } else {
1157#line 214
1158 if (index == 2) {
1159#line 215
1160 __ste_Client_AddressBook0_Alias2 = value;
1161 } else {
1162
1163 }
1164 }
1165 }
1166 } else {
1167#line 216
1168 if (handle == 2) {
1169#line 225
1170 if (index == 0) {
1171#line 219
1172 __ste_Client_AddressBook1_Alias0 = value;
1173 } else {
1174#line 220
1175 if (index == 1) {
1176#line 221
1177 __ste_Client_AddressBook1_Alias1 = value;
1178 } else {
1179#line 222
1180 if (index == 2) {
1181#line 223
1182 __ste_Client_AddressBook1_Alias2 = value;
1183 } else {
1184
1185 }
1186 }
1187 }
1188 } else {
1189#line 224
1190 if (handle == 3) {
1191#line 233
1192 if (index == 0) {
1193#line 227
1194 __ste_Client_AddressBook2_Alias0 = value;
1195 } else {
1196#line 228
1197 if (index == 1) {
1198#line 229
1199 __ste_Client_AddressBook2_Alias1 = value;
1200 } else {
1201#line 230
1202 if (index == 2) {
1203#line 231
1204 __ste_Client_AddressBook2_Alias2 = value;
1205 } else {
1206
1207 }
1208 }
1209 }
1210 } else {
1211
1212 }
1213 }
1214 }
1215#line 1420 "ClientLib.c"
1216 return;
1217}
1218}
1219#line 236 "ClientLib.c"
1220int __ste_Client_AddressBook0_Address0 = 0;
1221#line 238 "ClientLib.c"
1222int __ste_Client_AddressBook0_Address1 = 0;
1223#line 240 "ClientLib.c"
1224int __ste_Client_AddressBook0_Address2 = 0;
1225#line 242 "ClientLib.c"
1226int __ste_Client_AddressBook1_Address0 = 0;
1227#line 244 "ClientLib.c"
1228int __ste_Client_AddressBook1_Address1 = 0;
1229#line 246 "ClientLib.c"
1230int __ste_Client_AddressBook1_Address2 = 0;
1231#line 248 "ClientLib.c"
1232int __ste_Client_AddressBook2_Address0 = 0;
1233#line 250 "ClientLib.c"
1234int __ste_Client_AddressBook2_Address1 = 0;
1235#line 252 "ClientLib.c"
1236int __ste_Client_AddressBook2_Address2 = 0;
1237#line 255 "ClientLib.c"
1238int getClientAddressBookAddress(int handle , int index )
1239{ int retValue_acc ;
1240
1241 {
1242#line 288
1243 if (handle == 1) {
1244#line 265 "ClientLib.c"
1245 if (index == 0) {
1246#line 1462
1247 retValue_acc = __ste_Client_AddressBook0_Address0;
1248#line 1464
1249 return (retValue_acc);
1250 } else {
1251#line 1466
1252 if (index == 1) {
1253#line 1471
1254 retValue_acc = __ste_Client_AddressBook0_Address1;
1255#line 1473
1256 return (retValue_acc);
1257 } else {
1258#line 1475
1259 if (index == 2) {
1260#line 1480
1261 retValue_acc = __ste_Client_AddressBook0_Address2;
1262#line 1482
1263 return (retValue_acc);
1264 } else {
1265#line 1488
1266 retValue_acc = 0;
1267#line 1490
1268 return (retValue_acc);
1269 }
1270 }
1271 }
1272 } else {
1273#line 1492 "ClientLib.c"
1274 if (handle == 2) {
1275#line 275 "ClientLib.c"
1276 if (index == 0) {
1277#line 1500
1278 retValue_acc = __ste_Client_AddressBook1_Address0;
1279#line 1502
1280 return (retValue_acc);
1281 } else {
1282#line 1504
1283 if (index == 1) {
1284#line 1509
1285 retValue_acc = __ste_Client_AddressBook1_Address1;
1286#line 1511
1287 return (retValue_acc);
1288 } else {
1289#line 1513
1290 if (index == 2) {
1291#line 1518
1292 retValue_acc = __ste_Client_AddressBook1_Address2;
1293#line 1520
1294 return (retValue_acc);
1295 } else {
1296#line 1526
1297 retValue_acc = 0;
1298#line 1528
1299 return (retValue_acc);
1300 }
1301 }
1302 }
1303 } else {
1304#line 1530 "ClientLib.c"
1305 if (handle == 3) {
1306#line 285 "ClientLib.c"
1307 if (index == 0) {
1308#line 1538
1309 retValue_acc = __ste_Client_AddressBook2_Address0;
1310#line 1540
1311 return (retValue_acc);
1312 } else {
1313#line 1542
1314 if (index == 1) {
1315#line 1547
1316 retValue_acc = __ste_Client_AddressBook2_Address1;
1317#line 1549
1318 return (retValue_acc);
1319 } else {
1320#line 1551
1321 if (index == 2) {
1322#line 1556
1323 retValue_acc = __ste_Client_AddressBook2_Address2;
1324#line 1558
1325 return (retValue_acc);
1326 } else {
1327#line 1564
1328 retValue_acc = 0;
1329#line 1566
1330 return (retValue_acc);
1331 }
1332 }
1333 }
1334 } else {
1335#line 1572 "ClientLib.c"
1336 retValue_acc = 0;
1337#line 1574
1338 return (retValue_acc);
1339 }
1340 }
1341 }
1342#line 1581 "ClientLib.c"
1343 return (retValue_acc);
1344}
1345}
1346#line 291 "ClientLib.c"
1347void setClientAddressBookAddress(int handle , int index , int value )
1348{
1349
1350 {
1351#line 317
1352 if (handle == 1) {
1353#line 300
1354 if (index == 0) {
1355#line 294
1356 __ste_Client_AddressBook0_Address0 = value;
1357 } else {
1358#line 295
1359 if (index == 1) {
1360#line 296
1361 __ste_Client_AddressBook0_Address1 = value;
1362 } else {
1363#line 297
1364 if (index == 2) {
1365#line 298
1366 __ste_Client_AddressBook0_Address2 = value;
1367 } else {
1368
1369 }
1370 }
1371 }
1372 } else {
1373#line 299
1374 if (handle == 2) {
1375#line 308
1376 if (index == 0) {
1377#line 302
1378 __ste_Client_AddressBook1_Address0 = value;
1379 } else {
1380#line 303
1381 if (index == 1) {
1382#line 304
1383 __ste_Client_AddressBook1_Address1 = value;
1384 } else {
1385#line 305
1386 if (index == 2) {
1387#line 306
1388 __ste_Client_AddressBook1_Address2 = value;
1389 } else {
1390
1391 }
1392 }
1393 }
1394 } else {
1395#line 307
1396 if (handle == 3) {
1397#line 316
1398 if (index == 0) {
1399#line 310
1400 __ste_Client_AddressBook2_Address0 = value;
1401 } else {
1402#line 311
1403 if (index == 1) {
1404#line 312
1405 __ste_Client_AddressBook2_Address1 = value;
1406 } else {
1407#line 313
1408 if (index == 2) {
1409#line 314
1410 __ste_Client_AddressBook2_Address2 = value;
1411 } else {
1412
1413 }
1414 }
1415 }
1416 } else {
1417
1418 }
1419 }
1420 }
1421#line 1649 "ClientLib.c"
1422 return;
1423}
1424}
1425#line 319 "ClientLib.c"
1426int __ste_client_autoResponse0 = 0;
1427#line 321 "ClientLib.c"
1428int __ste_client_autoResponse1 = 0;
1429#line 323 "ClientLib.c"
1430int __ste_client_autoResponse2 = 0;
1431#line 326 "ClientLib.c"
1432int getClientAutoResponse(int handle )
1433{ int retValue_acc ;
1434
1435 {
1436#line 335 "ClientLib.c"
1437 if (handle == 1) {
1438#line 1676
1439 retValue_acc = __ste_client_autoResponse0;
1440#line 1678
1441 return (retValue_acc);
1442 } else {
1443#line 1680
1444 if (handle == 2) {
1445#line 1685
1446 retValue_acc = __ste_client_autoResponse1;
1447#line 1687
1448 return (retValue_acc);
1449 } else {
1450#line 1689
1451 if (handle == 3) {
1452#line 1694
1453 retValue_acc = __ste_client_autoResponse2;
1454#line 1696
1455 return (retValue_acc);
1456 } else {
1457#line 1702 "ClientLib.c"
1458 retValue_acc = -1;
1459#line 1704
1460 return (retValue_acc);
1461 }
1462 }
1463 }
1464#line 1711 "ClientLib.c"
1465 return (retValue_acc);
1466}
1467}
1468#line 338 "ClientLib.c"
1469void setClientAutoResponse(int handle , int value )
1470{
1471
1472 {
1473#line 346
1474 if (handle == 1) {
1475#line 340
1476 __ste_client_autoResponse0 = value;
1477 } else {
1478#line 341
1479 if (handle == 2) {
1480#line 342
1481 __ste_client_autoResponse1 = value;
1482 } else {
1483#line 343
1484 if (handle == 3) {
1485#line 344
1486 __ste_client_autoResponse2 = value;
1487 } else {
1488
1489 }
1490 }
1491 }
1492#line 1746 "ClientLib.c"
1493 return;
1494}
1495}
1496#line 348 "ClientLib.c"
1497int __ste_client_privateKey0 = 0;
1498#line 350 "ClientLib.c"
1499int __ste_client_privateKey1 = 0;
1500#line 352 "ClientLib.c"
1501int __ste_client_privateKey2 = 0;
1502#line 355 "ClientLib.c"
1503int getClientPrivateKey(int handle )
1504{ int retValue_acc ;
1505
1506 {
1507#line 364 "ClientLib.c"
1508 if (handle == 1) {
1509#line 1773
1510 retValue_acc = __ste_client_privateKey0;
1511#line 1775
1512 return (retValue_acc);
1513 } else {
1514#line 1777
1515 if (handle == 2) {
1516#line 1782
1517 retValue_acc = __ste_client_privateKey1;
1518#line 1784
1519 return (retValue_acc);
1520 } else {
1521#line 1786
1522 if (handle == 3) {
1523#line 1791
1524 retValue_acc = __ste_client_privateKey2;
1525#line 1793
1526 return (retValue_acc);
1527 } else {
1528#line 1799 "ClientLib.c"
1529 retValue_acc = 0;
1530#line 1801
1531 return (retValue_acc);
1532 }
1533 }
1534 }
1535#line 1808 "ClientLib.c"
1536 return (retValue_acc);
1537}
1538}
1539#line 367 "ClientLib.c"
1540void setClientPrivateKey(int handle , int value )
1541{
1542
1543 {
1544#line 375
1545 if (handle == 1) {
1546#line 369
1547 __ste_client_privateKey0 = value;
1548 } else {
1549#line 370
1550 if (handle == 2) {
1551#line 371
1552 __ste_client_privateKey1 = value;
1553 } else {
1554#line 372
1555 if (handle == 3) {
1556#line 373
1557 __ste_client_privateKey2 = value;
1558 } else {
1559
1560 }
1561 }
1562 }
1563#line 1843 "ClientLib.c"
1564 return;
1565}
1566}
1567#line 377 "ClientLib.c"
1568int __ste_ClientKeyring_size0 = 0;
1569#line 379 "ClientLib.c"
1570int __ste_ClientKeyring_size1 = 0;
1571#line 381 "ClientLib.c"
1572int __ste_ClientKeyring_size2 = 0;
1573#line 384 "ClientLib.c"
1574int getClientKeyringSize(int handle )
1575{ int retValue_acc ;
1576
1577 {
1578#line 393 "ClientLib.c"
1579 if (handle == 1) {
1580#line 1870
1581 retValue_acc = __ste_ClientKeyring_size0;
1582#line 1872
1583 return (retValue_acc);
1584 } else {
1585#line 1874
1586 if (handle == 2) {
1587#line 1879
1588 retValue_acc = __ste_ClientKeyring_size1;
1589#line 1881
1590 return (retValue_acc);
1591 } else {
1592#line 1883
1593 if (handle == 3) {
1594#line 1888
1595 retValue_acc = __ste_ClientKeyring_size2;
1596#line 1890
1597 return (retValue_acc);
1598 } else {
1599#line 1896 "ClientLib.c"
1600 retValue_acc = 0;
1601#line 1898
1602 return (retValue_acc);
1603 }
1604 }
1605 }
1606#line 1905 "ClientLib.c"
1607 return (retValue_acc);
1608}
1609}
1610#line 396 "ClientLib.c"
1611void setClientKeyringSize(int handle , int value )
1612{
1613
1614 {
1615#line 404
1616 if (handle == 1) {
1617#line 398
1618 __ste_ClientKeyring_size0 = value;
1619 } else {
1620#line 399
1621 if (handle == 2) {
1622#line 400
1623 __ste_ClientKeyring_size1 = value;
1624 } else {
1625#line 401
1626 if (handle == 3) {
1627#line 402
1628 __ste_ClientKeyring_size2 = value;
1629 } else {
1630
1631 }
1632 }
1633 }
1634#line 1940 "ClientLib.c"
1635 return;
1636}
1637}
1638#line 406 "ClientLib.c"
1639int createClientKeyringEntry(int handle )
1640{ int retValue_acc ;
1641 int size ;
1642 int tmp ;
1643 int __cil_tmp5 ;
1644
1645 {
1646 {
1647#line 407
1648 tmp = getClientKeyringSize(handle);
1649#line 407
1650 size = tmp;
1651 }
1652#line 408 "ClientLib.c"
1653 if (size < 2) {
1654 {
1655#line 409 "ClientLib.c"
1656 __cil_tmp5 = size + 1;
1657#line 409
1658 setClientKeyringSize(handle, __cil_tmp5);
1659#line 1967 "ClientLib.c"
1660 retValue_acc = size + 1;
1661 }
1662#line 1969
1663 return (retValue_acc);
1664 } else {
1665#line 1973 "ClientLib.c"
1666 retValue_acc = -1;
1667#line 1975
1668 return (retValue_acc);
1669 }
1670#line 1982 "ClientLib.c"
1671 return (retValue_acc);
1672}
1673}
1674#line 414 "ClientLib.c"
1675int __ste_Client_Keyring0_User0 = 0;
1676#line 416 "ClientLib.c"
1677int __ste_Client_Keyring0_User1 = 0;
1678#line 418 "ClientLib.c"
1679int __ste_Client_Keyring0_User2 = 0;
1680#line 420 "ClientLib.c"
1681int __ste_Client_Keyring1_User0 = 0;
1682#line 422 "ClientLib.c"
1683int __ste_Client_Keyring1_User1 = 0;
1684#line 424 "ClientLib.c"
1685int __ste_Client_Keyring1_User2 = 0;
1686#line 426 "ClientLib.c"
1687int __ste_Client_Keyring2_User0 = 0;
1688#line 428 "ClientLib.c"
1689int __ste_Client_Keyring2_User1 = 0;
1690#line 430 "ClientLib.c"
1691int __ste_Client_Keyring2_User2 = 0;
1692#line 433 "ClientLib.c"
1693int getClientKeyringUser(int handle , int index )
1694{ int retValue_acc ;
1695
1696 {
1697#line 466
1698 if (handle == 1) {
1699#line 443 "ClientLib.c"
1700 if (index == 0) {
1701#line 2028
1702 retValue_acc = __ste_Client_Keyring0_User0;
1703#line 2030
1704 return (retValue_acc);
1705 } else {
1706#line 2032
1707 if (index == 1) {
1708#line 2037
1709 retValue_acc = __ste_Client_Keyring0_User1;
1710#line 2039
1711 return (retValue_acc);
1712 } else {
1713#line 2045
1714 retValue_acc = 0;
1715#line 2047
1716 return (retValue_acc);
1717 }
1718 }
1719 } else {
1720#line 2049 "ClientLib.c"
1721 if (handle == 2) {
1722#line 453 "ClientLib.c"
1723 if (index == 0) {
1724#line 2057
1725 retValue_acc = __ste_Client_Keyring1_User0;
1726#line 2059
1727 return (retValue_acc);
1728 } else {
1729#line 2061
1730 if (index == 1) {
1731#line 2066
1732 retValue_acc = __ste_Client_Keyring1_User1;
1733#line 2068
1734 return (retValue_acc);
1735 } else {
1736#line 2074
1737 retValue_acc = 0;
1738#line 2076
1739 return (retValue_acc);
1740 }
1741 }
1742 } else {
1743#line 2078 "ClientLib.c"
1744 if (handle == 3) {
1745#line 463 "ClientLib.c"
1746 if (index == 0) {
1747#line 2086
1748 retValue_acc = __ste_Client_Keyring2_User0;
1749#line 2088
1750 return (retValue_acc);
1751 } else {
1752#line 2090
1753 if (index == 1) {
1754#line 2095
1755 retValue_acc = __ste_Client_Keyring2_User1;
1756#line 2097
1757 return (retValue_acc);
1758 } else {
1759#line 2103
1760 retValue_acc = 0;
1761#line 2105
1762 return (retValue_acc);
1763 }
1764 }
1765 } else {
1766#line 2111 "ClientLib.c"
1767 retValue_acc = 0;
1768#line 2113
1769 return (retValue_acc);
1770 }
1771 }
1772 }
1773#line 2120 "ClientLib.c"
1774 return (retValue_acc);
1775}
1776}
1777#line 473 "ClientLib.c"
1778void setClientKeyringUser(int handle , int index , int value )
1779{
1780
1781 {
1782#line 499
1783 if (handle == 1) {
1784#line 482
1785 if (index == 0) {
1786#line 476
1787 __ste_Client_Keyring0_User0 = value;
1788 } else {
1789#line 477
1790 if (index == 1) {
1791#line 478
1792 __ste_Client_Keyring0_User1 = value;
1793 } else {
1794
1795 }
1796 }
1797 } else {
1798#line 479
1799 if (handle == 2) {
1800#line 490
1801 if (index == 0) {
1802#line 484
1803 __ste_Client_Keyring1_User0 = value;
1804 } else {
1805#line 485
1806 if (index == 1) {
1807#line 486
1808 __ste_Client_Keyring1_User1 = value;
1809 } else {
1810
1811 }
1812 }
1813 } else {
1814#line 487
1815 if (handle == 3) {
1816#line 498
1817 if (index == 0) {
1818#line 492
1819 __ste_Client_Keyring2_User0 = value;
1820 } else {
1821#line 493
1822 if (index == 1) {
1823#line 494
1824 __ste_Client_Keyring2_User1 = value;
1825 } else {
1826
1827 }
1828 }
1829 } else {
1830
1831 }
1832 }
1833 }
1834#line 2176 "ClientLib.c"
1835 return;
1836}
1837}
1838#line 501 "ClientLib.c"
1839int __ste_Client_Keyring0_PublicKey0 = 0;
1840#line 503 "ClientLib.c"
1841int __ste_Client_Keyring0_PublicKey1 = 0;
1842#line 505 "ClientLib.c"
1843int __ste_Client_Keyring0_PublicKey2 = 0;
1844#line 507 "ClientLib.c"
1845int __ste_Client_Keyring1_PublicKey0 = 0;
1846#line 509 "ClientLib.c"
1847int __ste_Client_Keyring1_PublicKey1 = 0;
1848#line 511 "ClientLib.c"
1849int __ste_Client_Keyring1_PublicKey2 = 0;
1850#line 513 "ClientLib.c"
1851int __ste_Client_Keyring2_PublicKey0 = 0;
1852#line 515 "ClientLib.c"
1853int __ste_Client_Keyring2_PublicKey1 = 0;
1854#line 517 "ClientLib.c"
1855int __ste_Client_Keyring2_PublicKey2 = 0;
1856#line 520 "ClientLib.c"
1857int getClientKeyringPublicKey(int handle , int index )
1858{ int retValue_acc ;
1859
1860 {
1861#line 553
1862 if (handle == 1) {
1863#line 530 "ClientLib.c"
1864 if (index == 0) {
1865#line 2218
1866 retValue_acc = __ste_Client_Keyring0_PublicKey0;
1867#line 2220
1868 return (retValue_acc);
1869 } else {
1870#line 2222
1871 if (index == 1) {
1872#line 2227
1873 retValue_acc = __ste_Client_Keyring0_PublicKey1;
1874#line 2229
1875 return (retValue_acc);
1876 } else {
1877#line 2235
1878 retValue_acc = 0;
1879#line 2237
1880 return (retValue_acc);
1881 }
1882 }
1883 } else {
1884#line 2239 "ClientLib.c"
1885 if (handle == 2) {
1886#line 540 "ClientLib.c"
1887 if (index == 0) {
1888#line 2247
1889 retValue_acc = __ste_Client_Keyring1_PublicKey0;
1890#line 2249
1891 return (retValue_acc);
1892 } else {
1893#line 2251
1894 if (index == 1) {
1895#line 2256
1896 retValue_acc = __ste_Client_Keyring1_PublicKey1;
1897#line 2258
1898 return (retValue_acc);
1899 } else {
1900#line 2264
1901 retValue_acc = 0;
1902#line 2266
1903 return (retValue_acc);
1904 }
1905 }
1906 } else {
1907#line 2268 "ClientLib.c"
1908 if (handle == 3) {
1909#line 550 "ClientLib.c"
1910 if (index == 0) {
1911#line 2276
1912 retValue_acc = __ste_Client_Keyring2_PublicKey0;
1913#line 2278
1914 return (retValue_acc);
1915 } else {
1916#line 2280
1917 if (index == 1) {
1918#line 2285
1919 retValue_acc = __ste_Client_Keyring2_PublicKey1;
1920#line 2287
1921 return (retValue_acc);
1922 } else {
1923#line 2293
1924 retValue_acc = 0;
1925#line 2295
1926 return (retValue_acc);
1927 }
1928 }
1929 } else {
1930#line 2301 "ClientLib.c"
1931 retValue_acc = 0;
1932#line 2303
1933 return (retValue_acc);
1934 }
1935 }
1936 }
1937#line 2310 "ClientLib.c"
1938 return (retValue_acc);
1939}
1940}
1941#line 557 "ClientLib.c"
1942int findPublicKey(int handle , int userid )
1943{ int retValue_acc ;
1944
1945 {
1946#line 591
1947 if (handle == 1) {
1948#line 568 "ClientLib.c"
1949 if (userid == __ste_Client_Keyring0_User0) {
1950#line 2338
1951 retValue_acc = __ste_Client_Keyring0_PublicKey0;
1952#line 2340
1953 return (retValue_acc);
1954 } else {
1955#line 2342
1956 if (userid == __ste_Client_Keyring0_User1) {
1957#line 2347
1958 retValue_acc = __ste_Client_Keyring0_PublicKey1;
1959#line 2349
1960 return (retValue_acc);
1961 } else {
1962#line 2355
1963 retValue_acc = 0;
1964#line 2357
1965 return (retValue_acc);
1966 }
1967 }
1968 } else {
1969#line 2359 "ClientLib.c"
1970 if (handle == 2) {
1971#line 578 "ClientLib.c"
1972 if (userid == __ste_Client_Keyring1_User0) {
1973#line 2367
1974 retValue_acc = __ste_Client_Keyring1_PublicKey0;
1975#line 2369
1976 return (retValue_acc);
1977 } else {
1978#line 2371
1979 if (userid == __ste_Client_Keyring1_User1) {
1980#line 2376
1981 retValue_acc = __ste_Client_Keyring1_PublicKey1;
1982#line 2378
1983 return (retValue_acc);
1984 } else {
1985#line 2384
1986 retValue_acc = 0;
1987#line 2386
1988 return (retValue_acc);
1989 }
1990 }
1991 } else {
1992#line 2388 "ClientLib.c"
1993 if (handle == 3) {
1994#line 588 "ClientLib.c"
1995 if (userid == __ste_Client_Keyring2_User0) {
1996#line 2396
1997 retValue_acc = __ste_Client_Keyring2_PublicKey0;
1998#line 2398
1999 return (retValue_acc);
2000 } else {
2001#line 2400
2002 if (userid == __ste_Client_Keyring2_User1) {
2003#line 2405
2004 retValue_acc = __ste_Client_Keyring2_PublicKey1;
2005#line 2407
2006 return (retValue_acc);
2007 } else {
2008#line 2413
2009 retValue_acc = 0;
2010#line 2415
2011 return (retValue_acc);
2012 }
2013 }
2014 } else {
2015#line 2421 "ClientLib.c"
2016 retValue_acc = 0;
2017#line 2423
2018 return (retValue_acc);
2019 }
2020 }
2021 }
2022#line 2430 "ClientLib.c"
2023 return (retValue_acc);
2024}
2025}
2026#line 595 "ClientLib.c"
2027void setClientKeyringPublicKey(int handle , int index , int value )
2028{
2029
2030 {
2031#line 621
2032 if (handle == 1) {
2033#line 604
2034 if (index == 0) {
2035#line 598
2036 __ste_Client_Keyring0_PublicKey0 = value;
2037 } else {
2038#line 599
2039 if (index == 1) {
2040#line 600
2041 __ste_Client_Keyring0_PublicKey1 = value;
2042 } else {
2043
2044 }
2045 }
2046 } else {
2047#line 601
2048 if (handle == 2) {
2049#line 612
2050 if (index == 0) {
2051#line 606
2052 __ste_Client_Keyring1_PublicKey0 = value;
2053 } else {
2054#line 607
2055 if (index == 1) {
2056#line 608
2057 __ste_Client_Keyring1_PublicKey1 = value;
2058 } else {
2059
2060 }
2061 }
2062 } else {
2063#line 609
2064 if (handle == 3) {
2065#line 620
2066 if (index == 0) {
2067#line 614
2068 __ste_Client_Keyring2_PublicKey0 = value;
2069 } else {
2070#line 615
2071 if (index == 1) {
2072#line 616
2073 __ste_Client_Keyring2_PublicKey1 = value;
2074 } else {
2075
2076 }
2077 }
2078 } else {
2079
2080 }
2081 }
2082 }
2083#line 2486 "ClientLib.c"
2084 return;
2085}
2086}
2087#line 623 "ClientLib.c"
2088int __ste_client_forwardReceiver0 = 0;
2089#line 625 "ClientLib.c"
2090int __ste_client_forwardReceiver1 = 0;
2091#line 627 "ClientLib.c"
2092int __ste_client_forwardReceiver2 = 0;
2093#line 629 "ClientLib.c"
2094int __ste_client_forwardReceiver3 = 0;
2095#line 631 "ClientLib.c"
2096int getClientForwardReceiver(int handle )
2097{ int retValue_acc ;
2098
2099 {
2100#line 640 "ClientLib.c"
2101 if (handle == 1) {
2102#line 2515
2103 retValue_acc = __ste_client_forwardReceiver0;
2104#line 2517
2105 return (retValue_acc);
2106 } else {
2107#line 2519
2108 if (handle == 2) {
2109#line 2524
2110 retValue_acc = __ste_client_forwardReceiver1;
2111#line 2526
2112 return (retValue_acc);
2113 } else {
2114#line 2528
2115 if (handle == 3) {
2116#line 2533
2117 retValue_acc = __ste_client_forwardReceiver2;
2118#line 2535
2119 return (retValue_acc);
2120 } else {
2121#line 2541 "ClientLib.c"
2122 retValue_acc = 0;
2123#line 2543
2124 return (retValue_acc);
2125 }
2126 }
2127 }
2128#line 2550 "ClientLib.c"
2129 return (retValue_acc);
2130}
2131}
2132#line 643 "ClientLib.c"
2133void setClientForwardReceiver(int handle , int value )
2134{
2135
2136 {
2137#line 651
2138 if (handle == 1) {
2139#line 645
2140 __ste_client_forwardReceiver0 = value;
2141 } else {
2142#line 646
2143 if (handle == 2) {
2144#line 647
2145 __ste_client_forwardReceiver1 = value;
2146 } else {
2147#line 648
2148 if (handle == 3) {
2149#line 649
2150 __ste_client_forwardReceiver2 = value;
2151 } else {
2152
2153 }
2154 }
2155 }
2156#line 2585 "ClientLib.c"
2157 return;
2158}
2159}
2160#line 653 "ClientLib.c"
2161int __ste_client_idCounter0 = 0;
2162#line 655 "ClientLib.c"
2163int __ste_client_idCounter1 = 0;
2164#line 657 "ClientLib.c"
2165int __ste_client_idCounter2 = 0;
2166#line 660 "ClientLib.c"
2167int getClientId(int handle )
2168{ int retValue_acc ;
2169
2170 {
2171#line 669 "ClientLib.c"
2172 if (handle == 1) {
2173#line 2612
2174 retValue_acc = __ste_client_idCounter0;
2175#line 2614
2176 return (retValue_acc);
2177 } else {
2178#line 2616
2179 if (handle == 2) {
2180#line 2621
2181 retValue_acc = __ste_client_idCounter1;
2182#line 2623
2183 return (retValue_acc);
2184 } else {
2185#line 2625
2186 if (handle == 3) {
2187#line 2630
2188 retValue_acc = __ste_client_idCounter2;
2189#line 2632
2190 return (retValue_acc);
2191 } else {
2192#line 2638 "ClientLib.c"
2193 retValue_acc = 0;
2194#line 2640
2195 return (retValue_acc);
2196 }
2197 }
2198 }
2199#line 2647 "ClientLib.c"
2200 return (retValue_acc);
2201}
2202}
2203#line 672 "ClientLib.c"
2204void setClientId(int handle , int value )
2205{
2206
2207 {
2208#line 680
2209 if (handle == 1) {
2210#line 674
2211 __ste_client_idCounter0 = value;
2212 } else {
2213#line 675
2214 if (handle == 2) {
2215#line 676
2216 __ste_client_idCounter1 = value;
2217 } else {
2218#line 677
2219 if (handle == 3) {
2220#line 678
2221 __ste_client_idCounter2 = value;
2222 } else {
2223
2224 }
2225 }
2226 }
2227#line 2682 "ClientLib.c"
2228 return;
2229}
2230}
2231#line 1 "featureselect.o"
2232#pragma merger(0,"featureselect.i","")
2233#line 8 "featureselect.h"
2234int __SELECTED_FEATURE_Base ;
2235#line 11 "featureselect.h"
2236int __SELECTED_FEATURE_Keys ;
2237#line 14 "featureselect.h"
2238int __SELECTED_FEATURE_Encrypt ;
2239#line 17 "featureselect.h"
2240int __SELECTED_FEATURE_AutoResponder ;
2241#line 20 "featureselect.h"
2242int __SELECTED_FEATURE_AddressBook ;
2243#line 23 "featureselect.h"
2244int __SELECTED_FEATURE_Sign ;
2245#line 26 "featureselect.h"
2246int __SELECTED_FEATURE_Forward ;
2247#line 29 "featureselect.h"
2248int __SELECTED_FEATURE_Verify ;
2249#line 32 "featureselect.h"
2250int __SELECTED_FEATURE_Decrypt ;
2251#line 35 "featureselect.h"
2252int __GUIDSL_ROOT_PRODUCTION ;
2253#line 37 "featureselect.h"
2254int __GUIDSL_NON_TERMINAL_main ;
2255#line 41
2256int select_one(void) ;
2257#line 43
2258void select_features(void) ;
2259#line 45
2260void select_helpers(void) ;
2261#line 47
2262int valid_product(void) ;
2263#line 8 "featureselect.c"
2264int select_one(void)
2265{ int retValue_acc ;
2266 int choice = __VERIFIER_nondet_int();
2267
2268 {
2269#line 84 "featureselect.c"
2270 retValue_acc = choice;
2271#line 86
2272 return (retValue_acc);
2273#line 93
2274 return (retValue_acc);
2275}
2276}
2277#line 14 "featureselect.c"
2278void select_features(void)
2279{
2280
2281 {
2282#line 115 "featureselect.c"
2283 return;
2284}
2285}
2286#line 20 "featureselect.c"
2287void select_helpers(void)
2288{
2289
2290 {
2291#line 133 "featureselect.c"
2292 return;
2293}
2294}
2295#line 25 "featureselect.c"
2296int valid_product(void)
2297{ int retValue_acc ;
2298
2299 {
2300#line 151 "featureselect.c"
2301 retValue_acc = 1;
2302#line 153
2303 return (retValue_acc);
2304#line 160
2305 return (retValue_acc);
2306}
2307}
2308#line 1 "Util.o"
2309#pragma merger(0,"Util.i","")
2310#line 359 "/usr/include/stdio.h"
2311extern int printf(char const * __restrict __format , ...) ;
2312#line 1 "Util.h"
2313int prompt(char *msg ) ;
2314#line 9 "Util.c"
2315int prompt(char *msg )
2316{ int retValue_acc ;
2317 int retval ;
2318 char const * __restrict __cil_tmp4 ;
2319
2320 {
2321 {
2322#line 10
2323 __cil_tmp4 = (char const * __restrict )"%s\n";
2324#line 10
2325 printf(__cil_tmp4, msg);
2326#line 518 "Util.c"
2327 retValue_acc = retval;
2328 }
2329#line 520
2330 return (retValue_acc);
2331#line 527
2332 return (retValue_acc);
2333}
2334}
2335#line 1 "wsllib_check.o"
2336#pragma merger(0,"wsllib_check.i","")
2337#line 3 "wsllib_check.c"
2338void __automaton_fail(void)
2339{
2340
2341 {
2342 goto ERROR;
2343 ERROR: ;
2344#line 53 "wsllib_check.c"
2345 return;
2346}
2347}
2348#line 1 "Email.o"
2349#pragma merger(0,"Email.i","")
2350#line 6 "EmailLib.h"
2351int getEmailId(int handle ) ;
2352#line 10
2353int getEmailFrom(int handle ) ;
2354#line 12
2355void setEmailFrom(int handle , int value ) ;
2356#line 14
2357int getEmailTo(int handle ) ;
2358#line 16
2359void setEmailTo(int handle , int value ) ;
2360#line 26
2361int isEncrypted(int handle ) ;
2362#line 30
2363int getEmailEncryptionKey(int handle ) ;
2364#line 34
2365int isSigned(int handle ) ;
2366#line 38
2367int getEmailSignKey(int handle ) ;
2368#line 42
2369int isVerified(int handle ) ;
2370#line 6 "Email.h"
2371void printMail(int msg ) ;
2372#line 9
2373int isReadable(int msg ) ;
2374#line 12
2375int createEmail(int from , int to ) ;
2376#line 15
2377int cloneEmail(int msg ) ;
2378#line 9 "Email.c"
2379void printMail__wrappee__Keys(int msg )
2380{ int tmp ;
2381 int tmp___0 ;
2382 int tmp___1 ;
2383 int tmp___2 ;
2384 char const * __restrict __cil_tmp6 ;
2385 char const * __restrict __cil_tmp7 ;
2386 char const * __restrict __cil_tmp8 ;
2387 char const * __restrict __cil_tmp9 ;
2388
2389 {
2390 {
2391#line 10
2392 tmp = getEmailId(msg);
2393#line 10
2394 __cil_tmp6 = (char const * __restrict )"ID:\n %i\n";
2395#line 10
2396 printf(__cil_tmp6, tmp);
2397#line 11
2398 tmp___0 = getEmailFrom(msg);
2399#line 11
2400 __cil_tmp7 = (char const * __restrict )"FROM:\n %i\n";
2401#line 11
2402 printf(__cil_tmp7, tmp___0);
2403#line 12
2404 tmp___1 = getEmailTo(msg);
2405#line 12
2406 __cil_tmp8 = (char const * __restrict )"TO:\n %i\n";
2407#line 12
2408 printf(__cil_tmp8, tmp___1);
2409#line 13
2410 tmp___2 = isReadable(msg);
2411#line 13
2412 __cil_tmp9 = (char const * __restrict )"IS_READABLE\n %i\n";
2413#line 13
2414 printf(__cil_tmp9, tmp___2);
2415 }
2416#line 601 "Email.c"
2417 return;
2418}
2419}
2420#line 17 "Email.c"
2421void printMail__wrappee__AddressBook(int msg )
2422{ int tmp ;
2423 int tmp___0 ;
2424 char const * __restrict __cil_tmp4 ;
2425 char const * __restrict __cil_tmp5 ;
2426
2427 {
2428 {
2429#line 18
2430 printMail__wrappee__Keys(msg);
2431#line 19
2432 tmp = isEncrypted(msg);
2433#line 19
2434 __cil_tmp4 = (char const * __restrict )"ENCRYPTED\n %d\n";
2435#line 19
2436 printf(__cil_tmp4, tmp);
2437#line 20
2438 tmp___0 = getEmailEncryptionKey(msg);
2439#line 20
2440 __cil_tmp5 = (char const * __restrict )"ENCRYPTION KEY\n %d\n";
2441#line 20
2442 printf(__cil_tmp5, tmp___0);
2443 }
2444#line 625 "Email.c"
2445 return;
2446}
2447}
2448#line 26 "Email.c"
2449void printMail__wrappee__Sign(int msg )
2450{ int tmp ;
2451 int tmp___0 ;
2452 char const * __restrict __cil_tmp4 ;
2453 char const * __restrict __cil_tmp5 ;
2454
2455 {
2456 {
2457#line 27
2458 printMail__wrappee__AddressBook(msg);
2459#line 28
2460 tmp = isSigned(msg);
2461#line 28
2462 __cil_tmp4 = (char const * __restrict )"SIGNED\n %i\n";
2463#line 28
2464 printf(__cil_tmp4, tmp);
2465#line 29
2466 tmp___0 = getEmailSignKey(msg);
2467#line 29
2468 __cil_tmp5 = (char const * __restrict )"SIGNATURE\n %i\n";
2469#line 29
2470 printf(__cil_tmp5, tmp___0);
2471 }
2472#line 649 "Email.c"
2473 return;
2474}
2475}
2476#line 33 "Email.c"
2477void printMail(int msg )
2478{ int tmp ;
2479 char const * __restrict __cil_tmp3 ;
2480
2481 {
2482 {
2483#line 34
2484 printMail__wrappee__Sign(msg);
2485#line 35
2486 tmp = isVerified(msg);
2487#line 35
2488 __cil_tmp3 = (char const * __restrict )"SIGNATURE VERIFIED\n %d\n";
2489#line 35
2490 printf(__cil_tmp3, tmp);
2491 }
2492#line 671 "Email.c"
2493 return;
2494}
2495}
2496#line 41 "Email.c"
2497int isReadable__wrappee__Keys(int msg )
2498{ int retValue_acc ;
2499
2500 {
2501#line 689 "Email.c"
2502 retValue_acc = 1;
2503#line 691
2504 return (retValue_acc);
2505#line 698
2506 return (retValue_acc);
2507}
2508}
2509#line 49 "Email.c"
2510int isReadable(int msg )
2511{ int retValue_acc ;
2512 int tmp ;
2513
2514 {
2515 {
2516#line 53
2517 tmp = isEncrypted(msg);
2518 }
2519#line 53 "Email.c"
2520 if (tmp) {
2521#line 727
2522 retValue_acc = 0;
2523#line 729
2524 return (retValue_acc);
2525 } else {
2526 {
2527#line 721 "Email.c"
2528 retValue_acc = isReadable__wrappee__Keys(msg);
2529 }
2530#line 723
2531 return (retValue_acc);
2532 }
2533#line 736 "Email.c"
2534 return (retValue_acc);
2535}
2536}
2537#line 57 "Email.c"
2538int cloneEmail(int msg )
2539{ int retValue_acc ;
2540
2541 {
2542#line 758 "Email.c"
2543 retValue_acc = msg;
2544#line 760
2545 return (retValue_acc);
2546#line 767
2547 return (retValue_acc);
2548}
2549}
2550#line 62 "Email.c"
2551int createEmail(int from , int to )
2552{ int retValue_acc ;
2553 int msg ;
2554
2555 {
2556 {
2557#line 63
2558 msg = 1;
2559#line 64
2560 setEmailFrom(msg, from);
2561#line 65
2562 setEmailTo(msg, to);
2563#line 797 "Email.c"
2564 retValue_acc = msg;
2565 }
2566#line 799
2567 return (retValue_acc);
2568#line 806
2569 return (retValue_acc);
2570}
2571}
2572#line 1 "scenario.o"
2573#pragma merger(0,"scenario.i","")
2574#line 17 "scenario.c"
2575void bobKeyAdd(void) ;
2576#line 24
2577void rjhDeletePrivateKey(void) ;
2578#line 28
2579void rjhKeyAdd(void) ;
2580#line 32
2581void chuckKeyAddRjh(void) ;
2582#line 39
2583void rjhKeyChange(void) ;
2584#line 43
2585void bobSetAddressBook(void) ;
2586#line 47
2587void chuckKeyAdd(void) ;
2588#line 51
2589void bobKeyChange(void) ;
2590#line 53
2591#line 60
2592void bobToRjh(void) ;
2593#line 1 "scenario.c"
2594void test(void)
2595{ int op1 ;
2596 int op2 ;
2597 int op3 ;
2598 int op4 ;
2599 int op5 ;
2600 int op6 ;
2601 int op7 ;
2602 int op8 ;
2603 int op9 ;
2604 int op10 ;
2605 int op11 ;
2606 int splverifierCounter ;
2607 int tmp ;
2608 int tmp___0 ;
2609 int tmp___1 ;
2610 int tmp___2 ;
2611 int tmp___3 ;
2612 int tmp___4 ;
2613 int tmp___5 ;
2614 int tmp___6 ;
2615 int tmp___7 ;
2616 int tmp___8 ;
2617 int tmp___9 ;
2618
2619 {
2620#line 2
2621 op1 = 0;
2622#line 3
2623 op2 = 0;
2624#line 4
2625 op3 = 0;
2626#line 5
2627 op4 = 0;
2628#line 6
2629 op5 = 0;
2630#line 7
2631 op6 = 0;
2632#line 8
2633 op7 = 0;
2634#line 9
2635 op8 = 0;
2636#line 10
2637 op9 = 0;
2638#line 11
2639 op10 = 0;
2640#line 12
2641 op11 = 0;
2642#line 13
2643 splverifierCounter = 0;
2644 {
2645#line 14
2646 while (1) {
2647 while_3_continue: ;
2648#line 14
2649 if (splverifierCounter < 4) {
2650
2651 } else {
2652 goto while_3_break;
2653 }
2654#line 15
2655 splverifierCounter = splverifierCounter + 1;
2656#line 16
2657 if (! op1) {
2658 {
2659#line 16
2660 tmp___9 = __VERIFIER_nondet_int();
2661 }
2662#line 16
2663 if (tmp___9) {
2664 {
2665#line 17
2666 bobKeyAdd();
2667#line 18
2668 op1 = 1;
2669 }
2670 } else {
2671 goto _L___8;
2672 }
2673 } else {
2674 _L___8:
2675#line 19
2676 if (! op2) {
2677 {
2678#line 19
2679 tmp___8 = __VERIFIER_nondet_int();
2680 }
2681#line 19
2682 if (tmp___8) {
2683#line 21
2684 op2 = 1;
2685 } else {
2686 goto _L___7;
2687 }
2688 } else {
2689 _L___7:
2690#line 22
2691 if (! op3) {
2692 {
2693#line 22
2694 tmp___7 = __VERIFIER_nondet_int();
2695 }
2696#line 22
2697 if (tmp___7) {
2698 {
2699#line 24
2700 rjhDeletePrivateKey();
2701#line 25
2702 op3 = 1;
2703 }
2704 } else {
2705 goto _L___6;
2706 }
2707 } else {
2708 _L___6:
2709#line 26
2710 if (! op4) {
2711 {
2712#line 26
2713 tmp___6 = __VERIFIER_nondet_int();
2714 }
2715#line 26
2716 if (tmp___6) {
2717 {
2718#line 28
2719 rjhKeyAdd();
2720#line 29
2721 op4 = 1;
2722 }
2723 } else {
2724 goto _L___5;
2725 }
2726 } else {
2727 _L___5:
2728#line 30
2729 if (! op5) {
2730 {
2731#line 30
2732 tmp___5 = __VERIFIER_nondet_int();
2733 }
2734#line 30
2735 if (tmp___5) {
2736 {
2737#line 32
2738 chuckKeyAddRjh();
2739#line 33
2740 op5 = 1;
2741 }
2742 } else {
2743 goto _L___4;
2744 }
2745 } else {
2746 _L___4:
2747#line 34
2748 if (! op6) {
2749 {
2750#line 34
2751 tmp___4 = __VERIFIER_nondet_int();
2752 }
2753#line 34
2754 if (tmp___4) {
2755#line 36
2756 op6 = 1;
2757 } else {
2758 goto _L___3;
2759 }
2760 } else {
2761 _L___3:
2762#line 37
2763 if (! op7) {
2764 {
2765#line 37
2766 tmp___3 = __VERIFIER_nondet_int();
2767 }
2768#line 37
2769 if (tmp___3) {
2770 {
2771#line 39
2772 rjhKeyChange();
2773#line 40
2774 op7 = 1;
2775 }
2776 } else {
2777 goto _L___2;
2778 }
2779 } else {
2780 _L___2:
2781#line 41
2782 if (! op8) {
2783 {
2784#line 41
2785 tmp___2 = __VERIFIER_nondet_int();
2786 }
2787#line 41
2788 if (tmp___2) {
2789 {
2790#line 43
2791 bobSetAddressBook();
2792#line 44
2793 op8 = 1;
2794 }
2795 } else {
2796 goto _L___1;
2797 }
2798 } else {
2799 _L___1:
2800#line 45
2801 if (! op9) {
2802 {
2803#line 45
2804 tmp___1 = __VERIFIER_nondet_int();
2805 }
2806#line 45
2807 if (tmp___1) {
2808 {
2809#line 47
2810 chuckKeyAdd();
2811#line 48
2812 op9 = 1;
2813 }
2814 } else {
2815 goto _L___0;
2816 }
2817 } else {
2818 _L___0:
2819#line 49
2820 if (! op10) {
2821 {
2822#line 49
2823 tmp___0 = __VERIFIER_nondet_int();
2824 }
2825#line 49
2826 if (tmp___0) {
2827 {
2828#line 51
2829 bobKeyChange();
2830#line 52
2831 op10 = 1;
2832 }
2833 } else {
2834 goto _L;
2835 }
2836 } else {
2837 _L:
2838#line 53
2839 if (! op11) {
2840 {
2841#line 53
2842 tmp = __VERIFIER_nondet_int();
2843 }
2844#line 53
2845 if (tmp) {
2846 {
2847#line 55
2848 chuckKeyAdd();
2849#line 56
2850 op11 = 1;
2851 }
2852 } else {
2853 goto while_3_break;
2854 }
2855 } else {
2856 goto while_3_break;
2857 }
2858 }
2859 }
2860 }
2861 }
2862 }
2863 }
2864 }
2865 }
2866 }
2867 }
2868 }
2869 while_3_break: ;
2870 }
2871 {
2872#line 60
2873 bobToRjh();
2874 }
2875#line 167 "scenario.c"
2876 return;
2877}
2878}
2879#line 1 "Client.o"
2880#pragma merger(0,"Client.i","")
2881#line 688 "/usr/include/stdio.h"
2882extern int puts(char const *__s ) ;
2883#line 28 "EmailLib.h"
2884void setEmailIsEncrypted(int handle , int value ) ;
2885#line 32
2886void setEmailEncryptionKey(int handle , int value ) ;
2887#line 36
2888void setEmailIsSigned(int handle , int value ) ;
2889#line 40
2890void setEmailSignKey(int handle , int value ) ;
2891#line 44
2892void setEmailIsSignatureVerified(int handle , int value ) ;
2893#line 14 "Client.h"
2894void queue(int client , int msg ) ;
2895#line 17
2896int is_queue_empty(void) ;
2897#line 19
2898int get_queued_client(void) ;
2899#line 21
2900int get_queued_email(void) ;
2901#line 24
2902void mail(int client , int msg ) ;
2903#line 26
2904void outgoing(int client , int msg ) ;
2905#line 28
2906void deliver(int client , int msg ) ;
2907#line 30
2908void incoming(int client , int msg ) ;
2909#line 32
2910int createClient(char *name ) ;
2911#line 35
2912void sendEmail(int sender , int receiver ) ;
2913#line 40
2914int isKeyPairValid(int publicKey , int privateKey ) ;
2915#line 44
2916void generateKeyPair(int client , int seed ) ;
2917#line 45
2918void sendToAddressBook(int client , int msg ) ;
2919#line 47
2920void sign(int client , int msg ) ;
2921#line 49
2922void verify(int client , int msg ) ;
2923#line 6 "Client.c"
2924int queue_empty = 1;
2925#line 9 "Client.c"
2926int queued_message ;
2927#line 12 "Client.c"
2928int queued_client ;
2929#line 18 "Client.c"
2930void mail(int client , int msg )
2931{ int tmp ;
2932
2933 {
2934 {
2935#line 19
2936 puts("mail sent");
2937#line 20
2938 tmp = getEmailTo(msg);
2939#line 20
2940 incoming(tmp, msg);
2941 }
2942#line 735 "Client.c"
2943 return;
2944}
2945}
2946#line 27 "Client.c"
2947void outgoing__wrappee__Keys(int client , int msg )
2948{ int tmp ;
2949
2950 {
2951 {
2952#line 28
2953 tmp = getClientId(client);
2954#line 28
2955 setEmailFrom(msg, tmp);
2956#line 29
2957 mail(client, msg);
2958 }
2959#line 757 "Client.c"
2960 return;
2961}
2962}
2963#line 33 "Client.c"
2964void outgoing__wrappee__Encrypt(int client , int msg )
2965{ int receiver ;
2966 int tmp ;
2967 int pubkey ;
2968 int tmp___0 ;
2969
2970 {
2971 {
2972#line 36
2973 tmp = getEmailTo(msg);
2974#line 36
2975 receiver = tmp;
2976#line 37
2977 tmp___0 = findPublicKey(client, receiver);
2978#line 37
2979 pubkey = tmp___0;
2980 }
2981#line 38
2982 if (pubkey) {
2983 {
2984#line 39
2985 setEmailEncryptionKey(msg, pubkey);
2986#line 40
2987 setEmailIsEncrypted(msg, 1);
2988 }
2989 } else {
2990
2991 }
2992 {
2993#line 45
2994 outgoing__wrappee__Keys(client, msg);
2995 }
2996#line 792 "Client.c"
2997 return;
2998}
2999}
3000#line 52 "Client.c"
3001void outgoing__wrappee__AddressBook(int client , int msg )
3002{ int size ;
3003 int tmp ;
3004 int receiver ;
3005 int tmp___0 ;
3006 int second ;
3007 int tmp___1 ;
3008 int tmp___2 ;
3009
3010 {
3011 {
3012#line 54
3013 tmp = getClientAddressBookSize(client);
3014#line 54
3015 size = tmp;
3016 }
3017#line 56
3018 if (size) {
3019 {
3020#line 57
3021 sendToAddressBook(client, msg);
3022#line 58
3023 puts("sending to alias in address book\n");
3024#line 59
3025 tmp___0 = getEmailTo(msg);
3026#line 59
3027 receiver = tmp___0;
3028#line 61
3029 puts("sending to second receipient\n");
3030#line 62
3031 tmp___1 = getClientAddressBookAddress(client, 1);
3032#line 62
3033 second = tmp___1;
3034#line 63
3035 setEmailTo(msg, second);
3036#line 64
3037 outgoing__wrappee__Encrypt(client, msg);
3038#line 67
3039 tmp___2 = getClientAddressBookAddress(client, 0);
3040#line 67
3041 setEmailTo(msg, tmp___2);
3042#line 68
3043 outgoing__wrappee__Encrypt(client, msg);
3044 }
3045 } else {
3046 {
3047#line 70
3048 outgoing__wrappee__Encrypt(client, msg);
3049 }
3050 }
3051#line 842 "Client.c"
3052 return;
3053}
3054}
3055#line 78 "Client.c"
3056void outgoing(int client , int msg )
3057{
3058
3059 {
3060 {
3061#line 79
3062 sign(client, msg);
3063#line 80
3064 outgoing__wrappee__AddressBook(client, msg);
3065 }
3066#line 864 "Client.c"
3067 return;
3068}
3069}
3070#line 866
3071void __utac_acc__VerifyForward_spec__1(int client , int msg ) ;
3072#line 87 "Client.c"
3073void deliver(int client , int msg )
3074{ int __utac__ad__arg1 ;
3075 int __utac__ad__arg2 ;
3076
3077 {
3078 {
3079#line 877 "Client.c"
3080 __utac__ad__arg1 = client;
3081#line 878
3082 __utac__ad__arg2 = msg;
3083#line 879
3084 __utac_acc__VerifyForward_spec__1(__utac__ad__arg1, __utac__ad__arg2);
3085#line 88 "Client.c"
3086 puts("mail delivered\n");
3087 }
3088#line 894 "Client.c"
3089 return;
3090}
3091}
3092#line 95 "Client.c"
3093void incoming__wrappee__Sign(int client , int msg )
3094{
3095
3096 {
3097 {
3098#line 96
3099 deliver(client, msg);
3100 }
3101#line 914 "Client.c"
3102 return;
3103}
3104}
3105#line 102 "Client.c"
3106void incoming__wrappee__Verify(int client , int msg )
3107{
3108
3109 {
3110 {
3111#line 103
3112 verify(client, msg);
3113#line 104
3114 incoming__wrappee__Sign(client, msg);
3115 }
3116#line 936 "Client.c"
3117 return;
3118}
3119}
3120#line 109 "Client.c"
3121void incoming(int client , int msg )
3122{ int privkey ;
3123 int tmp ;
3124 int tmp___0 ;
3125 int tmp___1 ;
3126 int tmp___2 ;
3127
3128 {
3129 {
3130#line 112
3131 tmp = getClientPrivateKey(client);
3132#line 112
3133 privkey = tmp;
3134 }
3135#line 113
3136 if (privkey) {
3137 {
3138#line 121
3139 tmp___0 = isEncrypted(msg);
3140 }
3141#line 121
3142 if (tmp___0) {
3143 {
3144#line 121
3145 tmp___1 = getEmailEncryptionKey(msg);
3146#line 121
3147 tmp___2 = isKeyPairValid(tmp___1, privkey);
3148 }
3149#line 121
3150 if (tmp___2) {
3151 {
3152#line 118
3153 setEmailIsEncrypted(msg, 0);
3154#line 119
3155 setEmailEncryptionKey(msg, 0);
3156 }
3157 } else {
3158
3159 }
3160 } else {
3161
3162 }
3163 } else {
3164
3165 }
3166 {
3167#line 124
3168 incoming__wrappee__Verify(client, msg);
3169 }
3170#line 970 "Client.c"
3171 return;
3172}
3173}
3174#line 128 "Client.c"
3175int createClient(char *name )
3176{ int retValue_acc ;
3177 int client ;
3178 int tmp ;
3179
3180 {
3181 {
3182#line 129
3183 tmp = initClient();
3184#line 129
3185 client = tmp;
3186#line 992 "Client.c"
3187 retValue_acc = client;
3188 }
3189#line 994
3190 return (retValue_acc);
3191#line 1001
3192 return (retValue_acc);
3193}
3194}
3195#line 136 "Client.c"
3196void sendEmail(int sender , int receiver )
3197{ int email ;
3198 int tmp ;
3199
3200 {
3201 {
3202#line 137
3203 tmp = createEmail(0, receiver);
3204#line 137
3205 email = tmp;
3206#line 138
3207 outgoing(sender, email);
3208 }
3209#line 1029 "Client.c"
3210 return;
3211}
3212}
3213#line 146 "Client.c"
3214void queue(int client , int msg )
3215{
3216
3217 {
3218#line 147
3219 queue_empty = 0;
3220#line 148
3221 queued_message = msg;
3222#line 149
3223 queued_client = client;
3224#line 1053 "Client.c"
3225 return;
3226}
3227}
3228#line 155 "Client.c"
3229int is_queue_empty(void)
3230{ int retValue_acc ;
3231
3232 {
3233#line 1071 "Client.c"
3234 retValue_acc = queue_empty;
3235#line 1073
3236 return (retValue_acc);
3237#line 1080
3238 return (retValue_acc);
3239}
3240}
3241#line 162 "Client.c"
3242int get_queued_client(void)
3243{ int retValue_acc ;
3244
3245 {
3246#line 1102 "Client.c"
3247 retValue_acc = queued_client;
3248#line 1104
3249 return (retValue_acc);
3250#line 1111
3251 return (retValue_acc);
3252}
3253}
3254#line 169 "Client.c"
3255int get_queued_email(void)
3256{ int retValue_acc ;
3257
3258 {
3259#line 1133 "Client.c"
3260 retValue_acc = queued_message;
3261#line 1135
3262 return (retValue_acc);
3263#line 1142
3264 return (retValue_acc);
3265}
3266}
3267#line 175 "Client.c"
3268int isKeyPairValid(int publicKey , int privateKey )
3269{ int retValue_acc ;
3270 char const * __restrict __cil_tmp4 ;
3271
3272 {
3273 {
3274#line 176
3275 __cil_tmp4 = (char const * __restrict )"keypair valid %d %d";
3276#line 176
3277 printf(__cil_tmp4, publicKey, privateKey);
3278 }
3279#line 177 "Client.c"
3280 if (! publicKey) {
3281#line 1167 "Client.c"
3282 retValue_acc = 0;
3283#line 1169
3284 return (retValue_acc);
3285 } else {
3286#line 177 "Client.c"
3287 if (! privateKey) {
3288#line 1167 "Client.c"
3289 retValue_acc = 0;
3290#line 1169
3291 return (retValue_acc);
3292 } else {
3293
3294 }
3295 }
3296#line 1174 "Client.c"
3297 retValue_acc = privateKey == publicKey;
3298#line 1176
3299 return (retValue_acc);
3300#line 1183
3301 return (retValue_acc);
3302}
3303}
3304#line 185 "Client.c"
3305void generateKeyPair(int client , int seed )
3306{
3307
3308 {
3309 {
3310#line 186
3311 setClientPrivateKey(client, seed);
3312 }
3313#line 1207 "Client.c"
3314 return;
3315}
3316}
3317#line 191 "Client.c"
3318void sendToAddressBook(int client , int msg )
3319{
3320
3321 {
3322#line 1225 "Client.c"
3323 return;
3324}
3325}
3326#line 197 "Client.c"
3327void sign(int client , int msg )
3328{ int privkey ;
3329 int tmp ;
3330
3331 {
3332 {
3333#line 198
3334 tmp = getClientPrivateKey(client);
3335#line 198
3336 privkey = tmp;
3337 }
3338#line 199
3339 if (! privkey) {
3340#line 200
3341 return;
3342 } else {
3343
3344 }
3345 {
3346#line 201
3347 setEmailIsSigned(msg, 1);
3348#line 202
3349 setEmailSignKey(msg, privkey);
3350 }
3351#line 1255 "Client.c"
3352 return;
3353}
3354}
3355#line 207 "Client.c"
3356void verify(int client , int msg )
3357{ int tmp ;
3358 int tmp___0 ;
3359 int pubkey ;
3360 int tmp___1 ;
3361 int tmp___2 ;
3362 int tmp___3 ;
3363 int tmp___4 ;
3364
3365 {
3366 {
3367#line 212
3368 tmp = isReadable(msg);
3369 }
3370#line 212
3371 if (tmp) {
3372 {
3373#line 212
3374 tmp___0 = isSigned(msg);
3375 }
3376#line 212
3377 if (tmp___0) {
3378
3379 } else {
3380#line 213
3381 return;
3382 }
3383 } else {
3384#line 213
3385 return;
3386 }
3387 {
3388#line 212
3389 tmp___1 = getEmailFrom(msg);
3390#line 212
3391 tmp___2 = findPublicKey(client, tmp___1);
3392#line 212
3393 pubkey = tmp___2;
3394 }
3395#line 213
3396 if (pubkey) {
3397 {
3398#line 213
3399 tmp___3 = getEmailSignKey(msg);
3400#line 213
3401 tmp___4 = isKeyPairValid(tmp___3, pubkey);
3402 }
3403#line 213
3404 if (tmp___4) {
3405 {
3406#line 214
3407 setEmailIsSignatureVerified(msg, 1);
3408 }
3409 } else {
3410
3411 }
3412 } else {
3413
3414 }
3415#line 1286 "Client.c"
3416 return;
3417}
3418}
3419#line 1 "EmailLib.o"
3420#pragma merger(0,"EmailLib.i","")
3421#line 4 "EmailLib.h"
3422int initEmail(void) ;
3423#line 8
3424void setEmailId(int handle , int value ) ;
3425#line 18
3426char *getEmailSubject(int handle ) ;
3427#line 20
3428void setEmailSubject(int handle , char *value ) ;
3429#line 22
3430char *getEmailBody(int handle ) ;
3431#line 24
3432void setEmailBody(int handle , char *value ) ;
3433#line 5 "EmailLib.c"
3434int __ste_Email_counter = 0;
3435#line 7 "EmailLib.c"
3436int initEmail(void)
3437{ int retValue_acc ;
3438
3439 {
3440#line 12 "EmailLib.c"
3441 if (__ste_Email_counter < 2) {
3442#line 670
3443 __ste_Email_counter = __ste_Email_counter + 1;
3444#line 670
3445 retValue_acc = __ste_Email_counter;
3446#line 672
3447 return (retValue_acc);
3448 } else {
3449#line 678 "EmailLib.c"
3450 retValue_acc = -1;
3451#line 680
3452 return (retValue_acc);
3453 }
3454#line 687 "EmailLib.c"
3455 return (retValue_acc);
3456}
3457}
3458#line 15 "EmailLib.c"
3459int __ste_email_id0 = 0;
3460#line 17 "EmailLib.c"
3461int __ste_email_id1 = 0;
3462#line 19 "EmailLib.c"
3463int getEmailId(int handle )
3464{ int retValue_acc ;
3465
3466 {
3467#line 26 "EmailLib.c"
3468 if (handle == 1) {
3469#line 716
3470 retValue_acc = __ste_email_id0;
3471#line 718
3472 return (retValue_acc);
3473 } else {
3474#line 720
3475 if (handle == 2) {
3476#line 725
3477 retValue_acc = __ste_email_id1;
3478#line 727
3479 return (retValue_acc);
3480 } else {
3481#line 733 "EmailLib.c"
3482 retValue_acc = 0;
3483#line 735
3484 return (retValue_acc);
3485 }
3486 }
3487#line 742 "EmailLib.c"
3488 return (retValue_acc);
3489}
3490}
3491#line 29 "EmailLib.c"
3492void setEmailId(int handle , int value )
3493{
3494
3495 {
3496#line 35
3497 if (handle == 1) {
3498#line 31
3499 __ste_email_id0 = value;
3500 } else {
3501#line 32
3502 if (handle == 2) {
3503#line 33
3504 __ste_email_id1 = value;
3505 } else {
3506
3507 }
3508 }
3509#line 773 "EmailLib.c"
3510 return;
3511}
3512}
3513#line 37 "EmailLib.c"
3514int __ste_email_from0 = 0;
3515#line 39 "EmailLib.c"
3516int __ste_email_from1 = 0;
3517#line 41 "EmailLib.c"
3518int getEmailFrom(int handle )
3519{ int retValue_acc ;
3520
3521 {
3522#line 48 "EmailLib.c"
3523 if (handle == 1) {
3524#line 798
3525 retValue_acc = __ste_email_from0;
3526#line 800
3527 return (retValue_acc);
3528 } else {
3529#line 802
3530 if (handle == 2) {
3531#line 807
3532 retValue_acc = __ste_email_from1;
3533#line 809
3534 return (retValue_acc);
3535 } else {
3536#line 815 "EmailLib.c"
3537 retValue_acc = 0;
3538#line 817
3539 return (retValue_acc);
3540 }
3541 }
3542#line 824 "EmailLib.c"
3543 return (retValue_acc);
3544}
3545}
3546#line 51 "EmailLib.c"
3547void setEmailFrom(int handle , int value )
3548{
3549
3550 {
3551#line 57
3552 if (handle == 1) {
3553#line 53
3554 __ste_email_from0 = value;
3555 } else {
3556#line 54
3557 if (handle == 2) {
3558#line 55
3559 __ste_email_from1 = value;
3560 } else {
3561
3562 }
3563 }
3564#line 855 "EmailLib.c"
3565 return;
3566}
3567}
3568#line 59 "EmailLib.c"
3569int __ste_email_to0 = 0;
3570#line 61 "EmailLib.c"
3571int __ste_email_to1 = 0;
3572#line 63 "EmailLib.c"
3573int getEmailTo(int handle )
3574{ int retValue_acc ;
3575
3576 {
3577#line 70 "EmailLib.c"
3578 if (handle == 1) {
3579#line 880
3580 retValue_acc = __ste_email_to0;
3581#line 882
3582 return (retValue_acc);
3583 } else {
3584#line 884
3585 if (handle == 2) {
3586#line 889
3587 retValue_acc = __ste_email_to1;
3588#line 891
3589 return (retValue_acc);
3590 } else {
3591#line 897 "EmailLib.c"
3592 retValue_acc = 0;
3593#line 899
3594 return (retValue_acc);
3595 }
3596 }
3597#line 906 "EmailLib.c"
3598 return (retValue_acc);
3599}
3600}
3601#line 73 "EmailLib.c"
3602void setEmailTo(int handle , int value )
3603{
3604
3605 {
3606#line 79
3607 if (handle == 1) {
3608#line 75
3609 __ste_email_to0 = value;
3610 } else {
3611#line 76
3612 if (handle == 2) {
3613#line 77
3614 __ste_email_to1 = value;
3615 } else {
3616
3617 }
3618 }
3619#line 937 "EmailLib.c"
3620 return;
3621}
3622}
3623#line 81 "EmailLib.c"
3624char *__ste_email_subject0 ;
3625#line 83 "EmailLib.c"
3626char *__ste_email_subject1 ;
3627#line 85 "EmailLib.c"
3628char *getEmailSubject(int handle )
3629{ char *retValue_acc ;
3630 void *__cil_tmp3 ;
3631
3632 {
3633#line 92 "EmailLib.c"
3634 if (handle == 1) {
3635#line 962
3636 retValue_acc = __ste_email_subject0;
3637#line 964
3638 return (retValue_acc);
3639 } else {
3640#line 966
3641 if (handle == 2) {
3642#line 971
3643 retValue_acc = __ste_email_subject1;
3644#line 973
3645 return (retValue_acc);
3646 } else {
3647#line 979 "EmailLib.c"
3648 __cil_tmp3 = (void *)0;
3649#line 979
3650 retValue_acc = (char *)__cil_tmp3;
3651#line 981
3652 return (retValue_acc);
3653 }
3654 }
3655#line 988 "EmailLib.c"
3656 return (retValue_acc);
3657}
3658}
3659#line 95 "EmailLib.c"
3660void setEmailSubject(int handle , char *value )
3661{
3662
3663 {
3664#line 101
3665 if (handle == 1) {
3666#line 97
3667 __ste_email_subject0 = value;
3668 } else {
3669#line 98
3670 if (handle == 2) {
3671#line 99
3672 __ste_email_subject1 = value;
3673 } else {
3674
3675 }
3676 }
3677#line 1019 "EmailLib.c"
3678 return;
3679}
3680}
3681#line 103 "EmailLib.c"
3682char *__ste_email_body0 = (char *)0;
3683#line 105 "EmailLib.c"
3684char *__ste_email_body1 = (char *)0;
3685#line 107 "EmailLib.c"
3686char *getEmailBody(int handle )
3687{ char *retValue_acc ;
3688 void *__cil_tmp3 ;
3689
3690 {
3691#line 114 "EmailLib.c"
3692 if (handle == 1) {
3693#line 1044
3694 retValue_acc = __ste_email_body0;
3695#line 1046
3696 return (retValue_acc);
3697 } else {
3698#line 1048
3699 if (handle == 2) {
3700#line 1053
3701 retValue_acc = __ste_email_body1;
3702#line 1055
3703 return (retValue_acc);
3704 } else {
3705#line 1061 "EmailLib.c"
3706 __cil_tmp3 = (void *)0;
3707#line 1061
3708 retValue_acc = (char *)__cil_tmp3;
3709#line 1063
3710 return (retValue_acc);
3711 }
3712 }
3713#line 1070 "EmailLib.c"
3714 return (retValue_acc);
3715}
3716}
3717#line 117 "EmailLib.c"
3718void setEmailBody(int handle , char *value )
3719{
3720
3721 {
3722#line 123
3723 if (handle == 1) {
3724#line 119
3725 __ste_email_body0 = value;
3726 } else {
3727#line 120
3728 if (handle == 2) {
3729#line 121
3730 __ste_email_body1 = value;
3731 } else {
3732
3733 }
3734 }
3735#line 1101 "EmailLib.c"
3736 return;
3737}
3738}
3739#line 125 "EmailLib.c"
3740int __ste_email_isEncrypted0 = 0;
3741#line 127 "EmailLib.c"
3742int __ste_email_isEncrypted1 = 0;
3743#line 129 "EmailLib.c"
3744int isEncrypted(int handle )
3745{ int retValue_acc ;
3746
3747 {
3748#line 136 "EmailLib.c"
3749 if (handle == 1) {
3750#line 1126
3751 retValue_acc = __ste_email_isEncrypted0;
3752#line 1128
3753 return (retValue_acc);
3754 } else {
3755#line 1130
3756 if (handle == 2) {
3757#line 1135
3758 retValue_acc = __ste_email_isEncrypted1;
3759#line 1137
3760 return (retValue_acc);
3761 } else {
3762#line 1143 "EmailLib.c"
3763 retValue_acc = 0;
3764#line 1145
3765 return (retValue_acc);
3766 }
3767 }
3768#line 1152 "EmailLib.c"
3769 return (retValue_acc);
3770}
3771}
3772#line 139 "EmailLib.c"
3773void setEmailIsEncrypted(int handle , int value )
3774{
3775
3776 {
3777#line 145
3778 if (handle == 1) {
3779#line 141
3780 __ste_email_isEncrypted0 = value;
3781 } else {
3782#line 142
3783 if (handle == 2) {
3784#line 143
3785 __ste_email_isEncrypted1 = value;
3786 } else {
3787
3788 }
3789 }
3790#line 1183 "EmailLib.c"
3791 return;
3792}
3793}
3794#line 147 "EmailLib.c"
3795int __ste_email_encryptionKey0 = 0;
3796#line 149 "EmailLib.c"
3797int __ste_email_encryptionKey1 = 0;
3798#line 151 "EmailLib.c"
3799int getEmailEncryptionKey(int handle )
3800{ int retValue_acc ;
3801
3802 {
3803#line 158 "EmailLib.c"
3804 if (handle == 1) {
3805#line 1208
3806 retValue_acc = __ste_email_encryptionKey0;
3807#line 1210
3808 return (retValue_acc);
3809 } else {
3810#line 1212
3811 if (handle == 2) {
3812#line 1217
3813 retValue_acc = __ste_email_encryptionKey1;
3814#line 1219
3815 return (retValue_acc);
3816 } else {
3817#line 1225 "EmailLib.c"
3818 retValue_acc = 0;
3819#line 1227
3820 return (retValue_acc);
3821 }
3822 }
3823#line 1234 "EmailLib.c"
3824 return (retValue_acc);
3825}
3826}
3827#line 161 "EmailLib.c"
3828void setEmailEncryptionKey(int handle , int value )
3829{
3830
3831 {
3832#line 167
3833 if (handle == 1) {
3834#line 163
3835 __ste_email_encryptionKey0 = value;
3836 } else {
3837#line 164
3838 if (handle == 2) {
3839#line 165
3840 __ste_email_encryptionKey1 = value;
3841 } else {
3842
3843 }
3844 }
3845#line 1265 "EmailLib.c"
3846 return;
3847}
3848}
3849#line 169 "EmailLib.c"
3850int __ste_email_isSigned0 = 0;
3851#line 171 "EmailLib.c"
3852int __ste_email_isSigned1 = 0;
3853#line 173 "EmailLib.c"
3854int isSigned(int handle )
3855{ int retValue_acc ;
3856
3857 {
3858#line 180 "EmailLib.c"
3859 if (handle == 1) {
3860#line 1290
3861 retValue_acc = __ste_email_isSigned0;
3862#line 1292
3863 return (retValue_acc);
3864 } else {
3865#line 1294
3866 if (handle == 2) {
3867#line 1299
3868 retValue_acc = __ste_email_isSigned1;
3869#line 1301
3870 return (retValue_acc);
3871 } else {
3872#line 1307 "EmailLib.c"
3873 retValue_acc = 0;
3874#line 1309
3875 return (retValue_acc);
3876 }
3877 }
3878#line 1316 "EmailLib.c"
3879 return (retValue_acc);
3880}
3881}
3882#line 183 "EmailLib.c"
3883void setEmailIsSigned(int handle , int value )
3884{
3885
3886 {
3887#line 189
3888 if (handle == 1) {
3889#line 185
3890 __ste_email_isSigned0 = value;
3891 } else {
3892#line 186
3893 if (handle == 2) {
3894#line 187
3895 __ste_email_isSigned1 = value;
3896 } else {
3897
3898 }
3899 }
3900#line 1347 "EmailLib.c"
3901 return;
3902}
3903}
3904#line 191 "EmailLib.c"
3905int __ste_email_signKey0 = 0;
3906#line 193 "EmailLib.c"
3907int __ste_email_signKey1 = 0;
3908#line 195 "EmailLib.c"
3909int getEmailSignKey(int handle )
3910{ int retValue_acc ;
3911
3912 {
3913#line 202 "EmailLib.c"
3914 if (handle == 1) {
3915#line 1372
3916 retValue_acc = __ste_email_signKey0;
3917#line 1374
3918 return (retValue_acc);
3919 } else {
3920#line 1376
3921 if (handle == 2) {
3922#line 1381
3923 retValue_acc = __ste_email_signKey1;
3924#line 1383
3925 return (retValue_acc);
3926 } else {
3927#line 1389 "EmailLib.c"
3928 retValue_acc = 0;
3929#line 1391
3930 return (retValue_acc);
3931 }
3932 }
3933#line 1398 "EmailLib.c"
3934 return (retValue_acc);
3935}
3936}
3937#line 205 "EmailLib.c"
3938void setEmailSignKey(int handle , int value )
3939{
3940
3941 {
3942#line 211
3943 if (handle == 1) {
3944#line 207
3945 __ste_email_signKey0 = value;
3946 } else {
3947#line 208
3948 if (handle == 2) {
3949#line 209
3950 __ste_email_signKey1 = value;
3951 } else {
3952
3953 }
3954 }
3955#line 1429 "EmailLib.c"
3956 return;
3957}
3958}
3959#line 213 "EmailLib.c"
3960int __ste_email_isSignatureVerified0 ;
3961#line 215 "EmailLib.c"
3962int __ste_email_isSignatureVerified1 ;
3963#line 217 "EmailLib.c"
3964int isVerified(int handle )
3965{ int retValue_acc ;
3966
3967 {
3968#line 224 "EmailLib.c"
3969 if (handle == 1) {
3970#line 1454
3971 retValue_acc = __ste_email_isSignatureVerified0;
3972#line 1456
3973 return (retValue_acc);
3974 } else {
3975#line 1458
3976 if (handle == 2) {
3977#line 1463
3978 retValue_acc = __ste_email_isSignatureVerified1;
3979#line 1465
3980 return (retValue_acc);
3981 } else {
3982#line 1471 "EmailLib.c"
3983 retValue_acc = 0;
3984#line 1473
3985 return (retValue_acc);
3986 }
3987 }
3988#line 1480 "EmailLib.c"
3989 return (retValue_acc);
3990}
3991}
3992#line 227 "EmailLib.c"
3993void setEmailIsSignatureVerified(int handle , int value )
3994{
3995
3996 {
3997#line 233
3998 if (handle == 1) {
3999#line 229
4000 __ste_email_isSignatureVerified0 = value;
4001 } else {
4002#line 230
4003 if (handle == 2) {
4004#line 231
4005 __ste_email_isSignatureVerified1 = value;
4006 } else {
4007
4008 }
4009 }
4010#line 1511 "EmailLib.c"
4011 return;
4012}
4013}
4014#line 1 "Test.o"
4015#pragma merger(0,"Test.i","")
4016#line 2 "Test.h"
4017int bob ;
4018#line 5 "Test.h"
4019int rjh ;
4020#line 8 "Test.h"
4021int chuck ;
4022#line 11
4023void setup_bob(int bob___0 ) ;
4024#line 14
4025void setup_rjh(int rjh___0 ) ;
4026#line 17
4027void setup_chuck(int chuck___0 ) ;
4028#line 26
4029void rjhToBob(void) ;
4030#line 32
4031void setup(void) ;
4032#line 35
4033int main(void) ;
4034#line 39
4035void bobKeyAddChuck(void) ;
4036#line 45
4037void rjhKeyAddChuck(void) ;
4038#line 18 "Test.c"
4039void setup_bob__wrappee__Base(int bob___0 )
4040{
4041
4042 {
4043 {
4044#line 19
4045 setClientId(bob___0, bob___0);
4046 }
4047#line 1330 "Test.c"
4048 return;
4049}
4050}
4051#line 23 "Test.c"
4052void setup_bob(int bob___0 )
4053{
4054
4055 {
4056 {
4057#line 24
4058 setup_bob__wrappee__Base(bob___0);
4059#line 25
4060 setClientPrivateKey(bob___0, 123);
4061 }
4062#line 1352 "Test.c"
4063 return;
4064}
4065}
4066#line 33 "Test.c"
4067void setup_rjh__wrappee__Base(int rjh___0 )
4068{
4069
4070 {
4071 {
4072#line 34
4073 setClientId(rjh___0, rjh___0);
4074 }
4075#line 1372 "Test.c"
4076 return;
4077}
4078}
4079#line 40 "Test.c"
4080void setup_rjh(int rjh___0 )
4081{
4082
4083 {
4084 {
4085#line 42
4086 setup_rjh__wrappee__Base(rjh___0);
4087#line 43
4088 setClientPrivateKey(rjh___0, 456);
4089 }
4090#line 1394 "Test.c"
4091 return;
4092}
4093}
4094#line 50 "Test.c"
4095void setup_chuck__wrappee__Base(int chuck___0 )
4096{
4097
4098 {
4099 {
4100#line 51
4101 setClientId(chuck___0, chuck___0);
4102 }
4103#line 1414 "Test.c"
4104 return;
4105}
4106}
4107#line 57 "Test.c"
4108void setup_chuck(int chuck___0 )
4109{
4110
4111 {
4112 {
4113#line 58
4114 setup_chuck__wrappee__Base(chuck___0);
4115#line 59
4116 setClientPrivateKey(chuck___0, 789);
4117 }
4118#line 1436 "Test.c"
4119 return;
4120}
4121}
4122#line 69 "Test.c"
4123void bobToRjh(void)
4124{ int tmp ;
4125 int tmp___0 ;
4126 int tmp___1 ;
4127
4128 {
4129 {
4130#line 71
4131 puts("Please enter a subject and a message body.\n");
4132#line 72
4133 sendEmail(bob, rjh);
4134#line 73
4135 tmp___1 = is_queue_empty();
4136 }
4137#line 73
4138 if (tmp___1) {
4139
4140 } else {
4141 {
4142#line 74
4143 tmp = get_queued_email();
4144#line 74
4145 tmp___0 = get_queued_client();
4146#line 74
4147 outgoing(tmp___0, tmp);
4148 }
4149 }
4150#line 1463 "Test.c"
4151 return;
4152}
4153}
4154#line 81 "Test.c"
4155void rjhToBob(void)
4156{
4157
4158 {
4159 {
4160#line 83
4161 puts("Please enter a subject and a message body.\n");
4162#line 84
4163 sendEmail(rjh, bob);
4164 }
4165#line 1485 "Test.c"
4166 return;
4167}
4168}
4169#line 88 "Test.c"
4170#line 95 "Test.c"
4171void setup(void)
4172{ char const * __restrict __cil_tmp1 ;
4173 char const * __restrict __cil_tmp2 ;
4174 char const * __restrict __cil_tmp3 ;
4175
4176 {
4177 {
4178#line 96
4179 bob = 1;
4180#line 97
4181 setup_bob(bob);
4182#line 98
4183 __cil_tmp1 = (char const * __restrict )"bob: %d\n";
4184#line 98
4185 printf(__cil_tmp1, bob);
4186#line 100
4187 rjh = 2;
4188#line 101
4189 setup_rjh(rjh);
4190#line 102
4191 __cil_tmp2 = (char const * __restrict )"rjh: %d\n";
4192#line 102
4193 printf(__cil_tmp2, rjh);
4194#line 104
4195 chuck = 3;
4196#line 105
4197 setup_chuck(chuck);
4198#line 106
4199 __cil_tmp3 = (char const * __restrict )"chuck: %d\n";
4200#line 106
4201 printf(__cil_tmp3, chuck);
4202 }
4203#line 1556 "Test.c"
4204 return;
4205}
4206}
4207#line 112 "Test.c"
4208int main(void)
4209{ int retValue_acc ;
4210 int tmp ;
4211
4212 {
4213 {
4214#line 113
4215 select_helpers();
4216#line 114
4217 select_features();
4218#line 115
4219 tmp = valid_product();
4220 }
4221#line 115
4222 if (tmp) {
4223 {
4224#line 116
4225 setup();
4226#line 117
4227 test();
4228 }
4229 } else {
4230
4231 }
4232#line 1587 "Test.c"
4233 return (retValue_acc);
4234}
4235}
4236#line 125 "Test.c"
4237void bobKeyAdd(void)
4238{ int tmp ;
4239 int tmp___0 ;
4240 char const * __restrict __cil_tmp3 ;
4241 char const * __restrict __cil_tmp4 ;
4242
4243 {
4244 {
4245#line 126
4246 createClientKeyringEntry(bob);
4247#line 127
4248 setClientKeyringUser(bob, 0, 2);
4249#line 128
4250 setClientKeyringPublicKey(bob, 0, 456);
4251#line 129
4252 puts("bob added rjhs key");
4253#line 130
4254 tmp = getClientKeyringUser(bob, 0);
4255#line 130
4256 __cil_tmp3 = (char const * __restrict )"%d\n";
4257#line 130
4258 printf(__cil_tmp3, tmp);
4259#line 131
4260 tmp___0 = getClientKeyringPublicKey(bob, 0);
4261#line 131
4262 __cil_tmp4 = (char const * __restrict )"%d\n";
4263#line 131
4264 printf(__cil_tmp4, tmp___0);
4265 }
4266#line 1621 "Test.c"
4267 return;
4268}
4269}
4270#line 137 "Test.c"
4271void rjhKeyAdd(void)
4272{
4273
4274 {
4275 {
4276#line 138
4277 createClientKeyringEntry(rjh);
4278#line 139
4279 setClientKeyringUser(rjh, 0, 1);
4280#line 140
4281 setClientKeyringPublicKey(rjh, 0, 123);
4282 }
4283#line 1645 "Test.c"
4284 return;
4285}
4286}
4287#line 146 "Test.c"
4288void rjhKeyAddChuck(void)
4289{
4290
4291 {
4292 {
4293#line 147
4294 createClientKeyringEntry(rjh);
4295#line 148
4296 setClientKeyringUser(rjh, 0, 3);
4297#line 149
4298 setClientKeyringPublicKey(rjh, 0, 789);
4299 }
4300#line 1669 "Test.c"
4301 return;
4302}
4303}
4304#line 156 "Test.c"
4305void bobKeyAddChuck(void)
4306{
4307
4308 {
4309 {
4310#line 157
4311 createClientKeyringEntry(bob);
4312#line 158
4313 setClientKeyringUser(bob, 1, 3);
4314#line 159
4315 setClientKeyringPublicKey(bob, 1, 789);
4316 }
4317#line 1693 "Test.c"
4318 return;
4319}
4320}
4321#line 165 "Test.c"
4322void chuckKeyAdd(void)
4323{
4324
4325 {
4326 {
4327#line 166
4328 createClientKeyringEntry(chuck);
4329#line 167
4330 setClientKeyringUser(chuck, 0, 1);
4331#line 168
4332 setClientKeyringPublicKey(chuck, 0, 123);
4333 }
4334#line 1717 "Test.c"
4335 return;
4336}
4337}
4338#line 174 "Test.c"
4339void chuckKeyAddRjh(void)
4340{
4341
4342 {
4343 {
4344#line 175
4345 createClientKeyringEntry(chuck);
4346#line 176
4347 setClientKeyringUser(chuck, 0, 2);
4348#line 177
4349 setClientKeyringPublicKey(chuck, 0, 456);
4350 }
4351#line 1741 "Test.c"
4352 return;
4353}
4354}
4355#line 183 "Test.c"
4356void rjhDeletePrivateKey(void)
4357{
4358
4359 {
4360 {
4361#line 184
4362 setClientPrivateKey(rjh, 0);
4363 }
4364#line 1761 "Test.c"
4365 return;
4366}
4367}
4368#line 190 "Test.c"
4369void bobKeyChange(void)
4370{
4371
4372 {
4373 {
4374#line 191
4375 generateKeyPair(bob, 777);
4376 }
4377#line 1781 "Test.c"
4378 return;
4379}
4380}
4381#line 197 "Test.c"
4382void rjhKeyChange(void)
4383{
4384
4385 {
4386 {
4387#line 198
4388 generateKeyPair(rjh, 666);
4389 }
4390#line 1801 "Test.c"
4391 return;
4392}
4393}
4394#line 203 "Test.c"
4395void bobSetAddressBook(void)
4396{
4397
4398 {
4399 {
4400#line 204
4401 setClientAddressBookSize(bob, 1);
4402#line 205
4403 setClientAddressBookAlias(bob, 0, rjh);
4404#line 206
4405 setClientAddressBookAddress(bob, 0, rjh);
4406#line 207
4407 setClientAddressBookAddress(bob, 1, chuck);
4408 }
4409#line 1827 "Test.c"
4410 return;
4411}
4412}
4413#line 1 "VerifyForward_spec.o"
4414#pragma merger(0,"VerifyForward_spec.i","")
4415#line 12 "VerifyForward_spec.c"
4416void __utac_acc__VerifyForward_spec__1(int client , int msg )
4417{ int pubkey ;
4418 int tmp ;
4419 int tmp___0 ;
4420 int tmp___1 ;
4421
4422 {
4423 {
4424#line 15
4425 puts("before deliver\n");
4426#line 17
4427 tmp___1 = isVerified(msg);
4428 }
4429#line 17
4430 if (tmp___1) {
4431 {
4432#line 18
4433 tmp = getEmailFrom(msg);
4434#line 18
4435 tmp___0 = findPublicKey(client, tmp);
4436#line 18
4437 pubkey = tmp___0;
4438 }
4439#line 19
4440 if (pubkey == 0) {
4441 {
4442#line 20
4443 __automaton_fail();
4444 }
4445 } else {
4446
4447 }
4448 } else {
4449
4450 }
4451#line 20
4452 return;
4453}
4454}