1 /* Generated by Nim Compiler v1.6.2 */
2 #define NIM_INTBITS 32
3
4 #include "nimbase.h"
5 #include <string.h>
6 #include <stdio.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_RopeObj__OFzf0kSiPTcNreUIeJgWVA tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA;
23 typedef struct TNimType TNimType;
24 typedef struct TNimNode TNimNode;
25 typedef struct RootObj RootObj;
26 typedef struct NimStringDesc NimStringDesc;
27 typedef struct TGenericSeq TGenericSeq;
28 typedef struct tySequence__WwUFq9cJ2xKRlsAWVEHyPRg tySequence__WwUFq9cJ2xKRlsAWVEHyPRg;
29 typedef struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g;
30 typedef struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w;
31 typedef struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ;
32 typedef struct tyObject_GcStack__7fytPA5bBsob6See21YMRA tyObject_GcStack__7fytPA5bBsob6See21YMRA;
33 typedef struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg;
34 typedef struct tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ;
35 typedef struct tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg;
36 typedef struct tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw;
37 typedef struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA;
38 typedef struct tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw;
39 typedef struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw;
40 typedef struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg;
41 typedef struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyTuple__ujsjpB2O9cjj3uDHsXbnSzg;
42 typedef struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg;
43 typedef struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ;
44 typedef struct tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg;
45 typedef tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* tyArray__USLYl0Lpkimm4FABiJ3ldA[4096];
46 typedef NU8 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A;
47 typedef NU8 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ;
48 typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
49 typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
50 struct TNimType {
51 NI size;
52 NI align;
53 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
54 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
55 TNimType* base;
56 TNimNode* node;
57 void* finalizer;
58 tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
59 tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
60 };
61 typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
62 struct TNimNode {
63 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
64 NI offset;
65 TNimType* typ;
66 NCSTRING name;
67 NI len;
68 TNimNode** sons;
69 };
70 struct RootObj {
71 TNimType* m_type;
72 };
73 struct TGenericSeq {
74 NI len;
75 NI reserved;
76 };
77 struct NimStringDesc {
78 TGenericSeq Sup;
79 NIM_CHAR data[SEQ_DECL_SIZE];
80 };
81 struct tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA {
82 RootObj Sup;
83 tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* left;
84 tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* right;
85 NI L;
86 NimStringDesc* data;
87 };
88 typedef N_NIMCALL_PTR(void, tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ) (void);
89 struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g {
90 NI refcount;
91 TNimType* typ;
92 };
93 struct tyObject_GcStack__7fytPA5bBsob6See21YMRA {
94 void* bottom;
95 };
96 struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w {
97 NI len;
98 NI cap;
99 tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g** d;
100 };
101 typedef tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ* tyArray__SPr7N6UKfuF549bNPiUvSRw[256];
102 typedef NU32 tyArray__BHbOSqU1t9b3Gt7K2c6fQig[24];
103 typedef tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* tyArray__N1u1nqOgmuJN9cSZrnMHgOQ[32];
104 typedef tyArray__N1u1nqOgmuJN9cSZrnMHgOQ tyArray__B6durA4ZCi1xjJvRtyYxMg[24];
105 typedef tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw* tyArray__lh2A89ahMmYg9bCmpVaplLbA[256];
106 struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA {
107 tyArray__lh2A89ahMmYg9bCmpVaplLbA data;
108 };
109 typedef tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* tyArray__0aOLqZchNi8nWtMTi8ND8w[2];
110 struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw {
111 tyArray__0aOLqZchNi8nWtMTi8ND8w link;
112 NI key;
113 NI upperBound;
114 NI level;
115 };
116 struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg {
117 tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* Field0;
118 NI Field1;
119 };
120 typedef tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyArray__LzOv2eCDGiceMKQstCLmhw[30];
121 struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg {
122 NI len;
123 tyArray__LzOv2eCDGiceMKQstCLmhw chunks;
124 tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg* next;
125 };
126 struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg {
127 NI minLargeObj;
128 NI maxLargeObj;
129 tyArray__SPr7N6UKfuF549bNPiUvSRw freeSmallChunks;
130 NU32 flBitmap;
131 tyArray__BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
132 tyArray__B6durA4ZCi1xjJvRtyYxMg matrix;
133 tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw* llmem;
134 NI currMem;
135 NI maxMem;
136 NI freeMem;
137 NI occ;
138 NI lastSize;
139 tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA chunkStarts;
140 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* root;
141 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* deleted;
142 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* last;
143 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* freeAvlNodes;
144 NIM_BOOL locked;
145 NIM_BOOL blockChunkSizeIncrease;
146 NI nextChunkSize;
147 tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw bottomData;
148 tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg heapLinks;
149 };
150 struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg {
151 NI stackScans;
152 NI cycleCollections;
153 NI maxThreshold;
154 NI maxStackSize;
155 NI maxStackCells;
156 NI cycleTableSize;
157 NI64 maxPause;
158 };
159 struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ {
160 NI counter;
161 NI max;
162 tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg* head;
163 tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg** data;
164 };
165 struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ {
166 tyObject_GcStack__7fytPA5bBsob6See21YMRA stack;
167 NI cycleThreshold;
168 NI zctThreshold;
169 tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w zct;
170 tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w decStack;
171 tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tempStack;
172 NI recGcLock;
173 tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg region;
174 tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg stat;
175 tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ marked;
176 tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w additionalRoots;
177 NI gcThreadId;
178 };
179 typedef NU8 tyEnum_FileMode__ZJfK20XeZ9bv2j1pZjw9aswg;
180 typedef NIM_CHAR tyArray__9bKy7UA2LOi2vzOViufaW1Q[1024];
181 struct tySequence__WwUFq9cJ2xKRlsAWVEHyPRg {
182 TGenericSeq Sup;
183 tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* data[SEQ_DECL_SIZE];
184 };
185 N_LIB_PRIVATE N_NIMCALL(void, nimGCvisit)(void* d, NI op);
186 static N_NIMCALL(void, Marker_tyRef__4hi0XQqK9aLiPuWT9acsXm9aQ)(void* p, NI op);
187 static N_NIMCALL(void, TM__Vw9cfUOQOae9b9bzZBlucMZQg_3)(void);
188 N_LIB_PRIVATE N_NIMCALL(void, nimRegisterGlobalMarker)(tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ markerProc);
189 N_NIMCALL(NimStringDesc*, mnewString)(NI len);
190 N_LIB_PRIVATE N_NIMCALL(NI, len__ropes_10)(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* a);
191 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, setLengthStr)(NimStringDesc* s, NI newLen);
192 N_LIB_PRIVATE N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
193 static N_NIMCALL(void, Marker_tySequence__WwUFq9cJ2xKRlsAWVEHyPRg)(void* p, NI op);
194 static N_INLINE(void, asgnRef)(void** dest, void* src);
195 static N_INLINE(void, incRef__system_5308)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
196 static N_INLINE(NI, pluspercent___system_696)(NI x, NI y);
197 static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__system_5270)(void* usr);
198 static N_INLINE(NI, minuspercent___system_716)(NI x, NI y);
199 static N_INLINE(void, decRef__system_5315)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
200 static N_INLINE(NIM_BOOL, ltpercent___system_1005)(NI x, NI y);
201 static N_INLINE(void, rtlAddZCT__system_5313)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
202 N_LIB_PRIVATE N_NOINLINE(void, addZCT__system_5264)(tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w* s, tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
203 static N_INLINE(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*, pop__ropes_180)(tySequence__WwUFq9cJ2xKRlsAWVEHyPRg** s);
204 N_LIB_PRIVATE N_NIMCALL(TGenericSeq*, setLengthSeqV2)(TGenericSeq* s, TNimType* typ, NI newLen);
205 N_LIB_PRIVATE N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
206 N_LIB_PRIVATE N_NIMCALL(TGenericSeq*, incrSeqV3)(TGenericSeq* s, TNimType* typ);
207 static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
208 static N_INLINE(void, copyMem__system_1727)(void* dest, void* source, NI size);
209 static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
210 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
211 N_LIB_PRIVATE N_NIMCALL(void, add__ropes_162)(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA** a, NimStringDesc* b);
212 N_LIB_PRIVATE N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*, amp___ropes_140)(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* a, NimStringDesc* b);
213 N_LIB_PRIVATE N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*, amp___ropes_128)(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* a, tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* b);
214 N_LIB_PRIVATE N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*, newRope__ropes_17)(NimStringDesc* data);
215 N_LIB_PRIVATE N_NOINLINE(void*, newObj)(TNimType* typ, NI size);
216 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
217 static N_INLINE(void, nimGCunrefNoCycle)(void* p);
218 N_LIB_PRIVATE N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*, rope__ropes_109)(NimStringDesc* s);
219 N_LIB_PRIVATE N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*, insertInCache__ropes_90)(NimStringDesc* s);
220 N_LIB_PRIVATE N_NIMCALL(NI, hash__pureZhashes_279)(NimStringDesc* x);
221 static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
222 static N_INLINE(NIM_BOOL, equalMem__system_1735)(void* a, void* b, NI size);
223 static N_INLINE(int, nimCmpMem)(void* a, void* b, NI size);
224 N_LIB_PRIVATE N_NIMCALL(void, add__ropes_159)(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA** a, tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* b);
225 N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__systemZassertions_56)(NimStringDesc* msg);
226 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
227 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, substr__system_7743)(NimStringDesc* s, NI first, NI last);
228 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___systemZdollars_6)(NI64 x);
229 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, open__systemZio_391)(FILE** f, NimStringDesc* filename, tyEnum_FileMode__ZJfK20XeZ9bv2j1pZjw9aswg mode, NI bufSize);
230 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, equalsFile__ropes_385)(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* r, FILE* f);
231 static N_INLINE(void, nimZeroMem)(void* p, NI size);
232 static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
233 N_LIB_PRIVATE N_NIMCALL(NI, readBuffer__systemZio_144)(FILE* f, void* buffer, NI len);
234 static N_INLINE(NCSTRING, nimToCStringConv)(NimStringDesc* s);
235 N_LIB_PRIVATE N_NIMCALL(void, close__systemZio_218)(FILE* f);
236 N_LIB_PRIVATE N_NIMCALL(void, writeRope__ropes_237)(FILE* f, tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* r);
237 N_LIB_PRIVATE N_NIMCALL(void, write__systemZio_205)(FILE* f, NimStringDesc* s);
238 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, equalsFile__ropes_453)(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* r, NimStringDesc* filename);
239 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, writeRope__ropes_241)(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* head, NimStringDesc* filename);
240 extern TNimType NTIrootobj__ytyiCJqK439aF9cIibuRVpAg_;
241 N_LIB_PRIVATE TNimType NTIropeobj__OFzf0kSiPTcNreUIeJgWVA_;
242 extern TNimType NTIint__rR5Bzr1D5krxoo1NcNyeMA_;
243 extern TNimType NTIstring__77mFvmsOLKik79ci2hXkHEg_;
244 N_LIB_PRIVATE TNimType NTIrope__4hi0XQqK9aLiPuWT9acsXm9aQ_;
245 N_LIB_PRIVATE TNimType NTIarrayL48OO52485753_ropeT__USLYl0Lpkimm4FABiJ3ldA_;
246 N_LIB_PRIVATE TNimType NTIseqLropeT__WwUFq9cJ2xKRlsAWVEHyPRg_;
247 STRING_LITERAL(TM__Vw9cfUOQOae9b9bzZBlucMZQg_4, "$", 1);
248 STRING_LITERAL(TM__Vw9cfUOQOae9b9bzZBlucMZQg_5, "ropes.nim(237, 20) `false` invalid format string: ", 50);
249 STRING_LITERAL(TM__Vw9cfUOQOae9b9bzZBlucMZQg_6, "ropes.nim(249, 20) `false` invalid format string: ", 50);
250 STRING_LITERAL(TM__Vw9cfUOQOae9b9bzZBlucMZQg_7, "ropes.nim(252, 20) `false` invalid format string: ", 50);
251 STRING_LITERAL(TM__Vw9cfUOQOae9b9bzZBlucMZQg_8, "\012", 1);
252 STRING_LITERAL(TM__Vw9cfUOQOae9b9bzZBlucMZQg_9, "ropes.nim(262, 18) `false` invalid format string: ", 50);
253 N_LIB_PRIVATE tyArray__USLYl0Lpkimm4FABiJ3ldA cache__ropes_41;
254 N_LIB_PRIVATE NI gCacheTries__ropes_87 = ((NI) 0);
255 N_LIB_PRIVATE NI gCacheMisses__ropes_88 = ((NI) 0);
256 N_LIB_PRIVATE NI gCacheIntTries__ropes_89 = ((NI) 0);
257 extern tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ gch__system_5217;
N_NIMCALL(void,Marker_tyRef__4hi0XQqK9aLiPuWT9acsXm9aQ)258 static N_NIMCALL(void, Marker_tyRef__4hi0XQqK9aLiPuWT9acsXm9aQ)(void* p, NI op) {
259 tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* a;
260 a = (tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*)p;
261 nimGCvisit((void*)(*a).left, op);
262 nimGCvisit((void*)(*a).right, op);
263 nimGCvisit((void*)(*a).data, op);
264 }
N_NIMCALL(void,TM__Vw9cfUOQOae9b9bzZBlucMZQg_3)265 static N_NIMCALL(void, TM__Vw9cfUOQOae9b9bzZBlucMZQg_3)(void) {
266 NI T1_;
267 T1_ = (NI)0;
268 for (T1_ = 0; T1_ < 4096; T1_++) {
269 nimGCvisit((void*)cache__ropes_41[T1_], 0);
270 }
271 }
N_NIMCALL(NI,len__ropes_10)272 N_LIB_PRIVATE N_NIMCALL(NI, len__ropes_10)(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* a) {
273 NI result;
274 result = (NI)0;
275 {
276 if (!(a == ((tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*) NIM_NIL))) goto LA3_;
277 result = ((NI) 0);
278 }
279 goto LA1_;
280 LA3_: ;
281 {
282 result = ((*a).L > 0? ((*a).L) : -((*a).L));
283 }
284 LA1_: ;
285 return result;
286 }
N_NIMCALL(void,Marker_tySequence__WwUFq9cJ2xKRlsAWVEHyPRg)287 static N_NIMCALL(void, Marker_tySequence__WwUFq9cJ2xKRlsAWVEHyPRg)(void* p, NI op) {
288 tySequence__WwUFq9cJ2xKRlsAWVEHyPRg* a;
289 NI T1_;
290 a = (tySequence__WwUFq9cJ2xKRlsAWVEHyPRg*)p;
291 T1_ = (NI)0;
292 for (T1_ = 0; T1_ < (a ? a->Sup.len : 0); T1_++) {
293 nimGCvisit((void*)a->data[T1_], op);
294 }
295 }
N_INLINE(NI,pluspercent___system_696)296 static N_INLINE(NI, pluspercent___system_696)(NI x, NI y) {
297 NI result;
298 result = (NI)0;
299 result = ((NI) ((NU)((NU32)(((NU) (x))) + (NU32)(((NU) (y))))));
300 return result;
301 }
N_INLINE(void,incRef__system_5308)302 static N_INLINE(void, incRef__system_5308)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
303 (*c).refcount = pluspercent___system_696((*c).refcount, ((NI) 8));
304 }
N_INLINE(NI,minuspercent___system_716)305 static N_INLINE(NI, minuspercent___system_716)(NI x, NI y) {
306 NI result;
307 result = (NI)0;
308 result = ((NI) ((NU)((NU32)(((NU) (x))) - (NU32)(((NU) (y))))));
309 return result;
310 }
N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g *,usrToCell__system_5270)311 static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__system_5270)(void* usr) {
312 tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* result;
313 NI T1_;
314 result = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
315 T1_ = (NI)0;
316 T1_ = minuspercent___system_716(((NI) (ptrdiff_t) (usr)), ((NI) 8));
317 result = ((tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*) (T1_));
318 return result;
319 }
N_INLINE(NIM_BOOL,ltpercent___system_1005)320 static N_INLINE(NIM_BOOL, ltpercent___system_1005)(NI x, NI y) {
321 NIM_BOOL result;
322 result = (NIM_BOOL)0;
323 result = ((NU32)(((NU) (x))) < (NU32)(((NU) (y))));
324 return result;
325 }
N_INLINE(void,rtlAddZCT__system_5313)326 static N_INLINE(void, rtlAddZCT__system_5313)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
327 addZCT__system_5264((&gch__system_5217.zct), c);
328 }
N_INLINE(void,decRef__system_5315)329 static N_INLINE(void, decRef__system_5315)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
330 (*c).refcount = minuspercent___system_716((*c).refcount, ((NI) 8));
331 {
332 NIM_BOOL T3_;
333 T3_ = (NIM_BOOL)0;
334 T3_ = ltpercent___system_1005((*c).refcount, ((NI) 8));
335 if (!T3_) goto LA4_;
336 rtlAddZCT__system_5313(c);
337 }
338 LA4_: ;
339 }
N_INLINE(void,asgnRef)340 static N_INLINE(void, asgnRef)(void** dest, void* src) {
341 {
342 tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T5_;
343 if (!!((src == NIM_NIL))) goto LA3_;
344 T5_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
345 T5_ = usrToCell__system_5270(src);
346 incRef__system_5308(T5_);
347 }
348 LA3_: ;
349 {
350 tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T10_;
351 if (!!(((*dest) == NIM_NIL))) goto LA8_;
352 T10_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
353 T10_ = usrToCell__system_5270((*dest));
354 decRef__system_5315(T10_);
355 }
356 LA8_: ;
357 (*dest) = src;
358 }
N_INLINE(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA *,pop__ropes_180)359 static N_INLINE(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*, pop__ropes_180)(tySequence__WwUFq9cJ2xKRlsAWVEHyPRg** s) {
360 tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* result;
361 NI L;
362 NI T1_;
363 result = NIM_NIL;
364 T1_ = ((*s) ? (*s)->Sup.len : 0);
365 L = (NI)(T1_ - ((NI) 1));
366 result = (*s)->data[L];
367 unsureAsgnRef((void**) (&(*s)), (tySequence__WwUFq9cJ2xKRlsAWVEHyPRg*) setLengthSeqV2(&((*s))->Sup, (&NTIseqLropeT__WwUFq9cJ2xKRlsAWVEHyPRg_), ((NI) (L))));
368 return result;
369 }
N_INLINE(void,nimCopyMem)370 static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) {
371 void* T1_;
372 T1_ = (void*)0;
373 T1_ = memcpy(dest, source, ((size_t) (size)));
374 }
N_INLINE(void,copyMem__system_1727)375 static N_INLINE(void, copyMem__system_1727)(void* dest, void* source, NI size) {
376 nimCopyMem(dest, source, size);
377 }
N_INLINE(void,appendString)378 static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
379 {
380 if (!!((src == ((NimStringDesc*) NIM_NIL)))) goto LA3_;
381 copyMem__system_1727(((void*) ((&(*dest).data[(*dest).Sup.len]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1)))));
382 (*dest).Sup.len += (*src).Sup.len;
383 }
384 LA3_: ;
385 }
N_NIMCALL(NimStringDesc *,dollar___ropes_250)386 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___ropes_250)(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* r) {
387 NimStringDesc* result;
388 NI T1_;
389 result = NIM_NIL;
390 T1_ = (NI)0;
391 T1_ = len__ropes_10(r);
392 result = mnewString(((NI) (T1_)));
393 result = setLengthStr(result, ((NI) 0));
394 {
395 NimStringDesc* s;
396 s = NIM_NIL;
397 {
398 tySequence__WwUFq9cJ2xKRlsAWVEHyPRg* stack;
399 if (!!((r == ((tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*) NIM_NIL)))) goto LA5_;
400 stack = (tySequence__WwUFq9cJ2xKRlsAWVEHyPRg*) newSeq((&NTIseqLropeT__WwUFq9cJ2xKRlsAWVEHyPRg_), 1);
401 asgnRef((void**) (&stack->data[0]), r);
402 {
403 while (1) {
404 NI T9_;
405 tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* it;
406 T9_ = (stack ? stack->Sup.len : 0);
407 if (!(((NI) 0) < T9_)) goto LA8;
408 it = pop__ropes_180((&stack));
409 {
410 while (1) {
411 NI T12_;
412 if (!!(((*it).left == ((tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*) NIM_NIL)))) goto LA11;
413 stack = (tySequence__WwUFq9cJ2xKRlsAWVEHyPRg*) incrSeqV3((TGenericSeq*)(stack), (&NTIseqLropeT__WwUFq9cJ2xKRlsAWVEHyPRg_));
414 T12_ = stack->Sup.len++;
415 asgnRef((void**) (&stack->data[T12_]), (*it).right);
416 it = (*it).left;
417 } LA11: ;
418 }
419 s = (*it).data;
420 result = resizeString(result, (s ? s->Sup.len : 0) + 0);
421 appendString(result, s);
422 } LA8: ;
423 }
424 }
425 LA5_: ;
426 }
427 return result;
428 }
N_INLINE(void,nimGCunrefNoCycle)429 static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
430 tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T1_;
431 T1_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
432 T1_ = usrToCell__system_5270(p);
433 decRef__system_5315(T1_);
434 }
N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA *,newRope__ropes_17)435 N_LIB_PRIVATE N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*, newRope__ropes_17)(NimStringDesc* data) {
436 tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* result;
437 NimStringDesc* T1_;
438 result = NIM_NIL;
439 result = (tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*) newObj((&NTIrope__4hi0XQqK9aLiPuWT9acsXm9aQ_), sizeof(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA));
440 (*result).Sup.m_type = (&NTIropeobj__OFzf0kSiPTcNreUIeJgWVA_);
441 (*result).L = ((NI32)-((data ? data->Sup.len : 0)));
442 T1_ = NIM_NIL;
443 T1_ = (*result).data; (*result).data = copyStringRC1(data);
444 if (T1_) nimGCunrefNoCycle(T1_);
445 return result;
446 }
N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA *,amp___ropes_128)447 N_LIB_PRIVATE N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*, amp___ropes_128)(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* a, tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* b) {
448 tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* result;
449 result = NIM_NIL;
450 {
451 if (!(a == ((tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*) NIM_NIL))) goto LA3_;
452 result = b;
453 }
454 goto LA1_;
455 LA3_: ;
456 {
457 if (!(b == ((tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*) NIM_NIL))) goto LA6_;
458 result = a;
459 }
460 goto LA1_;
461 LA6_: ;
462 {
463 result = newRope__ropes_17(((NimStringDesc*) NIM_NIL));
464 (*result).L = (NI)(((*a).L > 0? ((*a).L) : -((*a).L)) + ((*b).L > 0? ((*b).L) : -((*b).L)));
465 asgnRef((void**) (&(*result).left), a);
466 asgnRef((void**) (&(*result).right), b);
467 }
468 LA1_: ;
469 return result;
470 }
N_INLINE(int,nimCmpMem)471 static N_INLINE(int, nimCmpMem)(void* a, void* b, NI size) {
472 int result;
473 result = (int)0;
474 result = memcmp(a, b, ((size_t) (size)));
475 return result;
476 }
N_INLINE(NIM_BOOL,equalMem__system_1735)477 static N_INLINE(NIM_BOOL, equalMem__system_1735)(void* a, void* b, NI size) {
478 NIM_BOOL result;
479 int T1_;
480 result = (NIM_BOOL)0;
481 T1_ = (int)0;
482 T1_ = nimCmpMem(a, b, size);
483 result = (T1_ == ((NI32) 0));
484 return result;
485 }
N_INLINE(NIM_BOOL,eqStrings)486 static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b) {
487 NIM_BOOL result;
488 NI alen;
489 NI blen;
490 { result = (NIM_BOOL)0;
491 alen = (a ? a->Sup.len : 0);
492 blen = (b ? b->Sup.len : 0);
493 {
494 if (!(alen == blen)) goto LA3_;
495 {
496 if (!(alen == ((NI) 0))) goto LA7_;
497 result = NIM_TRUE;
498 goto BeforeRet_;
499 }
500 LA7_: ;
501 result = equalMem__system_1735(((void*) ((&a->data[((NI) 0)]))), ((void*) ((&b->data[((NI) 0)]))), ((NI) (alen)));
502 goto BeforeRet_;
503 }
504 LA3_: ;
505 }BeforeRet_: ;
506 return result;
507 }
N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA *,insertInCache__ropes_90)508 N_LIB_PRIVATE N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*, insertInCache__ropes_90)(NimStringDesc* s) {
509 tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* result;
510 NI h;
511 NI T1_;
512 result = NIM_NIL;
513 gCacheTries__ropes_87 += ((NI) 1);
514 T1_ = (NI)0;
515 T1_ = hash__pureZhashes_279(s);
516 h = (NI)(T1_ & ((NI) 4095));
517 result = cache__ropes_41[(h)- 0];
518 {
519 NIM_BOOL T4_;
520 T4_ = (NIM_BOOL)0;
521 T4_ = (result == 0);
522 if (T4_) goto LA5_;
523 T4_ = !(eqStrings((*result).data, s));
524 LA5_: ;
525 if (!T4_) goto LA6_;
526 gCacheMisses__ropes_88 += ((NI) 1);
527 result = newRope__ropes_17(s);
528 asgnRef((void**) (&cache__ropes_41[(h)- 0]), result);
529 }
530 LA6_: ;
531 return result;
532 }
N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA *,rope__ropes_109)533 N_LIB_PRIVATE N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*, rope__ropes_109)(NimStringDesc* s) {
534 tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* result;
535 result = NIM_NIL;
536 {
537 if (!((s ? s->Sup.len : 0) == ((NI) 0))) goto LA3_;
538 result = ((tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*) NIM_NIL);
539 }
540 goto LA1_;
541 LA3_: ;
542 {
543 result = insertInCache__ropes_90(s);
544 }
545 LA1_: ;
546 return result;
547 }
N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA *,amp___ropes_140)548 N_LIB_PRIVATE N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*, amp___ropes_140)(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* a, NimStringDesc* b) {
549 tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* result;
550 tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* T1_;
551 result = NIM_NIL;
552 T1_ = NIM_NIL;
553 T1_ = rope__ropes_109(b);
554 result = amp___ropes_128(a, T1_);
555 return result;
556 }
N_NIMCALL(void,add__ropes_162)557 N_LIB_PRIVATE N_NIMCALL(void, add__ropes_162)(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA** a, NimStringDesc* b) {
558 unsureAsgnRef((void**) (&(*a)), amp___ropes_140((*a), b));
559 }
N_NIMCALL(void,add__ropes_159)560 N_LIB_PRIVATE N_NIMCALL(void, add__ropes_159)(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA** a, tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* b) {
561 unsureAsgnRef((void**) (&(*a)), amp___ropes_128((*a), b));
562 }
N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA *,runtimeFormat__ropes_271)563 N_LIB_PRIVATE N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*, runtimeFormat__ropes_271)(NimStringDesc* frmt, tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA** args, NI argsLen_0) {
564 tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* result;
565 NI i;
566 NI num;
567 result = NIM_NIL;
568 i = ((NI) 0);
569 result = ((tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*) NIM_NIL);
570 num = ((NI) 0);
571 {
572 while (1) {
573 NI start;
574 if (!(i < (frmt ? frmt->Sup.len : 0))) goto LA2;
575 {
576 if (!((NU8)(frmt->data[i]) == (NU8)(36))) goto LA5_;
577 i += ((NI) 1);
578 switch (((NU8)(frmt->data[i]))) {
579 case 36:
580 {
581 add__ropes_162(&result, ((NimStringDesc*) &TM__Vw9cfUOQOae9b9bzZBlucMZQg_4));
582 i += ((NI) 1);
583 }
584 break;
585 case 35:
586 {
587 i += ((NI) 1);
588 add__ropes_159(&result, args[num]);
589 num += ((NI) 1);
590 }
591 break;
592 case 48 ... 57:
593 {
594 NI j;
595 j = ((NI) 0);
596 {
597 while (1) {
598 j = (NI)((NI)((NI)(j * ((NI) 10)) + ((NU8)(frmt->data[i]))) - ((NI) 48));
599 i += ((NI) 1);
600 {
601 NIM_BOOL T14_;
602 T14_ = (NIM_BOOL)0;
603 T14_ = ((frmt ? frmt->Sup.len : 0) <= i);
604 if (T14_) goto LA15_;
605 T14_ = !((((NU8)(frmt->data[i])) >= ((NU8)(48)) && ((NU8)(frmt->data[i])) <= ((NU8)(57))));
606 LA15_: ;
607 if (!T14_) goto LA16_;
608 goto LA10;
609 }
610 LA16_: ;
611 }
612 } LA10: ;
613 num = j;
614 {
615 if (!((NI)((argsLen_0-1) + ((NI) 1)) < j)) goto LA20_;
616 {
617 NimStringDesc* T26_;
618 if (!NIM_TRUE) goto LA24_;
619 T26_ = NIM_NIL;
620 T26_ = rawNewString((frmt ? frmt->Sup.len : 0) + 50);
621 appendString(T26_, ((NimStringDesc*) &TM__Vw9cfUOQOae9b9bzZBlucMZQg_5));
622 appendString(T26_, frmt);
623 failedAssertImpl__systemZassertions_56(T26_);
624 }
625 LA24_: ;
626 }
627 goto LA18_;
628 LA20_: ;
629 {
630 add__ropes_159(&result, args[(NI)(j - ((NI) 1))]);
631 }
632 LA18_: ;
633 }
634 break;
635 case 123:
636 {
637 NI j_2;
638 i += ((NI) 1);
639 j_2 = ((NI) 0);
640 {
641 while (1) {
642 if (!(((NU8)(frmt->data[i])) >= ((NU8)(48)) && ((NU8)(frmt->data[i])) <= ((NU8)(57)))) goto LA30;
643 j_2 = (NI)((NI)((NI)(j_2 * ((NI) 10)) + ((NU8)(frmt->data[i]))) - ((NI) 48));
644 i += ((NI) 1);
645 } LA30: ;
646 }
647 num = j_2;
648 {
649 if (!((NU8)(frmt->data[i]) == (NU8)(125))) goto LA33_;
650 i += ((NI) 1);
651 }
652 goto LA31_;
653 LA33_: ;
654 {
655 {
656 NimStringDesc* T40_;
657 if (!NIM_TRUE) goto LA38_;
658 T40_ = NIM_NIL;
659 T40_ = rawNewString((frmt ? frmt->Sup.len : 0) + 50);
660 appendString(T40_, ((NimStringDesc*) &TM__Vw9cfUOQOae9b9bzZBlucMZQg_6));
661 appendString(T40_, frmt);
662 failedAssertImpl__systemZassertions_56(T40_);
663 }
664 LA38_: ;
665 }
666 LA31_: ;
667 {
668 if (!((NI)((argsLen_0-1) + ((NI) 1)) < j_2)) goto LA43_;
669 {
670 NimStringDesc* T49_;
671 if (!NIM_TRUE) goto LA47_;
672 T49_ = NIM_NIL;
673 T49_ = rawNewString((frmt ? frmt->Sup.len : 0) + 50);
674 appendString(T49_, ((NimStringDesc*) &TM__Vw9cfUOQOae9b9bzZBlucMZQg_7));
675 appendString(T49_, frmt);
676 failedAssertImpl__systemZassertions_56(T49_);
677 }
678 LA47_: ;
679 }
680 goto LA41_;
681 LA43_: ;
682 {
683 add__ropes_159(&result, args[(NI)(j_2 - ((NI) 1))]);
684 }
685 LA41_: ;
686 }
687 break;
688 case 110:
689 {
690 add__ropes_162(&result, ((NimStringDesc*) &TM__Vw9cfUOQOae9b9bzZBlucMZQg_8));
691 i += ((NI) 1);
692 }
693 break;
694 case 78:
695 {
696 add__ropes_162(&result, ((NimStringDesc*) &TM__Vw9cfUOQOae9b9bzZBlucMZQg_8));
697 i += ((NI) 1);
698 }
699 break;
700 default:
701 {
702 {
703 NimStringDesc* T58_;
704 if (!NIM_TRUE) goto LA56_;
705 T58_ = NIM_NIL;
706 T58_ = rawNewString((frmt ? frmt->Sup.len : 0) + 50);
707 appendString(T58_, ((NimStringDesc*) &TM__Vw9cfUOQOae9b9bzZBlucMZQg_9));
708 appendString(T58_, frmt);
709 failedAssertImpl__systemZassertions_56(T58_);
710 }
711 LA56_: ;
712 }
713 break;
714 }
715 }
716 LA5_: ;
717 start = i;
718 {
719 while (1) {
720 if (!(i < (frmt ? frmt->Sup.len : 0))) goto LA60;
721 {
722 if (!!(((NU8)(frmt->data[i]) == (NU8)(36)))) goto LA63_;
723 i += ((NI) 1);
724 }
725 goto LA61_;
726 LA63_: ;
727 {
728 goto LA59;
729 }
730 LA61_: ;
731 } LA60: ;
732 } LA59: ;
733 {
734 NimStringDesc* T70_;
735 if (!(start <= (NI)(i - ((NI) 1)))) goto LA68_;
736 T70_ = NIM_NIL;
737 T70_ = substr__system_7743(frmt, start, (NI)(i - ((NI) 1)));
738 add__ropes_162(&result, T70_);
739 }
740 LA68_: ;
741 } LA2: ;
742 }
743 return result;
744 }
N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA *,rope__ropes_115)745 N_LIB_PRIVATE N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*, rope__ropes_115)(NI64 i) {
746 tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* result;
747 NimStringDesc* T1_;
748 result = NIM_NIL;
749 gCacheIntTries__ropes_89 += ((NI) 1);
750 T1_ = NIM_NIL;
751 T1_ = dollar___systemZdollars_6(i);
752 result = rope__ropes_109(T1_);
753 return result;
754 }
N_NIMCALL(void,prepend__ropes_265)755 N_LIB_PRIVATE N_NIMCALL(void, prepend__ropes_265)(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA** a, tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* b) {
756 unsureAsgnRef((void**) (&(*a)), amp___ropes_128(b, (*a)));
757 }
N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA *,amp___ropes_144)758 N_LIB_PRIVATE N_NIMCALL(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*, amp___ropes_144)(NimStringDesc* a, tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* b) {
759 tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* result;
760 tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* T1_;
761 result = NIM_NIL;
762 T1_ = NIM_NIL;
763 T1_ = rope__ropes_109(a);
764 result = amp___ropes_128(T1_, b);
765 return result;
766 }
N_INLINE(void,nimSetMem__systemZmemory_7)767 static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) {
768 void* T1_;
769 T1_ = (void*)0;
770 T1_ = memset(a, v, ((size_t) (size)));
771 }
N_INLINE(void,nimZeroMem)772 static N_INLINE(void, nimZeroMem)(void* p, NI size) {
773 nimSetMem__systemZmemory_7(p, ((int) 0), size);
774 }
N_INLINE(NCSTRING,nimToCStringConv)775 static N_INLINE(NCSTRING, nimToCStringConv)(NimStringDesc* s) {
776 NCSTRING result;
777 result = (NCSTRING)0;
778 {
779 NIM_BOOL T3_;
780 T3_ = (NIM_BOOL)0;
781 T3_ = (s == ((NimStringDesc*) NIM_NIL));
782 if (T3_) goto LA4_;
783 T3_ = ((*s).Sup.len == ((NI) 0));
784 LA4_: ;
785 if (!T3_) goto LA5_;
786 result = "";
787 }
788 goto LA1_;
789 LA5_: ;
790 {
791 result = ((NCSTRING) ((*s).data));
792 }
793 LA1_: ;
794 return result;
795 }
N_NIMCALL(NIM_BOOL,equalsFile__ropes_385)796 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, equalsFile__ropes_385)(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* r, FILE* f) {
797 NIM_BOOL result;
798 tyArray__9bKy7UA2LOi2vzOViufaW1Q buf;
799 NI bpos;
800 NI blen;
801 NI btotal;
802 NI rtotal;
803 NIM_BOOL T27_;
804 NI T28_;
805 { result = (NIM_BOOL)0;
806 nimZeroMem((void*)buf, sizeof(tyArray__9bKy7UA2LOi2vzOViufaW1Q));
807 bpos = ((NI) 1024);
808 blen = ((NI) 1024);
809 btotal = ((NI) 0);
810 rtotal = ((NI) 0);
811 {
812 NimStringDesc* s;
813 s = NIM_NIL;
814 {
815 tySequence__WwUFq9cJ2xKRlsAWVEHyPRg* stack;
816 if (!!((r == ((tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*) NIM_NIL)))) goto LA4_;
817 stack = (tySequence__WwUFq9cJ2xKRlsAWVEHyPRg*) newSeq((&NTIseqLropeT__WwUFq9cJ2xKRlsAWVEHyPRg_), 1);
818 asgnRef((void**) (&stack->data[0]), r);
819 {
820 while (1) {
821 NI T8_;
822 tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* it;
823 NI spos;
824 T8_ = (stack ? stack->Sup.len : 0);
825 if (!(((NI) 0) < T8_)) goto LA7;
826 it = pop__ropes_180((&stack));
827 {
828 while (1) {
829 NI T11_;
830 if (!!(((*it).left == ((tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*) NIM_NIL)))) goto LA10;
831 stack = (tySequence__WwUFq9cJ2xKRlsAWVEHyPRg*) incrSeqV3((TGenericSeq*)(stack), (&NTIseqLropeT__WwUFq9cJ2xKRlsAWVEHyPRg_));
832 T11_ = stack->Sup.len++;
833 asgnRef((void**) (&stack->data[T11_]), (*it).right);
834 it = (*it).left;
835 } LA10: ;
836 }
837 s = (*it).data;
838 spos = ((NI) 0);
839 rtotal += (s ? s->Sup.len : 0);
840 {
841 while (1) {
842 NI n;
843 if (!(spos < (s ? s->Sup.len : 0))) goto LA13;
844 {
845 if (!(bpos == blen)) goto LA16_;
846 bpos = ((NI) 0);
847 blen = readBuffer__systemZio_144(f, ((void*) ((&buf[(((NI) 0))- 0]))), ((NI) 1024));
848 btotal += blen;
849 {
850 if (!(blen == ((NI) 0))) goto LA20_;
851 result = NIM_FALSE;
852 goto BeforeRet_;
853 }
854 LA20_: ;
855 }
856 LA16_: ;
857 n = (((NI)(blen - bpos) <= (NI)((s ? s->Sup.len : 0) - spos)) ? (NI)(blen - bpos) : (NI)((s ? s->Sup.len : 0) - spos));
858 {
859 NIM_BOOL T24_;
860 T24_ = (NIM_BOOL)0;
861 T24_ = equalMem__system_1735(((void*) ((&buf[(bpos)- 0]))), ((void*) ((NI)(((NI) (nimToCStringConv(s))) + spos))), ((NI) (n)));
862 if (!!(T24_)) goto LA25_;
863 result = NIM_FALSE;
864 goto BeforeRet_;
865 }
866 LA25_: ;
867 spos += n;
868 bpos += n;
869 } LA13: ;
870 }
871 } LA7: ;
872 }
873 }
874 LA4_: ;
875 }
876 T27_ = (NIM_BOOL)0;
877 T28_ = (NI)0;
878 T28_ = readBuffer__systemZio_144(f, ((void*) ((&buf[(((NI) 0))- 0]))), ((NI) 1));
879 T27_ = (T28_ == ((NI) 0));
880 if (!(T27_)) goto LA29_;
881 T27_ = (btotal == rtotal);
882 LA29_: ;
883 result = T27_;
884 }BeforeRet_: ;
885 return result;
886 }
N_NIMCALL(NIM_BOOL,equalsFile__ropes_453)887 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, equalsFile__ropes_453)(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* r, NimStringDesc* filename) {
888 NIM_BOOL result;
889 FILE* f;
890 result = (NIM_BOOL)0;
891 f = (FILE*)0;
892 result = open__systemZio_391(&f, filename, ((tyEnum_FileMode__ZJfK20XeZ9bv2j1pZjw9aswg) 0), ((NI) -1));
893 {
894 if (!result) goto LA3_;
895 result = equalsFile__ropes_385(r, f);
896 close__systemZio_218(f);
897 }
898 LA3_: ;
899 return result;
900 }
N_NIMCALL(void,writeRope__ropes_237)901 N_LIB_PRIVATE N_NIMCALL(void, writeRope__ropes_237)(FILE* f, tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* r) {
902 {
903 NimStringDesc* s;
904 s = NIM_NIL;
905 {
906 tySequence__WwUFq9cJ2xKRlsAWVEHyPRg* stack;
907 if (!!((r == ((tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*) NIM_NIL)))) goto LA4_;
908 stack = (tySequence__WwUFq9cJ2xKRlsAWVEHyPRg*) newSeq((&NTIseqLropeT__WwUFq9cJ2xKRlsAWVEHyPRg_), 1);
909 asgnRef((void**) (&stack->data[0]), r);
910 {
911 while (1) {
912 NI T8_;
913 tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* it;
914 T8_ = (stack ? stack->Sup.len : 0);
915 if (!(((NI) 0) < T8_)) goto LA7;
916 it = pop__ropes_180((&stack));
917 {
918 while (1) {
919 NI T11_;
920 if (!!(((*it).left == ((tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*) NIM_NIL)))) goto LA10;
921 stack = (tySequence__WwUFq9cJ2xKRlsAWVEHyPRg*) incrSeqV3((TGenericSeq*)(stack), (&NTIseqLropeT__WwUFq9cJ2xKRlsAWVEHyPRg_));
922 T11_ = stack->Sup.len++;
923 asgnRef((void**) (&stack->data[T11_]), (*it).right);
924 it = (*it).left;
925 } LA10: ;
926 }
927 s = (*it).data;
928 write__systemZio_205(f, s);
929 } LA7: ;
930 }
931 }
932 LA4_: ;
933 }
934 }
N_NIMCALL(NIM_BOOL,writeRope__ropes_241)935 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, writeRope__ropes_241)(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* head, NimStringDesc* filename) {
936 NIM_BOOL result;
937 FILE* f;
938 result = (NIM_BOOL)0;
939 f = (FILE*)0;
940 {
941 NIM_BOOL T3_;
942 T3_ = (NIM_BOOL)0;
943 T3_ = open__systemZio_391(&f, filename, ((tyEnum_FileMode__ZJfK20XeZ9bv2j1pZjw9aswg) 1), ((NI) -1));
944 if (!T3_) goto LA4_;
945 {
946 if (!!((head == ((tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*) NIM_NIL)))) goto LA8_;
947 writeRope__ropes_237(f, head);
948 }
949 LA8_: ;
950 close__systemZio_218(f);
951 result = NIM_TRUE;
952 }
953 goto LA1_;
954 LA4_: ;
955 {
956 result = NIM_FALSE;
957 }
958 LA1_: ;
959 return result;
960 }
N_NIMCALL(NIM_BOOL,writeRopeIfNotEqual__ropes_458)961 N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, writeRopeIfNotEqual__ropes_458)(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* r, NimStringDesc* filename) {
962 NIM_BOOL result;
963 result = (NIM_BOOL)0;
964 {
965 NIM_BOOL T3_;
966 T3_ = (NIM_BOOL)0;
967 T3_ = equalsFile__ropes_453(r, filename);
968 if (!!(T3_)) goto LA4_;
969 result = writeRope__ropes_241(r, filename);
970 }
971 goto LA1_;
972 LA4_: ;
973 {
974 result = NIM_FALSE;
975 }
976 LA1_: ;
977 return result;
978 }
N_NIMCALL(void,compiler_ropesInit000)979 N_LIB_PRIVATE N_NIMCALL(void, compiler_ropesInit000)(void) {
980 {
981 TFrame FR_; FR_.len = 0;
982
983 nimRegisterGlobalMarker(TM__Vw9cfUOQOae9b9bzZBlucMZQg_3);
984
985 }/* preInitProc end */
986 {
987 }
988 }
989
N_NIMCALL(void,compiler_ropesDatInit000)990 N_LIB_PRIVATE N_NIMCALL(void, compiler_ropesDatInit000)(void) {
991 static TNimNode* TM__Vw9cfUOQOae9b9bzZBlucMZQg_2_4[4];
992 static TNimNode TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[5];
993 NTIropeobj__OFzf0kSiPTcNreUIeJgWVA_.size = sizeof(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA);
994 NTIropeobj__OFzf0kSiPTcNreUIeJgWVA_.align = NIM_ALIGNOF(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA);
995 NTIropeobj__OFzf0kSiPTcNreUIeJgWVA_.kind = 17;
996 NTIropeobj__OFzf0kSiPTcNreUIeJgWVA_.base = (&NTIrootobj__ytyiCJqK439aF9cIibuRVpAg_);
997 NTIropeobj__OFzf0kSiPTcNreUIeJgWVA_.flags = 2;
998 TM__Vw9cfUOQOae9b9bzZBlucMZQg_2_4[0] = &TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[1];
999 TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[1].kind = 1;
1000 TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[1].offset = offsetof(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA, left);
1001 TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[1].typ = (&NTIrope__4hi0XQqK9aLiPuWT9acsXm9aQ_);
1002 TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[1].name = "left";
1003 TM__Vw9cfUOQOae9b9bzZBlucMZQg_2_4[1] = &TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[2];
1004 TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[2].kind = 1;
1005 TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[2].offset = offsetof(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA, right);
1006 TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[2].typ = (&NTIrope__4hi0XQqK9aLiPuWT9acsXm9aQ_);
1007 TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[2].name = "right";
1008 TM__Vw9cfUOQOae9b9bzZBlucMZQg_2_4[2] = &TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[3];
1009 TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[3].kind = 1;
1010 TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[3].offset = offsetof(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA, L);
1011 TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[3].typ = (&NTIint__rR5Bzr1D5krxoo1NcNyeMA_);
1012 TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[3].name = "L";
1013 TM__Vw9cfUOQOae9b9bzZBlucMZQg_2_4[3] = &TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[4];
1014 TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[4].kind = 1;
1015 TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[4].offset = offsetof(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA, data);
1016 TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[4].typ = (&NTIstring__77mFvmsOLKik79ci2hXkHEg_);
1017 TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[4].name = "data";
1018 TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[0].len = 4; TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[0].kind = 2; TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[0].sons = &TM__Vw9cfUOQOae9b9bzZBlucMZQg_2_4[0];
1019 NTIropeobj__OFzf0kSiPTcNreUIeJgWVA_.node = &TM__Vw9cfUOQOae9b9bzZBlucMZQg_0[0];
1020 NTIrope__4hi0XQqK9aLiPuWT9acsXm9aQ_.size = sizeof(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*);
1021 NTIrope__4hi0XQqK9aLiPuWT9acsXm9aQ_.align = NIM_ALIGNOF(tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA*);
1022 NTIrope__4hi0XQqK9aLiPuWT9acsXm9aQ_.kind = 22;
1023 NTIrope__4hi0XQqK9aLiPuWT9acsXm9aQ_.base = (&NTIropeobj__OFzf0kSiPTcNreUIeJgWVA_);
1024 NTIrope__4hi0XQqK9aLiPuWT9acsXm9aQ_.marker = Marker_tyRef__4hi0XQqK9aLiPuWT9acsXm9aQ;
1025 NTIarrayL48OO52485753_ropeT__USLYl0Lpkimm4FABiJ3ldA_.size = sizeof(tyArray__USLYl0Lpkimm4FABiJ3ldA);
1026 NTIarrayL48OO52485753_ropeT__USLYl0Lpkimm4FABiJ3ldA_.align = NIM_ALIGNOF(tyArray__USLYl0Lpkimm4FABiJ3ldA);
1027 NTIarrayL48OO52485753_ropeT__USLYl0Lpkimm4FABiJ3ldA_.kind = 16;
1028 NTIarrayL48OO52485753_ropeT__USLYl0Lpkimm4FABiJ3ldA_.base = (&NTIrope__4hi0XQqK9aLiPuWT9acsXm9aQ_);
1029 NTIseqLropeT__WwUFq9cJ2xKRlsAWVEHyPRg_.size = sizeof(tySequence__WwUFq9cJ2xKRlsAWVEHyPRg*);
1030 NTIseqLropeT__WwUFq9cJ2xKRlsAWVEHyPRg_.align = NIM_ALIGNOF(tySequence__WwUFq9cJ2xKRlsAWVEHyPRg*);
1031 NTIseqLropeT__WwUFq9cJ2xKRlsAWVEHyPRg_.kind = 24;
1032 NTIseqLropeT__WwUFq9cJ2xKRlsAWVEHyPRg_.base = (&NTIrope__4hi0XQqK9aLiPuWT9acsXm9aQ_);
1033 NTIseqLropeT__WwUFq9cJ2xKRlsAWVEHyPRg_.marker = Marker_tySequence__WwUFq9cJ2xKRlsAWVEHyPRg;
1034 }
1035
1036