This repository has been archived by the owner on Oct 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathcompiler_gorgeimpl.c
554 lines (535 loc) · 23.3 KB
/
compiler_gorgeimpl.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
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
/* Generated by Nim Compiler v0.19.0 */
/* (c) 2018 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_NEW_MANGLING_RULES
#define NIM_INTBITS 64
#include "nimbase.h"
#include <string.h>
#include <setjmp.h>
#include <stdio.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyObject_TLineInfo_WGx4rAexNXnczy1Avn646Q tyObject_TLineInfo_WGx4rAexNXnczy1Avn646Q;
typedef struct tyObject_ConfigRefcolonObjectType__LaK09ayL9alwKUad7rts0rTw tyObject_ConfigRefcolonObjectType__LaK09ayL9alwKUad7rts0rTw;
typedef struct tyTuple_XOVT24GHXwqiEj5GCsEGCA tyTuple_XOVT24GHXwqiEj5GCsEGCA;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Exception Exception;
typedef struct RootObj RootObj;
typedef struct tySequence_uB9b75OUPRENsBAu4AnoePA tySequence_uB9b75OUPRENsBAu4AnoePA;
typedef struct TSafePoint TSafePoint;
typedef struct tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg;
typedef struct tyObject_StringTableObj_V5PVrt9bIxZEeV7lfvqqtNg tyObject_StringTableObj_V5PVrt9bIxZEeV7lfvqqtNg;
typedef struct tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ;
typedef struct tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g;
typedef struct tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w;
typedef struct tyObject_GcHeap_1TRH1TZMaVZTnLNcIHuNFQ tyObject_GcHeap_1TRH1TZMaVZTnLNcIHuNFQ;
typedef struct tyObject_GcStack_7fytPA5bBsob6See21YMRA tyObject_GcStack_7fytPA5bBsob6See21YMRA;
typedef struct tyObject_MemRegion_x81NhDv59b8ercDZ9bi85jyg tyObject_MemRegion_x81NhDv59b8ercDZ9bi85jyg;
typedef struct tyObject_SmallChunk_tXn60W2f8h3jgAYdEmy5NQ tyObject_SmallChunk_tXn60W2f8h3jgAYdEmy5NQ;
typedef struct tyObject_BigChunk_Rv9c70Uhp2TytkX7eH78qEg tyObject_BigChunk_Rv9c70Uhp2TytkX7eH78qEg;
typedef struct tyObject_LLChunk_XsENErzHIZV9bhvyJx56wGw tyObject_LLChunk_XsENErzHIZV9bhvyJx56wGw;
typedef struct tyObject_IntSet_EZObFrE3NC9bIb3YMkY9crZA tyObject_IntSet_EZObFrE3NC9bIb3YMkY9crZA;
typedef struct tyObject_Trunk_W0r8S0Y3UGke6T9bIUWnnuw tyObject_Trunk_W0r8S0Y3UGke6T9bIUWnnuw;
typedef struct tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw;
typedef struct tyObject_HeapLinks_PDV1HBZ8CQSQJC9aOBFNRSg tyObject_HeapLinks_PDV1HBZ8CQSQJC9aOBFNRSg;
typedef struct tyTuple_ujsjpB2O9cjj3uDHsXbnSzg tyTuple_ujsjpB2O9cjj3uDHsXbnSzg;
typedef struct tyObject_GcStat_0RwLoVBHZPfUAcLczmfQAg tyObject_GcStat_0RwLoVBHZPfUAcLczmfQAg;
typedef struct tyObject_CellSet_jG87P0AI9aZtss9ccTYBIISQ tyObject_CellSet_jG87P0AI9aZtss9ccTYBIISQ;
typedef struct tyObject_PageDesc_fublkgIY4LG3mT51LU2WHg tyObject_PageDesc_fublkgIY4LG3mT51LU2WHg;
typedef struct tyObject_StackTraceEntry_oLyohQ7O2XOvGnflOss8EA tyObject_StackTraceEntry_oLyohQ7O2XOvGnflOss8EA;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct tyObject_TLineInfo_WGx4rAexNXnczy1Avn646Q {
NU16 line;
NI16 col;
NI32 fileIndex;
};
struct tyTuple_XOVT24GHXwqiEj5GCsEGCA {
NimStringDesc* Field0;
NI Field1;
};
typedef NU8 tyEnum_TNimKind_jIBKr1ejBgsfM33Kxw4j7A;
typedef NU8 tySet_tyEnum_TNimTypeFlag_v8QUszD1sWlSIWZz7mC4bQ;
typedef N_NIMCALL_PTR(void, tyProc_ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, tyProc_WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
struct TNimType {
NI size;
tyEnum_TNimKind_jIBKr1ejBgsfM33Kxw4j7A kind;
tySet_tyEnum_TNimTypeFlag_v8QUszD1sWlSIWZz7mC4bQ flags;
TNimType* base;
TNimNode* node;
void* finalizer;
tyProc_ojoeKfW4VYIm36I9cpDTQIg marker;
tyProc_WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
typedef NU8 tyEnum_TNimNodeKind_unfNsxrcATrufDZmpBq4HQ;
struct TNimNode {
tyEnum_TNimNodeKind_unfNsxrcATrufDZmpBq4HQ kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
typedef NU8 tyArray_YtcvxHNKV4YiecPE9ap1mcA[20];
typedef NU8 tyEnum_FileMode_fVUBHvW79bXUw1j55Oo9avSQ;
struct RootObj {
TNimType* m_type;
};
struct Exception {
RootObj Sup;
Exception* parent;
NCSTRING name;
NimStringDesc* message;
tySequence_uB9b75OUPRENsBAu4AnoePA* trace;
NU raise_id;
Exception* up;
};
typedef struct {
N_NIMCALL_PTR(NIM_BOOL, ClP_0) (Exception* e, void* ClE_0);
void* ClE_0;
} tyProc_NT9bSe2DDkjdtx7j9aov2Z6g;
struct TSafePoint {
TSafePoint* prev;
NI status;
jmp_buf context;
NIM_BOOL hasRaiseAction;
tyProc_NT9bSe2DDkjdtx7j9aov2Z6g raiseAction;
};
typedef NU8 tySet_tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA;
typedef NimStringDesc* tyArray_8ZvwQIddfpj2THRVPsFzIQ[1];
struct tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g {
NI refcount;
TNimType* typ;
};
struct tyObject_GcStack_7fytPA5bBsob6See21YMRA {
void* bottom;
};
struct tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w {
NI len;
NI cap;
tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g** d;
};
typedef tyObject_SmallChunk_tXn60W2f8h3jgAYdEmy5NQ* tyArray_SiRwrEKZdLgxqz9a9aoVBglg[512];
typedef NU32 tyArray_BHbOSqU1t9b3Gt7K2c6fQig[24];
typedef tyObject_BigChunk_Rv9c70Uhp2TytkX7eH78qEg* tyArray_N1u1nqOgmuJN9cSZrnMHgOQ[32];
typedef tyArray_N1u1nqOgmuJN9cSZrnMHgOQ tyArray_B6durA4ZCi1xjJvRtyYxMg[24];
typedef tyObject_Trunk_W0r8S0Y3UGke6T9bIUWnnuw* tyArray_lh2A89ahMmYg9bCmpVaplLbA[256];
struct tyObject_IntSet_EZObFrE3NC9bIb3YMkY9crZA {
tyArray_lh2A89ahMmYg9bCmpVaplLbA data;
};
typedef tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw* tyArray_0aOLqZchNi8nWtMTi8ND8w[2];
struct tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw {
tyArray_0aOLqZchNi8nWtMTi8ND8w link;
NI key;
NI upperBound;
NI level;
};
struct tyTuple_ujsjpB2O9cjj3uDHsXbnSzg {
tyObject_BigChunk_Rv9c70Uhp2TytkX7eH78qEg* Field0;
NI Field1;
};
typedef tyTuple_ujsjpB2O9cjj3uDHsXbnSzg tyArray_LzOv2eCDGiceMKQstCLmhw[30];
struct tyObject_HeapLinks_PDV1HBZ8CQSQJC9aOBFNRSg {
NI len;
tyArray_LzOv2eCDGiceMKQstCLmhw chunks;
tyObject_HeapLinks_PDV1HBZ8CQSQJC9aOBFNRSg* next;
};
struct tyObject_MemRegion_x81NhDv59b8ercDZ9bi85jyg {
NI minLargeObj;
NI maxLargeObj;
tyArray_SiRwrEKZdLgxqz9a9aoVBglg freeSmallChunks;
NU32 flBitmap;
tyArray_BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
tyArray_B6durA4ZCi1xjJvRtyYxMg matrix;
tyObject_LLChunk_XsENErzHIZV9bhvyJx56wGw* llmem;
NI currMem;
NI maxMem;
NI freeMem;
NI occ;
NI lastSize;
tyObject_IntSet_EZObFrE3NC9bIb3YMkY9crZA chunkStarts;
tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw* root;
tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw* deleted;
tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw* last;
tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw* freeAvlNodes;
NIM_BOOL locked;
NIM_BOOL blockChunkSizeIncrease;
NI nextChunkSize;
tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw bottomData;
tyObject_HeapLinks_PDV1HBZ8CQSQJC9aOBFNRSg heapLinks;
};
struct tyObject_GcStat_0RwLoVBHZPfUAcLczmfQAg {
NI stackScans;
NI cycleCollections;
NI maxThreshold;
NI maxStackSize;
NI maxStackCells;
NI cycleTableSize;
NI64 maxPause;
};
struct tyObject_CellSet_jG87P0AI9aZtss9ccTYBIISQ {
NI counter;
NI max;
tyObject_PageDesc_fublkgIY4LG3mT51LU2WHg* head;
tyObject_PageDesc_fublkgIY4LG3mT51LU2WHg** data;
};
struct tyObject_GcHeap_1TRH1TZMaVZTnLNcIHuNFQ {
tyObject_GcStack_7fytPA5bBsob6See21YMRA stack;
NI cycleThreshold;
tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w zct;
tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w decStack;
tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w tempStack;
NI recGcLock;
tyObject_MemRegion_x81NhDv59b8ercDZ9bi85jyg region;
tyObject_GcStat_0RwLoVBHZPfUAcLczmfQAg stat;
tyObject_CellSet_jG87P0AI9aZtss9ccTYBIISQ marked;
tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w additionalRoots;
NI gcThreadId;
};
struct tyObject_StackTraceEntry_oLyohQ7O2XOvGnflOss8EA {
NCSTRING procname;
NI line;
NCSTRING filename;
};
struct tySequence_uB9b75OUPRENsBAu4AnoePA {
TGenericSeq Sup;
tyObject_StackTraceEntry_oLyohQ7O2XOvGnflOss8EA data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, genericReset)(void* dest, TNimType* mt);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosparentDir)(NimStringDesc* path);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toFullPath_tdNdBP9cVqODPZCeXYb1GvA)(tyObject_ConfigRefcolonObjectType__LaK09ayL9alwKUad7rts0rTw* conf, NI32 fileIdx);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem_cNwQQ4PlSJsZSwvoN5Uafwsystem)(void* a, int v, NI size);
N_LIB_PRIVATE N_NIMCALL(void, secureHash_EXfqX32pW1lnNt34KrEaBg)(NimStringDesc* str, tyArray_YtcvxHNKV4YiecPE9ap1mcA Result);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
static N_INLINE(void, copyMem_E1xtACub5WcDa3vbrIXbwgsystem)(void* dest, void* source, NI size);
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toGeneratedFile_9bcMIEimlTw8WtgU9crIa4Rg)(tyObject_ConfigRefcolonObjectType__LaK09ayL9alwKUad7rts0rTw* conf, NimStringDesc* path, NimStringDesc* ext);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar__9cgKBrLNcxzFztdSZGMv5ZA)(tyArray_YtcvxHNKV4YiecPE9ap1mcA self);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, open_sEp0GH2306oGo9bqBpj5oTQ)(FILE** f, NimStringDesc* filename, tyEnum_FileMode_fVUBHvW79bXUw1j55Oo9avSQ mode, NI bufSize);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, readAll_y7iEIBoIrYlvsLCqA1SrwQ)(FILE* file);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_LIB_PRIVATE N_NIMCALL(void, close_BWnr8V7RERYno9bIdPmw8Hw_3)(FILE* f);
static N_INLINE(void, pushSafePoint)(TSafePoint* s);
N_LIB_PRIVATE N_NIMCALL(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg*, nospstartProcess)(NimStringDesc* command, NimStringDesc* workingDir, NimStringDesc** args, NI argsLen_0, tyObject_StringTableObj_V5PVrt9bIxZEeV7lfvqqtNg* env, tySet_tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA options);
N_LIB_PRIVATE N_NIMCALL(void, write_ilJq6ezua9cBxEFehuCAG9bg)(tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* s, NimStringDesc* x);
N_LIB_PRIVATE N_NIMCALL(tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ*, nospinputStream)(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p);
N_LIB_PRIVATE N_NIMCALL(void, close_Xz3YiEzNrT9cUBndwi4hNjw)(tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* s);
N_LIB_PRIVATE N_NIMCALL(void, readOutput_L39bfsU0iC6XDNIbeI5awjQ)(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p, tyTuple_XOVT24GHXwqiEj5GCsEGCA* Result);
N_LIB_PRIVATE N_NIMCALL(tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ*, nospoutputStream)(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, atEnd_5ebsEcBZaoqxCkfDcpzdgg)(tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* s);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, readLine_KN3I0OGVr9bF9acs3y6DWpiA)(tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* s);
N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
N_NIMCALL(NimStringDesc*, setLengthStr)(NimStringDesc* s, NI newLen);
N_LIB_PRIVATE N_NIMCALL(NI, nospwaitForExit)(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p, NI timeout);
N_LIB_PRIVATE N_NIMCALL(void, writeFile_c1B29b0ZdDRPHc27YaKqwaA)(NimStringDesc* filename, NimStringDesc* content);
static N_INLINE(void, popSafePoint)(void);
N_NIMCALL(NIM_BOOL, isObj)(TNimType* obj, TNimType* subclass);
static N_INLINE(Exception*, getCurrentException)(void);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
static N_INLINE(void, popCurrentException)(void);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incRef_9cAA5YuQAAC3MVbnGeV86swsystem)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem)(void* usr);
static N_INLINE(void, decRef_MV4BBk6J1qu70IbBxwEn4wsystem)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(void, rtlAddZCT_MV4BBk6J1qu70IbBxwEn4w_2system)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_PRIVATE N_NOINLINE(void, addZCT_fCDI7oO1NNVXXURtxSzsRw)(tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w* s, tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
N_NIMCALL(void, reraiseException)(void);
TNimType NTI_XOVT24GHXwqiEj5GCsEGCA_;
extern TNimType NTI_77mFvmsOLKik79ci2hXkHEg_;
extern TNimType NTI_rR5Bzr1D5krxoo1NcNyeMA_;
extern TSafePoint* excHandler_rqLlY5bs9atDw2OXYqJEn5g;
extern TNimType NTI_iLZrPn9anoh9ad1MmO0RczFw_;
extern Exception* currException_9bVPeDJlYTi9bQApZpfH8wjg;
extern TNimType NTI_BeJgrOdDsczOwEWOZbRfKA_;
extern tyObject_GcHeap_1TRH1TZMaVZTnLNcIHuNFQ gch_IcYaEuuWivYAS86vFMTS3Q;
STRING_LITERAL(TM_69a9b06YSkBJW7wqzuZfJ29aQ_3, "\011", 1);
STRING_LITERAL(TM_69a9b06YSkBJW7wqzuZfJ29aQ_4, "gorge_", 6);
STRING_LITERAL(TM_69a9b06YSkBJW7wqzuZfJ29aQ_5, "txt", 3);
STRING_LITERAL(TM_69a9b06YSkBJW7wqzuZfJ29aQ_7, "\012", 1);
NIM_CONST tyTuple_XOVT24GHXwqiEj5GCsEGCA TM_69a9b06YSkBJW7wqzuZfJ29aQ_8 = {((NimStringDesc*) NIM_NIL),
((NI) -1)}
;
static N_INLINE(void, nimSetMem_cNwQQ4PlSJsZSwvoN5Uafwsystem)(void* a, int v, NI size) {
void* T1_;
T1_ = (void*)0;
T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
nimSetMem_cNwQQ4PlSJsZSwvoN5Uafwsystem(p, ((int) 0), size);
}
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) {
void* T1_;
T1_ = (void*)0;
T1_ = memcpy(dest, source, ((size_t) (size)));
}
static N_INLINE(void, copyMem_E1xtACub5WcDa3vbrIXbwgsystem)(void* dest, void* source, NI size) {
nimCopyMem(dest, source, size);
}
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
{
if (!!((src == NIM_NIL))) goto LA3_;
copyMem_E1xtACub5WcDa3vbrIXbwgsystem(((void*) ((&(*dest).data[((*dest).Sup.len)- 0]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1)))));
(*dest).Sup.len += (*src).Sup.len;
}
LA3_: ;
}
static N_INLINE(void, pushSafePoint)(TSafePoint* s) {
(*s).hasRaiseAction = NIM_FALSE;
(*s).prev = excHandler_rqLlY5bs9atDw2OXYqJEn5g;
excHandler_rqLlY5bs9atDw2OXYqJEn5g = s;
}
N_LIB_PRIVATE N_NIMCALL(void, readOutput_L39bfsU0iC6XDNIbeI5awjQ)(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p, tyTuple_XOVT24GHXwqiEj5GCsEGCA* Result) {
tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* output;
genericReset((void*)Result, (&NTI_XOVT24GHXwqiEj5GCsEGCA_));
unsureAsgnRef((void**) (&(*Result).Field0), ((NimStringDesc*) NIM_NIL));
output = nospoutputStream(p);
{
while (1) {
NIM_BOOL T3_;
NimStringDesc* T4_;
T3_ = (NIM_BOOL)0;
T3_ = atEnd_5ebsEcBZaoqxCkfDcpzdgg(output);
if (!!(T3_)) goto LA2;
T4_ = (NimStringDesc*)0;
T4_ = readLine_KN3I0OGVr9bF9acs3y6DWpiA(output);
unsureAsgnRef((void**) (&(*Result).Field0), resizeString((*Result).Field0, (T4_ ? T4_->Sup.len : 0) + 0));
appendString((*Result).Field0, T4_);
unsureAsgnRef((void**) (&(*Result).Field0), resizeString((*Result).Field0, 1));
appendString((*Result).Field0, ((NimStringDesc*) &TM_69a9b06YSkBJW7wqzuZfJ29aQ_7));
} LA2: ;
}
{
if (!(((NI) 0) < ((*Result).Field0 ? (*Result).Field0->Sup.len : 0))) goto LA7_;
unsureAsgnRef((void**) (&(*Result).Field0), setLengthStr((*Result).Field0, ((NI) ((NI)(((*Result).Field0 ? (*Result).Field0->Sup.len : 0) - ((NI) 1))))));
}
LA7_: ;
(*Result).Field1 = nospwaitForExit(p, ((NI) -1));
}
static N_INLINE(void, popSafePoint)(void) {
excHandler_rqLlY5bs9atDw2OXYqJEn5g = (*excHandler_rqLlY5bs9atDw2OXYqJEn5g).prev;
}
static N_INLINE(Exception*, getCurrentException)(void) {
Exception* result;
result = (Exception*)0;
result = currException_9bVPeDJlYTi9bQApZpfH8wjg;
return result;
}
static N_INLINE(void, incRef_9cAA5YuQAAC3MVbnGeV86swsystem)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c) {
(*c).refcount = (NI)((NU64)((*c).refcount) + (NU64)(((NI) 8)));
}
static N_INLINE(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem)(void* usr) {
tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* result;
result = (tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*)0;
result = ((tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*) ((NI)((NU64)(((NI) (ptrdiff_t) (usr))) - (NU64)(((NI)sizeof(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g))))));
return result;
}
static N_INLINE(void, rtlAddZCT_MV4BBk6J1qu70IbBxwEn4w_2system)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c) {
addZCT_fCDI7oO1NNVXXURtxSzsRw((&gch_IcYaEuuWivYAS86vFMTS3Q.zct), c);
}
static N_INLINE(void, decRef_MV4BBk6J1qu70IbBxwEn4wsystem)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c) {
{
(*c).refcount -= ((NI) 8);
if (!((NU64)((*c).refcount) < (NU64)(((NI) 8)))) goto LA3_;
rtlAddZCT_MV4BBk6J1qu70IbBxwEn4w_2system(c);
}
LA3_: ;
}
static N_INLINE(void, asgnRef)(void** dest, void* src) {
{
tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* T5_;
if (!!((src == NIM_NIL))) goto LA3_;
T5_ = (tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*)0;
T5_ = usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem(src);
incRef_9cAA5YuQAAC3MVbnGeV86swsystem(T5_);
}
LA3_: ;
{
tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* T10_;
if (!!(((*dest) == NIM_NIL))) goto LA8_;
T10_ = (tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*)0;
T10_ = usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem((*dest));
decRef_MV4BBk6J1qu70IbBxwEn4wsystem(T10_);
}
LA8_: ;
(*dest) = src;
}
static N_INLINE(void, popCurrentException)(void) {
asgnRef((void**) (&currException_9bVPeDJlYTi9bQApZpfH8wjg), (*currException_9bVPeDJlYTi9bQApZpfH8wjg).up);
}
N_LIB_PRIVATE N_NIMCALL(void, opGorge_BjvODCrbmWn89cyUmTGZz0A)(NimStringDesc* cmd, NimStringDesc* input, NimStringDesc* cache, tyObject_TLineInfo_WGx4rAexNXnczy1Avn646Q info, tyObject_ConfigRefcolonObjectType__LaK09ayL9alwKUad7rts0rTw* conf, tyTuple_XOVT24GHXwqiEj5GCsEGCA* Result) {
NimStringDesc* workingDir;
NimStringDesc* T1_;
{ genericReset((void*)Result, (&NTI_XOVT24GHXwqiEj5GCsEGCA_));
T1_ = (NimStringDesc*)0;
T1_ = toFullPath_tdNdBP9cVqODPZCeXYb1GvA(conf, info.fileIndex);
workingDir = nosparentDir(T1_);
{
tyArray_YtcvxHNKV4YiecPE9ap1mcA h;
NimStringDesc* T6_;
NimStringDesc* filename;
NimStringDesc* T7_;
NimStringDesc* T8_;
FILE* f;
NIM_BOOL volatile readSuccessful;
TSafePoint TM_69a9b06YSkBJW7wqzuZfJ29aQ_6;
if (!(((NI) 0) < (cache ? cache->Sup.len : 0))) goto LA4_;
nimZeroMem((void*)h, sizeof(tyArray_YtcvxHNKV4YiecPE9ap1mcA));
T6_ = (NimStringDesc*)0;
T6_ = rawNewString((cmd ? cmd->Sup.len : 0) + (input ? input->Sup.len : 0) + (cache ? cache->Sup.len : 0) + 2);
appendString(T6_, cmd);
appendString(T6_, ((NimStringDesc*) &TM_69a9b06YSkBJW7wqzuZfJ29aQ_3));
appendString(T6_, input);
appendString(T6_, ((NimStringDesc*) &TM_69a9b06YSkBJW7wqzuZfJ29aQ_3));
appendString(T6_, cache);
secureHash_EXfqX32pW1lnNt34KrEaBg(T6_, h);
T7_ = (NimStringDesc*)0;
T8_ = (NimStringDesc*)0;
T8_ = dollar__9cgKBrLNcxzFztdSZGMv5ZA(h);
T7_ = rawNewString((T8_ ? T8_->Sup.len : 0) + 6);
appendString(T7_, ((NimStringDesc*) &TM_69a9b06YSkBJW7wqzuZfJ29aQ_4));
appendString(T7_, T8_);
filename = toGeneratedFile_9bcMIEimlTw8WtgU9crIa4Rg(conf, T7_, ((NimStringDesc*) &TM_69a9b06YSkBJW7wqzuZfJ29aQ_5));
f = (FILE*)0;
{
NIM_BOOL T11_;
T11_ = (NIM_BOOL)0;
T11_ = open_sEp0GH2306oGo9bqBpj5oTQ(&f, filename, ((tyEnum_FileMode_fVUBHvW79bXUw1j55Oo9avSQ) 0), ((NI) -1));
if (!T11_) goto LA12_;
unsureAsgnRef((void**) (&(*Result).Field0), readAll_y7iEIBoIrYlvsLCqA1SrwQ(f));
(*Result).Field1 = ((NI) 0);
close_BWnr8V7RERYno9bIdPmw8Hw_3(f);
goto BeforeRet_;
}
LA12_: ;
readSuccessful = NIM_FALSE;
pushSafePoint(&TM_69a9b06YSkBJW7wqzuZfJ29aQ_6);
TM_69a9b06YSkBJW7wqzuZfJ29aQ_6.status = _setjmp(TM_69a9b06YSkBJW7wqzuZfJ29aQ_6.context);
if (TM_69a9b06YSkBJW7wqzuZfJ29aQ_6.status == 0) {
tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p;
tyArray_8ZvwQIddfpj2THRVPsFzIQ T15_;
nimZeroMem((void*)T15_, sizeof(tyArray_8ZvwQIddfpj2THRVPsFzIQ));
p = nospstartProcess(cmd, workingDir, T15_, 0, NIM_NIL, 12);
{
tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* T20_;
tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* T21_;
if (!!(((input ? input->Sup.len : 0) == ((NI) 0)))) goto LA18_;
T20_ = (tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ*)0;
T20_ = nospinputStream(p);
write_ilJq6ezua9cBxEFehuCAG9bg(T20_, input);
T21_ = (tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ*)0;
T21_ = nospinputStream(p);
close_Xz3YiEzNrT9cUBndwi4hNjw(T21_);
}
LA18_: ;
readOutput_L39bfsU0iC6XDNIbeI5awjQ(p, Result);
readSuccessful = NIM_TRUE;
{
if (!((*Result).Field1 == ((NI) 0))) goto LA24_;
writeFile_c1B29b0ZdDRPHc27YaKqwaA(filename, (*Result).Field0);
}
LA24_: ;
popSafePoint();
}
else {
popSafePoint();
if (isObj(getCurrentException()->Sup.m_type, (&NTI_iLZrPn9anoh9ad1MmO0RczFw_))||isObj(getCurrentException()->Sup.m_type, (&NTI_BeJgrOdDsczOwEWOZbRfKA_))) {
TM_69a9b06YSkBJW7wqzuZfJ29aQ_6.status = 0;
{
if (!!(readSuccessful)) goto LA30_;
unsureAsgnRef((void**) (&(*Result).Field0), copyString(TM_69a9b06YSkBJW7wqzuZfJ29aQ_8.Field0));
(*Result).Field1 = TM_69a9b06YSkBJW7wqzuZfJ29aQ_8.Field1;
}
LA30_: ;
popCurrentException();
}
}
if (TM_69a9b06YSkBJW7wqzuZfJ29aQ_6.status != 0) reraiseException();
}
goto LA2_;
LA4_: ;
{
TSafePoint TM_69a9b06YSkBJW7wqzuZfJ29aQ_9;
pushSafePoint(&TM_69a9b06YSkBJW7wqzuZfJ29aQ_9);
TM_69a9b06YSkBJW7wqzuZfJ29aQ_9.status = _setjmp(TM_69a9b06YSkBJW7wqzuZfJ29aQ_9.context);
if (TM_69a9b06YSkBJW7wqzuZfJ29aQ_9.status == 0) {
tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p_2;
tyArray_8ZvwQIddfpj2THRVPsFzIQ T34_;
nimZeroMem((void*)T34_, sizeof(tyArray_8ZvwQIddfpj2THRVPsFzIQ));
p_2 = nospstartProcess(cmd, workingDir, T34_, 0, NIM_NIL, 12);
{
tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* T39_;
tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* T40_;
if (!!(((input ? input->Sup.len : 0) == ((NI) 0)))) goto LA37_;
T39_ = (tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ*)0;
T39_ = nospinputStream(p_2);
write_ilJq6ezua9cBxEFehuCAG9bg(T39_, input);
T40_ = (tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ*)0;
T40_ = nospinputStream(p_2);
close_Xz3YiEzNrT9cUBndwi4hNjw(T40_);
}
LA37_: ;
readOutput_L39bfsU0iC6XDNIbeI5awjQ(p_2, Result);
popSafePoint();
}
else {
popSafePoint();
if (isObj(getCurrentException()->Sup.m_type, (&NTI_iLZrPn9anoh9ad1MmO0RczFw_))||isObj(getCurrentException()->Sup.m_type, (&NTI_BeJgrOdDsczOwEWOZbRfKA_))) {
TM_69a9b06YSkBJW7wqzuZfJ29aQ_9.status = 0;
unsureAsgnRef((void**) (&(*Result).Field0), copyString(TM_69a9b06YSkBJW7wqzuZfJ29aQ_8.Field0));
(*Result).Field1 = TM_69a9b06YSkBJW7wqzuZfJ29aQ_8.Field1;
popCurrentException();
}
}
if (TM_69a9b06YSkBJW7wqzuZfJ29aQ_9.status != 0) reraiseException();
}
LA2_: ;
}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, compiler_gorgeimplInit000)(void) {
{
TFrame FR_; FR_.len = 0;
}
}
N_LIB_PRIVATE N_NIMCALL(void, compiler_gorgeimplDatInit000)(void) {
static TNimNode* TM_69a9b06YSkBJW7wqzuZfJ29aQ_2[2];
static TNimNode TM_69a9b06YSkBJW7wqzuZfJ29aQ_0[3];
NTI_XOVT24GHXwqiEj5GCsEGCA_.size = sizeof(tyTuple_XOVT24GHXwqiEj5GCsEGCA);
NTI_XOVT24GHXwqiEj5GCsEGCA_.kind = 18;
NTI_XOVT24GHXwqiEj5GCsEGCA_.base = 0;
NTI_XOVT24GHXwqiEj5GCsEGCA_.flags = 2;
TM_69a9b06YSkBJW7wqzuZfJ29aQ_2[0] = &TM_69a9b06YSkBJW7wqzuZfJ29aQ_0[1];
TM_69a9b06YSkBJW7wqzuZfJ29aQ_0[1].kind = 1;
TM_69a9b06YSkBJW7wqzuZfJ29aQ_0[1].offset = offsetof(tyTuple_XOVT24GHXwqiEj5GCsEGCA, Field0);
TM_69a9b06YSkBJW7wqzuZfJ29aQ_0[1].typ = (&NTI_77mFvmsOLKik79ci2hXkHEg_);
TM_69a9b06YSkBJW7wqzuZfJ29aQ_0[1].name = "Field0";
TM_69a9b06YSkBJW7wqzuZfJ29aQ_2[1] = &TM_69a9b06YSkBJW7wqzuZfJ29aQ_0[2];
TM_69a9b06YSkBJW7wqzuZfJ29aQ_0[2].kind = 1;
TM_69a9b06YSkBJW7wqzuZfJ29aQ_0[2].offset = offsetof(tyTuple_XOVT24GHXwqiEj5GCsEGCA, Field1);
TM_69a9b06YSkBJW7wqzuZfJ29aQ_0[2].typ = (&NTI_rR5Bzr1D5krxoo1NcNyeMA_);
TM_69a9b06YSkBJW7wqzuZfJ29aQ_0[2].name = "Field1";
TM_69a9b06YSkBJW7wqzuZfJ29aQ_0[0].len = 2; TM_69a9b06YSkBJW7wqzuZfJ29aQ_0[0].kind = 2; TM_69a9b06YSkBJW7wqzuZfJ29aQ_0[0].sons = &TM_69a9b06YSkBJW7wqzuZfJ29aQ_2[0];
NTI_XOVT24GHXwqiEj5GCsEGCA_.node = &TM_69a9b06YSkBJW7wqzuZfJ29aQ_0[0];
}