/* Generated by Nim Compiler v0.11.2 */
/*   (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 Tlinkedlist130028 Tlinkedlist130028;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tlistentry130022 Tlistentry130022;
typedef struct Tpass241017 Tpass241017;
typedef struct Tpasscontext241005 Tpasscontext241005;
typedef struct Tsym190843 Tsym190843;
typedef struct Trodreader233030 Trodreader233030;
typedef struct Tnode190813 Tnode190813;
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 TY522054 TY522054;
typedef struct Tmoduleinmemory522017 Tmoduleinmemory522017;
typedef struct TY190933 TY190933;
typedef struct Jsonnodeobj289726 Jsonnodeobj289726;
typedef struct Stringtableobj134012 Stringtableobj134012;
typedef struct TNimObject TNimObject;
typedef struct TNimNode TNimNode;
typedef struct Keyvaluepairseq134010 Keyvaluepairseq134010;
typedef struct Keyvaluepair134008 Keyvaluepair134008;
typedef struct TY289741 TY289741;
typedef struct TY289746 TY289746;
typedef struct Tstrentry130024 Tstrentry130024;
typedef struct TY290209 TY290209;
typedef struct Tllstream178204 Tllstream178204;
typedef struct Tlexer181185 Tlexer181185;
typedef struct Tbaselexer179024 Tbaselexer179024;
typedef struct Tlineinfo163338 Tlineinfo163338;
typedef struct Ttoken181181 Ttoken181181;
typedef struct Tident167021 Tident167021;
typedef struct TY122008 TY122008;
typedef struct Tidobj167015 Tidobj167015;
typedef struct Ttypeseq190845 Ttypeseq190845;
typedef struct Tscope190837 Tscope190837;
typedef struct TY190944 TY190944;
typedef struct Tstrtable190817 Tstrtable190817;
typedef struct Tsymseq190815 Tsymseq190815;
typedef struct Ttype190849 Ttype190849;
typedef struct Tloc190827 Tloc190827;
typedef struct Ropeobj161009 Ropeobj161009;
typedef struct Tlib190831 Tlib190831;
typedef struct Tindex233028 Tindex233028;
typedef struct Tiitable198274 Tiitable198274;
typedef struct Tiipairseq198272 Tiipairseq198272;
typedef struct Tidtable190861 Tidtable190861;
typedef struct Tidpairseq190859 Tidpairseq190859;
typedef struct Memfile231208 Memfile231208;
typedef struct Tnodeseq190807 Tnodeseq190807;
typedef struct Tbasechunk27438 Tbasechunk27438;
typedef struct Tfreecell27430 Tfreecell27430;
typedef struct Tinstantiation190833 Tinstantiation190833;
typedef struct Tiipair198270 Tiipair198270;
typedef struct Tidpair190857 Tidpair190857;
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(Tpasscontext241005*, Tpassopen241009) (Tsym190843* module);
typedef N_NIMCALL_PTR(Tpasscontext241005*, Tpassopencached241011) (Tsym190843* module, Trodreader233030* rd);
typedef N_NIMCALL_PTR(Tnode190813*, Tpassprocess241015) (Tpasscontext241005* p, Tnode190813* toplevelstmt);
typedef N_NIMCALL_PTR(Tnode190813*, Tpassclose241013) (Tpasscontext241005* p, Tnode190813* n);
struct Tpass241017 {
Tpassopen241009 Field0;
Tpassopencached241011 Field1;
Tpassprocess241015 Field2;
Tpassclose241013 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  Tmoduleinmemory522017  {
NF compiledat;
NI32 crc;
TY190933* 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  Jsonnodeobj289726  {
NU8 kind;
union{
struct {NimStringDesc* str;
} S1;
struct {NI64 num;
} S2;
struct {NF fnum;
} S3;
struct {NIM_BOOL bval;
} S4;
struct {TY289741* fields;
} S6;
struct {TY289746* elems;
} S7;
} kindU;
};
struct  Tlistentry130022  {
  TNimObject Sup;
Tlistentry130022* prev;
Tlistentry130022* next;
};
struct  Tstrentry130024  {
  Tlistentry130022 Sup;
NimStringDesc* data;
};
struct TY290209 {
NimStringDesc* Field0;
Jsonnodeobj289726* Field1;
};
typedef TY290209 TY525027[4];
struct  Tbaselexer179024  {
  TNimObject Sup;
NI bufpos;
NCSTRING buf;
NI buflen;
Tllstream178204* stream;
NI linenumber;
NI sentinel;
NI linestart;
};
struct  Tlineinfo163338  {
NI16 line;
NI16 col;
NI32 fileindex;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (Tlineinfo163338 info, NU16 msg, NimStringDesc* arg, void* ClEnv);
void* ClEnv;
} Terrorhandler181183;
struct  Tlexer181185  {
  Tbaselexer179024 Sup;
NI32 fileidx;
NI indentahead;
NI currlineindent;
NIM_BOOL strongspaces;
Terrorhandler181183 errorhandler;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Ttoken181181  {
NU8 toktype;
NI indent;
Tident167021* ident;
NI64 inumber;
NF fnumber;
NU8 base;
NI8 strongspacea;
NI8 strongspaceb;
NimStringDesc* literal;
NI line;
NI col;
};
struct  Tidobj167015  {
  TNimObject Sup;
NI id;
};
struct  Tstrtable190817  {
NI counter;
Tsymseq190815* data;
};
struct  Tloc190827  {
NU8 k;
NU8 s;
NU16 flags;
Ttype190849* t;
Ropeobj161009* r;
Ropeobj161009* heaproot;
};
struct  Tsym190843  {
  Tidobj167015 Sup;
NU8 kind;
union{
struct {Ttypeseq190845* typeinstcache;
Tscope190837* typscope;
} S1;
struct {TY190944* procinstcache;
Tsym190843* gcunsafetyreason;
} S2;
struct {TY190944* usedgenerics;
Tstrtable190817 tab;
} S3;
struct {Tsym190843* guard;
} S4;
} kindU;
NU16 magic;
Ttype190849* typ;
Tident167021* name;
Tlineinfo163338 info;
Tsym190843* owner;
NU32 flags;
Tnode190813* ast;
NU32 options;
NI position;
NI offset;
Tloc190827 loc;
Tlib190831* annex;
Tnode190813* constraint;
};
typedef Tpass241017 TY524241[3];
typedef Tident167021* TY167034[8192];
typedef N_NIMCALL_PTR(void, TY521256) (void);
typedef NimStringDesc* TY164825[4];
struct  Tpasscontext241005  {
  TNimObject Sup;
NIM_BOOL fromcache;
};
struct  Tiitable198274  {
NI counter;
Tiipairseq198272* data;
};
struct  Tindex233028  {
NI lastidxkey;
NI lastidxval;
Tiitable198274 tab;
NimStringDesc* r;
NI offset;
};
struct  Tidtable190861  {
NI counter;
Tidpairseq190859* data;
};
struct  Memfile231208  {
void* mem;
NI size;
int handle;
};
struct  Trodreader233030  {
  TNimObject Sup;
NI pos;
NCSTRING s;
NU32 options;
NU8 reason;
TY190933* moddeps;
TY190933* files;
NI dataidx;
NI convertersidx;
NI initidx;
NI interfidx;
NI compilerprocsidx;
NI methodsidx;
NimStringDesc* filename;
Tindex233028 index;
Tindex233028 imports;
NI readerindex;
NI line;
NI moduleid;
Tidtable190861 syms;
Memfile231208 memfile;
Tsymseq190815* methods;
NimStringDesc* origfile;
NIM_BOOL inviewmode;
};
struct  Tnode190813  {
Ttype190849* typ;
Tlineinfo163338 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym190843* sym;
} S4;
struct {Tident167021* ident;
} S5;
struct {Tnodeseq190807* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
typedef NI TY27420[8];
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  Tllstream178204  {
  TNimObject Sup;
NU8 kind;
FILE* f;
NimStringDesc* s;
NI rd;
NI wr;
NI lineoffset;
};
struct  Tident167021  {
  Tidobj167015 Sup;
NimStringDesc* s;
Tident167021* next;
NI h;
};
struct  Tscope190837  {
NI depthlevel;
Tstrtable190817 symbols;
Tnodeseq190807* usingsyms;
Tscope190837* parent;
};
struct  Ttype190849  {
  Tidobj167015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq190845* sons;
Tnode190813* n;
Tsym190843* owner;
Tsym190843* sym;
Tsym190843* destructor;
Tsym190843* deepcopy;
Tsym190843* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc190827 loc;
};
struct  Ropeobj161009  {
  TNimObject Sup;
Ropeobj161009* left;
Ropeobj161009* right;
NI length;
NimStringDesc* data;
};
struct  Tlib190831  {
  Tlistentry130022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj161009* name;
Tnode190813* path;
};
struct  Tiipair198270  {
NI key;
NI val;
};
struct  Tidpair190857  {
Tidobj167015* key;
TNimObject* val;
};
struct  Tfreecell27430  {
Tfreecell27430* next;
NI zerofield;
};
struct  Tinstantiation190833  {
Tsym190843* sym;
Ttypeseq190845* concretetypes;
TY190933* usedby;
};
struct TY522054 {
  TGenericSeq Sup;
  Tmoduleinmemory522017 data[SEQ_DECL_SIZE];
};
struct TY289746 {
  TGenericSeq Sup;
  Jsonnodeobj289726* data[SEQ_DECL_SIZE];
};
struct TY122008 {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct Tsymseq190815 {
  TGenericSeq Sup;
  Tsym190843* data[SEQ_DECL_SIZE];
};
struct TY190933 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq134010 {
  TGenericSeq Sup;
  Keyvaluepair134008 data[SEQ_DECL_SIZE];
};
struct TY289741 {
  TGenericSeq Sup;
  TY290209 data[SEQ_DECL_SIZE];
};
struct Ttypeseq190845 {
  TGenericSeq Sup;
  Ttype190849* data[SEQ_DECL_SIZE];
};
struct TY190944 {
  TGenericSeq Sup;
  Tinstantiation190833* data[SEQ_DECL_SIZE];
};
struct Tiipairseq198272 {
  TGenericSeq Sup;
  Tiipair198270 data[SEQ_DECL_SIZE];
};
struct Tidpairseq190859 {
  TGenericSeq Sup;
  Tidpair190857 data[SEQ_DECL_SIZE];
};
struct Tnodeseq190807 {
  TGenericSeq Sup;
  Tnode190813* data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, clearpasses_241182)(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_189440)(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_524071)(void);
N_NIMCALL(void, initvars_170876)(void);
N_NIMCALL(void, semanticpasses_524033)(void);
N_NIMCALL(void, registerpass_241190)(Tpass241017* p);
N_NIMCALL(Tpasscontext241005*, verboseopen_505012)(Tsym190843* s);
N_NIMCALL(Tnode190813*, verboseprocess_505023)(Tpasscontext241005* context, Tnode190813* n);
N_NIMCALL(Tpasscontext241005*, myopen_450686)(Tsym190843* module);
N_NIMCALL(Tpasscontext241005*, myopencached_450723)(Tsym190843* module, Trodreader233030* rd);
N_NIMCALL(Tnode190813*, myprocess_450851)(Tpasscontext241005* context, Tnode190813* n);
N_NIMCALL(Tnode190813*, myclose_450867)(Tpasscontext241005* context, Tnode190813* n);
N_NIMCALL(Tpasscontext241005*, myopen_492968)(Tsym190843* module);
N_NIMCALL(Tpasscontext241005*, myopencached_493120)(Tsym190843* module, Trodreader233030* rd);
N_NIMCALL(Tnode190813*, myprocess_493208)(Tpasscontext241005* b, Tnode190813* n);
N_NIMCALL(Tnode190813*, myclose_493642)(Tpasscontext241005* b, Tnode190813* n);
N_NIMCALL(void, rodpass_524007)(void);
N_NIMCALL(Tpasscontext241005*, myopen_254250)(Tsym190843* module);
N_NIMCALL(Tnode190813*, process_253968)(Tpasscontext241005* c, Tnode190813* n);
N_NIMCALL(Tnode190813*, myclose_254265)(Tpasscontext241005* c, Tnode190813* n);
N_NIMCALL(void, compileproject_522985)(NI32 projectfileidx);
N_NIMCALL(void, cgenwritemodules_493720)(void);
N_NIMCALL(void, callccompiler_171574)(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_492850)(void);
N_NIMCALL(void, resetcompilationlists_170943)(void);
N_NIMCALL(void, resetcaches_454448)(void);
N_NIMCALL(void, Gcfullcollect_8805)(void);
N_NIMCALL(void, definesymbol_168013)(NimStringDesc* symbol);
N_NIMCALL(void, rawmessage_164960)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, commandcompiletojs_524132)(void);
N_NIMCALL(void, settarget_159634)(NU8 o, NU8 c);
N_NIMCALL(Tpasscontext241005*, myopen_503742)(Tsym190843* s);
N_NIMCALL(Tpasscontext241005*, myopencached_503731)(Tsym190843* s, Trodreader233030* rd);
N_NIMCALL(Tnode190813*, myprocess_503597)(Tpasscontext241005* b, Tnode190813* n);
N_NIMCALL(Tnode190813*, myclose_503703)(Tpasscontext241005* b, Tnode190813* n);
N_NIMCALL(void, wantmainmodule_522922)(void);
N_NIMCALL(void, loadconfigs_186609)(NimStringDesc* cfg);
N_NIMCALL(void, commanddoc_343360)(void);
N_NIMCALL(void, commanddoc2_524060)(void);
N_NIMCALL(Tpasscontext241005*, myopen_507068)(Tsym190843* module);
N_NIMCALL(Tnode190813*, processnode_507056)(Tpasscontext241005* c, Tnode190813* n);
N_NIMCALL(Tnode190813*, close_507018)(Tpasscontext241005* p, Tnode190813* n);
N_NIMCALL(void, finishdoc2pass_507106)(NimStringDesc* project);
N_NIMCALL(void, commandrst2html_343400)(void);
N_NIMCALL(void, commandrst2tex_343408)(void);
N_NIMCALL(void, commandjson_343416)(void);
N_NIMCALL(void, commandbuildindex_343452)(void);
N_NIMCALL(void, commandgendepend_524041)(void);
N_NIMCALL(Tpasscontext241005*, myopen_506131)(Tsym190843* module);
N_NIMCALL(Tnode190813*, adddotdependency_506041)(Tpasscontext241005* c, Tnode190813* n);
N_NIMCALL(Tnode190813*, cleanup_505066)(Tpasscontext241005* c, Tnode190813* n);
N_NIMCALL(void, generatedot_506009)(NimStringDesc* project);
N_NIMCALL(void, execexternalprogram_170985)(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_154334)(NimStringDesc* key);
N_NIMCALL(Jsonnodeobj289726*, newjarray_289927)(void);
N_NIMCALL(Jsonnodeobj289726*, HEX25_290130)(NimStringDesc* s);
N_NIMCALL(TGenericSeq*, incrSeq)(TGenericSeq* seq, NI elemsize);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(Jsonnodeobj289726*, HEX25_290206)(TY290209* keyvals, NI keyvalsLen0);
N_NIMCALL(void, outwriteln_164505)(NimStringDesc* s);
N_NIMCALL(NimStringDesc*, HEX24_293458)(Jsonnodeobj289726* node);
N_NIMCALL(void, msgwriteln_164536)(NimStringDesc* s);
N_NIMCALL(void, commandcheck_524049)(void);
N_NIMCALL(Tnode190813*, parsefile_218041)(NI32 fileidx);
N_NIMCALL(void, commandscan_524278)(void);
N_NIMCALL(NimStringDesc*, nosaddFileExt)(NimStringDesc* filename, NimStringDesc* ext);
N_NIMCALL(NimStringDesc*, maincommandarg_154307)(void);
N_NIMCALL(Tllstream178204*, llstreamopen_178256)(NimStringDesc* filename, NU8 mode);
N_NIMCALL(void, inittoken_181369)(Ttoken181181* L);
N_NIMCALL(void, openlexer_181412)(Tlexer181185* lex, NimStringDesc* filename, Tllstream178204* inputstream);
N_NIMCALL(void, rawgettok_184848)(Tlexer181185* L, Ttoken181181* tok);
N_NIMCALL(void, printtok_181355)(Ttoken181181* tok);
N_NIMCALL(void, closelexer_181424)(Tlexer181185* lex);
N_NIMCALL(void, commandinteractive_524207)(void);
N_NIMCALL(void, interactivepasses_524140)(void);
N_NIMCALL(void, initdefines_168254)(void);
N_NIMCALL(Tpasscontext241005*, myopen_396852)(Tsym190843* module);
N_NIMCALL(Tnode190813*, myprocess_397012)(Tpasscontext241005* c, Tnode190813* n);
N_NIMCALL(void, compilesystemmodule_522901)(void);
N_NIMCALL(Tsym190843*, compilemodule_522726)(NI32 fileidx, NU32 flags);
N_NIMCALL(NI32, fileinfoidx_163853)(NimStringDesc* filename);
N_NIMCALL(Tsym190843*, makestdinmodule_523003)(void);
N_NIMCALL(void, processmodule_241056)(Tsym190843* module, Tllstream178204* stream, Trodreader233030* rd);
N_NIMCALL(Tllstream178204*, llstreamopenstdin_178293)(void);
N_NIMCALL(void, commandeval_524256)(NimStringDesc* exp);
N_NIMCALL(void, evalnim_524246)(Tnode190813* nodes, Tsym190843* module);
N_NIMCALL(void, carrypasses_241231)(Tnode190813* nodes, Tsym190843* module, Tpass241017* passes, NI passesLen0);
N_NIMCALL(Tnode190813*, parsestring_210306)(NimStringDesc* s, NimStringDesc* filename, NI line, Terrorhandler181183 errorhandler);
N_NIMCALL(void, resetmemory_524338)(void);
N_NIMCALL(void, resetallmodules_522350)(void);
N_NIMCALL(void, resetropecache_161111)(void);
N_NIMCALL(void, resetsystypes_238302)(void);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
N_NIMCALL(void, commandsuggest_524325)(void);
N_NIMCALL(void, resetmodule_522317)(NI32 fileidx);
N_NIMCALL(void, serve_521254)(TY521256 action);
N_NIMCALL(void, maincommand_524628)(void);
N_NIMCALL(void, rawmessage_164888)(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_100698)(NI64 bytes, NIM_CHAR decimalsep);
N_NIMCALL(NI, gettotalmem_6699)(void);
N_NIMCALL(NIM_BOOL, isdefined_168031)(NimStringDesc* symbol);
STRING_LITERAL(TMP1900, "c", 1);
STRING_LITERAL(TMP1901, "cc", 2);
STRING_LITERAL(TMP1902, "compile", 7);
STRING_LITERAL(TMP1903, "compiletoc", 10);
STRING_LITERAL(TMP1904, "cpp", 3);
STRING_LITERAL(TMP1905, "compiletocpp", 12);
STRING_LITERAL(TMP1906, "objc", 4);
STRING_LITERAL(TMP1907, "compiletooc", 11);
STRING_LITERAL(TMP1908, "run", 3);
STRING_LITERAL(TMP1909, "js", 2);
STRING_LITERAL(TMP1910, "compiletojs", 11);
STRING_LITERAL(TMP1911, "doc", 3);
STRING_LITERAL(TMP1912, "doc2", 4);
STRING_LITERAL(TMP1913, "rst2html", 8);
STRING_LITERAL(TMP1914, "rst2tex", 7);
STRING_LITERAL(TMP1915, "jsondoc", 7);
STRING_LITERAL(TMP1916, "buildindex", 10);
STRING_LITERAL(TMP1917, "gendepend", 9);
STRING_LITERAL(TMP1918, "dump", 4);
STRING_LITERAL(TMP1919, "check", 5);
STRING_LITERAL(TMP1920, "parse", 5);
STRING_LITERAL(TMP1921, "scan", 4);
STRING_LITERAL(TMP1922, "i", 1);
STRING_LITERAL(TMP1923, "e", 1);
STRING_LITERAL(TMP1924, "reset", 5);
STRING_LITERAL(TMP1925, "idetools", 8);
STRING_LITERAL(TMP1926, "serve", 5);
STRING_LITERAL(TMP4356, "-", 1);
STRING_LITERAL(TMP4357, "stdinfile", 9);
STRING_LITERAL(TMP4358, "", 0);
STRING_LITERAL(TMP4359, "nimrod", 6);
STRING_LITERAL(TMP4360, "ecmascript", 10);
STRING_LITERAL(TMP4757, "nimdoc.cfg", 10);
STRING_LITERAL(TMP4884, "nimdoc", 6);
STRING_LITERAL(TMP4890, "nimdoc.tex.cfg", 14);
STRING_LITERAL(TMP4960, "dot -Tpng -o", 12);
STRING_LITERAL(TMP4961, "png", 3);
STRING_LITERAL(TMP4962, "dot", 3);
STRING_LITERAL(TMP4963, "dump.format", 11);
STRING_LITERAL(TMP4964, "json", 4);
STRING_LITERAL(TMP4965, "false", 5);
STRING_LITERAL(TMP4966, "version", 7);
STRING_LITERAL(TMP4967, "0.11.2", 6);
STRING_LITERAL(TMP4968, "project_path", 12);
STRING_LITERAL(TMP4969, "defined_symbols", 15);
STRING_LITERAL(TMP4970, "lib_paths", 9);
STRING_LITERAL(TMP4971, "-- list of currently defined symbols --", 39);
STRING_LITERAL(TMP4972, "-- end of list --", 17);
STRING_LITERAL(TMP4973, "nim", 3);
STRING_LITERAL(TMP4976, "Beware: Indentation tokens depend on the parser\'s state!", 56);
STRING_LITERAL(TMP4977, "nimrodvm", 8);
STRING_LITERAL(TMP4980, "echo \"eval\\t\", repr(", 20);
STRING_LITERAL(TMP4981, ")", 1);
static NIM_CONST Terrorhandler181183 TMP4982 = {NIM_NIL,NIM_NIL};
STRING_LITERAL(TMP5011, "release", 7);
STRING_LITERAL(TMP5012, "Release Build", 13);
STRING_LITERAL(TMP5013, "Debug Build", 11);
extern NF glastcmdtime_154141;
extern Tlinkedlist130028 searchpaths_154132;
extern NimStringDesc* libpath_154233;
extern NimStringDesc* gprojectfull_154236;
extern NimStringDesc* gprojectpath_154235;
extern NI gfrontendid_189012;
extern NimStringDesc* command_154239;
extern NU8 gcmd_154130;
extern NU32 gglobaloptions_154128;
extern NimStringDesc* gprojectname_154234;
extern NIM_BOOL isserving_154143;
extern NimStringDesc* lastcaascmd_521205;
extern NimStringDesc* curcaascmd_521204;
extern Tgcheap48216 gch_48244;
extern TY522054* gmemcachedata_522071;
extern NI gerrormax_164015;
extern Stringtableobj134012* gsymbols_168004;
extern NI32 gprojectmainidx_154237;
extern TNimType NTI181185; /* TLexer */
extern TY122008* commandargs_154257;
extern Tsym190843* systemmodule_238019;
extern Tsymseq190815* gowners_244288;
extern TNimType NTI190815; /* TSymSeq */
extern Tsym190843* rangedestructorproc_431422;
extern TY167034 buckets_167039;
extern Tident167021* idanon_167495;
extern NimStringDesc* gevalexpr_154140;
extern Tlineinfo163338 gtrackpos_164500;
extern NI gerrorcounter_164012;
extern NI gverbosity_154137;
extern NI glinescompiled_181213;

static N_INLINE(void, setid_189440)(NI id) {
	gfrontendid_189012 = ((gfrontendid_189012 >= (NI)(id + ((NI) 1))) ? gfrontendid_189012 : (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_524033)(void) {
	Tpass241017 LOC1;
	Tpass241017 LOC2;
	LOC1.Field0 = verboseopen_505012;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = verboseprocess_505023;
	LOC1.Field3 = NIM_NIL;
	registerpass_241190((&LOC1));
	LOC2.Field0 = myopen_450686;
	LOC2.Field1 = myopencached_450723;
	LOC2.Field2 = myprocess_450851;
	LOC2.Field3 = myclose_450867;
	registerpass_241190((&LOC2));
}

N_NIMCALL(void, rodpass_524007)(void) {
	{
		Tpass241017 LOC5;
		if (!((gglobaloptions_154128 &(1<<((((NU8) 14))&31)))!=0)) goto LA3;
		LOC5.Field0 = myopen_254250;
		LOC5.Field1 = NIM_NIL;
		LOC5.Field2 = process_253968;
		LOC5.Field3 = myclose_254265;
		registerpass_241190((&LOC5));
	}
	LA3: ;
}

static N_INLINE(Tcell46347*, usrtocell_49846)(void* usr) {
	Tcell46347* result;
	result = 0;
	result = ((Tcell46347*) ((NI)((NU64)(((NI) (usr))) - (NU64)(((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 (!((NU64)((*c).refcount) < (NU64)(((NI) 8)))) goto LA3;
		rtladdzct_51404(c);
	}
	LA3: ;
}

N_NIMCALL(void, commandcompiletoc_524071)(void) {
	Tpass241017 LOC1;
	initvars_170876();
	semanticpasses_524033();
	LOC1.Field0 = myopen_492968;
	LOC1.Field1 = myopencached_493120;
	LOC1.Field2 = myprocess_493208;
	LOC1.Field3 = myclose_493642;
	registerpass_241190((&LOC1));
	rodpass_524007();
	compileproject_522985(((NI32) -1));
	cgenwritemodules_493720();
	{
		NimStringDesc* LOC6;
		if (!!((gcmd_154130 == ((NU8) 19)))) goto LA4;
		LOC6 = 0;
		{
			if (!eqStrings(gprojectname_154234, ((NimStringDesc*) &TMP4356))) goto LA9;
			LOC6 = copyString(((NimStringDesc*) &TMP4357));
		}
		goto LA7;
		LA9: ;
		{
			LOC6 = noschangeFileExt(gprojectfull_154236, ((NimStringDesc*) &TMP4358));
		}
		LA7: ;
		callccompiler_171574(LOC6);
	}
	LA4: ;
	{
		NimStringDesc* LOC16;
		if (!isserving_154143) goto LA14;
		LOC16 = 0;
		LOC16 = lastcaascmd_521205; lastcaascmd_521205 = copyStringRC1(curcaascmd_521204);
		if (LOC16) nimGCunrefNoCycle(LOC16);
		resetcgenmodules_492850();
		{
			NI i_524108;
			NI HEX3Atmp_524110;
			NI res_524113;
			i_524108 = 0;
			HEX3Atmp_524110 = 0;
			HEX3Atmp_524110 = ((gmemcachedata_522071 ? gmemcachedata_522071->Sup.len : 0) - 1);
			res_524113 = ((NI) 0);
			{
				while (1) {
					if (!(res_524113 <= HEX3Atmp_524110)) goto LA19;
					i_524108 = res_524113;
					gmemcachedata_522071->data[i_524108].crcstatus = ((NU8) 1);
					gmemcachedata_522071->data[i_524108].needsrecompile = ((NU8) 0);
					res_524113 += ((NI) 1);
				} LA19: ;
			}
		}
		resetcompilationlists_170943();
		resetcaches_454448();
		Gcfullcollect_8805();
	}
	LA14: ;
}

N_NIMCALL(void, commandcompiletojs_524132)(void) {
	Tpass241017 LOC1;
	settarget_159634(((NU8) 22), ((NU8) 12));
	definesymbol_168013(((NimStringDesc*) &TMP4359));
	definesymbol_168013(((NimStringDesc*) &TMP4360));
	definesymbol_168013(((NimStringDesc*) &TMP1909));
	semanticpasses_524033();
	LOC1.Field0 = myopen_503742;
	LOC1.Field1 = myopencached_503731;
	LOC1.Field2 = myprocess_503597;
	LOC1.Field3 = myclose_503703;
	registerpass_241190((&LOC1));
	compileproject_522985(((NI32) -1));
}

N_NIMCALL(void, commanddoc2_524060)(void) {
	Tpass241017 LOC1;
	gerrormax_164015 = ((NI) IL64(9223372036854775807));
	semanticpasses_524033();
	LOC1.Field0 = myopen_507068;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = processnode_507056;
	LOC1.Field3 = close_507018;
	registerpass_241190((&LOC1));
	compileproject_522985(((NI32) -1));
	finishdoc2pass_507106(gprojectname_154234);
}

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_524041)(void) {
	Tpass241017 LOC1;
	Tpass241017 LOC2;
	NimStringDesc* LOC3;
	NimStringDesc* LOC4;
	NimStringDesc* LOC5;
	semanticpasses_524033();
	LOC1.Field0 = myopen_506131;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = adddotdependency_506041;
	LOC1.Field3 = NIM_NIL;
	registerpass_241190((&LOC1));
	LOC2.Field0 = NIM_NIL;
	LOC2.Field1 = NIM_NIL;
	LOC2.Field2 = cleanup_505066;
	LOC2.Field3 = cleanup_505066;
	registerpass_241190((&LOC2));
	compileproject_522985(((NI32) -1));
	generatedot_506009(gprojectfull_154236);
	LOC3 = 0;
	LOC4 = 0;
	LOC4 = noschangeFileExt(gprojectfull_154236, ((NimStringDesc*) &TMP4961));
	LOC5 = 0;
	LOC5 = noschangeFileExt(gprojectfull_154236, ((NimStringDesc*) &TMP4962));
	LOC3 = rawNewString(LOC4->Sup.len + LOC5->Sup.len + 13);
appendString(LOC3, ((NimStringDesc*) &TMP4960));
appendString(LOC3, LOC4);
appendChar(LOC3, 32);
appendString(LOC3, LOC5);
	execexternalprogram_170985(LOC3, ((NimStringDesc*) &TMP4358));
}

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 (!((NU64)((*c).refcount) < (NU64)(((NI) 8)))) goto LA11;
			rtladdzct_51404(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

N_NIMCALL(void, commandcheck_524049)(void) {
	gerrormax_164015 = ((NI) IL64(9223372036854775807));
	semanticpasses_524033();
	rodpass_524007();
	compileproject_522985(((NI32) -1));
}

N_NIMCALL(void, commandscan_524278)(void) {
	NimStringDesc* f;
	NimStringDesc* LOC1;
	Tllstream178204* stream;
	LOC1 = 0;
	LOC1 = maincommandarg_154307();
	f = nosaddFileExt(LOC1, ((NimStringDesc*) &TMP4973));
	stream = llstreamopen_178256(f, ((NU8) 0));
	{
		Tlexer181185 L;
		Ttoken181181 tok;
		if (!!((stream == NIM_NIL))) goto LA4;
		memset((void*)(&L), 0, sizeof(L));
		L.Sup.Sup.m_type = (&NTI181185);
		memset((void*)(&tok), 0, sizeof(tok));
		inittoken_181369((&tok));
		openlexer_181412((&L), f, stream);
		{
			while (1) {
				rawgettok_184848((&L), (&tok));
				printtok_181355((&tok));
				{
					if (!(tok.toktype == ((NU8) 1))) goto LA10;
					goto LA6;
				}
				LA10: ;
			}
		} LA6: ;
		closelexer_181424((&L));
	}
	goto LA2;
	LA4: ;
	{
		rawmessage_164960(((NU16) 3), f);
	}
	LA2: ;
}

N_NIMCALL(void, interactivepasses_524140)(void) {
	Tpass241017 LOC1;
	Tpass241017 LOC2;
	Tpass241017 LOC3;
	initdefines_168254();
	definesymbol_168013(((NimStringDesc*) &TMP4977));
	LOC1.Field0 = verboseopen_505012;
	LOC1.Field1 = NIM_NIL;
	LOC1.Field2 = verboseprocess_505023;
	LOC1.Field3 = NIM_NIL;
	registerpass_241190((&LOC1));
	LOC2.Field0 = myopen_450686;
	LOC2.Field1 = myopencached_450723;
	LOC2.Field2 = myprocess_450851;
	LOC2.Field3 = myclose_450867;
	registerpass_241190((&LOC2));
	LOC3.Field0 = myopen_396852;
	LOC3.Field1 = NIM_NIL;
	LOC3.Field2 = myprocess_397012;
	LOC3.Field3 = myprocess_397012;
	registerpass_241190((&LOC3));
}

N_NIMCALL(void, commandinteractive_524207)(void) {
	gerrormax_164015 = ((NI) IL64(9223372036854775807));
	interactivepasses_524140();
	compilesystemmodule_522901();
	{
		NI32 LOC5;
		Tsym190843* LOC6;
		if (!(((NI) 0) < (commandargs_154257 ? commandargs_154257->Sup.len : 0))) goto LA3;
		LOC5 = 0;
		LOC5 = fileinfoidx_163853(gprojectfull_154236);
		LOC6 = 0;
		LOC6 = compilemodule_522726(LOC5, 0);
	}
	goto LA1;
	LA3: ;
	{
		Tsym190843* m;
		Tllstream178204* LOC8;
		m = makestdinmodule_523003();
		(*m).flags |= ((NI32)1)<<((((NU8) 12))%(sizeof(NI32)*8));
		LOC8 = 0;
		LOC8 = llstreamopenstdin_178293();
		processmodule_241056(m, LOC8, NIM_NIL);
	}
	LA1: ;
}

N_NIMCALL(void, evalnim_524246)(Tnode190813* nodes, Tsym190843* module) {
	TY524241 LOC1;
	LOC1[0].Field0 = verboseopen_505012;
	LOC1[0].Field1 = NIM_NIL;
	LOC1[0].Field2 = verboseprocess_505023;
	LOC1[0].Field3 = NIM_NIL;
	LOC1[1].Field0 = myopen_450686;
	LOC1[1].Field1 = myopencached_450723;
	LOC1[1].Field2 = myprocess_450851;
	LOC1[1].Field3 = myclose_450867;
	LOC1[2].Field0 = myopen_396852;
	LOC1[2].Field1 = NIM_NIL;
	LOC1[2].Field2 = myprocess_397012;
	LOC1[2].Field3 = myprocess_397012;
	carrypasses_241231(nodes, module, LOC1, 3);
}

N_NIMCALL(void, commandeval_524256)(NimStringDesc* exp) {
	NimStringDesc* echoexp;
	NimStringDesc* LOC5;
	Tnode190813* LOC6;
	Tsym190843* LOC7;
	{
		if (!(systemmodule_238019 == NIM_NIL)) goto LA3;
		interactivepasses_524140();
		compilesystemmodule_522901();
	}
	LA3: ;
	LOC5 = 0;
	LOC5 = rawNewString(exp->Sup.len + 21);
appendString(LOC5, ((NimStringDesc*) &TMP4980));
appendString(LOC5, exp);
appendString(LOC5, ((NimStringDesc*) &TMP4981));
	echoexp = LOC5;
	LOC6 = 0;
	LOC6 = parsestring_210306(echoexp, ((NimStringDesc*) &TMP4358), ((NI) 0), TMP4982);
	LOC7 = 0;
	LOC7 = makestdinmodule_523003();
	evalnim_524246(LOC6, LOC7);
}

N_NIMCALL(void, resetmemory_524338)(void) {
	resetcompilationlists_170943();
	resetcaches_454448();
	resetallmodules_522350();
	resetropecache_161111();
	resetsystypes_238302();
	if (gowners_244288) nimGCunrefNoCycle(gowners_244288);
	gowners_244288 = (Tsymseq190815*) newSeqRC1((&NTI190815), 0);
	asgnRefNoCycle((void**) (&rangedestructorproc_431422), NIM_NIL);
	{
		NI i_524423;
		NI res_524605;
		i_524423 = 0;
		res_524605 = ((NI) 0);
		{
			while (1) {
				if (!(res_524605 <= ((NI) 8191))) goto LA3;
				i_524423 = ((NI) (res_524605));
				asgnRefNoCycle((void**) (&buckets_167039[(i_524423)- 0]), NIM_NIL);
				res_524605 += ((NI) 1);
			} LA3: ;
		}
	}
	asgnRefNoCycle((void**) (&idanon_167495), NIM_NIL);
}

N_NIMCALL(void, commandsuggest_524325)(void) {
	{
		NI32 gdirtybufferidx;
		Tsym190843* LOC5;
		if (!isserving_154143) goto LA3;
		commandcompiletoc_524071();
		gdirtybufferidx = gtrackpos_164500.fileindex;
		LOC5 = 0;
		LOC5 = compilemodule_522726(gdirtybufferidx, 512);
		resetmodule_522317(gdirtybufferidx);
	}
	goto LA1;
	LA3: ;
	{
		gerrormax_164015 = ((NI) IL64(9223372036854775807));
		semanticpasses_524033();
		rodpass_524007();
		compileproject_522985(((NI32) -1));
	}
	LA1: ;
}

N_NIMCALL(void, maincommand_524628)(void) {
	NimStringDesc* LOC5;
	clearpasses_241182();
	glastcmdtime_154141 = ntepochTime();
	appendstr_130268((&searchpaths_154132), libpath_154233);
	{
		if (!!(((gprojectfull_154236 ? gprojectfull_154236->Sup.len : 0) == ((NI) 0)))) goto LA3;
		prependstr_130419((&searchpaths_154132), gprojectpath_154235);
	}
	LA3: ;
	setid_189440(((NI) 100));
	LOC5 = 0;
	LOC5 = nsuNormalize(command_154239);
	switch (hashString(LOC5) & 31) {
	case 0: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1905))) goto LA7;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1907))) goto LA8;
break;
	case 1: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1916))) goto LA16;
break;
	case 2: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1918))) goto LA18;
break;
	case 4: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1920))) goto LA20;
break;
	case 9: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1908))) goto LA9;
break;
	case 10: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1901))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1919))) goto LA19;
break;
	case 12: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1903))) goto LA6;
break;
	case 13: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1911))) goto LA11;
break;
	case 14: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1925))) goto LA25;
break;
	case 15: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1922))) goto LA22;
break;
	case 16: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1923))) goto LA23;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1926))) goto LA26;
break;
	case 18: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1902))) goto LA6;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1910))) goto LA10;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1924))) goto LA24;
break;
	case 19: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1914))) goto LA14;
break;
	case 20: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1915))) goto LA15;
break;
	case 25: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1900))) goto LA6;
break;
	case 26: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1921))) goto LA21;
break;
	case 27: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1904))) goto LA7;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1909))) goto LA10;
break;
	case 29: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1917))) goto LA17;
break;
	case 31: 
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1906))) goto LA8;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1912))) goto LA12;
if (eqStrings(LOC5, ((NimStringDesc*) &TMP1913))) goto LA13;
break;
	}
	goto LA27;
	LA6: ;
	{
		gcmd_154130 = ((NU8) 1);
		commandcompiletoc_524071();
	}
	goto LA28;
	LA7: ;
	{
		gcmd_154130 = ((NU8) 2);
		definesymbol_168013(((NimStringDesc*) &TMP1904));
		commandcompiletoc_524071();
	}
	goto LA28;
	LA8: ;
	{
		gcmd_154130 = ((NU8) 3);
		definesymbol_168013(((NimStringDesc*) &TMP1906));
		commandcompiletoc_524071();
	}
	goto LA28;
	LA9: ;
	{
		gcmd_154130 = ((NU8) 19);
		rawmessage_164960(((NU16) 180), command_154239);
	}
	goto LA28;
	LA10: ;
	{
		gcmd_154130 = ((NU8) 4);
		commandcompiletojs_524132();
	}
	goto LA28;
	LA11: ;
	{
		wantmainmodule_522922();
		gcmd_154130 = ((NU8) 8);
		loadconfigs_186609(((NimStringDesc*) &TMP4757));
		commanddoc_343360();
	}
	goto LA28;
	LA12: ;
	{
		gcmd_154130 = ((NU8) 8);
		loadconfigs_186609(((NimStringDesc*) &TMP4757));
		definesymbol_168013(((NimStringDesc*) &TMP4884));
		commanddoc2_524060();
	}
	goto LA28;
	LA13: ;
	{
		gcmd_154130 = ((NU8) 16);
		loadconfigs_186609(((NimStringDesc*) &TMP4757));
		commandrst2html_343400();
	}
	goto LA28;
	LA14: ;
	{
		gcmd_154130 = ((NU8) 17);
		loadconfigs_186609(((NimStringDesc*) &TMP4890));
		commandrst2tex_343408();
	}
	goto LA28;
	LA15: ;
	{
		wantmainmodule_522922();
		gcmd_154130 = ((NU8) 8);
		loadconfigs_186609(((NimStringDesc*) &TMP4757));
		wantmainmodule_522922();
		definesymbol_168013(((NimStringDesc*) &TMP4884));
		commandjson_343416();
	}
	goto LA28;
	LA16: ;
	{
		gcmd_154130 = ((NU8) 8);
		loadconfigs_186609(((NimStringDesc*) &TMP4757));
		commandbuildindex_343452();
	}
	goto LA28;
	LA17: ;
	{
		gcmd_154130 = ((NU8) 9);
		commandgendepend_524041();
	}
	goto LA28;
	LA18: ;
	{
		gcmd_154130 = ((NU8) 10);
		{
			NimStringDesc* LOC44;
			Jsonnodeobj289726* definedsymbols;
			Jsonnodeobj289726* libpaths;
			Jsonnodeobj289726* dumpdata;
			TY525027 LOC65;
			NimStringDesc* LOC66;
			LOC44 = 0;
			LOC44 = getconfigvar_154334(((NimStringDesc*) &TMP4963));
			if (!eqStrings(LOC44, ((NimStringDesc*) &TMP4964))) goto LA45;
			wantmainmodule_522922();
			definedsymbols = newjarray_289927();
			{
				NimStringDesc* s_525002;
				s_525002 = 0;
				{
					NimStringDesc* key_525406;
					NimStringDesc* val_525408;
					key_525406 = 0;
					val_525408 = 0;
					{
						NI h_525410;
						NI HEX3Atmp_525412;
						NI res_525414;
						h_525410 = 0;
						HEX3Atmp_525412 = 0;
						HEX3Atmp_525412 = ((*gsymbols_168004).data ? ((*gsymbols_168004).data->Sup.len-1) : -1);
						res_525414 = ((NI) 0);
						{
							while (1) {
								if (!(res_525414 <= HEX3Atmp_525412)) goto LA51;
								h_525410 = res_525414;
								{
									if (!!((*gsymbols_168004).data->data[h_525410].Field0 == 0)) goto LA54;
									key_525406 = (*gsymbols_168004).data->data[h_525410].Field0;
									val_525408 = (*gsymbols_168004).data->data[h_525410].Field1;
									{
										Jsonnodeobj289726* LOC60;
										if (!!(eqStrings(val_525408, ((NimStringDesc*) &TMP4965)))) goto LA58;
										s_525002 = key_525406;
										LOC60 = 0;
										LOC60 = HEX25_290130(s_525002);
										(*definedsymbols).kindU.S7.elems = (TY289746*) incrSeq(&((*definedsymbols).kindU.S7.elems)->Sup, sizeof(Jsonnodeobj289726*));
										asgnRefNoCycle((void**) (&(*definedsymbols).kindU.S7.elems->data[(*definedsymbols).kindU.S7.elems->Sup.len-1]), LOC60);
									}
									LA58: ;
								}
								LA54: ;
								res_525414 += ((NI) 1);
							} LA51: ;
						}
					}
				}
			}
			libpaths = newjarray_289927();
			{
				NimStringDesc* dir_525015;
				Tstrentry130024* it_525420;
				dir_525015 = 0;
				it_525420 = ((Tstrentry130024*) (searchpaths_154132.head));
				{
					while (1) {
						Jsonnodeobj289726* LOC64;
						if (!!((it_525420 == NIM_NIL))) goto LA63;
						dir_525015 = (*it_525420).data;
						LOC64 = 0;
						LOC64 = HEX25_290130(dir_525015);
						(*libpaths).kindU.S7.elems = (TY289746*) incrSeq(&((*libpaths).kindU.S7.elems)->Sup, sizeof(Jsonnodeobj289726*));
						asgnRefNoCycle((void**) (&(*libpaths).kindU.S7.elems->data[(*libpaths).kindU.S7.elems->Sup.len-1]), LOC64);
						it_525420 = ((Tstrentry130024*) ((*it_525420).Sup.next));
					} LA63: ;
				}
			}
			memset((void*)LOC65, 0, sizeof(LOC65));
			LOC65[0].Field0 = copyString(((NimStringDesc*) &TMP4966));
			LOC65[0].Field1 = HEX25_290130(((NimStringDesc*) &TMP4967));
			LOC65[1].Field0 = copyString(((NimStringDesc*) &TMP4968));
			LOC65[1].Field1 = HEX25_290130(gprojectfull_154236);
			LOC65[2].Field0 = copyString(((NimStringDesc*) &TMP4969));
			LOC65[2].Field1 = definedsymbols;
			LOC65[3].Field0 = copyString(((NimStringDesc*) &TMP4970));
			LOC65[3].Field1 = libpaths;
			dumpdata = HEX25_290206(LOC65, 4);
			LOC66 = 0;
			LOC66 = HEX24_293458(dumpdata);
			outwriteln_164505(LOC66);
		}
		goto LA42;
		LA45: ;
		{
			outwriteln_164505(((NimStringDesc*) &TMP4971));
			{
				NimStringDesc* s_525042;
				s_525042 = 0;
				{
					NimStringDesc* key_525426;
					NimStringDesc* val_525428;
					key_525426 = 0;
					val_525428 = 0;
					{
						NI h_525430;
						NI HEX3Atmp_525432;
						NI res_525434;
						h_525430 = 0;
						HEX3Atmp_525432 = 0;
						HEX3Atmp_525432 = ((*gsymbols_168004).data ? ((*gsymbols_168004).data->Sup.len-1) : -1);
						res_525434 = ((NI) 0);
						{
							while (1) {
								if (!(res_525434 <= HEX3Atmp_525432)) goto LA72;
								h_525430 = res_525434;
								{
									if (!!((*gsymbols_168004).data->data[h_525430].Field0 == 0)) goto LA75;
									key_525426 = (*gsymbols_168004).data->data[h_525430].Field0;
									val_525428 = (*gsymbols_168004).data->data[h_525430].Field1;
									{
										if (!!(eqStrings(val_525428, ((NimStringDesc*) &TMP4965)))) goto LA79;
										s_525042 = key_525426;
										outwriteln_164505(s_525042);
									}
									LA79: ;
								}
								LA75: ;
								res_525434 += ((NI) 1);
							} LA72: ;
						}
					}
				}
			}
			outwriteln_164505(((NimStringDesc*) &TMP4972));
			{
				NimStringDesc* it_525043;
				Tstrentry130024* it_525440;
				it_525043 = 0;
				it_525440 = ((Tstrentry130024*) (searchpaths_154132.head));
				{
					while (1) {
						if (!!((it_525440 == NIM_NIL))) goto LA83;
						it_525043 = (*it_525440).data;
						msgwriteln_164536(it_525043);
						it_525440 = ((Tstrentry130024*) ((*it_525440).Sup.next));
					} LA83: ;
				}
			}
		}
		LA42: ;
	}
	goto LA28;
	LA19: ;
	{
		gcmd_154130 = ((NU8) 11);
		commandcheck_524049();
	}
	goto LA28;
	LA20: ;
	{
		Tnode190813* LOC86;
		gcmd_154130 = ((NU8) 12);
		wantmainmodule_522922();
		LOC86 = 0;
		LOC86 = parsefile_218041(gprojectmainidx_154237);
	}
	goto LA28;
	LA21: ;
	{
		gcmd_154130 = ((NU8) 13);
		wantmainmodule_522922();
		commandscan_524278();
		msgwriteln_164536(((NimStringDesc*) &TMP4976));
	}
	goto LA28;
	LA22: ;
	{
		gcmd_154130 = ((NU8) 18);
		commandinteractive_524207();
	}
	goto LA28;
	LA23: ;
	{
		NimStringDesc* LOC90;
		LOC90 = 0;
		LOC90 = maincommandarg_154307();
		commandeval_524256(LOC90);
	}
	goto LA28;
	LA24: ;
	{
		resetmemory_524338();
	}
	goto LA28;
	LA25: ;
	{
		gcmd_154130 = ((NU8) 14);
		{
			if (!!(((gevalexpr_154140) && (gevalexpr_154140)->Sup.len == 0))) goto LA95;
			commandeval_524256(gevalexpr_154140);
		}
		goto LA93;
		LA95: ;
		{
			commandsuggest_524325();
		}
		LA93: ;
	}
	goto LA28;
	LA26: ;
	{
		isserving_154143 = NIM_TRUE;
		gglobaloptions_154128 |= ((NI32)1)<<((((NU8) 15))%(sizeof(NI32)*8));
		gerrormax_164015 = ((NI) IL64(9223372036854775807));
		serve_521254(maincommand_524628);
	}
	goto LA28;
	LA27: ;
	{
		rawmessage_164960(((NU16) 180), command_154239);
	}
	LA28: ;
	{
		NIM_BOOL LOC102;
		NIM_BOOL LOC103;
		TY164825 LOC108;
		NF LOC109;
		NI LOC110;
		LOC102 = 0;
		LOC103 = 0;
		LOC103 = (gerrorcounter_164012 == ((NI) 0));
		if (!(LOC103)) goto LA104;
		LOC103 = !(((525376 &(1<<((gcmd_154130)&31)))!=0));
		LA104: ;
		LOC102 = LOC103;
		if (!(LOC102)) goto LA105;
		LOC102 = (((NI) 0) < gverbosity_154137);
		LA105: ;
		if (!LOC102) goto LA106;
		memset((void*)LOC108, 0, sizeof(LOC108));
		LOC108[0] = nimIntToStr(glinescompiled_181213);
		LOC109 = 0;
		LOC109 = ntepochTime();
		LOC108[1] = nsuformatFloat(((NF)(LOC109) - (NF)(glastcmdtime_154141)), ((NU8) 1), ((NI) 3));
		LOC110 = 0;
		LOC110 = gettotalmem_6699();
		LOC108[2] = formatsize_100698(((NI64) (LOC110)), 46);
		{
			NIM_BOOL LOC113;
			LOC113 = 0;
			LOC113 = isdefined_168031(((NimStringDesc*) &TMP5011));
			if (!LOC113) goto LA114;
			LOC108[3] = copyString(((NimStringDesc*) &TMP5012));
		}
		goto LA111;
		LA114: ;
		{
			LOC108[3] = copyString(((NimStringDesc*) &TMP5013));
		}
		LA111: ;
		rawmessage_164888(((NU16) 262), LOC108, 4);
	}
	LA106: ;
}
NIM_EXTERNC N_NOINLINE(void, nimsrc_mainInit)(void) {
}

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

