/* Generated by Nimrod Compiler v0.9.5 */
/*   (c) 2014 Andreas Rumpf */
/* The generated code is subject to the original license. */
/* Compiled for: Linux, i386, gcc */
/* Command for C compiler:
   gcc -c  -w -O3 -fno-strict-aliasing  -I/build/nimrod/src/nimrod/lib -o compiler/nimcache/main.o compiler/nimcache/main.c */
#define NIM_INTBITS 32
#include "nimbase.h"

#include <string.h>

#include <stdio.h>
typedef struct tlinkedlist118023 tlinkedlist118023;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tlistentry118017 tlistentry118017;
typedef struct tnode188803 tnode188803;
typedef struct tsym188833 tsym188833;
typedef struct tlineinfo163527 tlineinfo163527;
typedef struct tcell41090 tcell41090;
typedef struct TNimType TNimType;
typedef struct tcellseq41106 tcellseq41106;
typedef struct tgcheap43016 tgcheap43016;
typedef struct tcellset41102 tcellset41102;
typedef struct tpagedesc41098 tpagedesc41098;
typedef struct tmemregion23410 tmemregion23410;
typedef struct tsmallchunk22638 tsmallchunk22638;
typedef struct tllchunk23404 tllchunk23404;
typedef struct tbigchunk22640 tbigchunk22640;
typedef struct tintset22615 tintset22615;
typedef struct ttrunk22611 ttrunk22611;
typedef struct tavlnode23408 tavlnode23408;
typedef struct tgcstat43014 tgcstat43014;
typedef struct tpass246015 tpass246015;
typedef struct tpasscontext246003 tpasscontext246003;
typedef struct trodreader236024 trodreader236024;
typedef struct TY524051 TY524051;
typedef struct tmoduleinmemory524012 tmoduleinmemory524012;
typedef struct TY188922 TY188922;
typedef struct tjsonnode292105 tjsonnode292105;
typedef struct tstringtable121810 tstringtable121810;
typedef struct TNimObject TNimObject;
typedef struct TNimNode TNimNode;
typedef struct tkeyvaluepairseq121808 tkeyvaluepairseq121808;
typedef struct tkeyvaluepair121806 tkeyvaluepair121806;
typedef struct TY292120 TY292120;
typedef struct TY292613 TY292613;
typedef struct TY292125 TY292125;
typedef struct tstrentry118019 tstrentry118019;
typedef struct tllstream176204 tllstream176204;
typedef struct tlexer180176 tlexer180176;
typedef struct tbaselexer178018 tbaselexer178018;
typedef struct ttoken180174 ttoken180174;
typedef struct tident167019 tident167019;
typedef struct TY110805 TY110805;
typedef struct tidobj167013 tidobj167013;
typedef struct ttypeseq188835 ttypeseq188835;
typedef struct ttype188837 ttype188837;
typedef struct tscope188827 tscope188827;
typedef struct TY188933 TY188933;
typedef struct tinstantiation188823 tinstantiation188823;
typedef struct tstrtable188807 tstrtable188807;
typedef struct tsymseq188805 tsymseq188805;
typedef struct tloc188817 tloc188817;
typedef struct trope145007 trope145007;
typedef struct tlib188821 tlib188821;
typedef struct tnodeseq188797 tnodeseq188797;
typedef struct tbasechunk22636 tbasechunk22636;
typedef struct tfreecell22628 tfreecell22628;
typedef struct tindex236022 tindex236022;
typedef struct tiitable197207 tiitable197207;
typedef struct tiipairseq197205 tiipairseq197205;
typedef struct tiipair197203 tiipair197203;
typedef struct tidtable188849 tidtable188849;
typedef struct tidpairseq188847 tidpairseq188847;
typedef struct tidpair188845 tidpair188845;
typedef struct tmemfile234204 tmemfile234204;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  tlinkedlist118023  {
tlistentry118017* Head;
tlistentry118017* Tail;
NI Counter;
};
typedef N_NIMCALL_PTR(tnode188803*, TY246061) (tsym188833* m, NI32 fileidx);
typedef N_NIMCALL_PTR(tsym188833*, TY246056) (tsym188833* m, NI32 fileidx);
struct  tlineinfo163527  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
struct  tcell41090  {
NI Refcount;
TNimType* Typ;
};
struct  tcellseq41106  {
NI Len;
NI Cap;
tcell41090** D;
};
struct  tcellset41102  {
NI Counter;
NI Max;
tpagedesc41098* Head;
tpagedesc41098** Data;
};
typedef tsmallchunk22638* TY23422[512];
typedef ttrunk22611* ttrunkbuckets22613[256];
struct  tintset22615  {
ttrunkbuckets22613 Data;
};
struct  tmemregion23410  {
NI Minlargeobj;
NI Maxlargeobj;
TY23422 Freesmallchunks;
tllchunk23404* Llmem;
NI Currmem;
NI Maxmem;
NI Freemem;
NI Lastsize;
tbigchunk22640* Freechunkslist;
tintset22615 Chunkstarts;
tavlnode23408* Root;
tavlnode23408* Deleted;
tavlnode23408* Last;
tavlnode23408* Freeavlnodes;
};
struct  tgcstat43014  {
NI Stackscans;
NI Cyclecollections;
NI Maxthreshold;
NI Maxstacksize;
NI Maxstackcells;
NI Cycletablesize;
NI64 Maxpause;
};
struct  tgcheap43016  {
void* Stackbottom;
NI Cyclethreshold;
tcellseq41106 Zct;
tcellseq41106 Decstack;
tcellset41102 Cycleroots;
tcellseq41106 Tempstack;
NI Recgclock;
tmemregion23410 Region;
tgcstat43014 Stat;
};
typedef N_NIMCALL_PTR(tpasscontext246003*, tpassopen246007) (tsym188833* module);
typedef N_NIMCALL_PTR(tpasscontext246003*, tpassopencached246009) (tsym188833* module, trodreader236024* rd);
typedef N_NIMCALL_PTR(tnode188803*, tpassprocess246013) (tpasscontext246003* p, tnode188803* toplevelstmt);
typedef N_NIMCALL_PTR(tnode188803*, tpassclose246011) (tpasscontext246003* p, tnode188803* n);
struct tpass246015 {
tpassopen246007 Field0;
tpassopencached246009 Field1;
tpassprocess246013 Field2;
tpassclose246011 Field3;
};
struct  tmoduleinmemory524012  {
NF Compiledat;
NI32 Crc;
TY188922* Deps;
NU8 Needsrecompile;
NU8 Crcstatus;
};
typedef N_NIMCALL_PTR(void, TY2289) (void* p, NI op);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY2289 marker;
};
struct  TNimObject  {
TNimType* m_type;
};
struct tkeyvaluepair121806 {
NimStringDesc* Field0;
NimStringDesc* Field1;
};
struct  tstringtable121810  {
  TNimObject Sup;
NI Counter;
tkeyvaluepairseq121808* Data;
NU8 Mode;
};
struct TY292613 {
NimStringDesc* Field0;
tjsonnode292105* Field1;
};
struct  tjsonnode292105  {
NU8 Kind;
union {
struct {NimStringDesc* Str;
} S1;
struct {NI64 Num;
} S2;
struct {NF Fnum;
} S3;
struct {NIM_BOOL Bval;
} S4;
struct {TY292120* Fields;
} S6;
struct {TY292125* Elems;
} S7;
} kindU;
};
struct  tlistentry118017  {
  TNimObject Sup;
tlistentry118017* Prev;
tlistentry118017* Next;
};
struct  tstrentry118019  {
  tlistentry118017 Sup;
NimStringDesc* Data;
};
typedef TY292613 TY527683[4];
struct  tbaselexer178018  {
  TNimObject Sup;
NI Bufpos;
NCSTRING Buf;
NI Buflen;
tllstream176204* Stream;
NI Linenumber;
NI Sentinel;
NI Linestart;
};
struct  tlexer180176  {
  tbaselexer178018 Sup;
NI32 Fileidx;
NI Indentahead;
NI Currlineindent;
NIM_BOOL Strongspaces;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  ttoken180174  {
NU8 Toktype;
NI Indent;
tident167019* Ident;
NI64 Inumber;
NF Fnumber;
NU8 Base;
NI8 Strongspacea;
NI8 Strongspaceb;
NimStringDesc* Literal;
NI Line;
NI Col;
};
struct  tidobj167013  {
  TNimObject Sup;
NI Id;
};
struct  tstrtable188807  {
NI Counter;
tsymseq188805* Data;
};
struct  tloc188817  {
NU8 K;
NU8 S;
NU8 Flags;
ttype188837* T;
trope145007* R;
trope145007* Heaproot;
NI A;
};
struct  tsym188833  {
  tidobj167013 Sup;
NU8 Kind;
union {
struct {ttypeseq188835* Typeinstcache;
tscope188827* Typscope;
} S1;
struct {TY188933* Procinstcache;
tscope188827* Scope;
} S2;
struct {TY188933* Usedgenerics;
tstrtable188807 Tab;
} S3;
} kindU;
NU16 Magic;
ttype188837* Typ;
tident167019* Name;
tlineinfo163527 Info;
tsym188833* Owner;
NU32 Flags;
tnode188803* Ast;
NU32 Options;
NI Position;
NI Offset;
tloc188817 Loc;
tlib188821* Annex;
tnode188803* Constraint;
};
typedef tpass246015 TY526642[3];
typedef tident167019* TY167028[8192];
typedef N_NIMCALL_PTR(void, TY523294) (void);
typedef NimStringDesc* TY173034[3];
struct  tnode188803  {
ttype188837* Typ;
tlineinfo163527 Info;
NU16 Flags;
NU8 Kind;
union {
struct {NI64 Intval;
} S1;
struct {NF Floatval;
} S2;
struct {NimStringDesc* Strval;
} S3;
struct {tsym188833* Sym;
} S4;
struct {tident167019* Ident;
} S5;
struct {tnodeseq188797* Sons;
} S6;
} kindU;
NimStringDesc* Comment;
};
typedef NI TY22618[16];
struct  tpagedesc41098  {
tpagedesc41098* Next;
NI Key;
TY22618 Bits;
};
struct  tbasechunk22636  {
NI Prevsize;
NI Size;
NIM_BOOL Used;
};
struct  tsmallchunk22638  {
  tbasechunk22636 Sup;
tsmallchunk22638* Next;
tsmallchunk22638* Prev;
tfreecell22628* Freelist;
NI Free;
NI Acc;
NF Data;
};
struct  tllchunk23404  {
NI Size;
NI Acc;
tllchunk23404* Next;
};
struct  tbigchunk22640  {
  tbasechunk22636 Sup;
tbigchunk22640* Next;
tbigchunk22640* Prev;
NI Align;
NF Data;
};
struct  ttrunk22611  {
ttrunk22611* Next;
NI Key;
TY22618 Bits;
};
typedef tavlnode23408* TY23414[2];
struct  tavlnode23408  {
TY23414 Link;
NI Key;
NI Upperbound;
NI Level;
};
struct  tpasscontext246003  {
  TNimObject Sup;
NIM_BOOL Fromcache;
};
struct  tiipair197203  {
NI Key;
NI Val;
};
struct  tiitable197207  {
NI Counter;
tiipairseq197205* Data;
};
struct  tindex236022  {
NI Lastidxkey;
NI Lastidxval;
tiitable197207 Tab;
NimStringDesc* R;
NI Offset;
};
struct  tidpair188845  {
tidobj167013* Key;
TNimObject* Val;
};
struct  tidtable188849  {
NI Counter;
tidpairseq188847* Data;
};
struct  tmemfile234204  {
void* Mem;
NI Size;
int Handle;
};
struct  trodreader236024  {
  TNimObject Sup;
NI Pos;
NCSTRING S;
NU32 Options;
NU8 Reason;
TY188922* Moddeps;
TY188922* Files;
NI Dataidx;
NI Convertersidx;
NI Initidx;
NI Interfidx;
NI Compilerprocsidx;
NI Methodsidx;
NimStringDesc* Filename;
tindex236022 Index;
tindex236022 Imports;
NI Readerindex;
NI Line;
NI Moduleid;
tidtable188849 Syms;
tmemfile234204 Memfile;
tsymseq188805* Methods;
NimStringDesc* Origfile;
NIM_BOOL Inviewmode;
};
struct  tllstream176204  {
  TNimObject Sup;
NU8 Kind;
FILE* F;
NimStringDesc* S;
NI Rd;
NI Wr;
NI Lineoffset;
};
struct  tident167019  {
  tidobj167013 Sup;
NimStringDesc* S;
tident167019* Next;
NI H;
};
struct  ttype188837  {
  tidobj167013 Sup;
NU8 Kind;
NU8 Callconv;
NU32 Flags;
ttypeseq188835* Sons;
tnode188803* N;
tsym188833* Destructor;
tsym188833* Owner;
tsym188833* Sym;
NI64 Size;
NI Align;
tloc188817 Loc;
};
struct  tscope188827  {
NI Depthlevel;
tstrtable188807 Symbols;
tnodeseq188797* Usingsyms;
tscope188827* Parent;
};
struct  tinstantiation188823  {
tsym188833* Sym;
ttypeseq188835* Concretetypes;
TY188922* Usedby;
};
struct  trope145007  {
  TNimObject Sup;
trope145007* Left;
trope145007* Right;
NI Length;
NimStringDesc* Data;
};
struct  tlib188821  {
  tlistentry118017 Sup;
NU8 Kind;
NIM_BOOL Generated;
NIM_BOOL Isoverriden;
trope145007* Name;
tnode188803* Path;
};
struct  tfreecell22628  {
tfreecell22628* Next;
NI Zerofield;
};
struct TY188922 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct TY524051 {
  TGenericSeq Sup;
  tmoduleinmemory524012 data[SEQ_DECL_SIZE];
};
struct tkeyvaluepairseq121808 {
  TGenericSeq Sup;
  tkeyvaluepair121806 data[SEQ_DECL_SIZE];
};
struct TY292120 {
  TGenericSeq Sup;
  TY292613 data[SEQ_DECL_SIZE];
};
struct TY292125 {
  TGenericSeq Sup;
  tjsonnode292105* data[SEQ_DECL_SIZE];
};
struct TY110805 {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct ttypeseq188835 {
  TGenericSeq Sup;
  ttype188837* data[SEQ_DECL_SIZE];
};
struct TY188933 {
  TGenericSeq Sup;
  tinstantiation188823* data[SEQ_DECL_SIZE];
};
struct tsymseq188805 {
  TGenericSeq Sup;
  tsym188833* data[SEQ_DECL_SIZE];
};
struct tnodeseq188797 {
  TGenericSeq Sup;
  tnode188803* data[SEQ_DECL_SIZE];
};
struct tiipairseq197205 {
  TGenericSeq Sup;
  tiipair197203 data[SEQ_DECL_SIZE];
};
struct tidpairseq188847 {
  TGenericSeq Sup;
  tidpair188845 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, clearpasses_246183)(void);
N_NIMCALL(NF, ntepochTime)(void);
N_NIMCALL(void, appendstr_118268)(tlinkedlist118023* list, NimStringDesc* data);
N_NIMCALL(void, prependstr_118420)(tlinkedlist118023* list, NimStringDesc* data);
static N_INLINE(void, setid_187444)(NI id);
N_NIMCALL(tnode188803*, includemodule_524892)(tsym188833* s, NI32 fileidx);
N_NIMCALL(tsym188833*, importmodule_524857)(tsym188833* s, NI32 fileidx);
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, wantmainmodule_526768)(void);
N_NIMCALL(void, fatal_165551)(tlineinfo163527 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(tcell41090*, usrtocell_44443)(void* usr);
static N_INLINE(void, rtladdzct_46002)(tcell41090* c);
N_NOINLINE(void, addzct_44418)(tcellseq41106* s, tcell41090* c);
N_NIMCALL(NimStringDesc*, HEX2F_108477)(NimStringDesc* head, NimStringDesc* tail);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(NI32, fileinfoidx_163721)(NimStringDesc* filename);
N_NIMCALL(NimStringDesc*, nosaddFileExt)(NimStringDesc* filename, NimStringDesc* ext);
N_NIMCALL(void, commandcompiletoc_526244)(void);
N_NIMCALL(void, semanticpasses_526222)(void);
N_NIMCALL(void, registerpass_246187)(tpass246015 p);
N_NIMCALL(tpasscontext246003*, verboseopen_518007)(tsym188833* s);
N_NIMCALL(tnode188803*, verboseprocess_518014)(tpasscontext246003* context, tnode188803* n);
N_NIMCALL(tpasscontext246003*, myopen_463662)(tsym188833* module);
N_NIMCALL(tpasscontext246003*, myopencached_463701)(tsym188833* module, trodreader236024* rd);
N_NIMCALL(tnode188803*, myprocess_463808)(tpasscontext246003* context, tnode188803* n);
N_NIMCALL(tnode188803*, myclose_463820)(tpasscontext246003* context, tnode188803* n);
N_NIMCALL(tpasscontext246003*, myopen_505605)(tsym188833* module);
N_NIMCALL(tpasscontext246003*, myopencached_505714)(tsym188833* module, trodreader236024* rd);
N_NIMCALL(tnode188803*, myprocess_505804)(tpasscontext246003* b, tnode188803* n);
N_NIMCALL(tnode188803*, myclose_506238)(tpasscontext246003* b, tnode188803* n);
N_NIMCALL(void, rodpass_526201)(void);
N_NIMCALL(tpasscontext246003*, myopen_259386)(tsym188833* module);
N_NIMCALL(tnode188803*, process_258961)(tpasscontext246003* c, tnode188803* n);
N_NIMCALL(tnode188803*, myclose_259395)(tpasscontext246003* c, tnode188803* n);
N_NIMCALL(void, compileproject_524968)(NI32 projectfile);
N_NIMCALL(void, cgenwritemodules_506338)(void);
N_NIMCALL(void, callccompiler_170516)(NimStringDesc* projectfile);
N_NIMCALL(NimStringDesc*, noschangeFileExt)(NimStringDesc* filename, NimStringDesc* ext);
N_NIMCALL(void, resetcgenmodules_505484)(void);
N_NIMCALL(void, resetcompilationlists_169772)(void);
N_NIMCALL(void, resetcaches_464288)(void);
N_NIMCALL(void, gcfullcollect_6606)(void);
N_NIMCALL(void, setcc_169632)(NimStringDesc* ccname);
N_NIMCALL(void, definesymbol_168006)(NimStringDesc* symbol);
N_NIMCALL(void, rawmessage_165386)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, commandcompiletojs_526401)(void);
N_NIMCALL(void, settarget_142599)(NU8 o, NU8 c);
N_NIMCALL(tpasscontext246003*, myopen_517225)(tsym188833* s);
N_NIMCALL(tpasscontext246003*, myopencached_517218)(tsym188833* s, trodreader236024* rd);
N_NIMCALL(tnode188803*, myprocess_517084)(tpasscontext246003* b, tnode188803* n);
N_NIMCALL(tnode188803*, myclose_517191)(tpasscontext246003* b, tnode188803* n);
N_NIMCALL(void, commandpretty_526697)(void);
N_NIMCALL(tpasscontext246003*, myopen_356491)(tsym188833* module);
N_NIMCALL(tnode188803*, processsym_356484)(tpasscontext246003* c, tnode188803* n);
N_NIMCALL(void, overwritefiles_355139)(void);
N_NIMCALL(void, loadconfigs_184607)(NimStringDesc* cfg);
N_NIMCALL(void, commanddoc_344741)(void);
N_NIMCALL(void, commanddoc2_526237)(void);
N_NIMCALL(tpasscontext246003*, myopen_520058)(tsym188833* module);
N_NIMCALL(tnode188803*, processnode_520050)(tpasscontext246003* c, tnode188803* n);
N_NIMCALL(tnode188803*, close_520014)(tpasscontext246003* p, tnode188803* n);
N_NIMCALL(void, finishdoc2pass_520087)(NimStringDesc* project);
N_NIMCALL(void, commandrst2html_344779)(void);
N_NIMCALL(void, commandrst2tex_344783)(void);
N_NIMCALL(void, commandjson_344787)(void);
N_NIMCALL(void, commandbuildindex_344825)(void);
N_NIMCALL(void, commandgendepend_526226)(void);
N_NIMCALL(tpasscontext246003*, myopen_519128)(tsym188833* module);
N_NIMCALL(tnode188803*, adddotdependency_519031)(tpasscontext246003* c, tnode188803* n);
N_NIMCALL(tnode188803*, cleanup_518056)(tpasscontext246003* c, tnode188803* n);
N_NIMCALL(void, generatedot_519007)(NimStringDesc* project);
N_NIMCALL(void, execexternalprogram_169785)(NimStringDesc* cmd);
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_137311)(NimStringDesc* key);
N_NIMCALL(void, requiremainmoduleoption_526772)(void);
N_NIMCALL(tjsonnode292105*, newjarray_292411)(void);
N_NIMCALL(tjsonnode292105*, HEX25_292466)(NimStringDesc* s);
N_NIMCALL(TGenericSeq*, incrSeq)(TGenericSeq* seq, NI elemsize);
N_NIMCALL(tjsonnode292105*, HEX25_292610)(TY292613* keyvals, NI keyvalsLen0);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(void, outwriteln_164903)(NimStringDesc* s);
N_NIMCALL(NimStringDesc*, HEX24_295148)(tjsonnode292105* node);
N_NIMCALL(void, msgwriteln_164937)(NimStringDesc* s);
N_NIMCALL(void, commandcheck_526230)(void);
N_NIMCALL(tnode188803*, parsefile_220033)(NI32 fileidx);
N_NIMCALL(void, commandscan_526704)(void);
N_NIMCALL(NimStringDesc*, maincommandarg_137288)(void);
N_NIMCALL(tllstream176204*, llstreamopen_176227)(NimStringDesc* filename, NU8 mode);
N_NIMCALL(void, inittoken_180417)(ttoken180174* l);
N_NIMCALL(void, openlexer_180238)(tlexer180176* lex, NimStringDesc* filename, tllstream176204* inputstream);
N_NIMCALL(void, rawgettok_180211)(tlexer180176* l, ttoken180174* tok);
N_NIMCALL(void, printtok_180230)(ttoken180174* tok);
N_NIMCALL(void, closelexer_180225)(tlexer180176* lex);
N_NIMCALL(void, commandinteractive_526603)(void);
N_NIMCALL(void, interactivepasses_526405)(void);
N_NIMCALL(void, initdefines_168072)(void);
N_NIMCALL(tpasscontext246003*, myopen_409823)(tsym188833* module);
N_NIMCALL(tnode188803*, myprocess_410006)(tpasscontext246003* c, tnode188803* n);
N_NIMCALL(void, compilesystemmodule_524946)(void);
N_NIMCALL(tsym188833*, compilemodule_524750)(NI32 fileidx, NU32 flags);
N_NIMCALL(tsym188833*, makestdinmodule_524979)(void);
N_NIMCALL(void, processmodule_246049)(tsym188833* module, tllstream176204* stream, trodreader236024* rd);
N_NIMCALL(tllstream176204*, llstreamopenstdin_176235)(void);
N_NIMCALL(void, commandeval_526651)(NimStringDesc* exp);
N_NIMCALL(void, evalnim_526645)(tnode188803* nodes, tsym188833* module);
N_NIMCALL(void, carrypasses_246226)(tnode188803* nodes, tsym188833* module, tpass246015* passes, NI passesLen0);
N_NIMCALL(tnode188803*, parsestring_205227)(NimStringDesc* s, NimStringDesc* filename, NI line);
N_NIMCALL(void, resetmemory_526776)(void);
N_NIMCALL(void, resetallmodules_524362)(void);
N_NIMCALL(void, resetropecache_145192)(void);
N_NIMCALL(void, resetsystypes_242292)(void);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
N_NIMCALL(void, commandsuggest_526746)(void);
N_NIMCALL(void, resetmodule_524357)(NI32 fileidx);
N_NIMCALL(void, deffromsourcemap_362811)(tlineinfo163527 i);
N_NIMCALL(void, serve_523292)(TY523294 action);
N_NIMCALL(void, maincommand_527011)(void);
N_NIMCALL(void, rawmessage_165292)(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_91567)(NI64 bytes, NIM_CHAR decimalsep);
N_NIMCALL(NI, gettotalmem_5265)(void);
STRING_LITERAL(TMP1792, "c", 1);
STRING_LITERAL(TMP1793, "cc", 2);
STRING_LITERAL(TMP1794, "compile", 7);
STRING_LITERAL(TMP1795, "compiletoc", 10);
STRING_LITERAL(TMP1796, "cpp", 3);
STRING_LITERAL(TMP1797, "compiletocpp", 12);
STRING_LITERAL(TMP1798, "objc", 4);
STRING_LITERAL(TMP1799, "compiletooc", 11);
STRING_LITERAL(TMP1800, "run", 3);
STRING_LITERAL(TMP1801, "js", 2);
STRING_LITERAL(TMP1802, "compiletojs", 11);
STRING_LITERAL(TMP1803, "compiletollvm", 13);
STRING_LITERAL(TMP1804, "pretty", 6);
STRING_LITERAL(TMP1805, "doc", 3);
STRING_LITERAL(TMP1806, "doc2", 4);
STRING_LITERAL(TMP1807, "rst2html", 8);
STRING_LITERAL(TMP1808, "rst2tex", 7);
STRING_LITERAL(TMP1809, "jsondoc", 7);
STRING_LITERAL(TMP1810, "buildindex", 10);
STRING_LITERAL(TMP1811, "gendepend", 9);
STRING_LITERAL(TMP1812, "dump", 4);
STRING_LITERAL(TMP1813, "check", 5);
STRING_LITERAL(TMP1814, "parse", 5);
STRING_LITERAL(TMP1815, "scan", 4);
STRING_LITERAL(TMP1816, "i", 1);
STRING_LITERAL(TMP1817, "e", 1);
STRING_LITERAL(TMP1818, "reset", 5);
STRING_LITERAL(TMP1819, "idetools", 8);
STRING_LITERAL(TMP1820, "serve", 5);
STRING_LITERAL(TMP1821, "", 0);
STRING_LITERAL(TMP1822, "nim", 3);
NIM_CONST tpass246015 TMP1823 = {verboseopen_518007,
NIM_NIL,
verboseprocess_518014,
NIM_NIL}
;
NIM_CONST tpass246015 TMP1825 = {myopen_463662,
myopencached_463701,
myprocess_463808,
myclose_463820}
;
NIM_CONST tpass246015 TMP3124 = {myopen_505605,
myopencached_505714,
myprocess_505804,
myclose_506238}
;
NIM_CONST tpass246015 TMP3801 = {myopen_259386,
NIM_NIL,
process_258961,
myclose_259395}
;
STRING_LITERAL(TMP3921, ".cpp", 4);
STRING_LITERAL(TMP3922, "gpp", 3);
STRING_LITERAL(TMP3923, ".m", 2);
STRING_LITERAL(TMP3924, "nimrod", 6);
STRING_LITERAL(TMP3925, "ecmascript", 10);
NIM_CONST tpass246015 TMP3926 = {myopen_517225,
myopencached_517218,
myprocess_517084,
myclose_517191}
;
NIM_CONST tpass246015 TMP4317 = {myopen_356491,
NIM_NIL,
processsym_356484,
NIM_NIL}
;
STRING_LITERAL(TMP4326, "nimdoc.cfg", 10);
STRING_LITERAL(TMP4446, "nimdoc", 6);
NIM_CONST tpass246015 TMP4447 = {myopen_520058,
NIM_NIL,
processnode_520050,
close_520014}
;
STRING_LITERAL(TMP4453, "nimdoc.tex.cfg", 14);
NIM_CONST tpass246015 TMP4496 = {myopen_519128,
NIM_NIL,
adddotdependency_519031,
NIM_NIL}
;
NIM_CONST tpass246015 TMP4499 = {NIM_NIL,
NIM_NIL,
cleanup_518056,
cleanup_518056}
;
STRING_LITERAL(TMP4503, "dot -Tpng -o", 12);
STRING_LITERAL(TMP4504, "png", 3);
STRING_LITERAL(TMP4505, "dot", 3);
STRING_LITERAL(TMP4506, "dump.format", 11);
STRING_LITERAL(TMP4507, "json", 4);
STRING_LITERAL(TMP4508, "true", 4);
STRING_LITERAL(TMP4509, "version", 7);
STRING_LITERAL(TMP4510, "0.9.5", 5);
STRING_LITERAL(TMP4511, "project_path", 12);
STRING_LITERAL(TMP4512, "defined_symbols", 15);
STRING_LITERAL(TMP4513, "lib_paths", 9);
STRING_LITERAL(TMP4514, "-- list of currently defined symbols --", 39);
STRING_LITERAL(TMP4515, "-- end of list --", 17);
STRING_LITERAL(TMP4518, "Beware: Indentation tokens depend on the parser\'s state!", 56);
STRING_LITERAL(TMP4519, "nimrodvm", 8);
NIM_CONST tpass246015 TMP4520 = {myopen_409823,
NIM_NIL,
myprocess_410006,
myprocess_410006}
;
STRING_LITERAL(TMP4523, "echo \"eval\\t\", repr(", 20);
STRING_LITERAL(TMP4524, ")", 1);
NIM_CONST TY526642 TMP4525 = {{verboseopen_518007,
NIM_NIL,
verboseprocess_518014,
NIM_NIL}
,
{myopen_463662,
myopencached_463701,
myprocess_463808,
myclose_463820}
,
{myopen_409823,
NIM_NIL,
myprocess_410006,
myprocess_410006}
}
;
extern NF glastcmdtime_137124;
extern tlinkedlist118023 searchpaths_137115;
extern NimStringDesc* libpath_137205;
extern NimStringDesc* gprojectfull_137208;
extern NimStringDesc* gprojectpath_137207;
extern NI gfrontendid_187007;
extern TY246061 gincludefile_246065;
extern TY246056 gimportmodule_246060;
extern NimStringDesc* command_137212;
extern NU8 gcmd_137113;
extern NimStringDesc* optmainmodule_137210;
extern tlineinfo163527 gcmdlineinfo_164104;
extern NimStringDesc* gprojectname_137206;
extern tgcheap43016 gch_43044;
extern NI32 gprojectmainidx_137209;
extern NU32 gglobaloptions_137111;
extern NIM_BOOL isserving_137126;
extern NimStringDesc* lastcaascmd_523204;
extern NimStringDesc* curcaascmd_523203;
extern TY524051* gmemcachedata_524072;
extern NimStringDesc* cext_169426;
extern NU8 ccompiler_169425;
extern NI gerrormax_164185;
extern tstringtable121810* gsymbols_168003;
extern TNimType NTI180176; /* TLexer */
extern TY110805* commandargs_137234;
extern tsym188833* systemmodule_242017;
extern tsymseq188805* gowners_250247;
extern TNimType NTI188805; /* TSymSeq */
extern tsym188833* rangedestructorproc_438218;
extern TY167028 buckets_167033;
extern tident167019* idanon_167476;
extern NimStringDesc* gevalexpr_137123;
extern NI32 gdirtybufferidx_137127;
extern tlineinfo163527 opttrackpos_164871;
extern NI32 gdirtyoriginalidx_137128;
extern NI gerrorcounter_164182;
extern NI gverbosity_137120;
extern NI glinescompiled_180197;

static N_INLINE(void, setid_187444)(NI id) {
	gfrontendid_187007 = ((gfrontendid_187007 >= (NI32)(id + 1)) ? gfrontendid_187007 : (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;
}

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

static N_INLINE(void, rtladdzct_46002)(tcell41090* c) {
	addzct_44418(&gch_43044.Zct, c);
}

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

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

N_NIMCALL(void, wantmainmodule_526768)(void) {
	NimStringDesc* LOC11;
	{
		if (!(gprojectfull_137208->Sup.len == 0)) goto LA3;
		{
			if (!(optmainmodule_137210->Sup.len == 0)) goto LA7;
			fatal_165551(gcmdlineinfo_164104, ((NU16) 186), ((NimStringDesc*) &TMP1821));
		}
		goto LA5;
		LA7: ;
		{
			NimStringDesc* LOC10;
			LOC10 = 0;
			LOC10 = gprojectname_137206; gprojectname_137206 = copyStringRC1(optmainmodule_137210);
			if (LOC10) nimGCunrefNoCycle(LOC10);
			asgnRefNoCycle((void**) &gprojectfull_137208, HEX2F_108477(gprojectpath_137207, gprojectname_137206));
		}
		LA5: ;
	}
	LA3: ;
	LOC11 = 0;
	LOC11 = nosaddFileExt(gprojectfull_137208, ((NimStringDesc*) &TMP1822));
	gprojectmainidx_137209 = fileinfoidx_163721(LOC11);
}

N_NIMCALL(void, semanticpasses_526222)(void) {
	registerpass_246187(TMP1823);
	registerpass_246187(TMP1825);
}

N_NIMCALL(void, rodpass_526201)(void) {
	{
		if (!((gglobaloptions_137111 &(1<<((((NU8) 14))&31)))!=0)) goto LA3;
		registerpass_246187(TMP3801);
	}
	LA3: ;
}

N_NIMCALL(void, commandcompiletoc_526244)(void) {
	semanticpasses_526222();
	registerpass_246187(TMP3124);
	rodpass_526201();
	{
		if (!((gglobaloptions_137111 &(1<<((((NU8) 15))&31)))!=0)) goto LA3;
	}
	LA3: ;
	compileproject_524968(gprojectmainidx_137209);
	cgenwritemodules_506338();
	{
		NimStringDesc* LOC9;
		if (!!((gcmd_137113 == ((NU8) 19)))) goto LA7;
		LOC9 = 0;
		LOC9 = noschangeFileExt(gprojectfull_137208, ((NimStringDesc*) &TMP1821));
		callccompiler_170516(LOC9);
	}
	LA7: ;
	{
		NimStringDesc* LOC14;
		NI i_526300;
		NI HEX3Atmp_526301;
		NI res_526303;
		if (!isserving_137126) goto LA12;
		LOC14 = 0;
		LOC14 = lastcaascmd_523204; lastcaascmd_523204 = copyStringRC1(curcaascmd_523203);
		if (LOC14) nimGCunrefNoCycle(LOC14);
		resetcgenmodules_505484();
		i_526300 = 0;
		HEX3Atmp_526301 = 0;
		HEX3Atmp_526301 = gmemcachedata_524072->Sup.len - 1;
		res_526303 = 0;
		while (1) {
			if (!(res_526303 <= HEX3Atmp_526301)) goto LA15;
			i_526300 = res_526303;
			gmemcachedata_524072->data[i_526300].Crcstatus = ((NU8) 1);
			gmemcachedata_524072->data[i_526300].Needsrecompile = ((NU8) 0);
			res_526303 += 1;
		} LA15: ;
		resetcompilationlists_169772();
		resetcaches_464288();
		gcfullcollect_6606();
	}
	LA12: ;
}

N_NIMCALL(void, commandcompiletojs_526401)(void) {
	settarget_142599(((NU8) 21), ((NU8) 12));
	definesymbol_168006(((NimStringDesc*) &TMP3924));
	definesymbol_168006(((NimStringDesc*) &TMP3925));
	definesymbol_168006(((NimStringDesc*) &TMP1801));
	semanticpasses_526222();
	registerpass_246187(TMP3926);
	compileproject_524968(gprojectmainidx_137209);
}

N_NIMCALL(void, commandpretty_526697)(void) {
	gerrormax_164185 = 2147483647;
	semanticpasses_526222();
	registerpass_246187(TMP4317);
	compileproject_524968(gprojectmainidx_137209);
	overwritefiles_355139();
}

N_NIMCALL(void, commanddoc2_526237)(void) {
	gerrormax_164185 = 2147483647;
	semanticpasses_526222();
	registerpass_246187(TMP4447);
	compileproject_524968(gprojectmainidx_137209);
	finishdoc2pass_520087(gprojectname_137206);
}

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_526226)(void) {
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	NimStringDesc* LOC3;
	semanticpasses_526222();
	registerpass_246187(TMP4496);
	registerpass_246187(TMP4499);
	compileproject_524968(gprojectmainidx_137209);
	generatedot_519007(gprojectfull_137208);
	LOC1 = 0;
	LOC2 = 0;
	LOC2 = noschangeFileExt(gprojectfull_137208, ((NimStringDesc*) &TMP4504));
	LOC3 = 0;
	LOC3 = noschangeFileExt(gprojectfull_137208, ((NimStringDesc*) &TMP4505));
	LOC1 = rawNewString(LOC2->Sup.len + LOC3->Sup.len + 13);
appendString(LOC1, ((NimStringDesc*) &TMP4503));
appendString(LOC1, LOC2);
appendChar(LOC1, 32);
appendString(LOC1, LOC3);
	execexternalprogram_169785(LOC1);
}

N_NIMCALL(void, requiremainmoduleoption_526772)(void) {
	NimStringDesc* LOC7;
	{
		if (!(optmainmodule_137210->Sup.len == 0)) goto LA3;
		fatal_165551(gcmdlineinfo_164104, ((NU16) 187), ((NimStringDesc*) &TMP1821));
	}
	goto LA1;
	LA3: ;
	{
		NimStringDesc* LOC6;
		LOC6 = 0;
		LOC6 = gprojectname_137206; gprojectname_137206 = copyStringRC1(optmainmodule_137210);
		if (LOC6) nimGCunrefNoCycle(LOC6);
		asgnRefNoCycle((void**) &gprojectfull_137208, HEX2F_108477(gprojectpath_137207, gprojectname_137206));
	}
	LA1: ;
	LOC7 = 0;
	LOC7 = nosaddFileExt(gprojectfull_137208, ((NimStringDesc*) &TMP1822));
	gprojectmainidx_137209 = fileinfoidx_163721(LOC7);
}

N_NIMCALL(void, commandcheck_526230)(void) {
	gerrormax_164185 = 2147483647;
	semanticpasses_526222();
	rodpass_526201();
	compileproject_524968(gprojectmainidx_137209);
}

N_NIMCALL(void, commandscan_526704)(void) {
	NimStringDesc* f;
	NimStringDesc* LOC1;
	tllstream176204* stream;
	LOC1 = 0;
	LOC1 = maincommandarg_137288();
	f = nosaddFileExt(LOC1, ((NimStringDesc*) &TMP1822));
	stream = llstreamopen_176227(f, ((NU8) 0));
	{
		tlexer180176 l;
		ttoken180174 tok;
		if (!!((stream == NIM_NIL))) goto LA4;
		memset((void*)&l, 0, sizeof(l));
		l.Sup.Sup.m_type = (&NTI180176);
		memset((void*)&tok, 0, sizeof(tok));
		inittoken_180417(&tok);
		openlexer_180238(&l, f, stream);
		while (1) {
			rawgettok_180211(&l, &tok);
			printtok_180230(&tok);
			{
				if (!(tok.Toktype == ((NU8) 1))) goto LA9;
				goto LA6;
			}
			LA9: ;
		} LA6: ;
		closelexer_180225(&l);
	}
	goto LA2;
	LA4: ;
	{
		rawmessage_165386(((NU16) 3), f);
	}
	LA2: ;
}

N_NIMCALL(void, interactivepasses_526405)(void) {
	initdefines_168072();
	definesymbol_168006(((NimStringDesc*) &TMP4519));
	registerpass_246187(TMP1823);
	registerpass_246187(TMP1825);
	registerpass_246187(TMP4520);
}

N_NIMCALL(void, commandinteractive_526603)(void) {
	gerrormax_164185 = 2147483647;
	interactivepasses_526405();
	compilesystemmodule_524946();
	{
		NI32 LOC5;
		tsym188833* LOC6;
		if (!(0 < commandargs_137234->Sup.len)) goto LA3;
		LOC5 = 0;
		LOC5 = fileinfoidx_163721(gprojectfull_137208);
		LOC6 = 0;
		LOC6 = compilemodule_524750(LOC5, 0);
	}
	goto LA1;
	LA3: ;
	{
		tsym188833* m;
		tllstream176204* LOC8;
		m = makestdinmodule_524979();
		(*m).Flags |=((NI32)(1)<<((((NU8) 12))%(sizeof(NI32)*8)));
		LOC8 = 0;
		LOC8 = llstreamopenstdin_176235();
		processmodule_246049(m, LOC8, NIM_NIL);
	}
	LA1: ;
}

N_NIMCALL(void, evalnim_526645)(tnode188803* nodes, tsym188833* module) {
	carrypasses_246226(nodes, module, TMP4525, 3);
}

N_NIMCALL(void, commandeval_526651)(NimStringDesc* exp) {
	NimStringDesc* echoexp;
	NimStringDesc* LOC5;
	tnode188803* LOC6;
	tsym188833* LOC7;
	{
		if (!(systemmodule_242017 == NIM_NIL)) goto LA3;
		interactivepasses_526405();
		compilesystemmodule_524946();
	}
	LA3: ;
	LOC5 = 0;
	LOC5 = rawNewString(exp->Sup.len + 21);
appendString(LOC5, ((NimStringDesc*) &TMP4523));
appendString(LOC5, exp);
appendString(LOC5, ((NimStringDesc*) &TMP4524));
	echoexp = LOC5;
	LOC6 = 0;
	LOC6 = parsestring_205227(echoexp, ((NimStringDesc*) &TMP1821), 0);
	LOC7 = 0;
	LOC7 = makestdinmodule_524979();
	evalnim_526645(LOC6, LOC7);
}

N_NIMCALL(void, resetmemory_526776)(void) {
	NI i_526829;
	NI res_527003;
	resetcompilationlists_169772();
	resetcaches_464288();
	resetallmodules_524362();
	resetropecache_145192();
	resetsystypes_242292();
	if (gowners_250247) nimGCunrefNoCycle(gowners_250247);
	gowners_250247 = (tsymseq188805*) newSeqRC1((&NTI188805), 0);
	asgnRefNoCycle((void**) &rangedestructorproc_438218, NIM_NIL);
	i_526829 = 0;
	res_527003 = 0;
	while (1) {
		if (!(((NI) (res_527003)) <= 8191)) goto LA1;
		i_526829 = res_527003;
		asgnRefNoCycle((void**) &buckets_167033[(i_526829)- 0], NIM_NIL);
		res_527003 += 1;
	} LA1: ;
	asgnRefNoCycle((void**) &idanon_167476, NIM_NIL);
}

N_NIMCALL(void, commandsuggest_526746)(void) {
	{
		if (!isserving_137126) goto LA3;
		commandcompiletoc_526244();
		{
			tsym188833* LOC9;
			if (!!((gdirtybufferidx_137127 == ((NI32) 0)))) goto LA7;
			LOC9 = 0;
			LOC9 = compilemodule_524750(gdirtybufferidx_137127, 512);
			resetmodule_524357(gdirtybufferidx_137127);
		}
		LA7: ;
		{
			if (!((gglobaloptions_137111 &(1<<((((NU8) 25))&31)))!=0)) goto LA12;
			deffromsourcemap_362811(opttrackpos_164871);
		}
		LA12: ;
	}
	goto LA1;
	LA3: ;
	{
		NI32 projfile;
		gerrormax_164185 = 2147483647;
		semanticpasses_526222();
		rodpass_526201();
		{
			if (!(gprojectmainidx_137209 == gdirtyoriginalidx_137128)) goto LA17;
			projfile = gdirtybufferidx_137127;
		}
		goto LA15;
		LA17: ;
		{
			projfile = gprojectmainidx_137209;
		}
		LA15: ;
		compileproject_524968(projfile);
	}
	LA1: ;
}

N_NIMCALL(void, maincommand_527011)(void) {
	NimStringDesc* LOC5;
	clearpasses_246183();
	glastcmdtime_137124 = ntepochTime();
	appendstr_118268(&searchpaths_137115, libpath_137205);
	{
		if (!!((gprojectfull_137208->Sup.len == 0))) goto LA3;
		prependstr_118420(&searchpaths_137115, gprojectpath_137207);
	}
	LA3: ;
	setid_187444(100);
	gincludefile_246065 = includemodule_524892;
	gimportmodule_246060 = importmodule_524857;
	LOC5 = 0;
	LOC5 = nsuNormalize(command_137212);
	switch (hashString(LOC5) & 31) {
	case 0: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1794))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1799))) goto LA8;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1819))) goto LA27;
break;
	case 2: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1812))) goto LA20;
break;
	case 4: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1814))) goto LA22;
break;
	case 7: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1807))) goto LA15;
break;
	case 9: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1800))) goto LA9;
break;
	case 10: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1793))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1802))) goto LA10;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1813))) goto LA21;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1818))) goto LA26;
break;
	case 11: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1811))) goto LA19;
break;
	case 13: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1805))) goto LA13;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1808))) goto LA16;
break;
	case 14: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1809))) goto LA17;
break;
	case 15: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1816))) goto LA24;
break;
	case 16: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1795))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1817))) goto LA25;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1820))) goto LA28;
break;
	case 19: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1797))) goto LA7;
break;
	case 25: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1792))) goto LA6;
break;
	case 26: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1804))) goto LA12;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1815))) goto LA23;
break;
	case 27: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1796))) goto LA7;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1801))) goto LA10;
break;
	case 28: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1803))) goto LA11;
break;
	case 29: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1810))) goto LA18;
break;
	case 31: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1798))) goto LA8;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1806))) goto LA14;
break;
	}
	goto LA29;
	LA6: ;
	{
		gcmd_137113 = ((NU8) 1);
		wantmainmodule_526768();
		commandcompiletoc_526244();
	}
	goto LA30;
	LA7: ;
	{
		NimStringDesc* LOC33;
		LOC33 = 0;
		LOC33 = cext_169426; cext_169426 = copyStringRC1(((NimStringDesc*) &TMP3921));
		if (LOC33) nimGCunrefNoCycle(LOC33);
		gcmd_137113 = ((NU8) 2);
		{
			if (!(ccompiler_169425 == ((NU8) 1))) goto LA36;
			setcc_169632(((NimStringDesc*) &TMP3922));
		}
		LA36: ;
		wantmainmodule_526768();
		definesymbol_168006(((NimStringDesc*) &TMP1796));
		commandcompiletoc_526244();
	}
	goto LA30;
	LA8: ;
	{
		NimStringDesc* LOC39;
		LOC39 = 0;
		LOC39 = cext_169426; cext_169426 = copyStringRC1(((NimStringDesc*) &TMP3923));
		if (LOC39) nimGCunrefNoCycle(LOC39);
		gcmd_137113 = ((NU8) 3);
		wantmainmodule_526768();
		definesymbol_168006(((NimStringDesc*) &TMP1798));
		commandcompiletoc_526244();
	}
	goto LA30;
	LA9: ;
	{
		gcmd_137113 = ((NU8) 19);
		wantmainmodule_526768();
		rawmessage_165386(((NU16) 180), command_137212);
	}
	goto LA30;
	LA10: ;
	{
		gcmd_137113 = ((NU8) 4);
		wantmainmodule_526768();
		commandcompiletojs_526401();
	}
	goto LA30;
	LA11: ;
	{
		gcmd_137113 = ((NU8) 5);
		wantmainmodule_526768();
		rawmessage_165386(((NU16) 180), command_137212);
	}
	goto LA30;
	LA12: ;
	{
		gcmd_137113 = ((NU8) 7);
		wantmainmodule_526768();
		commandpretty_526697();
	}
	goto LA30;
	LA13: ;
	{
		gcmd_137113 = ((NU8) 8);
		loadconfigs_184607(((NimStringDesc*) &TMP4326));
		wantmainmodule_526768();
		commanddoc_344741();
	}
	goto LA30;
	LA14: ;
	{
		gcmd_137113 = ((NU8) 8);
		loadconfigs_184607(((NimStringDesc*) &TMP4326));
		wantmainmodule_526768();
		definesymbol_168006(((NimStringDesc*) &TMP4446));
		commanddoc2_526237();
	}
	goto LA30;
	LA15: ;
	{
		gcmd_137113 = ((NU8) 16);
		loadconfigs_184607(((NimStringDesc*) &TMP4326));
		wantmainmodule_526768();
		commandrst2html_344779();
	}
	goto LA30;
	LA16: ;
	{
		gcmd_137113 = ((NU8) 17);
		loadconfigs_184607(((NimStringDesc*) &TMP4453));
		wantmainmodule_526768();
		commandrst2tex_344783();
	}
	goto LA30;
	LA17: ;
	{
		gcmd_137113 = ((NU8) 8);
		loadconfigs_184607(((NimStringDesc*) &TMP4326));
		wantmainmodule_526768();
		definesymbol_168006(((NimStringDesc*) &TMP4446));
		commandjson_344787();
	}
	goto LA30;
	LA18: ;
	{
		gcmd_137113 = ((NU8) 8);
		loadconfigs_184607(((NimStringDesc*) &TMP4326));
		commandbuildindex_344825();
	}
	goto LA30;
	LA19: ;
	{
		gcmd_137113 = ((NU8) 9);
		wantmainmodule_526768();
		commandgendepend_526226();
	}
	goto LA30;
	LA20: ;
	{
		gcmd_137113 = ((NU8) 10);
		{
			NimStringDesc* LOC54;
			tjsonnode292105* definedsymbols;
			NimStringDesc* s_527602;
			NimStringDesc* key_528002;
			NimStringDesc* val_528004;
			NI h_528006;
			NI HEX3Atmp_528008;
			NI res_528010;
			tjsonnode292105* libpaths;
			NimStringDesc* dir_527636;
			tstrentry118019* it_528012;
			tjsonnode292105* dumpdata;
			TY527683 LOC69;
			NimStringDesc* LOC70;
			LOC54 = 0;
			LOC54 = getconfigvar_137311(((NimStringDesc*) &TMP4506));
			if (!eqStrings(LOC54, ((NimStringDesc*) &TMP4507))) goto LA55;
			requiremainmoduleoption_526772();
			definedsymbols = newjarray_292411();
			s_527602 = 0;
			key_528002 = 0;
			val_528004 = 0;
			h_528006 = 0;
			HEX3Atmp_528008 = 0;
			HEX3Atmp_528008 = ((*gsymbols_168003).Data->Sup.len-1);
			res_528010 = 0;
			while (1) {
				if (!(res_528010 <= HEX3Atmp_528008)) goto LA57;
				h_528006 = res_528010;
				{
					if (!!((*gsymbols_168003).Data->data[h_528006].Field0 == 0)) goto LA60;
					key_528002 = (*gsymbols_168003).Data->data[h_528006].Field0;
					val_528004 = (*gsymbols_168003).Data->data[h_528006].Field1;
					{
						tjsonnode292105* LOC66;
						if (!eqStrings(val_528004, ((NimStringDesc*) &TMP4508))) goto LA64;
						s_527602 = key_528002;
						LOC66 = 0;
						LOC66 = HEX25_292466(s_527602);
						(*definedsymbols).kindU.S7.Elems = (TY292125*) incrSeq(&((*definedsymbols).kindU.S7.Elems)->Sup, sizeof(tjsonnode292105*));
						asgnRefNoCycle((void**) &(*definedsymbols).kindU.S7.Elems->data[(*definedsymbols).kindU.S7.Elems->Sup.len-1], LOC66);
					}
					LA64: ;
				}
				LA60: ;
				res_528010 += 1;
			} LA57: ;
			libpaths = newjarray_292411();
			dir_527636 = 0;
			it_528012 = ((tstrentry118019*) (searchpaths_137115.Head));
			while (1) {
				tjsonnode292105* LOC68;
				if (!!((it_528012 == NIM_NIL))) goto LA67;
				dir_527636 = (*it_528012).Data;
				LOC68 = 0;
				LOC68 = HEX25_292466(dir_527636);
				(*libpaths).kindU.S7.Elems = (TY292125*) incrSeq(&((*libpaths).kindU.S7.Elems)->Sup, sizeof(tjsonnode292105*));
				asgnRefNoCycle((void**) &(*libpaths).kindU.S7.Elems->data[(*libpaths).kindU.S7.Elems->Sup.len-1], LOC68);
				it_528012 = ((tstrentry118019*) ((*it_528012).Sup.Next));
			} LA67: ;
			memset((void*)LOC69, 0, sizeof(LOC69));
			LOC69[0].Field0 = copyString(((NimStringDesc*) &TMP4509));
			LOC69[0].Field1 = HEX25_292466(((NimStringDesc*) &TMP4510));
			LOC69[1].Field0 = copyString(((NimStringDesc*) &TMP4511));
			LOC69[1].Field1 = HEX25_292466(gprojectfull_137208);
			LOC69[2].Field0 = copyString(((NimStringDesc*) &TMP4512));
			LOC69[2].Field1 = definedsymbols;
			LOC69[3].Field0 = copyString(((NimStringDesc*) &TMP4513));
			LOC69[3].Field1 = libpaths;
			dumpdata = HEX25_292610(LOC69, 4);
			LOC70 = 0;
			LOC70 = HEX24_295148(dumpdata);
			outwriteln_164903(LOC70);
		}
		goto LA52;
		LA55: ;
		{
			NimStringDesc* s_527686;
			NimStringDesc* key_528014;
			NimStringDesc* val_528016;
			NI h_528018;
			NI HEX3Atmp_528020;
			NI res_528022;
			NimStringDesc* it_527687;
			tstrentry118019* it_528024;
			outwriteln_164903(((NimStringDesc*) &TMP4514));
			s_527686 = 0;
			key_528014 = 0;
			val_528016 = 0;
			h_528018 = 0;
			HEX3Atmp_528020 = 0;
			HEX3Atmp_528020 = ((*gsymbols_168003).Data->Sup.len-1);
			res_528022 = 0;
			while (1) {
				if (!(res_528022 <= HEX3Atmp_528020)) goto LA72;
				h_528018 = res_528022;
				{
					if (!!((*gsymbols_168003).Data->data[h_528018].Field0 == 0)) goto LA75;
					key_528014 = (*gsymbols_168003).Data->data[h_528018].Field0;
					val_528016 = (*gsymbols_168003).Data->data[h_528018].Field1;
					{
						if (!eqStrings(val_528016, ((NimStringDesc*) &TMP4508))) goto LA79;
						s_527686 = key_528014;
						outwriteln_164903(s_527686);
					}
					LA79: ;
				}
				LA75: ;
				res_528022 += 1;
			} LA72: ;
			outwriteln_164903(((NimStringDesc*) &TMP4515));
			it_527687 = 0;
			it_528024 = ((tstrentry118019*) (searchpaths_137115.Head));
			while (1) {
				if (!!((it_528024 == NIM_NIL))) goto LA81;
				it_527687 = (*it_528024).Data;
				msgwriteln_164937(it_527687);
				it_528024 = ((tstrentry118019*) ((*it_528024).Sup.Next));
			} LA81: ;
		}
		LA52: ;
	}
	goto LA30;
	LA21: ;
	{
		gcmd_137113 = ((NU8) 11);
		wantmainmodule_526768();
		commandcheck_526230();
	}
	goto LA30;
	LA22: ;
	{
		tnode188803* LOC84;
		gcmd_137113 = ((NU8) 12);
		wantmainmodule_526768();
		LOC84 = 0;
		LOC84 = parsefile_220033(gprojectmainidx_137209);
	}
	goto LA30;
	LA23: ;
	{
		gcmd_137113 = ((NU8) 13);
		wantmainmodule_526768();
		commandscan_526704();
		msgwriteln_164937(((NimStringDesc*) &TMP4518));
	}
	goto LA30;
	LA24: ;
	{
		gcmd_137113 = ((NU8) 18);
		commandinteractive_526603();
	}
	goto LA30;
	LA25: ;
	{
		NimStringDesc* LOC88;
		LOC88 = 0;
		LOC88 = maincommandarg_137288();
		commandeval_526651(LOC88);
	}
	goto LA30;
	LA26: ;
	{
		resetmemory_526776();
	}
	goto LA30;
	LA27: ;
	{
		gcmd_137113 = ((NU8) 14);
		{
			if (!!(((gevalexpr_137123) && (gevalexpr_137123)->Sup.len == 0))) goto LA93;
			commandeval_526651(gevalexpr_137123);
		}
		goto LA91;
		LA93: ;
		{
			wantmainmodule_526768();
			commandsuggest_526746();
		}
		LA91: ;
	}
	goto LA30;
	LA28: ;
	{
		isserving_137126 = NIM_TRUE;
		gglobaloptions_137111 |=((NI32)(1)<<((((NU8) 15))%(sizeof(NI32)*8)));
		gerrormax_164185 = 2147483647;
		serve_523292(maincommand_527011);
	}
	goto LA30;
	LA29: ;
	{
		rawmessage_165386(((NU16) 180), command_137212);
	}
	LA30: ;
	{
		NIM_BOOL LOC100;
		NIM_BOOL LOC101;
		TY173034 LOC106;
		NF LOC107;
		NI LOC108;
		LOC100 = 0;
		LOC101 = 0;
		LOC101 = (gerrorcounter_164182 == 0);
		if (!(LOC101)) goto LA102;
		LOC101 = !(((525376 &(1<<((gcmd_137113)&31)))!=0));
		LA102: ;
		LOC100 = LOC101;
		if (!(LOC100)) goto LA103;
		LOC100 = (0 < gverbosity_137120);
		LA103: ;
		if (!LOC100) goto LA104;
		memset((void*)LOC106, 0, sizeof(LOC106));
		LOC106[0] = nimIntToStr(glinescompiled_180197);
		LOC107 = 0;
		LOC107 = ntepochTime();
		LOC106[1] = nsuformatFloat(((NF)(LOC107) - (NF)(glastcmdtime_137124)), ((NU8) 1), 3);
		LOC108 = 0;
		LOC108 = gettotalmem_5265();
		LOC106[2] = formatsize_91567(((NI64) (LOC108)), 46);
		rawmessage_165292(((NU16) 258), LOC106, 3);
	}
	LA104: ;
}
N_NOINLINE(void, mainInit)(void) {
}

N_NOINLINE(void, mainDatInit)(void) {
}

