-
Notifications
You must be signed in to change notification settings - Fork 0
/
merged.c
230 lines (202 loc) · 4.33 KB
/
merged.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
/* Generated by Frama-C */
typedef unsigned long a_0;
struct __anonstruct_e_1 {
int b ;
int c ;
unsigned long *d ;
};
typedef struct __anonstruct_e_1 *e;
typedef a_0 *b_0;
typedef unsigned long size_t;
typedef unsigned long __uint64_t;
typedef struct __anonstruct_e_1 e_0;
typedef long c;
typedef unsigned int d;
typedef e_0 e_1[1];
typedef int ab;
void *(*__gmp_allocate_func)();
void __gmpz_init_set_ui(e dest, unsigned long l)
{
dest->d = (unsigned long *)(*__gmp_allocate_func)(sizeof(a_0));
*(dest->d + 0) = l;
return;
}
void __gmpz_lucnum2_ui(e g_0, e h, unsigned long i_0)
{
g_0->c = 1;
return;
}
/* compiler builtin:
void *__builtin_alloca(unsigned int); */
long an;
long ao;
long ar;
void *__gmpz_realloc(e_0 *m, long o);
void __gmpn_sqr(unsigned long *d, unsigned long *a_0, long e);
void __gmpz_lucnum_ui(struct __anonstruct_e_1 *au, unsigned long g_0)
{
long av;
b_0 aw;
b_0 ax;
a_0 aj;
b_0 ak;
av = (long)2;
if (av) aw = (b_0)__gmpz_realloc(au,av); else aw = (a_0 *)0;
an = (long)2;
ax = (b_0)__builtin_alloca((unsigned int)((unsigned long)an * (unsigned long)sizeof(0)));
while (1) {
b_0 q;
if (g_0 & (unsigned long)1) {
ar = (long)4;
break;
}
q = ax;
ax = aw;
aw = q;
g_0 /= (unsigned long)2;
if (g_0 <= (unsigned long)2) {
*(aw + 0) = (unsigned long)2;
break;
}
}
__gmpn_sqr(ax,aw,ao);
ak = ax;
aj = *ak;
*ak = aj - (a_0)2;
return;
}
//extern int ( /* missing proto */ __builtin_bswap32)(int x_0);
__inline static unsigned int __bswap_32(unsigned int __bsx)
{
unsigned int __retres;
int tmp;
tmp = __builtin_bswap32((int)__bsx);
__retres = (unsigned int)tmp;
return __retres;
}
//extern int ( /* missing proto */ __builtin_bswap64)(unsigned long x_0);
__inline static __uint64_t __bswap_64(__uint64_t __bsx)
{
__uint64_t __retres;
int tmp;
tmp = __builtin_bswap64(__bsx);
__retres = (unsigned long)tmp;
return __retres;
}
extern __attribute__((__nothrow__)) void *malloc(size_t __size) __attribute__((
__malloc__, __leaf__));
extern __attribute__((__nothrow__)) void *realloc(void *__ptr, size_t __size) __attribute__((
__warn_unused_result__, __leaf__));
void *a(size_t c);
void *b(void *e, size_t f, size_t g_0);
void *(*__gmp_allocate_func)() = & a;
void *(*__gmp_reallocate_func)() = & b;
void *a(size_t c)
{
void *d;
d = malloc(c);
return d;
}
void *b(void *e, size_t f, size_t g_0)
{
void *d;
d = realloc(e,g_0);
return d;
}
void *__gmpz_realloc(e_0 *m, long o)
{
void *__retres;
a_0 *mp;
mp = (a_0 *)(*__gmp_reallocate_func)(m->d,sizeof(0),sizeof(a_0));
m->d = mp;
__retres = (void *)mp;
return __retres;
}
long p;
long __gmpn_sqr_basecase_lpl;
void __gmpn_sqr_basecase(unsigned long *q, unsigned long *r, long n)
{
c i_0;
d j_0;
d k;
c m;
c o;
p = (long)*(r + 0);
m = p;
j_0 = (unsigned int)m;
o = (long)j_0;
k = (unsigned int)o;
i_0 = (long)(j_0 * k);
__gmpn_sqr_basecase_lpl = i_0;
*(q + 0) = (unsigned long)__gmpn_sqr_basecase_lpl;
return;
}
void __gmpn_sqr(unsigned long *d, unsigned long *a_0, long e)
{
__gmpn_sqr_basecase(d,a_0,e);
return;
}
e_1 g;
e_1 j;
e_1 i;
int __gmpz_cmp(e t, e u);
extern int printf(char const * __restrict __format , ...);
__inline static unsigned int __bswap_65(unsigned int __bsx)
{
unsigned int __retres;
int tmp;
tmp = __builtin_bswap32((int)__bsx);
__retres = (unsigned int)tmp;
return __retres;
}
__inline static __uint64_t __bswap_66(__uint64_t __bsx)
{
__uint64_t __retres;
int tmp;
tmp = __builtin_bswap64(__bsx);
__retres = (unsigned long)tmp;
return __retres;
}
extern __attribute__((__nothrow__, __noreturn__)) void abort(void) __attribute__((
__leaf__));
extern __attribute__((__nothrow__, __noreturn__)) void exit(int __status) __attribute__((
__leaf__));
int main(void)
{
int __retres;
int tmp;
__gmpz_init_set_ui(g,(unsigned long)2);
__gmpz_lucnum2_ui(j,i,(unsigned long)0);
__gmpz_lucnum_ui(j,(unsigned long)0);
tmp = __gmpz_cmp(j,g);
if (tmp) {
printf("mpz_lucnum_ui0 wrong\n");
abort();
}
exit(0);
return __retres;
}
ab s;
ab ac;
a_0 *ad;
a_0 *ae;
int __gmpz_cmp(e t, e u)
{
int af;
ab l;
a_0 m;
a_0 n;
s = t->c;
ac = s;
ad = t->d;
ae = u->d;
af = 0;
l = ac;
l --;
if (l >= 0) {
m = *(ad + l);
n = *(ae + l);
if (m != n) af = 1;
}
return af;
}