/* Generated by Nim Compiler v0.13.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 Tlinkedlist135016 Tlinkedlist135016;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tlistentry135010 Tlistentry135010;
typedef struct Tpass262014 Tpass262014;
typedef struct Tpasscontext262002 Tpasscontext262002;
typedef struct Tsym215822 Tsym215822;
typedef struct Trodreader253021 Trodreader253021;
typedef struct Tnode215790 Tnode215790;
typedef struct Cell47505 Cell47505;
typedef struct TNimType TNimType;
typedef struct Cellseq47521 Cellseq47521;
typedef struct Gcheap49818 Gcheap49818;
typedef struct Gcstack49816 Gcstack49816;
typedef struct Cellset47517 Cellset47517;
typedef struct Pagedesc47513 Pagedesc47513;
typedef struct Memregion29688 Memregion29688;
typedef struct Smallchunk29640 Smallchunk29640;
typedef struct Llchunk29682 Llchunk29682;
typedef struct Bigchunk29642 Bigchunk29642;
typedef struct Intset29614 Intset29614;
typedef struct Trunk29610 Trunk29610;
typedef struct Avlnode29686 Avlnode29686;
typedef struct Gcstat49814 Gcstat49814;
typedef struct TY532042 TY532042;
typedef struct Tmoduleinmemory532008 Tmoduleinmemory532008;
typedef struct TY215913 TY215913;
typedef struct Jsonnodeobj307633 Jsonnodeobj307633;
typedef struct Stringtableobj140209 Stringtableobj140209;
typedef struct TNimObject TNimObject;
typedef struct TNimNode TNimNode;
typedef struct Keyvaluepairseq140207 Keyvaluepairseq140207;
typedef struct Keyvaluepair140205 Keyvaluepair140205;
typedef struct TY307648 TY307648;
typedef struct TY307653 TY307653;
typedef struct Tstrentry135012 Tstrentry135012;
typedef struct TY308043 TY308043;
typedef struct Tllstream203204 Tllstream203204;
typedef struct Tlexer206173 Tlexer206173;
typedef struct Tbaselexer204015 Tbaselexer204015;
typedef struct Tlineinfo183337 Tlineinfo183337;
typedef struct Ttoken206169 Ttoken206169;
typedef struct Tident190012 Tident190012;
typedef struct TY125202 TY125202;
typedef struct Tidobj190006 Tidobj190006;
typedef struct Ttypeseq215824 Ttypeseq215824;
typedef struct Tscope215816 Tscope215816;
typedef struct TY215925 TY215925;
typedef struct Tstrtable215794 Tstrtable215794;
typedef struct Tsymseq215792 Tsymseq215792;
typedef struct Ttype215828 Ttype215828;
typedef struct Tloc215804 Tloc215804;
typedef struct Ropeobj170006 Ropeobj170006;
typedef struct Tlib215808 Tlib215808;
typedef struct Tindex253019 Tindex253019;
typedef struct Tiitable222163 Tiitable222163;
typedef struct Tiipairseq222161 Tiipairseq222161;
typedef struct Table253054 Table253054;
typedef struct Keyvaluepairseq253057 Keyvaluepairseq253057;
typedef struct Memfile251202 Memfile251202;
typedef struct Tnodeseq215784 Tnodeseq215784;
typedef struct Basechunk29638 Basechunk29638;
typedef struct Freecell29630 Freecell29630;
typedef struct Tinstantiation215812 Tinstantiation215812;
typedef struct Tiipair222159 Tiipair222159;
typedef struct Keyvaluepair253060 Keyvaluepair253060;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tlinkedlist135016  {
Tlistentry135010* head;
Tlistentry135010* tail;
NI counter;
};
typedef N_NIMCALL_PTR(Tpasscontext262002*, Tpassopen262006) (Tsym215822* module);
typedef N_NIMCALL_PTR(Tpasscontext262002*, Tpassopencached262008) (Tsym215822* module, Trodreader253021* rd);
typedef N_NIMCALL_PTR(Tnode215790*, Tpassprocess262012) (Tpasscontext262002* p, Tnode215790* toplevelstmt);
typedef N_NIMCALL_PTR(Tnode215790*, Tpassclose262010) (Tpasscontext262002* p, Tnode215790* n);
struct Tpass262014 {
Tpassopen262006 Field0;
Tpassopencached262008 Field1;
Tpassprocess262012 Field2;
Tpassclose262010 Field3;
};
struct  Cell47505  {
NI refcount;
TNimType* typ;
};
struct  Cellseq47521  {
NI len;
NI cap;
Cell47505** d;
};
struct  Cellset47517  {
NI counter;
NI max;
Pagedesc47513* head;
Pagedesc47513** data;
};
typedef Smallchunk29640* TY29703[512];
typedef Trunk29610* Trunkbuckets29612[256];
struct  Intset29614  {
Trunkbuckets29612 data;
};
struct  Memregion29688  {
NI minlargeobj;
NI maxlargeobj;
TY29703 freesmallchunks;
Llchunk29682* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk29642* freechunkslist;
Intset29614 chunkstarts;
Avlnode29686* root;
Avlnode29686* deleted;
Avlnode29686* last;
Avlnode29686* freeavlnodes;
};
struct  Gcstat49814  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap49818  {
Gcstack49816* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq47521 zct;
Cellseq47521 decstack;
Cellset47517 cycleroots;
Cellseq47521 tempstack;
NI recgclock;
Memregion29688 region;
Gcstat49814 stat;
};
typedef NU8 Sha1digest193003[20];
struct  Tmoduleinmemory532008  {
NF compiledat;
Sha1digest193003 hash;
TY215913* deps;
NU8 needsrecompile;
NU8 hashstatus;
};
typedef N_NIMCALL_PTR(void, TY3489) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3494) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3489 marker;
TY3494 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Stringtableobj140209  {
  TNimObject Sup;
NI counter;
Keyvaluepairseq140207* data;
NU8 mode;
};
struct Keyvaluepair140205 {
NimStringDesc* Field0;
NimStringDesc* Field1;
};
struct  Jsonnodeobj307633  {
NU8 kind;
union{
struct {NimStringDesc* str;
} S1;
struct {NI64 num;
} S2;
struct {NF fnum;
} S3;
struct {NIM_BOOL bval;
} S4;
struct {TY307648* fields;
} S6;
struct {TY307653* elems;
} S7;
} kindU;
};
struct  Tlistentry135010  {
  TNimObject Sup;
Tlistentry135010* prev;
Tlistentry135010* next;
};
struct  Tstrentry135012  {
  Tlistentry135010 Sup;
NimStringDesc* data;
};
struct TY308043 {
NimStringDesc* Field0;
Jsonnodeobj307633* Field1;
};
typedef TY308043 TY534027[4];
struct  Tbaselexer204015  {
  TNimObject Sup;
NI bufpos;
NCSTRING buf;
NI buflen;
Tllstream203204* stream;
NI linenumber;
NI sentinel;
NI linestart;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (Tlineinfo183337 info, NU16 msg, NimStringDesc* arg, void* ClEnv);
void* ClEnv;
} Terrorhandler206171;
struct  Tlexer206173  {
  Tbaselexer204015 Sup;
NI32 fileidx;
NI indentahead;
NI currlineindent;
NIM_BOOL strongspaces;
Terrorhandler206171 errorhandler;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Ttoken206169  {
NU8 toktype;
NI indent;
Tident190012* ident;
NI64 inumber;
NF fnumber;
NU8 base;
NI8 strongspacea;
NI8 strongspaceb;
NimStringDesc* literal;
NI line;
NI col;
};
struct  Tidobj190006  {
  TNimObject Sup;
NI id;
};
struct  Tstrtable215794  {
NI counter;
Tsymseq215792* data;
};
struct  Tlineinfo183337  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tloc215804  {
NU8 k;
NU8 s;
NU16 flags;
Ttype215828* t;
Ropeobj170006* r;
Ropeobj170006* heaproot;
};
struct  Tsym215822  {
  Tidobj190006 Sup;
NU8 kind;
union{
struct {Ttypeseq215824* typeinstcache;
Tscope215816* typscope;
} S1;
struct {TY215925* procinstcache;
Tsym215822* gcunsafetyreason;
} S2;
struct {TY215925* usedgenerics;
Tstrtable215794 tab;
} S3;
struct {Tsym215822* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype215828* typ;
Tident190012* name;
Tlineinfo183337 info;
Tsym215822* owner;
NU32 flags;
Tnode215790* ast;
NU32 options;
NI position;
NI offset;
Tloc215804 loc;
Tlib215808* annex;
Tnode215790* constraint;
};
typedef Tpass262014 TY533229[3];
typedef Tident190012* TY190023[8192];
typedef N_NIMCALL_PTR(void, TY531238) (void);
typedef NimStringDesc* TY186781[4];
struct  Tpasscontext262002  {
  TNimObject Sup;
NIM_BOOL fromcache;
};
struct  Tiitable222163  {
NI counter;
Tiipairseq222161* data;
};
struct  Tindex253019  {
NI lastidxkey;
NI lastidxval;
Tiitable222163 tab;
NimStringDesc* r;
NI offset;
};
struct  Table253054  {
Keyvaluepairseq253057* data;
NI counter;
};
struct  Memfile251202  {
void* mem;
NI size;
int handle;
};
struct  Trodreader253021  {
  TNimObject Sup;
NI pos;
NCSTRING s;
NU32 options;
NU8 reason;
TY215913* moddeps;
TY215913* files;
NI dataidx;
NI convertersidx;
NI initidx;
NI interfidx;
NI compilerprocsidx;
NI methodsidx;
NimStringDesc* filename;
Tindex253019 index;
Tindex253019 imports;
NI readerindex;
NI line;
NI moduleid;
Table253054 syms;
Memfile251202 memfile;
Tsymseq215792* methods;
NimStringDesc* origfile;
NIM_BOOL inviewmode;
};
struct  Tnode215790  {
Ttype215828* typ;
Tlineinfo183337 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym215822* sym;
} S4;
struct {Tident190012* ident;
} S5;
struct {Tnodeseq215784* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Gcstack49816  {
Gcstack49816* prev;
Gcstack49816* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY29619[8];
struct  Pagedesc47513  {
Pagedesc47513* next;
NI key;
TY29619 bits;
};
struct  Basechunk29638  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk29640  {
  Basechunk29638 Sup;
Smallchunk29640* next;
Smallchunk29640* prev;
Freecell29630* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk29682  {
NI size;
NI acc;
Llchunk29682* next;
};
struct  Bigchunk29642  {
  Basechunk29638 Sup;
Bigchunk29642* next;
Bigchunk29642* prev;
NI align;
NF data;
};
struct  Trunk29610  {
Trunk29610* next;
NI key;
TY29619 bits;
};
typedef Avlnode29686* TY29693[2];
struct  Avlnode29686  {
TY29693 link;
NI key;
NI upperbound;
NI level;
};
struct  Tllstream203204  {
  TNimObject Sup;
NU8 kind;
FILE* f;
NimStringDesc* s;
NI rd;
NI wr;
NI lineoffset;
};
struct  Tident190012  {
  Tidobj190006 Sup;
NimStringDesc* s;
Tident190012* next;
NI h;
};
struct  Tscope215816  {
NI depthlevel;
Tstrtable215794 symbols;
Tnodeseq215784* usingsyms;
Tscope215816* parent;
};
struct  Ttype215828  {
  Tidobj190006 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq215824* sons;
Tnode215790* n;
Tsym215822* owner;
Tsym215822* sym;
Tsym215822* destructor;
Tsym215822* deepcopy;
Tsym215822* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc215804 loc;
};
struct  Ropeobj170006  {
  TNimObject Sup;
Ropeobj170006* left;
Ropeobj170006* right;
NI length;
NimStringDesc* data;
};
struct  Tlib215808  {
  Tlistentry135010 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj170006* name;
Tnode215790* path;
};
struct  Tiipair222159  {
NI key;
NI val;
};
struct Keyvaluepair253060 {
NI Field0;
NI Field1;
Tsym215822* Field2;
};
struct  Freecell29630  {
Freecell29630* next;
NI zerofield;
};
struct  Tinstantiation215812  {
Tsym215822* sym;
Ttypeseq215824* concretetypes;
TY215913* usedby;
NI compilesid;
};
struct TY532042 {
  TGenericSeq Sup;
  Tmoduleinmemory532008 data[SEQ_DECL_SIZE];
};
struct TY307653 {
  TGenericSeq Sup;
  Jsonnodeobj307633* data[SEQ_DECL_SIZE];
};
struct TY125202 {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct Tsymseq215792 {
  TGenericSeq Sup;
  Tsym215822* data[SEQ_DECL_SIZE];
};
struct TY215913 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq140207 {
  TGenericSeq Sup;
  Keyvaluepair140205 data[SEQ_DECL_SIZE];
};
struct TY307648 {
  TGenericSeq Sup;
  TY308043 data[SEQ_DECL_SIZE];
};
struct Ttypeseq215824 {
  TGenericSeq Sup;
  Ttype215828* data[SEQ_DECL_SIZE];
};
struct TY215925 {
  TGenericSeq Sup;
  Tinstantiation215812* data[SEQ_DECL_SIZE];
};
struct Tiipairseq222161 {
  TGenericSeq Sup;
  Tiipair222159 data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq253057 {
  TGenericSeq Sup;
  Keyvaluepair253060 data[SEQ_DECL_SIZE];
};
struct Tnodeseq215784 {
  TGenericSeq Sup;
  Tnode215790* data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, clearpasses_262143)(void);
N_NIMCALL(NF, ntepochTime)(void);
N_NIMCALL(void, appendstr_135244)(Tlinkedlist135016* list, NimStringDesc* data);
N_NIMCALL(void, prependstr_135413)(Tlinkedlist135016* list, NimStringDesc* data);
static N_INLINE(void, setid_214425)(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_533029)(void);
N_NIMCALL(void, initvars_195834)(void);
N_NIMCALL(void, semanticpasses_533015)(void);
N_NIMCALL(void, registerpass_262145)(Tpass262014* p);
N_NIMCALL(Tpasscontext262002*, verboseopen_514003)(Tsym215822* s);
N_NIMCALL(Tnode215790*, verboseprocess_514008)(Tpasscontext262002* context, Tnode215790* n);
N_NIMCALL(Tpasscontext262002*, myopen_468665)(Tsym215822* module);
N_NIMCALL(Tpasscontext262002*, myopencached_468696)(Tsym215822* module, Trodreader253021* rd);
N_NIMCALL(Tnode215790*, myprocess_468804)(Tpasscontext262002* context, Tnode215790* n);
N_NIMCALL(Tnode215790*, myclose_468814)(Tpasscontext262002* context, Tnode215790* n);
N_NIMCALL(Tpasscontext262002*, myopen_504712)(Tsym215822* module);
N_NIMCALL(Tpasscontext262002*, myopencached_504836)(Tsym215822* module, Trodreader253021* rd);
N_NIMCALL(Tnode215790*, myprocess_505002)(Tpasscontext262002* b, Tnode215790* n);
N_NIMCALL(Tnode215790*, myclose_505430)(Tpasscontext262002* b, Tnode215790* n);
N_NIMCALL(void, rodpass_533001)(void);
N_NIMCALL(Tpasscontext262002*, myopen_274918)(Tsym215822* module);
N_NIMCALL(Tnode215790*, process_274698)(Tpasscontext262002* c, Tnode215790* n);
N_NIMCALL(Tnode215790*, myclose_274927)(Tpasscontext262002* c, Tnode215790* n);
N_NIMCALL(void, compileproject_532877)(NI32 projectfileidx);
N_NIMCALL(void, cgenwritemodules_505492)(void);
N_NIMCALL(void, callccompiler_196510)(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(Cell47505*, usrtocell_51440)(void* usr);
static N_INLINE(void, rtladdzct_53001)(Cell47505* c);
N_NOINLINE(void, addzct_51417)(Cellseq47521* s, Cell47505* c);
N_NIMCALL(void, resetcgenmodules_504624)(void);
N_NIMCALL(void, resetcompilationlists_195867)(void);
N_NIMCALL(void, resetcaches_469424)(void);
N_NIMCALL(void, Gcfullcollect_9805)(void);
N_NIMCALL(void, definesymbol_191004)(NimStringDesc* symbol);
N_NIMCALL(void, rawmessage_186612)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, commandcompiletojs_533074)(void);
N_NIMCALL(void, settarget_168623)(NU8 o, NU8 c);
N_NIMCALL(Tpasscontext262002*, myopen_513129)(Tsym215822* s);
N_NIMCALL(Tpasscontext262002*, myopencached_513124)(Tsym215822* s, Trodreader253021* rd);
N_NIMCALL(Tnode215790*, myprocess_513028)(Tpasscontext262002* b, Tnode215790* n);
N_NIMCALL(Tnode215790*, myclose_513102)(Tpasscontext262002* b, Tnode215790* n);
N_NIMCALL(void, wantmainmodule_532871)(void);
N_NIMCALL(void, loadconfigs_211603)(NimStringDesc* cfg);
N_NIMCALL(void, commanddoc_362714)(void);
N_NIMCALL(void, commanddoc2_533024)(void);
N_NIMCALL(Tpasscontext262002*, myopen_516047)(Tsym215822* module);
N_NIMCALL(Tnode215790*, processnode_516041)(Tpasscontext262002* c, Tnode215790* n);
N_NIMCALL(Tnode215790*, close_516009)(Tpasscontext262002* p, Tnode215790* n);
N_NIMCALL(void, finishdoc2pass_516067)(NimStringDesc* project);
N_NIMCALL(void, commandrst2html_362742)(void);
N_NIMCALL(void, commandrst2tex_362744)(void);
N_NIMCALL(void, commandjson_362746)(void);
N_NIMCALL(void, commandbuildindex_362776)(void);
N_NIMCALL(void, commandgendepend_533017)(void);
N_NIMCALL(Tpasscontext262002*, myopen_515078)(Tsym215822* module);
N_NIMCALL(Tnode215790*, adddotdependency_515020)(Tpasscontext262002* c, Tnode215790* n);
N_NIMCALL(Tnode215790*, cleanup_514036)(Tpasscontext262002* c, Tnode215790* n);
N_NIMCALL(void, generatedot_515003)(NimStringDesc* project);
N_NIMCALL(void, execexternalprogram_195881)(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_161282)(NimStringDesc* key);
N_NIMCALL(Jsonnodeobj307633*, newjarray_307781)(void);
N_NIMCALL(Jsonnodeobj307633*, HEX25_307988)(NimStringDesc* s);
N_NIMCALL(TGenericSeq*, incrSeqV2)(TGenericSeq* seq, NI elemsize);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(Jsonnodeobj307633*, HEX25_308040)(TY308043* keyvals, NI keyvalsLen0);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(void, msgwriteln_184449)(NimStringDesc* s, NU8 flags);
N_NIMCALL(NimStringDesc*, HEX24_311805)(Jsonnodeobj307633* node);
N_NIMCALL(void, commandcheck_533019)(void);
N_NIMCALL(Tnode215790*, parsefile_239029)(NI32 fileidx);
N_NIMCALL(void, commandscan_533251)(void);
N_NIMCALL(NimStringDesc*, nosaddFileExt)(NimStringDesc* filename, NimStringDesc* ext);
N_NIMCALL(NimStringDesc*, maincommandarg_161267)(void);
N_NIMCALL(Tllstream203204*, llstreamopen_203241)(NimStringDesc* filename, NU8 mode);
N_NIMCALL(void, inittoken_206306)(Ttoken206169* L);
N_NIMCALL(void, openlexer_206329)(Tlexer206173* lex, NimStringDesc* filename, Tllstream203204* inputstream);
N_NIMCALL(void, rawgettok_209824)(Tlexer206173* L, Ttoken206169* tok);
N_NIMCALL(void, printtok_206301)(Ttoken206169* tok);
N_NIMCALL(void, closelexer_206335)(Tlexer206173* lex);
N_NIMCALL(void, commandinteractive_533201)(void);
N_NIMCALL(void, interactivepasses_533076)(void);
N_NIMCALL(void, initdefines_191184)(void);
N_NIMCALL(Tpasscontext262002*, myopen_415030)(Tsym215822* module);
N_NIMCALL(Tnode215790*, myprocess_415203)(Tpasscontext262002* c, Tnode215790* n);
N_NIMCALL(void, compilesystemmodule_532856)(void);
N_NIMCALL(Tsym215822*, compilemodule_532695)(NI32 fileidx, NU32 flags);
N_NIMCALL(NI32, fileinfoidx_184016)(NimStringDesc* filename);
N_NIMCALL(Tsym215822*, makestdinmodule_532889)(void);
N_NIMCALL(void, processmodule_262044)(Tsym215822* module, Tllstream203204* stream, Trodreader253021* rd);
N_NIMCALL(Tllstream203204*, llstreamopenstdin_203266)(void);
N_NIMCALL(void, commandeval_533235)(NimStringDesc* exp);
N_NIMCALL(void, evalnim_533231)(Tnode215790* nodes, Tsym215822* module);
N_NIMCALL(void, carrypasses_262174)(Tnode215790* nodes, Tsym215822* module, Tpass262014* passes, NI passesLen0);
N_NIMCALL(Tnode215790*, parsestring_232536)(NimStringDesc* s, NimStringDesc* filename, NI line, Terrorhandler206171 errorhandler);
N_NIMCALL(void, resetmemory_533293)(void);
N_NIMCALL(void, resetallmodules_532318)(void);
N_NIMCALL(void, resetropecache_170075)(void);
N_NIMCALL(void, resetsystypes_259199)(void);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
N_NIMCALL(void, commandsuggest_533286)(void);
N_NIMCALL(void, resetmodule_532258)(NI32 fileidx);
N_NIMCALL(void, serve_531236)(TY531238 action);
N_NIMCALL(void, maincommand_533610)(void);
N_NIMCALL(void, rawmessage_185645)(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_102497)(NI64 bytes, NIM_CHAR decimalsep);
N_NIMCALL(NI, gettotalmem_8059)(void);
N_NIMCALL(NIM_BOOL, isdefined_191010)(NimStringDesc* symbol);
N_NIMCALL(void, resetattributes_186618)(void);
STRING_LITERAL(TMP3724, "c", 1);
STRING_LITERAL(TMP3725, "cc", 2);
STRING_LITERAL(TMP3726, "compile", 7);
STRING_LITERAL(TMP3727, "compiletoc", 10);
STRING_LITERAL(TMP3728, "cpp", 3);
STRING_LITERAL(TMP3729, "compiletocpp", 12);
STRING_LITERAL(TMP3730, "objc", 4);
STRING_LITERAL(TMP3731, "compiletooc", 11);
STRING_LITERAL(TMP3732, "run", 3);
STRING_LITERAL(TMP3733, "js", 2);
STRING_LITERAL(TMP3734, "compiletojs", 11);
STRING_LITERAL(TMP3735, "doc", 3);
STRING_LITERAL(TMP3736, "doc2", 4);
STRING_LITERAL(TMP3737, "rst2html", 8);
STRING_LITERAL(TMP3738, "rst2tex", 7);
STRING_LITERAL(TMP3739, "jsondoc", 7);
STRING_LITERAL(TMP3740, "buildindex", 10);
STRING_LITERAL(TMP3741, "gendepend", 9);
STRING_LITERAL(TMP3742, "dump", 4);
STRING_LITERAL(TMP3743, "check", 5);
STRING_LITERAL(TMP3744, "parse", 5);
STRING_LITERAL(TMP3745, "scan", 4);
STRING_LITERAL(TMP3746, "secret", 6);
STRING_LITERAL(TMP3747, "e", 1);
STRING_LITERAL(TMP3748, "reset", 5);
STRING_LITERAL(TMP3749, "idetools", 8);
STRING_LITERAL(TMP3750, "serve", 5);
STRING_LITERAL(TMP3751, "nop", 3);
STRING_LITERAL(TMP3752, "help", 4);
STRING_LITERAL(TMP4633, "", 0);
STRING_LITERAL(TMP4634, "nimrod", 6);
STRING_LITERAL(TMP4635, "ecmascript", 10);
STRING_LITERAL(TMP5030, "nimdoc.cfg", 10);
STRING_LITERAL(TMP5161, "nimdoc", 6);
STRING_LITERAL(TMP5167, "nimdoc.tex.cfg", 14);
STRING_LITERAL(TMP5237, "dot -Tpng -o", 12);
STRING_LITERAL(TMP5238, "png", 3);
STRING_LITERAL(TMP5239, "dot", 3);
STRING_LITERAL(TMP5240, "dump.format", 11);
STRING_LITERAL(TMP5241, "json", 4);
STRING_LITERAL(TMP5242, "false", 5);
STRING_LITERAL(TMP5243, "version", 7);
STRING_LITERAL(TMP5244, "0.13.0", 6);
STRING_LITERAL(TMP5245, "project_path", 12);
STRING_LITERAL(TMP5246, "defined_symbols", 15);
STRING_LITERAL(TMP5247, "lib_paths", 9);
STRING_LITERAL(TMP5250, "-- list of currently defined symbols --", 39);
STRING_LITERAL(TMP5251, "-- end of list --", 17);
STRING_LITERAL(TMP5252, "nim", 3);
STRING_LITERAL(TMP5255, "Beware: Indentation tokens depend on the parser\'s state!", 56);
STRING_LITERAL(TMP5256, "nimscript", 9);
STRING_LITERAL(TMP5258, "echo \"eval\\t\", repr(", 20);
STRING_LITERAL(TMP5259, ")", 1);
static NIM_CONST Terrorhandler206171 TMP5260 = {NIM_NIL,NIM_NIL};
STRING_LITERAL(TMP5297, "release", 7);
STRING_LITERAL(TMP5298, "Release Build", 13);
STRING_LITERAL(TMP5299, "Debug Build", 11);
extern NF glastcmdtime_161134;
extern Tlinkedlist135016 searchpaths_161125;
extern NimStringDesc* libpath_161198;
extern NimStringDesc* gprojectfull_161201;
extern NimStringDesc* gprojectpath_161200;
extern NI gfrontendid_214003;
extern NimStringDesc* command_161205;
extern NU8 gcmd_161123;
extern NU32 gglobaloptions_161121;
extern NIM_BOOL isserving_161136;
extern NimStringDesc* lastcaascmd_531202;
extern NimStringDesc* curcaascmd_531201;
extern Gcheap49818 gch_49859;
extern TY532042* gmemcachedata_532059;
extern NI gerrormax_184081;
extern NimStringDesc* gprojectname_161199;
extern Stringtableobj140209* gsymbols_191001;
extern NI32 gprojectmainidx_161203;
extern TNimType NTI206173; /* TLexer */
extern TY125202* commandargs_161223;
extern Tsym215822* systemmodule_259007;
extern Tsymseq215792* gowners_265233;
extern TNimType NTI215792; /* TSymSeq */
extern TY190023 buckets_190024;
extern Tident190012* idanon_190455;
extern NimStringDesc* gevalexpr_161133;
extern Tlineinfo183337 gtrackpos_184441;
extern NI gerrorcounter_184078;
extern NI glinescompiled_206198;

static N_INLINE(void, setid_214425)(NI id) {
	gfrontendid_214003 = ((gfrontendid_214003 >= (NI)(id + ((NI) 1))) ? gfrontendid_214003 : (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_533015)(void) {
	Tpass262014 LOC1;
	Tpass262014 LOC2;
	LOC1.Field0 = verboseopen_514003;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = verboseprocess_514008;
	LOC1.Field3 = NIM_NIL;
	registerpass_262145((&LOC1));
	LOC2.Field0 = myopen_468665;
	LOC2.Field1 = myopencached_468696;
	LOC2.Field2 = myprocess_468804;
	LOC2.Field3 = myclose_468814;
	registerpass_262145((&LOC2));
}

N_NIMCALL(void, rodpass_533001)(void) {
	{
		Tpass262014 LOC5;
		if (!((gglobaloptions_161121 &(1U<<((NU)(((NU8) 14))&31U)))!=0)) goto LA3;
		LOC5.Field0 = myopen_274918;
		LOC5.Field1 = NIM_NIL;
		LOC5.Field2 = process_274698;
		LOC5.Field3 = myclose_274927;
		registerpass_262145((&LOC5));
	}
	LA3: ;
}

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

static N_INLINE(void, rtladdzct_53001)(Cell47505* c) {
	addzct_51417((&gch_49859.zct), c);
}

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

N_NIMCALL(void, commandcompiletoc_533029)(void) {
	Tpass262014 LOC1;
	initvars_195834();
	semanticpasses_533015();
	LOC1.Field0 = myopen_504712;
	LOC1.Field1 = myopencached_504836;
	LOC1.Field2 = myprocess_505002;
	LOC1.Field3 = myclose_505430;
	registerpass_262145((&LOC1));
	rodpass_533001();
	compileproject_532877(((NI32) -1));
	cgenwritemodules_505492();
	{
		NimStringDesc* LOC6;
		if (!!((gcmd_161123 == ((NU8) 19)))) goto LA4;
		LOC6 = 0;
		LOC6 = noschangeFileExt(gprojectfull_161201, ((NimStringDesc*) &TMP4633));
		callccompiler_196510(LOC6);
	}
	LA4: ;
	{
		NimStringDesc* LOC11;
		if (!isserving_161136) goto LA9;
		LOC11 = 0;
		LOC11 = lastcaascmd_531202; lastcaascmd_531202 = copyStringRC1(curcaascmd_531201);
		if (LOC11) nimGCunrefNoCycle(LOC11);
		resetcgenmodules_504624();
		{
			NI i_533065;
			NI HEX3Atmp_533067;
			NI res_533070;
			i_533065 = 0;
			HEX3Atmp_533067 = 0;
			HEX3Atmp_533067 = ((gmemcachedata_532059 ? gmemcachedata_532059->Sup.len : 0) - 1);
			res_533070 = ((NI) 0);
			{
				while (1) {
					if (!(res_533070 <= HEX3Atmp_533067)) goto LA14;
					i_533065 = res_533070;
					gmemcachedata_532059->data[i_533065].hashstatus = ((NU8) 1);
					gmemcachedata_532059->data[i_533065].needsrecompile = ((NU8) 0);
					res_533070 += ((NI) 1);
				} LA14: ;
			}
		}
		resetcompilationlists_195867();
		resetcaches_469424();
		Gcfullcollect_9805();
	}
	LA9: ;
}

N_NIMCALL(void, commandcompiletojs_533074)(void) {
	Tpass262014 LOC1;
	settarget_168623(((NU8) 22), ((NU8) 15));
	definesymbol_191004(((NimStringDesc*) &TMP4634));
	definesymbol_191004(((NimStringDesc*) &TMP4635));
	definesymbol_191004(((NimStringDesc*) &TMP3733));
	semanticpasses_533015();
	LOC1.Field0 = myopen_513129;
	LOC1.Field1 = myopencached_513124;
	LOC1.Field2 = myprocess_513028;
	LOC1.Field3 = myclose_513102;
	registerpass_262145((&LOC1));
	compileproject_532877(((NI32) -1));
}

N_NIMCALL(void, commanddoc2_533024)(void) {
	Tpass262014 LOC1;
	gerrormax_184081 = ((NI) IL64(9223372036854775807));
	semanticpasses_533015();
	LOC1.Field0 = myopen_516047;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = processnode_516041;
	LOC1.Field3 = close_516009;
	registerpass_262145((&LOC1));
	compileproject_532877(((NI32) -1));
	finishdoc2pass_516067(gprojectname_161199);
}

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_533017)(void) {
	Tpass262014 LOC1;
	Tpass262014 LOC2;
	NimStringDesc* LOC3;
	NimStringDesc* LOC4;
	NimStringDesc* LOC5;
	semanticpasses_533015();
	LOC1.Field0 = myopen_515078;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = adddotdependency_515020;
	LOC1.Field3 = NIM_NIL;
	registerpass_262145((&LOC1));
	LOC2.Field0 = NIM_NIL;
	LOC2.Field1 = NIM_NIL;
	LOC2.Field2 = cleanup_514036;
	LOC2.Field3 = cleanup_514036;
	registerpass_262145((&LOC2));
	compileproject_532877(((NI32) -1));
	generatedot_515003(gprojectfull_161201);
	LOC3 = 0;
	LOC4 = 0;
	LOC4 = noschangeFileExt(gprojectfull_161201, ((NimStringDesc*) &TMP5238));
	LOC5 = 0;
	LOC5 = noschangeFileExt(gprojectfull_161201, ((NimStringDesc*) &TMP5239));
	LOC3 = rawNewString(LOC4->Sup.len + LOC5->Sup.len + 13);
appendString(LOC3, ((NimStringDesc*) &TMP5237));
appendString(LOC3, LOC4);
appendChar(LOC3, 32);
appendString(LOC3, LOC5);
	execexternalprogram_195881(LOC3, ((NU16) 284));
}

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

N_NIMCALL(void, commandcheck_533019)(void) {
	gerrormax_184081 = ((NI) IL64(9223372036854775807));
	semanticpasses_533015();
	rodpass_533001();
	compileproject_532877(((NI32) -1));
}

N_NIMCALL(void, commandscan_533251)(void) {
	NimStringDesc* f;
	NimStringDesc* LOC1;
	Tllstream203204* stream;
	LOC1 = 0;
	LOC1 = maincommandarg_161267();
	f = nosaddFileExt(LOC1, ((NimStringDesc*) &TMP5252));
	stream = llstreamopen_203241(f, ((NU8) 0));
	{
		Tlexer206173 L;
		Ttoken206169 tok;
		if (!!((stream == NIM_NIL))) goto LA4;
		memset((void*)(&L), 0, sizeof(L));
		L.Sup.Sup.m_type = (&NTI206173);
		memset((void*)(&tok), 0, sizeof(tok));
		inittoken_206306((&tok));
		openlexer_206329((&L), f, stream);
		{
			while (1) {
				rawgettok_209824((&L), (&tok));
				printtok_206301((&tok));
				{
					if (!(tok.toktype == ((NU8) 1))) goto LA10;
					goto LA6;
				}
				LA10: ;
			}
		} LA6: ;
		closelexer_206335((&L));
	}
	goto LA2;
	LA4: ;
	{
		rawmessage_186612(((NU16) 3), f);
	}
	LA2: ;
}

N_NIMCALL(void, interactivepasses_533076)(void) {
	Tpass262014 LOC1;
	Tpass262014 LOC2;
	Tpass262014 LOC3;
	initdefines_191184();
	definesymbol_191004(((NimStringDesc*) &TMP5256));
	LOC1.Field0 = verboseopen_514003;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = verboseprocess_514008;
	LOC1.Field3 = NIM_NIL;
	registerpass_262145((&LOC1));
	LOC2.Field0 = myopen_468665;
	LOC2.Field1 = myopencached_468696;
	LOC2.Field2 = myprocess_468804;
	LOC2.Field3 = myclose_468814;
	registerpass_262145((&LOC2));
	LOC3.Field0 = myopen_415030;
	LOC3.Field1 = NIM_NIL;
	LOC3.Field2 = myprocess_415203;
	LOC3.Field3 = myprocess_415203;
	registerpass_262145((&LOC3));
}

N_NIMCALL(void, commandinteractive_533201)(void) {
	gerrormax_184081 = ((NI) IL64(9223372036854775807));
	interactivepasses_533076();
	compilesystemmodule_532856();
	{
		NI32 LOC5;
		Tsym215822* LOC6;
		if (!(((NI) 0) < (commandargs_161223 ? commandargs_161223->Sup.len : 0))) goto LA3;
		LOC5 = 0;
		LOC5 = fileinfoidx_184016(gprojectfull_161201);
		LOC6 = 0;
		LOC6 = compilemodule_532695(LOC5, 0);
	}
	goto LA1;
	LA3: ;
	{
		Tsym215822* m;
		Tllstream203204* LOC8;
		m = makestdinmodule_532889();
		(*m).flags |= ((NU32)1)<<((((NU8) 12))%(sizeof(NU32)*8));
		LOC8 = 0;
		LOC8 = llstreamopenstdin_203266();
		processmodule_262044(m, LOC8, NIM_NIL);
	}
	LA1: ;
}

N_NIMCALL(void, evalnim_533231)(Tnode215790* nodes, Tsym215822* module) {
	TY533229 LOC1;
	LOC1[0].Field0 = verboseopen_514003;
	LOC1[0].Field1 = NIM_NIL;
	LOC1[0].Field2 = verboseprocess_514008;
	LOC1[0].Field3 = NIM_NIL;
	LOC1[1].Field0 = myopen_468665;
	LOC1[1].Field1 = myopencached_468696;
	LOC1[1].Field2 = myprocess_468804;
	LOC1[1].Field3 = myclose_468814;
	LOC1[2].Field0 = myopen_415030;
	LOC1[2].Field1 = NIM_NIL;
	LOC1[2].Field2 = myprocess_415203;
	LOC1[2].Field3 = myprocess_415203;
	carrypasses_262174(nodes, module, LOC1, 3);
}

N_NIMCALL(void, commandeval_533235)(NimStringDesc* exp) {
	NimStringDesc* echoexp;
	NimStringDesc* LOC5;
	Tnode215790* LOC6;
	Tsym215822* LOC7;
	{
		if (!(systemmodule_259007 == NIM_NIL)) goto LA3;
		interactivepasses_533076();
		compilesystemmodule_532856();
	}
	LA3: ;
	LOC5 = 0;
	LOC5 = rawNewString(exp->Sup.len + 21);
appendString(LOC5, ((NimStringDesc*) &TMP5258));
appendString(LOC5, exp);
appendString(LOC5, ((NimStringDesc*) &TMP5259));
	echoexp = LOC5;
	LOC6 = 0;
	LOC6 = parsestring_232536(echoexp, ((NimStringDesc*) &TMP4633), ((NI) 0), TMP5260);
	LOC7 = 0;
	LOC7 = makestdinmodule_532889();
	evalnim_533231(LOC6, LOC7);
}

N_NIMCALL(void, resetmemory_533293)(void) {
	resetcompilationlists_195867();
	resetcaches_469424();
	resetallmodules_532318();
	resetropecache_170075();
	resetsystypes_259199();
	if (gowners_265233) nimGCunrefNoCycle(gowners_265233);
	gowners_265233 = (Tsymseq215792*) newSeqRC1((&NTI215792), 0);
	{
		NI i_533414;
		NI res_533605;
		i_533414 = 0;
		res_533605 = ((NI) 0);
		{
			while (1) {
				if (!(res_533605 <= ((NI) 8191))) goto LA3;
				i_533414 = ((NI) (res_533605));
				asgnRefNoCycle((void**) (&buckets_190024[(i_533414)- 0]), NIM_NIL);
				res_533605 += ((NI) 1);
			} LA3: ;
		}
	}
	asgnRefNoCycle((void**) (&idanon_190455), NIM_NIL);
}

N_NIMCALL(void, commandsuggest_533286)(void) {
	{
		NI32 gdirtybufferidx;
		Tsym215822* LOC5;
		if (!isserving_161136) goto LA3;
		commandcompiletoc_533029();
		gdirtybufferidx = gtrackpos_184441.fileindex;
		LOC5 = 0;
		LOC5 = compilemodule_532695(gdirtybufferidx, 512);
		resetmodule_532258(gdirtybufferidx);
	}
	goto LA1;
	LA3: ;
	{
		gerrormax_184081 = ((NI) IL64(9223372036854775807));
		semanticpasses_533015();
		rodpass_533001();
		compileproject_532877(((NI32) -1));
	}
	LA1: ;
}

N_NIMCALL(void, maincommand_533610)(void) {
	NimStringDesc* LOC5;
	clearpasses_262143();
	glastcmdtime_161134 = ntepochTime();
	appendstr_135244((&searchpaths_161125), libpath_161198);
	{
		if (!!(((gprojectfull_161201 ? gprojectfull_161201->Sup.len : 0) == ((NI) 0)))) goto LA3;
		prependstr_135413((&searchpaths_161125), gprojectpath_161200);
	}
	LA3: ;
	setid_214425(((NI) 100));
	LOC5 = 0;
	LOC5 = nsuNormalize(command_161205);
	switch (hashString(LOC5) & 31) {
	case 0: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3729))) goto LA7;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3731))) goto LA8;
break;
	case 1: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3740))) goto LA16;
break;
	case 2: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3742))) goto LA18;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3751))) goto LA27;
break;
	case 4: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3744))) goto LA20;
break;
	case 9: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3732))) goto LA9;
break;
	case 10: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3725))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3743))) goto LA19;
break;
	case 12: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3727))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3752))) goto LA27;
break;
	case 13: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3735))) goto LA11;
break;
	case 14: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3749))) goto LA25;
break;
	case 16: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3747))) goto LA23;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3750))) goto LA26;
break;
	case 18: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3726))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3734))) goto LA10;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3748))) goto LA24;
break;
	case 19: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3738))) goto LA14;
break;
	case 20: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3739))) goto LA15;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3746))) goto LA22;
break;
	case 25: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3724))) goto LA6;
break;
	case 26: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3745))) goto LA21;
break;
	case 27: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3728))) goto LA7;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3733))) goto LA10;
break;
	case 29: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3741))) goto LA17;
break;
	case 31: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3730))) goto LA8;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3736))) goto LA12;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP3737))) goto LA13;
break;
	}
	goto LA28;
	LA6: ;
	{
		gcmd_161123 = ((NU8) 1);
		commandcompiletoc_533029();
	}
	goto LA29;
	LA7: ;
	{
		gcmd_161123 = ((NU8) 2);
		definesymbol_191004(((NimStringDesc*) &TMP3728));
		commandcompiletoc_533029();
	}
	goto LA29;
	LA8: ;
	{
		gcmd_161123 = ((NU8) 3);
		definesymbol_191004(((NimStringDesc*) &TMP3730));
		commandcompiletoc_533029();
	}
	goto LA29;
	LA9: ;
	{
		gcmd_161123 = ((NU8) 19);
		rawmessage_186612(((NU16) 185), command_161205);
	}
	goto LA29;
	LA10: ;
	{
		gcmd_161123 = ((NU8) 4);
		commandcompiletojs_533074();
	}
	goto LA29;
	LA11: ;
	{
		wantmainmodule_532871();
		gcmd_161123 = ((NU8) 8);
		loadconfigs_211603(((NimStringDesc*) &TMP5030));
		commanddoc_362714();
	}
	goto LA29;
	LA12: ;
	{
		gcmd_161123 = ((NU8) 8);
		loadconfigs_211603(((NimStringDesc*) &TMP5030));
		definesymbol_191004(((NimStringDesc*) &TMP5161));
		commanddoc2_533024();
	}
	goto LA29;
	LA13: ;
	{
		gcmd_161123 = ((NU8) 16);
		loadconfigs_211603(((NimStringDesc*) &TMP5030));
		commandrst2html_362742();
	}
	goto LA29;
	LA14: ;
	{
		gcmd_161123 = ((NU8) 17);
		loadconfigs_211603(((NimStringDesc*) &TMP5167));
		commandrst2tex_362744();
	}
	goto LA29;
	LA15: ;
	{
		wantmainmodule_532871();
		gcmd_161123 = ((NU8) 8);
		loadconfigs_211603(((NimStringDesc*) &TMP5030));
		wantmainmodule_532871();
		definesymbol_191004(((NimStringDesc*) &TMP5161));
		commandjson_362746();
	}
	goto LA29;
	LA16: ;
	{
		gcmd_161123 = ((NU8) 8);
		loadconfigs_211603(((NimStringDesc*) &TMP5030));
		commandbuildindex_362776();
	}
	goto LA29;
	LA17: ;
	{
		gcmd_161123 = ((NU8) 9);
		commandgendepend_533017();
	}
	goto LA29;
	LA18: ;
	{
		gcmd_161123 = ((NU8) 10);
		{
			NimStringDesc* LOC45;
			Jsonnodeobj307633* definedsymbols;
			Jsonnodeobj307633* libpaths;
			Jsonnodeobj307633* dumpdata;
			TY534027 LOC66;
			NimStringDesc* LOC67;
			LOC45 = 0;
			LOC45 = getconfigvar_161282(((NimStringDesc*) &TMP5240));
			if (!eqStrings(LOC45, ((NimStringDesc*) &TMP5241))) goto LA46;
			wantmainmodule_532871();
			definedsymbols = newjarray_307781();
			{
				NimStringDesc* s_534002;
				s_534002 = 0;
				{
					NimStringDesc* key_534406;
					NimStringDesc* val_534408;
					key_534406 = 0;
					val_534408 = 0;
					{
						NI h_534410;
						NI HEX3Atmp_534412;
						NI res_534414;
						h_534410 = 0;
						HEX3Atmp_534412 = 0;
						HEX3Atmp_534412 = ((*gsymbols_191001).data ? ((*gsymbols_191001).data->Sup.len-1) : -1);
						res_534414 = ((NI) 0);
						{
							while (1) {
								if (!(res_534414 <= HEX3Atmp_534412)) goto LA52;
								h_534410 = res_534414;
								{
									if (!!((*gsymbols_191001).data->data[h_534410].Field0 == 0)) goto LA55;
									key_534406 = (*gsymbols_191001).data->data[h_534410].Field0;
									val_534408 = (*gsymbols_191001).data->data[h_534410].Field1;
									{
										Jsonnodeobj307633* LOC61;
										if (!!(eqStrings(val_534408, ((NimStringDesc*) &TMP5242)))) goto LA59;
										s_534002 = key_534406;
										LOC61 = 0;
										LOC61 = HEX25_307988(s_534002);
										(*definedsymbols).kindU.S7.elems = (TY307653*) incrSeqV2(&((*definedsymbols).kindU.S7.elems)->Sup, sizeof(Jsonnodeobj307633*));
										asgnRefNoCycle((void**) (&(*definedsymbols).kindU.S7.elems->data[(*definedsymbols).kindU.S7.elems->Sup.len]), LOC61);
										++(*definedsymbols).kindU.S7.elems->Sup.len;
									}
									LA59: ;
								}
								LA55: ;
								res_534414 += ((NI) 1);
							} LA52: ;
						}
					}
				}
			}
			libpaths = newjarray_307781();
			{
				NimStringDesc* dir_534015;
				Tstrentry135012* it_534420;
				dir_534015 = 0;
				it_534420 = ((Tstrentry135012*) (searchpaths_161125.head));
				{
					while (1) {
						Jsonnodeobj307633* LOC65;
						if (!!((it_534420 == NIM_NIL))) goto LA64;
						dir_534015 = (*it_534420).data;
						LOC65 = 0;
						LOC65 = HEX25_307988(dir_534015);
						(*libpaths).kindU.S7.elems = (TY307653*) incrSeqV2(&((*libpaths).kindU.S7.elems)->Sup, sizeof(Jsonnodeobj307633*));
						asgnRefNoCycle((void**) (&(*libpaths).kindU.S7.elems->data[(*libpaths).kindU.S7.elems->Sup.len]), LOC65);
						++(*libpaths).kindU.S7.elems->Sup.len;
						it_534420 = ((Tstrentry135012*) ((*it_534420).Sup.next));
					} LA64: ;
				}
			}
			memset((void*)LOC66, 0, sizeof(LOC66));
			LOC66[0].Field0 = copyString(((NimStringDesc*) &TMP5243));
			LOC66[0].Field1 = HEX25_307988(((NimStringDesc*) &TMP5244));
			LOC66[1].Field0 = copyString(((NimStringDesc*) &TMP5245));
			LOC66[1].Field1 = HEX25_307988(gprojectfull_161201);
			LOC66[2].Field0 = copyString(((NimStringDesc*) &TMP5246));
			LOC66[2].Field1 = definedsymbols;
			LOC66[3].Field0 = copyString(((NimStringDesc*) &TMP5247));
			LOC66[3].Field1 = libpaths;
			dumpdata = HEX25_308040(LOC66, 4);
			LOC67 = 0;
			LOC67 = HEX24_311805(dumpdata);
			msgwriteln_184449(LOC67, 3);
		}
		goto LA43;
		LA46: ;
		{
			msgwriteln_184449(((NimStringDesc*) &TMP5250), 3);
			{
				NimStringDesc* s_534044;
				s_534044 = 0;
				{
					NimStringDesc* key_534426;
					NimStringDesc* val_534428;
					key_534426 = 0;
					val_534428 = 0;
					{
						NI h_534430;
						NI HEX3Atmp_534432;
						NI res_534434;
						h_534430 = 0;
						HEX3Atmp_534432 = 0;
						HEX3Atmp_534432 = ((*gsymbols_191001).data ? ((*gsymbols_191001).data->Sup.len-1) : -1);
						res_534434 = ((NI) 0);
						{
							while (1) {
								if (!(res_534434 <= HEX3Atmp_534432)) goto LA73;
								h_534430 = res_534434;
								{
									if (!!((*gsymbols_191001).data->data[h_534430].Field0 == 0)) goto LA76;
									key_534426 = (*gsymbols_191001).data->data[h_534430].Field0;
									val_534428 = (*gsymbols_191001).data->data[h_534430].Field1;
									{
										if (!!(eqStrings(val_534428, ((NimStringDesc*) &TMP5242)))) goto LA80;
										s_534044 = key_534426;
										msgwriteln_184449(s_534044, 3);
									}
									LA80: ;
								}
								LA76: ;
								res_534434 += ((NI) 1);
							} LA73: ;
						}
					}
				}
			}
			msgwriteln_184449(((NimStringDesc*) &TMP5251), 3);
			{
				NimStringDesc* it_534047;
				Tstrentry135012* it_534440;
				it_534047 = 0;
				it_534440 = ((Tstrentry135012*) (searchpaths_161125.head));
				{
					while (1) {
						if (!!((it_534440 == NIM_NIL))) goto LA84;
						it_534047 = (*it_534440).data;
						msgwriteln_184449(it_534047, 0);
						it_534440 = ((Tstrentry135012*) ((*it_534440).Sup.next));
					} LA84: ;
				}
			}
		}
		LA43: ;
	}
	goto LA29;
	LA19: ;
	{
		gcmd_161123 = ((NU8) 11);
		commandcheck_533019();
	}
	goto LA29;
	LA20: ;
	{
		Tnode215790* LOC87;
		gcmd_161123 = ((NU8) 12);
		wantmainmodule_532871();
		LOC87 = 0;
		LOC87 = parsefile_239029(gprojectmainidx_161203);
	}
	goto LA29;
	LA21: ;
	{
		gcmd_161123 = ((NU8) 13);
		wantmainmodule_532871();
		commandscan_533251();
		msgwriteln_184449(((NimStringDesc*) &TMP5255), 0);
	}
	goto LA29;
	LA22: ;
	{
		gcmd_161123 = ((NU8) 18);
		commandinteractive_533201();
	}
	goto LA29;
	LA23: ;
	{
		NimStringDesc* LOC91;
		LOC91 = 0;
		LOC91 = maincommandarg_161267();
		commandeval_533235(LOC91);
	}
	goto LA29;
	LA24: ;
	{
		resetmemory_533293();
	}
	goto LA29;
	LA25: ;
	{
		gcmd_161123 = ((NU8) 14);
		{
			if (!!(((gevalexpr_161133) && (gevalexpr_161133)->Sup.len == 0))) goto LA96;
			commandeval_533235(gevalexpr_161133);
		}
		goto LA94;
		LA96: ;
		{
			commandsuggest_533286();
		}
		LA94: ;
	}
	goto LA29;
	LA26: ;
	{
		isserving_161136 = NIM_TRUE;
		gglobaloptions_161121 |= ((NU32)1)<<((((NU8) 15))%(sizeof(NU32)*8));
		gerrormax_184081 = ((NI) IL64(9223372036854775807));
		serve_531236(maincommand_533610);
	}
	goto LA29;
	LA27: ;
	{
		gcmd_161123 = ((NU8) 10);
	}
	goto LA29;
	LA28: ;
	{
		rawmessage_186612(((NU16) 185), command_161205);
	}
	LA29: ;
	{
		NIM_BOOL LOC104;
		TY186781 LOC108;
		NF LOC109;
		NI LOC110;
		LOC104 = 0;
		LOC104 = (gerrorcounter_184078 == ((NI) 0));
		if (!(LOC104)) goto LA105;
		LOC104 = !(((525376 &(1U<<((NU)(gcmd_161123)&31U)))!=0));
		LA105: ;
		if (!LOC104) goto LA106;
		memset((void*)LOC108, 0, sizeof(LOC108));
		LOC108[0] = nimIntToStr(glinescompiled_206198);
		LOC109 = 0;
		LOC109 = ntepochTime();
		LOC108[1] = nsuformatFloat(((NF)(LOC109) - (NF)(glastcmdtime_161134)), ((NU8) 1), ((NI) 3), 46);
		LOC110 = 0;
		LOC110 = gettotalmem_8059();
		LOC108[2] = formatsize_102497(((NI64) (LOC110)), 46);
		{
			NIM_BOOL LOC113;
			LOC113 = 0;
			LOC113 = isdefined_191010(((NimStringDesc*) &TMP5297));
			if (!LOC113) goto LA114;
			LOC108[3] = copyString(((NimStringDesc*) &TMP5298));
		}
		goto LA111;
		LA114: ;
		{
			LOC108[3] = copyString(((NimStringDesc*) &TMP5299));
		}
		LA111: ;
		rawmessage_185645(((NU16) 269), LOC108, 4);
	}
	LA106: ;
	resetattributes_186618();
}
NIM_EXTERNC N_NOINLINE(void, compiler_mainInit000)(void) {
}

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

