/* 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 Tlinkedlist139028 Tlinkedlist139028;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tlistentry139022 Tlistentry139022;
typedef struct Tpass275017 Tpass275017;
typedef struct Tpasscontext275005 Tpasscontext275005;
typedef struct Tsym223841 Tsym223841;
typedef struct Trodreader266030 Trodreader266030;
typedef struct Tnode223809 Tnode223809;
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 TY574054 TY574054;
typedef struct Tmoduleinmemory574017 Tmoduleinmemory574017;
typedef struct TY223932 TY223932;
typedef struct Jsonnodeobj323754 Jsonnodeobj323754;
typedef struct Stringtableobj144212 Stringtableobj144212;
typedef struct TNimObject TNimObject;
typedef struct TNimNode TNimNode;
typedef struct Keyvaluepairseq144210 Keyvaluepairseq144210;
typedef struct Keyvaluepair144208 Keyvaluepair144208;
typedef struct TY323769 TY323769;
typedef struct TY323774 TY323774;
typedef struct Tstrentry139024 Tstrentry139024;
typedef struct TY324284 TY324284;
typedef struct Tllstream211204 Tllstream211204;
typedef struct Tlexer214185 Tlexer214185;
typedef struct Tbaselexer212024 Tbaselexer212024;
typedef struct Tlineinfo188352 Tlineinfo188352;
typedef struct Ttoken214181 Ttoken214181;
typedef struct Tident196021 Tident196021;
typedef struct TY129408 TY129408;
typedef struct Tidobj196015 Tidobj196015;
typedef struct Ttypeseq223843 Ttypeseq223843;
typedef struct Tscope223835 Tscope223835;
typedef struct TY223944 TY223944;
typedef struct Tstrtable223813 Tstrtable223813;
typedef struct Tsymseq223811 Tsymseq223811;
typedef struct Ttype223847 Ttype223847;
typedef struct Tloc223823 Tloc223823;
typedef struct Ropeobj174009 Ropeobj174009;
typedef struct Tlib223827 Tlib223827;
typedef struct Tindex266028 Tindex266028;
typedef struct Tiitable231274 Tiitable231274;
typedef struct Tiipairseq231272 Tiipairseq231272;
typedef struct Table266063 Table266063;
typedef struct Keyvaluepairseq266066 Keyvaluepairseq266066;
typedef struct Memfile264208 Memfile264208;
typedef struct Tnodeseq223803 Tnodeseq223803;
typedef struct Basechunk30841 Basechunk30841;
typedef struct Freecell30833 Freecell30833;
typedef struct Tinstantiation223831 Tinstantiation223831;
typedef struct Tiipair231270 Tiipair231270;
typedef struct Keyvaluepair266069 Keyvaluepair266069;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tlinkedlist139028  {
Tlistentry139022* head;
Tlistentry139022* tail;
NI counter;
};
typedef N_NIMCALL_PTR(Tpasscontext275005*, Tpassopen275009) (Tsym223841* module);
typedef N_NIMCALL_PTR(Tpasscontext275005*, Tpassopencached275011) (Tsym223841* module, Trodreader266030* rd);
typedef N_NIMCALL_PTR(Tnode223809*, Tpassprocess275015) (Tpasscontext275005* p, Tnode223809* toplevelstmt);
typedef N_NIMCALL_PTR(Tnode223809*, Tpassclose275013) (Tpasscontext275005* p, Tnode223809* n);
struct Tpass275017 {
Tpassopen275009 Field0;
Tpassopencached275011 Field1;
Tpassprocess275015 Field2;
Tpassclose275013 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 Sha1digest199009[20];
struct  Tmoduleinmemory574017  {
NF compiledat;
Sha1digest199009 hash;
TY223932* 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  Stringtableobj144212  {
  TNimObject Sup;
NI counter;
Keyvaluepairseq144210* data;
NU8 mode;
};
struct Keyvaluepair144208 {
NimStringDesc* Field0;
NimStringDesc* Field1;
};
struct  Jsonnodeobj323754  {
NU8 kind;
union{
struct {NimStringDesc* str;
} S1;
struct {NI64 num;
} S2;
struct {NF fnum;
} S3;
struct {NIM_BOOL bval;
} S4;
struct {TY323769* fields;
} S6;
struct {TY323774* elems;
} S7;
} kindU;
};
struct  Tlistentry139022  {
  TNimObject Sup;
Tlistentry139022* prev;
Tlistentry139022* next;
};
struct  Tstrentry139024  {
  Tlistentry139022 Sup;
NimStringDesc* data;
};
struct TY324284 {
NimStringDesc* Field0;
Jsonnodeobj323754* Field1;
};
typedef TY324284 TY577027[4];
struct  Tbaselexer212024  {
  TNimObject Sup;
NI bufpos;
NCSTRING buf;
NI buflen;
Tllstream211204* stream;
NI linenumber;
NI sentinel;
NI linestart;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (Tlineinfo188352 info, NU16 msg, NimStringDesc* arg, void* ClEnv);
void* ClEnv;
} Terrorhandler214183;
struct  Tlexer214185  {
  Tbaselexer212024 Sup;
NI32 fileidx;
NI indentahead;
NI currlineindent;
NIM_BOOL strongspaces;
Terrorhandler214183 errorhandler;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Ttoken214181  {
NU8 toktype;
NI indent;
Tident196021* ident;
NI64 inumber;
NF fnumber;
NU8 base;
NI8 strongspacea;
NI8 strongspaceb;
NimStringDesc* literal;
NI line;
NI col;
};
struct  Tidobj196015  {
  TNimObject Sup;
NI id;
};
struct  Tstrtable223813  {
NI counter;
Tsymseq223811* data;
};
struct  Tlineinfo188352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tloc223823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype223847* t;
Ropeobj174009* r;
Ropeobj174009* heaproot;
};
struct  Tsym223841  {
  Tidobj196015 Sup;
NU8 kind;
union{
struct {Ttypeseq223843* typeinstcache;
Tscope223835* typscope;
} S1;
struct {TY223944* procinstcache;
Tsym223841* gcunsafetyreason;
} S2;
struct {TY223944* usedgenerics;
Tstrtable223813 tab;
} S3;
struct {Tsym223841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype223847* typ;
Tident196021* name;
Tlineinfo188352 info;
Tsym223841* owner;
NU32 flags;
Tnode223809* ast;
NU32 options;
NI position;
NI offset;
Tloc223823 loc;
Tlib223827* annex;
Tnode223809* constraint;
};
typedef Tpass275017 TY576241[3];
typedef Tident196021* TY196038[8192];
typedef N_NIMCALL_PTR(void, TY573256) (void);
typedef NimStringDesc* TY192829[4];
struct  Tpasscontext275005  {
  TNimObject Sup;
NIM_BOOL fromcache;
};
struct  Tiitable231274  {
NI counter;
Tiipairseq231272* data;
};
struct  Tindex266028  {
NI lastidxkey;
NI lastidxval;
Tiitable231274 tab;
NimStringDesc* r;
NI offset;
};
struct  Table266063  {
Keyvaluepairseq266066* data;
NI counter;
};
struct  Memfile264208  {
void* mem;
NI size;
int handle;
};
struct  Trodreader266030  {
  TNimObject Sup;
NI pos;
NCSTRING s;
NU32 options;
NU8 reason;
TY223932* moddeps;
TY223932* files;
NI dataidx;
NI convertersidx;
NI initidx;
NI interfidx;
NI compilerprocsidx;
NI methodsidx;
NimStringDesc* filename;
Tindex266028 index;
Tindex266028 imports;
NI readerindex;
NI line;
NI moduleid;
Table266063 syms;
Memfile264208 memfile;
Tsymseq223811* methods;
NimStringDesc* origfile;
NIM_BOOL inviewmode;
};
struct  Tnode223809  {
Ttype223847* typ;
Tlineinfo188352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym223841* sym;
} S4;
struct {Tident196021* ident;
} S5;
struct {Tnodeseq223803* 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  Tllstream211204  {
  TNimObject Sup;
NU8 kind;
FILE* f;
NimStringDesc* s;
NI rd;
NI wr;
NI lineoffset;
};
struct  Tident196021  {
  Tidobj196015 Sup;
NimStringDesc* s;
Tident196021* next;
NI h;
};
struct  Tscope223835  {
NI depthlevel;
Tstrtable223813 symbols;
Tnodeseq223803* usingsyms;
Tscope223835* parent;
};
struct  Ttype223847  {
  Tidobj196015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq223843* sons;
Tnode223809* n;
Tsym223841* owner;
Tsym223841* sym;
Tsym223841* destructor;
Tsym223841* deepcopy;
Tsym223841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc223823 loc;
};
struct  Ropeobj174009  {
  TNimObject Sup;
Ropeobj174009* left;
Ropeobj174009* right;
NI length;
NimStringDesc* data;
};
struct  Tlib223827  {
  Tlistentry139022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj174009* name;
Tnode223809* path;
};
struct  Tiipair231270  {
NI key;
NI val;
};
struct Keyvaluepair266069 {
NI Field0;
NI Field1;
Tsym223841* Field2;
};
struct  Freecell30833  {
Freecell30833* next;
NI zerofield;
};
struct  Tinstantiation223831  {
Tsym223841* sym;
Ttypeseq223843* concretetypes;
TY223932* usedby;
NI compilesid;
};
struct TY574054 {
  TGenericSeq Sup;
  Tmoduleinmemory574017 data[SEQ_DECL_SIZE];
};
struct TY323774 {
  TGenericSeq Sup;
  Jsonnodeobj323754* data[SEQ_DECL_SIZE];
};
struct TY129408 {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct Tsymseq223811 {
  TGenericSeq Sup;
  Tsym223841* data[SEQ_DECL_SIZE];
};
struct TY223932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq144210 {
  TGenericSeq Sup;
  Keyvaluepair144208 data[SEQ_DECL_SIZE];
};
struct TY323769 {
  TGenericSeq Sup;
  TY324284 data[SEQ_DECL_SIZE];
};
struct Ttypeseq223843 {
  TGenericSeq Sup;
  Ttype223847* data[SEQ_DECL_SIZE];
};
struct TY223944 {
  TGenericSeq Sup;
  Tinstantiation223831* data[SEQ_DECL_SIZE];
};
struct Tiipairseq231272 {
  TGenericSeq Sup;
  Tiipair231270 data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq266066 {
  TGenericSeq Sup;
  Keyvaluepair266069 data[SEQ_DECL_SIZE];
};
struct Tnodeseq223803 {
  TGenericSeq Sup;
  Tnode223809* data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, clearpasses_275182)(void);
N_NIMCALL(NF, ntepochTime)(void);
N_NIMCALL(void, appendstr_139268)(Tlinkedlist139028* list, NimStringDesc* data);
N_NIMCALL(void, prependstr_139419)(Tlinkedlist139028* list, NimStringDesc* data);
static N_INLINE(void, setid_222440)(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_576071)(void);
N_NIMCALL(void, initvars_202076)(void);
N_NIMCALL(void, semanticpasses_576033)(void);
N_NIMCALL(void, registerpass_275190)(Tpass275017* p);
N_NIMCALL(Tpasscontext275005*, verboseopen_556012)(Tsym223841* s);
N_NIMCALL(Tnode223809*, verboseprocess_556023)(Tpasscontext275005* context, Tnode223809* n);
N_NIMCALL(Tpasscontext275005*, myopen_500741)(Tsym223841* module);
N_NIMCALL(Tpasscontext275005*, myopencached_500778)(Tsym223841* module, Trodreader266030* rd);
N_NIMCALL(Tnode223809*, myprocess_500917)(Tpasscontext275005* context, Tnode223809* n);
N_NIMCALL(Tnode223809*, myclose_500933)(Tpasscontext275005* context, Tnode223809* n);
N_NIMCALL(Tpasscontext275005*, myopen_543769)(Tsym223841* module);
N_NIMCALL(Tpasscontext275005*, myopencached_543921)(Tsym223841* module, Trodreader266030* rd);
N_NIMCALL(Tnode223809*, myprocess_544008)(Tpasscontext275005* b, Tnode223809* n);
N_NIMCALL(Tnode223809*, myclose_544442)(Tpasscontext275005* b, Tnode223809* n);
N_NIMCALL(void, rodpass_576007)(void);
N_NIMCALL(Tpasscontext275005*, myopen_289250)(Tsym223841* module);
N_NIMCALL(Tnode223809*, process_288968)(Tpasscontext275005* c, Tnode223809* n);
N_NIMCALL(Tnode223809*, myclose_289265)(Tpasscontext275005* c, Tnode223809* n);
N_NIMCALL(void, compileproject_574994)(NI32 projectfileidx);
N_NIMCALL(void, cgenwritemodules_544520)(void);
N_NIMCALL(void, callccompiler_202808)(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_543651)(void);
N_NIMCALL(void, resetcompilationlists_202143)(void);
N_NIMCALL(void, resetcaches_505448)(void);
N_NIMCALL(void, Gcfullcollect_11205)(void);
N_NIMCALL(void, definesymbol_197013)(NimStringDesc* symbol);
N_NIMCALL(void, rawmessage_192636)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, commandcompiletojs_576132)(void);
N_NIMCALL(void, settarget_172662)(NU8 o, NU8 c);
N_NIMCALL(Tpasscontext275005*, myopen_555213)(Tsym223841* s);
N_NIMCALL(Tpasscontext275005*, myopencached_555202)(Tsym223841* s, Trodreader266030* rd);
N_NIMCALL(Tnode223809*, myprocess_555068)(Tpasscontext275005* b, Tnode223809* n);
N_NIMCALL(Tnode223809*, myclose_555174)(Tpasscontext275005* b, Tnode223809* n);
N_NIMCALL(void, wantmainmodule_574931)(void);
N_NIMCALL(void, loadconfigs_219609)(NimStringDesc* cfg);
N_NIMCALL(void, commanddoc_385360)(void);
N_NIMCALL(void, commanddoc2_576060)(void);
N_NIMCALL(Tpasscontext275005*, myopen_558068)(Tsym223841* module);
N_NIMCALL(Tnode223809*, processnode_558056)(Tpasscontext275005* c, Tnode223809* n);
N_NIMCALL(Tnode223809*, close_558018)(Tpasscontext275005* p, Tnode223809* n);
N_NIMCALL(void, finishdoc2pass_558106)(NimStringDesc* project);
N_NIMCALL(void, commandrst2html_385400)(void);
N_NIMCALL(void, commandrst2tex_385408)(void);
N_NIMCALL(void, commandjson_385416)(void);
N_NIMCALL(void, commandbuildindex_385452)(void);
N_NIMCALL(void, commandgendepend_576041)(void);
N_NIMCALL(Tpasscontext275005*, myopen_557131)(Tsym223841* module);
N_NIMCALL(Tnode223809*, adddotdependency_557041)(Tpasscontext275005* c, Tnode223809* n);
N_NIMCALL(Tnode223809*, cleanup_556066)(Tpasscontext275005* c, Tnode223809* n);
N_NIMCALL(void, generatedot_557009)(NimStringDesc* project);
N_NIMCALL(void, execexternalprogram_202175)(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_165335)(NimStringDesc* key);
N_NIMCALL(Jsonnodeobj323754*, newjarray_323956)(void);
N_NIMCALL(Jsonnodeobj323754*, HEX25_324205)(NimStringDesc* s);
N_NIMCALL(TGenericSeq*, incrSeqV2)(TGenericSeq* seq, NI elemsize);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(Jsonnodeobj323754*, HEX25_324281)(TY324284* keyvals, NI keyvalsLen0);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(void, msgwriteln_189915)(NimStringDesc* s, NU8 flags);
N_NIMCALL(NimStringDesc*, HEX24_328129)(Jsonnodeobj323754* node);
N_NIMCALL(void, commandcheck_576049)(void);
N_NIMCALL(Tnode223809*, parsefile_251041)(NI32 fileidx);
N_NIMCALL(void, commandscan_576278)(void);
N_NIMCALL(NimStringDesc*, nosaddFileExt)(NimStringDesc* filename, NimStringDesc* ext);
N_NIMCALL(NimStringDesc*, maincommandarg_165308)(void);
N_NIMCALL(Tllstream211204*, llstreamopen_211256)(NimStringDesc* filename, NU8 mode);
N_NIMCALL(void, inittoken_214369)(Ttoken214181* L);
N_NIMCALL(void, openlexer_214410)(Tlexer214185* lex, NimStringDesc* filename, Tllstream211204* inputstream);
N_NIMCALL(void, rawgettok_218048)(Tlexer214185* L, Ttoken214181* tok);
N_NIMCALL(void, printtok_214355)(Ttoken214181* tok);
N_NIMCALL(void, closelexer_214422)(Tlexer214185* lex);
N_NIMCALL(void, commandinteractive_576207)(void);
N_NIMCALL(void, interactivepasses_576140)(void);
N_NIMCALL(void, initdefines_197254)(void);
N_NIMCALL(Tpasscontext275005*, myopen_443295)(Tsym223841* module);
N_NIMCALL(Tnode223809*, myprocess_443412)(Tpasscontext275005* c, Tnode223809* n);
N_NIMCALL(void, compilesystemmodule_574910)(void);
N_NIMCALL(Tsym223841*, compilemodule_574725)(NI32 fileidx, NU32 flags);
N_NIMCALL(NI32, fileinfoidx_189253)(NimStringDesc* filename);
N_NIMCALL(Tsym223841*, makestdinmodule_575018)(void);
N_NIMCALL(void, processmodule_275056)(Tsym223841* module, Tllstream211204* stream, Trodreader266030* rd);
N_NIMCALL(Tllstream211204*, llstreamopenstdin_211293)(void);
N_NIMCALL(void, commandeval_576256)(NimStringDesc* exp);
N_NIMCALL(void, evalnim_576246)(Tnode223809* nodes, Tsym223841* module);
N_NIMCALL(void, carrypasses_275231)(Tnode223809* nodes, Tsym223841* module, Tpass275017* passes, NI passesLen0);
N_NIMCALL(Tnode223809*, parsestring_243506)(NimStringDesc* s, NimStringDesc* filename, NI line, Terrorhandler214183 errorhandler);
N_NIMCALL(void, resetmemory_576338)(void);
N_NIMCALL(void, resetallmodules_574391)(void);
N_NIMCALL(void, resetropecache_174111)(void);
N_NIMCALL(void, resetsystypes_272268)(void);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
N_NIMCALL(void, commandsuggest_576325)(void);
N_NIMCALL(void, resetmodule_574319)(NI32 fileidx);
N_NIMCALL(void, serve_573254)(TY573256 action);
N_NIMCALL(void, maincommand_576628)(void);
N_NIMCALL(void, rawmessage_191675)(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_197031)(NimStringDesc* symbol);
N_NIMCALL(void, resetattributes_192648)(void);
STRING_LITERAL(TMP3709, "c", 1);
STRING_LITERAL(TMP3710, "cc", 2);
STRING_LITERAL(TMP3711, "compile", 7);
STRING_LITERAL(TMP3712, "compiletoc", 10);
STRING_LITERAL(TMP3713, "cpp", 3);
STRING_LITERAL(TMP3714, "compiletocpp", 12);
STRING_LITERAL(TMP3715, "objc", 4);
STRING_LITERAL(TMP3716, "compiletooc", 11);
STRING_LITERAL(TMP3717, "run", 3);
STRING_LITERAL(TMP3718, "js", 2);
STRING_LITERAL(TMP3719, "compiletojs", 11);
STRING_LITERAL(TMP3720, "doc", 3);
STRING_LITERAL(TMP3721, "doc2", 4);
STRING_LITERAL(TMP3722, "rst2html", 8);
STRING_LITERAL(TMP3723, "rst2tex", 7);
STRING_LITERAL(TMP3724, "jsondoc", 7);
STRING_LITERAL(TMP3725, "buildindex", 10);
STRING_LITERAL(TMP3726, "gendepend", 9);
STRING_LITERAL(TMP3727, "dump", 4);
STRING_LITERAL(TMP3728, "check", 5);
STRING_LITERAL(TMP3729, "parse", 5);
STRING_LITERAL(TMP3730, "scan", 4);
STRING_LITERAL(TMP3731, "secret", 6);
STRING_LITERAL(TMP3732, "e", 1);
STRING_LITERAL(TMP3733, "reset", 5);
STRING_LITERAL(TMP3734, "idetools", 8);
STRING_LITERAL(TMP3735, "serve", 5);
STRING_LITERAL(TMP3736, "nop", 3);
STRING_LITERAL(TMP3737, "help", 4);
STRING_LITERAL(TMP4615, "", 0);
STRING_LITERAL(TMP4616, "nimrod", 6);
STRING_LITERAL(TMP4617, "ecmascript", 10);
STRING_LITERAL(TMP5010, "nimdoc.cfg", 10);
STRING_LITERAL(TMP5141, "nimdoc", 6);
STRING_LITERAL(TMP5147, "nimdoc.tex.cfg", 14);
STRING_LITERAL(TMP5217, "dot -Tpng -o", 12);
STRING_LITERAL(TMP5218, "png", 3);
STRING_LITERAL(TMP5219, "dot", 3);
STRING_LITERAL(TMP5220, "dump.format", 11);
STRING_LITERAL(TMP5221, "json", 4);
STRING_LITERAL(TMP5222, "false", 5);
STRING_LITERAL(TMP5223, "version", 7);
STRING_LITERAL(TMP5224, "0.12.0", 6);
STRING_LITERAL(TMP5225, "project_path", 12);
STRING_LITERAL(TMP5226, "defined_symbols", 15);
STRING_LITERAL(TMP5227, "lib_paths", 9);
STRING_LITERAL(TMP5230, "-- list of currently defined symbols --", 39);
STRING_LITERAL(TMP5231, "-- end of list --", 17);
STRING_LITERAL(TMP5232, "nim", 3);
STRING_LITERAL(TMP5235, "Beware: Indentation tokens depend on the parser\'s state!", 56);
STRING_LITERAL(TMP5236, "nimscript", 9);
STRING_LITERAL(TMP5238, "echo \"eval\\t\", repr(", 20);
STRING_LITERAL(TMP5239, ")", 1);
static NIM_CONST Terrorhandler214183 TMP5240 = {NIM_NIL,NIM_NIL};
STRING_LITERAL(TMP5277, "release", 7);
STRING_LITERAL(TMP5278, "Release Build", 13);
STRING_LITERAL(TMP5279, "Debug Build", 11);
extern NF glastcmdtime_165145;
extern Tlinkedlist139028 searchpaths_165136;
extern NimStringDesc* libpath_165233;
extern NimStringDesc* gprojectfull_165236;
extern NimStringDesc* gprojectpath_165235;
extern NI gfrontendid_222012;
extern NimStringDesc* command_165240;
extern NU8 gcmd_165134;
extern NU32 gglobaloptions_165132;
extern NIM_BOOL isserving_165147;
extern NimStringDesc* lastcaascmd_573205;
extern NimStringDesc* curcaascmd_573204;
extern Gcheap51018 gch_51059;
extern TY574054* gmemcachedata_574071;
extern NI gerrormax_189399;
extern NimStringDesc* gprojectname_165234;
extern Stringtableobj144212* gsymbols_197004;
extern NI32 gprojectmainidx_165238;
extern TNimType NTI214185; /* TLexer */
extern TY129408* commandargs_165258;
extern Tsym223841* systemmodule_272019;
extern Tsymseq223811* gowners_278290;
extern TNimType NTI223811; /* TSymSeq */
extern TY196038 buckets_196039;
extern Tident196021* idanon_196495;
extern NimStringDesc* gevalexpr_165144;
extern Tlineinfo188352 gtrackpos_189901;
extern NI gerrorcounter_189396;
extern NI glinescompiled_214213;

static N_INLINE(void, setid_222440)(NI id) {
	gfrontendid_222012 = ((gfrontendid_222012 >= (NI)(id + ((NI) 1))) ? gfrontendid_222012 : (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_576033)(void) {
	Tpass275017 LOC1;
	Tpass275017 LOC2;
	LOC1.Field0 = verboseopen_556012;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = verboseprocess_556023;
	LOC1.Field3 = NIM_NIL;
	registerpass_275190((&LOC1));
	LOC2.Field0 = myopen_500741;
	LOC2.Field1 = myopencached_500778;
	LOC2.Field2 = myprocess_500917;
	LOC2.Field3 = myclose_500933;
	registerpass_275190((&LOC2));
}

N_NIMCALL(void, rodpass_576007)(void) {
	{
		Tpass275017 LOC5;
		if (!((gglobaloptions_165132 &(1<<((((NU8) 14))&31)))!=0)) goto LA3;
		LOC5.Field0 = myopen_289250;
		LOC5.Field1 = NIM_NIL;
		LOC5.Field2 = process_288968;
		LOC5.Field3 = myclose_289265;
		registerpass_275190((&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_576071)(void) {
	Tpass275017 LOC1;
	initvars_202076();
	semanticpasses_576033();
	LOC1.Field0 = myopen_543769;
	LOC1.Field1 = myopencached_543921;
	LOC1.Field2 = myprocess_544008;
	LOC1.Field3 = myclose_544442;
	registerpass_275190((&LOC1));
	rodpass_576007();
	compileproject_574994(((NI32) -1));
	cgenwritemodules_544520();
	{
		NimStringDesc* LOC6;
		if (!!((gcmd_165134 == ((NU8) 19)))) goto LA4;
		LOC6 = 0;
		LOC6 = noschangeFileExt(gprojectfull_165236, ((NimStringDesc*) &TMP4615));
		callccompiler_202808(LOC6);
	}
	LA4: ;
	{
		NimStringDesc* LOC11;
		if (!isserving_165147) goto LA9;
		LOC11 = 0;
		LOC11 = lastcaascmd_573205; lastcaascmd_573205 = copyStringRC1(curcaascmd_573204);
		if (LOC11) nimGCunrefNoCycle(LOC11);
		resetcgenmodules_543651();
		{
			NI i_576108;
			NI HEX3Atmp_576110;
			NI res_576113;
			i_576108 = 0;
			HEX3Atmp_576110 = 0;
			HEX3Atmp_576110 = ((gmemcachedata_574071 ? gmemcachedata_574071->Sup.len : 0) - 1);
			res_576113 = ((NI) 0);
			{
				while (1) {
					if (!(res_576113 <= HEX3Atmp_576110)) goto LA14;
					i_576108 = res_576113;
					gmemcachedata_574071->data[i_576108].hashstatus = ((NU8) 1);
					gmemcachedata_574071->data[i_576108].needsrecompile = ((NU8) 0);
					res_576113 += ((NI) 1);
				} LA14: ;
			}
		}
		resetcompilationlists_202143();
		resetcaches_505448();
		Gcfullcollect_11205();
	}
	LA9: ;
}

N_NIMCALL(void, commandcompiletojs_576132)(void) {
	Tpass275017 LOC1;
	settarget_172662(((NU8) 22), ((NU8) 15));
	definesymbol_197013(((NimStringDesc*) &TMP4616));
	definesymbol_197013(((NimStringDesc*) &TMP4617));
	definesymbol_197013(((NimStringDesc*) &TMP3718));
	semanticpasses_576033();
	LOC1.Field0 = myopen_555213;
	LOC1.Field1 = myopencached_555202;
	LOC1.Field2 = myprocess_555068;
	LOC1.Field3 = myclose_555174;
	registerpass_275190((&LOC1));
	compileproject_574994(((NI32) -1));
}

N_NIMCALL(void, commanddoc2_576060)(void) {
	Tpass275017 LOC1;
	gerrormax_189399 = ((NI) IL64(9223372036854775807));
	semanticpasses_576033();
	LOC1.Field0 = myopen_558068;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = processnode_558056;
	LOC1.Field3 = close_558018;
	registerpass_275190((&LOC1));
	compileproject_574994(((NI32) -1));
	finishdoc2pass_558106(gprojectname_165234);
}

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_576041)(void) {
	Tpass275017 LOC1;
	Tpass275017 LOC2;
	NimStringDesc* LOC3;
	NimStringDesc* LOC4;
	NimStringDesc* LOC5;
	semanticpasses_576033();
	LOC1.Field0 = myopen_557131;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = adddotdependency_557041;
	LOC1.Field3 = NIM_NIL;
	registerpass_275190((&LOC1));
	LOC2.Field0 = NIM_NIL;
	LOC2.Field1 = NIM_NIL;
	LOC2.Field2 = cleanup_556066;
	LOC2.Field3 = cleanup_556066;
	registerpass_275190((&LOC2));
	compileproject_574994(((NI32) -1));
	generatedot_557009(gprojectfull_165236);
	LOC3 = 0;
	LOC4 = 0;
	LOC4 = noschangeFileExt(gprojectfull_165236, ((NimStringDesc*) &TMP5218));
	LOC5 = 0;
	LOC5 = noschangeFileExt(gprojectfull_165236, ((NimStringDesc*) &TMP5219));
	LOC3 = rawNewString(LOC4->Sup.len + LOC5->Sup.len + 13);
appendString(LOC3, ((NimStringDesc*) &TMP5217));
appendString(LOC3, LOC4);
appendChar(LOC3, 32);
appendString(LOC3, LOC5);
	execexternalprogram_202175(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_576049)(void) {
	gerrormax_189399 = ((NI) IL64(9223372036854775807));
	semanticpasses_576033();
	rodpass_576007();
	compileproject_574994(((NI32) -1));
}

N_NIMCALL(void, commandscan_576278)(void) {
	NimStringDesc* f;
	NimStringDesc* LOC1;
	Tllstream211204* stream;
	LOC1 = 0;
	LOC1 = maincommandarg_165308();
	f = nosaddFileExt(LOC1, ((NimStringDesc*) &TMP5232));
	stream = llstreamopen_211256(f, ((NU8) 0));
	{
		Tlexer214185 L;
		Ttoken214181 tok;
		if (!!((stream == NIM_NIL))) goto LA4;
		memset((void*)(&L), 0, sizeof(L));
		L.Sup.Sup.m_type = (&NTI214185);
		memset((void*)(&tok), 0, sizeof(tok));
		inittoken_214369((&tok));
		openlexer_214410((&L), f, stream);
		{
			while (1) {
				rawgettok_218048((&L), (&tok));
				printtok_214355((&tok));
				{
					if (!(tok.toktype == ((NU8) 1))) goto LA10;
					goto LA6;
				}
				LA10: ;
			}
		} LA6: ;
		closelexer_214422((&L));
	}
	goto LA2;
	LA4: ;
	{
		rawmessage_192636(((NU16) 3), f);
	}
	LA2: ;
}

N_NIMCALL(void, interactivepasses_576140)(void) {
	Tpass275017 LOC1;
	Tpass275017 LOC2;
	Tpass275017 LOC3;
	initdefines_197254();
	definesymbol_197013(((NimStringDesc*) &TMP5236));
	LOC1.Field0 = verboseopen_556012;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = verboseprocess_556023;
	LOC1.Field3 = NIM_NIL;
	registerpass_275190((&LOC1));
	LOC2.Field0 = myopen_500741;
	LOC2.Field1 = myopencached_500778;
	LOC2.Field2 = myprocess_500917;
	LOC2.Field3 = myclose_500933;
	registerpass_275190((&LOC2));
	LOC3.Field0 = myopen_443295;
	LOC3.Field1 = NIM_NIL;
	LOC3.Field2 = myprocess_443412;
	LOC3.Field3 = myprocess_443412;
	registerpass_275190((&LOC3));
}

N_NIMCALL(void, commandinteractive_576207)(void) {
	gerrormax_189399 = ((NI) IL64(9223372036854775807));
	interactivepasses_576140();
	compilesystemmodule_574910();
	{
		NI32 LOC5;
		Tsym223841* LOC6;
		if (!(((NI) 0) < (commandargs_165258 ? commandargs_165258->Sup.len : 0))) goto LA3;
		LOC5 = 0;
		LOC5 = fileinfoidx_189253(gprojectfull_165236);
		LOC6 = 0;
		LOC6 = compilemodule_574725(LOC5, 0);
	}
	goto LA1;
	LA3: ;
	{
		Tsym223841* m;
		Tllstream211204* LOC8;
		m = makestdinmodule_575018();
		(*m).flags |= ((NU32)1)<<((((NU8) 12))%(sizeof(NU32)*8));
		LOC8 = 0;
		LOC8 = llstreamopenstdin_211293();
		processmodule_275056(m, LOC8, NIM_NIL);
	}
	LA1: ;
}

N_NIMCALL(void, evalnim_576246)(Tnode223809* nodes, Tsym223841* module) {
	TY576241 LOC1;
	LOC1[0].Field0 = verboseopen_556012;
	LOC1[0].Field1 = NIM_NIL;
	LOC1[0].Field2 = verboseprocess_556023;
	LOC1[0].Field3 = NIM_NIL;
	LOC1[1].Field0 = myopen_500741;
	LOC1[1].Field1 = myopencached_500778;
	LOC1[1].Field2 = myprocess_500917;
	LOC1[1].Field3 = myclose_500933;
	LOC1[2].Field0 = myopen_443295;
	LOC1[2].Field1 = NIM_NIL;
	LOC1[2].Field2 = myprocess_443412;
	LOC1[2].Field3 = myprocess_443412;
	carrypasses_275231(nodes, module, LOC1, 3);
}

N_NIMCALL(void, commandeval_576256)(NimStringDesc* exp) {
	NimStringDesc* echoexp;
	NimStringDesc* LOC5;
	Tnode223809* LOC6;
	Tsym223841* LOC7;
	{
		if (!(systemmodule_272019 == NIM_NIL)) goto LA3;
		interactivepasses_576140();
		compilesystemmodule_574910();
	}
	LA3: ;
	LOC5 = 0;
	LOC5 = rawNewString(exp->Sup.len + 21);
appendString(LOC5, ((NimStringDesc*) &TMP5238));
appendString(LOC5, exp);
appendString(LOC5, ((NimStringDesc*) &TMP5239));
	echoexp = LOC5;
	LOC6 = 0;
	LOC6 = parsestring_243506(echoexp, ((NimStringDesc*) &TMP4615), ((NI) 0), TMP5240);
	LOC7 = 0;
	LOC7 = makestdinmodule_575018();
	evalnim_576246(LOC6, LOC7);
}

N_NIMCALL(void, resetmemory_576338)(void) {
	resetcompilationlists_202143();
	resetcaches_505448();
	resetallmodules_574391();
	resetropecache_174111();
	resetsystypes_272268();
	if (gowners_278290) nimGCunrefNoCycle(gowners_278290);
	gowners_278290 = (Tsymseq223811*) newSeqRC1((&NTI223811), 0);
	{
		NI i_576423;
		NI res_576605;
		i_576423 = 0;
		res_576605 = ((NI) 0);
		{
			while (1) {
				if (!(res_576605 <= ((NI) 8191))) goto LA3;
				i_576423 = ((NI) (res_576605));
				asgnRefNoCycle((void**) (&buckets_196039[(i_576423)- 0]), NIM_NIL);
				res_576605 += ((NI) 1);
			} LA3: ;
		}
	}
	asgnRefNoCycle((void**) (&idanon_196495), NIM_NIL);
}

N_NIMCALL(void, commandsuggest_576325)(void) {
	{
		NI32 gdirtybufferidx;
		Tsym223841* LOC5;
		if (!isserving_165147) goto LA3;
		commandcompiletoc_576071();
		gdirtybufferidx = gtrackpos_189901.fileindex;
		LOC5 = 0;
		LOC5 = compilemodule_574725(gdirtybufferidx, 512);
		resetmodule_574319(gdirtybufferidx);
	}
	goto LA1;
	LA3: ;
	{
		gerrormax_189399 = ((NI) IL64(9223372036854775807));
		semanticpasses_576033();
		rodpass_576007();
		compileproject_574994(((NI32) -1));
	}
	LA1: ;
}

N_NIMCALL(void, maincommand_576628)(void) {
	NimStringDesc* LOC5;
	clearpasses_275182();
	glastcmdtime_165145 = ntepochTime();
	appendstr_139268((&searchpaths_165136), libpath_165233);
	{
		if (!!(((gprojectfull_165236 ? gprojectfull_165236->Sup.len : 0) == ((NI) 0)))) goto LA3;
		prependstr_139419((&searchpaths_165136), gprojectpath_165235);
	}
	LA3: ;
	setid_222440(((NI) 100));
	LOC5 = 0;
	LOC5 = nsuNormalize(command_165240);
	switch (hashString(LOC5) & 31) {
	case 0: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3714))) goto LA7;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3716))) goto LA8;
break;
	case 1: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3725))) goto LA16;
break;
	case 2: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3727))) goto LA18;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3736))) goto LA27;
break;
	case 4: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3729))) goto LA20;
break;
	case 9: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3717))) goto LA9;
break;
	case 10: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3710))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3728))) goto LA19;
break;
	case 12: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3712))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3737))) goto LA27;
break;
	case 13: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3720))) goto LA11;
break;
	case 14: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3734))) goto LA25;
break;
	case 16: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3732))) goto LA23;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3735))) goto LA26;
break;
	case 18: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3711))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3719))) goto LA10;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3733))) goto LA24;
break;
	case 19: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3723))) goto LA14;
break;
	case 20: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3724))) goto LA15;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3731))) goto LA22;
break;
	case 25: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3709))) goto LA6;
break;
	case 26: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3730))) goto LA21;
break;
	case 27: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3713))) goto LA7;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3718))) goto LA10;
break;
	case 29: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3726))) goto LA17;
break;
	case 31: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3715))) goto LA8;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3721))) goto LA12;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3722))) goto LA13;
break;
	}
	goto LA28;
	LA6: ;
	{
		gcmd_165134 = ((NU8) 1);
		commandcompiletoc_576071();
	}
	goto LA29;
	LA7: ;
	{
		gcmd_165134 = ((NU8) 2);
		definesymbol_197013(((NimStringDesc*) &TMP3713));
		commandcompiletoc_576071();
	}
	goto LA29;
	LA8: ;
	{
		gcmd_165134 = ((NU8) 3);
		definesymbol_197013(((NimStringDesc*) &TMP3715));
		commandcompiletoc_576071();
	}
	goto LA29;
	LA9: ;
	{
		gcmd_165134 = ((NU8) 19);
		rawmessage_192636(((NU16) 185), command_165240);
	}
	goto LA29;
	LA10: ;
	{
		gcmd_165134 = ((NU8) 4);
		commandcompiletojs_576132();
	}
	goto LA29;
	LA11: ;
	{
		wantmainmodule_574931();
		gcmd_165134 = ((NU8) 8);
		loadconfigs_219609(((NimStringDesc*) &TMP5010));
		commanddoc_385360();
	}
	goto LA29;
	LA12: ;
	{
		gcmd_165134 = ((NU8) 8);
		loadconfigs_219609(((NimStringDesc*) &TMP5010));
		definesymbol_197013(((NimStringDesc*) &TMP5141));
		commanddoc2_576060();
	}
	goto LA29;
	LA13: ;
	{
		gcmd_165134 = ((NU8) 16);
		loadconfigs_219609(((NimStringDesc*) &TMP5010));
		commandrst2html_385400();
	}
	goto LA29;
	LA14: ;
	{
		gcmd_165134 = ((NU8) 17);
		loadconfigs_219609(((NimStringDesc*) &TMP5147));
		commandrst2tex_385408();
	}
	goto LA29;
	LA15: ;
	{
		wantmainmodule_574931();
		gcmd_165134 = ((NU8) 8);
		loadconfigs_219609(((NimStringDesc*) &TMP5010));
		wantmainmodule_574931();
		definesymbol_197013(((NimStringDesc*) &TMP5141));
		commandjson_385416();
	}
	goto LA29;
	LA16: ;
	{
		gcmd_165134 = ((NU8) 8);
		loadconfigs_219609(((NimStringDesc*) &TMP5010));
		commandbuildindex_385452();
	}
	goto LA29;
	LA17: ;
	{
		gcmd_165134 = ((NU8) 9);
		commandgendepend_576041();
	}
	goto LA29;
	LA18: ;
	{
		gcmd_165134 = ((NU8) 10);
		{
			NimStringDesc* LOC45;
			Jsonnodeobj323754* definedsymbols;
			Jsonnodeobj323754* libpaths;
			Jsonnodeobj323754* dumpdata;
			TY577027 LOC66;
			NimStringDesc* LOC67;
			LOC45 = 0;
			LOC45 = getconfigvar_165335(((NimStringDesc*) &TMP5220));
			if (!eqStrings(LOC45, ((NimStringDesc*) &TMP5221))) goto LA46;
			wantmainmodule_574931();
			definedsymbols = newjarray_323956();
			{
				NimStringDesc* s_577002;
				s_577002 = 0;
				{
					NimStringDesc* key_577406;
					NimStringDesc* val_577408;
					key_577406 = 0;
					val_577408 = 0;
					{
						NI h_577410;
						NI HEX3Atmp_577412;
						NI res_577414;
						h_577410 = 0;
						HEX3Atmp_577412 = 0;
						HEX3Atmp_577412 = ((*gsymbols_197004).data ? ((*gsymbols_197004).data->Sup.len-1) : -1);
						res_577414 = ((NI) 0);
						{
							while (1) {
								if (!(res_577414 <= HEX3Atmp_577412)) goto LA52;
								h_577410 = res_577414;
								{
									if (!!((*gsymbols_197004).data->data[h_577410].Field0 == 0)) goto LA55;
									key_577406 = (*gsymbols_197004).data->data[h_577410].Field0;
									val_577408 = (*gsymbols_197004).data->data[h_577410].Field1;
									{
										Jsonnodeobj323754* LOC61;
										if (!!(eqStrings(val_577408, ((NimStringDesc*) &TMP5222)))) goto LA59;
										s_577002 = key_577406;
										LOC61 = 0;
										LOC61 = HEX25_324205(s_577002);
										(*definedsymbols).kindU.S7.elems = (TY323774*) incrSeqV2(&((*definedsymbols).kindU.S7.elems)->Sup, sizeof(Jsonnodeobj323754*));
										asgnRefNoCycle((void**) (&(*definedsymbols).kindU.S7.elems->data[(*definedsymbols).kindU.S7.elems->Sup.len]), LOC61);
										++(*definedsymbols).kindU.S7.elems->Sup.len;
									}
									LA59: ;
								}
								LA55: ;
								res_577414 += ((NI) 1);
							} LA52: ;
						}
					}
				}
			}
			libpaths = newjarray_323956();
			{
				NimStringDesc* dir_577015;
				Tstrentry139024* it_577420;
				dir_577015 = 0;
				it_577420 = ((Tstrentry139024*) (searchpaths_165136.head));
				{
					while (1) {
						Jsonnodeobj323754* LOC65;
						if (!!((it_577420 == NIM_NIL))) goto LA64;
						dir_577015 = (*it_577420).data;
						LOC65 = 0;
						LOC65 = HEX25_324205(dir_577015);
						(*libpaths).kindU.S7.elems = (TY323774*) incrSeqV2(&((*libpaths).kindU.S7.elems)->Sup, sizeof(Jsonnodeobj323754*));
						asgnRefNoCycle((void**) (&(*libpaths).kindU.S7.elems->data[(*libpaths).kindU.S7.elems->Sup.len]), LOC65);
						++(*libpaths).kindU.S7.elems->Sup.len;
						it_577420 = ((Tstrentry139024*) ((*it_577420).Sup.next));
					} LA64: ;
				}
			}
			memset((void*)LOC66, 0, sizeof(LOC66));
			LOC66[0].Field0 = copyString(((NimStringDesc*) &TMP5223));
			LOC66[0].Field1 = HEX25_324205(((NimStringDesc*) &TMP5224));
			LOC66[1].Field0 = copyString(((NimStringDesc*) &TMP5225));
			LOC66[1].Field1 = HEX25_324205(gprojectfull_165236);
			LOC66[2].Field0 = copyString(((NimStringDesc*) &TMP5226));
			LOC66[2].Field1 = definedsymbols;
			LOC66[3].Field0 = copyString(((NimStringDesc*) &TMP5227));
			LOC66[3].Field1 = libpaths;
			dumpdata = HEX25_324281(LOC66, 4);
			LOC67 = 0;
			LOC67 = HEX24_328129(dumpdata);
			msgwriteln_189915(LOC67, 3);
		}
		goto LA43;
		LA46: ;
		{
			msgwriteln_189915(((NimStringDesc*) &TMP5230), 3);
			{
				NimStringDesc* s_577044;
				s_577044 = 0;
				{
					NimStringDesc* key_577426;
					NimStringDesc* val_577428;
					key_577426 = 0;
					val_577428 = 0;
					{
						NI h_577430;
						NI HEX3Atmp_577432;
						NI res_577434;
						h_577430 = 0;
						HEX3Atmp_577432 = 0;
						HEX3Atmp_577432 = ((*gsymbols_197004).data ? ((*gsymbols_197004).data->Sup.len-1) : -1);
						res_577434 = ((NI) 0);
						{
							while (1) {
								if (!(res_577434 <= HEX3Atmp_577432)) goto LA73;
								h_577430 = res_577434;
								{
									if (!!((*gsymbols_197004).data->data[h_577430].Field0 == 0)) goto LA76;
									key_577426 = (*gsymbols_197004).data->data[h_577430].Field0;
									val_577428 = (*gsymbols_197004).data->data[h_577430].Field1;
									{
										if (!!(eqStrings(val_577428, ((NimStringDesc*) &TMP5222)))) goto LA80;
										s_577044 = key_577426;
										msgwriteln_189915(s_577044, 3);
									}
									LA80: ;
								}
								LA76: ;
								res_577434 += ((NI) 1);
							} LA73: ;
						}
					}
				}
			}
			msgwriteln_189915(((NimStringDesc*) &TMP5231), 3);
			{
				NimStringDesc* it_577047;
				Tstrentry139024* it_577440;
				it_577047 = 0;
				it_577440 = ((Tstrentry139024*) (searchpaths_165136.head));
				{
					while (1) {
						if (!!((it_577440 == NIM_NIL))) goto LA84;
						it_577047 = (*it_577440).data;
						msgwriteln_189915(it_577047, 0);
						it_577440 = ((Tstrentry139024*) ((*it_577440).Sup.next));
					} LA84: ;
				}
			}
		}
		LA43: ;
	}
	goto LA29;
	LA19: ;
	{
		gcmd_165134 = ((NU8) 11);
		commandcheck_576049();
	}
	goto LA29;
	LA20: ;
	{
		Tnode223809* LOC87;
		gcmd_165134 = ((NU8) 12);
		wantmainmodule_574931();
		LOC87 = 0;
		LOC87 = parsefile_251041(gprojectmainidx_165238);
	}
	goto LA29;
	LA21: ;
	{
		gcmd_165134 = ((NU8) 13);
		wantmainmodule_574931();
		commandscan_576278();
		msgwriteln_189915(((NimStringDesc*) &TMP5235), 0);
	}
	goto LA29;
	LA22: ;
	{
		gcmd_165134 = ((NU8) 18);
		commandinteractive_576207();
	}
	goto LA29;
	LA23: ;
	{
		NimStringDesc* LOC91;
		LOC91 = 0;
		LOC91 = maincommandarg_165308();
		commandeval_576256(LOC91);
	}
	goto LA29;
	LA24: ;
	{
		resetmemory_576338();
	}
	goto LA29;
	LA25: ;
	{
		gcmd_165134 = ((NU8) 14);
		{
			if (!!(((gevalexpr_165144) && (gevalexpr_165144)->Sup.len == 0))) goto LA96;
			commandeval_576256(gevalexpr_165144);
		}
		goto LA94;
		LA96: ;
		{
			commandsuggest_576325();
		}
		LA94: ;
	}
	goto LA29;
	LA26: ;
	{
		isserving_165147 = NIM_TRUE;
		gglobaloptions_165132 |= ((NU32)1)<<((((NU8) 15))%(sizeof(NU32)*8));
		gerrormax_189399 = ((NI) IL64(9223372036854775807));
		serve_573254(maincommand_576628);
	}
	goto LA29;
	LA27: ;
	{
		gcmd_165134 = ((NU8) 10);
	}
	goto LA29;
	LA28: ;
	{
		rawmessage_192636(((NU16) 185), command_165240);
	}
	LA29: ;
	{
		NIM_BOOL LOC104;
		TY192829 LOC108;
		NF LOC109;
		NI LOC110;
		LOC104 = 0;
		LOC104 = (gerrorcounter_189396 == ((NI) 0));
		if (!(LOC104)) goto LA105;
		LOC104 = !(((525376 &(1<<((gcmd_165134)&31)))!=0));
		LA105: ;
		if (!LOC104) goto LA106;
		memset((void*)LOC108, 0, sizeof(LOC108));
		LOC108[0] = nimIntToStr(glinescompiled_214213);
		LOC109 = 0;
		LOC109 = ntepochTime();
		LOC108[1] = nsuformatFloat(((NF)(LOC109) - (NF)(glastcmdtime_165145)), ((NU8) 1), ((NI) 3), 46);
		LOC110 = 0;
		LOC110 = gettotalmem_9095();
		LOC108[2] = formatsize_105405(((NI64) (LOC110)), 46);
		{
			NIM_BOOL LOC113;
			LOC113 = 0;
			LOC113 = isdefined_197031(((NimStringDesc*) &TMP5277));
			if (!LOC113) goto LA114;
			LOC108[3] = copyString(((NimStringDesc*) &TMP5278));
		}
		goto LA111;
		LA114: ;
		{
			LOC108[3] = copyString(((NimStringDesc*) &TMP5279));
		}
		LA111: ;
		rawmessage_191675(((NU16) 269), LOC108, 4);
	}
	LA106: ;
	resetattributes_192648();
}
NIM_EXTERNC N_NOINLINE(void, compiler_mainInit000)(void) {
}

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

