/* Generated by Nim Compiler v0.11.2 */
/*   (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 Tlinkedlist130028 Tlinkedlist130028;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tlistentry130022 Tlistentry130022;
typedef struct Tpass242017 Tpass242017;
typedef struct Tpasscontext242005 Tpasscontext242005;
typedef struct Tsym191843 Tsym191843;
typedef struct Trodreader234030 Trodreader234030;
typedef struct Tnode191813 Tnode191813;
typedef struct Tcell46347 Tcell46347;
typedef struct TNimType TNimType;
typedef struct Tcellseq46363 Tcellseq46363;
typedef struct Tgcheap48216 Tgcheap48216;
typedef struct Tcellset46359 Tcellset46359;
typedef struct Tpagedesc46355 Tpagedesc46355;
typedef struct Tmemregion28210 Tmemregion28210;
typedef struct Tsmallchunk27440 Tsmallchunk27440;
typedef struct Tllchunk28204 Tllchunk28204;
typedef struct Tbigchunk27442 Tbigchunk27442;
typedef struct Tintset27417 Tintset27417;
typedef struct Ttrunk27413 Ttrunk27413;
typedef struct Tavlnode28208 Tavlnode28208;
typedef struct Tgcstat48214 Tgcstat48214;
typedef struct TY523054 TY523054;
typedef struct Tmoduleinmemory523017 Tmoduleinmemory523017;
typedef struct TY191933 TY191933;
typedef struct Jsonnodeobj290726 Jsonnodeobj290726;
typedef struct Stringtableobj134012 Stringtableobj134012;
typedef struct TNimObject TNimObject;
typedef struct TNimNode TNimNode;
typedef struct Keyvaluepairseq134010 Keyvaluepairseq134010;
typedef struct Keyvaluepair134008 Keyvaluepair134008;
typedef struct TY290741 TY290741;
typedef struct TY290746 TY290746;
typedef struct Tstrentry130024 Tstrentry130024;
typedef struct TY291209 TY291209;
typedef struct Tllstream179204 Tllstream179204;
typedef struct Tlexer182185 Tlexer182185;
typedef struct Tbaselexer180024 Tbaselexer180024;
typedef struct Tlineinfo164338 Tlineinfo164338;
typedef struct Ttoken182181 Ttoken182181;
typedef struct Tident168021 Tident168021;
typedef struct TY122008 TY122008;
typedef struct Tidobj168015 Tidobj168015;
typedef struct Ttypeseq191845 Ttypeseq191845;
typedef struct Tscope191837 Tscope191837;
typedef struct TY191944 TY191944;
typedef struct Tstrtable191817 Tstrtable191817;
typedef struct Tsymseq191815 Tsymseq191815;
typedef struct Ttype191849 Ttype191849;
typedef struct Tloc191827 Tloc191827;
typedef struct Ropeobj162009 Ropeobj162009;
typedef struct Tlib191831 Tlib191831;
typedef struct Tindex234028 Tindex234028;
typedef struct Tiitable199274 Tiitable199274;
typedef struct Tiipairseq199272 Tiipairseq199272;
typedef struct Tidtable191861 Tidtable191861;
typedef struct Tidpairseq191859 Tidpairseq191859;
typedef struct Memfile232208 Memfile232208;
typedef struct Tnodeseq191807 Tnodeseq191807;
typedef struct Tbasechunk27438 Tbasechunk27438;
typedef struct Tfreecell27430 Tfreecell27430;
typedef struct Tinstantiation191833 Tinstantiation191833;
typedef struct Tiipair199270 Tiipair199270;
typedef struct Tidpair191857 Tidpair191857;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tlinkedlist130028  {
Tlistentry130022* head;
Tlistentry130022* tail;
NI counter;
};
typedef N_NIMCALL_PTR(Tpasscontext242005*, Tpassopen242009) (Tsym191843* module);
typedef N_NIMCALL_PTR(Tpasscontext242005*, Tpassopencached242011) (Tsym191843* module, Trodreader234030* rd);
typedef N_NIMCALL_PTR(Tnode191813*, Tpassprocess242015) (Tpasscontext242005* p, Tnode191813* toplevelstmt);
typedef N_NIMCALL_PTR(Tnode191813*, Tpassclose242013) (Tpasscontext242005* p, Tnode191813* n);
struct Tpass242017 {
Tpassopen242009 Field0;
Tpassopencached242011 Field1;
Tpassprocess242015 Field2;
Tpassclose242013 Field3;
};
struct  Tcell46347  {
NI refcount;
TNimType* typ;
};
struct  Tcellseq46363  {
NI len;
NI cap;
Tcell46347** d;
};
struct  Tcellset46359  {
NI counter;
NI max;
Tpagedesc46355* head;
Tpagedesc46355** data;
};
typedef Tsmallchunk27440* TY28222[512];
typedef Ttrunk27413* Ttrunkbuckets27415[256];
struct  Tintset27417  {
Ttrunkbuckets27415 data;
};
struct  Tmemregion28210  {
NI minlargeobj;
NI maxlargeobj;
TY28222 freesmallchunks;
Tllchunk28204* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Tbigchunk27442* freechunkslist;
Tintset27417 chunkstarts;
Tavlnode28208* root;
Tavlnode28208* deleted;
Tavlnode28208* last;
Tavlnode28208* freeavlnodes;
};
struct  Tgcstat48214  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Tgcheap48216  {
void* stackbottom;
NI cyclethreshold;
Tcellseq46363 zct;
Tcellseq46363 decstack;
Tcellset46359 cycleroots;
Tcellseq46363 tempstack;
NI recgclock;
Tmemregion28210 region;
Tgcstat48214 stat;
};
struct  Tmoduleinmemory523017  {
NF compiledat;
NI32 crc;
TY191933* deps;
NU8 needsrecompile;
NU8 crcstatus;
};
typedef N_NIMCALL_PTR(void, TY3289) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3294) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3289 marker;
TY3294 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Stringtableobj134012  {
  TNimObject Sup;
NI counter;
Keyvaluepairseq134010* data;
NU8 mode;
};
struct Keyvaluepair134008 {
NimStringDesc* Field0;
NimStringDesc* Field1;
};
struct  Jsonnodeobj290726  {
NU8 kind;
union{
struct {NimStringDesc* str;
} S1;
struct {NI64 num;
} S2;
struct {NF fnum;
} S3;
struct {NIM_BOOL bval;
} S4;
struct {TY290741* fields;
} S6;
struct {TY290746* elems;
} S7;
} kindU;
};
struct  Tlistentry130022  {
  TNimObject Sup;
Tlistentry130022* prev;
Tlistentry130022* next;
};
struct  Tstrentry130024  {
  Tlistentry130022 Sup;
NimStringDesc* data;
};
struct TY291209 {
NimStringDesc* Field0;
Jsonnodeobj290726* Field1;
};
typedef TY291209 TY526027[4];
struct  Tbaselexer180024  {
  TNimObject Sup;
NI bufpos;
NCSTRING buf;
NI buflen;
Tllstream179204* stream;
NI linenumber;
NI sentinel;
NI linestart;
};
struct  Tlineinfo164338  {
NI16 line;
NI16 col;
NI32 fileindex;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (Tlineinfo164338 info, NU16 msg, NimStringDesc* arg, void* ClEnv);
void* ClEnv;
} Terrorhandler182183;
struct  Tlexer182185  {
  Tbaselexer180024 Sup;
NI32 fileidx;
NI indentahead;
NI currlineindent;
NIM_BOOL strongspaces;
Terrorhandler182183 errorhandler;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Ttoken182181  {
NU8 toktype;
NI indent;
Tident168021* ident;
NI64 inumber;
NF fnumber;
NU8 base;
NI8 strongspacea;
NI8 strongspaceb;
NimStringDesc* literal;
NI line;
NI col;
};
struct  Tidobj168015  {
  TNimObject Sup;
NI id;
};
struct  Tstrtable191817  {
NI counter;
Tsymseq191815* data;
};
struct  Tloc191827  {
NU8 k;
NU8 s;
NU16 flags;
Ttype191849* t;
Ropeobj162009* r;
Ropeobj162009* heaproot;
};
struct  Tsym191843  {
  Tidobj168015 Sup;
NU8 kind;
union{
struct {Ttypeseq191845* typeinstcache;
Tscope191837* typscope;
} S1;
struct {TY191944* procinstcache;
Tsym191843* gcunsafetyreason;
} S2;
struct {TY191944* usedgenerics;
Tstrtable191817 tab;
} S3;
struct {Tsym191843* guard;
} S4;
} kindU;
NU16 magic;
Ttype191849* typ;
Tident168021* name;
Tlineinfo164338 info;
Tsym191843* owner;
NU32 flags;
Tnode191813* ast;
NU32 options;
NI position;
NI offset;
Tloc191827 loc;
Tlib191831* annex;
Tnode191813* constraint;
};
typedef Tpass242017 TY525241[3];
typedef Tident168021* TY168034[8192];
typedef N_NIMCALL_PTR(void, TY522256) (void);
typedef NimStringDesc* TY165825[4];
struct  Tpasscontext242005  {
  TNimObject Sup;
NIM_BOOL fromcache;
};
struct  Tiitable199274  {
NI counter;
Tiipairseq199272* data;
};
struct  Tindex234028  {
NI lastidxkey;
NI lastidxval;
Tiitable199274 tab;
NimStringDesc* r;
NI offset;
};
struct  Tidtable191861  {
NI counter;
Tidpairseq191859* data;
};
struct  Memfile232208  {
void* mem;
NI size;
int handle;
};
struct  Trodreader234030  {
  TNimObject Sup;
NI pos;
NCSTRING s;
NU32 options;
NU8 reason;
TY191933* moddeps;
TY191933* files;
NI dataidx;
NI convertersidx;
NI initidx;
NI interfidx;
NI compilerprocsidx;
NI methodsidx;
NimStringDesc* filename;
Tindex234028 index;
Tindex234028 imports;
NI readerindex;
NI line;
NI moduleid;
Tidtable191861 syms;
Memfile232208 memfile;
Tsymseq191815* methods;
NimStringDesc* origfile;
NIM_BOOL inviewmode;
};
struct  Tnode191813  {
Ttype191849* typ;
Tlineinfo164338 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym191843* sym;
} S4;
struct {Tident168021* ident;
} S5;
struct {Tnodeseq191807* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
typedef NI TY27420[16];
struct  Tpagedesc46355  {
Tpagedesc46355* next;
NI key;
TY27420 bits;
};
struct  Tbasechunk27438  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Tsmallchunk27440  {
  Tbasechunk27438 Sup;
Tsmallchunk27440* next;
Tsmallchunk27440* prev;
Tfreecell27430* freelist;
NI free;
NI acc;
NF data;
};
struct  Tllchunk28204  {
NI size;
NI acc;
Tllchunk28204* next;
};
struct  Tbigchunk27442  {
  Tbasechunk27438 Sup;
Tbigchunk27442* next;
Tbigchunk27442* prev;
NI align;
NF data;
};
struct  Ttrunk27413  {
Ttrunk27413* next;
NI key;
TY27420 bits;
};
typedef Tavlnode28208* TY28214[2];
struct  Tavlnode28208  {
TY28214 link;
NI key;
NI upperbound;
NI level;
};
struct  Tllstream179204  {
  TNimObject Sup;
NU8 kind;
FILE* f;
NimStringDesc* s;
NI rd;
NI wr;
NI lineoffset;
};
struct  Tident168021  {
  Tidobj168015 Sup;
NimStringDesc* s;
Tident168021* next;
NI h;
};
struct  Tscope191837  {
NI depthlevel;
Tstrtable191817 symbols;
Tnodeseq191807* usingsyms;
Tscope191837* parent;
};
struct  Ttype191849  {
  Tidobj168015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq191845* sons;
Tnode191813* n;
Tsym191843* owner;
Tsym191843* sym;
Tsym191843* destructor;
Tsym191843* deepcopy;
Tsym191843* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc191827 loc;
};
struct  Ropeobj162009  {
  TNimObject Sup;
Ropeobj162009* left;
Ropeobj162009* right;
NI length;
NimStringDesc* data;
};
struct  Tlib191831  {
  Tlistentry130022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj162009* name;
Tnode191813* path;
};
struct  Tiipair199270  {
NI key;
NI val;
};
struct  Tidpair191857  {
Tidobj168015* key;
TNimObject* val;
};
struct  Tfreecell27430  {
Tfreecell27430* next;
NI zerofield;
};
struct  Tinstantiation191833  {
Tsym191843* sym;
Ttypeseq191845* concretetypes;
TY191933* usedby;
};
struct TY523054 {
  TGenericSeq Sup;
  Tmoduleinmemory523017 data[SEQ_DECL_SIZE];
};
struct TY290746 {
  TGenericSeq Sup;
  Jsonnodeobj290726* data[SEQ_DECL_SIZE];
};
struct TY122008 {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct Tsymseq191815 {
  TGenericSeq Sup;
  Tsym191843* data[SEQ_DECL_SIZE];
};
struct TY191933 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq134010 {
  TGenericSeq Sup;
  Keyvaluepair134008 data[SEQ_DECL_SIZE];
};
struct TY290741 {
  TGenericSeq Sup;
  TY291209 data[SEQ_DECL_SIZE];
};
struct Ttypeseq191845 {
  TGenericSeq Sup;
  Ttype191849* data[SEQ_DECL_SIZE];
};
struct TY191944 {
  TGenericSeq Sup;
  Tinstantiation191833* data[SEQ_DECL_SIZE];
};
struct Tiipairseq199272 {
  TGenericSeq Sup;
  Tiipair199270 data[SEQ_DECL_SIZE];
};
struct Tidpairseq191859 {
  TGenericSeq Sup;
  Tidpair191857 data[SEQ_DECL_SIZE];
};
struct Tnodeseq191807 {
  TGenericSeq Sup;
  Tnode191813* data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, clearpasses_242182)(void);
N_NIMCALL(NF, ntepochTime)(void);
N_NIMCALL(void, appendstr_130268)(Tlinkedlist130028* list, NimStringDesc* data);
N_NIMCALL(void, prependstr_130419)(Tlinkedlist130028* list, NimStringDesc* data);
static N_INLINE(void, setid_190440)(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_525071)(void);
N_NIMCALL(void, initvars_171876)(void);
N_NIMCALL(void, semanticpasses_525033)(void);
N_NIMCALL(void, registerpass_242190)(Tpass242017 p);
N_NIMCALL(Tpasscontext242005*, verboseopen_506012)(Tsym191843* s);
N_NIMCALL(Tnode191813*, verboseprocess_506023)(Tpasscontext242005* context, Tnode191813* n);
N_NIMCALL(Tpasscontext242005*, myopen_451686)(Tsym191843* module);
N_NIMCALL(Tpasscontext242005*, myopencached_451723)(Tsym191843* module, Trodreader234030* rd);
N_NIMCALL(Tnode191813*, myprocess_451851)(Tpasscontext242005* context, Tnode191813* n);
N_NIMCALL(Tnode191813*, myclose_451867)(Tpasscontext242005* context, Tnode191813* n);
N_NIMCALL(Tpasscontext242005*, myopen_493971)(Tsym191843* module);
N_NIMCALL(Tpasscontext242005*, myopencached_494123)(Tsym191843* module, Trodreader234030* rd);
N_NIMCALL(Tnode191813*, myprocess_494208)(Tpasscontext242005* b, Tnode191813* n);
N_NIMCALL(Tnode191813*, myclose_494642)(Tpasscontext242005* b, Tnode191813* n);
N_NIMCALL(void, rodpass_525007)(void);
N_NIMCALL(Tpasscontext242005*, myopen_255251)(Tsym191843* module);
N_NIMCALL(Tnode191813*, process_254969)(Tpasscontext242005* c, Tnode191813* n);
N_NIMCALL(Tnode191813*, myclose_255267)(Tpasscontext242005* c, Tnode191813* n);
N_NIMCALL(void, compileproject_523985)(NI32 projectfileidx);
N_NIMCALL(void, cgenwritemodules_494720)(void);
N_NIMCALL(void, callccompiler_172574)(NimStringDesc* projectfile);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(NimStringDesc*, noschangeFileExt)(NimStringDesc* filename, NimStringDesc* ext);
N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(Tcell46347*, usrtocell_49846)(void* usr);
static N_INLINE(void, rtladdzct_51404)(Tcell46347* c);
N_NOINLINE(void, addzct_49817)(Tcellseq46363* s, Tcell46347* c);
N_NIMCALL(void, resetcgenmodules_493850)(void);
N_NIMCALL(void, resetcompilationlists_171943)(void);
N_NIMCALL(void, resetcaches_455448)(void);
N_NIMCALL(void, Gcfullcollect_8805)(void);
N_NIMCALL(void, definesymbol_169013)(NimStringDesc* symbol);
N_NIMCALL(void, rawmessage_165960)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, commandcompiletojs_525132)(void);
N_NIMCALL(void, settarget_160634)(NU8 o, NU8 c);
N_NIMCALL(Tpasscontext242005*, myopen_504743)(Tsym191843* s);
N_NIMCALL(Tpasscontext242005*, myopencached_504732)(Tsym191843* s, Trodreader234030* rd);
N_NIMCALL(Tnode191813*, myprocess_504597)(Tpasscontext242005* b, Tnode191813* n);
N_NIMCALL(Tnode191813*, myclose_504703)(Tpasscontext242005* b, Tnode191813* n);
N_NIMCALL(void, wantmainmodule_523922)(void);
N_NIMCALL(void, loadconfigs_187609)(NimStringDesc* cfg);
N_NIMCALL(void, commanddoc_344360)(void);
N_NIMCALL(void, commanddoc2_525060)(void);
N_NIMCALL(Tpasscontext242005*, myopen_508069)(Tsym191843* module);
N_NIMCALL(Tnode191813*, processnode_508057)(Tpasscontext242005* c, Tnode191813* n);
N_NIMCALL(Tnode191813*, close_508018)(Tpasscontext242005* p, Tnode191813* n);
N_NIMCALL(void, finishdoc2pass_508108)(NimStringDesc* project);
N_NIMCALL(void, commandrst2html_344400)(void);
N_NIMCALL(void, commandrst2tex_344408)(void);
N_NIMCALL(void, commandjson_344416)(void);
N_NIMCALL(void, commandbuildindex_344452)(void);
N_NIMCALL(void, commandgendepend_525041)(void);
N_NIMCALL(Tpasscontext242005*, myopen_507131)(Tsym191843* module);
N_NIMCALL(Tnode191813*, adddotdependency_507041)(Tpasscontext242005* c, Tnode191813* n);
N_NIMCALL(Tnode191813*, cleanup_506066)(Tpasscontext242005* c, Tnode191813* n);
N_NIMCALL(void, generatedot_507009)(NimStringDesc* project);
N_NIMCALL(void, execexternalprogram_171985)(NimStringDesc* cmd, NimStringDesc* prettycmd);
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_155334)(NimStringDesc* key);
N_NIMCALL(Jsonnodeobj290726*, newjarray_290927)(void);
N_NIMCALL(Jsonnodeobj290726*, HEX25_291130)(NimStringDesc* s);
N_NIMCALL(TGenericSeq*, incrSeq)(TGenericSeq* seq, NI elemsize);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(Jsonnodeobj290726*, HEX25_291206)(TY291209* keyvals, NI keyvalsLen0);
N_NIMCALL(void, outwriteln_165505)(NimStringDesc* s);
N_NIMCALL(NimStringDesc*, HEX24_294458)(Jsonnodeobj290726* node);
N_NIMCALL(void, msgwriteln_165536)(NimStringDesc* s);
N_NIMCALL(void, commandcheck_525049)(void);
N_NIMCALL(Tnode191813*, parsefile_219041)(NI32 fileidx);
N_NIMCALL(void, commandscan_525278)(void);
N_NIMCALL(NimStringDesc*, nosaddFileExt)(NimStringDesc* filename, NimStringDesc* ext);
N_NIMCALL(NimStringDesc*, maincommandarg_155307)(void);
N_NIMCALL(Tllstream179204*, llstreamopen_179256)(NimStringDesc* filename, NU8 mode);
N_NIMCALL(void, inittoken_182369)(Ttoken182181* L);
N_NIMCALL(void, openlexer_182412)(Tlexer182185* lex, NimStringDesc* filename, Tllstream179204* inputstream);
N_NIMCALL(void, rawgettok_185848)(Tlexer182185* L, Ttoken182181* tok);
N_NIMCALL(void, printtok_182355)(Ttoken182181* tok);
N_NIMCALL(void, closelexer_182424)(Tlexer182185* lex);
N_NIMCALL(void, commandinteractive_525207)(void);
N_NIMCALL(void, interactivepasses_525140)(void);
N_NIMCALL(void, initdefines_169254)(void);
N_NIMCALL(Tpasscontext242005*, myopen_397852)(Tsym191843* module);
N_NIMCALL(Tnode191813*, myprocess_398012)(Tpasscontext242005* c, Tnode191813* n);
N_NIMCALL(void, compilesystemmodule_523901)(void);
N_NIMCALL(Tsym191843*, compilemodule_523726)(NI32 fileidx, NU32 flags);
N_NIMCALL(NI32, fileinfoidx_164854)(NimStringDesc* filename);
N_NIMCALL(Tsym191843*, makestdinmodule_524003)(void);
N_NIMCALL(void, processmodule_242056)(Tsym191843* module, Tllstream179204* stream, Trodreader234030* rd);
N_NIMCALL(Tllstream179204*, llstreamopenstdin_179293)(void);
N_NIMCALL(void, commandeval_525256)(NimStringDesc* exp);
N_NIMCALL(void, evalnim_525246)(Tnode191813* nodes, Tsym191843* module);
N_NIMCALL(void, carrypasses_242231)(Tnode191813* nodes, Tsym191843* module, Tpass242017* passes, NI passesLen0);
N_NIMCALL(Tnode191813*, parsestring_211306)(NimStringDesc* s, NimStringDesc* filename, NI line, Terrorhandler182183 errorhandler);
N_NIMCALL(void, resetmemory_525338)(void);
N_NIMCALL(void, resetallmodules_523350)(void);
N_NIMCALL(void, resetropecache_162111)(void);
N_NIMCALL(void, resetsystypes_239302)(void);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
N_NIMCALL(void, commandsuggest_525325)(void);
N_NIMCALL(void, resetmodule_523317)(NI32 fileidx);
N_NIMCALL(void, serve_522254)(TY522256 action);
N_NIMCALL(void, maincommand_525628)(void);
N_NIMCALL(void, rawmessage_165888)(NU16 msg, NimStringDesc** args, NI argsLen0);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
N_NIMCALL(NimStringDesc*, nsuformatFloat)(NF f, NU8 format, NI precision);
N_NIMCALL(NimStringDesc*, formatsize_100697)(NI64 bytes, NIM_CHAR decimalsep);
N_NIMCALL(NI, gettotalmem_6699)(void);
N_NIMCALL(NIM_BOOL, isdefined_169031)(NimStringDesc* symbol);
STRING_LITERAL(TMP1901, "c", 1);
STRING_LITERAL(TMP1902, "cc", 2);
STRING_LITERAL(TMP1903, "compile", 7);
STRING_LITERAL(TMP1904, "compiletoc", 10);
STRING_LITERAL(TMP1905, "cpp", 3);
STRING_LITERAL(TMP1906, "compiletocpp", 12);
STRING_LITERAL(TMP1907, "objc", 4);
STRING_LITERAL(TMP1908, "compiletooc", 11);
STRING_LITERAL(TMP1909, "run", 3);
STRING_LITERAL(TMP1910, "js", 2);
STRING_LITERAL(TMP1911, "compiletojs", 11);
STRING_LITERAL(TMP1912, "doc", 3);
STRING_LITERAL(TMP1913, "doc2", 4);
STRING_LITERAL(TMP1914, "rst2html", 8);
STRING_LITERAL(TMP1915, "rst2tex", 7);
STRING_LITERAL(TMP1916, "jsondoc", 7);
STRING_LITERAL(TMP1917, "buildindex", 10);
STRING_LITERAL(TMP1918, "gendepend", 9);
STRING_LITERAL(TMP1919, "dump", 4);
STRING_LITERAL(TMP1920, "check", 5);
STRING_LITERAL(TMP1921, "parse", 5);
STRING_LITERAL(TMP1922, "scan", 4);
STRING_LITERAL(TMP1923, "i", 1);
STRING_LITERAL(TMP1924, "e", 1);
STRING_LITERAL(TMP1925, "reset", 5);
STRING_LITERAL(TMP1926, "idetools", 8);
STRING_LITERAL(TMP1927, "serve", 5);
STRING_LITERAL(TMP4357, "-", 1);
STRING_LITERAL(TMP4358, "stdinfile", 9);
STRING_LITERAL(TMP4359, "", 0);
STRING_LITERAL(TMP4360, "nimrod", 6);
STRING_LITERAL(TMP4361, "ecmascript", 10);
STRING_LITERAL(TMP4758, "nimdoc.cfg", 10);
STRING_LITERAL(TMP4885, "nimdoc", 6);
STRING_LITERAL(TMP4891, "nimdoc.tex.cfg", 14);
STRING_LITERAL(TMP4961, "dot -Tpng -o", 12);
STRING_LITERAL(TMP4962, "png", 3);
STRING_LITERAL(TMP4963, "dot", 3);
STRING_LITERAL(TMP4964, "dump.format", 11);
STRING_LITERAL(TMP4965, "json", 4);
STRING_LITERAL(TMP4966, "false", 5);
STRING_LITERAL(TMP4967, "version", 7);
STRING_LITERAL(TMP4968, "0.11.2", 6);
STRING_LITERAL(TMP4969, "project_path", 12);
STRING_LITERAL(TMP4970, "defined_symbols", 15);
STRING_LITERAL(TMP4971, "lib_paths", 9);
STRING_LITERAL(TMP4972, "-- list of currently defined symbols --", 39);
STRING_LITERAL(TMP4973, "-- end of list --", 17);
STRING_LITERAL(TMP4974, "nim", 3);
STRING_LITERAL(TMP4977, "Beware: Indentation tokens depend on the parser\'s state!", 56);
STRING_LITERAL(TMP4978, "nimrodvm", 8);
STRING_LITERAL(TMP4981, "echo \"eval\\t\", repr(", 20);
STRING_LITERAL(TMP4982, ")", 1);
static NIM_CONST Terrorhandler182183 TMP4983 = {NIM_NIL,NIM_NIL};
STRING_LITERAL(TMP5012, "release", 7);
STRING_LITERAL(TMP5013, "Release Build", 13);
STRING_LITERAL(TMP5014, "Debug Build", 11);
extern NF glastcmdtime_155141;
extern Tlinkedlist130028 searchpaths_155132;
extern NimStringDesc* libpath_155233;
extern NimStringDesc* gprojectfull_155236;
extern NimStringDesc* gprojectpath_155235;
extern NI gfrontendid_190012;
extern NimStringDesc* command_155239;
extern NU8 gcmd_155130;
extern NU32 gglobaloptions_155128;
extern NimStringDesc* gprojectname_155234;
extern NIM_BOOL isserving_155143;
extern NimStringDesc* lastcaascmd_522205;
extern NimStringDesc* curcaascmd_522204;
extern Tgcheap48216 gch_48244;
extern TY523054* gmemcachedata_523071;
extern NI gerrormax_165018;
extern Stringtableobj134012* gsymbols_169004;
extern NI32 gprojectmainidx_155237;
extern TNimType NTI182185; /* TLexer */
extern TY122008* commandargs_155257;
extern Tsym191843* systemmodule_239019;
extern Tsymseq191815* gowners_245289;
extern TNimType NTI191815; /* TSymSeq */
extern Tsym191843* rangedestructorproc_432422;
extern TY168034 buckets_168039;
extern Tident168021* idanon_168495;
extern NimStringDesc* gevalexpr_155140;
extern Tlineinfo164338 gtrackpos_165500;
extern NI gerrorcounter_165015;
extern NI gverbosity_155137;
extern NI glinescompiled_182213;

static N_INLINE(void, setid_190440)(NI id) {
	gfrontendid_190012 = ((gfrontendid_190012 >= (NI)(id + ((NI) 1))) ? gfrontendid_190012 : (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_525033)(void) {
	Tpass242017 LOC1;
	Tpass242017 LOC2;
	LOC1.Field0 = verboseopen_506012;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = verboseprocess_506023;
	LOC1.Field3 = NIM_NIL;
	registerpass_242190(LOC1);
	LOC2.Field0 = myopen_451686;
	LOC2.Field1 = myopencached_451723;
	LOC2.Field2 = myprocess_451851;
	LOC2.Field3 = myclose_451867;
	registerpass_242190(LOC2);
}

N_NIMCALL(void, rodpass_525007)(void) {
	{
		Tpass242017 LOC5;
		if (!((gglobaloptions_155128 &(1<<((((NU8) 14))&31)))!=0)) goto LA3;
		LOC5.Field0 = myopen_255251;
		LOC5.Field1 = NIM_NIL;
		LOC5.Field2 = process_254969;
		LOC5.Field3 = myclose_255267;
		registerpass_242190(LOC5);
	}
	LA3: ;
}

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

static N_INLINE(void, rtladdzct_51404)(Tcell46347* c) {
	addzct_49817((&gch_48244.zct), c);
}

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

N_NIMCALL(void, commandcompiletoc_525071)(void) {
	Tpass242017 LOC1;
	initvars_171876();
	semanticpasses_525033();
	LOC1.Field0 = myopen_493971;
	LOC1.Field1 = myopencached_494123;
	LOC1.Field2 = myprocess_494208;
	LOC1.Field3 = myclose_494642;
	registerpass_242190(LOC1);
	rodpass_525007();
	compileproject_523985(((NI32) -1));
	cgenwritemodules_494720();
	{
		NimStringDesc* LOC6;
		if (!!((gcmd_155130 == ((NU8) 19)))) goto LA4;
		LOC6 = 0;
		{
			if (!eqStrings(gprojectname_155234, ((NimStringDesc*) &TMP4357))) goto LA9;
			LOC6 = copyString(((NimStringDesc*) &TMP4358));
		}
		goto LA7;
		LA9: ;
		{
			LOC6 = noschangeFileExt(gprojectfull_155236, ((NimStringDesc*) &TMP4359));
		}
		LA7: ;
		callccompiler_172574(LOC6);
	}
	LA4: ;
	{
		NimStringDesc* LOC16;
		if (!isserving_155143) goto LA14;
		LOC16 = 0;
		LOC16 = lastcaascmd_522205; lastcaascmd_522205 = copyStringRC1(curcaascmd_522204);
		if (LOC16) nimGCunrefNoCycle(LOC16);
		resetcgenmodules_493850();
		{
			NI i_525108;
			NI HEX3Atmp_525110;
			NI res_525113;
			i_525108 = 0;
			HEX3Atmp_525110 = 0;
			HEX3Atmp_525110 = ((gmemcachedata_523071 ? gmemcachedata_523071->Sup.len : 0) - 1);
			res_525113 = ((NI) 0);
			{
				while (1) {
					if (!(res_525113 <= HEX3Atmp_525110)) goto LA19;
					i_525108 = res_525113;
					gmemcachedata_523071->data[i_525108].crcstatus = ((NU8) 1);
					gmemcachedata_523071->data[i_525108].needsrecompile = ((NU8) 0);
					res_525113 += ((NI) 1);
				} LA19: ;
			}
		}
		resetcompilationlists_171943();
		resetcaches_455448();
		Gcfullcollect_8805();
	}
	LA14: ;
}

N_NIMCALL(void, commandcompiletojs_525132)(void) {
	Tpass242017 LOC1;
	settarget_160634(((NU8) 22), ((NU8) 12));
	definesymbol_169013(((NimStringDesc*) &TMP4360));
	definesymbol_169013(((NimStringDesc*) &TMP4361));
	definesymbol_169013(((NimStringDesc*) &TMP1910));
	semanticpasses_525033();
	LOC1.Field0 = myopen_504743;
	LOC1.Field1 = myopencached_504732;
	LOC1.Field2 = myprocess_504597;
	LOC1.Field3 = myclose_504703;
	registerpass_242190(LOC1);
	compileproject_523985(((NI32) -1));
}

N_NIMCALL(void, commanddoc2_525060)(void) {
	Tpass242017 LOC1;
	gerrormax_165018 = ((NI) 2147483647);
	semanticpasses_525033();
	LOC1.Field0 = myopen_508069;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = processnode_508057;
	LOC1.Field3 = close_508018;
	registerpass_242190(LOC1);
	compileproject_523985(((NI32) -1));
	finishdoc2pass_508108(gprojectname_155234);
}

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_525041)(void) {
	Tpass242017 LOC1;
	Tpass242017 LOC2;
	NimStringDesc* LOC3;
	NimStringDesc* LOC4;
	NimStringDesc* LOC5;
	semanticpasses_525033();
	LOC1.Field0 = myopen_507131;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = adddotdependency_507041;
	LOC1.Field3 = NIM_NIL;
	registerpass_242190(LOC1);
	LOC2.Field0 = NIM_NIL;
	LOC2.Field1 = NIM_NIL;
	LOC2.Field2 = cleanup_506066;
	LOC2.Field3 = cleanup_506066;
	registerpass_242190(LOC2);
	compileproject_523985(((NI32) -1));
	generatedot_507009(gprojectfull_155236);
	LOC3 = 0;
	LOC4 = 0;
	LOC4 = noschangeFileExt(gprojectfull_155236, ((NimStringDesc*) &TMP4962));
	LOC5 = 0;
	LOC5 = noschangeFileExt(gprojectfull_155236, ((NimStringDesc*) &TMP4963));
	LOC3 = rawNewString(LOC4->Sup.len + LOC5->Sup.len + 13);
appendString(LOC3, ((NimStringDesc*) &TMP4961));
appendString(LOC3, LOC4);
appendChar(LOC3, 32);
appendString(LOC3, LOC5);
	execexternalprogram_171985(LOC3, ((NimStringDesc*) &TMP4359));
}

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

N_NIMCALL(void, commandcheck_525049)(void) {
	gerrormax_165018 = ((NI) 2147483647);
	semanticpasses_525033();
	rodpass_525007();
	compileproject_523985(((NI32) -1));
}

N_NIMCALL(void, commandscan_525278)(void) {
	NimStringDesc* f;
	NimStringDesc* LOC1;
	Tllstream179204* stream;
	LOC1 = 0;
	LOC1 = maincommandarg_155307();
	f = nosaddFileExt(LOC1, ((NimStringDesc*) &TMP4974));
	stream = llstreamopen_179256(f, ((NU8) 0));
	{
		Tlexer182185 L;
		Ttoken182181 tok;
		if (!!((stream == NIM_NIL))) goto LA4;
		memset((void*)(&L), 0, sizeof(L));
		L.Sup.Sup.m_type = (&NTI182185);
		memset((void*)(&tok), 0, sizeof(tok));
		inittoken_182369((&tok));
		openlexer_182412((&L), f, stream);
		{
			while (1) {
				rawgettok_185848((&L), (&tok));
				printtok_182355((&tok));
				{
					if (!(tok.toktype == ((NU8) 1))) goto LA10;
					goto LA6;
				}
				LA10: ;
			}
		} LA6: ;
		closelexer_182424((&L));
	}
	goto LA2;
	LA4: ;
	{
		rawmessage_165960(((NU16) 3), f);
	}
	LA2: ;
}

N_NIMCALL(void, interactivepasses_525140)(void) {
	Tpass242017 LOC1;
	Tpass242017 LOC2;
	Tpass242017 LOC3;
	initdefines_169254();
	definesymbol_169013(((NimStringDesc*) &TMP4978));
	LOC1.Field0 = verboseopen_506012;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = verboseprocess_506023;
	LOC1.Field3 = NIM_NIL;
	registerpass_242190(LOC1);
	LOC2.Field0 = myopen_451686;
	LOC2.Field1 = myopencached_451723;
	LOC2.Field2 = myprocess_451851;
	LOC2.Field3 = myclose_451867;
	registerpass_242190(LOC2);
	LOC3.Field0 = myopen_397852;
	LOC3.Field1 = NIM_NIL;
	LOC3.Field2 = myprocess_398012;
	LOC3.Field3 = myprocess_398012;
	registerpass_242190(LOC3);
}

N_NIMCALL(void, commandinteractive_525207)(void) {
	gerrormax_165018 = ((NI) 2147483647);
	interactivepasses_525140();
	compilesystemmodule_523901();
	{
		NI32 LOC5;
		Tsym191843* LOC6;
		if (!(((NI) 0) < (commandargs_155257 ? commandargs_155257->Sup.len : 0))) goto LA3;
		LOC5 = 0;
		LOC5 = fileinfoidx_164854(gprojectfull_155236);
		LOC6 = 0;
		LOC6 = compilemodule_523726(LOC5, 0);
	}
	goto LA1;
	LA3: ;
	{
		Tsym191843* m;
		Tllstream179204* LOC8;
		m = makestdinmodule_524003();
		(*m).flags |= ((NI32)1)<<((((NU8) 12))%(sizeof(NI32)*8));
		LOC8 = 0;
		LOC8 = llstreamopenstdin_179293();
		processmodule_242056(m, LOC8, NIM_NIL);
	}
	LA1: ;
}

N_NIMCALL(void, evalnim_525246)(Tnode191813* nodes, Tsym191843* module) {
	TY525241 LOC1;
	LOC1[0].Field0 = verboseopen_506012;
	LOC1[0].Field1 = NIM_NIL;
	LOC1[0].Field2 = verboseprocess_506023;
	LOC1[0].Field3 = NIM_NIL;
	LOC1[1].Field0 = myopen_451686;
	LOC1[1].Field1 = myopencached_451723;
	LOC1[1].Field2 = myprocess_451851;
	LOC1[1].Field3 = myclose_451867;
	LOC1[2].Field0 = myopen_397852;
	LOC1[2].Field1 = NIM_NIL;
	LOC1[2].Field2 = myprocess_398012;
	LOC1[2].Field3 = myprocess_398012;
	carrypasses_242231(nodes, module, LOC1, 3);
}

N_NIMCALL(void, commandeval_525256)(NimStringDesc* exp) {
	NimStringDesc* echoexp;
	NimStringDesc* LOC5;
	Tnode191813* LOC6;
	Tsym191843* LOC7;
	{
		if (!(systemmodule_239019 == NIM_NIL)) goto LA3;
		interactivepasses_525140();
		compilesystemmodule_523901();
	}
	LA3: ;
	LOC5 = 0;
	LOC5 = rawNewString(exp->Sup.len + 21);
appendString(LOC5, ((NimStringDesc*) &TMP4981));
appendString(LOC5, exp);
appendString(LOC5, ((NimStringDesc*) &TMP4982));
	echoexp = LOC5;
	LOC6 = 0;
	LOC6 = parsestring_211306(echoexp, ((NimStringDesc*) &TMP4359), ((NI) 0), TMP4983);
	LOC7 = 0;
	LOC7 = makestdinmodule_524003();
	evalnim_525246(LOC6, LOC7);
}

N_NIMCALL(void, resetmemory_525338)(void) {
	resetcompilationlists_171943();
	resetcaches_455448();
	resetallmodules_523350();
	resetropecache_162111();
	resetsystypes_239302();
	if (gowners_245289) nimGCunrefNoCycle(gowners_245289);
	gowners_245289 = (Tsymseq191815*) newSeqRC1((&NTI191815), 0);
	asgnRefNoCycle((void**) (&rangedestructorproc_432422), NIM_NIL);
	{
		NI i_525423;
		NI res_525605;
		i_525423 = 0;
		res_525605 = ((NI) 0);
		{
			while (1) {
				if (!(res_525605 <= ((NI) 8191))) goto LA3;
				i_525423 = ((NI) (res_525605));
				asgnRefNoCycle((void**) (&buckets_168039[(i_525423)- 0]), NIM_NIL);
				res_525605 += ((NI) 1);
			} LA3: ;
		}
	}
	asgnRefNoCycle((void**) (&idanon_168495), NIM_NIL);
}

N_NIMCALL(void, commandsuggest_525325)(void) {
	{
		NI32 gdirtybufferidx;
		Tsym191843* LOC5;
		if (!isserving_155143) goto LA3;
		commandcompiletoc_525071();
		gdirtybufferidx = gtrackpos_165500.fileindex;
		LOC5 = 0;
		LOC5 = compilemodule_523726(gdirtybufferidx, 512);
		resetmodule_523317(gdirtybufferidx);
	}
	goto LA1;
	LA3: ;
	{
		gerrormax_165018 = ((NI) 2147483647);
		semanticpasses_525033();
		rodpass_525007();
		compileproject_523985(((NI32) -1));
	}
	LA1: ;
}

N_NIMCALL(void, maincommand_525628)(void) {
	NimStringDesc* LOC5;
	clearpasses_242182();
	glastcmdtime_155141 = ntepochTime();
	appendstr_130268((&searchpaths_155132), libpath_155233);
	{
		if (!!(((gprojectfull_155236 ? gprojectfull_155236->Sup.len : 0) == ((NI) 0)))) goto LA3;
		prependstr_130419((&searchpaths_155132), gprojectpath_155235);
	}
	LA3: ;
	setid_190440(((NI) 100));
	LOC5 = 0;
	LOC5 = nsuNormalize(command_155239);
	switch (hashString(LOC5) & 31) {
	case 0: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1903))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1908))) goto LA8;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1926))) goto LA25;
break;
	case 2: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1919))) goto LA18;
break;
	case 4: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1921))) goto LA20;
break;
	case 7: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1914))) goto LA13;
break;
	case 9: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1909))) goto LA9;
break;
	case 10: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1902))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1911))) goto LA10;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1920))) goto LA19;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1925))) goto LA24;
break;
	case 11: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1918))) goto LA17;
break;
	case 13: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1912))) goto LA11;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1915))) goto LA14;
break;
	case 14: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1916))) goto LA15;
break;
	case 15: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1923))) goto LA22;
break;
	case 16: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1904))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1924))) goto LA23;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1927))) goto LA26;
break;
	case 19: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1906))) goto LA7;
break;
	case 25: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1901))) goto LA6;
break;
	case 26: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1922))) goto LA21;
break;
	case 27: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1905))) goto LA7;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1910))) goto LA10;
break;
	case 29: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1917))) goto LA16;
break;
	case 31: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1907))) goto LA8;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1913))) goto LA12;
break;
	}
	goto LA27;
	LA6: ;
	{
		gcmd_155130 = ((NU8) 1);
		commandcompiletoc_525071();
	}
	goto LA28;
	LA7: ;
	{
		gcmd_155130 = ((NU8) 2);
		definesymbol_169013(((NimStringDesc*) &TMP1905));
		commandcompiletoc_525071();
	}
	goto LA28;
	LA8: ;
	{
		gcmd_155130 = ((NU8) 3);
		definesymbol_169013(((NimStringDesc*) &TMP1907));
		commandcompiletoc_525071();
	}
	goto LA28;
	LA9: ;
	{
		gcmd_155130 = ((NU8) 19);
		rawmessage_165960(((NU16) 180), command_155239);
	}
	goto LA28;
	LA10: ;
	{
		gcmd_155130 = ((NU8) 4);
		commandcompiletojs_525132();
	}
	goto LA28;
	LA11: ;
	{
		wantmainmodule_523922();
		gcmd_155130 = ((NU8) 8);
		loadconfigs_187609(((NimStringDesc*) &TMP4758));
		commanddoc_344360();
	}
	goto LA28;
	LA12: ;
	{
		gcmd_155130 = ((NU8) 8);
		loadconfigs_187609(((NimStringDesc*) &TMP4758));
		definesymbol_169013(((NimStringDesc*) &TMP4885));
		commanddoc2_525060();
	}
	goto LA28;
	LA13: ;
	{
		gcmd_155130 = ((NU8) 16);
		loadconfigs_187609(((NimStringDesc*) &TMP4758));
		commandrst2html_344400();
	}
	goto LA28;
	LA14: ;
	{
		gcmd_155130 = ((NU8) 17);
		loadconfigs_187609(((NimStringDesc*) &TMP4891));
		commandrst2tex_344408();
	}
	goto LA28;
	LA15: ;
	{
		wantmainmodule_523922();
		gcmd_155130 = ((NU8) 8);
		loadconfigs_187609(((NimStringDesc*) &TMP4758));
		wantmainmodule_523922();
		definesymbol_169013(((NimStringDesc*) &TMP4885));
		commandjson_344416();
	}
	goto LA28;
	LA16: ;
	{
		gcmd_155130 = ((NU8) 8);
		loadconfigs_187609(((NimStringDesc*) &TMP4758));
		commandbuildindex_344452();
	}
	goto LA28;
	LA17: ;
	{
		gcmd_155130 = ((NU8) 9);
		commandgendepend_525041();
	}
	goto LA28;
	LA18: ;
	{
		gcmd_155130 = ((NU8) 10);
		{
			NimStringDesc* LOC44;
			Jsonnodeobj290726* definedsymbols;
			Jsonnodeobj290726* libpaths;
			Jsonnodeobj290726* dumpdata;
			TY526027 LOC65;
			NimStringDesc* LOC66;
			LOC44 = 0;
			LOC44 = getconfigvar_155334(((NimStringDesc*) &TMP4964));
			if (!eqStrings(LOC44, ((NimStringDesc*) &TMP4965))) goto LA45;
			wantmainmodule_523922();
			definedsymbols = newjarray_290927();
			{
				NimStringDesc* s_526002;
				s_526002 = 0;
				{
					NimStringDesc* key_526406;
					NimStringDesc* val_526408;
					key_526406 = 0;
					val_526408 = 0;
					{
						NI h_526410;
						NI HEX3Atmp_526412;
						NI res_526414;
						h_526410 = 0;
						HEX3Atmp_526412 = 0;
						HEX3Atmp_526412 = ((*gsymbols_169004).data ? ((*gsymbols_169004).data->Sup.len-1) : -1);
						res_526414 = ((NI) 0);
						{
							while (1) {
								if (!(res_526414 <= HEX3Atmp_526412)) goto LA51;
								h_526410 = res_526414;
								{
									if (!!((*gsymbols_169004).data->data[h_526410].Field0 == 0)) goto LA54;
									key_526406 = (*gsymbols_169004).data->data[h_526410].Field0;
									val_526408 = (*gsymbols_169004).data->data[h_526410].Field1;
									{
										Jsonnodeobj290726* LOC60;
										if (!!(eqStrings(val_526408, ((NimStringDesc*) &TMP4966)))) goto LA58;
										s_526002 = key_526406;
										LOC60 = 0;
										LOC60 = HEX25_291130(s_526002);
										(*definedsymbols).kindU.S7.elems = (TY290746*) incrSeq(&((*definedsymbols).kindU.S7.elems)->Sup, sizeof(Jsonnodeobj290726*));
										asgnRefNoCycle((void**) (&(*definedsymbols).kindU.S7.elems->data[(*definedsymbols).kindU.S7.elems->Sup.len-1]), LOC60);
									}
									LA58: ;
								}
								LA54: ;
								res_526414 += ((NI) 1);
							} LA51: ;
						}
					}
				}
			}
			libpaths = newjarray_290927();
			{
				NimStringDesc* dir_526015;
				Tstrentry130024* it_526420;
				dir_526015 = 0;
				it_526420 = ((Tstrentry130024*) (searchpaths_155132.head));
				{
					while (1) {
						Jsonnodeobj290726* LOC64;
						if (!!((it_526420 == NIM_NIL))) goto LA63;
						dir_526015 = (*it_526420).data;
						LOC64 = 0;
						LOC64 = HEX25_291130(dir_526015);
						(*libpaths).kindU.S7.elems = (TY290746*) incrSeq(&((*libpaths).kindU.S7.elems)->Sup, sizeof(Jsonnodeobj290726*));
						asgnRefNoCycle((void**) (&(*libpaths).kindU.S7.elems->data[(*libpaths).kindU.S7.elems->Sup.len-1]), LOC64);
						it_526420 = ((Tstrentry130024*) ((*it_526420).Sup.next));
					} LA63: ;
				}
			}
			memset((void*)LOC65, 0, sizeof(LOC65));
			LOC65[0].Field0 = copyString(((NimStringDesc*) &TMP4967));
			LOC65[0].Field1 = HEX25_291130(((NimStringDesc*) &TMP4968));
			LOC65[1].Field0 = copyString(((NimStringDesc*) &TMP4969));
			LOC65[1].Field1 = HEX25_291130(gprojectfull_155236);
			LOC65[2].Field0 = copyString(((NimStringDesc*) &TMP4970));
			LOC65[2].Field1 = definedsymbols;
			LOC65[3].Field0 = copyString(((NimStringDesc*) &TMP4971));
			LOC65[3].Field1 = libpaths;
			dumpdata = HEX25_291206(LOC65, 4);
			LOC66 = 0;
			LOC66 = HEX24_294458(dumpdata);
			outwriteln_165505(LOC66);
		}
		goto LA42;
		LA45: ;
		{
			outwriteln_165505(((NimStringDesc*) &TMP4972));
			{
				NimStringDesc* s_526042;
				s_526042 = 0;
				{
					NimStringDesc* key_526426;
					NimStringDesc* val_526428;
					key_526426 = 0;
					val_526428 = 0;
					{
						NI h_526430;
						NI HEX3Atmp_526432;
						NI res_526434;
						h_526430 = 0;
						HEX3Atmp_526432 = 0;
						HEX3Atmp_526432 = ((*gsymbols_169004).data ? ((*gsymbols_169004).data->Sup.len-1) : -1);
						res_526434 = ((NI) 0);
						{
							while (1) {
								if (!(res_526434 <= HEX3Atmp_526432)) goto LA72;
								h_526430 = res_526434;
								{
									if (!!((*gsymbols_169004).data->data[h_526430].Field0 == 0)) goto LA75;
									key_526426 = (*gsymbols_169004).data->data[h_526430].Field0;
									val_526428 = (*gsymbols_169004).data->data[h_526430].Field1;
									{
										if (!!(eqStrings(val_526428, ((NimStringDesc*) &TMP4966)))) goto LA79;
										s_526042 = key_526426;
										outwriteln_165505(s_526042);
									}
									LA79: ;
								}
								LA75: ;
								res_526434 += ((NI) 1);
							} LA72: ;
						}
					}
				}
			}
			outwriteln_165505(((NimStringDesc*) &TMP4973));
			{
				NimStringDesc* it_526043;
				Tstrentry130024* it_526440;
				it_526043 = 0;
				it_526440 = ((Tstrentry130024*) (searchpaths_155132.head));
				{
					while (1) {
						if (!!((it_526440 == NIM_NIL))) goto LA83;
						it_526043 = (*it_526440).data;
						msgwriteln_165536(it_526043);
						it_526440 = ((Tstrentry130024*) ((*it_526440).Sup.next));
					} LA83: ;
				}
			}
		}
		LA42: ;
	}
	goto LA28;
	LA19: ;
	{
		gcmd_155130 = ((NU8) 11);
		commandcheck_525049();
	}
	goto LA28;
	LA20: ;
	{
		Tnode191813* LOC86;
		gcmd_155130 = ((NU8) 12);
		wantmainmodule_523922();
		LOC86 = 0;
		LOC86 = parsefile_219041(gprojectmainidx_155237);
	}
	goto LA28;
	LA21: ;
	{
		gcmd_155130 = ((NU8) 13);
		wantmainmodule_523922();
		commandscan_525278();
		msgwriteln_165536(((NimStringDesc*) &TMP4977));
	}
	goto LA28;
	LA22: ;
	{
		gcmd_155130 = ((NU8) 18);
		commandinteractive_525207();
	}
	goto LA28;
	LA23: ;
	{
		NimStringDesc* LOC90;
		LOC90 = 0;
		LOC90 = maincommandarg_155307();
		commandeval_525256(LOC90);
	}
	goto LA28;
	LA24: ;
	{
		resetmemory_525338();
	}
	goto LA28;
	LA25: ;
	{
		gcmd_155130 = ((NU8) 14);
		{
			if (!!(((gevalexpr_155140) && (gevalexpr_155140)->Sup.len == 0))) goto LA95;
			commandeval_525256(gevalexpr_155140);
		}
		goto LA93;
		LA95: ;
		{
			commandsuggest_525325();
		}
		LA93: ;
	}
	goto LA28;
	LA26: ;
	{
		isserving_155143 = NIM_TRUE;
		gglobaloptions_155128 |= ((NI32)1)<<((((NU8) 15))%(sizeof(NI32)*8));
		gerrormax_165018 = ((NI) 2147483647);
		serve_522254(maincommand_525628);
	}
	goto LA28;
	LA27: ;
	{
		rawmessage_165960(((NU16) 180), command_155239);
	}
	LA28: ;
	{
		NIM_BOOL LOC102;
		NIM_BOOL LOC103;
		TY165825 LOC108;
		NF LOC109;
		NI LOC110;
		LOC102 = 0;
		LOC103 = 0;
		LOC103 = (gerrorcounter_165015 == ((NI) 0));
		if (!(LOC103)) goto LA104;
		LOC103 = !(((525376 &(1<<((gcmd_155130)&31)))!=0));
		LA104: ;
		LOC102 = LOC103;
		if (!(LOC102)) goto LA105;
		LOC102 = (((NI) 0) < gverbosity_155137);
		LA105: ;
		if (!LOC102) goto LA106;
		memset((void*)LOC108, 0, sizeof(LOC108));
		LOC108[0] = nimIntToStr(glinescompiled_182213);
		LOC109 = 0;
		LOC109 = ntepochTime();
		LOC108[1] = nsuformatFloat(((NF)(LOC109) - (NF)(glastcmdtime_155141)), ((NU8) 1), ((NI) 3));
		LOC110 = 0;
		LOC110 = gettotalmem_6699();
		LOC108[2] = formatsize_100697(((NI64) (LOC110)), 46);
		{
			NIM_BOOL LOC113;
			LOC113 = 0;
			LOC113 = isdefined_169031(((NimStringDesc*) &TMP5012));
			if (!LOC113) goto LA114;
			LOC108[3] = copyString(((NimStringDesc*) &TMP5013));
		}
		goto LA111;
		LA114: ;
		{
			LOC108[3] = copyString(((NimStringDesc*) &TMP5014));
		}
		LA111: ;
		rawmessage_165888(((NU16) 262), LOC108, 4);
	}
	LA106: ;
}
NIM_EXTERNC N_NOINLINE(void, nimsrc_mainInit)(void) {
}

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

