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

#include <string.h>

#include <stdio.h>
typedef struct tlinkedlist127028 tlinkedlist127028;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tlistentry127022 tlistentry127022;
typedef struct tpass286017 tpass286017;
typedef struct tpasscontext286005 tpasscontext286005;
typedef struct tsym225846 tsym225846;
typedef struct trodreader276030 trodreader276030;
typedef struct tnode225816 tnode225816;
typedef struct tcell44935 tcell44935;
typedef struct TNimType TNimType;
typedef struct tcellseq44951 tcellseq44951;
typedef struct tgcheap47016 tgcheap47016;
typedef struct tcellset44947 tcellset44947;
typedef struct tpagedesc44943 tpagedesc44943;
typedef struct tmemregion27210 tmemregion27210;
typedef struct tsmallchunk26440 tsmallchunk26440;
typedef struct tllchunk27204 tllchunk27204;
typedef struct tbigchunk26442 tbigchunk26442;
typedef struct tintset26417 tintset26417;
typedef struct ttrunk26413 ttrunk26413;
typedef struct tavlnode27208 tavlnode27208;
typedef struct tgcstat47014 tgcstat47014;
typedef struct TY611058 TY611058;
typedef struct tmoduleinmemory611017 tmoduleinmemory611017;
typedef struct TY225936 TY225936;
typedef struct jsonnodeobj336042 jsonnodeobj336042;
typedef struct stringtableobj131012 stringtableobj131012;
typedef struct TNimObject TNimObject;
typedef struct TNimNode TNimNode;
typedef struct keyvaluepairseq131010 keyvaluepairseq131010;
typedef struct keyvaluepair131008 keyvaluepair131008;
typedef struct TY336057 TY336057;
typedef struct TY336611 TY336611;
typedef struct TY336062 TY336062;
typedef struct tstrentry127024 tstrentry127024;
typedef struct tllstream211204 tllstream211204;
typedef struct tlexer215190 tlexer215190;
typedef struct tbaselexer213024 tbaselexer213024;
typedef struct tlineinfo195539 tlineinfo195539;
typedef struct ttoken215186 ttoken215186;
typedef struct tident200021 tident200021;
typedef struct TY119808 TY119808;
typedef struct tidobj200015 tidobj200015;
typedef struct ttypeseq225848 ttypeseq225848;
typedef struct ttype225852 ttype225852;
typedef struct tscope225840 tscope225840;
typedef struct TY225947 TY225947;
typedef struct tinstantiation225836 tinstantiation225836;
typedef struct tstrtable225820 tstrtable225820;
typedef struct tsymseq225818 tsymseq225818;
typedef struct tloc225830 tloc225830;
typedef struct trope177009 trope177009;
typedef struct tlib225834 tlib225834;
typedef struct tindex276028 tindex276028;
typedef struct tiitable235274 tiitable235274;
typedef struct tiipairseq235272 tiipairseq235272;
typedef struct tiipair235270 tiipair235270;
typedef struct tidtable225864 tidtable225864;
typedef struct tidpairseq225862 tidpairseq225862;
typedef struct tidpair225860 tidpair225860;
typedef struct memfile274208 memfile274208;
typedef struct tnodeseq225810 tnodeseq225810;
typedef struct tbasechunk26438 tbasechunk26438;
typedef struct tfreecell26430 tfreecell26430;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  tlinkedlist127028  {
tlistentry127022* Head;
tlistentry127022* Tail;
NI Counter;
};
typedef N_NIMCALL_PTR(tpasscontext286005*, tpassopen286009) (tsym225846* module);
typedef N_NIMCALL_PTR(tpasscontext286005*, tpassopencached286011) (tsym225846* module, trodreader276030* rd);
typedef N_NIMCALL_PTR(tnode225816*, tpassprocess286015) (tpasscontext286005* p, tnode225816* toplevelstmt);
typedef N_NIMCALL_PTR(tnode225816*, tpassclose286013) (tpasscontext286005* p, tnode225816* n);
struct tpass286017 {
tpassopen286009 Field0;
tpassopencached286011 Field1;
tpassprocess286015 Field2;
tpassclose286013 Field3;
};
struct  tcell44935  {
NI Refcount;
TNimType* Typ;
};
struct  tcellseq44951  {
NI Len;
NI Cap;
tcell44935** D;
};
struct  tcellset44947  {
NI Counter;
NI Max;
tpagedesc44943* Head;
tpagedesc44943** Data;
};
typedef tsmallchunk26440* TY27222[512];
typedef ttrunk26413* ttrunkbuckets26415[256];
struct  tintset26417  {
ttrunkbuckets26415 Data;
};
struct  tmemregion27210  {
NI Minlargeobj;
NI Maxlargeobj;
TY27222 Freesmallchunks;
tllchunk27204* Llmem;
NI Currmem;
NI Maxmem;
NI Freemem;
NI Lastsize;
tbigchunk26442* Freechunkslist;
tintset26417 Chunkstarts;
tavlnode27208* Root;
tavlnode27208* Deleted;
tavlnode27208* Last;
tavlnode27208* Freeavlnodes;
};
struct  tgcstat47014  {
NI Stackscans;
NI Cyclecollections;
NI Maxthreshold;
NI Maxstacksize;
NI Maxstackcells;
NI Cycletablesize;
NI64 Maxpause;
};
struct  tgcheap47016  {
void* Stackbottom;
NI Cyclethreshold;
tcellseq44951 Zct;
tcellseq44951 Decstack;
tcellset44947 Cycleroots;
tcellseq44951 Tempstack;
NI Recgclock;
tmemregion27210 Region;
tgcstat47014 Stat;
};
struct  tmoduleinmemory611017  {
NF Compiledat;
NI32 Crc;
TY225936* Deps;
NU8 Needsrecompile;
NU8 Crcstatus;
};
typedef N_NIMCALL_PTR(void, TY3089) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3094) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3089 marker;
TY3094 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct keyvaluepair131008 {
NimStringDesc* Field0;
NimStringDesc* Field1;
};
struct  stringtableobj131012  {
  TNimObject Sup;
NI Counter;
keyvaluepairseq131010* Data;
NU8 Mode;
};
struct TY336611 {
NimStringDesc* Field0;
jsonnodeobj336042* Field1;
};
struct  jsonnodeobj336042  {
NU8 Kind;
union {
struct {NimStringDesc* Str;
} S1;
struct {NI64 Num;
} S2;
struct {NF Fnum;
} S3;
struct {NIM_BOOL Bval;
} S4;
struct {TY336057* Fields;
} S6;
struct {TY336062* Elems;
} S7;
} kindU;
};
struct  tlistentry127022  {
  TNimObject Sup;
tlistentry127022* Prev;
tlistentry127022* Next;
};
struct  tstrentry127024  {
  tlistentry127022 Sup;
NimStringDesc* Data;
};
typedef TY336611 TY614683[4];
struct  tbaselexer213024  {
  TNimObject Sup;
NI Bufpos;
NCSTRING Buf;
NI Buflen;
tllstream211204* Stream;
NI Linenumber;
NI Sentinel;
NI Linestart;
};
struct  tlineinfo195539  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (tlineinfo195539 info, NU16 msg, NimStringDesc* arg, void* ClEnv);
void* ClEnv;
} terrorhandler215188;
struct  tlexer215190  {
  tbaselexer213024 Sup;
NI32 Fileidx;
NI Indentahead;
NI Currlineindent;
NIM_BOOL Strongspaces;
terrorhandler215188 Errorhandler;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  ttoken215186  {
NU8 Toktype;
NI Indent;
tident200021* Ident;
NI64 Inumber;
NF Fnumber;
NU8 Base;
NI8 Strongspacea;
NI8 Strongspaceb;
NimStringDesc* Literal;
NI Line;
NI Col;
};
struct  tidobj200015  {
  TNimObject Sup;
NI Id;
};
struct  tstrtable225820  {
NI Counter;
tsymseq225818* Data;
};
struct  tloc225830  {
NU8 K;
NU8 S;
NU8 Flags;
ttype225852* T;
trope177009* R;
trope177009* Heaproot;
};
struct  tsym225846  {
  tidobj200015 Sup;
NU8 Kind;
union {
struct {ttypeseq225848* Typeinstcache;
tscope225840* Typscope;
} S1;
struct {TY225947* Procinstcache;
tscope225840* Scope;
} S2;
struct {TY225947* Usedgenerics;
tstrtable225820 Tab;
} S3;
struct {tsym225846* Guard;
} S4;
} kindU;
NU16 Magic;
ttype225852* Typ;
tident200021* Name;
tlineinfo195539 Info;
tsym225846* Owner;
NU32 Flags;
tnode225816* Ast;
NU32 Options;
NI Position;
NI Offset;
tloc225830 Loc;
tlib225834* Annex;
tnode225816* Constraint;
};
typedef tpass286017 TY613650[3];
typedef tident200021* TY200034[8192];
typedef N_NIMCALL_PTR(void, TY610261) (void);
typedef NimStringDesc* TY208063[3];
struct  tpasscontext286005  {
  TNimObject Sup;
NIM_BOOL Fromcache;
};
struct  tiipair235270  {
NI Key;
NI Val;
};
struct  tiitable235274  {
NI Counter;
tiipairseq235272* Data;
};
struct  tindex276028  {
NI Lastidxkey;
NI Lastidxval;
tiitable235274 Tab;
NimStringDesc* R;
NI Offset;
};
struct  tidpair225860  {
tidobj200015* Key;
TNimObject* Val;
};
struct  tidtable225864  {
NI Counter;
tidpairseq225862* Data;
};
struct  memfile274208  {
void* Mem;
NI Size;
int Handle;
};
struct  trodreader276030  {
  TNimObject Sup;
NI Pos;
NCSTRING S;
NU32 Options;
NU8 Reason;
TY225936* Moddeps;
TY225936* Files;
NI Dataidx;
NI Convertersidx;
NI Initidx;
NI Interfidx;
NI Compilerprocsidx;
NI Methodsidx;
NimStringDesc* Filename;
tindex276028 Index;
tindex276028 Imports;
NI Readerindex;
NI Line;
NI Moduleid;
tidtable225864 Syms;
memfile274208 Memfile;
tsymseq225818* Methods;
NimStringDesc* Origfile;
NIM_BOOL Inviewmode;
};
struct  tnode225816  {
ttype225852* Typ;
tlineinfo195539 Info;
NU16 Flags;
NU8 Kind;
union {
struct {NI64 Intval;
} S1;
struct {NF Floatval;
} S2;
struct {NimStringDesc* Strval;
} S3;
struct {tsym225846* Sym;
} S4;
struct {tident200021* Ident;
} S5;
struct {tnodeseq225810* Sons;
} S6;
} kindU;
NimStringDesc* Comment;
};
typedef NI TY26420[8];
struct  tpagedesc44943  {
tpagedesc44943* Next;
NI Key;
TY26420 Bits;
};
struct  tbasechunk26438  {
NI Prevsize;
NI Size;
NIM_BOOL Used;
};
struct  tsmallchunk26440  {
  tbasechunk26438 Sup;
tsmallchunk26440* Next;
tsmallchunk26440* Prev;
tfreecell26430* Freelist;
NI Free;
NI Acc;
NF Data;
};
struct  tllchunk27204  {
NI Size;
NI Acc;
tllchunk27204* Next;
};
struct  tbigchunk26442  {
  tbasechunk26438 Sup;
tbigchunk26442* Next;
tbigchunk26442* Prev;
NI Align;
NF Data;
};
struct  ttrunk26413  {
ttrunk26413* Next;
NI Key;
TY26420 Bits;
};
typedef tavlnode27208* TY27214[2];
struct  tavlnode27208  {
TY27214 Link;
NI Key;
NI Upperbound;
NI Level;
};
struct  tllstream211204  {
  TNimObject Sup;
NU8 Kind;
FILE* F;
NimStringDesc* S;
NI Rd;
NI Wr;
NI Lineoffset;
};
struct  tident200021  {
  tidobj200015 Sup;
NimStringDesc* S;
tident200021* Next;
NI H;
};
struct  ttype225852  {
  tidobj200015 Sup;
NU8 Kind;
NU8 Callconv;
NU32 Flags;
ttypeseq225848* Sons;
tnode225816* N;
tsym225846* Owner;
tsym225846* Sym;
tsym225846* Destructor;
tsym225846* Deepcopy;
NI64 Size;
NI16 Align;
NI16 Locklevel;
tloc225830 Loc;
};
struct  tscope225840  {
NI Depthlevel;
tstrtable225820 Symbols;
tnodeseq225810* Usingsyms;
tscope225840* Parent;
};
struct  tinstantiation225836  {
tsym225846* Sym;
ttypeseq225848* Concretetypes;
TY225936* Usedby;
};
struct  trope177009  {
  TNimObject Sup;
trope177009* Left;
trope177009* Right;
NI Length;
NimStringDesc* Data;
};
struct  tlib225834  {
  tlistentry127022 Sup;
NU8 Kind;
NIM_BOOL Generated;
NIM_BOOL Isoverriden;
trope177009* Name;
tnode225816* Path;
};
struct  tfreecell26430  {
tfreecell26430* Next;
NI Zerofield;
};
struct TY225936 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct TY611058 {
  TGenericSeq Sup;
  tmoduleinmemory611017 data[SEQ_DECL_SIZE];
};
struct keyvaluepairseq131010 {
  TGenericSeq Sup;
  keyvaluepair131008 data[SEQ_DECL_SIZE];
};
struct TY336057 {
  TGenericSeq Sup;
  TY336611 data[SEQ_DECL_SIZE];
};
struct TY336062 {
  TGenericSeq Sup;
  jsonnodeobj336042* data[SEQ_DECL_SIZE];
};
struct TY119808 {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct ttypeseq225848 {
  TGenericSeq Sup;
  ttype225852* data[SEQ_DECL_SIZE];
};
struct TY225947 {
  TGenericSeq Sup;
  tinstantiation225836* data[SEQ_DECL_SIZE];
};
struct tsymseq225818 {
  TGenericSeq Sup;
  tsym225846* data[SEQ_DECL_SIZE];
};
struct tiipairseq235272 {
  TGenericSeq Sup;
  tiipair235270 data[SEQ_DECL_SIZE];
};
struct tidpairseq225862 {
  TGenericSeq Sup;
  tidpair225860 data[SEQ_DECL_SIZE];
};
struct tnodeseq225810 {
  TGenericSeq Sup;
  tnode225816* data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, clearpasses_286206)(void);
N_NIMCALL(NF, ntepochTime)(void);
N_NIMCALL(void, appendstr_127286)(tlinkedlist127028* list, NimStringDesc* data);
N_NIMCALL(void, prependstr_127424)(tlinkedlist127028* list, NimStringDesc* data);
static N_INLINE(void, setid_224446)(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_613268)(void);
N_NIMCALL(void, semanticpasses_613230)(void);
N_NIMCALL(void, registerpass_286214)(tpass286017* p);
N_NIMCALL(tpasscontext286005*, verboseopen_607012)(tsym225846* s);
N_NIMCALL(tnode225816*, verboseprocess_607023)(tpasscontext286005* context, tnode225816* n);
N_NIMCALL(tpasscontext286005*, myopen_544456)(tsym225846* module);
N_NIMCALL(tpasscontext286005*, myopencached_544499)(tsym225846* module, trodreader276030* rd);
N_NIMCALL(tnode225816*, myprocess_544640)(tpasscontext286005* context, tnode225816* n);
N_NIMCALL(tnode225816*, myclose_544656)(tpasscontext286005* context, tnode225816* n);
N_NIMCALL(tpasscontext286005*, myopen_591541)(tsym225846* module);
N_NIMCALL(tpasscontext286005*, myopencached_591717)(tsym225846* module, trodreader276030* rd);
N_NIMCALL(tnode225816*, myprocess_591808)(tpasscontext286005* b, tnode225816* n);
N_NIMCALL(tnode225816*, myclose_592246)(tpasscontext286005* b, tnode225816* n);
N_NIMCALL(void, rodpass_613201)(void);
N_NIMCALL(tpasscontext286005*, myopen_302687)(tsym225846* module);
N_NIMCALL(tnode225816*, process_302204)(tpasscontext286005* c, tnode225816* n);
N_NIMCALL(tnode225816*, myclose_302699)(tpasscontext286005* c, tnode225816* n);
N_NIMCALL(void, compileproject_612077)(NI32 projectfileidx);
N_NIMCALL(void, cgenwritemodules_592360)(void);
N_NIMCALL(void, callccompiler_203541)(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(tcell44935*, usrtocell_48646)(void* usr);
static N_INLINE(void, rtladdzct_50204)(tcell44935* c);
N_NOINLINE(void, addzct_48617)(tcellseq44951* s, tcell44935* c);
N_NIMCALL(void, resetcgenmodules_591397)(void);
N_NIMCALL(void, resetcompilationlists_202886)(void);
N_NIMCALL(void, resetcaches_548365)(void);
N_NIMCALL(void, gcfullcollect_8005)(void);
N_NIMCALL(void, setcc_202708)(NimStringDesc* ccname);
N_NIMCALL(void, definesymbol_201009)(NimStringDesc* symbol);
N_NIMCALL(void, rawmessage_197733)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, commandcompiletojs_613401)(void);
N_NIMCALL(void, settarget_174621)(NU8 o, NU8 c);
N_NIMCALL(tpasscontext286005*, myopen_606238)(tsym225846* s);
N_NIMCALL(tpasscontext286005*, myopencached_606227)(tsym225846* s, trodreader276030* rd);
N_NIMCALL(tnode225816*, myprocess_606062)(tpasscontext286005* b, tnode225816* n);
N_NIMCALL(tnode225816*, myclose_606197)(tpasscontext286005* b, tnode225816* n);
N_NIMCALL(void, wantmainmodule_612014)(void);
N_NIMCALL(void, loadconfigs_220811)(NimStringDesc* cfg);
N_NIMCALL(void, commanddoc_403946)(void);
N_NIMCALL(void, commanddoc2_613257)(void);
N_NIMCALL(tpasscontext286005*, myopen_609069)(tsym225846* module);
N_NIMCALL(tnode225816*, processnode_609057)(tpasscontext286005* c, tnode225816* n);
N_NIMCALL(tnode225816*, close_609018)(tpasscontext286005* p, tnode225816* n);
N_NIMCALL(void, finishdoc2pass_609112)(NimStringDesc* project);
N_NIMCALL(void, commandrst2html_403992)(void);
N_NIMCALL(void, commandrst2tex_404000)(void);
N_NIMCALL(void, commandjson_404008)(void);
N_NIMCALL(void, commandbuildindex_404054)(void);
N_NIMCALL(void, commandgendepend_613238)(void);
N_NIMCALL(tpasscontext286005*, myopen_608168)(tsym225846* module);
N_NIMCALL(tnode225816*, adddotdependency_608043)(tpasscontext286005* c, tnode225816* n);
N_NIMCALL(tnode225816*, cleanup_607077)(tpasscontext286005* c, tnode225816* n);
N_NIMCALL(void, generatedot_608009)(NimStringDesc* project);
N_NIMCALL(void, execexternalprogram_202907)(NimStringDesc* cmd, NimStringDesc* prettycmd);
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_169350)(NimStringDesc* key);
N_NIMCALL(jsonnodeobj336042*, newjarray_336389)(void);
N_NIMCALL(jsonnodeobj336042*, HEX25_336448)(NimStringDesc* s);
N_NIMCALL(TGenericSeq*, incrSeq)(TGenericSeq* seq, NI elemsize);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(jsonnodeobj336042*, HEX25_336608)(TY336611* keyvals, NI keyvalsLen0);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(void, outwriteln_197198)(NimStringDesc* s);
N_NIMCALL(NimStringDesc*, HEX24_340633)(jsonnodeobj336042* node);
N_NIMCALL(void, msgwriteln_197236)(NimStringDesc* s);
N_NIMCALL(void, commandcheck_613246)(void);
N_NIMCALL(tnode225816*, parsefile_260041)(NI32 fileidx);
N_NIMCALL(void, commandscan_613692)(void);
N_NIMCALL(NimStringDesc*, nosaddFileExt)(NimStringDesc* filename, NimStringDesc* ext);
N_NIMCALL(NimStringDesc*, maincommandarg_169319)(void);
N_NIMCALL(tllstream211204*, llstreamopen_211233)(NimStringDesc* filename, NU8 mode);
N_NIMCALL(void, inittoken_215482)(ttoken215186* l);
N_NIMCALL(void, openlexer_215277)(tlexer215190* lex, NimStringDesc* filename, tllstream211204* inputstream);
N_NIMCALL(void, rawgettok_215238)(tlexer215190* l, ttoken215186* tok);
N_NIMCALL(void, printtok_215265)(ttoken215186* tok);
N_NIMCALL(void, closelexer_215258)(tlexer215190* lex);
N_NIMCALL(void, commandinteractive_613607)(void);
N_NIMCALL(void, interactivepasses_613409)(void);
N_NIMCALL(void, initdefines_201146)(void);
N_NIMCALL(tpasscontext286005*, myopen_476283)(tsym225846* module);
N_NIMCALL(tnode225816*, myprocess_476412)(tpasscontext286005* c, tnode225816* n);
N_NIMCALL(void, compilesystemmodule_611988)(void);
N_NIMCALL(tsym225846*, compilemodule_611776)(NI32 fileidx, NU32 flags);
N_NIMCALL(NI32, fileinfoidx_195747)(NimStringDesc* filename);
N_NIMCALL(tsym225846*, makestdinmodule_612097)(void);
N_NIMCALL(void, processmodule_286056)(tsym225846* module, tllstream211204* stream, trodreader276030* rd);
N_NIMCALL(tllstream211204*, llstreamopenstdin_211245)(void);
N_NIMCALL(void, commandeval_613665)(NimStringDesc* exp);
N_NIMCALL(void, evalnim_613655)(tnode225816* nodes, tsym225846* module);
N_NIMCALL(void, carrypasses_286257)(tnode225816* nodes, tsym225846* module, tpass286017* passes, NI passesLen0);
N_NIMCALL(tnode225816*, parsestring_248539)(NimStringDesc* s, NimStringDesc* filename, NI line, terrorhandler215188 errorhandler);
N_NIMCALL(void, resetmemory_613770)(void);
N_NIMCALL(void, resetallmodules_611411)(void);
N_NIMCALL(void, resetropecache_177247)(void);
N_NIMCALL(void, resetsystypes_282359)(void);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
N_NIMCALL(void, commandsuggest_613744)(void);
N_NIMCALL(void, resetmodule_611402)(NI32 fileidx);
N_NIMCALL(void, deffromsourcemap_420834)(tlineinfo195539 i);
N_NIMCALL(void, serve_610259)(TY610261 action);
N_NIMCALL(void, maincommand_614027)(void);
N_NIMCALL(void, rawmessage_197643)(NU16 msg, NimStringDesc** args, NI argsLen0);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
N_NIMCALL(NimStringDesc*, nsuformatFloat)(NF f, NU8 format, NI precision);
N_NIMCALL(NimStringDesc*, formatsize_98605)(NI64 bytes, NIM_CHAR decimalsep);
N_NIMCALL(NI, gettotalmem_6499)(void);
STRING_LITERAL(TMP1916, "c", 1);
STRING_LITERAL(TMP1917, "cc", 2);
STRING_LITERAL(TMP1918, "compile", 7);
STRING_LITERAL(TMP1919, "compiletoc", 10);
STRING_LITERAL(TMP1920, "cpp", 3);
STRING_LITERAL(TMP1921, "compiletocpp", 12);
STRING_LITERAL(TMP1922, "objc", 4);
STRING_LITERAL(TMP1923, "compiletooc", 11);
STRING_LITERAL(TMP1924, "run", 3);
STRING_LITERAL(TMP1925, "js", 2);
STRING_LITERAL(TMP1926, "compiletojs", 11);
STRING_LITERAL(TMP1927, "compiletollvm", 13);
STRING_LITERAL(TMP1928, "doc", 3);
STRING_LITERAL(TMP1929, "doc2", 4);
STRING_LITERAL(TMP1930, "rst2html", 8);
STRING_LITERAL(TMP1931, "rst2tex", 7);
STRING_LITERAL(TMP1932, "jsondoc", 7);
STRING_LITERAL(TMP1933, "buildindex", 10);
STRING_LITERAL(TMP1934, "gendepend", 9);
STRING_LITERAL(TMP1935, "dump", 4);
STRING_LITERAL(TMP1936, "check", 5);
STRING_LITERAL(TMP1937, "parse", 5);
STRING_LITERAL(TMP1938, "scan", 4);
STRING_LITERAL(TMP1939, "i", 1);
STRING_LITERAL(TMP1940, "e", 1);
STRING_LITERAL(TMP1941, "reset", 5);
STRING_LITERAL(TMP1942, "idetools", 8);
STRING_LITERAL(TMP1943, "serve", 5);
STRING_LITERAL(TMP4229, "", 0);
STRING_LITERAL(TMP4230, "gcc", 3);
STRING_LITERAL(TMP4231, "nimrod", 6);
STRING_LITERAL(TMP4232, "ecmascript", 10);
STRING_LITERAL(TMP4623, "nimdoc.cfg", 10);
STRING_LITERAL(TMP4747, "nimdoc", 6);
STRING_LITERAL(TMP4753, "nimdoc.tex.cfg", 14);
STRING_LITERAL(TMP4831, "dot -Tpng -o", 12);
STRING_LITERAL(TMP4832, "png", 3);
STRING_LITERAL(TMP4833, "dot", 3);
STRING_LITERAL(TMP4834, "dump.format", 11);
STRING_LITERAL(TMP4835, "json", 4);
STRING_LITERAL(TMP4836, "true", 4);
STRING_LITERAL(TMP4837, "version", 7);
STRING_LITERAL(TMP4838, "0.10.2", 6);
STRING_LITERAL(TMP4839, "project_path", 12);
STRING_LITERAL(TMP4840, "defined_symbols", 15);
STRING_LITERAL(TMP4841, "lib_paths", 9);
STRING_LITERAL(TMP4842, "-- list of currently defined symbols --", 39);
STRING_LITERAL(TMP4843, "-- end of list --", 17);
STRING_LITERAL(TMP4844, "nim", 3);
STRING_LITERAL(TMP4847, "Beware: Indentation tokens depend on the parser\'s state!", 56);
STRING_LITERAL(TMP4848, "nimrodvm", 8);
STRING_LITERAL(TMP4851, "echo \"eval\\t\", repr(", 20);
STRING_LITERAL(TMP4852, ")", 1);
static NIM_CONST terrorhandler215188 TMP4853 = {NIM_NIL,NIM_NIL};
extern NF glastcmdtime_169131;
extern tlinkedlist127028 searchpaths_169122;
extern NimStringDesc* libpath_169233;
extern NimStringDesc* gprojectfull_169236;
extern NimStringDesc* gprojectpath_169235;
extern NI gfrontendid_224012;
extern NimStringDesc* command_169239;
extern NU8 gcmd_169120;
extern NU32 gglobaloptions_169118;
extern NIM_BOOL isserving_169133;
extern NimStringDesc* lastcaascmd_610205;
extern NimStringDesc* curcaascmd_610204;
extern tgcheap47016 gch_47044;
extern TY611058* gmemcachedata_611079;
extern NU8 ccompiler_202461;
extern NI gerrormax_196306;
extern NimStringDesc* gprojectname_169234;
extern stringtableobj131012* gsymbols_201004;
extern NI32 gprojectmainidx_169237;
extern TNimType NTI215190; /* TLexer */
extern TY119808* commandargs_169261;
extern tsym225846* systemmodule_282019;
extern tsymseq225818* gowners_290292;
extern TNimType NTI225818; /* TSymSeq */
extern tsym225846* rangedestructorproc_515764;
extern TY200034 buckets_200039;
extern tident200021* idanon_200504;
extern NimStringDesc* gevalexpr_169130;
extern NI32 gdirtybufferidx_169134;
extern tlineinfo195539 opttrackpos_197156;
extern NI32 gdirtyoriginalidx_169135;
extern NI gerrorcounter_196303;
extern NI gverbosity_169127;
extern NI glinescompiled_215218;

static N_INLINE(void, setid_224446)(NI id) {
	gfrontendid_224012 = ((gfrontendid_224012 >= (NI64)(id + 1)) ? gfrontendid_224012 : (NI64)(id + 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)), (NI64)((*a).Sup.len * 1));
	LOC11 = (LOC13 == ((NI32) 0));
	LA12: ;
	result = LOC11;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, semanticpasses_613230)(void) {
	tpass286017 LOC1;
	tpass286017 LOC2;
	LOC1.Field0 = verboseopen_607012;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = verboseprocess_607023;
	LOC1.Field3 = NIM_NIL;
	registerpass_286214((&LOC1));
	LOC2.Field0 = myopen_544456;
	LOC2.Field1 = myopencached_544499;
	LOC2.Field2 = myprocess_544640;
	LOC2.Field3 = myclose_544656;
	registerpass_286214((&LOC2));
}

N_NIMCALL(void, rodpass_613201)(void) {
	{
		tpass286017 LOC5;
		if (!((gglobaloptions_169118 &(1<<((((NU8) 14))&31)))!=0)) goto LA3;
		LOC5.Field0 = myopen_302687;
		LOC5.Field1 = NIM_NIL;
		LOC5.Field2 = process_302204;
		LOC5.Field3 = myclose_302699;
		registerpass_286214((&LOC5));
	}
	LA3: ;
}

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

static N_INLINE(void, rtladdzct_50204)(tcell44935* c) {
	addzct_48617((&gch_47044.Zct), c);
}

static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
	tcell44935* c;
	c = usrtocell_48646(p);
	{
		(*c).Refcount -= 8;
		if (!((NU64)((*c).Refcount) < (NU64)(8))) goto LA3;
		rtladdzct_50204(c);
	}
	LA3: ;
}

N_NIMCALL(void, commandcompiletoc_613268)(void) {
	tpass286017 LOC1;
	semanticpasses_613230();
	LOC1.Field0 = myopen_591541;
	LOC1.Field1 = myopencached_591717;
	LOC1.Field2 = myprocess_591808;
	LOC1.Field3 = myclose_592246;
	registerpass_286214((&LOC1));
	rodpass_613201();
	{
		if (!((gglobaloptions_169118 &(1<<((((NU8) 15))&31)))!=0)) goto LA4;
	}
	LA4: ;
	compileproject_612077(((NI32) -1));
	cgenwritemodules_592360();
	{
		NimStringDesc* LOC10;
		if (!!((gcmd_169120 == ((NU8) 19)))) goto LA8;
		LOC10 = 0;
		LOC10 = noschangeFileExt(gprojectfull_169236, ((NimStringDesc*) &TMP4229));
		callccompiler_203541(LOC10);
	}
	LA8: ;
	{
		NimStringDesc* LOC15;
		if (!isserving_169133) goto LA13;
		LOC15 = 0;
		LOC15 = lastcaascmd_610205; lastcaascmd_610205 = copyStringRC1(curcaascmd_610204);
		if (LOC15) nimGCunrefNoCycle(LOC15);
		resetcgenmodules_591397();
		{
			NI i_613324;
			NI HEX3Atmp_613326;
			NI res_613329;
			i_613324 = 0;
			HEX3Atmp_613326 = 0;
			HEX3Atmp_613326 = (gmemcachedata_611079->Sup.len - 1);
			res_613329 = 0;
			{
				while (1) {
					if (!(res_613329 <= HEX3Atmp_613326)) goto LA18;
					i_613324 = res_613329;
					gmemcachedata_611079->data[i_613324].Crcstatus = ((NU8) 1);
					gmemcachedata_611079->data[i_613324].Needsrecompile = ((NU8) 0);
					res_613329 += 1;
				} LA18: ;
			}
		}
		resetcompilationlists_202886();
		resetcaches_548365();
		gcfullcollect_8005();
	}
	LA13: ;
}

N_NIMCALL(void, commandcompiletojs_613401)(void) {
	tpass286017 LOC1;
	settarget_174621(((NU8) 21), ((NU8) 12));
	definesymbol_201009(((NimStringDesc*) &TMP4231));
	definesymbol_201009(((NimStringDesc*) &TMP4232));
	definesymbol_201009(((NimStringDesc*) &TMP1925));
	semanticpasses_613230();
	LOC1.Field0 = myopen_606238;
	LOC1.Field1 = myopencached_606227;
	LOC1.Field2 = myprocess_606062;
	LOC1.Field3 = myclose_606197;
	registerpass_286214((&LOC1));
	compileproject_612077(((NI32) -1));
}

N_NIMCALL(void, commanddoc2_613257)(void) {
	tpass286017 LOC1;
	gerrormax_196306 = IL64(9223372036854775807);
	semanticpasses_613230();
	LOC1.Field0 = myopen_609069;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = processnode_609057;
	LOC1.Field3 = close_609018;
	registerpass_286214((&LOC1));
	compileproject_612077(((NI32) -1));
	finishdoc2pass_609112(gprojectname_169234);
}

static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
	memcpy(((NCSTRING) ((&(*dest).data[((*dest).Sup.len)- 0]))), ((NCSTRING) ((*src).data)), (NI64)((*src).Sup.len + 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[((NI64)((*dest).Sup.len + 1))- 0] = 0;
	(*dest).Sup.len += 1;
}

N_NIMCALL(void, commandgendepend_613238)(void) {
	tpass286017 LOC1;
	tpass286017 LOC2;
	NimStringDesc* LOC3;
	NimStringDesc* LOC4;
	NimStringDesc* LOC5;
	semanticpasses_613230();
	LOC1.Field0 = myopen_608168;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = adddotdependency_608043;
	LOC1.Field3 = NIM_NIL;
	registerpass_286214((&LOC1));
	LOC2.Field0 = NIM_NIL;
	LOC2.Field1 = NIM_NIL;
	LOC2.Field2 = cleanup_607077;
	LOC2.Field3 = cleanup_607077;
	registerpass_286214((&LOC2));
	compileproject_612077(((NI32) -1));
	generatedot_608009(gprojectfull_169236);
	LOC3 = 0;
	LOC4 = 0;
	LOC4 = noschangeFileExt(gprojectfull_169236, ((NimStringDesc*) &TMP4832));
	LOC5 = 0;
	LOC5 = noschangeFileExt(gprojectfull_169236, ((NimStringDesc*) &TMP4833));
	LOC3 = rawNewString(LOC4->Sup.len + LOC5->Sup.len + 13);
appendString(LOC3, ((NimStringDesc*) &TMP4831));
appendString(LOC3, LOC4);
appendChar(LOC3, 32);
appendString(LOC3, LOC5);
	execexternalprogram_202907(LOC3, ((NimStringDesc*) &TMP4229));
}

static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) {
	{
		tcell44935* c;
		if (!!((src == NIM_NIL))) goto LA3;
		c = usrtocell_48646(src);
		(*c).Refcount += 8;
	}
	LA3: ;
	{
		tcell44935* c;
		if (!!(((*dest) == NIM_NIL))) goto LA7;
		c = usrtocell_48646((*dest));
		{
			(*c).Refcount -= 8;
			if (!((NU64)((*c).Refcount) < (NU64)(8))) goto LA11;
			rtladdzct_50204(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

N_NIMCALL(void, commandcheck_613246)(void) {
	gerrormax_196306 = IL64(9223372036854775807);
	semanticpasses_613230();
	rodpass_613201();
	compileproject_612077(((NI32) -1));
}

N_NIMCALL(void, commandscan_613692)(void) {
	NimStringDesc* f;
	NimStringDesc* LOC1;
	tllstream211204* stream;
	LOC1 = 0;
	LOC1 = maincommandarg_169319();
	f = nosaddFileExt(LOC1, ((NimStringDesc*) &TMP4844));
	stream = llstreamopen_211233(f, ((NU8) 0));
	{
		tlexer215190 l;
		ttoken215186 tok;
		if (!!((stream == NIM_NIL))) goto LA4;
		memset((void*)(&l), 0, sizeof(l));
		l.Sup.Sup.m_type = (&NTI215190);
		memset((void*)(&tok), 0, sizeof(tok));
		inittoken_215482((&tok));
		openlexer_215277((&l), f, stream);
		{
			while (1) {
				rawgettok_215238((&l), (&tok));
				printtok_215265((&tok));
				{
					if (!(tok.Toktype == ((NU8) 1))) goto LA10;
					goto LA6;
				}
				LA10: ;
			}
		} LA6: ;
		closelexer_215258((&l));
	}
	goto LA2;
	LA4: ;
	{
		rawmessage_197733(((NU16) 3), f);
	}
	LA2: ;
}

N_NIMCALL(void, interactivepasses_613409)(void) {
	tpass286017 LOC1;
	tpass286017 LOC2;
	tpass286017 LOC3;
	initdefines_201146();
	definesymbol_201009(((NimStringDesc*) &TMP4848));
	LOC1.Field0 = verboseopen_607012;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = verboseprocess_607023;
	LOC1.Field3 = NIM_NIL;
	registerpass_286214((&LOC1));
	LOC2.Field0 = myopen_544456;
	LOC2.Field1 = myopencached_544499;
	LOC2.Field2 = myprocess_544640;
	LOC2.Field3 = myclose_544656;
	registerpass_286214((&LOC2));
	LOC3.Field0 = myopen_476283;
	LOC3.Field1 = NIM_NIL;
	LOC3.Field2 = myprocess_476412;
	LOC3.Field3 = myprocess_476412;
	registerpass_286214((&LOC3));
}

N_NIMCALL(void, commandinteractive_613607)(void) {
	gerrormax_196306 = IL64(9223372036854775807);
	interactivepasses_613409();
	compilesystemmodule_611988();
	{
		NI32 LOC5;
		tsym225846* LOC6;
		if (!(0 < commandargs_169261->Sup.len)) goto LA3;
		LOC5 = 0;
		LOC5 = fileinfoidx_195747(gprojectfull_169236);
		LOC6 = 0;
		LOC6 = compilemodule_611776(LOC5, 0);
	}
	goto LA1;
	LA3: ;
	{
		tsym225846* m;
		tllstream211204* LOC8;
		m = makestdinmodule_612097();
		(*m).Flags |= ((NI32)1)<<((((NU8) 12))%(sizeof(NI32)*8));
		LOC8 = 0;
		LOC8 = llstreamopenstdin_211245();
		processmodule_286056(m, LOC8, NIM_NIL);
	}
	LA1: ;
}

N_NIMCALL(void, evalnim_613655)(tnode225816* nodes, tsym225846* module) {
	TY613650 LOC1;
	LOC1[0].Field0 = verboseopen_607012;
	LOC1[0].Field1 = NIM_NIL;
	LOC1[0].Field2 = verboseprocess_607023;
	LOC1[0].Field3 = NIM_NIL;
	LOC1[1].Field0 = myopen_544456;
	LOC1[1].Field1 = myopencached_544499;
	LOC1[1].Field2 = myprocess_544640;
	LOC1[1].Field3 = myclose_544656;
	LOC1[2].Field0 = myopen_476283;
	LOC1[2].Field1 = NIM_NIL;
	LOC1[2].Field2 = myprocess_476412;
	LOC1[2].Field3 = myprocess_476412;
	carrypasses_286257(nodes, module, LOC1, 3);
}

N_NIMCALL(void, commandeval_613665)(NimStringDesc* exp) {
	NimStringDesc* echoexp;
	NimStringDesc* LOC5;
	tnode225816* LOC6;
	tsym225846* LOC7;
	{
		if (!(systemmodule_282019 == NIM_NIL)) goto LA3;
		interactivepasses_613409();
		compilesystemmodule_611988();
	}
	LA3: ;
	LOC5 = 0;
	LOC5 = rawNewString(exp->Sup.len + 21);
appendString(LOC5, ((NimStringDesc*) &TMP4851));
appendString(LOC5, exp);
appendString(LOC5, ((NimStringDesc*) &TMP4852));
	echoexp = LOC5;
	LOC6 = 0;
	LOC6 = parsestring_248539(echoexp, ((NimStringDesc*) &TMP4229), 0, TMP4853);
	LOC7 = 0;
	LOC7 = makestdinmodule_612097();
	evalnim_613655(LOC6, LOC7);
}

N_NIMCALL(void, resetmemory_613770)(void) {
	resetcompilationlists_202886();
	resetcaches_548365();
	resetallmodules_611411();
	resetropecache_177247();
	resetsystypes_282359();
	if (gowners_290292) nimGCunrefNoCycle(gowners_290292);
	gowners_290292 = (tsymseq225818*) newSeqRC1((&NTI225818), 0);
	asgnRefNoCycle((void**) (&rangedestructorproc_515764), NIM_NIL);
	{
		NI i_613827;
		NI res_614005;
		i_613827 = 0;
		res_614005 = 0;
		{
			while (1) {
				if (!(((NI) (res_614005)) <= 8191)) goto LA3;
				i_613827 = res_614005;
				asgnRefNoCycle((void**) (&buckets_200039[(i_613827)- 0]), NIM_NIL);
				res_614005 += 1;
			} LA3: ;
		}
	}
	asgnRefNoCycle((void**) (&idanon_200504), NIM_NIL);
}

N_NIMCALL(void, commandsuggest_613744)(void) {
	{
		if (!isserving_169133) goto LA3;
		commandcompiletoc_613268();
		{
			tsym225846* LOC9;
			if (!!((gdirtybufferidx_169134 == ((NI32) 0)))) goto LA7;
			LOC9 = 0;
			LOC9 = compilemodule_611776(gdirtybufferidx_169134, 512);
			resetmodule_611402(gdirtybufferidx_169134);
		}
		LA7: ;
		{
			if (!((gglobaloptions_169118 &(1<<((((NU8) 25))&31)))!=0)) goto LA12;
			deffromsourcemap_420834(opttrackpos_197156);
		}
		LA12: ;
	}
	goto LA1;
	LA3: ;
	{
		NI32 projfile;
		gerrormax_196306 = IL64(9223372036854775807);
		semanticpasses_613230();
		rodpass_613201();
		{
			if (!(gprojectmainidx_169237 == gdirtyoriginalidx_169135)) goto LA17;
			projfile = gdirtybufferidx_169134;
		}
		goto LA15;
		LA17: ;
		{
			projfile = gprojectmainidx_169237;
		}
		LA15: ;
		compileproject_612077(projfile);
	}
	LA1: ;
}

N_NIMCALL(void, maincommand_614027)(void) {
	NimStringDesc* LOC5;
	clearpasses_286206();
	glastcmdtime_169131 = ntepochTime();
	appendstr_127286((&searchpaths_169122), libpath_169233);
	{
		if (!!((gprojectfull_169236->Sup.len == 0))) goto LA3;
		prependstr_127424((&searchpaths_169122), gprojectpath_169235);
	}
	LA3: ;
	setid_224446(100);
	LOC5 = 0;
	LOC5 = nsuNormalize(command_169239);
	switch (hashString(LOC5) & 31) {
	case 0: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1921))) goto LA7;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1923))) goto LA8;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1927))) goto LA11;
break;
	case 1: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1933))) goto LA17;
break;
	case 2: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1935))) goto LA19;
break;
	case 4: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1937))) goto LA21;
break;
	case 9: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1924))) goto LA9;
break;
	case 10: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1917))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1936))) goto LA20;
break;
	case 12: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1919))) goto LA6;
break;
	case 13: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1928))) goto LA12;
break;
	case 14: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1942))) goto LA26;
break;
	case 15: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1939))) goto LA23;
break;
	case 16: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1940))) goto LA24;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1943))) goto LA27;
break;
	case 18: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1918))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1926))) goto LA10;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1941))) goto LA25;
break;
	case 19: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1931))) goto LA15;
break;
	case 20: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1932))) goto LA16;
break;
	case 25: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1916))) goto LA6;
break;
	case 26: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1938))) goto LA22;
break;
	case 27: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1920))) goto LA7;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1925))) goto LA10;
break;
	case 29: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1934))) goto LA18;
break;
	case 31: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1922))) goto LA8;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1929))) goto LA13;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1930))) goto LA14;
break;
	}
	goto LA28;
	LA6: ;
	{
		gcmd_169120 = ((NU8) 1);
		commandcompiletoc_613268();
	}
	goto LA29;
	LA7: ;
	{
		gcmd_169120 = ((NU8) 2);
		{
			if (!(ccompiler_202461 == ((NU8) 1))) goto LA34;
			setcc_202708(((NimStringDesc*) &TMP4230));
		}
		LA34: ;
		definesymbol_201009(((NimStringDesc*) &TMP1920));
		commandcompiletoc_613268();
	}
	goto LA29;
	LA8: ;
	{
		gcmd_169120 = ((NU8) 3);
		definesymbol_201009(((NimStringDesc*) &TMP1922));
		commandcompiletoc_613268();
	}
	goto LA29;
	LA9: ;
	{
		gcmd_169120 = ((NU8) 19);
		rawmessage_197733(((NU16) 180), command_169239);
	}
	goto LA29;
	LA10: ;
	{
		gcmd_169120 = ((NU8) 4);
		commandcompiletojs_613401();
	}
	goto LA29;
	LA11: ;
	{
		gcmd_169120 = ((NU8) 5);
		rawmessage_197733(((NU16) 180), command_169239);
	}
	goto LA29;
	LA12: ;
	{
		wantmainmodule_612014();
		gcmd_169120 = ((NU8) 8);
		loadconfigs_220811(((NimStringDesc*) &TMP4623));
		commanddoc_403946();
	}
	goto LA29;
	LA13: ;
	{
		gcmd_169120 = ((NU8) 8);
		loadconfigs_220811(((NimStringDesc*) &TMP4623));
		definesymbol_201009(((NimStringDesc*) &TMP4747));
		commanddoc2_613257();
	}
	goto LA29;
	LA14: ;
	{
		gcmd_169120 = ((NU8) 16);
		loadconfigs_220811(((NimStringDesc*) &TMP4623));
		commandrst2html_403992();
	}
	goto LA29;
	LA15: ;
	{
		gcmd_169120 = ((NU8) 17);
		loadconfigs_220811(((NimStringDesc*) &TMP4753));
		commandrst2tex_404000();
	}
	goto LA29;
	LA16: ;
	{
		wantmainmodule_612014();
		gcmd_169120 = ((NU8) 8);
		loadconfigs_220811(((NimStringDesc*) &TMP4623));
		wantmainmodule_612014();
		definesymbol_201009(((NimStringDesc*) &TMP4747));
		commandjson_404008();
	}
	goto LA29;
	LA17: ;
	{
		gcmd_169120 = ((NU8) 8);
		loadconfigs_220811(((NimStringDesc*) &TMP4623));
		commandbuildindex_404054();
	}
	goto LA29;
	LA18: ;
	{
		gcmd_169120 = ((NU8) 9);
		commandgendepend_613238();
	}
	goto LA29;
	LA19: ;
	{
		gcmd_169120 = ((NU8) 10);
		{
			NimStringDesc* LOC50;
			jsonnodeobj336042* definedsymbols;
			jsonnodeobj336042* libpaths;
			jsonnodeobj336042* dumpdata;
			TY614683 LOC71;
			NimStringDesc* LOC72;
			LOC50 = 0;
			LOC50 = getconfigvar_169350(((NimStringDesc*) &TMP4834));
			if (!eqStrings(LOC50, ((NimStringDesc*) &TMP4835))) goto LA51;
			wantmainmodule_612014();
			definedsymbols = newjarray_336389();
			{
				NimStringDesc* s_614602;
				s_614602 = 0;
				{
					NimStringDesc* key_615006;
					NimStringDesc* val_615008;
					key_615006 = 0;
					val_615008 = 0;
					{
						NI h_615010;
						NI HEX3Atmp_615012;
						NI res_615014;
						h_615010 = 0;
						HEX3Atmp_615012 = 0;
						HEX3Atmp_615012 = ((*gsymbols_201004).Data->Sup.len-1);
						res_615014 = 0;
						{
							while (1) {
								if (!(res_615014 <= HEX3Atmp_615012)) goto LA57;
								h_615010 = res_615014;
								{
									if (!!((*gsymbols_201004).Data->data[h_615010].Field0 == 0)) goto LA60;
									key_615006 = (*gsymbols_201004).Data->data[h_615010].Field0;
									val_615008 = (*gsymbols_201004).Data->data[h_615010].Field1;
									{
										jsonnodeobj336042* LOC66;
										if (!eqStrings(val_615008, ((NimStringDesc*) &TMP4836))) goto LA64;
										s_614602 = key_615006;
										LOC66 = 0;
										LOC66 = HEX25_336448(s_614602);
										(*definedsymbols).kindU.S7.Elems = (TY336062*) incrSeq(&((*definedsymbols).kindU.S7.Elems)->Sup, sizeof(jsonnodeobj336042*));
										asgnRefNoCycle((void**) (&(*definedsymbols).kindU.S7.Elems->data[(*definedsymbols).kindU.S7.Elems->Sup.len-1]), LOC66);
									}
									LA64: ;
								}
								LA60: ;
								res_615014 += 1;
							} LA57: ;
						}
					}
				}
			}
			libpaths = newjarray_336389();
			{
				NimStringDesc* dir_614636;
				tstrentry127024* it_615018;
				dir_614636 = 0;
				it_615018 = ((tstrentry127024*) (searchpaths_169122.Head));
				{
					while (1) {
						jsonnodeobj336042* LOC70;
						if (!!((it_615018 == NIM_NIL))) goto LA69;
						dir_614636 = (*it_615018).Data;
						LOC70 = 0;
						LOC70 = HEX25_336448(dir_614636);
						(*libpaths).kindU.S7.Elems = (TY336062*) incrSeq(&((*libpaths).kindU.S7.Elems)->Sup, sizeof(jsonnodeobj336042*));
						asgnRefNoCycle((void**) (&(*libpaths).kindU.S7.Elems->data[(*libpaths).kindU.S7.Elems->Sup.len-1]), LOC70);
						it_615018 = ((tstrentry127024*) ((*it_615018).Sup.Next));
					} LA69: ;
				}
			}
			memset((void*)LOC71, 0, sizeof(LOC71));
			LOC71[0].Field0 = copyString(((NimStringDesc*) &TMP4837));
			LOC71[0].Field1 = HEX25_336448(((NimStringDesc*) &TMP4838));
			LOC71[1].Field0 = copyString(((NimStringDesc*) &TMP4839));
			LOC71[1].Field1 = HEX25_336448(gprojectfull_169236);
			LOC71[2].Field0 = copyString(((NimStringDesc*) &TMP4840));
			LOC71[2].Field1 = definedsymbols;
			LOC71[3].Field0 = copyString(((NimStringDesc*) &TMP4841));
			LOC71[3].Field1 = libpaths;
			dumpdata = HEX25_336608(LOC71, 4);
			LOC72 = 0;
			LOC72 = HEX24_340633(dumpdata);
			outwriteln_197198(LOC72);
		}
		goto LA48;
		LA51: ;
		{
			outwriteln_197198(((NimStringDesc*) &TMP4842));
			{
				NimStringDesc* s_614686;
				s_614686 = 0;
				{
					NimStringDesc* key_615024;
					NimStringDesc* val_615026;
					key_615024 = 0;
					val_615026 = 0;
					{
						NI h_615028;
						NI HEX3Atmp_615030;
						NI res_615032;
						h_615028 = 0;
						HEX3Atmp_615030 = 0;
						HEX3Atmp_615030 = ((*gsymbols_201004).Data->Sup.len-1);
						res_615032 = 0;
						{
							while (1) {
								if (!(res_615032 <= HEX3Atmp_615030)) goto LA78;
								h_615028 = res_615032;
								{
									if (!!((*gsymbols_201004).Data->data[h_615028].Field0 == 0)) goto LA81;
									key_615024 = (*gsymbols_201004).Data->data[h_615028].Field0;
									val_615026 = (*gsymbols_201004).Data->data[h_615028].Field1;
									{
										if (!eqStrings(val_615026, ((NimStringDesc*) &TMP4836))) goto LA85;
										s_614686 = key_615024;
										outwriteln_197198(s_614686);
									}
									LA85: ;
								}
								LA81: ;
								res_615032 += 1;
							} LA78: ;
						}
					}
				}
			}
			outwriteln_197198(((NimStringDesc*) &TMP4843));
			{
				NimStringDesc* it_614687;
				tstrentry127024* it_615036;
				it_614687 = 0;
				it_615036 = ((tstrentry127024*) (searchpaths_169122.Head));
				{
					while (1) {
						if (!!((it_615036 == NIM_NIL))) goto LA89;
						it_614687 = (*it_615036).Data;
						msgwriteln_197236(it_614687);
						it_615036 = ((tstrentry127024*) ((*it_615036).Sup.Next));
					} LA89: ;
				}
			}
		}
		LA48: ;
	}
	goto LA29;
	LA20: ;
	{
		gcmd_169120 = ((NU8) 11);
		commandcheck_613246();
	}
	goto LA29;
	LA21: ;
	{
		tnode225816* LOC92;
		gcmd_169120 = ((NU8) 12);
		wantmainmodule_612014();
		LOC92 = 0;
		LOC92 = parsefile_260041(gprojectmainidx_169237);
	}
	goto LA29;
	LA22: ;
	{
		gcmd_169120 = ((NU8) 13);
		wantmainmodule_612014();
		commandscan_613692();
		msgwriteln_197236(((NimStringDesc*) &TMP4847));
	}
	goto LA29;
	LA23: ;
	{
		gcmd_169120 = ((NU8) 18);
		commandinteractive_613607();
	}
	goto LA29;
	LA24: ;
	{
		NimStringDesc* LOC96;
		LOC96 = 0;
		LOC96 = maincommandarg_169319();
		commandeval_613665(LOC96);
	}
	goto LA29;
	LA25: ;
	{
		resetmemory_613770();
	}
	goto LA29;
	LA26: ;
	{
		gcmd_169120 = ((NU8) 14);
		{
			if (!!(((gevalexpr_169130) && (gevalexpr_169130)->Sup.len == 0))) goto LA101;
			commandeval_613665(gevalexpr_169130);
		}
		goto LA99;
		LA101: ;
		{
			commandsuggest_613744();
		}
		LA99: ;
	}
	goto LA29;
	LA27: ;
	{
		isserving_169133 = NIM_TRUE;
		gglobaloptions_169118 |= ((NI32)1)<<((((NU8) 15))%(sizeof(NI32)*8));
		gerrormax_196306 = IL64(9223372036854775807);
		serve_610259(maincommand_614027);
	}
	goto LA29;
	LA28: ;
	{
		rawmessage_197733(((NU16) 180), command_169239);
	}
	LA29: ;
	{
		NIM_BOOL LOC108;
		NIM_BOOL LOC109;
		TY208063 LOC114;
		NF LOC115;
		NI LOC116;
		LOC108 = 0;
		LOC109 = 0;
		LOC109 = (gerrorcounter_196303 == 0);
		if (!(LOC109)) goto LA110;
		LOC109 = !(((525376 &(1<<((gcmd_169120)&31)))!=0));
		LA110: ;
		LOC108 = LOC109;
		if (!(LOC108)) goto LA111;
		LOC108 = (0 < gverbosity_169127);
		LA111: ;
		if (!LOC108) goto LA112;
		memset((void*)LOC114, 0, sizeof(LOC114));
		LOC114[0] = nimIntToStr(glinescompiled_215218);
		LOC115 = 0;
		LOC115 = ntepochTime();
		LOC114[1] = nsuformatFloat(((NF)(LOC115) - (NF)(glastcmdtime_169131)), ((NU8) 1), 3);
		LOC116 = 0;
		LOC116 = gettotalmem_6499();
		LOC114[2] = formatsize_98605(((NI64) (LOC116)), 46);
		rawmessage_197643(((NU16) 260), LOC114, 3);
	}
	LA112: ;
}
NIM_EXTERNC N_NOINLINE(void, HEX00_mainInit)(void) {
}

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

