1 /* Generated by Nim Compiler v1.6.2 */
2 #define NIM_INTBITS 32
3 
4 #include "nimbase.h"
5 #include <string.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 NimStringDesc NimStringDesc;
22 typedef struct TGenericSeq TGenericSeq;
23 typedef struct tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw;
24 typedef struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA;
25 typedef struct Exception Exception;
26 typedef struct RootObj RootObj;
27 typedef struct TNimType TNimType;
28 typedef struct TNimNode TNimNode;
29 typedef struct tySequence__uB9b75OUPRENsBAu4AnoePA tySequence__uB9b75OUPRENsBAu4AnoePA;
30 typedef struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g;
31 typedef struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w;
32 typedef struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ;
33 typedef struct tyObject_GcStack__7fytPA5bBsob6See21YMRA tyObject_GcStack__7fytPA5bBsob6See21YMRA;
34 typedef struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg;
35 typedef struct tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ;
36 typedef struct tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg;
37 typedef struct tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw;
38 typedef struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA;
39 typedef struct tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw;
40 typedef struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw;
41 typedef struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg;
42 typedef struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyTuple__ujsjpB2O9cjj3uDHsXbnSzg;
43 typedef struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg;
44 typedef struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ;
45 typedef struct tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg;
46 typedef struct tyTuple__jq7X5k7hWG0tdTZTDkiyGQ tyTuple__jq7X5k7hWG0tdTZTDkiyGQ;
47 typedef struct tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q;
48 typedef struct tyObject_Joptions__LkVLf5IMKBOgl3HJApAzgQ tyObject_Joptions__LkVLf5IMKBOgl3HJApAzgQ;
49 typedef struct tyTuple__d8cOxWret6fRDupvUsyoyw tyTuple__d8cOxWret6fRDupvUsyoyw;
50 typedef struct tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ;
51 typedef struct tyObject_OrderedTable__ZZvSdVkA2s2sIyifu4cpkg tyObject_OrderedTable__ZZvSdVkA2s2sIyifu4cpkg;
52 typedef struct tySequence__MlAD6nAPq9bHKla9cWiIZP0g tySequence__MlAD6nAPq9bHKla9cWiIZP0g;
53 typedef struct tySequence__oLpBKXzW3hF9aCVMo5EymfQ tySequence__oLpBKXzW3hF9aCVMo5EymfQ;
54 typedef struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA;
55 typedef struct tyTuple__awOivLjlO76sGdHY7nQUjQ tyTuple__awOivLjlO76sGdHY7nQUjQ;
56 struct TGenericSeq {
57 NI len;
58 NI reserved;
59 };
60 struct NimStringDesc {
61   TGenericSeq Sup;
62 NIM_CHAR data[SEQ_DECL_SIZE];
63 };
64 typedef NU8 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A;
65 typedef NU8 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ;
66 typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
67 typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
68 struct TNimType {
69 NI size;
70 NI align;
71 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
72 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
73 TNimType* base;
74 TNimNode* node;
75 void* finalizer;
76 tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
77 tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
78 };
79 struct RootObj {
80 TNimType* m_type;
81 };
82 struct Exception {
83   RootObj Sup;
84 Exception* parent;
85 NCSTRING name;
86 NimStringDesc* message;
87 tySequence__uB9b75OUPRENsBAu4AnoePA* trace;
88 Exception* up;
89 };
90 struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA {
91   Exception Sup;
92 };
93 struct tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw {
94   tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA Sup;
95 };
96 typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
97 struct TNimNode {
98 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
99 NI offset;
100 TNimType* typ;
101 NCSTRING name;
102 NI len;
103 TNimNode** sons;
104 };
105 struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g {
106 NI refcount;
107 TNimType* typ;
108 };
109 struct tyObject_GcStack__7fytPA5bBsob6See21YMRA {
110 void* bottom;
111 };
112 struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w {
113 NI len;
114 NI cap;
115 tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g** d;
116 };
117 typedef tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ* tyArray__SPr7N6UKfuF549bNPiUvSRw[256];
118 typedef NU32 tyArray__BHbOSqU1t9b3Gt7K2c6fQig[24];
119 typedef tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* tyArray__N1u1nqOgmuJN9cSZrnMHgOQ[32];
120 typedef tyArray__N1u1nqOgmuJN9cSZrnMHgOQ tyArray__B6durA4ZCi1xjJvRtyYxMg[24];
121 typedef tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw* tyArray__lh2A89ahMmYg9bCmpVaplLbA[256];
122 struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA {
123 tyArray__lh2A89ahMmYg9bCmpVaplLbA data;
124 };
125 typedef tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* tyArray__0aOLqZchNi8nWtMTi8ND8w[2];
126 struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw {
127 tyArray__0aOLqZchNi8nWtMTi8ND8w link;
128 NI key;
129 NI upperBound;
130 NI level;
131 };
132 struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg {
133 tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* Field0;
134 NI Field1;
135 };
136 typedef tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyArray__LzOv2eCDGiceMKQstCLmhw[30];
137 struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg {
138 NI len;
139 tyArray__LzOv2eCDGiceMKQstCLmhw chunks;
140 tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg* next;
141 };
142 struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg {
143 NI minLargeObj;
144 NI maxLargeObj;
145 tyArray__SPr7N6UKfuF549bNPiUvSRw freeSmallChunks;
146 NU32 flBitmap;
147 tyArray__BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
148 tyArray__B6durA4ZCi1xjJvRtyYxMg matrix;
149 tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw* llmem;
150 NI currMem;
151 NI maxMem;
152 NI freeMem;
153 NI occ;
154 NI lastSize;
155 tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA chunkStarts;
156 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* root;
157 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* deleted;
158 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* last;
159 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* freeAvlNodes;
160 NIM_BOOL locked;
161 NIM_BOOL blockChunkSizeIncrease;
162 NI nextChunkSize;
163 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw bottomData;
164 tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg heapLinks;
165 };
166 struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg {
167 NI stackScans;
168 NI cycleCollections;
169 NI maxThreshold;
170 NI maxStackSize;
171 NI maxStackCells;
172 NI cycleTableSize;
173 NI64 maxPause;
174 };
175 struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ {
176 NI counter;
177 NI max;
178 tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg* head;
179 tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg** data;
180 };
181 struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ {
182 tyObject_GcStack__7fytPA5bBsob6See21YMRA stack;
183 NI cycleThreshold;
184 NI zctThreshold;
185 tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w zct;
186 tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w decStack;
187 tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tempStack;
188 NI recGcLock;
189 tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg region;
190 tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg stat;
191 tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ marked;
192 tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w additionalRoots;
193 NI gcThreadId;
194 };
195 struct tyTuple__jq7X5k7hWG0tdTZTDkiyGQ {
196 NimStringDesc* Field0;
197 tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* Field1;
198 };
199 struct tyObject_Joptions__LkVLf5IMKBOgl3HJApAzgQ {
200 NIM_BOOL allowExtraKeys;
201 NIM_BOOL allowMissingKeys;
202 };
203 struct tyTuple__d8cOxWret6fRDupvUsyoyw {
204 NimStringDesc* Field0;
205 NimStringDesc* Field1;
206 tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* Field2;
207 };
208 typedef NU8 tyEnum_EnumMode__VBQLiQclXYpinosAjWkfrg;
209 typedef NU8 tyEnum_JsonNodeMode__UTXRaEPTjXpNdVaD9bbN0bQ;
210 struct tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ {
211 tyEnum_EnumMode__VBQLiQclXYpinosAjWkfrg enumMode;
212 tyEnum_JsonNodeMode__UTXRaEPTjXpNdVaD9bbN0bQ jsonNodeMode;
213 };
214 typedef NU8 tyEnum_JsonNodeKind__RUngo7nCHe6O8aBGIcrhtg;
215 struct tyObject_OrderedTable__ZZvSdVkA2s2sIyifu4cpkg {
216 tySequence__MlAD6nAPq9bHKla9cWiIZP0g* data;
217 NI counter;
218 NI first;
219 NI last;
220 };
221 struct tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q {
222 NIM_BOOL isUnquoted;
223 tyEnum_JsonNodeKind__RUngo7nCHe6O8aBGIcrhtg kind;
224 union{
225 struct {NimStringDesc* str;
226 } _kind_1;
227 struct {NI64 num;
228 } _kind_2;
229 struct {NF fnum;
230 } _kind_3;
231 struct {NIM_BOOL bval;
232 } _kind_4;
233 struct {tyObject_OrderedTable__ZZvSdVkA2s2sIyifu4cpkg fields;
234 } _kind_6;
235 struct {tySequence__oLpBKXzW3hF9aCVMo5EymfQ* elems;
236 } _kind_7;
237 };
238 };
239 struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA {
240 NCSTRING procname;
241 NI line;
242 NCSTRING filename;
243 };
244 struct tyTuple__awOivLjlO76sGdHY7nQUjQ {
245 NI Field0;
246 NI Field1;
247 NimStringDesc* Field2;
248 tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* Field3;
249 };
250 struct tySequence__uB9b75OUPRENsBAu4AnoePA {
251   TGenericSeq Sup;
252   tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA data[SEQ_DECL_SIZE];
253 };
254 struct tySequence__MlAD6nAPq9bHKla9cWiIZP0g {
255   TGenericSeq Sup;
256   tyTuple__awOivLjlO76sGdHY7nQUjQ data[SEQ_DECL_SIZE];
257 };
258 struct tySequence__oLpBKXzW3hF9aCVMo5EymfQ {
259   TGenericSeq Sup;
260   tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* data[SEQ_DECL_SIZE];
261 };
262 N_LIB_PRIVATE N_NOINLINE(void*, newObj)(TNimType* typ, NI size);
263 static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
264 static N_INLINE(void, copyMem__system_1727)(void* dest, void* source, NI size);
265 static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
266 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
267 static N_INLINE(void, asgnRef)(void** dest, void* src);
268 static N_INLINE(void, incRef__system_5300)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
269 static N_INLINE(NI, pluspercent___system_696)(NI x, NI y);
270 static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__system_5262)(void* usr);
271 static N_INLINE(NI, minuspercent___system_716)(NI x, NI y);
272 static N_INLINE(void, decRef__system_5307)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
273 static N_INLINE(NIM_BOOL, ltpercent___system_1005)(NI x, NI y);
274 static N_INLINE(void, rtlAddZCT__system_5305)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
275 N_LIB_PRIVATE N_NOINLINE(void, addZCT__system_5256)(tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w* s, tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
276 N_LIB_PRIVATE N_NIMCALL(void, raiseExceptionEx)(Exception* e, NCSTRING ename, NCSTRING procname, NCSTRING filename, NI line);
277 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
278 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
279 N_LIB_PRIVATE N_NIMCALL(void, addQuoted__pureZos_449)(NimStringDesc** s, NimStringDesc* x);
280 N_LIB_PRIVATE N_NIMCALL(void, addQuoted__stdZjsonutils_444)(NimStringDesc** s, tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* x);
281 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___pureZjson_4465)(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* node);
282 N_LIB_PRIVATE N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
283 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, eqeq___pureZjson_2044)(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* a, tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* b);
284 N_LIB_PRIVATE N_NOINLINE(void, raiseJsonException__stdZjsonutils_168)(NimStringDesc* condStr, NimStringDesc* msg);
285 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___stdZjsonutils_407)(tyTuple__jq7X5k7hWG0tdTZTDkiyGQ x);
286 static N_INLINE(void, nimZeroMem)(void* p, NI size);
287 static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
288 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, to__stdZjsonutils_581)(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* node);
289 N_LIB_PRIVATE N_NIMCALL(void, initFromJson__pureZjson_5260)(NimStringDesc** dst, tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* jsonNode, NimStringDesc** jsonPath);
290 N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, percent___pureZjson_1790)(NimStringDesc* s);
291 extern TNimType NTIrefvalueerror__Ie1m0dv1ZHg72IgPRr1cDw_;
292 extern TNimType NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_;
293 STRING_LITERAL(TM__D9aPSI6l3gZsoFvdx9c3FKBg_2, " failed: ", 9);
294 STRING_LITERAL(TM__D9aPSI6l3gZsoFvdx9c3FKBg_3, "(", 1);
295 STRING_LITERAL(TM__D9aPSI6l3gZsoFvdx9c3FKBg_4, ", ", 2);
296 STRING_LITERAL(TM__D9aPSI6l3gZsoFvdx9c3FKBg_5, "nil", 3);
297 STRING_LITERAL(TM__D9aPSI6l3gZsoFvdx9c3FKBg_6, ",", 1);
298 STRING_LITERAL(TM__D9aPSI6l3gZsoFvdx9c3FKBg_7, ")", 1);
299 STRING_LITERAL(TM__D9aPSI6l3gZsoFvdx9c3FKBg_8, "\012not (b == nil)", 15);
300 STRING_LITERAL(TM__D9aPSI6l3gZsoFvdx9c3FKBg_9, "string", 6);
301 extern tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ gch__system_5209;
N_INLINE(void,nimCopyMem)302 static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) {
303 	void* T1_;
304 	T1_ = (void*)0;
305 	T1_ = memcpy(dest, source, ((size_t) (size)));
306 }
N_INLINE(void,copyMem__system_1727)307 static N_INLINE(void, copyMem__system_1727)(void* dest, void* source, NI size) {
308 	nimCopyMem(dest, source, size);
309 }
N_INLINE(void,appendString)310 static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
311 	{
312 		if (!!((src == ((NimStringDesc*) NIM_NIL)))) goto LA3_;
313 		copyMem__system_1727(((void*) ((&(*dest).data[(*dest).Sup.len]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1)))));
314 		(*dest).Sup.len += (*src).Sup.len;
315 	}
316 	LA3_: ;
317 }
N_INLINE(NI,pluspercent___system_696)318 static N_INLINE(NI, pluspercent___system_696)(NI x, NI y) {
319 	NI result;
320 	result = (NI)0;
321 	result = ((NI) ((NU)((NU32)(((NU) (x))) + (NU32)(((NU) (y))))));
322 	return result;
323 }
N_INLINE(void,incRef__system_5300)324 static N_INLINE(void, incRef__system_5300)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
325 	(*c).refcount = pluspercent___system_696((*c).refcount, ((NI) 8));
326 }
N_INLINE(NI,minuspercent___system_716)327 static N_INLINE(NI, minuspercent___system_716)(NI x, NI y) {
328 	NI result;
329 	result = (NI)0;
330 	result = ((NI) ((NU)((NU32)(((NU) (x))) - (NU32)(((NU) (y))))));
331 	return result;
332 }
N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g *,usrToCell__system_5262)333 static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__system_5262)(void* usr) {
334 	tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* result;
335 	NI T1_;
336 	result = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
337 	T1_ = (NI)0;
338 	T1_ = minuspercent___system_716(((NI) (ptrdiff_t) (usr)), ((NI) 8));
339 	result = ((tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*) (T1_));
340 	return result;
341 }
N_INLINE(NIM_BOOL,ltpercent___system_1005)342 static N_INLINE(NIM_BOOL, ltpercent___system_1005)(NI x, NI y) {
343 	NIM_BOOL result;
344 	result = (NIM_BOOL)0;
345 	result = ((NU32)(((NU) (x))) < (NU32)(((NU) (y))));
346 	return result;
347 }
N_INLINE(void,rtlAddZCT__system_5305)348 static N_INLINE(void, rtlAddZCT__system_5305)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
349 	addZCT__system_5256((&gch__system_5209.zct), c);
350 }
N_INLINE(void,decRef__system_5307)351 static N_INLINE(void, decRef__system_5307)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
352 	(*c).refcount = minuspercent___system_716((*c).refcount, ((NI) 8));
353 	{
354 		NIM_BOOL T3_;
355 		T3_ = (NIM_BOOL)0;
356 		T3_ = ltpercent___system_1005((*c).refcount, ((NI) 8));
357 		if (!T3_) goto LA4_;
358 		rtlAddZCT__system_5305(c);
359 	}
360 	LA4_: ;
361 }
N_INLINE(void,asgnRef)362 static N_INLINE(void, asgnRef)(void** dest, void* src) {
363 	{
364 		tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T5_;
365 		if (!!((src == NIM_NIL))) goto LA3_;
366 		T5_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
367 		T5_ = usrToCell__system_5262(src);
368 		incRef__system_5300(T5_);
369 	}
370 	LA3_: ;
371 	{
372 		tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T10_;
373 		if (!!(((*dest) == NIM_NIL))) goto LA8_;
374 		T10_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
375 		T10_ = usrToCell__system_5262((*dest));
376 		decRef__system_5307(T10_);
377 	}
378 	LA8_: ;
379 	(*dest) = src;
380 }
N_NOINLINE(void,raiseJsonException__stdZjsonutils_168)381 N_LIB_PRIVATE N_NOINLINE(void, raiseJsonException__stdZjsonutils_168)(NimStringDesc* condStr, NimStringDesc* msg) {
382 	tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw* T1_;
383 	NimStringDesc* T2_;
384 	T1_ = NIM_NIL;
385 	T1_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*) newObj((&NTIrefvalueerror__Ie1m0dv1ZHg72IgPRr1cDw_), sizeof(tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw));
386 	(*T1_).Sup.Sup.Sup.m_type = (&NTIvalueerror__yoNlBGx0D2tRizIdhQuENw_);
387 	(*T1_).Sup.Sup.name = "ValueError";
388 	T2_ = NIM_NIL;
389 	T2_ = rawNewString((condStr ? condStr->Sup.len : 0) + (msg ? msg->Sup.len : 0) + 9);
390 appendString(T2_, condStr);
391 appendString(T2_, ((NimStringDesc*) &TM__D9aPSI6l3gZsoFvdx9c3FKBg_2));
392 appendString(T2_, msg);
393 	asgnRef((void**) (&(*T1_).Sup.Sup.message), T2_);
394 	asgnRef((void**) (&(*T1_).Sup.Sup.parent), ((Exception*) NIM_NIL));
395 	raiseExceptionEx((Exception*)T1_, "ValueError", "raiseJsonException", "jsonutils.nim", 134);
396 }
N_NIMCALL(void,addQuoted__stdZjsonutils_444)397 N_LIB_PRIVATE N_NIMCALL(void, addQuoted__stdZjsonutils_444)(NimStringDesc** s, tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* x) {
398 	NimStringDesc* T1_;
399 	T1_ = NIM_NIL;
400 	T1_ = dollar___pureZjson_4465(x);
401 	unsureAsgnRef((void**) (&(*s)), resizeString((*s), (T1_ ? T1_->Sup.len : 0) + 0));
402 appendString((*s), T1_);
403 }
N_NIMCALL(NimStringDesc *,dollar___stdZjsonutils_407)404 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___stdZjsonutils_407)(tyTuple__jq7X5k7hWG0tdTZTDkiyGQ x) {
405 	NimStringDesc* result;
406 	NI count;
407 	result = NIM_NIL;
408 	result = copyString(((NimStringDesc*) &TM__D9aPSI6l3gZsoFvdx9c3FKBg_3));
409 	count = ((NI) 0);
410 	{
411 		if (!(((NI) 0) < count)) goto LA3_;
412 		result = resizeString(result, 2);
413 appendString(result, ((NimStringDesc*) &TM__D9aPSI6l3gZsoFvdx9c3FKBg_4));
414 	}
415 	LA3_: ;
416 	count += ((NI) 1);
417 	addQuoted__pureZos_449((&result), x.Field0);
418 	{
419 		if (!(((NI) 0) < count)) goto LA7_;
420 		result = resizeString(result, 2);
421 appendString(result, ((NimStringDesc*) &TM__D9aPSI6l3gZsoFvdx9c3FKBg_4));
422 	}
423 	LA7_: ;
424 	count += ((NI) 1);
425 	{
426 		if (!(x.Field1 == 0)) goto LA11_;
427 		result = resizeString(result, 3);
428 appendString(result, ((NimStringDesc*) &TM__D9aPSI6l3gZsoFvdx9c3FKBg_5));
429 	}
430 	goto LA9_;
431 	LA11_: ;
432 	{
433 		addQuoted__stdZjsonutils_444((&result), x.Field1);
434 	}
435 	LA9_: ;
436 	{
437 		if (!(count == ((NI) 1))) goto LA16_;
438 		result = resizeString(result, 1);
439 appendString(result, ((NimStringDesc*) &TM__D9aPSI6l3gZsoFvdx9c3FKBg_6));
440 	}
441 	LA16_: ;
442 	result = resizeString(result, 1);
443 appendString(result, ((NimStringDesc*) &TM__D9aPSI6l3gZsoFvdx9c3FKBg_7));
444 	return result;
445 }
N_INLINE(void,nimSetMem__systemZmemory_7)446 static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) {
447 	void* T1_;
448 	T1_ = (void*)0;
449 	T1_ = memset(a, v, ((size_t) (size)));
450 }
N_INLINE(void,nimZeroMem)451 static N_INLINE(void, nimZeroMem)(void* p, NI size) {
452 	nimSetMem__systemZmemory_7(p, ((int) 0), size);
453 }
N_NIMCALL(NimStringDesc *,to__stdZjsonutils_581)454 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, to__stdZjsonutils_581)(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* node) {
455 	NimStringDesc* result;
456 	NimStringDesc* jsonPath;
457 	result = NIM_NIL;
458 	jsonPath = ((NimStringDesc*) NIM_NIL);
459 	initFromJson__pureZjson_5260((&result), node, (&jsonPath));
460 	return result;
461 }
N_NIMCALL(void,fromJson__stdZjsonutils_566)462 N_LIB_PRIVATE N_NIMCALL(void, fromJson__stdZjsonutils_566)(NimStringDesc** a, tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* b, tyObject_Joptions__LkVLf5IMKBOgl3HJApAzgQ opt) {
463 	{
464 		NIM_BOOL T3_;
465 		tyTuple__jq7X5k7hWG0tdTZTDkiyGQ T6_;
466 		NimStringDesc* T7_;
467 		T3_ = (NIM_BOOL)0;
468 		T3_ = eqeq___pureZjson_2044(b, ((tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*) NIM_NIL));
469 		if (!!(!(T3_))) goto LA4_;
470 		nimZeroMem((void*)(&T6_), sizeof(tyTuple__jq7X5k7hWG0tdTZTDkiyGQ));
471 		T6_.Field0 = copyString(((NimStringDesc*) &TM__D9aPSI6l3gZsoFvdx9c3FKBg_9));
472 		T6_.Field1 = b;
473 		T7_ = NIM_NIL;
474 		T7_ = dollar___stdZjsonutils_407(T6_);
475 		raiseJsonException__stdZjsonutils_168(((NimStringDesc*) &TM__D9aPSI6l3gZsoFvdx9c3FKBg_8), T7_);
476 	}
477 	LA4_: ;
478 	unsureAsgnRef((void**) (&(*a)), to__stdZjsonutils_581(b));
479 }
N_NIMCALL(NimStringDesc *,dollar___stdZjsonutils_504)480 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___stdZjsonutils_504)(tyTuple__d8cOxWret6fRDupvUsyoyw x) {
481 	NimStringDesc* result;
482 	NI count;
483 	result = NIM_NIL;
484 	result = copyString(((NimStringDesc*) &TM__D9aPSI6l3gZsoFvdx9c3FKBg_3));
485 	count = ((NI) 0);
486 	{
487 		if (!(((NI) 0) < count)) goto LA3_;
488 		result = resizeString(result, 2);
489 appendString(result, ((NimStringDesc*) &TM__D9aPSI6l3gZsoFvdx9c3FKBg_4));
490 	}
491 	LA3_: ;
492 	count += ((NI) 1);
493 	addQuoted__pureZos_449((&result), x.Field0);
494 	{
495 		if (!(((NI) 0) < count)) goto LA7_;
496 		result = resizeString(result, 2);
497 appendString(result, ((NimStringDesc*) &TM__D9aPSI6l3gZsoFvdx9c3FKBg_4));
498 	}
499 	LA7_: ;
500 	count += ((NI) 1);
501 	addQuoted__pureZos_449((&result), x.Field1);
502 	{
503 		if (!(((NI) 0) < count)) goto LA11_;
504 		result = resizeString(result, 2);
505 appendString(result, ((NimStringDesc*) &TM__D9aPSI6l3gZsoFvdx9c3FKBg_4));
506 	}
507 	LA11_: ;
508 	count += ((NI) 1);
509 	{
510 		if (!(x.Field2 == 0)) goto LA15_;
511 		result = resizeString(result, 3);
512 appendString(result, ((NimStringDesc*) &TM__D9aPSI6l3gZsoFvdx9c3FKBg_5));
513 	}
514 	goto LA13_;
515 	LA15_: ;
516 	{
517 		addQuoted__stdZjsonutils_444((&result), x.Field2);
518 	}
519 	LA13_: ;
520 	{
521 		if (!(count == ((NI) 1))) goto LA20_;
522 		result = resizeString(result, 1);
523 appendString(result, ((NimStringDesc*) &TM__D9aPSI6l3gZsoFvdx9c3FKBg_6));
524 	}
525 	LA20_: ;
526 	result = resizeString(result, 1);
527 appendString(result, ((NimStringDesc*) &TM__D9aPSI6l3gZsoFvdx9c3FKBg_7));
528 	return result;
529 }
N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q *,toJson__stdZjsonutils_603)530 N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q*, toJson__stdZjsonutils_603)(NimStringDesc* a, tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ opt) {
531 	tyObject_JsonNodeObj__df9bshXB7C9cTiWPIOtX3j1Q* result;
532 	result = NIM_NIL;
533 	result = percent___pureZjson_1790(a);
534 	return result;
535 }
N_NIMCALL(tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ,initToJsonOptions__stdZjsonutils_33)536 N_LIB_PRIVATE N_NIMCALL(tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ, initToJsonOptions__stdZjsonutils_33)(void) {
537 	tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ result;
538 	nimZeroMem((void*)(&result), sizeof(tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ));
539 	nimZeroMem((void*)(&result), sizeof(tyObject_ToJsonOptions__T9bCB8O1ZaL5BIvSkjYqMnQ));
540 	result.enumMode = ((tyEnum_EnumMode__VBQLiQclXYpinosAjWkfrg) 0);
541 	result.jsonNodeMode = ((tyEnum_JsonNodeMode__UTXRaEPTjXpNdVaD9bbN0bQ) 0);
542 	return result;
543 }
544