1 /* Generated by Nim Compiler v1.6.2 */
2 #define NIM_INTBITS 32
3 
4 #include "nimbase.h"
5 #include <setjmp.h>
6 #include <string.h>
7 #undef LANGUAGE_C
8 #undef MIPSEB
9 #undef MIPSEL
10 #undef PPC
11 #undef R3000
12 #undef R4000
13 #undef i386
14 #undef linux
15 #undef mips
16 #undef near
17 #undef far
18 #undef powerpc
19 #undef unix
20 #define nimfr_(x, y)
21 #define nimln_(x, y)
22 typedef struct tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw;
23 typedef struct tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw;
24 typedef struct NimStringDesc NimStringDesc;
25 typedef struct TGenericSeq TGenericSeq;
26 typedef struct tyObject_TType__facALICuu8zUj0hjvbTLFg tyObject_TType__facALICuu8zUj0hjvbTLFg;
27 typedef struct tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q;
28 typedef struct tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ;
29 typedef struct tyObject_TIdent__1LTsGP7bSxg45u9aHcxh6OA tyObject_TIdent__1LTsGP7bSxg45u9aHcxh6OA;
30 typedef struct tySequence__ehmV9bTklH2Gt9cXHV9c0HLeQ tySequence__ehmV9bTklH2Gt9cXHV9c0HLeQ;
31 typedef struct Exception Exception;
32 typedef struct RootObj RootObj;
33 typedef struct TNimType TNimType;
34 typedef struct TNimNode TNimNode;
35 typedef struct tySequence__uB9b75OUPRENsBAu4AnoePA tySequence__uB9b75OUPRENsBAu4AnoePA;
36 typedef struct TSafePoint TSafePoint;
37 typedef struct tyTuple__7q7q3E6Oj24ZNVJb9aonhAg tyTuple__7q7q3E6Oj24ZNVJb9aonhAg;
38 typedef struct tyTuple__kN8up2W6YKc5YA9avn5mV5w tyTuple__kN8up2W6YKc5YA9avn5mV5w;
39 typedef struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g;
40 typedef struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w;
41 typedef struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ;
42 typedef struct tyObject_GcStack__7fytPA5bBsob6See21YMRA tyObject_GcStack__7fytPA5bBsob6See21YMRA;
43 typedef struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg;
44 typedef struct tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ;
45 typedef struct tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg;
46 typedef struct tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw;
47 typedef struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA;
48 typedef struct tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw;
49 typedef struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw;
50 typedef struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg;
51 typedef struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyTuple__ujsjpB2O9cjj3uDHsXbnSzg;
52 typedef struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg;
53 typedef struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ;
54 typedef struct tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg;
55 typedef struct tyObject_TIdObj__KUwfjfUQEwGHguQbTcXu7w tyObject_TIdObj__KUwfjfUQEwGHguQbTcXu7w;
56 typedef struct tyObject_ItemId__ozxAxZLHTQ9c3akTzYvt67g tyObject_ItemId__ozxAxZLHTQ9c3akTzYvt67g;
57 typedef struct tyObject_TLoc__EtHNvCB0bgfu9bFjzx9cb6aA tyObject_TLoc__EtHNvCB0bgfu9bFjzx9cb6aA;
58 typedef struct tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA;
59 typedef struct tyObject_TLib__NBMxlJ6g3utqUlplqTTHkA tyObject_TLib__NBMxlJ6g3utqUlplqTTHkA;
60 typedef struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA;
61 struct TGenericSeq {
62 NI len;
63 NI reserved;
64 };
65 struct NimStringDesc {
66   TGenericSeq Sup;
67 NIM_CHAR data[SEQ_DECL_SIZE];
68 };
69 struct tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q {
70 NU16 line;
71 NI16 col;
72 NI32 fileIndex;
73 };
74 typedef NU32 tySet_tyEnum_TNodeFlag__jyh9acXHkhZANSSvPIY7ZLg;
75 typedef NU8 tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw;
76 struct tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw {
77 tyObject_TType__facALICuu8zUj0hjvbTLFg* typ;
78 tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q info;
79 tySet_tyEnum_TNodeFlag__jyh9acXHkhZANSSvPIY7ZLg flags;
80 tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw kind;
81 union{
82 struct {NI64 intVal;
83 } _kind_1;
84 struct {NF floatVal;
85 } _kind_2;
86 struct {NimStringDesc* strVal;
87 } _kind_3;
88 struct {tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ* sym;
89 } _kind_4;
90 struct {tyObject_TIdent__1LTsGP7bSxg45u9aHcxh6OA* ident;
91 } _kind_5;
92 struct {tySequence__ehmV9bTklH2Gt9cXHV9c0HLeQ* sons;
93 } _kind_6;
94 };
95 };
96 typedef NU8 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A;
97 typedef NU8 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ;
98 typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
99 typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
100 struct TNimType {
101 NI size;
102 NI align;
103 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
104 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
105 TNimType* base;
106 TNimNode* node;
107 void* finalizer;
108 tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
109 tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
110 };
111 struct RootObj {
112 TNimType* m_type;
113 };
114 struct Exception {
115   RootObj Sup;
116 Exception* parent;
117 NCSTRING name;
118 NimStringDesc* message;
119 tySequence__uB9b75OUPRENsBAu4AnoePA* trace;
120 Exception* up;
121 };
122 struct TSafePoint {
123 TSafePoint* prev;
124 NI status;
125 jmp_buf context;
126 };
127 struct tyTuple__7q7q3E6Oj24ZNVJb9aonhAg {
128 NimStringDesc* Field0;
129 NimStringDesc* Field1;
130 NimStringDesc* Field2;
131 };
132 typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
133 struct TNimNode {
134 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
135 NI offset;
136 TNimType* typ;
137 NCSTRING name;
138 NI len;
139 TNimNode** sons;
140 };
141 typedef NU8 tyEnum_TMsgKind__29cbg2fC1z5iM1PAI28kR5w;
142 typedef NU8 tyEnum_TErrorHandling__q4fXoCN3Xdcm6SS9cUkWkWw;
143 struct tyTuple__kN8up2W6YKc5YA9avn5mV5w {
144 NimStringDesc* Field0;
145 NI Field1;
146 NI Field2;
147 };
148 struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g {
149 NI refcount;
150 TNimType* typ;
151 };
152 struct tyObject_GcStack__7fytPA5bBsob6See21YMRA {
153 void* bottom;
154 };
155 struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w {
156 NI len;
157 NI cap;
158 tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g** d;
159 };
160 typedef tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ* tyArray__SPr7N6UKfuF549bNPiUvSRw[256];
161 typedef NU32 tyArray__BHbOSqU1t9b3Gt7K2c6fQig[24];
162 typedef tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* tyArray__N1u1nqOgmuJN9cSZrnMHgOQ[32];
163 typedef tyArray__N1u1nqOgmuJN9cSZrnMHgOQ tyArray__B6durA4ZCi1xjJvRtyYxMg[24];
164 typedef tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw* tyArray__lh2A89ahMmYg9bCmpVaplLbA[256];
165 struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA {
166 tyArray__lh2A89ahMmYg9bCmpVaplLbA data;
167 };
168 typedef tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* tyArray__0aOLqZchNi8nWtMTi8ND8w[2];
169 struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw {
170 tyArray__0aOLqZchNi8nWtMTi8ND8w link;
171 NI key;
172 NI upperBound;
173 NI level;
174 };
175 struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg {
176 tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* Field0;
177 NI Field1;
178 };
179 typedef tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyArray__LzOv2eCDGiceMKQstCLmhw[30];
180 struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg {
181 NI len;
182 tyArray__LzOv2eCDGiceMKQstCLmhw chunks;
183 tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg* next;
184 };
185 struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg {
186 NI minLargeObj;
187 NI maxLargeObj;
188 tyArray__SPr7N6UKfuF549bNPiUvSRw freeSmallChunks;
189 NU32 flBitmap;
190 tyArray__BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
191 tyArray__B6durA4ZCi1xjJvRtyYxMg matrix;
192 tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw* llmem;
193 NI currMem;
194 NI maxMem;
195 NI freeMem;
196 NI occ;
197 NI lastSize;
198 tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA chunkStarts;
199 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* root;
200 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* deleted;
201 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* last;
202 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* freeAvlNodes;
203 NIM_BOOL locked;
204 NIM_BOOL blockChunkSizeIncrease;
205 NI nextChunkSize;
206 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw bottomData;
207 tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg heapLinks;
208 };
209 struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg {
210 NI stackScans;
211 NI cycleCollections;
212 NI maxThreshold;
213 NI maxStackSize;
214 NI maxStackCells;
215 NI cycleTableSize;
216 NI64 maxPause;
217 };
218 struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ {
219 NI counter;
220 NI max;
221 tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg* head;
222 tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg** data;
223 };
224 struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ {
225 tyObject_GcStack__7fytPA5bBsob6See21YMRA stack;
226 NI cycleThreshold;
227 NI zctThreshold;
228 tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w zct;
229 tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w decStack;
230 tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tempStack;
231 NI recGcLock;
232 tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg region;
233 tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg stat;
234 tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ marked;
235 tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w additionalRoots;
236 NI gcThreadId;
237 };
238 struct tyObject_TIdent__1LTsGP7bSxg45u9aHcxh6OA {
239 NI id;
240 NimStringDesc* s;
241 tyObject_TIdent__1LTsGP7bSxg45u9aHcxh6OA* next;
242 NI h;
243 };
244 struct tyObject_ItemId__ozxAxZLHTQ9c3akTzYvt67g {
245 NI32 module;
246 NI32 item;
247 };
248 struct tyObject_TIdObj__KUwfjfUQEwGHguQbTcXu7w {
249   RootObj Sup;
250 tyObject_ItemId__ozxAxZLHTQ9c3akTzYvt67g itemId;
251 };
252 typedef NU8 tyEnum_TSymKind__cNCW9acsSznmEccl1fgQwkw;
253 typedef NU16 tyEnum_TMagic__shZhZOdbVC5nnFvcXQAImg;
254 typedef NU64 tySet_tyEnum_TSymFlag__K9ay6LWMat9bUiT9bIbMxpDHw;
255 typedef NU32 tySet_tyEnum_TOption__WspMeQySXNP2XoTWR5MTgg;
256 typedef NU8 tyEnum_TLocKind__O7PRFZKuiBBWbku09cayVBg;
257 typedef NU8 tyEnum_TStorageLoc__JK9cKMX3XnqHaUky9b6gkGEw;
258 typedef NU16 tySet_tyEnum_TLocFlag__o2bqJgR4ceIupnUSpxiudA;
259 struct tyObject_TLoc__EtHNvCB0bgfu9bFjzx9cb6aA {
260 tyEnum_TLocKind__O7PRFZKuiBBWbku09cayVBg k;
261 tyEnum_TStorageLoc__JK9cKMX3XnqHaUky9b6gkGEw storage;
262 tySet_tyEnum_TLocFlag__o2bqJgR4ceIupnUSpxiudA flags;
263 tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* lode;
264 tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* r;
265 };
266 struct tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ {
267   tyObject_TIdObj__KUwfjfUQEwGHguQbTcXu7w Sup;
268 tyEnum_TSymKind__cNCW9acsSznmEccl1fgQwkw kind;
269 union{
270 struct {tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ* gcUnsafetyReason;
271 tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* transformedBody;
272 } _kind_1;
273 struct {tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ* guard;
274 NI bitsize;
275 NI alignment;
276 } _kind_2;
277 };
278 tyEnum_TMagic__shZhZOdbVC5nnFvcXQAImg magic;
279 tyObject_TType__facALICuu8zUj0hjvbTLFg* typ;
280 tyObject_TIdent__1LTsGP7bSxg45u9aHcxh6OA* name;
281 tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q info;
282 tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ* owner;
283 tySet_tyEnum_TSymFlag__K9ay6LWMat9bUiT9bIbMxpDHw flags;
284 tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* ast;
285 tySet_tyEnum_TOption__WspMeQySXNP2XoTWR5MTgg options;
286 NI position;
287 NI offset;
288 tyObject_TLoc__EtHNvCB0bgfu9bFjzx9cb6aA loc;
289 tyObject_TLib__NBMxlJ6g3utqUlplqTTHkA* annex;
290 tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* constraint;
291 };
292 typedef NU16 tySet_tyEnum_TRenderFlag__wrPgUo1ExBlHvFnXN2nSHw;
293 struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA {
294 NCSTRING procname;
295 NI line;
296 NCSTRING filename;
297 };
298 struct tySequence__ehmV9bTklH2Gt9cXHV9c0HLeQ {
299   TGenericSeq Sup;
300   tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* data[SEQ_DECL_SIZE];
301 };
302 struct tySequence__uB9b75OUPRENsBAu4AnoePA {
303   TGenericSeq Sup;
304   tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA data[SEQ_DECL_SIZE];
305 };
306 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, getModuleName__modulepaths_10)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n);
307 static N_INLINE(void, pushSafePoint)(TSafePoint* s);
308 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, pathSubs__options_4205)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, NimStringDesc* p, NimStringDesc* config);
309 N_LIB_PRIVATE N_NIMCALL(void, nossplitFile)(NimStringDesc* path, tyTuple__7q7q3E6Oj24ZNVJb9aonhAg* Result);
310 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toFullPath__msgs_538)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, NI32 fileIdx);
311 static N_INLINE(void, nimZeroMem)(void* p, NI size);
312 static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
313 static N_INLINE(void, popSafePoint)(void);
314 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, isObj)(TNimType* obj, TNimType* subclass);
315 static N_INLINE(Exception*, nimBorrowCurrentException)(void);
316 N_LIB_PRIVATE N_NOINLINE(void, liMessage__msgs_1118)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q info, tyEnum_TMsgKind__29cbg2fC1z5iM1PAI28kR5w msg, NimStringDesc* arg, tyEnum_TErrorHandling__q4fXoCN3Xdcm6SS9cUkWkWw eh, tyTuple__kN8up2W6YKc5YA9avn5mV5w info2, NIM_BOOL isRaw);
317 static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
318 static N_INLINE(void, copyMem__system_1727)(void* dest, void* source, NI size);
319 static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
320 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
321 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
322 static N_INLINE(void, popCurrentException)(void);
323 static N_INLINE(void, asgnRef)(void** dest, void* src);
324 static N_INLINE(void, incRef__system_5308)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
325 static N_INLINE(NI, pluspercent___system_696)(NI x, NI y);
326 static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__system_5270)(void* usr);
327 static N_INLINE(NI, minuspercent___system_716)(NI x, NI y);
328 static N_INLINE(void, decRef__system_5315)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
329 static N_INLINE(NIM_BOOL, ltpercent___system_1005)(NI x, NI y);
330 static N_INLINE(void, rtlAddZCT__system_5313)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
331 N_LIB_PRIVATE N_NOINLINE(void, addZCT__system_5264)(tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w* s, tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
332 N_LIB_PRIVATE N_NIMCALL(void, reraiseException)(void);
333 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuReplaceStr)(NimStringDesc* s, NimStringDesc* sub, NimStringDesc* by);
334 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, renderTree__renderer_46)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n, tySet_tyEnum_TRenderFlag__wrPgUo1ExBlHvFnXN2nSHw renderFlags);
335 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
336 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuFormatSingleElem)(NimStringDesc* formatstr, NimStringDesc* a);
337 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, findModule__options_4510)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, NimStringDesc* modulename, NimStringDesc* currentModule);
338 static N_INLINE(NIM_BOOL, isEmpty__options_4495)(NimStringDesc* x);
339 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___renderer_2106)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n);
340 N_LIB_PRIVATE N_NIMCALL(NI32, fileInfoIdx__msgs_376)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, NimStringDesc* filename);
341 extern TNimType NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_;
342 STRING_LITERAL(TM__GM5IT6miOywfWPAzqo7pmA_3, "invalid path: ", 14);
343 STRING_LITERAL(TM__GM5IT6miOywfWPAzqo7pmA_5, "/home/runner/work/nightlies/nightlies/nim/compiler/modulepaths.nim", 66);
344 static NIM_CONST tyTuple__kN8up2W6YKc5YA9avn5mV5w TM__GM5IT6miOywfWPAzqo7pmA_4 = {((NimStringDesc*) &TM__GM5IT6miOywfWPAzqo7pmA_5),
345 ((NI) 116),
346 ((NI) 16)}
347 ;
348 STRING_LITERAL(TM__GM5IT6miOywfWPAzqo7pmA_6, " ", 1);
349 STRING_LITERAL(TM__GM5IT6miOywfWPAzqo7pmA_7, "using \'.\' instead of \'/\' in import paths is deprecated", 54);
350 static NIM_CONST tyTuple__kN8up2W6YKc5YA9avn5mV5w TM__GM5IT6miOywfWPAzqo7pmA_8 = {((NimStringDesc*) &TM__GM5IT6miOywfWPAzqo7pmA_5),
351 ((NI) 147),
352 ((NI) 14)}
353 ;
354 STRING_LITERAL(TM__GM5IT6miOywfWPAzqo7pmA_9, ".", 1);
355 STRING_LITERAL(TM__GM5IT6miOywfWPAzqo7pmA_10, "/", 1);
356 STRING_LITERAL(TM__GM5IT6miOywfWPAzqo7pmA_11, "invalid module name: \'$1\'", 25);
357 static NIM_CONST tyTuple__kN8up2W6YKc5YA9avn5mV5w TM__GM5IT6miOywfWPAzqo7pmA_12 = {((NimStringDesc*) &TM__GM5IT6miOywfWPAzqo7pmA_5),
358 ((NI) 152),
359 ((NI) 14)}
360 ;
361 STRING_LITERAL(TM__GM5IT6miOywfWPAzqo7pmA_13, "cannot open file: ", 18);
362 static NIM_CONST tyTuple__kN8up2W6YKc5YA9avn5mV5w TM__GM5IT6miOywfWPAzqo7pmA_14 = {((NimStringDesc*) &TM__GM5IT6miOywfWPAzqo7pmA_5),
363 ((NI) 162),
364 ((NI) 16)}
365 ;
366 extern TSafePoint* excHandler__system_2565;
367 extern TSafePoint* excHandler__system_2565;
368 extern TSafePoint* excHandler__system_2565;
369 extern TSafePoint* excHandler__system_2565;
370 extern Exception* currException__system_2566;
371 extern Exception* currException__system_2566;
372 extern Exception* currException__system_2566;
373 extern tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ gch__system_5217;
N_INLINE(void,pushSafePoint)374 static N_INLINE(void, pushSafePoint)(TSafePoint* s) {
375 	(*s).prev = excHandler__system_2565;
376 	excHandler__system_2565 = s;
377 }
N_INLINE(void,nimSetMem__systemZmemory_7)378 static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) {
379 	void* T1_;
380 	T1_ = (void*)0;
381 	T1_ = memset(a, v, ((size_t) (size)));
382 }
N_INLINE(void,nimZeroMem)383 static N_INLINE(void, nimZeroMem)(void* p, NI size) {
384 	nimSetMem__systemZmemory_7(p, ((int) 0), size);
385 }
N_INLINE(void,popSafePoint)386 static N_INLINE(void, popSafePoint)(void) {
387 	excHandler__system_2565 = (*excHandler__system_2565).prev;
388 }
N_INLINE(Exception *,nimBorrowCurrentException)389 static N_INLINE(Exception*, nimBorrowCurrentException)(void) {
390 	Exception* result;
391 	result = NIM_NIL;
392 	result = currException__system_2566;
393 	return result;
394 }
N_INLINE(void,nimCopyMem)395 static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) {
396 	void* T1_;
397 	T1_ = (void*)0;
398 	T1_ = memcpy(dest, source, ((size_t) (size)));
399 }
N_INLINE(void,copyMem__system_1727)400 static N_INLINE(void, copyMem__system_1727)(void* dest, void* source, NI size) {
401 	nimCopyMem(dest, source, size);
402 }
N_INLINE(void,appendString)403 static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
404 	{
405 		if (!!((src == ((NimStringDesc*) NIM_NIL)))) goto LA3_;
406 		copyMem__system_1727(((void*) ((&(*dest).data[(*dest).Sup.len]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1)))));
407 		(*dest).Sup.len += (*src).Sup.len;
408 	}
409 	LA3_: ;
410 }
N_INLINE(NI,pluspercent___system_696)411 static N_INLINE(NI, pluspercent___system_696)(NI x, NI y) {
412 	NI result;
413 	result = (NI)0;
414 	result = ((NI) ((NU)((NU32)(((NU) (x))) + (NU32)(((NU) (y))))));
415 	return result;
416 }
N_INLINE(void,incRef__system_5308)417 static N_INLINE(void, incRef__system_5308)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
418 	(*c).refcount = pluspercent___system_696((*c).refcount, ((NI) 8));
419 }
N_INLINE(NI,minuspercent___system_716)420 static N_INLINE(NI, minuspercent___system_716)(NI x, NI y) {
421 	NI result;
422 	result = (NI)0;
423 	result = ((NI) ((NU)((NU32)(((NU) (x))) - (NU32)(((NU) (y))))));
424 	return result;
425 }
N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g *,usrToCell__system_5270)426 static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__system_5270)(void* usr) {
427 	tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* result;
428 	NI T1_;
429 	result = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
430 	T1_ = (NI)0;
431 	T1_ = minuspercent___system_716(((NI) (ptrdiff_t) (usr)), ((NI) 8));
432 	result = ((tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*) (T1_));
433 	return result;
434 }
N_INLINE(NIM_BOOL,ltpercent___system_1005)435 static N_INLINE(NIM_BOOL, ltpercent___system_1005)(NI x, NI y) {
436 	NIM_BOOL result;
437 	result = (NIM_BOOL)0;
438 	result = ((NU32)(((NU) (x))) < (NU32)(((NU) (y))));
439 	return result;
440 }
N_INLINE(void,rtlAddZCT__system_5313)441 static N_INLINE(void, rtlAddZCT__system_5313)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
442 	addZCT__system_5264((&gch__system_5217.zct), c);
443 }
N_INLINE(void,decRef__system_5315)444 static N_INLINE(void, decRef__system_5315)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
445 	(*c).refcount = minuspercent___system_716((*c).refcount, ((NI) 8));
446 	{
447 		NIM_BOOL T3_;
448 		T3_ = (NIM_BOOL)0;
449 		T3_ = ltpercent___system_1005((*c).refcount, ((NI) 8));
450 		if (!T3_) goto LA4_;
451 		rtlAddZCT__system_5313(c);
452 	}
453 	LA4_: ;
454 }
N_INLINE(void,asgnRef)455 static N_INLINE(void, asgnRef)(void** dest, void* src) {
456 	{
457 		tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T5_;
458 		if (!!((src == NIM_NIL))) goto LA3_;
459 		T5_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
460 		T5_ = usrToCell__system_5270(src);
461 		incRef__system_5308(T5_);
462 	}
463 	LA3_: ;
464 	{
465 		tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T10_;
466 		if (!!(((*dest) == NIM_NIL))) goto LA8_;
467 		T10_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
468 		T10_ = usrToCell__system_5270((*dest));
469 		decRef__system_5315(T10_);
470 	}
471 	LA8_: ;
472 	(*dest) = src;
473 }
N_INLINE(void,popCurrentException)474 static N_INLINE(void, popCurrentException)(void) {
475 	asgnRef((void**) (&currException__system_2566), (*currException__system_2566).up);
476 }
N_NIMCALL(NimStringDesc *,getModuleName__modulepaths_10)477 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, getModuleName__modulepaths_10)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n) {
478 	NimStringDesc* volatile result;
479 	result = NIM_NIL;
480 	switch ((*n).kind) {
481 	case ((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 20):
482 	case ((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 21):
483 	case ((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 22):
484 	{
485 		TSafePoint TM__GM5IT6miOywfWPAzqo7pmA_2;
486 		NimStringDesc* T2_;
487 		tyTuple__7q7q3E6Oj24ZNVJb9aonhAg T3_;
488 		pushSafePoint(&TM__GM5IT6miOywfWPAzqo7pmA_2);
489 		TM__GM5IT6miOywfWPAzqo7pmA_2.status = setjmp(TM__GM5IT6miOywfWPAzqo7pmA_2.context);
490 		if (TM__GM5IT6miOywfWPAzqo7pmA_2.status == 0) {
491 		T2_ = NIM_NIL;
492 		T2_ = toFullPath__msgs_538(conf, (*n).info.fileIndex);
493 		nimZeroMem((void*)(&T3_), sizeof(tyTuple__7q7q3E6Oj24ZNVJb9aonhAg));
494 		nossplitFile(T2_, (&T3_));
495 		result = pathSubs__options_4205(conf, (*n)._kind_3.strVal, T3_.Field0);
496 		popSafePoint();
497 		}
498 		else {
499 			popSafePoint();
500 			if (isObj(nimBorrowCurrentException()->Sup.m_type, (&NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_))) {
501 				NimStringDesc* T6_;
502 				TM__GM5IT6miOywfWPAzqo7pmA_2.status = 0;
503 				T6_ = NIM_NIL;
504 				T6_ = rawNewString(((*n)._kind_3.strVal ? (*n)._kind_3.strVal->Sup.len : 0) + 14);
505 appendString(T6_, ((NimStringDesc*) &TM__GM5IT6miOywfWPAzqo7pmA_3));
506 appendString(T6_, (*n)._kind_3.strVal);
507 				liMessage__msgs_1118(conf, (*n).info, ((tyEnum_TMsgKind__29cbg2fC1z5iM1PAI28kR5w) 14), T6_, ((tyEnum_TErrorHandling__q4fXoCN3Xdcm6SS9cUkWkWw) 0), TM__GM5IT6miOywfWPAzqo7pmA_4, NIM_FALSE);
508 				result = copyString((*n)._kind_3.strVal);
509 				popCurrentException();
510 			}
511 		}
512 		if (TM__GM5IT6miOywfWPAzqo7pmA_2.status != 0) reraiseException();
513 	}
514 	break;
515 	case ((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 2):
516 	{
517 		result = copyString((*(*n)._kind_5.ident).s);
518 	}
519 	break;
520 	case ((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 3):
521 	{
522 		result = copyString((*(*(*n)._kind_4.sym).name).s);
523 	}
524 	break;
525 	case ((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 29):
526 	{
527 		tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n0;
528 		tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n1;
529 		NimStringDesc* modname;
530 		NimStringDesc* T10_;
531 		NimStringDesc* T11_;
532 		n0 = (*n)._kind_6.sons->data[((NI) 0)];
533 		n1 = (*n)._kind_6.sons->data[((NI) 1)];
534 		modname = getModuleName__modulepaths_10(conf, (*n)._kind_6.sons->data[((NI) 2)]);
535 		result = getModuleName__modulepaths_10(conf, n1);
536 		T10_ = NIM_NIL;
537 		T10_ = renderTree__renderer_46(n0, 4);
538 		T11_ = NIM_NIL;
539 		T11_ = nsuReplaceStr(T10_, ((NimStringDesc*) &TM__GM5IT6miOywfWPAzqo7pmA_6), ((NimStringDesc*) NIM_NIL));
540 		result = resizeString(result, (T11_ ? T11_->Sup.len : 0) + 0);
541 appendString(result, T11_);
542 		result = resizeString(result, (modname ? modname->Sup.len : 0) + 0);
543 appendString(result, modname);
544 	}
545 	break;
546 	case ((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 30):
547 	{
548 		NimStringDesc* T13_;
549 		T13_ = NIM_NIL;
550 		T13_ = renderTree__renderer_46(n, 4);
551 		result = nsuReplaceStr(T13_, ((NimStringDesc*) &TM__GM5IT6miOywfWPAzqo7pmA_6), ((NimStringDesc*) NIM_NIL));
552 	}
553 	break;
554 	case ((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 45):
555 	{
556 		NimStringDesc* T15_;
557 		liMessage__msgs_1118(conf, (*n).info, ((tyEnum_TMsgKind__29cbg2fC1z5iM1PAI28kR5w) 20), ((NimStringDesc*) &TM__GM5IT6miOywfWPAzqo7pmA_7), ((tyEnum_TErrorHandling__q4fXoCN3Xdcm6SS9cUkWkWw) 0), TM__GM5IT6miOywfWPAzqo7pmA_8, NIM_FALSE);
558 		T15_ = NIM_NIL;
559 		T15_ = renderTree__renderer_46(n, 4);
560 		result = nsuReplaceStr(T15_, ((NimStringDesc*) &TM__GM5IT6miOywfWPAzqo7pmA_9), ((NimStringDesc*) &TM__GM5IT6miOywfWPAzqo7pmA_10));
561 	}
562 	break;
563 	case ((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 78):
564 	{
565 		result = getModuleName__modulepaths_10(conf, (*n)._kind_6.sons->data[((NI) 0)]);
566 	}
567 	break;
568 	default:
569 	{
570 		NimStringDesc* T18_;
571 		NimStringDesc* T19_;
572 		T18_ = NIM_NIL;
573 		T18_ = renderTree__renderer_46(n, 0);
574 		T19_ = NIM_NIL;
575 		T19_ = nsuFormatSingleElem(((NimStringDesc*) &TM__GM5IT6miOywfWPAzqo7pmA_11), T18_);
576 		liMessage__msgs_1118(conf, (*n).info, ((tyEnum_TMsgKind__29cbg2fC1z5iM1PAI28kR5w) 14), T19_, ((tyEnum_TErrorHandling__q4fXoCN3Xdcm6SS9cUkWkWw) 0), TM__GM5IT6miOywfWPAzqo7pmA_12, NIM_FALSE);
577 		result = ((NimStringDesc*) NIM_NIL);
578 	}
579 	break;
580 	}
581 	return result;
582 }
N_INLINE(NIM_BOOL,isEmpty__options_4495)583 static N_INLINE(NIM_BOOL, isEmpty__options_4495)(NimStringDesc* x) {
584 	NIM_BOOL result;
585 	result = (NIM_BOOL)0;
586 	result = ((x ? x->Sup.len : 0) == ((NI) 0));
587 	return result;
588 }
N_NIMCALL(NI32,checkModuleName__modulepaths_21)589 N_LIB_PRIVATE N_NIMCALL(NI32, checkModuleName__modulepaths_21)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n, NIM_BOOL doLocalError) {
590 	NI32 result;
591 	NimStringDesc* modulename;
592 	NimStringDesc* fullPath;
593 	NimStringDesc* T1_;
594 	result = (NI32)0;
595 	modulename = getModuleName__modulepaths_10(conf, n);
596 	T1_ = NIM_NIL;
597 	T1_ = toFullPath__msgs_538(conf, (*n).info.fileIndex);
598 	fullPath = findModule__options_4510(conf, modulename, T1_);
599 	{
600 		NIM_BOOL T4_;
601 		T4_ = (NIM_BOOL)0;
602 		T4_ = isEmpty__options_4495(fullPath);
603 		if (!T4_) goto LA5_;
604 		{
605 			NimStringDesc* m;
606 			NimStringDesc* T16_;
607 			if (!doLocalError) goto LA9_;
608 			{
609 				if (!(((NI) 0) < (modulename ? modulename->Sup.len : 0))) goto LA13_;
610 				m = modulename;
611 			}
612 			goto LA11_;
613 			LA13_: ;
614 			{
615 				m = dollar___renderer_2106(n);
616 			}
617 			LA11_: ;
618 			T16_ = NIM_NIL;
619 			T16_ = rawNewString((m ? m->Sup.len : 0) + 18);
620 appendString(T16_, ((NimStringDesc*) &TM__GM5IT6miOywfWPAzqo7pmA_13));
621 appendString(T16_, m);
622 			liMessage__msgs_1118(conf, (*n).info, ((tyEnum_TMsgKind__29cbg2fC1z5iM1PAI28kR5w) 14), T16_, ((tyEnum_TErrorHandling__q4fXoCN3Xdcm6SS9cUkWkWw) 0), TM__GM5IT6miOywfWPAzqo7pmA_14, NIM_FALSE);
623 		}
624 		LA9_: ;
625 		result = ((NI32) -1);
626 	}
627 	goto LA2_;
628 	LA5_: ;
629 	{
630 		result = fileInfoIdx__msgs_376(conf, fullPath);
631 	}
632 	LA2_: ;
633 	return result;
634 }
635