1 /* Generated by Nim Compiler v1.6.2 */
2 #define NIM_INTBITS 32
3 #define NIM_EmulateOverflowChecks
4 
5 #include "nimbase.h"
6 #undef LANGUAGE_C
7 #undef MIPSEB
8 #undef MIPSEL
9 #undef PPC
10 #undef R3000
11 #undef R4000
12 #undef i386
13 #undef linux
14 #undef mips
15 #undef near
16 #undef far
17 #undef powerpc
18 #undef unix
19 #define nimfr_(x, y)
20 #define nimln_(x, y)
21 typedef struct tySequence__6H5Oh5UUvVCLiakt9aTwtUQ tySequence__6H5Oh5UUvVCLiakt9aTwtUQ;
22 typedef struct TGenericSeq TGenericSeq;
23 typedef struct TNimType TNimType;
24 typedef struct TNimNode TNimNode;
25 struct TGenericSeq {
26 NI len;
27 NI reserved;
28 };
29 typedef NU8 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A;
30 typedef NU8 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ;
31 typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
32 typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
33 struct TNimType {
34 NI size;
35 NI align;
36 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
37 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
38 TNimType* base;
39 TNimNode* node;
40 void* finalizer;
41 tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
42 tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
43 };
44 typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
45 struct TNimNode {
46 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
47 NI offset;
48 TNimType* typ;
49 NCSTRING name;
50 NI len;
51 TNimNode** sons;
52 };
53 typedef NU8 tyArray__PgpowgA9aFQHq0cr9b7SoUgw[256];
54 struct tySequence__6H5Oh5UUvVCLiakt9aTwtUQ {
55   TGenericSeq Sup;
56   NU8 data[SEQ_DECL_SIZE];
57 };
58 N_LIB_PRIVATE N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
59 N_LIB_PRIVATE N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
60 extern TNimType NTIseqLbyteT__6H5Oh5UUvVCLiakt9aTwtUQ_;
61 N_LIB_PRIVATE NIM_CONST tyArray__PgpowgA9aFQHq0cr9b7SoUgw populationCount__bitsets_212 = {((NU8) 0),
62 ((NU8) 1),
63 ((NU8) 1),
64 ((NU8) 2),
65 ((NU8) 1),
66 ((NU8) 2),
67 ((NU8) 2),
68 ((NU8) 3),
69 ((NU8) 1),
70 ((NU8) 2),
71 ((NU8) 2),
72 ((NU8) 3),
73 ((NU8) 2),
74 ((NU8) 3),
75 ((NU8) 3),
76 ((NU8) 4),
77 ((NU8) 1),
78 ((NU8) 2),
79 ((NU8) 2),
80 ((NU8) 3),
81 ((NU8) 2),
82 ((NU8) 3),
83 ((NU8) 3),
84 ((NU8) 4),
85 ((NU8) 2),
86 ((NU8) 3),
87 ((NU8) 3),
88 ((NU8) 4),
89 ((NU8) 3),
90 ((NU8) 4),
91 ((NU8) 4),
92 ((NU8) 5),
93 ((NU8) 1),
94 ((NU8) 2),
95 ((NU8) 2),
96 ((NU8) 3),
97 ((NU8) 2),
98 ((NU8) 3),
99 ((NU8) 3),
100 ((NU8) 4),
101 ((NU8) 2),
102 ((NU8) 3),
103 ((NU8) 3),
104 ((NU8) 4),
105 ((NU8) 3),
106 ((NU8) 4),
107 ((NU8) 4),
108 ((NU8) 5),
109 ((NU8) 2),
110 ((NU8) 3),
111 ((NU8) 3),
112 ((NU8) 4),
113 ((NU8) 3),
114 ((NU8) 4),
115 ((NU8) 4),
116 ((NU8) 5),
117 ((NU8) 3),
118 ((NU8) 4),
119 ((NU8) 4),
120 ((NU8) 5),
121 ((NU8) 4),
122 ((NU8) 5),
123 ((NU8) 5),
124 ((NU8) 6),
125 ((NU8) 1),
126 ((NU8) 2),
127 ((NU8) 2),
128 ((NU8) 3),
129 ((NU8) 2),
130 ((NU8) 3),
131 ((NU8) 3),
132 ((NU8) 4),
133 ((NU8) 2),
134 ((NU8) 3),
135 ((NU8) 3),
136 ((NU8) 4),
137 ((NU8) 3),
138 ((NU8) 4),
139 ((NU8) 4),
140 ((NU8) 5),
141 ((NU8) 2),
142 ((NU8) 3),
143 ((NU8) 3),
144 ((NU8) 4),
145 ((NU8) 3),
146 ((NU8) 4),
147 ((NU8) 4),
148 ((NU8) 5),
149 ((NU8) 3),
150 ((NU8) 4),
151 ((NU8) 4),
152 ((NU8) 5),
153 ((NU8) 4),
154 ((NU8) 5),
155 ((NU8) 5),
156 ((NU8) 6),
157 ((NU8) 2),
158 ((NU8) 3),
159 ((NU8) 3),
160 ((NU8) 4),
161 ((NU8) 3),
162 ((NU8) 4),
163 ((NU8) 4),
164 ((NU8) 5),
165 ((NU8) 3),
166 ((NU8) 4),
167 ((NU8) 4),
168 ((NU8) 5),
169 ((NU8) 4),
170 ((NU8) 5),
171 ((NU8) 5),
172 ((NU8) 6),
173 ((NU8) 3),
174 ((NU8) 4),
175 ((NU8) 4),
176 ((NU8) 5),
177 ((NU8) 4),
178 ((NU8) 5),
179 ((NU8) 5),
180 ((NU8) 6),
181 ((NU8) 4),
182 ((NU8) 5),
183 ((NU8) 5),
184 ((NU8) 6),
185 ((NU8) 5),
186 ((NU8) 6),
187 ((NU8) 6),
188 ((NU8) 7),
189 ((NU8) 1),
190 ((NU8) 2),
191 ((NU8) 2),
192 ((NU8) 3),
193 ((NU8) 2),
194 ((NU8) 3),
195 ((NU8) 3),
196 ((NU8) 4),
197 ((NU8) 2),
198 ((NU8) 3),
199 ((NU8) 3),
200 ((NU8) 4),
201 ((NU8) 3),
202 ((NU8) 4),
203 ((NU8) 4),
204 ((NU8) 5),
205 ((NU8) 2),
206 ((NU8) 3),
207 ((NU8) 3),
208 ((NU8) 4),
209 ((NU8) 3),
210 ((NU8) 4),
211 ((NU8) 4),
212 ((NU8) 5),
213 ((NU8) 3),
214 ((NU8) 4),
215 ((NU8) 4),
216 ((NU8) 5),
217 ((NU8) 4),
218 ((NU8) 5),
219 ((NU8) 5),
220 ((NU8) 6),
221 ((NU8) 2),
222 ((NU8) 3),
223 ((NU8) 3),
224 ((NU8) 4),
225 ((NU8) 3),
226 ((NU8) 4),
227 ((NU8) 4),
228 ((NU8) 5),
229 ((NU8) 3),
230 ((NU8) 4),
231 ((NU8) 4),
232 ((NU8) 5),
233 ((NU8) 4),
234 ((NU8) 5),
235 ((NU8) 5),
236 ((NU8) 6),
237 ((NU8) 3),
238 ((NU8) 4),
239 ((NU8) 4),
240 ((NU8) 5),
241 ((NU8) 4),
242 ((NU8) 5),
243 ((NU8) 5),
244 ((NU8) 6),
245 ((NU8) 4),
246 ((NU8) 5),
247 ((NU8) 5),
248 ((NU8) 6),
249 ((NU8) 5),
250 ((NU8) 6),
251 ((NU8) 6),
252 ((NU8) 7),
253 ((NU8) 2),
254 ((NU8) 3),
255 ((NU8) 3),
256 ((NU8) 4),
257 ((NU8) 3),
258 ((NU8) 4),
259 ((NU8) 4),
260 ((NU8) 5),
261 ((NU8) 3),
262 ((NU8) 4),
263 ((NU8) 4),
264 ((NU8) 5),
265 ((NU8) 4),
266 ((NU8) 5),
267 ((NU8) 5),
268 ((NU8) 6),
269 ((NU8) 3),
270 ((NU8) 4),
271 ((NU8) 4),
272 ((NU8) 5),
273 ((NU8) 4),
274 ((NU8) 5),
275 ((NU8) 5),
276 ((NU8) 6),
277 ((NU8) 4),
278 ((NU8) 5),
279 ((NU8) 5),
280 ((NU8) 6),
281 ((NU8) 5),
282 ((NU8) 6),
283 ((NU8) 6),
284 ((NU8) 7),
285 ((NU8) 3),
286 ((NU8) 4),
287 ((NU8) 4),
288 ((NU8) 5),
289 ((NU8) 4),
290 ((NU8) 5),
291 ((NU8) 5),
292 ((NU8) 6),
293 ((NU8) 4),
294 ((NU8) 5),
295 ((NU8) 5),
296 ((NU8) 6),
297 ((NU8) 5),
298 ((NU8) 6),
299 ((NU8) 6),
300 ((NU8) 7),
301 ((NU8) 4),
302 ((NU8) 5),
303 ((NU8) 5),
304 ((NU8) 6),
305 ((NU8) 5),
306 ((NU8) 6),
307 ((NU8) 6),
308 ((NU8) 7),
309 ((NU8) 5),
310 ((NU8) 6),
311 ((NU8) 6),
312 ((NU8) 7),
313 ((NU8) 6),
314 ((NU8) 7),
315 ((NU8) 7),
316 ((NU8) 8)}
317 ;
N_NIMCALL(void,bitSetInit__bitsets_10)318 N_LIB_PRIVATE N_NIMCALL(void, bitSetInit__bitsets_10)(tySequence__6H5Oh5UUvVCLiakt9aTwtUQ** b, NI length) {
319 	unsureAsgnRef((void**) (&(*b)), (tySequence__6H5Oh5UUvVCLiakt9aTwtUQ*) newSeq((&NTIseqLbyteT__6H5Oh5UUvVCLiakt9aTwtUQ_), ((NI) (length))));
320 }
N_NIMCALL(void,bitSetIncl__bitsets_25)321 N_LIB_PRIVATE N_NIMCALL(void, bitSetIncl__bitsets_25)(tySequence__6H5Oh5UUvVCLiakt9aTwtUQ** x, NI64 elem) {
322 	(*x)->data[(NI64)((NI64)(elem) >> (NU64)(((NI) 3)))] = (NU8)((*x)->data[(NI64)((NI64)(elem) >> (NU64)(((NI) 3)))] | (NU8)((NU64)(((NU8) 1)) << (NU64)((NI64)(elem & IL64(7)))));
323 }
N_NIMCALL(NI64,bitSetCard__bitsets_40)324 N_LIB_PRIVATE N_NIMCALL(NI64, bitSetCard__bitsets_40)(tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* x) {
325 	NI64 result;
326 	result = (NI64)0;
327 	{
328 		NU8* it;
329 		NI i;
330 		NI L;
331 		NI T2_;
332 		it = (NU8*)0;
333 		i = ((NI) 0);
334 		T2_ = (x ? x->Sup.len : 0);
335 		L = T2_;
336 		{
337 			while (1) {
338 				if (!(i < L)) goto LA4;
339 				it = (&x->data[i]);
340 				result += ((NI) (populationCount__bitsets_212[((*it))- 0]));
341 				i += ((NI) 1);
342 			} LA4: ;
343 		}
344 	}
345 	return result;
346 }
N_NIMCALL(NIM_BOOL,bitSetContains__bitsets_37)347 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, bitSetContains__bitsets_37)(tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* x, tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* y) {
348 	NIM_BOOL result;
349 {	result = (NIM_BOOL)0;
350 	{
351 		NI i;
352 		NI colontmp_;
353 		NI T2_;
354 		NI res;
355 		i = (NI)0;
356 		colontmp_ = (NI)0;
357 		T2_ = ((x ? x->Sup.len : 0)-1);
358 		colontmp_ = T2_;
359 		res = ((NI) 0);
360 		{
361 			while (1) {
362 				if (!(res <= colontmp_)) goto LA4;
363 				i = res;
364 				{
365 					if (!!(((NU8)(x->data[i] & (NU8)((NU8) ~(y->data[i]))) == ((NU8) 0)))) goto LA7_;
366 					result = NIM_FALSE;
367 					goto BeforeRet_;
368 				}
369 				LA7_: ;
370 				res += ((NI) 1);
371 			} LA4: ;
372 		}
373 	}
374 	result = NIM_TRUE;
375 	}BeforeRet_: ;
376 	return result;
377 }
N_NIMCALL(NIM_BOOL,bitSetEquals__bitsets_34)378 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, bitSetEquals__bitsets_34)(tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* x, tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* y) {
379 	NIM_BOOL result;
380 {	result = (NIM_BOOL)0;
381 	{
382 		NI i;
383 		NI colontmp_;
384 		NI T2_;
385 		NI res;
386 		i = (NI)0;
387 		colontmp_ = (NI)0;
388 		T2_ = ((x ? x->Sup.len : 0)-1);
389 		colontmp_ = T2_;
390 		res = ((NI) 0);
391 		{
392 			while (1) {
393 				if (!(res <= colontmp_)) goto LA4;
394 				i = res;
395 				{
396 					if (!!((x->data[i] == y->data[i]))) goto LA7_;
397 					result = NIM_FALSE;
398 					goto BeforeRet_;
399 				}
400 				LA7_: ;
401 				res += ((NI) 1);
402 			} LA4: ;
403 		}
404 	}
405 	result = NIM_TRUE;
406 	}BeforeRet_: ;
407 	return result;
408 }
N_NIMCALL(void,bitSetIntersect__bitsets_22)409 N_LIB_PRIVATE N_NIMCALL(void, bitSetIntersect__bitsets_22)(tySequence__6H5Oh5UUvVCLiakt9aTwtUQ** x, tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* y) {
410 	{
411 		NI i;
412 		NI colontmp_;
413 		NI T2_;
414 		NI res;
415 		i = (NI)0;
416 		colontmp_ = (NI)0;
417 		T2_ = (((*x) ? (*x)->Sup.len : 0)-1);
418 		colontmp_ = T2_;
419 		res = ((NI) 0);
420 		{
421 			while (1) {
422 				if (!(res <= colontmp_)) goto LA4;
423 				i = res;
424 				(*x)->data[i] = (NU8)((*x)->data[i] & y->data[i]);
425 				res += ((NI) 1);
426 			} LA4: ;
427 		}
428 	}
429 }
N_NIMCALL(NIM_BOOL,bitSetIn__bitsets_31)430 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, bitSetIn__bitsets_31)(tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* x, NI64 e) {
431 	NIM_BOOL result;
432 	result = (NIM_BOOL)0;
433 	result = !(((NU8)(x->data[(NI64)((NI64)(e) >> (NU64)(((NI) 3)))] & (NU8)((NU64)(((NU8) 1)) << (NU64)((NI64)(e & IL64(7))))) == ((NU8) 0)));
434 	return result;
435 }
N_NIMCALL(void,bitSetUnion__bitsets_13)436 N_LIB_PRIVATE N_NIMCALL(void, bitSetUnion__bitsets_13)(tySequence__6H5Oh5UUvVCLiakt9aTwtUQ** x, tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* y) {
437 	{
438 		NI i;
439 		NI colontmp_;
440 		NI T2_;
441 		NI res;
442 		i = (NI)0;
443 		colontmp_ = (NI)0;
444 		T2_ = (((*x) ? (*x)->Sup.len : 0)-1);
445 		colontmp_ = T2_;
446 		res = ((NI) 0);
447 		{
448 			while (1) {
449 				if (!(res <= colontmp_)) goto LA4;
450 				i = res;
451 				(*x)->data[i] = (NU8)((*x)->data[i] | y->data[i]);
452 				res += ((NI) 1);
453 			} LA4: ;
454 		}
455 	}
456 }
N_NIMCALL(void,bitSetDiff__bitsets_16)457 N_LIB_PRIVATE N_NIMCALL(void, bitSetDiff__bitsets_16)(tySequence__6H5Oh5UUvVCLiakt9aTwtUQ** x, tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* y) {
458 	{
459 		NI i;
460 		NI colontmp_;
461 		NI T2_;
462 		NI res;
463 		i = (NI)0;
464 		colontmp_ = (NI)0;
465 		T2_ = (((*x) ? (*x)->Sup.len : 0)-1);
466 		colontmp_ = T2_;
467 		res = ((NI) 0);
468 		{
469 			while (1) {
470 				if (!(res <= colontmp_)) goto LA4;
471 				i = res;
472 				(*x)->data[i] = (NU8)((*x)->data[i] & (NU8)((NU8) ~(y->data[i])));
473 				res += ((NI) 1);
474 			} LA4: ;
475 		}
476 	}
477 }
478