]> matita.cs.unibo.it Git - pkg-cerco/acc.git/blob - tests/clight/complets.Clight.expected
Imported Upstream version 0.2
[pkg-cerco/acc.git] / tests / clight / complets.Clight.expected
1 extern void *__builtin___memcpy_chk(void *, void *, unsigned int, unsigned int);
2
3 extern void *__builtin___memmove_chk(void *, void *, unsigned int, unsigned int);
4
5 extern void *__builtin___mempcpy_chk(void *, void *, unsigned int, unsigned int);
6
7 extern void *__builtin___memset_chk(void *, int, unsigned int, unsigned int);
8
9 extern unsigned char *__builtin___stpcpy_chk(unsigned char *, unsigned char *, unsigned int);
10
11 extern unsigned char *__builtin___strcat_chk(unsigned char *, unsigned char *, unsigned int);
12
13 extern unsigned char *__builtin___strcpy_chk(unsigned char *, unsigned char *, unsigned int);
14
15 extern unsigned char *__builtin___strncat_chk(unsigned char *, unsigned char *, unsigned int, unsigned int);
16
17 extern unsigned char *__builtin___strncpy_chk(unsigned char *, unsigned char *, unsigned int, unsigned int);
18
19 extern int __builtin___vfprintf_chk(void *, int, unsigned char *, void *);
20
21 extern int __builtin___vprintf_chk(int, unsigned char *, void *);
22
23 extern int __builtin___vsnprintf_chk(unsigned char *, unsigned int, int, unsigned int, unsigned char *, void *);
24
25 extern int __builtin___vsprintf_chk(unsigned char *, int, unsigned int, unsigned char *, void *);
26
27 extern double __builtin_acos(double);
28
29 extern float __builtin_acosf(float);
30
31 extern double __builtin_acosl(double);
32
33 extern void *__builtin_alloca(unsigned int);
34
35 extern double __builtin_asin(double);
36
37 extern float __builtin_asinf(float);
38
39 extern double __builtin_asinl(double);
40
41 extern double __builtin_atan(double);
42
43 extern float __builtin_atanf(float);
44
45 extern double __builtin_atanl(double);
46
47 extern double __builtin_atan2(double, double);
48
49 extern float __builtin_atan2f(float, float);
50
51 extern double __builtin_atan2l(double, double);
52
53 extern double __builtin_ceil(double);
54
55 extern float __builtin_ceilf(float);
56
57 extern double __builtin_ceill(double);
58
59 extern double __builtin_cos(double);
60
61 extern float __builtin_cosf(float);
62
63 extern double __builtin_cosl(double);
64
65 extern double __builtin_cosh(double);
66
67 extern float __builtin_coshf(float);
68
69 extern double __builtin_coshl(double);
70
71 extern int __builtin_clz(unsigned int);
72
73 extern int __builtin_clzl(unsigned int);
74
75 extern int __builtin_clzll(unsigned int);
76
77 extern int __builtin_constant_p(int);
78
79 extern int __builtin_ctz(unsigned int);
80
81 extern int __builtin_ctzl(unsigned int);
82
83 extern int __builtin_ctzll(unsigned int);
84
85 extern double __builtin_exp(double);
86
87 extern float __builtin_expf(float);
88
89 extern double __builtin_expl(double);
90
91 extern int __builtin_expect(int, int);
92
93 extern double __builtin_fabs(double);
94
95 extern float __builtin_fabsf(float);
96
97 extern double __builtin_fabsl(double);
98
99 extern int __builtin_ffs(unsigned int);
100
101 extern int __builtin_ffsl(unsigned int);
102
103 extern int __builtin_ffsll(unsigned int);
104
105 extern void *__builtin_frame_address(unsigned int);
106
107 extern double __builtin_floor(double);
108
109 extern float __builtin_floorf(float);
110
111 extern double __builtin_floorl(double);
112
113 extern double __builtin_huge_val(void);
114
115 extern float __builtin_huge_valf(void);
116
117 extern double __builtin_huge_vall(void);
118
119 extern double __builtin_inf(void);
120
121 extern float __builtin_inff(void);
122
123 extern double __builtin_infl(void);
124
125 extern void *__builtin_memcpy(void *, void *, unsigned int);
126
127 extern void *__builtin_mempcpy(void *, void *, unsigned int);
128
129 extern double __builtin_fmod(double);
130
131 extern float __builtin_fmodf(float);
132
133 extern double __builtin_fmodl(double);
134
135 extern double __builtin_frexp(double, int *);
136
137 extern float __builtin_frexpf(float, int *);
138
139 extern double __builtin_frexpl(double, int *);
140
141 extern double __builtin_ldexp(double, int);
142
143 extern float __builtin_ldexpf(float, int);
144
145 extern double __builtin_ldexpl(double, int);
146
147 extern double __builtin_log(double);
148
149 extern float __builtin_logf(float);
150
151 extern double __builtin_logl(double);
152
153 extern double __builtin_log10(double);
154
155 extern float __builtin_log10f(float);
156
157 extern double __builtin_log10l(double);
158
159 extern float __builtin_modff(float, float *);
160
161 extern double __builtin_modfl(double, double *);
162
163 extern double __builtin_nan(unsigned char *);
164
165 extern float __builtin_nanf(unsigned char *);
166
167 extern double __builtin_nanl(unsigned char *);
168
169 extern double __builtin_nans(unsigned char *);
170
171 extern float __builtin_nansf(unsigned char *);
172
173 extern double __builtin_nansl(unsigned char *);
174
175 extern void *__builtin_next_arg(void);
176
177 extern unsigned int __builtin_object_size(void *, int);
178
179 extern int __builtin_parity(unsigned int);
180
181 extern int __builtin_parityl(unsigned int);
182
183 extern int __builtin_parityll(unsigned int);
184
185 extern int __builtin_popcount(unsigned int);
186
187 extern int __builtin_popcountl(unsigned int);
188
189 extern int __builtin_popcountll(unsigned int);
190
191 extern double __builtin_powi(double, int);
192
193 extern float __builtin_powif(float, int);
194
195 extern double __builtin_powil(double, int);
196
197 extern void __builtin_return(void *);
198
199 extern void *__builtin_return_address(unsigned int);
200
201 extern double __builtin_sin(double);
202
203 extern float __builtin_sinf(float);
204
205 extern double __builtin_sinl(double);
206
207 extern double __builtin_sinh(double);
208
209 extern float __builtin_sinhf(float);
210
211 extern double __builtin_sinhl(double);
212
213 extern double __builtin_sqrt(double);
214
215 extern float __builtin_sqrtf(float);
216
217 extern double __builtin_sqrtl(double);
218
219 extern unsigned char *__builtin_stpcpy(unsigned char *, unsigned char *);
220
221 extern unsigned char *__builtin_strchr(unsigned char *, unsigned char);
222
223 extern int __builtin_strcmp(unsigned char *, unsigned char *);
224
225 extern unsigned char *__builtin_strcpy(unsigned char *, unsigned char *);
226
227 extern unsigned int __builtin_strcspn(unsigned char *, unsigned char *);
228
229 extern unsigned char *__builtin_strncat(unsigned char *, unsigned char *, unsigned int);
230
231 extern int __builtin_strncmp(unsigned char *, unsigned char *, unsigned int);
232
233 extern unsigned char *__builtin_strncpy(unsigned char *, unsigned char *, unsigned int);
234
235 extern int __builtin_strspn(unsigned char *, unsigned char *);
236
237 extern unsigned char *__builtin_strpbrk(unsigned char *, unsigned char *);
238
239 extern int __builtin_types_compatible_p(unsigned int, unsigned int);
240
241 extern double __builtin_tan(double);
242
243 extern float __builtin_tanf(float);
244
245 extern double __builtin_tanl(double);
246
247 extern double __builtin_tanh(double);
248
249 extern float __builtin_tanhf(float);
250
251 extern double __builtin_tanhl(double);
252
253 extern void __builtin_va_end(void *);
254
255 extern void __builtin_varargs_start(void *);
256
257 extern void __builtin_va_start(void *, void *);
258
259 extern void __builtin_stdarg_start(void *);
260
261 extern void __builtin_va_arg(void *, unsigned int);
262
263 extern void __builtin_va_copy(void *, void *);
264
265 int comp_fir_basic(int *input, int *h, int *z, int N, int n)
266 {
267   int i;
268   int j;
269   int k;
270   int y;
271   c16:
272   y = 0;
273   c15:
274   for (({ c14: k = 0; }); (/* c13 */ k < 3); ({ c12: k = k + 1; })) {
275     c11:
276     z[0] = input[k];
277     c10:
278     for (({ c9: i = 0; }); (/* c8 */ i < 3); ({ c7: i = i + 1; })) {
279       c6:
280       y = y + h[i] * z[i];
281     }
282     c5:
283     for (({ c4: j = 2; }); (/* c3 */ j >= 0); ({ c2: j = j - 1; })) {
284       c1:
285       z[(j + 1)] = z[j];
286     }
287   }
288   c0:
289   return y;
290 }
291
292 int comp_fir16(int *in, int *c, int *out, int size)
293 {
294   int i;
295   int j;
296   int res;
297   int tmp;
298   int x[16];
299   int adx;
300   c49:
301   x[0] = 0;
302   c48:
303   x[1] = 0;
304   c47:
305   x[2] = 0;
306   c46:
307   x[3] = 0;
308   c45:
309   x[4] = 0;
310   c44:
311   x[5] = 0;
312   c43:
313   x[6] = 0;
314   c42:
315   x[7] = 0;
316   c41:
317   x[8] = 0;
318   c40:
319   x[9] = 0;
320   c39:
321   x[10] = 0;
322   c38:
323   x[11] = 0;
324   c37:
325   x[12] = 0;
326   c36:
327   x[13] = 0;
328   c35:
329   x[14] = 0;
330   c34:
331   x[15] = 0;
332   c33:
333   adx = 0;
334   c32:
335   res = 0;
336   c31:
337   for (({ c30: j = 0; }); (/* c29 */ j < size); ({ c28: j = j + 1; })) {
338     c27:
339     x[adx] = in[j];
340     c26:
341     for (({ c25: i = 0; }); (/* c24 */ i < 16); ({ c23: i = i + 1; })) {
342       c22:
343       tmp = (x[adx] * c[i]) * (2 ^ 16);
344       c21:
345       res = res + tmp;
346       c20:
347       adx = (adx + 1) % 16;
348     }
349     c19:
350     adx = (adx + 1) % 16;
351     c18:
352     out[j] = res;
353   }
354   c17:
355   return x[0];
356 }
357
358 int comp_ifFor(int a, int b, int pas)
359 {
360   int i;
361   int result;
362   c58:
363   result = 0;
364   c57:
365   for (({ c56: i = 0; }); (/* c55 */ i < a); ({ c54: i = i + pas; })) {
366     c53:
367     if (i != b) {
368       c52:
369       result = result + i;
370     } else {
371       c51:
372       result = 0;
373     }
374   }
375   c50:
376   return result;
377 }
378
379 int comp_total(int *tabParam, int a, int b)
380 {
381   int i;
382   int j;
383   int k;
384   int tabLocal1[10];
385   int tabLocal2[10];
386   c94:
387   tabLocal1[0] = 0;
388   c93:
389   tabLocal1[1] = 0;
390   c92:
391   tabLocal1[2] = 0;
392   c91:
393   tabLocal1[3] = 0;
394   c90:
395   tabLocal1[4] = 0;
396   c89:
397   tabLocal1[5] = 0;
398   c88:
399   tabLocal1[6] = 0;
400   c87:
401   tabLocal1[7] = 0;
402   c86:
403   tabLocal1[8] = 0;
404   c85:
405   tabLocal1[9] = 0;
406   c84:
407   tabLocal2[0] = 0;
408   c83:
409   tabLocal2[1] = 0;
410   c82:
411   tabLocal2[2] = 0;
412   c81:
413   tabLocal2[3] = 0;
414   c80:
415   tabLocal2[4] = 0;
416   c79:
417   tabLocal2[5] = 0;
418   c78:
419   tabLocal2[6] = 0;
420   c77:
421   tabLocal2[7] = 0;
422   c76:
423   tabLocal2[8] = 0;
424   c75:
425   tabLocal2[9] = 0;
426   c74:
427   if (a < b) {
428     c73:
429     for (({ c72: i = 0; }); (/* c71 */ i <= a); ({ c70: i = i + 1; })) {
430       c69:
431       tabLocal1[i] = tabParam[(a - i)];
432     }
433   } else {
434     c68:
435     for (({ c67: k = 0; }); (/* c66 */ k < a); ({ c65: k = k + 1; })) {
436       c64:
437       for (({ c63: j = b; }); (/* c62 */ j > 0); ({ c61: j = j - 1; })) {
438         c60:
439         tabParam[k] = tabLocal1[k] + tabLocal2[j];
440       }
441     }
442   }
443   c59:
444   return 0;
445 }
446
447 int comp_tri(int *t, int n)
448 {
449   int i;
450   int j;
451   int tmp;
452   c108:
453   tmp = 0;
454   c107:
455   for (({ c106: i = 0; }); (/* c105 */ i < n); ({ c104: i = i + 1; })) {
456     c103:
457     for (({ c102:
458          j = 1; });
459          (/* c101 */
460          j < n - i);
461          ({ c100:
462          j = j + 1; })) {
463       c99:
464       if (t[j] < t[(j - 1)]) {
465         c98:
466         tmp = t[(j - 1)];
467         c97:
468         t[(j - 1)] = t[j];
469         c96:
470         t[j] = tmp;
471       }
472     }
473   }
474   c95:
475   return tmp;
476 }
477
478 int comp_forif2(int *u, int *v, int a, int b)
479 {
480   int i;
481   int j;
482   int k;
483   int l;
484   int res;
485   c130:
486   k = 0;
487   c129:
488   l = 0;
489   c128:
490   for (({ c127: i = 0; }); (/* c126 */ i < a); ({ c125: i = i + 1; })) {
491     c124:
492     k = k + u[i];
493   }
494   c123:
495   for (({ c122: j = 0; }); (/* c121 */ j < b); ({ c120: j = j + 1; })) {
496     c119:
497     l = l + v[j];
498   }
499   c118:
500   if ((/* c117 */ k % 2 == 0) && (/* c116 */ l % 2 == 0)) {
501     c115:
502     res = 0;
503   } else {
504     c114:
505     if (k % 2 == 0) {
506       c113:
507       res = 1;
508     } else {
509       c112:
510       if (l % 2 == 0) {
511         c111:
512         res = 2;
513       } else {
514         c110:
515         res = 3;
516       }
517     }
518   }
519   c109:
520   return 0;
521 }
522
523 int comp_forif(void)
524 {
525   int i;
526   int j;
527   int k;
528   c141:
529   j = 0;
530   c140:
531   k = 0;
532   c139:
533   for (({ c138: i = 0; }); (/* c137 */ i < 10); ({ c136: i = i + 1; })) {
534     c135:
535     j = j + 1;
536     c134:
537     j = j + 1;
538     c133:
539     if (i % 2 == 0) {
540       c132:
541       k = k + 1;
542     }
543   }
544   c131:
545   return j;
546 }
547
548 int main(void)
549 {
550   int a;
551   int t[16];
552   c165:
553   t[0] = 10;
554   c164:
555   t[1] = 9;
556   c163:
557   t[2] = 8;
558   c162:
559   t[3] = 7;
560   c161:
561   t[4] = 6;
562   c160:
563   t[5] = 0;
564   c159:
565   t[6] = 5;
566   c158:
567   t[7] = 4;
568   c157:
569   t[8] = 3;
570   c156:
571   t[9] = 2;
572   c155:
573   t[10] = 0;
574   c154:
575   t[11] = 0;
576   c153:
577   t[12] = 0;
578   c152:
579   t[13] = 0;
580   c151:
581   t[14] = 0;
582   c150:
583   t[15] = 0;
584   c149:
585   a = comp_fir_basic(t, t, t, 10, 10);
586   c148:
587   a = comp_fir16(t, t, t, 16);
588   c147:
589   a = comp_ifFor(4, 1, 1);
590   c146:
591   a = comp_total(t, 9, 3);
592   c145:
593   a = comp_tri(t, 10);
594   c144:
595   a = comp_forif2(t, t, 10, 10);
596   c143:
597   a = comp_forif();
598   c142:
599   return a;
600 }
601
602