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

#include "nimbase.h"
#include <string.h>
#include <stdio.h>
typedef struct Tlinkedlist135016 Tlinkedlist135016;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tlistentry135010 Tlistentry135010;
typedef struct Tpass260014 Tpass260014;
typedef struct Tpasscontext260002 Tpasscontext260002;
typedef struct Tsym213822 Tsym213822;
typedef struct Trodreader251021 Trodreader251021;
typedef struct Tnode213790 Tnode213790;
typedef struct Cell47705 Cell47705;
typedef struct TNimType TNimType;
typedef struct Cellseq47721 Cellseq47721;
typedef struct Gcheap50018 Gcheap50018;
typedef struct Gcstack50016 Gcstack50016;
typedef struct Cellset47717 Cellset47717;
typedef struct Pagedesc47713 Pagedesc47713;
typedef struct Memregion29887 Memregion29887;
typedef struct Smallchunk29839 Smallchunk29839;
typedef struct Llchunk29881 Llchunk29881;
typedef struct Bigchunk29841 Bigchunk29841;
typedef struct Intset29814 Intset29814;
typedef struct Trunk29810 Trunk29810;
typedef struct Avlnode29885 Avlnode29885;
typedef struct Gcstat50014 Gcstat50014;
typedef struct TY530042 TY530042;
typedef struct Tmoduleinmemory530008 Tmoduleinmemory530008;
typedef struct TY213913 TY213913;
typedef struct Jsonnodeobj305633 Jsonnodeobj305633;
typedef struct Stringtableobj140209 Stringtableobj140209;
typedef struct TNimObject TNimObject;
typedef struct TNimNode TNimNode;
typedef struct Keyvaluepairseq140207 Keyvaluepairseq140207;
typedef struct Keyvaluepair140205 Keyvaluepair140205;
typedef struct TY305648 TY305648;
typedef struct TY305653 TY305653;
typedef struct Tstrentry135012 Tstrentry135012;
typedef struct TY306043 TY306043;
typedef struct Tllstream201204 Tllstream201204;
typedef struct Tlexer204173 Tlexer204173;
typedef struct Tbaselexer202015 Tbaselexer202015;
typedef struct Tlineinfo181337 Tlineinfo181337;
typedef struct Ttoken204169 Ttoken204169;
typedef struct Tident188012 Tident188012;
typedef struct TY125402 TY125402;
typedef struct Tidobj188006 Tidobj188006;
typedef struct Ttypeseq213824 Ttypeseq213824;
typedef struct Tscope213816 Tscope213816;
typedef struct TY213925 TY213925;
typedef struct Tstrtable213794 Tstrtable213794;
typedef struct Tsymseq213792 Tsymseq213792;
typedef struct Ttype213828 Ttype213828;
typedef struct Tloc213804 Tloc213804;
typedef struct Ropeobj168006 Ropeobj168006;
typedef struct Tlib213808 Tlib213808;
typedef struct Tindex251019 Tindex251019;
typedef struct Tiitable220163 Tiitable220163;
typedef struct Tiipairseq220161 Tiipairseq220161;
typedef struct Table251054 Table251054;
typedef struct Keyvaluepairseq251057 Keyvaluepairseq251057;
typedef struct Memfile249202 Memfile249202;
typedef struct Tnodeseq213784 Tnodeseq213784;
typedef struct Basechunk29837 Basechunk29837;
typedef struct Freecell29829 Freecell29829;
typedef struct Tinstantiation213812 Tinstantiation213812;
typedef struct Tiipair220159 Tiipair220159;
typedef struct Keyvaluepair251060 Keyvaluepair251060;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tlinkedlist135016  {
Tlistentry135010* head;
Tlistentry135010* tail;
NI counter;
};
typedef N_NIMCALL_PTR(Tpasscontext260002*, Tpassopen260006) (Tsym213822* module);
typedef N_NIMCALL_PTR(Tpasscontext260002*, Tpassopencached260008) (Tsym213822* module, Trodreader251021* rd);
typedef N_NIMCALL_PTR(Tnode213790*, Tpassprocess260012) (Tpasscontext260002* p, Tnode213790* toplevelstmt);
typedef N_NIMCALL_PTR(Tnode213790*, Tpassclose260010) (Tpasscontext260002* p, Tnode213790* n);
struct Tpass260014 {
Tpassopen260006 Field0;
Tpassopencached260008 Field1;
Tpassprocess260012 Field2;
Tpassclose260010 Field3;
};
struct  Cell47705  {
NI refcount;
TNimType* typ;
};
struct  Cellseq47721  {
NI len;
NI cap;
Cell47705** d;
};
struct  Cellset47717  {
NI counter;
NI max;
Pagedesc47713* head;
Pagedesc47713** data;
};
typedef Smallchunk29839* TY29902[512];
typedef Trunk29810* Trunkbuckets29812[256];
struct  Intset29814  {
Trunkbuckets29812 data;
};
struct  Memregion29887  {
NI minlargeobj;
NI maxlargeobj;
TY29902 freesmallchunks;
Llchunk29881* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk29841* freechunkslist;
Intset29814 chunkstarts;
Avlnode29885* root;
Avlnode29885* deleted;
Avlnode29885* last;
Avlnode29885* freeavlnodes;
};
struct  Gcstat50014  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap50018  {
Gcstack50016* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq47721 zct;
Cellseq47721 decstack;
Cellset47717 cycleroots;
Cellseq47721 tempstack;
NI recgclock;
Memregion29887 region;
Gcstat50014 stat;
};
typedef NU8 Sha1digest191003[20];
struct  Tmoduleinmemory530008  {
NF compiledat;
Sha1digest191003 hash;
TY213913* deps;
NU8 needsrecompile;
NU8 hashstatus;
};
typedef N_NIMCALL_PTR(void, TY3489) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3494) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3489 marker;
TY3494 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Stringtableobj140209  {
  TNimObject Sup;
NI counter;
Keyvaluepairseq140207* data;
NU8 mode;
};
struct Keyvaluepair140205 {
NimStringDesc* Field0;
NimStringDesc* Field1;
};
struct  Jsonnodeobj305633  {
NU8 kind;
union{
struct {NimStringDesc* str;
} S1;
struct {NI64 num;
} S2;
struct {NF fnum;
} S3;
struct {NIM_BOOL bval;
} S4;
struct {TY305648* fields;
} S6;
struct {TY305653* elems;
} S7;
} kindU;
};
struct  Tlistentry135010  {
  TNimObject Sup;
Tlistentry135010* prev;
Tlistentry135010* next;
};
struct  Tstrentry135012  {
  Tlistentry135010 Sup;
NimStringDesc* data;
};
struct TY306043 {
NimStringDesc* Field0;
Jsonnodeobj305633* Field1;
};
typedef TY306043 TY532027[4];
struct  Tbaselexer202015  {
  TNimObject Sup;
NI bufpos;
NCSTRING buf;
NI buflen;
Tllstream201204* stream;
NI linenumber;
NI sentinel;
NI linestart;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (Tlineinfo181337 info, NU16 msg, NimStringDesc* arg, void* ClEnv);
void* ClEnv;
} Terrorhandler204171;
struct  Tlexer204173  {
  Tbaselexer202015 Sup;
NI32 fileidx;
NI indentahead;
NI currlineindent;
NIM_BOOL strongspaces;
Terrorhandler204171 errorhandler;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Ttoken204169  {
NU8 toktype;
NI indent;
Tident188012* ident;
NI64 inumber;
NF fnumber;
NU8 base;
NI8 strongspacea;
NI8 strongspaceb;
NimStringDesc* literal;
NI line;
NI col;
};
struct  Tidobj188006  {
  TNimObject Sup;
NI id;
};
struct  Tstrtable213794  {
NI counter;
Tsymseq213792* data;
};
struct  Tlineinfo181337  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tloc213804  {
NU8 k;
NU8 s;
NU16 flags;
Ttype213828* t;
Ropeobj168006* r;
Ropeobj168006* heaproot;
};
struct  Tsym213822  {
  Tidobj188006 Sup;
NU8 kind;
union{
struct {Ttypeseq213824* typeinstcache;
Tscope213816* typscope;
} S1;
struct {TY213925* procinstcache;
Tsym213822* gcunsafetyreason;
} S2;
struct {TY213925* usedgenerics;
Tstrtable213794 tab;
} S3;
struct {Tsym213822* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype213828* typ;
Tident188012* name;
Tlineinfo181337 info;
Tsym213822* owner;
NU32 flags;
Tnode213790* ast;
NU32 options;
NI position;
NI offset;
Tloc213804 loc;
Tlib213808* annex;
Tnode213790* constraint;
};
typedef Tpass260014 TY531229[3];
typedef Tident188012* TY188023[8192];
typedef N_NIMCALL_PTR(void, TY529238) (void);
typedef NimStringDesc* TY184781[4];
struct  Tpasscontext260002  {
  TNimObject Sup;
NIM_BOOL fromcache;
};
struct  Tiitable220163  {
NI counter;
Tiipairseq220161* data;
};
struct  Tindex251019  {
NI lastidxkey;
NI lastidxval;
Tiitable220163 tab;
NimStringDesc* r;
NI offset;
};
struct  Table251054  {
Keyvaluepairseq251057* data;
NI counter;
};
struct  Memfile249202  {
void* mem;
NI size;
int handle;
};
struct  Trodreader251021  {
  TNimObject Sup;
NI pos;
NCSTRING s;
NU32 options;
NU8 reason;
TY213913* moddeps;
TY213913* files;
NI dataidx;
NI convertersidx;
NI initidx;
NI interfidx;
NI compilerprocsidx;
NI methodsidx;
NimStringDesc* filename;
Tindex251019 index;
Tindex251019 imports;
NI readerindex;
NI line;
NI moduleid;
Table251054 syms;
Memfile249202 memfile;
Tsymseq213792* methods;
NimStringDesc* origfile;
NIM_BOOL inviewmode;
};
struct  Tnode213790  {
Ttype213828* typ;
Tlineinfo181337 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym213822* sym;
} S4;
struct {Tident188012* ident;
} S5;
struct {Tnodeseq213784* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Gcstack50016  {
Gcstack50016* prev;
Gcstack50016* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY29818[16];
struct  Pagedesc47713  {
Pagedesc47713* next;
NI key;
TY29818 bits;
};
struct  Basechunk29837  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk29839  {
  Basechunk29837 Sup;
Smallchunk29839* next;
Smallchunk29839* prev;
Freecell29829* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk29881  {
NI size;
NI acc;
Llchunk29881* next;
};
struct  Bigchunk29841  {
  Basechunk29837 Sup;
Bigchunk29841* next;
Bigchunk29841* prev;
NI align;
NF data;
};
struct  Trunk29810  {
Trunk29810* next;
NI key;
TY29818 bits;
};
typedef Avlnode29885* TY29892[2];
struct  Avlnode29885  {
TY29892 link;
NI key;
NI upperbound;
NI level;
};
struct  Tllstream201204  {
  TNimObject Sup;
NU8 kind;
FILE* f;
NimStringDesc* s;
NI rd;
NI wr;
NI lineoffset;
};
struct  Tident188012  {
  Tidobj188006 Sup;
NimStringDesc* s;
Tident188012* next;
NI h;
};
struct  Tscope213816  {
NI depthlevel;
Tstrtable213794 symbols;
Tnodeseq213784* usingsyms;
Tscope213816* parent;
};
struct  Ttype213828  {
  Tidobj188006 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq213824* sons;
Tnode213790* n;
Tsym213822* owner;
Tsym213822* sym;
Tsym213822* destructor;
Tsym213822* deepcopy;
Tsym213822* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc213804 loc;
};
struct  Ropeobj168006  {
  TNimObject Sup;
Ropeobj168006* left;
Ropeobj168006* right;
NI length;
NimStringDesc* data;
};
struct  Tlib213808  {
  Tlistentry135010 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj168006* name;
Tnode213790* path;
};
struct  Tiipair220159  {
NI key;
NI val;
};
struct Keyvaluepair251060 {
NI Field0;
NI Field1;
Tsym213822* Field2;
};
struct  Freecell29829  {
Freecell29829* next;
NI zerofield;
};
struct  Tinstantiation213812  {
Tsym213822* sym;
Ttypeseq213824* concretetypes;
TY213913* usedby;
NI compilesid;
};
struct TY530042 {
  TGenericSeq Sup;
  Tmoduleinmemory530008 data[SEQ_DECL_SIZE];
};
struct TY305653 {
  TGenericSeq Sup;
  Jsonnodeobj305633* data[SEQ_DECL_SIZE];
};
struct TY125402 {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct Tsymseq213792 {
  TGenericSeq Sup;
  Tsym213822* data[SEQ_DECL_SIZE];
};
struct TY213913 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq140207 {
  TGenericSeq Sup;
  Keyvaluepair140205 data[SEQ_DECL_SIZE];
};
struct TY305648 {
  TGenericSeq Sup;
  TY306043 data[SEQ_DECL_SIZE];
};
struct Ttypeseq213824 {
  TGenericSeq Sup;
  Ttype213828* data[SEQ_DECL_SIZE];
};
struct TY213925 {
  TGenericSeq Sup;
  Tinstantiation213812* data[SEQ_DECL_SIZE];
};
struct Tiipairseq220161 {
  TGenericSeq Sup;
  Tiipair220159 data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq251057 {
  TGenericSeq Sup;
  Keyvaluepair251060 data[SEQ_DECL_SIZE];
};
struct Tnodeseq213784 {
  TGenericSeq Sup;
  Tnode213790* data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, clearpasses_260143)(void);
N_NIMCALL(NF, ntepochTime)(void);
N_NIMCALL(void, appendstr_135244)(Tlinkedlist135016* list, NimStringDesc* data);
N_NIMCALL(void, prependstr_135413)(Tlinkedlist135016* list, NimStringDesc* data);
static N_INLINE(void, setid_212425)(NI id);
N_NIMCALL(NimStringDesc*, nsuNormalize)(NimStringDesc* s);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(NI, hashString)(NimStringDesc* s);
N_NIMCALL(void, commandcompiletoc_531029)(void);
N_NIMCALL(void, initvars_193834)(void);
N_NIMCALL(void, semanticpasses_531015)(void);
N_NIMCALL(void, registerpass_260145)(Tpass260014 p);
N_NIMCALL(Tpasscontext260002*, verboseopen_512003)(Tsym213822* s);
N_NIMCALL(Tnode213790*, verboseprocess_512008)(Tpasscontext260002* context, Tnode213790* n);
N_NIMCALL(Tpasscontext260002*, myopen_466665)(Tsym213822* module);
N_NIMCALL(Tpasscontext260002*, myopencached_466696)(Tsym213822* module, Trodreader251021* rd);
N_NIMCALL(Tnode213790*, myprocess_466804)(Tpasscontext260002* context, Tnode213790* n);
N_NIMCALL(Tnode213790*, myclose_466814)(Tpasscontext260002* context, Tnode213790* n);
N_NIMCALL(Tpasscontext260002*, myopen_502515)(Tsym213822* module);
N_NIMCALL(Tpasscontext260002*, myopencached_502639)(Tsym213822* module, Trodreader251021* rd);
N_NIMCALL(Tnode213790*, myprocess_502802)(Tpasscontext260002* b, Tnode213790* n);
N_NIMCALL(Tnode213790*, myclose_503230)(Tpasscontext260002* b, Tnode213790* n);
N_NIMCALL(void, rodpass_531001)(void);
N_NIMCALL(Tpasscontext260002*, myopen_272919)(Tsym213822* module);
N_NIMCALL(Tnode213790*, process_272699)(Tpasscontext260002* c, Tnode213790* n);
N_NIMCALL(Tnode213790*, myclose_272929)(Tpasscontext260002* c, Tnode213790* n);
N_NIMCALL(void, compileproject_530877)(NI32 projectfileidx);
N_NIMCALL(void, cgenwritemodules_503292)(void);
N_NIMCALL(void, callccompiler_194510)(NimStringDesc* projectfile);
N_NIMCALL(NimStringDesc*, noschangeFileExt)(NimStringDesc* filename, NimStringDesc* ext);
N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(Cell47705*, usrtocell_51640)(void* usr);
static N_INLINE(void, rtladdzct_53201)(Cell47705* c);
N_NOINLINE(void, addzct_51617)(Cellseq47721* s, Cell47705* c);
N_NIMCALL(void, resetcgenmodules_502424)(void);
N_NIMCALL(void, resetcompilationlists_193867)(void);
N_NIMCALL(void, resetcaches_467424)(void);
N_NIMCALL(void, Gcfullcollect_9805)(void);
N_NIMCALL(void, definesymbol_189004)(NimStringDesc* symbol);
N_NIMCALL(void, rawmessage_184612)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, commandcompiletojs_531074)(void);
N_NIMCALL(void, settarget_166623)(NU8 o, NU8 c);
N_NIMCALL(Tpasscontext260002*, myopen_511130)(Tsym213822* s);
N_NIMCALL(Tpasscontext260002*, myopencached_511125)(Tsym213822* s, Trodreader251021* rd);
N_NIMCALL(Tnode213790*, myprocess_511028)(Tpasscontext260002* b, Tnode213790* n);
N_NIMCALL(Tnode213790*, myclose_511102)(Tpasscontext260002* b, Tnode213790* n);
N_NIMCALL(void, wantmainmodule_530871)(void);
N_NIMCALL(void, loadconfigs_209603)(NimStringDesc* cfg);
N_NIMCALL(void, commanddoc_360714)(void);
N_NIMCALL(void, commanddoc2_531024)(void);
N_NIMCALL(Tpasscontext260002*, myopen_514048)(Tsym213822* module);
N_NIMCALL(Tnode213790*, processnode_514042)(Tpasscontext260002* c, Tnode213790* n);
N_NIMCALL(Tnode213790*, close_514009)(Tpasscontext260002* p, Tnode213790* n);
N_NIMCALL(void, finishdoc2pass_514069)(NimStringDesc* project);
N_NIMCALL(void, commandrst2html_360742)(void);
N_NIMCALL(void, commandrst2tex_360744)(void);
N_NIMCALL(void, commandjson_360746)(void);
N_NIMCALL(void, commandbuildindex_360776)(void);
N_NIMCALL(void, commandgendepend_531017)(void);
N_NIMCALL(Tpasscontext260002*, myopen_513078)(Tsym213822* module);
N_NIMCALL(Tnode213790*, adddotdependency_513020)(Tpasscontext260002* c, Tnode213790* n);
N_NIMCALL(Tnode213790*, cleanup_512036)(Tpasscontext260002* c, Tnode213790* n);
N_NIMCALL(void, generatedot_513003)(NimStringDesc* project);
N_NIMCALL(void, execexternalprogram_193881)(NimStringDesc* cmd, NU16 msg);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
static N_INLINE(void, appendChar)(NimStringDesc* dest, NIM_CHAR c);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(NimStringDesc*, getconfigvar_159282)(NimStringDesc* key);
N_NIMCALL(Jsonnodeobj305633*, newjarray_305781)(void);
N_NIMCALL(Jsonnodeobj305633*, HEX25_305988)(NimStringDesc* s);
N_NIMCALL(TGenericSeq*, incrSeqV2)(TGenericSeq* seq, NI elemsize);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(Jsonnodeobj305633*, HEX25_306040)(TY306043* keyvals, NI keyvalsLen0);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(void, msgwriteln_182449)(NimStringDesc* s, NU8 flags);
N_NIMCALL(NimStringDesc*, HEX24_309805)(Jsonnodeobj305633* node);
N_NIMCALL(void, commandcheck_531019)(void);
N_NIMCALL(Tnode213790*, parsefile_237029)(NI32 fileidx);
N_NIMCALL(void, commandscan_531251)(void);
N_NIMCALL(NimStringDesc*, nosaddFileExt)(NimStringDesc* filename, NimStringDesc* ext);
N_NIMCALL(NimStringDesc*, maincommandarg_159267)(void);
N_NIMCALL(Tllstream201204*, llstreamopen_201241)(NimStringDesc* filename, NU8 mode);
N_NIMCALL(void, inittoken_204306)(Ttoken204169* L);
N_NIMCALL(void, openlexer_204329)(Tlexer204173* lex, NimStringDesc* filename, Tllstream201204* inputstream);
N_NIMCALL(void, rawgettok_207824)(Tlexer204173* L, Ttoken204169* tok);
N_NIMCALL(void, printtok_204301)(Ttoken204169* tok);
N_NIMCALL(void, closelexer_204335)(Tlexer204173* lex);
N_NIMCALL(void, commandinteractive_531201)(void);
N_NIMCALL(void, interactivepasses_531076)(void);
N_NIMCALL(void, initdefines_189184)(void);
N_NIMCALL(Tpasscontext260002*, myopen_413030)(Tsym213822* module);
N_NIMCALL(Tnode213790*, myprocess_413203)(Tpasscontext260002* c, Tnode213790* n);
N_NIMCALL(void, compilesystemmodule_530856)(void);
N_NIMCALL(Tsym213822*, compilemodule_530695)(NI32 fileidx, NU32 flags);
N_NIMCALL(NI32, fileinfoidx_182017)(NimStringDesc* filename);
N_NIMCALL(Tsym213822*, makestdinmodule_530889)(void);
N_NIMCALL(void, processmodule_260044)(Tsym213822* module, Tllstream201204* stream, Trodreader251021* rd);
N_NIMCALL(Tllstream201204*, llstreamopenstdin_201266)(void);
N_NIMCALL(void, commandeval_531235)(NimStringDesc* exp);
N_NIMCALL(void, evalnim_531231)(Tnode213790* nodes, Tsym213822* module);
N_NIMCALL(void, carrypasses_260174)(Tnode213790* nodes, Tsym213822* module, Tpass260014* passes, NI passesLen0);
N_NIMCALL(Tnode213790*, parsestring_230536)(NimStringDesc* s, NimStringDesc* filename, NI line, Terrorhandler204171 errorhandler);
N_NIMCALL(void, resetmemory_531293)(void);
N_NIMCALL(void, resetallmodules_530320)(void);
N_NIMCALL(void, resetropecache_168075)(void);
N_NIMCALL(void, resetsystypes_257199)(void);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
N_NIMCALL(void, commandsuggest_531286)(void);
N_NIMCALL(void, resetmodule_530258)(NI32 fileidx);
N_NIMCALL(void, serve_529236)(TY529238 action);
N_NIMCALL(void, maincommand_531610)(void);
N_NIMCALL(void, rawmessage_183645)(NU16 msg, NimStringDesc** args, NI argsLen0);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
N_NIMCALL(NimStringDesc*, nsuformatFloat)(NF f, NU8 format, NI precision, NIM_CHAR decimalsep);
N_NIMCALL(NimStringDesc*, formatsize_102497)(NI64 bytes, NIM_CHAR decimalsep);
N_NIMCALL(NI, gettotalmem_8059)(void);
N_NIMCALL(NIM_BOOL, isdefined_189010)(NimStringDesc* symbol);
N_NIMCALL(void, resetattributes_184618)(void);
STRING_LITERAL(TMP3719, "c", 1);
STRING_LITERAL(TMP3720, "cc", 2);
STRING_LITERAL(TMP3721, "compile", 7);
STRING_LITERAL(TMP3722, "compiletoc", 10);
STRING_LITERAL(TMP3723, "cpp", 3);
STRING_LITERAL(TMP3724, "compiletocpp", 12);
STRING_LITERAL(TMP3725, "objc", 4);
STRING_LITERAL(TMP3726, "compiletooc", 11);
STRING_LITERAL(TMP3727, "run", 3);
STRING_LITERAL(TMP3728, "js", 2);
STRING_LITERAL(TMP3729, "compiletojs", 11);
STRING_LITERAL(TMP3730, "doc", 3);
STRING_LITERAL(TMP3731, "doc2", 4);
STRING_LITERAL(TMP3732, "rst2html", 8);
STRING_LITERAL(TMP3733, "rst2tex", 7);
STRING_LITERAL(TMP3734, "jsondoc", 7);
STRING_LITERAL(TMP3735, "buildindex", 10);
STRING_LITERAL(TMP3736, "gendepend", 9);
STRING_LITERAL(TMP3737, "dump", 4);
STRING_LITERAL(TMP3738, "check", 5);
STRING_LITERAL(TMP3739, "parse", 5);
STRING_LITERAL(TMP3740, "scan", 4);
STRING_LITERAL(TMP3741, "secret", 6);
STRING_LITERAL(TMP3742, "e", 1);
STRING_LITERAL(TMP3743, "reset", 5);
STRING_LITERAL(TMP3744, "idetools", 8);
STRING_LITERAL(TMP3745, "serve", 5);
STRING_LITERAL(TMP3746, "nop", 3);
STRING_LITERAL(TMP3747, "help", 4);
STRING_LITERAL(TMP4628, "", 0);
STRING_LITERAL(TMP4629, "nimrod", 6);
STRING_LITERAL(TMP4630, "ecmascript", 10);
STRING_LITERAL(TMP5025, "nimdoc.cfg", 10);
STRING_LITERAL(TMP5156, "nimdoc", 6);
STRING_LITERAL(TMP5162, "nimdoc.tex.cfg", 14);
STRING_LITERAL(TMP5232, "dot -Tpng -o", 12);
STRING_LITERAL(TMP5233, "png", 3);
STRING_LITERAL(TMP5234, "dot", 3);
STRING_LITERAL(TMP5235, "dump.format", 11);
STRING_LITERAL(TMP5236, "json", 4);
STRING_LITERAL(TMP5237, "false", 5);
STRING_LITERAL(TMP5238, "version", 7);
STRING_LITERAL(TMP5239, "0.13.0", 6);
STRING_LITERAL(TMP5240, "project_path", 12);
STRING_LITERAL(TMP5241, "defined_symbols", 15);
STRING_LITERAL(TMP5242, "lib_paths", 9);
STRING_LITERAL(TMP5245, "-- list of currently defined symbols --", 39);
STRING_LITERAL(TMP5246, "-- end of list --", 17);
STRING_LITERAL(TMP5247, "nim", 3);
STRING_LITERAL(TMP5250, "Beware: Indentation tokens depend on the parser\'s state!", 56);
STRING_LITERAL(TMP5251, "nimscript", 9);
STRING_LITERAL(TMP5253, "echo \"eval\\t\", repr(", 20);
STRING_LITERAL(TMP5254, ")", 1);
static NIM_CONST Terrorhandler204171 TMP5255 = {NIM_NIL,NIM_NIL};
STRING_LITERAL(TMP5292, "release", 7);
STRING_LITERAL(TMP5293, "Release Build", 13);
STRING_LITERAL(TMP5294, "Debug Build", 11);
extern NF glastcmdtime_159134;
extern Tlinkedlist135016 searchpaths_159125;
extern NimStringDesc* libpath_159198;
extern NimStringDesc* gprojectfull_159201;
extern NimStringDesc* gprojectpath_159200;
extern NI gfrontendid_212003;
extern NimStringDesc* command_159205;
extern NU8 gcmd_159123;
extern NU32 gglobaloptions_159121;
extern NIM_BOOL isserving_159136;
extern NimStringDesc* lastcaascmd_529202;
extern NimStringDesc* curcaascmd_529201;
extern Gcheap50018 gch_50059;
extern TY530042* gmemcachedata_530059;
extern NI gerrormax_182084;
extern NimStringDesc* gprojectname_159199;
extern Stringtableobj140209* gsymbols_189001;
extern NI32 gprojectmainidx_159203;
extern TNimType NTI204173; /* TLexer */
extern TY125402* commandargs_159223;
extern Tsym213822* systemmodule_257007;
extern Tsymseq213792* gowners_263234;
extern TNimType NTI213792; /* TSymSeq */
extern TY188023 buckets_188024;
extern Tident188012* idanon_188455;
extern NimStringDesc* gevalexpr_159133;
extern Tlineinfo181337 gtrackpos_182441;
extern NI gerrorcounter_182081;
extern NI glinescompiled_204198;

static N_INLINE(void, setid_212425)(NI id) {
	gfrontendid_212003 = ((gfrontendid_212003 >= (NI)(id + ((NI) 1))) ? gfrontendid_212003 : (NI)(id + ((NI) 1)));
}

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(void, semanticpasses_531015)(void) {
	Tpass260014 LOC1;
	Tpass260014 LOC2;
	LOC1.Field0 = verboseopen_512003;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = verboseprocess_512008;
	LOC1.Field3 = NIM_NIL;
	registerpass_260145(LOC1);
	LOC2.Field0 = myopen_466665;
	LOC2.Field1 = myopencached_466696;
	LOC2.Field2 = myprocess_466804;
	LOC2.Field3 = myclose_466814;
	registerpass_260145(LOC2);
}

N_NIMCALL(void, rodpass_531001)(void) {
	{
		Tpass260014 LOC5;
		if (!((gglobaloptions_159121 &(1U<<((NU)(((NU8) 14))&31U)))!=0)) goto LA3;
		LOC5.Field0 = myopen_272919;
		LOC5.Field1 = NIM_NIL;
		LOC5.Field2 = process_272699;
		LOC5.Field3 = myclose_272929;
		registerpass_260145(LOC5);
	}
	LA3: ;
}

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

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

static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
	Cell47705* c;
	c = usrtocell_51640(p);
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA3;
		rtladdzct_53201(c);
	}
	LA3: ;
}

N_NIMCALL(void, commandcompiletoc_531029)(void) {
	Tpass260014 LOC1;
	initvars_193834();
	semanticpasses_531015();
	LOC1.Field0 = myopen_502515;
	LOC1.Field1 = myopencached_502639;
	LOC1.Field2 = myprocess_502802;
	LOC1.Field3 = myclose_503230;
	registerpass_260145(LOC1);
	rodpass_531001();
	compileproject_530877(((NI32) -1));
	cgenwritemodules_503292();
	{
		NimStringDesc* LOC6;
		if (!!((gcmd_159123 == ((NU8) 19)))) goto LA4;
		LOC6 = 0;
		LOC6 = noschangeFileExt(gprojectfull_159201, ((NimStringDesc*) &TMP4628));
		callccompiler_194510(LOC6);
	}
	LA4: ;
	{
		NimStringDesc* LOC11;
		if (!isserving_159136) goto LA9;
		LOC11 = 0;
		LOC11 = lastcaascmd_529202; lastcaascmd_529202 = copyStringRC1(curcaascmd_529201);
		if (LOC11) nimGCunrefNoCycle(LOC11);
		resetcgenmodules_502424();
		{
			NI i_531065;
			NI HEX3Atmp_531067;
			NI res_531070;
			i_531065 = 0;
			HEX3Atmp_531067 = 0;
			HEX3Atmp_531067 = ((gmemcachedata_530059 ? gmemcachedata_530059->Sup.len : 0) - 1);
			res_531070 = ((NI) 0);
			{
				while (1) {
					if (!(res_531070 <= HEX3Atmp_531067)) goto LA14;
					i_531065 = res_531070;
					gmemcachedata_530059->data[i_531065].hashstatus = ((NU8) 1);
					gmemcachedata_530059->data[i_531065].needsrecompile = ((NU8) 0);
					res_531070 += ((NI) 1);
				} LA14: ;
			}
		}
		resetcompilationlists_193867();
		resetcaches_467424();
		Gcfullcollect_9805();
	}
	LA9: ;
}

N_NIMCALL(void, commandcompiletojs_531074)(void) {
	Tpass260014 LOC1;
	settarget_166623(((NU8) 22), ((NU8) 15));
	definesymbol_189004(((NimStringDesc*) &TMP4629));
	definesymbol_189004(((NimStringDesc*) &TMP4630));
	definesymbol_189004(((NimStringDesc*) &TMP3728));
	semanticpasses_531015();
	LOC1.Field0 = myopen_511130;
	LOC1.Field1 = myopencached_511125;
	LOC1.Field2 = myprocess_511028;
	LOC1.Field3 = myclose_511102;
	registerpass_260145(LOC1);
	compileproject_530877(((NI32) -1));
}

N_NIMCALL(void, commanddoc2_531024)(void) {
	Tpass260014 LOC1;
	gerrormax_182084 = ((NI) 2147483647);
	semanticpasses_531015();
	LOC1.Field0 = myopen_514048;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = processnode_514042;
	LOC1.Field3 = close_514009;
	registerpass_260145(LOC1);
	compileproject_530877(((NI32) -1));
	finishdoc2pass_514069(gprojectname_159199);
}

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, appendChar)(NimStringDesc* dest, NIM_CHAR c) {
	(*dest).data[((*dest).Sup.len)- 0] = c;
	(*dest).data[((NI)((*dest).Sup.len + ((NI) 1)))- 0] = 0;
	(*dest).Sup.len += ((NI) 1);
}

N_NIMCALL(void, commandgendepend_531017)(void) {
	Tpass260014 LOC1;
	Tpass260014 LOC2;
	NimStringDesc* LOC3;
	NimStringDesc* LOC4;
	NimStringDesc* LOC5;
	semanticpasses_531015();
	LOC1.Field0 = myopen_513078;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = adddotdependency_513020;
	LOC1.Field3 = NIM_NIL;
	registerpass_260145(LOC1);
	LOC2.Field0 = NIM_NIL;
	LOC2.Field1 = NIM_NIL;
	LOC2.Field2 = cleanup_512036;
	LOC2.Field3 = cleanup_512036;
	registerpass_260145(LOC2);
	compileproject_530877(((NI32) -1));
	generatedot_513003(gprojectfull_159201);
	LOC3 = 0;
	LOC4 = 0;
	LOC4 = noschangeFileExt(gprojectfull_159201, ((NimStringDesc*) &TMP5233));
	LOC5 = 0;
	LOC5 = noschangeFileExt(gprojectfull_159201, ((NimStringDesc*) &TMP5234));
	LOC3 = rawNewString(LOC4->Sup.len + LOC5->Sup.len + 13);
appendString(LOC3, ((NimStringDesc*) &TMP5232));
appendString(LOC3, LOC4);
appendChar(LOC3, 32);
appendString(LOC3, LOC5);
	execexternalprogram_193881(LOC3, ((NU16) 284));
}

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

N_NIMCALL(void, commandcheck_531019)(void) {
	gerrormax_182084 = ((NI) 2147483647);
	semanticpasses_531015();
	rodpass_531001();
	compileproject_530877(((NI32) -1));
}

N_NIMCALL(void, commandscan_531251)(void) {
	NimStringDesc* f;
	NimStringDesc* LOC1;
	Tllstream201204* stream;
	LOC1 = 0;
	LOC1 = maincommandarg_159267();
	f = nosaddFileExt(LOC1, ((NimStringDesc*) &TMP5247));
	stream = llstreamopen_201241(f, ((NU8) 0));
	{
		Tlexer204173 L;
		Ttoken204169 tok;
		if (!!((stream == NIM_NIL))) goto LA4;
		memset((void*)(&L), 0, sizeof(L));
		L.Sup.Sup.m_type = (&NTI204173);
		memset((void*)(&tok), 0, sizeof(tok));
		inittoken_204306((&tok));
		openlexer_204329((&L), f, stream);
		{
			while (1) {
				rawgettok_207824((&L), (&tok));
				printtok_204301((&tok));
				{
					if (!(tok.toktype == ((NU8) 1))) goto LA10;
					goto LA6;
				}
				LA10: ;
			}
		} LA6: ;
		closelexer_204335((&L));
	}
	goto LA2;
	LA4: ;
	{
		rawmessage_184612(((NU16) 3), f);
	}
	LA2: ;
}

N_NIMCALL(void, interactivepasses_531076)(void) {
	Tpass260014 LOC1;
	Tpass260014 LOC2;
	Tpass260014 LOC3;
	initdefines_189184();
	definesymbol_189004(((NimStringDesc*) &TMP5251));
	LOC1.Field0 = verboseopen_512003;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = verboseprocess_512008;
	LOC1.Field3 = NIM_NIL;
	registerpass_260145(LOC1);
	LOC2.Field0 = myopen_466665;
	LOC2.Field1 = myopencached_466696;
	LOC2.Field2 = myprocess_466804;
	LOC2.Field3 = myclose_466814;
	registerpass_260145(LOC2);
	LOC3.Field0 = myopen_413030;
	LOC3.Field1 = NIM_NIL;
	LOC3.Field2 = myprocess_413203;
	LOC3.Field3 = myprocess_413203;
	registerpass_260145(LOC3);
}

N_NIMCALL(void, commandinteractive_531201)(void) {
	gerrormax_182084 = ((NI) 2147483647);
	interactivepasses_531076();
	compilesystemmodule_530856();
	{
		NI32 LOC5;
		Tsym213822* LOC6;
		if (!(((NI) 0) < (commandargs_159223 ? commandargs_159223->Sup.len : 0))) goto LA3;
		LOC5 = 0;
		LOC5 = fileinfoidx_182017(gprojectfull_159201);
		LOC6 = 0;
		LOC6 = compilemodule_530695(LOC5, 0);
	}
	goto LA1;
	LA3: ;
	{
		Tsym213822* m;
		Tllstream201204* LOC8;
		m = makestdinmodule_530889();
		(*m).flags |= ((NU32)1)<<((((NU8) 12))%(sizeof(NU32)*8));
		LOC8 = 0;
		LOC8 = llstreamopenstdin_201266();
		processmodule_260044(m, LOC8, NIM_NIL);
	}
	LA1: ;
}

N_NIMCALL(void, evalnim_531231)(Tnode213790* nodes, Tsym213822* module) {
	TY531229 LOC1;
	LOC1[0].Field0 = verboseopen_512003;
	LOC1[0].Field1 = NIM_NIL;
	LOC1[0].Field2 = verboseprocess_512008;
	LOC1[0].Field3 = NIM_NIL;
	LOC1[1].Field0 = myopen_466665;
	LOC1[1].Field1 = myopencached_466696;
	LOC1[1].Field2 = myprocess_466804;
	LOC1[1].Field3 = myclose_466814;
	LOC1[2].Field0 = myopen_413030;
	LOC1[2].Field1 = NIM_NIL;
	LOC1[2].Field2 = myprocess_413203;
	LOC1[2].Field3 = myprocess_413203;
	carrypasses_260174(nodes, module, LOC1, 3);
}

N_NIMCALL(void, commandeval_531235)(NimStringDesc* exp) {
	NimStringDesc* echoexp;
	NimStringDesc* LOC5;
	Tnode213790* LOC6;
	Tsym213822* LOC7;
	{
		if (!(systemmodule_257007 == NIM_NIL)) goto LA3;
		interactivepasses_531076();
		compilesystemmodule_530856();
	}
	LA3: ;
	LOC5 = 0;
	LOC5 = rawNewString(exp->Sup.len + 21);
appendString(LOC5, ((NimStringDesc*) &TMP5253));
appendString(LOC5, exp);
appendString(LOC5, ((NimStringDesc*) &TMP5254));
	echoexp = LOC5;
	LOC6 = 0;
	LOC6 = parsestring_230536(echoexp, ((NimStringDesc*) &TMP4628), ((NI) 0), TMP5255);
	LOC7 = 0;
	LOC7 = makestdinmodule_530889();
	evalnim_531231(LOC6, LOC7);
}

N_NIMCALL(void, resetmemory_531293)(void) {
	resetcompilationlists_193867();
	resetcaches_467424();
	resetallmodules_530320();
	resetropecache_168075();
	resetsystypes_257199();
	if (gowners_263234) nimGCunrefNoCycle(gowners_263234);
	gowners_263234 = (Tsymseq213792*) newSeqRC1((&NTI213792), 0);
	{
		NI i_531414;
		NI res_531605;
		i_531414 = 0;
		res_531605 = ((NI) 0);
		{
			while (1) {
				if (!(res_531605 <= ((NI) 8191))) goto LA3;
				i_531414 = ((NI) (res_531605));
				asgnRefNoCycle((void**) (&buckets_188024[(i_531414)- 0]), NIM_NIL);
				res_531605 += ((NI) 1);
			} LA3: ;
		}
	}
	asgnRefNoCycle((void**) (&idanon_188455), NIM_NIL);
}

N_NIMCALL(void, commandsuggest_531286)(void) {
	{
		NI32 gdirtybufferidx;
		Tsym213822* LOC5;
		if (!isserving_159136) goto LA3;
		commandcompiletoc_531029();
		gdirtybufferidx = gtrackpos_182441.fileindex;
		LOC5 = 0;
		LOC5 = compilemodule_530695(gdirtybufferidx, 512);
		resetmodule_530258(gdirtybufferidx);
	}
	goto LA1;
	LA3: ;
	{
		gerrormax_182084 = ((NI) 2147483647);
		semanticpasses_531015();
		rodpass_531001();
		compileproject_530877(((NI32) -1));
	}
	LA1: ;
}

N_NIMCALL(void, maincommand_531610)(void) {
	NimStringDesc* LOC5;
	clearpasses_260143();
	glastcmdtime_159134 = ntepochTime();
	appendstr_135244((&searchpaths_159125), libpath_159198);
	{
		if (!!(((gprojectfull_159201 ? gprojectfull_159201->Sup.len : 0) == ((NI) 0)))) goto LA3;
		prependstr_135413((&searchpaths_159125), gprojectpath_159200);
	}
	LA3: ;
	setid_212425(((NI) 100));
	LOC5 = 0;
	LOC5 = nsuNormalize(command_159205);
	switch (hashString(LOC5) & 31) {
	case 0: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3721))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3726))) goto LA8;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3744))) goto LA25;
break;
	case 2: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3737))) goto LA18;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3746))) goto LA27;
break;
	case 4: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3739))) goto LA20;
break;
	case 7: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3732))) goto LA13;
break;
	case 9: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3727))) goto LA9;
break;
	case 10: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3720))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3729))) goto LA10;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3738))) goto LA19;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3743))) goto LA24;
break;
	case 11: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3736))) goto LA17;
break;
	case 12: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3747))) goto LA27;
break;
	case 13: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3730))) goto LA11;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3733))) goto LA14;
break;
	case 14: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3734))) goto LA15;
break;
	case 16: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3722))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3742))) goto LA23;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3745))) goto LA26;
break;
	case 19: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3724))) goto LA7;
break;
	case 21: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3741))) goto LA22;
break;
	case 25: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3719))) goto LA6;
break;
	case 26: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3740))) goto LA21;
break;
	case 27: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3723))) goto LA7;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3728))) goto LA10;
break;
	case 29: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3735))) goto LA16;
break;
	case 31: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3725))) goto LA8;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3731))) goto LA12;
break;
	}
	goto LA28;
	LA6: ;
	{
		gcmd_159123 = ((NU8) 1);
		commandcompiletoc_531029();
	}
	goto LA29;
	LA7: ;
	{
		gcmd_159123 = ((NU8) 2);
		definesymbol_189004(((NimStringDesc*) &TMP3723));
		commandcompiletoc_531029();
	}
	goto LA29;
	LA8: ;
	{
		gcmd_159123 = ((NU8) 3);
		definesymbol_189004(((NimStringDesc*) &TMP3725));
		commandcompiletoc_531029();
	}
	goto LA29;
	LA9: ;
	{
		gcmd_159123 = ((NU8) 19);
		rawmessage_184612(((NU16) 185), command_159205);
	}
	goto LA29;
	LA10: ;
	{
		gcmd_159123 = ((NU8) 4);
		commandcompiletojs_531074();
	}
	goto LA29;
	LA11: ;
	{
		wantmainmodule_530871();
		gcmd_159123 = ((NU8) 8);
		loadconfigs_209603(((NimStringDesc*) &TMP5025));
		commanddoc_360714();
	}
	goto LA29;
	LA12: ;
	{
		gcmd_159123 = ((NU8) 8);
		loadconfigs_209603(((NimStringDesc*) &TMP5025));
		definesymbol_189004(((NimStringDesc*) &TMP5156));
		commanddoc2_531024();
	}
	goto LA29;
	LA13: ;
	{
		gcmd_159123 = ((NU8) 16);
		loadconfigs_209603(((NimStringDesc*) &TMP5025));
		commandrst2html_360742();
	}
	goto LA29;
	LA14: ;
	{
		gcmd_159123 = ((NU8) 17);
		loadconfigs_209603(((NimStringDesc*) &TMP5162));
		commandrst2tex_360744();
	}
	goto LA29;
	LA15: ;
	{
		wantmainmodule_530871();
		gcmd_159123 = ((NU8) 8);
		loadconfigs_209603(((NimStringDesc*) &TMP5025));
		wantmainmodule_530871();
		definesymbol_189004(((NimStringDesc*) &TMP5156));
		commandjson_360746();
	}
	goto LA29;
	LA16: ;
	{
		gcmd_159123 = ((NU8) 8);
		loadconfigs_209603(((NimStringDesc*) &TMP5025));
		commandbuildindex_360776();
	}
	goto LA29;
	LA17: ;
	{
		gcmd_159123 = ((NU8) 9);
		commandgendepend_531017();
	}
	goto LA29;
	LA18: ;
	{
		gcmd_159123 = ((NU8) 10);
		{
			NimStringDesc* LOC45;
			Jsonnodeobj305633* definedsymbols;
			Jsonnodeobj305633* libpaths;
			Jsonnodeobj305633* dumpdata;
			TY532027 LOC66;
			NimStringDesc* LOC67;
			LOC45 = 0;
			LOC45 = getconfigvar_159282(((NimStringDesc*) &TMP5235));
			if (!eqStrings(LOC45, ((NimStringDesc*) &TMP5236))) goto LA46;
			wantmainmodule_530871();
			definedsymbols = newjarray_305781();
			{
				NimStringDesc* s_532002;
				s_532002 = 0;
				{
					NimStringDesc* key_532406;
					NimStringDesc* val_532408;
					key_532406 = 0;
					val_532408 = 0;
					{
						NI h_532410;
						NI HEX3Atmp_532412;
						NI res_532414;
						h_532410 = 0;
						HEX3Atmp_532412 = 0;
						HEX3Atmp_532412 = ((*gsymbols_189001).data ? ((*gsymbols_189001).data->Sup.len-1) : -1);
						res_532414 = ((NI) 0);
						{
							while (1) {
								if (!(res_532414 <= HEX3Atmp_532412)) goto LA52;
								h_532410 = res_532414;
								{
									if (!!((*gsymbols_189001).data->data[h_532410].Field0 == 0)) goto LA55;
									key_532406 = (*gsymbols_189001).data->data[h_532410].Field0;
									val_532408 = (*gsymbols_189001).data->data[h_532410].Field1;
									{
										Jsonnodeobj305633* LOC61;
										if (!!(eqStrings(val_532408, ((NimStringDesc*) &TMP5237)))) goto LA59;
										s_532002 = key_532406;
										LOC61 = 0;
										LOC61 = HEX25_305988(s_532002);
										(*definedsymbols).kindU.S7.elems = (TY305653*) incrSeqV2(&((*definedsymbols).kindU.S7.elems)->Sup, sizeof(Jsonnodeobj305633*));
										asgnRefNoCycle((void**) (&(*definedsymbols).kindU.S7.elems->data[(*definedsymbols).kindU.S7.elems->Sup.len]), LOC61);
										++(*definedsymbols).kindU.S7.elems->Sup.len;
									}
									LA59: ;
								}
								LA55: ;
								res_532414 += ((NI) 1);
							} LA52: ;
						}
					}
				}
			}
			libpaths = newjarray_305781();
			{
				NimStringDesc* dir_532015;
				Tstrentry135012* it_532420;
				dir_532015 = 0;
				it_532420 = ((Tstrentry135012*) (searchpaths_159125.head));
				{
					while (1) {
						Jsonnodeobj305633* LOC65;
						if (!!((it_532420 == NIM_NIL))) goto LA64;
						dir_532015 = (*it_532420).data;
						LOC65 = 0;
						LOC65 = HEX25_305988(dir_532015);
						(*libpaths).kindU.S7.elems = (TY305653*) incrSeqV2(&((*libpaths).kindU.S7.elems)->Sup, sizeof(Jsonnodeobj305633*));
						asgnRefNoCycle((void**) (&(*libpaths).kindU.S7.elems->data[(*libpaths).kindU.S7.elems->Sup.len]), LOC65);
						++(*libpaths).kindU.S7.elems->Sup.len;
						it_532420 = ((Tstrentry135012*) ((*it_532420).Sup.next));
					} LA64: ;
				}
			}
			memset((void*)LOC66, 0, sizeof(LOC66));
			LOC66[0].Field0 = copyString(((NimStringDesc*) &TMP5238));
			LOC66[0].Field1 = HEX25_305988(((NimStringDesc*) &TMP5239));
			LOC66[1].Field0 = copyString(((NimStringDesc*) &TMP5240));
			LOC66[1].Field1 = HEX25_305988(gprojectfull_159201);
			LOC66[2].Field0 = copyString(((NimStringDesc*) &TMP5241));
			LOC66[2].Field1 = definedsymbols;
			LOC66[3].Field0 = copyString(((NimStringDesc*) &TMP5242));
			LOC66[3].Field1 = libpaths;
			dumpdata = HEX25_306040(LOC66, 4);
			LOC67 = 0;
			LOC67 = HEX24_309805(dumpdata);
			msgwriteln_182449(LOC67, 3);
		}
		goto LA43;
		LA46: ;
		{
			msgwriteln_182449(((NimStringDesc*) &TMP5245), 3);
			{
				NimStringDesc* s_532044;
				s_532044 = 0;
				{
					NimStringDesc* key_532426;
					NimStringDesc* val_532428;
					key_532426 = 0;
					val_532428 = 0;
					{
						NI h_532430;
						NI HEX3Atmp_532432;
						NI res_532434;
						h_532430 = 0;
						HEX3Atmp_532432 = 0;
						HEX3Atmp_532432 = ((*gsymbols_189001).data ? ((*gsymbols_189001).data->Sup.len-1) : -1);
						res_532434 = ((NI) 0);
						{
							while (1) {
								if (!(res_532434 <= HEX3Atmp_532432)) goto LA73;
								h_532430 = res_532434;
								{
									if (!!((*gsymbols_189001).data->data[h_532430].Field0 == 0)) goto LA76;
									key_532426 = (*gsymbols_189001).data->data[h_532430].Field0;
									val_532428 = (*gsymbols_189001).data->data[h_532430].Field1;
									{
										if (!!(eqStrings(val_532428, ((NimStringDesc*) &TMP5237)))) goto LA80;
										s_532044 = key_532426;
										msgwriteln_182449(s_532044, 3);
									}
									LA80: ;
								}
								LA76: ;
								res_532434 += ((NI) 1);
							} LA73: ;
						}
					}
				}
			}
			msgwriteln_182449(((NimStringDesc*) &TMP5246), 3);
			{
				NimStringDesc* it_532047;
				Tstrentry135012* it_532440;
				it_532047 = 0;
				it_532440 = ((Tstrentry135012*) (searchpaths_159125.head));
				{
					while (1) {
						if (!!((it_532440 == NIM_NIL))) goto LA84;
						it_532047 = (*it_532440).data;
						msgwriteln_182449(it_532047, 0);
						it_532440 = ((Tstrentry135012*) ((*it_532440).Sup.next));
					} LA84: ;
				}
			}
		}
		LA43: ;
	}
	goto LA29;
	LA19: ;
	{
		gcmd_159123 = ((NU8) 11);
		commandcheck_531019();
	}
	goto LA29;
	LA20: ;
	{
		Tnode213790* LOC87;
		gcmd_159123 = ((NU8) 12);
		wantmainmodule_530871();
		LOC87 = 0;
		LOC87 = parsefile_237029(gprojectmainidx_159203);
	}
	goto LA29;
	LA21: ;
	{
		gcmd_159123 = ((NU8) 13);
		wantmainmodule_530871();
		commandscan_531251();
		msgwriteln_182449(((NimStringDesc*) &TMP5250), 0);
	}
	goto LA29;
	LA22: ;
	{
		gcmd_159123 = ((NU8) 18);
		commandinteractive_531201();
	}
	goto LA29;
	LA23: ;
	{
		NimStringDesc* LOC91;
		LOC91 = 0;
		LOC91 = maincommandarg_159267();
		commandeval_531235(LOC91);
	}
	goto LA29;
	LA24: ;
	{
		resetmemory_531293();
	}
	goto LA29;
	LA25: ;
	{
		gcmd_159123 = ((NU8) 14);
		{
			if (!!(((gevalexpr_159133) && (gevalexpr_159133)->Sup.len == 0))) goto LA96;
			commandeval_531235(gevalexpr_159133);
		}
		goto LA94;
		LA96: ;
		{
			commandsuggest_531286();
		}
		LA94: ;
	}
	goto LA29;
	LA26: ;
	{
		isserving_159136 = NIM_TRUE;
		gglobaloptions_159121 |= ((NU32)1)<<((((NU8) 15))%(sizeof(NU32)*8));
		gerrormax_182084 = ((NI) 2147483647);
		serve_529236(maincommand_531610);
	}
	goto LA29;
	LA27: ;
	{
		gcmd_159123 = ((NU8) 10);
	}
	goto LA29;
	LA28: ;
	{
		rawmessage_184612(((NU16) 185), command_159205);
	}
	LA29: ;
	{
		NIM_BOOL LOC104;
		TY184781 LOC108;
		NF LOC109;
		NI LOC110;
		LOC104 = 0;
		LOC104 = (gerrorcounter_182081 == ((NI) 0));
		if (!(LOC104)) goto LA105;
		LOC104 = !(((525376 &(1U<<((NU)(gcmd_159123)&31U)))!=0));
		LA105: ;
		if (!LOC104) goto LA106;
		memset((void*)LOC108, 0, sizeof(LOC108));
		LOC108[0] = nimIntToStr(glinescompiled_204198);
		LOC109 = 0;
		LOC109 = ntepochTime();
		LOC108[1] = nsuformatFloat(((NF)(LOC109) - (NF)(glastcmdtime_159134)), ((NU8) 1), ((NI) 3), 46);
		LOC110 = 0;
		LOC110 = gettotalmem_8059();
		LOC108[2] = formatsize_102497(((NI64) (LOC110)), 46);
		{
			NIM_BOOL LOC113;
			LOC113 = 0;
			LOC113 = isdefined_189010(((NimStringDesc*) &TMP5292));
			if (!LOC113) goto LA114;
			LOC108[3] = copyString(((NimStringDesc*) &TMP5293));
		}
		goto LA111;
		LA114: ;
		{
			LOC108[3] = copyString(((NimStringDesc*) &TMP5294));
		}
		LA111: ;
		rawmessage_183645(((NU16) 269), LOC108, 4);
	}
	LA106: ;
	resetattributes_184618();
}
NIM_EXTERNC N_NOINLINE(void, compiler_mainInit000)(void) {
}

NIM_EXTERNC N_NOINLINE(void, compiler_mainDatInit000)(void) {
}

