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

#include <string.h>

#include <stdio.h>
typedef struct tlinkedlist127028 tlinkedlist127028;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tlistentry127022 tlistentry127022;
typedef struct tpass287017 tpass287017;
typedef struct tpasscontext287005 tpasscontext287005;
typedef struct tsym226846 tsym226846;
typedef struct trodreader277030 trodreader277030;
typedef struct tnode226816 tnode226816;
typedef struct tcell44933 tcell44933;
typedef struct TNimType TNimType;
typedef struct tcellseq44949 tcellseq44949;
typedef struct tgcheap47016 tgcheap47016;
typedef struct tcellset44945 tcellset44945;
typedef struct tpagedesc44941 tpagedesc44941;
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 TY612058 TY612058;
typedef struct tmoduleinmemory612017 tmoduleinmemory612017;
typedef struct TY226936 TY226936;
typedef struct jsonnodeobj337042 jsonnodeobj337042;
typedef struct stringtableobj131012 stringtableobj131012;
typedef struct TNimObject TNimObject;
typedef struct TNimNode TNimNode;
typedef struct keyvaluepairseq131010 keyvaluepairseq131010;
typedef struct keyvaluepair131008 keyvaluepair131008;
typedef struct TY337057 TY337057;
typedef struct TY337611 TY337611;
typedef struct TY337062 TY337062;
typedef struct tstrentry127024 tstrentry127024;
typedef struct tllstream212204 tllstream212204;
typedef struct tlexer216190 tlexer216190;
typedef struct tbaselexer214024 tbaselexer214024;
typedef struct tlineinfo196539 tlineinfo196539;
typedef struct ttoken216186 ttoken216186;
typedef struct tident201021 tident201021;
typedef struct TY119808 TY119808;
typedef struct tidobj201015 tidobj201015;
typedef struct ttypeseq226848 ttypeseq226848;
typedef struct ttype226852 ttype226852;
typedef struct tscope226840 tscope226840;
typedef struct TY226947 TY226947;
typedef struct tinstantiation226836 tinstantiation226836;
typedef struct tstrtable226820 tstrtable226820;
typedef struct tsymseq226818 tsymseq226818;
typedef struct tloc226830 tloc226830;
typedef struct trope178009 trope178009;
typedef struct tlib226834 tlib226834;
typedef struct tindex277028 tindex277028;
typedef struct tiitable236274 tiitable236274;
typedef struct tiipairseq236272 tiipairseq236272;
typedef struct tiipair236270 tiipair236270;
typedef struct tidtable226864 tidtable226864;
typedef struct tidpairseq226862 tidpairseq226862;
typedef struct tidpair226860 tidpair226860;
typedef struct memfile275208 memfile275208;
typedef struct tnodeseq226810 tnodeseq226810;
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(tpasscontext287005*, tpassopen287009) (tsym226846* module);
typedef N_NIMCALL_PTR(tpasscontext287005*, tpassopencached287011) (tsym226846* module, trodreader277030* rd);
typedef N_NIMCALL_PTR(tnode226816*, tpassprocess287015) (tpasscontext287005* p, tnode226816* toplevelstmt);
typedef N_NIMCALL_PTR(tnode226816*, tpassclose287013) (tpasscontext287005* p, tnode226816* n);
struct tpass287017 {
tpassopen287009 Field0;
tpassopencached287011 Field1;
tpassprocess287015 Field2;
tpassclose287013 Field3;
};
struct  tcell44933  {
NI Refcount;
TNimType* Typ;
};
struct  tcellseq44949  {
NI Len;
NI Cap;
tcell44933** D;
};
struct  tcellset44945  {
NI Counter;
NI Max;
tpagedesc44941* Head;
tpagedesc44941** 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;
tcellseq44949 Zct;
tcellseq44949 Decstack;
tcellset44945 Cycleroots;
tcellseq44949 Tempstack;
NI Recgclock;
tmemregion27210 Region;
tgcstat47014 Stat;
};
struct  tmoduleinmemory612017  {
NF Compiledat;
NI32 Crc;
TY226936* 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 TY337611 {
NimStringDesc* Field0;
jsonnodeobj337042* Field1;
};
struct  jsonnodeobj337042  {
NU8 Kind;
union {
struct {NimStringDesc* Str;
} S1;
struct {NI64 Num;
} S2;
struct {NF Fnum;
} S3;
struct {NIM_BOOL Bval;
} S4;
struct {TY337057* Fields;
} S6;
struct {TY337062* Elems;
} S7;
} kindU;
};
struct  tlistentry127022  {
  TNimObject Sup;
tlistentry127022* Prev;
tlistentry127022* Next;
};
struct  tstrentry127024  {
  tlistentry127022 Sup;
NimStringDesc* Data;
};
typedef TY337611 TY615683[4];
struct  tbaselexer214024  {
  TNimObject Sup;
NI Bufpos;
NCSTRING Buf;
NI Buflen;
tllstream212204* Stream;
NI Linenumber;
NI Sentinel;
NI Linestart;
};
struct  tlineinfo196539  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (tlineinfo196539 info, NU16 msg, NimStringDesc* arg, void* ClEnv);
void* ClEnv;
} terrorhandler216188;
struct  tlexer216190  {
  tbaselexer214024 Sup;
NI32 Fileidx;
NI Indentahead;
NI Currlineindent;
NIM_BOOL Strongspaces;
terrorhandler216188 Errorhandler;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  ttoken216186  {
NU8 Toktype;
NI Indent;
tident201021* Ident;
NI64 Inumber;
NF Fnumber;
NU8 Base;
NI8 Strongspacea;
NI8 Strongspaceb;
NimStringDesc* Literal;
NI Line;
NI Col;
};
struct  tidobj201015  {
  TNimObject Sup;
NI Id;
};
struct  tstrtable226820  {
NI Counter;
tsymseq226818* Data;
};
struct  tloc226830  {
NU8 K;
NU8 S;
NU8 Flags;
ttype226852* T;
trope178009* R;
trope178009* Heaproot;
};
struct  tsym226846  {
  tidobj201015 Sup;
NU8 Kind;
union {
struct {ttypeseq226848* Typeinstcache;
tscope226840* Typscope;
} S1;
struct {TY226947* Procinstcache;
tscope226840* Scope;
} S2;
struct {TY226947* Usedgenerics;
tstrtable226820 Tab;
} S3;
struct {tsym226846* Guard;
} S4;
} kindU;
NU16 Magic;
ttype226852* Typ;
tident201021* Name;
tlineinfo196539 Info;
tsym226846* Owner;
NU32 Flags;
tnode226816* Ast;
NU32 Options;
NI Position;
NI Offset;
tloc226830 Loc;
tlib226834* Annex;
tnode226816* Constraint;
};
typedef tpass287017 TY614650[3];
typedef tident201021* TY201034[8192];
typedef N_NIMCALL_PTR(void, TY611261) (void);
typedef NimStringDesc* TY209063[3];
struct  tpasscontext287005  {
  TNimObject Sup;
NIM_BOOL Fromcache;
};
struct  tiipair236270  {
NI Key;
NI Val;
};
struct  tiitable236274  {
NI Counter;
tiipairseq236272* Data;
};
struct  tindex277028  {
NI Lastidxkey;
NI Lastidxval;
tiitable236274 Tab;
NimStringDesc* R;
NI Offset;
};
struct  tidpair226860  {
tidobj201015* Key;
TNimObject* Val;
};
struct  tidtable226864  {
NI Counter;
tidpairseq226862* Data;
};
struct  memfile275208  {
void* Mem;
NI Size;
int Handle;
};
struct  trodreader277030  {
  TNimObject Sup;
NI Pos;
NCSTRING S;
NU32 Options;
NU8 Reason;
TY226936* Moddeps;
TY226936* Files;
NI Dataidx;
NI Convertersidx;
NI Initidx;
NI Interfidx;
NI Compilerprocsidx;
NI Methodsidx;
NimStringDesc* Filename;
tindex277028 Index;
tindex277028 Imports;
NI Readerindex;
NI Line;
NI Moduleid;
tidtable226864 Syms;
memfile275208 Memfile;
tsymseq226818* Methods;
NimStringDesc* Origfile;
NIM_BOOL Inviewmode;
};
struct  tnode226816  {
ttype226852* Typ;
tlineinfo196539 Info;
NU16 Flags;
NU8 Kind;
union {
struct {NI64 Intval;
} S1;
struct {NF Floatval;
} S2;
struct {NimStringDesc* Strval;
} S3;
struct {tsym226846* Sym;
} S4;
struct {tident201021* Ident;
} S5;
struct {tnodeseq226810* Sons;
} S6;
} kindU;
NimStringDesc* Comment;
};
typedef NI TY26420[16];
struct  tpagedesc44941  {
tpagedesc44941* 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  tllstream212204  {
  TNimObject Sup;
NU8 Kind;
FILE* F;
NimStringDesc* S;
NI Rd;
NI Wr;
NI Lineoffset;
};
struct  tident201021  {
  tidobj201015 Sup;
NimStringDesc* S;
tident201021* Next;
NI H;
};
struct  ttype226852  {
  tidobj201015 Sup;
NU8 Kind;
NU8 Callconv;
NU32 Flags;
ttypeseq226848* Sons;
tnode226816* N;
tsym226846* Owner;
tsym226846* Sym;
tsym226846* Destructor;
tsym226846* Deepcopy;
NI64 Size;
NI16 Align;
NI16 Locklevel;
tloc226830 Loc;
};
struct  tscope226840  {
NI Depthlevel;
tstrtable226820 Symbols;
tnodeseq226810* Usingsyms;
tscope226840* Parent;
};
struct  tinstantiation226836  {
tsym226846* Sym;
ttypeseq226848* Concretetypes;
TY226936* Usedby;
};
struct  trope178009  {
  TNimObject Sup;
trope178009* Left;
trope178009* Right;
NI Length;
NimStringDesc* Data;
};
struct  tlib226834  {
  tlistentry127022 Sup;
NU8 Kind;
NIM_BOOL Generated;
NIM_BOOL Isoverriden;
trope178009* Name;
tnode226816* Path;
};
struct  tfreecell26430  {
tfreecell26430* Next;
NI Zerofield;
};
struct TY226936 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct TY612058 {
  TGenericSeq Sup;
  tmoduleinmemory612017 data[SEQ_DECL_SIZE];
};
struct keyvaluepairseq131010 {
  TGenericSeq Sup;
  keyvaluepair131008 data[SEQ_DECL_SIZE];
};
struct TY337057 {
  TGenericSeq Sup;
  TY337611 data[SEQ_DECL_SIZE];
};
struct TY337062 {
  TGenericSeq Sup;
  jsonnodeobj337042* data[SEQ_DECL_SIZE];
};
struct TY119808 {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct ttypeseq226848 {
  TGenericSeq Sup;
  ttype226852* data[SEQ_DECL_SIZE];
};
struct TY226947 {
  TGenericSeq Sup;
  tinstantiation226836* data[SEQ_DECL_SIZE];
};
struct tsymseq226818 {
  TGenericSeq Sup;
  tsym226846* data[SEQ_DECL_SIZE];
};
struct tiipairseq236272 {
  TGenericSeq Sup;
  tiipair236270 data[SEQ_DECL_SIZE];
};
struct tidpairseq226862 {
  TGenericSeq Sup;
  tidpair226860 data[SEQ_DECL_SIZE];
};
struct tnodeseq226810 {
  TGenericSeq Sup;
  tnode226816* data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, clearpasses_287206)(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_225446)(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_614268)(void);
N_NIMCALL(void, semanticpasses_614230)(void);
N_NIMCALL(void, registerpass_287214)(tpass287017 p);
N_NIMCALL(tpasscontext287005*, verboseopen_608012)(tsym226846* s);
N_NIMCALL(tnode226816*, verboseprocess_608023)(tpasscontext287005* context, tnode226816* n);
N_NIMCALL(tpasscontext287005*, myopen_545456)(tsym226846* module);
N_NIMCALL(tpasscontext287005*, myopencached_545499)(tsym226846* module, trodreader277030* rd);
N_NIMCALL(tnode226816*, myprocess_545640)(tpasscontext287005* context, tnode226816* n);
N_NIMCALL(tnode226816*, myclose_545656)(tpasscontext287005* context, tnode226816* n);
N_NIMCALL(tpasscontext287005*, myopen_592544)(tsym226846* module);
N_NIMCALL(tpasscontext287005*, myopencached_592720)(tsym226846* module, trodreader277030* rd);
N_NIMCALL(tnode226816*, myprocess_592808)(tpasscontext287005* b, tnode226816* n);
N_NIMCALL(tnode226816*, myclose_593246)(tpasscontext287005* b, tnode226816* n);
N_NIMCALL(void, rodpass_614201)(void);
N_NIMCALL(tpasscontext287005*, myopen_303688)(tsym226846* module);
N_NIMCALL(tnode226816*, process_303205)(tpasscontext287005* c, tnode226816* n);
N_NIMCALL(tnode226816*, myclose_303701)(tpasscontext287005* c, tnode226816* n);
N_NIMCALL(void, compileproject_613077)(NI32 projectfileidx);
N_NIMCALL(void, cgenwritemodules_593360)(void);
N_NIMCALL(void, callccompiler_204541)(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(tcell44933*, usrtocell_48646)(void* usr);
static N_INLINE(void, rtladdzct_50204)(tcell44933* c);
N_NOINLINE(void, addzct_48617)(tcellseq44949* s, tcell44933* c);
N_NIMCALL(void, resetcgenmodules_592397)(void);
N_NIMCALL(void, resetcompilationlists_203886)(void);
N_NIMCALL(void, resetcaches_549365)(void);
N_NIMCALL(void, gcfullcollect_8005)(void);
N_NIMCALL(void, setcc_203708)(NimStringDesc* ccname);
N_NIMCALL(void, definesymbol_202009)(NimStringDesc* symbol);
N_NIMCALL(void, rawmessage_198733)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, commandcompiletojs_614401)(void);
N_NIMCALL(void, settarget_175621)(NU8 o, NU8 c);
N_NIMCALL(tpasscontext287005*, myopen_607239)(tsym226846* s);
N_NIMCALL(tpasscontext287005*, myopencached_607228)(tsym226846* s, trodreader277030* rd);
N_NIMCALL(tnode226816*, myprocess_607062)(tpasscontext287005* b, tnode226816* n);
N_NIMCALL(tnode226816*, myclose_607197)(tpasscontext287005* b, tnode226816* n);
N_NIMCALL(void, wantmainmodule_613014)(void);
N_NIMCALL(void, loadconfigs_221811)(NimStringDesc* cfg);
N_NIMCALL(void, commanddoc_404946)(void);
N_NIMCALL(void, commanddoc2_614257)(void);
N_NIMCALL(tpasscontext287005*, myopen_610070)(tsym226846* module);
N_NIMCALL(tnode226816*, processnode_610058)(tpasscontext287005* c, tnode226816* n);
N_NIMCALL(tnode226816*, close_610018)(tpasscontext287005* p, tnode226816* n);
N_NIMCALL(void, finishdoc2pass_610114)(NimStringDesc* project);
N_NIMCALL(void, commandrst2html_404992)(void);
N_NIMCALL(void, commandrst2tex_405000)(void);
N_NIMCALL(void, commandjson_405008)(void);
N_NIMCALL(void, commandbuildindex_405054)(void);
N_NIMCALL(void, commandgendepend_614238)(void);
N_NIMCALL(tpasscontext287005*, myopen_609168)(tsym226846* module);
N_NIMCALL(tnode226816*, adddotdependency_609043)(tpasscontext287005* c, tnode226816* n);
N_NIMCALL(tnode226816*, cleanup_608077)(tpasscontext287005* c, tnode226816* n);
N_NIMCALL(void, generatedot_609009)(NimStringDesc* project);
N_NIMCALL(void, execexternalprogram_203907)(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_170350)(NimStringDesc* key);
N_NIMCALL(jsonnodeobj337042*, newjarray_337389)(void);
N_NIMCALL(jsonnodeobj337042*, HEX25_337448)(NimStringDesc* s);
N_NIMCALL(TGenericSeq*, incrSeq)(TGenericSeq* seq, NI elemsize);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(jsonnodeobj337042*, HEX25_337608)(TY337611* keyvals, NI keyvalsLen0);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(void, outwriteln_198198)(NimStringDesc* s);
N_NIMCALL(NimStringDesc*, HEX24_341633)(jsonnodeobj337042* node);
N_NIMCALL(void, msgwriteln_198236)(NimStringDesc* s);
N_NIMCALL(void, commandcheck_614246)(void);
N_NIMCALL(tnode226816*, parsefile_261041)(NI32 fileidx);
N_NIMCALL(void, commandscan_614692)(void);
N_NIMCALL(NimStringDesc*, nosaddFileExt)(NimStringDesc* filename, NimStringDesc* ext);
N_NIMCALL(NimStringDesc*, maincommandarg_170319)(void);
N_NIMCALL(tllstream212204*, llstreamopen_212233)(NimStringDesc* filename, NU8 mode);
N_NIMCALL(void, inittoken_216482)(ttoken216186* l);
N_NIMCALL(void, openlexer_216277)(tlexer216190* lex, NimStringDesc* filename, tllstream212204* inputstream);
N_NIMCALL(void, rawgettok_216238)(tlexer216190* l, ttoken216186* tok);
N_NIMCALL(void, printtok_216265)(ttoken216186* tok);
N_NIMCALL(void, closelexer_216258)(tlexer216190* lex);
N_NIMCALL(void, commandinteractive_614607)(void);
N_NIMCALL(void, interactivepasses_614409)(void);
N_NIMCALL(void, initdefines_202146)(void);
N_NIMCALL(tpasscontext287005*, myopen_477283)(tsym226846* module);
N_NIMCALL(tnode226816*, myprocess_477412)(tpasscontext287005* c, tnode226816* n);
N_NIMCALL(void, compilesystemmodule_612988)(void);
N_NIMCALL(tsym226846*, compilemodule_612776)(NI32 fileidx, NU32 flags);
N_NIMCALL(NI32, fileinfoidx_196747)(NimStringDesc* filename);
N_NIMCALL(tsym226846*, makestdinmodule_613097)(void);
N_NIMCALL(void, processmodule_287056)(tsym226846* module, tllstream212204* stream, trodreader277030* rd);
N_NIMCALL(tllstream212204*, llstreamopenstdin_212245)(void);
N_NIMCALL(void, commandeval_614665)(NimStringDesc* exp);
N_NIMCALL(void, evalnim_614655)(tnode226816* nodes, tsym226846* module);
N_NIMCALL(void, carrypasses_287257)(tnode226816* nodes, tsym226846* module, tpass287017* passes, NI passesLen0);
N_NIMCALL(tnode226816*, parsestring_249539)(NimStringDesc* s, NimStringDesc* filename, NI line, terrorhandler216188 errorhandler);
N_NIMCALL(void, resetmemory_614770)(void);
N_NIMCALL(void, resetallmodules_612411)(void);
N_NIMCALL(void, resetropecache_178247)(void);
N_NIMCALL(void, resetsystypes_283359)(void);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
N_NIMCALL(void, commandsuggest_614744)(void);
N_NIMCALL(void, resetmodule_612402)(NI32 fileidx);
N_NIMCALL(void, deffromsourcemap_421834)(tlineinfo196539 i);
N_NIMCALL(void, serve_611259)(TY611261 action);
N_NIMCALL(void, maincommand_615027)(void);
N_NIMCALL(void, rawmessage_198643)(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_98604)(NI64 bytes, NIM_CHAR decimalsep);
N_NIMCALL(NI, gettotalmem_6499)(void);
STRING_LITERAL(TMP1917, "c", 1);
STRING_LITERAL(TMP1918, "cc", 2);
STRING_LITERAL(TMP1919, "compile", 7);
STRING_LITERAL(TMP1920, "compiletoc", 10);
STRING_LITERAL(TMP1921, "cpp", 3);
STRING_LITERAL(TMP1922, "compiletocpp", 12);
STRING_LITERAL(TMP1923, "objc", 4);
STRING_LITERAL(TMP1924, "compiletooc", 11);
STRING_LITERAL(TMP1925, "run", 3);
STRING_LITERAL(TMP1926, "js", 2);
STRING_LITERAL(TMP1927, "compiletojs", 11);
STRING_LITERAL(TMP1928, "compiletollvm", 13);
STRING_LITERAL(TMP1929, "doc", 3);
STRING_LITERAL(TMP1930, "doc2", 4);
STRING_LITERAL(TMP1931, "rst2html", 8);
STRING_LITERAL(TMP1932, "rst2tex", 7);
STRING_LITERAL(TMP1933, "jsondoc", 7);
STRING_LITERAL(TMP1934, "buildindex", 10);
STRING_LITERAL(TMP1935, "gendepend", 9);
STRING_LITERAL(TMP1936, "dump", 4);
STRING_LITERAL(TMP1937, "check", 5);
STRING_LITERAL(TMP1938, "parse", 5);
STRING_LITERAL(TMP1939, "scan", 4);
STRING_LITERAL(TMP1940, "i", 1);
STRING_LITERAL(TMP1941, "e", 1);
STRING_LITERAL(TMP1942, "reset", 5);
STRING_LITERAL(TMP1943, "idetools", 8);
STRING_LITERAL(TMP1944, "serve", 5);
STRING_LITERAL(TMP4230, "", 0);
STRING_LITERAL(TMP4231, "gcc", 3);
STRING_LITERAL(TMP4232, "nimrod", 6);
STRING_LITERAL(TMP4233, "ecmascript", 10);
STRING_LITERAL(TMP4624, "nimdoc.cfg", 10);
STRING_LITERAL(TMP4748, "nimdoc", 6);
STRING_LITERAL(TMP4754, "nimdoc.tex.cfg", 14);
STRING_LITERAL(TMP4832, "dot -Tpng -o", 12);
STRING_LITERAL(TMP4833, "png", 3);
STRING_LITERAL(TMP4834, "dot", 3);
STRING_LITERAL(TMP4835, "dump.format", 11);
STRING_LITERAL(TMP4836, "json", 4);
STRING_LITERAL(TMP4837, "true", 4);
STRING_LITERAL(TMP4838, "version", 7);
STRING_LITERAL(TMP4839, "0.10.2", 6);
STRING_LITERAL(TMP4840, "project_path", 12);
STRING_LITERAL(TMP4841, "defined_symbols", 15);
STRING_LITERAL(TMP4842, "lib_paths", 9);
STRING_LITERAL(TMP4843, "-- list of currently defined symbols --", 39);
STRING_LITERAL(TMP4844, "-- end of list --", 17);
STRING_LITERAL(TMP4845, "nim", 3);
STRING_LITERAL(TMP4848, "Beware: Indentation tokens depend on the parser\'s state!", 56);
STRING_LITERAL(TMP4849, "nimrodvm", 8);
STRING_LITERAL(TMP4852, "echo \"eval\\t\", repr(", 20);
STRING_LITERAL(TMP4853, ")", 1);
static NIM_CONST terrorhandler216188 TMP4854 = {NIM_NIL,NIM_NIL};
extern NF glastcmdtime_170131;
extern tlinkedlist127028 searchpaths_170122;
extern NimStringDesc* libpath_170233;
extern NimStringDesc* gprojectfull_170236;
extern NimStringDesc* gprojectpath_170235;
extern NI gfrontendid_225012;
extern NimStringDesc* command_170239;
extern NU8 gcmd_170120;
extern NU32 gglobaloptions_170118;
extern NIM_BOOL isserving_170133;
extern NimStringDesc* lastcaascmd_611205;
extern NimStringDesc* curcaascmd_611204;
extern tgcheap47016 gch_47044;
extern TY612058* gmemcachedata_612079;
extern NU8 ccompiler_203461;
extern NI gerrormax_197309;
extern NimStringDesc* gprojectname_170234;
extern stringtableobj131012* gsymbols_202004;
extern NI32 gprojectmainidx_170237;
extern TNimType NTI216190; /* TLexer */
extern TY119808* commandargs_170261;
extern tsym226846* systemmodule_283019;
extern tsymseq226818* gowners_291293;
extern TNimType NTI226818; /* TSymSeq */
extern tsym226846* rangedestructorproc_516764;
extern TY201034 buckets_201039;
extern tident201021* idanon_201504;
extern NimStringDesc* gevalexpr_170130;
extern NI32 gdirtybufferidx_170134;
extern tlineinfo196539 opttrackpos_198156;
extern NI32 gdirtyoriginalidx_170135;
extern NI gerrorcounter_197306;
extern NI gverbosity_170127;
extern NI glinescompiled_216218;

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

N_NIMCALL(void, semanticpasses_614230)(void) {
	tpass287017 LOC1;
	tpass287017 LOC2;
	LOC1.Field0 = verboseopen_608012;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = verboseprocess_608023;
	LOC1.Field3 = NIM_NIL;
	registerpass_287214(LOC1);
	LOC2.Field0 = myopen_545456;
	LOC2.Field1 = myopencached_545499;
	LOC2.Field2 = myprocess_545640;
	LOC2.Field3 = myclose_545656;
	registerpass_287214(LOC2);
}

N_NIMCALL(void, rodpass_614201)(void) {
	{
		tpass287017 LOC5;
		if (!((gglobaloptions_170118 &(1<<((((NU8) 14))&31)))!=0)) goto LA3;
		LOC5.Field0 = myopen_303688;
		LOC5.Field1 = NIM_NIL;
		LOC5.Field2 = process_303205;
		LOC5.Field3 = myclose_303701;
		registerpass_287214(LOC5);
	}
	LA3: ;
}

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

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

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

N_NIMCALL(void, commandcompiletoc_614268)(void) {
	tpass287017 LOC1;
	semanticpasses_614230();
	LOC1.Field0 = myopen_592544;
	LOC1.Field1 = myopencached_592720;
	LOC1.Field2 = myprocess_592808;
	LOC1.Field3 = myclose_593246;
	registerpass_287214(LOC1);
	rodpass_614201();
	{
		if (!((gglobaloptions_170118 &(1<<((((NU8) 15))&31)))!=0)) goto LA4;
	}
	LA4: ;
	compileproject_613077(((NI32) -1));
	cgenwritemodules_593360();
	{
		NimStringDesc* LOC10;
		if (!!((gcmd_170120 == ((NU8) 19)))) goto LA8;
		LOC10 = 0;
		LOC10 = noschangeFileExt(gprojectfull_170236, ((NimStringDesc*) &TMP4230));
		callccompiler_204541(LOC10);
	}
	LA8: ;
	{
		NimStringDesc* LOC15;
		if (!isserving_170133) goto LA13;
		LOC15 = 0;
		LOC15 = lastcaascmd_611205; lastcaascmd_611205 = copyStringRC1(curcaascmd_611204);
		if (LOC15) nimGCunrefNoCycle(LOC15);
		resetcgenmodules_592397();
		{
			NI i_614324;
			NI HEX3Atmp_614326;
			NI res_614329;
			i_614324 = 0;
			HEX3Atmp_614326 = 0;
			HEX3Atmp_614326 = (gmemcachedata_612079->Sup.len - 1);
			res_614329 = 0;
			{
				while (1) {
					if (!(res_614329 <= HEX3Atmp_614326)) goto LA18;
					i_614324 = res_614329;
					gmemcachedata_612079->data[i_614324].Crcstatus = ((NU8) 1);
					gmemcachedata_612079->data[i_614324].Needsrecompile = ((NU8) 0);
					res_614329 += 1;
				} LA18: ;
			}
		}
		resetcompilationlists_203886();
		resetcaches_549365();
		gcfullcollect_8005();
	}
	LA13: ;
}

N_NIMCALL(void, commandcompiletojs_614401)(void) {
	tpass287017 LOC1;
	settarget_175621(((NU8) 21), ((NU8) 12));
	definesymbol_202009(((NimStringDesc*) &TMP4232));
	definesymbol_202009(((NimStringDesc*) &TMP4233));
	definesymbol_202009(((NimStringDesc*) &TMP1926));
	semanticpasses_614230();
	LOC1.Field0 = myopen_607239;
	LOC1.Field1 = myopencached_607228;
	LOC1.Field2 = myprocess_607062;
	LOC1.Field3 = myclose_607197;
	registerpass_287214(LOC1);
	compileproject_613077(((NI32) -1));
}

N_NIMCALL(void, commanddoc2_614257)(void) {
	tpass287017 LOC1;
	gerrormax_197309 = 2147483647;
	semanticpasses_614230();
	LOC1.Field0 = myopen_610070;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = processnode_610058;
	LOC1.Field3 = close_610018;
	registerpass_287214(LOC1);
	compileproject_613077(((NI32) -1));
	finishdoc2pass_610114(gprojectname_170234);
}

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

static N_INLINE(void, appendChar)(NimStringDesc* dest, NIM_CHAR c) {
	(*dest).data[((*dest).Sup.len)- 0] = c;
	(*dest).data[((NI32)((*dest).Sup.len + 1))- 0] = 0;
	(*dest).Sup.len += 1;
}

N_NIMCALL(void, commandgendepend_614238)(void) {
	tpass287017 LOC1;
	tpass287017 LOC2;
	NimStringDesc* LOC3;
	NimStringDesc* LOC4;
	NimStringDesc* LOC5;
	semanticpasses_614230();
	LOC1.Field0 = myopen_609168;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = adddotdependency_609043;
	LOC1.Field3 = NIM_NIL;
	registerpass_287214(LOC1);
	LOC2.Field0 = NIM_NIL;
	LOC2.Field1 = NIM_NIL;
	LOC2.Field2 = cleanup_608077;
	LOC2.Field3 = cleanup_608077;
	registerpass_287214(LOC2);
	compileproject_613077(((NI32) -1));
	generatedot_609009(gprojectfull_170236);
	LOC3 = 0;
	LOC4 = 0;
	LOC4 = noschangeFileExt(gprojectfull_170236, ((NimStringDesc*) &TMP4833));
	LOC5 = 0;
	LOC5 = noschangeFileExt(gprojectfull_170236, ((NimStringDesc*) &TMP4834));
	LOC3 = rawNewString(LOC4->Sup.len + LOC5->Sup.len + 13);
appendString(LOC3, ((NimStringDesc*) &TMP4832));
appendString(LOC3, LOC4);
appendChar(LOC3, 32);
appendString(LOC3, LOC5);
	execexternalprogram_203907(LOC3, ((NimStringDesc*) &TMP4230));
}

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

N_NIMCALL(void, commandcheck_614246)(void) {
	gerrormax_197309 = 2147483647;
	semanticpasses_614230();
	rodpass_614201();
	compileproject_613077(((NI32) -1));
}

N_NIMCALL(void, commandscan_614692)(void) {
	NimStringDesc* f;
	NimStringDesc* LOC1;
	tllstream212204* stream;
	LOC1 = 0;
	LOC1 = maincommandarg_170319();
	f = nosaddFileExt(LOC1, ((NimStringDesc*) &TMP4845));
	stream = llstreamopen_212233(f, ((NU8) 0));
	{
		tlexer216190 l;
		ttoken216186 tok;
		if (!!((stream == NIM_NIL))) goto LA4;
		memset((void*)(&l), 0, sizeof(l));
		l.Sup.Sup.m_type = (&NTI216190);
		memset((void*)(&tok), 0, sizeof(tok));
		inittoken_216482((&tok));
		openlexer_216277((&l), f, stream);
		{
			while (1) {
				rawgettok_216238((&l), (&tok));
				printtok_216265((&tok));
				{
					if (!(tok.Toktype == ((NU8) 1))) goto LA10;
					goto LA6;
				}
				LA10: ;
			}
		} LA6: ;
		closelexer_216258((&l));
	}
	goto LA2;
	LA4: ;
	{
		rawmessage_198733(((NU16) 3), f);
	}
	LA2: ;
}

N_NIMCALL(void, interactivepasses_614409)(void) {
	tpass287017 LOC1;
	tpass287017 LOC2;
	tpass287017 LOC3;
	initdefines_202146();
	definesymbol_202009(((NimStringDesc*) &TMP4849));
	LOC1.Field0 = verboseopen_608012;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = verboseprocess_608023;
	LOC1.Field3 = NIM_NIL;
	registerpass_287214(LOC1);
	LOC2.Field0 = myopen_545456;
	LOC2.Field1 = myopencached_545499;
	LOC2.Field2 = myprocess_545640;
	LOC2.Field3 = myclose_545656;
	registerpass_287214(LOC2);
	LOC3.Field0 = myopen_477283;
	LOC3.Field1 = NIM_NIL;
	LOC3.Field2 = myprocess_477412;
	LOC3.Field3 = myprocess_477412;
	registerpass_287214(LOC3);
}

N_NIMCALL(void, commandinteractive_614607)(void) {
	gerrormax_197309 = 2147483647;
	interactivepasses_614409();
	compilesystemmodule_612988();
	{
		NI32 LOC5;
		tsym226846* LOC6;
		if (!(0 < commandargs_170261->Sup.len)) goto LA3;
		LOC5 = 0;
		LOC5 = fileinfoidx_196747(gprojectfull_170236);
		LOC6 = 0;
		LOC6 = compilemodule_612776(LOC5, 0);
	}
	goto LA1;
	LA3: ;
	{
		tsym226846* m;
		tllstream212204* LOC8;
		m = makestdinmodule_613097();
		(*m).Flags |= ((NI32)1)<<((((NU8) 12))%(sizeof(NI32)*8));
		LOC8 = 0;
		LOC8 = llstreamopenstdin_212245();
		processmodule_287056(m, LOC8, NIM_NIL);
	}
	LA1: ;
}

N_NIMCALL(void, evalnim_614655)(tnode226816* nodes, tsym226846* module) {
	TY614650 LOC1;
	LOC1[0].Field0 = verboseopen_608012;
	LOC1[0].Field1 = NIM_NIL;
	LOC1[0].Field2 = verboseprocess_608023;
	LOC1[0].Field3 = NIM_NIL;
	LOC1[1].Field0 = myopen_545456;
	LOC1[1].Field1 = myopencached_545499;
	LOC1[1].Field2 = myprocess_545640;
	LOC1[1].Field3 = myclose_545656;
	LOC1[2].Field0 = myopen_477283;
	LOC1[2].Field1 = NIM_NIL;
	LOC1[2].Field2 = myprocess_477412;
	LOC1[2].Field3 = myprocess_477412;
	carrypasses_287257(nodes, module, LOC1, 3);
}

N_NIMCALL(void, commandeval_614665)(NimStringDesc* exp) {
	NimStringDesc* echoexp;
	NimStringDesc* LOC5;
	tnode226816* LOC6;
	tsym226846* LOC7;
	{
		if (!(systemmodule_283019 == NIM_NIL)) goto LA3;
		interactivepasses_614409();
		compilesystemmodule_612988();
	}
	LA3: ;
	LOC5 = 0;
	LOC5 = rawNewString(exp->Sup.len + 21);
appendString(LOC5, ((NimStringDesc*) &TMP4852));
appendString(LOC5, exp);
appendString(LOC5, ((NimStringDesc*) &TMP4853));
	echoexp = LOC5;
	LOC6 = 0;
	LOC6 = parsestring_249539(echoexp, ((NimStringDesc*) &TMP4230), 0, TMP4854);
	LOC7 = 0;
	LOC7 = makestdinmodule_613097();
	evalnim_614655(LOC6, LOC7);
}

N_NIMCALL(void, resetmemory_614770)(void) {
	resetcompilationlists_203886();
	resetcaches_549365();
	resetallmodules_612411();
	resetropecache_178247();
	resetsystypes_283359();
	if (gowners_291293) nimGCunrefNoCycle(gowners_291293);
	gowners_291293 = (tsymseq226818*) newSeqRC1((&NTI226818), 0);
	asgnRefNoCycle((void**) (&rangedestructorproc_516764), NIM_NIL);
	{
		NI i_614827;
		NI res_615005;
		i_614827 = 0;
		res_615005 = 0;
		{
			while (1) {
				if (!(((NI) (res_615005)) <= 8191)) goto LA3;
				i_614827 = res_615005;
				asgnRefNoCycle((void**) (&buckets_201039[(i_614827)- 0]), NIM_NIL);
				res_615005 += 1;
			} LA3: ;
		}
	}
	asgnRefNoCycle((void**) (&idanon_201504), NIM_NIL);
}

N_NIMCALL(void, commandsuggest_614744)(void) {
	{
		if (!isserving_170133) goto LA3;
		commandcompiletoc_614268();
		{
			tsym226846* LOC9;
			if (!!((gdirtybufferidx_170134 == ((NI32) 0)))) goto LA7;
			LOC9 = 0;
			LOC9 = compilemodule_612776(gdirtybufferidx_170134, 512);
			resetmodule_612402(gdirtybufferidx_170134);
		}
		LA7: ;
		{
			if (!((gglobaloptions_170118 &(1<<((((NU8) 25))&31)))!=0)) goto LA12;
			deffromsourcemap_421834(opttrackpos_198156);
		}
		LA12: ;
	}
	goto LA1;
	LA3: ;
	{
		NI32 projfile;
		gerrormax_197309 = 2147483647;
		semanticpasses_614230();
		rodpass_614201();
		{
			if (!(gprojectmainidx_170237 == gdirtyoriginalidx_170135)) goto LA17;
			projfile = gdirtybufferidx_170134;
		}
		goto LA15;
		LA17: ;
		{
			projfile = gprojectmainidx_170237;
		}
		LA15: ;
		compileproject_613077(projfile);
	}
	LA1: ;
}

N_NIMCALL(void, maincommand_615027)(void) {
	NimStringDesc* LOC5;
	clearpasses_287206();
	glastcmdtime_170131 = ntepochTime();
	appendstr_127286((&searchpaths_170122), libpath_170233);
	{
		if (!!((gprojectfull_170236->Sup.len == 0))) goto LA3;
		prependstr_127424((&searchpaths_170122), gprojectpath_170235);
	}
	LA3: ;
	setid_225446(100);
	LOC5 = 0;
	LOC5 = nsuNormalize(command_170239);
	switch (hashString(LOC5) & 31) {
	case 0: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1919))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1924))) goto LA8;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1943))) goto LA26;
break;
	case 2: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1936))) goto LA19;
break;
	case 4: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1938))) goto LA21;
break;
	case 7: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1931))) goto LA14;
break;
	case 9: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1925))) goto LA9;
break;
	case 10: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1918))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1927))) goto LA10;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1937))) goto LA20;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1942))) goto LA25;
break;
	case 11: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1935))) goto LA18;
break;
	case 13: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1929))) goto LA12;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1932))) goto LA15;
break;
	case 14: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1933))) goto LA16;
break;
	case 15: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1940))) goto LA23;
break;
	case 16: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1920))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1941))) goto LA24;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1944))) goto LA27;
break;
	case 19: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1922))) goto LA7;
break;
	case 25: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1917))) goto LA6;
break;
	case 26: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1939))) goto LA22;
break;
	case 27: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1921))) goto LA7;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1926))) goto LA10;
break;
	case 28: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1928))) goto LA11;
break;
	case 29: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1934))) goto LA17;
break;
	case 31: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1923))) goto LA8;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1930))) goto LA13;
break;
	}
	goto LA28;
	LA6: ;
	{
		gcmd_170120 = ((NU8) 1);
		commandcompiletoc_614268();
	}
	goto LA29;
	LA7: ;
	{
		gcmd_170120 = ((NU8) 2);
		{
			if (!(ccompiler_203461 == ((NU8) 1))) goto LA34;
			setcc_203708(((NimStringDesc*) &TMP4231));
		}
		LA34: ;
		definesymbol_202009(((NimStringDesc*) &TMP1921));
		commandcompiletoc_614268();
	}
	goto LA29;
	LA8: ;
	{
		gcmd_170120 = ((NU8) 3);
		definesymbol_202009(((NimStringDesc*) &TMP1923));
		commandcompiletoc_614268();
	}
	goto LA29;
	LA9: ;
	{
		gcmd_170120 = ((NU8) 19);
		rawmessage_198733(((NU16) 180), command_170239);
	}
	goto LA29;
	LA10: ;
	{
		gcmd_170120 = ((NU8) 4);
		commandcompiletojs_614401();
	}
	goto LA29;
	LA11: ;
	{
		gcmd_170120 = ((NU8) 5);
		rawmessage_198733(((NU16) 180), command_170239);
	}
	goto LA29;
	LA12: ;
	{
		wantmainmodule_613014();
		gcmd_170120 = ((NU8) 8);
		loadconfigs_221811(((NimStringDesc*) &TMP4624));
		commanddoc_404946();
	}
	goto LA29;
	LA13: ;
	{
		gcmd_170120 = ((NU8) 8);
		loadconfigs_221811(((NimStringDesc*) &TMP4624));
		definesymbol_202009(((NimStringDesc*) &TMP4748));
		commanddoc2_614257();
	}
	goto LA29;
	LA14: ;
	{
		gcmd_170120 = ((NU8) 16);
		loadconfigs_221811(((NimStringDesc*) &TMP4624));
		commandrst2html_404992();
	}
	goto LA29;
	LA15: ;
	{
		gcmd_170120 = ((NU8) 17);
		loadconfigs_221811(((NimStringDesc*) &TMP4754));
		commandrst2tex_405000();
	}
	goto LA29;
	LA16: ;
	{
		wantmainmodule_613014();
		gcmd_170120 = ((NU8) 8);
		loadconfigs_221811(((NimStringDesc*) &TMP4624));
		wantmainmodule_613014();
		definesymbol_202009(((NimStringDesc*) &TMP4748));
		commandjson_405008();
	}
	goto LA29;
	LA17: ;
	{
		gcmd_170120 = ((NU8) 8);
		loadconfigs_221811(((NimStringDesc*) &TMP4624));
		commandbuildindex_405054();
	}
	goto LA29;
	LA18: ;
	{
		gcmd_170120 = ((NU8) 9);
		commandgendepend_614238();
	}
	goto LA29;
	LA19: ;
	{
		gcmd_170120 = ((NU8) 10);
		{
			NimStringDesc* LOC50;
			jsonnodeobj337042* definedsymbols;
			jsonnodeobj337042* libpaths;
			jsonnodeobj337042* dumpdata;
			TY615683 LOC71;
			NimStringDesc* LOC72;
			LOC50 = 0;
			LOC50 = getconfigvar_170350(((NimStringDesc*) &TMP4835));
			if (!eqStrings(LOC50, ((NimStringDesc*) &TMP4836))) goto LA51;
			wantmainmodule_613014();
			definedsymbols = newjarray_337389();
			{
				NimStringDesc* s_615602;
				s_615602 = 0;
				{
					NimStringDesc* key_616006;
					NimStringDesc* val_616008;
					key_616006 = 0;
					val_616008 = 0;
					{
						NI h_616010;
						NI HEX3Atmp_616012;
						NI res_616014;
						h_616010 = 0;
						HEX3Atmp_616012 = 0;
						HEX3Atmp_616012 = ((*gsymbols_202004).Data->Sup.len-1);
						res_616014 = 0;
						{
							while (1) {
								if (!(res_616014 <= HEX3Atmp_616012)) goto LA57;
								h_616010 = res_616014;
								{
									if (!!((*gsymbols_202004).Data->data[h_616010].Field0 == 0)) goto LA60;
									key_616006 = (*gsymbols_202004).Data->data[h_616010].Field0;
									val_616008 = (*gsymbols_202004).Data->data[h_616010].Field1;
									{
										jsonnodeobj337042* LOC66;
										if (!eqStrings(val_616008, ((NimStringDesc*) &TMP4837))) goto LA64;
										s_615602 = key_616006;
										LOC66 = 0;
										LOC66 = HEX25_337448(s_615602);
										(*definedsymbols).kindU.S7.Elems = (TY337062*) incrSeq(&((*definedsymbols).kindU.S7.Elems)->Sup, sizeof(jsonnodeobj337042*));
										asgnRefNoCycle((void**) (&(*definedsymbols).kindU.S7.Elems->data[(*definedsymbols).kindU.S7.Elems->Sup.len-1]), LOC66);
									}
									LA64: ;
								}
								LA60: ;
								res_616014 += 1;
							} LA57: ;
						}
					}
				}
			}
			libpaths = newjarray_337389();
			{
				NimStringDesc* dir_615636;
				tstrentry127024* it_616018;
				dir_615636 = 0;
				it_616018 = ((tstrentry127024*) (searchpaths_170122.Head));
				{
					while (1) {
						jsonnodeobj337042* LOC70;
						if (!!((it_616018 == NIM_NIL))) goto LA69;
						dir_615636 = (*it_616018).Data;
						LOC70 = 0;
						LOC70 = HEX25_337448(dir_615636);
						(*libpaths).kindU.S7.Elems = (TY337062*) incrSeq(&((*libpaths).kindU.S7.Elems)->Sup, sizeof(jsonnodeobj337042*));
						asgnRefNoCycle((void**) (&(*libpaths).kindU.S7.Elems->data[(*libpaths).kindU.S7.Elems->Sup.len-1]), LOC70);
						it_616018 = ((tstrentry127024*) ((*it_616018).Sup.Next));
					} LA69: ;
				}
			}
			memset((void*)LOC71, 0, sizeof(LOC71));
			LOC71[0].Field0 = copyString(((NimStringDesc*) &TMP4838));
			LOC71[0].Field1 = HEX25_337448(((NimStringDesc*) &TMP4839));
			LOC71[1].Field0 = copyString(((NimStringDesc*) &TMP4840));
			LOC71[1].Field1 = HEX25_337448(gprojectfull_170236);
			LOC71[2].Field0 = copyString(((NimStringDesc*) &TMP4841));
			LOC71[2].Field1 = definedsymbols;
			LOC71[3].Field0 = copyString(((NimStringDesc*) &TMP4842));
			LOC71[3].Field1 = libpaths;
			dumpdata = HEX25_337608(LOC71, 4);
			LOC72 = 0;
			LOC72 = HEX24_341633(dumpdata);
			outwriteln_198198(LOC72);
		}
		goto LA48;
		LA51: ;
		{
			outwriteln_198198(((NimStringDesc*) &TMP4843));
			{
				NimStringDesc* s_615686;
				s_615686 = 0;
				{
					NimStringDesc* key_616024;
					NimStringDesc* val_616026;
					key_616024 = 0;
					val_616026 = 0;
					{
						NI h_616028;
						NI HEX3Atmp_616030;
						NI res_616032;
						h_616028 = 0;
						HEX3Atmp_616030 = 0;
						HEX3Atmp_616030 = ((*gsymbols_202004).Data->Sup.len-1);
						res_616032 = 0;
						{
							while (1) {
								if (!(res_616032 <= HEX3Atmp_616030)) goto LA78;
								h_616028 = res_616032;
								{
									if (!!((*gsymbols_202004).Data->data[h_616028].Field0 == 0)) goto LA81;
									key_616024 = (*gsymbols_202004).Data->data[h_616028].Field0;
									val_616026 = (*gsymbols_202004).Data->data[h_616028].Field1;
									{
										if (!eqStrings(val_616026, ((NimStringDesc*) &TMP4837))) goto LA85;
										s_615686 = key_616024;
										outwriteln_198198(s_615686);
									}
									LA85: ;
								}
								LA81: ;
								res_616032 += 1;
							} LA78: ;
						}
					}
				}
			}
			outwriteln_198198(((NimStringDesc*) &TMP4844));
			{
				NimStringDesc* it_615687;
				tstrentry127024* it_616036;
				it_615687 = 0;
				it_616036 = ((tstrentry127024*) (searchpaths_170122.Head));
				{
					while (1) {
						if (!!((it_616036 == NIM_NIL))) goto LA89;
						it_615687 = (*it_616036).Data;
						msgwriteln_198236(it_615687);
						it_616036 = ((tstrentry127024*) ((*it_616036).Sup.Next));
					} LA89: ;
				}
			}
		}
		LA48: ;
	}
	goto LA29;
	LA20: ;
	{
		gcmd_170120 = ((NU8) 11);
		commandcheck_614246();
	}
	goto LA29;
	LA21: ;
	{
		tnode226816* LOC92;
		gcmd_170120 = ((NU8) 12);
		wantmainmodule_613014();
		LOC92 = 0;
		LOC92 = parsefile_261041(gprojectmainidx_170237);
	}
	goto LA29;
	LA22: ;
	{
		gcmd_170120 = ((NU8) 13);
		wantmainmodule_613014();
		commandscan_614692();
		msgwriteln_198236(((NimStringDesc*) &TMP4848));
	}
	goto LA29;
	LA23: ;
	{
		gcmd_170120 = ((NU8) 18);
		commandinteractive_614607();
	}
	goto LA29;
	LA24: ;
	{
		NimStringDesc* LOC96;
		LOC96 = 0;
		LOC96 = maincommandarg_170319();
		commandeval_614665(LOC96);
	}
	goto LA29;
	LA25: ;
	{
		resetmemory_614770();
	}
	goto LA29;
	LA26: ;
	{
		gcmd_170120 = ((NU8) 14);
		{
			if (!!(((gevalexpr_170130) && (gevalexpr_170130)->Sup.len == 0))) goto LA101;
			commandeval_614665(gevalexpr_170130);
		}
		goto LA99;
		LA101: ;
		{
			commandsuggest_614744();
		}
		LA99: ;
	}
	goto LA29;
	LA27: ;
	{
		isserving_170133 = NIM_TRUE;
		gglobaloptions_170118 |= ((NI32)1)<<((((NU8) 15))%(sizeof(NI32)*8));
		gerrormax_197309 = 2147483647;
		serve_611259(maincommand_615027);
	}
	goto LA29;
	LA28: ;
	{
		rawmessage_198733(((NU16) 180), command_170239);
	}
	LA29: ;
	{
		NIM_BOOL LOC108;
		NIM_BOOL LOC109;
		TY209063 LOC114;
		NF LOC115;
		NI LOC116;
		LOC108 = 0;
		LOC109 = 0;
		LOC109 = (gerrorcounter_197306 == 0);
		if (!(LOC109)) goto LA110;
		LOC109 = !(((525376 &(1<<((gcmd_170120)&31)))!=0));
		LA110: ;
		LOC108 = LOC109;
		if (!(LOC108)) goto LA111;
		LOC108 = (0 < gverbosity_170127);
		LA111: ;
		if (!LOC108) goto LA112;
		memset((void*)LOC114, 0, sizeof(LOC114));
		LOC114[0] = nimIntToStr(glinescompiled_216218);
		LOC115 = 0;
		LOC115 = ntepochTime();
		LOC114[1] = nsuformatFloat(((NF)(LOC115) - (NF)(glastcmdtime_170131)), ((NU8) 1), 3);
		LOC116 = 0;
		LOC116 = gettotalmem_6499();
		LOC114[2] = formatsize_98604(((NI64) (LOC116)), 46);
		rawmessage_198643(((NU16) 260), LOC114, 3);
	}
	LA112: ;
}
NIM_EXTERNC N_NOINLINE(void, HEX00_mainInit)(void) {
}

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

