/* Generated by Nim Compiler v0.13.0 */
/*   (c) 2015 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_INTBITS 64

#include "nimbase.h"
#include <string.h>
#include <sys/mman.h>
#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>
#include <signal.h>
typedef struct Exception Exception;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Avlnode29886 Avlnode29886;
typedef struct Gcheap50018 Gcheap50018;
typedef struct Gcstack50016 Gcstack50016;
typedef struct Cellseq47721 Cellseq47721;
typedef struct Cell47705 Cell47705;
typedef struct Cellset47717 Cellset47717;
typedef struct Pagedesc47713 Pagedesc47713;
typedef struct Memregion29888 Memregion29888;
typedef struct Smallchunk29840 Smallchunk29840;
typedef struct Llchunk29882 Llchunk29882;
typedef struct Bigchunk29842 Bigchunk29842;
typedef struct Intset29814 Intset29814;
typedef struct Trunk29810 Trunk29810;
typedef struct Gcstat50014 Gcstat50014;
typedef struct Basechunk29838 Basechunk29838;
typedef struct Freecell29830 Freecell29830;
typedef struct TGenericSeq TGenericSeq;
typedef struct NimStringDesc NimStringDesc;
typedef struct TSafePoint TSafePoint;
typedef struct TNimObject TNimObject;
typedef struct Overflowerror3640 Overflowerror3640;
typedef struct Arithmeticerror3636 Arithmeticerror3636;
typedef struct Systemerror3626 Systemerror3626;
typedef struct Outofmemerror3650 Outofmemerror3650;
typedef struct Valueerror3646 Valueerror3646;
typedef struct Ioerror3628 Ioerror3628;
typedef struct Reraiseerror3660 Reraiseerror3660;
typedef struct TY88887 TY88887;
typedef struct Tnodeseq213784 Tnodeseq213784;
typedef struct Tnode213790 Tnode213790;
typedef struct Oserror3630 Oserror3630;
typedef struct Keyerror3648 Keyerror3648;
typedef struct Rangeerror3656 Rangeerror3656;
typedef struct TY213913 TY213913;
typedef struct Indexerror3652 Indexerror3652;
typedef struct Assertionerror3644 Assertionerror3644;
typedef struct Ttypeseq213824 Ttypeseq213824;
typedef struct Ttype213828 Ttype213828;
typedef struct TY243443 TY243443;
typedef struct Tinstantiation213812 Tinstantiation213812;
typedef struct Tsym213822 Tsym213822;
typedef struct TY213925 TY213925;
typedef struct Slice88282 Slice88282;
typedef struct Divbyzeroerror3638 Divbyzeroerror3638;
typedef struct Tsymseq213792 Tsymseq213792;
typedef struct TY305653 TY305653;
typedef struct Jsonnodeobj305633 Jsonnodeobj305633;
typedef struct TY305648 TY305648;
typedef struct TY306043 TY306043;
typedef struct Indexentry326126 Indexentry326126;
typedef struct TY524219 TY524219;
typedef struct Tlineinfo181337 Tlineinfo181337;
typedef struct Tident188012 Tident188012;
typedef struct Tidobj188006 Tidobj188006;
typedef struct Tloc213804 Tloc213804;
typedef struct Ropeobj168006 Ropeobj168006;
typedef struct Tscope213816 Tscope213816;
typedef struct Tstrtable213794 Tstrtable213794;
typedef struct Tlib213808 Tlib213808;
typedef struct Tlistentry135010 Tlistentry135010;
typedef N_NIMCALL_PTR(NIM_BOOL, TY10009) (Exception* e);
typedef N_NIMCALL_PTR(NIM_BOOL, TY10014) (Exception* e);
typedef N_NIMCALL_PTR(void, TY10019) (void);
typedef N_NIMCALL_PTR(void, TY3489) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3494) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3489 marker;
TY3494 deepcopy;
};
typedef Avlnode29886* TY29893[2];
struct  Avlnode29886  {
TY29893 link;
NI key;
NI upperbound;
NI level;
};
struct  Cellseq47721  {
NI len;
NI cap;
Cell47705** d;
};
struct  Cellset47717  {
NI counter;
NI max;
Pagedesc47713* head;
Pagedesc47713** data;
};
typedef Smallchunk29840* TY29903[512];
typedef Trunk29810* Trunkbuckets29812[256];
struct  Intset29814  {
Trunkbuckets29812 data;
};
struct  Memregion29888  {
NI minlargeobj;
NI maxlargeobj;
TY29903 freesmallchunks;
Llchunk29882* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk29842* freechunkslist;
Intset29814 chunkstarts;
Avlnode29886* root;
Avlnode29886* deleted;
Avlnode29886* last;
Avlnode29886* freeavlnodes;
};
struct  Gcstat50014  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap50018  {
Gcstack50016* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq47721 zct;
Cellseq47721 decstack;
Cellset47717 cycleroots;
Cellseq47721 tempstack;
NI recgclock;
Memregion29888 region;
Gcstat50014 stat;
};
struct  Basechunk29838  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk29840  {
  Basechunk29838 Sup;
Smallchunk29840* next;
Smallchunk29840* prev;
Freecell29830* freelist;
NI free;
NI acc;
NF data;
};
struct  Bigchunk29842  {
  Basechunk29838 Sup;
Bigchunk29842* next;
Bigchunk29842* prev;
NI align;
NF data;
};
typedef NI TY29819[8];
struct  Trunk29810  {
Trunk29810* next;
NI key;
TY29819 bits;
};
struct  Llchunk29882  {
NI size;
NI acc;
Llchunk29882* next;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Freecell29830  {
Freecell29830* next;
NI zerofield;
};
typedef N_NIMCALL_PTR(void, TY19401) (NimStringDesc* msg);
typedef TFrame* TY20003[128];
struct  Cell47705  {
NI refcount;
TNimType* typ;
};
struct  Pagedesc47713  {
Pagedesc47713* next;
NI key;
TY29819 bits;
};
typedef N_NIMCALL_PTR(void, Finalizer) (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  Arithmeticerror3636  {
  Exception Sup;
};
struct  Overflowerror3640  {
  Arithmeticerror3636 Sup;
};
typedef struct {
N_NIMCALL_PTR(NIM_BOOL, ClPrc) (Exception* e, void* ClEnv);
void* ClEnv;
} TY18011;
struct  TSafePoint  {
TSafePoint* prev;
NI status;
jmp_buf context;
NIM_BOOL hasRaiseAction;
TY18011 raiseAction;
};
typedef N_CLOSURE_PTR(NIM_BOOL, TMP52) (Exception* e);
struct  Systemerror3626  {
  Exception Sup;
};
struct  Outofmemerror3650  {
  Systemerror3626 Sup;
};
typedef NIM_CHAR TY21218[2001];
struct  Valueerror3646  {
  Exception Sup;
};
struct  Ioerror3628  {
  Systemerror3626 Sup;
};
typedef NimStringDesc* TY82813[5];
struct  Reraiseerror3660  {
  Exception Sup;
};
struct TY88887 {
NimStringDesc* Field0;
NI Field1;
};
typedef NIM_CHAR TY80822[500];
struct  Oserror3630  {
  Systemerror3626 Sup;
NI32 errorcode;
};
struct  Keyerror3648  {
  Valueerror3646 Sup;
};
struct  Rangeerror3656  {
  Exception Sup;
};
typedef NIM_CHAR TY80765[65];
typedef NI32 TY530234[1];
typedef NU8 Sha1digest191003[20];
struct  Indexerror3652  {
  Exception Sup;
};
struct  Assertionerror3644  {
  Exception Sup;
};
struct TY243443 {
NI Field0;
NI Field1;
};
typedef Ttype213828* TY365877[1];
typedef NIM_CHAR TY85037[60];
struct  Tinstantiation213812  {
Tsym213822* sym;
Ttypeseq213824* concretetypes;
TY213913* usedby;
NI compilesid;
};
typedef Tinstantiation213812* TY427516[1];
typedef Tnode213790* TY229280[1];
struct  Slice88282  {
NI a;
NI b;
};
struct  Divbyzeroerror3638  {
  Arithmeticerror3636 Sup;
};
typedef Tsym213822* TY263331[1];
struct TY306043 {
NimStringDesc* Field0;
Jsonnodeobj305633* Field1;
};
struct  Indexentry326126  {
NimStringDesc* keyword;
NimStringDesc* link;
NimStringDesc* linktitle;
NimStringDesc* linkdesc;
};
struct  Gcstack50016  {
Gcstack50016* prev;
Gcstack50016* next;
void* starts;
void* pos;
NI maxstacksize;
};
struct  Tlineinfo181337  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tnode213790  {
Ttype213828* typ;
Tlineinfo181337 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym213822* sym;
} S4;
struct {Tident188012* ident;
} S5;
struct {Tnodeseq213784* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Tidobj188006  {
  TNimObject Sup;
NI id;
};
struct  Tloc213804  {
NU8 k;
NU8 s;
NU16 flags;
Ttype213828* t;
Ropeobj168006* r;
Ropeobj168006* heaproot;
};
struct  Ttype213828  {
  Tidobj188006 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq213824* sons;
Tnode213790* n;
Tsym213822* owner;
Tsym213822* sym;
Tsym213822* destructor;
Tsym213822* deepcopy;
Tsym213822* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc213804 loc;
};
struct  Tstrtable213794  {
NI counter;
Tsymseq213792* data;
};
struct  Tsym213822  {
  Tidobj188006 Sup;
NU8 kind;
union{
struct {Ttypeseq213824* typeinstcache;
Tscope213816* typscope;
} S1;
struct {TY213925* procinstcache;
Tsym213822* gcunsafetyreason;
} S2;
struct {TY213925* usedgenerics;
Tstrtable213794 tab;
} S3;
struct {Tsym213822* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype213828* typ;
Tident188012* name;
Tlineinfo181337 info;
Tsym213822* owner;
NU32 flags;
Tnode213790* ast;
NU32 options;
NI position;
NI offset;
Tloc213804 loc;
Tlib213808* annex;
Tnode213790* constraint;
};
struct  Jsonnodeobj305633  {
NU8 kind;
union{
struct {NimStringDesc* str;
} S1;
struct {NI64 num;
} S2;
struct {NF fnum;
} S3;
struct {NIM_BOOL bval;
} S4;
struct {TY305648* fields;
} S6;
struct {TY305653* elems;
} S7;
} kindU;
};
struct  Tident188012  {
  Tidobj188006 Sup;
NimStringDesc* s;
Tident188012* next;
NI h;
};
struct  Ropeobj168006  {
  TNimObject Sup;
Ropeobj168006* left;
Ropeobj168006* right;
NI length;
NimStringDesc* data;
};
struct  Tscope213816  {
NI depthlevel;
Tstrtable213794 symbols;
Tnodeseq213784* usingsyms;
Tscope213816* parent;
};
struct  Tlistentry135010  {
  TNimObject Sup;
Tlistentry135010* prev;
Tlistentry135010* next;
};
struct  Tlib213808  {
  Tlistentry135010 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj168006* name;
Tnode213790* path;
};
struct Tnodeseq213784 {
  TGenericSeq Sup;
  Tnode213790* data[SEQ_DECL_SIZE];
};
struct TY213913 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct Ttypeseq213824 {
  TGenericSeq Sup;
  Ttype213828* data[SEQ_DECL_SIZE];
};
struct TY213925 {
  TGenericSeq Sup;
  Tinstantiation213812* data[SEQ_DECL_SIZE];
};
struct Tsymseq213792 {
  TGenericSeq Sup;
  Tsym213822* data[SEQ_DECL_SIZE];
};
struct TY305653 {
  TGenericSeq Sup;
  Jsonnodeobj305633* data[SEQ_DECL_SIZE];
};
struct TY305648 {
  TGenericSeq Sup;
  TY306043 data[SEQ_DECL_SIZE];
};
struct TY524219 {
  TGenericSeq Sup;
  int data[SEQ_DECL_SIZE];
};
static N_INLINE(void, initallocator_11601)(void);
static N_INLINE(void, initStackBottom)(void);
N_NOINLINE(void, setStackBottom)(void* thestackbottom);
N_NIMCALL(void, initgc_11401)(void);
N_NIMCALL(void, init_47803)(Cellseq47721* s, NI cap);
N_NOCONV(void*, alloc0_7417)(NI size);
N_NIMCALL(void*, alloc0_46416)(Memregion29888* allocator, NI size);
N_NIMCALL(void*, alloc_46240)(Memregion29888* allocator, NI size);
N_NIMCALL(void*, rawalloc_37068)(Memregion29888* a, NI requestedsize);
static N_INLINE(NI, roundup_28401)(NI x, NI v);
N_NIMCALL(Smallchunk29840*, getsmallchunk_36412)(Memregion29888* a);
N_NIMCALL(Bigchunk29842*, getbigchunk_35614)(Memregion29888* a, NI size);
static N_INLINE(void, listremove_33402)(Bigchunk29842** head, Bigchunk29842* c);
N_NIMCALL(void, splitchunk_35409)(Memregion29888* a, Bigchunk29842* c, NI size);
static N_INLINE(void, updateprevsize_32468)(Memregion29888* a, Bigchunk29842* c, NI prevsize);
static N_INLINE(NIM_BOOL, isaccessible_32415)(Memregion29888* a, void* p);
N_NIMCALL(NIM_BOOL, contains_31132)(Intset29814* s, NI key);
N_NIMCALL(Trunk29810*, intsetget_31083)(Intset29814* t, NI key);
static N_INLINE(NI, pageindex_31575)(void* p);
N_NIMCALL(void, incl_31153)(Memregion29888* a, Intset29814* s, NI key);
N_NIMCALL(Trunk29810*, intsetput_31105)(Memregion29888* a, Intset29814* t, NI key);
N_NIMCALL(void*, llalloc_30043)(Memregion29888* a, NI size);
static N_INLINE(void*, osallocpages_29615)(NI size);
N_NOINLINE(void, raiseoutofmem_28234)(void);
static N_INLINE(void, inccurrmem_30002)(Memregion29888* a, NI bytes);
static N_INLINE(NI, pageindex_31570)(Basechunk29838* c);
static N_INLINE(void, listadd_34623)(Bigchunk29842** head, Bigchunk29842* c);
N_NIMCALL(Bigchunk29842*, requestoschunks_31587)(Memregion29888* a, NI size);
static N_INLINE(void, listadd_38016)(Smallchunk29840** head, Smallchunk29840* c);
static N_INLINE(void, listremove_40802)(Smallchunk29840** head, Smallchunk29840* c);
N_NIMCALL(void, add_30953)(Memregion29888* a, Avlnode29886** t, NI key, NI upperbound);
N_NIMCALL(Avlnode29886*, allocavlnode_30227)(Memregion29888* a, NI key, NI upperbound);
N_NIMCALL(void, skew_30934)(Avlnode29886** t);
N_NIMCALL(void, split_30939)(Avlnode29886** t);
N_NIMCALL(void, init_47818)(Cellset47717* s);
N_NOCONV(void, signalHandler)(int sig);
N_NIMCALL(void, showerrormessage_19606)(NCSTRING data);
N_NIMCALL(NimStringDesc*, cstrToNimstr)(NCSTRING str);
N_NIMCALL(NimStringDesc*, toNimStr)(NCSTRING str, NI len);
N_NIMCALL(NimStringDesc*, rawNewStringNoInit)(NI space);
N_NIMCALL(void*, newObjNoInit)(TNimType* typ, NI size);
N_NIMCALL(void*, rawnewobj_57801)(TNimType* typ, NI size, Gcheap50018* gch);
N_NIMCALL(void, collectct_52007)(Gcheap50018* gch);
N_NOINLINE(NI, stacksize_71801)(void);
static N_INLINE(NI, getoccupiedmem_47630)(Memregion29888* a);
N_NIMCALL(void, collectctbody_75609)(Gcheap50018* gch);
static N_INLINE(void, prepareforinteriorpointerchecking_45088)(Memregion29888* a);
N_NIMCALL(NI, lowgauge_30812)(Avlnode29886* n);
N_NIMCALL(NI, highgauge_30829)(Avlnode29886* n);
N_CDECL(void, markstackandregisters_73037)(Gcheap50018* gch);
static N_INLINE(void, gcmark_70816)(Gcheap50018* gch, void* p);
static N_INLINE(Cell47705*, usrtocell_51640)(void* usr);
N_NIMCALL(void*, interiorallocatedptr_45092)(Memregion29888* a, void* p);
static N_INLINE(Basechunk29838*, pageaddr_31580)(void* p);
static N_INLINE(NIM_BOOL, chunkunused_31489)(Basechunk29838* c);
static N_INLINE(NIM_BOOL, issmallchunk_31469)(Basechunk29838* c);
N_NIMCALL(Avlnode29886*, inrange_30881)(Avlnode29886* root, NI key);
static N_INLINE(void, add_47783)(Cellseq47721* s, Cell47705* c);
N_NOCONV(void*, alloc_7401)(NI size);
N_NOCONV(void, dealloc_7448)(void* p);
N_NIMCALL(void, dealloc_46422)(Memregion29888* allocator, void* p);
N_NIMCALL(void, rawdealloc_43417)(Memregion29888* a, void* p);
N_NIMCALL(void, freebigchunk_32603)(Memregion29888* a, Bigchunk29842* c_32607);
N_NIMCALL(void, excl_31164)(Intset29814* s, NI key);
N_NIMCALL(void, freeoschunks_32207)(Memregion29888* a, void* p, NI size);
static N_INLINE(void, osdeallocpages_29621)(void* p, NI size);
static N_INLINE(void, deccurrmem_30016)(Memregion29888* a, NI bytes);
N_NIMCALL(void, del_31001)(Memregion29888* a, Avlnode29886** t, NI x);
static N_INLINE(void, deallocavlnode_30803)(Memregion29888* a, Avlnode29886* n);
N_NIMCALL(void, markthreadstacks_71403)(Gcheap50018* gch);
N_NIMCALL(NIM_BOOL, collectzct_70206)(Gcheap50018* gch);
static N_INLINE(NIM_BOOL, canbecycleroot_51658)(Cell47705* c);
N_NIMCALL(void, excl_48474)(Cellset47717* s, Cell47705* cell);
N_NIMCALL(Pagedesc47713*, cellsetget_47850)(Cellset47717* t, NI key);
static N_INLINE(NI, nexttry_47845)(NI h, NI maxhash);
N_NIMCALL(void, preparedealloc_52208)(Cell47705* cell);
static N_INLINE(void*, celltousr_51622)(Cell47705* cell);
N_NIMCALL(void, forallchildren_52014)(Cell47705* cell, NU8 op);
N_NIMCALL(void, forallchildrenaux_52022)(void* dest, TNimType* mt, NU8 op);
N_NIMCALL(void, dooperation_52018)(void* p, NU8 op);
static N_INLINE(void, decref_53601)(Cell47705* c);
static N_INLINE(void, rtladdzct_53201)(Cell47705* c);
N_NOINLINE(void, addzct_51617)(Cellseq47721* s, Cell47705* c);
static N_INLINE(void, rtladdcycleroot_52420)(Cell47705* c);
N_NOINLINE(void, incl_48447)(Cellset47717* s, Cell47705* cell);
N_NIMCALL(Pagedesc47713*, cellsetput_48241)(Cellset47717* t, NI key);
N_NIMCALL(void, cellsetenlarge_48203)(Cellset47717* t);
N_NIMCALL(void, cellsetrawinsert_47870)(Cellset47717* t, Pagedesc47713** data, Pagedesc47713* desc);
N_NIMCALL(void, markgray_67202)(Cell47705* s);
N_NIMCALL(void, scan_67601)(Cell47705* s);
N_NIMCALL(void, scanblack_67401)(Cell47705* s);
N_NIMCALL(void, collectwhite_67801)(Cell47705* s);
N_NIMCALL(NIM_BOOL, isallocatedptr_36802)(Memregion29888* a, void* p);
N_NIMCALL(void, freecycliccell_66415)(Gcheap50018* gch, Cell47705* c);
N_NIMCALL(void, forallslotsaux_56205)(void* dest, TNimNode* n, NU8 op);
N_NIMCALL(TNimNode*, selectbranch_27807)(void* aa, TNimNode* n);
N_NIMCALL(NI, getdiscriminant_27404)(void* aa, TNimNode* n);
N_NIMCALL(void, collectcycles_70420)(Gcheap50018* gch);
N_NIMCALL(void, markroots_68002)(Gcheap50018* gch);
N_NIMCALL(void, collectroots_70401)(Gcheap50018* gch);
N_NIMCALL(void, cellsetreset_56201)(Cellset47717* s);
N_NIMCALL(void, deinit_47826)(Cellset47717* s);
N_NIMCALL(NI, getoccupiedmem_8055)(void);
N_NIMCALL(NI, gettotalmem_8059)(void);
N_NIMCALL(NI, getfreemem_8057)(void);
N_NIMCALL(void, unmarkstackandregisters_75402)(Gcheap50018* gch);
static N_INLINE(void, addnewobjtozct_57274)(Cell47705* res, Gcheap50018* gch);
N_NIMCALL(void, writetostderr_19601)(NCSTRING msg);
N_NIMCALL(void, write_15701)(FILE* f, NCSTRING c);
N_NIMCALL(void, registersignalhandler_23202)(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);
static N_INLINE(void, sysfatal_24062)(NimStringDesc* message) __attribute__((noreturn));
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(void*, newObj)(TNimType* typ, NI size);
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_20801)(Exception* e);
static N_INLINE(void, pushCurrentException)(Exception* e);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incref_54019)(Cell47705* c);
static N_INLINE(NIM_BOOL, isObjWithCache)(TNimType* obj, TNimType* subclass, TNimType** cache);
N_NOINLINE(NIM_BOOL, isobjslowpath_23934)(TNimType* obj, TNimType* subclass, TNimType** cache);
static N_INLINE(void, quitordebug_20604)(void);
N_NIMCALL(NI, mulInt)(NI a, NI b);
N_NOINLINE(NIM_BOOL, isonstack_52011)(void* p);
static N_INLINE(void, sysfatal_23818)(NimStringDesc* message) __attribute__((noreturn));
N_NIMCALL(void, TMP140)(void* p, NI op);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(void, genericresetaux_83401)(void* dest, TNimNode* n);
N_NIMCALL(void, genericReset)(void* dest, TNimType* mt);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(NimStringDesc*, copyStrLast)(NimStringDesc* s, NI start_80010, NI last);
static N_INLINE(NI, resize_79401)(NI old);
N_NIMCALL(void*, growobj_66409)(void* old, NI newsize);
N_NIMCALL(void*, growobj_63603)(void* old, NI newsize, Gcheap50018* gch);
N_NIMCALL(NimStringDesc*, mnewString)(NI len);
N_NIMCALL(NimStringDesc*, mnewString)(NI len);
N_NIMCALL(void, genericassignaux_83406)(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_83412)(void* dest, void* src, TNimNode* n, NIM_BOOL shallow);
N_NIMCALL(NimStringDesc*, setLengthStr)(NimStringDesc* s, NI newlen);
N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
N_NIMCALL(NI, writebuffer_15776)(FILE* f, void* buffer, NI len);
N_NOINLINE(void, raiseeio_81405)(NimStringDesc* msg) __attribute__((noreturn));
static N_INLINE(void, sysfatal_81410)(NimStringDesc* message) __attribute__((noreturn));
N_NIMCALL(void, TMP430)(void* p, NI op);
N_NIMCALL(void, TMP917)(void* p, NI op);
N_NIMCALL(TNimType*, extGetCellType)(void* c);
N_NIMCALL(NIM_BOOL, open_15603)(FILE** f, NimStringDesc* filename, NU8 mode, NI bufsize);
static N_INLINE(void, sysfatal_15626)(NimStringDesc* message, NimStringDesc* arg) __attribute__((noreturn));
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
static N_INLINE(void, sysfatal_21417)(NimStringDesc* message) __attribute__((noreturn));
N_NIMCALL(void, TMP1055)(void* p, NI op);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
N_NIMCALL(NIM_CHAR, getdecimalpoint_80806)(void);
N_NIMCALL(void, objectinitaux_84278)(void* dest, TNimNode* n);
N_NIMCALL(void, objectInit)(void* dest, TNimType* typ);
N_NIMCALL(void, TMP1226)(void* p, NI op);
N_NIMCALL(void, TMP1229)(void* p, NI op);
N_NIMCALL(void*, realloc_47404)(Memregion29888* allocator, void* p, NI newsize);
N_NIMCALL(NI, ptrsize_46013)(void* p);
N_NIMCALL(void, genericAssign)(void* dest, void* src, TNimType* mt);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_530149)(TY213913* x, TY213913* y);
static N_INLINE(void*, seqtoptr_530160)(TY213913* x);
N_NIMCALL(TGenericSeq*, incrSeqV2)(TGenericSeq* seq, NI elemsize);
N_NIMCALL(FILE*, open_15617)(NimStringDesc* filename, NU8 mode, NI bufsize);
static N_INLINE(void, pushSafePoint)(TSafePoint* s);
N_NIMCALL(NimStringDesc*, readall_15663)(FILE* file);
N_NIMCALL(NI, rawfilesize_82066)(FILE* file);
N_NIMCALL(NimStringDesc*, readallfile_82072)(FILE* file, NI len);
N_NIMCALL(NI, readbuffer_15754)(FILE* f, void* buffer, NI len);
N_NIMCALL(NIM_BOOL, endoffile_15654)(FILE* f);
N_NIMCALL(NimStringDesc*, readallbuffer_82058)(FILE* file);
static N_INLINE(void, popSafePoint)(void);
N_NIMCALL(void, reraiseException)(void);
N_NIMCALL(void, write_15689)(FILE* f, NimStringDesc* s);
N_NIMCALL(void, TMP1663)(void* p, NI op);
N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
N_NIMCALL(NIM_BOOL, readline_15713)(FILE* f, NimStringDesc** line);
static N_INLINE(void, sysfatal_88898)(NimStringDesc* message) __attribute__((noreturn));
N_NIMCALL(void, TMP2308)(void* p, NI op);
static N_INLINE(void*, seqtoptr_247938)(Ttypeseq213824* x);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_247927)(Ttypeseq213824* x, Ttypeseq213824* y);
static N_INLINE(void*, seqtoptr_216875)(TY213925* x);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_216864)(TY213925* x, TY213925* y);
static N_INLINE(void*, seqtoptr_281355)(Tnodeseq213784* x);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_281344)(Tnodeseq213784* x, Tnodeseq213784* y);
N_NIMCALL(TGenericSeq*, setLengthSeq)(TGenericSeq* seq, NI elemsize, NI newlen);
static N_INLINE(void*, seqtoptr_427822)(Tsymseq213792* x);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_427811)(Tsymseq213792* x, Tsymseq213792* y);
static N_INLINE(void*, seqtoptr_306494)(TY305653* x);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_306431)(Jsonnodeobj305633* a, Jsonnodeobj305633* b);
static N_INLINE(void*, seqtoptr_306582)(TY305648* x);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_306649)(TY306043 x, TY306043 y);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(void, TMP5283)(void* p, NI op);
static N_INLINE(void, Gcdisable_9801)(void);
N_NIMCALL(NimStringDesc*, nimInt64ToStr)(NI64 x);
static N_INLINE(void, Gcenable_9803)(void);
STRING_LITERAL(TMP2, "out of memory", 13);
STRING_LITERAL(TMP53, "over- or underflow", 18);
STRING_LITERAL(TMP141, "attempt to write to a nil address", 33);
STRING_LITERAL(TMP431, "cannot write string to file", 27);
STRING_LITERAL(TMP494, "rb", 2);
STRING_LITERAL(TMP495, "wb", 2);
STRING_LITERAL(TMP496, "w+b", 3);
STRING_LITERAL(TMP497, "r+b", 3);
STRING_LITERAL(TMP498, "ab", 2);
NIM_CONST TY82813 Formatopen_82810 = {((NimStringDesc*) &TMP494),
((NimStringDesc*) &TMP495),
((NimStringDesc*) &TMP496),
((NimStringDesc*) &TMP497),
((NimStringDesc*) &TMP498)}
;
STRING_LITERAL(TMP1054, "cannot open: ", 13);
STRING_LITERAL(TMP1056, "no exception to reraise", 23);
STRING_LITERAL(TMP1057, "(", 1);
STRING_LITERAL(TMP1058, ", ", 2);
STRING_LITERAL(TMP1059, "filename", 8);
STRING_LITERAL(TMP1060, ": ", 2);
STRING_LITERAL(TMP1061, "nil", 3);
STRING_LITERAL(TMP1062, "line", 4);
STRING_LITERAL(TMP1063, ")", 1);
STRING_LITERAL(TMP1108, " (invalid data!)", 16);
STRING_LITERAL(TMP1385, "nan", 3);
STRING_LITERAL(TMP1386, "-inf", 4);
STRING_LITERAL(TMP1387, "inf", 3);
STRING_LITERAL(TMP1549, "error while reading from file", 29);
STRING_LITERAL(TMP1550, "", 0);
STRING_LITERAL(TMP1916, "EOF reached", 11);
STRING_LITERAL(TMP2828, "cannot set file position", 24);
STRING_LITERAL(TMP2829, "cannot retrieve file position", 29);
STRING_LITERAL(TMP3067, "0", 1);
STRING_LITERAL(TMP3132, "true", 4);
STRING_LITERAL(TMP3133, "false", 5);
STRING_LITERAL(TMP5295, "[GC] total memory: ", 19);
STRING_LITERAL(TMP5296, "\012[GC] occupied memory: ", 23);
STRING_LITERAL(TMP5297, "\012[GC] stack scans: ", 19);
STRING_LITERAL(TMP5298, "\012[GC] stack cells: ", 19);
STRING_LITERAL(TMP5299, "\012[GC] cycle collections: ", 25);
STRING_LITERAL(TMP5300, "\012[GC] max threshold: ", 21);
STRING_LITERAL(TMP5301, "\012[GC] zct capacity: ", 20);
STRING_LITERAL(TMP5302, "\012[GC] max cycle table size: ", 28);
STRING_LITERAL(TMP5303, "\012[GC] max pause time [ms]: ", 27);
STRING_LITERAL(TMP5304, "[GC] max stack size: ", 21);
STRING_LITERAL(TMP5305, "\012", 1);
NIM_BOOL nimvm_5751;
NI nim_program_result;
TY10009 globalraisehook_10013;
TY10014 localraisehook_10018;
TY10019 outofmemhook_10021;
TNimType strdesc_12203;
TY19401 errormessagewriter_19404;
TFrame* frameptr_19636;
TSafePoint* exchandler_19637;
Exception* currexception_19639;
TY20003 tempframes_20004;
Avlnode29886 bottomdata_29919;
Avlnode29886* bottom_29920;
Gcheap50018 gch_50059;
NIM_BOOL localgcinitialized_71824;
NIM_CHAR decimalpoint_80805;
TNimType NTI3608; /* RootObj */
TNimType NTI104; /* int */
TNimType NTI138; /* string */
TNimType NTI3624; /* Exception */
TNimType NTI10010; /* ref Exception */
TNimType NTI140; /* cstring */
TNimType NTI3636; /* ArithmeticError */
TNimType NTI3640; /* OverflowError */
TNimType NTI24069; /* ref OverflowError */
TNimType NTI3626; /* SystemError */
TNimType NTI3650; /* OutOfMemError */
static TNimType* Nim_OfCheck_CACHE1[2];
TNimType NTI110; /* int32 */
TNimType NTI3646; /* ValueError */
TNimType NTI23825; /* ref ValueError */
TNimType NTI108; /* int16 */
TNimType NTI3628; /* IOError */
TNimType NTI81417; /* ref IOError */
TNimType NTI130; /* bool */
TNimType NTI7088; /* BiggestInt */
TNimType NTI7090; /* BiggestFloat */
TNimType NTI142; /* pointer */
TNimType NTI7208; /* cint */
TNimType NTI116; /* uint8 */
TNimType NTI3610; /* RootRef */
TNimType NTI3660; /* ReraiseError */
TNimType NTI21424; /* ref ReraiseError */
TNimType NTI29819; /* array[0..7, int] */
extern TNimType NTI213784; /* TNodeSeq */
TNimType NTI3604; /* Natural */
TNimType NTI124; /* float */
TNimType NTI15202; /* CFile */
TNimType NTI15204; /* File */
TNimType NTI106; /* int8 */
TNimType NTI3630; /* OSError */
TNimType NTI121007; /* ref OSError */
TNimType NTI3648; /* KeyError */
TNimType NTI181804; /* ref KeyError */
TNimType NTI3656; /* RangeError */
extern TNimType NTI213913; /* seq[int32] */
TNimType NTI3652; /* IndexError */
TNimType NTI131615; /* ref IndexError */
TNimType NTI120; /* uint32 */
TNimType NTI3644; /* AssertionError */
TNimType NTI88905; /* ref AssertionError */
extern TNimType NTI213824; /* TTypeSeq */
TNimType NTI136; /* char */
TNimType NTI15208; /* FileHandle */
extern TNimType NTI213814; /* PInstantiation */
extern TNimType NTI213925; /* seq[PInstantiation] */
TNimType NTI3638; /* DivByZeroError */
extern TNimType NTI213792; /* TSymSeq */
TNimType NTI524219; /* seq[SocketHandle] */

static N_INLINE(void, initallocator_11601)(void) {
	bottom_29920 = (&bottomdata_29919);
	(*bottom_29920).link[(((NI) 0))- 0] = bottom_29920;
	(*bottom_29920).link[(((NI) 1))- 0] = bottom_29920;
}

N_NOINLINE(void, setStackBottom)(void* thestackbottom) {
	{
		if (!(gch_50059.stackbottom == NIM_NIL)) goto LA3;
		gch_50059.stackbottom = thestackbottom;
	}
	goto LA1;
	LA3: ;
	{
		NI a;
		NI b;
		a = ((NI) (thestackbottom));
		b = ((NI) (gch_50059.stackbottom));
		gch_50059.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_28401)(NI x, NI v) {
	NI result;
	result = 0;
	result = (NI)((NI)(x + (NI)(v - ((NI) 1))) & (NI)((NU64) ~((NI)(v - ((NI) 1)))));
	return result;
}

static N_INLINE(void, listremove_33402)(Bigchunk29842** head, Bigchunk29842* c) {
	{
		if (!(c == (*head))) goto LA3;
		(*head) = (*c).next;
		{
			if (!!(((*head) == NIM_NIL))) goto LA7;
			(*(*head)).prev = NIM_NIL;
		}
		LA7: ;
	}
	goto LA1;
	LA3: ;
	{
		(*(*c).prev).next = (*c).next;
		{
			if (!!(((*c).next == NIM_NIL))) goto LA12;
			(*(*c).next).prev = (*c).prev;
		}
		LA12: ;
	}
	LA1: ;
	(*c).next = NIM_NIL;
	(*c).prev = NIM_NIL;
}

N_NIMCALL(Trunk29810*, intsetget_31083)(Intset29814* t, NI key) {
	Trunk29810* result;
	Trunk29810* it;
{	result = 0;
	it = (*t).data[((NI)(key & ((NI) 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_31132)(Intset29814* s, NI key) {
	NIM_BOOL result;
	Trunk29810* t;
	result = 0;
	t = intsetget_31083(s, (NI)((NU64)(key) >> (NU64)(((NI) 9))));
	{
		NI u;
		if (!!((t == NIM_NIL))) goto LA3;
		u = (NI)(key & ((NI) 511));
		result = !(((NI)((*t).bits[((NI)((NU64)(((NI) (u))) >> (NU64)(((NI) 6))))- 0] & (NI)((NU64)(((NI) 1)) << (NU64)(((NI) ((NI)(((NI) (u)) & ((NI) 63))))))) == ((NI) 0)));
	}
	goto LA1;
	LA3: ;
	{
		result = NIM_FALSE;
	}
	LA1: ;
	return result;
}

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

static N_INLINE(NIM_BOOL, isaccessible_32415)(Memregion29888* a, void* p) {
	NIM_BOOL result;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = pageindex_31575(p);
	result = contains_31132((&(*a).chunkstarts), LOC1);
	return result;
}

static N_INLINE(void, updateprevsize_32468)(Memregion29888* a, Bigchunk29842* c, NI prevsize) {
	Basechunk29838* ri;
	ri = ((Basechunk29838*) ((NI)((NU64)(((NI) (c))) + (NU64)((*c).Sup.size))));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = isaccessible_32415((&(*a)), ((void*) (ri)));
		if (!LOC3) goto LA4;
		(*ri).prevsize = prevsize;
	}
	LA4: ;
}

N_NOINLINE(void, raiseoutofmem_28234)(void) {
	{
		if (!!((outofmemhook_10021 == NIM_NIL))) goto LA3;
		outofmemhook_10021();
	}
	LA3: ;
	printf("%s\012", ((NimStringDesc*) &TMP2)? (((NimStringDesc*) &TMP2))->data:"nil");
	fflush(stdout);
	exit(((NI) 1));
}

static N_INLINE(void*, osallocpages_29615)(NI size) {
	void* result;
	result = 0;
	result = mmap(NIM_NIL, size, ((int) 3), ((NI32) 4098), ((int) -1), ((NI) 0));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = (result == NIM_NIL);
		if (LOC3) goto LA4;
		LOC3 = (result == ((void*) -1));
		LA4: ;
		if (!LOC3) goto LA5;
		raiseoutofmem_28234();
	}
	LA5: ;
	return result;
}

static N_INLINE(void, inccurrmem_30002)(Memregion29888* a, NI bytes) {
	(*a).currmem += bytes;
}

N_NIMCALL(void*, llalloc_30043)(Memregion29888* a, NI size) {
	void* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		Llchunk29882* 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_29615(((NI) 4096));
		(*a).llmem = ((Llchunk29882*) (LOC7));
		inccurrmem_30002(a, ((NI) 4096));
		(*(*a).llmem).size = (NI)(((NI) 4096) - ((NI)sizeof(Llchunk29882)));
		(*(*a).llmem).acc = ((NI)sizeof(Llchunk29882));
		(*(*a).llmem).next = old;
	}
	LA5: ;
	result = ((void*) ((NI)(((NI) ((*a).llmem)) + (*(*a).llmem).acc)));
	(*(*a).llmem).size -= size;
	(*(*a).llmem).acc += size;
	zeroMem(result, ((NI) (size)));
	return result;
}

N_NIMCALL(Trunk29810*, intsetput_31105)(Memregion29888* a, Intset29814* t, NI key) {
	Trunk29810* result;
	result = 0;
	result = intsetget_31083((&(*t)), key);
	{
		void* LOC5;
		if (!(result == NIM_NIL)) goto LA3;
		LOC5 = 0;
		LOC5 = llalloc_30043(a, ((NI)sizeof(Trunk29810)));
		result = ((Trunk29810*) (LOC5));
		(*result).next = (*t).data[((NI)(key & ((NI) 255)))- 0];
		(*t).data[((NI)(key & ((NI) 255)))- 0] = result;
		(*result).key = key;
	}
	LA3: ;
	return result;
}

N_NIMCALL(void, incl_31153)(Memregion29888* a, Intset29814* s, NI key) {
	Trunk29810* t;
	NI u;
	t = intsetput_31105(a, s, (NI)((NU64)(key) >> (NU64)(((NI) 9))));
	u = (NI)(key & ((NI) 511));
	(*t).bits[((NI)((NU64)(((NI) (u))) >> (NU64)(((NI) 6))))- 0] = (NI)((*t).bits[((NI)((NU64)(((NI) (u))) >> (NU64)(((NI) 6))))- 0] | (NI)((NU64)(((NI) 1)) << (NU64)(((NI) ((NI)(((NI) (u)) & ((NI) 63)))))));
}

static N_INLINE(NI, pageindex_31570)(Basechunk29838* c) {
	NI result;
	result = 0;
	result = (NI)((NU64)(((NI) (c))) >> (NU64)(((NI) 12)));
	return result;
}

static N_INLINE(void, listadd_34623)(Bigchunk29842** head, Bigchunk29842* c) {
	(*c).next = (*head);
	{
		if (!!(((*head) == NIM_NIL))) goto LA3;
		(*(*head)).prev = c;
	}
	LA3: ;
	(*head) = c;
}

N_NIMCALL(void, splitchunk_35409)(Memregion29888* a, Bigchunk29842* c, NI size) {
	Bigchunk29842* rest;
	Basechunk29838* LOC1;
	NI LOC2;
	rest = ((Bigchunk29842*) ((NI)((NU64)(((NI) (c))) + (NU64)(size))));
	(*rest).Sup.size = (NI)((*c).Sup.size - size);
	(*rest).Sup.used = NIM_FALSE;
	(*rest).next = NIM_NIL;
	(*rest).prev = NIM_NIL;
	(*rest).Sup.prevsize = size;
	updateprevsize_32468(a, c, (*rest).Sup.size);
	(*c).Sup.size = size;
	LOC1 = 0;
	LOC1 = &rest->Sup;
	LOC2 = 0;
	LOC2 = pageindex_31570(LOC1);
	incl_31153(a, (&(*a).chunkstarts), LOC2);
	listadd_34623(&(*a).freechunkslist, rest);
}

N_NIMCALL(Bigchunk29842*, requestoschunks_31587)(Memregion29888* a, NI size) {
	Bigchunk29842* result;
	void* LOC1;
	NI nxt;
	Basechunk29838* next;
	NI lastsize;
	NI prv;
	Basechunk29838* prev;
	result = 0;
	inccurrmem_30002(a, size);
	(*a).freemem += size;
	LOC1 = 0;
	LOC1 = osallocpages_29615(size);
	result = ((Bigchunk29842*) (LOC1));
	(*result).next = NIM_NIL;
	(*result).prev = NIM_NIL;
	(*result).Sup.used = NIM_FALSE;
	(*result).Sup.size = size;
	nxt = (NI)((NU64)(((NI) (result))) + (NU64)(size));
	next = ((Basechunk29838*) (nxt));
	{
		NI LOC4;
		NIM_BOOL LOC5;
		LOC4 = 0;
		LOC4 = pageindex_31570(next);
		LOC5 = 0;
		LOC5 = contains_31132((&(*a).chunkstarts), LOC4);
		if (!LOC5) goto LA6;
		(*next).prevsize = size;
	}
	LA6: ;
	{
		if (!!(((*a).lastsize == ((NI) 0)))) goto LA10;
		lastsize = (*a).lastsize;
	}
	goto LA8;
	LA10: ;
	{
		lastsize = ((NI) 4096);
	}
	LA8: ;
	prv = (NI)((NU64)(((NI) (result))) - (NU64)(lastsize));
	prev = ((Basechunk29838*) (prv));
	{
		NIM_BOOL LOC15;
		NI LOC16;
		LOC15 = 0;
		LOC16 = 0;
		LOC16 = pageindex_31570(prev);
		LOC15 = contains_31132((&(*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 = ((NI) 0);
	}
	LA13: ;
	(*a).lastsize = size;
	return result;
}

N_NIMCALL(Bigchunk29842*, getbigchunk_35614)(Memregion29888* a, NI size) {
	Bigchunk29842* result;
	Basechunk29838* LOC16;
	NI LOC17;
	result = 0;
	result = (*a).freechunkslist;
	{
		{
			while (1) {
				if (!!((result == NIM_NIL))) goto LA3;
				{
					if (!((*result).Sup.size == size)) goto LA6;
					listremove_33402(&(*a).freechunkslist, result);
					goto LA1;
				}
				goto LA4;
				LA6: ;
				{
					if (!(size < (*result).Sup.size)) goto LA9;
					listremove_33402(&(*a).freechunkslist, result);
					splitchunk_35409(a, result, size);
					goto LA1;
				}
				goto LA4;
				LA9: ;
				LA4: ;
				result = (*result).next;
			} LA3: ;
		}
		{
			if (!(size < ((NI) 524288))) goto LA13;
			result = requestoschunks_31587(a, ((NI) 524288));
			splitchunk_35409(a, result, size);
		}
		goto LA11;
		LA13: ;
		{
			result = requestoschunks_31587(a, size);
		}
		LA11: ;
	} LA1: ;
	(*result).Sup.prevsize = ((NI) 0);
	(*result).Sup.used = NIM_TRUE;
	LOC16 = 0;
	LOC16 = &result->Sup;
	LOC17 = 0;
	LOC17 = pageindex_31570(LOC16);
	incl_31153(a, (&(*a).chunkstarts), LOC17);
	(*a).freemem -= size;
	return result;
}

N_NIMCALL(Smallchunk29840*, getsmallchunk_36412)(Memregion29888* a) {
	Smallchunk29840* result;
	Bigchunk29842* res;
	result = 0;
	res = getbigchunk_35614(a, ((NI) 4096));
	result = ((Smallchunk29840*) (res));
	return result;
}

static N_INLINE(void, listadd_38016)(Smallchunk29840** head, Smallchunk29840* c) {
	(*c).next = (*head);
	{
		if (!!(((*head) == NIM_NIL))) goto LA3;
		(*(*head)).prev = c;
	}
	LA3: ;
	(*head) = c;
}

static N_INLINE(void, listremove_40802)(Smallchunk29840** head, Smallchunk29840* c) {
	{
		if (!(c == (*head))) goto LA3;
		(*head) = (*c).next;
		{
			if (!!(((*head) == NIM_NIL))) goto LA7;
			(*(*head)).prev = NIM_NIL;
		}
		LA7: ;
	}
	goto LA1;
	LA3: ;
	{
		(*(*c).prev).next = (*c).next;
		{
			if (!!(((*c).next == NIM_NIL))) goto LA12;
			(*(*c).next).prev = (*c).prev;
		}
		LA12: ;
	}
	LA1: ;
	(*c).next = NIM_NIL;
	(*c).prev = NIM_NIL;
}

N_NIMCALL(Avlnode29886*, allocavlnode_30227)(Memregion29888* a, NI key, NI upperbound) {
	Avlnode29886* result;
	result = 0;
	{
		if (!!(((*a).freeavlnodes == NIM_NIL))) goto LA3;
		result = (*a).freeavlnodes;
		(*a).freeavlnodes = (*(*a).freeavlnodes).link[(((NI) 0))- 0];
	}
	goto LA1;
	LA3: ;
	{
		void* LOC6;
		LOC6 = 0;
		LOC6 = llalloc_30043(a, ((NI)sizeof(Avlnode29886)));
		result = ((Avlnode29886*) (LOC6));
	}
	LA1: ;
	(*result).key = key;
	(*result).upperbound = upperbound;
	(*result).link[(((NI) 0))- 0] = bottom_29920;
	(*result).link[(((NI) 1))- 0] = bottom_29920;
	(*result).level = ((NI) 1);
	return result;
}

N_NIMCALL(void, skew_30934)(Avlnode29886** t) {
	{
		Avlnode29886* temp;
		if (!((*(*(*t)).link[(((NI) 0))- 0]).level == (*(*t)).level)) goto LA3;
		temp = (*t);
		(*t) = (*(*t)).link[(((NI) 0))- 0];
		(*temp).link[(((NI) 0))- 0] = (*(*t)).link[(((NI) 1))- 0];
		(*(*t)).link[(((NI) 1))- 0] = temp;
	}
	LA3: ;
}

N_NIMCALL(void, split_30939)(Avlnode29886** t) {
	{
		Avlnode29886* temp;
		if (!((*(*(*(*t)).link[(((NI) 1))- 0]).link[(((NI) 1))- 0]).level == (*(*t)).level)) goto LA3;
		temp = (*t);
		(*t) = (*(*t)).link[(((NI) 1))- 0];
		(*temp).link[(((NI) 1))- 0] = (*(*t)).link[(((NI) 0))- 0];
		(*(*t)).link[(((NI) 0))- 0] = temp;
		(*(*t)).level += ((NI) 1);
	}
	LA3: ;
}

N_NIMCALL(void, add_30953)(Memregion29888* a, Avlnode29886** t, NI key, NI upperbound) {
	{
		if (!((*t) == bottom_29920)) goto LA3;
		(*t) = allocavlnode_30227(a, key, upperbound);
	}
	goto LA1;
	LA3: ;
	{
		{
			if (!((NU64)(key) < (NU64)((*(*t)).key))) goto LA8;
			add_30953(a, &(*(*t)).link[(((NI) 0))- 0], key, upperbound);
		}
		goto LA6;
		LA8: ;
		{
			if (!((NU64)((*(*t)).key) < (NU64)(key))) goto LA11;
			add_30953(a, &(*(*t)).link[(((NI) 1))- 0], key, upperbound);
		}
		goto LA6;
		LA11: ;
		{
		}
		LA6: ;
		skew_30934(t);
		split_30939(t);
	}
	LA1: ;
}

N_NIMCALL(void*, rawalloc_37068)(Memregion29888* a, NI requestedsize) {
	void* result;
	NI size;
	result = 0;
	size = roundup_28401(requestedsize, ((NI) 8));
	{
		NI s;
		Smallchunk29840* c;
		if (!(size <= (NI)(((NI) 4096) - (NI)(((NI)sizeof(Smallchunk29840)) - ((NI) 8))))) goto LA3;
		s = (NI)(size / ((NI) 8));
		c = (*a).freesmallchunks[(s)- 0];
		{
			if (!(c == NIM_NIL)) goto LA7;
			c = getsmallchunk_36412(a);
			(*c).freelist = NIM_NIL;
			(*c).Sup.size = size;
			(*c).acc = size;
			(*c).free = (NI)((NI)(((NI) 4096) - (NI)(((NI)sizeof(Smallchunk29840)) - ((NI) 8))) - size);
			(*c).next = NIM_NIL;
			(*c).prev = NIM_NIL;
			listadd_38016(&(*a).freesmallchunks[(s)- 0], c);
			result = ((void*) ((&(*c).data)));
		}
		goto LA5;
		LA7: ;
		{
			{
				if (!((*c).freelist == NIM_NIL)) goto LA12;
				result = ((void*) ((NI)((NU64)(((NI) ((&(*c).data)))) + (NU64)((*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_40802(&(*a).freesmallchunks[(s)- 0], c);
		}
		LA17: ;
	}
	goto LA1;
	LA3: ;
	{
		Bigchunk29842* c;
		size = roundup_28401((NI)(requestedsize + (NI)(((NI)sizeof(Bigchunk29842)) - ((NI) 8))), ((NI) 4096));
		c = getbigchunk_35614(a, size);
		result = ((void*) ((&(*c).data)));
		{
			if (!((*a).root == NIM_NIL)) goto LA22;
			(*a).root = bottom_29920;
		}
		LA22: ;
		add_30953(a, &(*a).root, ((NI) (result)), (NI)((NU64)(((NI) (result))) + (NU64)(size)));
	}
	LA1: ;
	return result;
}

N_NIMCALL(void*, alloc_46240)(Memregion29888* allocator, NI size) {
	void* result;
	result = 0;
	result = rawalloc_37068(allocator, (NI)(((NI) (size)) + ((NI)sizeof(Freecell29830))));
	(*((Freecell29830*) (result))).zerofield = ((NI) 1);
	result = ((void*) ((NI)((NU64)(((NI) (result))) + (NU64)(((NI)sizeof(Freecell29830))))));
	return result;
}

N_NIMCALL(void*, alloc0_46416)(Memregion29888* allocator, NI size) {
	void* result;
	result = 0;
	result = alloc_46240(allocator, size);
	zeroMem(result, size);
	return result;
}

N_NOCONV(void*, alloc0_7417)(NI size) {
	void* result;
	result = 0;
	result = alloc0_46416((&gch_50059.region), size);
	return result;
}

N_NIMCALL(void, init_47803)(Cellseq47721* s, NI cap) {
	void* LOC1;
	(*s).len = ((NI) 0);
	(*s).cap = cap;
	LOC1 = 0;
	LOC1 = alloc0_7417(((NI) ((NI)(cap * ((NI) 8)))));
	(*s).d = ((Cell47705**) (LOC1));
}

N_NIMCALL(void, init_47818)(Cellset47717* s) {
	void* LOC1;
	LOC1 = 0;
	LOC1 = alloc0_7417(((NI) 8192));
	(*s).data = ((Pagedesc47713**) (LOC1));
	(*s).max = ((NI) 1023);
	(*s).counter = ((NI) 0);
	(*s).head = NIM_NIL;
}

N_NIMCALL(void, initgc_11401)(void) {
	gch_50059.cyclethreshold = ((NI) 4194304);
	gch_50059.stat.stackscans = ((NI) 0);
	gch_50059.stat.cyclecollections = ((NI) 0);
	gch_50059.stat.maxthreshold = ((NI) 0);
	gch_50059.stat.maxstacksize = ((NI) 0);
	gch_50059.stat.maxstackcells = ((NI) 0);
	gch_50059.stat.cycletablesize = ((NI) 0);
	init_47803((&gch_50059.zct), ((NI) 1024));
	init_47803((&gch_50059.tempstack), ((NI) 1024));
	init_47818((&gch_50059.cycleroots));
	init_47803((&gch_50059.decstack), ((NI) 1024));
}

N_NOINLINE(NI, stacksize_71801)(void) {
	NI result;
	void* volatile stacktop;
	result = 0;
	stacktop = 0;
	result = ((NI)(((NI) ((&stacktop))) - ((NI) (gch_50059.stackbottom))) > 0? ((NI)(((NI) ((&stacktop))) - ((NI) (gch_50059.stackbottom)))) : -((NI)(((NI) ((&stacktop))) - ((NI) (gch_50059.stackbottom)))));
	return result;
}

static N_INLINE(NI, getoccupiedmem_47630)(Memregion29888* a) {
	NI result;
	result = 0;
	result = (NI)((*a).currmem - (*a).freemem);
	return result;
}

N_NIMCALL(NI, lowgauge_30812)(Avlnode29886* n) {
	NI result;
	Avlnode29886* it;
	result = 0;
	it = n;
	{
		while (1) {
			if (!!((it == bottom_29920))) goto LA2;
			result = (*it).key;
			it = (*it).link[(((NI) 0))- 0];
		} LA2: ;
	}
	return result;
}

N_NIMCALL(NI, highgauge_30829)(Avlnode29886* n) {
	NI result;
	Avlnode29886* it;
	result = 0;
	result = ((NI) -1);
	it = n;
	{
		while (1) {
			if (!!((it == bottom_29920))) goto LA2;
			result = (*it).upperbound;
			it = (*it).link[(((NI) 1))- 0];
		} LA2: ;
	}
	return result;
}

static N_INLINE(void, prepareforinteriorpointerchecking_45088)(Memregion29888* a) {
	(*a).minlargeobj = lowgauge_30812((*a).root);
	(*a).maxlargeobj = highgauge_30829((*a).root);
}

static N_INLINE(Cell47705*, usrtocell_51640)(void* usr) {
	Cell47705* result;
	result = 0;
	result = ((Cell47705*) ((NI)((NU64)(((NI) (usr))) - (NU64)(((NI)sizeof(Cell47705))))));
	return result;
}

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

static N_INLINE(NIM_BOOL, chunkunused_31489)(Basechunk29838* c) {
	NIM_BOOL result;
	result = 0;
	result = !((*c).used);
	return result;
}

static N_INLINE(NIM_BOOL, issmallchunk_31469)(Basechunk29838* c) {
	NIM_BOOL result;
{	result = 0;
	result = ((*c).size <= (NI)(((NI) 4096) - (NI)(((NI)sizeof(Smallchunk29840)) - ((NI) 8))));
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Avlnode29886*, inrange_30881)(Avlnode29886* root, NI key) {
	Avlnode29886* result;
	Avlnode29886* it;
{	result = 0;
	it = root;
	{
		while (1) {
			if (!!((it == bottom_29920))) goto LA2;
			{
				NIM_BOOL LOC5;
				LOC5 = 0;
				LOC5 = ((NU64)((*it).key) <= (NU64)(key));
				if (!(LOC5)) goto LA6;
				LOC5 = ((NU64)(key) < (NU64)((*it).upperbound));
				LA6: ;
				if (!LOC5) goto LA7;
				result = it;
				goto BeforeRet;
			}
			LA7: ;
			it = (*it).link[(((NU64)((*it).key) < (NU64)(key)))- 0];
		} LA2: ;
	}
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void*, interiorallocatedptr_45092)(Memregion29888* a, void* p) {
	void* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		Basechunk29838* c_45097;
		LOC3 = 0;
		LOC3 = isaccessible_32415(a, p);
		if (!LOC3) goto LA4;
		c_45097 = pageaddr_31580(p);
		{
			NIM_BOOL LOC8;
			LOC8 = 0;
			LOC8 = chunkunused_31489(c_45097);
			if (!!(LOC8)) goto LA9;
			{
				NIM_BOOL LOC13;
				Smallchunk29840* c;
				NI offset;
				LOC13 = 0;
				LOC13 = issmallchunk_31469(c_45097);
				if (!LOC13) goto LA14;
				c = ((Smallchunk29840*) (c_45097));
				offset = (NI)((NU64)(((NI) ((NI)(((NI) (p)) & ((NI) 4095))))) - (NU64)((NI)(((NI)sizeof(Smallchunk29840)) - ((NI) 8))));
				{
					Freecell29830* d;
					if (!((NU64)(offset) < (NU64)((*c).acc))) goto LA18;
					d = ((Freecell29830*) ((NI)((NU64)((NI)((NU64)(((NI) ((&(*c).data)))) + (NU64)(offset))) - (NU64)((NI)((NU64)(offset) % (NU64)((*c).Sup.size))))));
					{
						if (!((NU64)(((NI) 1)) < (NU64)((*d).zerofield))) goto LA22;
						result = ((void*) (d));
					}
					LA22: ;
				}
				LA18: ;
			}
			goto LA11;
			LA14: ;
			{
				Bigchunk29842* c;
				NF* d;
				c = ((Bigchunk29842*) (c_45097));
				d = (&(*c).data);
				{
					NIM_BOOL LOC27;
					LOC27 = 0;
					LOC27 = (((void*) (d)) <= p);
					if (!(LOC27)) goto LA28;
					LOC27 = ((NU64)(((NI) 1)) < (NU64)((*((Freecell29830*) (d))).zerofield));
					LA28: ;
					if (!LOC27) goto LA29;
					result = ((void*) (d));
				}
				LA29: ;
			}
			LA11: ;
		}
		LA9: ;
	}
	goto LA1;
	LA4: ;
	{
		NI q;
		q = ((NI) (p));
		{
			NIM_BOOL LOC34;
			Avlnode29886* avlnode;
			LOC34 = 0;
			LOC34 = ((NU64)((*a).minlargeobj) <= (NU64)(q));
			if (!(LOC34)) goto LA35;
			LOC34 = ((NU64)(q) <= (NU64)((*a).maxlargeobj));
			LA35: ;
			if (!LOC34) goto LA36;
			avlnode = inrange_30881((*a).root, q);
			{
				void* k;
				Bigchunk29842* c;
				Basechunk29838* LOC42;
				if (!!((avlnode == NIM_NIL))) goto LA40;
				k = ((void*) ((*avlnode).key));
				LOC42 = 0;
				LOC42 = pageaddr_31580(k);
				c = ((Bigchunk29842*) (LOC42));
				{
					if (!((NU64)(((NI) 1)) < (NU64)((*((Freecell29830*) (k))).zerofield))) goto LA45;
					result = k;
				}
				LA45: ;
			}
			LA40: ;
		}
		LA36: ;
	}
	LA1: ;
	return result;
}

N_NOCONV(void*, alloc_7401)(NI size) {
	void* result;
	result = 0;
	result = alloc_46240((&gch_50059.region), size);
	return result;
}

N_NIMCALL(void, excl_31164)(Intset29814* s, NI key) {
	Trunk29810* t;
	t = intsetget_31083((&(*s)), (NI)((NU64)(key) >> (NU64)(((NI) 9))));
	{
		NI u;
		if (!!((t == NIM_NIL))) goto LA3;
		u = (NI)(key & ((NI) 511));
		(*t).bits[((NI)((NU64)(((NI) (u))) >> (NU64)(((NI) 6))))- 0] = (NI)((*t).bits[((NI)((NU64)(((NI) (u))) >> (NU64)(((NI) 6))))- 0] & (NI)((NU64) ~((NI)((NU64)(((NI) 1)) << (NU64)(((NI) ((NI)(((NI) (u)) & ((NI) 63)))))))));
	}
	LA3: ;
}

static N_INLINE(void, osdeallocpages_29621)(void* p, NI size) {
	munmap(p, size);
}

static N_INLINE(void, deccurrmem_30016)(Memregion29888* a, NI bytes) {
	(*a).maxmem = (((*a).maxmem >= (*a).currmem) ? (*a).maxmem : (*a).currmem);
	(*a).currmem -= bytes;
}

N_NIMCALL(void, freeoschunks_32207)(Memregion29888* a, void* p, NI size) {
	Basechunk29838* c;
	NI nxt;
	Basechunk29838* next;
	NI LOC7;
	c = ((Basechunk29838*) (p));
	nxt = (NI)((NU64)(((NI) (p))) + (NU64)((*c).size));
	next = ((Basechunk29838*) (nxt));
	{
		NI LOC3;
		NIM_BOOL LOC4;
		LOC3 = 0;
		LOC3 = pageindex_31570(next);
		LOC4 = 0;
		LOC4 = contains_31132((&(*a).chunkstarts), LOC3);
		if (!LOC4) goto LA5;
		(*next).prevsize = ((NI) 0);
	}
	LA5: ;
	LOC7 = 0;
	LOC7 = pageindex_31575(p);
	excl_31164((&(*a).chunkstarts), LOC7);
	osdeallocpages_29621(p, size);
	deccurrmem_30016(a, size);
	(*a).freemem -= size;
}

N_NIMCALL(void, freebigchunk_32603)(Memregion29888* a, Bigchunk29842* c_32607) {
	Bigchunk29842* c;
	Basechunk29838* ri;
	c = c_32607;
	(*a).freemem += (*c).Sup.size;
	ri = ((Basechunk29838*) ((NI)((NU64)(((NI) (c))) + (NU64)((*c).Sup.size))));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = isaccessible_32415((&(*a)), ((void*) (ri)));
		if (!(LOC3)) goto LA4;
		LOC3 = chunkunused_31489(ri);
		LA4: ;
		if (!LOC3) goto LA5;
		{
			NIM_BOOL LOC9;
			NI LOC12;
			LOC9 = 0;
			LOC9 = issmallchunk_31469(ri);
			if (!!(LOC9)) goto LA10;
			listremove_33402(&(*a).freechunkslist, ((Bigchunk29842*) (ri)));
			(*c).Sup.size += (*ri).size;
			LOC12 = 0;
			LOC12 = pageindex_31570(ri);
			excl_31164((&(*a).chunkstarts), LOC12);
		}
		LA10: ;
	}
	LA5: ;
	{
		Basechunk29838* le;
		if (!!(((*c).Sup.prevsize == ((NI) 0)))) goto LA15;
		le = ((Basechunk29838*) ((NI)((NU64)(((NI) (c))) - (NU64)((*c).Sup.prevsize))));
		{
			NIM_BOOL LOC19;
			LOC19 = 0;
			LOC19 = isaccessible_32415((&(*a)), ((void*) (le)));
			if (!(LOC19)) goto LA20;
			LOC19 = chunkunused_31489(le);
			LA20: ;
			if (!LOC19) goto LA21;
			{
				NIM_BOOL LOC25;
				Basechunk29838* LOC28;
				NI LOC29;
				LOC25 = 0;
				LOC25 = issmallchunk_31469(le);
				if (!!(LOC25)) goto LA26;
				listremove_33402(&(*a).freechunkslist, ((Bigchunk29842*) (le)));
				(*le).size += (*c).Sup.size;
				LOC28 = 0;
				LOC28 = &c->Sup;
				LOC29 = 0;
				LOC29 = pageindex_31570(LOC28);
				excl_31164((&(*a).chunkstarts), LOC29);
				c = ((Bigchunk29842*) (le));
			}
			LA26: ;
		}
		LA21: ;
	}
	LA15: ;
	{
		NIM_BOOL LOC32;
		Basechunk29838* LOC36;
		NI LOC37;
		LOC32 = 0;
		LOC32 = ((*c).Sup.size < ((NI) 1048576));
		if (LOC32) goto LA33;
		LOC32 = NIM_FALSE;
		LA33: ;
		if (!LOC32) goto LA34;
		LOC36 = 0;
		LOC36 = &c->Sup;
		LOC37 = 0;
		LOC37 = pageindex_31570(LOC36);
		incl_31153(a, (&(*a).chunkstarts), LOC37);
		updateprevsize_32468(a, c, (*c).Sup.size);
		listadd_34623(&(*a).freechunkslist, c);
		(*c).Sup.used = NIM_FALSE;
	}
	goto LA30;
	LA34: ;
	{
		freeoschunks_32207(a, ((void*) (c)), (*c).Sup.size);
	}
	LA30: ;
}

static N_INLINE(void, deallocavlnode_30803)(Memregion29888* a, Avlnode29886* n) {
	(*n).link[(((NI) 0))- 0] = (*a).freeavlnodes;
	(*a).freeavlnodes = n;
}

N_NIMCALL(void, del_31001)(Memregion29888* a, Avlnode29886** t, NI x) {
{	{
		if (!((*t) == bottom_29920)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	(*a).last = (*t);
	{
		if (!((NU64)(x) < (NU64)((*(*t)).key))) goto LA7;
		del_31001(a, &(*(*t)).link[(((NI) 0))- 0], x);
	}
	goto LA5;
	LA7: ;
	{
		(*a).deleted = (*t);
		del_31001(a, &(*(*t)).link[(((NI) 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_29920));
		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_29920;
		(*t) = (*(*t)).link[(((NI) 1))- 0];
		deallocavlnode_30803(a, (*a).last);
	}
	goto LA10;
	LA16: ;
	{
		NIM_BOOL LOC19;
		LOC19 = 0;
		LOC19 = ((*(*(*t)).link[(((NI) 0))- 0]).level < (NI)((*(*t)).level - ((NI) 1)));
		if (LOC19) goto LA20;
		LOC19 = ((*(*(*t)).link[(((NI) 1))- 0]).level < (NI)((*(*t)).level - ((NI) 1)));
		LA20: ;
		if (!LOC19) goto LA21;
		(*(*t)).level -= ((NI) 1);
		{
			if (!((*(*t)).level < (*(*(*t)).link[(((NI) 1))- 0]).level)) goto LA25;
			(*(*(*t)).link[(((NI) 1))- 0]).level = (*(*t)).level;
		}
		LA25: ;
		skew_30934(t);
		skew_30934(&(*(*t)).link[(((NI) 1))- 0]);
		skew_30934(&(*(*(*t)).link[(((NI) 1))- 0]).link[(((NI) 1))- 0]);
		split_30939(t);
		split_30939(&(*(*t)).link[(((NI) 1))- 0]);
	}
	goto LA10;
	LA21: ;
	LA10: ;
	}BeforeRet: ;
}

N_NIMCALL(void, rawdealloc_43417)(Memregion29888* a, void* p) {
	Basechunk29838* c_43601;
	c_43601 = pageaddr_31580(p);
	{
		NIM_BOOL LOC3;
		Smallchunk29840* c;
		NI s;
		Freecell29830* f;
		LOC3 = 0;
		LOC3 = issmallchunk_31469(c_43601);
		if (!LOC3) goto LA4;
		c = ((Smallchunk29840*) (c_43601));
		s = (*c).Sup.size;
		f = ((Freecell29830*) (p));
		(*f).zerofield = ((NI) 0);
		(*f).next = (*c).freelist;
		(*c).freelist = f;
		{
			if (!((*c).free < s)) goto LA8;
			listadd_38016(&(*a).freesmallchunks[((NI)(s / ((NI) 8)))- 0], c);
			(*c).free += s;
		}
		goto LA6;
		LA8: ;
		{
			(*c).free += s;
			{
				if (!((*c).free == (NI)(((NI) 4096) - (NI)(((NI)sizeof(Smallchunk29840)) - ((NI) 8))))) goto LA13;
				listremove_40802(&(*a).freesmallchunks[((NI)(s / ((NI) 8)))- 0], c);
				(*c).Sup.size = ((NI) 4096);
				freebigchunk_32603(a, ((Bigchunk29842*) (c)));
			}
			LA13: ;
		}
		LA6: ;
	}
	goto LA1;
	LA4: ;
	{
		Bigchunk29842* c;
		c = ((Bigchunk29842*) (c_43601));
		(*a).deleted = bottom_29920;
		del_31001(a, &(*a).root, ((NI) ((&(*c).data))));
		freebigchunk_32603(a, c);
	}
	LA1: ;
}

N_NIMCALL(void, dealloc_46422)(Memregion29888* allocator, void* p) {
	void* x;
	x = ((void*) ((NI)((NU64)(((NI) (p))) - (NU64)(((NI)sizeof(Freecell29830))))));
	rawdealloc_43417(allocator, x);
}

N_NOCONV(void, dealloc_7448)(void* p) {
	dealloc_46422((&gch_50059.region), p);
}

static N_INLINE(void, add_47783)(Cellseq47721* s, Cell47705* c) {
	{
		Cell47705** d;
		void* LOC5;
		if (!((*s).cap <= (*s).len)) goto LA3;
		(*s).cap = (NI)((NI)((*s).cap * ((NI) 3)) / ((NI) 2));
		LOC5 = 0;
		LOC5 = alloc_7401(((NI) ((NI)((*s).cap * ((NI) 8)))));
		d = ((Cell47705**) (LOC5));
		memcpy(((void*) (d)), ((void*) ((*s).d)), ((NI) ((NI)((*s).len * ((NI) 8)))));
		dealloc_7448(((void*) ((*s).d)));
		(*s).d = d;
	}
	LA3: ;
	(*s).d[((*s).len)- 0] = c;
	(*s).len += ((NI) 1);
}

static N_INLINE(void, gcmark_70816)(Gcheap50018* gch, void* p) {
	Cell47705* cell;
	NI c;
	cell = usrtocell_51640(p);
	c = ((NI) (cell));
	{
		Cell47705* objstart;
		void* LOC5;
		if (!((NU64)(((NI) 4096)) < (NU64)(c))) goto LA3;
		LOC5 = 0;
		LOC5 = interiorallocatedptr_45092((&(*gch).region), ((void*) (cell)));
		objstart = ((Cell47705*) (LOC5));
		{
			if (!!((objstart == NIM_NIL))) goto LA8;
			(*objstart).refcount = (NI)((NU64)((*objstart).refcount) + (NU64)(((NI) 8)));
			add_47783((&(*gch).decstack), objstart);
		}
		LA8: ;
	}
	LA3: ;
}

N_CDECL(void, markstackandregisters_73037)(Gcheap50018* gch) {
	jmp_buf registers;
	{
		int LOC3;
		NI max;
		NI sp;
		NI regend;
		LOC3 = 0;
		LOC3 = _setjmp(registers);
		if (!(LOC3 == ((NI32) 0))) goto LA4;
		max = ((NI) ((*gch).stackbottom));
		sp = ((NI) ((&registers)));
		regend = (NI)((NU64)(sp) + (NU64)(((NI)sizeof(jmp_buf))));
		{
			while (1) {
				if (!((NU64)(sp) < (NU64)(regend))) goto LA7;
				gcmark_70816(gch, (*((void**) (sp))));
				gcmark_70816(gch, (*((void**) ((NI)((NU64)(sp) + (NU64)(((NI) 4)))))));
				sp = (NI)((NU64)(sp) + (NU64)(((NI) 8)));
			} LA7: ;
		}
		sp = (NI)(sp & ((NI) -8));
		{
			while (1) {
				if (!((NU64)(sp) < (NU64)((NI)(max - ((NI) 64))))) goto LA9;
				gcmark_70816(gch, ((void**) (sp))[(((NI) 0))- 0]);
				gcmark_70816(gch, ((void**) (sp))[(((NI) 1))- 0]);
				gcmark_70816(gch, ((void**) (sp))[(((NI) 2))- 0]);
				gcmark_70816(gch, ((void**) (sp))[(((NI) 3))- 0]);
				gcmark_70816(gch, ((void**) (sp))[(((NI) 4))- 0]);
				gcmark_70816(gch, ((void**) (sp))[(((NI) 5))- 0]);
				gcmark_70816(gch, ((void**) (sp))[(((NI) 6))- 0]);
				gcmark_70816(gch, ((void**) (sp))[(((NI) 7))- 0]);
				sp = (NI)((NU64)(sp) + (NU64)(((NI) 64)));
			} LA9: ;
		}
		{
			while (1) {
				if (!((NU64)(sp) <= (NU64)(max))) goto LA11;
				gcmark_70816(gch, (*((void**) (sp))));
				sp = (NI)((NU64)(sp) + (NU64)(((NI) 8)));
			} LA11: ;
		}
	}
	LA4: ;
}

N_NIMCALL(void, markthreadstacks_71403)(Gcheap50018* gch) {
}

static N_INLINE(NIM_BOOL, canbecycleroot_51658)(Cell47705* c) {
	NIM_BOOL result;
	result = 0;
	result = !((((*(*c).typ).flags &(1U<<((NU)(((NU8) 1))&7U)))!=0));
	return result;
}

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

N_NIMCALL(Pagedesc47713*, cellsetget_47850)(Cellset47717* t, NI key) {
	Pagedesc47713* 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_47845(h, (*t).max);
		} LA2: ;
	}
	result = NIM_NIL;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, excl_48474)(Cellset47717* s, Cell47705* cell) {
	NI u;
	Pagedesc47713* t;
	u = ((NI) (cell));
	t = cellsetget_47850((&(*s)), (NI)((NU64)(u) >> (NU64)(((NI) 12))));
	{
		if (!!((t == NIM_NIL))) goto LA3;
		u = (NI)((NU64)((NI)((NU64)(u) % (NU64)(((NI) 4096)))) / (NU64)(((NI) 8)));
		(*t).bits[((NI)((NU64)(u) >> (NU64)(((NI) 6))))- 0] = (NI)((*t).bits[((NI)((NU64)(u) >> (NU64)(((NI) 6))))- 0] & (NI)((NU64) ~((NI)((NU64)(((NI) 1)) << (NU64)(((NI) ((NI)(u & ((NI) 63)))))))));
	}
	LA3: ;
}

static N_INLINE(void*, celltousr_51622)(Cell47705* cell) {
	void* result;
	result = 0;
	result = ((void*) ((NI)((NU64)(((NI) (cell))) + (NU64)(((NI)sizeof(Cell47705))))));
	return result;
}

N_NIMCALL(void, preparedealloc_52208)(Cell47705* cell) {
	{
		void* LOC5;
		if (!!(((*(*cell).typ).finalizer == NIM_NIL))) goto LA3;
		gch_50059.recgclock += ((NI) 1);
		LOC5 = 0;
		LOC5 = celltousr_51622(cell);
		((Finalizer) ((*(*cell).typ).finalizer))(LOC5);
		gch_50059.recgclock -= ((NI) 1);
	}
	LA3: ;
}

N_NOINLINE(void, addzct_51617)(Cellseq47721* s, Cell47705* c) {
	{
		if (!((NI)((*c).refcount & ((NI) 4)) == ((NI) 0))) goto LA3;
		(*c).refcount = (NI)((*c).refcount | ((NI) 4));
		add_47783(s, c);
	}
	LA3: ;
}

static N_INLINE(void, rtladdzct_53201)(Cell47705* c) {
	addzct_51617((&gch_50059.zct), c);
}

N_NIMCALL(void, cellsetrawinsert_47870)(Cellset47717* t, Pagedesc47713** data, Pagedesc47713* desc) {
	NI h;
	h = (NI)(((NI) ((*desc).key)) & (*t).max);
	{
		while (1) {
			if (!!((data[(h)- 0] == NIM_NIL))) goto LA2;
			h = nexttry_47845(h, (*t).max);
		} LA2: ;
	}
	data[(h)- 0] = desc;
}

N_NIMCALL(void, cellsetenlarge_48203)(Cellset47717* t) {
	NI oldmax;
	Pagedesc47713** n;
	void* LOC1;
	oldmax = (*t).max;
	(*t).max = (NI)((NI)((NI)((*t).max + ((NI) 1)) * ((NI) 2)) - ((NI) 1));
	LOC1 = 0;
	LOC1 = alloc0_7417(((NI) ((NI)((NI)((*t).max + ((NI) 1)) * ((NI) 8)))));
	n = ((Pagedesc47713**) (LOC1));
	{
		NI i_48219;
		NI res_48237;
		i_48219 = 0;
		res_48237 = ((NI) 0);
		{
			while (1) {
				if (!(res_48237 <= oldmax)) goto LA4;
				i_48219 = res_48237;
				{
					if (!!(((*t).data[(i_48219)- 0] == NIM_NIL))) goto LA7;
					cellsetrawinsert_47870((&(*t)), n, (*t).data[(i_48219)- 0]);
				}
				LA7: ;
				res_48237 += ((NI) 1);
			} LA4: ;
		}
	}
	dealloc_7448(((void*) ((*t).data)));
	(*t).data = n;
}

N_NIMCALL(Pagedesc47713*, cellsetput_48241)(Cellset47717* t, NI key) {
	Pagedesc47713* result;
	NI h;
	void* LOC19;
{	result = 0;
	h = (NI)(((NI) (key)) & (*t).max);
	{
		while (1) {
			Pagedesc47713* 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_47845(h, (*t).max);
		}
	} LA1: ;
	{
		NIM_BOOL LOC13;
		LOC13 = 0;
		LOC13 = ((NI)((NI)((*t).max + ((NI) 1)) * ((NI) 2)) < (NI)((*t).counter * ((NI) 3)));
		if (LOC13) goto LA14;
		LOC13 = ((NI)((NI)((*t).max + ((NI) 1)) - (*t).counter) < ((NI) 4));
		LA14: ;
		if (!LOC13) goto LA15;
		cellsetenlarge_48203(t);
	}
	LA15: ;
	(*t).counter += ((NI) 1);
	h = (NI)(((NI) (key)) & (*t).max);
	{
		while (1) {
			if (!!(((*t).data[(h)- 0] == NIM_NIL))) goto LA18;
			h = nexttry_47845(h, (*t).max);
		} LA18: ;
	}
	LOC19 = 0;
	LOC19 = alloc0_7417(((NI) (((NI)sizeof(Pagedesc47713)))));
	result = ((Pagedesc47713*) (LOC19));
	(*result).next = (*t).head;
	(*result).key = key;
	(*t).head = result;
	(*t).data[(h)- 0] = result;
	}BeforeRet: ;
	return result;
}

N_NOINLINE(void, incl_48447)(Cellset47717* s, Cell47705* cell) {
	NI u;
	Pagedesc47713* t;
	u = ((NI) (cell));
	t = cellsetput_48241(s, (NI)((NU64)(u) >> (NU64)(((NI) 12))));
	u = (NI)((NU64)((NI)((NU64)(u) % (NU64)(((NI) 4096)))) / (NU64)(((NI) 8)));
	(*t).bits[((NI)((NU64)(u) >> (NU64)(((NI) 6))))- 0] = (NI)((*t).bits[((NI)((NU64)(u) >> (NU64)(((NI) 6))))- 0] | (NI)((NU64)(((NI) 1)) << (NU64)(((NI) ((NI)(u & ((NI) 63)))))));
}

static N_INLINE(void, rtladdcycleroot_52420)(Cell47705* c) {
	{
		if (!!((((NI) ((NI)((*c).refcount & ((NI) 3)))) == ((NI) 3)))) goto LA3;
		(*c).refcount = (NI)((NI)((*c).refcount & ((NI) -4)) | ((NI) 3));
		incl_48447((&gch_50059.cycleroots), c);
	}
	LA3: ;
}

static N_INLINE(void, decref_53601)(Cell47705* c) {
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU64)((*c).refcount) < (NU64)(((NI) 8)))) goto LA3;
		rtladdzct_53201(c);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = canbecycleroot_51658(c);
		if (!LOC6) goto LA7;
		rtladdcycleroot_52420(c);
	}
	goto LA1;
	LA7: ;
	LA1: ;
}

N_NIMCALL(void, markgray_67202)(Cell47705* s) {
	{
		if (!!((((NI) ((NI)((*s).refcount & ((NI) 3)))) == ((NI) 1)))) goto LA3;
		(*s).refcount = (NI)((NI)((*s).refcount & ((NI) -4)) | ((NI) 1));
		forallchildren_52014(s, ((NU8) 5));
	}
	LA3: ;
}

N_NIMCALL(void, scanblack_67401)(Cell47705* s) {
	(*s).refcount = (NI)((*s).refcount & ((NI) -4));
	forallchildren_52014(s, ((NU8) 7));
}

N_NIMCALL(void, scan_67601)(Cell47705* s) {
	{
		if (!(((NI) ((NI)((*s).refcount & ((NI) 3)))) == ((NI) 1))) goto LA3;
		{
			if (!((NU64)(((NI) 8)) <= (NU64)((*s).refcount))) goto LA7;
			scanblack_67401(s);
		}
		goto LA5;
		LA7: ;
		{
			(*s).refcount = (NI)((NI)((*s).refcount & ((NI) -4)) | ((NI) 2));
			forallchildren_52014(s, ((NU8) 6));
		}
		LA5: ;
	}
	LA3: ;
}

N_NIMCALL(NIM_BOOL, isallocatedptr_36802)(Memregion29888* a, void* p) {
	NIM_BOOL result;
	result = 0;
	{
		NIM_BOOL LOC3;
		Basechunk29838* c_45013;
		LOC3 = 0;
		LOC3 = isaccessible_32415(a, p);
		if (!LOC3) goto LA4;
		c_45013 = pageaddr_31580(p);
		{
			NIM_BOOL LOC8;
			LOC8 = 0;
			LOC8 = chunkunused_31489(c_45013);
			if (!!(LOC8)) goto LA9;
			{
				NIM_BOOL LOC13;
				Smallchunk29840* c;
				NI offset;
				NIM_BOOL LOC16;
				NIM_BOOL LOC17;
				LOC13 = 0;
				LOC13 = issmallchunk_31469(c_45013);
				if (!LOC13) goto LA14;
				c = ((Smallchunk29840*) (c_45013));
				offset = (NI)((NU64)(((NI) ((NI)(((NI) (p)) & ((NI) 4095))))) - (NU64)((NI)(((NI)sizeof(Smallchunk29840)) - ((NI) 8))));
				LOC16 = 0;
				LOC17 = 0;
				LOC17 = ((NU64)(offset) < (NU64)((*c).acc));
				if (!(LOC17)) goto LA18;
				LOC17 = ((NI)((NU64)(offset) % (NU64)((*c).Sup.size)) == ((NI) 0));
				LA18: ;
				LOC16 = LOC17;
				if (!(LOC16)) goto LA19;
				LOC16 = ((NU64)(((NI) 1)) < (NU64)((*((Freecell29830*) (p))).zerofield));
				LA19: ;
				result = LOC16;
			}
			goto LA11;
			LA14: ;
			{
				Bigchunk29842* c;
				NIM_BOOL LOC21;
				c = ((Bigchunk29842*) (c_45013));
				LOC21 = 0;
				LOC21 = (p == ((void*) ((&(*c).data))));
				if (!(LOC21)) goto LA22;
				LOC21 = ((NU64)(((NI) 1)) < (NU64)((*((Freecell29830*) (p))).zerofield));
				LA22: ;
				result = LOC21;
			}
			LA11: ;
		}
		LA9: ;
	}
	LA4: ;
	return result;
}

N_NIMCALL(void, freecycliccell_66415)(Gcheap50018* gch, Cell47705* c) {
	preparedealloc_52208(c);
	rawdealloc_43417((&(*gch).region), ((void*) (c)));
}

N_NIMCALL(void, collectwhite_67801)(Cell47705* s) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = isallocatedptr_36802((&gch_50059.region), ((void*) (s)));
		if (!(LOC3)) goto LA4;
		LOC3 = (((NI) ((NI)((*s).refcount & ((NI) 3)))) == ((NI) 2));
		LA4: ;
		if (!LOC3) goto LA5;
		(*s).refcount = (NI)((*s).refcount & ((NI) -4));
		forallchildren_52014(s, ((NU8) 8));
		freecycliccell_66415((&gch_50059), s);
	}
	LA5: ;
}

N_NIMCALL(void, dooperation_52018)(void* p, NU8 op) {
	Cell47705* c;
{	{
		if (!(p == NIM_NIL)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	c = usrtocell_51640(p);
	switch (op) {
	case ((NU8) 2):
	{
		decref_53601(c);
	}
	break;
	case ((NU8) 3):
	{
		add_47783((&gch_50059.tempstack), c);
	}
	break;
	case ((NU8) 4):
	{
		(*c).refcount = (NI)((NU64)((*c).refcount) - (NU64)(((NI) 8)));
	}
	break;
	case ((NU8) 5):
	{
		(*c).refcount = (NI)((NU64)((*c).refcount) - (NU64)(((NI) 8)));
		markgray_67202(c);
	}
	break;
	case ((NU8) 6):
	{
		scan_67601(c);
	}
	break;
	case ((NU8) 7):
	{
		(*c).refcount = (NI)((NU64)((*c).refcount) + (NU64)(((NI) 8)));
		{
			if (!!((((NI) ((NI)((*c).refcount & ((NI) 3)))) == ((NI) 0)))) goto LA13;
			scanblack_67401(c);
		}
		LA13: ;
	}
	break;
	case ((NU8) 8):
	{
		collectwhite_67801(c);
	}
	break;
	case ((NU8) 0):
	{
	}
	break;
	case ((NU8) 1):
	{
	}
	break;
	}
	}BeforeRet: ;
}

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

N_NIMCALL(TNimNode*, selectbranch_27807)(void* aa, TNimNode* n) {
	TNimNode* result;
	NI discr;
	result = 0;
	discr = getdiscriminant_27404(aa, n);
	{
		if (!((NU64)(discr) < (NU64)((*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_56205)(void* dest, TNimNode* n, NU8 op) {
	NI d;
	d = ((NI) (dest));
	switch ((*n).kind) {
	case ((NU8) 1):
	{
		forallchildrenaux_52022(((void*) ((NI)((NU64)(d) + (NU64)((*n).offset)))), (*n).typ, op);
	}
	break;
	case ((NU8) 2):
	{
		{
			NI i_56230;
			NI HEX3Atmp_56406;
			NI res_56409;
			i_56230 = 0;
			HEX3Atmp_56406 = 0;
			HEX3Atmp_56406 = (NI)((*n).len - ((NI) 1));
			res_56409 = ((NI) 0);
			{
				while (1) {
					if (!(res_56409 <= HEX3Atmp_56406)) goto LA5;
					i_56230 = res_56409;
					{
						if (!((*(*n).sons[(i_56230)- 0]).kind == ((NU8) 1))) goto LA8;
						{
							if (!((289406976 &((NU64)1<<((NU)((*(*(*n).sons[(i_56230)- 0]).typ).kind)&63U)))!=0)) goto LA12;
							dooperation_52018((*((void**) ((NI)((NU64)(d) + (NU64)((*(*n).sons[(i_56230)- 0]).offset))))), op);
						}
						goto LA10;
						LA12: ;
						{
							forallchildrenaux_52022(((void*) ((NI)((NU64)(d) + (NU64)((*(*n).sons[(i_56230)- 0]).offset)))), (*(*n).sons[(i_56230)- 0]).typ, op);
						}
						LA10: ;
					}
					goto LA6;
					LA8: ;
					{
						forallslotsaux_56205(dest, (*n).sons[(i_56230)- 0], op);
					}
					LA6: ;
					res_56409 += ((NI) 1);
				} LA5: ;
			}
		}
	}
	break;
	case ((NU8) 3):
	{
		TNimNode* m;
		m = selectbranch_27807(dest, n);
		{
			if (!!((m == NIM_NIL))) goto LA19;
			forallslotsaux_56205(dest, m, op);
		}
		LA19: ;
	}
	break;
	case ((NU8) 0):
	{
	}
	break;
	}
}

N_NIMCALL(void, forallchildrenaux_52022)(void* dest, TNimType* mt, NU8 op) {
	NI d;
{	d = ((NI) (dest));
	{
		if (!(dest == NIM_NIL)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	{
		if (!!((((*mt).flags &(1U<<((NU)(((NU8) 0))&7U)))!=0))) goto LA7;
		switch ((*mt).kind) {
		case ((NU8) 22):
		case ((NU8) 28):
		case ((NU8) 24):
		{
			dooperation_52018((*((void**) (d))), op);
		}
		break;
		case ((NU8) 17):
		case ((NU8) 18):
		{
			forallslotsaux_56205(dest, (*mt).node, op);
		}
		break;
		case ((NU8) 16):
		case ((NU8) 4):
		case ((NU8) 27):
		{
			{
				NI i_56438;
				NI HEX3Atmp_56461;
				NI res_56464;
				i_56438 = 0;
				HEX3Atmp_56461 = 0;
				HEX3Atmp_56461 = (NI)((NI)((*mt).size / (*(*mt).base).size) - ((NI) 1));
				res_56464 = ((NI) 0);
				{
					while (1) {
						if (!(res_56464 <= HEX3Atmp_56461)) goto LA14;
						i_56438 = res_56464;
						forallchildrenaux_52022(((void*) ((NI)((NU64)(d) + (NU64)((NI)((NU64)(i_56438) * (NU64)((*(*mt).base).size)))))), (*mt).base, op);
						res_56464 += ((NI) 1);
					} LA14: ;
				}
			}
		}
		break;
		default:
		{
		}
		break;
		}
	}
	LA7: ;
	}BeforeRet: ;
}

N_NIMCALL(void, forallchildren_52014)(Cell47705* cell, NU8 op) {
	TY3489 marker;
	marker = (*(*cell).typ).marker;
	{
		void* LOC5;
		if (!!((marker == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = celltousr_51622(cell);
		marker(LOC5, ((NI) (op)));
	}
	goto LA1;
	LA3: ;
	{
		switch ((*(*cell).typ).kind) {
		case ((NU8) 22):
		{
			void* LOC8;
			LOC8 = 0;
			LOC8 = celltousr_51622(cell);
			forallchildrenaux_52022(LOC8, (*(*cell).typ).base, op);
		}
		break;
		case ((NU8) 24):
		{
			NI d;
			void* LOC10;
			TGenericSeq* s;
			LOC10 = 0;
			LOC10 = celltousr_51622(cell);
			d = ((NI) (LOC10));
			s = ((TGenericSeq*) (d));
			{
				if (!!((s == NIM_NIL))) goto LA13;
				{
					NI i_57234;
					NI HEX3Atmp_57267;
					NI res_57270;
					i_57234 = 0;
					HEX3Atmp_57267 = 0;
					HEX3Atmp_57267 = (NI)((*s).len - ((NI) 1));
					res_57270 = ((NI) 0);
					{
						while (1) {
							if (!(res_57270 <= HEX3Atmp_57267)) goto LA17;
							i_57234 = res_57270;
							forallchildrenaux_52022(((void*) ((NI)((NU64)((NI)((NU64)(d) + (NU64)((NI)((NU64)(i_57234) * (NU64)((*(*(*cell).typ).base).size))))) + (NU64)(((NI) 16))))), (*(*cell).typ).base, op);
							res_57270 += ((NI) 1);
						} LA17: ;
					}
				}
			}
			LA13: ;
		}
		break;
		default:
		{
		}
		break;
		}
	}
	LA1: ;
}

N_NIMCALL(NIM_BOOL, collectzct_70206)(Gcheap50018* gch) {
	NIM_BOOL result;
	NI* L;
	result = 0;
	L = (&(*gch).zct.len);
	{
		while (1) {
			Cell47705* c;
			if (!(((NI) 0) < (*L))) goto LA2;
			c = (*gch).zct.d[(((NI) 0))- 0];
			(*c).refcount = (NI)((*c).refcount & ((NI) -5));
			(*gch).zct.d[(((NI) 0))- 0] = (*gch).zct.d[((NI)((*L) - ((NI) 1)))- 0];
			(*L) -= ((NI) 1);
			{
				if (!((NU64)((*c).refcount) < (NU64)(((NI) 8)))) goto LA5;
				{
					NIM_BOOL LOC9;
					LOC9 = 0;
					LOC9 = canbecycleroot_51658(c);
					if (!LOC9) goto LA10;
					excl_48474((&(*gch).cycleroots), c);
				}
				LA10: ;
				preparedealloc_52208(c);
				forallchildren_52014(c, ((NU8) 2));
				rawdealloc_43417((&(*gch).region), ((void*) (c)));
			}
			LA5: ;
		} LA2: ;
	}
	result = NIM_TRUE;
	return result;
}

N_NIMCALL(void, markroots_68002)(Gcheap50018* gch) {
	NI tabsize;
	tabsize = ((NI) 0);
	{
		Cell47705* s_68007;
		Cellset47717 HEX3Atmp_68034;
		Pagedesc47713* r_68039;
		s_68007 = 0;
		memset((void*)(&HEX3Atmp_68034), 0, sizeof(HEX3Atmp_68034));
		HEX3Atmp_68034 = (*gch).cycleroots;
		r_68039 = HEX3Atmp_68034.head;
		{
			while (1) {
				NI i_68041;
				if (!!((r_68039 == NIM_NIL))) goto LA3;
				i_68041 = ((NI) 0);
				{
					while (1) {
						NI w_68043;
						NI j_68045;
						if (!(i_68041 <= ((NI) 7))) goto LA5;
						w_68043 = (*r_68039).bits[(i_68041)- 0];
						j_68045 = ((NI) 0);
						{
							while (1) {
								if (!!((w_68043 == ((NI) 0)))) goto LA7;
								{
									if (!!((((NI) ((NI)(w_68043 & ((NI) 1)))) == ((NI) 0)))) goto LA10;
									s_68007 = ((Cell47705*) ((NI)((NI)((NU64)((*r_68039).key) << (NU64)(((NI) 12))) | (NI)((NU64)((NI)((NU64)((NI)((NU64)(i_68041) << (NU64)(((NI) 6)))) + (NU64)(j_68045))) * (NU64)(((NI) 8))))));
									tabsize += ((NI) 1);
									{
										NIM_BOOL LOC14;
										LOC14 = 0;
										LOC14 = (((NI) ((NI)((*s_68007).refcount & ((NI) 3)))) == ((NI) 3));
										if (!(LOC14)) goto LA15;
										LOC14 = ((NU64)(((NI) 8)) <= (NU64)((*s_68007).refcount));
										LA15: ;
										if (!LOC14) goto LA16;
										markgray_67202(s_68007);
									}
									goto LA12;
									LA16: ;
									{
										excl_48474((&(*gch).cycleroots), s_68007);
										{
											if (!((*s_68007).refcount == ((NI) 0))) goto LA21;
											freecycliccell_66415(gch, s_68007);
										}
										LA21: ;
									}
									LA12: ;
								}
								LA10: ;
								j_68045 += ((NI) 1);
								w_68043 = (NI)((NU64)(w_68043) >> (NU64)(((NI) 1)));
							} LA7: ;
						}
						i_68041 += ((NI) 1);
					} LA5: ;
				}
				r_68039 = (*r_68039).next;
			} LA3: ;
		}
	}
	(*gch).stat.cycletablesize = (((*gch).stat.cycletablesize >= tabsize) ? (*gch).stat.cycletablesize : tabsize);
}

N_NIMCALL(void, collectroots_70401)(Gcheap50018* gch) {
	{
		Cell47705* s_70405;
		Cellset47717 HEX3Atmp_70407;
		Pagedesc47713* r_70412;
		s_70405 = 0;
		memset((void*)(&HEX3Atmp_70407), 0, sizeof(HEX3Atmp_70407));
		HEX3Atmp_70407 = (*gch).cycleroots;
		r_70412 = HEX3Atmp_70407.head;
		{
			while (1) {
				NI i_70414;
				if (!!((r_70412 == NIM_NIL))) goto LA3;
				i_70414 = ((NI) 0);
				{
					while (1) {
						NI w_70416;
						NI j_70418;
						if (!(i_70414 <= ((NI) 7))) goto LA5;
						w_70416 = (*r_70412).bits[(i_70414)- 0];
						j_70418 = ((NI) 0);
						{
							while (1) {
								if (!!((w_70416 == ((NI) 0)))) goto LA7;
								{
									if (!!((((NI) ((NI)(w_70416 & ((NI) 1)))) == ((NI) 0)))) goto LA10;
									s_70405 = ((Cell47705*) ((NI)((NI)((NU64)((*r_70412).key) << (NU64)(((NI) 12))) | (NI)((NU64)((NI)((NU64)((NI)((NU64)(i_70414) << (NU64)(((NI) 6)))) + (NU64)(j_70418))) * (NU64)(((NI) 8))))));
									collectwhite_67801(s_70405);
								}
								LA10: ;
								j_70418 += ((NI) 1);
								w_70416 = (NI)((NU64)(w_70416) >> (NU64)(((NI) 1)));
							} LA7: ;
						}
						i_70414 += ((NI) 1);
					} LA5: ;
				}
				r_70412 = (*r_70412).next;
			} LA3: ;
		}
	}
}

N_NIMCALL(void, deinit_47826)(Cellset47717* s) {
	Pagedesc47713* it;
	it = (*s).head;
	{
		while (1) {
			Pagedesc47713* n;
			if (!!((it == NIM_NIL))) goto LA2;
			n = (*it).next;
			dealloc_7448(((void*) (it)));
			it = n;
		} LA2: ;
	}
	(*s).head = NIM_NIL;
	dealloc_7448(((void*) ((*s).data)));
	(*s).data = NIM_NIL;
	(*s).counter = ((NI) 0);
}

N_NIMCALL(void, cellsetreset_56201)(Cellset47717* s) {
	deinit_47826(s);
	init_47818(s);
}

N_NIMCALL(void, collectcycles_70420)(Gcheap50018* gch) {
	{
		while (1) {
			NIM_BOOL LOC3;
			if (!(((NI) 0) < (*gch).zct.len)) goto LA2;
			LOC3 = 0;
			LOC3 = collectzct_70206(gch);
		} LA2: ;
	}
	markroots_68002(gch);
	{
		Cell47705* s_70601;
		Cellset47717 HEX3Atmp_70803;
		Pagedesc47713* r_70808;
		s_70601 = 0;
		memset((void*)(&HEX3Atmp_70803), 0, sizeof(HEX3Atmp_70803));
		HEX3Atmp_70803 = (*gch).cycleroots;
		r_70808 = HEX3Atmp_70803.head;
		{
			while (1) {
				NI i_70810;
				if (!!((r_70808 == NIM_NIL))) goto LA6;
				i_70810 = ((NI) 0);
				{
					while (1) {
						NI w_70812;
						NI j_70814;
						if (!(i_70810 <= ((NI) 7))) goto LA8;
						w_70812 = (*r_70808).bits[(i_70810)- 0];
						j_70814 = ((NI) 0);
						{
							while (1) {
								if (!!((w_70812 == ((NI) 0)))) goto LA10;
								{
									if (!!((((NI) ((NI)(w_70812 & ((NI) 1)))) == ((NI) 0)))) goto LA13;
									s_70601 = ((Cell47705*) ((NI)((NI)((NU64)((*r_70808).key) << (NU64)(((NI) 12))) | (NI)((NU64)((NI)((NU64)((NI)((NU64)(i_70810) << (NU64)(((NI) 6)))) + (NU64)(j_70814))) * (NU64)(((NI) 8))))));
									scan_67601(s_70601);
								}
								LA13: ;
								j_70814 += ((NI) 1);
								w_70812 = (NI)((NU64)(w_70812) >> (NU64)(((NI) 1)));
							} LA10: ;
						}
						i_70810 += ((NI) 1);
					} LA8: ;
				}
				r_70808 = (*r_70808).next;
			} LA6: ;
		}
	}
	collectroots_70401(gch);
	cellsetreset_56201((&(*gch).cycleroots));
}

N_NIMCALL(NI, gettotalmem_8059)(void) {
	NI result;
{	result = 0;
	result = gch_50059.region.currmem;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NI, getfreemem_8057)(void) {
	NI result;
	result = 0;
	result = gch_50059.region.freemem;
	return result;
}

N_NIMCALL(NI, getoccupiedmem_8055)(void) {
	NI result;
	NI LOC1;
	NI LOC2;
{	result = 0;
	LOC1 = 0;
	LOC1 = gettotalmem_8059();
	LOC2 = 0;
	LOC2 = getfreemem_8057();
	result = (NI)(LOC1 - LOC2);
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, unmarkstackandregisters_75402)(Gcheap50018* gch) {
	Cell47705** d;
	d = (*gch).decstack.d;
	{
		NI i_75416;
		NI HEX3Atmp_75602;
		NI res_75605;
		i_75416 = 0;
		HEX3Atmp_75602 = 0;
		HEX3Atmp_75602 = (NI)((*gch).decstack.len - ((NI) 1));
		res_75605 = ((NI) 0);
		{
			while (1) {
				if (!(res_75605 <= HEX3Atmp_75602)) goto LA3;
				i_75416 = res_75605;
				decref_53601(d[(i_75416)- 0]);
				res_75605 += ((NI) 1);
			} LA3: ;
		}
	}
	(*gch).decstack.len = ((NI) 0);
}

N_NIMCALL(void, collectctbody_75609)(Gcheap50018* gch) {
	NI LOC1;
	LOC1 = 0;
	LOC1 = stacksize_71801();
	(*gch).stat.maxstacksize = (((*gch).stat.maxstacksize >= LOC1) ? (*gch).stat.maxstacksize : LOC1);
	prepareforinteriorpointerchecking_45088((&(*gch).region));
	markstackandregisters_73037(gch);
	markthreadstacks_71403(gch);
	(*gch).stat.maxstackcells = (((*gch).stat.maxstackcells >= (*gch).decstack.len) ? (*gch).stat.maxstackcells : (*gch).decstack.len);
	(*gch).stat.stackscans += ((NI) 1);
	{
		NIM_BOOL LOC4;
		LOC4 = 0;
		LOC4 = collectzct_70206(gch);
		if (!LOC4) goto LA5;
		{
			NIM_BOOL LOC9;
			NI LOC10;
			NI LOC14;
			LOC9 = 0;
			LOC10 = 0;
			LOC10 = getoccupiedmem_47630((&(*gch).region));
			LOC9 = ((*gch).cyclethreshold <= LOC10);
			if (LOC9) goto LA11;
			LOC9 = NIM_FALSE;
			LA11: ;
			if (!LOC9) goto LA12;
			collectcycles_70420(gch);
			(*gch).stat.cyclecollections += ((NI) 1);
			LOC14 = 0;
			LOC14 = getoccupiedmem_8055();
			(*gch).cyclethreshold = ((((NI) 4194304) >= (NI)(LOC14 * ((NI) 2))) ? ((NI) 4194304) : (NI)(LOC14 * ((NI) 2)));
			(*gch).stat.maxthreshold = (((*gch).stat.maxthreshold >= (*gch).cyclethreshold) ? (*gch).stat.maxthreshold : (*gch).cyclethreshold);
		}
		LA12: ;
	}
	LA5: ;
	unmarkstackandregisters_75402(gch);
}

N_NIMCALL(void, collectct_52007)(Gcheap50018* gch) {
	NI stackmarkcosts;
	NI LOC1;
	LOC1 = 0;
	LOC1 = stacksize_71801();
	stackmarkcosts = (((NI)(LOC1 / ((NI) 128)) >= ((NI) 500)) ? (NI)(LOC1 / ((NI) 128)) : ((NI) 500));
	{
		NIM_BOOL LOC4;
		NIM_BOOL LOC5;
		NIM_BOOL LOC6;
		NIM_BOOL LOC8;
		NI LOC10;
		LOC4 = 0;
		LOC5 = 0;
		LOC6 = 0;
		LOC6 = (stackmarkcosts <= (*gch).zct.len);
		if (LOC6) goto LA7;
		LOC8 = 0;
		LOC8 = NIM_TRUE;
		if (!(LOC8)) goto LA9;
		LOC10 = 0;
		LOC10 = getoccupiedmem_47630((&(*gch).region));
		LOC8 = ((*gch).cyclethreshold <= LOC10);
		LA9: ;
		LOC6 = LOC8;
		LA7: ;
		LOC5 = LOC6;
		if (LOC5) goto LA11;
		LOC5 = NIM_FALSE;
		LA11: ;
		LOC4 = LOC5;
		if (!(LOC4)) goto LA12;
		LOC4 = ((*gch).recgclock == ((NI) 0));
		LA12: ;
		if (!LOC4) goto LA13;
		collectctbody_75609(gch);
	}
	LA13: ;
}

static N_INLINE(void, addnewobjtozct_57274)(Cell47705* res, Gcheap50018* gch) {
	NI L;
	Cell47705** d;
{	L = (*gch).zct.len;
	d = (*gch).zct.d;
	{
		Cell47705* c;
		if (!(((NI) 8) < L)) goto LA3;
		c = 0;
		c = d[((NI)(L - ((NI) 1)))- 0];
		{
			if (!((NU64)(((NI) 8)) <= (NU64)((*c).refcount))) goto LA7;
			(*c).refcount = (NI)((*c).refcount & ((NI) -5));
			d[((NI)(L - ((NI) 1)))- 0] = res;
			goto BeforeRet;
		}
		LA7: ;
		c = d[((NI)(L - ((NI) 2)))- 0];
		{
			if (!((NU64)(((NI) 8)) <= (NU64)((*c).refcount))) goto LA11;
			(*c).refcount = (NI)((*c).refcount & ((NI) -5));
			d[((NI)(L - ((NI) 2)))- 0] = res;
			goto BeforeRet;
		}
		LA11: ;
		c = d[((NI)(L - ((NI) 3)))- 0];
		{
			if (!((NU64)(((NI) 8)) <= (NU64)((*c).refcount))) goto LA15;
			(*c).refcount = (NI)((*c).refcount & ((NI) -5));
			d[((NI)(L - ((NI) 3)))- 0] = res;
			goto BeforeRet;
		}
		LA15: ;
		c = d[((NI)(L - ((NI) 4)))- 0];
		{
			if (!((NU64)(((NI) 8)) <= (NU64)((*c).refcount))) goto LA19;
			(*c).refcount = (NI)((*c).refcount & ((NI) -5));
			d[((NI)(L - ((NI) 4)))- 0] = res;
			goto BeforeRet;
		}
		LA19: ;
		c = d[((NI)(L - ((NI) 5)))- 0];
		{
			if (!((NU64)(((NI) 8)) <= (NU64)((*c).refcount))) goto LA23;
			(*c).refcount = (NI)((*c).refcount & ((NI) -5));
			d[((NI)(L - ((NI) 5)))- 0] = res;
			goto BeforeRet;
		}
		LA23: ;
		c = d[((NI)(L - ((NI) 6)))- 0];
		{
			if (!((NU64)(((NI) 8)) <= (NU64)((*c).refcount))) goto LA27;
			(*c).refcount = (NI)((*c).refcount & ((NI) -5));
			d[((NI)(L - ((NI) 6)))- 0] = res;
			goto BeforeRet;
		}
		LA27: ;
		c = d[((NI)(L - ((NI) 7)))- 0];
		{
			if (!((NU64)(((NI) 8)) <= (NU64)((*c).refcount))) goto LA31;
			(*c).refcount = (NI)((*c).refcount & ((NI) -5));
			d[((NI)(L - ((NI) 7)))- 0] = res;
			goto BeforeRet;
		}
		LA31: ;
		c = d[((NI)(L - ((NI) 8)))- 0];
		{
			if (!((NU64)(((NI) 8)) <= (NU64)((*c).refcount))) goto LA35;
			(*c).refcount = (NI)((*c).refcount & ((NI) -5));
			d[((NI)(L - ((NI) 8)))- 0] = res;
			goto BeforeRet;
		}
		LA35: ;
		add_47783((&(*gch).zct), res);
	}
	goto LA1;
	LA3: ;
	{
		d[(L)- 0] = res;
		(*gch).zct.len += ((NI) 1);
	}
	LA1: ;
	}BeforeRet: ;
}

N_NIMCALL(void*, rawnewobj_57801)(TNimType* typ, NI size, Gcheap50018* gch) {
	void* result;
	Cell47705* res;
	void* LOC1;
	result = 0;
	collectct_52007(gch);
	LOC1 = 0;
	LOC1 = rawalloc_37068((&(*gch).region), (NI)(size + ((NI)sizeof(Cell47705))));
	res = ((Cell47705*) (LOC1));
	(*res).typ = typ;
	(*res).refcount = ((NI) 4);
	addnewobjtozct_57274(res, gch);
	result = celltousr_51622(res);
	return result;
}

N_NIMCALL(void*, newObjNoInit)(TNimType* typ, NI size) {
	void* result;
	result = 0;
	result = rawnewobj_57801(typ, size, (&gch_50059));
	return result;
}

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

N_NIMCALL(NimStringDesc*, toNimStr)(NCSTRING str, NI len) {
	NimStringDesc* result;
	result = 0;
	result = rawNewStringNoInit(len);
	(*result).Sup.len = len;
	memcpy(((NCSTRING) ((*result).data)), str, (NI)(len + ((NI) 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_15701)(FILE* f, NCSTRING c) {
	fputs(c, f);
}

N_NIMCALL(void, writetostderr_19601)(NCSTRING msg) {
	write_15701(stdout, msg);
}

N_NIMCALL(void, showerrormessage_19606)(NCSTRING data) {
	{
		NimStringDesc* LOC5;
		if (!!((errormessagewriter_19404 == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = cstrToNimstr(data);
		errormessagewriter_19404(LOC5);
	}
	goto LA1;
	LA3: ;
	{
		writetostderr_19601(data);
	}
	LA1: ;
}

N_NOCONV(void, signalHandler)(int sig) {
	NCSTRING msg;
	msg = 0;
	{
		if (!(sig == SIGINT)) goto LA3;
		msg = "SIGINT: Interrupted by Ctrl-C.\012";
	}
	goto LA1;
	LA3: ;
	{
		if (!(sig == SIGSEGV)) goto LA6;
		msg = "SIGSEGV: Illegal storage access. (Attempt to read from nil?)\012";
	}
	goto LA1;
	LA6: ;
	{
		if (!(sig == SIGABRT)) goto LA9;
		msg = "SIGABRT: Abnormal termination.\012";
	}
	goto LA1;
	LA9: ;
	{
		if (!(sig == SIGFPE)) goto LA12;
		msg = "SIGFPE: Arithmetic error.\012";
	}
	goto LA1;
	LA12: ;
	{
		if (!(sig == SIGILL)) goto LA15;
		msg = "SIGILL: Illegal operation.\012";
	}
	goto LA1;
	LA15: ;
	{
		if (!(sig == SIGBUS)) goto LA18;
		msg = "SIGBUS: Illegal storage access. (Attempt to read from nil?)\012";
	}
	goto LA1;
	LA18: ;
	{
		{
			{
				if (!(sig == SIGPIPE)) goto LA24;
				msg = "SIGPIPE: Pipe closed.\012";
				goto LA21;
			}
			LA24: ;
			msg = "unknown signal\012";
		} LA21: ;
	}
	LA1: ;
	showerrormessage_19606(msg);
	exit(((NI) 1));
}

N_NIMCALL(void, registersignalhandler_23202)(void) {
	signal(SIGINT, signalHandler);
	signal(SIGSEGV, signalHandler);
	signal(SIGABRT, signalHandler);
	signal(SIGFPE, signalHandler);
	signal(SIGILL, signalHandler);
	signal(SIGBUS, signalHandler);
	signal(SIGPIPE, signalHandler);
}

N_NIMCALL(NI, getRefcount)(void* p) {
	NI result;
	Cell47705* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = usrtocell_51640(p);
	result = (NI)((NU64)((*LOC1).refcount) >> (NU64)(((NI) 3)));
	return result;
}

N_NIMCALL(void*, newObjRC1)(TNimType* typ, NI size) {
	void* result;
	Cell47705* res;
	void* LOC1;
	result = 0;
	collectct_52007((&gch_50059));
	LOC1 = 0;
	LOC1 = rawalloc_37068((&gch_50059.region), (NI)(size + ((NI)sizeof(Cell47705))));
	res = ((Cell47705*) (LOC1));
	(*res).typ = typ;
	(*res).refcount = ((NI) 8);
	result = celltousr_51622(res);
	zeroMem(result, ((NI) (size)));
	return result;
}

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

N_NIMCALL(void, nimGCvisit)(void* d, NI op) {
	dooperation_52018(d, ((NU8) (op)));
}

N_NIMCALL(void*, newObj)(TNimType* typ, NI size) {
	void* result;
	result = 0;
	result = rawnewobj_57801(typ, size, (&gch_50059));
	zeroMem(result, ((NI) (size)));
	return result;
}
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) {
	Overflowerror3640* a;
	a = (Overflowerror3640*)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) {
	Cell47705* c;
	c = usrtocell_51640(p);
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU64)((*c).refcount) < (NU64)(((NI) 8)))) goto LA3;
		rtladdzct_53201(c);
	}
	LA3: ;
}

static N_INLINE(void, incref_54019)(Cell47705* c) {
	(*c).refcount = (NI)((NU64)((*c).refcount) + (NU64)(((NI) 8)));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = canbecycleroot_51658(c);
		if (!LOC3) goto LA4;
		rtladdcycleroot_52420(c);
	}
	LA4: ;
}

static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		Cell47705* LOC5;
		if (!!((src == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = usrtocell_51640(src);
		incref_54019(LOC5);
	}
	LA3: ;
	{
		Cell47705* LOC10;
		if (!!(((*dest) == NIM_NIL))) goto LA8;
		LOC10 = 0;
		LOC10 = usrtocell_51640((*dest));
		decref_53601(LOC10);
	}
	LA8: ;
	(*dest) = src;
}

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

N_NOINLINE(NIM_BOOL, isobjslowpath_23934)(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[(((NI) 0))- 0] = obj;
				result = NIM_FALSE;
				goto BeforeRet;
			}
			LA5: ;
			x = (*x).base;
		} LA2: ;
	}
	cache[(((NI) 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[(((NI) 0))- 0] == obj)) goto LA11;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA11: ;
	{
		if (!(cache[(((NI) 1))- 0] == obj)) goto LA15;
		result = NIM_TRUE;
		goto BeforeRet;
	}
	LA15: ;
	result = isobjslowpath_23934(obj, subclass, cache);
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

static N_INLINE(void, quitordebug_20604)(void) {
	exit(((NI) 1));
}

N_NIMCALL(void, raiseexceptionaux_20801)(Exception* e) {
{	{
		if (!!((localraisehook_10018 == NIM_NIL))) goto LA3;
		{
			NIM_BOOL LOC7;
			LOC7 = 0;
			LOC7 = localraisehook_10018(e);
			if (!!(LOC7)) goto LA8;
			goto BeforeRet;
		}
		LA8: ;
	}
	LA3: ;
	{
		if (!!((globalraisehook_10013 == NIM_NIL))) goto LA12;
		{
			NIM_BOOL LOC16;
			LOC16 = 0;
			LOC16 = globalraisehook_10013(e);
			if (!!(LOC16)) goto LA17;
			goto BeforeRet;
		}
		LA17: ;
	}
	LA12: ;
	{
		if (!!((exchandler_19637 == NIM_NIL))) goto LA21;
		{
			NIM_BOOL LOC25;
			LOC25 = 0;
			LOC25 = !((*exchandler_19637).hasRaiseAction);
			if (LOC25) goto LA26;
			LOC25 = (*exchandler_19637).raiseAction.ClEnv? (*exchandler_19637).raiseAction.ClPrc(e, (*exchandler_19637).raiseAction.ClEnv):((TMP52)((*exchandler_19637).raiseAction.ClPrc))(e);
			LA26: ;
			if (!LOC25) goto LA27;
			pushCurrentException(e);
			_longjmp((*exchandler_19637).context, ((int) 1));
		}
		LA27: ;
	}
	goto LA19;
	LA21: ;
	{
		if (!(isObjWithCache((*e).Sup.m_type, (&NTI3650), Nim_OfCheck_CACHE1))) goto LA30;
		showerrormessage_19606((*e).name);
		quitordebug_20604();
	}
	goto LA19;
	LA30: ;
	{
		TY21218 buf;
		NI L;
		memset((void*)buf, 0, sizeof(buf));
		L = ((NI) 0);
		{
			if (!((NI)(L + ((NI) 28)) < ((NI) 2000))) goto LA35;
			memcpy(((void*) ((&buf[(L)- 0]))), "Error: unhandled exception: ", ((NI) 28));
			L += ((NI) 28);
		}
		LA35: ;
		{
			if (!!((*e).message == 0)) goto LA39;
			{
				if (!((NI)(L + ((*e).message ? (*e).message->Sup.len : 0)) < ((NI) 2000))) goto LA43;
				memcpy(((void*) ((&buf[(L)- 0]))), ((void*) ((*e).message->data)), ((NI) (((*e).message ? (*e).message->Sup.len : 0))));
				L += ((*e).message ? (*e).message->Sup.len : 0);
			}
			LA43: ;
		}
		LA39: ;
		{
			if (!((NI)(L + ((NI) 2)) < ((NI) 2000))) goto LA47;
			memcpy(((void*) ((&buf[(L)- 0]))), " [", ((NI) 2));
			L += ((NI) 2);
		}
		LA47: ;
		{
			NI LOC51;
			NI LOC54;
			NI LOC55;
			LOC51 = 0;
			LOC51 = strlen((*e).name);
			if (!((NI)(L + LOC51) < ((NI) 2000))) goto LA52;
			LOC54 = 0;
			LOC54 = strlen((*e).name);
			memcpy(((void*) ((&buf[(L)- 0]))), ((void*) ((*e).name)), ((NI) (LOC54)));
			LOC55 = 0;
			LOC55 = strlen((*e).name);
			L += LOC55;
		}
		LA52: ;
		{
			if (!((NI)(L + ((NI) 2)) < ((NI) 2000))) goto LA58;
			memcpy(((void*) ((&buf[(L)- 0]))), "]\012", ((NI) 2));
			L += ((NI) 2);
		}
		LA58: ;
		showerrormessage_19606(((NCSTRING) (buf)));
		quitordebug_20604();
	}
	LA19: ;
	}BeforeRet: ;
}

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

static N_INLINE(void, sysfatal_24062)(NimStringDesc* message) {
	Overflowerror3640* e;
	NimStringDesc* LOC1;
	e = 0;
	e = (Overflowerror3640*) newObj((&NTI24069), sizeof(Overflowerror3640));
	(*e).Sup.Sup.Sup.m_type = (&NTI3640);
	LOC1 = 0;
	LOC1 = (*e).Sup.Sup.message; (*e).Sup.Sup.message = copyStringRC1(message);
	if (LOC1) nimGCunrefNoCycle(LOC1);
	raiseException((Exception*)e, "OverflowError");
}

N_NOINLINE(void, raiseOverflow)(void) {
	sysfatal_24062(((NimStringDesc*) &TMP53));
}

static N_INLINE(NI, addInt)(NI a, NI b) {
	NI result;
{	result = 0;
	result = (NI)((NU64)(a) + (NU64)(b));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = (((NI) 0) <= (NI)(result ^ a));
		if (LOC3) goto LA4;
		LOC3 = (((NI) 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)((NU64)(a) * (NU64)(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, ((NI) 16));
	result = newObjRC1(typ, size);
	(*((TGenericSeq*) (result))).len = len;
	(*((TGenericSeq*) (result))).reserved = len;
	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, ((NI) 16));
	result = newObj(typ, size);
	(*((TGenericSeq*) (result))).len = len;
	(*((TGenericSeq*) (result))).reserved = len;
	return result;
}

N_NOINLINE(NIM_BOOL, isonstack_52011)(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_50059.stackbottom));
	a = ((NI) (stacktop));
	x = ((NI) (p));
	LOC1 = 0;
	LOC1 = ((NU64)(a) <= (NU64)(x));
	if (!(LOC1)) goto LA2;
	LOC1 = ((NU64)(x) <= (NU64)(b));
	LA2: ;
	result = LOC1;
	return result;
}

N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = isonstack_52011(((void*) (dest)));
		if (!!(LOC3)) goto LA4;
		{
			Cell47705* LOC10;
			if (!!((src == NIM_NIL))) goto LA8;
			LOC10 = 0;
			LOC10 = usrtocell_51640(src);
			incref_54019(LOC10);
		}
		LA8: ;
		{
			Cell47705* LOC15;
			if (!((NU64)(((NI) 4096)) <= (NU64)(((NI) ((*dest)))))) goto LA13;
			LOC15 = 0;
			LOC15 = usrtocell_51640((*dest));
			decref_53601(LOC15);
		}
		LA13: ;
	}
	goto LA1;
	LA4: ;
	{
	}
	LA1: ;
	(*dest) = src;
}
N_NIMCALL(void, TMP140)(void* p, NI op) {
	Valueerror3646* a;
	a = (Valueerror3646*)p;
	nimGCvisit((void*)(*a).Sup.parent, op);
	nimGCvisit((void*)(*a).Sup.message, op);
	nimGCvisit((void*)(*a).Sup.trace, op);
}

static N_INLINE(void, sysfatal_23818)(NimStringDesc* message) {
	Valueerror3646* e;
	NimStringDesc* LOC1;
	e = 0;
	e = (Valueerror3646*) newObj((&NTI23825), sizeof(Valueerror3646));
	(*e).Sup.Sup.m_type = (&NTI3646);
	LOC1 = 0;
	LOC1 = (*e).Sup.message; (*e).Sup.message = copyStringRC1(message);
	if (LOC1) nimGCunrefNoCycle(LOC1);
	raiseException((Exception*)e, "ValueError");
}

N_NOINLINE(void, chckNil)(void* p) {
	{
		if (!(p == NIM_NIL)) goto LA3;
		sysfatal_23818(((NimStringDesc*) &TMP141));
	}
	LA3: ;
}

N_NIMCALL(void, genericresetaux_83401)(void* dest, TNimNode* n) {
	NI d;
	d = ((NI) (dest));
	switch ((*n).kind) {
	case ((NU8) 0):
	{
	}
	break;
	case ((NU8) 1):
	{
		genericReset(((void*) ((NI)((NU64)(d) + (NU64)((*n).offset)))), (*n).typ);
	}
	break;
	case ((NU8) 2):
	{
		{
			NI i_84619;
			NI HEX3Atmp_84645;
			NI res_84648;
			i_84619 = 0;
			HEX3Atmp_84645 = 0;
			HEX3Atmp_84645 = (NI)((*n).len - ((NI) 1));
			res_84648 = ((NI) 0);
			{
				while (1) {
					if (!(res_84648 <= HEX3Atmp_84645)) goto LA6;
					i_84619 = res_84648;
					genericresetaux_83401(dest, (*n).sons[(i_84619)- 0]);
					res_84648 += ((NI) 1);
				} LA6: ;
			}
		}
	}
	break;
	case ((NU8) 3):
	{
		TNimNode* m;
		m = selectbranch_27807(dest, n);
		{
			if (!!((m == NIM_NIL))) goto LA10;
			genericresetaux_83401(dest, m);
		}
		LA10: ;
		zeroMem(((void*) ((NI)((NU64)(d) + (NU64)((*n).offset)))), ((NI) ((*(*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) 18):
	{
		genericresetaux_83401(dest, (*mt).node);
	}
	break;
	case ((NU8) 17):
	{
		TNimType** pint;
		genericresetaux_83401(dest, (*mt).node);
		pint = ((TNimType**) (dest));
		(*pint) = NIM_NIL;
	}
	break;
	case ((NU8) 16):
	case ((NU8) 4):
	{
		{
			NI i_84812;
			NI HEX3Atmp_84836;
			NI res_84839;
			i_84812 = 0;
			HEX3Atmp_84836 = 0;
			HEX3Atmp_84836 = (NI)((NI)((*mt).size / (*(*mt).base).size) - ((NI) 1));
			res_84839 = ((NI) 0);
			{
				while (1) {
					if (!(res_84839 <= HEX3Atmp_84836)) goto LA7;
					i_84812 = res_84839;
					genericReset(((void*) ((NI)((NU64)(d) + (NU64)((NI)((NU64)(i_84812) * (NU64)((*(*mt).base).size)))))), (*mt).base);
					res_84839 += ((NI) 1);
				} LA7: ;
			}
		}
	}
	break;
	default:
	{
		zeroMem(dest, ((NI) ((*mt).size)));
	}
	break;
	}
}

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

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

N_NIMCALL(NimStringDesc*, copyStrLast)(NimStringDesc* s, NI start_80010, NI last) {
	NimStringDesc* result;
	NI start;
	NI len;
	result = 0;
	start = ((start_80010 >= ((NI) 0)) ? start_80010 : ((NI) 0));
	len = (NI)((NI)(((last <= (NI)((*s).Sup.len - ((NI) 1))) ? last : (NI)((*s).Sup.len - ((NI) 1))) - start) + ((NI) 1));
	{
		if (!(((NI) 0) < len)) goto LA3;
		result = rawNewStringNoInit(len);
		(*result).Sup.len = len;
		memcpy(((NCSTRING) ((*result).data)), ((NCSTRING) ((&(*s).data[(start)- 0]))), len);
		(*result).data[(len)- 0] = 0;
	}
	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, (NI)((*s).Sup.len - ((NI) 1)));
	return result;
}

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

N_NIMCALL(void*, growobj_63603)(void* old, NI newsize, Gcheap50018* gch) {
	void* result;
	Cell47705* ol;
	Cell47705* res;
	void* LOC1;
	NI elemsize;
	NI oldsize;
	result = 0;
	collectct_52007(gch);
	ol = usrtocell_51640(old);
	LOC1 = 0;
	LOC1 = rawalloc_37068((&(*gch).region), (NI)(newsize + ((NI)sizeof(Cell47705))));
	res = ((Cell47705*) (LOC1));
	elemsize = ((NI) 1);
	{
		if (!!(((*(*ol).typ).kind == ((NU8) 28)))) goto LA4;
		elemsize = (*(*(*ol).typ).base).size;
	}
	LA4: ;
	oldsize = (NI)((NI)((*((TGenericSeq*) (old))).len * elemsize) + ((NI) 16));
	memcpy(((void*) (res)), ((void*) (ol)), ((NI) ((NI)(oldsize + ((NI)sizeof(Cell47705))))));
	zeroMem(((void*) ((NI)((NU64)((NI)((NU64)(((NI) (res))) + (NU64)(oldsize))) + (NU64)(((NI)sizeof(Cell47705)))))), ((NI) ((NI)(newsize - oldsize))));
	{
		if (!((NU64)((NI)((NU64)((*ol).refcount) >> (NU64)(((NI) 3)))) <= (NU64)(((NI) 1)))) goto LA8;
		{
			NI j;
			Cell47705** d;
			if (!!(((NI)((*ol).refcount & ((NI) 4)) == ((NI) 0)))) goto LA12;
			j = (NI)((*gch).zct.len - ((NI) 1));
			d = (*gch).zct.d;
			{
				while (1) {
					if (!(((NI) 0) <= j)) goto LA15;
					{
						if (!(d[(j)- 0] == ol)) goto LA18;
						d[(j)- 0] = res;
						goto LA14;
					}
					LA18: ;
					j -= ((NI) 1);
				} LA15: ;
			} LA14: ;
		}
		LA12: ;
		{
			NIM_BOOL LOC22;
			LOC22 = 0;
			LOC22 = canbecycleroot_51658(ol);
			if (!LOC22) goto LA23;
			excl_48474((&(*gch).cycleroots), ol);
		}
		LA23: ;
		rawdealloc_43417((&(*gch).region), ((void*) (ol)));
	}
	goto LA6;
	LA8: ;
	{
		(*res).refcount = ((NI) 8);
		decref_53601(ol);
	}
	LA6: ;
	result = celltousr_51622(res);
	return result;
}

N_NIMCALL(void*, growobj_66409)(void* old, NI newsize) {
	void* result;
	result = 0;
	result = growobj_63603(old, newsize, (&gch_50059));
	return result;
}

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

N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s, NIM_CHAR c) {
	NimStringDesc* result;
	result = 0;
	result = s;
	{
		void* LOC5;
		if (!((NI)((*result).Sup.reserved & ((NI) IL64(9223372036854775807))) <= (*result).Sup.len)) goto LA3;
		(*result).Sup.reserved = resize_79401((NI)((*result).Sup.reserved & ((NI) IL64(9223372036854775807))));
		LOC5 = 0;
		LOC5 = growobj_66409(((void*) (result)), (NI)((NI)(((NI)sizeof(TGenericSeq)) + (*result).Sup.reserved) + ((NI) 1)));
		result = ((NimStringDesc*) (LOC5));
	}
	LA3: ;
	(*result).data[((*result).Sup.len)- 0] = c;
	(*result).data[((NI)((*result).Sup.len + ((NI) 1)))- 0] = 0;
	(*result).Sup.len += ((NI) 1);
	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(((NI) 1));
	result->data[((NI) 0)] = x;
	return result;
}

N_NIMCALL(TGenericSeq*, incrSeqV2)(TGenericSeq* seq, NI elemsize) {
	TGenericSeq* result;
	result = 0;
	result = seq;
	{
		void* LOC5;
		if (!((NI)((*result).reserved & ((NI) IL64(9223372036854775807))) <= (*result).len)) goto LA3;
		(*result).reserved = resize_79401((NI)((*result).reserved & ((NI) IL64(9223372036854775807))));
		LOC5 = 0;
		LOC5 = growobj_66409(((void*) (result)), (NI)((NI)(elemsize * (*result).reserved) + ((NI) 16)));
		result = ((TGenericSeq*) (LOC5));
	}
	LA3: ;
	return result;
}

N_NIMCALL(void, genericassignaux_83412)(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_83406(((void*) ((NI)((NU64)(d) + (NU64)((*n).offset)))), ((void*) ((NI)((NU64)(s) + (NU64)((*n).offset)))), (*n).typ, shallow);
	}
	break;
	case ((NU8) 2):
	{
		{
			NI i_83448;
			NI HEX3Atmp_83606;
			NI res_83609;
			i_83448 = 0;
			HEX3Atmp_83606 = 0;
			HEX3Atmp_83606 = (NI)((*n).len - ((NI) 1));
			res_83609 = ((NI) 0);
			{
				while (1) {
					if (!(res_83609 <= HEX3Atmp_83606)) goto LA5;
					i_83448 = res_83609;
					genericassignaux_83412(dest, src, (*n).sons[(i_83448)- 0], shallow);
					res_83609 += ((NI) 1);
				} LA5: ;
			}
		}
	}
	break;
	case ((NU8) 3):
	{
		TNimNode* dd;
		TNimNode* m;
		dd = selectbranch_27807(dest, n);
		m = selectbranch_27807(src, n);
		{
			NIM_BOOL LOC9;
			LOC9 = 0;
			LOC9 = !((m == dd));
			if (!(LOC9)) goto LA10;
			LOC9 = !((dd == NIM_NIL));
			LA10: ;
			if (!LOC9) goto LA11;
			genericresetaux_83401(dest, dd);
		}
		LA11: ;
		memcpy(((void*) ((NI)((NU64)(d) + (NU64)((*n).offset)))), ((void*) ((NI)((NU64)(s) + (NU64)((*n).offset)))), ((NI) ((*(*n).typ).size)));
		{
			if (!!((m == NIM_NIL))) goto LA15;
			genericassignaux_83412(dest, src, m, shallow);
		}
		LA15: ;
	}
	break;
	case ((NU8) 0):
	{
	}
	break;
	}
}

N_NIMCALL(void, genericassignaux_83406)(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 & ((NI) (IL64(-9223372036854775807) - IL64(1)))) == ((NI) 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 & ((NI) (IL64(-9223372036854775807) - IL64(1)))) == ((NI) 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_84011;
			NI HEX3Atmp_84141;
			NI res_84144;
			i_84011 = 0;
			HEX3Atmp_84141 = 0;
			HEX3Atmp_84141 = (NI)((*seq).len - ((NI) 1));
			res_84144 = ((NI) 0);
			{
				while (1) {
					if (!(res_84144 <= HEX3Atmp_84141)) goto LA24;
					i_84011 = res_84144;
					genericassignaux_83406(((void*) ((NI)((NU64)((NI)((NU64)(dst) + (NU64)((NI)((NU64)(i_84011) * (NU64)((*(*mt).base).size))))) + (NU64)(((NI) 16))))), ((void*) ((NI)((NU64)((NI)((NU64)(((NI) (s2))) + (NU64)((NI)((NU64)(i_84011) * (NU64)((*(*mt).base).size))))) + (NU64)(((NI) 16))))), (*mt).base, shallow);
					res_84144 += ((NI) 1);
				} LA24: ;
			}
		}
	}
	break;
	case ((NU8) 17):
	{
		TNimType** pint;
		{
			if (!!(((*mt).base == NIM_NIL))) goto LA28;
			genericassignaux_83406(dest, src, (*mt).base, shallow);
		}
		LA28: ;
		genericassignaux_83412(dest, src, (*mt).node, shallow);
		pint = ((TNimType**) (dest));
		(*pint) = mt;
	}
	break;
	case ((NU8) 18):
	{
		genericassignaux_83412(dest, src, (*mt).node, shallow);
	}
	break;
	case ((NU8) 16):
	case ((NU8) 4):
	{
		{
			NI i_84089;
			NI HEX3Atmp_84152;
			NI res_84155;
			i_84089 = 0;
			HEX3Atmp_84152 = 0;
			HEX3Atmp_84152 = (NI)((NI)((*mt).size / (*(*mt).base).size) - ((NI) 1));
			res_84155 = ((NI) 0);
			{
				while (1) {
					if (!(res_84155 <= HEX3Atmp_84152)) goto LA34;
					i_84089 = res_84155;
					genericassignaux_83406(((void*) ((NI)((NU64)(d) + (NU64)((NI)((NU64)(i_84089) * (NU64)((*(*mt).base).size)))))), ((void*) ((NI)((NU64)(s) + (NU64)((NI)((NU64)(i_84089) * (NU64)((*(*mt).base).size)))))), (*mt).base, shallow);
					res_84155 += ((NI) 1);
				} LA34: ;
			}
		}
	}
	break;
	case ((NU8) 22):
	{
		unsureAsgnRef(((void**) (dest)), (*((void**) (s))));
	}
	break;
	default:
	{
		memcpy(dest, src, ((NI) ((*mt).size)));
	}
	break;
	}
	}BeforeRet: ;
}

N_NIMCALL(void, genericAssign)(void* dest, void* src, TNimType* mt) {
	genericassignaux_83406(dest, src, mt, NIM_FALSE);
}

N_NIMCALL(NimStringDesc*, setLengthStr)(NimStringDesc* s, NI newlen) {
	NimStringDesc* result;
	NI n;
	result = 0;
	n = ((newlen >= ((NI) 0)) ? newlen : ((NI) 0));
	{
		if (!(n <= (NI)((*s).Sup.reserved & ((NI) IL64(9223372036854775807))))) 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*, nimIntToStr)(NI x) {
	NimStringDesc* result;
	NI i;
	NI y;
	result = 0;
	result = mnewString(((NI) 32));
	i = ((NI) 0);
	y = x;
	{
		while (1) {
			NI d;
			d = (NI)(y / ((NI) 10));
			result->data[i] = ((NIM_CHAR) (((NI) ((NI)(((NI)(y - (NI)(d * ((NI) 10))) > 0? ((NI)(y - (NI)(d * ((NI) 10)))) : -((NI)(y - (NI)(d * ((NI) 10))))) + ((NI) 48))))));
			i += ((NI) 1);
			y = d;
			{
				if (!(y == ((NI) 0))) goto LA5;
				goto LA1;
			}
			LA5: ;
		}
	} LA1: ;
	{
		if (!(x < ((NI) 0))) goto LA9;
		result->data[i] = 45;
		i += ((NI) 1);
	}
	LA9: ;
	result = setLengthStr(result, ((NI) (i)));
	{
		NI j_80739;
		NI HEX3Atmp_80753;
		NI res_80756;
		j_80739 = 0;
		HEX3Atmp_80753 = 0;
		HEX3Atmp_80753 = (NI)((NI)(i / ((NI) 2)) - ((NI) 1));
		res_80756 = ((NI) 0);
		{
			while (1) {
				NIM_CHAR LOC14;
				if (!(res_80756 <= HEX3Atmp_80753)) goto LA13;
				j_80739 = res_80756;
				LOC14 = 0;
				LOC14 = result->data[j_80739];
				result->data[j_80739] = result->data[(NI)((NI)(i - j_80739) - ((NI) 1))];
				result->data[(NI)((NI)(i - j_80739) - ((NI) 1))] = LOC14;
				res_80756 += ((NI) 1);
			} LA13: ;
		}
	}
	return result;
}

N_NIMCALL(NI, writebuffer_15776)(FILE* f, void* buffer, NI len) {
	NI result;
	result = 0;
	result = fwrite(buffer, ((NI) 1), ((NI) (len)), f);
	return result;
}
N_NIMCALL(void, TMP430)(void* p, NI op) {
	Ioerror3628* a;
	a = (Ioerror3628*)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, sysfatal_81410)(NimStringDesc* message) {
	Ioerror3628* e;
	NimStringDesc* LOC1;
	e = 0;
	e = (Ioerror3628*) newObj((&NTI81417), sizeof(Ioerror3628));
	(*e).Sup.Sup.Sup.m_type = (&NTI3628);
	LOC1 = 0;
	LOC1 = (*e).Sup.Sup.message; (*e).Sup.Sup.message = copyStringRC1(message);
	if (LOC1) nimGCunrefNoCycle(LOC1);
	raiseException((Exception*)e, "IOError");
}

N_NOINLINE(void, raiseeio_81405)(NimStringDesc* msg) {
	sysfatal_81410(msg);
}

N_NIMCALL(void, write_15689)(FILE* f, NimStringDesc* s) {
	{
		NI LOC3;
		LOC3 = 0;
		LOC3 = writebuffer_15776(f, ((void*) (s->data)), ((NI) ((s ? s->Sup.len : 0))));
		if (!!((LOC3 == (s ? s->Sup.len : 0)))) goto LA4;
		raiseeio_81405(((NimStringDesc*) &TMP431));
	}
	LA4: ;
}

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

N_NIMCALL(NIM_BOOL, stacktraceavailable_20472)(void) {
	NIM_BOOL result;
	result = 0;
	result = NIM_FALSE;
	return result;
}

N_NIMCALL(void, writestacktrace_19007)(void) {
	showerrormessage_19606("No stack traceback available\012");
}
N_NIMCALL(void, TMP917)(void* p, NI op) {
	TNimObject* a;
	a = (TNimObject*)p;
}

N_NIMCALL(TNimType*, extGetCellType)(void* c) {
	TNimType* result;
	Cell47705* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = usrtocell_51640(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)((*result).reserved & ((NI) IL64(9223372036854775807))) < newlen)) goto LA3;
		LOC5 = 0;
		LOC5 = resize_79401((NI)((*result).reserved & ((NI) IL64(9223372036854775807))));
		(*result).reserved = ((LOC5 >= newlen) ? LOC5 : newlen);
		LOC6 = 0;
		LOC6 = growobj_66409(((void*) (result)), (NI)((NI)(elemsize * (*result).reserved) + ((NI) 16)));
		result = ((TGenericSeq*) (LOC6));
	}
	goto LA1;
	LA3: ;
	{
		if (!(newlen < (*result).len)) goto LA8;
		{
			NI i_80610;
			NI HEX3Atmp_80687;
			NI res_80690;
			i_80610 = 0;
			HEX3Atmp_80687 = 0;
			HEX3Atmp_80687 = (NI)((*result).len - ((NI) 1));
			res_80690 = newlen;
			{
				while (1) {
					TNimType* LOC13;
					if (!(res_80690 <= HEX3Atmp_80687)) goto LA12;
					i_80610 = res_80690;
					LOC13 = 0;
					LOC13 = extGetCellType(((void*) (result)));
					forallchildrenaux_52022(((void*) ((NI)((NU64)((NI)((NU64)(((NI) (result))) + (NU64)(((NI) 16)))) + (NU64)((NI)((NU64)(i_80610) * (NU64)(elemsize)))))), (*LOC13).base, ((NU8) 2));
					res_80690 += ((NI) 1);
				} LA12: ;
			}
		}
		zeroMem(((void*) ((NI)((NU64)((NI)((NU64)(((NI) (result))) + (NU64)(((NI) 16)))) + (NU64)((NI)((NU64)(newlen) * (NU64)(elemsize)))))), ((NI) ((NI)((NU64)((NI)((NU64)((*result).len) - (NU64)(newlen))) * (NU64)(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)), (NI)((*src).Sup.len + ((NI) 1)));
	(*dest).Sup.len += (*src).Sup.len;
}

static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) {
	{
		Cell47705* c;
		if (!!((src == NIM_NIL))) goto LA3;
		c = usrtocell_51640(src);
		(*c).refcount += ((NI) 8);
	}
	LA3: ;
	{
		Cell47705* c;
		if (!!(((*dest) == NIM_NIL))) goto LA7;
		c = usrtocell_51640((*dest));
		{
			(*c).refcount -= ((NI) 8);
			if (!((NU64)((*c).refcount) < (NU64)(((NI) 8)))) goto LA11;
			rtladdzct_53201(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

static N_INLINE(void, sysfatal_15626)(NimStringDesc* message, NimStringDesc* arg) {
	Ioerror3628* e;
	NimStringDesc* LOC1;
	e = 0;
	e = (Ioerror3628*) newObj((&NTI81417), sizeof(Ioerror3628));
	(*e).Sup.Sup.Sup.m_type = (&NTI3628);
	LOC1 = 0;
	LOC1 = rawNewString(message->Sup.len + arg->Sup.len + 0);
appendString(LOC1, message);
appendString(LOC1, arg);
	asgnRefNoCycle((void**) (&(*e).Sup.Sup.message), LOC1);
	raiseException((Exception*)e, "IOError");
}

N_NIMCALL(FILE*, open_15617)(NimStringDesc* filename, NU8 mode, NI bufsize) {
	FILE* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = open_15603(&result, filename, mode, bufsize);
		if (!!(LOC3)) goto LA4;
		sysfatal_15626(((NimStringDesc*) &TMP1054), filename);
	}
	LA4: ;
	return result;
}

N_NIMCALL(NIM_BOOL, readline_15713)(FILE* f, NimStringDesc** line) {
	NIM_BOOL result;
	NI pos;
	NI space;
{	result = 0;
	pos = ((NI) 0);
	space = (NI)((*((TGenericSeq*) ((*line)))).reserved & ((NI) IL64(9223372036854775807)));
	(*line) = setLengthStr((*line), ((NI) (space)));
	{
		while (1) {
			void* m;
			memset(((void*) ((&(*line)->data[pos]))), ((int) 10), space);
			{
				NCSTRING LOC5;
				LOC5 = 0;
				LOC5 = fgets(((NCSTRING) ((&(*line)->data[pos]))), space, f);
				if (!(LOC5 == NIM_NIL)) goto LA6;
				(*line) = setLengthStr((*line), ((NI) 0));
				result = NIM_FALSE;
				goto BeforeRet;
			}
			LA6: ;
			m = memchr(((void*) ((&(*line)->data[pos]))), ((int) 10), space);
			{
				NI last;
				if (!!((m == NIM_NIL))) goto LA10;
				last = (NI)(((NI) (m)) - ((NI) ((&(*line)->data[((NI) 0)]))));
				{
					NIM_BOOL LOC14;
					LOC14 = 0;
					LOC14 = (((NI) 0) < last);
					if (!(LOC14)) goto LA15;
					LOC14 = ((NU8)((*line)->data[(NI)(last - ((NI) 1))]) == (NU8)(13));
					LA15: ;
					if (!LOC14) goto LA16;
					(*line) = setLengthStr((*line), ((NI) ((NI)(last - ((NI) 1)))));
					result = NIM_TRUE;
					goto BeforeRet;
				}
				goto LA12;
				LA16: ;
				{
					NIM_BOOL LOC19;
					LOC19 = 0;
					LOC19 = (((NI) 0) < last);
					if (!(LOC19)) goto LA20;
					LOC19 = ((NU8)((*line)->data[(NI)(last - ((NI) 1))]) == (NU8)(0));
					LA20: ;
					if (!LOC19) goto LA21;
					{
						NIM_BOOL LOC25;
						LOC25 = 0;
						LOC25 = (last < (NI)((NI)(pos + space) - ((NI) 1)));
						if (!(LOC25)) goto LA26;
						LOC25 = !(((NU8)((*line)->data[(NI)(last + ((NI) 1))]) == (NU8)(0)));
						LA26: ;
						if (!LOC25) goto LA27;
						last -= ((NI) 1);
					}
					LA27: ;
				}
				goto LA12;
				LA21: ;
				LA12: ;
				(*line) = setLengthStr((*line), ((NI) (last)));
				result = NIM_TRUE;
				goto BeforeRet;
			}
			goto LA8;
			LA10: ;
			{
				space -= ((NI) 1);
			}
			LA8: ;
			pos += space;
			space = ((NI) 128);
			(*line) = setLengthStr((*line), ((NI) ((NI)(pos + space))));
		}
	}
	}BeforeRet: ;
	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, TMP1055)(void* p, NI op) {
	Reraiseerror3660* a;
	a = (Reraiseerror3660*)p;
	nimGCvisit((void*)(*a).Sup.parent, op);
	nimGCvisit((void*)(*a).Sup.message, op);
	nimGCvisit((void*)(*a).Sup.trace, op);
}

static N_INLINE(void, sysfatal_21417)(NimStringDesc* message) {
	Reraiseerror3660* e;
	NimStringDesc* LOC1;
	e = 0;
	e = (Reraiseerror3660*) newObj((&NTI21424), sizeof(Reraiseerror3660));
	(*e).Sup.Sup.m_type = (&NTI3660);
	LOC1 = 0;
	LOC1 = (*e).Sup.message; (*e).Sup.message = copyStringRC1(message);
	if (LOC1) nimGCunrefNoCycle(LOC1);
	raiseException((Exception*)e, "ReraiseError");
}

N_NIMCALL(void, reraiseException)(void) {
	{
		if (!(currexception_19639 == NIM_NIL)) goto LA3;
		sysfatal_21417(((NimStringDesc*) &TMP1056));
	}
	goto LA1;
	LA3: ;
	{
		raiseexceptionaux_20801(currexception_19639);
	}
	LA1: ;
}

N_NIMCALL(NimStringDesc*, HEX24_186183)(TY88887 x) {
	NimStringDesc* result;
	NIM_BOOL firstelement;
	NimStringDesc* LOC14;
	result = 0;
	result = copyString(((NimStringDesc*) &TMP1057));
	firstelement = NIM_TRUE;
	{
		if (!!(firstelement)) goto LA3;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TMP1058));
	}
	LA3: ;
	result = resizeString(result, 8);
appendString(result, ((NimStringDesc*) &TMP1059));
	result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TMP1060));
	{
		if (!x.Field0 == 0) goto LA7;
		result = resizeString(result, 3);
appendString(result, ((NimStringDesc*) &TMP1061));
	}
	goto LA5;
	LA7: ;
	{
		result = resizeString(result, x.Field0->Sup.len + 0);
appendString(result, x.Field0);
	}
	LA5: ;
	firstelement = NIM_FALSE;
	{
		if (!!(firstelement)) goto LA12;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TMP1058));
	}
	LA12: ;
	result = resizeString(result, 4);
appendString(result, ((NimStringDesc*) &TMP1062));
	result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TMP1060));
	LOC14 = 0;
	LOC14 = nimIntToStr(x.Field1);
	result = resizeString(result, LOC14->Sup.len + 0);
appendString(result, LOC14);
	firstelement = NIM_FALSE;
	result = resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TMP1063));
	return result;
}

N_NIMCALL(NIM_CHAR, getdecimalpoint_80806)(void) {
	NIM_CHAR result;
	result = 0;
	result = decimalpoint_80805;
	{
		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_80805 = result;
	}
	LA3: ;
	return result;
}

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

N_NIMCALL(NimStringDesc*, reprEnum)(NI e_85209, TNimType* typ) {
	NimStringDesc* result;
	NI e;
	NimStringDesc* LOC25;
	NimStringDesc* LOC26;
{	result = 0;
	{
		if (!((*typ).size == ((NI) 1))) goto LA3;
		e = ((NI) ((NI)(e_85209 & ((NI) 255))));
	}
	goto LA1;
	LA3: ;
	{
		if (!((*typ).size == ((NI) 2))) goto LA6;
		e = ((NI) ((NI)(e_85209 & ((NI) 65535))));
	}
	goto LA1;
	LA6: ;
	{
		e = e_85209;
	}
	LA1: ;
	{
		if (!!((((*typ).flags &(1U<<((NU)(((NU8) 2))&7U)))!=0))) goto LA11;
		{
			if (!((NU64)(e) < (NU64)((*(*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_85247;
			NI HEX3Atmp_85249;
			NI res_85252;
			i_85247 = 0;
			HEX3Atmp_85249 = 0;
			HEX3Atmp_85249 = (NI)((*n).len - ((NI) 1));
			res_85252 = ((NI) 0);
			{
				while (1) {
					if (!(res_85252 <= HEX3Atmp_85249)) goto LA20;
					i_85247 = res_85252;
					{
						if (!((*s[(i_85247)- 0]).offset == e)) goto LA23;
						result = cstrToNimstr((*s[(i_85247)- 0]).name);
						goto BeforeRet;
					}
					LA23: ;
					res_85252 += ((NI) 1);
				} LA20: ;
			}
		}
	}
	LA9: ;
	LOC25 = 0;
	LOC26 = 0;
	LOC26 = nimIntToStr(e);
	LOC25 = rawNewString(LOC26->Sup.len + 16);
appendString(LOC25, LOC26);
appendString(LOC25, ((NimStringDesc*) &TMP1108));
	result = LOC25;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tnodeseq213784*, HEX40_214609)(Tnode213790** a, NI aLen0) {
	Tnodeseq213784* result;
	result = 0;
	result = (Tnodeseq213784*) newSeq((&NTI213784), ((NI) (aLen0)));
	{
		NI i_214650;
		NI HEX3Atmp_214652;
		NI res_214655;
		i_214650 = 0;
		HEX3Atmp_214652 = 0;
		HEX3Atmp_214652 = (NI)(aLen0 - ((NI) 1));
		res_214655 = ((NI) 0);
		{
			while (1) {
				if (!(res_214655 <= HEX3Atmp_214652)) goto LA3;
				i_214650 = res_214655;
				asgnRefNoCycle((void**) (&result->data[i_214650]), a[i_214650]);
				res_214655 += ((NI) 1);
			} LA3: ;
		}
	}
	return result;
}

N_NIMCALL(void, objectinitaux_84278)(void* dest, TNimNode* n) {
	NI d;
	d = ((NI) (dest));
	switch ((*n).kind) {
	case ((NU8) 0):
	{
	}
	break;
	case ((NU8) 1):
	{
		objectInit(((void*) ((NI)((NU64)(d) + (NU64)((*n).offset)))), (*n).typ);
	}
	break;
	case ((NU8) 2):
	{
		{
			NI i_84419;
			NI HEX3Atmp_84436;
			NI res_84439;
			i_84419 = 0;
			HEX3Atmp_84436 = 0;
			HEX3Atmp_84436 = (NI)((*n).len - ((NI) 1));
			res_84439 = ((NI) 0);
			{
				while (1) {
					if (!(res_84439 <= HEX3Atmp_84436)) goto LA6;
					i_84419 = res_84439;
					objectinitaux_84278(dest, (*n).sons[(i_84419)- 0]);
					res_84439 += ((NI) 1);
				} LA6: ;
			}
		}
	}
	break;
	case ((NU8) 3):
	{
		TNimNode* m;
		m = selectbranch_27807(dest, n);
		{
			if (!!((m == NIM_NIL))) goto LA10;
			objectinitaux_84278(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_84278(dest, (*typ).node);
	}
	break;
	case ((NU8) 18):
	{
		objectinitaux_84278(dest, (*typ).node);
	}
	break;
	case ((NU8) 16):
	case ((NU8) 4):
	{
		{
			NI i_84459;
			NI HEX3Atmp_84473;
			NI res_84476;
			i_84459 = 0;
			HEX3Atmp_84473 = 0;
			HEX3Atmp_84473 = (NI)((NI)((*typ).size / (*(*typ).base).size) - ((NI) 1));
			res_84476 = ((NI) 0);
			{
				while (1) {
					if (!(res_84476 <= HEX3Atmp_84473)) goto LA6;
					i_84459 = res_84476;
					objectInit(((void*) ((NI)((NU64)(d) + (NU64)((NI)(i_84459 * (*(*typ).base).size))))), (*typ).base);
					res_84476 += ((NI) 1);
				} LA6: ;
			}
		}
	}
	break;
	default:
	{
	}
	break;
	}
}
N_NIMCALL(void, TMP1226)(void* p, NI op) {
	Oserror3630* a;
	a = (Oserror3630*)p;
	nimGCvisit((void*)(*a).Sup.Sup.parent, op);
	nimGCvisit((void*)(*a).Sup.Sup.message, op);
	nimGCvisit((void*)(*a).Sup.Sup.trace, op);
}
N_NIMCALL(void, TMP1229)(void* p, NI op) {
	Keyerror3648* a;
	a = (Keyerror3648*)p;
	nimGCvisit((void*)(*a).Sup.Sup.parent, op);
	nimGCvisit((void*)(*a).Sup.Sup.message, op);
	nimGCvisit((void*)(*a).Sup.Sup.trace, op);
}

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

N_NIMCALL(NI, ptrsize_46013)(void* p) {
	NI result;
	void* x;
	Basechunk29838* c;
	result = 0;
	x = ((void*) ((NI)((NU64)(((NI) (p))) - (NU64)(((NI)sizeof(Freecell29830))))));
	c = pageaddr_31580(p);
	result = (NI)((NU64)((*c).size) - (NU64)(((NI)sizeof(Freecell29830))));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = issmallchunk_31469(c);
		if (!!(LOC3)) goto LA4;
		result -= (NI)(((NI)sizeof(Bigchunk29842)) - ((NI) 8));
	}
	LA4: ;
	return result;
}

N_NIMCALL(void*, realloc_47404)(Memregion29888* allocator, void* p, NI newsize) {
	void* result;
	result = 0;
	{
		if (!(((NI) 0) < ((NI) (newsize)))) goto LA3;
		result = alloc0_46416(allocator, newsize);
		{
			NI LOC9;
			if (!!((p == NIM_NIL))) goto LA7;
			LOC9 = 0;
			LOC9 = ptrsize_46013(p);
			memcpy(result, p, ((NI) (LOC9)));
			dealloc_46422(allocator, p);
		}
		LA7: ;
	}
	goto LA1;
	LA3: ;
	{
		if (!!((p == NIM_NIL))) goto LA11;
		dealloc_46422(allocator, p);
	}
	goto LA1;
	LA11: ;
	LA1: ;
	return result;
}

N_NOCONV(void*, realloc_7433)(void* p, NI newsize) {
	void* result;
	result = 0;
	result = realloc_47404((&gch_50059.region), p, newsize);
	return result;
}

N_NIMCALL(NimStringDesc*, nimInt64ToStr)(NI64 x) {
	NimStringDesc* result;
	NI i;
	NI64 y;
	result = 0;
	result = mnewString(((NI) 32));
	i = ((NI) 0);
	y = x;
	{
		while (1) {
			NI64 d;
			d = (NI64)(y / IL64(10));
			result->data[i] = ((NIM_CHAR) (((NI) ((NI)((((NI) ((NI64)(y - (NI64)(d * IL64(10))))) > 0? (((NI) ((NI64)(y - (NI64)(d * IL64(10)))))) : -(((NI) ((NI64)(y - (NI64)(d * IL64(10))))))) + ((NI) 48))))));
			i += ((NI) 1);
			y = d;
			{
				if (!(y == IL64(0))) goto LA5;
				goto LA1;
			}
			LA5: ;
		}
	} LA1: ;
	{
		if (!(x < IL64(0))) goto LA9;
		result->data[i] = 45;
		i += ((NI) 1);
	}
	LA9: ;
	result = setLengthStr(result, ((NI) (i)));
	{
		NI j_81136;
		NI HEX3Atmp_81150;
		NI res_81153;
		j_81136 = 0;
		HEX3Atmp_81150 = 0;
		HEX3Atmp_81150 = (NI)((NI)(i / ((NI) 2)) - ((NI) 1));
		res_81153 = ((NI) 0);
		{
			while (1) {
				NIM_CHAR LOC14;
				if (!(res_81153 <= HEX3Atmp_81150)) goto LA13;
				j_81136 = res_81153;
				LOC14 = 0;
				LOC14 = result->data[j_81136];
				result->data[j_81136] = result->data[(NI)((NI)(i - j_81136) - ((NI) 1))];
				result->data[(NI)((NI)(i - j_81136) - ((NI) 1))] = LOC14;
				res_81153 += ((NI) 1);
			} LA13: ;
		}
	}
	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(NimStringDesc*, nimFloatToStr)(NF f) {
	NimStringDesc* result;
	TY80765 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_80778;
		NI HEX3Atmp_80793;
		NI res_80796;
		i_80778 = 0;
		HEX3Atmp_80793 = 0;
		HEX3Atmp_80793 = (NI)(n - ((NI) 1));
		res_80796 = ((NI) 0);
		{
			while (1) {
				if (!(res_80796 <= HEX3Atmp_80793)) goto LA4;
				i_80778 = res_80796;
				{
					if (!((NU8)(buf[(i_80778)- 0]) == (NU8)(44))) goto LA7;
					buf[(i_80778)- 0] = 46;
					hasdot = NIM_TRUE;
				}
				goto LA5;
				LA7: ;
				{
					if (!(((NU8)(buf[(i_80778)- 0])) >= ((NU8)(97)) && ((NU8)(buf[(i_80778)- 0])) <= ((NU8)(122)) || ((NU8)(buf[(i_80778)- 0])) >= ((NU8)(65)) && ((NU8)(buf[(i_80778)- 0])) <= ((NU8)(90)) || ((NU8)(buf[(i_80778)- 0])) == ((NU8)(46)))) goto LA10;
					hasdot = NIM_TRUE;
				}
				goto LA5;
				LA10: ;
				LA5: ;
				res_80796 += ((NI) 1);
			} LA4: ;
		}
	}
	{
		if (!!(hasdot)) goto LA14;
		buf[(n)- 0] = 46;
		buf[((NI)(n + ((NI) 1)))- 0] = 48;
		buf[((NI)(n + ((NI) 2)))- 0] = 0;
	}
	LA14: ;
	{
		if (!((NU8)(buf[((NI)(n - ((NI) 1)))- 0]) == (NU8)(78))) goto LA18;
		result = copyString(((NimStringDesc*) &TMP1385));
	}
	goto LA16;
	LA18: ;
	{
		if (!((NU8)(buf[((NI)(n - ((NI) 1)))- 0]) == (NU8)(70))) goto LA21;
		{
			if (!((NU8)(buf[(((NI) 0))- 0]) == (NU8)(45))) goto LA25;
			result = copyString(((NimStringDesc*) &TMP1386));
		}
		goto LA23;
		LA25: ;
		{
			result = copyString(((NimStringDesc*) &TMP1387));
		}
		LA23: ;
	}
	goto LA16;
	LA21: ;
	{
		result = cstrToNimstr(((NCSTRING) (buf)));
	}
	LA16: ;
	return result;
}

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

static N_INLINE(void*, seqtoptr_530160)(TY213913* x) {
	void* result;
	result = 0;
	result = ((void*) (x));
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_530149)(TY213913* x, TY213913* y) {
	NIM_BOOL result;
{	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_530160(x);
		LOC4 = 0;
		LOC4 = seqtoptr_530160(y);
		if (!(LOC3 == LOC4)) goto LA5;
		result = NIM_TRUE;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC8;
		void* LOC9;
		void* LOC11;
		LOC8 = 0;
		LOC9 = 0;
		LOC9 = seqtoptr_530160(x);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_530160(y);
		LOC8 = (LOC11 == NIM_NIL);
		LA10: ;
		if (!LOC8) goto LA12;
		result = NIM_FALSE;
	}
	goto LA1;
	LA12: ;
	{
		if (!((x ? x->Sup.len : 0) == (y ? y->Sup.len : 0))) goto LA15;
		{
			NI i_530225;
			NI HEX3Atmp_530227;
			NI res_530230;
			i_530225 = 0;
			HEX3Atmp_530227 = 0;
			HEX3Atmp_530227 = (NI)((x ? x->Sup.len : 0) - ((NI) 1));
			res_530230 = ((NI) 0);
			{
				while (1) {
					if (!(res_530230 <= HEX3Atmp_530227)) goto LA19;
					i_530225 = res_530230;
					{
						if (!!((x->data[i_530225] == y->data[i_530225]))) goto LA22;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA22: ;
					res_530230 += ((NI) 1);
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, safeadd_530138)(TY213913** x, NI32 y) {
	{
		NIM_BOOL LOC3;
		TY530234 LOC6;
		LOC3 = 0;
		LOC3 = HEX3DHEX3D_530149((*x), NIM_NIL);
		if (!LOC3) goto LA4;
		unsureAsgnRef((void**) (&(*x)), (TY213913*) newSeq((&NTI213913), 1));
		LOC6[0] = y;
		(*x)->data[0] = LOC6[0];
	}
	goto LA1;
	LA4: ;
	{
		(*x) = (TY213913*) incrSeqV2(&((*x))->Sup, sizeof(NI32));
		(*x)->data[(*x)->Sup.len] = y;
		++(*x)->Sup.len;
	}
	LA1: ;
}

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

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

N_NIMCALL(NIM_BOOL, endoffile_15654)(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(NimStringDesc*, readallbuffer_82058)(FILE* file) {
	NimStringDesc* result;
	NimStringDesc* buffer;
	result = 0;
	result = copyString(((NimStringDesc*) &TMP1550));
	buffer = mnewString(((NI) 4000));
	{
		while (1) {
			NI bytesread;
			bytesread = readbuffer_15754(file, ((void*) ((&buffer->data[((NI) 0)]))), ((NI) 4000));
			{
				if (!(bytesread == ((NI) 4000))) goto LA5;
				result = resizeString(result, buffer->Sup.len + 0);
appendString(result, buffer);
			}
			goto LA3;
			LA5: ;
			{
				buffer = setLengthStr(buffer, ((NI) (bytesread)));
				result = resizeString(result, buffer->Sup.len + 0);
appendString(result, buffer);
				goto LA1;
			}
			LA3: ;
		}
	} LA1: ;
	return result;
}

N_NIMCALL(NimStringDesc*, readallfile_82072)(FILE* file, NI len) {
	NimStringDesc* result;
	NI bytes;
	result = 0;
	result = mnewString(((NI) (len)));
	bytes = readbuffer_15754(file, ((void*) ((&result->data[((NI) 0)]))), ((NI) (len)));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = endoffile_15654(file);
		if (!LOC3) goto LA4;
		{
			if (!(bytes < len)) goto LA8;
			result = setLengthStr(result, ((NI) (bytes)));
		}
		LA8: ;
	}
	goto LA1;
	LA4: ;
	{
		NI LOC11;
		LOC11 = 0;
		LOC11 = ferror(file);
		if (!!((LOC11 == ((NI) 0)))) goto LA12;
		raiseeio_81405(((NimStringDesc*) &TMP1549));
	}
	goto LA1;
	LA12: ;
	{
		NimStringDesc* LOC15;
		LOC15 = 0;
		LOC15 = readallbuffer_82058(file);
		result = resizeString(result, LOC15->Sup.len + 0);
appendString(result, LOC15);
	}
	LA1: ;
	return result;
}

N_NIMCALL(NimStringDesc*, readall_15663)(FILE* file) {
	NimStringDesc* result;
	NI len;
	result = 0;
	{
		if (!!((file == stdin))) goto LA3;
		len = rawfilesize_82066(file);
	}
	goto LA1;
	LA3: ;
	{
		len = ((NI) -1);
	}
	LA1: ;
	{
		if (!(((NI) 0) < len)) goto LA8;
		result = readallfile_82072(file, len);
	}
	goto LA6;
	LA8: ;
	{
		result = readallbuffer_82058(file);
	}
	LA6: ;
	return result;
}

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

N_NIMCALL(NimStringDesc*, readfile_15666)(NimStringDesc* filename) {
	NimStringDesc* volatile result;
	FILE* f;
	TSafePoint TMP1548;
	result = 0;
	f = open_15617(filename, ((NU8) 0), ((NI) -1));
	pushSafePoint(&TMP1548);
	TMP1548.status = _setjmp(TMP1548.context);
	if (TMP1548.status == 0) {
		result = readall_15663(f);
		popSafePoint();
	}
	else {
		popSafePoint();
	}
	{
		fclose(f);
	}
	if (TMP1548.status != 0) reraiseException();
	return result;
}

N_NIMCALL(NI, cmp_5680)(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 = ((NI) 0);
	{
		NI i_80220;
		NI HEX3Atmp_80268;
		NI res_80271;
		i_80220 = 0;
		HEX3Atmp_80268 = 0;
		HEX3Atmp_80268 = (NI)((s ? s->Sup.len : 0) - ((NI) 1));
		res_80271 = ((NI) 0);
		{
			while (1) {
				if (!(res_80271 <= HEX3Atmp_80268)) goto LA3;
				i_80220 = res_80271;
				h = (NI)((NU64)(h) + (NU64)(((NI) (((NU8)(s->data[i_80220]))))));
				h = (NI)((NU64)(h) + (NU64)((NI)((NU64)(h) << (NU64)(((NI) 10)))));
				h = (NI)(h ^ (NI)((NU64)(h) >> (NU64)(((NI) 6))));
				res_80271 += ((NI) 1);
			} LA3: ;
		}
	}
	h = (NI)((NU64)(h) + (NU64)((NI)((NU64)(h) << (NU64)(((NI) 3)))));
	h = (NI)(h ^ (NI)((NU64)(h) >> (NU64)(((NI) 11))));
	h = (NI)((NU64)(h) + (NU64)((NI)((NU64)(h) << (NU64)(((NI) 15)))));
	result = h;
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_191093)(Sha1digest191003 x, Sha1digest191003 y) {
	NIM_BOOL result;
{	result = 0;
	{
		NI f_191214;
		NI res_191227;
		f_191214 = 0;
		res_191227 = ((NI) 0);
		{
			while (1) {
				if (!(res_191227 <= ((NI) 19))) goto LA3;
				f_191214 = ((NI) (res_191227));
				{
					if (!!((x[(f_191214)- 0] == y[(f_191214)- 0]))) goto LA6;
					goto BeforeRet;
				}
				LA6: ;
				res_191227 += ((NI) 1);
			} LA3: ;
		}
	}
	result = NIM_TRUE;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, write_15705)(FILE* f, NimStringDesc** a, NI aLen0) {
	{
		NimStringDesc* x_82051;
		NI i_82057;
		x_82051 = 0;
		i_82057 = ((NI) 0);
		{
			while (1) {
				if (!(i_82057 < aLen0)) goto LA3;
				x_82051 = a[i_82057];
				write_15689(f, x_82051);
				i_82057 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, Gcdisablemarkandsweep_9819)(void) {
	gch_50059.cyclethreshold = ((NI) IL64(9223372036854775806));
}
N_NIMCALL(void, TMP1663)(void* p, NI op) {
	Indexerror3652* a;
	a = (Indexerror3652*)p;
	nimGCvisit((void*)(*a).Sup.parent, op);
	nimGCvisit((void*)(*a).Sup.message, op);
	nimGCvisit((void*)(*a).Sup.trace, op);
}

N_NIMCALL(NimStringDesc*, readline_15710)(FILE* f) {
	NimStringDesc* result;
	result = 0;
	result = rawNewString(((NI) 80));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = readline_15713(f, (&result));
		if (!!(LOC3)) goto LA4;
		raiseeio_81405(((NimStringDesc*) &TMP1916));
	}
	LA4: ;
	return result;
}

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

static N_INLINE(void, sysfatal_88898)(NimStringDesc* message) {
	Assertionerror3644* e;
	NimStringDesc* LOC1;
	e = 0;
	e = (Assertionerror3644*) newObj((&NTI88905), sizeof(Assertionerror3644));
	(*e).Sup.Sup.m_type = (&NTI3644);
	LOC1 = 0;
	LOC1 = (*e).Sup.message; (*e).Sup.message = copyStringRC1(message);
	if (LOC1) nimGCunrefNoCycle(LOC1);
	raiseException((Exception*)e, "AssertionError");
}

N_NOINLINE(void, raiseassert_88893)(NimStringDesc* msg) {
	sysfatal_88898(msg);
}

static N_INLINE(void*, seqtoptr_247938)(Ttypeseq213824* x) {
	void* result;
	result = 0;
	result = ((void*) (x));
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_247927)(Ttypeseq213824* x, Ttypeseq213824* y) {
	NIM_BOOL result;
{	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_247938(x);
		LOC4 = 0;
		LOC4 = seqtoptr_247938(y);
		if (!(LOC3 == LOC4)) goto LA5;
		result = NIM_TRUE;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC8;
		void* LOC9;
		void* LOC11;
		LOC8 = 0;
		LOC9 = 0;
		LOC9 = seqtoptr_247938(x);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_247938(y);
		LOC8 = (LOC11 == NIM_NIL);
		LA10: ;
		if (!LOC8) goto LA12;
		result = NIM_FALSE;
	}
	goto LA1;
	LA12: ;
	{
		if (!((x ? x->Sup.len : 0) == (y ? y->Sup.len : 0))) goto LA15;
		{
			NI i_248003;
			NI HEX3Atmp_248016;
			NI res_248019;
			i_248003 = 0;
			HEX3Atmp_248016 = 0;
			HEX3Atmp_248016 = (NI)((x ? x->Sup.len : 0) - ((NI) 1));
			res_248019 = ((NI) 0);
			{
				while (1) {
					if (!(res_248019 <= HEX3Atmp_248016)) goto LA19;
					i_248003 = res_248019;
					{
						if (!!((x->data[i_248003] == y->data[i_248003]))) goto LA22;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA22: ;
					res_248019 += ((NI) 1);
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_243515)(TY243443 x, TY243443 y) {
	NIM_BOOL result;
{	result = 0;
	{
		if (!!((x.Field0 == y.Field0))) goto LA3;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA3: ;
	{
		if (!!((x.Field1 == y.Field1))) goto LA7;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA7: ;
	result = NIM_TRUE;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, safeadd_282485)(Ttypeseq213824** x, Ttype213828* y) {
	{
		NIM_BOOL LOC3;
		TY365877 LOC6;
		LOC3 = 0;
		LOC3 = HEX3DHEX3D_247927((*x), NIM_NIL);
		if (!LOC3) goto LA4;
		unsureAsgnRef((void**) (&(*x)), (Ttypeseq213824*) newSeq((&NTI213824), 1));
		memset((void*)LOC6, 0, sizeof(LOC6));
		LOC6[0] = y;
		asgnRefNoCycle((void**) (&(*x)->data[0]), LOC6[0]);
	}
	goto LA1;
	LA4: ;
	{
		(*x) = (Ttypeseq213824*) incrSeqV2(&((*x))->Sup, sizeof(Ttype213828*));
		asgnRefNoCycle((void**) (&(*x)->data[(*x)->Sup.len]), y);
		++(*x)->Sup.len;
	}
	LA1: ;
}

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

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

N_NIMCALL(void, writefile_15669)(NimStringDesc* filename, NimStringDesc* content) {
	FILE* f;
	TSafePoint TMP2901;
	f = open_15617(filename, ((NU8) 1), ((NI) -1));
	pushSafePoint(&TMP2901);
	TMP2901.status = _setjmp(TMP2901.context);
	if (TMP2901.status == 0) {
		write_15689(f, content);
		popSafePoint();
	}
	else {
		popSafePoint();
	}
	{
		fclose(f);
	}
	if (TMP2901.status != 0) reraiseException();
}

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

N_NIMCALL(NCSTRING*, alloccstringarray_16401)(NimStringDesc** a, NI aLen0) {
	NCSTRING* result;
	void* LOC1;
	NimStringDesc** x;
	result = 0;
	LOC1 = 0;
	LOC1 = alloc0_7417(((NI) ((NI)((NI)(aLen0 + ((NI) 1)) * ((NI) 8)))));
	result = ((NCSTRING*) (LOC1));
	x = ((NimStringDesc**) (a));
	{
		NI i_16615;
		NI HEX3Atmp_16622;
		NI res_16625;
		i_16615 = 0;
		HEX3Atmp_16622 = 0;
		HEX3Atmp_16622 = (aLen0-1);
		res_16625 = ((NI) 0);
		{
			while (1) {
				void* LOC5;
				if (!(res_16625 <= HEX3Atmp_16622)) goto LA4;
				i_16615 = res_16625;
				LOC5 = 0;
				LOC5 = alloc0_7417(((NI) ((NI)((x[(i_16615)- 0] ? x[(i_16615)- 0]->Sup.len : 0) + ((NI) 1)))));
				result[(i_16615)- 0] = ((NCSTRING) (LOC5));
				memcpy(((void*) (result[(i_16615)- 0])), ((void*) ((&x[(i_16615)- 0]->data[((NI) 0)]))), ((NI) ((x[(i_16615)- 0] ? x[(i_16615)- 0]->Sup.len : 0))));
				res_16625 += ((NI) 1);
			} LA4: ;
		}
	}
	return result;
}

N_NIMCALL(void, dealloccstringarray_16629)(NCSTRING* a) {
	NI i;
	i = ((NI) 0);
	{
		while (1) {
			if (!!((a[(i)- 0] == NIM_NIL))) goto LA2;
			dealloc_7448(((void*) (a[(i)- 0])));
			i += ((NI) 1);
		} LA2: ;
	}
	dealloc_7448(((void*) (a)));
}

N_NIMCALL(NIM_BOOL, open_15611)(FILE** f, int filehandle, NU8 mode) {
	NIM_BOOL result;
	result = 0;
	(*f) = fdopen(filehandle, Formatopen_82810[(mode)- 0]->data);
	result = !(((*f) == NIM_NIL));
	return result;
}

N_NIMCALL(NimStringDesc*, HEX24_7801)(NU64 x) {
	NimStringDesc* result;
	result = 0;
	{
		if (!(x == ((NI) 0))) goto LA3;
		result = copyString(((NimStringDesc*) &TMP3067));
	}
	goto LA1;
	LA3: ;
	{
		TY85037 buf;
		NI i;
		NU64 n;
		NI half;
		memset((void*)buf, 0, sizeof(buf));
		i = ((NI) 0);
		n = x;
		{
			while (1) {
				NU64 nn;
				if (!!((n == ((NI) 0)))) goto LA7;
				nn = (NU64)((NU64)(n) / (NU64)(10ULL));
				buf[(i)- 0] = ((NIM_CHAR) ((NU64)((NU64)((NU64)((NU64)(n) - (NU64)((NU64)((NU64)(10ULL) * (NU64)(nn))))) + (NU64)(((NI) 48)))));
				i += ((NI) 1);
				n = nn;
			} LA7: ;
		}
		half = (NI)(i / ((NI) 2));
		{
			NI t_85122;
			NI HEX3Atmp_85137;
			NI res_85140;
			t_85122 = 0;
			HEX3Atmp_85137 = 0;
			HEX3Atmp_85137 = (half - 1);
			res_85140 = ((NI) 0);
			{
				while (1) {
					NIM_CHAR LOC11;
					if (!(res_85140 <= HEX3Atmp_85137)) goto LA10;
					t_85122 = res_85140;
					LOC11 = 0;
					LOC11 = buf[(t_85122)- 0];
					buf[(t_85122)- 0] = buf[((NI)((NI)(i - t_85122) - ((NI) 1)))- 0];
					buf[((NI)((NI)(i - t_85122) - ((NI) 1)))- 0] = LOC11;
					res_85140 += ((NI) 1);
				} LA10: ;
			}
		}
		result = cstrToNimstr(((NCSTRING) (buf)));
	}
	LA1: ;
	return result;
}

N_NIMCALL(NI, clamp_145165)(NI x, NI a, NI b) {
	NI result;
{	result = 0;
	{
		if (!(x < a)) goto LA3;
		result = a;
		goto BeforeRet;
	}
	LA3: ;
	{
		if (!(b < x)) goto LA7;
		result = b;
		goto BeforeRet;
	}
	LA7: ;
	result = x;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

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

N_NIMCALL(Tinstantiation213812*, new_427322)(void) {
	Tinstantiation213812* result;
	Tinstantiation213812* r;
{	result = 0;
	r = 0;
	r = (Tinstantiation213812*) newObj((&NTI213814), sizeof(Tinstantiation213812));
	result = r;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

static N_INLINE(void*, seqtoptr_216875)(TY213925* x) {
	void* result;
	result = 0;
	result = ((void*) (x));
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_216864)(TY213925* x, TY213925* y) {
	NIM_BOOL result;
{	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_216875(x);
		LOC4 = 0;
		LOC4 = seqtoptr_216875(y);
		if (!(LOC3 == LOC4)) goto LA5;
		result = NIM_TRUE;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC8;
		void* LOC9;
		void* LOC11;
		LOC8 = 0;
		LOC9 = 0;
		LOC9 = seqtoptr_216875(x);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_216875(y);
		LOC8 = (LOC11 == NIM_NIL);
		LA10: ;
		if (!LOC8) goto LA12;
		result = NIM_FALSE;
	}
	goto LA1;
	LA12: ;
	{
		if (!((x ? x->Sup.len : 0) == (y ? y->Sup.len : 0))) goto LA15;
		{
			NI i_216940;
			NI HEX3Atmp_216953;
			NI res_216956;
			i_216940 = 0;
			HEX3Atmp_216953 = 0;
			HEX3Atmp_216953 = (NI)((x ? x->Sup.len : 0) - ((NI) 1));
			res_216956 = ((NI) 0);
			{
				while (1) {
					if (!(res_216956 <= HEX3Atmp_216953)) goto LA19;
					i_216940 = res_216956;
					{
						if (!!((x->data[i_216940] == y->data[i_216940]))) goto LA22;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA22: ;
					res_216956 += ((NI) 1);
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, safeadd_427495)(TY213925** x, Tinstantiation213812* y) {
	{
		NIM_BOOL LOC3;
		TY427516 LOC6;
		LOC3 = 0;
		LOC3 = HEX3DHEX3D_216864((*x), NIM_NIL);
		if (!LOC3) goto LA4;
		unsureAsgnRef((void**) (&(*x)), (TY213925*) newSeq((&NTI213925), 1));
		memset((void*)LOC6, 0, sizeof(LOC6));
		LOC6[0] = y;
		asgnRefNoCycle((void**) (&(*x)->data[0]), LOC6[0]);
	}
	goto LA1;
	LA4: ;
	{
		(*x) = (TY213925*) incrSeqV2(&((*x))->Sup, sizeof(Tinstantiation213812*));
		asgnRefNoCycle((void**) (&(*x)->data[(*x)->Sup.len]), y);
		++(*x)->Sup.len;
	}
	LA1: ;
}

static N_INLINE(void*, seqtoptr_281355)(Tnodeseq213784* x) {
	void* result;
	result = 0;
	result = ((void*) (x));
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_281344)(Tnodeseq213784* x, Tnodeseq213784* y) {
	NIM_BOOL result;
{	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_281355(x);
		LOC4 = 0;
		LOC4 = seqtoptr_281355(y);
		if (!(LOC3 == LOC4)) goto LA5;
		result = NIM_TRUE;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC8;
		void* LOC9;
		void* LOC11;
		LOC8 = 0;
		LOC9 = 0;
		LOC9 = seqtoptr_281355(x);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_281355(y);
		LOC8 = (LOC11 == NIM_NIL);
		LA10: ;
		if (!LOC8) goto LA12;
		result = NIM_FALSE;
	}
	goto LA1;
	LA12: ;
	{
		if (!((x ? x->Sup.len : 0) == (y ? y->Sup.len : 0))) goto LA15;
		{
			NI i_281420;
			NI HEX3Atmp_281433;
			NI res_281436;
			i_281420 = 0;
			HEX3Atmp_281433 = 0;
			HEX3Atmp_281433 = (NI)((x ? x->Sup.len : 0) - ((NI) 1));
			res_281436 = ((NI) 0);
			{
				while (1) {
					if (!(res_281436 <= HEX3Atmp_281433)) goto LA19;
					i_281420 = res_281436;
					{
						if (!!((x->data[i_281420] == y->data[i_281420]))) goto LA22;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA22: ;
					res_281436 += ((NI) 1);
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, safeadd_428175)(Tnodeseq213784** x, Tnode213790* y) {
	{
		NIM_BOOL LOC3;
		TY229280 LOC6;
		LOC3 = 0;
		LOC3 = HEX3DHEX3D_281344((*x), NIM_NIL);
		if (!LOC3) goto LA4;
		unsureAsgnRef((void**) (&(*x)), (Tnodeseq213784*) newSeq((&NTI213784), 1));
		memset((void*)LOC6, 0, sizeof(LOC6));
		LOC6[0] = y;
		asgnRefNoCycle((void**) (&(*x)->data[0]), LOC6[0]);
	}
	goto LA1;
	LA4: ;
	{
		(*x) = (Tnodeseq213784*) incrSeqV2(&((*x))->Sup, sizeof(Tnode213790*));
		asgnRefNoCycle((void**) (&(*x)->data[(*x)->Sup.len]), y);
		++(*x)->Sup.len;
	}
	LA1: ;
}

N_NIMCALL(void, insert_428284)(Tnodeseq213784** x, Tnode213790* item, NI i) {
	NI xl_428602;
	NI j_428604;
	xl_428602 = ((*x) ? (*x)->Sup.len : 0);
	(*x) = (Tnodeseq213784*) setLengthSeq(&((*x))->Sup, sizeof(Tnode213790*), ((NI) ((NI)(xl_428602 + ((NI) 1)))));
	j_428604 = (NI)(xl_428602 - ((NI) 1));
	{
		while (1) {
			if (!(((NI) (i)) <= j_428604)) goto LA2;
			asgnRefNoCycle((void**) (&(*x)->data[(NI)(j_428604 + ((NI) 1))]), (*x)->data[j_428604]);
			j_428604 -= ((NI) 1);
		} LA2: ;
	}
	asgnRefNoCycle((void**) (&(*x)->data[i]), item);
}

N_NIMCALL(Tnodeseq213784*, HEX5BHEX5D_386135)(Tnodeseq213784* s, Slice88282 x) {
	Tnodeseq213784* result;
	NI a;
	NI L;
	result = 0;
	a = x.a;
	L = (NI)((NI)(x.b - a) + ((NI) 1));
	result = (Tnodeseq213784*) newSeq((&NTI213784), ((NI) (L)));
	{
		NI i_386175;
		NI HEX3Atmp_386177;
		NI res_386180;
		i_386175 = 0;
		HEX3Atmp_386177 = 0;
		HEX3Atmp_386177 = (L - 1);
		res_386180 = ((NI) 0);
		{
			while (1) {
				if (!(res_386180 <= HEX3Atmp_386177)) goto LA3;
				i_386175 = res_386180;
				asgnRefNoCycle((void**) (&result->data[i_386175]), s->data[(NI)(i_386175 + a)]);
				res_386180 += ((NI) 1);
			} LA3: ;
		}
	}
	return result;
}

N_NIMCALL(void, HEX5BHEX5DHEX3D_386186)(Tnodeseq213784** s, Slice88282 x, Tnode213790** b, NI bLen0) {
	NI a;
	NI L;
	a = x.a;
	L = (NI)((NI)(x.b - a) + ((NI) 1));
	{
		if (!(L == bLen0)) goto LA3;
		{
			NI i_386237;
			NI HEX3Atmp_386334;
			NI res_386337;
			i_386237 = 0;
			HEX3Atmp_386334 = 0;
			HEX3Atmp_386334 = (L - 1);
			res_386337 = ((NI) 0);
			{
				while (1) {
					if (!(res_386337 <= HEX3Atmp_386334)) goto LA7;
					i_386237 = res_386337;
					asgnRefNoCycle((void**) (&(*s)->data[(NI)(i_386237 + a)]), b[i_386237]);
					res_386337 += ((NI) 1);
				} LA7: ;
			}
		}
	}
	goto LA1;
	LA3: ;
	{
		NI slen_386200;
		NI shift_386202;
		NI newlen_386204;
		slen_386200 = ((*s) ? (*s)->Sup.len : 0);
		shift_386202 = (NI)(bLen0 - L);
		newlen_386204 = (NI)(slen_386200 + shift_386202);
		{
			if (!(((NI) 0) < shift_386202)) goto LA11;
			(*s) = (Tnodeseq213784*) setLengthSeq(&((*s))->Sup, sizeof(Tnode213790*), ((NI) (newlen_386204)));
			{
				NI i_386206;
				NI HEX3Atmp_386342;
				NI HEX3Atmp_386343;
				NI res_386346;
				i_386206 = 0;
				HEX3Atmp_386342 = 0;
				HEX3Atmp_386343 = 0;
				HEX3Atmp_386342 = (NI)(newlen_386204 - ((NI) 1));
				HEX3Atmp_386343 = (NI)((NI)(a + shift_386202) + ((NI) 1));
				res_386346 = HEX3Atmp_386342;
				{
					while (1) {
						if (!(HEX3Atmp_386343 <= res_386346)) goto LA15;
						i_386206 = res_386346;
						asgnRefNoCycle((void**) (&(*s)->data[i_386206]), (*s)->data[(NI)(i_386206 - shift_386202)]);
						res_386346 -= ((NI) 1);
					} LA15: ;
				}
			}
		}
		goto LA9;
		LA11: ;
		{
			{
				NI i_386208;
				NI HEX3Atmp_386351;
				NI HEX3Atmp_386352;
				NI res_386355;
				i_386208 = 0;
				HEX3Atmp_386351 = 0;
				HEX3Atmp_386352 = 0;
				HEX3Atmp_386351 = (NI)(a + bLen0);
				HEX3Atmp_386352 = (NI)((NI)(((*s) ? (*s)->Sup.len : 0) - ((NI) 1)) + shift_386202);
				res_386355 = HEX3Atmp_386351;
				{
					while (1) {
						if (!(res_386355 <= HEX3Atmp_386352)) goto LA19;
						i_386208 = res_386355;
						asgnRefNoCycle((void**) (&(*s)->data[i_386208]), (*s)->data[(NI)(i_386208 - shift_386202)]);
						res_386355 += ((NI) 1);
					} LA19: ;
				}
			}
			(*s) = (Tnodeseq213784*) setLengthSeq(&((*s))->Sup, sizeof(Tnode213790*), ((NI) (newlen_386204)));
		}
		LA9: ;
		{
			NI i_386210;
			NI HEX3Atmp_386360;
			NI res_386363;
			i_386210 = 0;
			HEX3Atmp_386360 = 0;
			HEX3Atmp_386360 = (bLen0 - 1);
			res_386363 = ((NI) 0);
			{
				while (1) {
					if (!(res_386363 <= HEX3Atmp_386360)) goto LA22;
					i_386210 = res_386363;
					asgnRefNoCycle((void**) (&(*s)->data[(NI)(i_386210 + a)]), b[i_386210]);
					res_386363 += ((NI) 1);
				} LA22: ;
			}
		}
	}
	LA1: ;
}

static N_INLINE(void*, seqtoptr_427822)(Tsymseq213792* x) {
	void* result;
	result = 0;
	result = ((void*) (x));
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_427811)(Tsymseq213792* x, Tsymseq213792* y) {
	NIM_BOOL result;
{	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_427822(x);
		LOC4 = 0;
		LOC4 = seqtoptr_427822(y);
		if (!(LOC3 == LOC4)) goto LA5;
		result = NIM_TRUE;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC8;
		void* LOC9;
		void* LOC11;
		LOC8 = 0;
		LOC9 = 0;
		LOC9 = seqtoptr_427822(x);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_427822(y);
		LOC8 = (LOC11 == NIM_NIL);
		LA10: ;
		if (!LOC8) goto LA12;
		result = NIM_FALSE;
	}
	goto LA1;
	LA12: ;
	{
		if (!((x ? x->Sup.len : 0) == (y ? y->Sup.len : 0))) goto LA15;
		{
			NI i_427887;
			NI HEX3Atmp_427900;
			NI res_427903;
			i_427887 = 0;
			HEX3Atmp_427900 = 0;
			HEX3Atmp_427900 = (NI)((x ? x->Sup.len : 0) - ((NI) 1));
			res_427903 = ((NI) 0);
			{
				while (1) {
					if (!(res_427903 <= HEX3Atmp_427900)) goto LA19;
					i_427887 = res_427903;
					{
						if (!!((x->data[i_427887] == y->data[i_427887]))) goto LA22;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA22: ;
					res_427903 += ((NI) 1);
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, safeadd_427908)(Tsymseq213792** x, Tsym213822* y) {
	{
		NIM_BOOL LOC3;
		TY263331 LOC6;
		LOC3 = 0;
		LOC3 = HEX3DHEX3D_427811((*x), NIM_NIL);
		if (!LOC3) goto LA4;
		unsureAsgnRef((void**) (&(*x)), (Tsymseq213792*) newSeq((&NTI213792), 1));
		memset((void*)LOC6, 0, sizeof(LOC6));
		LOC6[0] = y;
		asgnRefNoCycle((void**) (&(*x)->data[0]), LOC6[0]);
	}
	goto LA1;
	LA4: ;
	{
		(*x) = (Tsymseq213792*) incrSeqV2(&((*x))->Sup, sizeof(Tsym213822*));
		asgnRefNoCycle((void**) (&(*x)->data[(*x)->Sup.len]), y);
		++(*x)->Sup.len;
	}
	LA1: ;
}

N_NIMCALL(void, delete_428831)(Tnodeseq213784** x, NI i) {
	NI xl_429202;
	xl_429202 = ((*x) ? (*x)->Sup.len : 0);
	{
		NI j_429204;
		NI HEX3Atmp_429410;
		NI res_429413;
		j_429204 = 0;
		HEX3Atmp_429410 = 0;
		HEX3Atmp_429410 = (NI)(xl_429202 - ((NI) 2));
		res_429413 = ((NI) (i));
		{
			while (1) {
				if (!(res_429413 <= HEX3Atmp_429410)) goto LA3;
				j_429204 = res_429413;
				asgnRefNoCycle((void**) (&(*x)->data[j_429204]), (*x)->data[(NI)(j_429204 + ((NI) 1))]);
				res_429413 += ((NI) 1);
			} LA3: ;
		}
	}
	(*x) = (Tnodeseq213784*) setLengthSeq(&((*x))->Sup, sizeof(Tnode213790*), ((NI) ((NI)(xl_429202 - ((NI) 1)))));
}

N_NIMCALL(Tnodeseq213784*, newseq_464233)(NI len) {
	Tnodeseq213784* result;
	result = 0;
	result = (Tnodeseq213784*) newSeq((&NTI213784), len);
	return result;
}

N_NIMCALL(void, Gcfullcollect_9805)(void) {
	NI oldthreshold;
	oldthreshold = gch_50059.cyclethreshold;
	gch_50059.cyclethreshold = ((NI) 0);
	collectct_52007((&gch_50059));
	gch_50059.cyclethreshold = oldthreshold;
}

static N_INLINE(void*, seqtoptr_306494)(TY305653* x) {
	void* result;
	result = 0;
	result = ((void*) (x));
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_306483)(TY305653* x, TY305653* y) {
	NIM_BOOL result;
{	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_306494(x);
		LOC4 = 0;
		LOC4 = seqtoptr_306494(y);
		if (!(LOC3 == LOC4)) goto LA5;
		result = NIM_TRUE;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC8;
		void* LOC9;
		void* LOC11;
		LOC8 = 0;
		LOC9 = 0;
		LOC9 = seqtoptr_306494(x);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_306494(y);
		LOC8 = (LOC11 == NIM_NIL);
		LA10: ;
		if (!LOC8) goto LA12;
		result = NIM_FALSE;
	}
	goto LA1;
	LA12: ;
	{
		if (!((x ? x->Sup.len : 0) == (y ? y->Sup.len : 0))) goto LA15;
		{
			NI i_306559;
			NI HEX3Atmp_306561;
			NI res_306564;
			i_306559 = 0;
			HEX3Atmp_306561 = 0;
			HEX3Atmp_306561 = (NI)((x ? x->Sup.len : 0) - ((NI) 1));
			res_306564 = ((NI) 0);
			{
				while (1) {
					if (!(res_306564 <= HEX3Atmp_306561)) goto LA19;
					i_306559 = res_306564;
					{
						NIM_BOOL LOC22;
						LOC22 = 0;
						LOC22 = HEX3DHEX3D_306431(x->data[i_306559], y->data[i_306559]);
						if (!!(LOC22)) goto LA23;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA23: ;
					res_306564 += ((NI) 1);
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	}BeforeRet: ;
	return result;
}

static N_INLINE(void*, seqtoptr_306582)(TY305648* x) {
	void* result;
	result = 0;
	result = ((void*) (x));
	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)), (*a).Sup.len);
	LOC11 = (LOC13 == ((NI32) 0));
	LA12: ;
	result = LOC11;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_306649)(TY306043 x, TY306043 y) {
	NIM_BOOL result;
{	result = 0;
	{
		if (!!(eqStrings(x.Field0, y.Field0))) goto LA3;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA3: ;
	{
		NIM_BOOL LOC7;
		LOC7 = 0;
		LOC7 = HEX3DHEX3D_306431(x.Field1, y.Field1);
		if (!!(LOC7)) goto LA8;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA8: ;
	result = NIM_TRUE;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_306571)(TY305648* x, TY305648* y) {
	NIM_BOOL result;
{	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_306582(x);
		LOC4 = 0;
		LOC4 = seqtoptr_306582(y);
		if (!(LOC3 == LOC4)) goto LA5;
		result = NIM_TRUE;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC8;
		void* LOC9;
		void* LOC11;
		LOC8 = 0;
		LOC9 = 0;
		LOC9 = seqtoptr_306582(x);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_306582(y);
		LOC8 = (LOC11 == NIM_NIL);
		LA10: ;
		if (!LOC8) goto LA12;
		result = NIM_FALSE;
	}
	goto LA1;
	LA12: ;
	{
		if (!((x ? x->Sup.len : 0) == (y ? y->Sup.len : 0))) goto LA15;
		{
			NI i_306647;
			NI HEX3Atmp_306667;
			NI res_306670;
			i_306647 = 0;
			HEX3Atmp_306667 = 0;
			HEX3Atmp_306667 = (NI)((x ? x->Sup.len : 0) - ((NI) 1));
			res_306670 = ((NI) 0);
			{
				while (1) {
					if (!(res_306670 <= HEX3Atmp_306667)) goto LA19;
					i_306647 = res_306670;
					{
						NIM_BOOL LOC22;
						LOC22 = 0;
						LOC22 = HEX3DHEX3D_306649(x->data[i_306647], y->data[i_306647]);
						if (!!(LOC22)) goto LA23;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA23: ;
					res_306670 += ((NI) 1);
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_328275)(Indexentry326126* x, Indexentry326126* y) {
	NIM_BOOL result;
{	result = 0;
	{
		if (!!(eqStrings((*x).keyword, (*y).keyword))) goto LA3;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA3: ;
	{
		if (!!(eqStrings((*x).link, (*y).link))) goto LA7;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA7: ;
	{
		if (!!(eqStrings((*x).linktitle, (*y).linktitle))) goto LA11;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA11: ;
	{
		if (!!(eqStrings((*x).linkdesc, (*y).linkdesc))) goto LA15;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA15: ;
	result = NIM_TRUE;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}
N_NIMCALL(void, TMP5283)(void* p, NI op) {
	TY524219* a;
	NI LOC1;
	a = (TY524219*)p;
	LOC1 = 0;
	for (LOC1 = 0; LOC1 < a->Sup.len; LOC1++) {
	}
}

static N_INLINE(void, Gcdisable_9801)(void) {
	gch_50059.recgclock += ((NI) 1);
}

static N_INLINE(void, Gcenable_9803)(void) {
	{
		if (!(((NI) 0) < gch_50059.recgclock)) goto LA3;
		gch_50059.recgclock -= ((NI) 1);
	}
	LA3: ;
}

N_NIMCALL(NimStringDesc*, Gcgetstatistics_9821)(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;
	NimStringDesc* LOC14;
	result = 0;
	Gcdisable_9801();
	LOC1 = 0;
	LOC2 = 0;
	LOC2 = gettotalmem_8059();
	LOC3 = 0;
	LOC3 = nimIntToStr(LOC2);
	LOC4 = 0;
	LOC4 = getoccupiedmem_8055();
	LOC5 = 0;
	LOC5 = nimIntToStr(LOC4);
	LOC6 = 0;
	LOC6 = nimIntToStr(gch_50059.stat.stackscans);
	LOC7 = 0;
	LOC7 = nimIntToStr(gch_50059.stat.maxstackcells);
	LOC8 = 0;
	LOC8 = nimIntToStr(gch_50059.stat.cyclecollections);
	LOC9 = 0;
	LOC9 = nimIntToStr(gch_50059.stat.maxthreshold);
	LOC10 = 0;
	LOC10 = nimIntToStr(gch_50059.zct.cap);
	LOC11 = 0;
	LOC11 = nimIntToStr(gch_50059.stat.cycletablesize);
	LOC12 = 0;
	LOC12 = nimInt64ToStr((NI64)(gch_50059.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 + 201);
appendString(LOC1, ((NimStringDesc*) &TMP5295));
appendString(LOC1, LOC3);
appendString(LOC1, ((NimStringDesc*) &TMP5296));
appendString(LOC1, LOC5);
appendString(LOC1, ((NimStringDesc*) &TMP5297));
appendString(LOC1, LOC6);
appendString(LOC1, ((NimStringDesc*) &TMP5298));
appendString(LOC1, LOC7);
appendString(LOC1, ((NimStringDesc*) &TMP5299));
appendString(LOC1, LOC8);
appendString(LOC1, ((NimStringDesc*) &TMP5300));
appendString(LOC1, LOC9);
appendString(LOC1, ((NimStringDesc*) &TMP5301));
appendString(LOC1, LOC10);
appendString(LOC1, ((NimStringDesc*) &TMP5302));
appendString(LOC1, LOC11);
appendString(LOC1, ((NimStringDesc*) &TMP5303));
appendString(LOC1, LOC12);
	result = LOC1;
	LOC13 = 0;
	LOC14 = 0;
	LOC14 = nimIntToStr(gch_50059.stat.maxstacksize);
	LOC13 = rawNewString(result->Sup.len + LOC14->Sup.len + 22);
appendString(LOC13, result);
appendString(LOC13, ((NimStringDesc*) &TMP5304));
appendString(LOC13, LOC14);
appendString(LOC13, ((NimStringDesc*) &TMP5305));
	result = LOC13;
	Gcenable_9803();
	return result;
}
NIM_EXTERNC N_NOINLINE(void, systemInit000)(void) {
	TNimType LOC1;
	nimvm_5751 = NIM_FALSE;
	memset((void*)(&LOC1), 0, sizeof(LOC1));
	LOC1.size = ((NI) 8);
	LOC1.kind = ((NU8) 28);
	LOC1.flags = 2;
	strdesc_12203 = LOC1;
	initallocator_11601();
	initStackBottom();
	initgc_11401();
	registersignalhandler_23202();
}

NIM_EXTERNC N_NOINLINE(void, systemDatInit000)(void) {
static TNimNode* TMP49[4];
static TNimNode TMP0[20];
NTI3608.size = sizeof(TNimObject);
NTI3608.kind = 17;
NTI3608.base = 0;
NTI3608.flags = 1;
TMP0[0].len = 0; TMP0[0].kind = 2;
NTI3608.node = &TMP0[0];
NTI104.size = sizeof(NI);
NTI104.kind = 31;
NTI104.base = 0;
NTI104.flags = 3;
NTI138.size = sizeof(NimStringDesc*);
NTI138.kind = 28;
NTI138.base = 0;
NTI138.flags = 2;
NTI3624.size = sizeof(Exception);
NTI3624.kind = 17;
NTI3624.base = (&NTI3608);
TMP49[0] = &TMP0[2];
NTI10010.size = sizeof(Exception*);
NTI10010.kind = 22;
NTI10010.base = (&NTI3624);
NTI10010.marker = TMP50;
TMP0[2].kind = 1;
TMP0[2].offset = offsetof(Exception, parent);
TMP0[2].typ = (&NTI10010);
TMP0[2].name = "parent";
TMP49[1] = &TMP0[3];
NTI140.size = sizeof(NCSTRING);
NTI140.kind = 29;
NTI140.base = 0;
NTI140.flags = 3;
TMP0[3].kind = 1;
TMP0[3].offset = offsetof(Exception, name);
TMP0[3].typ = (&NTI140);
TMP0[3].name = "name";
TMP49[2] = &TMP0[4];
TMP0[4].kind = 1;
TMP0[4].offset = offsetof(Exception, message);
TMP0[4].typ = (&NTI138);
TMP0[4].name = "msg";
TMP49[3] = &TMP0[5];
TMP0[5].kind = 1;
TMP0[5].offset = offsetof(Exception, trace);
TMP0[5].typ = (&NTI138);
TMP0[5].name = "trace";
TMP0[1].len = 4; TMP0[1].kind = 2; TMP0[1].sons = &TMP49[0];
NTI3624.node = &TMP0[1];
NTI3636.size = sizeof(Arithmeticerror3636);
NTI3636.kind = 17;
NTI3636.base = (&NTI3624);
TMP0[6].len = 0; TMP0[6].kind = 2;
NTI3636.node = &TMP0[6];
NTI3640.size = sizeof(Overflowerror3640);
NTI3640.kind = 17;
NTI3640.base = (&NTI3636);
TMP0[7].len = 0; TMP0[7].kind = 2;
NTI3640.node = &TMP0[7];
NTI24069.size = sizeof(Overflowerror3640*);
NTI24069.kind = 22;
NTI24069.base = (&NTI3640);
NTI24069.marker = TMP51;
NTI3626.size = sizeof(Systemerror3626);
NTI3626.kind = 17;
NTI3626.base = (&NTI3624);
TMP0[8].len = 0; TMP0[8].kind = 2;
NTI3626.node = &TMP0[8];
NTI3650.size = sizeof(Outofmemerror3650);
NTI3650.kind = 17;
NTI3650.base = (&NTI3626);
TMP0[9].len = 0; TMP0[9].kind = 2;
NTI3650.node = &TMP0[9];
NTI110.size = sizeof(NI32);
NTI110.kind = 34;
NTI110.base = 0;
NTI110.flags = 3;
NTI3646.size = sizeof(Valueerror3646);
NTI3646.kind = 17;
NTI3646.base = (&NTI3624);
TMP0[10].len = 0; TMP0[10].kind = 2;
NTI3646.node = &TMP0[10];
NTI23825.size = sizeof(Valueerror3646*);
NTI23825.kind = 22;
NTI23825.base = (&NTI3646);
NTI23825.marker = TMP140;
NTI108.size = sizeof(NI16);
NTI108.kind = 33;
NTI108.base = 0;
NTI108.flags = 3;
NTI3628.size = sizeof(Ioerror3628);
NTI3628.kind = 17;
NTI3628.base = (&NTI3626);
TMP0[11].len = 0; TMP0[11].kind = 2;
NTI3628.node = &TMP0[11];
NTI81417.size = sizeof(Ioerror3628*);
NTI81417.kind = 22;
NTI81417.base = (&NTI3628);
NTI81417.marker = TMP430;
NTI130.size = sizeof(NIM_BOOL);
NTI130.kind = 1;
NTI130.base = 0;
NTI130.flags = 3;
NTI7088.size = sizeof(NI64);
NTI7088.kind = 35;
NTI7088.base = 0;
NTI7088.flags = 3;
NTI7090.size = sizeof(NF);
NTI7090.kind = 36;
NTI7090.base = 0;
NTI7090.flags = 3;
NTI142.size = sizeof(void*);
NTI142.kind = 26;
NTI142.base = 0;
NTI142.flags = 3;
NTI7208.size = sizeof(int);
NTI7208.kind = 34;
NTI7208.base = 0;
NTI7208.flags = 3;
NTI116.size = sizeof(NU8);
NTI116.kind = 41;
NTI116.base = 0;
NTI116.flags = 3;
NTI3610.size = sizeof(TNimObject*);
NTI3610.kind = 22;
NTI3610.base = (&NTI3608);
NTI3610.marker = TMP917;
NTI3660.size = sizeof(Reraiseerror3660);
NTI3660.kind = 17;
NTI3660.base = (&NTI3624);
TMP0[12].len = 0; TMP0[12].kind = 2;
NTI3660.node = &TMP0[12];
NTI21424.size = sizeof(Reraiseerror3660*);
NTI21424.kind = 22;
NTI21424.base = (&NTI3660);
NTI21424.marker = TMP1055;
NTI29819.size = sizeof(TY29819);
NTI29819.kind = 16;
NTI29819.base = (&NTI104);
NTI29819.flags = 3;
NTI3604.size = sizeof(NI);
NTI3604.kind = 20;
NTI3604.base = (&NTI104);
NTI3604.flags = 3;
NTI124.size = sizeof(NF);
NTI124.kind = 36;
NTI124.base = 0;
NTI124.flags = 3;
NTI15202.size = sizeof(void*);
NTI15202.kind = 18;
NTI15202.base = 0;
NTI15202.flags = 3;
TMP0[13].len = 0; TMP0[13].kind = 2;
NTI15202.node = &TMP0[13];
NTI15204.size = sizeof(FILE*);
NTI15204.kind = 21;
NTI15204.base = (&NTI15202);
NTI15204.flags = 3;
NTI106.size = sizeof(NI8);
NTI106.kind = 32;
NTI106.base = 0;
NTI106.flags = 3;
NTI3630.size = sizeof(Oserror3630);
NTI3630.kind = 17;
NTI3630.base = (&NTI3626);
TMP0[14].kind = 1;
TMP0[14].offset = offsetof(Oserror3630, errorcode);
TMP0[14].typ = (&NTI110);
TMP0[14].name = "errorCode";
NTI3630.node = &TMP0[14];
NTI121007.size = sizeof(Oserror3630*);
NTI121007.kind = 22;
NTI121007.base = (&NTI3630);
NTI121007.marker = TMP1226;
NTI3648.size = sizeof(Keyerror3648);
NTI3648.kind = 17;
NTI3648.base = (&NTI3646);
TMP0[15].len = 0; TMP0[15].kind = 2;
NTI3648.node = &TMP0[15];
NTI181804.size = sizeof(Keyerror3648*);
NTI181804.kind = 22;
NTI181804.base = (&NTI3648);
NTI181804.marker = TMP1229;
NTI3656.size = sizeof(Rangeerror3656);
NTI3656.kind = 17;
NTI3656.base = (&NTI3624);
TMP0[16].len = 0; TMP0[16].kind = 2;
NTI3656.node = &TMP0[16];
NTI3652.size = sizeof(Indexerror3652);
NTI3652.kind = 17;
NTI3652.base = (&NTI3624);
TMP0[17].len = 0; TMP0[17].kind = 2;
NTI3652.node = &TMP0[17];
NTI131615.size = sizeof(Indexerror3652*);
NTI131615.kind = 22;
NTI131615.base = (&NTI3652);
NTI131615.marker = TMP1663;
NTI120.size = sizeof(NU32);
NTI120.kind = 43;
NTI120.base = 0;
NTI120.flags = 3;
NTI3644.size = sizeof(Assertionerror3644);
NTI3644.kind = 17;
NTI3644.base = (&NTI3624);
TMP0[18].len = 0; TMP0[18].kind = 2;
NTI3644.node = &TMP0[18];
NTI88905.size = sizeof(Assertionerror3644*);
NTI88905.kind = 22;
NTI88905.base = (&NTI3644);
NTI88905.marker = TMP2308;
NTI136.size = sizeof(NIM_CHAR);
NTI136.kind = 2;
NTI136.base = 0;
NTI136.flags = 3;
NTI15208.size = sizeof(int);
NTI15208.kind = 34;
NTI15208.base = 0;
NTI15208.flags = 3;
NTI3638.size = sizeof(Divbyzeroerror3638);
NTI3638.kind = 17;
NTI3638.base = (&NTI3636);
TMP0[19].len = 0; TMP0[19].kind = 2;
NTI3638.node = &TMP0[19];
NTI524219.size = sizeof(TY524219*);
NTI524219.kind = 24;
NTI524219.base = (&NTI7208);
NTI524219.flags = 2;
NTI524219.marker = TMP5283;
}

