/* Generated by Nim Compiler v0.10.2 */
/*   (c) 2014 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_INTBITS 32
#include "nimbase.h"

#include <io.h>

#include <fcntl.h>

#include <windows.h>

#include <stdio.h>

#include <stdlib.h>

#include <setjmp.h>

#include <string.h>

#include <signal.h>
typedef struct Exception Exception;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct tavlnode27008 tavlnode27008;
typedef struct tgcheap46816 tgcheap46816;
typedef struct tcellseq44749 tcellseq44749;
typedef struct tcell44733 tcell44733;
typedef struct tcellset44745 tcellset44745;
typedef struct tpagedesc44741 tpagedesc44741;
typedef struct tmemregion27010 tmemregion27010;
typedef struct tsmallchunk26240 tsmallchunk26240;
typedef struct tllchunk27004 tllchunk27004;
typedef struct tbigchunk26242 tbigchunk26242;
typedef struct tintset26217 tintset26217;
typedef struct ttrunk26213 ttrunk26213;
typedef struct tgcstat46814 tgcstat46814;
typedef struct tbasechunk26238 tbasechunk26238;
typedef struct tfreecell26230 tfreecell26230;
typedef struct TGenericSeq TGenericSeq;
typedef struct NimStringDesc NimStringDesc;
typedef struct TSafePoint TSafePoint;
typedef struct TNimObject TNimObject;
typedef struct overflowerror3243 overflowerror3243;
typedef struct arithmeticerror3239 arithmeticerror3239;
typedef struct systemerror3229 systemerror3229;
typedef struct outofmemerror3253 outofmemerror3253;
typedef struct oserror3233 oserror3233;
typedef struct valueerror3249 valueerror3249;
typedef struct ioerror3231 ioerror3231;
typedef struct TY120608 TY120608;
typedef struct reraiseerror3263 reraiseerror3263;
typedef struct TY86345 TY86345;
typedef struct rangeerror3259 rangeerror3259;
typedef struct TY226936 TY226936;
typedef struct assertionerror3247 assertionerror3247;
typedef struct TY269081 TY269081;
typedef struct ttypeseq226848 ttypeseq226848;
typedef struct ttype226852 ttype226852;
typedef struct TY419481 TY419481;
typedef struct tlinemap419480 tlinemap419480;
typedef struct TY419485 TY419485;
typedef struct tentry419478 tentry419478;
typedef struct tsym226846 tsym226846;
typedef struct tinstantiation226836 tinstantiation226836;
typedef struct TY226947 TY226947;
typedef struct tnodeseq226810 tnodeseq226810;
typedef struct tnode226816 tnode226816;
typedef struct slice85779 slice85779;
typedef struct divbyzeroerror3241 divbyzeroerror3241;
typedef struct tsymseq226818 tsymseq226818;
typedef struct TY337062 TY337062;
typedef struct jsonnodeobj337042 jsonnodeobj337042;
typedef struct TY337057 TY337057;
typedef struct TY337611 TY337611;
typedef struct tindexentry360264 tindexentry360264;
typedef struct TY192015 TY192015;
typedef struct tsocketimpl183607 tsocketimpl183607;
typedef struct tidobj201015 tidobj201015;
typedef struct tloc226830 tloc226830;
typedef struct trope178009 trope178009;
typedef struct tscope226840 tscope226840;
typedef struct tstrtable226820 tstrtable226820;
typedef struct tident201021 tident201021;
typedef struct tlineinfo196539 tlineinfo196539;
typedef struct tlib226834 tlib226834;
typedef struct tlistentry129022 tlistentry129022;
typedef N_NIMCALL_PTR(NIM_BOOL, TY8221) (Exception* e);
typedef N_NIMCALL_PTR(NIM_BOOL, TY8226) (Exception* e);
typedef N_NIMCALL_PTR(void, TY8231) (void);
typedef N_NIMCALL_PTR(void, TY3089) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3094) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3089 marker;
TY3094 deepcopy;
};
typedef tavlnode27008* TY27014[2];
struct  tavlnode27008  {
TY27014 Link;
NI Key;
NI Upperbound;
NI Level;
};
struct  tcellseq44749  {
NI Len;
NI Cap;
tcell44733** D;
};
struct  tcellset44745  {
NI Counter;
NI Max;
tpagedesc44741* Head;
tpagedesc44741** Data;
};
typedef tsmallchunk26240* TY27022[512];
typedef ttrunk26213* ttrunkbuckets26215[256];
struct  tintset26217  {
ttrunkbuckets26215 Data;
};
struct  tmemregion27010  {
NI Minlargeobj;
NI Maxlargeobj;
TY27022 Freesmallchunks;
tllchunk27004* Llmem;
NI Currmem;
NI Maxmem;
NI Freemem;
NI Lastsize;
tbigchunk26242* Freechunkslist;
tintset26217 Chunkstarts;
tavlnode27008* Root;
tavlnode27008* Deleted;
tavlnode27008* Last;
tavlnode27008* Freeavlnodes;
};
struct  tgcstat46814  {
NI Stackscans;
NI Cyclecollections;
NI Maxthreshold;
NI Maxstacksize;
NI Maxstackcells;
NI Cycletablesize;
NI64 Maxpause;
};
struct  tgcheap46816  {
void* Stackbottom;
NI Cyclethreshold;
tcellseq44749 Zct;
tcellseq44749 Decstack;
tcellset44745 Cycleroots;
tcellseq44749 Tempstack;
NI Recgclock;
tmemregion27010 Region;
tgcstat46814 Stat;
};
struct  tbasechunk26238  {
NI Prevsize;
NI Size;
NIM_BOOL Used;
};
struct  tsmallchunk26240  {
  tbasechunk26238 Sup;
tsmallchunk26240* Next;
tsmallchunk26240* Prev;
tfreecell26230* Freelist;
NI Free;
NI Acc;
NF Data;
};
struct  tbigchunk26242  {
  tbasechunk26238 Sup;
tbigchunk26242* Next;
tbigchunk26242* Prev;
NI Align;
NF Data;
};
typedef NI TY26220[16];
struct  ttrunk26213  {
ttrunk26213* Next;
NI Key;
TY26220 Bits;
};
struct  tllchunk27004  {
NI Size;
NI Acc;
tllchunk27004* Next;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  tfreecell26230  {
tfreecell26230* Next;
NI Zerofield;
};
typedef N_NIMCALL_PTR(void, TY16001) (NimStringDesc* msg);
typedef TFrame* TY16601[128];
struct  tcell44733  {
NI Refcount;
TNimType* Typ;
};
struct  tpagedesc44741  {
tpagedesc44741* Next;
NI Key;
TY26220 Bits;
};
typedef N_NIMCALL_PTR(void, TFinalizer) (void* self);
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Exception  {
  TNimObject Sup;
Exception* parent;
NCSTRING name;
NimStringDesc* message;
NimStringDesc* trace;
};
struct  arithmeticerror3239  {
  Exception Sup;
};
struct  overflowerror3243  {
  arithmeticerror3239 Sup;
};
typedef struct {
N_NIMCALL_PTR(NIM_BOOL, ClPrc) (Exception* e, void* ClEnv);
void* ClEnv;
} TY14809;
struct  TSafePoint  {
TSafePoint* prev;
NI status;
jmp_buf context;
NIM_BOOL hasRaiseAction;
TY14809 raiseAction;
};
typedef N_CLOSURE_PTR(NIM_BOOL, TMP53) (Exception* e);
struct  systemerror3229  {
  Exception Sup;
};
struct  outofmemerror3253  {
  systemerror3229 Sup;
};
typedef NIM_CHAR TY17616[2001];
struct  oserror3233  {
  systemerror3229 Sup;
NI32 Errorcode;
};
struct  valueerror3249  {
  Exception Sup;
};
struct  ioerror3231  {
  systemerror3229 Sup;
};
typedef NimStringDesc* TY198301[1];
typedef NI16 TY77805[1000001];
typedef NimStringDesc* TY79432[5];
struct  reraiseerror3263  {
  Exception Sup;
};
struct TY86345 {
NimStringDesc* Field0;
NI Field1;
};
typedef NIM_CHAR TY75680[500];
struct  rangeerror3259  {
  Exception Sup;
};
typedef NIM_CHAR TY75604[65];
typedef NI32 TY612372[1];
struct  assertionerror3247  {
  Exception Sup;
};
struct TY269081 {
NI Field0;
NI Field1;
};
typedef ttype226852* TY412748[1];
struct  tentry419478  {
NI Pos;
tsym226846* Sym;
};
struct  tlinemap419480  {
TY419485* Entries;
};
typedef NIM_CHAR TY82435[60];
struct  tinstantiation226836  {
tsym226846* Sym;
ttypeseq226848* Concretetypes;
TY226936* Usedby;
};
typedef tinstantiation226836* TY492078[1];
typedef tnode226816* TY247892[1];
struct  slice85779  {
NI A;
NI B;
};
struct  divbyzeroerror3241  {
  arithmeticerror3239 Sup;
};
typedef tsym226846* TY291499[1];
struct TY337611 {
NimStringDesc* Field0;
jsonnodeobj337042* Field1;
};
struct  tindexentry360264  {
NimStringDesc* Keyword;
NimStringDesc* Link;
NimStringDesc* Linktitle;
NimStringDesc* Linkdesc;
};
struct  tidobj201015  {
  TNimObject Sup;
NI Id;
};
struct  tloc226830  {
NU8 K;
NU8 S;
NU8 Flags;
ttype226852* T;
trope178009* R;
trope178009* Heaproot;
};
struct  ttype226852  {
  tidobj201015 Sup;
NU8 Kind;
NU8 Callconv;
NU32 Flags;
ttypeseq226848* Sons;
tnode226816* N;
tsym226846* Owner;
tsym226846* Sym;
tsym226846* Destructor;
tsym226846* Deepcopy;
NI64 Size;
NI16 Align;
NI16 Locklevel;
tloc226830 Loc;
};
struct  tstrtable226820  {
NI Counter;
tsymseq226818* Data;
};
struct  tlineinfo196539  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
struct  tsym226846  {
  tidobj201015 Sup;
NU8 Kind;
union {
struct {ttypeseq226848* Typeinstcache;
tscope226840* Typscope;
} S1;
struct {TY226947* Procinstcache;
tscope226840* Scope;
} S2;
struct {TY226947* Usedgenerics;
tstrtable226820 Tab;
} S3;
struct {tsym226846* Guard;
} S4;
} kindU;
NU16 Magic;
ttype226852* Typ;
tident201021* Name;
tlineinfo196539 Info;
tsym226846* Owner;
NU32 Flags;
tnode226816* Ast;
NU32 Options;
NI Position;
NI Offset;
tloc226830 Loc;
tlib226834* Annex;
tnode226816* Constraint;
};
struct  tnode226816  {
ttype226852* Typ;
tlineinfo196539 Info;
NU16 Flags;
NU8 Kind;
union {
struct {NI64 Intval;
} S1;
struct {NF Floatval;
} S2;
struct {NimStringDesc* Strval;
} S3;
struct {tsym226846* Sym;
} S4;
struct {tident201021* Ident;
} S5;
struct {tnodeseq226810* Sons;
} S6;
} kindU;
NimStringDesc* Comment;
};
struct  jsonnodeobj337042  {
NU8 Kind;
union {
struct {NimStringDesc* Str;
} S1;
struct {NI64 Num;
} S2;
struct {NF Fnum;
} S3;
struct {NIM_BOOL Bval;
} S4;
struct {TY337057* Fields;
} S6;
struct {TY337062* Elems;
} S7;
} kindU;
};
typedef NIM_CHAR TY183632[4001];
struct  tsocketimpl183607  {
NI Fd;
NIM_BOOL Isbuffered;
union {
struct {TY183632 Buffer;
NI Currpos;
NI Buflen;
} S1;
} isbufferedU;
NIM_BOOL Nonblocking;
};
struct  trope178009  {
  TNimObject Sup;
trope178009* Left;
trope178009* Right;
NI Length;
NimStringDesc* Data;
};
struct  tscope226840  {
NI Depthlevel;
tstrtable226820 Symbols;
tnodeseq226810* Usingsyms;
tscope226840* Parent;
};
struct  tident201021  {
  tidobj201015 Sup;
NimStringDesc* S;
tident201021* Next;
NI H;
};
struct  tlistentry129022  {
  TNimObject Sup;
tlistentry129022* Prev;
tlistentry129022* Next;
};
struct  tlib226834  {
  tlistentry129022 Sup;
NU8 Kind;
NIM_BOOL Generated;
NIM_BOOL Isoverriden;
trope178009* Name;
tnode226816* Path;
};
struct TY120608 {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct TY226936 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct ttypeseq226848 {
  TGenericSeq Sup;
  ttype226852* data[SEQ_DECL_SIZE];
};
struct TY419485 {
  TGenericSeq Sup;
  tentry419478 data[SEQ_DECL_SIZE];
};
struct TY419481 {
  TGenericSeq Sup;
  tlinemap419480 data[SEQ_DECL_SIZE];
};
struct TY226947 {
  TGenericSeq Sup;
  tinstantiation226836* data[SEQ_DECL_SIZE];
};
struct tnodeseq226810 {
  TGenericSeq Sup;
  tnode226816* data[SEQ_DECL_SIZE];
};
struct tsymseq226818 {
  TGenericSeq Sup;
  tsym226846* data[SEQ_DECL_SIZE];
};
struct TY337062 {
  TGenericSeq Sup;
  jsonnodeobj337042* data[SEQ_DECL_SIZE];
};
struct TY337057 {
  TGenericSeq Sup;
  TY337611 data[SEQ_DECL_SIZE];
};
struct TY192015 {
  TGenericSeq Sup;
  tsocketimpl183607* data[SEQ_DECL_SIZE];
};
static N_INLINE(void, initallocator_9401)(void);
static N_INLINE(void, initStackBottom)(void);
N_NOINLINE(void, setStackBottom)(void* thestackbottom);
N_NIMCALL(void, initgc_9201)(void);
N_NIMCALL(void, init_44847)(tcellseq44749* s, NI cap);
N_NOCONV(void*, alloc0_5817)(NI size);
N_NIMCALL(void*, alloc0_43419)(tmemregion27010* allocator, NI size);
N_NIMCALL(void*, alloc_43234)(tmemregion27010* allocator, NI size);
N_NIMCALL(void*, rawalloc_34146)(tmemregion27010* a, NI requestedsize);
static N_INLINE(NI, roundup_26270)(NI x, NI v);
N_NIMCALL(tsmallchunk26240*, getsmallchunk_33628)(tmemregion27010* a);
N_NIMCALL(tbigchunk26242*, getbigchunk_32820)(tmemregion27010* a, NI size);
static N_INLINE(void, listremove_30603)(tbigchunk26242** head_30609, tbigchunk26242* c_30612);
N_NIMCALL(void, splitchunk_32615)(tmemregion27010* a, tbigchunk26242* c, NI size);
static N_INLINE(void, updateprevsize_29691)(tmemregion27010* a, tbigchunk26242* c, NI prevsize);
static N_INLINE(NIM_BOOL, isaccessible_29621)(tmemregion27010* a, void* p);
N_NIMCALL(NIM_BOOL, contains_28595)(tintset26217* s, NI key);
N_NIMCALL(ttrunk26213*, intsetget_28524)(tintset26217* t, NI key);
static N_INLINE(NI, pageindex_28938)(void* p);
N_NIMCALL(void, incl_28624)(tmemregion27010* a, tintset26217* s, NI key);
N_NIMCALL(ttrunk26213*, intsetput_28560)(tmemregion27010* a, tintset26217* t, NI key);
N_NIMCALL(void*, llalloc_27259)(tmemregion27010* a, NI size);
static N_INLINE(void*, osallocpages_26023)(NI size);
N_NOINLINE(void, raiseoutofmem_25659)(void);
static N_INLINE(void, inccurrmem_27205)(tmemregion27010* a, NI bytes);
static N_INLINE(NI, pageindex_28930)(tbasechunk26238* c);
static N_INLINE(void, listadd_31831)(tbigchunk26242** head_31837, tbigchunk26242* c_31840);
N_NIMCALL(tbigchunk26242*, requestoschunks_28956)(tmemregion27010* a, NI size);
static N_INLINE(void, listadd_35005)(tsmallchunk26240** head_35011, tsmallchunk26240* c_35014);
static N_INLINE(void, listremove_37803)(tsmallchunk26240** head_37809, tsmallchunk26240* c_37812);
N_NIMCALL(void, add_28224)(tmemregion27010* a, tavlnode27008** t, NI key, NI upperbound);
N_NIMCALL(tavlnode27008*, allocavlnode_27436)(tmemregion27010* a, NI key, NI upperbound);
N_NIMCALL(void, skew_28196)(tavlnode27008** t);
N_NIMCALL(void, split_28204)(tavlnode27008** t);
N_NIMCALL(void, init_44868)(tcellset44745* s);
N_NOCONV(void, signalHandler)(int sig);
N_NIMCALL(void, showerrormessage_16209)(NCSTRING data);
N_NIMCALL(NimStringDesc*, cstrToNimstr)(NCSTRING str);
N_NIMCALL(NimStringDesc*, toNimStr)(NCSTRING str, NI len);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
N_NIMCALL(void*, rawnewobj_54604)(TNimType* typ, NI size, tgcheap46816* gch);
N_NIMCALL(void, collectct_48810)(tgcheap46816* gch);
static N_INLINE(NI, getoccupiedmem_44668)(tmemregion27010* a);
N_NIMCALL(void, collectctbody_71419)(tgcheap46816* gch);
N_NOINLINE(NI, stacksize_68810)(void);
static N_INLINE(void, prepareforinteriorpointerchecking_42082)(tmemregion27010* a);
N_NIMCALL(NI, lowgauge_28018)(tavlnode27008* n);
N_NIMCALL(NI, highgauge_28049)(tavlnode27008* n);
N_CDECL(void, markstackandregisters_69040)(tgcheap46816* gch);
static N_INLINE(void, gcmark_67446)(tgcheap46816* gch, void* p);
static N_INLINE(tcell44733*, usrtocell_48446)(void* usr);
N_NIMCALL(void*, interiorallocatedptr_42089)(tmemregion27010* a, void* p);
static N_INLINE(tbasechunk26238*, pageaddr_28946)(void* p);
static N_INLINE(NIM_BOOL, chunkunused_28810)(tbasechunk26238* c);
static N_INLINE(NIM_BOOL, issmallchunk_28799)(tbasechunk26238* c);
N_NIMCALL(tavlnode27008*, inrange_28129)(tavlnode27008* root, NI key);
static N_INLINE(void, add_44821)(tcellseq44749* s, tcell44733* c);
N_NOCONV(void*, alloc_5801)(NI size);
N_NOCONV(void, dealloc_5848)(void* p);
N_NIMCALL(void, dealloc_43428)(tmemregion27010* allocator, void* p);
N_NIMCALL(void, rawdealloc_40423)(tmemregion27010* a, void* p);
N_NIMCALL(void, freebigchunk_29806)(tmemregion27010* a, tbigchunk26242* c_29810);
N_NIMCALL(void, excl_28638)(tintset26217* s, NI key);
N_NIMCALL(void, freeoschunks_29410)(tmemregion27010* a, void* p, NI size);
static N_INLINE(void, osdeallocpages_26031)(void* p, NI size);
static N_INLINE(void, deccurrmem_27225)(tmemregion27010* a, NI bytes);
N_NIMCALL(void, del_28404)(tmemregion27010* a, tavlnode27008** t, NI x);
static N_INLINE(void, deallocavlnode_28006)(tmemregion27010* a, tavlnode27008* n);
N_NIMCALL(void, markthreadstacks_68006)(tgcheap46816* gch);
N_NIMCALL(NIM_BOOL, collectzct_66812)(tgcheap46816* gch);
static N_INLINE(NIM_BOOL, canbecycleroot_48467)(tcell44733* c);
N_NIMCALL(void, excl_45502)(tcellset44745* s, tcell44733* cell);
N_NIMCALL(tpagedesc44741*, cellsetget_44920)(tcellset44745 t, NI key);
static N_INLINE(NI, nexttry_44912)(NI h, NI maxhash);
N_NIMCALL(void, preparedealloc_49008)(tcell44733* cell);
static N_INLINE(void*, celltousr_48425)(tcell44733* cell);
N_NIMCALL(void, forallchildren_48817)(tcell44733* cell, NU8 op);
N_NIMCALL(void, forallchildrenaux_48825)(void* dest, TNimType* mt, NU8 op);
N_NIMCALL(void, dooperation_48821)(void* p, NU8 op);
static N_INLINE(void, decref_50404)(tcell44733* c);
static N_INLINE(void, rtladdzct_50004)(tcell44733* c);
N_NOINLINE(void, addzct_48417)(tcellseq44749* s, tcell44733* c);
static N_INLINE(void, rtladdcycleroot_49229)(tcell44733* c);
N_NOINLINE(void, incl_45471)(tcellset44745* s, tcell44733* cell);
N_NIMCALL(tpagedesc44741*, cellsetput_45266)(tcellset44745* t, NI key);
N_NIMCALL(void, cellsetenlarge_45212)(tcellset44745* t);
N_NIMCALL(void, cellsetrawinsert_44954)(tcellset44745 t, tpagedesc44741** data, tpagedesc44741* desc);
N_NIMCALL(void, markgray_64005)(tcell44733* s);
N_NIMCALL(void, scan_64404)(tcell44733* s);
N_NIMCALL(void, scanblack_64204)(tcell44733* s);
N_NIMCALL(void, collectwhite_64604)(tcell44733* s);
N_NIMCALL(NIM_BOOL, contains_45423)(tcellset44745 s, tcell44733* cell);
N_NIMCALL(void, freecycliccell_63227)(tgcheap46816* gch, tcell44733* c);
N_NIMCALL(void, forallslotsaux_53008)(void* dest, TNimNode* n, NU8 op);
N_NIMCALL(TNimNode*, selectbranch_25410)(void* aa, TNimNode* n);
N_NIMCALL(NI, getdiscriminant_25136)(void* aa, TNimNode* n);
N_NIMCALL(void, collectcycles_67045)(tgcheap46816* gch);
N_NIMCALL(void, markroots_64805)(tgcheap46816* gch);
N_NIMCALL(void, collectroots_67001)(tgcheap46816* gch);
N_NIMCALL(void, cellsetreset_53001)(tcellset44745* s);
N_NIMCALL(void, deinit_44879)(tcellset44745* s);
N_NIMCALL(NI, getoccupiedmem_6495)(void);
N_NIMCALL(NI, gettotalmem_6499)(void);
N_NIMCALL(NI, getfreemem_6497)(void);
N_NIMCALL(void, unmarkstackandregisters_71211)(tgcheap46816* gch);
static N_INLINE(void, addnewobjtozct_54090)(tcell44733* res, tgcheap46816* gch);
N_NIMCALL(void, writetostderr_16201)(NCSTRING msg);
N_NIMCALL(void, write_12877)(FILE* f, NCSTRING c);
N_NIMCALL(void, registersignalhandler_19808)(void);
N_NIMCALL(NI, getRefcount)(void* p);
N_NIMCALL(void*, newObjRC1)(TNimType* typ, NI size);
static N_INLINE(NI, addInt)(NI a, NI b);
N_NOINLINE(void, raiseOverflow)(void);
N_NIMCALL(void, nimGCvisit)(void* d, NI op);
N_NIMCALL(void, TMP50)(void* p, NI op);
N_NIMCALL(void, TMP51)(void* p, NI op);
N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
N_NIMCALL(void, raiseException)(Exception* e, NCSTRING ename);
N_NIMCALL(void, raiseexceptionaux_17404)(Exception* e);
static N_INLINE(void, pushCurrentException)(Exception* e);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incref_50825)(tcell44733* c);
static N_INLINE(NIM_BOOL, isObjWithCache)(TNimType* obj, TNimType* subclass, TNimType** cache);
N_NOINLINE(NIM_BOOL, isobjslowpath_21825)(TNimType* obj, TNimType* subclass, TNimType** cache);
static N_INLINE(void, quitordebug_17201)(void);
N_NIMCALL(NI, mulInt)(NI a, NI b);
N_NIMCALL(void, rawwrite_24602)(FILE* f, NimStringDesc* s);
N_NIMCALL(NI, writebuffer_13046)(FILE* f, void* buffer, NI len);
N_NOINLINE(void, procaddrerror_24615)(NCSTRING name);
N_NIMCALL(void, TMP138)(void* p, NI op);
N_NIMCALL(NimStringDesc*, HEX24_79012)(NI16* w, NI estimate);
N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s, NIM_CHAR c);
static N_INLINE(NI, resize_74401)(NI old);
N_NIMCALL(void*, growobj_63218)(void* old, NI newsize);
N_NIMCALL(void*, growobj_60206)(void* old, NI newsize, tgcheap46816* gch);
N_NOINLINE(NIM_BOOL, isonstack_48814)(void* p);
N_NIMCALL(void, TMP149)(void* p, NI op);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(void, genericresetaux_80201)(void* dest, TNimNode* n);
N_NIMCALL(void, genericReset)(void* dest, TNimType* mt);
N_NIMCALL(NimStringDesc*, copyStrLast)(NimStringDesc* s, NI start_74628, NI last);
N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
N_NIMCALL(NimStringDesc*, mnewString)(NI len);
N_NIMCALL(NimStringDesc*, mnewString)(NI len);
N_NIMCALL(void, genericassignaux_80206)(void* dest, void* src, TNimType* mt, NIM_BOOL shallow);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
N_NIMCALL(void, genericassignaux_80212)(void* dest, void* src, TNimNode* n, NIM_BOOL shallow);
N_NOINLINE(void, raiseeio_76605)(NimStringDesc* msg);
N_NIMCALL(void, TMP161)(void* p, NI op);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_197676)(TY120608* x_197682, TY120608* y_197687);
static N_INLINE(void*, seqtoptr_197692)(TY120608* x_197698);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(TGenericSeq*, incrSeq)(TGenericSeq* seq, NI elemsize);
N_NIMCALL(NimStringDesc*, setLengthStr)(NimStringDesc* s, NI newlen);
N_NIMCALL(void, TMP840)(void* p, NI op);
N_NIMCALL(void, objectinitaux_81292)(void* dest, TNimNode* n);
N_NIMCALL(void, objectInit)(void* dest, TNimType* typ);
N_NIMCALL(void*, fopen_79410)(NCSTRING filename, NCSTRING mode);
N_NIMCALL(NI16*, newwidecstring_78958)(NCSTRING s);
N_NIMCALL(NI16*, newwidecstring_78824)(NCSTRING source, NI l);
N_NIMCALL(void, TMP1036)(void* p, NI op);
N_NIMCALL(void*, realloc_44407)(tmemregion27010* allocator, void* p, NI newsize);
N_NIMCALL(NI, ptrsize_43016)(void* p);
N_NIMCALL(TNimType*, extGetCellType)(void* c);
N_NIMCALL(NIM_BOOL, open_12603)(FILE** f, NimStringDesc* filename, NU8 mode, NI bufsize);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(void, TMP1054)(void* p, NI op);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
N_NIMCALL(NIM_CHAR, getdecimalpoint_75661)(void);
N_NIMCALL(void, genericAssign)(void* dest, void* src, TNimType* mt);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_612232)(TY226936* x_612238, TY226936* y_612243);
static N_INLINE(void*, seqtoptr_612248)(TY226936* x_612254);
N_NIMCALL(void, write_12865)(FILE* f, NimStringDesc* s);
N_NIMCALL(void, TMP2178)(void* p, NI op);
N_NIMCALL(FILE*, open_12617)(NimStringDesc* filename, NU8 mode, NI bufsize);
static N_INLINE(void, pushSafePoint)(TSafePoint* s);
N_NIMCALL(NimStringDesc*, readallfile_77339)(FILE* file);
N_NIMCALL(NI, rawfilesize_77319)(FILE* file);
N_NIMCALL(NimStringDesc*, readallfile_77328)(FILE* file, NI len);
N_NIMCALL(NI, readbuffer_13027)(FILE* f, void* buffer, NI len);
static N_INLINE(void, popSafePoint)(void);
N_NIMCALL(void, reraiseException)(void);
static N_INLINE(void*, seqtoptr_274513)(ttypeseq226848* x_274519);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_274497)(ttypeseq226848* x_274503, ttypeseq226848* y_274508);
static N_INLINE(void*, seqtoptr_419648)(TY419481* x_419654);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_419739)(tlinemap419480 x_419743, tlinemap419480 y_419745);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_419758)(TY419485* x_419764, TY419485* y_419769);
static N_INLINE(void*, seqtoptr_419774)(TY419485* x_419780);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_419865)(tentry419478 x_419869, tentry419478 y_419871);
static N_INLINE(void*, seqtoptr_230354)(TY226947* x_230360);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_230338)(TY226947* x_230344, TY226947* y_230349);
static N_INLINE(void*, seqtoptr_316683)(tnodeseq226810* x_316689);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_316667)(tnodeseq226810* x_316673, tnodeseq226810* y_316678);
N_NIMCALL(TGenericSeq*, setLengthSeq)(TGenericSeq* seq, NI elemsize, NI newlen);
static N_INLINE(void*, seqtoptr_492417)(tsymseq226818* x_492423);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_492401)(tsymseq226818* x_492407, tsymseq226818* y_492412);
static N_INLINE(void*, seqtoptr_338098)(TY337062* x_338104);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_337893)(jsonnodeobj337042* a, jsonnodeobj337042* b);
static N_INLINE(void*, seqtoptr_338253)(TY337057* x_338259);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_338344)(TY337611 x_338348, TY337611 y_338350);
N_NIMCALL(NIM_BOOL, readline_12889)(FILE* f, NimStringDesc** line);
N_NIMCALL(void, TMP4868)(void* p, NI op);
static N_INLINE(void, gcdisable_8001)(void);
N_NIMCALL(NimStringDesc*, nimInt64ToStr)(NI64 x);
static N_INLINE(void, gcenable_8003)(void);
STRING_LITERAL(TMP2, "out of memory", 13);
STRING_LITERAL(TMP52, "over- or underflow", 18);
STRING_LITERAL(TMP135, "could not load: ", 16);
STRING_LITERAL(TMP136, "\015\012", 2);
STRING_LITERAL(TMP137, "could not import: ", 18);
STRING_LITERAL(TMP150, "attempt to write to a nil address", 33);
STRING_LITERAL(TMP162, "cannot write string to file", 27);
STRING_LITERAL(TMP1037, "rb", 2);
STRING_LITERAL(TMP1038, "wb", 2);
STRING_LITERAL(TMP1039, "w+b", 3);
STRING_LITERAL(TMP1040, "r+b", 3);
STRING_LITERAL(TMP1041, "ab", 2);
NIM_CONST TY79432 formatopen_79431 = {((NimStringDesc*) &TMP1037),
((NimStringDesc*) &TMP1038),
((NimStringDesc*) &TMP1039),
((NimStringDesc*) &TMP1040),
((NimStringDesc*) &TMP1041)}
;
STRING_LITERAL(TMP1053, "cannot open: ", 13);
STRING_LITERAL(TMP1055, "no exception to reraise", 23);
STRING_LITERAL(TMP1056, "(", 1);
STRING_LITERAL(TMP1057, ", ", 2);
STRING_LITERAL(TMP1058, "filename", 8);
STRING_LITERAL(TMP1059, ": ", 2);
STRING_LITERAL(TMP1060, "line", 4);
STRING_LITERAL(TMP1061, ")", 1);
STRING_LITERAL(TMP1247, " (invalid data!)", 16);
STRING_LITERAL(TMP2622, "error while reading from file", 29);
STRING_LITERAL(TMP2716, "cannot set file position", 24);
STRING_LITERAL(TMP2717, "cannot retrieve file position", 29);
STRING_LITERAL(TMP4776, "true", 4);
STRING_LITERAL(TMP4777, "false", 5);
STRING_LITERAL(TMP4857, "EOF reached", 11);
STRING_LITERAL(TMP4877, "[GC] total memory: ", 19);
STRING_LITERAL(TMP4878, "\015\012[GC] occupied memory: ", 24);
STRING_LITERAL(TMP4879, "\015\012[GC] stack scans: ", 20);
STRING_LITERAL(TMP4880, "\015\012[GC] stack cells: ", 20);
STRING_LITERAL(TMP4881, "\015\012[GC] cycle collections: ", 26);
STRING_LITERAL(TMP4882, "\015\012[GC] max threshold: ", 22);
STRING_LITERAL(TMP4883, "\015\012[GC] zct capacity: ", 21);
STRING_LITERAL(TMP4884, "\015\012[GC] max cycle table size: ", 29);
STRING_LITERAL(TMP4885, "\015\012[GC] max stack size: ", 23);
STRING_LITERAL(TMP4886, "\015\012[GC] max pause time [ms]: ", 28);
NI nim_program_result;
TY8221 globalraisehook_8225;
TY8226 localraisehook_8230;
TY8231 outofmemhook_8233;
TNimType strdesc_9804;
TY16001 errormessagewriter_16004;
TFrame* frameptr_16242;
TSafePoint* exchandler_16243;
Exception* currexception_16245;
TY16601 tempframes_16604;
tavlnode27008 bottomdata_27038;
tavlnode27008* bottom_27039;
tgcheap46816 gch_46844;
NIM_BOOL localgcinitialized_52804;
NIM_CHAR decimalpoint_75660;
TNimType NTI3211; /* RootObj */
TNimType NTI108; /* int */
TNimType NTI149; /* string */
TNimType NTI3227; /* Exception */
TNimType NTI8222; /* ref Exception */
TNimType NTI151; /* cstring */
TNimType NTI3239; /* ArithmeticError */
TNimType NTI3243; /* OverflowError */
TNimType NTI22201; /* ref OverflowError */
TNimType NTI3229; /* SystemError */
TNimType NTI3253; /* OutOfMemError */
static TNimType* Nim_OfCheck_CACHE1[2];
TNimType NTI3233; /* OSError */
TNimType NTI114; /* int32 */
TNimType NTI112438; /* ref OSError */
TNimType NTI3249; /* ValueError */
TNimType NTI21401; /* ref ValueError */
TNimType NTI112; /* int16 */
TNimType NTI3231; /* IOError */
TNimType NTI76801; /* ref IOError */
extern TNimType NTI120608; /* seq[string] */
TNimType NTI138; /* bool */
TNimType NTI5510; /* BiggestInt */
TNimType NTI5512; /* BiggestFloat */
TNimType NTI3213; /* RootRef */
TNimType NTI153; /* pointer */
TNimType NTI26220; /* array[0..15, int] */
TNimType NTI74721; /* range 0..2147483647(int) */
TNimType NTI128; /* float */
TNimType NTI12402; /* CFile */
TNimType NTI12404; /* File */
TNimType NTI110; /* int8 */
TNimType NTI77805; /* array[0..1000000, TUtf16Char] */
TNimType NTI77804; /* WideCString */
TNimType NTI3263; /* ReraiseError */
TNimType NTI18001; /* ref ReraiseError */
TNimType NTI3259; /* RangeError */
extern TNimType NTI226936; /* seq[int32] */
TNimType NTI124; /* uint32 */
TNimType NTI3247; /* AssertionError */
TNimType NTI86401; /* ref AssertionError */
extern TNimType NTI226848; /* TTypeSeq */
TNimType NTI12408; /* FileHandle */
TNimType NTI5611; /* cint */
extern TNimType NTI226838; /* PInstantiation */
extern TNimType NTI226947; /* seq[PInstantiation] */
extern TNimType NTI226810; /* TNodeSeq */
TNimType NTI3241; /* DivByZeroError */
extern TNimType NTI226818; /* TSymSeq */
TNimType NTI147; /* char */
extern TNimType NTI183609; /* Socket */
TNimType NTI192015; /* seq[Socket] */

static N_INLINE(void, initallocator_9401)(void) {
	bottom_27039 = (&bottomdata_27038);
	(*bottom_27039).Link[(0)- 0] = bottom_27039;
	(*bottom_27039).Link[(1)- 0] = bottom_27039;
}

N_NOINLINE(void, setStackBottom)(void* thestackbottom) {
	{
		if (!(gch_46844.Stackbottom == NIM_NIL)) goto LA3;
		gch_46844.Stackbottom = thestackbottom;
	}
	goto LA1;
	LA3: ;
	{
		NI a;
		NI b;
		a = ((NI) (thestackbottom));
		b = ((NI) (gch_46844.Stackbottom));
		gch_46844.Stackbottom = ((void*) (((a >= b) ? a : b)));
	}
	LA1: ;
}

static N_INLINE(void, initStackBottom)(void) {
	void* volatile locals;
	locals = 0;
	locals = ((void*) ((&locals)));
	setStackBottom(locals);
}

static N_INLINE(NI, roundup_26270)(NI x, NI v) {
	NI result;
	result = 0;
	result = (NI)((NI32)(x + (NI32)(v - 1)) & (NI)((NU32) ~((NI32)(v - 1))));
	return result;
}

static N_INLINE(void, listremove_30603)(tbigchunk26242** head_30609, tbigchunk26242* c_30612) {
	{
		if (!(c_30612 == (*head_30609))) goto LA3;
		(*head_30609) = (*c_30612).Next;
		{
			if (!!(((*head_30609) == NIM_NIL))) goto LA7;
			(*(*head_30609)).Prev = NIM_NIL;
		}
		LA7: ;
	}
	goto LA1;
	LA3: ;
	{
		(*(*c_30612).Prev).Next = (*c_30612).Next;
		{
			if (!!(((*c_30612).Next == NIM_NIL))) goto LA12;
			(*(*c_30612).Next).Prev = (*c_30612).Prev;
		}
		LA12: ;
	}
	LA1: ;
	(*c_30612).Next = NIM_NIL;
	(*c_30612).Prev = NIM_NIL;
}

N_NIMCALL(ttrunk26213*, intsetget_28524)(tintset26217* t, NI key) {
	ttrunk26213* result;
	ttrunk26213* it;
	result = 0;
	it = (*t).Data[((NI)(key & 255))- 0];
	{
		while (1) {
			if (!!((it == NIM_NIL))) goto LA2;
			{
				if (!((*it).Key == key)) goto LA5;
				result = it;
				goto BeforeRet;
			}
			LA5: ;
			it = (*it).Next;
		} LA2: ;
	}
	result = NIM_NIL;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, contains_28595)(tintset26217* s, NI key) {
	NIM_BOOL result;
	ttrunk26213* t;
	result = 0;
	t = intsetget_28524(s, (NI)((NU32)(key) >> (NU32)(9)));
	{
		NI u;
		if (!!((t == NIM_NIL))) goto LA3;
		u = (NI)(key & 511);
		result = !(((NI)((*t).Bits[((NI)((NU32)(((NI) (u))) >> (NU32)(5)))- 0] & (NI)((NU32)(1) << (NU32)(((NI) ((NI)(((NI) (u)) & 31)))))) == 0));
	}
	goto LA1;
	LA3: ;
	{
		result = NIM_FALSE;
	}
	LA1: ;
	return result;
}

static N_INLINE(NI, pageindex_28938)(void* p) {
	NI result;
	result = 0;
	result = (NI)((NU32)(((NI) (p))) >> (NU32)(12));
	return result;
}

static N_INLINE(NIM_BOOL, isaccessible_29621)(tmemregion27010* a, void* p) {
	NIM_BOOL result;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = pageindex_28938(p);
	result = contains_28595((&(*a).Chunkstarts), LOC1);
	return result;
}

static N_INLINE(void, updateprevsize_29691)(tmemregion27010* a, tbigchunk26242* c, NI prevsize) {
	tbasechunk26238* ri;
	ri = ((tbasechunk26238*) ((NI)((NU32)(((NI) (c))) + (NU32)((*c).Sup.Size))));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = isaccessible_29621((&(*a)), ((void*) (ri)));
		if (!LOC3) goto LA4;
		(*ri).Prevsize = prevsize;
	}
	LA4: ;
}

N_NOINLINE(void, raiseoutofmem_25659)(void) {
	{
		if (!!((outofmemhook_8233 == NIM_NIL))) goto LA3;
		outofmemhook_8233();
	}
	LA3: ;
	printf("%s\015\012", (((NimStringDesc*) &TMP2))->data);
	exit(1);
}

static N_INLINE(void*, osallocpages_26023)(NI size) {
	void* result;
	result = 0;
	result = VirtualAlloc(NIM_NIL, size, ((NI32) 12288), ((NI32) 4));
	{
		if (!(result == NIM_NIL)) goto LA3;
		raiseoutofmem_25659();
	}
	LA3: ;
	return result;
}

static N_INLINE(void, inccurrmem_27205)(tmemregion27010* a, NI bytes) {
	(*a).Currmem += bytes;
}

N_NIMCALL(void*, llalloc_27259)(tmemregion27010* a, NI size) {
	void* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		tllchunk27004* old;
		void* LOC7;
		LOC3 = 0;
		LOC3 = ((*a).Llmem == NIM_NIL);
		if (LOC3) goto LA4;
		LOC3 = ((*(*a).Llmem).Size < size);
		LA4: ;
		if (!LOC3) goto LA5;
		old = (*a).Llmem;
		LOC7 = 0;
		LOC7 = osallocpages_26023(4096);
		(*a).Llmem = ((tllchunk27004*) (LOC7));
		inccurrmem_27205(a, 4096);
		(*(*a).Llmem).Size = (NI32)(4096 - ((NI)sizeof(tllchunk27004)));
		(*(*a).Llmem).Acc = ((NI)sizeof(tllchunk27004));
		(*(*a).Llmem).Next = old;
	}
	LA5: ;
	result = ((void*) ((NI32)(((NI) ((*a).Llmem)) + (*(*a).Llmem).Acc)));
	(*(*a).Llmem).Size -= size;
	(*(*a).Llmem).Acc += size;
	zeroMem(result, size);
	return result;
}

N_NIMCALL(ttrunk26213*, intsetput_28560)(tmemregion27010* a, tintset26217* t, NI key) {
	ttrunk26213* result;
	result = 0;
	result = intsetget_28524((&(*t)), key);
	{
		void* LOC5;
		if (!(result == NIM_NIL)) goto LA3;
		LOC5 = 0;
		LOC5 = llalloc_27259(a, ((NI)sizeof(ttrunk26213)));
		result = ((ttrunk26213*) (LOC5));
		(*result).Next = (*t).Data[((NI)(key & 255))- 0];
		(*t).Data[((NI)(key & 255))- 0] = result;
		(*result).Key = key;
	}
	LA3: ;
	return result;
}

N_NIMCALL(void, incl_28624)(tmemregion27010* a, tintset26217* s, NI key) {
	ttrunk26213* t;
	NI u;
	t = intsetput_28560(a, s, (NI)((NU32)(key) >> (NU32)(9)));
	u = (NI)(key & 511);
	(*t).Bits[((NI)((NU32)(((NI) (u))) >> (NU32)(5)))- 0] = (NI)((*t).Bits[((NI)((NU32)(((NI) (u))) >> (NU32)(5)))- 0] | (NI)((NU32)(1) << (NU32)(((NI) ((NI)(((NI) (u)) & 31))))));
}

static N_INLINE(NI, pageindex_28930)(tbasechunk26238* c) {
	NI result;
	result = 0;
	result = (NI)((NU32)(((NI) (c))) >> (NU32)(12));
	return result;
}

static N_INLINE(void, listadd_31831)(tbigchunk26242** head_31837, tbigchunk26242* c_31840) {
	(*c_31840).Next = (*head_31837);
	{
		if (!!(((*head_31837) == NIM_NIL))) goto LA3;
		(*(*head_31837)).Prev = c_31840;
	}
	LA3: ;
	(*head_31837) = c_31840;
}

N_NIMCALL(void, splitchunk_32615)(tmemregion27010* a, tbigchunk26242* c, NI size) {
	tbigchunk26242* rest;
	tbasechunk26238* LOC1;
	NI LOC2;
	rest = ((tbigchunk26242*) ((NI)((NU32)(((NI) (c))) + (NU32)(size))));
	(*rest).Sup.Size = (NI32)((*c).Sup.Size - size);
	(*rest).Sup.Used = NIM_FALSE;
	(*rest).Next = NIM_NIL;
	(*rest).Prev = NIM_NIL;
	(*rest).Sup.Prevsize = size;
	updateprevsize_29691(a, c, (*rest).Sup.Size);
	(*c).Sup.Size = size;
	LOC1 = 0;
	LOC1 = &rest->Sup;
	LOC2 = 0;
	LOC2 = pageindex_28930(LOC1);
	incl_28624(a, (&(*a).Chunkstarts), LOC2);
	listadd_31831((&(*a).Freechunkslist), rest);
}

N_NIMCALL(tbigchunk26242*, requestoschunks_28956)(tmemregion27010* a, NI size) {
	tbigchunk26242* result;
	void* LOC1;
	NI nxt;
	tbasechunk26238* next;
	NI lastsize;
	NI prv;
	tbasechunk26238* prev;
	result = 0;
	inccurrmem_27205(a, size);
	(*a).Freemem += size;
	LOC1 = 0;
	LOC1 = osallocpages_26023(size);
	result = ((tbigchunk26242*) (LOC1));
	(*result).Next = NIM_NIL;
	(*result).Prev = NIM_NIL;
	(*result).Sup.Used = NIM_FALSE;
	(*result).Sup.Size = size;
	nxt = (NI)((NU32)(((NI) (result))) + (NU32)(size));
	next = ((tbasechunk26238*) (nxt));
	{
		NI LOC4;
		NIM_BOOL LOC5;
		LOC4 = 0;
		LOC4 = pageindex_28930(next);
		LOC5 = 0;
		LOC5 = contains_28595((&(*a).Chunkstarts), LOC4);
		if (!LOC5) goto LA6;
		(*next).Prevsize = size;
	}
	LA6: ;
	{
		if (!!(((*a).Lastsize == 0))) goto LA10;
		lastsize = (*a).Lastsize;
	}
	goto LA8;
	LA10: ;
	{
		lastsize = 4096;
	}
	LA8: ;
	prv = (NI)((NU32)(((NI) (result))) - (NU32)(lastsize));
	prev = ((tbasechunk26238*) (prv));
	{
		NIM_BOOL LOC15;
		NI LOC16;
		LOC15 = 0;
		LOC16 = 0;
		LOC16 = pageindex_28930(prev);
		LOC15 = contains_28595((&(*a).Chunkstarts), LOC16);
		if (!(LOC15)) goto LA17;
		LOC15 = ((*prev).Size == lastsize);
		LA17: ;
		if (!LOC15) goto LA18;
		(*result).Sup.Prevsize = lastsize;
	}
	goto LA13;
	LA18: ;
	{
		(*result).Sup.Prevsize = 0;
	}
	LA13: ;
	(*a).Lastsize = size;
	return result;
}

N_NIMCALL(tbigchunk26242*, getbigchunk_32820)(tmemregion27010* a, NI size) {
	tbigchunk26242* result;
	tbasechunk26238* LOC16;
	NI LOC17;
	result = 0;
	result = (*a).Freechunkslist;
	{
		{
			while (1) {
				if (!!((result == NIM_NIL))) goto LA3;
				{
					if (!((*result).Sup.Size == size)) goto LA6;
					listremove_30603((&(*a).Freechunkslist), result);
					goto LA1;
				}
				goto LA4;
				LA6: ;
				{
					if (!(size < (*result).Sup.Size)) goto LA9;
					listremove_30603((&(*a).Freechunkslist), result);
					splitchunk_32615(a, result, size);
					goto LA1;
				}
				goto LA4;
				LA9: ;
				LA4: ;
				result = (*result).Next;
			} LA3: ;
		}
		{
			if (!(size < 524288)) goto LA13;
			result = requestoschunks_28956(a, 524288);
			splitchunk_32615(a, result, size);
		}
		goto LA11;
		LA13: ;
		{
			result = requestoschunks_28956(a, size);
		}
		LA11: ;
	} LA1: ;
	(*result).Sup.Prevsize = 0;
	(*result).Sup.Used = NIM_TRUE;
	LOC16 = 0;
	LOC16 = &result->Sup;
	LOC17 = 0;
	LOC17 = pageindex_28930(LOC16);
	incl_28624(a, (&(*a).Chunkstarts), LOC17);
	(*a).Freemem -= size;
	return result;
}

N_NIMCALL(tsmallchunk26240*, getsmallchunk_33628)(tmemregion27010* a) {
	tsmallchunk26240* result;
	tbigchunk26242* res;
	result = 0;
	res = getbigchunk_32820(a, 4096);
	result = ((tsmallchunk26240*) (res));
	return result;
}

static N_INLINE(void, listadd_35005)(tsmallchunk26240** head_35011, tsmallchunk26240* c_35014) {
	(*c_35014).Next = (*head_35011);
	{
		if (!!(((*head_35011) == NIM_NIL))) goto LA3;
		(*(*head_35011)).Prev = c_35014;
	}
	LA3: ;
	(*head_35011) = c_35014;
}

static N_INLINE(void, listremove_37803)(tsmallchunk26240** head_37809, tsmallchunk26240* c_37812) {
	{
		if (!(c_37812 == (*head_37809))) goto LA3;
		(*head_37809) = (*c_37812).Next;
		{
			if (!!(((*head_37809) == NIM_NIL))) goto LA7;
			(*(*head_37809)).Prev = NIM_NIL;
		}
		LA7: ;
	}
	goto LA1;
	LA3: ;
	{
		(*(*c_37812).Prev).Next = (*c_37812).Next;
		{
			if (!!(((*c_37812).Next == NIM_NIL))) goto LA12;
			(*(*c_37812).Next).Prev = (*c_37812).Prev;
		}
		LA12: ;
	}
	LA1: ;
	(*c_37812).Next = NIM_NIL;
	(*c_37812).Prev = NIM_NIL;
}

N_NIMCALL(tavlnode27008*, allocavlnode_27436)(tmemregion27010* a, NI key, NI upperbound) {
	tavlnode27008* result;
	result = 0;
	{
		if (!!(((*a).Freeavlnodes == NIM_NIL))) goto LA3;
		result = (*a).Freeavlnodes;
		(*a).Freeavlnodes = (*(*a).Freeavlnodes).Link[(0)- 0];
	}
	goto LA1;
	LA3: ;
	{
		void* LOC6;
		LOC6 = 0;
		LOC6 = llalloc_27259(a, ((NI)sizeof(tavlnode27008)));
		result = ((tavlnode27008*) (LOC6));
	}
	LA1: ;
	(*result).Key = key;
	(*result).Upperbound = upperbound;
	(*result).Link[(0)- 0] = bottom_27039;
	(*result).Link[(1)- 0] = bottom_27039;
	(*result).Level = 1;
	return result;
}

N_NIMCALL(void, skew_28196)(tavlnode27008** t) {
	{
		tavlnode27008* temp;
		if (!((*(*(*t)).Link[(0)- 0]).Level == (*(*t)).Level)) goto LA3;
		temp = (*t);
		(*t) = (*(*t)).Link[(0)- 0];
		(*temp).Link[(0)- 0] = (*(*t)).Link[(1)- 0];
		(*(*t)).Link[(1)- 0] = temp;
	}
	LA3: ;
}

N_NIMCALL(void, split_28204)(tavlnode27008** t) {
	{
		tavlnode27008* temp;
		if (!((*(*(*(*t)).Link[(1)- 0]).Link[(1)- 0]).Level == (*(*t)).Level)) goto LA3;
		temp = (*t);
		(*t) = (*(*t)).Link[(1)- 0];
		(*temp).Link[(1)- 0] = (*(*t)).Link[(0)- 0];
		(*(*t)).Link[(0)- 0] = temp;
		(*(*t)).Level += 1;
	}
	LA3: ;
}

N_NIMCALL(void, add_28224)(tmemregion27010* a, tavlnode27008** t, NI key, NI upperbound) {
	{
		if (!((*t) == bottom_27039)) goto LA3;
		(*t) = allocavlnode_27436(a, key, upperbound);
	}
	goto LA1;
	LA3: ;
	{
		{
			if (!((NU32)(key) < (NU32)((*(*t)).Key))) goto LA8;
			add_28224(a, &(*(*t)).Link[(0)- 0], key, upperbound);
		}
		goto LA6;
		LA8: ;
		{
			if (!((NU32)((*(*t)).Key) < (NU32)(key))) goto LA11;
			add_28224(a, &(*(*t)).Link[(1)- 0], key, upperbound);
		}
		goto LA6;
		LA11: ;
		{
		}
		LA6: ;
		skew_28196(t);
		split_28204(t);
	}
	LA1: ;
}

N_NIMCALL(void*, rawalloc_34146)(tmemregion27010* a, NI requestedsize) {
	void* result;
	NI size;
	result = 0;
	size = roundup_26270(requestedsize, 8);
	{
		NI s;
		tsmallchunk26240* c;
		if (!(size <= (NI32)(4096 - (NI32)(((NI)sizeof(tsmallchunk26240)) - 8)))) goto LA3;
		s = (NI32)(size / 8);
		c = (*a).Freesmallchunks[(s)- 0];
		{
			if (!(c == NIM_NIL)) goto LA7;
			c = getsmallchunk_33628(a);
			(*c).Freelist = NIM_NIL;
			(*c).Sup.Size = size;
			(*c).Acc = size;
			(*c).Free = (NI32)((NI32)(4096 - (NI32)(((NI)sizeof(tsmallchunk26240)) - 8)) - size);
			(*c).Next = NIM_NIL;
			(*c).Prev = NIM_NIL;
			listadd_35005((&(*a).Freesmallchunks[(s)- 0]), c);
			result = ((void*) ((&(*c).Data)));
		}
		goto LA5;
		LA7: ;
		{
			{
				if (!((*c).Freelist == NIM_NIL)) goto LA12;
				result = ((void*) ((NI)((NU32)(((NI) ((&(*c).Data)))) + (NU32)((*c).Acc))));
				(*c).Acc += size;
			}
			goto LA10;
			LA12: ;
			{
				result = ((void*) ((*c).Freelist));
				(*c).Freelist = (*(*c).Freelist).Next;
			}
			LA10: ;
			(*c).Free -= size;
		}
		LA5: ;
		{
			if (!((*c).Free < size)) goto LA17;
			listremove_37803((&(*a).Freesmallchunks[(s)- 0]), c);
		}
		LA17: ;
	}
	goto LA1;
	LA3: ;
	{
		tbigchunk26242* c;
		size = roundup_26270((NI32)(requestedsize + (NI32)(((NI)sizeof(tbigchunk26242)) - 8)), 4096);
		c = getbigchunk_32820(a, size);
		result = ((void*) ((&(*c).Data)));
		{
			if (!((*a).Root == NIM_NIL)) goto LA22;
			(*a).Root = bottom_27039;
		}
		LA22: ;
		add_28224(a, &(*a).Root, ((NI) (result)), (NI)((NU32)(((NI) (result))) + (NU32)(size)));
	}
	LA1: ;
	return result;
}

N_NIMCALL(void*, alloc_43234)(tmemregion27010* allocator, NI size) {
	void* result;
	result = 0;
	result = rawalloc_34146(allocator, (NI32)(size + ((NI)sizeof(tfreecell26230))));
	(*((tfreecell26230*) (result))).Zerofield = 1;
	result = ((void*) ((NI)((NU32)(((NI) (result))) + (NU32)(((NI)sizeof(tfreecell26230))))));
	return result;
}

N_NIMCALL(void*, alloc0_43419)(tmemregion27010* allocator, NI size) {
	void* result;
	result = 0;
	result = alloc_43234(allocator, size);
	zeroMem(result, size);
	return result;
}

N_NOCONV(void*, alloc0_5817)(NI size) {
	void* result;
	result = 0;
	result = alloc0_43419((&gch_46844.Region), size);
	return result;
}

N_NIMCALL(void, init_44847)(tcellseq44749* s, NI cap) {
	void* LOC1;
	(*s).Len = 0;
	(*s).Cap = cap;
	LOC1 = 0;
	LOC1 = alloc0_5817((NI32)(cap * 4));
	(*s).D = ((tcell44733**) (LOC1));
}

N_NIMCALL(void, init_44868)(tcellset44745* s) {
	void* LOC1;
	LOC1 = 0;
	LOC1 = alloc0_5817(4096);
	(*s).Data = ((tpagedesc44741**) (LOC1));
	(*s).Max = 1023;
	(*s).Counter = 0;
	(*s).Head = NIM_NIL;
}

N_NIMCALL(void, initgc_9201)(void) {
	gch_46844.Cyclethreshold = 4194304;
	gch_46844.Stat.Stackscans = 0;
	gch_46844.Stat.Cyclecollections = 0;
	gch_46844.Stat.Maxthreshold = 0;
	gch_46844.Stat.Maxstacksize = 0;
	gch_46844.Stat.Maxstackcells = 0;
	gch_46844.Stat.Cycletablesize = 0;
	init_44847((&gch_46844.Zct), 1024);
	init_44847((&gch_46844.Tempstack), 1024);
	init_44868((&gch_46844.Cycleroots));
	init_44847((&gch_46844.Decstack), 1024);
}

static N_INLINE(NI, getoccupiedmem_44668)(tmemregion27010* a) {
	NI result;
	result = 0;
	result = (NI32)((*a).Currmem - (*a).Freemem);
	return result;
}

N_NOINLINE(NI, stacksize_68810)(void) {
	NI result;
	void* volatile stacktop;
	result = 0;
	stacktop = 0;
	result = ((NI32)(((NI) ((&stacktop))) - ((NI) (gch_46844.Stackbottom))) > 0? ((NI32)(((NI) ((&stacktop))) - ((NI) (gch_46844.Stackbottom)))) : -((NI32)(((NI) ((&stacktop))) - ((NI) (gch_46844.Stackbottom)))));
	return result;
}

N_NIMCALL(NI, lowgauge_28018)(tavlnode27008* n) {
	NI result;
	tavlnode27008* it;
	result = 0;
	it = n;
	{
		while (1) {
			if (!!((it == bottom_27039))) goto LA2;
			result = (*it).Key;
			it = (*it).Link[(0)- 0];
		} LA2: ;
	}
	return result;
}

N_NIMCALL(NI, highgauge_28049)(tavlnode27008* n) {
	NI result;
	tavlnode27008* it;
	result = 0;
	result = -1;
	it = n;
	{
		while (1) {
			if (!!((it == bottom_27039))) goto LA2;
			result = (*it).Upperbound;
			it = (*it).Link[(1)- 0];
		} LA2: ;
	}
	return result;
}

static N_INLINE(void, prepareforinteriorpointerchecking_42082)(tmemregion27010* a) {
	(*a).Minlargeobj = lowgauge_28018((*a).Root);
	(*a).Maxlargeobj = highgauge_28049((*a).Root);
}

static N_INLINE(tcell44733*, usrtocell_48446)(void* usr) {
	tcell44733* result;
	result = 0;
	result = ((tcell44733*) ((NI)((NU32)(((NI) (usr))) - (NU32)(((NI)sizeof(tcell44733))))));
	return result;
}

static N_INLINE(tbasechunk26238*, pageaddr_28946)(void* p) {
	tbasechunk26238* result;
	result = 0;
	result = ((tbasechunk26238*) ((NI)(((NI) (p)) & -4096)));
	return result;
}

static N_INLINE(NIM_BOOL, chunkunused_28810)(tbasechunk26238* c) {
	NIM_BOOL result;
	result = 0;
	result = !((*c).Used);
	return result;
}

static N_INLINE(NIM_BOOL, issmallchunk_28799)(tbasechunk26238* c) {
	NIM_BOOL result;
	result = 0;
	result = ((*c).Size <= (NI32)(4096 - (NI32)(((NI)sizeof(tsmallchunk26240)) - 8)));
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(tavlnode27008*, inrange_28129)(tavlnode27008* root, NI key) {
	tavlnode27008* result;
	tavlnode27008* it;
	result = 0;
	it = root;
	{
		while (1) {
			if (!!((it == bottom_27039))) goto LA2;
			{
				NIM_BOOL LOC5;
				LOC5 = 0;
				LOC5 = ((NU32)((*it).Key) <= (NU32)(key));
				if (!(LOC5)) goto LA6;
				LOC5 = ((NU32)(key) < (NU32)((*it).Upperbound));
				LA6: ;
				if (!LOC5) goto LA7;
				result = it;
				goto BeforeRet;
			}
			LA7: ;
			it = (*it).Link[(((NU32)((*it).Key) < (NU32)(key)))- 0];
		} LA2: ;
	}
	BeforeRet: ;
	return result;
}

N_NIMCALL(void*, interiorallocatedptr_42089)(tmemregion27010* a, void* p) {
	void* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		tbasechunk26238* c_42094;
		LOC3 = 0;
		LOC3 = isaccessible_29621(a, p);
		if (!LOC3) goto LA4;
		c_42094 = pageaddr_28946(p);
		{
			NIM_BOOL LOC8;
			LOC8 = 0;
			LOC8 = chunkunused_28810(c_42094);
			if (!!(LOC8)) goto LA9;
			{
				NIM_BOOL LOC13;
				tsmallchunk26240* c;
				NI offset;
				LOC13 = 0;
				LOC13 = issmallchunk_28799(c_42094);
				if (!LOC13) goto LA14;
				c = ((tsmallchunk26240*) (c_42094));
				offset = (NI)((NU32)((NI)(((NI) (p)) & 4095)) - (NU32)((NI32)(((NI)sizeof(tsmallchunk26240)) - 8)));
				{
					tfreecell26230* d;
					if (!((NU32)(offset) < (NU32)((*c).Acc))) goto LA18;
					d = ((tfreecell26230*) ((NI)((NU32)((NI)((NU32)(((NI) ((&(*c).Data)))) + (NU32)(offset))) - (NU32)((NI)((NU32)(offset) % (NU32)((*c).Sup.Size))))));
					{
						if (!((NU32)(1) < (NU32)((*d).Zerofield))) goto LA22;
						result = ((void*) (d));
					}
					LA22: ;
				}
				LA18: ;
			}
			goto LA11;
			LA14: ;
			{
				tbigchunk26242* c;
				NF* d;
				c = ((tbigchunk26242*) (c_42094));
				d = (&(*c).Data);
				{
					NIM_BOOL LOC27;
					LOC27 = 0;
					LOC27 = (((void*) (d)) <= p);
					if (!(LOC27)) goto LA28;
					LOC27 = ((NU32)(1) < (NU32)((*((tfreecell26230*) (d))).Zerofield));
					LA28: ;
					if (!LOC27) goto LA29;
					result = ((void*) (d));
				}
				LA29: ;
			}
			LA11: ;
		}
		LA9: ;
	}
	goto LA1;
	LA4: ;
	{
		NI q;
		q = ((NI) (p));
		{
			NIM_BOOL LOC34;
			tavlnode27008* avlnode;
			LOC34 = 0;
			LOC34 = ((NU32)((*a).Minlargeobj) <= (NU32)(q));
			if (!(LOC34)) goto LA35;
			LOC34 = ((NU32)(q) <= (NU32)((*a).Maxlargeobj));
			LA35: ;
			if (!LOC34) goto LA36;
			avlnode = inrange_28129((*a).Root, q);
			{
				void* k;
				tbigchunk26242* c;
				tbasechunk26238* LOC42;
				if (!!((avlnode == NIM_NIL))) goto LA40;
				k = ((void*) ((*avlnode).Key));
				LOC42 = 0;
				LOC42 = pageaddr_28946(k);
				c = ((tbigchunk26242*) (LOC42));
				{
					if (!((NU32)(1) < (NU32)((*((tfreecell26230*) (k))).Zerofield))) goto LA45;
					result = k;
				}
				LA45: ;
			}
			LA40: ;
		}
		LA36: ;
	}
	LA1: ;
	return result;
}

N_NOCONV(void*, alloc_5801)(NI size) {
	void* result;
	result = 0;
	result = alloc_43234((&gch_46844.Region), size);
	return result;
}

N_NIMCALL(void, excl_28638)(tintset26217* s, NI key) {
	ttrunk26213* t;
	t = intsetget_28524((&(*s)), (NI)((NU32)(key) >> (NU32)(9)));
	{
		NI u;
		if (!!((t == NIM_NIL))) goto LA3;
		u = (NI)(key & 511);
		(*t).Bits[((NI)((NU32)(((NI) (u))) >> (NU32)(5)))- 0] = (NI)((*t).Bits[((NI)((NU32)(((NI) (u))) >> (NU32)(5)))- 0] & (NI)((NU32) ~((NI)((NU32)(1) << (NU32)(((NI) ((NI)(((NI) (u)) & 31))))))));
	}
	LA3: ;
}

static N_INLINE(void, osdeallocpages_26031)(void* p, NI size) {
	VirtualFree(p, 0, ((NI32) 32768));
}

static N_INLINE(void, deccurrmem_27225)(tmemregion27010* a, NI bytes) {
	(*a).Maxmem = (((*a).Maxmem >= (*a).Currmem) ? (*a).Maxmem : (*a).Currmem);
	(*a).Currmem -= bytes;
}

N_NIMCALL(void, freeoschunks_29410)(tmemregion27010* a, void* p, NI size) {
	tbasechunk26238* c;
	NI nxt;
	tbasechunk26238* next;
	NI LOC7;
	c = ((tbasechunk26238*) (p));
	nxt = (NI)((NU32)(((NI) (p))) + (NU32)((*c).Size));
	next = ((tbasechunk26238*) (nxt));
	{
		NI LOC3;
		NIM_BOOL LOC4;
		LOC3 = 0;
		LOC3 = pageindex_28930(next);
		LOC4 = 0;
		LOC4 = contains_28595((&(*a).Chunkstarts), LOC3);
		if (!LOC4) goto LA5;
		(*next).Prevsize = 0;
	}
	LA5: ;
	LOC7 = 0;
	LOC7 = pageindex_28938(p);
	excl_28638((&(*a).Chunkstarts), LOC7);
	osdeallocpages_26031(p, size);
	deccurrmem_27225(a, size);
	(*a).Freemem -= size;
}

N_NIMCALL(void, freebigchunk_29806)(tmemregion27010* a, tbigchunk26242* c_29810) {
	tbigchunk26242* c;
	tbasechunk26238* ri;
	c = c_29810;
	(*a).Freemem += (*c).Sup.Size;
	ri = ((tbasechunk26238*) ((NI)((NU32)(((NI) (c))) + (NU32)((*c).Sup.Size))));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = isaccessible_29621((&(*a)), ((void*) (ri)));
		if (!(LOC3)) goto LA4;
		LOC3 = chunkunused_28810(ri);
		LA4: ;
		if (!LOC3) goto LA5;
		{
			NIM_BOOL LOC9;
			NI LOC12;
			LOC9 = 0;
			LOC9 = issmallchunk_28799(ri);
			if (!!(LOC9)) goto LA10;
			listremove_30603((&(*a).Freechunkslist), ((tbigchunk26242*) (ri)));
			(*c).Sup.Size += (*ri).Size;
			LOC12 = 0;
			LOC12 = pageindex_28930(ri);
			excl_28638((&(*a).Chunkstarts), LOC12);
		}
		LA10: ;
	}
	LA5: ;
	{
		tbasechunk26238* le;
		if (!!(((*c).Sup.Prevsize == 0))) goto LA15;
		le = ((tbasechunk26238*) ((NI)((NU32)(((NI) (c))) - (NU32)((*c).Sup.Prevsize))));
		{
			NIM_BOOL LOC19;
			LOC19 = 0;
			LOC19 = isaccessible_29621((&(*a)), ((void*) (le)));
			if (!(LOC19)) goto LA20;
			LOC19 = chunkunused_28810(le);
			LA20: ;
			if (!LOC19) goto LA21;
			{
				NIM_BOOL LOC25;
				tbasechunk26238* LOC28;
				NI LOC29;
				LOC25 = 0;
				LOC25 = issmallchunk_28799(le);
				if (!!(LOC25)) goto LA26;
				listremove_30603((&(*a).Freechunkslist), ((tbigchunk26242*) (le)));
				(*le).Size += (*c).Sup.Size;
				LOC28 = 0;
				LOC28 = &c->Sup;
				LOC29 = 0;
				LOC29 = pageindex_28930(LOC28);
				excl_28638((&(*a).Chunkstarts), LOC29);
				c = ((tbigchunk26242*) (le));
			}
			LA26: ;
		}
		LA21: ;
	}
	LA15: ;
	{
		NIM_BOOL LOC32;
		tbasechunk26238* LOC36;
		NI LOC37;
		LOC32 = 0;
		LOC32 = ((*c).Sup.Size < 1048576);
		if (LOC32) goto LA33;
		LOC32 = NIM_TRUE;
		LA33: ;
		if (!LOC32) goto LA34;
		LOC36 = 0;
		LOC36 = &c->Sup;
		LOC37 = 0;
		LOC37 = pageindex_28930(LOC36);
		incl_28624(a, (&(*a).Chunkstarts), LOC37);
		updateprevsize_29691(a, c, (*c).Sup.Size);
		listadd_31831((&(*a).Freechunkslist), c);
		(*c).Sup.Used = NIM_FALSE;
	}
	goto LA30;
	LA34: ;
	{
		freeoschunks_29410(a, ((void*) (c)), (*c).Sup.Size);
	}
	LA30: ;
}

static N_INLINE(void, deallocavlnode_28006)(tmemregion27010* a, tavlnode27008* n) {
	(*n).Link[(0)- 0] = (*a).Freeavlnodes;
	(*a).Freeavlnodes = n;
}

N_NIMCALL(void, del_28404)(tmemregion27010* a, tavlnode27008** t, NI x) {
	{
		if (!((*t) == bottom_27039)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	(*a).Last = (*t);
	{
		if (!((NU32)(x) < (NU32)((*(*t)).Key))) goto LA7;
		del_28404(a, &(*(*t)).Link[(0)- 0], x);
	}
	goto LA5;
	LA7: ;
	{
		(*a).Deleted = (*t);
		del_28404(a, &(*(*t)).Link[(1)- 0], x);
	}
	LA5: ;
	{
		NIM_BOOL LOC12;
		NIM_BOOL LOC13;
		LOC12 = 0;
		LOC13 = 0;
		LOC13 = ((*t) == (*a).Last);
		if (!(LOC13)) goto LA14;
		LOC13 = !(((*a).Deleted == bottom_27039));
		LA14: ;
		LOC12 = LOC13;
		if (!(LOC12)) goto LA15;
		LOC12 = (x == (*(*a).Deleted).Key);
		LA15: ;
		if (!LOC12) goto LA16;
		(*(*a).Deleted).Key = (*(*t)).Key;
		(*(*a).Deleted).Upperbound = (*(*t)).Upperbound;
		(*a).Deleted = bottom_27039;
		(*t) = (*(*t)).Link[(1)- 0];
		deallocavlnode_28006(a, (*a).Last);
	}
	goto LA10;
	LA16: ;
	{
		NIM_BOOL LOC19;
		LOC19 = 0;
		LOC19 = ((*(*(*t)).Link[(0)- 0]).Level < (NI32)((*(*t)).Level - 1));
		if (LOC19) goto LA20;
		LOC19 = ((*(*(*t)).Link[(1)- 0]).Level < (NI32)((*(*t)).Level - 1));
		LA20: ;
		if (!LOC19) goto LA21;
		(*(*t)).Level -= 1;
		{
			if (!((*(*t)).Level < (*(*(*t)).Link[(1)- 0]).Level)) goto LA25;
			(*(*(*t)).Link[(1)- 0]).Level = (*(*t)).Level;
		}
		LA25: ;
		skew_28196(t);
		skew_28196(&(*(*t)).Link[(1)- 0]);
		skew_28196(&(*(*(*t)).Link[(1)- 0]).Link[(1)- 0]);
		split_28204(t);
		split_28204(&(*(*t)).Link[(1)- 0]);
	}
	goto LA10;
	LA21: ;
	LA10: ;
	BeforeRet: ;
}

N_NIMCALL(void, rawdealloc_40423)(tmemregion27010* a, void* p) {
	tbasechunk26238* c_40601;
	c_40601 = pageaddr_28946(p);
	{
		NIM_BOOL LOC3;
		tsmallchunk26240* c;
		NI s;
		tfreecell26230* f;
		LOC3 = 0;
		LOC3 = issmallchunk_28799(c_40601);
		if (!LOC3) goto LA4;
		c = ((tsmallchunk26240*) (c_40601));
		s = (*c).Sup.Size;
		f = ((tfreecell26230*) (p));
		(*f).Zerofield = 0;
		(*f).Next = (*c).Freelist;
		(*c).Freelist = f;
		{
			if (!((*c).Free < s)) goto LA8;
			listadd_35005((&(*a).Freesmallchunks[((NI32)(s / 8))- 0]), c);
			(*c).Free += s;
		}
		goto LA6;
		LA8: ;
		{
			(*c).Free += s;
			{
				if (!((*c).Free == (NI32)(4096 - (NI32)(((NI)sizeof(tsmallchunk26240)) - 8)))) goto LA13;
				listremove_37803((&(*a).Freesmallchunks[((NI32)(s / 8))- 0]), c);
				(*c).Sup.Size = 4096;
				freebigchunk_29806(a, ((tbigchunk26242*) (c)));
			}
			LA13: ;
		}
		LA6: ;
	}
	goto LA1;
	LA4: ;
	{
		tbigchunk26242* c;
		c = ((tbigchunk26242*) (c_40601));
		(*a).Deleted = bottom_27039;
		del_28404(a, &(*a).Root, ((NI) ((&(*c).Data))));
		freebigchunk_29806(a, c);
	}
	LA1: ;
}

N_NIMCALL(void, dealloc_43428)(tmemregion27010* allocator, void* p) {
	void* x;
	x = ((void*) ((NI)((NU32)(((NI) (p))) - (NU32)(((NI)sizeof(tfreecell26230))))));
	rawdealloc_40423(allocator, x);
}

N_NOCONV(void, dealloc_5848)(void* p) {
	dealloc_43428((&gch_46844.Region), p);
}

static N_INLINE(void, add_44821)(tcellseq44749* s, tcell44733* c) {
	{
		tcell44733** d;
		void* LOC5;
		if (!((*s).Cap <= (*s).Len)) goto LA3;
		(*s).Cap = (NI32)((NI32)((*s).Cap * 3) / 2);
		LOC5 = 0;
		LOC5 = alloc_5801((NI32)((*s).Cap * 4));
		d = ((tcell44733**) (LOC5));
		memcpy(((void*) (d)), ((void*) ((*s).D)), (NI32)((*s).Len * 4));
		dealloc_5848(((void*) ((*s).D)));
		(*s).D = d;
	}
	LA3: ;
	(*s).D[((*s).Len)- 0] = c;
	(*s).Len += 1;
}

static N_INLINE(void, gcmark_67446)(tgcheap46816* gch, void* p) {
	tcell44733* cell;
	NI c;
	cell = usrtocell_48446(p);
	c = ((NI) (cell));
	{
		tcell44733* objstart;
		void* LOC5;
		if (!((NU32)(4096) < (NU32)(c))) goto LA3;
		LOC5 = 0;
		LOC5 = interiorallocatedptr_42089((&(*gch).Region), ((void*) (cell)));
		objstart = ((tcell44733*) (LOC5));
		{
			if (!!((objstart == NIM_NIL))) goto LA8;
			(*objstart).Refcount = (NI)((NU32)((*objstart).Refcount) + (NU32)(8));
			add_44821((&(*gch).Decstack), objstart);
		}
		LA8: ;
	}
	LA3: ;
}

N_CDECL(void, markstackandregisters_69040)(tgcheap46816* gch) {
	jmp_buf registers;
	{
		int LOC3;
		NI max;
		NI sp;
		LOC3 = 0;
		LOC3 = setjmp(registers);
		if (!(LOC3 == ((NI32) 0))) goto LA4;
		max = ((NI) ((*gch).Stackbottom));
		sp = ((NI) ((&registers)));
		{
			while (1) {
				if (!((NU32)(sp) < (NU32)((NI32)(max - 32)))) goto LA7;
				gcmark_67446(gch, ((void**) (sp))[(0)- 0]);
				gcmark_67446(gch, ((void**) (sp))[(1)- 0]);
				gcmark_67446(gch, ((void**) (sp))[(2)- 0]);
				gcmark_67446(gch, ((void**) (sp))[(3)- 0]);
				gcmark_67446(gch, ((void**) (sp))[(4)- 0]);
				gcmark_67446(gch, ((void**) (sp))[(5)- 0]);
				gcmark_67446(gch, ((void**) (sp))[(6)- 0]);
				gcmark_67446(gch, ((void**) (sp))[(7)- 0]);
				sp = (NI)((NU32)(sp) + (NU32)(32));
			} LA7: ;
		}
		{
			while (1) {
				if (!((NU32)(sp) <= (NU32)(max))) goto LA9;
				gcmark_67446(gch, (*((void**) (sp))));
				sp = (NI)((NU32)(sp) + (NU32)(4));
			} LA9: ;
		}
	}
	LA4: ;
}

N_NIMCALL(void, markthreadstacks_68006)(tgcheap46816* gch) {
}

static N_INLINE(NIM_BOOL, canbecycleroot_48467)(tcell44733* c) {
	NIM_BOOL result;
	result = 0;
	result = !((((*(*c).Typ).flags &(1<<((((NU8) 1))&7)))!=0));
	return result;
}

static N_INLINE(NI, nexttry_44912)(NI h, NI maxhash) {
	NI result;
	result = 0;
	result = (NI)((NI32)((NI32)(5 * h) + 1) & maxhash);
	return result;
}

N_NIMCALL(tpagedesc44741*, cellsetget_44920)(tcellset44745 t, NI key) {
	tpagedesc44741* result;
	NI h;
	result = 0;
	h = (NI)(((NI) (key)) & t.Max);
	{
		while (1) {
			if (!!((t.Data[(h)- 0] == NIM_NIL))) goto LA2;
			{
				if (!((*t.Data[(h)- 0]).Key == key)) goto LA5;
				result = t.Data[(h)- 0];
				goto BeforeRet;
			}
			LA5: ;
			h = nexttry_44912(h, t.Max);
		} LA2: ;
	}
	result = NIM_NIL;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, excl_45502)(tcellset44745* s, tcell44733* cell) {
	NI u;
	tpagedesc44741* t;
	u = ((NI) (cell));
	t = cellsetget_44920((*s), (NI)((NU32)(u) >> (NU32)(12)));
	{
		if (!!((t == NIM_NIL))) goto LA3;
		u = (NI)((NU32)((NI)((NU32)(u) % (NU32)(4096))) / (NU32)(8));
		(*t).Bits[((NI)((NU32)(u) >> (NU32)(5)))- 0] = (NI)((*t).Bits[((NI)((NU32)(u) >> (NU32)(5)))- 0] & (NI)((NU32) ~((NI)((NU32)(1) << (NU32)(((NI) ((NI)(u & 31))))))));
	}
	LA3: ;
}

static N_INLINE(void*, celltousr_48425)(tcell44733* cell) {
	void* result;
	result = 0;
	result = ((void*) ((NI)((NU32)(((NI) (cell))) + (NU32)(((NI)sizeof(tcell44733))))));
	return result;
}

N_NIMCALL(void, preparedealloc_49008)(tcell44733* cell) {
	{
		void* LOC5;
		if (!!(((*(*cell).Typ).finalizer == NIM_NIL))) goto LA3;
		gch_46844.Recgclock += 1;
		LOC5 = 0;
		LOC5 = celltousr_48425(cell);
		((TFinalizer) ((*(*cell).Typ).finalizer))(LOC5);
		gch_46844.Recgclock -= 1;
	}
	LA3: ;
}

N_NOINLINE(void, addzct_48417)(tcellseq44749* s, tcell44733* c) {
	{
		if (!((NI)((*c).Refcount & 4) == 0)) goto LA3;
		(*c).Refcount = (NI)((*c).Refcount | 4);
		add_44821(s, c);
	}
	LA3: ;
}

static N_INLINE(void, rtladdzct_50004)(tcell44733* c) {
	addzct_48417((&gch_46844.Zct), c);
}

N_NIMCALL(void, cellsetrawinsert_44954)(tcellset44745 t, tpagedesc44741** data, tpagedesc44741* desc) {
	NI h;
	h = (NI)(((NI) ((*desc).Key)) & t.Max);
	{
		while (1) {
			if (!!((data[(h)- 0] == NIM_NIL))) goto LA2;
			h = nexttry_44912(h, t.Max);
		} LA2: ;
	}
	data[(h)- 0] = desc;
}

N_NIMCALL(void, cellsetenlarge_45212)(tcellset44745* t) {
	NI oldmax;
	tpagedesc44741** n;
	void* LOC1;
	oldmax = (*t).Max;
	(*t).Max = (NI32)((NI32)((NI32)((*t).Max + 1) * 2) - 1);
	LOC1 = 0;
	LOC1 = alloc0_5817((NI32)((NI32)((*t).Max + 1) * 4));
	n = ((tpagedesc44741**) (LOC1));
	{
		NI i_45229;
		NI res_45252;
		i_45229 = 0;
		res_45252 = 0;
		{
			while (1) {
				if (!(res_45252 <= oldmax)) goto LA4;
				i_45229 = res_45252;
				{
					if (!!(((*t).Data[(i_45229)- 0] == NIM_NIL))) goto LA7;
					cellsetrawinsert_44954((*t), n, (*t).Data[(i_45229)- 0]);
				}
				LA7: ;
				res_45252 += 1;
			} LA4: ;
		}
	}
	dealloc_5848(((void*) ((*t).Data)));
	(*t).Data = n;
}

N_NIMCALL(tpagedesc44741*, cellsetput_45266)(tcellset44745* t, NI key) {
	tpagedesc44741* result;
	NI h;
	void* LOC19;
	result = 0;
	h = (NI)(((NI) (key)) & (*t).Max);
	{
		while (1) {
			tpagedesc44741* x;
			x = (*t).Data[(h)- 0];
			{
				if (!(x == NIM_NIL)) goto LA5;
				goto LA1;
			}
			LA5: ;
			{
				if (!((*x).Key == key)) goto LA9;
				result = x;
				goto BeforeRet;
			}
			LA9: ;
			h = nexttry_44912(h, (*t).Max);
		}
	} LA1: ;
	{
		NIM_BOOL LOC13;
		LOC13 = 0;
		LOC13 = ((NI32)((NI32)((*t).Max + 1) * 2) < (NI32)((*t).Counter * 3));
		if (LOC13) goto LA14;
		LOC13 = ((NI32)((NI32)((*t).Max + 1) - (*t).Counter) < 4);
		LA14: ;
		if (!LOC13) goto LA15;
		cellsetenlarge_45212(t);
	}
	LA15: ;
	(*t).Counter += 1;
	h = (NI)(((NI) (key)) & (*t).Max);
	{
		while (1) {
			if (!!(((*t).Data[(h)- 0] == NIM_NIL))) goto LA18;
			h = nexttry_44912(h, (*t).Max);
		} LA18: ;
	}
	LOC19 = 0;
	LOC19 = alloc0_5817(((NI)sizeof(tpagedesc44741)));
	result = ((tpagedesc44741*) (LOC19));
	(*result).Next = (*t).Head;
	(*result).Key = key;
	(*t).Head = result;
	(*t).Data[(h)- 0] = result;
	BeforeRet: ;
	return result;
}

N_NOINLINE(void, incl_45471)(tcellset44745* s, tcell44733* cell) {
	NI u;
	tpagedesc44741* t;
	u = ((NI) (cell));
	t = cellsetput_45266(s, (NI)((NU32)(u) >> (NU32)(12)));
	u = (NI)((NU32)((NI)((NU32)(u) % (NU32)(4096))) / (NU32)(8));
	(*t).Bits[((NI)((NU32)(u) >> (NU32)(5)))- 0] = (NI)((*t).Bits[((NI)((NU32)(u) >> (NU32)(5)))- 0] | (NI)((NU32)(1) << (NU32)(((NI) ((NI)(u & 31))))));
}

static N_INLINE(void, rtladdcycleroot_49229)(tcell44733* c) {
	{
		if (!!((((NI) ((NI)((*c).Refcount & 3))) == 3))) goto LA3;
		(*c).Refcount = (NI)((NI)((*c).Refcount & -4) | 3);
		incl_45471((&gch_46844.Cycleroots), c);
	}
	LA3: ;
}

static N_INLINE(void, decref_50404)(tcell44733* c) {
	{
		(*c).Refcount -= 8;
		if (!((NU32)((*c).Refcount) < (NU32)(8))) goto LA3;
		rtladdzct_50004(c);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = canbecycleroot_48467(c);
		if (!LOC6) goto LA7;
		rtladdcycleroot_49229(c);
	}
	goto LA1;
	LA7: ;
	LA1: ;
}

N_NIMCALL(void, markgray_64005)(tcell44733* s) {
	{
		if (!!((((NI) ((NI)((*s).Refcount & 3))) == 1))) goto LA3;
		(*s).Refcount = (NI)((NI)((*s).Refcount & -4) | 1);
		forallchildren_48817(s, ((NU8) 5));
	}
	LA3: ;
}

N_NIMCALL(void, scanblack_64204)(tcell44733* s) {
	(*s).Refcount = (NI)((*s).Refcount & -4);
	forallchildren_48817(s, ((NU8) 7));
}

N_NIMCALL(void, scan_64404)(tcell44733* s) {
	{
		if (!(((NI) ((NI)((*s).Refcount & 3))) == 1)) goto LA3;
		{
			if (!((NU32)(8) <= (NU32)((*s).Refcount))) goto LA7;
			scanblack_64204(s);
		}
		goto LA5;
		LA7: ;
		{
			(*s).Refcount = (NI)((NI)((*s).Refcount & -4) | 2);
			forallchildren_48817(s, ((NU8) 6));
		}
		LA5: ;
	}
	LA3: ;
}

N_NIMCALL(NIM_BOOL, contains_45423)(tcellset44745 s, tcell44733* cell) {
	NIM_BOOL result;
	NI u;
	tpagedesc44741* t;
	result = 0;
	u = ((NI) (cell));
	t = cellsetget_44920(s, (NI)((NU32)(u) >> (NU32)(12)));
	{
		if (!!((t == NIM_NIL))) goto LA3;
		u = (NI)((NU32)((NI)((NU32)(u) % (NU32)(4096))) / (NU32)(8));
		result = !(((NI)((*t).Bits[((NI)((NU32)(u) >> (NU32)(5)))- 0] & (NI)((NU32)(1) << (NU32)(((NI) ((NI)(u & 31)))))) == 0));
	}
	goto LA1;
	LA3: ;
	{
		result = NIM_FALSE;
	}
	LA1: ;
	return result;
}

N_NIMCALL(void, freecycliccell_63227)(tgcheap46816* gch, tcell44733* c) {
	preparedealloc_49008(c);
	rawdealloc_40423((&(*gch).Region), ((void*) (c)));
}

N_NIMCALL(void, collectwhite_64604)(tcell44733* s) {
	{
		NIM_BOOL LOC3;
		NIM_BOOL LOC5;
		LOC3 = 0;
		LOC3 = (((NI) ((NI)((*s).Refcount & 3))) == 2);
		if (!(LOC3)) goto LA4;
		LOC5 = 0;
		LOC5 = contains_45423(gch_46844.Cycleroots, s);
		LOC3 = !(LOC5);
		LA4: ;
		if (!LOC3) goto LA6;
		(*s).Refcount = (NI)((*s).Refcount & -4);
		forallchildren_48817(s, ((NU8) 8));
		freecycliccell_63227((&gch_46844), s);
	}
	LA6: ;
}

N_NIMCALL(void, dooperation_48821)(void* p, NU8 op) {
	tcell44733* c;
	{
		if (!(p == NIM_NIL)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	c = usrtocell_48446(p);
	switch (op) {
	case ((NU8) 2):
	{
		decref_50404(c);
	}
	break;
	case ((NU8) 3):
	{
		add_44821((&gch_46844.Tempstack), c);
	}
	break;
	case ((NU8) 4):
	{
		(*c).Refcount = (NI)((NU32)((*c).Refcount) - (NU32)(8));
	}
	break;
	case ((NU8) 5):
	{
		(*c).Refcount = (NI)((NU32)((*c).Refcount) - (NU32)(8));
		markgray_64005(c);
	}
	break;
	case ((NU8) 6):
	{
		scan_64404(c);
	}
	break;
	case ((NU8) 7):
	{
		(*c).Refcount = (NI)((NU32)((*c).Refcount) + (NU32)(8));
		{
			if (!!((((NI) ((NI)((*c).Refcount & 3))) == 0))) goto LA13;
			scanblack_64204(c);
		}
		LA13: ;
	}
	break;
	case ((NU8) 8):
	{
		collectwhite_64604(c);
	}
	break;
	case ((NU8) 0):
	{
	}
	break;
	case ((NU8) 1):
	{
	}
	break;
	}
	BeforeRet: ;
}

N_NIMCALL(NI, getdiscriminant_25136)(void* aa, TNimNode* n) {
	NI result;
	NI d;
	NI a;
	result = 0;
	d = 0;
	a = ((NI) (aa));
	switch ((*(*n).typ).size) {
	case 1:
	{
		d = ((NI)(NU)(NU8)((*((NI8*) ((NI)((NU32)(a) + (NU32)((*n).offset)))))));
	}
	break;
	case 2:
	{
		d = ((NI)(NU)(NU16)((*((NI16*) ((NI)((NU32)(a) + (NU32)((*n).offset)))))));
	}
	break;
	case 4:
	{
		d = ((NI) ((*((NI32*) ((NI)((NU32)(a) + (NU32)((*n).offset)))))));
	}
	break;
	default:
	{
	}
	break;
	}
	result = d;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(TNimNode*, selectbranch_25410)(void* aa, TNimNode* n) {
	TNimNode* result;
	NI discr;
	result = 0;
	discr = getdiscriminant_25136(aa, n);
	{
		if (!((NU32)(discr) < (NU32)((*n).len))) goto LA3;
		result = (*n).sons[(discr)- 0];
		{
			if (!(result == NIM_NIL)) goto LA7;
			result = (*n).sons[((*n).len)- 0];
		}
		LA7: ;
	}
	goto LA1;
	LA3: ;
	{
		result = (*n).sons[((*n).len)- 0];
	}
	LA1: ;
	return result;
}

N_NIMCALL(void, forallslotsaux_53008)(void* dest, TNimNode* n, NU8 op) {
	NI d;
	d = ((NI) (dest));
	switch ((*n).kind) {
	case ((NU8) 1):
	{
		forallchildrenaux_48825(((void*) ((NI)((NU32)(d) + (NU32)((*n).offset)))), (*n).typ, op);
	}
	break;
	case ((NU8) 2):
	{
		{
			NI i_53034;
			NI HEX3Atmp_53206;
			NI res_53209;
			i_53034 = 0;
			HEX3Atmp_53206 = 0;
			HEX3Atmp_53206 = (NI32)((*n).len - 1);
			res_53209 = 0;
			{
				while (1) {
					if (!(res_53209 <= HEX3Atmp_53206)) goto LA5;
					i_53034 = res_53209;
					{
						if (!((*(*n).sons[(i_53034)- 0]).kind == ((NU8) 1))) goto LA8;
						{
							if (!((*(*(*n).sons[(i_53034)- 0]).typ).kind == ((NU8) 22) || (*(*(*n).sons[(i_53034)- 0]).typ).kind == ((NU8) 28) || (*(*(*n).sons[(i_53034)- 0]).typ).kind == ((NU8) 24))) goto LA12;
							dooperation_48821((*((void**) ((NI)((NU32)(d) + (NU32)((*(*n).sons[(i_53034)- 0]).offset))))), op);
						}
						goto LA10;
						LA12: ;
						{
							forallchildrenaux_48825(((void*) ((NI)((NU32)(d) + (NU32)((*(*n).sons[(i_53034)- 0]).offset)))), (*(*n).sons[(i_53034)- 0]).typ, op);
						}
						LA10: ;
					}
					goto LA6;
					LA8: ;
					{
						forallslotsaux_53008(dest, (*n).sons[(i_53034)- 0], op);
					}
					LA6: ;
					res_53209 += 1;
				} LA5: ;
			}
		}
	}
	break;
	case ((NU8) 3):
	{
		TNimNode* m;
		m = selectbranch_25410(dest, n);
		{
			if (!!((m == NIM_NIL))) goto LA19;
			forallslotsaux_53008(dest, m, op);
		}
		LA19: ;
	}
	break;
	case ((NU8) 0):
	{
	}
	break;
	}
}

N_NIMCALL(void, forallchildrenaux_48825)(void* dest, TNimType* mt, NU8 op) {
	NI d;
	d = ((NI) (dest));
	{
		if (!(dest == NIM_NIL)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	{
		if (!!((((*mt).flags &(1<<((((NU8) 0))&7)))!=0))) goto LA7;
		switch ((*mt).kind) {
		case ((NU8) 22):
		case ((NU8) 28):
		case ((NU8) 24):
		{
			dooperation_48821((*((void**) (d))), op);
		}
		break;
		case ((NU8) 17):
		case ((NU8) 18):
		{
			forallslotsaux_53008(dest, (*mt).node, op);
		}
		break;
		case ((NU8) 16):
		case ((NU8) 4):
		case ((NU8) 27):
		{
			{
				NI i_53252;
				NI HEX3Atmp_53275;
				NI res_53278;
				i_53252 = 0;
				HEX3Atmp_53275 = 0;
				HEX3Atmp_53275 = (NI32)((NI32)((*mt).size / (*(*mt).base).size) - 1);
				res_53278 = 0;
				{
					while (1) {
						if (!(res_53278 <= HEX3Atmp_53275)) goto LA14;
						i_53252 = res_53278;
						forallchildrenaux_48825(((void*) ((NI)((NU32)(d) + (NU32)((NI)((NU32)(i_53252) * (NU32)((*(*mt).base).size)))))), (*mt).base, op);
						res_53278 += 1;
					} LA14: ;
				}
			}
		}
		break;
		default:
		{
		}
		break;
		}
	}
	LA7: ;
	BeforeRet: ;
}

N_NIMCALL(void, forallchildren_48817)(tcell44733* cell, NU8 op) {
	TY3089 marker;
	marker = (*(*cell).Typ).marker;
	{
		void* LOC5;
		if (!!((marker == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = celltousr_48425(cell);
		marker(LOC5, ((NI) (op)));
	}
	goto LA1;
	LA3: ;
	{
		switch ((*(*cell).Typ).kind) {
		case ((NU8) 22):
		{
			void* LOC8;
			LOC8 = 0;
			LOC8 = celltousr_48425(cell);
			forallchildrenaux_48825(LOC8, (*(*cell).Typ).base, op);
		}
		break;
		case ((NU8) 24):
		{
			NI d;
			void* LOC10;
			TGenericSeq* s;
			LOC10 = 0;
			LOC10 = celltousr_48425(cell);
			d = ((NI) (LOC10));
			s = ((TGenericSeq*) (d));
			{
				if (!!((s == NIM_NIL))) goto LA13;
				{
					NI i_54040;
					NI HEX3Atmp_54073;
					NI res_54076;
					i_54040 = 0;
					HEX3Atmp_54073 = 0;
					HEX3Atmp_54073 = (NI32)((*s).len - 1);
					res_54076 = 0;
					{
						while (1) {
							if (!(res_54076 <= HEX3Atmp_54073)) goto LA17;
							i_54040 = res_54076;
							forallchildrenaux_48825(((void*) ((NI)((NU32)((NI)((NU32)(d) + (NU32)((NI)((NU32)(i_54040) * (NU32)((*(*(*cell).Typ).base).size))))) + (NU32)(8)))), (*(*cell).Typ).base, op);
							res_54076 += 1;
						} LA17: ;
					}
				}
			}
			LA13: ;
		}
		break;
		default:
		{
		}
		break;
		}
	}
	LA1: ;
}

N_NIMCALL(NIM_BOOL, collectzct_66812)(tgcheap46816* gch) {
	NIM_BOOL result;
	NI* l;
	result = 0;
	l = (&(*gch).Zct.Len);
	{
		while (1) {
			tcell44733* c;
			if (!(0 < (*l))) goto LA2;
			c = (*gch).Zct.D[(0)- 0];
			(*c).Refcount = (NI)((*c).Refcount & -5);
			(*gch).Zct.D[(0)- 0] = (*gch).Zct.D[((NI32)((*l) - 1))- 0];
			(*l) -= 1;
			{
				if (!((NU32)((*c).Refcount) < (NU32)(8))) goto LA5;
				{
					NIM_BOOL LOC9;
					LOC9 = 0;
					LOC9 = canbecycleroot_48467(c);
					if (!LOC9) goto LA10;
					excl_45502((&(*gch).Cycleroots), c);
				}
				LA10: ;
				preparedealloc_49008(c);
				forallchildren_48817(c, ((NU8) 2));
				rawdealloc_40423((&(*gch).Region), ((void*) (c)));
			}
			LA5: ;
		} LA2: ;
	}
	result = NIM_TRUE;
	return result;
}

N_NIMCALL(void, markroots_64805)(tgcheap46816* gch) {
	NI tabsize;
	tabsize = 0;
	{
		tcell44733* s_64810;
		tcellset44745 HEX3Atmp_64839;
		tpagedesc44741* r_64844;
		s_64810 = 0;
		memset((void*)(&HEX3Atmp_64839), 0, sizeof(HEX3Atmp_64839));
		HEX3Atmp_64839 = (*gch).Cycleroots;
		r_64844 = HEX3Atmp_64839.Head;
		{
			while (1) {
				NI i_64846;
				if (!!((r_64844 == NIM_NIL))) goto LA3;
				i_64846 = 0;
				{
					while (1) {
						NI w_64848;
						NI j_64850;
						if (!(i_64846 <= 15)) goto LA5;
						w_64848 = (*r_64844).Bits[(i_64846)- 0];
						j_64850 = 0;
						{
							while (1) {
								if (!!((w_64848 == 0))) goto LA7;
								{
									if (!!((((NI) ((NI)(w_64848 & 1))) == 0))) goto LA10;
									s_64810 = ((tcell44733*) ((NI)((NI)((NU32)((*r_64844).Key) << (NU32)(12)) | (NI)((NU32)((NI)((NU32)((NI)((NU32)(i_64846) << (NU32)(5))) + (NU32)(j_64850))) * (NU32)(8)))));
									tabsize += 1;
									{
										NIM_BOOL LOC14;
										LOC14 = 0;
										LOC14 = (((NI) ((NI)((*s_64810).Refcount & 3))) == 3);
										if (!(LOC14)) goto LA15;
										LOC14 = ((NU32)(8) <= (NU32)((*s_64810).Refcount));
										LA15: ;
										if (!LOC14) goto LA16;
										markgray_64005(s_64810);
									}
									goto LA12;
									LA16: ;
									{
										excl_45502((&(*gch).Cycleroots), s_64810);
										{
											if (!((*s_64810).Refcount == 0)) goto LA21;
											freecycliccell_63227(gch, s_64810);
										}
										LA21: ;
									}
									LA12: ;
								}
								LA10: ;
								j_64850 += 1;
								w_64848 = (NI)((NU32)(w_64848) >> (NU32)(1));
							} LA7: ;
						}
						i_64846 += 1;
					} LA5: ;
				}
				r_64844 = (*r_64844).Next;
			} LA3: ;
		}
	}
	(*gch).Stat.Cycletablesize = (((*gch).Stat.Cycletablesize >= tabsize) ? (*gch).Stat.Cycletablesize : tabsize);
}

N_NIMCALL(void, collectroots_67001)(tgcheap46816* gch) {
	{
		tcell44733* s_67005;
		tcellset44745 HEX3Atmp_67008;
		tpagedesc44741* r_67013;
		s_67005 = 0;
		memset((void*)(&HEX3Atmp_67008), 0, sizeof(HEX3Atmp_67008));
		HEX3Atmp_67008 = (*gch).Cycleroots;
		r_67013 = HEX3Atmp_67008.Head;
		{
			while (1) {
				NI i_67015;
				if (!!((r_67013 == NIM_NIL))) goto LA3;
				i_67015 = 0;
				{
					while (1) {
						NI w_67017;
						NI j_67019;
						if (!(i_67015 <= 15)) goto LA5;
						w_67017 = (*r_67013).Bits[(i_67015)- 0];
						j_67019 = 0;
						{
							while (1) {
								if (!!((w_67017 == 0))) goto LA7;
								{
									if (!!((((NI) ((NI)(w_67017 & 1))) == 0))) goto LA10;
									s_67005 = ((tcell44733*) ((NI)((NI)((NU32)((*r_67013).Key) << (NU32)(12)) | (NI)((NU32)((NI)((NU32)((NI)((NU32)(i_67015) << (NU32)(5))) + (NU32)(j_67019))) * (NU32)(8)))));
									excl_45502((&(*gch).Cycleroots), s_67005);
									collectwhite_64604(s_67005);
								}
								LA10: ;
								j_67019 += 1;
								w_67017 = (NI)((NU32)(w_67017) >> (NU32)(1));
							} LA7: ;
						}
						i_67015 += 1;
					} LA5: ;
				}
				r_67013 = (*r_67013).Next;
			} LA3: ;
		}
	}
}

N_NIMCALL(void, deinit_44879)(tcellset44745* s) {
	tpagedesc44741* it;
	it = (*s).Head;
	{
		while (1) {
			tpagedesc44741* n;
			if (!!((it == NIM_NIL))) goto LA2;
			n = (*it).Next;
			dealloc_5848(((void*) (it)));
			it = n;
		} LA2: ;
	}
	(*s).Head = NIM_NIL;
	dealloc_5848(((void*) ((*s).Data)));
	(*s).Data = NIM_NIL;
	(*s).Counter = 0;
}

N_NIMCALL(void, cellsetreset_53001)(tcellset44745* s) {
	deinit_44879(s);
	init_44868(s);
}

N_NIMCALL(void, collectcycles_67045)(tgcheap46816* gch) {
	{
		while (1) {
			NIM_BOOL LOC3;
			if (!(0 < (*gch).Zct.Len)) goto LA2;
			LOC3 = 0;
			LOC3 = collectzct_66812(gch);
		} LA2: ;
	}
	markroots_64805(gch);
	{
		tcell44733* s_67201;
		tcellset44745 HEX3Atmp_67403;
		tpagedesc44741* r_67408;
		s_67201 = 0;
		memset((void*)(&HEX3Atmp_67403), 0, sizeof(HEX3Atmp_67403));
		HEX3Atmp_67403 = (*gch).Cycleroots;
		r_67408 = HEX3Atmp_67403.Head;
		{
			while (1) {
				NI i_67410;
				if (!!((r_67408 == NIM_NIL))) goto LA6;
				i_67410 = 0;
				{
					while (1) {
						NI w_67412;
						NI j_67414;
						if (!(i_67410 <= 15)) goto LA8;
						w_67412 = (*r_67408).Bits[(i_67410)- 0];
						j_67414 = 0;
						{
							while (1) {
								if (!!((w_67412 == 0))) goto LA10;
								{
									if (!!((((NI) ((NI)(w_67412 & 1))) == 0))) goto LA13;
									s_67201 = ((tcell44733*) ((NI)((NI)((NU32)((*r_67408).Key) << (NU32)(12)) | (NI)((NU32)((NI)((NU32)((NI)((NU32)(i_67410) << (NU32)(5))) + (NU32)(j_67414))) * (NU32)(8)))));
									scan_64404(s_67201);
								}
								LA13: ;
								j_67414 += 1;
								w_67412 = (NI)((NU32)(w_67412) >> (NU32)(1));
							} LA10: ;
						}
						i_67410 += 1;
					} LA8: ;
				}
				r_67408 = (*r_67408).Next;
			} LA6: ;
		}
	}
	collectroots_67001(gch);
	cellsetreset_53001((&(*gch).Cycleroots));
}

N_NIMCALL(NI, gettotalmem_6499)(void) {
	NI result;
	result = 0;
	result = gch_46844.Region.Currmem;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NI, getfreemem_6497)(void) {
	NI result;
	result = 0;
	result = gch_46844.Region.Freemem;
	return result;
}

N_NIMCALL(NI, getoccupiedmem_6495)(void) {
	NI result;
	NI LOC1;
	NI LOC2;
	result = 0;
	LOC1 = 0;
	LOC1 = gettotalmem_6499();
	LOC2 = 0;
	LOC2 = getfreemem_6497();
	result = (NI32)(LOC1 - LOC2);
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, unmarkstackandregisters_71211)(tgcheap46816* gch) {
	tcell44733** d;
	d = (*gch).Decstack.D;
	{
		NI i_71226;
		NI HEX3Atmp_71402;
		NI res_71405;
		i_71226 = 0;
		HEX3Atmp_71402 = 0;
		HEX3Atmp_71402 = (NI32)((*gch).Decstack.Len - 1);
		res_71405 = 0;
		{
			while (1) {
				if (!(res_71405 <= HEX3Atmp_71402)) goto LA3;
				i_71226 = res_71405;
				decref_50404(d[(i_71226)- 0]);
				res_71405 += 1;
			} LA3: ;
		}
	}
	(*gch).Decstack.Len = 0;
}

N_NIMCALL(void, collectctbody_71419)(tgcheap46816* gch) {
	NI LOC1;
	LOC1 = 0;
	LOC1 = stacksize_68810();
	(*gch).Stat.Maxstacksize = (((*gch).Stat.Maxstacksize >= LOC1) ? (*gch).Stat.Maxstacksize : LOC1);
	prepareforinteriorpointerchecking_42082((&(*gch).Region));
	markstackandregisters_69040(gch);
	markthreadstacks_68006(gch);
	(*gch).Stat.Maxstackcells = (((*gch).Stat.Maxstackcells >= (*gch).Decstack.Len) ? (*gch).Stat.Maxstackcells : (*gch).Decstack.Len);
	(*gch).Stat.Stackscans += 1;
	{
		NIM_BOOL LOC4;
		LOC4 = 0;
		LOC4 = collectzct_66812(gch);
		if (!LOC4) goto LA5;
		{
			NIM_BOOL LOC9;
			NI LOC10;
			NI LOC14;
			LOC9 = 0;
			LOC10 = 0;
			LOC10 = getoccupiedmem_44668((&(*gch).Region));
			LOC9 = ((*gch).Cyclethreshold <= LOC10);
			if (LOC9) goto LA11;
			LOC9 = NIM_FALSE;
			LA11: ;
			if (!LOC9) goto LA12;
			collectcycles_67045(gch);
			(*gch).Stat.Cyclecollections += 1;
			LOC14 = 0;
			LOC14 = getoccupiedmem_6495();
			(*gch).Cyclethreshold = ((4194304 >= (NI32)(LOC14 * 2)) ? 4194304 : (NI32)(LOC14 * 2));
			(*gch).Stat.Maxthreshold = (((*gch).Stat.Maxthreshold >= (*gch).Cyclethreshold) ? (*gch).Stat.Maxthreshold : (*gch).Cyclethreshold);
		}
		LA12: ;
	}
	LA5: ;
	unmarkstackandregisters_71211(gch);
}

N_NIMCALL(void, collectct_48810)(tgcheap46816* gch) {
	{
		NIM_BOOL LOC3;
		NIM_BOOL LOC4;
		NIM_BOOL LOC5;
		NIM_BOOL LOC7;
		NI LOC9;
		LOC3 = 0;
		LOC4 = 0;
		LOC5 = 0;
		LOC5 = (500 <= (*gch).Zct.Len);
		if (LOC5) goto LA6;
		LOC7 = 0;
		LOC7 = NIM_TRUE;
		if (!(LOC7)) goto LA8;
		LOC9 = 0;
		LOC9 = getoccupiedmem_44668((&(*gch).Region));
		LOC7 = ((*gch).Cyclethreshold <= LOC9);
		LA8: ;
		LOC5 = LOC7;
		LA6: ;
		LOC4 = LOC5;
		if (LOC4) goto LA10;
		LOC4 = NIM_FALSE;
		LA10: ;
		LOC3 = LOC4;
		if (!(LOC3)) goto LA11;
		LOC3 = ((*gch).Recgclock == 0);
		LA11: ;
		if (!LOC3) goto LA12;
		collectctbody_71419(gch);
	}
	LA12: ;
}

static N_INLINE(void, addnewobjtozct_54090)(tcell44733* res, tgcheap46816* gch) {
	NI l;
	tcell44733** d;
	l = (*gch).Zct.Len;
	d = (*gch).Zct.D;
	{
		tcell44733* c;
		if (!(8 < l)) goto LA3;
		c = 0;
		c = d[((NI32)(l - 1))- 0];
		{
			if (!((NU32)(8) <= (NU32)((*c).Refcount))) goto LA7;
			(*c).Refcount = (NI)((*c).Refcount & -5);
			d[((NI32)(l - 1))- 0] = res;
			goto BeforeRet;
		}
		LA7: ;
		c = d[((NI32)(l - 2))- 0];
		{
			if (!((NU32)(8) <= (NU32)((*c).Refcount))) goto LA11;
			(*c).Refcount = (NI)((*c).Refcount & -5);
			d[((NI32)(l - 2))- 0] = res;
			goto BeforeRet;
		}
		LA11: ;
		c = d[((NI32)(l - 3))- 0];
		{
			if (!((NU32)(8) <= (NU32)((*c).Refcount))) goto LA15;
			(*c).Refcount = (NI)((*c).Refcount & -5);
			d[((NI32)(l - 3))- 0] = res;
			goto BeforeRet;
		}
		LA15: ;
		c = d[((NI32)(l - 4))- 0];
		{
			if (!((NU32)(8) <= (NU32)((*c).Refcount))) goto LA19;
			(*c).Refcount = (NI)((*c).Refcount & -5);
			d[((NI32)(l - 4))- 0] = res;
			goto BeforeRet;
		}
		LA19: ;
		c = d[((NI32)(l - 5))- 0];
		{
			if (!((NU32)(8) <= (NU32)((*c).Refcount))) goto LA23;
			(*c).Refcount = (NI)((*c).Refcount & -5);
			d[((NI32)(l - 5))- 0] = res;
			goto BeforeRet;
		}
		LA23: ;
		c = d[((NI32)(l - 6))- 0];
		{
			if (!((NU32)(8) <= (NU32)((*c).Refcount))) goto LA27;
			(*c).Refcount = (NI)((*c).Refcount & -5);
			d[((NI32)(l - 6))- 0] = res;
			goto BeforeRet;
		}
		LA27: ;
		c = d[((NI32)(l - 7))- 0];
		{
			if (!((NU32)(8) <= (NU32)((*c).Refcount))) goto LA31;
			(*c).Refcount = (NI)((*c).Refcount & -5);
			d[((NI32)(l - 7))- 0] = res;
			goto BeforeRet;
		}
		LA31: ;
		c = d[((NI32)(l - 8))- 0];
		{
			if (!((NU32)(8) <= (NU32)((*c).Refcount))) goto LA35;
			(*c).Refcount = (NI)((*c).Refcount & -5);
			d[((NI32)(l - 8))- 0] = res;
			goto BeforeRet;
		}
		LA35: ;
		add_44821((&(*gch).Zct), res);
	}
	goto LA1;
	LA3: ;
	{
		d[(l)- 0] = res;
		(*gch).Zct.Len += 1;
	}
	LA1: ;
	BeforeRet: ;
}

N_NIMCALL(void*, rawnewobj_54604)(TNimType* typ, NI size, tgcheap46816* gch) {
	void* result;
	tcell44733* res;
	void* LOC1;
	result = 0;
	collectct_48810(gch);
	LOC1 = 0;
	LOC1 = rawalloc_34146((&(*gch).Region), (NI32)(size + ((NI)sizeof(tcell44733))));
	res = ((tcell44733*) (LOC1));
	(*res).Typ = typ;
	(*res).Refcount = 4;
	addnewobjtozct_54090(res, gch);
	result = celltousr_48425(res);
	return result;
}

N_NIMCALL(void*, newObj)(TNimType* typ, NI size) {
	void* result;
	result = 0;
	result = rawnewobj_54604(typ, size, (&gch_46844));
	zeroMem(result, size);
	return result;
}

N_NIMCALL(NimStringDesc*, rawNewString)(NI space) {
	NimStringDesc* result;
	NI s;
	void* LOC5;
	result = 0;
	s = space;
	{
		if (!(s < 8)) goto LA3;
		s = 7;
	}
	LA3: ;
	LOC5 = 0;
	LOC5 = newObj((&strdesc_9804), (NI32)((NI32)(((NI)sizeof(TGenericSeq)) + s) + 1));
	result = ((NimStringDesc*) (LOC5));
	(*result).Sup.reserved = s;
	return result;
}

N_NIMCALL(NimStringDesc*, toNimStr)(NCSTRING str, NI len) {
	NimStringDesc* result;
	result = 0;
	result = rawNewString(len);
	(*result).Sup.len = len;
	memcpy(((NCSTRING) ((*result).data)), str, (NI32)((NI32)(len + 1) * 1));
	return result;
}

N_NIMCALL(NimStringDesc*, cstrToNimstr)(NCSTRING str) {
	NimStringDesc* result;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = strlen(str);
	result = toNimStr(str, LOC1);
	return result;
}

N_NIMCALL(void, write_12877)(FILE* f, NCSTRING c) {
	fputs(c, f);
}

N_NIMCALL(void, writetostderr_16201)(NCSTRING msg) {
	write_12877(stdout, msg);
}

N_NIMCALL(void, showerrormessage_16209)(NCSTRING data) {
	{
		NimStringDesc* LOC5;
		if (!!((errormessagewriter_16004 == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = cstrToNimstr(data);
		errormessagewriter_16004(LOC5);
	}
	goto LA1;
	LA3: ;
	{
		writetostderr_16201(data);
	}
	LA1: ;
}

N_NOCONV(void, signalHandler)(int sig) {
	NCSTRING msg;
	msg = 0;
	{
		if (!(sig == SIGINT)) goto LA3;
		msg = "SIGINT: Interrupted by Ctrl-C.\015\012";
	}
	goto LA1;
	LA3: ;
	{
		if (!(sig == SIGSEGV)) goto LA6;
		msg = "SIGSEGV: Illegal storage access. (Try to compile with -d:useSys"
"Assert -d:useGcAssert for details.)\015\012";
	}
	goto LA1;
	LA6: ;
	{
		if (!(sig == SIGABRT)) goto LA9;
		msg = "SIGABRT: Abnormal termination.\015\012";
	}
	goto LA1;
	LA9: ;
	{
		if (!(sig == SIGFPE)) goto LA12;
		msg = "SIGFPE: Arithmetic error.\015\012";
	}
	goto LA1;
	LA12: ;
	{
		if (!(sig == SIGILL)) goto LA15;
		msg = "SIGILL: Illegal operation.\015\012";
	}
	goto LA1;
	LA15: ;
	{
		if (!(sig == SIGSEGV)) goto LA18;
		msg = "SIGBUS: Illegal storage access.  (Try to compile with -d:useSys"
"Assert -d:useGcAssert for details.)\015\012";
	}
	goto LA1;
	LA18: ;
	{
		{
			msg = "unknown signal\015\012";
		}
	}
	LA1: ;
	showerrormessage_16209(msg);
	exit(1);
}

N_NIMCALL(void, registersignalhandler_19808)(void) {
	signal(SIGINT, signalHandler);
	signal(SIGSEGV, signalHandler);
	signal(SIGABRT, signalHandler);
	signal(SIGFPE, signalHandler);
	signal(SIGILL, signalHandler);
	signal(SIGSEGV, signalHandler);
}

N_NIMCALL(NI, getRefcount)(void* p) {
	NI result;
	tcell44733* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = usrtocell_48446(p);
	result = (NI)((NU32)((*LOC1).Refcount) >> (NU32)(3));
	return result;
}

N_NIMCALL(void*, newObjRC1)(TNimType* typ, NI size) {
	void* result;
	tcell44733* res;
	void* LOC1;
	result = 0;
	collectct_48810((&gch_46844));
	LOC1 = 0;
	LOC1 = rawalloc_34146((&gch_46844.Region), (NI32)(size + ((NI)sizeof(tcell44733))));
	res = ((tcell44733*) (LOC1));
	(*res).Typ = typ;
	(*res).Refcount = 8;
	result = celltousr_48425(res);
	zeroMem(result, size);
	return result;
}

N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src) {
	NimStringDesc* result;
	result = 0;
	{
		NI s;
		void* LOC9;
		if (!!((src == NIM_NIL))) goto LA3;
		s = ((NI) ((NI)((*src).Sup.reserved & 2147483647)));
		{
			if (!(s < 8)) goto LA7;
			s = 7;
		}
		LA7: ;
		LOC9 = 0;
		LOC9 = newObjRC1((&strdesc_9804), (NI32)((NI32)(((NI)sizeof(TGenericSeq)) + s) + 1));
		result = ((NimStringDesc*) (LOC9));
		(*result).Sup.reserved = s;
		(*result).Sup.len = (*src).Sup.len;
		memcpy(((NCSTRING) ((*result).data)), ((NCSTRING) ((*src).data)), (NI32)((*src).Sup.len + 1));
	}
	LA3: ;
	return result;
}

N_NIMCALL(void, nimGCvisit)(void* d, NI op) {
	dooperation_48821(d, ((NU8) (op)));
}
N_NIMCALL(void, TMP50)(void* p, NI op) {
	Exception* a;
	a = (Exception*)p;
	nimGCvisit((void*)(*a).parent, op);
	nimGCvisit((void*)(*a).message, op);
	nimGCvisit((void*)(*a).trace, op);
}
N_NIMCALL(void, TMP51)(void* p, NI op) {
	overflowerror3243* a;
	a = (overflowerror3243*)p;
	nimGCvisit((void*)(*a).Sup.Sup.parent, op);
	nimGCvisit((void*)(*a).Sup.Sup.message, op);
	nimGCvisit((void*)(*a).Sup.Sup.trace, op);
}

static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
	tcell44733* c;
	c = usrtocell_48446(p);
	{
		(*c).Refcount -= 8;
		if (!((NU32)((*c).Refcount) < (NU32)(8))) goto LA3;
		rtladdzct_50004(c);
	}
	LA3: ;
}

static N_INLINE(void, incref_50825)(tcell44733* c) {
	(*c).Refcount = (NI)((NU32)((*c).Refcount) + (NU32)(8));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = canbecycleroot_48467(c);
		if (!LOC3) goto LA4;
		rtladdcycleroot_49229(c);
	}
	LA4: ;
}

static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		tcell44733* LOC5;
		if (!!((src == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = usrtocell_48446(src);
		incref_50825(LOC5);
	}
	LA3: ;
	{
		tcell44733* LOC10;
		if (!!(((*dest) == NIM_NIL))) goto LA8;
		LOC10 = 0;
		LOC10 = usrtocell_48446((*dest));
		decref_50404(LOC10);
	}
	LA8: ;
	(*dest) = src;
}

static N_INLINE(void, pushCurrentException)(Exception* e) {
	asgnRef((void**) (&(*e).parent), currexception_16245);
	asgnRef((void**) (&currexception_16245), e);
}

N_NOINLINE(NIM_BOOL, isobjslowpath_21825)(TNimType* obj, TNimType* subclass, TNimType** cache) {
	NIM_BOOL result;
	TNimType* x;
	result = 0;
	x = (*obj).base;
	{
		while (1) {
			if (!!((x == subclass))) goto LA2;
			{
				if (!(x == NIM_NIL)) goto LA5;
				cache[(0)- 0] = obj;
				result = NIM_FALSE;
				goto BeforeRet;
			}
			LA5: ;
			x = (*x).base;
		} LA2: ;
	}
	cache[(1)- 0] = obj;
	result = NIM_TRUE;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

static N_INLINE(NIM_BOOL, isObjWithCache)(TNimType* obj, TNimType* subclass, TNimType** cache) {
	NIM_BOOL result;
	result = 0;
	{
		if (!(obj == subclass)) goto LA3;
		result = NIM_TRUE;
		goto BeforeRet;
	}
	LA3: ;
	{
		if (!((*obj).base == subclass)) goto LA7;
		result = NIM_TRUE;
		goto BeforeRet;
	}
	LA7: ;
	{
		if (!(cache[(0)- 0] == obj)) goto LA11;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA11: ;
	{
		if (!(cache[(1)- 0] == obj)) goto LA15;
		result = NIM_TRUE;
		goto BeforeRet;
	}
	LA15: ;
	result = isobjslowpath_21825(obj, subclass, cache);
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

static N_INLINE(void, quitordebug_17201)(void) {
	exit(1);
}

N_NIMCALL(void, raiseexceptionaux_17404)(Exception* e) {
	{
		if (!!((localraisehook_8230 == NIM_NIL))) goto LA3;
		{
			NIM_BOOL LOC7;
			LOC7 = 0;
			LOC7 = localraisehook_8230(e);
			if (!!(LOC7)) goto LA8;
			goto BeforeRet;
		}
		LA8: ;
	}
	LA3: ;
	{
		if (!!((globalraisehook_8225 == NIM_NIL))) goto LA12;
		{
			NIM_BOOL LOC16;
			LOC16 = 0;
			LOC16 = globalraisehook_8225(e);
			if (!!(LOC16)) goto LA17;
			goto BeforeRet;
		}
		LA17: ;
	}
	LA12: ;
	{
		if (!!((exchandler_16243 == NIM_NIL))) goto LA21;
		{
			NIM_BOOL LOC25;
			LOC25 = 0;
			LOC25 = !((*exchandler_16243).hasRaiseAction);
			if (LOC25) goto LA26;
			LOC25 = (*exchandler_16243).raiseAction.ClEnv? (*exchandler_16243).raiseAction.ClPrc(e, (*exchandler_16243).raiseAction.ClEnv):((TMP53)((*exchandler_16243).raiseAction.ClPrc))(e);
			LA26: ;
			if (!LOC25) goto LA27;
			pushCurrentException(e);
			longjmp((*exchandler_16243).context, ((int) 1));
		}
		LA27: ;
	}
	goto LA19;
	LA21: ;
	{
		if (!(isObjWithCache((*e).Sup.m_type, (&NTI3253), Nim_OfCheck_CACHE1))) goto LA30;
		showerrormessage_16209((*e).name);
		quitordebug_17201();
	}
	goto LA19;
	LA30: ;
	{
		TY17616 buf;
		NI l;
		memset((void*)buf, 0, sizeof(buf));
		l = 0;
		{
			if (!((NI32)(l + 28) < 2000)) goto LA35;
			memcpy(((void*) ((&buf[(l)- 0]))), "Error: unhandled exception: ", 28);
			l += 28;
		}
		LA35: ;
		{
			if (!!((*e).message == 0)) goto LA39;
			{
				if (!((NI32)(l + (*e).message->Sup.len) < 2000)) goto LA43;
				memcpy(((void*) ((&buf[(l)- 0]))), ((void*) ((*e).message->data)), (*e).message->Sup.len);
				l += (*e).message->Sup.len;
			}
			LA43: ;
		}
		LA39: ;
		{
			if (!((NI32)(l + 2) < 2000)) goto LA47;
			memcpy(((void*) ((&buf[(l)- 0]))), " [", 2);
			l += 2;
		}
		LA47: ;
		{
			NI LOC51;
			NI LOC54;
			NI LOC55;
			LOC51 = 0;
			LOC51 = strlen((*e).name);
			if (!((NI32)(l + LOC51) < 2000)) goto LA52;
			LOC54 = 0;
			LOC54 = strlen((*e).name);
			memcpy(((void*) ((&buf[(l)- 0]))), ((void*) ((*e).name)), LOC54);
			LOC55 = 0;
			LOC55 = strlen((*e).name);
			l += LOC55;
		}
		LA52: ;
		{
			if (!((NI32)(l + 3) < 2000)) goto LA58;
			memcpy(((void*) ((&buf[(l)- 0]))), "]\015\012", 3);
			l += 3;
		}
		LA58: ;
		showerrormessage_16209(((NCSTRING) (buf)));
		quitordebug_17201();
	}
	LA19: ;
	BeforeRet: ;
}

N_NIMCALL(void, raiseException)(Exception* e, NCSTRING ename) {
	(*e).name = ename;
	raiseexceptionaux_17404(e);
}

N_NOINLINE(void, raiseOverflow)(void) {
	overflowerror3243* e_22019;
	NimStringDesc* LOC1;
	e_22019 = 0;
	e_22019 = (overflowerror3243*) newObj((&NTI22201), sizeof(overflowerror3243));
	(*e_22019).Sup.Sup.Sup.m_type = (&NTI3243);
	LOC1 = 0;
	LOC1 = (*e_22019).Sup.Sup.message; (*e_22019).Sup.Sup.message = copyStringRC1(((NimStringDesc*) &TMP52));
	if (LOC1) nimGCunrefNoCycle(LOC1);
	raiseException((Exception*)e_22019, "OverflowError");
}

static N_INLINE(NI, addInt)(NI a, NI b) {
	NI result;
	result = 0;
	result = (NI)((NU32)(a) + (NU32)(b));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = (0 <= (NI)(result ^ a));
		if (LOC3) goto LA4;
		LOC3 = (0 <= (NI)(result ^ b));
		LA4: ;
		if (!LOC3) goto LA5;
		goto BeforeRet;
	}
	LA5: ;
	raiseOverflow();
	BeforeRet: ;
	return result;
}

N_NIMCALL(NI, mulInt)(NI a, NI b) {
	NI result;
	NF resasfloat;
	NF floatprod;
	result = 0;
	resasfloat = 0;
	floatprod = 0;
	result = (NI)((NU32)(a) * (NU32)(b));
	floatprod = ((NF)(((double) (a))) * (NF)(((double) (b))));
	resasfloat = ((double) (result));
	{
		if (!(resasfloat == floatprod)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	{
		if (!(((NF)(3.2000000000000000e+01) * (NF)((((NF)(resasfloat) - (NF)(floatprod)) > 0? (((NF)(resasfloat) - (NF)(floatprod))) : -(((NF)(resasfloat) - (NF)(floatprod)))))) <= (floatprod > 0? (floatprod) : -(floatprod)))) goto LA7;
		goto BeforeRet;
	}
	LA7: ;
	raiseOverflow();
	BeforeRet: ;
	return result;
}

N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len) {
	void* result;
	NI size;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = mulInt(len, (*(*typ).base).size);
	size = addInt(LOC1, 8);
	result = newObjRC1(typ, size);
	(*((TGenericSeq*) (result))).len = len;
	(*((TGenericSeq*) (result))).reserved = len;
	return result;
}

N_NIMCALL(void*, nimLoadLibrary)(NimStringDesc* path) {
	void* result;
	void* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = LoadLibraryA(path->data);
	result = ((void*) (LOC1));
	return result;
}

N_NIMCALL(NI, writebuffer_13046)(FILE* f, void* buffer, NI len) {
	NI result;
	result = 0;
	result = fwrite(buffer, 1, len, f);
	return result;
}

N_NIMCALL(void, rawwrite_24602)(FILE* f, NimStringDesc* s) {
	NI LOC1;
	LOC1 = 0;
	LOC1 = writebuffer_13046(f, ((void*) (s->data)), s->Sup.len);
}

N_NOINLINE(void, nimLoadLibraryError)(NimStringDesc* path) {
	rawwrite_24602(stdout, ((NimStringDesc*) &TMP135));
	rawwrite_24602(stdout, path);
	rawwrite_24602(stdout, ((NimStringDesc*) &TMP136));
	exit(1);
}

N_NOINLINE(void, procaddrerror_24615)(NCSTRING name) {
	rawwrite_24602(stdout, ((NimStringDesc*) &TMP137));
	write_12877(stdout, name);
	rawwrite_24602(stdout, ((NimStringDesc*) &TMP136));
	exit(1);
}

N_NIMCALL(void*, nimGetProcAddr)(void* lib, NCSTRING name) {
	void* result;
	result = 0;
	result = GetProcAddress(((void*) (lib)), name);
	{
		if (!(result == NIM_NIL)) goto LA3;
		procaddrerror_24615(name);
	}
	LA3: ;
	return result;
}
N_NIMCALL(void, TMP138)(void* p, NI op) {
	oserror3233* a;
	a = (oserror3233*)p;
	nimGCvisit((void*)(*a).Sup.Sup.parent, op);
	nimGCvisit((void*)(*a).Sup.Sup.message, op);
	nimGCvisit((void*)(*a).Sup.Sup.trace, op);
}

N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src) {
	NimStringDesc* result;
	result = 0;
	{
		if (!!((src == NIM_NIL))) goto LA3;
		{
			if (!!(((NI)((*src).Sup.reserved & (-2147483647 -1)) == 0))) goto LA7;
			result = src;
		}
		goto LA5;
		LA7: ;
		{
			result = rawNewString(((NI) ((NI)((*src).Sup.reserved & 2147483647))));
			(*result).Sup.len = (*src).Sup.len;
			memcpy(((NCSTRING) ((*result).data)), ((NCSTRING) ((*src).data)), (NI32)((NI32)((*src).Sup.len + 1) * 1));
		}
		LA5: ;
	}
	LA3: ;
	return result;
}

static N_INLINE(NI, resize_74401)(NI old) {
	NI result;
	result = 0;
	{
		if (!(old <= 0)) goto LA3;
		result = 4;
	}
	goto LA1;
	LA3: ;
	{
		if (!(old < 65536)) goto LA6;
		result = (NI32)(old * 2);
	}
	goto LA1;
	LA6: ;
	{
		result = (NI32)((NI32)(old * 3) / 2);
	}
	LA1: ;
	return result;
}

N_NIMCALL(void*, growobj_60206)(void* old, NI newsize, tgcheap46816* gch) {
	void* result;
	tcell44733* ol;
	tcell44733* res;
	void* LOC1;
	NI elemsize;
	NI oldsize;
	result = 0;
	collectct_48810(gch);
	ol = usrtocell_48446(old);
	LOC1 = 0;
	LOC1 = rawalloc_34146((&(*gch).Region), (NI32)(newsize + ((NI)sizeof(tcell44733))));
	res = ((tcell44733*) (LOC1));
	elemsize = 1;
	{
		if (!!(((*(*ol).Typ).kind == ((NU8) 28)))) goto LA4;
		elemsize = (*(*(*ol).Typ).base).size;
	}
	LA4: ;
	oldsize = (NI32)((NI32)((*((TGenericSeq*) (old))).len * elemsize) + 8);
	memcpy(((void*) (res)), ((void*) (ol)), (NI32)(oldsize + ((NI)sizeof(tcell44733))));
	zeroMem(((void*) ((NI)((NU32)((NI)((NU32)(((NI) (res))) + (NU32)(oldsize))) + (NU32)(((NI)sizeof(tcell44733)))))), (NI32)(newsize - oldsize));
	{
		NI j;
		tcell44733** d;
		if (!!(((NI)((*ol).Refcount & 4) == 0))) goto LA8;
		j = (NI32)((*gch).Zct.Len - 1);
		d = (*gch).Zct.D;
		{
			while (1) {
				if (!(0 <= j)) goto LA11;
				{
					if (!(d[(j)- 0] == ol)) goto LA14;
					d[(j)- 0] = res;
					goto LA10;
				}
				LA14: ;
				j -= 1;
			} LA11: ;
		} LA10: ;
	}
	LA8: ;
	{
		NIM_BOOL LOC18;
		LOC18 = 0;
		LOC18 = canbecycleroot_48467(ol);
		if (!LOC18) goto LA19;
		excl_45502((&(*gch).Cycleroots), ol);
	}
	LA19: ;
	rawdealloc_40423((&(*gch).Region), ((void*) (ol)));
	result = celltousr_48425(res);
	return result;
}

N_NIMCALL(void*, growobj_63218)(void* old, NI newsize) {
	void* result;
	result = 0;
	result = growobj_60206(old, newsize, (&gch_46844));
	return result;
}

N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s, NIM_CHAR c) {
	NimStringDesc* result;
	result = 0;
	result = s;
	{
		void* LOC5;
		if (!(((NI) ((NI)((*result).Sup.reserved & 2147483647))) <= (*result).Sup.len)) goto LA3;
		(*result).Sup.reserved = resize_74401(((NI) ((NI)((*result).Sup.reserved & 2147483647))));
		LOC5 = 0;
		LOC5 = growobj_63218(((void*) (result)), (NI32)(((NI)sizeof(TGenericSeq)) + (NI32)((NI32)((*result).Sup.reserved + 1) * 1)));
		result = ((NimStringDesc*) (LOC5));
	}
	LA3: ;
	(*result).data[((*result).Sup.len)- 0] = c;
	(*result).data[((NI32)((*result).Sup.len + 1))- 0] = 0;
	(*result).Sup.len += 1;
	return result;
}

N_NIMCALL(NimStringDesc*, HEX24_79012)(NI16* w, NI estimate) {
	NimStringDesc* result;
	NI i;
	result = 0;
	result = rawNewString((NI32)(estimate + (NI)((NU32)(estimate) >> (NU32)(2))));
	i = 0;
	{
		while (1) {
			NI ch;
			if (!!((w[(i)- 0] == ((NI16) 0)))) goto LA2;
			ch = ((NI) (w[(i)- 0]));
			i += 1;
			{
				NIM_BOOL LOC5;
				NI ch2;
				LOC5 = 0;
				LOC5 = ((NU32)(55296) <= (NU32)(ch));
				if (!(LOC5)) goto LA6;
				LOC5 = ((NU32)(ch) <= (NU32)(56319));
				LA6: ;
				if (!LOC5) goto LA7;
				ch2 = ((NI) (w[(i)- 0]));
				{
					NIM_BOOL LOC11;
					LOC11 = 0;
					LOC11 = ((NU32)(56320) <= (NU32)(ch2));
					if (!(LOC11)) goto LA12;
					LOC11 = ((NU32)(ch2) <= (NU32)(57343));
					LA12: ;
					if (!LOC11) goto LA13;
					ch = (NI)((NU32)((NI)((NU32)((NI)((NU32)((NI)((NU32)(ch) - (NU32)(55296))) >> (NU32)(10))) + (NU32)((NI)((NU32)(ch2) - (NU32)(56320))))) + (NU32)(65536));
					i += 1;
				}
				LA13: ;
			}
			LA7: ;
			{
				if (!((NU32)(ch) <= (NU32)(127))) goto LA17;
				result = addChar(result, ((NIM_CHAR) (((NI) (ch)))));
			}
			goto LA15;
			LA17: ;
			{
				if (!((NU32)(ch) <= (NU32)(2047))) goto LA20;
				result = addChar(result, ((NIM_CHAR) (((NI) ((NI)((NI)((NU32)(ch) >> (NU32)(6)) | 192))))));
				result = addChar(result, ((NIM_CHAR) (((NI) ((NI)(((NI) ((NI)(ch & 63))) | 128))))));
			}
			goto LA15;
			LA20: ;
			{
				if (!((NU32)(ch) <= (NU32)(65535))) goto LA23;
				result = addChar(result, ((NIM_CHAR) (((NI) ((NI)((NI)((NU32)(ch) >> (NU32)(12)) | 224))))));
				result = addChar(result, ((NIM_CHAR) (((NI) ((NI)(((NI) ((NI)((NI)((NU32)(ch) >> (NU32)(6)) & 63))) | 128))))));
				result = addChar(result, ((NIM_CHAR) (((NI) ((NI)(((NI) ((NI)(ch & 63))) | 128))))));
			}
			goto LA15;
			LA23: ;
			{
				if (!((NU32)(ch) <= (NU32)(1114111))) goto LA26;
				result = addChar(result, ((NIM_CHAR) (((NI) ((NI)((NI)((NU32)(ch) >> (NU32)(18)) | 240))))));
				result = addChar(result, ((NIM_CHAR) (((NI) ((NI)(((NI) ((NI)((NI)((NU32)(ch) >> (NU32)(12)) & 63))) | 128))))));
				result = addChar(result, ((NIM_CHAR) (((NI) ((NI)(((NI) ((NI)((NI)((NU32)(ch) >> (NU32)(6)) & 63))) | 128))))));
				result = addChar(result, ((NIM_CHAR) (((NI) ((NI)(((NI) ((NI)(ch & 63))) | 128))))));
			}
			goto LA15;
			LA26: ;
			{
				result = addChar(result, 239);
				result = addChar(result, 191);
				result = addChar(result, 189);
			}
			LA15: ;
		} LA2: ;
	}
	return result;
}

N_NIMCALL(NimStringDesc*, HEX24_79195)(NI16* s) {
	NimStringDesc* result;
	result = 0;
	result = HEX24_79012(s, 80);
	return result;
}

N_NIMCALL(void*, newSeq)(TNimType* typ, NI len) {
	void* result;
	NI size;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = mulInt(len, (*(*typ).base).size);
	size = addInt(LOC1, 8);
	result = newObj(typ, size);
	(*((TGenericSeq*) (result))).len = len;
	(*((TGenericSeq*) (result))).reserved = len;
	return result;
}

N_NOINLINE(NIM_BOOL, isonstack_48814)(void* p) {
	NIM_BOOL result;
	void* volatile stacktop;
	NI b;
	NI a;
	NI x;
	NIM_BOOL LOC1;
	result = 0;
	stacktop = 0;
	stacktop = ((void*) ((&stacktop)));
	b = ((NI) (gch_46844.Stackbottom));
	a = ((NI) (stacktop));
	x = ((NI) (p));
	LOC1 = 0;
	LOC1 = ((NU32)(a) <= (NU32)(x));
	if (!(LOC1)) goto LA2;
	LOC1 = ((NU32)(x) <= (NU32)(b));
	LA2: ;
	result = LOC1;
	return result;
}

N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = isonstack_48814(((void*) (dest)));
		if (!!(LOC3)) goto LA4;
		{
			tcell44733* LOC10;
			if (!!((src == NIM_NIL))) goto LA8;
			LOC10 = 0;
			LOC10 = usrtocell_48446(src);
			incref_50825(LOC10);
		}
		LA8: ;
		{
			tcell44733* LOC15;
			if (!((NU32)(4096) <= (NU32)(((NI) ((*dest)))))) goto LA13;
			LOC15 = 0;
			LOC15 = usrtocell_48446((*dest));
			decref_50404(LOC15);
		}
		LA13: ;
	}
	goto LA1;
	LA4: ;
	{
	}
	LA1: ;
	(*dest) = src;
}
N_NIMCALL(void, TMP149)(void* p, NI op) {
	valueerror3249* a;
	a = (valueerror3249*)p;
	nimGCvisit((void*)(*a).Sup.parent, op);
	nimGCvisit((void*)(*a).Sup.message, op);
	nimGCvisit((void*)(*a).Sup.trace, op);
}

N_NOINLINE(void, chckNil)(void* p) {
	{
		valueerror3249* e_21227;
		NimStringDesc* LOC5;
		if (!(p == NIM_NIL)) goto LA3;
		e_21227 = 0;
		e_21227 = (valueerror3249*) newObj((&NTI21401), sizeof(valueerror3249));
		(*e_21227).Sup.Sup.m_type = (&NTI3249);
		LOC5 = 0;
		LOC5 = (*e_21227).Sup.message; (*e_21227).Sup.message = copyStringRC1(((NimStringDesc*) &TMP150));
		if (LOC5) nimGCunrefNoCycle(LOC5);
		raiseException((Exception*)e_21227, "ValueError");
	}
	LA3: ;
}

N_NIMCALL(void, genericresetaux_80201)(void* dest, TNimNode* n) {
	NI d;
	d = ((NI) (dest));
	switch ((*n).kind) {
	case ((NU8) 0):
	{
	}
	break;
	case ((NU8) 1):
	{
		genericReset(((void*) ((NI)((NU32)(d) + (NU32)((*n).offset)))), (*n).typ);
	}
	break;
	case ((NU8) 2):
	{
		{
			NI i_81820;
			NI HEX3Atmp_81851;
			NI res_81854;
			i_81820 = 0;
			HEX3Atmp_81851 = 0;
			HEX3Atmp_81851 = (NI32)((*n).len - 1);
			res_81854 = 0;
			{
				while (1) {
					if (!(res_81854 <= HEX3Atmp_81851)) goto LA6;
					i_81820 = res_81854;
					genericresetaux_80201(dest, (*n).sons[(i_81820)- 0]);
					res_81854 += 1;
				} LA6: ;
			}
		}
	}
	break;
	case ((NU8) 3):
	{
		TNimNode* m;
		m = selectbranch_25410(dest, n);
		{
			if (!!((m == NIM_NIL))) goto LA10;
			genericresetaux_80201(dest, m);
		}
		LA10: ;
		zeroMem(((void*) ((NI)((NU32)(d) + (NU32)((*n).offset)))), (*(*n).typ).size);
	}
	break;
	}
}

N_NIMCALL(void, genericReset)(void* dest, TNimType* mt) {
	NI d;
	d = ((NI) (dest));
	switch ((*mt).kind) {
	case ((NU8) 28):
	case ((NU8) 22):
	case ((NU8) 24):
	{
		unsureAsgnRef(((void**) (dest)), NIM_NIL);
	}
	break;
	case ((NU8) 17):
	case ((NU8) 18):
	{
		genericresetaux_80201(dest, (*mt).node);
	}
	break;
	case ((NU8) 16):
	case ((NU8) 4):
	{
		{
			NI i_82011;
			NI HEX3Atmp_82034;
			NI res_82037;
			i_82011 = 0;
			HEX3Atmp_82034 = 0;
			HEX3Atmp_82034 = (NI32)((NI32)((*mt).size / (*(*mt).base).size) - 1);
			res_82037 = 0;
			{
				while (1) {
					if (!(res_82037 <= HEX3Atmp_82034)) goto LA6;
					i_82011 = res_82037;
					genericReset(((void*) ((NI)((NU32)(d) + (NU32)((NI)((NU32)(i_82011) * (NU32)((*(*mt).base).size)))))), (*mt).base);
					res_82037 += 1;
				} LA6: ;
			}
		}
	}
	break;
	default:
	{
		zeroMem(dest, (*mt).size);
	}
	break;
	}
}

N_NIMCALL(NimStringDesc*, copyStrLast)(NimStringDesc* s, NI start_74628, NI last) {
	NimStringDesc* result;
	NI start;
	NI len;
	result = 0;
	start = ((start_74628 >= 0) ? start_74628 : 0);
	len = (NI32)((NI32)(((last <= (NI32)((*s).Sup.len - 1)) ? last : (NI32)((*s).Sup.len - 1)) - start) + 1);
	{
		if (!(0 < len)) goto LA3;
		result = rawNewString(len);
		(*result).Sup.len = len;
		memcpy(((NCSTRING) ((*result).data)), ((NCSTRING) ((&(*s).data[(start)- 0]))), (NI32)(len * 1));
	}
	goto LA1;
	LA3: ;
	{
		result = rawNewString(len);
	}
	LA1: ;
	return result;
}

N_NIMCALL(NimStringDesc*, copyStr)(NimStringDesc* s, NI start) {
	NimStringDesc* result;
	result = 0;
	result = copyStrLast(s, start, (NI32)((*s).Sup.len - 1));
	return result;
}

N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen) {
	NimStringDesc* result;
	result = 0;
	{
		if (!((NI32)((*dest).Sup.len + addlen) <= ((NI) ((NI)((*dest).Sup.reserved & 2147483647))))) goto LA3;
		result = dest;
	}
	goto LA1;
	LA3: ;
	{
		NI sp;
		NI LOC6;
		void* LOC7;
		LOC6 = 0;
		LOC6 = resize_74401(((NI) ((NI)((*dest).Sup.reserved & 2147483647))));
		sp = ((LOC6 >= (NI32)((*dest).Sup.len + addlen)) ? LOC6 : (NI32)((*dest).Sup.len + addlen));
		LOC7 = 0;
		LOC7 = growobj_63218(((void*) (dest)), (NI32)((NI32)(((NI)sizeof(TGenericSeq)) + sp) + 1));
		result = ((NimStringDesc*) (LOC7));
		(*result).Sup.reserved = sp;
	}
	LA1: ;
	return result;
}

N_NIMCALL(NimStringDesc*, setLengthStr)(NimStringDesc* s, NI newlen) {
	NimStringDesc* result;
	NI n;
	result = 0;
	n = ((newlen >= 0) ? newlen : 0);
	{
		if (!(n <= ((NI) ((NI)((*s).Sup.reserved & 2147483647))))) goto LA3;
		result = s;
	}
	goto LA1;
	LA3: ;
	{
		result = resizeString(s, n);
	}
	LA1: ;
	(*result).Sup.len = n;
	(*result).data[(n)- 0] = 0;
	return result;
}

N_NIMCALL(NimStringDesc*, mnewString)(NI len) {
	NimStringDesc* result;
	result = 0;
	result = rawNewString(len);
	(*result).Sup.len = len;
	return result;
}

N_NIMCALL(NimStringDesc*, nimCharToStr)(NIM_CHAR x) {
	NimStringDesc* result;
	result = 0;
	result = mnewString(1);
	result->data[0] = x;
	return result;
}

N_NIMCALL(TGenericSeq*, incrSeq)(TGenericSeq* seq, NI elemsize) {
	TGenericSeq* result;
	result = 0;
	result = seq;
	{
		void* LOC5;
		if (!(((NI) ((NI)((*result).reserved & 2147483647))) <= (*result).len)) goto LA3;
		(*result).reserved = resize_74401(((NI) ((NI)((*result).reserved & 2147483647))));
		LOC5 = 0;
		LOC5 = growobj_63218(((void*) (result)), (NI32)((NI32)(elemsize * (*result).reserved) + 8));
		result = ((TGenericSeq*) (LOC5));
	}
	LA3: ;
	(*result).len += 1;
	return result;
}

N_NIMCALL(void, genericassignaux_80212)(void* dest, void* src, TNimNode* n, NIM_BOOL shallow) {
	NI d;
	NI s;
	d = ((NI) (dest));
	s = ((NI) (src));
	switch ((*n).kind) {
	case ((NU8) 1):
	{
		genericassignaux_80206(((void*) ((NI)((NU32)(d) + (NU32)((*n).offset)))), ((void*) ((NI)((NU32)(s) + (NU32)((*n).offset)))), (*n).typ, shallow);
	}
	break;
	case ((NU8) 2):
	{
		{
			NI i_80249;
			NI HEX3Atmp_80406;
			NI res_80409;
			i_80249 = 0;
			HEX3Atmp_80406 = 0;
			HEX3Atmp_80406 = (NI32)((*n).len - 1);
			res_80409 = 0;
			{
				while (1) {
					if (!(res_80409 <= HEX3Atmp_80406)) goto LA5;
					i_80249 = res_80409;
					genericassignaux_80212(dest, src, (*n).sons[(i_80249)- 0], shallow);
					res_80409 += 1;
				} LA5: ;
			}
		}
	}
	break;
	case ((NU8) 3):
	{
		TNimNode* dd;
		TNimNode* m;
		dd = selectbranch_25410(dest, n);
		m = selectbranch_25410(src, n);
		{
			NIM_BOOL LOC9;
			LOC9 = 0;
			LOC9 = !((m == dd));
			if (!(LOC9)) goto LA10;
			LOC9 = !((dd == NIM_NIL));
			LA10: ;
			if (!LOC9) goto LA11;
			genericresetaux_80201(dest, dd);
		}
		LA11: ;
		memcpy(((void*) ((NI)((NU32)(d) + (NU32)((*n).offset)))), ((void*) ((NI)((NU32)(s) + (NU32)((*n).offset)))), (*(*n).typ).size);
		{
			if (!!((m == NIM_NIL))) goto LA15;
			genericassignaux_80212(dest, src, m, shallow);
		}
		LA15: ;
	}
	break;
	case ((NU8) 0):
	{
	}
	break;
	}
}

N_NIMCALL(void, genericassignaux_80206)(void* dest, void* src, TNimType* mt, NIM_BOOL shallow) {
	NI d;
	NI s;
	d = ((NI) (dest));
	s = ((NI) (src));
	switch ((*mt).kind) {
	case ((NU8) 28):
	{
		void** x;
		void* s2;
		x = ((void**) (dest));
		s2 = (*((void**) (s)));
		{
			NIM_BOOL LOC4;
			NIM_BOOL LOC5;
			LOC4 = 0;
			LOC5 = 0;
			LOC5 = (s2 == NIM_NIL);
			if (LOC5) goto LA6;
			LOC5 = shallow;
			LA6: ;
			LOC4 = LOC5;
			if (LOC4) goto LA7;
			LOC4 = !(((NI)((*((TGenericSeq*) (s2))).reserved & (-2147483647 -1)) == 0));
			LA7: ;
			if (!LOC4) goto LA8;
			unsureAsgnRef(x, s2);
		}
		goto LA2;
		LA8: ;
		{
			NimStringDesc* LOC11;
			LOC11 = 0;
			LOC11 = copyString(((NimStringDesc*) (s2)));
			unsureAsgnRef(x, ((void*) (LOC11)));
		}
		LA2: ;
	}
	break;
	case ((NU8) 24):
	{
		void* s2;
		TGenericSeq* seq;
		void** x;
		void* LOC21;
		NI dst;
		s2 = (*((void**) (src)));
		seq = ((TGenericSeq*) (s2));
		x = ((void**) (dest));
		{
			NIM_BOOL LOC15;
			NIM_BOOL LOC16;
			LOC15 = 0;
			LOC16 = 0;
			LOC16 = (s2 == NIM_NIL);
			if (LOC16) goto LA17;
			LOC16 = shallow;
			LA17: ;
			LOC15 = LOC16;
			if (LOC15) goto LA18;
			LOC15 = !(((NI)((*seq).reserved & (-2147483647 -1)) == 0));
			LA18: ;
			if (!LOC15) goto LA19;
			unsureAsgnRef(x, s2);
			goto BeforeRet;
		}
		LA19: ;
		LOC21 = 0;
		LOC21 = newSeq(mt, (*seq).len);
		unsureAsgnRef(x, LOC21);
		dst = ((NI) ((*((void**) (dest)))));
		{
			NI i_80812;
			NI HEX3Atmp_80948;
			NI res_80951;
			i_80812 = 0;
			HEX3Atmp_80948 = 0;
			HEX3Atmp_80948 = (NI32)((*seq).len - 1);
			res_80951 = 0;
			{
				while (1) {
					if (!(res_80951 <= HEX3Atmp_80948)) goto LA24;
					i_80812 = res_80951;
					genericassignaux_80206(((void*) ((NI)((NU32)((NI)((NU32)(dst) + (NU32)((NI)((NU32)(i_80812) * (NU32)((*(*mt).base).size))))) + (NU32)(8)))), ((void*) ((NI)((NU32)((NI)((NU32)(((NI) (s2))) + (NU32)((NI)((NU32)(i_80812) * (NU32)((*(*mt).base).size))))) + (NU32)(8)))), (*mt).base, shallow);
					res_80951 += 1;
				} LA24: ;
			}
		}
	}
	break;
	case ((NU8) 17):
	{
		TNimType** pint;
		{
			if (!!(((*mt).base == NIM_NIL))) goto LA28;
			genericassignaux_80206(dest, src, (*mt).base, shallow);
		}
		LA28: ;
		genericassignaux_80212(dest, src, (*mt).node, shallow);
		pint = ((TNimType**) (dest));
		(*pint) = mt;
	}
	break;
	case ((NU8) 18):
	{
		genericassignaux_80212(dest, src, (*mt).node, shallow);
	}
	break;
	case ((NU8) 16):
	case ((NU8) 4):
	{
		{
			NI i_80896;
			NI HEX3Atmp_80957;
			NI res_80960;
			i_80896 = 0;
			HEX3Atmp_80957 = 0;
			HEX3Atmp_80957 = (NI32)((NI32)((*mt).size / (*(*mt).base).size) - 1);
			res_80960 = 0;
			{
				while (1) {
					if (!(res_80960 <= HEX3Atmp_80957)) goto LA34;
					i_80896 = res_80960;
					genericassignaux_80206(((void*) ((NI)((NU32)(d) + (NU32)((NI)((NU32)(i_80896) * (NU32)((*(*mt).base).size)))))), ((void*) ((NI)((NU32)(s) + (NU32)((NI)((NU32)(i_80896) * (NU32)((*(*mt).base).size)))))), (*mt).base, shallow);
					res_80960 += 1;
				} LA34: ;
			}
		}
	}
	break;
	case ((NU8) 22):
	{
		unsureAsgnRef(((void**) (dest)), (*((void**) (s))));
	}
	break;
	default:
	{
		memcpy(dest, src, (*mt).size);
	}
	break;
	}
	BeforeRet: ;
}

N_NIMCALL(void, genericAssign)(void* dest, void* src, TNimType* mt) {
	genericassignaux_80206(dest, src, mt, NIM_FALSE);
}
N_NIMCALL(void, TMP161)(void* p, NI op) {
	ioerror3231* a;
	a = (ioerror3231*)p;
	nimGCvisit((void*)(*a).Sup.Sup.parent, op);
	nimGCvisit((void*)(*a).Sup.Sup.message, op);
	nimGCvisit((void*)(*a).Sup.Sup.trace, op);
}

N_NOINLINE(void, raiseeio_76605)(NimStringDesc* msg) {
	ioerror3231* e_76610;
	NimStringDesc* LOC1;
	e_76610 = 0;
	e_76610 = (ioerror3231*) newObj((&NTI76801), sizeof(ioerror3231));
	(*e_76610).Sup.Sup.Sup.m_type = (&NTI3231);
	LOC1 = 0;
	LOC1 = (*e_76610).Sup.Sup.message; (*e_76610).Sup.Sup.message = copyStringRC1(msg);
	if (LOC1) nimGCunrefNoCycle(LOC1);
	raiseException((Exception*)e_76610, "IOError");
}

N_NIMCALL(void, write_12865)(FILE* f, NimStringDesc* s) {
	{
		NI LOC3;
		LOC3 = 0;
		LOC3 = writebuffer_13046(f, ((void*) (s->data)), s->Sup.len);
		if (!!((LOC3 == s->Sup.len))) goto LA4;
		raiseeio_76605(((NimStringDesc*) &TMP162));
	}
	LA4: ;
}

static N_INLINE(void*, seqtoptr_197692)(TY120608* x_197698) {
	void* result;
	result = 0;
	result = ((void*) (x_197698));
	return result;
}

static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b) {
	NIM_BOOL result;
	NIM_BOOL LOC11;
	int LOC13;
	result = 0;
	{
		if (!(a == b)) goto LA3;
		result = NIM_TRUE;
		goto BeforeRet;
	}
	LA3: ;
	{
		NIM_BOOL LOC7;
		LOC7 = 0;
		LOC7 = (a == NIM_NIL);
		if (LOC7) goto LA8;
		LOC7 = (b == NIM_NIL);
		LA8: ;
		if (!LOC7) goto LA9;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA9: ;
	LOC11 = 0;
	LOC11 = ((*a).Sup.len == (*b).Sup.len);
	if (!(LOC11)) goto LA12;
	LOC13 = 0;
	LOC13 = memcmp(((NCSTRING) ((*a).data)), ((NCSTRING) ((*b).data)), (NI32)((*a).Sup.len * 1));
	LOC11 = (LOC13 == ((NI32) 0));
	LA12: ;
	result = LOC11;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_197676)(TY120608* x_197682, TY120608* y_197687) {
	NIM_BOOL result;
	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_197692(x_197682);
		LOC4 = 0;
		LOC4 = seqtoptr_197692(y_197687);
		if (!(LOC3 == LOC4)) goto LA5;
		result = NIM_TRUE;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC8;
		void* LOC9;
		void* LOC11;
		LOC8 = 0;
		LOC9 = 0;
		LOC9 = seqtoptr_197692(x_197682);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_197692(y_197687);
		LOC8 = (LOC11 == NIM_NIL);
		LA10: ;
		if (!LOC8) goto LA12;
		result = NIM_FALSE;
	}
	goto LA1;
	LA12: ;
	{
		if (!(x_197682->Sup.len == y_197687->Sup.len)) goto LA15;
		{
			NI i_197781;
			NI HEX3Atmp_197783;
			NI res_197786;
			i_197781 = 0;
			HEX3Atmp_197783 = 0;
			HEX3Atmp_197783 = (NI32)(x_197682->Sup.len - 1);
			res_197786 = 0;
			{
				while (1) {
					if (!(res_197786 <= HEX3Atmp_197783)) goto LA19;
					i_197781 = res_197786;
					{
						if (!!(eqStrings(x_197682->data[i_197781], y_197687->data[i_197781]))) goto LA22;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA22: ;
					res_197786 += 1;
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, safeadd_197660)(TY120608** x_197668, NimStringDesc* y_197672) {
	{
		NIM_BOOL LOC3;
		TY198301 LOC6;
		NimStringDesc* LOC7;
		LOC3 = 0;
		LOC3 = HEX3DHEX3D_197676((*x_197668), NIM_NIL);
		if (!LOC3) goto LA4;
		unsureAsgnRef((void**) (&(*x_197668)), (TY120608*) newSeq((&NTI120608), 1));
		memset((void*)LOC6, 0, sizeof(LOC6));
		LOC6[0] = copyString(y_197672);
		LOC7 = 0;
		LOC7 = (*x_197668)->data[0]; (*x_197668)->data[0] = copyStringRC1(LOC6[0]);
		if (LOC7) nimGCunrefNoCycle(LOC7);
	}
	goto LA1;
	LA4: ;
	{
		NimStringDesc* LOC9;
		(*x_197668) = (TY120608*) incrSeq(&((*x_197668))->Sup, sizeof(NimStringDesc*));
		LOC9 = 0;
		LOC9 = (*x_197668)->data[(*x_197668)->Sup.len-1]; (*x_197668)->data[(*x_197668)->Sup.len-1] = copyStringRC1(y_197672);
		if (LOC9) nimGCunrefNoCycle(LOC9);
	}
	LA1: ;
}

N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x) {
	NimStringDesc* result;
	NI i;
	NI y;
	result = 0;
	result = mnewString(16);
	i = 0;
	y = x;
	{
		while (1) {
			NI d;
			d = (NI32)(y / 10);
			result->data[i] = ((NIM_CHAR) (((NI) ((NI32)(((NI32)(y - (NI32)(d * 10)) > 0? ((NI32)(y - (NI32)(d * 10))) : -((NI32)(y - (NI32)(d * 10)))) + 48)))));
			i += 1;
			y = d;
			{
				if (!(y == 0)) goto LA5;
				goto LA1;
			}
			LA5: ;
		}
	} LA1: ;
	{
		if (!(x < 0)) goto LA9;
		result->data[i] = 45;
		i += 1;
	}
	LA9: ;
	result = setLengthStr(result, i);
	{
		NI j_75558;
		NI HEX3Atmp_75577;
		NI res_75580;
		j_75558 = 0;
		HEX3Atmp_75577 = 0;
		HEX3Atmp_75577 = (NI32)((NI32)(i / 2) - 1);
		res_75580 = 0;
		{
			while (1) {
				NIM_CHAR LOC14;
				if (!(res_75580 <= HEX3Atmp_75577)) goto LA13;
				j_75558 = res_75580;
				LOC14 = 0;
				LOC14 = result->data[j_75558];
				result->data[j_75558] = result->data[(NI32)((NI32)(i - j_75558) - 1)];
				result->data[(NI32)((NI32)(i - j_75558) - 1)] = LOC14;
				res_75580 += 1;
			} LA13: ;
		}
	}
	return result;
}

N_NIMCALL(void, writestacktrace_15606)(void) {
	showerrormessage_16209("No stack traceback available\015\012");
}
N_NIMCALL(void, TMP840)(void* p, NI op) {
	TNimObject* a;
	a = (TNimObject*)p;
}

N_NIMCALL(void, objectinitaux_81292)(void* dest, TNimNode* n) {
	NI d;
	d = ((NI) (dest));
	switch ((*n).kind) {
	case ((NU8) 0):
	{
	}
	break;
	case ((NU8) 1):
	{
		objectInit(((void*) ((NI)((NU32)(d) + (NU32)((*n).offset)))), (*n).typ);
	}
	break;
	case ((NU8) 2):
	{
		{
			NI i_81420;
			NI HEX3Atmp_81442;
			NI res_81445;
			i_81420 = 0;
			HEX3Atmp_81442 = 0;
			HEX3Atmp_81442 = (NI32)((*n).len - 1);
			res_81445 = 0;
			{
				while (1) {
					if (!(res_81445 <= HEX3Atmp_81442)) goto LA6;
					i_81420 = res_81445;
					objectinitaux_81292(dest, (*n).sons[(i_81420)- 0]);
					res_81445 += 1;
				} LA6: ;
			}
		}
	}
	break;
	case ((NU8) 3):
	{
		TNimNode* m;
		m = selectbranch_25410(dest, n);
		{
			if (!!((m == NIM_NIL))) goto LA10;
			objectinitaux_81292(dest, m);
		}
		LA10: ;
	}
	break;
	}
}

N_NIMCALL(void, objectInit)(void* dest, TNimType* typ) {
	NI d;
	d = ((NI) (dest));
	switch ((*typ).kind) {
	case ((NU8) 17):
	{
		TNimType** pint;
		pint = ((TNimType**) (dest));
		(*pint) = typ;
		objectinitaux_81292(dest, (*typ).node);
	}
	break;
	case ((NU8) 18):
	{
		objectinitaux_81292(dest, (*typ).node);
	}
	break;
	case ((NU8) 16):
	case ((NU8) 4):
	{
		{
			NI i_81476;
			NI HEX3Atmp_81490;
			NI res_81493;
			i_81476 = 0;
			HEX3Atmp_81490 = 0;
			HEX3Atmp_81490 = (NI32)((NI32)((*typ).size / (*(*typ).base).size) - 1);
			res_81493 = 0;
			{
				while (1) {
					if (!(res_81493 <= HEX3Atmp_81490)) goto LA6;
					i_81476 = res_81493;
					objectInit(((void*) ((NI)((NU32)(d) + (NU32)((NI32)(i_81476 * (*(*typ).base).size))))), (*typ).base);
					res_81493 += 1;
				} LA6: ;
			}
		}
	}
	break;
	default:
	{
	}
	break;
	}
}
N_NIMCALL(void, TMP1036)(void* p, NI op) {
	NI16* a;
	NI LOC1;
	a = (NI16*)p;
	LOC1 = 0;
	for (LOC1 = 0; LOC1 < 1000001; LOC1++) {
	}
}

N_NIMCALL(NI16*, newwidecstring_78824)(NCSTRING source, NI l) {
	NI16* result;
	NI d;
	result = 0;
	result = (NI16*) newObj((&NTI77804), (NI32)((NI32)(l * 4) + 2));
	d = 0;
	{
		NI ch_78846;
		NI i_78942;
		NI result_78944;
		ch_78846 = 0;
		i_78942 = 0;
		result_78944 = 0;
		{
			while (1) {
				if (!!(((NU8)(source[i_78942]) == (NU8)(0)))) goto LA3;
				{
					if (!((NU32)(((NU8)(source[i_78942]))) <= (NU32)(127))) goto LA6;
					result_78944 = ((NI) (((NU8)(source[i_78942]))));
					i_78942 += 1;
				}
				goto LA4;
				LA6: ;
				{
					if (!((NI)((NU32)(((NI) (((NU8)(source[i_78942]))))) >> (NU32)(5)) == 6)) goto LA9;
					result_78944 = (NI)((NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(source[i_78942])))) & 31)))) << (NU32)(6)) | ((NI) ((NI)(((NI) (((NU8)(source[(NI32)(i_78942 + 1)])))) & 63))));
					i_78942 += 2;
				}
				goto LA4;
				LA9: ;
				{
					if (!((NI)((NU32)(((NI) (((NU8)(source[i_78942]))))) >> (NU32)(4)) == 14)) goto LA12;
					result_78944 = (NI)((NI)((NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(source[i_78942])))) & 15)))) << (NU32)(12)) | (NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(source[(NI32)(i_78942 + 1)])))) & 63)))) << (NU32)(6))) | ((NI) ((NI)(((NI) (((NU8)(source[(NI32)(i_78942 + 2)])))) & 63))));
					i_78942 += 3;
				}
				goto LA4;
				LA12: ;
				{
					if (!((NI)((NU32)(((NI) (((NU8)(source[i_78942]))))) >> (NU32)(3)) == 30)) goto LA15;
					result_78944 = (NI)((NI)((NI)((NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(source[i_78942])))) & 7)))) << (NU32)(18)) | (NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(source[(NI32)(i_78942 + 1)])))) & 63)))) << (NU32)(12))) | (NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(source[(NI32)(i_78942 + 2)])))) & 63)))) << (NU32)(6))) | ((NI) ((NI)(((NI) (((NU8)(source[(NI32)(i_78942 + 3)])))) & 63))));
					i_78942 += 4;
				}
				goto LA4;
				LA15: ;
				{
					result_78944 = 65533;
					i_78942 += 1;
				}
				LA4: ;
				ch_78846 = result_78944;
				{
					if (!((NU32)(ch_78846) <= (NU32)(65535))) goto LA20;
					{
						NIM_BOOL LOC24;
						LOC24 = 0;
						LOC24 = ((NU32)(55296) <= (NU32)(ch_78846));
						if (!(LOC24)) goto LA25;
						LOC24 = ((NU32)(ch_78846) <= (NU32)(57343));
						LA25: ;
						if (!LOC24) goto LA26;
						result[(d)- 0] = ((NI16) -3);
					}
					goto LA22;
					LA26: ;
					{
						result[(d)- 0] = ((NI16)(NU16)(NU)(ch_78846));
					}
					LA22: ;
				}
				goto LA18;
				LA20: ;
				{
					if (!((NU32)(1114111) < (NU32)(ch_78846))) goto LA30;
					result[(d)- 0] = ((NI16) -3);
				}
				goto LA18;
				LA30: ;
				{
					NI ch;
					ch = (NI)((NU32)(ch_78846) - (NU32)(65536));
					result[(d)- 0] = ((NI16)(NU16)(NU)((NI)((NU32)((NI)((NU32)(ch) >> (NU32)(10))) + (NU32)(55296))));
					d += 1;
					result[(d)- 0] = ((NI16)(NU16)(NU)((NI)((NU32)((NI)(ch & 1023)) + (NU32)(56320))));
				}
				LA18: ;
				d += 1;
			} LA3: ;
		}
	}
	result[(d)- 0] = ((NI16) 0);
	return result;
}

N_NIMCALL(NI16*, newwidecstring_78958)(NCSTRING s) {
	NI16* result;
	NI l;
	result = 0;
	{
		if (!s == 0) goto LA3;
		result = NIM_NIL;
		goto BeforeRet;
	}
	LA3: ;
	l = strlen(s);
	result = newwidecstring_78824(s, l);
	BeforeRet: ;
	return result;
}

N_NIMCALL(void*, fopen_79410)(NCSTRING filename, NCSTRING mode) {
	void* result;
	NI16* f;
	NI16* m;
	result = 0;
	f = newwidecstring_78958(filename);
	m = newwidecstring_78958(mode);
	result = _wfopen(f, m);
	return result;
}

N_NIMCALL(NIM_BOOL, open_12603)(FILE** f, NimStringDesc* filename, NU8 mode, NI bufsize) {
	NIM_BOOL result;
	void* p;
	result = 0;
	p = fopen_79410(filename->data, formatopen_79431[(mode)- 0]->data);
	{
		if (!!((p == NIM_NIL))) goto LA3;
		result = NIM_TRUE;
		(*f) = ((FILE*) (p));
		{
			NIM_BOOL LOC7;
			int LOC11;
			LOC7 = 0;
			LOC7 = (0 < bufsize);
			if (!(LOC7)) goto LA8;
			LOC7 = (bufsize <= 2147483647);
			LA8: ;
			if (!LOC7) goto LA9;
			LOC11 = 0;
			LOC11 = setvbuf((*f), NIM_NIL, _IOFBF, ((int) (bufsize)));
		}
		goto LA5;
		LA9: ;
		{
			int LOC15;
			if (!(bufsize == 0)) goto LA13;
			LOC15 = 0;
			LOC15 = setvbuf((*f), NIM_NIL, _IONBF, ((int) 0));
		}
		goto LA5;
		LA13: ;
		LA5: ;
	}
	LA3: ;
	return result;
}

N_NIMCALL(NIM_BOOL, readline_12889)(FILE* f, NimStringDesc** line) {
	NIM_BOOL result;
	result = 0;
	(*line) = setLengthStr((*line), 0);
	{
		while (1) {
			int c;
			c = fgetc(f);
			{
				if (!(c < ((NI32) 0))) goto LA5;
				{
					if (!(0 < (*line)->Sup.len)) goto LA9;
					goto LA1;
				}
				goto LA7;
				LA9: ;
				{
					result = NIM_FALSE;
					goto BeforeRet;
				}
				LA7: ;
			}
			LA5: ;
			{
				if (!(c == ((NI32) 10))) goto LA14;
				goto LA1;
			}
			LA14: ;
			{
				if (!(c == ((NI32) 13))) goto LA18;
				c = fgetc(f);
				{
					if (!!((c == ((NI32) 10)))) goto LA22;
					ungetc(c, f);
				}
				LA22: ;
				goto LA1;
			}
			LA18: ;
			(*line) = addChar((*line), ((NIM_CHAR) (((NI) (((NI) (c)))))));
		}
	} LA1: ;
	result = NIM_TRUE;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NI, readbuffer_13027)(FILE* f, void* buffer, NI len) {
	NI result;
	result = 0;
	result = fread(buffer, 1, len, f);
	return result;
}

N_NIMCALL(NI, ptrsize_43016)(void* p) {
	NI result;
	void* x;
	tbasechunk26238* c;
	result = 0;
	x = ((void*) ((NI)((NU32)(((NI) (p))) - (NU32)(((NI)sizeof(tfreecell26230))))));
	c = pageaddr_28946(p);
	result = (NI)((NU32)((*c).Size) - (NU32)(((NI)sizeof(tfreecell26230))));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = issmallchunk_28799(c);
		if (!!(LOC3)) goto LA4;
		result -= (NI32)(((NI)sizeof(tbigchunk26242)) - 8);
	}
	LA4: ;
	return result;
}

N_NIMCALL(void*, realloc_44407)(tmemregion27010* allocator, void* p, NI newsize) {
	void* result;
	result = 0;
	{
		if (!(0 < newsize)) goto LA3;
		result = alloc0_43419(allocator, newsize);
		{
			NI LOC9;
			if (!!((p == NIM_NIL))) goto LA7;
			LOC9 = 0;
			LOC9 = ptrsize_43016(p);
			memcpy(result, p, LOC9);
			dealloc_43428(allocator, p);
		}
		LA7: ;
	}
	goto LA1;
	LA3: ;
	{
		if (!!((p == NIM_NIL))) goto LA11;
		dealloc_43428(allocator, p);
	}
	goto LA1;
	LA11: ;
	LA1: ;
	return result;
}

N_NOCONV(void*, realloc_5833)(void* p, NI newsize) {
	void* result;
	result = 0;
	result = realloc_44407((&gch_46844.Region), p, newsize);
	return result;
}

N_NIMCALL(TNimType*, extGetCellType)(void* c) {
	TNimType* result;
	tcell44733* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = usrtocell_48446(c);
	result = (*LOC1).Typ;
	return result;
}

N_NIMCALL(TGenericSeq*, setLengthSeq)(TGenericSeq* seq, NI elemsize, NI newlen) {
	TGenericSeq* result;
	result = 0;
	result = seq;
	{
		NI LOC5;
		void* LOC6;
		if (!(((NI) ((NI)((*result).reserved & 2147483647))) < newlen)) goto LA3;
		LOC5 = 0;
		LOC5 = resize_74401(((NI) ((NI)((*result).reserved & 2147483647))));
		(*result).reserved = ((LOC5 >= newlen) ? LOC5 : newlen);
		LOC6 = 0;
		LOC6 = growobj_63218(((void*) (result)), (NI32)((NI32)(elemsize * (*result).reserved) + 8));
		result = ((TGenericSeq*) (LOC6));
	}
	goto LA1;
	LA3: ;
	{
		if (!(newlen < (*result).len)) goto LA8;
		{
			NI i_75411;
			NI HEX3Atmp_75488;
			NI res_75491;
			i_75411 = 0;
			HEX3Atmp_75488 = 0;
			HEX3Atmp_75488 = (NI32)((*result).len - 1);
			res_75491 = newlen;
			{
				while (1) {
					TNimType* LOC13;
					if (!(res_75491 <= HEX3Atmp_75488)) goto LA12;
					i_75411 = res_75491;
					LOC13 = 0;
					LOC13 = extGetCellType(((void*) (result)));
					forallchildrenaux_48825(((void*) ((NI)((NU32)((NI)((NU32)(((NI) (result))) + (NU32)(8))) + (NU32)((NI)((NU32)(i_75411) * (NU32)(elemsize)))))), (*LOC13).base, ((NU8) 2));
					res_75491 += 1;
				} LA12: ;
			}
		}
		zeroMem(((void*) ((NI)((NU32)((NI)((NU32)(((NI) (result))) + (NU32)(8))) + (NU32)((NI)((NU32)(newlen) * (NU32)(elemsize)))))), (NI)((NU32)((NI)((NU32)((*result).len) - (NU32)(newlen))) * (NU32)(elemsize)));
	}
	goto LA1;
	LA8: ;
	LA1: ;
	(*result).len = newlen;
	return result;
}

static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
	memcpy(((NCSTRING) ((&(*dest).data[((*dest).Sup.len)- 0]))), ((NCSTRING) ((*src).data)), (NI32)((*src).Sup.len + 1));
	(*dest).Sup.len += (*src).Sup.len;
}

static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) {
	{
		tcell44733* c;
		if (!!((src == NIM_NIL))) goto LA3;
		c = usrtocell_48446(src);
		(*c).Refcount += 8;
	}
	LA3: ;
	{
		tcell44733* c;
		if (!!(((*dest) == NIM_NIL))) goto LA7;
		c = usrtocell_48446((*dest));
		{
			(*c).Refcount -= 8;
			if (!((NU32)((*c).Refcount) < (NU32)(8))) goto LA11;
			rtladdzct_50004(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

N_NIMCALL(FILE*, open_12617)(NimStringDesc* filename, NU8 mode, NI bufsize) {
	FILE* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		ioerror3231* e_12626;
		NimStringDesc* LOC6;
		LOC3 = 0;
		LOC3 = open_12603(&result, filename, mode, bufsize);
		if (!!(LOC3)) goto LA4;
		e_12626 = 0;
		e_12626 = (ioerror3231*) newObj((&NTI76801), sizeof(ioerror3231));
		(*e_12626).Sup.Sup.Sup.m_type = (&NTI3231);
		LOC6 = 0;
		LOC6 = rawNewString(filename->Sup.len + 13);
appendString(LOC6, ((NimStringDesc*) &TMP1053));
appendString(LOC6, filename);
		asgnRefNoCycle((void**) (&(*e_12626).Sup.Sup.message), LOC6);
		raiseException((Exception*)e_12626, "IOError");
	}
	LA4: ;
	return result;
}

N_NIMCALL(NIM_BOOL, isObj)(TNimType* obj, TNimType* subclass) {
	NIM_BOOL result;
	TNimType* x;
	result = 0;
	x = obj;
	{
		if (!(x == subclass)) goto LA3;
		result = NIM_TRUE;
		goto BeforeRet;
	}
	LA3: ;
	{
		while (1) {
			if (!!((x == subclass))) goto LA6;
			{
				if (!(x == NIM_NIL)) goto LA9;
				result = NIM_FALSE;
				goto BeforeRet;
			}
			LA9: ;
			x = (*x).base;
		} LA6: ;
	}
	result = NIM_TRUE;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}
N_NIMCALL(void, TMP1054)(void* p, NI op) {
	reraiseerror3263* a;
	a = (reraiseerror3263*)p;
	nimGCvisit((void*)(*a).Sup.parent, op);
	nimGCvisit((void*)(*a).Sup.message, op);
	nimGCvisit((void*)(*a).Sup.trace, op);
}

N_NIMCALL(void, reraiseException)(void) {
	{
		reraiseerror3263* e_17825;
		NimStringDesc* LOC5;
		if (!(currexception_16245 == NIM_NIL)) goto LA3;
		e_17825 = 0;
		e_17825 = (reraiseerror3263*) newObj((&NTI18001), sizeof(reraiseerror3263));
		(*e_17825).Sup.Sup.m_type = (&NTI3263);
		LOC5 = 0;
		LOC5 = (*e_17825).Sup.message; (*e_17825).Sup.message = copyStringRC1(((NimStringDesc*) &TMP1055));
		if (LOC5) nimGCunrefNoCycle(LOC5);
		raiseException((Exception*)e_17825, "ReraiseError");
	}
	goto LA1;
	LA3: ;
	{
		raiseexceptionaux_17404(currexception_16245);
	}
	LA1: ;
}

N_NIMCALL(NimStringDesc*, HEX24_199126)(TY86345 x_199130) {
	NimStringDesc* result;
	NIM_BOOL firstelement;
	NimStringDesc* LOC9;
	result = 0;
	result = copyString(((NimStringDesc*) &TMP1056));
	firstelement = NIM_TRUE;
	{
		if (!!(firstelement)) goto LA3;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TMP1057));
	}
	LA3: ;
	result = resizeString(result, 8);
appendString(result, ((NimStringDesc*) &TMP1058));
	result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TMP1059));
	result = resizeString(result, x_199130.Field0->Sup.len + 0);
appendString(result, x_199130.Field0);
	firstelement = NIM_FALSE;
	{
		if (!!(firstelement)) goto LA7;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TMP1057));
	}
	LA7: ;
	result = resizeString(result, 4);
appendString(result, ((NimStringDesc*) &TMP1060));
	result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TMP1059));
	LOC9 = 0;
	LOC9 = nimIntToStr(x_199130.Field1);
	result = resizeString(result, LOC9->Sup.len + 0);
appendString(result, LOC9);
	firstelement = NIM_FALSE;
	result = resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TMP1061));
	return result;
}

N_NIMCALL(NIM_CHAR, getdecimalpoint_75661)(void) {
	NIM_CHAR result;
	result = 0;
	result = decimalpoint_75660;
	{
		if (!((NU8)(result) == (NU8)(0))) goto LA3;
		{
			NF LOC7;
			LOC7 = 0;
			LOC7 = strtod("0,5", NIM_NIL);
			if (!(LOC7 == 5.0000000000000000e-01)) goto LA8;
			result = 44;
		}
		goto LA5;
		LA8: ;
		{
			result = 46;
		}
		LA5: ;
		decimalpoint_75660 = result;
	}
	LA3: ;
	return result;
}

N_NIMCALL(NI, nimParseBiggestFloat)(NimStringDesc* s, NF* number, NI start) {
	NI result;
	NI i;
	NF sign;
	TY75680 t;
	NI ti;
	NIM_BOOL hasdigits;
	result = 0;
	i = start;
	sign = 1.0000000000000000e+00;
	memset((void*)t, 0, sizeof(t));
	ti = 0;
	hasdigits = NIM_FALSE;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = ((NU8)(s->data[i]) == (NU8)(43));
		if (LOC3) goto LA4;
		LOC3 = ((NU8)(s->data[i]) == (NU8)(45));
		LA4: ;
		if (!LOC3) goto LA5;
		{
			if (!((NU8)(s->data[i]) == (NU8)(45))) goto LA9;
			sign = -1.0000000000000000e+00;
		}
		LA9: ;
		t[(ti)- 0] = s->data[i];
		i += 1;
		ti += 1;
	}
	LA5: ;
	{
		NIM_BOOL LOC13;
		LOC13 = 0;
		LOC13 = ((NU8)(s->data[i]) == (NU8)(78));
		if (LOC13) goto LA14;
		LOC13 = ((NU8)(s->data[i]) == (NU8)(110));
		LA14: ;
		if (!LOC13) goto LA15;
		{
			NIM_BOOL LOC19;
			LOC19 = 0;
			LOC19 = ((NU8)(s->data[(NI32)(i + 1)]) == (NU8)(65));
			if (LOC19) goto LA20;
			LOC19 = ((NU8)(s->data[(NI32)(i + 1)]) == (NU8)(97));
			LA20: ;
			if (!LOC19) goto LA21;
			{
				NIM_BOOL LOC25;
				LOC25 = 0;
				LOC25 = ((NU8)(s->data[(NI32)(i + 2)]) == (NU8)(78));
				if (LOC25) goto LA26;
				LOC25 = ((NU8)(s->data[(NI32)(i + 2)]) == (NU8)(110));
				LA26: ;
				if (!LOC25) goto LA27;
				{
					if (!!((((NU8)(s->data[(NI32)(i + 3)])) >= ((NU8)(97)) && ((NU8)(s->data[(NI32)(i + 3)])) <= ((NU8)(122)) || ((NU8)(s->data[(NI32)(i + 3)])) >= ((NU8)(65)) && ((NU8)(s->data[(NI32)(i + 3)])) <= ((NU8)(90)) || ((NU8)(s->data[(NI32)(i + 3)])) >= ((NU8)(48)) && ((NU8)(s->data[(NI32)(i + 3)])) <= ((NU8)(57)) || ((NU8)(s->data[(NI32)(i + 3)])) == ((NU8)(95))))) goto LA31;
					(*number) = NAN;
					result = (NI32)((NI32)(i + 3) - start);
					goto BeforeRet;
				}
				LA31: ;
			}
			LA27: ;
		}
		LA21: ;
		result = 0;
		goto BeforeRet;
	}
	LA15: ;
	{
		NIM_BOOL LOC35;
		LOC35 = 0;
		LOC35 = ((NU8)(s->data[i]) == (NU8)(73));
		if (LOC35) goto LA36;
		LOC35 = ((NU8)(s->data[i]) == (NU8)(105));
		LA36: ;
		if (!LOC35) goto LA37;
		{
			NIM_BOOL LOC41;
			LOC41 = 0;
			LOC41 = ((NU8)(s->data[(NI32)(i + 1)]) == (NU8)(78));
			if (LOC41) goto LA42;
			LOC41 = ((NU8)(s->data[(NI32)(i + 1)]) == (NU8)(110));
			LA42: ;
			if (!LOC41) goto LA43;
			{
				NIM_BOOL LOC47;
				LOC47 = 0;
				LOC47 = ((NU8)(s->data[(NI32)(i + 2)]) == (NU8)(70));
				if (LOC47) goto LA48;
				LOC47 = ((NU8)(s->data[(NI32)(i + 2)]) == (NU8)(102));
				LA48: ;
				if (!LOC47) goto LA49;
				{
					if (!!((((NU8)(s->data[(NI32)(i + 3)])) >= ((NU8)(97)) && ((NU8)(s->data[(NI32)(i + 3)])) <= ((NU8)(122)) || ((NU8)(s->data[(NI32)(i + 3)])) >= ((NU8)(65)) && ((NU8)(s->data[(NI32)(i + 3)])) <= ((NU8)(90)) || ((NU8)(s->data[(NI32)(i + 3)])) >= ((NU8)(48)) && ((NU8)(s->data[(NI32)(i + 3)])) <= ((NU8)(57)) || ((NU8)(s->data[(NI32)(i + 3)])) == ((NU8)(95))))) goto LA53;
					(*number) = ((NF)(INF) * (NF)(sign));
					result = (NI32)((NI32)(i + 3) - start);
					goto BeforeRet;
				}
				LA53: ;
			}
			LA49: ;
		}
		LA43: ;
		result = 0;
		goto BeforeRet;
	}
	LA37: ;
	{
		while (1) {
			if (!(((NU8)(s->data[i])) >= ((NU8)(48)) && ((NU8)(s->data[i])) <= ((NU8)(57)))) goto LA56;
			hasdigits = NIM_TRUE;
			{
				if (!(ti < 499)) goto LA59;
				t[(ti)- 0] = s->data[i];
				ti += 1;
			}
			LA59: ;
			i += 1;
			{
				while (1) {
					if (!((NU8)(s->data[i]) == (NU8)(95))) goto LA62;
					i += 1;
				} LA62: ;
			}
		} LA56: ;
	}
	{
		if (!((NU8)(s->data[i]) == (NU8)(46))) goto LA65;
		{
			if (!(ti < 499)) goto LA69;
			t[(ti)- 0] = getdecimalpoint_75661();
			ti += 1;
		}
		LA69: ;
		i += 1;
		{
			while (1) {
				if (!(((NU8)(s->data[i])) >= ((NU8)(48)) && ((NU8)(s->data[i])) <= ((NU8)(57)))) goto LA72;
				hasdigits = NIM_TRUE;
				{
					if (!(ti < 499)) goto LA75;
					t[(ti)- 0] = s->data[i];
					ti += 1;
				}
				LA75: ;
				i += 1;
				{
					while (1) {
						if (!((NU8)(s->data[i]) == (NU8)(95))) goto LA78;
						i += 1;
					} LA78: ;
				}
			} LA72: ;
		}
	}
	LA65: ;
	{
		if (!!(hasdigits)) goto LA81;
		result = 0;
		goto BeforeRet;
	}
	LA81: ;
	{
		if (!(((NU8)(s->data[i])) == ((NU8)(101)) || ((NU8)(s->data[i])) == ((NU8)(69)))) goto LA85;
		{
			if (!(ti < 499)) goto LA89;
			t[(ti)- 0] = s->data[i];
			ti += 1;
		}
		LA89: ;
		i += 1;
		{
			if (!(((NU8)(s->data[i])) == ((NU8)(43)) || ((NU8)(s->data[i])) == ((NU8)(45)))) goto LA93;
			{
				if (!(ti < 499)) goto LA97;
				t[(ti)- 0] = s->data[i];
				ti += 1;
			}
			LA97: ;
			i += 1;
		}
		LA93: ;
		{
			if (!!((((NU8)(s->data[i])) >= ((NU8)(48)) && ((NU8)(s->data[i])) <= ((NU8)(57))))) goto LA101;
			result = 0;
			goto BeforeRet;
		}
		LA101: ;
		{
			while (1) {
				if (!(((NU8)(s->data[i])) >= ((NU8)(48)) && ((NU8)(s->data[i])) <= ((NU8)(57)))) goto LA104;
				{
					if (!(ti < 499)) goto LA107;
					t[(ti)- 0] = s->data[i];
					ti += 1;
				}
				LA107: ;
				i += 1;
				{
					while (1) {
						if (!((NU8)(s->data[i]) == (NU8)(95))) goto LA110;
						i += 1;
					} LA110: ;
				}
			} LA104: ;
		}
	}
	LA85: ;
	(*number) = strtod(((NCSTRING) (t)), NIM_NIL);
	result = (NI32)(i - start);
	BeforeRet: ;
	return result;
}

N_NIMCALL(NI64, mulInt64)(NI64 a, NI64 b) {
	NI64 result;
	NF resasfloat;
	NF floatprod;
	result = 0;
	resasfloat = 0;
	floatprod = 0;
	result = (NI64)((NU64)(a) * (NU64)(b));
	floatprod = ((double) (a));
	floatprod = ((NF)(floatprod) * (NF)(((double) (b))));
	resasfloat = ((double) (result));
	{
		if (!(resasfloat == floatprod)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	{
		if (!(((NF)(3.2000000000000000e+01) * (NF)((((NF)(resasfloat) - (NF)(floatprod)) > 0? (((NF)(resasfloat) - (NF)(floatprod))) : -(((NF)(resasfloat) - (NF)(floatprod)))))) <= (floatprod > 0? (floatprod) : -(floatprod)))) goto LA7;
		goto BeforeRet;
	}
	LA7: ;
	raiseOverflow();
	BeforeRet: ;
	return result;
}

N_NIMCALL(NI16*, newwidecstring_79005)(NimStringDesc* s) {
	NI16* result;
	result = 0;
	result = newwidecstring_78824(s->data, s->Sup.len);
	return result;
}

N_NIMCALL(NimStringDesc*, nimInt64ToStr)(NI64 x) {
	NimStringDesc* result;
	NI i;
	NI64 y;
	result = 0;
	result = mnewString(32);
	i = 0;
	y = x;
	{
		while (1) {
			NI64 d;
			d = (NI64)(y / IL64(10));
			result->data[i] = ((NIM_CHAR) (((NI) ((NI32)((((NI) ((NI64)(y - (NI64)(d * IL64(10))))) > 0? (((NI) ((NI64)(y - (NI64)(d * IL64(10)))))) : -(((NI) ((NI64)(y - (NI64)(d * IL64(10))))))) + 48)))));
			i += 1;
			y = d;
			{
				if (!(y == IL64(0))) goto LA5;
				goto LA1;
			}
			LA5: ;
		}
	} LA1: ;
	{
		if (!(x < IL64(0))) goto LA9;
		result->data[i] = 45;
		i += 1;
	}
	LA9: ;
	result = setLengthStr(result, i);
	{
		NI j_76126;
		NI HEX3Atmp_76144;
		NI res_76147;
		j_76126 = 0;
		HEX3Atmp_76144 = 0;
		HEX3Atmp_76144 = (NI32)((NI32)(i / 2) - 1);
		res_76147 = 0;
		{
			while (1) {
				NIM_CHAR LOC14;
				if (!(res_76147 <= HEX3Atmp_76144)) goto LA13;
				j_76126 = res_76147;
				LOC14 = 0;
				LOC14 = result->data[j_76126];
				result->data[j_76126] = result->data[(NI32)((NI32)(i - j_76126) - 1)];
				result->data[(NI32)((NI32)(i - j_76126) - 1)] = LOC14;
				res_76147 += 1;
			} LA13: ;
		}
	}
	return result;
}

N_NIMCALL(NimStringDesc*, nimFloatToStr)(NF f) {
	NimStringDesc* result;
	TY75604 buf;
	NI n;
	int LOC1;
	NIM_BOOL hasdot;
	result = 0;
	memset((void*)buf, 0, sizeof(buf));
	LOC1 = 0;
	LOC1 = sprintf(((NCSTRING) (buf)), "%.16g", f);
	n = ((NI) (LOC1));
	hasdot = NIM_FALSE;
	{
		NI i_75620;
		NI HEX3Atmp_75638;
		NI res_75641;
		i_75620 = 0;
		HEX3Atmp_75638 = 0;
		HEX3Atmp_75638 = (NI32)(n - 1);
		res_75641 = 0;
		{
			while (1) {
				if (!(res_75641 <= HEX3Atmp_75638)) goto LA4;
				i_75620 = res_75641;
				{
					if (!((NU8)(buf[(i_75620)- 0]) == (NU8)(44))) goto LA7;
					buf[(i_75620)- 0] = 46;
					hasdot = NIM_TRUE;
				}
				goto LA5;
				LA7: ;
				{
					if (!(((NU8)(buf[(i_75620)- 0])) >= ((NU8)(97)) && ((NU8)(buf[(i_75620)- 0])) <= ((NU8)(122)) || ((NU8)(buf[(i_75620)- 0])) >= ((NU8)(65)) && ((NU8)(buf[(i_75620)- 0])) <= ((NU8)(90)) || ((NU8)(buf[(i_75620)- 0])) == ((NU8)(46)))) goto LA10;
					hasdot = NIM_TRUE;
				}
				goto LA5;
				LA10: ;
				LA5: ;
				res_75641 += 1;
			} LA4: ;
		}
	}
	{
		if (!!(hasdot)) goto LA14;
		buf[(n)- 0] = 46;
		buf[((NI32)(n + 1))- 0] = 48;
		buf[((NI32)(n + 2))- 0] = 0;
	}
	LA14: ;
	result = cstrToNimstr(((NCSTRING) (buf)));
	return result;
}

N_NIMCALL(void, genericSeqAssign)(void* dest, void* src_81204, TNimType* mt) {
	void* src;
	src = src_81204;
	genericAssign(dest, ((void*) ((&src))), mt);
}

N_NIMCALL(NimStringDesc*, reprEnum)(NI e_82507, TNimType* typ) {
	NimStringDesc* result;
	NI e;
	NimStringDesc* LOC25;
	NimStringDesc* LOC26;
	result = 0;
	{
		if (!((*typ).size == 1)) goto LA3;
		e = ((NI) ((NI)(e_82507 & 255)));
	}
	goto LA1;
	LA3: ;
	{
		if (!((*typ).size == 2)) goto LA6;
		e = ((NI) ((NI)(e_82507 & 65535)));
	}
	goto LA1;
	LA6: ;
	{
		e = e_82507;
	}
	LA1: ;
	{
		if (!!((((*typ).flags &(1<<((((NU8) 2))&7)))!=0))) goto LA11;
		{
			if (!((NU32)(e) < (NU32)((*(*typ).node).len))) goto LA15;
			result = cstrToNimstr((*(*(*typ).node).sons[(e)- 0]).name);
			goto BeforeRet;
		}
		LA15: ;
	}
	goto LA9;
	LA11: ;
	{
		TNimNode* n;
		TNimNode** s;
		n = (*typ).node;
		s = (*n).sons;
		{
			NI i_82549;
			NI HEX3Atmp_82551;
			NI res_82554;
			i_82549 = 0;
			HEX3Atmp_82551 = 0;
			HEX3Atmp_82551 = (NI32)((*n).len - 1);
			res_82554 = 0;
			{
				while (1) {
					if (!(res_82554 <= HEX3Atmp_82551)) goto LA20;
					i_82549 = res_82554;
					{
						if (!((*s[(i_82549)- 0]).offset == e)) goto LA23;
						result = cstrToNimstr((*s[(i_82549)- 0]).name);
						goto BeforeRet;
					}
					LA23: ;
					res_82554 += 1;
				} LA20: ;
			}
		}
	}
	LA9: ;
	LOC25 = 0;
	LOC26 = 0;
	LOC26 = nimIntToStr(e);
	LOC25 = rawNewString(LOC26->Sup.len + 16);
appendString(LOC25, LOC26);
appendString(LOC25, ((NimStringDesc*) &TMP1247));
	result = LOC25;
	BeforeRet: ;
	return result;
}

static N_INLINE(void*, seqtoptr_612248)(TY226936* x_612254) {
	void* result;
	result = 0;
	result = ((void*) (x_612254));
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_612232)(TY226936* x_612238, TY226936* y_612243) {
	NIM_BOOL result;
	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_612248(x_612238);
		LOC4 = 0;
		LOC4 = seqtoptr_612248(y_612243);
		if (!(LOC3 == LOC4)) goto LA5;
		result = NIM_TRUE;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC8;
		void* LOC9;
		void* LOC11;
		LOC8 = 0;
		LOC9 = 0;
		LOC9 = seqtoptr_612248(x_612238);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_612248(y_612243);
		LOC8 = (LOC11 == NIM_NIL);
		LA10: ;
		if (!LOC8) goto LA12;
		result = NIM_FALSE;
	}
	goto LA1;
	LA12: ;
	{
		if (!(x_612238->Sup.len == y_612243->Sup.len)) goto LA15;
		{
			NI i_612337;
			NI HEX3Atmp_612339;
			NI res_612342;
			i_612337 = 0;
			HEX3Atmp_612339 = 0;
			HEX3Atmp_612339 = (NI32)(x_612238->Sup.len - 1);
			res_612342 = 0;
			{
				while (1) {
					if (!(res_612342 <= HEX3Atmp_612339)) goto LA19;
					i_612337 = res_612342;
					{
						if (!!((x_612238->data[i_612337] == y_612243->data[i_612337]))) goto LA22;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA22: ;
					res_612342 += 1;
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, safeadd_612216)(TY226936** x_612224, NI32 y_612228) {
	{
		NIM_BOOL LOC3;
		TY612372 LOC6;
		LOC3 = 0;
		LOC3 = HEX3DHEX3D_612232((*x_612224), NIM_NIL);
		if (!LOC3) goto LA4;
		unsureAsgnRef((void**) (&(*x_612224)), (TY226936*) newSeq((&NTI226936), 1));
		LOC6[0] = y_612228;
		(*x_612224)->data[0] = LOC6[0];
	}
	goto LA1;
	LA4: ;
	{
		(*x_612224) = (TY226936*) incrSeq(&((*x_612224))->Sup, sizeof(NI32));
		(*x_612224)->data[(*x_612224)->Sup.len-1] = y_612228;
	}
	LA1: ;
}

N_NIMCALL(NI, cmp_4517)(NimStringDesc* x, NimStringDesc* y) {
	NI result;
	int LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = strcmp(x->data, y->data);
	result = ((NI) (LOC1));
	return result;
}

N_NIMCALL(NI, hashString)(NimStringDesc* s) {
	NI result;
	NI h;
	result = 0;
	h = 0;
	{
		NI i_74823;
		NI HEX3Atmp_74870;
		NI res_74873;
		i_74823 = 0;
		HEX3Atmp_74870 = 0;
		HEX3Atmp_74870 = (NI32)(s->Sup.len - 1);
		res_74873 = 0;
		{
			while (1) {
				if (!(res_74873 <= HEX3Atmp_74870)) goto LA3;
				i_74823 = res_74873;
				h = (NI)((NU32)(h) + (NU32)(((NI) (((NU8)(s->data[i_74823]))))));
				h = (NI)((NU32)(h) + (NU32)((NI)((NU32)(h) << (NU32)(10))));
				h = (NI)(h ^ (NI)((NU32)(h) >> (NU32)(6)));
				res_74873 += 1;
			} LA3: ;
		}
	}
	h = (NI)((NU32)(h) + (NU32)((NI)((NU32)(h) << (NU32)(3))));
	h = (NI)(h ^ (NI)((NU32)(h) >> (NU32)(11)));
	h = (NI)((NU32)(h) + (NU32)((NI)((NU32)(h) << (NU32)(15))));
	result = h;
	return result;
}

N_NIMCALL(void, write_12881)(FILE* f, NimStringDesc** a, NI aLen0) {
	{
		NimStringDesc* x_77283;
		NI i_77289;
		x_77283 = 0;
		i_77289 = 0;
		{
			while (1) {
				if (!(i_77289 < aLen0)) goto LA3;
				x_77283 = a[i_77289];
				write_12865(f, x_77283);
				i_77289 += 1;
			} LA3: ;
		}
	}
}

N_NIMCALL(void, gcdisablemarkandsweep_8019)(void) {
	gch_46844.Cyclethreshold = 2147483646;
}

N_NIMCALL(void, insert_87401)(NimStringDesc** x, NimStringDesc* item, NI i) {
	NI xl;
	NI j;
	xl = (*x)->Sup.len;
	(*x) = setLengthStr((*x), (NI32)(xl + item->Sup.len));
	j = (NI32)(xl - 1);
	{
		while (1) {
			if (!(i <= j)) goto LA2;
			(*x)->data[(NI32)(j + item->Sup.len)] = (*x)->data[j];
			j -= 1;
		} LA2: ;
	}
	j = 0;
	{
		while (1) {
			if (!(j < item->Sup.len)) goto LA4;
			(*x)->data[(NI32)(j + i)] = item->data[j];
			j += 1;
		} LA4: ;
	}
}
N_NIMCALL(void, TMP2178)(void* p, NI op) {
	assertionerror3247* a;
	a = (assertionerror3247*)p;
	nimGCvisit((void*)(*a).Sup.parent, op);
	nimGCvisit((void*)(*a).Sup.message, op);
	nimGCvisit((void*)(*a).Sup.trace, op);
}

N_NOINLINE(void, raiseassert_86357)(NimStringDesc* msg) {
	assertionerror3247* e_86362;
	NimStringDesc* LOC1;
	e_86362 = 0;
	e_86362 = (assertionerror3247*) newObj((&NTI86401), sizeof(assertionerror3247));
	(*e_86362).Sup.Sup.m_type = (&NTI3247);
	LOC1 = 0;
	LOC1 = (*e_86362).Sup.message; (*e_86362).Sup.message = copyStringRC1(msg);
	if (LOC1) nimGCunrefNoCycle(LOC1);
	raiseException((Exception*)e_86362, "AssertionError");
}

static N_INLINE(void, pushSafePoint)(TSafePoint* s) {
	(*s).hasRaiseAction = NIM_FALSE;
	(*s).prev = exchandler_16243;
	exchandler_16243 = s;
}

N_NIMCALL(NI, rawfilesize_77319)(FILE* file) {
	NI result;
	NI oldpos;
	NI LOC1;
	NI LOC2;
	result = 0;
	oldpos = ftell(file);
	LOC1 = 0;
	LOC1 = fseek(file, ((long) 0), 2);
	result = ftell(file);
	LOC2 = 0;
	LOC2 = fseek(file, ((long) (oldpos)), 0);
	return result;
}

N_NIMCALL(NimStringDesc*, readallfile_77328)(FILE* file, NI len) {
	NimStringDesc* result;
	result = 0;
	result = mnewString(len);
	{
		NI LOC3;
		LOC3 = 0;
		LOC3 = readbuffer_13027(file, ((void*) ((&result->data[0]))), len);
		if (!!((LOC3 == len))) goto LA4;
		raiseeio_76605(((NimStringDesc*) &TMP2622));
	}
	LA4: ;
	return result;
}

N_NIMCALL(NimStringDesc*, readallfile_77339)(FILE* file) {
	NimStringDesc* result;
	NI len;
	result = 0;
	len = rawfilesize_77319(file);
	result = readallfile_77328(file, len);
	return result;
}

static N_INLINE(void, popSafePoint)(void) {
	exchandler_16243 = (*exchandler_16243).prev;
}

N_NIMCALL(NimStringDesc*, readfile_12842)(NimStringDesc* filename) {
	NimStringDesc* volatile result;
	FILE* f;
	TSafePoint TMP2621;
	result = 0;
	f = open_12617(filename, ((NU8) 0), -1);
	pushSafePoint(&TMP2621);
	TMP2621.status = setjmp(TMP2621.context);
	if (TMP2621.status == 0) {
		result = readallfile_77339(f);
		popSafePoint();
	}
	else {
		popSafePoint();
	}
	{
		fclose(f);
	}
	if (TMP2621.status != 0) reraiseException();
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_152641)(TY269081 x_152645, TY269081 y_152647) {
	NIM_BOOL result;
	result = 0;
	{
		if (!!((x_152645.Field0 == y_152647.Field0))) goto LA3;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA3: ;
	{
		if (!!((x_152645.Field1 == y_152647.Field1))) goto LA7;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA7: ;
	result = NIM_TRUE;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

static N_INLINE(void*, seqtoptr_274513)(ttypeseq226848* x_274519) {
	void* result;
	result = 0;
	result = ((void*) (x_274519));
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_274497)(ttypeseq226848* x_274503, ttypeseq226848* y_274508) {
	NIM_BOOL result;
	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_274513(x_274503);
		LOC4 = 0;
		LOC4 = seqtoptr_274513(y_274508);
		if (!(LOC3 == LOC4)) goto LA5;
		result = NIM_TRUE;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC8;
		void* LOC9;
		void* LOC11;
		LOC8 = 0;
		LOC9 = 0;
		LOC9 = seqtoptr_274513(x_274503);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_274513(y_274508);
		LOC8 = (LOC11 == NIM_NIL);
		LA10: ;
		if (!LOC8) goto LA12;
		result = NIM_FALSE;
	}
	goto LA1;
	LA12: ;
	{
		if (!(x_274503->Sup.len == y_274508->Sup.len)) goto LA15;
		{
			NI i_274602;
			NI HEX3Atmp_274620;
			NI res_274623;
			i_274602 = 0;
			HEX3Atmp_274620 = 0;
			HEX3Atmp_274620 = (NI32)(x_274503->Sup.len - 1);
			res_274623 = 0;
			{
				while (1) {
					if (!(res_274623 <= HEX3Atmp_274620)) goto LA19;
					i_274602 = res_274623;
					{
						if (!!((x_274503->data[i_274602] == y_274508->data[i_274602]))) goto LA22;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA22: ;
					res_274623 += 1;
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, safeadd_318709)(ttypeseq226848** x_318717, ttype226852* y_318721) {
	{
		NIM_BOOL LOC3;
		TY412748 LOC6;
		LOC3 = 0;
		LOC3 = HEX3DHEX3D_274497((*x_318717), NIM_NIL);
		if (!LOC3) goto LA4;
		unsureAsgnRef((void**) (&(*x_318717)), (ttypeseq226848*) newSeq((&NTI226848), 1));
		memset((void*)LOC6, 0, sizeof(LOC6));
		LOC6[0] = y_318721;
		asgnRefNoCycle((void**) (&(*x_318717)->data[0]), LOC6[0]);
	}
	goto LA1;
	LA4: ;
	{
		(*x_318717) = (ttypeseq226848*) incrSeq(&((*x_318717))->Sup, sizeof(ttype226852*));
		asgnRefNoCycle((void**) (&(*x_318717)->data[(*x_318717)->Sup.len-1]), y_318721);
	}
	LA1: ;
}

static N_INLINE(void*, seqtoptr_419648)(TY419481* x_419654) {
	void* result;
	result = 0;
	result = ((void*) (x_419654));
	return result;
}

static N_INLINE(void*, seqtoptr_419774)(TY419485* x_419780) {
	void* result;
	result = 0;
	result = ((void*) (x_419780));
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_419865)(tentry419478 x_419869, tentry419478 y_419871) {
	NIM_BOOL result;
	result = 0;
	{
		if (!!((x_419869.Pos == y_419871.Pos))) goto LA3;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA3: ;
	{
		if (!!((x_419869.Sym == y_419871.Sym))) goto LA7;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA7: ;
	result = NIM_TRUE;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_419758)(TY419485* x_419764, TY419485* y_419769) {
	NIM_BOOL result;
	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_419774(x_419764);
		LOC4 = 0;
		LOC4 = seqtoptr_419774(y_419769);
		if (!(LOC3 == LOC4)) goto LA5;
		result = NIM_TRUE;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC8;
		void* LOC9;
		void* LOC11;
		LOC8 = 0;
		LOC9 = 0;
		LOC9 = seqtoptr_419774(x_419764);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_419774(y_419769);
		LOC8 = (LOC11 == NIM_NIL);
		LA10: ;
		if (!LOC8) goto LA12;
		result = NIM_FALSE;
	}
	goto LA1;
	LA12: ;
	{
		if (!(x_419764->Sup.len == y_419769->Sup.len)) goto LA15;
		{
			NI i_419863;
			NI HEX3Atmp_419902;
			NI res_419905;
			i_419863 = 0;
			HEX3Atmp_419902 = 0;
			HEX3Atmp_419902 = (NI32)(x_419764->Sup.len - 1);
			res_419905 = 0;
			{
				while (1) {
					if (!(res_419905 <= HEX3Atmp_419902)) goto LA19;
					i_419863 = res_419905;
					{
						NIM_BOOL LOC22;
						LOC22 = 0;
						LOC22 = HEX3DHEX3D_419865(x_419764->data[i_419863], y_419769->data[i_419863]);
						if (!!(LOC22)) goto LA23;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA23: ;
					res_419905 += 1;
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_419739)(tlinemap419480 x_419743, tlinemap419480 y_419745) {
	NIM_BOOL result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = HEX3DHEX3D_419758(x_419743.Entries, y_419745.Entries);
		if (!!(LOC3)) goto LA4;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA4: ;
	result = NIM_TRUE;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_419632)(TY419481* x_419638, TY419481* y_419643) {
	NIM_BOOL result;
	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_419648(x_419638);
		LOC4 = 0;
		LOC4 = seqtoptr_419648(y_419643);
		if (!(LOC3 == LOC4)) goto LA5;
		result = NIM_TRUE;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC8;
		void* LOC9;
		void* LOC11;
		LOC8 = 0;
		LOC9 = 0;
		LOC9 = seqtoptr_419648(x_419638);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_419648(y_419643);
		LOC8 = (LOC11 == NIM_NIL);
		LA10: ;
		if (!LOC8) goto LA12;
		result = NIM_FALSE;
	}
	goto LA1;
	LA12: ;
	{
		if (!(x_419638->Sup.len == y_419643->Sup.len)) goto LA15;
		{
			NI i_419737;
			NI HEX3Atmp_419923;
			NI res_419926;
			i_419737 = 0;
			HEX3Atmp_419923 = 0;
			HEX3Atmp_419923 = (NI32)(x_419638->Sup.len - 1);
			res_419926 = 0;
			{
				while (1) {
					if (!(res_419926 <= HEX3Atmp_419923)) goto LA19;
					i_419737 = res_419926;
					{
						NIM_BOOL LOC22;
						LOC22 = 0;
						LOC22 = HEX3DHEX3D_419739(x_419638->data[i_419737], y_419643->data[i_419737]);
						if (!!(LOC22)) goto LA23;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA23: ;
					res_419926 += 1;
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, endoffile_12830)(FILE* f) {
	NIM_BOOL result;
	int c;
	result = 0;
	c = fgetc(f);
	ungetc(c, f);
	result = (c < ((NI32) 0));
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, setfilepos_13051)(FILE* f, NI64 pos) {
	{
		NI LOC3;
		LOC3 = 0;
		LOC3 = fseek(f, ((long) (pos)), 0);
		if (!!((LOC3 == 0))) goto LA4;
		raiseeio_76605(((NimStringDesc*) &TMP2716));
	}
	LA4: ;
}

N_NIMCALL(NI64, getfilepos_13055)(FILE* f) {
	NI64 result;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = ftell(f);
	result = ((NI64) (LOC1));
	{
		if (!(result < IL64(0))) goto LA4;
		raiseeio_76605(((NimStringDesc*) &TMP2717));
	}
	LA4: ;
	return result;
}

N_NIMCALL(void, writefile_12845)(NimStringDesc* filename, NimStringDesc* content) {
	FILE* f;
	TSafePoint TMP2787;
	f = open_12617(filename, ((NU8) 1), -1);
	pushSafePoint(&TMP2787);
	TMP2787.status = setjmp(TMP2787.context);
	if (TMP2787.status == 0) {
		write_12865(f, content);
		popSafePoint();
	}
	else {
		popSafePoint();
	}
	{
		fclose(f);
	}
	if (TMP2787.status != 0) reraiseException();
}

N_NIMCALL(void, genericShallowAssign)(void* dest, void* src, TNimType* mt) {
	genericassignaux_80206(dest, src, mt, NIM_TRUE);
}

N_NIMCALL(NimStringDesc*, HEX24_6201)(NU64 x) {
	NimStringDesc* result;
	TY82435 buf;
	int LOC1;
	result = 0;
	memset((void*)buf, 0, sizeof(buf));
	LOC1 = 0;
	LOC1 = sprintf(((NCSTRING) (buf)), "%llu", x);
	result = cstrToNimstr(((NCSTRING) (buf)));
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(tinstantiation226836*, new_491941)(void) {
	tinstantiation226836* result;
	result = 0;
	result = (tinstantiation226836*) newObj((&NTI226838), sizeof(tinstantiation226836));
	return result;
}

static N_INLINE(void*, seqtoptr_230354)(TY226947* x_230360) {
	void* result;
	result = 0;
	result = ((void*) (x_230360));
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_230338)(TY226947* x_230344, TY226947* y_230349) {
	NIM_BOOL result;
	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_230354(x_230344);
		LOC4 = 0;
		LOC4 = seqtoptr_230354(y_230349);
		if (!(LOC3 == LOC4)) goto LA5;
		result = NIM_TRUE;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC8;
		void* LOC9;
		void* LOC11;
		LOC8 = 0;
		LOC9 = 0;
		LOC9 = seqtoptr_230354(x_230344);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_230354(y_230349);
		LOC8 = (LOC11 == NIM_NIL);
		LA10: ;
		if (!LOC8) goto LA12;
		result = NIM_FALSE;
	}
	goto LA1;
	LA12: ;
	{
		if (!(x_230344->Sup.len == y_230349->Sup.len)) goto LA15;
		{
			NI i_230443;
			NI HEX3Atmp_230461;
			NI res_230464;
			i_230443 = 0;
			HEX3Atmp_230461 = 0;
			HEX3Atmp_230461 = (NI32)(x_230344->Sup.len - 1);
			res_230464 = 0;
			{
				while (1) {
					if (!(res_230464 <= HEX3Atmp_230461)) goto LA19;
					i_230443 = res_230464;
					{
						if (!!((x_230344->data[i_230443] == y_230349->data[i_230443]))) goto LA22;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA22: ;
					res_230464 += 1;
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, safeadd_492032)(TY226947** x_492040, tinstantiation226836* y_492044) {
	{
		NIM_BOOL LOC3;
		TY492078 LOC6;
		LOC3 = 0;
		LOC3 = HEX3DHEX3D_230338((*x_492040), NIM_NIL);
		if (!LOC3) goto LA4;
		unsureAsgnRef((void**) (&(*x_492040)), (TY226947*) newSeq((&NTI226947), 1));
		memset((void*)LOC6, 0, sizeof(LOC6));
		LOC6[0] = y_492044;
		asgnRefNoCycle((void**) (&(*x_492040)->data[0]), LOC6[0]);
	}
	goto LA1;
	LA4: ;
	{
		(*x_492040) = (TY226947*) incrSeq(&((*x_492040))->Sup, sizeof(tinstantiation226836*));
		asgnRefNoCycle((void**) (&(*x_492040)->data[(*x_492040)->Sup.len-1]), y_492044);
	}
	LA1: ;
}

static N_INLINE(void*, seqtoptr_316683)(tnodeseq226810* x_316689) {
	void* result;
	result = 0;
	result = ((void*) (x_316689));
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_316667)(tnodeseq226810* x_316673, tnodeseq226810* y_316678) {
	NIM_BOOL result;
	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_316683(x_316673);
		LOC4 = 0;
		LOC4 = seqtoptr_316683(y_316678);
		if (!(LOC3 == LOC4)) goto LA5;
		result = NIM_TRUE;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC8;
		void* LOC9;
		void* LOC11;
		LOC8 = 0;
		LOC9 = 0;
		LOC9 = seqtoptr_316683(x_316673);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_316683(y_316678);
		LOC8 = (LOC11 == NIM_NIL);
		LA10: ;
		if (!LOC8) goto LA12;
		result = NIM_FALSE;
	}
	goto LA1;
	LA12: ;
	{
		if (!(x_316673->Sup.len == y_316678->Sup.len)) goto LA15;
		{
			NI i_316772;
			NI HEX3Atmp_316790;
			NI res_316793;
			i_316772 = 0;
			HEX3Atmp_316790 = 0;
			HEX3Atmp_316790 = (NI32)(x_316673->Sup.len - 1);
			res_316793 = 0;
			{
				while (1) {
					if (!(res_316793 <= HEX3Atmp_316790)) goto LA19;
					i_316772 = res_316793;
					{
						if (!!((x_316673->data[i_316772] == y_316678->data[i_316772]))) goto LA22;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA22: ;
					res_316793 += 1;
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, safeadd_492915)(tnodeseq226810** x_492923, tnode226816* y_492927) {
	{
		NIM_BOOL LOC3;
		TY247892 LOC6;
		LOC3 = 0;
		LOC3 = HEX3DHEX3D_316667((*x_492923), NIM_NIL);
		if (!LOC3) goto LA4;
		unsureAsgnRef((void**) (&(*x_492923)), (tnodeseq226810*) newSeq((&NTI226810), 1));
		memset((void*)LOC6, 0, sizeof(LOC6));
		LOC6[0] = y_492927;
		asgnRefNoCycle((void**) (&(*x_492923)->data[0]), LOC6[0]);
	}
	goto LA1;
	LA4: ;
	{
		(*x_492923) = (tnodeseq226810*) incrSeq(&((*x_492923))->Sup, sizeof(tnode226816*));
		asgnRefNoCycle((void**) (&(*x_492923)->data[(*x_492923)->Sup.len-1]), y_492927);
	}
	LA1: ;
}

N_NIMCALL(void, insert_493119)(tnodeseq226810** x_493127, tnode226816* item_493131, NI i_493133) {
	NI xl;
	NI j;
	xl = (*x_493127)->Sup.len;
	(*x_493127) = (tnodeseq226810*) setLengthSeq(&((*x_493127))->Sup, sizeof(tnode226816*), (NI32)(xl + 1));
	j = (NI32)(xl - 1);
	{
		while (1) {
			if (!(i_493133 <= j)) goto LA2;
			asgnRefNoCycle((void**) (&(*x_493127)->data[(NI32)(j + 1)]), (*x_493127)->data[j]);
			j -= 1;
		} LA2: ;
	}
	asgnRefNoCycle((void**) (&(*x_493127)->data[i_493133]), item_493131);
}

N_NIMCALL(tnodeseq226810*, HEX5BHEX5D_517155)(tnodeseq226810* s_517161, slice85779 x_517166) {
	tnodeseq226810* result;
	NI a;
	NI l;
	NI LOC6;
	result = 0;
	{
		if (!(0 <= x_517166.A)) goto LA3;
		a = x_517166.A;
	}
	goto LA1;
	LA3: ;
	{
		a = (NI32)(s_517161->Sup.len + x_517166.A);
	}
	LA1: ;
	LOC6 = 0;
	{
		if (!(0 <= x_517166.B)) goto LA9;
		LOC6 = x_517166.B;
	}
	goto LA7;
	LA9: ;
	{
		LOC6 = (NI32)(s_517161->Sup.len + x_517166.B);
	}
	LA7: ;
	l = (NI32)((NI32)(LOC6 - a) + 1);
	result = (tnodeseq226810*) newSeq((&NTI226810), l);
	{
		NI i_517231;
		NI HEX3Atmp_517233;
		NI res_517236;
		i_517231 = 0;
		HEX3Atmp_517233 = 0;
		HEX3Atmp_517233 = (l - 1);
		res_517236 = 0;
		{
			while (1) {
				if (!(res_517236 <= HEX3Atmp_517233)) goto LA14;
				i_517231 = res_517236;
				asgnRefNoCycle((void**) (&result->data[i_517231]), s_517161->data[(NI32)(i_517231 + a)]);
				res_517236 += 1;
			} LA14: ;
		}
	}
	return result;
}

static N_INLINE(void*, seqtoptr_492417)(tsymseq226818* x_492423) {
	void* result;
	result = 0;
	result = ((void*) (x_492423));
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_492401)(tsymseq226818* x_492407, tsymseq226818* y_492412) {
	NIM_BOOL result;
	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_492417(x_492407);
		LOC4 = 0;
		LOC4 = seqtoptr_492417(y_492412);
		if (!(LOC3 == LOC4)) goto LA5;
		result = NIM_TRUE;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC8;
		void* LOC9;
		void* LOC11;
		LOC8 = 0;
		LOC9 = 0;
		LOC9 = seqtoptr_492417(x_492407);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_492417(y_492412);
		LOC8 = (LOC11 == NIM_NIL);
		LA10: ;
		if (!LOC8) goto LA12;
		result = NIM_FALSE;
	}
	goto LA1;
	LA12: ;
	{
		if (!(x_492407->Sup.len == y_492412->Sup.len)) goto LA15;
		{
			NI i_492506;
			NI HEX3Atmp_492524;
			NI res_492527;
			i_492506 = 0;
			HEX3Atmp_492524 = 0;
			HEX3Atmp_492524 = (NI32)(x_492407->Sup.len - 1);
			res_492527 = 0;
			{
				while (1) {
					if (!(res_492527 <= HEX3Atmp_492524)) goto LA19;
					i_492506 = res_492527;
					{
						if (!!((x_492407->data[i_492506] == y_492412->data[i_492506]))) goto LA22;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA22: ;
					res_492527 += 1;
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, safeadd_492544)(tsymseq226818** x_492552, tsym226846* y_492556) {
	{
		NIM_BOOL LOC3;
		TY291499 LOC6;
		LOC3 = 0;
		LOC3 = HEX3DHEX3D_492401((*x_492552), NIM_NIL);
		if (!LOC3) goto LA4;
		unsureAsgnRef((void**) (&(*x_492552)), (tsymseq226818*) newSeq((&NTI226818), 1));
		memset((void*)LOC6, 0, sizeof(LOC6));
		LOC6[0] = y_492556;
		asgnRefNoCycle((void**) (&(*x_492552)->data[0]), LOC6[0]);
	}
	goto LA1;
	LA4: ;
	{
		(*x_492552) = (tsymseq226818*) incrSeq(&((*x_492552))->Sup, sizeof(tsym226846*));
		asgnRefNoCycle((void**) (&(*x_492552)->data[(*x_492552)->Sup.len-1]), y_492556);
	}
	LA1: ;
}

N_NIMCALL(void, delete_493248)(tnodeseq226810** x_493256, NI i_493260) {
	NI xl;
	xl = (*x_493256)->Sup.len;
	{
		NI j_493283;
		NI HEX3Atmp_493301;
		NI res_493304;
		j_493283 = 0;
		HEX3Atmp_493301 = 0;
		HEX3Atmp_493301 = (NI32)(xl - 2);
		res_493304 = i_493260;
		{
			while (1) {
				if (!(res_493304 <= HEX3Atmp_493301)) goto LA3;
				j_493283 = res_493304;
				asgnRefNoCycle((void**) (&(*x_493256)->data[j_493283]), (*x_493256)->data[(NI32)(j_493283 + 1)]);
				res_493304 += 1;
			} LA3: ;
		}
	}
	(*x_493256) = (tnodeseq226810*) setLengthSeq(&((*x_493256))->Sup, sizeof(tnode226816*), (NI32)(xl - 1));
}

N_NIMCALL(void, HEX5BHEX5DHEX3D_493447)(tnodeseq226810** s_493455, slice85779 x_493461, tnode226816** b_493466, NI b_493466Len0) {
	NI a;
	NI l;
	NI LOC6;
	{
		if (!(0 <= x_493461.A)) goto LA3;
		a = x_493461.A;
	}
	goto LA1;
	LA3: ;
	{
		a = (NI32)((*s_493455)->Sup.len + x_493461.A);
	}
	LA1: ;
	LOC6 = 0;
	{
		if (!(0 <= x_493461.B)) goto LA9;
		LOC6 = x_493461.B;
	}
	goto LA7;
	LA9: ;
	{
		LOC6 = (NI32)((*s_493455)->Sup.len + x_493461.B);
	}
	LA7: ;
	l = (NI32)((NI32)(LOC6 - a) + 1);
	{
		if (!(l == b_493466Len0)) goto LA14;
		{
			NI i_493532;
			NI HEX3Atmp_493654;
			NI res_493657;
			i_493532 = 0;
			HEX3Atmp_493654 = 0;
			HEX3Atmp_493654 = (l - 1);
			res_493657 = 0;
			{
				while (1) {
					if (!(res_493657 <= HEX3Atmp_493654)) goto LA18;
					i_493532 = res_493657;
					asgnRefNoCycle((void**) (&(*s_493455)->data[(NI32)(i_493532 + a)]), b_493466[i_493532]);
					res_493657 += 1;
				} LA18: ;
			}
		}
	}
	goto LA12;
	LA14: ;
	{
		NI slen_493469;
		NI shift_493471;
		NI newlen_493473;
		slen_493469 = (*s_493455)->Sup.len;
		shift_493471 = (NI32)(b_493466Len0 - l);
		newlen_493473 = (NI32)(slen_493469 + shift_493471);
		{
			if (!(0 < shift_493471)) goto LA22;
			(*s_493455) = (tnodeseq226810*) setLengthSeq(&((*s_493455))->Sup, sizeof(tnode226816*), newlen_493473);
			{
				NI i_493475;
				NI HEX3Atmp_493660;
				NI HEX3Atmp_493661;
				NI res_493664;
				i_493475 = 0;
				HEX3Atmp_493660 = 0;
				HEX3Atmp_493661 = 0;
				HEX3Atmp_493660 = (NI32)(newlen_493473 - 1);
				HEX3Atmp_493661 = (NI32)((NI32)(a + shift_493471) + 1);
				res_493664 = HEX3Atmp_493660;
				{
					while (1) {
						if (!(HEX3Atmp_493661 <= res_493664)) goto LA26;
						i_493475 = res_493664;
						asgnRefNoCycle((void**) (&(*s_493455)->data[i_493475]), (*s_493455)->data[(NI32)(i_493475 - shift_493471)]);
						res_493664 -= 1;
					} LA26: ;
				}
			}
		}
		goto LA20;
		LA22: ;
		{
			{
				NI i_493477;
				NI HEX3Atmp_493666;
				NI HEX3Atmp_493667;
				NI res_493670;
				i_493477 = 0;
				HEX3Atmp_493666 = 0;
				HEX3Atmp_493667 = 0;
				HEX3Atmp_493666 = (NI32)(a + b_493466Len0);
				HEX3Atmp_493667 = (NI32)((NI32)((*s_493455)->Sup.len - 1) + shift_493471);
				res_493670 = HEX3Atmp_493666;
				{
					while (1) {
						if (!(res_493670 <= HEX3Atmp_493667)) goto LA30;
						i_493477 = res_493670;
						asgnRefNoCycle((void**) (&(*s_493455)->data[i_493477]), (*s_493455)->data[(NI32)(i_493477 - shift_493471)]);
						res_493670 += 1;
					} LA30: ;
				}
			}
			(*s_493455) = (tnodeseq226810*) setLengthSeq(&((*s_493455))->Sup, sizeof(tnode226816*), newlen_493473);
		}
		LA20: ;
		{
			NI i_493479;
			NI HEX3Atmp_493673;
			NI res_493676;
			i_493479 = 0;
			HEX3Atmp_493673 = 0;
			HEX3Atmp_493673 = (b_493466Len0 - 1);
			res_493676 = 0;
			{
				while (1) {
					if (!(res_493676 <= HEX3Atmp_493673)) goto LA33;
					i_493479 = res_493676;
					asgnRefNoCycle((void**) (&(*s_493455)->data[(NI32)(i_493479 + a)]), b_493466[i_493479]);
					res_493676 += 1;
				} LA33: ;
			}
		}
	}
	LA12: ;
}

N_NIMCALL(tnodeseq226810*, newseq_540811)(NI len_540815) {
	tnodeseq226810* result;
	result = 0;
	result = (tnodeseq226810*) newSeq((&NTI226810), len_540815);
	return result;
}

N_NIMCALL(void, gcfullcollect_8005)(void) {
	NI oldthreshold;
	oldthreshold = gch_46844.Cyclethreshold;
	gch_46844.Cyclethreshold = 0;
	collectct_48810((&gch_46844));
	gch_46844.Cyclethreshold = oldthreshold;
}

static N_INLINE(void*, seqtoptr_338098)(TY337062* x_338104) {
	void* result;
	result = 0;
	result = ((void*) (x_338104));
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_338082)(TY337062* x_338088, TY337062* y_338093) {
	NIM_BOOL result;
	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_338098(x_338088);
		LOC4 = 0;
		LOC4 = seqtoptr_338098(y_338093);
		if (!(LOC3 == LOC4)) goto LA5;
		result = NIM_TRUE;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC8;
		void* LOC9;
		void* LOC11;
		LOC8 = 0;
		LOC9 = 0;
		LOC9 = seqtoptr_338098(x_338088);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_338098(y_338093);
		LOC8 = (LOC11 == NIM_NIL);
		LA10: ;
		if (!LOC8) goto LA12;
		result = NIM_FALSE;
	}
	goto LA1;
	LA12: ;
	{
		if (!(x_338088->Sup.len == y_338093->Sup.len)) goto LA15;
		{
			NI i_338187;
			NI HEX3Atmp_338190;
			NI res_338193;
			i_338187 = 0;
			HEX3Atmp_338190 = 0;
			HEX3Atmp_338190 = (NI32)(x_338088->Sup.len - 1);
			res_338193 = 0;
			{
				while (1) {
					if (!(res_338193 <= HEX3Atmp_338190)) goto LA19;
					i_338187 = res_338193;
					{
						NIM_BOOL LOC22;
						LOC22 = 0;
						LOC22 = HEX3DHEX3D_337893(x_338088->data[i_338187], y_338093->data[i_338187]);
						if (!!(LOC22)) goto LA23;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA23: ;
					res_338193 += 1;
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	BeforeRet: ;
	return result;
}

static N_INLINE(void*, seqtoptr_338253)(TY337057* x_338259) {
	void* result;
	result = 0;
	result = ((void*) (x_338259));
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_338344)(TY337611 x_338348, TY337611 y_338350) {
	NIM_BOOL result;
	result = 0;
	{
		if (!!(eqStrings(x_338348.Field0, y_338350.Field0))) goto LA3;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA3: ;
	{
		NIM_BOOL LOC7;
		LOC7 = 0;
		LOC7 = HEX3DHEX3D_337893(x_338348.Field1, y_338350.Field1);
		if (!!(LOC7)) goto LA8;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA8: ;
	result = NIM_TRUE;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_338237)(TY337057* x_338243, TY337057* y_338248) {
	NIM_BOOL result;
	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_338253(x_338243);
		LOC4 = 0;
		LOC4 = seqtoptr_338253(y_338248);
		if (!(LOC3 == LOC4)) goto LA5;
		result = NIM_TRUE;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC8;
		void* LOC9;
		void* LOC11;
		LOC8 = 0;
		LOC9 = 0;
		LOC9 = seqtoptr_338253(x_338243);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_338253(y_338248);
		LOC8 = (LOC11 == NIM_NIL);
		LA10: ;
		if (!LOC8) goto LA12;
		result = NIM_FALSE;
	}
	goto LA1;
	LA12: ;
	{
		if (!(x_338243->Sup.len == y_338248->Sup.len)) goto LA15;
		{
			NI i_338342;
			NI HEX3Atmp_338366;
			NI res_338369;
			i_338342 = 0;
			HEX3Atmp_338366 = 0;
			HEX3Atmp_338366 = (NI32)(x_338243->Sup.len - 1);
			res_338369 = 0;
			{
				while (1) {
					if (!(res_338369 <= HEX3Atmp_338366)) goto LA19;
					i_338342 = res_338369;
					{
						NIM_BOOL LOC22;
						LOC22 = 0;
						LOC22 = HEX3DHEX3D_338344(x_338243->data[i_338342], y_338248->data[i_338342]);
						if (!!(LOC22)) goto LA23;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA23: ;
					res_338369 += 1;
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NimStringDesc*, nimBoolToStr)(NIM_BOOL x) {
	NimStringDesc* result;
	result = 0;
	{
		if (!x) goto LA3;
		result = copyString(((NimStringDesc*) &TMP4776));
	}
	goto LA1;
	LA3: ;
	{
		result = copyString(((NimStringDesc*) &TMP4777));
	}
	LA1: ;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_362335)(tindexentry360264 x_362339, tindexentry360264 y_362341) {
	NIM_BOOL result;
	result = 0;
	{
		if (!!(eqStrings(x_362339.Keyword, y_362341.Keyword))) goto LA3;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA3: ;
	{
		if (!!(eqStrings(x_362339.Link, y_362341.Link))) goto LA7;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA7: ;
	{
		if (!!(eqStrings(x_362339.Linktitle, y_362341.Linktitle))) goto LA11;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA11: ;
	{
		if (!!(eqStrings(x_362339.Linkdesc, y_362341.Linkdesc))) goto LA15;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA15: ;
	result = NIM_TRUE;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NI, cmp_420107)(NI x_420111, NI y_420113) {
	NI result;
	result = 0;
	{
		if (!(x_420111 == y_420113)) goto LA3;
		result = 0;
		goto BeforeRet;
	}
	LA3: ;
	{
		if (!(x_420111 < y_420113)) goto LA7;
		result = -1;
		goto BeforeRet;
	}
	LA7: ;
	result = 1;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NimStringDesc*, readline_12886)(FILE* f) {
	NimStringDesc* result;
	result = 0;
	result = rawNewString(80);
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = readline_12889(f, (&result));
		if (!!(LOC3)) goto LA4;
		raiseeio_76605(((NimStringDesc*) &TMP4857));
	}
	LA4: ;
	return result;
}
N_NIMCALL(void, TMP4868)(void* p, NI op) {
	TY192015* a;
	NI LOC1;
	a = (TY192015*)p;
	LOC1 = 0;
	for (LOC1 = 0; LOC1 < a->Sup.len; LOC1++) {
	nimGCvisit((void*)a->data[LOC1], op);
	}
}

static N_INLINE(void, gcdisable_8001)(void) {
	gch_46844.Recgclock += 1;
}

static N_INLINE(void, gcenable_8003)(void) {
	{
		if (!(0 < gch_46844.Recgclock)) goto LA3;
		gch_46844.Recgclock -= 1;
	}
	LA3: ;
}

N_NIMCALL(NimStringDesc*, gcgetstatistics_8021)(void) {
	NimStringDesc* result;
	NimStringDesc* LOC1;
	NI LOC2;
	NimStringDesc* LOC3;
	NI LOC4;
	NimStringDesc* LOC5;
	NimStringDesc* LOC6;
	NimStringDesc* LOC7;
	NimStringDesc* LOC8;
	NimStringDesc* LOC9;
	NimStringDesc* LOC10;
	NimStringDesc* LOC11;
	NimStringDesc* LOC12;
	NimStringDesc* LOC13;
	result = 0;
	gcdisable_8001();
	LOC1 = 0;
	LOC2 = 0;
	LOC2 = gettotalmem_6499();
	LOC3 = 0;
	LOC3 = nimIntToStr(LOC2);
	LOC4 = 0;
	LOC4 = getoccupiedmem_6495();
	LOC5 = 0;
	LOC5 = nimIntToStr(LOC4);
	LOC6 = 0;
	LOC6 = nimIntToStr(gch_46844.Stat.Stackscans);
	LOC7 = 0;
	LOC7 = nimIntToStr(gch_46844.Stat.Maxstackcells);
	LOC8 = 0;
	LOC8 = nimIntToStr(gch_46844.Stat.Cyclecollections);
	LOC9 = 0;
	LOC9 = nimIntToStr(gch_46844.Stat.Maxthreshold);
	LOC10 = 0;
	LOC10 = nimIntToStr(gch_46844.Zct.Cap);
	LOC11 = 0;
	LOC11 = nimIntToStr(gch_46844.Stat.Cycletablesize);
	LOC12 = 0;
	LOC12 = nimIntToStr(gch_46844.Stat.Maxstacksize);
	LOC13 = 0;
	LOC13 = nimInt64ToStr((NI64)(gch_46844.Stat.Maxpause / IL64(1000000)));
	LOC1 = rawNewString(LOC3->Sup.len + LOC5->Sup.len + LOC6->Sup.len + LOC7->Sup.len + LOC8->Sup.len + LOC9->Sup.len + LOC10->Sup.len + LOC11->Sup.len + LOC12->Sup.len + LOC13->Sup.len + 232);
appendString(LOC1, ((NimStringDesc*) &TMP4877));
appendString(LOC1, LOC3);
appendString(LOC1, ((NimStringDesc*) &TMP4878));
appendString(LOC1, LOC5);
appendString(LOC1, ((NimStringDesc*) &TMP4879));
appendString(LOC1, LOC6);
appendString(LOC1, ((NimStringDesc*) &TMP4880));
appendString(LOC1, LOC7);
appendString(LOC1, ((NimStringDesc*) &TMP4881));
appendString(LOC1, LOC8);
appendString(LOC1, ((NimStringDesc*) &TMP4882));
appendString(LOC1, LOC9);
appendString(LOC1, ((NimStringDesc*) &TMP4883));
appendString(LOC1, LOC10);
appendString(LOC1, ((NimStringDesc*) &TMP4884));
appendString(LOC1, LOC11);
appendString(LOC1, ((NimStringDesc*) &TMP4885));
appendString(LOC1, LOC12);
appendString(LOC1, ((NimStringDesc*) &TMP4886));
appendString(LOC1, LOC13);
	result = LOC1;
	gcenable_8003();
	return result;
}
NIM_EXTERNC N_NOINLINE(void, systemInit)(void) {
	NI LOC1;
	NI LOC2;
	strdesc_9804.size = 4;
	strdesc_9804.kind = ((NU8) 28);
	strdesc_9804.flags = 2;
	LOC1 = 0;
	LOC1 = fileno(stdin);
	setmode(LOC1, O_BINARY);
	LOC2 = 0;
	LOC2 = fileno(stdout);
	setmode(LOC2, O_BINARY);
	initallocator_9401();
	initStackBottom();
	initgc_9201();
	registersignalhandler_19808();
}

NIM_EXTERNC N_NOINLINE(void, systemDatInit)(void) {
static TNimNode* TMP49[4];
static TNimNode TMP0[18];
NTI3211.size = sizeof(TNimObject);
NTI3211.kind = 17;
NTI3211.base = 0;
NTI3211.flags = 1;
TMP0[0].len = 0; TMP0[0].kind = 2;
NTI3211.node = &TMP0[0];
NTI108.size = sizeof(NI);
NTI108.kind = 31;
NTI108.base = 0;
NTI108.flags = 3;
NTI149.size = sizeof(NimStringDesc*);
NTI149.kind = 28;
NTI149.base = 0;
NTI149.flags = 2;
NTI3227.size = sizeof(Exception);
NTI3227.kind = 17;
NTI3227.base = (&NTI3211);
TMP49[0] = &TMP0[2];
NTI8222.size = sizeof(Exception*);
NTI8222.kind = 22;
NTI8222.base = (&NTI3227);
NTI8222.marker = TMP50;
TMP0[2].kind = 1;
TMP0[2].offset = offsetof(Exception, parent);
TMP0[2].typ = (&NTI8222);
TMP0[2].name = "parent";
TMP49[1] = &TMP0[3];
NTI151.size = sizeof(NCSTRING);
NTI151.kind = 29;
NTI151.base = 0;
NTI151.flags = 3;
TMP0[3].kind = 1;
TMP0[3].offset = offsetof(Exception, name);
TMP0[3].typ = (&NTI151);
TMP0[3].name = "name";
TMP49[2] = &TMP0[4];
TMP0[4].kind = 1;
TMP0[4].offset = offsetof(Exception, message);
TMP0[4].typ = (&NTI149);
TMP0[4].name = "msg";
TMP49[3] = &TMP0[5];
TMP0[5].kind = 1;
TMP0[5].offset = offsetof(Exception, trace);
TMP0[5].typ = (&NTI149);
TMP0[5].name = "trace";
TMP0[1].len = 4; TMP0[1].kind = 2; TMP0[1].sons = &TMP49[0];
NTI3227.node = &TMP0[1];
NTI3239.size = sizeof(arithmeticerror3239);
NTI3239.kind = 17;
NTI3239.base = (&NTI3227);
TMP0[6].len = 0; TMP0[6].kind = 2;
NTI3239.node = &TMP0[6];
NTI3243.size = sizeof(overflowerror3243);
NTI3243.kind = 17;
NTI3243.base = (&NTI3239);
TMP0[7].len = 0; TMP0[7].kind = 2;
NTI3243.node = &TMP0[7];
NTI22201.size = sizeof(overflowerror3243*);
NTI22201.kind = 22;
NTI22201.base = (&NTI3243);
NTI22201.marker = TMP51;
NTI3229.size = sizeof(systemerror3229);
NTI3229.kind = 17;
NTI3229.base = (&NTI3227);
TMP0[8].len = 0; TMP0[8].kind = 2;
NTI3229.node = &TMP0[8];
NTI3253.size = sizeof(outofmemerror3253);
NTI3253.kind = 17;
NTI3253.base = (&NTI3229);
TMP0[9].len = 0; TMP0[9].kind = 2;
NTI3253.node = &TMP0[9];
NTI3233.size = sizeof(oserror3233);
NTI3233.kind = 17;
NTI3233.base = (&NTI3229);
NTI114.size = sizeof(NI32);
NTI114.kind = 34;
NTI114.base = 0;
NTI114.flags = 3;
TMP0[10].kind = 1;
TMP0[10].offset = offsetof(oserror3233, Errorcode);
TMP0[10].typ = (&NTI114);
TMP0[10].name = "errorCode";
NTI3233.node = &TMP0[10];
NTI112438.size = sizeof(oserror3233*);
NTI112438.kind = 22;
NTI112438.base = (&NTI3233);
NTI112438.marker = TMP138;
NTI3249.size = sizeof(valueerror3249);
NTI3249.kind = 17;
NTI3249.base = (&NTI3227);
TMP0[11].len = 0; TMP0[11].kind = 2;
NTI3249.node = &TMP0[11];
NTI21401.size = sizeof(valueerror3249*);
NTI21401.kind = 22;
NTI21401.base = (&NTI3249);
NTI21401.marker = TMP149;
NTI112.size = sizeof(NI16);
NTI112.kind = 33;
NTI112.base = 0;
NTI112.flags = 3;
NTI3231.size = sizeof(ioerror3231);
NTI3231.kind = 17;
NTI3231.base = (&NTI3229);
TMP0[12].len = 0; TMP0[12].kind = 2;
NTI3231.node = &TMP0[12];
NTI76801.size = sizeof(ioerror3231*);
NTI76801.kind = 22;
NTI76801.base = (&NTI3231);
NTI76801.marker = TMP161;
NTI138.size = sizeof(NIM_BOOL);
NTI138.kind = 1;
NTI138.base = 0;
NTI138.flags = 3;
NTI5510.size = sizeof(NI64);
NTI5510.kind = 35;
NTI5510.base = 0;
NTI5510.flags = 3;
NTI5512.size = sizeof(NF);
NTI5512.kind = 36;
NTI5512.base = 0;
NTI5512.flags = 3;
NTI3213.size = sizeof(TNimObject*);
NTI3213.kind = 22;
NTI3213.base = (&NTI3211);
NTI3213.marker = TMP840;
NTI153.size = sizeof(void*);
NTI153.kind = 26;
NTI153.base = 0;
NTI153.flags = 3;
NTI26220.size = sizeof(TY26220);
NTI26220.kind = 16;
NTI26220.base = (&NTI108);
NTI26220.flags = 3;
NTI74721.size = sizeof(NI);
NTI74721.kind = 20;
NTI74721.base = (&NTI108);
NTI74721.flags = 3;
NTI128.size = sizeof(NF);
NTI128.kind = 36;
NTI128.base = 0;
NTI128.flags = 3;
NTI12402.size = sizeof(void*);
NTI12402.kind = 18;
NTI12402.base = 0;
NTI12402.flags = 3;
TMP0[13].len = 0; TMP0[13].kind = 2;
NTI12402.node = &TMP0[13];
NTI12404.size = sizeof(FILE*);
NTI12404.kind = 21;
NTI12404.base = (&NTI12402);
NTI12404.flags = 3;
NTI110.size = sizeof(NI8);
NTI110.kind = 32;
NTI110.base = 0;
NTI110.flags = 3;
NTI77805.size = sizeof(TY77805);
NTI77805.kind = 16;
NTI77805.base = (&NTI112);
NTI77805.flags = 3;
NTI77804.size = sizeof(NI16*);
NTI77804.kind = 22;
NTI77804.base = (&NTI77805);
NTI77804.flags = 2;
NTI77804.marker = TMP1036;
NTI3263.size = sizeof(reraiseerror3263);
NTI3263.kind = 17;
NTI3263.base = (&NTI3227);
TMP0[14].len = 0; TMP0[14].kind = 2;
NTI3263.node = &TMP0[14];
NTI18001.size = sizeof(reraiseerror3263*);
NTI18001.kind = 22;
NTI18001.base = (&NTI3263);
NTI18001.marker = TMP1054;
NTI3259.size = sizeof(rangeerror3259);
NTI3259.kind = 17;
NTI3259.base = (&NTI3227);
TMP0[15].len = 0; TMP0[15].kind = 2;
NTI3259.node = &TMP0[15];
NTI124.size = sizeof(NU32);
NTI124.kind = 43;
NTI124.base = 0;
NTI124.flags = 3;
NTI3247.size = sizeof(assertionerror3247);
NTI3247.kind = 17;
NTI3247.base = (&NTI3227);
TMP0[16].len = 0; TMP0[16].kind = 2;
NTI3247.node = &TMP0[16];
NTI86401.size = sizeof(assertionerror3247*);
NTI86401.kind = 22;
NTI86401.base = (&NTI3247);
NTI86401.marker = TMP2178;
NTI12408.size = sizeof(int);
NTI12408.kind = 34;
NTI12408.base = 0;
NTI12408.flags = 3;
NTI5611.size = sizeof(int);
NTI5611.kind = 34;
NTI5611.base = 0;
NTI5611.flags = 3;
NTI3241.size = sizeof(divbyzeroerror3241);
NTI3241.kind = 17;
NTI3241.base = (&NTI3239);
TMP0[17].len = 0; TMP0[17].kind = 2;
NTI3241.node = &TMP0[17];
NTI147.size = sizeof(NIM_CHAR);
NTI147.kind = 2;
NTI147.base = 0;
NTI147.flags = 3;
NTI192015.size = sizeof(TY192015*);
NTI192015.kind = 24;
NTI192015.base = (&NTI183609);
NTI192015.flags = 2;
NTI192015.marker = TMP4868;
}

