-
Notifications
You must be signed in to change notification settings - Fork 2
/
draft.c
366 lines (326 loc) · 6.59 KB
/
draft.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
// ---------------------------------------------
// C file generated from draft.pvs
// ---------------------------------------------
// Make sure to link GC.c and GMP in compilation:
// gcc -o draft draft.c GC.c -lgmp
// ./draft
// ---------------------------------------------
#include<stdio.h>
#include<gmp.h>
#include "GC.h"
#include "draft.h"
#define TRUE 1
#define FALSE 0
int main(void) {
GC_start();
printf("Executing draft ...\n");
// Insert code here
GC_quit();
return 0;
}
pair2510 pvs_a2508() {
pair2510 result;
result = GC_malloc(1, sizeof( struct struct_pair2510 ) );
mpz_init( result->y );
result->x = 2;
mpz_set_si(result->y, (long) 12);
return result;
}
pair2510 pvs_a_d2509() {
pair2510 result;
result = GC_malloc(1, sizeof( struct struct_pair2510 ) );
mpz_init( result->y );
result->x = 2;
mpz_set_si(result->y, (long) 12);
return result;
}
int pvs_first2511(pair2510 a) {
int result;
result = a->x;
if( GC_count( a ) == 1 ) {
mpz_clear(a->y);
}
GC_free(a);
return result;
}
int pvs_first_d2512(pair2510 a) {
int result;
result = a->x;
if( GC_count( a ) == 1 ) {
mpz_clear(a->y);
}
GC_free(a);
return result;
}
pair2510 pvs_zero2513(pair2510 a) {
pair2510 result;
if ( GC_count( a ) == 1 )
result = a;
else {
result = GC_malloc(1, sizeof( struct struct_pair2510 ));
mpz_init( result->y );
mpz_set(result->y, a->y);
result->x = a->x;
}
result->x = 0;
int res2515;
return result;
}
pair2510 pvs_zero_d2514(pair2510 a) {
a->x = 0;
int res2516;
pair2510 result;
return a;
}
unsigned long int pvs_a2517() {
return (unsigned long int) 2;
}
unsigned long int pvs_a_d2518() {
return (unsigned long int) 2;
}
int pvs_b2519() {
return (3 + 1);
}
int pvs_b_d2520() {
return (3 + 1);
}
void pvs_c2521(mpz_t result) {
mpz_set_si(result, (long) (3 * (1 + 2)));
}
void pvs_c_d2522(mpz_t result) {
mpz_set_si(result, (long) (3 * (1 + 2)));
}
int pvs_incr2523(int x) {
return (x + 1);
}
int pvs_incr_d2524(int x) {
return (x + 1);
}
int pvs_zero2525(mpz_t x) {
mpz_clear(x);
int result;
return 0;
}
int pvs_zero_d2526(mpz_t x) {
mpz_clear(x);
int result;
return 0;
}
int pvs_f2527(int a, int b) {
mpz_t conv2529;
mpz_init( conv2529 );
mpz_set_si(conv2529, (long) b);
int result;
result = (int) (pvs_zero_d2526( conv2529 ) * pvs_incr_d2524( a ));
mpz_clear(conv2529);
return result;
}
int pvs_f_d2528(int a, int b) {
mpz_t conv2530;
mpz_init( conv2530 );
mpz_set_si(conv2530, (long) b);
int result;
result = (int) (pvs_zero_d2526( conv2530 ) * pvs_incr_d2524( a ));
mpz_clear(conv2530);
return result;
}
int pvs_f2531(int x) {
if (((x <= 1) && 1)) {
if (((x == 0) || (x < 0))) {
return 0;
} else {
return x;
}
} else {
if ((x > 10)) {
return 10;
} else {
return (x - 5);
}
}
}
int pvs_f_d2532(int x) {
if (((x <= 1) && 1)) {
if (((x == 0) || (x < 0))) {
return 0;
} else {
return x;
}
} else {
if ((x > 10)) {
return 10;
} else {
return (x - 5);
}
}
}
int pvs_t2539(int x) {
return x;
}
int pvs_t_d2540(int x) {
return x;
}
int* pvs_id22541(int* t103946) {
return t103946;
}
int* pvs_id2_d2542(int* t103946) {
return t103946;
}
int* pvs_f2545(int x) {
int* result;
result = GC_malloc(1000, sizeof(int) );
int i2547;
for(i2547 = 0; i2547 < 1000; i2547++) {
result[i2547] = pvs_t_d2540( i2547 );
}
return result;
}
int* pvs_f_d2546(int x) {
int* result;
result = GC_malloc(1000, sizeof(int) );
int i2548;
for(i2548 = 0; i2548 < 1000; i2548++) {
result[i2548] = pvs_t_d2540( i2548 );
}
return result;
}
int* pvs_update2549(int* x) {
int* result;
if ( GC_count( x ) == 1 )
result = x;
else {
result = GC_malloc(1000, sizeof(int) );
int i2703;
for(i2703 = 0; i2703 < 1000; i2703++) {
result[i2703] = x[i2703];
}
}
result[0] = 0;
int L2551;
int res2552;
return result;
}
int* pvs_update_d2550(int* x) {
x[0] = 0;
int res2554;
int L2553;
int* result;
return x;
}
int* pvs_t22567(int x) {
int* result;
result = GC_malloc(1000, sizeof(int) );
int i2569;
for(i2569 = 0; i2569 < 1000; i2569++) {
result[i2569] = (x + i2569);
}
return result;
}
int* pvs_t2_d2568(int x) {
int* result;
result = GC_malloc(1000, sizeof(int) );
int i2570;
for(i2570 = 0; i2570 < 1000; i2570++) {
result[i2570] = (x + i2570);
}
return result;
}
int* pvs_id2571(int** t103946) {
int* result;
result = (int*) t103946[0];
if( GC_count( t103946 ) == 1 ) {
int i2704;
for(i2704 = 0; i2704 < 1000; i2704++) {
GC_free(t103946[i2704]);
}
}
GC_free(t103946);
int** a;
return result;
}
int* pvs_id_d2572(int** t103946) {
int* result;
result = (int*) t103946[0];
if( GC_count( t103946 ) == 1 ) {
int i2706;
for(i2706 = 0; i2706 < 1000; i2706++) {
GC_free(t103946[i2706]);
}
}
GC_free(t103946);
int** a;
return result;
}
int* pvs_te2603() {
int* aux2606;
aux2606 = GC_malloc(1000, sizeof(int) );
int i2605;
for(i2605 = 0; i2605 < 1000; i2605++) {
aux2606[i2605] = pvs_t_d2540( i2605 );
}
return pvs_update_d2550( pvs_update_d2550( aux2606 ) );
}
int* pvs_te_d2604() {
int* aux2608;
aux2608 = GC_malloc(1000, sizeof(int) );
int i2607;
for(i2607 = 0; i2607 < 1000; i2607++) {
aux2608[i2607] = pvs_t_d2540( i2607 );
}
return pvs_update_d2550( pvs_update_d2550( aux2608 ) );
}
int** pvs_update2611(int** x) {
int* res2618;
res2618 = GC_malloc(1000, sizeof(int) );
int i2619;
for(i2619 = 0; i2619 < 1000; i2619++) {
res2618[i2619] = i2619;
}
int** result;
if ( GC_count( x ) == 1 )
result = x;
else {
result = GC_malloc(1000, sizeof(int*) );
int i2708;
for(i2708 = 0; i2708 < 1000; i2708++) {
result[i2708] = (int*) x[i2708];
}
}
int* E2614;
E2614 = GC_malloc(1000, sizeof(int) );
int i2709;
for(i2709 = 0; i2709 < 1000; i2709++) {
E2614[i2709] = result[0][i2709];
}
E2614[1] = 0;
result[0] = (int*) E2614;
result[1] = (int*) res2618;
int L2613;
int L2615;
int res2616;
int L2617;
return result;
}
int** pvs_update_d2612(int** x) {
int* res2625;
res2625 = GC_malloc(1000, sizeof(int) );
int i2626;
for(i2626 = 0; i2626 < 1000; i2626++) {
res2625[i2626] = i2626;
}
int* E2621;
E2621 = GC_malloc(1000, sizeof(int) );
int i2710;
for(i2710 = 0; i2710 < 1000; i2710++) {
E2621[i2710] = x[0][i2710];
}
E2621[1] = 0;
x[0] = (int*) E2621;
x[1] = (int*) res2625;
int** result;
int L2620;
int L2622;
int res2623;
int L2624;
return x;
}