/* Generated by Nim Compiler v0.12.0 */
/*   (c) 2015 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 Tlinkedlist140028 Tlinkedlist140028;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tlistentry140022 Tlistentry140022;
typedef struct Tpass277017 Tpass277017;
typedef struct Tpasscontext277005 Tpasscontext277005;
typedef struct Tsym225841 Tsym225841;
typedef struct Trodreader268030 Trodreader268030;
typedef struct Tnode225809 Tnode225809;
typedef struct Cell48947 Cell48947;
typedef struct TNimType TNimType;
typedef struct Cellseq48963 Cellseq48963;
typedef struct Gcheap51018 Gcheap51018;
typedef struct Gcstack51016 Gcstack51016;
typedef struct Cellset48959 Cellset48959;
typedef struct Pagedesc48955 Pagedesc48955;
typedef struct Memregion30891 Memregion30891;
typedef struct Smallchunk30843 Smallchunk30843;
typedef struct Llchunk30885 Llchunk30885;
typedef struct Bigchunk30845 Bigchunk30845;
typedef struct Intset30817 Intset30817;
typedef struct Trunk30813 Trunk30813;
typedef struct Avlnode30889 Avlnode30889;
typedef struct Gcstat51014 Gcstat51014;
typedef struct TY576054 TY576054;
typedef struct Tmoduleinmemory576017 Tmoduleinmemory576017;
typedef struct TY225932 TY225932;
typedef struct Jsonnodeobj325754 Jsonnodeobj325754;
typedef struct Stringtableobj145212 Stringtableobj145212;
typedef struct TNimObject TNimObject;
typedef struct TNimNode TNimNode;
typedef struct Keyvaluepairseq145210 Keyvaluepairseq145210;
typedef struct Keyvaluepair145208 Keyvaluepair145208;
typedef struct TY325769 TY325769;
typedef struct TY325774 TY325774;
typedef struct Tstrentry140024 Tstrentry140024;
typedef struct TY326284 TY326284;
typedef struct Tllstream213204 Tllstream213204;
typedef struct Tlexer216185 Tlexer216185;
typedef struct Tbaselexer214024 Tbaselexer214024;
typedef struct Tlineinfo190352 Tlineinfo190352;
typedef struct Ttoken216181 Ttoken216181;
typedef struct Tident198021 Tident198021;
typedef struct TY130408 TY130408;
typedef struct Tidobj198015 Tidobj198015;
typedef struct Ttypeseq225843 Ttypeseq225843;
typedef struct Tscope225835 Tscope225835;
typedef struct TY225944 TY225944;
typedef struct Tstrtable225813 Tstrtable225813;
typedef struct Tsymseq225811 Tsymseq225811;
typedef struct Ttype225847 Ttype225847;
typedef struct Tloc225823 Tloc225823;
typedef struct Ropeobj176009 Ropeobj176009;
typedef struct Tlib225827 Tlib225827;
typedef struct Tindex268028 Tindex268028;
typedef struct Tiitable233274 Tiitable233274;
typedef struct Tiipairseq233272 Tiipairseq233272;
typedef struct Table268063 Table268063;
typedef struct Keyvaluepairseq268066 Keyvaluepairseq268066;
typedef struct Memfile266208 Memfile266208;
typedef struct Tnodeseq225803 Tnodeseq225803;
typedef struct Basechunk30841 Basechunk30841;
typedef struct Freecell30833 Freecell30833;
typedef struct Tinstantiation225831 Tinstantiation225831;
typedef struct Tiipair233270 Tiipair233270;
typedef struct Keyvaluepair268069 Keyvaluepair268069;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tlinkedlist140028  {
Tlistentry140022* head;
Tlistentry140022* tail;
NI counter;
};
typedef N_NIMCALL_PTR(Tpasscontext277005*, Tpassopen277009) (Tsym225841* module);
typedef N_NIMCALL_PTR(Tpasscontext277005*, Tpassopencached277011) (Tsym225841* module, Trodreader268030* rd);
typedef N_NIMCALL_PTR(Tnode225809*, Tpassprocess277015) (Tpasscontext277005* p, Tnode225809* toplevelstmt);
typedef N_NIMCALL_PTR(Tnode225809*, Tpassclose277013) (Tpasscontext277005* p, Tnode225809* n);
struct Tpass277017 {
Tpassopen277009 Field0;
Tpassopencached277011 Field1;
Tpassprocess277015 Field2;
Tpassclose277013 Field3;
};
struct  Cell48947  {
NI refcount;
TNimType* typ;
};
struct  Cellseq48963  {
NI len;
NI cap;
Cell48947** d;
};
struct  Cellset48959  {
NI counter;
NI max;
Pagedesc48955* head;
Pagedesc48955** data;
};
typedef Smallchunk30843* TY30906[512];
typedef Trunk30813* Trunkbuckets30815[256];
struct  Intset30817  {
Trunkbuckets30815 data;
};
struct  Memregion30891  {
NI minlargeobj;
NI maxlargeobj;
TY30906 freesmallchunks;
Llchunk30885* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk30845* freechunkslist;
Intset30817 chunkstarts;
Avlnode30889* root;
Avlnode30889* deleted;
Avlnode30889* last;
Avlnode30889* freeavlnodes;
};
struct  Gcstat51014  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap51018  {
Gcstack51016* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq48963 zct;
Cellseq48963 decstack;
Cellset48959 cycleroots;
Cellseq48963 tempstack;
NI recgclock;
Memregion30891 region;
Gcstat51014 stat;
};
typedef NU8 Sha1digest201009[20];
struct  Tmoduleinmemory576017  {
NF compiledat;
Sha1digest201009 hash;
TY225932* deps;
NU8 needsrecompile;
NU8 hashstatus;
};
typedef N_NIMCALL_PTR(void, TY3889) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3894) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3889 marker;
TY3894 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Stringtableobj145212  {
  TNimObject Sup;
NI counter;
Keyvaluepairseq145210* data;
NU8 mode;
};
struct Keyvaluepair145208 {
NimStringDesc* Field0;
NimStringDesc* Field1;
};
struct  Jsonnodeobj325754  {
NU8 kind;
union{
struct {NimStringDesc* str;
} S1;
struct {NI64 num;
} S2;
struct {NF fnum;
} S3;
struct {NIM_BOOL bval;
} S4;
struct {TY325769* fields;
} S6;
struct {TY325774* elems;
} S7;
} kindU;
};
struct  Tlistentry140022  {
  TNimObject Sup;
Tlistentry140022* prev;
Tlistentry140022* next;
};
struct  Tstrentry140024  {
  Tlistentry140022 Sup;
NimStringDesc* data;
};
struct TY326284 {
NimStringDesc* Field0;
Jsonnodeobj325754* Field1;
};
typedef TY326284 TY579027[4];
struct  Tbaselexer214024  {
  TNimObject Sup;
NI bufpos;
NCSTRING buf;
NI buflen;
Tllstream213204* stream;
NI linenumber;
NI sentinel;
NI linestart;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (Tlineinfo190352 info, NU16 msg, NimStringDesc* arg, void* ClEnv);
void* ClEnv;
} Terrorhandler216183;
struct  Tlexer216185  {
  Tbaselexer214024 Sup;
NI32 fileidx;
NI indentahead;
NI currlineindent;
NIM_BOOL strongspaces;
Terrorhandler216183 errorhandler;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Ttoken216181  {
NU8 toktype;
NI indent;
Tident198021* ident;
NI64 inumber;
NF fnumber;
NU8 base;
NI8 strongspacea;
NI8 strongspaceb;
NimStringDesc* literal;
NI line;
NI col;
};
struct  Tidobj198015  {
  TNimObject Sup;
NI id;
};
struct  Tstrtable225813  {
NI counter;
Tsymseq225811* data;
};
struct  Tlineinfo190352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tloc225823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype225847* t;
Ropeobj176009* r;
Ropeobj176009* heaproot;
};
struct  Tsym225841  {
  Tidobj198015 Sup;
NU8 kind;
union{
struct {Ttypeseq225843* typeinstcache;
Tscope225835* typscope;
} S1;
struct {TY225944* procinstcache;
Tsym225841* gcunsafetyreason;
} S2;
struct {TY225944* usedgenerics;
Tstrtable225813 tab;
} S3;
struct {Tsym225841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype225847* typ;
Tident198021* name;
Tlineinfo190352 info;
Tsym225841* owner;
NU32 flags;
Tnode225809* ast;
NU32 options;
NI position;
NI offset;
Tloc225823 loc;
Tlib225827* annex;
Tnode225809* constraint;
};
typedef Tpass277017 TY578241[3];
typedef Tident198021* TY198038[8192];
typedef N_NIMCALL_PTR(void, TY575256) (void);
typedef NimStringDesc* TY194829[4];
struct  Tpasscontext277005  {
  TNimObject Sup;
NIM_BOOL fromcache;
};
struct  Tiitable233274  {
NI counter;
Tiipairseq233272* data;
};
struct  Tindex268028  {
NI lastidxkey;
NI lastidxval;
Tiitable233274 tab;
NimStringDesc* r;
NI offset;
};
struct  Table268063  {
Keyvaluepairseq268066* data;
NI counter;
};
struct  Memfile266208  {
void* mem;
NI size;
int handle;
};
struct  Trodreader268030  {
  TNimObject Sup;
NI pos;
NCSTRING s;
NU32 options;
NU8 reason;
TY225932* moddeps;
TY225932* files;
NI dataidx;
NI convertersidx;
NI initidx;
NI interfidx;
NI compilerprocsidx;
NI methodsidx;
NimStringDesc* filename;
Tindex268028 index;
Tindex268028 imports;
NI readerindex;
NI line;
NI moduleid;
Table268063 syms;
Memfile266208 memfile;
Tsymseq225811* methods;
NimStringDesc* origfile;
NIM_BOOL inviewmode;
};
struct  Tnode225809  {
Ttype225847* typ;
Tlineinfo190352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym225841* sym;
} S4;
struct {Tident198021* ident;
} S5;
struct {Tnodeseq225803* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Gcstack51016  {
Gcstack51016* prev;
Gcstack51016* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY30822[8];
struct  Pagedesc48955  {
Pagedesc48955* next;
NI key;
TY30822 bits;
};
struct  Basechunk30841  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk30843  {
  Basechunk30841 Sup;
Smallchunk30843* next;
Smallchunk30843* prev;
Freecell30833* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk30885  {
NI size;
NI acc;
Llchunk30885* next;
};
struct  Bigchunk30845  {
  Basechunk30841 Sup;
Bigchunk30845* next;
Bigchunk30845* prev;
NI align;
NF data;
};
struct  Trunk30813  {
Trunk30813* next;
NI key;
TY30822 bits;
};
typedef Avlnode30889* TY30896[2];
struct  Avlnode30889  {
TY30896 link;
NI key;
NI upperbound;
NI level;
};
struct  Tllstream213204  {
  TNimObject Sup;
NU8 kind;
FILE* f;
NimStringDesc* s;
NI rd;
NI wr;
NI lineoffset;
};
struct  Tident198021  {
  Tidobj198015 Sup;
NimStringDesc* s;
Tident198021* next;
NI h;
};
struct  Tscope225835  {
NI depthlevel;
Tstrtable225813 symbols;
Tnodeseq225803* usingsyms;
Tscope225835* parent;
};
struct  Ttype225847  {
  Tidobj198015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq225843* sons;
Tnode225809* n;
Tsym225841* owner;
Tsym225841* sym;
Tsym225841* destructor;
Tsym225841* deepcopy;
Tsym225841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc225823 loc;
};
struct  Ropeobj176009  {
  TNimObject Sup;
Ropeobj176009* left;
Ropeobj176009* right;
NI length;
NimStringDesc* data;
};
struct  Tlib225827  {
  Tlistentry140022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj176009* name;
Tnode225809* path;
};
struct  Tiipair233270  {
NI key;
NI val;
};
struct Keyvaluepair268069 {
NI Field0;
NI Field1;
Tsym225841* Field2;
};
struct  Freecell30833  {
Freecell30833* next;
NI zerofield;
};
struct  Tinstantiation225831  {
Tsym225841* sym;
Ttypeseq225843* concretetypes;
TY225932* usedby;
NI compilesid;
};
struct TY576054 {
  TGenericSeq Sup;
  Tmoduleinmemory576017 data[SEQ_DECL_SIZE];
};
struct TY325774 {
  TGenericSeq Sup;
  Jsonnodeobj325754* data[SEQ_DECL_SIZE];
};
struct TY130408 {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct Tsymseq225811 {
  TGenericSeq Sup;
  Tsym225841* data[SEQ_DECL_SIZE];
};
struct TY225932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq145210 {
  TGenericSeq Sup;
  Keyvaluepair145208 data[SEQ_DECL_SIZE];
};
struct TY325769 {
  TGenericSeq Sup;
  TY326284 data[SEQ_DECL_SIZE];
};
struct Ttypeseq225843 {
  TGenericSeq Sup;
  Ttype225847* data[SEQ_DECL_SIZE];
};
struct TY225944 {
  TGenericSeq Sup;
  Tinstantiation225831* data[SEQ_DECL_SIZE];
};
struct Tiipairseq233272 {
  TGenericSeq Sup;
  Tiipair233270 data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq268066 {
  TGenericSeq Sup;
  Keyvaluepair268069 data[SEQ_DECL_SIZE];
};
struct Tnodeseq225803 {
  TGenericSeq Sup;
  Tnode225809* data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, clearpasses_277182)(void);
N_NIMCALL(NF, ntepochTime)(void);
N_NIMCALL(void, appendstr_140268)(Tlinkedlist140028* list, NimStringDesc* data);
N_NIMCALL(void, prependstr_140419)(Tlinkedlist140028* list, NimStringDesc* data);
static N_INLINE(void, setid_224440)(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_578071)(void);
N_NIMCALL(void, initvars_204076)(void);
N_NIMCALL(void, semanticpasses_578033)(void);
N_NIMCALL(void, registerpass_277190)(Tpass277017* p);
N_NIMCALL(Tpasscontext277005*, verboseopen_558012)(Tsym225841* s);
N_NIMCALL(Tnode225809*, verboseprocess_558023)(Tpasscontext277005* context, Tnode225809* n);
N_NIMCALL(Tpasscontext277005*, myopen_502741)(Tsym225841* module);
N_NIMCALL(Tpasscontext277005*, myopencached_502778)(Tsym225841* module, Trodreader268030* rd);
N_NIMCALL(Tnode225809*, myprocess_502917)(Tpasscontext277005* context, Tnode225809* n);
N_NIMCALL(Tnode225809*, myclose_502933)(Tpasscontext277005* context, Tnode225809* n);
N_NIMCALL(Tpasscontext277005*, myopen_545769)(Tsym225841* module);
N_NIMCALL(Tpasscontext277005*, myopencached_545921)(Tsym225841* module, Trodreader268030* rd);
N_NIMCALL(Tnode225809*, myprocess_546008)(Tpasscontext277005* b, Tnode225809* n);
N_NIMCALL(Tnode225809*, myclose_546442)(Tpasscontext277005* b, Tnode225809* n);
N_NIMCALL(void, rodpass_578007)(void);
N_NIMCALL(Tpasscontext277005*, myopen_291250)(Tsym225841* module);
N_NIMCALL(Tnode225809*, process_290968)(Tpasscontext277005* c, Tnode225809* n);
N_NIMCALL(Tnode225809*, myclose_291265)(Tpasscontext277005* c, Tnode225809* n);
N_NIMCALL(void, compileproject_576994)(NI32 projectfileidx);
N_NIMCALL(void, cgenwritemodules_546520)(void);
N_NIMCALL(void, callccompiler_204808)(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(Cell48947*, usrtocell_52646)(void* usr);
static N_INLINE(void, rtladdzct_54204)(Cell48947* c);
N_NOINLINE(void, addzct_52617)(Cellseq48963* s, Cell48947* c);
N_NIMCALL(void, resetcgenmodules_545651)(void);
N_NIMCALL(void, resetcompilationlists_204143)(void);
N_NIMCALL(void, resetcaches_507448)(void);
N_NIMCALL(void, Gcfullcollect_11205)(void);
N_NIMCALL(void, definesymbol_199013)(NimStringDesc* symbol);
N_NIMCALL(void, rawmessage_194636)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, commandcompiletojs_578132)(void);
N_NIMCALL(void, settarget_174662)(NU8 o, NU8 c);
N_NIMCALL(Tpasscontext277005*, myopen_557213)(Tsym225841* s);
N_NIMCALL(Tpasscontext277005*, myopencached_557202)(Tsym225841* s, Trodreader268030* rd);
N_NIMCALL(Tnode225809*, myprocess_557068)(Tpasscontext277005* b, Tnode225809* n);
N_NIMCALL(Tnode225809*, myclose_557174)(Tpasscontext277005* b, Tnode225809* n);
N_NIMCALL(void, wantmainmodule_576931)(void);
N_NIMCALL(void, loadconfigs_221609)(NimStringDesc* cfg);
N_NIMCALL(void, commanddoc_387360)(void);
N_NIMCALL(void, commanddoc2_578060)(void);
N_NIMCALL(Tpasscontext277005*, myopen_560068)(Tsym225841* module);
N_NIMCALL(Tnode225809*, processnode_560056)(Tpasscontext277005* c, Tnode225809* n);
N_NIMCALL(Tnode225809*, close_560018)(Tpasscontext277005* p, Tnode225809* n);
N_NIMCALL(void, finishdoc2pass_560106)(NimStringDesc* project);
N_NIMCALL(void, commandrst2html_387400)(void);
N_NIMCALL(void, commandrst2tex_387408)(void);
N_NIMCALL(void, commandjson_387416)(void);
N_NIMCALL(void, commandbuildindex_387452)(void);
N_NIMCALL(void, commandgendepend_578041)(void);
N_NIMCALL(Tpasscontext277005*, myopen_559131)(Tsym225841* module);
N_NIMCALL(Tnode225809*, adddotdependency_559041)(Tpasscontext277005* c, Tnode225809* n);
N_NIMCALL(Tnode225809*, cleanup_558066)(Tpasscontext277005* c, Tnode225809* n);
N_NIMCALL(void, generatedot_559009)(NimStringDesc* project);
N_NIMCALL(void, execexternalprogram_204175)(NimStringDesc* cmd, NU16 msg);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
static N_INLINE(void, appendChar)(NimStringDesc* dest, NIM_CHAR c);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(NimStringDesc*, getconfigvar_167335)(NimStringDesc* key);
N_NIMCALL(Jsonnodeobj325754*, newjarray_325956)(void);
N_NIMCALL(Jsonnodeobj325754*, HEX25_326205)(NimStringDesc* s);
N_NIMCALL(TGenericSeq*, incrSeqV2)(TGenericSeq* seq, NI elemsize);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(Jsonnodeobj325754*, HEX25_326281)(TY326284* keyvals, NI keyvalsLen0);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(void, msgwriteln_191915)(NimStringDesc* s, NU8 flags);
N_NIMCALL(NimStringDesc*, HEX24_330129)(Jsonnodeobj325754* node);
N_NIMCALL(void, commandcheck_578049)(void);
N_NIMCALL(Tnode225809*, parsefile_253041)(NI32 fileidx);
N_NIMCALL(void, commandscan_578278)(void);
N_NIMCALL(NimStringDesc*, nosaddFileExt)(NimStringDesc* filename, NimStringDesc* ext);
N_NIMCALL(NimStringDesc*, maincommandarg_167308)(void);
N_NIMCALL(Tllstream213204*, llstreamopen_213256)(NimStringDesc* filename, NU8 mode);
N_NIMCALL(void, inittoken_216369)(Ttoken216181* L);
N_NIMCALL(void, openlexer_216410)(Tlexer216185* lex, NimStringDesc* filename, Tllstream213204* inputstream);
N_NIMCALL(void, rawgettok_220048)(Tlexer216185* L, Ttoken216181* tok);
N_NIMCALL(void, printtok_216355)(Ttoken216181* tok);
N_NIMCALL(void, closelexer_216422)(Tlexer216185* lex);
N_NIMCALL(void, commandinteractive_578207)(void);
N_NIMCALL(void, interactivepasses_578140)(void);
N_NIMCALL(void, initdefines_199254)(void);
N_NIMCALL(Tpasscontext277005*, myopen_445295)(Tsym225841* module);
N_NIMCALL(Tnode225809*, myprocess_445412)(Tpasscontext277005* c, Tnode225809* n);
N_NIMCALL(void, compilesystemmodule_576910)(void);
N_NIMCALL(Tsym225841*, compilemodule_576725)(NI32 fileidx, NU32 flags);
N_NIMCALL(NI32, fileinfoidx_191253)(NimStringDesc* filename);
N_NIMCALL(Tsym225841*, makestdinmodule_577018)(void);
N_NIMCALL(void, processmodule_277056)(Tsym225841* module, Tllstream213204* stream, Trodreader268030* rd);
N_NIMCALL(Tllstream213204*, llstreamopenstdin_213293)(void);
N_NIMCALL(void, commandeval_578256)(NimStringDesc* exp);
N_NIMCALL(void, evalnim_578246)(Tnode225809* nodes, Tsym225841* module);
N_NIMCALL(void, carrypasses_277231)(Tnode225809* nodes, Tsym225841* module, Tpass277017* passes, NI passesLen0);
N_NIMCALL(Tnode225809*, parsestring_245506)(NimStringDesc* s, NimStringDesc* filename, NI line, Terrorhandler216183 errorhandler);
N_NIMCALL(void, resetmemory_578338)(void);
N_NIMCALL(void, resetallmodules_576391)(void);
N_NIMCALL(void, resetropecache_176111)(void);
N_NIMCALL(void, resetsystypes_274268)(void);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
N_NIMCALL(void, commandsuggest_578325)(void);
N_NIMCALL(void, resetmodule_576319)(NI32 fileidx);
N_NIMCALL(void, serve_575254)(TY575256 action);
N_NIMCALL(void, maincommand_578628)(void);
N_NIMCALL(void, rawmessage_193675)(NU16 msg, NimStringDesc** args, NI argsLen0);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
N_NIMCALL(NimStringDesc*, nsuformatFloat)(NF f, NU8 format, NI precision, NIM_CHAR decimalsep);
N_NIMCALL(NimStringDesc*, formatsize_105405)(NI64 bytes, NIM_CHAR decimalsep);
N_NIMCALL(NI, gettotalmem_9095)(void);
N_NIMCALL(NIM_BOOL, isdefined_199031)(NimStringDesc* symbol);
N_NIMCALL(void, resetattributes_194648)(void);
STRING_LITERAL(TMP3711, "c", 1);
STRING_LITERAL(TMP3712, "cc", 2);
STRING_LITERAL(TMP3713, "compile", 7);
STRING_LITERAL(TMP3714, "compiletoc", 10);
STRING_LITERAL(TMP3715, "cpp", 3);
STRING_LITERAL(TMP3716, "compiletocpp", 12);
STRING_LITERAL(TMP3717, "objc", 4);
STRING_LITERAL(TMP3718, "compiletooc", 11);
STRING_LITERAL(TMP3719, "run", 3);
STRING_LITERAL(TMP3720, "js", 2);
STRING_LITERAL(TMP3721, "compiletojs", 11);
STRING_LITERAL(TMP3722, "doc", 3);
STRING_LITERAL(TMP3723, "doc2", 4);
STRING_LITERAL(TMP3724, "rst2html", 8);
STRING_LITERAL(TMP3725, "rst2tex", 7);
STRING_LITERAL(TMP3726, "jsondoc", 7);
STRING_LITERAL(TMP3727, "buildindex", 10);
STRING_LITERAL(TMP3728, "gendepend", 9);
STRING_LITERAL(TMP3729, "dump", 4);
STRING_LITERAL(TMP3730, "check", 5);
STRING_LITERAL(TMP3731, "parse", 5);
STRING_LITERAL(TMP3732, "scan", 4);
STRING_LITERAL(TMP3733, "secret", 6);
STRING_LITERAL(TMP3734, "e", 1);
STRING_LITERAL(TMP3735, "reset", 5);
STRING_LITERAL(TMP3736, "idetools", 8);
STRING_LITERAL(TMP3737, "serve", 5);
STRING_LITERAL(TMP3738, "nop", 3);
STRING_LITERAL(TMP3739, "help", 4);
STRING_LITERAL(TMP4617, "", 0);
STRING_LITERAL(TMP4618, "nimrod", 6);
STRING_LITERAL(TMP4619, "ecmascript", 10);
STRING_LITERAL(TMP5012, "nimdoc.cfg", 10);
STRING_LITERAL(TMP5143, "nimdoc", 6);
STRING_LITERAL(TMP5149, "nimdoc.tex.cfg", 14);
STRING_LITERAL(TMP5219, "dot -Tpng -o", 12);
STRING_LITERAL(TMP5220, "png", 3);
STRING_LITERAL(TMP5221, "dot", 3);
STRING_LITERAL(TMP5222, "dump.format", 11);
STRING_LITERAL(TMP5223, "json", 4);
STRING_LITERAL(TMP5224, "false", 5);
STRING_LITERAL(TMP5225, "version", 7);
STRING_LITERAL(TMP5226, "0.12.0", 6);
STRING_LITERAL(TMP5227, "project_path", 12);
STRING_LITERAL(TMP5228, "defined_symbols", 15);
STRING_LITERAL(TMP5229, "lib_paths", 9);
STRING_LITERAL(TMP5232, "-- list of currently defined symbols --", 39);
STRING_LITERAL(TMP5233, "-- end of list --", 17);
STRING_LITERAL(TMP5234, "nim", 3);
STRING_LITERAL(TMP5237, "Beware: Indentation tokens depend on the parser\'s state!", 56);
STRING_LITERAL(TMP5238, "nimscript", 9);
STRING_LITERAL(TMP5240, "echo \"eval\\t\", repr(", 20);
STRING_LITERAL(TMP5241, ")", 1);
static NIM_CONST Terrorhandler216183 TMP5242 = {NIM_NIL,NIM_NIL};
STRING_LITERAL(TMP5279, "release", 7);
STRING_LITERAL(TMP5280, "Release Build", 13);
STRING_LITERAL(TMP5281, "Debug Build", 11);
extern NF glastcmdtime_167145;
extern Tlinkedlist140028 searchpaths_167136;
extern NimStringDesc* libpath_167233;
extern NimStringDesc* gprojectfull_167236;
extern NimStringDesc* gprojectpath_167235;
extern NI gfrontendid_224012;
extern NimStringDesc* command_167240;
extern NU8 gcmd_167134;
extern NU32 gglobaloptions_167132;
extern NIM_BOOL isserving_167147;
extern NimStringDesc* lastcaascmd_575205;
extern NimStringDesc* curcaascmd_575204;
extern Gcheap51018 gch_51059;
extern TY576054* gmemcachedata_576071;
extern NI gerrormax_191399;
extern NimStringDesc* gprojectname_167234;
extern Stringtableobj145212* gsymbols_199004;
extern NI32 gprojectmainidx_167238;
extern TNimType NTI216185; /* TLexer */
extern TY130408* commandargs_167258;
extern Tsym225841* systemmodule_274019;
extern Tsymseq225811* gowners_280290;
extern TNimType NTI225811; /* TSymSeq */
extern TY198038 buckets_198039;
extern Tident198021* idanon_198495;
extern NimStringDesc* gevalexpr_167144;
extern Tlineinfo190352 gtrackpos_191901;
extern NI gerrorcounter_191396;
extern NI glinescompiled_216213;

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

static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b) {
	NIM_BOOL result;
	NIM_BOOL LOC11;
	int LOC13;
{	result = 0;
	{
		if (!(a == b)) goto LA3;
		result = NIM_TRUE;
		goto BeforeRet;
	}
	LA3: ;
	{
		NIM_BOOL LOC7;
		LOC7 = 0;
		LOC7 = (a == NIM_NIL);
		if (LOC7) goto LA8;
		LOC7 = (b == NIM_NIL);
		LA8: ;
		if (!LOC7) goto LA9;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA9: ;
	LOC11 = 0;
	LOC11 = ((*a).Sup.len == (*b).Sup.len);
	if (!(LOC11)) goto LA12;
	LOC13 = 0;
	LOC13 = memcmp(((NCSTRING) ((*a).data)), ((NCSTRING) ((*b).data)), (*a).Sup.len);
	LOC11 = (LOC13 == ((NI32) 0));
	LA12: ;
	result = LOC11;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, semanticpasses_578033)(void) {
	Tpass277017 LOC1;
	Tpass277017 LOC2;
	LOC1.Field0 = verboseopen_558012;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = verboseprocess_558023;
	LOC1.Field3 = NIM_NIL;
	registerpass_277190((&LOC1));
	LOC2.Field0 = myopen_502741;
	LOC2.Field1 = myopencached_502778;
	LOC2.Field2 = myprocess_502917;
	LOC2.Field3 = myclose_502933;
	registerpass_277190((&LOC2));
}

N_NIMCALL(void, rodpass_578007)(void) {
	{
		Tpass277017 LOC5;
		if (!((gglobaloptions_167132 &(1<<((((NU8) 14))&31)))!=0)) goto LA3;
		LOC5.Field0 = myopen_291250;
		LOC5.Field1 = NIM_NIL;
		LOC5.Field2 = process_290968;
		LOC5.Field3 = myclose_291265;
		registerpass_277190((&LOC5));
	}
	LA3: ;
}

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

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

static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
	Cell48947* c;
	c = usrtocell_52646(p);
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU64)((*c).refcount) < (NU64)(((NI) 8)))) goto LA3;
		rtladdzct_54204(c);
	}
	LA3: ;
}

N_NIMCALL(void, commandcompiletoc_578071)(void) {
	Tpass277017 LOC1;
	initvars_204076();
	semanticpasses_578033();
	LOC1.Field0 = myopen_545769;
	LOC1.Field1 = myopencached_545921;
	LOC1.Field2 = myprocess_546008;
	LOC1.Field3 = myclose_546442;
	registerpass_277190((&LOC1));
	rodpass_578007();
	compileproject_576994(((NI32) -1));
	cgenwritemodules_546520();
	{
		NimStringDesc* LOC6;
		if (!!((gcmd_167134 == ((NU8) 19)))) goto LA4;
		LOC6 = 0;
		LOC6 = noschangeFileExt(gprojectfull_167236, ((NimStringDesc*) &TMP4617));
		callccompiler_204808(LOC6);
	}
	LA4: ;
	{
		NimStringDesc* LOC11;
		if (!isserving_167147) goto LA9;
		LOC11 = 0;
		LOC11 = lastcaascmd_575205; lastcaascmd_575205 = copyStringRC1(curcaascmd_575204);
		if (LOC11) nimGCunrefNoCycle(LOC11);
		resetcgenmodules_545651();
		{
			NI i_578108;
			NI HEX3Atmp_578110;
			NI res_578113;
			i_578108 = 0;
			HEX3Atmp_578110 = 0;
			HEX3Atmp_578110 = ((gmemcachedata_576071 ? gmemcachedata_576071->Sup.len : 0) - 1);
			res_578113 = ((NI) 0);
			{
				while (1) {
					if (!(res_578113 <= HEX3Atmp_578110)) goto LA14;
					i_578108 = res_578113;
					gmemcachedata_576071->data[i_578108].hashstatus = ((NU8) 1);
					gmemcachedata_576071->data[i_578108].needsrecompile = ((NU8) 0);
					res_578113 += ((NI) 1);
				} LA14: ;
			}
		}
		resetcompilationlists_204143();
		resetcaches_507448();
		Gcfullcollect_11205();
	}
	LA9: ;
}

N_NIMCALL(void, commandcompiletojs_578132)(void) {
	Tpass277017 LOC1;
	settarget_174662(((NU8) 22), ((NU8) 15));
	definesymbol_199013(((NimStringDesc*) &TMP4618));
	definesymbol_199013(((NimStringDesc*) &TMP4619));
	definesymbol_199013(((NimStringDesc*) &TMP3720));
	semanticpasses_578033();
	LOC1.Field0 = myopen_557213;
	LOC1.Field1 = myopencached_557202;
	LOC1.Field2 = myprocess_557068;
	LOC1.Field3 = myclose_557174;
	registerpass_277190((&LOC1));
	compileproject_576994(((NI32) -1));
}

N_NIMCALL(void, commanddoc2_578060)(void) {
	Tpass277017 LOC1;
	gerrormax_191399 = ((NI) IL64(9223372036854775807));
	semanticpasses_578033();
	LOC1.Field0 = myopen_560068;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = processnode_560056;
	LOC1.Field3 = close_560018;
	registerpass_277190((&LOC1));
	compileproject_576994(((NI32) -1));
	finishdoc2pass_560106(gprojectname_167234);
}

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

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

N_NIMCALL(void, commandgendepend_578041)(void) {
	Tpass277017 LOC1;
	Tpass277017 LOC2;
	NimStringDesc* LOC3;
	NimStringDesc* LOC4;
	NimStringDesc* LOC5;
	semanticpasses_578033();
	LOC1.Field0 = myopen_559131;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = adddotdependency_559041;
	LOC1.Field3 = NIM_NIL;
	registerpass_277190((&LOC1));
	LOC2.Field0 = NIM_NIL;
	LOC2.Field1 = NIM_NIL;
	LOC2.Field2 = cleanup_558066;
	LOC2.Field3 = cleanup_558066;
	registerpass_277190((&LOC2));
	compileproject_576994(((NI32) -1));
	generatedot_559009(gprojectfull_167236);
	LOC3 = 0;
	LOC4 = 0;
	LOC4 = noschangeFileExt(gprojectfull_167236, ((NimStringDesc*) &TMP5220));
	LOC5 = 0;
	LOC5 = noschangeFileExt(gprojectfull_167236, ((NimStringDesc*) &TMP5221));
	LOC3 = rawNewString(LOC4->Sup.len + LOC5->Sup.len + 13);
appendString(LOC3, ((NimStringDesc*) &TMP5219));
appendString(LOC3, LOC4);
appendChar(LOC3, 32);
appendString(LOC3, LOC5);
	execexternalprogram_204175(LOC3, ((NU16) 284));
}

static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) {
	{
		Cell48947* c;
		if (!!((src == NIM_NIL))) goto LA3;
		c = usrtocell_52646(src);
		(*c).refcount += ((NI) 8);
	}
	LA3: ;
	{
		Cell48947* c;
		if (!!(((*dest) == NIM_NIL))) goto LA7;
		c = usrtocell_52646((*dest));
		{
			(*c).refcount -= ((NI) 8);
			if (!((NU64)((*c).refcount) < (NU64)(((NI) 8)))) goto LA11;
			rtladdzct_54204(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

N_NIMCALL(void, commandcheck_578049)(void) {
	gerrormax_191399 = ((NI) IL64(9223372036854775807));
	semanticpasses_578033();
	rodpass_578007();
	compileproject_576994(((NI32) -1));
}

N_NIMCALL(void, commandscan_578278)(void) {
	NimStringDesc* f;
	NimStringDesc* LOC1;
	Tllstream213204* stream;
	LOC1 = 0;
	LOC1 = maincommandarg_167308();
	f = nosaddFileExt(LOC1, ((NimStringDesc*) &TMP5234));
	stream = llstreamopen_213256(f, ((NU8) 0));
	{
		Tlexer216185 L;
		Ttoken216181 tok;
		if (!!((stream == NIM_NIL))) goto LA4;
		memset((void*)(&L), 0, sizeof(L));
		L.Sup.Sup.m_type = (&NTI216185);
		memset((void*)(&tok), 0, sizeof(tok));
		inittoken_216369((&tok));
		openlexer_216410((&L), f, stream);
		{
			while (1) {
				rawgettok_220048((&L), (&tok));
				printtok_216355((&tok));
				{
					if (!(tok.toktype == ((NU8) 1))) goto LA10;
					goto LA6;
				}
				LA10: ;
			}
		} LA6: ;
		closelexer_216422((&L));
	}
	goto LA2;
	LA4: ;
	{
		rawmessage_194636(((NU16) 3), f);
	}
	LA2: ;
}

N_NIMCALL(void, interactivepasses_578140)(void) {
	Tpass277017 LOC1;
	Tpass277017 LOC2;
	Tpass277017 LOC3;
	initdefines_199254();
	definesymbol_199013(((NimStringDesc*) &TMP5238));
	LOC1.Field0 = verboseopen_558012;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = verboseprocess_558023;
	LOC1.Field3 = NIM_NIL;
	registerpass_277190((&LOC1));
	LOC2.Field0 = myopen_502741;
	LOC2.Field1 = myopencached_502778;
	LOC2.Field2 = myprocess_502917;
	LOC2.Field3 = myclose_502933;
	registerpass_277190((&LOC2));
	LOC3.Field0 = myopen_445295;
	LOC3.Field1 = NIM_NIL;
	LOC3.Field2 = myprocess_445412;
	LOC3.Field3 = myprocess_445412;
	registerpass_277190((&LOC3));
}

N_NIMCALL(void, commandinteractive_578207)(void) {
	gerrormax_191399 = ((NI) IL64(9223372036854775807));
	interactivepasses_578140();
	compilesystemmodule_576910();
	{
		NI32 LOC5;
		Tsym225841* LOC6;
		if (!(((NI) 0) < (commandargs_167258 ? commandargs_167258->Sup.len : 0))) goto LA3;
		LOC5 = 0;
		LOC5 = fileinfoidx_191253(gprojectfull_167236);
		LOC6 = 0;
		LOC6 = compilemodule_576725(LOC5, 0);
	}
	goto LA1;
	LA3: ;
	{
		Tsym225841* m;
		Tllstream213204* LOC8;
		m = makestdinmodule_577018();
		(*m).flags |= ((NU32)1)<<((((NU8) 12))%(sizeof(NU32)*8));
		LOC8 = 0;
		LOC8 = llstreamopenstdin_213293();
		processmodule_277056(m, LOC8, NIM_NIL);
	}
	LA1: ;
}

N_NIMCALL(void, evalnim_578246)(Tnode225809* nodes, Tsym225841* module) {
	TY578241 LOC1;
	LOC1[0].Field0 = verboseopen_558012;
	LOC1[0].Field1 = NIM_NIL;
	LOC1[0].Field2 = verboseprocess_558023;
	LOC1[0].Field3 = NIM_NIL;
	LOC1[1].Field0 = myopen_502741;
	LOC1[1].Field1 = myopencached_502778;
	LOC1[1].Field2 = myprocess_502917;
	LOC1[1].Field3 = myclose_502933;
	LOC1[2].Field0 = myopen_445295;
	LOC1[2].Field1 = NIM_NIL;
	LOC1[2].Field2 = myprocess_445412;
	LOC1[2].Field3 = myprocess_445412;
	carrypasses_277231(nodes, module, LOC1, 3);
}

N_NIMCALL(void, commandeval_578256)(NimStringDesc* exp) {
	NimStringDesc* echoexp;
	NimStringDesc* LOC5;
	Tnode225809* LOC6;
	Tsym225841* LOC7;
	{
		if (!(systemmodule_274019 == NIM_NIL)) goto LA3;
		interactivepasses_578140();
		compilesystemmodule_576910();
	}
	LA3: ;
	LOC5 = 0;
	LOC5 = rawNewString(exp->Sup.len + 21);
appendString(LOC5, ((NimStringDesc*) &TMP5240));
appendString(LOC5, exp);
appendString(LOC5, ((NimStringDesc*) &TMP5241));
	echoexp = LOC5;
	LOC6 = 0;
	LOC6 = parsestring_245506(echoexp, ((NimStringDesc*) &TMP4617), ((NI) 0), TMP5242);
	LOC7 = 0;
	LOC7 = makestdinmodule_577018();
	evalnim_578246(LOC6, LOC7);
}

N_NIMCALL(void, resetmemory_578338)(void) {
	resetcompilationlists_204143();
	resetcaches_507448();
	resetallmodules_576391();
	resetropecache_176111();
	resetsystypes_274268();
	if (gowners_280290) nimGCunrefNoCycle(gowners_280290);
	gowners_280290 = (Tsymseq225811*) newSeqRC1((&NTI225811), 0);
	{
		NI i_578423;
		NI res_578605;
		i_578423 = 0;
		res_578605 = ((NI) 0);
		{
			while (1) {
				if (!(res_578605 <= ((NI) 8191))) goto LA3;
				i_578423 = ((NI) (res_578605));
				asgnRefNoCycle((void**) (&buckets_198039[(i_578423)- 0]), NIM_NIL);
				res_578605 += ((NI) 1);
			} LA3: ;
		}
	}
	asgnRefNoCycle((void**) (&idanon_198495), NIM_NIL);
}

N_NIMCALL(void, commandsuggest_578325)(void) {
	{
		NI32 gdirtybufferidx;
		Tsym225841* LOC5;
		if (!isserving_167147) goto LA3;
		commandcompiletoc_578071();
		gdirtybufferidx = gtrackpos_191901.fileindex;
		LOC5 = 0;
		LOC5 = compilemodule_576725(gdirtybufferidx, 512);
		resetmodule_576319(gdirtybufferidx);
	}
	goto LA1;
	LA3: ;
	{
		gerrormax_191399 = ((NI) IL64(9223372036854775807));
		semanticpasses_578033();
		rodpass_578007();
		compileproject_576994(((NI32) -1));
	}
	LA1: ;
}

N_NIMCALL(void, maincommand_578628)(void) {
	NimStringDesc* LOC5;
	clearpasses_277182();
	glastcmdtime_167145 = ntepochTime();
	appendstr_140268((&searchpaths_167136), libpath_167233);
	{
		if (!!(((gprojectfull_167236 ? gprojectfull_167236->Sup.len : 0) == ((NI) 0)))) goto LA3;
		prependstr_140419((&searchpaths_167136), gprojectpath_167235);
	}
	LA3: ;
	setid_224440(((NI) 100));
	LOC5 = 0;
	LOC5 = nsuNormalize(command_167240);
	switch (hashString(LOC5) & 31) {
	case 0: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3716))) goto LA7;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3718))) goto LA8;
break;
	case 1: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3727))) goto LA16;
break;
	case 2: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3729))) goto LA18;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3738))) goto LA27;
break;
	case 4: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3731))) goto LA20;
break;
	case 9: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3719))) goto LA9;
break;
	case 10: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3712))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3730))) goto LA19;
break;
	case 12: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3714))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3739))) goto LA27;
break;
	case 13: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3722))) goto LA11;
break;
	case 14: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3736))) goto LA25;
break;
	case 16: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3734))) goto LA23;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3737))) goto LA26;
break;
	case 18: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3713))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3721))) goto LA10;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3735))) goto LA24;
break;
	case 19: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3725))) goto LA14;
break;
	case 20: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3726))) goto LA15;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3733))) goto LA22;
break;
	case 25: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3711))) goto LA6;
break;
	case 26: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3732))) goto LA21;
break;
	case 27: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3715))) goto LA7;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3720))) goto LA10;
break;
	case 29: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3728))) goto LA17;
break;
	case 31: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3717))) goto LA8;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3723))) goto LA12;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3724))) goto LA13;
break;
	}
	goto LA28;
	LA6: ;
	{
		gcmd_167134 = ((NU8) 1);
		commandcompiletoc_578071();
	}
	goto LA29;
	LA7: ;
	{
		gcmd_167134 = ((NU8) 2);
		definesymbol_199013(((NimStringDesc*) &TMP3715));
		commandcompiletoc_578071();
	}
	goto LA29;
	LA8: ;
	{
		gcmd_167134 = ((NU8) 3);
		definesymbol_199013(((NimStringDesc*) &TMP3717));
		commandcompiletoc_578071();
	}
	goto LA29;
	LA9: ;
	{
		gcmd_167134 = ((NU8) 19);
		rawmessage_194636(((NU16) 185), command_167240);
	}
	goto LA29;
	LA10: ;
	{
		gcmd_167134 = ((NU8) 4);
		commandcompiletojs_578132();
	}
	goto LA29;
	LA11: ;
	{
		wantmainmodule_576931();
		gcmd_167134 = ((NU8) 8);
		loadconfigs_221609(((NimStringDesc*) &TMP5012));
		commanddoc_387360();
	}
	goto LA29;
	LA12: ;
	{
		gcmd_167134 = ((NU8) 8);
		loadconfigs_221609(((NimStringDesc*) &TMP5012));
		definesymbol_199013(((NimStringDesc*) &TMP5143));
		commanddoc2_578060();
	}
	goto LA29;
	LA13: ;
	{
		gcmd_167134 = ((NU8) 16);
		loadconfigs_221609(((NimStringDesc*) &TMP5012));
		commandrst2html_387400();
	}
	goto LA29;
	LA14: ;
	{
		gcmd_167134 = ((NU8) 17);
		loadconfigs_221609(((NimStringDesc*) &TMP5149));
		commandrst2tex_387408();
	}
	goto LA29;
	LA15: ;
	{
		wantmainmodule_576931();
		gcmd_167134 = ((NU8) 8);
		loadconfigs_221609(((NimStringDesc*) &TMP5012));
		wantmainmodule_576931();
		definesymbol_199013(((NimStringDesc*) &TMP5143));
		commandjson_387416();
	}
	goto LA29;
	LA16: ;
	{
		gcmd_167134 = ((NU8) 8);
		loadconfigs_221609(((NimStringDesc*) &TMP5012));
		commandbuildindex_387452();
	}
	goto LA29;
	LA17: ;
	{
		gcmd_167134 = ((NU8) 9);
		commandgendepend_578041();
	}
	goto LA29;
	LA18: ;
	{
		gcmd_167134 = ((NU8) 10);
		{
			NimStringDesc* LOC45;
			Jsonnodeobj325754* definedsymbols;
			Jsonnodeobj325754* libpaths;
			Jsonnodeobj325754* dumpdata;
			TY579027 LOC66;
			NimStringDesc* LOC67;
			LOC45 = 0;
			LOC45 = getconfigvar_167335(((NimStringDesc*) &TMP5222));
			if (!eqStrings(LOC45, ((NimStringDesc*) &TMP5223))) goto LA46;
			wantmainmodule_576931();
			definedsymbols = newjarray_325956();
			{
				NimStringDesc* s_579002;
				s_579002 = 0;
				{
					NimStringDesc* key_579406;
					NimStringDesc* val_579408;
					key_579406 = 0;
					val_579408 = 0;
					{
						NI h_579410;
						NI HEX3Atmp_579412;
						NI res_579414;
						h_579410 = 0;
						HEX3Atmp_579412 = 0;
						HEX3Atmp_579412 = ((*gsymbols_199004).data ? ((*gsymbols_199004).data->Sup.len-1) : -1);
						res_579414 = ((NI) 0);
						{
							while (1) {
								if (!(res_579414 <= HEX3Atmp_579412)) goto LA52;
								h_579410 = res_579414;
								{
									if (!!((*gsymbols_199004).data->data[h_579410].Field0 == 0)) goto LA55;
									key_579406 = (*gsymbols_199004).data->data[h_579410].Field0;
									val_579408 = (*gsymbols_199004).data->data[h_579410].Field1;
									{
										Jsonnodeobj325754* LOC61;
										if (!!(eqStrings(val_579408, ((NimStringDesc*) &TMP5224)))) goto LA59;
										s_579002 = key_579406;
										LOC61 = 0;
										LOC61 = HEX25_326205(s_579002);
										(*definedsymbols).kindU.S7.elems = (TY325774*) incrSeqV2(&((*definedsymbols).kindU.S7.elems)->Sup, sizeof(Jsonnodeobj325754*));
										asgnRefNoCycle((void**) (&(*definedsymbols).kindU.S7.elems->data[(*definedsymbols).kindU.S7.elems->Sup.len]), LOC61);
										++(*definedsymbols).kindU.S7.elems->Sup.len;
									}
									LA59: ;
								}
								LA55: ;
								res_579414 += ((NI) 1);
							} LA52: ;
						}
					}
				}
			}
			libpaths = newjarray_325956();
			{
				NimStringDesc* dir_579015;
				Tstrentry140024* it_579420;
				dir_579015 = 0;
				it_579420 = ((Tstrentry140024*) (searchpaths_167136.head));
				{
					while (1) {
						Jsonnodeobj325754* LOC65;
						if (!!((it_579420 == NIM_NIL))) goto LA64;
						dir_579015 = (*it_579420).data;
						LOC65 = 0;
						LOC65 = HEX25_326205(dir_579015);
						(*libpaths).kindU.S7.elems = (TY325774*) incrSeqV2(&((*libpaths).kindU.S7.elems)->Sup, sizeof(Jsonnodeobj325754*));
						asgnRefNoCycle((void**) (&(*libpaths).kindU.S7.elems->data[(*libpaths).kindU.S7.elems->Sup.len]), LOC65);
						++(*libpaths).kindU.S7.elems->Sup.len;
						it_579420 = ((Tstrentry140024*) ((*it_579420).Sup.next));
					} LA64: ;
				}
			}
			memset((void*)LOC66, 0, sizeof(LOC66));
			LOC66[0].Field0 = copyString(((NimStringDesc*) &TMP5225));
			LOC66[0].Field1 = HEX25_326205(((NimStringDesc*) &TMP5226));
			LOC66[1].Field0 = copyString(((NimStringDesc*) &TMP5227));
			LOC66[1].Field1 = HEX25_326205(gprojectfull_167236);
			LOC66[2].Field0 = copyString(((NimStringDesc*) &TMP5228));
			LOC66[2].Field1 = definedsymbols;
			LOC66[3].Field0 = copyString(((NimStringDesc*) &TMP5229));
			LOC66[3].Field1 = libpaths;
			dumpdata = HEX25_326281(LOC66, 4);
			LOC67 = 0;
			LOC67 = HEX24_330129(dumpdata);
			msgwriteln_191915(LOC67, 3);
		}
		goto LA43;
		LA46: ;
		{
			msgwriteln_191915(((NimStringDesc*) &TMP5232), 3);
			{
				NimStringDesc* s_579044;
				s_579044 = 0;
				{
					NimStringDesc* key_579426;
					NimStringDesc* val_579428;
					key_579426 = 0;
					val_579428 = 0;
					{
						NI h_579430;
						NI HEX3Atmp_579432;
						NI res_579434;
						h_579430 = 0;
						HEX3Atmp_579432 = 0;
						HEX3Atmp_579432 = ((*gsymbols_199004).data ? ((*gsymbols_199004).data->Sup.len-1) : -1);
						res_579434 = ((NI) 0);
						{
							while (1) {
								if (!(res_579434 <= HEX3Atmp_579432)) goto LA73;
								h_579430 = res_579434;
								{
									if (!!((*gsymbols_199004).data->data[h_579430].Field0 == 0)) goto LA76;
									key_579426 = (*gsymbols_199004).data->data[h_579430].Field0;
									val_579428 = (*gsymbols_199004).data->data[h_579430].Field1;
									{
										if (!!(eqStrings(val_579428, ((NimStringDesc*) &TMP5224)))) goto LA80;
										s_579044 = key_579426;
										msgwriteln_191915(s_579044, 3);
									}
									LA80: ;
								}
								LA76: ;
								res_579434 += ((NI) 1);
							} LA73: ;
						}
					}
				}
			}
			msgwriteln_191915(((NimStringDesc*) &TMP5233), 3);
			{
				NimStringDesc* it_579047;
				Tstrentry140024* it_579440;
				it_579047 = 0;
				it_579440 = ((Tstrentry140024*) (searchpaths_167136.head));
				{
					while (1) {
						if (!!((it_579440 == NIM_NIL))) goto LA84;
						it_579047 = (*it_579440).data;
						msgwriteln_191915(it_579047, 0);
						it_579440 = ((Tstrentry140024*) ((*it_579440).Sup.next));
					} LA84: ;
				}
			}
		}
		LA43: ;
	}
	goto LA29;
	LA19: ;
	{
		gcmd_167134 = ((NU8) 11);
		commandcheck_578049();
	}
	goto LA29;
	LA20: ;
	{
		Tnode225809* LOC87;
		gcmd_167134 = ((NU8) 12);
		wantmainmodule_576931();
		LOC87 = 0;
		LOC87 = parsefile_253041(gprojectmainidx_167238);
	}
	goto LA29;
	LA21: ;
	{
		gcmd_167134 = ((NU8) 13);
		wantmainmodule_576931();
		commandscan_578278();
		msgwriteln_191915(((NimStringDesc*) &TMP5237), 0);
	}
	goto LA29;
	LA22: ;
	{
		gcmd_167134 = ((NU8) 18);
		commandinteractive_578207();
	}
	goto LA29;
	LA23: ;
	{
		NimStringDesc* LOC91;
		LOC91 = 0;
		LOC91 = maincommandarg_167308();
		commandeval_578256(LOC91);
	}
	goto LA29;
	LA24: ;
	{
		resetmemory_578338();
	}
	goto LA29;
	LA25: ;
	{
		gcmd_167134 = ((NU8) 14);
		{
			if (!!(((gevalexpr_167144) && (gevalexpr_167144)->Sup.len == 0))) goto LA96;
			commandeval_578256(gevalexpr_167144);
		}
		goto LA94;
		LA96: ;
		{
			commandsuggest_578325();
		}
		LA94: ;
	}
	goto LA29;
	LA26: ;
	{
		isserving_167147 = NIM_TRUE;
		gglobaloptions_167132 |= ((NU32)1)<<((((NU8) 15))%(sizeof(NU32)*8));
		gerrormax_191399 = ((NI) IL64(9223372036854775807));
		serve_575254(maincommand_578628);
	}
	goto LA29;
	LA27: ;
	{
		gcmd_167134 = ((NU8) 10);
	}
	goto LA29;
	LA28: ;
	{
		rawmessage_194636(((NU16) 185), command_167240);
	}
	LA29: ;
	{
		NIM_BOOL LOC104;
		TY194829 LOC108;
		NF LOC109;
		NI LOC110;
		LOC104 = 0;
		LOC104 = (gerrorcounter_191396 == ((NI) 0));
		if (!(LOC104)) goto LA105;
		LOC104 = !(((525376 &(1<<((gcmd_167134)&31)))!=0));
		LA105: ;
		if (!LOC104) goto LA106;
		memset((void*)LOC108, 0, sizeof(LOC108));
		LOC108[0] = nimIntToStr(glinescompiled_216213);
		LOC109 = 0;
		LOC109 = ntepochTime();
		LOC108[1] = nsuformatFloat(((NF)(LOC109) - (NF)(glastcmdtime_167145)), ((NU8) 1), ((NI) 3), 46);
		LOC110 = 0;
		LOC110 = gettotalmem_9095();
		LOC108[2] = formatsize_105405(((NI64) (LOC110)), 46);
		{
			NIM_BOOL LOC113;
			LOC113 = 0;
			LOC113 = isdefined_199031(((NimStringDesc*) &TMP5279));
			if (!LOC113) goto LA114;
			LOC108[3] = copyString(((NimStringDesc*) &TMP5280));
		}
		goto LA111;
		LA114: ;
		{
			LOC108[3] = copyString(((NimStringDesc*) &TMP5281));
		}
		LA111: ;
		rawmessage_193675(((NU16) 269), LOC108, 4);
	}
	LA106: ;
	resetattributes_194648();
}
NIM_EXTERNC N_NOINLINE(void, compiler_mainInit000)(void) {
}

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

