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

#include "nimbase.h"
#include <sys/mman.h>
#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>
#include <string.h>
#include <signal.h>
typedef struct Exception Exception;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Avlnode30888 Avlnode30888;
typedef struct Gcheap51018 Gcheap51018;
typedef struct Gcstack51016 Gcstack51016;
typedef struct Cellseq48963 Cellseq48963;
typedef struct Cell48947 Cell48947;
typedef struct Cellset48959 Cellset48959;
typedef struct Pagedesc48955 Pagedesc48955;
typedef struct Memregion30890 Memregion30890;
typedef struct Smallchunk30842 Smallchunk30842;
typedef struct Llchunk30884 Llchunk30884;
typedef struct Bigchunk30844 Bigchunk30844;
typedef struct Intset30817 Intset30817;
typedef struct Trunk30813 Trunk30813;
typedef struct Gcstat51014 Gcstat51014;
typedef struct Basechunk30840 Basechunk30840;
typedef struct Freecell30832 Freecell30832;
typedef struct TGenericSeq TGenericSeq;
typedef struct NimStringDesc NimStringDesc;
typedef struct TSafePoint TSafePoint;
typedef struct TNimObject TNimObject;
typedef struct Overflowerror4043 Overflowerror4043;
typedef struct Arithmeticerror4039 Arithmeticerror4039;
typedef struct Systemerror4029 Systemerror4029;
typedef struct Outofmemerror4053 Outofmemerror4053;
typedef struct Valueerror4049 Valueerror4049;
typedef struct Ioerror4031 Ioerror4031;
typedef struct Reraiseerror4063 Reraiseerror4063;
typedef struct TY90959 TY90959;
typedef struct Oserror4033 Oserror4033;
typedef struct Keyerror4051 Keyerror4051;
typedef struct Indexerror4055 Indexerror4055;
typedef struct Rangeerror4059 Rangeerror4059;
typedef struct TY224932 TY224932;
typedef struct Assertionerror4047 Assertionerror4047;
typedef struct Ttypeseq224843 Ttypeseq224843;
typedef struct Ttype224847 Ttype224847;
typedef struct TY258855 TY258855;
typedef struct Tinstantiation224831 Tinstantiation224831;
typedef struct Tsym224841 Tsym224841;
typedef struct TY224944 TY224944;
typedef struct Tnodeseq224803 Tnodeseq224803;
typedef struct Tnode224809 Tnode224809;
typedef struct Slice90365 Slice90365;
typedef struct Divbyzeroerror4041 Divbyzeroerror4041;
typedef struct Tsymseq224811 Tsymseq224811;
typedef struct TY324774 TY324774;
typedef struct Jsonnodeobj324754 Jsonnodeobj324754;
typedef struct TY324769 TY324769;
typedef struct TY325284 TY325284;
typedef struct Indexentry347397 Indexentry347397;
typedef struct TY569225 TY569225;
typedef struct Tidobj197015 Tidobj197015;
typedef struct Tloc224823 Tloc224823;
typedef struct Ropeobj175009 Ropeobj175009;
typedef struct Tscope224835 Tscope224835;
typedef struct Tstrtable224813 Tstrtable224813;
typedef struct Tident197021 Tident197021;
typedef struct Tlineinfo189352 Tlineinfo189352;
typedef struct Tlib224827 Tlib224827;
typedef struct Tlistentry140022 Tlistentry140022;
typedef N_NIMCALL_PTR(NIM_BOOL, TY11421) (Exception* e);
typedef N_NIMCALL_PTR(NIM_BOOL, TY11426) (Exception* e);
typedef N_NIMCALL_PTR(void, TY11431) (void);
typedef N_NIMCALL_PTR(void, TY3889) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3894) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3889 marker;
TY3894 deepcopy;
};
typedef Avlnode30888* TY30895[2];
struct  Avlnode30888  {
TY30895 link;
NI key;
NI upperbound;
NI level;
};
struct  Cellseq48963  {
NI len;
NI cap;
Cell48947** d;
};
struct  Cellset48959  {
NI counter;
NI max;
Pagedesc48955* head;
Pagedesc48955** data;
};
typedef Smallchunk30842* TY30905[512];
typedef Trunk30813* Trunkbuckets30815[256];
struct  Intset30817  {
Trunkbuckets30815 data;
};
struct  Memregion30890  {
NI minlargeobj;
NI maxlargeobj;
TY30905 freesmallchunks;
Llchunk30884* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk30844* freechunkslist;
Intset30817 chunkstarts;
Avlnode30888* root;
Avlnode30888* deleted;
Avlnode30888* last;
Avlnode30888* freeavlnodes;
};
struct  Gcstat51014  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap51018  {
Gcstack51016* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq48963 zct;
Cellseq48963 decstack;
Cellset48959 cycleroots;
Cellseq48963 tempstack;
NI recgclock;
Memregion30890 region;
Gcstat51014 stat;
};
struct  Basechunk30840  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk30842  {
  Basechunk30840 Sup;
Smallchunk30842* next;
Smallchunk30842* prev;
Freecell30832* freelist;
NI free;
NI acc;
NF data;
};
struct  Bigchunk30844  {
  Basechunk30840 Sup;
Bigchunk30844* next;
Bigchunk30844* prev;
NI align;
NF data;
};
typedef NI TY30821[16];
struct  Trunk30813  {
Trunk30813* next;
NI key;
TY30821 bits;
};
struct  Llchunk30884  {
NI size;
NI acc;
Llchunk30884* next;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Freecell30832  {
Freecell30832* next;
NI zerofield;
};
typedef N_NIMCALL_PTR(void, TY20601) (NimStringDesc* msg);
typedef TFrame* TY21203[128];
struct  Cell48947  {
NI refcount;
TNimType* typ;
};
struct  Pagedesc48955  {
Pagedesc48955* next;
NI key;
TY30821 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  Arithmeticerror4039  {
  Exception Sup;
};
struct  Overflowerror4043  {
  Arithmeticerror4039 Sup;
};
typedef struct {
N_NIMCALL_PTR(NIM_BOOL, ClPrc) (Exception* e, void* ClEnv);
void* ClEnv;
} TY19211;
struct  TSafePoint  {
TSafePoint* prev;
NI status;
jmp_buf context;
NIM_BOOL hasRaiseAction;
TY19211 raiseAction;
};
typedef N_CLOSURE_PTR(NIM_BOOL, TMP52) (Exception* e);
struct  Systemerror4029  {
  Exception Sup;
};
struct  Outofmemerror4053  {
  Systemerror4029 Sup;
};
typedef NIM_CHAR TY22418[2001];
struct  Valueerror4049  {
  Exception Sup;
};
struct  Ioerror4031  {
  Systemerror4029 Sup;
};
typedef NimStringDesc* TY84213[5];
struct  Reraiseerror4063  {
  Exception Sup;
};
struct TY90959 {
NimStringDesc* Field0;
NI Field1;
};
typedef NIM_CHAR TY82070[500];
struct  Oserror4033  {
  Systemerror4029 Sup;
NI32 errorcode;
};
struct  Keyerror4051  {
  Valueerror4049 Sup;
};
struct  Indexerror4055  {
  Exception Sup;
};
struct  Rangeerror4059  {
  Exception Sup;
};
typedef NIM_CHAR TY81997[65];
typedef NI32 TY575286[1];
typedef NU8 Sha1digest200009[20];
struct  Assertionerror4047  {
  Exception Sup;
};
struct TY258855 {
NI Field0;
NI Field1;
};
typedef Ttype224847* TY392275[1];
typedef NIM_CHAR TY86646[60];
struct  Tinstantiation224831  {
Tsym224841* sym;
Ttypeseq224843* concretetypes;
TY224932* usedby;
NI compilesid;
};
typedef Tinstantiation224831* TY459720[1];
typedef Tnode224809* TY242880[1];
struct  Slice90365  {
NI a;
NI b;
};
struct  Divbyzeroerror4041  {
  Arithmeticerror4039 Sup;
};
typedef Tsym224841* TY279434[1];
struct TY325284 {
NimStringDesc* Field0;
Jsonnodeobj324754* Field1;
};
struct  Indexentry347397  {
NimStringDesc* keyword;
NimStringDesc* link;
NimStringDesc* linktitle;
NimStringDesc* linkdesc;
};
struct  Gcstack51016  {
Gcstack51016* prev;
Gcstack51016* next;
void* starts;
void* pos;
NI maxstacksize;
};
struct  Tidobj197015  {
  TNimObject Sup;
NI id;
};
struct  Tloc224823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype224847* t;
Ropeobj175009* r;
Ropeobj175009* heaproot;
};
struct  Ttype224847  {
  Tidobj197015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq224843* sons;
Tnode224809* n;
Tsym224841* owner;
Tsym224841* sym;
Tsym224841* destructor;
Tsym224841* deepcopy;
Tsym224841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc224823 loc;
};
struct  Tstrtable224813  {
NI counter;
Tsymseq224811* data;
};
struct  Tlineinfo189352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tsym224841  {
  Tidobj197015 Sup;
NU8 kind;
union{
struct {Ttypeseq224843* typeinstcache;
Tscope224835* typscope;
} S1;
struct {TY224944* procinstcache;
Tsym224841* gcunsafetyreason;
} S2;
struct {TY224944* usedgenerics;
Tstrtable224813 tab;
} S3;
struct {Tsym224841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype224847* typ;
Tident197021* name;
Tlineinfo189352 info;
Tsym224841* owner;
NU32 flags;
Tnode224809* ast;
NU32 options;
NI position;
NI offset;
Tloc224823 loc;
Tlib224827* annex;
Tnode224809* constraint;
};
struct  Tnode224809  {
Ttype224847* typ;
Tlineinfo189352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym224841* sym;
} S4;
struct {Tident197021* ident;
} S5;
struct {Tnodeseq224803* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Jsonnodeobj324754  {
NU8 kind;
union{
struct {NimStringDesc* str;
} S1;
struct {NI64 num;
} S2;
struct {NF fnum;
} S3;
struct {NIM_BOOL bval;
} S4;
struct {TY324769* fields;
} S6;
struct {TY324774* elems;
} S7;
} kindU;
};
struct  Ropeobj175009  {
  TNimObject Sup;
Ropeobj175009* left;
Ropeobj175009* right;
NI length;
NimStringDesc* data;
};
struct  Tscope224835  {
NI depthlevel;
Tstrtable224813 symbols;
Tnodeseq224803* usingsyms;
Tscope224835* parent;
};
struct  Tident197021  {
  Tidobj197015 Sup;
NimStringDesc* s;
Tident197021* next;
NI h;
};
struct  Tlistentry140022  {
  TNimObject Sup;
Tlistentry140022* prev;
Tlistentry140022* next;
};
struct  Tlib224827  {
  Tlistentry140022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj175009* name;
Tnode224809* path;
};
struct TY224932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct Ttypeseq224843 {
  TGenericSeq Sup;
  Ttype224847* data[SEQ_DECL_SIZE];
};
struct TY224944 {
  TGenericSeq Sup;
  Tinstantiation224831* data[SEQ_DECL_SIZE];
};
struct Tnodeseq224803 {
  TGenericSeq Sup;
  Tnode224809* data[SEQ_DECL_SIZE];
};
struct Tsymseq224811 {
  TGenericSeq Sup;
  Tsym224841* data[SEQ_DECL_SIZE];
};
struct TY324774 {
  TGenericSeq Sup;
  Jsonnodeobj324754* data[SEQ_DECL_SIZE];
};
struct TY324769 {
  TGenericSeq Sup;
  TY325284 data[SEQ_DECL_SIZE];
};
struct TY569225 {
  TGenericSeq Sup;
  int data[SEQ_DECL_SIZE];
};
static N_INLINE(void, initallocator_13001)(void);
static N_INLINE(void, initStackBottom)(void);
N_NOINLINE(void, setStackBottom)(void* thestackbottom);
N_NIMCALL(void, initgc_12801)(void);
N_NIMCALL(void, init_49061)(Cellseq48963* s, NI cap);
N_NOCONV(void*, alloc0_8417)(NI size);
N_NIMCALL(void*, alloc0_47619)(Memregion30890* allocator, NI size);
N_NIMCALL(void*, alloc_47443)(Memregion30890* allocator, NI size);
N_NIMCALL(void*, rawalloc_38301)(Memregion30890* a, NI requestedsize);
static N_INLINE(NI, roundup_29401)(NI x, NI v);
N_NIMCALL(Smallchunk30842*, getsmallchunk_37624)(Memregion30890* a);
N_NIMCALL(Bigchunk30844*, getbigchunk_36817)(Memregion30890* a, NI size);
static N_INLINE(void, listremove_34602)(Bigchunk30844** head, Bigchunk30844* c);
N_NIMCALL(void, splitchunk_36615)(Memregion30890* a, Bigchunk30844* c, NI size);
static N_INLINE(void, updateprevsize_33683)(Memregion30890* a, Bigchunk30844* c, NI prevsize);
static N_INLINE(NIM_BOOL, isaccessible_33618)(Memregion30890* a, void* p);
N_NIMCALL(NIM_BOOL, contains_32359)(Intset30817* s, NI key);
N_NIMCALL(Trunk30813*, intsetget_32298)(Intset30817* t, NI key);
static N_INLINE(NI, pageindex_32859)(void* p);
N_NIMCALL(void, incl_32383)(Memregion30890* a, Intset30817* s, NI key);
N_NIMCALL(Trunk30813*, intsetput_32329)(Memregion30890* a, Intset30817* t, NI key);
N_NIMCALL(void*, llalloc_31055)(Memregion30890* a, NI size);
static N_INLINE(void*, osallocpages_30615)(NI size);
N_NOINLINE(void, raiseoutofmem_29232)(void);
static N_INLINE(void, inccurrmem_31005)(Memregion30890* a, NI bytes);
static N_INLINE(NI, pageindex_32851)(Basechunk30840* c);
static N_INLINE(void, listadd_35823)(Bigchunk30844** head, Bigchunk30844* c);
N_NIMCALL(Bigchunk30844*, requestoschunks_32877)(Memregion30890* a, NI size);
static N_INLINE(void, listadd_39216)(Smallchunk30842** head, Smallchunk30842* c);
static N_INLINE(void, listremove_42002)(Smallchunk30842** head, Smallchunk30842* c);
N_NIMCALL(void, add_32001)(Memregion30890* a, Avlnode30888** t, NI key, NI upperbound);
N_NIMCALL(Avlnode30888*, allocavlnode_31230)(Memregion30890* a, NI key, NI upperbound);
N_NIMCALL(void, skew_31976)(Avlnode30888** t);
N_NIMCALL(void, split_31984)(Avlnode30888** t);
N_NIMCALL(void, init_49082)(Cellset48959* s);
N_NOCONV(void, signalHandler)(int sig);
N_NIMCALL(void, showerrormessage_20809)(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_58804)(TNimType* typ, NI size, Gcheap51018* gch);
N_NIMCALL(void, collectct_53010)(Gcheap51018* gch);
N_NOINLINE(NI, stacksize_72801)(void);
static N_INLINE(NI, getoccupiedmem_48869)(Memregion30890* a);
N_NIMCALL(void, collectctbody_76621)(Gcheap51018* gch);
static N_INLINE(void, prepareforinteriorpointerchecking_46294)(Memregion30890* a);
N_NIMCALL(NI, lowgauge_31818)(Avlnode30888* n);
N_NIMCALL(NI, highgauge_31844)(Avlnode30888* n);
N_CDECL(void, markstackandregisters_74040)(Gcheap51018* gch);
static N_INLINE(void, gcmark_71846)(Gcheap51018* gch, void* p);
static N_INLINE(Cell48947*, usrtocell_52646)(void* usr);
N_NIMCALL(void*, interiorallocatedptr_46301)(Memregion30890* a, void* p);
static N_INLINE(Basechunk30840*, pageaddr_32867)(void* p);
static N_INLINE(NIM_BOOL, chunkunused_32731)(Basechunk30840* c);
static N_INLINE(NIM_BOOL, issmallchunk_32708)(Basechunk30840* c);
N_NIMCALL(Avlnode30888*, inrange_31914)(Avlnode30888* root, NI key);
static N_INLINE(void, add_49038)(Cellseq48963* s, Cell48947* c);
N_NOCONV(void*, alloc_8401)(NI size);
N_NOCONV(void, dealloc_8448)(void* p);
N_NIMCALL(void, dealloc_47628)(Memregion30890* allocator, void* p);
N_NIMCALL(void, rawdealloc_44623)(Memregion30890* a, void* p);
N_NIMCALL(void, freebigchunk_33806)(Memregion30890* a, Bigchunk30844* c_33810);
N_NIMCALL(void, excl_32397)(Intset30817* s, NI key);
N_NIMCALL(void, freeoschunks_33410)(Memregion30890* a, void* p, NI size);
static N_INLINE(void, osdeallocpages_30624)(void* p, NI size);
static N_INLINE(void, deccurrmem_31022)(Memregion30890* a, NI bytes);
N_NIMCALL(void, del_32204)(Memregion30890* a, Avlnode30888** t, NI x);
static N_INLINE(void, deallocavlnode_31806)(Memregion30890* a, Avlnode30888* n);
N_NIMCALL(void, markthreadstacks_72406)(Gcheap51018* gch);
N_NIMCALL(NIM_BOOL, collectzct_71212)(Gcheap51018* gch);
static N_INLINE(NIM_BOOL, canbecycleroot_52667)(Cell48947* c);
N_NIMCALL(void, excl_49695)(Cellset48959* s, Cell48947* cell);
N_NIMCALL(Pagedesc48955*, cellsetget_49129)(Cellset48959 t, NI key);
static N_INLINE(NI, nexttry_49121)(NI h, NI maxhash);
N_NIMCALL(void, preparedealloc_53208)(Cell48947* cell);
static N_INLINE(void*, celltousr_52625)(Cell48947* cell);
N_NIMCALL(void, forallchildren_53017)(Cell48947* cell, NU8 op);
N_NIMCALL(void, forallchildrenaux_53025)(void* dest, TNimType* mt, NU8 op);
N_NIMCALL(void, dooperation_53021)(void* p, NU8 op);
static N_INLINE(void, decref_54604)(Cell48947* c);
static N_INLINE(void, rtladdzct_54204)(Cell48947* c);
N_NOINLINE(void, addzct_52617)(Cellseq48963* s, Cell48947* c);
static N_INLINE(void, rtladdcycleroot_53423)(Cell48947* c);
N_NOINLINE(void, incl_49665)(Cellset48959* s, Cell48947* cell);
N_NIMCALL(Pagedesc48955*, cellsetput_49463)(Cellset48959* t, NI key);
N_NIMCALL(void, cellsetenlarge_49412)(Cellset48959* t);
N_NIMCALL(void, cellsetrawinsert_49158)(Cellset48959 t, Pagedesc48955** data, Pagedesc48955* desc);
N_NIMCALL(void, markgray_68205)(Cell48947* s);
N_NIMCALL(void, scan_68604)(Cell48947* s);
N_NIMCALL(void, scanblack_68404)(Cell48947* s);
N_NIMCALL(void, collectwhite_68804)(Cell48947* s);
N_NIMCALL(NIM_BOOL, isallocatedptr_38005)(Memregion30890* a, void* p);
N_NIMCALL(void, freecycliccell_67427)(Gcheap51018* gch, Cell48947* c);
N_NIMCALL(void, forallslotsaux_57208)(void* dest, TNimNode* n, NU8 op);
N_NIMCALL(TNimNode*, selectbranch_28810)(void* aa, TNimNode* n);
N_NIMCALL(NI, getdiscriminant_28404)(void* aa, TNimNode* n);
N_NIMCALL(void, collectcycles_71444)(Gcheap51018* gch);
N_NIMCALL(void, markroots_69005)(Gcheap51018* gch);
N_NIMCALL(void, collectroots_71401)(Gcheap51018* gch);
N_NIMCALL(void, cellsetreset_57201)(Cellset48959* s);
N_NIMCALL(void, deinit_49093)(Cellset48959* s);
N_NIMCALL(NI, getoccupiedmem_9091)(void);
N_NIMCALL(NI, gettotalmem_9095)(void);
N_NIMCALL(NI, getfreemem_9093)(void);
N_NIMCALL(void, unmarkstackandregisters_76411)(Gcheap51018* gch);
static N_INLINE(void, addnewobjtozct_58287)(Cell48947* res, Gcheap51018* gch);
N_NIMCALL(void, writetostderr_20801)(NCSTRING msg);
N_NIMCALL(void, write_16907)(FILE* f, NCSTRING c);
N_NIMCALL(void, registersignalhandler_24408)(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_25310)(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_22004)(Exception* e);
static N_INLINE(void, pushCurrentException)(Exception* e);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incref_55022)(Cell48947* c);
static N_INLINE(NIM_BOOL, isObjWithCache)(TNimType* obj, TNimType* subclass, TNimType** cache);
N_NOINLINE(NIM_BOOL, isobjslowpath_25161)(TNimType* obj, TNimType* subclass, TNimType** cache);
static N_INLINE(void, quitordebug_21807)(void);
N_NIMCALL(NI, mulInt)(NI a, NI b);
N_NOINLINE(NIM_BOOL, isonstack_53014)(void* p);
static N_INLINE(void, sysfatal_25021)(NimStringDesc* message) __attribute__((noreturn));
N_NIMCALL(void, TMP140)(void* p, NI op);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(void, genericresetaux_84801)(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_81016, NI last);
static N_INLINE(NI, resize_80401)(NI old);
N_NIMCALL(void*, growobj_67418)(void* old, NI newsize);
N_NIMCALL(void*, growobj_64606)(void* old, NI newsize, Gcheap51018* gch);
N_NIMCALL(NimStringDesc*, mnewString)(NI len);
N_NIMCALL(NimStringDesc*, mnewString)(NI len);
N_NIMCALL(void, genericassignaux_84806)(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_84812)(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_16982)(FILE* f, void* buffer, NI len);
N_NOINLINE(void, raiseeio_82805)(NimStringDesc* msg) __attribute__((noreturn));
static N_INLINE(void, sysfatal_82810)(NimStringDesc* message) __attribute__((noreturn));
N_NIMCALL(void, TMP430)(void* p, NI op);
N_NIMCALL(void, TMP913)(void* p, NI op);
N_NIMCALL(TNimType*, extGetCellType)(void* c);
N_NIMCALL(NIM_BOOL, open_16803)(FILE** f, NimStringDesc* filename, NU8 mode, NI bufsize);
static N_INLINE(void, sysfatal_16826)(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_22620)(NimStringDesc* message) __attribute__((noreturn));
N_NIMCALL(void, TMP1056)(void* p, NI op);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
N_NIMCALL(NIM_CHAR, getdecimalpoint_82051)(void);
N_NIMCALL(void, objectinitaux_85894)(void* dest, TNimNode* n);
N_NIMCALL(void, objectInit)(void* dest, TNimType* typ);
N_NIMCALL(void, TMP1189)(void* p, NI op);
N_NIMCALL(void, TMP1192)(void* p, NI op);
N_NIMCALL(void, TMP1195)(void* p, NI op);
N_NIMCALL(void*, realloc_48607)(Memregion30890* allocator, void* p, NI newsize);
N_NIMCALL(NI, ptrsize_47216)(void* p);
N_NIMCALL(void, genericAssign)(void* dest, void* src, TNimType* mt);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_575185)(TY224932* x, TY224932* y);
static N_INLINE(void*, seqtoptr_575196)(TY224932* x);
N_NIMCALL(TGenericSeq*, incrSeqV2)(TGenericSeq* seq, NI elemsize);
N_NIMCALL(FILE*, open_16817)(NimStringDesc* filename, NU8 mode, NI bufsize);
static N_INLINE(void, pushSafePoint)(TSafePoint* s);
N_NIMCALL(NimStringDesc*, readall_16869)(FILE* file);
N_NIMCALL(NI, rawfilesize_83512)(FILE* file);
N_NIMCALL(NimStringDesc*, readallfile_83521)(FILE* file, NI len);
N_NIMCALL(NI, readbuffer_16960)(FILE* f, void* buffer, NI len);
N_NIMCALL(NIM_BOOL, endoffile_16860)(FILE* f);
N_NIMCALL(NimStringDesc*, readallbuffer_83495)(FILE* file);
static N_INLINE(void, popSafePoint)(void);
N_NIMCALL(void, reraiseException)(void);
N_NIMCALL(void, write_16895)(FILE* f, NimStringDesc* s);
N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
N_NIMCALL(NIM_BOOL, readline_16919)(FILE* f, NimStringDesc** line);
static N_INLINE(void, sysfatal_90976)(NimStringDesc* message) __attribute__((noreturn));
N_NIMCALL(void, TMP2268)(void* p, NI op);
static N_INLINE(void*, seqtoptr_263750)(Ttypeseq224843* x);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_263739)(Ttypeseq224843* x, Ttypeseq224843* y);
static N_INLINE(void*, seqtoptr_227881)(TY224944* x);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_227870)(TY224944* x, TY224944* y);
static N_INLINE(void*, seqtoptr_299983)(Tnodeseq224803* x);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_299972)(Tnodeseq224803* x, Tnodeseq224803* y);
N_NIMCALL(TGenericSeq*, setLengthSeq)(TGenericSeq* seq, NI elemsize, NI newlen);
static N_INLINE(void*, seqtoptr_460069)(Tsymseq224811* x);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_460058)(Tsymseq224811* x, Tsymseq224811* y);
static N_INLINE(void*, seqtoptr_325724)(TY324774* x);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_325661)(Jsonnodeobj324754* a, Jsonnodeobj324754* b);
static N_INLINE(void*, seqtoptr_325828)(TY324769* x);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_325899)(TY325284 x, TY325284 y);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(void, TMP5268)(void* p, NI op);
static N_INLINE(void, Gcdisable_11201)(void);
N_NIMCALL(NimStringDesc*, nimInt64ToStr)(NI64 x);
static N_INLINE(void, Gcenable_11203)(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(TMP1050, "rb", 2);
STRING_LITERAL(TMP1051, "wb", 2);
STRING_LITERAL(TMP1052, "w+b", 3);
STRING_LITERAL(TMP1053, "r+b", 3);
STRING_LITERAL(TMP1054, "ab", 2);
NIM_CONST TY84213 Formatopen_84210 = {((NimStringDesc*) &TMP1050),
((NimStringDesc*) &TMP1051),
((NimStringDesc*) &TMP1052),
((NimStringDesc*) &TMP1053),
((NimStringDesc*) &TMP1054)}
;
STRING_LITERAL(TMP1055, "cannot open: ", 13);
STRING_LITERAL(TMP1057, "no exception to reraise", 23);
STRING_LITERAL(TMP1058, "(", 1);
STRING_LITERAL(TMP1059, ", ", 2);
STRING_LITERAL(TMP1060, "filename", 8);
STRING_LITERAL(TMP1061, ": ", 2);
STRING_LITERAL(TMP1062, "nil", 3);
STRING_LITERAL(TMP1063, "line", 4);
STRING_LITERAL(TMP1064, ")", 1);
STRING_LITERAL(TMP1109, " (invalid data!)", 16);
STRING_LITERAL(TMP1355, "nan", 3);
STRING_LITERAL(TMP1356, "-inf", 4);
STRING_LITERAL(TMP1357, "inf", 3);
STRING_LITERAL(TMP1519, "error while reading from file", 29);
STRING_LITERAL(TMP1520, "", 0);
STRING_LITERAL(TMP1884, "EOF reached", 11);
STRING_LITERAL(TMP2793, "cannot set file position", 24);
STRING_LITERAL(TMP2794, "cannot retrieve file position", 29);
STRING_LITERAL(TMP3029, "0", 1);
STRING_LITERAL(TMP3097, "true", 4);
STRING_LITERAL(TMP3098, "false", 5);
STRING_LITERAL(TMP5280, "[GC] total memory: ", 19);
STRING_LITERAL(TMP5281, "\012[GC] occupied memory: ", 23);
STRING_LITERAL(TMP5282, "\012[GC] stack scans: ", 19);
STRING_LITERAL(TMP5283, "\012[GC] stack cells: ", 19);
STRING_LITERAL(TMP5284, "\012[GC] cycle collections: ", 25);
STRING_LITERAL(TMP5285, "\012[GC] max threshold: ", 21);
STRING_LITERAL(TMP5286, "\012[GC] zct capacity: ", 20);
STRING_LITERAL(TMP5287, "\012[GC] max cycle table size: ", 28);
STRING_LITERAL(TMP5288, "\012[GC] max pause time [ms]: ", 27);
STRING_LITERAL(TMP5289, "[GC] max stack size: ", 21);
STRING_LITERAL(TMP5290, "\012", 1);
NIM_BOOL nimvm_6690;
NI nim_program_result;
TY11421 globalraisehook_11425;
TY11426 localraisehook_11430;
TY11431 outofmemhook_11433;
TNimType strdesc_13601;
TY20601 errormessagewriter_20604;
TFrame* frameptr_20842;
TSafePoint* exchandler_20843;
Exception* currexception_20845;
TY21203 tempframes_21204;
Avlnode30888 bottomdata_30921;
Avlnode30888* bottom_30922;
Gcheap51018 gch_51059;
NIM_BOOL localgcinitialized_72837;
NIM_CHAR decimalpoint_82050;
TNimType NTI4011; /* RootObj */
TNimType NTI108; /* int */
TNimType NTI149; /* string */
TNimType NTI4027; /* Exception */
TNimType NTI11422; /* ref Exception */
TNimType NTI151; /* cstring */
TNimType NTI4039; /* ArithmeticError */
TNimType NTI4043; /* OverflowError */
TNimType NTI25317; /* ref OverflowError */
TNimType NTI4029; /* SystemError */
TNimType NTI4053; /* OutOfMemError */
static TNimType* Nim_OfCheck_CACHE1[2];
TNimType NTI114; /* int32 */
TNimType NTI4049; /* ValueError */
TNimType NTI25028; /* ref ValueError */
TNimType NTI112; /* int16 */
TNimType NTI4031; /* IOError */
TNimType NTI82817; /* ref IOError */
TNimType NTI138; /* bool */
TNimType NTI8112; /* BiggestInt */
TNimType NTI8114; /* BiggestFloat */
TNimType NTI153; /* pointer */
TNimType NTI8211; /* cint */
TNimType NTI120; /* uint8 */
TNimType NTI4013; /* RootRef */
TNimType NTI4063; /* ReraiseError */
TNimType NTI22627; /* ref ReraiseError */
TNimType NTI30821; /* array[0..15, int] */
TNimType NTI4007; /* Natural */
TNimType NTI128; /* float */
TNimType NTI16402; /* CFile */
TNimType NTI16404; /* File */
TNimType NTI110; /* int8 */
TNimType NTI4033; /* OSError */
TNimType NTI126013; /* ref OSError */
TNimType NTI4051; /* KeyError */
TNimType NTI190004; /* ref KeyError */
TNimType NTI4055; /* IndexError */
TNimType NTI136021; /* ref IndexError */
TNimType NTI4059; /* RangeError */
extern TNimType NTI224932; /* seq[int32] */
TNimType NTI124; /* uint32 */
TNimType NTI4047; /* AssertionError */
TNimType NTI90983; /* ref AssertionError */
extern TNimType NTI224843; /* TTypeSeq */
TNimType NTI147; /* char */
TNimType NTI16408; /* FileHandle */
extern TNimType NTI224833; /* PInstantiation */
extern TNimType NTI224944; /* seq[PInstantiation] */
extern TNimType NTI224803; /* TNodeSeq */
TNimType NTI4041; /* DivByZeroError */
extern TNimType NTI224811; /* TSymSeq */
TNimType NTI569225; /* seq[SocketHandle] */

static N_INLINE(void, initallocator_13001)(void) {
	bottom_30922 = (&bottomdata_30921);
	(*bottom_30922).link[(((NI) 0))- 0] = bottom_30922;
	(*bottom_30922).link[(((NI) 1))- 0] = bottom_30922;
}

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

static N_INLINE(void, listremove_34602)(Bigchunk30844** head, Bigchunk30844* 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(Trunk30813*, intsetget_32298)(Intset30817* t, NI key) {
	Trunk30813* result;
	Trunk30813* 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_32359)(Intset30817* s, NI key) {
	NIM_BOOL result;
	Trunk30813* t;
	result = 0;
	t = intsetget_32298(s, (NI)((NU32)(key) >> (NU32)(((NI) 9))));
	{
		NI u;
		if (!!((t == NIM_NIL))) goto LA3;
		u = (NI)(key & ((NI) 511));
		result = !(((NI)((*t).bits[((NI)((NU32)(((NI) (u))) >> (NU32)(((NI) 5))))- 0] & (NI)((NU32)(((NI) 1)) << (NU32)(((NI) ((NI)(((NI) (u)) & ((NI) 31))))))) == ((NI) 0)));
	}
	goto LA1;
	LA3: ;
	{
		result = NIM_FALSE;
	}
	LA1: ;
	return result;
}

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

static N_INLINE(NIM_BOOL, isaccessible_33618)(Memregion30890* a, void* p) {
	NIM_BOOL result;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = pageindex_32859(p);
	result = contains_32359((&(*a).chunkstarts), LOC1);
	return result;
}

static N_INLINE(void, updateprevsize_33683)(Memregion30890* a, Bigchunk30844* c, NI prevsize) {
	Basechunk30840* ri;
	ri = ((Basechunk30840*) ((NI)((NU32)(((NI) (c))) + (NU32)((*c).Sup.size))));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = isaccessible_33618((&(*a)), ((void*) (ri)));
		if (!LOC3) goto LA4;
		(*ri).prevsize = prevsize;
	}
	LA4: ;
}

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

static N_INLINE(void*, osallocpages_30615)(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_29232();
	}
	LA5: ;
	return result;
}

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

N_NIMCALL(void*, llalloc_31055)(Memregion30890* a, NI size) {
	void* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		Llchunk30884* 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_30615(((NI) 4096));
		(*a).llmem = ((Llchunk30884*) (LOC7));
		inccurrmem_31005(a, ((NI) 4096));
		(*(*a).llmem).size = (NI)(((NI) 4096) - ((NI)sizeof(Llchunk30884)));
		(*(*a).llmem).acc = ((NI)sizeof(Llchunk30884));
		(*(*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(Trunk30813*, intsetput_32329)(Memregion30890* a, Intset30817* t, NI key) {
	Trunk30813* result;
	result = 0;
	result = intsetget_32298((&(*t)), key);
	{
		void* LOC5;
		if (!(result == NIM_NIL)) goto LA3;
		LOC5 = 0;
		LOC5 = llalloc_31055(a, ((NI)sizeof(Trunk30813)));
		result = ((Trunk30813*) (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_32383)(Memregion30890* a, Intset30817* s, NI key) {
	Trunk30813* t;
	NI u;
	t = intsetput_32329(a, s, (NI)((NU32)(key) >> (NU32)(((NI) 9))));
	u = (NI)(key & ((NI) 511));
	(*t).bits[((NI)((NU32)(((NI) (u))) >> (NU32)(((NI) 5))))- 0] = (NI)((*t).bits[((NI)((NU32)(((NI) (u))) >> (NU32)(((NI) 5))))- 0] | (NI)((NU32)(((NI) 1)) << (NU32)(((NI) ((NI)(((NI) (u)) & ((NI) 31)))))));
}

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

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

N_NIMCALL(void, splitchunk_36615)(Memregion30890* a, Bigchunk30844* c, NI size) {
	Bigchunk30844* rest;
	Basechunk30840* LOC1;
	NI LOC2;
	rest = ((Bigchunk30844*) ((NI)((NU32)(((NI) (c))) + (NU32)(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_33683(a, c, (*rest).Sup.size);
	(*c).Sup.size = size;
	LOC1 = 0;
	LOC1 = &rest->Sup;
	LOC2 = 0;
	LOC2 = pageindex_32851(LOC1);
	incl_32383(a, (&(*a).chunkstarts), LOC2);
	listadd_35823(&(*a).freechunkslist, rest);
}

N_NIMCALL(Bigchunk30844*, requestoschunks_32877)(Memregion30890* a, NI size) {
	Bigchunk30844* result;
	void* LOC1;
	NI nxt;
	Basechunk30840* next;
	NI lastsize;
	NI prv;
	Basechunk30840* prev;
	result = 0;
	inccurrmem_31005(a, size);
	(*a).freemem += size;
	LOC1 = 0;
	LOC1 = osallocpages_30615(size);
	result = ((Bigchunk30844*) (LOC1));
	(*result).next = NIM_NIL;
	(*result).prev = NIM_NIL;
	(*result).Sup.used = NIM_FALSE;
	(*result).Sup.size = size;
	nxt = (NI)((NU32)(((NI) (result))) + (NU32)(size));
	next = ((Basechunk30840*) (nxt));
	{
		NI LOC4;
		NIM_BOOL LOC5;
		LOC4 = 0;
		LOC4 = pageindex_32851(next);
		LOC5 = 0;
		LOC5 = contains_32359((&(*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)((NU32)(((NI) (result))) - (NU32)(lastsize));
	prev = ((Basechunk30840*) (prv));
	{
		NIM_BOOL LOC15;
		NI LOC16;
		LOC15 = 0;
		LOC16 = 0;
		LOC16 = pageindex_32851(prev);
		LOC15 = contains_32359((&(*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(Bigchunk30844*, getbigchunk_36817)(Memregion30890* a, NI size) {
	Bigchunk30844* result;
	Basechunk30840* LOC16;
	NI LOC17;
	result = 0;
	result = (*a).freechunkslist;
	{
		{
			while (1) {
				if (!!((result == NIM_NIL))) goto LA3;
				{
					if (!((*result).Sup.size == size)) goto LA6;
					listremove_34602(&(*a).freechunkslist, result);
					goto LA1;
				}
				goto LA4;
				LA6: ;
				{
					if (!(size < (*result).Sup.size)) goto LA9;
					listremove_34602(&(*a).freechunkslist, result);
					splitchunk_36615(a, result, size);
					goto LA1;
				}
				goto LA4;
				LA9: ;
				LA4: ;
				result = (*result).next;
			} LA3: ;
		}
		{
			if (!(size < ((NI) 524288))) goto LA13;
			result = requestoschunks_32877(a, ((NI) 524288));
			splitchunk_36615(a, result, size);
		}
		goto LA11;
		LA13: ;
		{
			result = requestoschunks_32877(a, size);
		}
		LA11: ;
	} LA1: ;
	(*result).Sup.prevsize = ((NI) 0);
	(*result).Sup.used = NIM_TRUE;
	LOC16 = 0;
	LOC16 = &result->Sup;
	LOC17 = 0;
	LOC17 = pageindex_32851(LOC16);
	incl_32383(a, (&(*a).chunkstarts), LOC17);
	(*a).freemem -= size;
	return result;
}

N_NIMCALL(Smallchunk30842*, getsmallchunk_37624)(Memregion30890* a) {
	Smallchunk30842* result;
	Bigchunk30844* res;
	result = 0;
	res = getbigchunk_36817(a, ((NI) 4096));
	result = ((Smallchunk30842*) (res));
	return result;
}

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

static N_INLINE(void, listremove_42002)(Smallchunk30842** head, Smallchunk30842* 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(Avlnode30888*, allocavlnode_31230)(Memregion30890* a, NI key, NI upperbound) {
	Avlnode30888* 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_31055(a, ((NI)sizeof(Avlnode30888)));
		result = ((Avlnode30888*) (LOC6));
	}
	LA1: ;
	(*result).key = key;
	(*result).upperbound = upperbound;
	(*result).link[(((NI) 0))- 0] = bottom_30922;
	(*result).link[(((NI) 1))- 0] = bottom_30922;
	(*result).level = ((NI) 1);
	return result;
}

N_NIMCALL(void, skew_31976)(Avlnode30888** t) {
	{
		Avlnode30888* 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_31984)(Avlnode30888** t) {
	{
		Avlnode30888* 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_32001)(Memregion30890* a, Avlnode30888** t, NI key, NI upperbound) {
	{
		if (!((*t) == bottom_30922)) goto LA3;
		(*t) = allocavlnode_31230(a, key, upperbound);
	}
	goto LA1;
	LA3: ;
	{
		{
			if (!((NU32)(key) < (NU32)((*(*t)).key))) goto LA8;
			add_32001(a, &(*(*t)).link[(((NI) 0))- 0], key, upperbound);
		}
		goto LA6;
		LA8: ;
		{
			if (!((NU32)((*(*t)).key) < (NU32)(key))) goto LA11;
			add_32001(a, &(*(*t)).link[(((NI) 1))- 0], key, upperbound);
		}
		goto LA6;
		LA11: ;
		{
		}
		LA6: ;
		skew_31976(t);
		split_31984(t);
	}
	LA1: ;
}

N_NIMCALL(void*, rawalloc_38301)(Memregion30890* a, NI requestedsize) {
	void* result;
	NI size;
	result = 0;
	size = roundup_29401(requestedsize, ((NI) 8));
	{
		NI s;
		Smallchunk30842* c;
		if (!(size <= (NI)(((NI) 4096) - (NI)(((NI)sizeof(Smallchunk30842)) - ((NI) 8))))) goto LA3;
		s = (NI)(size / ((NI) 8));
		c = (*a).freesmallchunks[(s)- 0];
		{
			if (!(c == NIM_NIL)) goto LA7;
			c = getsmallchunk_37624(a);
			(*c).freelist = NIM_NIL;
			(*c).Sup.size = size;
			(*c).acc = size;
			(*c).free = (NI)((NI)(((NI) 4096) - (NI)(((NI)sizeof(Smallchunk30842)) - ((NI) 8))) - size);
			(*c).next = NIM_NIL;
			(*c).prev = NIM_NIL;
			listadd_39216(&(*a).freesmallchunks[(s)- 0], c);
			result = ((void*) ((&(*c).data)));
		}
		goto LA5;
		LA7: ;
		{
			{
				if (!((*c).freelist == NIM_NIL)) goto LA12;
				result = ((void*) ((NI)((NU32)(((NI) ((&(*c).data)))) + (NU32)((*c).acc))));
				(*c).acc += size;
			}
			goto LA10;
			LA12: ;
			{
				result = ((void*) ((*c).freelist));
				(*c).freelist = (*(*c).freelist).next;
			}
			LA10: ;
			(*c).free -= size;
		}
		LA5: ;
		{
			if (!((*c).free < size)) goto LA17;
			listremove_42002(&(*a).freesmallchunks[(s)- 0], c);
		}
		LA17: ;
	}
	goto LA1;
	LA3: ;
	{
		Bigchunk30844* c;
		size = roundup_29401((NI)(requestedsize + (NI)(((NI)sizeof(Bigchunk30844)) - ((NI) 8))), ((NI) 4096));
		c = getbigchunk_36817(a, size);
		result = ((void*) ((&(*c).data)));
		{
			if (!((*a).root == NIM_NIL)) goto LA22;
			(*a).root = bottom_30922;
		}
		LA22: ;
		add_32001(a, &(*a).root, ((NI) (result)), (NI)((NU32)(((NI) (result))) + (NU32)(size)));
	}
	LA1: ;
	return result;
}

N_NIMCALL(void*, alloc_47443)(Memregion30890* allocator, NI size) {
	void* result;
	result = 0;
	result = rawalloc_38301(allocator, (NI)(((NI) (size)) + ((NI)sizeof(Freecell30832))));
	(*((Freecell30832*) (result))).zerofield = ((NI) 1);
	result = ((void*) ((NI)((NU32)(((NI) (result))) + (NU32)(((NI)sizeof(Freecell30832))))));
	return result;
}

N_NIMCALL(void*, alloc0_47619)(Memregion30890* allocator, NI size) {
	void* result;
	result = 0;
	result = alloc_47443(allocator, size);
	zeroMem(result, size);
	return result;
}

N_NOCONV(void*, alloc0_8417)(NI size) {
	void* result;
	result = 0;
	result = alloc0_47619((&gch_51059.region), size);
	return result;
}

N_NIMCALL(void, init_49061)(Cellseq48963* s, NI cap) {
	void* LOC1;
	(*s).len = ((NI) 0);
	(*s).cap = cap;
	LOC1 = 0;
	LOC1 = alloc0_8417(((NI) ((NI)(cap * ((NI) 4)))));
	(*s).d = ((Cell48947**) (LOC1));
}

N_NIMCALL(void, init_49082)(Cellset48959* s) {
	void* LOC1;
	LOC1 = 0;
	LOC1 = alloc0_8417(((NI) 4096));
	(*s).data = ((Pagedesc48955**) (LOC1));
	(*s).max = ((NI) 1023);
	(*s).counter = ((NI) 0);
	(*s).head = NIM_NIL;
}

N_NIMCALL(void, initgc_12801)(void) {
	gch_51059.cyclethreshold = ((NI) 4194304);
	gch_51059.stat.stackscans = ((NI) 0);
	gch_51059.stat.cyclecollections = ((NI) 0);
	gch_51059.stat.maxthreshold = ((NI) 0);
	gch_51059.stat.maxstacksize = ((NI) 0);
	gch_51059.stat.maxstackcells = ((NI) 0);
	gch_51059.stat.cycletablesize = ((NI) 0);
	init_49061((&gch_51059.zct), ((NI) 1024));
	init_49061((&gch_51059.tempstack), ((NI) 1024));
	init_49082((&gch_51059.cycleroots));
	init_49061((&gch_51059.decstack), ((NI) 1024));
}

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

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

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

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

static N_INLINE(void, prepareforinteriorpointerchecking_46294)(Memregion30890* a) {
	(*a).minlargeobj = lowgauge_31818((*a).root);
	(*a).maxlargeobj = highgauge_31844((*a).root);
}

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

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

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

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

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

N_NIMCALL(void*, interiorallocatedptr_46301)(Memregion30890* a, void* p) {
	void* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		Basechunk30840* c_46306;
		LOC3 = 0;
		LOC3 = isaccessible_33618(a, p);
		if (!LOC3) goto LA4;
		c_46306 = pageaddr_32867(p);
		{
			NIM_BOOL LOC8;
			LOC8 = 0;
			LOC8 = chunkunused_32731(c_46306);
			if (!!(LOC8)) goto LA9;
			{
				NIM_BOOL LOC13;
				Smallchunk30842* c;
				NI offset;
				LOC13 = 0;
				LOC13 = issmallchunk_32708(c_46306);
				if (!LOC13) goto LA14;
				c = ((Smallchunk30842*) (c_46306));
				offset = (NI)((NU32)(((NI) ((NI)(((NI) (p)) & ((NI) 4095))))) - (NU32)((NI)(((NI)sizeof(Smallchunk30842)) - ((NI) 8))));
				{
					Freecell30832* d;
					if (!((NU32)(offset) < (NU32)((*c).acc))) goto LA18;
					d = ((Freecell30832*) ((NI)((NU32)((NI)((NU32)(((NI) ((&(*c).data)))) + (NU32)(offset))) - (NU32)((NI)((NU32)(offset) % (NU32)((*c).Sup.size))))));
					{
						if (!((NU32)(((NI) 1)) < (NU32)((*d).zerofield))) goto LA22;
						result = ((void*) (d));
					}
					LA22: ;
				}
				LA18: ;
			}
			goto LA11;
			LA14: ;
			{
				Bigchunk30844* c;
				NF* d;
				c = ((Bigchunk30844*) (c_46306));
				d = (&(*c).data);
				{
					NIM_BOOL LOC27;
					LOC27 = 0;
					LOC27 = (((void*) (d)) <= p);
					if (!(LOC27)) goto LA28;
					LOC27 = ((NU32)(((NI) 1)) < (NU32)((*((Freecell30832*) (d))).zerofield));
					LA28: ;
					if (!LOC27) goto LA29;
					result = ((void*) (d));
				}
				LA29: ;
			}
			LA11: ;
		}
		LA9: ;
	}
	goto LA1;
	LA4: ;
	{
		NI q;
		q = ((NI) (p));
		{
			NIM_BOOL LOC34;
			Avlnode30888* avlnode;
			LOC34 = 0;
			LOC34 = ((NU32)((*a).minlargeobj) <= (NU32)(q));
			if (!(LOC34)) goto LA35;
			LOC34 = ((NU32)(q) <= (NU32)((*a).maxlargeobj));
			LA35: ;
			if (!LOC34) goto LA36;
			avlnode = inrange_31914((*a).root, q);
			{
				void* k;
				Bigchunk30844* c;
				Basechunk30840* LOC42;
				if (!!((avlnode == NIM_NIL))) goto LA40;
				k = ((void*) ((*avlnode).key));
				LOC42 = 0;
				LOC42 = pageaddr_32867(k);
				c = ((Bigchunk30844*) (LOC42));
				{
					if (!((NU32)(((NI) 1)) < (NU32)((*((Freecell30832*) (k))).zerofield))) goto LA45;
					result = k;
				}
				LA45: ;
			}
			LA40: ;
		}
		LA36: ;
	}
	LA1: ;
	return result;
}

N_NOCONV(void*, alloc_8401)(NI size) {
	void* result;
	result = 0;
	result = alloc_47443((&gch_51059.region), size);
	return result;
}

N_NIMCALL(void, excl_32397)(Intset30817* s, NI key) {
	Trunk30813* t;
	t = intsetget_32298((&(*s)), (NI)((NU32)(key) >> (NU32)(((NI) 9))));
	{
		NI u;
		if (!!((t == NIM_NIL))) goto LA3;
		u = (NI)(key & ((NI) 511));
		(*t).bits[((NI)((NU32)(((NI) (u))) >> (NU32)(((NI) 5))))- 0] = (NI)((*t).bits[((NI)((NU32)(((NI) (u))) >> (NU32)(((NI) 5))))- 0] & (NI)((NU32) ~((NI)((NU32)(((NI) 1)) << (NU32)(((NI) ((NI)(((NI) (u)) & ((NI) 31)))))))));
	}
	LA3: ;
}

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

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

N_NIMCALL(void, freeoschunks_33410)(Memregion30890* a, void* p, NI size) {
	Basechunk30840* c;
	NI nxt;
	Basechunk30840* next;
	NI LOC7;
	c = ((Basechunk30840*) (p));
	nxt = (NI)((NU32)(((NI) (p))) + (NU32)((*c).size));
	next = ((Basechunk30840*) (nxt));
	{
		NI LOC3;
		NIM_BOOL LOC4;
		LOC3 = 0;
		LOC3 = pageindex_32851(next);
		LOC4 = 0;
		LOC4 = contains_32359((&(*a).chunkstarts), LOC3);
		if (!LOC4) goto LA5;
		(*next).prevsize = ((NI) 0);
	}
	LA5: ;
	LOC7 = 0;
	LOC7 = pageindex_32859(p);
	excl_32397((&(*a).chunkstarts), LOC7);
	osdeallocpages_30624(p, size);
	deccurrmem_31022(a, size);
	(*a).freemem -= size;
}

N_NIMCALL(void, freebigchunk_33806)(Memregion30890* a, Bigchunk30844* c_33810) {
	Bigchunk30844* c;
	Basechunk30840* ri;
	c = c_33810;
	(*a).freemem += (*c).Sup.size;
	ri = ((Basechunk30840*) ((NI)((NU32)(((NI) (c))) + (NU32)((*c).Sup.size))));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = isaccessible_33618((&(*a)), ((void*) (ri)));
		if (!(LOC3)) goto LA4;
		LOC3 = chunkunused_32731(ri);
		LA4: ;
		if (!LOC3) goto LA5;
		{
			NIM_BOOL LOC9;
			NI LOC12;
			LOC9 = 0;
			LOC9 = issmallchunk_32708(ri);
			if (!!(LOC9)) goto LA10;
			listremove_34602(&(*a).freechunkslist, ((Bigchunk30844*) (ri)));
			(*c).Sup.size += (*ri).size;
			LOC12 = 0;
			LOC12 = pageindex_32851(ri);
			excl_32397((&(*a).chunkstarts), LOC12);
		}
		LA10: ;
	}
	LA5: ;
	{
		Basechunk30840* le;
		if (!!(((*c).Sup.prevsize == ((NI) 0)))) goto LA15;
		le = ((Basechunk30840*) ((NI)((NU32)(((NI) (c))) - (NU32)((*c).Sup.prevsize))));
		{
			NIM_BOOL LOC19;
			LOC19 = 0;
			LOC19 = isaccessible_33618((&(*a)), ((void*) (le)));
			if (!(LOC19)) goto LA20;
			LOC19 = chunkunused_32731(le);
			LA20: ;
			if (!LOC19) goto LA21;
			{
				NIM_BOOL LOC25;
				Basechunk30840* LOC28;
				NI LOC29;
				LOC25 = 0;
				LOC25 = issmallchunk_32708(le);
				if (!!(LOC25)) goto LA26;
				listremove_34602(&(*a).freechunkslist, ((Bigchunk30844*) (le)));
				(*le).size += (*c).Sup.size;
				LOC28 = 0;
				LOC28 = &c->Sup;
				LOC29 = 0;
				LOC29 = pageindex_32851(LOC28);
				excl_32397((&(*a).chunkstarts), LOC29);
				c = ((Bigchunk30844*) (le));
			}
			LA26: ;
		}
		LA21: ;
	}
	LA15: ;
	{
		NIM_BOOL LOC32;
		Basechunk30840* 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_32851(LOC36);
		incl_32383(a, (&(*a).chunkstarts), LOC37);
		updateprevsize_33683(a, c, (*c).Sup.size);
		listadd_35823(&(*a).freechunkslist, c);
		(*c).Sup.used = NIM_FALSE;
	}
	goto LA30;
	LA34: ;
	{
		freeoschunks_33410(a, ((void*) (c)), (*c).Sup.size);
	}
	LA30: ;
}

static N_INLINE(void, deallocavlnode_31806)(Memregion30890* a, Avlnode30888* n) {
	(*n).link[(((NI) 0))- 0] = (*a).freeavlnodes;
	(*a).freeavlnodes = n;
}

N_NIMCALL(void, del_32204)(Memregion30890* a, Avlnode30888** t, NI x) {
{	{
		if (!((*t) == bottom_30922)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	(*a).last = (*t);
	{
		if (!((NU32)(x) < (NU32)((*(*t)).key))) goto LA7;
		del_32204(a, &(*(*t)).link[(((NI) 0))- 0], x);
	}
	goto LA5;
	LA7: ;
	{
		(*a).deleted = (*t);
		del_32204(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_30922));
		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_30922;
		(*t) = (*(*t)).link[(((NI) 1))- 0];
		deallocavlnode_31806(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_31976(t);
		skew_31976(&(*(*t)).link[(((NI) 1))- 0]);
		skew_31976(&(*(*(*t)).link[(((NI) 1))- 0]).link[(((NI) 1))- 0]);
		split_31984(t);
		split_31984(&(*(*t)).link[(((NI) 1))- 0]);
	}
	goto LA10;
	LA21: ;
	LA10: ;
	}BeforeRet: ;
}

N_NIMCALL(void, rawdealloc_44623)(Memregion30890* a, void* p) {
	Basechunk30840* c_44801;
	c_44801 = pageaddr_32867(p);
	{
		NIM_BOOL LOC3;
		Smallchunk30842* c;
		NI s;
		Freecell30832* f;
		LOC3 = 0;
		LOC3 = issmallchunk_32708(c_44801);
		if (!LOC3) goto LA4;
		c = ((Smallchunk30842*) (c_44801));
		s = (*c).Sup.size;
		f = ((Freecell30832*) (p));
		(*f).zerofield = ((NI) 0);
		(*f).next = (*c).freelist;
		(*c).freelist = f;
		{
			if (!((*c).free < s)) goto LA8;
			listadd_39216(&(*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(Smallchunk30842)) - ((NI) 8))))) goto LA13;
				listremove_42002(&(*a).freesmallchunks[((NI)(s / ((NI) 8)))- 0], c);
				(*c).Sup.size = ((NI) 4096);
				freebigchunk_33806(a, ((Bigchunk30844*) (c)));
			}
			LA13: ;
		}
		LA6: ;
	}
	goto LA1;
	LA4: ;
	{
		Bigchunk30844* c;
		c = ((Bigchunk30844*) (c_44801));
		(*a).deleted = bottom_30922;
		del_32204(a, &(*a).root, ((NI) ((&(*c).data))));
		freebigchunk_33806(a, c);
	}
	LA1: ;
}

N_NIMCALL(void, dealloc_47628)(Memregion30890* allocator, void* p) {
	void* x;
	x = ((void*) ((NI)((NU32)(((NI) (p))) - (NU32)(((NI)sizeof(Freecell30832))))));
	rawdealloc_44623(allocator, x);
}

N_NOCONV(void, dealloc_8448)(void* p) {
	dealloc_47628((&gch_51059.region), p);
}

static N_INLINE(void, add_49038)(Cellseq48963* s, Cell48947* c) {
	{
		Cell48947** d;
		void* LOC5;
		if (!((*s).cap <= (*s).len)) goto LA3;
		(*s).cap = (NI)((NI)((*s).cap * ((NI) 3)) / ((NI) 2));
		LOC5 = 0;
		LOC5 = alloc_8401(((NI) ((NI)((*s).cap * ((NI) 4)))));
		d = ((Cell48947**) (LOC5));
		memcpy(((void*) (d)), ((void*) ((*s).d)), ((NI) ((NI)((*s).len * ((NI) 4)))));
		dealloc_8448(((void*) ((*s).d)));
		(*s).d = d;
	}
	LA3: ;
	(*s).d[((*s).len)- 0] = c;
	(*s).len += ((NI) 1);
}

static N_INLINE(void, gcmark_71846)(Gcheap51018* gch, void* p) {
	Cell48947* cell;
	NI c;
	cell = usrtocell_52646(p);
	c = ((NI) (cell));
	{
		Cell48947* objstart;
		void* LOC5;
		if (!((NU32)(((NI) 4096)) < (NU32)(c))) goto LA3;
		LOC5 = 0;
		LOC5 = interiorallocatedptr_46301((&(*gch).region), ((void*) (cell)));
		objstart = ((Cell48947*) (LOC5));
		{
			if (!!((objstart == NIM_NIL))) goto LA8;
			(*objstart).refcount = (NI)((NU32)((*objstart).refcount) + (NU32)(((NI) 8)));
			add_49038((&(*gch).decstack), objstart);
		}
		LA8: ;
	}
	LA3: ;
}

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

N_NIMCALL(void, markthreadstacks_72406)(Gcheap51018* gch) {
}

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

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

N_NIMCALL(Pagedesc48955*, cellsetget_49129)(Cellset48959 t, NI key) {
	Pagedesc48955* 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_49121(h, t.max);
		} LA2: ;
	}
	result = NIM_NIL;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, excl_49695)(Cellset48959* s, Cell48947* cell) {
	NI u;
	Pagedesc48955* t;
	u = ((NI) (cell));
	t = cellsetget_49129((*s), (NI)((NU32)(u) >> (NU32)(((NI) 12))));
	{
		if (!!((t == NIM_NIL))) goto LA3;
		u = (NI)((NU32)((NI)((NU32)(u) % (NU32)(((NI) 4096)))) / (NU32)(((NI) 8)));
		(*t).bits[((NI)((NU32)(u) >> (NU32)(((NI) 5))))- 0] = (NI)((*t).bits[((NI)((NU32)(u) >> (NU32)(((NI) 5))))- 0] & (NI)((NU32) ~((NI)((NU32)(((NI) 1)) << (NU32)(((NI) ((NI)(u & ((NI) 31)))))))));
	}
	LA3: ;
}

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

N_NIMCALL(void, preparedealloc_53208)(Cell48947* cell) {
	{
		void* LOC5;
		if (!!(((*(*cell).typ).finalizer == NIM_NIL))) goto LA3;
		gch_51059.recgclock += ((NI) 1);
		LOC5 = 0;
		LOC5 = celltousr_52625(cell);
		((Finalizer) ((*(*cell).typ).finalizer))(LOC5);
		gch_51059.recgclock -= ((NI) 1);
	}
	LA3: ;
}

N_NOINLINE(void, addzct_52617)(Cellseq48963* s, Cell48947* c) {
	{
		if (!((NI)((*c).refcount & ((NI) 4)) == ((NI) 0))) goto LA3;
		(*c).refcount = (NI)((*c).refcount | ((NI) 4));
		add_49038(s, c);
	}
	LA3: ;
}

static N_INLINE(void, rtladdzct_54204)(Cell48947* c) {
	addzct_52617((&gch_51059.zct), c);
}

N_NIMCALL(void, cellsetrawinsert_49158)(Cellset48959 t, Pagedesc48955** data, Pagedesc48955* desc) {
	NI h;
	h = (NI)(((NI) ((*desc).key)) & t.max);
	{
		while (1) {
			if (!!((data[(h)- 0] == NIM_NIL))) goto LA2;
			h = nexttry_49121(h, t.max);
		} LA2: ;
	}
	data[(h)- 0] = desc;
}

N_NIMCALL(void, cellsetenlarge_49412)(Cellset48959* t) {
	NI oldmax;
	Pagedesc48955** n;
	void* LOC1;
	oldmax = (*t).max;
	(*t).max = (NI)((NI)((NI)((*t).max + ((NI) 1)) * ((NI) 2)) - ((NI) 1));
	LOC1 = 0;
	LOC1 = alloc0_8417(((NI) ((NI)((NI)((*t).max + ((NI) 1)) * ((NI) 4)))));
	n = ((Pagedesc48955**) (LOC1));
	{
		NI i_49429;
		NI res_49447;
		i_49429 = 0;
		res_49447 = ((NI) 0);
		{
			while (1) {
				if (!(res_49447 <= oldmax)) goto LA4;
				i_49429 = res_49447;
				{
					if (!!(((*t).data[(i_49429)- 0] == NIM_NIL))) goto LA7;
					cellsetrawinsert_49158((*t), n, (*t).data[(i_49429)- 0]);
				}
				LA7: ;
				res_49447 += ((NI) 1);
			} LA4: ;
		}
	}
	dealloc_8448(((void*) ((*t).data)));
	(*t).data = n;
}

N_NIMCALL(Pagedesc48955*, cellsetput_49463)(Cellset48959* t, NI key) {
	Pagedesc48955* result;
	NI h;
	void* LOC19;
{	result = 0;
	h = (NI)(((NI) (key)) & (*t).max);
	{
		while (1) {
			Pagedesc48955* 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_49121(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_49412(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_49121(h, (*t).max);
		} LA18: ;
	}
	LOC19 = 0;
	LOC19 = alloc0_8417(((NI) (((NI)sizeof(Pagedesc48955)))));
	result = ((Pagedesc48955*) (LOC19));
	(*result).next = (*t).head;
	(*result).key = key;
	(*t).head = result;
	(*t).data[(h)- 0] = result;
	}BeforeRet: ;
	return result;
}

N_NOINLINE(void, incl_49665)(Cellset48959* s, Cell48947* cell) {
	NI u;
	Pagedesc48955* t;
	u = ((NI) (cell));
	t = cellsetput_49463(s, (NI)((NU32)(u) >> (NU32)(((NI) 12))));
	u = (NI)((NU32)((NI)((NU32)(u) % (NU32)(((NI) 4096)))) / (NU32)(((NI) 8)));
	(*t).bits[((NI)((NU32)(u) >> (NU32)(((NI) 5))))- 0] = (NI)((*t).bits[((NI)((NU32)(u) >> (NU32)(((NI) 5))))- 0] | (NI)((NU32)(((NI) 1)) << (NU32)(((NI) ((NI)(u & ((NI) 31)))))));
}

static N_INLINE(void, rtladdcycleroot_53423)(Cell48947* c) {
	{
		if (!!((((NI) ((NI)((*c).refcount & ((NI) 3)))) == ((NI) 3)))) goto LA3;
		(*c).refcount = (NI)((NI)((*c).refcount & ((NI) -4)) | ((NI) 3));
		incl_49665((&gch_51059.cycleroots), c);
	}
	LA3: ;
}

static N_INLINE(void, decref_54604)(Cell48947* c) {
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA3;
		rtladdzct_54204(c);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = canbecycleroot_52667(c);
		if (!LOC6) goto LA7;
		rtladdcycleroot_53423(c);
	}
	goto LA1;
	LA7: ;
	LA1: ;
}

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

N_NIMCALL(void, scanblack_68404)(Cell48947* s) {
	(*s).refcount = (NI)((*s).refcount & ((NI) -4));
	forallchildren_53017(s, ((NU8) 7));
}

N_NIMCALL(void, scan_68604)(Cell48947* s) {
	{
		if (!(((NI) ((NI)((*s).refcount & ((NI) 3)))) == ((NI) 1))) goto LA3;
		{
			if (!((NU32)(((NI) 8)) <= (NU32)((*s).refcount))) goto LA7;
			scanblack_68404(s);
		}
		goto LA5;
		LA7: ;
		{
			(*s).refcount = (NI)((NI)((*s).refcount & ((NI) -4)) | ((NI) 2));
			forallchildren_53017(s, ((NU8) 6));
		}
		LA5: ;
	}
	LA3: ;
}

N_NIMCALL(NIM_BOOL, isallocatedptr_38005)(Memregion30890* a, void* p) {
	NIM_BOOL result;
	result = 0;
	{
		NIM_BOOL LOC3;
		Basechunk30840* c_46216;
		LOC3 = 0;
		LOC3 = isaccessible_33618(a, p);
		if (!LOC3) goto LA4;
		c_46216 = pageaddr_32867(p);
		{
			NIM_BOOL LOC8;
			LOC8 = 0;
			LOC8 = chunkunused_32731(c_46216);
			if (!!(LOC8)) goto LA9;
			{
				NIM_BOOL LOC13;
				Smallchunk30842* c;
				NI offset;
				NIM_BOOL LOC16;
				NIM_BOOL LOC17;
				LOC13 = 0;
				LOC13 = issmallchunk_32708(c_46216);
				if (!LOC13) goto LA14;
				c = ((Smallchunk30842*) (c_46216));
				offset = (NI)((NU32)(((NI) ((NI)(((NI) (p)) & ((NI) 4095))))) - (NU32)((NI)(((NI)sizeof(Smallchunk30842)) - ((NI) 8))));
				LOC16 = 0;
				LOC17 = 0;
				LOC17 = ((NU32)(offset) < (NU32)((*c).acc));
				if (!(LOC17)) goto LA18;
				LOC17 = ((NI)((NU32)(offset) % (NU32)((*c).Sup.size)) == ((NI) 0));
				LA18: ;
				LOC16 = LOC17;
				if (!(LOC16)) goto LA19;
				LOC16 = ((NU32)(((NI) 1)) < (NU32)((*((Freecell30832*) (p))).zerofield));
				LA19: ;
				result = LOC16;
			}
			goto LA11;
			LA14: ;
			{
				Bigchunk30844* c;
				NIM_BOOL LOC21;
				c = ((Bigchunk30844*) (c_46216));
				LOC21 = 0;
				LOC21 = (p == ((void*) ((&(*c).data))));
				if (!(LOC21)) goto LA22;
				LOC21 = ((NU32)(((NI) 1)) < (NU32)((*((Freecell30832*) (p))).zerofield));
				LA22: ;
				result = LOC21;
			}
			LA11: ;
		}
		LA9: ;
	}
	LA4: ;
	return result;
}

N_NIMCALL(void, freecycliccell_67427)(Gcheap51018* gch, Cell48947* c) {
	preparedealloc_53208(c);
	rawdealloc_44623((&(*gch).region), ((void*) (c)));
}

N_NIMCALL(void, collectwhite_68804)(Cell48947* s) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = isallocatedptr_38005((&gch_51059.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_53017(s, ((NU8) 8));
		freecycliccell_67427((&gch_51059), s);
	}
	LA5: ;
}

N_NIMCALL(void, dooperation_53021)(void* p, NU8 op) {
	Cell48947* c;
{	{
		if (!(p == NIM_NIL)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	c = usrtocell_52646(p);
	switch (op) {
	case ((NU8) 2):
	{
		decref_54604(c);
	}
	break;
	case ((NU8) 3):
	{
		add_49038((&gch_51059.tempstack), c);
	}
	break;
	case ((NU8) 4):
	{
		(*c).refcount = (NI)((NU32)((*c).refcount) - (NU32)(((NI) 8)));
	}
	break;
	case ((NU8) 5):
	{
		(*c).refcount = (NI)((NU32)((*c).refcount) - (NU32)(((NI) 8)));
		markgray_68205(c);
	}
	break;
	case ((NU8) 6):
	{
		scan_68604(c);
	}
	break;
	case ((NU8) 7):
	{
		(*c).refcount = (NI)((NU32)((*c).refcount) + (NU32)(((NI) 8)));
		{
			if (!!((((NI) ((NI)((*c).refcount & ((NI) 3)))) == ((NI) 0)))) goto LA13;
			scanblack_68404(c);
		}
		LA13: ;
	}
	break;
	case ((NU8) 8):
	{
		collectwhite_68804(c);
	}
	break;
	case ((NU8) 0):
	{
	}
	break;
	case ((NU8) 1):
	{
	}
	break;
	}
	}BeforeRet: ;
}

N_NIMCALL(NI, getdiscriminant_28404)(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)((NU32)(a) + (NU32)((*n).offset)))))));
	}
	break;
	case ((NI) 2):
	{
		d = ((NI)(NU)(NU16)((*((NI16*) ((NI)((NU32)(a) + (NU32)((*n).offset)))))));
	}
	break;
	case ((NI) 4):
	{
		d = ((NI) ((*((NI32*) ((NI)((NU32)(a) + (NU32)((*n).offset)))))));
	}
	break;
	default:
	{
	}
	break;
	}
	result = d;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

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

N_NIMCALL(void, forallslotsaux_57208)(void* dest, TNimNode* n, NU8 op) {
	NI d;
	d = ((NI) (dest));
	switch ((*n).kind) {
	case ((NU8) 1):
	{
		forallchildrenaux_53025(((void*) ((NI)((NU32)(d) + (NU32)((*n).offset)))), (*n).typ, op);
	}
	break;
	case ((NU8) 2):
	{
		{
			NI i_57234;
			NI HEX3Atmp_57406;
			NI res_57409;
			i_57234 = 0;
			HEX3Atmp_57406 = 0;
			HEX3Atmp_57406 = (NI)((*n).len - ((NI) 1));
			res_57409 = ((NI) 0);
			{
				while (1) {
					if (!(res_57409 <= HEX3Atmp_57406)) goto LA5;
					i_57234 = res_57409;
					{
						if (!((*(*n).sons[(i_57234)- 0]).kind == ((NU8) 1))) goto LA8;
						{
							if (!((*(*(*n).sons[(i_57234)- 0]).typ).kind == ((NU8) 22) || (*(*(*n).sons[(i_57234)- 0]).typ).kind == ((NU8) 28) || (*(*(*n).sons[(i_57234)- 0]).typ).kind == ((NU8) 24))) goto LA12;
							dooperation_53021((*((void**) ((NI)((NU32)(d) + (NU32)((*(*n).sons[(i_57234)- 0]).offset))))), op);
						}
						goto LA10;
						LA12: ;
						{
							forallchildrenaux_53025(((void*) ((NI)((NU32)(d) + (NU32)((*(*n).sons[(i_57234)- 0]).offset)))), (*(*n).sons[(i_57234)- 0]).typ, op);
						}
						LA10: ;
					}
					goto LA6;
					LA8: ;
					{
						forallslotsaux_57208(dest, (*n).sons[(i_57234)- 0], op);
					}
					LA6: ;
					res_57409 += ((NI) 1);
				} LA5: ;
			}
		}
	}
	break;
	case ((NU8) 3):
	{
		TNimNode* m;
		m = selectbranch_28810(dest, n);
		{
			if (!!((m == NIM_NIL))) goto LA19;
			forallslotsaux_57208(dest, m, op);
		}
		LA19: ;
	}
	break;
	case ((NU8) 0):
	{
	}
	break;
	}
}

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

N_NIMCALL(void, forallchildren_53017)(Cell48947* cell, NU8 op) {
	TY3889 marker;
	marker = (*(*cell).typ).marker;
	{
		void* LOC5;
		if (!!((marker == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = celltousr_52625(cell);
		marker(LOC5, ((NI) (op)));
	}
	goto LA1;
	LA3: ;
	{
		switch ((*(*cell).typ).kind) {
		case ((NU8) 22):
		{
			void* LOC8;
			LOC8 = 0;
			LOC8 = celltousr_52625(cell);
			forallchildrenaux_53025(LOC8, (*(*cell).typ).base, op);
		}
		break;
		case ((NU8) 24):
		{
			NI d;
			void* LOC10;
			TGenericSeq* s;
			LOC10 = 0;
			LOC10 = celltousr_52625(cell);
			d = ((NI) (LOC10));
			s = ((TGenericSeq*) (d));
			{
				if (!!((s == NIM_NIL))) goto LA13;
				{
					NI i_58235;
					NI HEX3Atmp_58268;
					NI res_58271;
					i_58235 = 0;
					HEX3Atmp_58268 = 0;
					HEX3Atmp_58268 = (NI)((*s).len - ((NI) 1));
					res_58271 = ((NI) 0);
					{
						while (1) {
							if (!(res_58271 <= HEX3Atmp_58268)) goto LA17;
							i_58235 = res_58271;
							forallchildrenaux_53025(((void*) ((NI)((NU32)((NI)((NU32)(d) + (NU32)((NI)((NU32)(i_58235) * (NU32)((*(*(*cell).typ).base).size))))) + (NU32)(((NI) 8))))), (*(*cell).typ).base, op);
							res_58271 += ((NI) 1);
						} LA17: ;
					}
				}
			}
			LA13: ;
		}
		break;
		default:
		{
		}
		break;
		}
	}
	LA1: ;
}

N_NIMCALL(NIM_BOOL, collectzct_71212)(Gcheap51018* gch) {
	NIM_BOOL result;
	NI* L;
	result = 0;
	L = (&(*gch).zct.len);
	{
		while (1) {
			Cell48947* 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 (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA5;
				{
					NIM_BOOL LOC9;
					LOC9 = 0;
					LOC9 = canbecycleroot_52667(c);
					if (!LOC9) goto LA10;
					excl_49695((&(*gch).cycleroots), c);
				}
				LA10: ;
				preparedealloc_53208(c);
				forallchildren_53017(c, ((NU8) 2));
				rawdealloc_44623((&(*gch).region), ((void*) (c)));
			}
			LA5: ;
		} LA2: ;
	}
	result = NIM_TRUE;
	return result;
}

N_NIMCALL(void, markroots_69005)(Gcheap51018* gch) {
	NI tabsize;
	tabsize = ((NI) 0);
	{
		Cell48947* s_69010;
		Cellset48959 HEX3Atmp_69037;
		Pagedesc48955* r_69042;
		s_69010 = 0;
		memset((void*)(&HEX3Atmp_69037), 0, sizeof(HEX3Atmp_69037));
		HEX3Atmp_69037 = (*gch).cycleroots;
		r_69042 = HEX3Atmp_69037.head;
		{
			while (1) {
				NI i_69044;
				if (!!((r_69042 == NIM_NIL))) goto LA3;
				i_69044 = ((NI) 0);
				{
					while (1) {
						NI w_69046;
						NI j_69048;
						if (!(i_69044 <= ((NI) 15))) goto LA5;
						w_69046 = (*r_69042).bits[(i_69044)- 0];
						j_69048 = ((NI) 0);
						{
							while (1) {
								if (!!((w_69046 == ((NI) 0)))) goto LA7;
								{
									if (!!((((NI) ((NI)(w_69046 & ((NI) 1)))) == ((NI) 0)))) goto LA10;
									s_69010 = ((Cell48947*) ((NI)((NI)((NU32)((*r_69042).key) << (NU32)(((NI) 12))) | (NI)((NU32)((NI)((NU32)((NI)((NU32)(i_69044) << (NU32)(((NI) 5)))) + (NU32)(j_69048))) * (NU32)(((NI) 8))))));
									tabsize += ((NI) 1);
									{
										NIM_BOOL LOC14;
										LOC14 = 0;
										LOC14 = (((NI) ((NI)((*s_69010).refcount & ((NI) 3)))) == ((NI) 3));
										if (!(LOC14)) goto LA15;
										LOC14 = ((NU32)(((NI) 8)) <= (NU32)((*s_69010).refcount));
										LA15: ;
										if (!LOC14) goto LA16;
										markgray_68205(s_69010);
									}
									goto LA12;
									LA16: ;
									{
										excl_49695((&(*gch).cycleroots), s_69010);
										{
											if (!((*s_69010).refcount == ((NI) 0))) goto LA21;
											freecycliccell_67427(gch, s_69010);
										}
										LA21: ;
									}
									LA12: ;
								}
								LA10: ;
								j_69048 += ((NI) 1);
								w_69046 = (NI)((NU32)(w_69046) >> (NU32)(((NI) 1)));
							} LA7: ;
						}
						i_69044 += ((NI) 1);
					} LA5: ;
				}
				r_69042 = (*r_69042).next;
			} LA3: ;
		}
	}
	(*gch).stat.cycletablesize = (((*gch).stat.cycletablesize >= tabsize) ? (*gch).stat.cycletablesize : tabsize);
}

N_NIMCALL(void, collectroots_71401)(Gcheap51018* gch) {
	{
		Cell48947* s_71405;
		Cellset48959 HEX3Atmp_71407;
		Pagedesc48955* r_71412;
		s_71405 = 0;
		memset((void*)(&HEX3Atmp_71407), 0, sizeof(HEX3Atmp_71407));
		HEX3Atmp_71407 = (*gch).cycleroots;
		r_71412 = HEX3Atmp_71407.head;
		{
			while (1) {
				NI i_71414;
				if (!!((r_71412 == NIM_NIL))) goto LA3;
				i_71414 = ((NI) 0);
				{
					while (1) {
						NI w_71416;
						NI j_71418;
						if (!(i_71414 <= ((NI) 15))) goto LA5;
						w_71416 = (*r_71412).bits[(i_71414)- 0];
						j_71418 = ((NI) 0);
						{
							while (1) {
								if (!!((w_71416 == ((NI) 0)))) goto LA7;
								{
									if (!!((((NI) ((NI)(w_71416 & ((NI) 1)))) == ((NI) 0)))) goto LA10;
									s_71405 = ((Cell48947*) ((NI)((NI)((NU32)((*r_71412).key) << (NU32)(((NI) 12))) | (NI)((NU32)((NI)((NU32)((NI)((NU32)(i_71414) << (NU32)(((NI) 5)))) + (NU32)(j_71418))) * (NU32)(((NI) 8))))));
									collectwhite_68804(s_71405);
								}
								LA10: ;
								j_71418 += ((NI) 1);
								w_71416 = (NI)((NU32)(w_71416) >> (NU32)(((NI) 1)));
							} LA7: ;
						}
						i_71414 += ((NI) 1);
					} LA5: ;
				}
				r_71412 = (*r_71412).next;
			} LA3: ;
		}
	}
}

N_NIMCALL(void, deinit_49093)(Cellset48959* s) {
	Pagedesc48955* it;
	it = (*s).head;
	{
		while (1) {
			Pagedesc48955* n;
			if (!!((it == NIM_NIL))) goto LA2;
			n = (*it).next;
			dealloc_8448(((void*) (it)));
			it = n;
		} LA2: ;
	}
	(*s).head = NIM_NIL;
	dealloc_8448(((void*) ((*s).data)));
	(*s).data = NIM_NIL;
	(*s).counter = ((NI) 0);
}

N_NIMCALL(void, cellsetreset_57201)(Cellset48959* s) {
	deinit_49093(s);
	init_49082(s);
}

N_NIMCALL(void, collectcycles_71444)(Gcheap51018* gch) {
	{
		while (1) {
			NIM_BOOL LOC3;
			if (!(((NI) 0) < (*gch).zct.len)) goto LA2;
			LOC3 = 0;
			LOC3 = collectzct_71212(gch);
		} LA2: ;
	}
	markroots_69005(gch);
	{
		Cell48947* s_71601;
		Cellset48959 HEX3Atmp_71803;
		Pagedesc48955* r_71808;
		s_71601 = 0;
		memset((void*)(&HEX3Atmp_71803), 0, sizeof(HEX3Atmp_71803));
		HEX3Atmp_71803 = (*gch).cycleroots;
		r_71808 = HEX3Atmp_71803.head;
		{
			while (1) {
				NI i_71810;
				if (!!((r_71808 == NIM_NIL))) goto LA6;
				i_71810 = ((NI) 0);
				{
					while (1) {
						NI w_71812;
						NI j_71814;
						if (!(i_71810 <= ((NI) 15))) goto LA8;
						w_71812 = (*r_71808).bits[(i_71810)- 0];
						j_71814 = ((NI) 0);
						{
							while (1) {
								if (!!((w_71812 == ((NI) 0)))) goto LA10;
								{
									if (!!((((NI) ((NI)(w_71812 & ((NI) 1)))) == ((NI) 0)))) goto LA13;
									s_71601 = ((Cell48947*) ((NI)((NI)((NU32)((*r_71808).key) << (NU32)(((NI) 12))) | (NI)((NU32)((NI)((NU32)((NI)((NU32)(i_71810) << (NU32)(((NI) 5)))) + (NU32)(j_71814))) * (NU32)(((NI) 8))))));
									scan_68604(s_71601);
								}
								LA13: ;
								j_71814 += ((NI) 1);
								w_71812 = (NI)((NU32)(w_71812) >> (NU32)(((NI) 1)));
							} LA10: ;
						}
						i_71810 += ((NI) 1);
					} LA8: ;
				}
				r_71808 = (*r_71808).next;
			} LA6: ;
		}
	}
	collectroots_71401(gch);
	cellsetreset_57201((&(*gch).cycleroots));
}

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

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

N_NIMCALL(NI, getoccupiedmem_9091)(void) {
	NI result;
	NI LOC1;
	NI LOC2;
{	result = 0;
	LOC1 = 0;
	LOC1 = gettotalmem_9095();
	LOC2 = 0;
	LOC2 = getfreemem_9093();
	result = (NI)(LOC1 - LOC2);
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, unmarkstackandregisters_76411)(Gcheap51018* gch) {
	Cell48947** d;
	d = (*gch).decstack.d;
	{
		NI i_76426;
		NI HEX3Atmp_76602;
		NI res_76605;
		i_76426 = 0;
		HEX3Atmp_76602 = 0;
		HEX3Atmp_76602 = (NI)((*gch).decstack.len - ((NI) 1));
		res_76605 = ((NI) 0);
		{
			while (1) {
				if (!(res_76605 <= HEX3Atmp_76602)) goto LA3;
				i_76426 = res_76605;
				decref_54604(d[(i_76426)- 0]);
				res_76605 += ((NI) 1);
			} LA3: ;
		}
	}
	(*gch).decstack.len = ((NI) 0);
}

N_NIMCALL(void, collectctbody_76621)(Gcheap51018* gch) {
	NI LOC1;
	LOC1 = 0;
	LOC1 = stacksize_72801();
	(*gch).stat.maxstacksize = (((*gch).stat.maxstacksize >= LOC1) ? (*gch).stat.maxstacksize : LOC1);
	prepareforinteriorpointerchecking_46294((&(*gch).region));
	markstackandregisters_74040(gch);
	markthreadstacks_72406(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_71212(gch);
		if (!LOC4) goto LA5;
		{
			NIM_BOOL LOC9;
			NI LOC10;
			NI LOC14;
			LOC9 = 0;
			LOC10 = 0;
			LOC10 = getoccupiedmem_48869((&(*gch).region));
			LOC9 = ((*gch).cyclethreshold <= LOC10);
			if (LOC9) goto LA11;
			LOC9 = NIM_FALSE;
			LA11: ;
			if (!LOC9) goto LA12;
			collectcycles_71444(gch);
			(*gch).stat.cyclecollections += ((NI) 1);
			LOC14 = 0;
			LOC14 = getoccupiedmem_9091();
			(*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_76411(gch);
}

N_NIMCALL(void, collectct_53010)(Gcheap51018* gch) {
	NI stackmarkcosts;
	NI LOC1;
	LOC1 = 0;
	LOC1 = stacksize_72801();
	stackmarkcosts = (((NI)(LOC1 / ((NI) 64)) >= ((NI) 500)) ? (NI)(LOC1 / ((NI) 64)) : ((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_48869((&(*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_76621(gch);
	}
	LA13: ;
}

static N_INLINE(void, addnewobjtozct_58287)(Cell48947* res, Gcheap51018* gch) {
	NI L;
	Cell48947** d;
{	L = (*gch).zct.len;
	d = (*gch).zct.d;
	{
		Cell48947* c;
		if (!(((NI) 8) < L)) goto LA3;
		c = 0;
		c = d[((NI)(L - ((NI) 1)))- 0];
		{
			if (!((NU32)(((NI) 8)) <= (NU32)((*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 (!((NU32)(((NI) 8)) <= (NU32)((*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 (!((NU32)(((NI) 8)) <= (NU32)((*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 (!((NU32)(((NI) 8)) <= (NU32)((*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 (!((NU32)(((NI) 8)) <= (NU32)((*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 (!((NU32)(((NI) 8)) <= (NU32)((*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 (!((NU32)(((NI) 8)) <= (NU32)((*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 (!((NU32)(((NI) 8)) <= (NU32)((*c).refcount))) goto LA35;
			(*c).refcount = (NI)((*c).refcount & ((NI) -5));
			d[((NI)(L - ((NI) 8)))- 0] = res;
			goto BeforeRet;
		}
		LA35: ;
		add_49038((&(*gch).zct), res);
	}
	goto LA1;
	LA3: ;
	{
		d[(L)- 0] = res;
		(*gch).zct.len += ((NI) 1);
	}
	LA1: ;
	}BeforeRet: ;
}

N_NIMCALL(void*, rawnewobj_58804)(TNimType* typ, NI size, Gcheap51018* gch) {
	void* result;
	Cell48947* res;
	void* LOC1;
	result = 0;
	collectct_53010(gch);
	LOC1 = 0;
	LOC1 = rawalloc_38301((&(*gch).region), (NI)(size + ((NI)sizeof(Cell48947))));
	res = ((Cell48947*) (LOC1));
	(*res).typ = typ;
	(*res).refcount = ((NI) 4);
	addnewobjtozct_58287(res, gch);
	result = celltousr_52625(res);
	return result;
}

N_NIMCALL(void*, newObjNoInit)(TNimType* typ, NI size) {
	void* result;
	result = 0;
	result = rawnewobj_58804(typ, size, (&gch_51059));
	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_13601), (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_16907)(FILE* f, NCSTRING c) {
	fputs(c, f);
}

N_NIMCALL(void, writetostderr_20801)(NCSTRING msg) {
	write_16907(stdout, msg);
}

N_NIMCALL(void, showerrormessage_20809)(NCSTRING data) {
	{
		NimStringDesc* LOC5;
		if (!!((errormessagewriter_20604 == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = cstrToNimstr(data);
		errormessagewriter_20604(LOC5);
	}
	goto LA1;
	LA3: ;
	{
		writetostderr_20801(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 == SIGSEGV)) goto LA18;
		msg = "SIGBUS: Illegal storage access. (Attempt to read from nil?)\012";
	}
	goto LA1;
	LA18: ;
	{
		{
			msg = "unknown signal\012";
		}
	}
	LA1: ;
	showerrormessage_20809(msg);
	exit(((NI) 1));
}

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

N_NIMCALL(NI, getRefcount)(void* p) {
	NI result;
	Cell48947* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = usrtocell_52646(p);
	result = (NI)((NU32)((*LOC1).refcount) >> (NU32)(((NI) 3)));
	return result;
}

N_NIMCALL(void*, newObjRC1)(TNimType* typ, NI size) {
	void* result;
	Cell48947* res;
	void* LOC1;
	result = 0;
	collectct_53010((&gch_51059));
	LOC1 = 0;
	LOC1 = rawalloc_38301((&gch_51059.region), (NI)(size + ((NI)sizeof(Cell48947))));
	res = ((Cell48947*) (LOC1));
	(*res).typ = typ;
	(*res).refcount = ((NI) 8);
	result = celltousr_52625(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_13601), (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_53021(d, ((NU8) (op)));
}

N_NIMCALL(void*, newObj)(TNimType* typ, NI size) {
	void* result;
	result = 0;
	result = rawnewobj_58804(typ, size, (&gch_51059));
	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) {
	Overflowerror4043* a;
	a = (Overflowerror4043*)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) {
	Cell48947* c;
	c = usrtocell_52646(p);
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA3;
		rtladdzct_54204(c);
	}
	LA3: ;
}

static N_INLINE(void, incref_55022)(Cell48947* c) {
	(*c).refcount = (NI)((NU32)((*c).refcount) + (NU32)(((NI) 8)));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = canbecycleroot_52667(c);
		if (!LOC3) goto LA4;
		rtladdcycleroot_53423(c);
	}
	LA4: ;
}

static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		Cell48947* LOC5;
		if (!!((src == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = usrtocell_52646(src);
		incref_55022(LOC5);
	}
	LA3: ;
	{
		Cell48947* LOC10;
		if (!!(((*dest) == NIM_NIL))) goto LA8;
		LOC10 = 0;
		LOC10 = usrtocell_52646((*dest));
		decref_54604(LOC10);
	}
	LA8: ;
	(*dest) = src;
}

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

N_NOINLINE(NIM_BOOL, isobjslowpath_25161)(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_25161(obj, subclass, cache);
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

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

N_NIMCALL(void, raiseexceptionaux_22004)(Exception* e) {
{	{
		if (!!((localraisehook_11430 == NIM_NIL))) goto LA3;
		{
			NIM_BOOL LOC7;
			LOC7 = 0;
			LOC7 = localraisehook_11430(e);
			if (!!(LOC7)) goto LA8;
			goto BeforeRet;
		}
		LA8: ;
	}
	LA3: ;
	{
		if (!!((globalraisehook_11425 == NIM_NIL))) goto LA12;
		{
			NIM_BOOL LOC16;
			LOC16 = 0;
			LOC16 = globalraisehook_11425(e);
			if (!!(LOC16)) goto LA17;
			goto BeforeRet;
		}
		LA17: ;
	}
	LA12: ;
	{
		if (!!((exchandler_20843 == NIM_NIL))) goto LA21;
		{
			NIM_BOOL LOC25;
			LOC25 = 0;
			LOC25 = !((*exchandler_20843).hasRaiseAction);
			if (LOC25) goto LA26;
			LOC25 = (*exchandler_20843).raiseAction.ClEnv? (*exchandler_20843).raiseAction.ClPrc(e, (*exchandler_20843).raiseAction.ClEnv):((TMP52)((*exchandler_20843).raiseAction.ClPrc))(e);
			LA26: ;
			if (!LOC25) goto LA27;
			pushCurrentException(e);
			_longjmp((*exchandler_20843).context, ((int) 1));
		}
		LA27: ;
	}
	goto LA19;
	LA21: ;
	{
		if (!(isObjWithCache((*e).Sup.m_type, (&NTI4053), Nim_OfCheck_CACHE1))) goto LA30;
		showerrormessage_20809((*e).name);
		quitordebug_21807();
	}
	goto LA19;
	LA30: ;
	{
		TY22418 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_20809(((NCSTRING) (buf)));
		quitordebug_21807();
	}
	LA19: ;
	}BeforeRet: ;
}

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

static N_INLINE(void, sysfatal_25310)(NimStringDesc* message) {
	Overflowerror4043* e;
	NimStringDesc* LOC1;
	e = 0;
	e = (Overflowerror4043*) newObj((&NTI25317), sizeof(Overflowerror4043));
	(*e).Sup.Sup.Sup.m_type = (&NTI4043);
	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_25310(((NimStringDesc*) &TMP53));
}

static N_INLINE(NI, addInt)(NI a, NI b) {
	NI result;
{	result = 0;
	result = (NI)((NU32)(a) + (NU32)(b));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = (((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)((NU32)(a) * (NU32)(b));
	floatprod = ((NF)(((double) (a))) * (NF)(((double) (b))));
	resasfloat = ((double) (result));
	{
		if (!(resasfloat == floatprod)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	{
		if (!(((NF)(3.2000000000000000e+01) * (NF)((((NF)(resasfloat) - (NF)(floatprod)) > 0? (((NF)(resasfloat) - (NF)(floatprod))) : -(((NF)(resasfloat) - (NF)(floatprod)))))) <= (floatprod > 0? (floatprod) : -(floatprod)))) goto LA7;
		goto BeforeRet;
	}
	LA7: ;
	raiseOverflow();
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len) {
	void* result;
	NI size;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = mulInt(len, (*(*typ).base).size);
	size = addInt(LOC1, ((NI) 8));
	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) 8));
	result = newObj(typ, size);
	(*((TGenericSeq*) (result))).len = len;
	(*((TGenericSeq*) (result))).reserved = len;
	return result;
}

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

N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = isonstack_53014(((void*) (dest)));
		if (!!(LOC3)) goto LA4;
		{
			Cell48947* LOC10;
			if (!!((src == NIM_NIL))) goto LA8;
			LOC10 = 0;
			LOC10 = usrtocell_52646(src);
			incref_55022(LOC10);
		}
		LA8: ;
		{
			Cell48947* LOC15;
			if (!((NU32)(((NI) 4096)) <= (NU32)(((NI) ((*dest)))))) goto LA13;
			LOC15 = 0;
			LOC15 = usrtocell_52646((*dest));
			decref_54604(LOC15);
		}
		LA13: ;
	}
	goto LA1;
	LA4: ;
	{
	}
	LA1: ;
	(*dest) = src;
}
N_NIMCALL(void, TMP140)(void* p, NI op) {
	Valueerror4049* a;
	a = (Valueerror4049*)p;
	nimGCvisit((void*)(*a).Sup.parent, op);
	nimGCvisit((void*)(*a).Sup.message, op);
	nimGCvisit((void*)(*a).Sup.trace, op);
}

static N_INLINE(void, sysfatal_25021)(NimStringDesc* message) {
	Valueerror4049* e;
	NimStringDesc* LOC1;
	e = 0;
	e = (Valueerror4049*) newObj((&NTI25028), sizeof(Valueerror4049));
	(*e).Sup.Sup.m_type = (&NTI4049);
	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_25021(((NimStringDesc*) &TMP141));
	}
	LA3: ;
}

N_NIMCALL(void, genericresetaux_84801)(void* dest, TNimNode* n) {
	NI d;
	d = ((NI) (dest));
	switch ((*n).kind) {
	case ((NU8) 0):
	{
	}
	break;
	case ((NU8) 1):
	{
		genericReset(((void*) ((NI)((NU32)(d) + (NU32)((*n).offset)))), (*n).typ);
	}
	break;
	case ((NU8) 2):
	{
		{
			NI i_86220;
			NI HEX3Atmp_86246;
			NI res_86249;
			i_86220 = 0;
			HEX3Atmp_86246 = 0;
			HEX3Atmp_86246 = (NI)((*n).len - ((NI) 1));
			res_86249 = ((NI) 0);
			{
				while (1) {
					if (!(res_86249 <= HEX3Atmp_86246)) goto LA6;
					i_86220 = res_86249;
					genericresetaux_84801(dest, (*n).sons[(i_86220)- 0]);
					res_86249 += ((NI) 1);
				} LA6: ;
			}
		}
	}
	break;
	case ((NU8) 3):
	{
		TNimNode* m;
		m = selectbranch_28810(dest, n);
		{
			if (!!((m == NIM_NIL))) goto LA10;
			genericresetaux_84801(dest, m);
		}
		LA10: ;
		zeroMem(((void*) ((NI)((NU32)(d) + (NU32)((*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_84801(dest, (*mt).node);
	}
	break;
	case ((NU8) 17):
	{
		TNimType** pint;
		genericresetaux_84801(dest, (*mt).node);
		pint = ((TNimType**) (dest));
		(*pint) = NIM_NIL;
	}
	break;
	case ((NU8) 16):
	case ((NU8) 4):
	{
		{
			NI i_86413;
			NI HEX3Atmp_86437;
			NI res_86440;
			i_86413 = 0;
			HEX3Atmp_86437 = 0;
			HEX3Atmp_86437 = (NI)((NI)((*mt).size / (*(*mt).base).size) - ((NI) 1));
			res_86440 = ((NI) 0);
			{
				while (1) {
					if (!(res_86440 <= HEX3Atmp_86437)) goto LA7;
					i_86413 = res_86440;
					genericReset(((void*) ((NI)((NU32)(d) + (NU32)((NI)((NU32)(i_86413) * (NU32)((*(*mt).base).size)))))), (*mt).base);
					res_86440 += ((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) (-2147483647 -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_13601), (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_81016, NI last) {
	NimStringDesc* result;
	NI start;
	NI len;
	result = 0;
	start = ((start_81016 >= ((NI) 0)) ? start_81016 : ((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_80401)(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_64606)(void* old, NI newsize, Gcheap51018* gch) {
	void* result;
	Cell48947* ol;
	Cell48947* res;
	void* LOC1;
	NI elemsize;
	NI oldsize;
	result = 0;
	collectct_53010(gch);
	ol = usrtocell_52646(old);
	LOC1 = 0;
	LOC1 = rawalloc_38301((&(*gch).region), (NI)(newsize + ((NI)sizeof(Cell48947))));
	res = ((Cell48947*) (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) 8));
	memcpy(((void*) (res)), ((void*) (ol)), ((NI) ((NI)(oldsize + ((NI)sizeof(Cell48947))))));
	zeroMem(((void*) ((NI)((NU32)((NI)((NU32)(((NI) (res))) + (NU32)(oldsize))) + (NU32)(((NI)sizeof(Cell48947)))))), ((NI) ((NI)(newsize - oldsize))));
	{
		if (!((NU32)((NI)((NU32)((*ol).refcount) >> (NU32)(((NI) 3)))) <= (NU32)(((NI) 1)))) goto LA8;
		{
			NI j;
			Cell48947** 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_52667(ol);
			if (!LOC22) goto LA23;
			excl_49695((&(*gch).cycleroots), ol);
		}
		LA23: ;
		rawdealloc_44623((&(*gch).region), ((void*) (ol)));
	}
	goto LA6;
	LA8: ;
	{
		(*res).refcount = ((NI) 8);
		decref_54604(ol);
	}
	LA6: ;
	result = celltousr_52625(res);
	return result;
}

N_NIMCALL(void*, growobj_67418)(void* old, NI newsize) {
	void* result;
	result = 0;
	result = growobj_64606(old, newsize, (&gch_51059));
	return result;
}

N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen) {
	NimStringDesc* result;
	result = 0;
	{
		if (!((NI)((*dest).Sup.len + addlen) <= ((NI) ((NI)((*dest).Sup.reserved & ((NI) 2147483647)))))) goto LA3;
		result = dest;
	}
	goto LA1;
	LA3: ;
	{
		NI sp;
		NI LOC6;
		void* LOC7;
		LOC6 = 0;
		LOC6 = resize_80401(((NI) ((NI)((*dest).Sup.reserved & ((NI) 2147483647)))));
		sp = ((LOC6 >= (NI)((*dest).Sup.len + addlen)) ? LOC6 : (NI)((*dest).Sup.len + addlen));
		LOC7 = 0;
		LOC7 = growobj_67418(((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) ((NI)((*result).Sup.reserved & ((NI) 2147483647)))) <= (*result).Sup.len)) goto LA3;
		(*result).Sup.reserved = resize_80401(((NI) ((NI)((*result).Sup.reserved & ((NI) 2147483647)))));
		LOC5 = 0;
		LOC5 = growobj_67418(((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) ((NI)((*result).reserved & ((NI) 2147483647)))) <= (*result).len)) goto LA3;
		(*result).reserved = resize_80401(((NI) ((NI)((*result).reserved & ((NI) 2147483647)))));
		LOC5 = 0;
		LOC5 = growobj_67418(((void*) (result)), (NI)((NI)(elemsize * (*result).reserved) + ((NI) 8)));
		result = ((TGenericSeq*) (LOC5));
	}
	LA3: ;
	return result;
}

N_NIMCALL(void, genericassignaux_84812)(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_84806(((void*) ((NI)((NU32)(d) + (NU32)((*n).offset)))), ((void*) ((NI)((NU32)(s) + (NU32)((*n).offset)))), (*n).typ, shallow);
	}
	break;
	case ((NU8) 2):
	{
		{
			NI i_84849;
			NI HEX3Atmp_85006;
			NI res_85009;
			i_84849 = 0;
			HEX3Atmp_85006 = 0;
			HEX3Atmp_85006 = (NI)((*n).len - ((NI) 1));
			res_85009 = ((NI) 0);
			{
				while (1) {
					if (!(res_85009 <= HEX3Atmp_85006)) goto LA5;
					i_84849 = res_85009;
					genericassignaux_84812(dest, src, (*n).sons[(i_84849)- 0], shallow);
					res_85009 += ((NI) 1);
				} LA5: ;
			}
		}
	}
	break;
	case ((NU8) 3):
	{
		TNimNode* dd;
		TNimNode* m;
		dd = selectbranch_28810(dest, n);
		m = selectbranch_28810(src, n);
		{
			NIM_BOOL LOC9;
			LOC9 = 0;
			LOC9 = !((m == dd));
			if (!(LOC9)) goto LA10;
			LOC9 = !((dd == NIM_NIL));
			LA10: ;
			if (!LOC9) goto LA11;
			genericresetaux_84801(dest, dd);
		}
		LA11: ;
		memcpy(((void*) ((NI)((NU32)(d) + (NU32)((*n).offset)))), ((void*) ((NI)((NU32)(s) + (NU32)((*n).offset)))), ((NI) ((*(*n).typ).size)));
		{
			if (!!((m == NIM_NIL))) goto LA15;
			genericassignaux_84812(dest, src, m, shallow);
		}
		LA15: ;
	}
	break;
	case ((NU8) 0):
	{
	}
	break;
	}
}

N_NIMCALL(void, genericassignaux_84806)(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) (-2147483647 -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) (-2147483647 -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_85412;
			NI HEX3Atmp_85543;
			NI res_85546;
			i_85412 = 0;
			HEX3Atmp_85543 = 0;
			HEX3Atmp_85543 = (NI)((*seq).len - ((NI) 1));
			res_85546 = ((NI) 0);
			{
				while (1) {
					if (!(res_85546 <= HEX3Atmp_85543)) goto LA24;
					i_85412 = res_85546;
					genericassignaux_84806(((void*) ((NI)((NU32)((NI)((NU32)(dst) + (NU32)((NI)((NU32)(i_85412) * (NU32)((*(*mt).base).size))))) + (NU32)(((NI) 8))))), ((void*) ((NI)((NU32)((NI)((NU32)(((NI) (s2))) + (NU32)((NI)((NU32)(i_85412) * (NU32)((*(*mt).base).size))))) + (NU32)(((NI) 8))))), (*mt).base, shallow);
					res_85546 += ((NI) 1);
				} LA24: ;
			}
		}
	}
	break;
	case ((NU8) 17):
	{
		TNimType** pint;
		{
			if (!!(((*mt).base == NIM_NIL))) goto LA28;
			genericassignaux_84806(dest, src, (*mt).base, shallow);
		}
		LA28: ;
		genericassignaux_84812(dest, src, (*mt).node, shallow);
		pint = ((TNimType**) (dest));
		(*pint) = mt;
	}
	break;
	case ((NU8) 18):
	{
		genericassignaux_84812(dest, src, (*mt).node, shallow);
	}
	break;
	case ((NU8) 16):
	case ((NU8) 4):
	{
		{
			NI i_85491;
			NI HEX3Atmp_85554;
			NI res_85557;
			i_85491 = 0;
			HEX3Atmp_85554 = 0;
			HEX3Atmp_85554 = (NI)((NI)((*mt).size / (*(*mt).base).size) - ((NI) 1));
			res_85557 = ((NI) 0);
			{
				while (1) {
					if (!(res_85557 <= HEX3Atmp_85554)) goto LA34;
					i_85491 = res_85557;
					genericassignaux_84806(((void*) ((NI)((NU32)(d) + (NU32)((NI)((NU32)(i_85491) * (NU32)((*(*mt).base).size)))))), ((void*) ((NI)((NU32)(s) + (NU32)((NI)((NU32)(i_85491) * (NU32)((*(*mt).base).size)))))), (*mt).base, shallow);
					res_85557 += ((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_84806(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) ((NI)((*s).Sup.reserved & ((NI) 2147483647)))))) goto LA3;
		result = s;
	}
	goto LA1;
	LA3: ;
	{
		result = resizeString(s, n);
	}
	LA1: ;
	(*result).Sup.len = n;
	(*result).data[(n)- 0] = 0;
	return result;
}

N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x) {
	NimStringDesc* result;
	NI i;
	NI y;
	result = 0;
	result = mnewString(((NI) 16));
	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_81953;
		NI HEX3Atmp_81967;
		NI res_81970;
		j_81953 = 0;
		HEX3Atmp_81967 = 0;
		HEX3Atmp_81967 = (NI)((NI)(i / ((NI) 2)) - ((NI) 1));
		res_81970 = ((NI) 0);
		{
			while (1) {
				NIM_CHAR LOC14;
				if (!(res_81970 <= HEX3Atmp_81967)) goto LA13;
				j_81953 = res_81970;
				LOC14 = 0;
				LOC14 = result->data[j_81953];
				result->data[j_81953] = result->data[(NI)((NI)(i - j_81953) - ((NI) 1))];
				result->data[(NI)((NI)(i - j_81953) - ((NI) 1))] = LOC14;
				res_81970 += ((NI) 1);
			} LA13: ;
		}
	}
	return result;
}

N_NIMCALL(NI, writebuffer_16982)(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) {
	Ioerror4031* a;
	a = (Ioerror4031*)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_82810)(NimStringDesc* message) {
	Ioerror4031* e;
	NimStringDesc* LOC1;
	e = 0;
	e = (Ioerror4031*) newObj((&NTI82817), sizeof(Ioerror4031));
	(*e).Sup.Sup.Sup.m_type = (&NTI4031);
	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_82805)(NimStringDesc* msg) {
	sysfatal_82810(msg);
}

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

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

N_NIMCALL(void, writestacktrace_20207)(void) {
	showerrormessage_20809("No stack traceback available\012");
}
N_NIMCALL(void, TMP913)(void* p, NI op) {
	TNimObject* a;
	a = (TNimObject*)p;
}

N_NIMCALL(TNimType*, extGetCellType)(void* c) {
	TNimType* result;
	Cell48947* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = usrtocell_52646(c);
	result = (*LOC1).typ;
	return result;
}

N_NIMCALL(TGenericSeq*, setLengthSeq)(TGenericSeq* seq, NI elemsize, NI newlen) {
	TGenericSeq* result;
	result = 0;
	result = seq;
	{
		NI LOC5;
		void* LOC6;
		if (!(((NI) ((NI)((*result).reserved & ((NI) 2147483647)))) < newlen)) goto LA3;
		LOC5 = 0;
		LOC5 = resize_80401(((NI) ((NI)((*result).reserved & ((NI) 2147483647)))));
		(*result).reserved = ((LOC5 >= newlen) ? LOC5 : newlen);
		LOC6 = 0;
		LOC6 = growobj_67418(((void*) (result)), (NI)((NI)(elemsize * (*result).reserved) + ((NI) 8)));
		result = ((TGenericSeq*) (LOC6));
	}
	goto LA1;
	LA3: ;
	{
		if (!(newlen < (*result).len)) goto LA8;
		{
			NI i_81811;
			NI HEX3Atmp_81888;
			NI res_81891;
			i_81811 = 0;
			HEX3Atmp_81888 = 0;
			HEX3Atmp_81888 = (NI)((*result).len - ((NI) 1));
			res_81891 = newlen;
			{
				while (1) {
					TNimType* LOC13;
					if (!(res_81891 <= HEX3Atmp_81888)) goto LA12;
					i_81811 = res_81891;
					LOC13 = 0;
					LOC13 = extGetCellType(((void*) (result)));
					forallchildrenaux_53025(((void*) ((NI)((NU32)((NI)((NU32)(((NI) (result))) + (NU32)(((NI) 8)))) + (NU32)((NI)((NU32)(i_81811) * (NU32)(elemsize)))))), (*LOC13).base, ((NU8) 2));
					res_81891 += ((NI) 1);
				} LA12: ;
			}
		}
		zeroMem(((void*) ((NI)((NU32)((NI)((NU32)(((NI) (result))) + (NU32)(((NI) 8)))) + (NU32)((NI)((NU32)(newlen) * (NU32)(elemsize)))))), ((NI) ((NI)((NU32)((NI)((NU32)((*result).len) - (NU32)(newlen))) * (NU32)(elemsize)))));
	}
	goto LA1;
	LA8: ;
	LA1: ;
	(*result).len = newlen;
	return result;
}

N_NIMCALL(NIM_BOOL, open_16803)(FILE** f, NimStringDesc* filename, NU8 mode, NI bufsize) {
	NIM_BOOL result;
	void* p;
	result = 0;
	p = fopen(filename->data, Formatopen_84210[(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;
}

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) {
	{
		Cell48947* c;
		if (!!((src == NIM_NIL))) goto LA3;
		c = usrtocell_52646(src);
		(*c).refcount += ((NI) 8);
	}
	LA3: ;
	{
		Cell48947* c;
		if (!!(((*dest) == NIM_NIL))) goto LA7;
		c = usrtocell_52646((*dest));
		{
			(*c).refcount -= ((NI) 8);
			if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA11;
			rtladdzct_54204(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

static N_INLINE(void, sysfatal_16826)(NimStringDesc* message, NimStringDesc* arg) {
	Ioerror4031* e;
	NimStringDesc* LOC1;
	e = 0;
	e = (Ioerror4031*) newObj((&NTI82817), sizeof(Ioerror4031));
	(*e).Sup.Sup.Sup.m_type = (&NTI4031);
	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_16817)(NimStringDesc* filename, NU8 mode, NI bufsize) {
	FILE* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = open_16803(&result, filename, mode, bufsize);
		if (!!(LOC3)) goto LA4;
		sysfatal_16826(((NimStringDesc*) &TMP1055), filename);
	}
	LA4: ;
	return result;
}

N_NIMCALL(NIM_BOOL, readline_16919)(FILE* f, NimStringDesc** line) {
	NIM_BOOL result;
	NI pos;
	NI space;
{	result = 0;
	pos = ((NI) 0);
	space = ((NI) ((NI)((*((TGenericSeq*) ((*line)))).reserved & ((NI) 2147483647))));
	(*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, TMP1056)(void* p, NI op) {
	Reraiseerror4063* a;
	a = (Reraiseerror4063*)p;
	nimGCvisit((void*)(*a).Sup.parent, op);
	nimGCvisit((void*)(*a).Sup.message, op);
	nimGCvisit((void*)(*a).Sup.trace, op);
}

static N_INLINE(void, sysfatal_22620)(NimStringDesc* message) {
	Reraiseerror4063* e;
	NimStringDesc* LOC1;
	e = 0;
	e = (Reraiseerror4063*) newObj((&NTI22627), sizeof(Reraiseerror4063));
	(*e).Sup.Sup.m_type = (&NTI4063);
	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_20845 == NIM_NIL)) goto LA3;
		sysfatal_22620(((NimStringDesc*) &TMP1057));
	}
	goto LA1;
	LA3: ;
	{
		raiseexceptionaux_22004(currexception_20845);
	}
	LA1: ;
}

N_NIMCALL(NimStringDesc*, HEX24_195279)(TY90959 x) {
	NimStringDesc* result;
	NIM_BOOL firstelement;
	NimStringDesc* LOC14;
	result = 0;
	result = copyString(((NimStringDesc*) &TMP1058));
	firstelement = NIM_TRUE;
	{
		if (!!(firstelement)) goto LA3;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TMP1059));
	}
	LA3: ;
	result = resizeString(result, 8);
appendString(result, ((NimStringDesc*) &TMP1060));
	result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TMP1061));
	{
		if (!x.Field0 == 0) goto LA7;
		result = resizeString(result, 3);
appendString(result, ((NimStringDesc*) &TMP1062));
	}
	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*) &TMP1059));
	}
	LA12: ;
	result = resizeString(result, 4);
appendString(result, ((NimStringDesc*) &TMP1063));
	result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TMP1061));
	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*) &TMP1064));
	return result;
}

N_NIMCALL(NIM_CHAR, getdecimalpoint_82051)(void) {
	NIM_CHAR result;
	result = 0;
	result = decimalpoint_82050;
	{
		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_82050 = result;
	}
	LA3: ;
	return result;
}

N_NIMCALL(NI, nimParseBiggestFloat)(NimStringDesc* s, NF* number, NI start) {
	NI result;
	NI i;
	NF sign;
	TY82070 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_82051();
			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_86859, TNimType* typ) {
	NimStringDesc* result;
	NI e;
	NimStringDesc* LOC25;
	NimStringDesc* LOC26;
{	result = 0;
	{
		if (!((*typ).size == ((NI) 1))) goto LA3;
		e = ((NI) ((NI)(e_86859 & ((NI) 255))));
	}
	goto LA1;
	LA3: ;
	{
		if (!((*typ).size == ((NI) 2))) goto LA6;
		e = ((NI) ((NI)(e_86859 & ((NI) 65535))));
	}
	goto LA1;
	LA6: ;
	{
		e = e_86859;
	}
	LA1: ;
	{
		if (!!((((*typ).flags &(1<<((((NU8) 2))&7)))!=0))) goto LA11;
		{
			if (!((NU32)(e) < (NU32)((*(*typ).node).len))) goto LA15;
			result = cstrToNimstr((*(*(*typ).node).sons[(e)- 0]).name);
			goto BeforeRet;
		}
		LA15: ;
	}
	goto LA9;
	LA11: ;
	{
		TNimNode* n;
		TNimNode** s;
		n = (*typ).node;
		s = (*n).sons;
		{
			NI i_86898;
			NI HEX3Atmp_86900;
			NI res_86903;
			i_86898 = 0;
			HEX3Atmp_86900 = 0;
			HEX3Atmp_86900 = (NI)((*n).len - ((NI) 1));
			res_86903 = ((NI) 0);
			{
				while (1) {
					if (!(res_86903 <= HEX3Atmp_86900)) goto LA20;
					i_86898 = res_86903;
					{
						if (!((*s[(i_86898)- 0]).offset == e)) goto LA23;
						result = cstrToNimstr((*s[(i_86898)- 0]).name);
						goto BeforeRet;
					}
					LA23: ;
					res_86903 += ((NI) 1);
				} LA20: ;
			}
		}
	}
	LA9: ;
	LOC25 = 0;
	LOC26 = 0;
	LOC26 = nimIntToStr(e);
	LOC25 = rawNewString(LOC26->Sup.len + 16);
appendString(LOC25, LOC26);
appendString(LOC25, ((NimStringDesc*) &TMP1109));
	result = LOC25;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, objectinitaux_85894)(void* dest, TNimNode* n) {
	NI d;
	d = ((NI) (dest));
	switch ((*n).kind) {
	case ((NU8) 0):
	{
	}
	break;
	case ((NU8) 1):
	{
		objectInit(((void*) ((NI)((NU32)(d) + (NU32)((*n).offset)))), (*n).typ);
	}
	break;
	case ((NU8) 2):
	{
		{
			NI i_86020;
			NI HEX3Atmp_86037;
			NI res_86040;
			i_86020 = 0;
			HEX3Atmp_86037 = 0;
			HEX3Atmp_86037 = (NI)((*n).len - ((NI) 1));
			res_86040 = ((NI) 0);
			{
				while (1) {
					if (!(res_86040 <= HEX3Atmp_86037)) goto LA6;
					i_86020 = res_86040;
					objectinitaux_85894(dest, (*n).sons[(i_86020)- 0]);
					res_86040 += ((NI) 1);
				} LA6: ;
			}
		}
	}
	break;
	case ((NU8) 3):
	{
		TNimNode* m;
		m = selectbranch_28810(dest, n);
		{
			if (!!((m == NIM_NIL))) goto LA10;
			objectinitaux_85894(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_85894(dest, (*typ).node);
	}
	break;
	case ((NU8) 18):
	{
		objectinitaux_85894(dest, (*typ).node);
	}
	break;
	case ((NU8) 16):
	case ((NU8) 4):
	{
		{
			NI i_86073;
			NI HEX3Atmp_86087;
			NI res_86090;
			i_86073 = 0;
			HEX3Atmp_86087 = 0;
			HEX3Atmp_86087 = (NI)((NI)((*typ).size / (*(*typ).base).size) - ((NI) 1));
			res_86090 = ((NI) 0);
			{
				while (1) {
					if (!(res_86090 <= HEX3Atmp_86087)) goto LA6;
					i_86073 = res_86090;
					objectInit(((void*) ((NI)((NU32)(d) + (NU32)((NI)(i_86073 * (*(*typ).base).size))))), (*typ).base);
					res_86090 += ((NI) 1);
				} LA6: ;
			}
		}
	}
	break;
	default:
	{
	}
	break;
	}
}
N_NIMCALL(void, TMP1189)(void* p, NI op) {
	Oserror4033* a;
	a = (Oserror4033*)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, TMP1192)(void* p, NI op) {
	Keyerror4051* a;
	a = (Keyerror4051*)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, TMP1195)(void* p, NI op) {
	Indexerror4055* a;
	a = (Indexerror4055*)p;
	nimGCvisit((void*)(*a).Sup.parent, op);
	nimGCvisit((void*)(*a).Sup.message, op);
	nimGCvisit((void*)(*a).Sup.trace, op);
}

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

N_NIMCALL(NI, ptrsize_47216)(void* p) {
	NI result;
	void* x;
	Basechunk30840* c;
	result = 0;
	x = ((void*) ((NI)((NU32)(((NI) (p))) - (NU32)(((NI)sizeof(Freecell30832))))));
	c = pageaddr_32867(p);
	result = (NI)((NU32)((*c).size) - (NU32)(((NI)sizeof(Freecell30832))));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = issmallchunk_32708(c);
		if (!!(LOC3)) goto LA4;
		result -= (NI)(((NI)sizeof(Bigchunk30844)) - ((NI) 8));
	}
	LA4: ;
	return result;
}

N_NIMCALL(void*, realloc_48607)(Memregion30890* allocator, void* p, NI newsize) {
	void* result;
	result = 0;
	{
		if (!(((NI) 0) < ((NI) (newsize)))) goto LA3;
		result = alloc0_47619(allocator, newsize);
		{
			NI LOC9;
			if (!!((p == NIM_NIL))) goto LA7;
			LOC9 = 0;
			LOC9 = ptrsize_47216(p);
			memcpy(result, p, ((NI) (LOC9)));
			dealloc_47628(allocator, p);
		}
		LA7: ;
	}
	goto LA1;
	LA3: ;
	{
		if (!!((p == NIM_NIL))) goto LA11;
		dealloc_47628(allocator, p);
	}
	goto LA1;
	LA11: ;
	LA1: ;
	return result;
}

N_NOCONV(void*, realloc_8433)(void* p, NI newsize) {
	void* result;
	result = 0;
	result = realloc_48607((&gch_51059.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_82424;
		NI HEX3Atmp_82437;
		NI res_82440;
		j_82424 = 0;
		HEX3Atmp_82437 = 0;
		HEX3Atmp_82437 = (NI)((NI)(i / ((NI) 2)) - ((NI) 1));
		res_82440 = ((NI) 0);
		{
			while (1) {
				NIM_CHAR LOC14;
				if (!(res_82440 <= HEX3Atmp_82437)) goto LA13;
				j_82424 = res_82440;
				LOC14 = 0;
				LOC14 = result->data[j_82424];
				result->data[j_82424] = result->data[(NI)((NI)(i - j_82424) - ((NI) 1))];
				result->data[(NI)((NI)(i - j_82424) - ((NI) 1))] = LOC14;
				res_82440 += ((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;
	TY81997 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_82011;
		NI HEX3Atmp_82026;
		NI res_82029;
		i_82011 = 0;
		HEX3Atmp_82026 = 0;
		HEX3Atmp_82026 = (NI)(n - ((NI) 1));
		res_82029 = ((NI) 0);
		{
			while (1) {
				if (!(res_82029 <= HEX3Atmp_82026)) goto LA4;
				i_82011 = res_82029;
				{
					if (!((NU8)(buf[(i_82011)- 0]) == (NU8)(44))) goto LA7;
					buf[(i_82011)- 0] = 46;
					hasdot = NIM_TRUE;
				}
				goto LA5;
				LA7: ;
				{
					if (!(((NU8)(buf[(i_82011)- 0])) >= ((NU8)(97)) && ((NU8)(buf[(i_82011)- 0])) <= ((NU8)(122)) || ((NU8)(buf[(i_82011)- 0])) >= ((NU8)(65)) && ((NU8)(buf[(i_82011)- 0])) <= ((NU8)(90)) || ((NU8)(buf[(i_82011)- 0])) == ((NU8)(46)))) goto LA10;
					hasdot = NIM_TRUE;
				}
				goto LA5;
				LA10: ;
				LA5: ;
				res_82029 += ((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*) &TMP1355));
	}
	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*) &TMP1356));
		}
		goto LA23;
		LA25: ;
		{
			result = copyString(((NimStringDesc*) &TMP1357));
		}
		LA23: ;
	}
	goto LA16;
	LA21: ;
	{
		result = cstrToNimstr(((NCSTRING) (buf)));
	}
	LA16: ;
	return result;
}

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

static N_INLINE(void*, seqtoptr_575196)(TY224932* x) {
	void* result;
	result = 0;
	result = ((void*) (x));
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_575185)(TY224932* x, TY224932* y) {
	NIM_BOOL result;
{	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_575196(x);
		LOC4 = 0;
		LOC4 = seqtoptr_575196(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_575196(x);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_575196(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_575265;
			NI HEX3Atmp_575267;
			NI res_575270;
			i_575265 = 0;
			HEX3Atmp_575267 = 0;
			HEX3Atmp_575267 = (NI)((x ? x->Sup.len : 0) - ((NI) 1));
			res_575270 = ((NI) 0);
			{
				while (1) {
					if (!(res_575270 <= HEX3Atmp_575267)) goto LA19;
					i_575265 = res_575270;
					{
						if (!!((x->data[i_575265] == y->data[i_575265]))) goto LA22;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA22: ;
					res_575270 += ((NI) 1);
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, safeadd_575174)(TY224932** x, NI32 y) {
	{
		NIM_BOOL LOC3;
		TY575286 LOC6;
		LOC3 = 0;
		LOC3 = HEX3DHEX3D_575185((*x), NIM_NIL);
		if (!LOC3) goto LA4;
		unsureAsgnRef((void**) (&(*x)), (TY224932*) newSeq((&NTI224932), 1));
		LOC6[0] = y;
		(*x)->data[0] = LOC6[0];
	}
	goto LA1;
	LA4: ;
	{
		(*x) = (TY224932*) 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_20843;
	exchandler_20843 = s;
}

N_NIMCALL(NI, rawfilesize_83512)(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_16860)(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_83495)(FILE* file) {
	NimStringDesc* result;
	NimStringDesc* buffer;
	result = 0;
	result = copyString(((NimStringDesc*) &TMP1520));
	buffer = mnewString(((NI) 4000));
	{
		while (1) {
			NI bytesread;
			bytesread = readbuffer_16960(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_83521)(FILE* file, NI len) {
	NimStringDesc* result;
	NI bytes;
	result = 0;
	result = mnewString(((NI) (len)));
	bytes = readbuffer_16960(file, ((void*) ((&result->data[((NI) 0)]))), ((NI) (len)));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = endoffile_16860(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_82805(((NimStringDesc*) &TMP1519));
	}
	goto LA1;
	LA12: ;
	{
		NimStringDesc* LOC15;
		LOC15 = 0;
		LOC15 = readallbuffer_83495(file);
		result = resizeString(result, LOC15->Sup.len + 0);
appendString(result, LOC15);
	}
	LA1: ;
	return result;
}

N_NIMCALL(NimStringDesc*, readall_16869)(FILE* file) {
	NimStringDesc* result;
	NI len;
	result = 0;
	{
		if (!!((file == stdin))) goto LA3;
		len = rawfilesize_83512(file);
	}
	goto LA1;
	LA3: ;
	{
		len = ((NI) -1);
	}
	LA1: ;
	{
		if (!(((NI) 0) < len)) goto LA8;
		result = readallfile_83521(file, len);
	}
	goto LA6;
	LA8: ;
	{
		result = readallbuffer_83495(file);
	}
	LA6: ;
	return result;
}

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

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

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

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_200158)(Sha1digest200009 x, Sha1digest200009 y) {
	NIM_BOOL result;
{	result = 0;
	{
		NI f_200223;
		NI res_200236;
		f_200223 = 0;
		res_200236 = ((NI) 0);
		{
			while (1) {
				if (!(res_200236 <= ((NI) 19))) goto LA3;
				f_200223 = ((NI) (res_200236));
				{
					if (!!((x[(f_200223)- 0] == y[(f_200223)- 0]))) goto LA6;
					goto BeforeRet;
				}
				LA6: ;
				res_200236 += ((NI) 1);
			} LA3: ;
		}
	}
	result = NIM_TRUE;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, write_16911)(FILE* f, NimStringDesc** a, NI aLen0) {
	{
		NimStringDesc* x_83476;
		NI i_83482;
		x_83476 = 0;
		i_83482 = ((NI) 0);
		{
			while (1) {
				if (!(i_83482 < aLen0)) goto LA3;
				x_83476 = a[i_83482];
				write_16895(f, x_83476);
				i_83482 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, Gcdisablemarkandsweep_11219)(void) {
	gch_51059.cyclethreshold = ((NI) 2147483646);
}

N_NIMCALL(NimStringDesc*, readline_16916)(FILE* f) {
	NimStringDesc* result;
	result = 0;
	result = rawNewString(((NI) 80));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = readline_16919(f, (&result));
		if (!!(LOC3)) goto LA4;
		raiseeio_82805(((NimStringDesc*) &TMP1884));
	}
	LA4: ;
	return result;
}

N_NIMCALL(void, insert_92001)(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, TMP2268)(void* p, NI op) {
	Assertionerror4047* a;
	a = (Assertionerror4047*)p;
	nimGCvisit((void*)(*a).Sup.parent, op);
	nimGCvisit((void*)(*a).Sup.message, op);
	nimGCvisit((void*)(*a).Sup.trace, op);
}

static N_INLINE(void, sysfatal_90976)(NimStringDesc* message) {
	Assertionerror4047* e;
	NimStringDesc* LOC1;
	e = 0;
	e = (Assertionerror4047*) newObj((&NTI90983), sizeof(Assertionerror4047));
	(*e).Sup.Sup.m_type = (&NTI4047);
	LOC1 = 0;
	LOC1 = (*e).Sup.message; (*e).Sup.message = copyStringRC1(message);
	if (LOC1) nimGCunrefNoCycle(LOC1);
	raiseException((Exception*)e, "AssertionError");
}

N_NOINLINE(void, raiseassert_90971)(NimStringDesc* msg) {
	sysfatal_90976(msg);
}

static N_INLINE(void*, seqtoptr_263750)(Ttypeseq224843* x) {
	void* result;
	result = 0;
	result = ((void*) (x));
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_263739)(Ttypeseq224843* x, Ttypeseq224843* y) {
	NIM_BOOL result;
{	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_263750(x);
		LOC4 = 0;
		LOC4 = seqtoptr_263750(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_263750(x);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_263750(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_263819;
			NI HEX3Atmp_263832;
			NI res_263835;
			i_263819 = 0;
			HEX3Atmp_263832 = 0;
			HEX3Atmp_263832 = (NI)((x ? x->Sup.len : 0) - ((NI) 1));
			res_263835 = ((NI) 0);
			{
				while (1) {
					if (!(res_263835 <= HEX3Atmp_263832)) goto LA19;
					i_263819 = res_263835;
					{
						if (!!((x->data[i_263819] == y->data[i_263819]))) goto LA22;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA22: ;
					res_263835 += ((NI) 1);
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_258946)(TY258855 x, TY258855 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_301522)(Ttypeseq224843** x, Ttype224847* y) {
	{
		NIM_BOOL LOC3;
		TY392275 LOC6;
		LOC3 = 0;
		LOC3 = HEX3DHEX3D_263739((*x), NIM_NIL);
		if (!LOC3) goto LA4;
		unsureAsgnRef((void**) (&(*x)), (Ttypeseq224843*) newSeq((&NTI224843), 1));
		memset((void*)LOC6, 0, sizeof(LOC6));
		LOC6[0] = y;
		asgnRefNoCycle((void**) (&(*x)->data[0]), LOC6[0]);
	}
	goto LA1;
	LA4: ;
	{
		(*x) = (Ttypeseq224843*) incrSeqV2(&((*x))->Sup, sizeof(Ttype224847*));
		asgnRefNoCycle((void**) (&(*x)->data[(*x)->Sup.len]), y);
		++(*x)->Sup.len;
	}
	LA1: ;
}

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

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

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

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

N_NIMCALL(NCSTRING*, alloccstringarray_17601)(NimStringDesc** a, NI aLen0) {
	NCSTRING* result;
	void* LOC1;
	NimStringDesc** x;
	result = 0;
	LOC1 = 0;
	LOC1 = alloc0_8417(((NI) ((NI)((NI)(aLen0 + ((NI) 1)) * ((NI) 4)))));
	result = ((NCSTRING*) (LOC1));
	x = ((NimStringDesc**) (a));
	{
		NI i_17824;
		NI HEX3Atmp_17831;
		NI res_17834;
		i_17824 = 0;
		HEX3Atmp_17831 = 0;
		HEX3Atmp_17831 = (aLen0-1);
		res_17834 = ((NI) 0);
		{
			while (1) {
				void* LOC5;
				if (!(res_17834 <= HEX3Atmp_17831)) goto LA4;
				i_17824 = res_17834;
				LOC5 = 0;
				LOC5 = alloc0_8417(((NI) ((NI)((x[(i_17824)- 0] ? x[(i_17824)- 0]->Sup.len : 0) + ((NI) 1)))));
				result[(i_17824)- 0] = ((NCSTRING) (LOC5));
				memcpy(((void*) (result[(i_17824)- 0])), ((void*) ((&x[(i_17824)- 0]->data[((NI) 0)]))), ((NI) ((x[(i_17824)- 0] ? x[(i_17824)- 0]->Sup.len : 0))));
				res_17834 += ((NI) 1);
			} LA4: ;
		}
	}
	return result;
}

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

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

N_NIMCALL(NimStringDesc*, HEX24_8801)(NU64 x) {
	NimStringDesc* result;
	result = 0;
	{
		if (!(x == ((NI) 0))) goto LA3;
		result = copyString(((NimStringDesc*) &TMP3029));
	}
	goto LA1;
	LA3: ;
	{
		TY86646 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_86732;
			NI HEX3Atmp_86747;
			NI res_86750;
			t_86732 = 0;
			HEX3Atmp_86747 = 0;
			HEX3Atmp_86747 = (half - 1);
			res_86750 = ((NI) 0);
			{
				while (1) {
					NIM_CHAR LOC11;
					if (!(res_86750 <= HEX3Atmp_86747)) goto LA10;
					t_86732 = res_86750;
					LOC11 = 0;
					LOC11 = buf[(t_86732)- 0];
					buf[(t_86732)- 0] = buf[((NI)((NI)(i - t_86732) - ((NI) 1)))- 0];
					buf[((NI)((NI)(i - t_86732) - ((NI) 1)))- 0] = LOC11;
					res_86750 += ((NI) 1);
				} LA10: ;
			}
		}
		result = cstrToNimstr(((NCSTRING) (buf)));
	}
	LA1: ;
	return result;
}

N_NIMCALL(NI, clamp_150539)(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*) &TMP3097));
	}
	goto LA1;
	LA3: ;
	{
		result = copyString(((NimStringDesc*) &TMP3098));
	}
	LA1: ;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tinstantiation224831*, new_459534)(void) {
	Tinstantiation224831* result;
	Tinstantiation224831* r;
{	result = 0;
	r = 0;
	r = (Tinstantiation224831*) newObj((&NTI224833), sizeof(Tinstantiation224831));
	result = r;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

static N_INLINE(void*, seqtoptr_227881)(TY224944* x) {
	void* result;
	result = 0;
	result = ((void*) (x));
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_227870)(TY224944* x, TY224944* y) {
	NIM_BOOL result;
{	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_227881(x);
		LOC4 = 0;
		LOC4 = seqtoptr_227881(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_227881(x);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_227881(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_227950;
			NI HEX3Atmp_227963;
			NI res_227966;
			i_227950 = 0;
			HEX3Atmp_227963 = 0;
			HEX3Atmp_227963 = (NI)((x ? x->Sup.len : 0) - ((NI) 1));
			res_227966 = ((NI) 0);
			{
				while (1) {
					if (!(res_227966 <= HEX3Atmp_227963)) goto LA19;
					i_227950 = res_227966;
					{
						if (!!((x->data[i_227950] == y->data[i_227950]))) goto LA22;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA22: ;
					res_227966 += ((NI) 1);
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, safeadd_459699)(TY224944** x, Tinstantiation224831* y) {
	{
		NIM_BOOL LOC3;
		TY459720 LOC6;
		LOC3 = 0;
		LOC3 = HEX3DHEX3D_227870((*x), NIM_NIL);
		if (!LOC3) goto LA4;
		unsureAsgnRef((void**) (&(*x)), (TY224944*) newSeq((&NTI224944), 1));
		memset((void*)LOC6, 0, sizeof(LOC6));
		LOC6[0] = y;
		asgnRefNoCycle((void**) (&(*x)->data[0]), LOC6[0]);
	}
	goto LA1;
	LA4: ;
	{
		(*x) = (TY224944*) incrSeqV2(&((*x))->Sup, sizeof(Tinstantiation224831*));
		asgnRefNoCycle((void**) (&(*x)->data[(*x)->Sup.len]), y);
		++(*x)->Sup.len;
	}
	LA1: ;
}

static N_INLINE(void*, seqtoptr_299983)(Tnodeseq224803* x) {
	void* result;
	result = 0;
	result = ((void*) (x));
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_299972)(Tnodeseq224803* x, Tnodeseq224803* y) {
	NIM_BOOL result;
{	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_299983(x);
		LOC4 = 0;
		LOC4 = seqtoptr_299983(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_299983(x);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_299983(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_300052;
			NI HEX3Atmp_300065;
			NI res_300068;
			i_300052 = 0;
			HEX3Atmp_300065 = 0;
			HEX3Atmp_300065 = (NI)((x ? x->Sup.len : 0) - ((NI) 1));
			res_300068 = ((NI) 0);
			{
				while (1) {
					if (!(res_300068 <= HEX3Atmp_300065)) goto LA19;
					i_300052 = res_300068;
					{
						if (!!((x->data[i_300052] == y->data[i_300052]))) goto LA22;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA22: ;
					res_300068 += ((NI) 1);
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, safeadd_460504)(Tnodeseq224803** x, Tnode224809* y) {
	{
		NIM_BOOL LOC3;
		TY242880 LOC6;
		LOC3 = 0;
		LOC3 = HEX3DHEX3D_299972((*x), NIM_NIL);
		if (!LOC3) goto LA4;
		unsureAsgnRef((void**) (&(*x)), (Tnodeseq224803*) newSeq((&NTI224803), 1));
		memset((void*)LOC6, 0, sizeof(LOC6));
		LOC6[0] = y;
		asgnRefNoCycle((void**) (&(*x)->data[0]), LOC6[0]);
	}
	goto LA1;
	LA4: ;
	{
		(*x) = (Tnodeseq224803*) incrSeqV2(&((*x))->Sup, sizeof(Tnode224809*));
		asgnRefNoCycle((void**) (&(*x)->data[(*x)->Sup.len]), y);
		++(*x)->Sup.len;
	}
	LA1: ;
}

N_NIMCALL(void, insert_460637)(Tnodeseq224803** x, Tnode224809* item, NI i) {
	NI xl_461002;
	NI j_461004;
	xl_461002 = ((*x) ? (*x)->Sup.len : 0);
	(*x) = (Tnodeseq224803*) setLengthSeq(&((*x))->Sup, sizeof(Tnode224809*), ((NI) ((NI)(xl_461002 + ((NI) 1)))));
	j_461004 = (NI)(xl_461002 - ((NI) 1));
	{
		while (1) {
			if (!(((NI) (i)) <= j_461004)) goto LA2;
			asgnRefNoCycle((void**) (&(*x)->data[(NI)(j_461004 + ((NI) 1))]), (*x)->data[j_461004]);
			j_461004 -= ((NI) 1);
		} LA2: ;
	}
	asgnRefNoCycle((void**) (&(*x)->data[i]), item);
}

N_NIMCALL(Tnodeseq224803*, HEX5BHEX5D_415753)(Tnodeseq224803* s, Slice90365 x) {
	Tnodeseq224803* result;
	NI a;
	NI L;
	result = 0;
	a = x.a;
	L = (NI)((NI)(x.b - a) + ((NI) 1));
	result = (Tnodeseq224803*) newSeq((&NTI224803), ((NI) (L)));
	{
		NI i_415794;
		NI HEX3Atmp_415796;
		NI res_415799;
		i_415794 = 0;
		HEX3Atmp_415796 = 0;
		HEX3Atmp_415796 = (L - 1);
		res_415799 = ((NI) 0);
		{
			while (1) {
				if (!(res_415799 <= HEX3Atmp_415796)) goto LA3;
				i_415794 = res_415799;
				asgnRefNoCycle((void**) (&result->data[i_415794]), s->data[(NI)(i_415794 + a)]);
				res_415799 += ((NI) 1);
			} LA3: ;
		}
	}
	return result;
}

N_NIMCALL(void, HEX5BHEX5DHEX3D_415817)(Tnodeseq224803** s, Slice90365 x, Tnode224809** 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_415869;
			NI HEX3Atmp_415969;
			NI res_415972;
			i_415869 = 0;
			HEX3Atmp_415969 = 0;
			HEX3Atmp_415969 = (L - 1);
			res_415972 = ((NI) 0);
			{
				while (1) {
					if (!(res_415972 <= HEX3Atmp_415969)) goto LA7;
					i_415869 = res_415972;
					asgnRefNoCycle((void**) (&(*s)->data[(NI)(i_415869 + a)]), b[i_415869]);
					res_415972 += ((NI) 1);
				} LA7: ;
			}
		}
	}
	goto LA1;
	LA3: ;
	{
		NI slen_415831;
		NI shift_415833;
		NI newlen_415835;
		slen_415831 = ((*s) ? (*s)->Sup.len : 0);
		shift_415833 = (NI)(bLen0 - L);
		newlen_415835 = (NI)(slen_415831 + shift_415833);
		{
			if (!(((NI) 0) < shift_415833)) goto LA11;
			(*s) = (Tnodeseq224803*) setLengthSeq(&((*s))->Sup, sizeof(Tnode224809*), ((NI) (newlen_415835)));
			{
				NI i_415837;
				NI HEX3Atmp_415977;
				NI HEX3Atmp_415978;
				NI res_415981;
				i_415837 = 0;
				HEX3Atmp_415977 = 0;
				HEX3Atmp_415978 = 0;
				HEX3Atmp_415977 = (NI)(newlen_415835 - ((NI) 1));
				HEX3Atmp_415978 = (NI)((NI)(a + shift_415833) + ((NI) 1));
				res_415981 = HEX3Atmp_415977;
				{
					while (1) {
						if (!(HEX3Atmp_415978 <= res_415981)) goto LA15;
						i_415837 = res_415981;
						asgnRefNoCycle((void**) (&(*s)->data[i_415837]), (*s)->data[(NI)(i_415837 - shift_415833)]);
						res_415981 -= ((NI) 1);
					} LA15: ;
				}
			}
		}
		goto LA9;
		LA11: ;
		{
			{
				NI i_415839;
				NI HEX3Atmp_415986;
				NI HEX3Atmp_415987;
				NI res_415990;
				i_415839 = 0;
				HEX3Atmp_415986 = 0;
				HEX3Atmp_415987 = 0;
				HEX3Atmp_415986 = (NI)(a + bLen0);
				HEX3Atmp_415987 = (NI)((NI)(((*s) ? (*s)->Sup.len : 0) - ((NI) 1)) + shift_415833);
				res_415990 = HEX3Atmp_415986;
				{
					while (1) {
						if (!(res_415990 <= HEX3Atmp_415987)) goto LA19;
						i_415839 = res_415990;
						asgnRefNoCycle((void**) (&(*s)->data[i_415839]), (*s)->data[(NI)(i_415839 - shift_415833)]);
						res_415990 += ((NI) 1);
					} LA19: ;
				}
			}
			(*s) = (Tnodeseq224803*) setLengthSeq(&((*s))->Sup, sizeof(Tnode224809*), ((NI) (newlen_415835)));
		}
		LA9: ;
		{
			NI i_415841;
			NI HEX3Atmp_415995;
			NI res_415998;
			i_415841 = 0;
			HEX3Atmp_415995 = 0;
			HEX3Atmp_415995 = (bLen0 - 1);
			res_415998 = ((NI) 0);
			{
				while (1) {
					if (!(res_415998 <= HEX3Atmp_415995)) goto LA22;
					i_415841 = res_415998;
					asgnRefNoCycle((void**) (&(*s)->data[(NI)(i_415841 + a)]), b[i_415841]);
					res_415998 += ((NI) 1);
				} LA22: ;
			}
		}
	}
	LA1: ;
}

static N_INLINE(void*, seqtoptr_460069)(Tsymseq224811* x) {
	void* result;
	result = 0;
	result = ((void*) (x));
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_460058)(Tsymseq224811* x, Tsymseq224811* y) {
	NIM_BOOL result;
{	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_460069(x);
		LOC4 = 0;
		LOC4 = seqtoptr_460069(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_460069(x);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_460069(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_460138;
			NI HEX3Atmp_460151;
			NI res_460154;
			i_460138 = 0;
			HEX3Atmp_460151 = 0;
			HEX3Atmp_460151 = (NI)((x ? x->Sup.len : 0) - ((NI) 1));
			res_460154 = ((NI) 0);
			{
				while (1) {
					if (!(res_460154 <= HEX3Atmp_460151)) goto LA19;
					i_460138 = res_460154;
					{
						if (!!((x->data[i_460138] == y->data[i_460138]))) goto LA22;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA22: ;
					res_460154 += ((NI) 1);
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, safeadd_460171)(Tsymseq224811** x, Tsym224841* y) {
	{
		NIM_BOOL LOC3;
		TY279434 LOC6;
		LOC3 = 0;
		LOC3 = HEX3DHEX3D_460058((*x), NIM_NIL);
		if (!LOC3) goto LA4;
		unsureAsgnRef((void**) (&(*x)), (Tsymseq224811*) newSeq((&NTI224811), 1));
		memset((void*)LOC6, 0, sizeof(LOC6));
		LOC6[0] = y;
		asgnRefNoCycle((void**) (&(*x)->data[0]), LOC6[0]);
	}
	goto LA1;
	LA4: ;
	{
		(*x) = (Tsymseq224811*) incrSeqV2(&((*x))->Sup, sizeof(Tsym224841*));
		asgnRefNoCycle((void**) (&(*x)->data[(*x)->Sup.len]), y);
		++(*x)->Sup.len;
	}
	LA1: ;
}

N_NIMCALL(void, delete_461246)(Tnodeseq224803** x, NI i) {
	NI xl_461602;
	xl_461602 = ((*x) ? (*x)->Sup.len : 0);
	{
		NI j_461604;
		NI HEX3Atmp_461810;
		NI res_461813;
		j_461604 = 0;
		HEX3Atmp_461810 = 0;
		HEX3Atmp_461810 = (NI)(xl_461602 - ((NI) 2));
		res_461813 = ((NI) (i));
		{
			while (1) {
				if (!(res_461813 <= HEX3Atmp_461810)) goto LA3;
				j_461604 = res_461813;
				asgnRefNoCycle((void**) (&(*x)->data[j_461604]), (*x)->data[(NI)(j_461604 + ((NI) 1))]);
				res_461813 += ((NI) 1);
			} LA3: ;
		}
	}
	(*x) = (Tnodeseq224803*) setLengthSeq(&((*x))->Sup, sizeof(Tnode224809*), ((NI) ((NI)(xl_461602 - ((NI) 1)))));
}

N_NIMCALL(Tnodeseq224803*, newseq_498862)(NI len) {
	Tnodeseq224803* result;
	result = 0;
	result = (Tnodeseq224803*) newSeq((&NTI224803), len);
	return result;
}

N_NIMCALL(void, Gcfullcollect_11205)(void) {
	NI oldthreshold;
	oldthreshold = gch_51059.cyclethreshold;
	gch_51059.cyclethreshold = ((NI) 0);
	collectct_53010((&gch_51059));
	gch_51059.cyclethreshold = oldthreshold;
}

static N_INLINE(void*, seqtoptr_325724)(TY324774* x) {
	void* result;
	result = 0;
	result = ((void*) (x));
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_325713)(TY324774* x, TY324774* y) {
	NIM_BOOL result;
{	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_325724(x);
		LOC4 = 0;
		LOC4 = seqtoptr_325724(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_325724(x);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_325724(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_325793;
			NI HEX3Atmp_325795;
			NI res_325798;
			i_325793 = 0;
			HEX3Atmp_325795 = 0;
			HEX3Atmp_325795 = (NI)((x ? x->Sup.len : 0) - ((NI) 1));
			res_325798 = ((NI) 0);
			{
				while (1) {
					if (!(res_325798 <= HEX3Atmp_325795)) goto LA19;
					i_325793 = res_325798;
					{
						NIM_BOOL LOC22;
						LOC22 = 0;
						LOC22 = HEX3DHEX3D_325661(x->data[i_325793], y->data[i_325793]);
						if (!!(LOC22)) goto LA23;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA23: ;
					res_325798 += ((NI) 1);
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	}BeforeRet: ;
	return result;
}

static N_INLINE(void*, seqtoptr_325828)(TY324769* 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_325899)(TY325284 x, TY325284 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_325661(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_325817)(TY324769* x, TY324769* y) {
	NIM_BOOL result;
{	result = 0;
	{
		void* LOC3;
		void* LOC4;
		LOC3 = 0;
		LOC3 = seqtoptr_325828(x);
		LOC4 = 0;
		LOC4 = seqtoptr_325828(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_325828(x);
		LOC8 = (LOC9 == NIM_NIL);
		if (LOC8) goto LA10;
		LOC11 = 0;
		LOC11 = seqtoptr_325828(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_325897;
			NI HEX3Atmp_325920;
			NI res_325923;
			i_325897 = 0;
			HEX3Atmp_325920 = 0;
			HEX3Atmp_325920 = (NI)((x ? x->Sup.len : 0) - ((NI) 1));
			res_325923 = ((NI) 0);
			{
				while (1) {
					if (!(res_325923 <= HEX3Atmp_325920)) goto LA19;
					i_325897 = res_325923;
					{
						NIM_BOOL LOC22;
						LOC22 = 0;
						LOC22 = HEX3DHEX3D_325899(x->data[i_325897], y->data[i_325897]);
						if (!!(LOC22)) goto LA23;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA23: ;
					res_325923 += ((NI) 1);
				} LA19: ;
			}
		}
		result = NIM_TRUE;
	}
	goto LA1;
	LA15: ;
	LA1: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_349712)(Indexentry347397 x, Indexentry347397 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, TMP5268)(void* p, NI op) {
	TY569225* a;
	NI LOC1;
	a = (TY569225*)p;
	LOC1 = 0;
	for (LOC1 = 0; LOC1 < a->Sup.len; LOC1++) {
	}
}

static N_INLINE(void, Gcdisable_11201)(void) {
	gch_51059.recgclock += ((NI) 1);
}

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

N_NIMCALL(NimStringDesc*, Gcgetstatistics_11221)(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_11201();
	LOC1 = 0;
	LOC2 = 0;
	LOC2 = gettotalmem_9095();
	LOC3 = 0;
	LOC3 = nimIntToStr(LOC2);
	LOC4 = 0;
	LOC4 = getoccupiedmem_9091();
	LOC5 = 0;
	LOC5 = nimIntToStr(LOC4);
	LOC6 = 0;
	LOC6 = nimIntToStr(gch_51059.stat.stackscans);
	LOC7 = 0;
	LOC7 = nimIntToStr(gch_51059.stat.maxstackcells);
	LOC8 = 0;
	LOC8 = nimIntToStr(gch_51059.stat.cyclecollections);
	LOC9 = 0;
	LOC9 = nimIntToStr(gch_51059.stat.maxthreshold);
	LOC10 = 0;
	LOC10 = nimIntToStr(gch_51059.zct.cap);
	LOC11 = 0;
	LOC11 = nimIntToStr(gch_51059.stat.cycletablesize);
	LOC12 = 0;
	LOC12 = nimInt64ToStr((NI64)(gch_51059.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*) &TMP5280));
appendString(LOC1, LOC3);
appendString(LOC1, ((NimStringDesc*) &TMP5281));
appendString(LOC1, LOC5);
appendString(LOC1, ((NimStringDesc*) &TMP5282));
appendString(LOC1, LOC6);
appendString(LOC1, ((NimStringDesc*) &TMP5283));
appendString(LOC1, LOC7);
appendString(LOC1, ((NimStringDesc*) &TMP5284));
appendString(LOC1, LOC8);
appendString(LOC1, ((NimStringDesc*) &TMP5285));
appendString(LOC1, LOC9);
appendString(LOC1, ((NimStringDesc*) &TMP5286));
appendString(LOC1, LOC10);
appendString(LOC1, ((NimStringDesc*) &TMP5287));
appendString(LOC1, LOC11);
appendString(LOC1, ((NimStringDesc*) &TMP5288));
appendString(LOC1, LOC12);
	result = LOC1;
	LOC13 = 0;
	LOC14 = 0;
	LOC14 = nimIntToStr(gch_51059.stat.maxstacksize);
	LOC13 = rawNewString(result->Sup.len + LOC14->Sup.len + 22);
appendString(LOC13, result);
appendString(LOC13, ((NimStringDesc*) &TMP5289));
appendString(LOC13, LOC14);
appendString(LOC13, ((NimStringDesc*) &TMP5290));
	result = LOC13;
	Gcenable_11203();
	return result;
}
NIM_EXTERNC N_NOINLINE(void, systemInit000)(void) {
	nimvm_6690 = NIM_FALSE;
	strdesc_13601.size = ((NI) 4);
	strdesc_13601.kind = ((NU8) 28);
	strdesc_13601.flags = 2;
	initallocator_13001();
	initStackBottom();
	initgc_12801();
	registersignalhandler_24408();
}

NIM_EXTERNC N_NOINLINE(void, systemDatInit000)(void) {
static TNimNode* TMP49[4];
static TNimNode TMP0[20];
NTI4011.size = sizeof(TNimObject);
NTI4011.kind = 17;
NTI4011.base = 0;
NTI4011.flags = 1;
TMP0[0].len = 0; TMP0[0].kind = 2;
NTI4011.node = &TMP0[0];
NTI108.size = sizeof(NI);
NTI108.kind = 31;
NTI108.base = 0;
NTI108.flags = 3;
NTI149.size = sizeof(NimStringDesc*);
NTI149.kind = 28;
NTI149.base = 0;
NTI149.flags = 2;
NTI4027.size = sizeof(Exception);
NTI4027.kind = 17;
NTI4027.base = (&NTI4011);
TMP49[0] = &TMP0[2];
NTI11422.size = sizeof(Exception*);
NTI11422.kind = 22;
NTI11422.base = (&NTI4027);
NTI11422.marker = TMP50;
TMP0[2].kind = 1;
TMP0[2].offset = offsetof(Exception, parent);
TMP0[2].typ = (&NTI11422);
TMP0[2].name = "parent";
TMP49[1] = &TMP0[3];
NTI151.size = sizeof(NCSTRING);
NTI151.kind = 29;
NTI151.base = 0;
NTI151.flags = 3;
TMP0[3].kind = 1;
TMP0[3].offset = offsetof(Exception, name);
TMP0[3].typ = (&NTI151);
TMP0[3].name = "name";
TMP49[2] = &TMP0[4];
TMP0[4].kind = 1;
TMP0[4].offset = offsetof(Exception, message);
TMP0[4].typ = (&NTI149);
TMP0[4].name = "msg";
TMP49[3] = &TMP0[5];
TMP0[5].kind = 1;
TMP0[5].offset = offsetof(Exception, trace);
TMP0[5].typ = (&NTI149);
TMP0[5].name = "trace";
TMP0[1].len = 4; TMP0[1].kind = 2; TMP0[1].sons = &TMP49[0];
NTI4027.node = &TMP0[1];
NTI4039.size = sizeof(Arithmeticerror4039);
NTI4039.kind = 17;
NTI4039.base = (&NTI4027);
TMP0[6].len = 0; TMP0[6].kind = 2;
NTI4039.node = &TMP0[6];
NTI4043.size = sizeof(Overflowerror4043);
NTI4043.kind = 17;
NTI4043.base = (&NTI4039);
TMP0[7].len = 0; TMP0[7].kind = 2;
NTI4043.node = &TMP0[7];
NTI25317.size = sizeof(Overflowerror4043*);
NTI25317.kind = 22;
NTI25317.base = (&NTI4043);
NTI25317.marker = TMP51;
NTI4029.size = sizeof(Systemerror4029);
NTI4029.kind = 17;
NTI4029.base = (&NTI4027);
TMP0[8].len = 0; TMP0[8].kind = 2;
NTI4029.node = &TMP0[8];
NTI4053.size = sizeof(Outofmemerror4053);
NTI4053.kind = 17;
NTI4053.base = (&NTI4029);
TMP0[9].len = 0; TMP0[9].kind = 2;
NTI4053.node = &TMP0[9];
NTI114.size = sizeof(NI32);
NTI114.kind = 34;
NTI114.base = 0;
NTI114.flags = 3;
NTI4049.size = sizeof(Valueerror4049);
NTI4049.kind = 17;
NTI4049.base = (&NTI4027);
TMP0[10].len = 0; TMP0[10].kind = 2;
NTI4049.node = &TMP0[10];
NTI25028.size = sizeof(Valueerror4049*);
NTI25028.kind = 22;
NTI25028.base = (&NTI4049);
NTI25028.marker = TMP140;
NTI112.size = sizeof(NI16);
NTI112.kind = 33;
NTI112.base = 0;
NTI112.flags = 3;
NTI4031.size = sizeof(Ioerror4031);
NTI4031.kind = 17;
NTI4031.base = (&NTI4029);
TMP0[11].len = 0; TMP0[11].kind = 2;
NTI4031.node = &TMP0[11];
NTI82817.size = sizeof(Ioerror4031*);
NTI82817.kind = 22;
NTI82817.base = (&NTI4031);
NTI82817.marker = TMP430;
NTI138.size = sizeof(NIM_BOOL);
NTI138.kind = 1;
NTI138.base = 0;
NTI138.flags = 3;
NTI8112.size = sizeof(NI64);
NTI8112.kind = 35;
NTI8112.base = 0;
NTI8112.flags = 3;
NTI8114.size = sizeof(NF);
NTI8114.kind = 36;
NTI8114.base = 0;
NTI8114.flags = 3;
NTI153.size = sizeof(void*);
NTI153.kind = 26;
NTI153.base = 0;
NTI153.flags = 3;
NTI8211.size = sizeof(int);
NTI8211.kind = 34;
NTI8211.base = 0;
NTI8211.flags = 3;
NTI120.size = sizeof(NU8);
NTI120.kind = 41;
NTI120.base = 0;
NTI120.flags = 3;
NTI4013.size = sizeof(TNimObject*);
NTI4013.kind = 22;
NTI4013.base = (&NTI4011);
NTI4013.marker = TMP913;
NTI4063.size = sizeof(Reraiseerror4063);
NTI4063.kind = 17;
NTI4063.base = (&NTI4027);
TMP0[12].len = 0; TMP0[12].kind = 2;
NTI4063.node = &TMP0[12];
NTI22627.size = sizeof(Reraiseerror4063*);
NTI22627.kind = 22;
NTI22627.base = (&NTI4063);
NTI22627.marker = TMP1056;
NTI30821.size = sizeof(TY30821);
NTI30821.kind = 16;
NTI30821.base = (&NTI108);
NTI30821.flags = 3;
NTI4007.size = sizeof(NI);
NTI4007.kind = 20;
NTI4007.base = (&NTI108);
NTI4007.flags = 3;
NTI128.size = sizeof(NF);
NTI128.kind = 36;
NTI128.base = 0;
NTI128.flags = 3;
NTI16402.size = sizeof(void*);
NTI16402.kind = 18;
NTI16402.base = 0;
NTI16402.flags = 3;
TMP0[13].len = 0; TMP0[13].kind = 2;
NTI16402.node = &TMP0[13];
NTI16404.size = sizeof(FILE*);
NTI16404.kind = 21;
NTI16404.base = (&NTI16402);
NTI16404.flags = 3;
NTI110.size = sizeof(NI8);
NTI110.kind = 32;
NTI110.base = 0;
NTI110.flags = 3;
NTI4033.size = sizeof(Oserror4033);
NTI4033.kind = 17;
NTI4033.base = (&NTI4029);
TMP0[14].kind = 1;
TMP0[14].offset = offsetof(Oserror4033, errorcode);
TMP0[14].typ = (&NTI114);
TMP0[14].name = "errorCode";
NTI4033.node = &TMP0[14];
NTI126013.size = sizeof(Oserror4033*);
NTI126013.kind = 22;
NTI126013.base = (&NTI4033);
NTI126013.marker = TMP1189;
NTI4051.size = sizeof(Keyerror4051);
NTI4051.kind = 17;
NTI4051.base = (&NTI4049);
TMP0[15].len = 0; TMP0[15].kind = 2;
NTI4051.node = &TMP0[15];
NTI190004.size = sizeof(Keyerror4051*);
NTI190004.kind = 22;
NTI190004.base = (&NTI4051);
NTI190004.marker = TMP1192;
NTI4055.size = sizeof(Indexerror4055);
NTI4055.kind = 17;
NTI4055.base = (&NTI4027);
TMP0[16].len = 0; TMP0[16].kind = 2;
NTI4055.node = &TMP0[16];
NTI136021.size = sizeof(Indexerror4055*);
NTI136021.kind = 22;
NTI136021.base = (&NTI4055);
NTI136021.marker = TMP1195;
NTI4059.size = sizeof(Rangeerror4059);
NTI4059.kind = 17;
NTI4059.base = (&NTI4027);
TMP0[17].len = 0; TMP0[17].kind = 2;
NTI4059.node = &TMP0[17];
NTI124.size = sizeof(NU32);
NTI124.kind = 43;
NTI124.base = 0;
NTI124.flags = 3;
NTI4047.size = sizeof(Assertionerror4047);
NTI4047.kind = 17;
NTI4047.base = (&NTI4027);
TMP0[18].len = 0; TMP0[18].kind = 2;
NTI4047.node = &TMP0[18];
NTI90983.size = sizeof(Assertionerror4047*);
NTI90983.kind = 22;
NTI90983.base = (&NTI4047);
NTI90983.marker = TMP2268;
NTI147.size = sizeof(NIM_CHAR);
NTI147.kind = 2;
NTI147.base = 0;
NTI147.flags = 3;
NTI16408.size = sizeof(int);
NTI16408.kind = 34;
NTI16408.base = 0;
NTI16408.flags = 3;
NTI4041.size = sizeof(Divbyzeroerror4041);
NTI4041.kind = 17;
NTI4041.base = (&NTI4039);
TMP0[19].len = 0; TMP0[19].kind = 2;
NTI4041.node = &TMP0[19];
NTI569225.size = sizeof(TY569225*);
NTI569225.kind = 24;
NTI569225.base = (&NTI8211);
NTI569225.flags = 2;
NTI569225.marker = TMP5268;
}

