/* Generated by Nim Compiler v0.12.0 */
/*   (c) 2015 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_INTBITS 32

#include "nimbase.h"
#include <string.h>
#include <stdio.h>
typedef struct Tlinkedlist140028 Tlinkedlist140028;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tlistentry140022 Tlistentry140022;
typedef struct Tpass276017 Tpass276017;
typedef struct Tpasscontext276005 Tpasscontext276005;
typedef struct Tsym224841 Tsym224841;
typedef struct Trodreader267030 Trodreader267030;
typedef struct Tnode224809 Tnode224809;
typedef struct Cell48946 Cell48946;
typedef struct TNimType TNimType;
typedef struct Cellseq48962 Cellseq48962;
typedef struct Gcheap51018 Gcheap51018;
typedef struct Gcstack51016 Gcstack51016;
typedef struct Cellset48958 Cellset48958;
typedef struct Pagedesc48954 Pagedesc48954;
typedef struct Memregion30890 Memregion30890;
typedef struct Smallchunk30842 Smallchunk30842;
typedef struct Llchunk30884 Llchunk30884;
typedef struct Bigchunk30844 Bigchunk30844;
typedef struct Intset30817 Intset30817;
typedef struct Trunk30813 Trunk30813;
typedef struct Avlnode30888 Avlnode30888;
typedef struct Gcstat51014 Gcstat51014;
typedef struct TY575054 TY575054;
typedef struct Tmoduleinmemory575017 Tmoduleinmemory575017;
typedef struct TY224932 TY224932;
typedef struct Jsonnodeobj324754 Jsonnodeobj324754;
typedef struct Stringtableobj145212 Stringtableobj145212;
typedef struct TNimObject TNimObject;
typedef struct TNimNode TNimNode;
typedef struct Keyvaluepairseq145210 Keyvaluepairseq145210;
typedef struct Keyvaluepair145208 Keyvaluepair145208;
typedef struct TY324769 TY324769;
typedef struct TY324774 TY324774;
typedef struct Tstrentry140024 Tstrentry140024;
typedef struct TY325284 TY325284;
typedef struct Tllstream212204 Tllstream212204;
typedef struct Tlexer215185 Tlexer215185;
typedef struct Tbaselexer213024 Tbaselexer213024;
typedef struct Tlineinfo189352 Tlineinfo189352;
typedef struct Ttoken215181 Ttoken215181;
typedef struct Tident197021 Tident197021;
typedef struct TY130408 TY130408;
typedef struct Tidobj197015 Tidobj197015;
typedef struct Ttypeseq224843 Ttypeseq224843;
typedef struct Tscope224835 Tscope224835;
typedef struct TY224944 TY224944;
typedef struct Tstrtable224813 Tstrtable224813;
typedef struct Tsymseq224811 Tsymseq224811;
typedef struct Ttype224847 Ttype224847;
typedef struct Tloc224823 Tloc224823;
typedef struct Ropeobj175009 Ropeobj175009;
typedef struct Tlib224827 Tlib224827;
typedef struct Tindex267028 Tindex267028;
typedef struct Tiitable232274 Tiitable232274;
typedef struct Tiipairseq232272 Tiipairseq232272;
typedef struct Table267063 Table267063;
typedef struct Keyvaluepairseq267066 Keyvaluepairseq267066;
typedef struct Memfile265208 Memfile265208;
typedef struct Tnodeseq224803 Tnodeseq224803;
typedef struct Basechunk30840 Basechunk30840;
typedef struct Freecell30832 Freecell30832;
typedef struct Tinstantiation224831 Tinstantiation224831;
typedef struct Tiipair232270 Tiipair232270;
typedef struct Keyvaluepair267069 Keyvaluepair267069;
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(Tpasscontext276005*, Tpassopen276009) (Tsym224841* module);
typedef N_NIMCALL_PTR(Tpasscontext276005*, Tpassopencached276011) (Tsym224841* module, Trodreader267030* rd);
typedef N_NIMCALL_PTR(Tnode224809*, Tpassprocess276015) (Tpasscontext276005* p, Tnode224809* toplevelstmt);
typedef N_NIMCALL_PTR(Tnode224809*, Tpassclose276013) (Tpasscontext276005* p, Tnode224809* n);
struct Tpass276017 {
Tpassopen276009 Field0;
Tpassopencached276011 Field1;
Tpassprocess276015 Field2;
Tpassclose276013 Field3;
};
struct  Cell48946  {
NI refcount;
TNimType* typ;
};
struct  Cellseq48962  {
NI len;
NI cap;
Cell48946** d;
};
struct  Cellset48958  {
NI counter;
NI max;
Pagedesc48954* head;
Pagedesc48954** data;
};
typedef Smallchunk30842* TY30905[512];
typedef Trunk30813* Trunkbuckets30815[256];
struct  Intset30817  {
Trunkbuckets30815 data;
};
struct  Memregion30890  {
NI minlargeobj;
NI maxlargeobj;
TY30905 freesmallchunks;
Llchunk30884* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk30844* freechunkslist;
Intset30817 chunkstarts;
Avlnode30888* root;
Avlnode30888* deleted;
Avlnode30888* last;
Avlnode30888* 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;
Cellseq48962 zct;
Cellseq48962 decstack;
Cellset48958 cycleroots;
Cellseq48962 tempstack;
NI recgclock;
Memregion30890 region;
Gcstat51014 stat;
};
typedef NU8 Sha1digest200009[20];
struct  Tmoduleinmemory575017  {
NF compiledat;
Sha1digest200009 hash;
TY224932* 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  Jsonnodeobj324754  {
NU8 kind;
union{
struct {NimStringDesc* str;
} S1;
struct {NI64 num;
} S2;
struct {NF fnum;
} S3;
struct {NIM_BOOL bval;
} S4;
struct {TY324769* fields;
} S6;
struct {TY324774* elems;
} S7;
} kindU;
};
struct  Tlistentry140022  {
  TNimObject Sup;
Tlistentry140022* prev;
Tlistentry140022* next;
};
struct  Tstrentry140024  {
  Tlistentry140022 Sup;
NimStringDesc* data;
};
struct TY325284 {
NimStringDesc* Field0;
Jsonnodeobj324754* Field1;
};
typedef TY325284 TY578027[4];
struct  Tbaselexer213024  {
  TNimObject Sup;
NI bufpos;
NCSTRING buf;
NI buflen;
Tllstream212204* stream;
NI linenumber;
NI sentinel;
NI linestart;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (Tlineinfo189352 info, NU16 msg, NimStringDesc* arg, void* ClEnv);
void* ClEnv;
} Terrorhandler215183;
struct  Tlexer215185  {
  Tbaselexer213024 Sup;
NI32 fileidx;
NI indentahead;
NI currlineindent;
NIM_BOOL strongspaces;
Terrorhandler215183 errorhandler;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Ttoken215181  {
NU8 toktype;
NI indent;
Tident197021* ident;
NI64 inumber;
NF fnumber;
NU8 base;
NI8 strongspacea;
NI8 strongspaceb;
NimStringDesc* literal;
NI line;
NI col;
};
struct  Tidobj197015  {
  TNimObject Sup;
NI id;
};
struct  Tstrtable224813  {
NI counter;
Tsymseq224811* data;
};
struct  Tlineinfo189352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tloc224823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype224847* t;
Ropeobj175009* r;
Ropeobj175009* heaproot;
};
struct  Tsym224841  {
  Tidobj197015 Sup;
NU8 kind;
union{
struct {Ttypeseq224843* typeinstcache;
Tscope224835* typscope;
} S1;
struct {TY224944* procinstcache;
Tsym224841* gcunsafetyreason;
} S2;
struct {TY224944* usedgenerics;
Tstrtable224813 tab;
} S3;
struct {Tsym224841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype224847* typ;
Tident197021* name;
Tlineinfo189352 info;
Tsym224841* owner;
NU32 flags;
Tnode224809* ast;
NU32 options;
NI position;
NI offset;
Tloc224823 loc;
Tlib224827* annex;
Tnode224809* constraint;
};
typedef Tpass276017 TY577241[3];
typedef Tident197021* TY197038[8192];
typedef N_NIMCALL_PTR(void, TY574256) (void);
typedef NimStringDesc* TY193829[4];
struct  Tpasscontext276005  {
  TNimObject Sup;
NIM_BOOL fromcache;
};
struct  Tiitable232274  {
NI counter;
Tiipairseq232272* data;
};
struct  Tindex267028  {
NI lastidxkey;
NI lastidxval;
Tiitable232274 tab;
NimStringDesc* r;
NI offset;
};
struct  Table267063  {
Keyvaluepairseq267066* data;
NI counter;
};
struct  Memfile265208  {
void* mem;
NI size;
int handle;
};
struct  Trodreader267030  {
  TNimObject Sup;
NI pos;
NCSTRING s;
NU32 options;
NU8 reason;
TY224932* moddeps;
TY224932* files;
NI dataidx;
NI convertersidx;
NI initidx;
NI interfidx;
NI compilerprocsidx;
NI methodsidx;
NimStringDesc* filename;
Tindex267028 index;
Tindex267028 imports;
NI readerindex;
NI line;
NI moduleid;
Table267063 syms;
Memfile265208 memfile;
Tsymseq224811* methods;
NimStringDesc* origfile;
NIM_BOOL inviewmode;
};
struct  Tnode224809  {
Ttype224847* typ;
Tlineinfo189352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym224841* sym;
} S4;
struct {Tident197021* ident;
} S5;
struct {Tnodeseq224803* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Gcstack51016  {
Gcstack51016* prev;
Gcstack51016* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY30821[16];
struct  Pagedesc48954  {
Pagedesc48954* next;
NI key;
TY30821 bits;
};
struct  Basechunk30840  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk30842  {
  Basechunk30840 Sup;
Smallchunk30842* next;
Smallchunk30842* prev;
Freecell30832* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk30884  {
NI size;
NI acc;
Llchunk30884* next;
};
struct  Bigchunk30844  {
  Basechunk30840 Sup;
Bigchunk30844* next;
Bigchunk30844* prev;
NI align;
NF data;
};
struct  Trunk30813  {
Trunk30813* next;
NI key;
TY30821 bits;
};
typedef Avlnode30888* TY30895[2];
struct  Avlnode30888  {
TY30895 link;
NI key;
NI upperbound;
NI level;
};
struct  Tllstream212204  {
  TNimObject Sup;
NU8 kind;
FILE* f;
NimStringDesc* s;
NI rd;
NI wr;
NI lineoffset;
};
struct  Tident197021  {
  Tidobj197015 Sup;
NimStringDesc* s;
Tident197021* next;
NI h;
};
struct  Tscope224835  {
NI depthlevel;
Tstrtable224813 symbols;
Tnodeseq224803* usingsyms;
Tscope224835* parent;
};
struct  Ttype224847  {
  Tidobj197015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq224843* sons;
Tnode224809* n;
Tsym224841* owner;
Tsym224841* sym;
Tsym224841* destructor;
Tsym224841* deepcopy;
Tsym224841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc224823 loc;
};
struct  Ropeobj175009  {
  TNimObject Sup;
Ropeobj175009* left;
Ropeobj175009* right;
NI length;
NimStringDesc* data;
};
struct  Tlib224827  {
  Tlistentry140022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj175009* name;
Tnode224809* path;
};
struct  Tiipair232270  {
NI key;
NI val;
};
struct Keyvaluepair267069 {
NI Field0;
NI Field1;
Tsym224841* Field2;
};
struct  Freecell30832  {
Freecell30832* next;
NI zerofield;
};
struct  Tinstantiation224831  {
Tsym224841* sym;
Ttypeseq224843* concretetypes;
TY224932* usedby;
NI compilesid;
};
struct TY575054 {
  TGenericSeq Sup;
  Tmoduleinmemory575017 data[SEQ_DECL_SIZE];
};
struct TY324774 {
  TGenericSeq Sup;
  Jsonnodeobj324754* data[SEQ_DECL_SIZE];
};
struct TY130408 {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct Tsymseq224811 {
  TGenericSeq Sup;
  Tsym224841* data[SEQ_DECL_SIZE];
};
struct TY224932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq145210 {
  TGenericSeq Sup;
  Keyvaluepair145208 data[SEQ_DECL_SIZE];
};
struct TY324769 {
  TGenericSeq Sup;
  TY325284 data[SEQ_DECL_SIZE];
};
struct Ttypeseq224843 {
  TGenericSeq Sup;
  Ttype224847* data[SEQ_DECL_SIZE];
};
struct TY224944 {
  TGenericSeq Sup;
  Tinstantiation224831* data[SEQ_DECL_SIZE];
};
struct Tiipairseq232272 {
  TGenericSeq Sup;
  Tiipair232270 data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq267066 {
  TGenericSeq Sup;
  Keyvaluepair267069 data[SEQ_DECL_SIZE];
};
struct Tnodeseq224803 {
  TGenericSeq Sup;
  Tnode224809* data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, clearpasses_276182)(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_223440)(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_577071)(void);
N_NIMCALL(void, initvars_203076)(void);
N_NIMCALL(void, semanticpasses_577033)(void);
N_NIMCALL(void, registerpass_276190)(Tpass276017 p);
N_NIMCALL(Tpasscontext276005*, verboseopen_557012)(Tsym224841* s);
N_NIMCALL(Tnode224809*, verboseprocess_557023)(Tpasscontext276005* context, Tnode224809* n);
N_NIMCALL(Tpasscontext276005*, myopen_501741)(Tsym224841* module);
N_NIMCALL(Tpasscontext276005*, myopencached_501778)(Tsym224841* module, Trodreader267030* rd);
N_NIMCALL(Tnode224809*, myprocess_501917)(Tpasscontext276005* context, Tnode224809* n);
N_NIMCALL(Tnode224809*, myclose_501933)(Tpasscontext276005* context, Tnode224809* n);
N_NIMCALL(Tpasscontext276005*, myopen_544772)(Tsym224841* module);
N_NIMCALL(Tpasscontext276005*, myopencached_544924)(Tsym224841* module, Trodreader267030* rd);
N_NIMCALL(Tnode224809*, myprocess_545008)(Tpasscontext276005* b, Tnode224809* n);
N_NIMCALL(Tnode224809*, myclose_545442)(Tpasscontext276005* b, Tnode224809* n);
N_NIMCALL(void, rodpass_577007)(void);
N_NIMCALL(Tpasscontext276005*, myopen_290251)(Tsym224841* module);
N_NIMCALL(Tnode224809*, process_289969)(Tpasscontext276005* c, Tnode224809* n);
N_NIMCALL(Tnode224809*, myclose_290267)(Tpasscontext276005* c, Tnode224809* n);
N_NIMCALL(void, compileproject_575994)(NI32 projectfileidx);
N_NIMCALL(void, cgenwritemodules_545520)(void);
N_NIMCALL(void, callccompiler_203808)(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(Cell48946*, usrtocell_52646)(void* usr);
static N_INLINE(void, rtladdzct_54204)(Cell48946* c);
N_NOINLINE(void, addzct_52617)(Cellseq48962* s, Cell48946* c);
N_NIMCALL(void, resetcgenmodules_544651)(void);
N_NIMCALL(void, resetcompilationlists_203143)(void);
N_NIMCALL(void, resetcaches_506448)(void);
N_NIMCALL(void, Gcfullcollect_11205)(void);
N_NIMCALL(void, definesymbol_198013)(NimStringDesc* symbol);
N_NIMCALL(void, rawmessage_193636)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, commandcompiletojs_577132)(void);
N_NIMCALL(void, settarget_173662)(NU8 o, NU8 c);
N_NIMCALL(Tpasscontext276005*, myopen_556214)(Tsym224841* s);
N_NIMCALL(Tpasscontext276005*, myopencached_556203)(Tsym224841* s, Trodreader267030* rd);
N_NIMCALL(Tnode224809*, myprocess_556068)(Tpasscontext276005* b, Tnode224809* n);
N_NIMCALL(Tnode224809*, myclose_556174)(Tpasscontext276005* b, Tnode224809* n);
N_NIMCALL(void, wantmainmodule_575931)(void);
N_NIMCALL(void, loadconfigs_220609)(NimStringDesc* cfg);
N_NIMCALL(void, commanddoc_386360)(void);
N_NIMCALL(void, commanddoc2_577060)(void);
N_NIMCALL(Tpasscontext276005*, myopen_559069)(Tsym224841* module);
N_NIMCALL(Tnode224809*, processnode_559057)(Tpasscontext276005* c, Tnode224809* n);
N_NIMCALL(Tnode224809*, close_559018)(Tpasscontext276005* p, Tnode224809* n);
N_NIMCALL(void, finishdoc2pass_559108)(NimStringDesc* project);
N_NIMCALL(void, commandrst2html_386400)(void);
N_NIMCALL(void, commandrst2tex_386408)(void);
N_NIMCALL(void, commandjson_386416)(void);
N_NIMCALL(void, commandbuildindex_386452)(void);
N_NIMCALL(void, commandgendepend_577041)(void);
N_NIMCALL(Tpasscontext276005*, myopen_558131)(Tsym224841* module);
N_NIMCALL(Tnode224809*, adddotdependency_558041)(Tpasscontext276005* c, Tnode224809* n);
N_NIMCALL(Tnode224809*, cleanup_557066)(Tpasscontext276005* c, Tnode224809* n);
N_NIMCALL(void, generatedot_558009)(NimStringDesc* project);
N_NIMCALL(void, execexternalprogram_203175)(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_166335)(NimStringDesc* key);
N_NIMCALL(Jsonnodeobj324754*, newjarray_324956)(void);
N_NIMCALL(Jsonnodeobj324754*, HEX25_325205)(NimStringDesc* s);
N_NIMCALL(TGenericSeq*, incrSeqV2)(TGenericSeq* seq, NI elemsize);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(Jsonnodeobj324754*, HEX25_325281)(TY325284* keyvals, NI keyvalsLen0);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(void, msgwriteln_190915)(NimStringDesc* s, NU8 flags);
N_NIMCALL(NimStringDesc*, HEX24_329129)(Jsonnodeobj324754* node);
N_NIMCALL(void, commandcheck_577049)(void);
N_NIMCALL(Tnode224809*, parsefile_252041)(NI32 fileidx);
N_NIMCALL(void, commandscan_577278)(void);
N_NIMCALL(NimStringDesc*, nosaddFileExt)(NimStringDesc* filename, NimStringDesc* ext);
N_NIMCALL(NimStringDesc*, maincommandarg_166308)(void);
N_NIMCALL(Tllstream212204*, llstreamopen_212256)(NimStringDesc* filename, NU8 mode);
N_NIMCALL(void, inittoken_215369)(Ttoken215181* L);
N_NIMCALL(void, openlexer_215410)(Tlexer215185* lex, NimStringDesc* filename, Tllstream212204* inputstream);
N_NIMCALL(void, rawgettok_218848)(Tlexer215185* L, Ttoken215181* tok);
N_NIMCALL(void, printtok_215355)(Ttoken215181* tok);
N_NIMCALL(void, closelexer_215422)(Tlexer215185* lex);
N_NIMCALL(void, commandinteractive_577207)(void);
N_NIMCALL(void, interactivepasses_577140)(void);
N_NIMCALL(void, initdefines_198254)(void);
N_NIMCALL(Tpasscontext276005*, myopen_444295)(Tsym224841* module);
N_NIMCALL(Tnode224809*, myprocess_444412)(Tpasscontext276005* c, Tnode224809* n);
N_NIMCALL(void, compilesystemmodule_575910)(void);
N_NIMCALL(Tsym224841*, compilemodule_575725)(NI32 fileidx, NU32 flags);
N_NIMCALL(NI32, fileinfoidx_190254)(NimStringDesc* filename);
N_NIMCALL(Tsym224841*, makestdinmodule_576018)(void);
N_NIMCALL(void, processmodule_276056)(Tsym224841* module, Tllstream212204* stream, Trodreader267030* rd);
N_NIMCALL(Tllstream212204*, llstreamopenstdin_212293)(void);
N_NIMCALL(void, commandeval_577256)(NimStringDesc* exp);
N_NIMCALL(void, evalnim_577246)(Tnode224809* nodes, Tsym224841* module);
N_NIMCALL(void, carrypasses_276231)(Tnode224809* nodes, Tsym224841* module, Tpass276017* passes, NI passesLen0);
N_NIMCALL(Tnode224809*, parsestring_244506)(NimStringDesc* s, NimStringDesc* filename, NI line, Terrorhandler215183 errorhandler);
N_NIMCALL(void, resetmemory_577338)(void);
N_NIMCALL(void, resetallmodules_575393)(void);
N_NIMCALL(void, resetropecache_175111)(void);
N_NIMCALL(void, resetsystypes_273268)(void);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
N_NIMCALL(void, commandsuggest_577325)(void);
N_NIMCALL(void, resetmodule_575319)(NI32 fileidx);
N_NIMCALL(void, serve_574254)(TY574256 action);
N_NIMCALL(void, maincommand_577628)(void);
N_NIMCALL(void, rawmessage_192675)(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_105404)(NI64 bytes, NIM_CHAR decimalsep);
N_NIMCALL(NI, gettotalmem_9095)(void);
N_NIMCALL(NIM_BOOL, isdefined_198031)(NimStringDesc* symbol);
N_NIMCALL(void, resetattributes_193648)(void);
STRING_LITERAL(TMP3708, "c", 1);
STRING_LITERAL(TMP3709, "cc", 2);
STRING_LITERAL(TMP3710, "compile", 7);
STRING_LITERAL(TMP3711, "compiletoc", 10);
STRING_LITERAL(TMP3712, "cpp", 3);
STRING_LITERAL(TMP3713, "compiletocpp", 12);
STRING_LITERAL(TMP3714, "objc", 4);
STRING_LITERAL(TMP3715, "compiletooc", 11);
STRING_LITERAL(TMP3716, "run", 3);
STRING_LITERAL(TMP3717, "js", 2);
STRING_LITERAL(TMP3718, "compiletojs", 11);
STRING_LITERAL(TMP3719, "doc", 3);
STRING_LITERAL(TMP3720, "doc2", 4);
STRING_LITERAL(TMP3721, "rst2html", 8);
STRING_LITERAL(TMP3722, "rst2tex", 7);
STRING_LITERAL(TMP3723, "jsondoc", 7);
STRING_LITERAL(TMP3724, "buildindex", 10);
STRING_LITERAL(TMP3725, "gendepend", 9);
STRING_LITERAL(TMP3726, "dump", 4);
STRING_LITERAL(TMP3727, "check", 5);
STRING_LITERAL(TMP3728, "parse", 5);
STRING_LITERAL(TMP3729, "scan", 4);
STRING_LITERAL(TMP3730, "secret", 6);
STRING_LITERAL(TMP3731, "e", 1);
STRING_LITERAL(TMP3732, "reset", 5);
STRING_LITERAL(TMP3733, "idetools", 8);
STRING_LITERAL(TMP3734, "serve", 5);
STRING_LITERAL(TMP3735, "nop", 3);
STRING_LITERAL(TMP3736, "help", 4);
STRING_LITERAL(TMP4614, "", 0);
STRING_LITERAL(TMP4615, "nimrod", 6);
STRING_LITERAL(TMP4616, "ecmascript", 10);
STRING_LITERAL(TMP5009, "nimdoc.cfg", 10);
STRING_LITERAL(TMP5140, "nimdoc", 6);
STRING_LITERAL(TMP5146, "nimdoc.tex.cfg", 14);
STRING_LITERAL(TMP5216, "dot -Tpng -o", 12);
STRING_LITERAL(TMP5217, "png", 3);
STRING_LITERAL(TMP5218, "dot", 3);
STRING_LITERAL(TMP5219, "dump.format", 11);
STRING_LITERAL(TMP5220, "json", 4);
STRING_LITERAL(TMP5221, "false", 5);
STRING_LITERAL(TMP5222, "version", 7);
STRING_LITERAL(TMP5223, "0.12.0", 6);
STRING_LITERAL(TMP5224, "project_path", 12);
STRING_LITERAL(TMP5225, "defined_symbols", 15);
STRING_LITERAL(TMP5226, "lib_paths", 9);
STRING_LITERAL(TMP5229, "-- list of currently defined symbols --", 39);
STRING_LITERAL(TMP5230, "-- end of list --", 17);
STRING_LITERAL(TMP5231, "nim", 3);
STRING_LITERAL(TMP5234, "Beware: Indentation tokens depend on the parser\'s state!", 56);
STRING_LITERAL(TMP5235, "nimscript", 9);
STRING_LITERAL(TMP5237, "echo \"eval\\t\", repr(", 20);
STRING_LITERAL(TMP5238, ")", 1);
static NIM_CONST Terrorhandler215183 TMP5239 = {NIM_NIL,NIM_NIL};
STRING_LITERAL(TMP5276, "release", 7);
STRING_LITERAL(TMP5277, "Release Build", 13);
STRING_LITERAL(TMP5278, "Debug Build", 11);
extern NF glastcmdtime_166145;
extern Tlinkedlist140028 searchpaths_166136;
extern NimStringDesc* libpath_166233;
extern NimStringDesc* gprojectfull_166236;
extern NimStringDesc* gprojectpath_166235;
extern NI gfrontendid_223012;
extern NimStringDesc* command_166240;
extern NU8 gcmd_166134;
extern NU32 gglobaloptions_166132;
extern NIM_BOOL isserving_166147;
extern NimStringDesc* lastcaascmd_574205;
extern NimStringDesc* curcaascmd_574204;
extern Gcheap51018 gch_51059;
extern TY575054* gmemcachedata_575071;
extern NI gerrormax_190402;
extern NimStringDesc* gprojectname_166234;
extern Stringtableobj145212* gsymbols_198004;
extern NI32 gprojectmainidx_166238;
extern TNimType NTI215185; /* TLexer */
extern TY130408* commandargs_166258;
extern Tsym224841* systemmodule_273019;
extern Tsymseq224811* gowners_279291;
extern TNimType NTI224811; /* TSymSeq */
extern TY197038 buckets_197039;
extern Tident197021* idanon_197495;
extern NimStringDesc* gevalexpr_166144;
extern Tlineinfo189352 gtrackpos_190901;
extern NI gerrorcounter_190399;
extern NI glinescompiled_215213;

static N_INLINE(void, setid_223440)(NI id) {
	gfrontendid_223012 = ((gfrontendid_223012 >= (NI)(id + ((NI) 1))) ? gfrontendid_223012 : (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_577033)(void) {
	Tpass276017 LOC1;
	Tpass276017 LOC2;
	LOC1.Field0 = verboseopen_557012;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = verboseprocess_557023;
	LOC1.Field3 = NIM_NIL;
	registerpass_276190(LOC1);
	LOC2.Field0 = myopen_501741;
	LOC2.Field1 = myopencached_501778;
	LOC2.Field2 = myprocess_501917;
	LOC2.Field3 = myclose_501933;
	registerpass_276190(LOC2);
}

N_NIMCALL(void, rodpass_577007)(void) {
	{
		Tpass276017 LOC5;
		if (!((gglobaloptions_166132 &(1<<((((NU8) 14))&31)))!=0)) goto LA3;
		LOC5.Field0 = myopen_290251;
		LOC5.Field1 = NIM_NIL;
		LOC5.Field2 = process_289969;
		LOC5.Field3 = myclose_290267;
		registerpass_276190(LOC5);
	}
	LA3: ;
}

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

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

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

N_NIMCALL(void, commandcompiletoc_577071)(void) {
	Tpass276017 LOC1;
	initvars_203076();
	semanticpasses_577033();
	LOC1.Field0 = myopen_544772;
	LOC1.Field1 = myopencached_544924;
	LOC1.Field2 = myprocess_545008;
	LOC1.Field3 = myclose_545442;
	registerpass_276190(LOC1);
	rodpass_577007();
	compileproject_575994(((NI32) -1));
	cgenwritemodules_545520();
	{
		NimStringDesc* LOC6;
		if (!!((gcmd_166134 == ((NU8) 19)))) goto LA4;
		LOC6 = 0;
		LOC6 = noschangeFileExt(gprojectfull_166236, ((NimStringDesc*) &TMP4614));
		callccompiler_203808(LOC6);
	}
	LA4: ;
	{
		NimStringDesc* LOC11;
		if (!isserving_166147) goto LA9;
		LOC11 = 0;
		LOC11 = lastcaascmd_574205; lastcaascmd_574205 = copyStringRC1(curcaascmd_574204);
		if (LOC11) nimGCunrefNoCycle(LOC11);
		resetcgenmodules_544651();
		{
			NI i_577108;
			NI HEX3Atmp_577110;
			NI res_577113;
			i_577108 = 0;
			HEX3Atmp_577110 = 0;
			HEX3Atmp_577110 = ((gmemcachedata_575071 ? gmemcachedata_575071->Sup.len : 0) - 1);
			res_577113 = ((NI) 0);
			{
				while (1) {
					if (!(res_577113 <= HEX3Atmp_577110)) goto LA14;
					i_577108 = res_577113;
					gmemcachedata_575071->data[i_577108].hashstatus = ((NU8) 1);
					gmemcachedata_575071->data[i_577108].needsrecompile = ((NU8) 0);
					res_577113 += ((NI) 1);
				} LA14: ;
			}
		}
		resetcompilationlists_203143();
		resetcaches_506448();
		Gcfullcollect_11205();
	}
	LA9: ;
}

N_NIMCALL(void, commandcompiletojs_577132)(void) {
	Tpass276017 LOC1;
	settarget_173662(((NU8) 22), ((NU8) 15));
	definesymbol_198013(((NimStringDesc*) &TMP4615));
	definesymbol_198013(((NimStringDesc*) &TMP4616));
	definesymbol_198013(((NimStringDesc*) &TMP3717));
	semanticpasses_577033();
	LOC1.Field0 = myopen_556214;
	LOC1.Field1 = myopencached_556203;
	LOC1.Field2 = myprocess_556068;
	LOC1.Field3 = myclose_556174;
	registerpass_276190(LOC1);
	compileproject_575994(((NI32) -1));
}

N_NIMCALL(void, commanddoc2_577060)(void) {
	Tpass276017 LOC1;
	gerrormax_190402 = ((NI) 2147483647);
	semanticpasses_577033();
	LOC1.Field0 = myopen_559069;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = processnode_559057;
	LOC1.Field3 = close_559018;
	registerpass_276190(LOC1);
	compileproject_575994(((NI32) -1));
	finishdoc2pass_559108(gprojectname_166234);
}

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_577041)(void) {
	Tpass276017 LOC1;
	Tpass276017 LOC2;
	NimStringDesc* LOC3;
	NimStringDesc* LOC4;
	NimStringDesc* LOC5;
	semanticpasses_577033();
	LOC1.Field0 = myopen_558131;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = adddotdependency_558041;
	LOC1.Field3 = NIM_NIL;
	registerpass_276190(LOC1);
	LOC2.Field0 = NIM_NIL;
	LOC2.Field1 = NIM_NIL;
	LOC2.Field2 = cleanup_557066;
	LOC2.Field3 = cleanup_557066;
	registerpass_276190(LOC2);
	compileproject_575994(((NI32) -1));
	generatedot_558009(gprojectfull_166236);
	LOC3 = 0;
	LOC4 = 0;
	LOC4 = noschangeFileExt(gprojectfull_166236, ((NimStringDesc*) &TMP5217));
	LOC5 = 0;
	LOC5 = noschangeFileExt(gprojectfull_166236, ((NimStringDesc*) &TMP5218));
	LOC3 = rawNewString(LOC4->Sup.len + LOC5->Sup.len + 13);
appendString(LOC3, ((NimStringDesc*) &TMP5216));
appendString(LOC3, LOC4);
appendChar(LOC3, 32);
appendString(LOC3, LOC5);
	execexternalprogram_203175(LOC3, ((NU16) 284));
}

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

N_NIMCALL(void, commandcheck_577049)(void) {
	gerrormax_190402 = ((NI) 2147483647);
	semanticpasses_577033();
	rodpass_577007();
	compileproject_575994(((NI32) -1));
}

N_NIMCALL(void, commandscan_577278)(void) {
	NimStringDesc* f;
	NimStringDesc* LOC1;
	Tllstream212204* stream;
	LOC1 = 0;
	LOC1 = maincommandarg_166308();
	f = nosaddFileExt(LOC1, ((NimStringDesc*) &TMP5231));
	stream = llstreamopen_212256(f, ((NU8) 0));
	{
		Tlexer215185 L;
		Ttoken215181 tok;
		if (!!((stream == NIM_NIL))) goto LA4;
		memset((void*)(&L), 0, sizeof(L));
		L.Sup.Sup.m_type = (&NTI215185);
		memset((void*)(&tok), 0, sizeof(tok));
		inittoken_215369((&tok));
		openlexer_215410((&L), f, stream);
		{
			while (1) {
				rawgettok_218848((&L), (&tok));
				printtok_215355((&tok));
				{
					if (!(tok.toktype == ((NU8) 1))) goto LA10;
					goto LA6;
				}
				LA10: ;
			}
		} LA6: ;
		closelexer_215422((&L));
	}
	goto LA2;
	LA4: ;
	{
		rawmessage_193636(((NU16) 3), f);
	}
	LA2: ;
}

N_NIMCALL(void, interactivepasses_577140)(void) {
	Tpass276017 LOC1;
	Tpass276017 LOC2;
	Tpass276017 LOC3;
	initdefines_198254();
	definesymbol_198013(((NimStringDesc*) &TMP5235));
	LOC1.Field0 = verboseopen_557012;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = verboseprocess_557023;
	LOC1.Field3 = NIM_NIL;
	registerpass_276190(LOC1);
	LOC2.Field0 = myopen_501741;
	LOC2.Field1 = myopencached_501778;
	LOC2.Field2 = myprocess_501917;
	LOC2.Field3 = myclose_501933;
	registerpass_276190(LOC2);
	LOC3.Field0 = myopen_444295;
	LOC3.Field1 = NIM_NIL;
	LOC3.Field2 = myprocess_444412;
	LOC3.Field3 = myprocess_444412;
	registerpass_276190(LOC3);
}

N_NIMCALL(void, commandinteractive_577207)(void) {
	gerrormax_190402 = ((NI) 2147483647);
	interactivepasses_577140();
	compilesystemmodule_575910();
	{
		NI32 LOC5;
		Tsym224841* LOC6;
		if (!(((NI) 0) < (commandargs_166258 ? commandargs_166258->Sup.len : 0))) goto LA3;
		LOC5 = 0;
		LOC5 = fileinfoidx_190254(gprojectfull_166236);
		LOC6 = 0;
		LOC6 = compilemodule_575725(LOC5, 0);
	}
	goto LA1;
	LA3: ;
	{
		Tsym224841* m;
		Tllstream212204* LOC8;
		m = makestdinmodule_576018();
		(*m).flags |= ((NU32)1)<<((((NU8) 12))%(sizeof(NU32)*8));
		LOC8 = 0;
		LOC8 = llstreamopenstdin_212293();
		processmodule_276056(m, LOC8, NIM_NIL);
	}
	LA1: ;
}

N_NIMCALL(void, evalnim_577246)(Tnode224809* nodes, Tsym224841* module) {
	TY577241 LOC1;
	LOC1[0].Field0 = verboseopen_557012;
	LOC1[0].Field1 = NIM_NIL;
	LOC1[0].Field2 = verboseprocess_557023;
	LOC1[0].Field3 = NIM_NIL;
	LOC1[1].Field0 = myopen_501741;
	LOC1[1].Field1 = myopencached_501778;
	LOC1[1].Field2 = myprocess_501917;
	LOC1[1].Field3 = myclose_501933;
	LOC1[2].Field0 = myopen_444295;
	LOC1[2].Field1 = NIM_NIL;
	LOC1[2].Field2 = myprocess_444412;
	LOC1[2].Field3 = myprocess_444412;
	carrypasses_276231(nodes, module, LOC1, 3);
}

N_NIMCALL(void, commandeval_577256)(NimStringDesc* exp) {
	NimStringDesc* echoexp;
	NimStringDesc* LOC5;
	Tnode224809* LOC6;
	Tsym224841* LOC7;
	{
		if (!(systemmodule_273019 == NIM_NIL)) goto LA3;
		interactivepasses_577140();
		compilesystemmodule_575910();
	}
	LA3: ;
	LOC5 = 0;
	LOC5 = rawNewString(exp->Sup.len + 21);
appendString(LOC5, ((NimStringDesc*) &TMP5237));
appendString(LOC5, exp);
appendString(LOC5, ((NimStringDesc*) &TMP5238));
	echoexp = LOC5;
	LOC6 = 0;
	LOC6 = parsestring_244506(echoexp, ((NimStringDesc*) &TMP4614), ((NI) 0), TMP5239);
	LOC7 = 0;
	LOC7 = makestdinmodule_576018();
	evalnim_577246(LOC6, LOC7);
}

N_NIMCALL(void, resetmemory_577338)(void) {
	resetcompilationlists_203143();
	resetcaches_506448();
	resetallmodules_575393();
	resetropecache_175111();
	resetsystypes_273268();
	if (gowners_279291) nimGCunrefNoCycle(gowners_279291);
	gowners_279291 = (Tsymseq224811*) newSeqRC1((&NTI224811), 0);
	{
		NI i_577423;
		NI res_577605;
		i_577423 = 0;
		res_577605 = ((NI) 0);
		{
			while (1) {
				if (!(res_577605 <= ((NI) 8191))) goto LA3;
				i_577423 = ((NI) (res_577605));
				asgnRefNoCycle((void**) (&buckets_197039[(i_577423)- 0]), NIM_NIL);
				res_577605 += ((NI) 1);
			} LA3: ;
		}
	}
	asgnRefNoCycle((void**) (&idanon_197495), NIM_NIL);
}

N_NIMCALL(void, commandsuggest_577325)(void) {
	{
		NI32 gdirtybufferidx;
		Tsym224841* LOC5;
		if (!isserving_166147) goto LA3;
		commandcompiletoc_577071();
		gdirtybufferidx = gtrackpos_190901.fileindex;
		LOC5 = 0;
		LOC5 = compilemodule_575725(gdirtybufferidx, 512);
		resetmodule_575319(gdirtybufferidx);
	}
	goto LA1;
	LA3: ;
	{
		gerrormax_190402 = ((NI) 2147483647);
		semanticpasses_577033();
		rodpass_577007();
		compileproject_575994(((NI32) -1));
	}
	LA1: ;
}

N_NIMCALL(void, maincommand_577628)(void) {
	NimStringDesc* LOC5;
	clearpasses_276182();
	glastcmdtime_166145 = ntepochTime();
	appendstr_140268((&searchpaths_166136), libpath_166233);
	{
		if (!!(((gprojectfull_166236 ? gprojectfull_166236->Sup.len : 0) == ((NI) 0)))) goto LA3;
		prependstr_140419((&searchpaths_166136), gprojectpath_166235);
	}
	LA3: ;
	setid_223440(((NI) 100));
	LOC5 = 0;
	LOC5 = nsuNormalize(command_166240);
	switch (hashString(LOC5) & 31) {
	case 0: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3710))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3715))) goto LA8;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3733))) goto LA25;
break;
	case 2: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3726))) goto LA18;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3735))) goto LA27;
break;
	case 4: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3728))) goto LA20;
break;
	case 7: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3721))) goto LA13;
break;
	case 9: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3716))) goto LA9;
break;
	case 10: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3709))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3718))) goto LA10;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3727))) goto LA19;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3732))) goto LA24;
break;
	case 11: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3725))) goto LA17;
break;
	case 12: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3736))) goto LA27;
break;
	case 13: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3719))) goto LA11;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3722))) goto LA14;
break;
	case 14: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3723))) goto LA15;
break;
	case 16: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3711))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3731))) goto LA23;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3734))) goto LA26;
break;
	case 19: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3713))) goto LA7;
break;
	case 21: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3730))) goto LA22;
break;
	case 25: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3708))) goto LA6;
break;
	case 26: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3729))) goto LA21;
break;
	case 27: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3712))) goto LA7;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3717))) goto LA10;
break;
	case 29: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3724))) goto LA16;
break;
	case 31: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3714))) goto LA8;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3720))) goto LA12;
break;
	}
	goto LA28;
	LA6: ;
	{
		gcmd_166134 = ((NU8) 1);
		commandcompiletoc_577071();
	}
	goto LA29;
	LA7: ;
	{
		gcmd_166134 = ((NU8) 2);
		definesymbol_198013(((NimStringDesc*) &TMP3712));
		commandcompiletoc_577071();
	}
	goto LA29;
	LA8: ;
	{
		gcmd_166134 = ((NU8) 3);
		definesymbol_198013(((NimStringDesc*) &TMP3714));
		commandcompiletoc_577071();
	}
	goto LA29;
	LA9: ;
	{
		gcmd_166134 = ((NU8) 19);
		rawmessage_193636(((NU16) 185), command_166240);
	}
	goto LA29;
	LA10: ;
	{
		gcmd_166134 = ((NU8) 4);
		commandcompiletojs_577132();
	}
	goto LA29;
	LA11: ;
	{
		wantmainmodule_575931();
		gcmd_166134 = ((NU8) 8);
		loadconfigs_220609(((NimStringDesc*) &TMP5009));
		commanddoc_386360();
	}
	goto LA29;
	LA12: ;
	{
		gcmd_166134 = ((NU8) 8);
		loadconfigs_220609(((NimStringDesc*) &TMP5009));
		definesymbol_198013(((NimStringDesc*) &TMP5140));
		commanddoc2_577060();
	}
	goto LA29;
	LA13: ;
	{
		gcmd_166134 = ((NU8) 16);
		loadconfigs_220609(((NimStringDesc*) &TMP5009));
		commandrst2html_386400();
	}
	goto LA29;
	LA14: ;
	{
		gcmd_166134 = ((NU8) 17);
		loadconfigs_220609(((NimStringDesc*) &TMP5146));
		commandrst2tex_386408();
	}
	goto LA29;
	LA15: ;
	{
		wantmainmodule_575931();
		gcmd_166134 = ((NU8) 8);
		loadconfigs_220609(((NimStringDesc*) &TMP5009));
		wantmainmodule_575931();
		definesymbol_198013(((NimStringDesc*) &TMP5140));
		commandjson_386416();
	}
	goto LA29;
	LA16: ;
	{
		gcmd_166134 = ((NU8) 8);
		loadconfigs_220609(((NimStringDesc*) &TMP5009));
		commandbuildindex_386452();
	}
	goto LA29;
	LA17: ;
	{
		gcmd_166134 = ((NU8) 9);
		commandgendepend_577041();
	}
	goto LA29;
	LA18: ;
	{
		gcmd_166134 = ((NU8) 10);
		{
			NimStringDesc* LOC45;
			Jsonnodeobj324754* definedsymbols;
			Jsonnodeobj324754* libpaths;
			Jsonnodeobj324754* dumpdata;
			TY578027 LOC66;
			NimStringDesc* LOC67;
			LOC45 = 0;
			LOC45 = getconfigvar_166335(((NimStringDesc*) &TMP5219));
			if (!eqStrings(LOC45, ((NimStringDesc*) &TMP5220))) goto LA46;
			wantmainmodule_575931();
			definedsymbols = newjarray_324956();
			{
				NimStringDesc* s_578002;
				s_578002 = 0;
				{
					NimStringDesc* key_578406;
					NimStringDesc* val_578408;
					key_578406 = 0;
					val_578408 = 0;
					{
						NI h_578410;
						NI HEX3Atmp_578412;
						NI res_578414;
						h_578410 = 0;
						HEX3Atmp_578412 = 0;
						HEX3Atmp_578412 = ((*gsymbols_198004).data ? ((*gsymbols_198004).data->Sup.len-1) : -1);
						res_578414 = ((NI) 0);
						{
							while (1) {
								if (!(res_578414 <= HEX3Atmp_578412)) goto LA52;
								h_578410 = res_578414;
								{
									if (!!((*gsymbols_198004).data->data[h_578410].Field0 == 0)) goto LA55;
									key_578406 = (*gsymbols_198004).data->data[h_578410].Field0;
									val_578408 = (*gsymbols_198004).data->data[h_578410].Field1;
									{
										Jsonnodeobj324754* LOC61;
										if (!!(eqStrings(val_578408, ((NimStringDesc*) &TMP5221)))) goto LA59;
										s_578002 = key_578406;
										LOC61 = 0;
										LOC61 = HEX25_325205(s_578002);
										(*definedsymbols).kindU.S7.elems = (TY324774*) incrSeqV2(&((*definedsymbols).kindU.S7.elems)->Sup, sizeof(Jsonnodeobj324754*));
										asgnRefNoCycle((void**) (&(*definedsymbols).kindU.S7.elems->data[(*definedsymbols).kindU.S7.elems->Sup.len]), LOC61);
										++(*definedsymbols).kindU.S7.elems->Sup.len;
									}
									LA59: ;
								}
								LA55: ;
								res_578414 += ((NI) 1);
							} LA52: ;
						}
					}
				}
			}
			libpaths = newjarray_324956();
			{
				NimStringDesc* dir_578015;
				Tstrentry140024* it_578420;
				dir_578015 = 0;
				it_578420 = ((Tstrentry140024*) (searchpaths_166136.head));
				{
					while (1) {
						Jsonnodeobj324754* LOC65;
						if (!!((it_578420 == NIM_NIL))) goto LA64;
						dir_578015 = (*it_578420).data;
						LOC65 = 0;
						LOC65 = HEX25_325205(dir_578015);
						(*libpaths).kindU.S7.elems = (TY324774*) incrSeqV2(&((*libpaths).kindU.S7.elems)->Sup, sizeof(Jsonnodeobj324754*));
						asgnRefNoCycle((void**) (&(*libpaths).kindU.S7.elems->data[(*libpaths).kindU.S7.elems->Sup.len]), LOC65);
						++(*libpaths).kindU.S7.elems->Sup.len;
						it_578420 = ((Tstrentry140024*) ((*it_578420).Sup.next));
					} LA64: ;
				}
			}
			memset((void*)LOC66, 0, sizeof(LOC66));
			LOC66[0].Field0 = copyString(((NimStringDesc*) &TMP5222));
			LOC66[0].Field1 = HEX25_325205(((NimStringDesc*) &TMP5223));
			LOC66[1].Field0 = copyString(((NimStringDesc*) &TMP5224));
			LOC66[1].Field1 = HEX25_325205(gprojectfull_166236);
			LOC66[2].Field0 = copyString(((NimStringDesc*) &TMP5225));
			LOC66[2].Field1 = definedsymbols;
			LOC66[3].Field0 = copyString(((NimStringDesc*) &TMP5226));
			LOC66[3].Field1 = libpaths;
			dumpdata = HEX25_325281(LOC66, 4);
			LOC67 = 0;
			LOC67 = HEX24_329129(dumpdata);
			msgwriteln_190915(LOC67, 3);
		}
		goto LA43;
		LA46: ;
		{
			msgwriteln_190915(((NimStringDesc*) &TMP5229), 3);
			{
				NimStringDesc* s_578044;
				s_578044 = 0;
				{
					NimStringDesc* key_578426;
					NimStringDesc* val_578428;
					key_578426 = 0;
					val_578428 = 0;
					{
						NI h_578430;
						NI HEX3Atmp_578432;
						NI res_578434;
						h_578430 = 0;
						HEX3Atmp_578432 = 0;
						HEX3Atmp_578432 = ((*gsymbols_198004).data ? ((*gsymbols_198004).data->Sup.len-1) : -1);
						res_578434 = ((NI) 0);
						{
							while (1) {
								if (!(res_578434 <= HEX3Atmp_578432)) goto LA73;
								h_578430 = res_578434;
								{
									if (!!((*gsymbols_198004).data->data[h_578430].Field0 == 0)) goto LA76;
									key_578426 = (*gsymbols_198004).data->data[h_578430].Field0;
									val_578428 = (*gsymbols_198004).data->data[h_578430].Field1;
									{
										if (!!(eqStrings(val_578428, ((NimStringDesc*) &TMP5221)))) goto LA80;
										s_578044 = key_578426;
										msgwriteln_190915(s_578044, 3);
									}
									LA80: ;
								}
								LA76: ;
								res_578434 += ((NI) 1);
							} LA73: ;
						}
					}
				}
			}
			msgwriteln_190915(((NimStringDesc*) &TMP5230), 3);
			{
				NimStringDesc* it_578047;
				Tstrentry140024* it_578440;
				it_578047 = 0;
				it_578440 = ((Tstrentry140024*) (searchpaths_166136.head));
				{
					while (1) {
						if (!!((it_578440 == NIM_NIL))) goto LA84;
						it_578047 = (*it_578440).data;
						msgwriteln_190915(it_578047, 0);
						it_578440 = ((Tstrentry140024*) ((*it_578440).Sup.next));
					} LA84: ;
				}
			}
		}
		LA43: ;
	}
	goto LA29;
	LA19: ;
	{
		gcmd_166134 = ((NU8) 11);
		commandcheck_577049();
	}
	goto LA29;
	LA20: ;
	{
		Tnode224809* LOC87;
		gcmd_166134 = ((NU8) 12);
		wantmainmodule_575931();
		LOC87 = 0;
		LOC87 = parsefile_252041(gprojectmainidx_166238);
	}
	goto LA29;
	LA21: ;
	{
		gcmd_166134 = ((NU8) 13);
		wantmainmodule_575931();
		commandscan_577278();
		msgwriteln_190915(((NimStringDesc*) &TMP5234), 0);
	}
	goto LA29;
	LA22: ;
	{
		gcmd_166134 = ((NU8) 18);
		commandinteractive_577207();
	}
	goto LA29;
	LA23: ;
	{
		NimStringDesc* LOC91;
		LOC91 = 0;
		LOC91 = maincommandarg_166308();
		commandeval_577256(LOC91);
	}
	goto LA29;
	LA24: ;
	{
		resetmemory_577338();
	}
	goto LA29;
	LA25: ;
	{
		gcmd_166134 = ((NU8) 14);
		{
			if (!!(((gevalexpr_166144) && (gevalexpr_166144)->Sup.len == 0))) goto LA96;
			commandeval_577256(gevalexpr_166144);
		}
		goto LA94;
		LA96: ;
		{
			commandsuggest_577325();
		}
		LA94: ;
	}
	goto LA29;
	LA26: ;
	{
		isserving_166147 = NIM_TRUE;
		gglobaloptions_166132 |= ((NU32)1)<<((((NU8) 15))%(sizeof(NU32)*8));
		gerrormax_190402 = ((NI) 2147483647);
		serve_574254(maincommand_577628);
	}
	goto LA29;
	LA27: ;
	{
		gcmd_166134 = ((NU8) 10);
	}
	goto LA29;
	LA28: ;
	{
		rawmessage_193636(((NU16) 185), command_166240);
	}
	LA29: ;
	{
		NIM_BOOL LOC104;
		TY193829 LOC108;
		NF LOC109;
		NI LOC110;
		LOC104 = 0;
		LOC104 = (gerrorcounter_190399 == ((NI) 0));
		if (!(LOC104)) goto LA105;
		LOC104 = !(((525376 &(1<<((gcmd_166134)&31)))!=0));
		LA105: ;
		if (!LOC104) goto LA106;
		memset((void*)LOC108, 0, sizeof(LOC108));
		LOC108[0] = nimIntToStr(glinescompiled_215213);
		LOC109 = 0;
		LOC109 = ntepochTime();
		LOC108[1] = nsuformatFloat(((NF)(LOC109) - (NF)(glastcmdtime_166145)), ((NU8) 1), ((NI) 3), 46);
		LOC110 = 0;
		LOC110 = gettotalmem_9095();
		LOC108[2] = formatsize_105404(((NI64) (LOC110)), 46);
		{
			NIM_BOOL LOC113;
			LOC113 = 0;
			LOC113 = isdefined_198031(((NimStringDesc*) &TMP5276));
			if (!LOC113) goto LA114;
			LOC108[3] = copyString(((NimStringDesc*) &TMP5277));
		}
		goto LA111;
		LA114: ;
		{
			LOC108[3] = copyString(((NimStringDesc*) &TMP5278));
		}
		LA111: ;
		rawmessage_192675(((NU16) 269), LOC108, 4);
	}
	LA106: ;
	resetattributes_193648();
}
NIM_EXTERNC N_NOINLINE(void, compiler_mainInit000)(void) {
}

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

