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

#include "nimbase.h"
#include <string.h>
#include <setjmp.h>
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>
#include <stdio.h>
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tnode223809 Tnode223809;
typedef struct Tsym223841 Tsym223841;
typedef struct Tpass275017 Tpass275017;
typedef struct Tpasscontext275005 Tpasscontext275005;
typedef struct Trodreader266030 Trodreader266030;
typedef struct Tlinkedlist139028 Tlinkedlist139028;
typedef struct Tlistentry139022 Tlistentry139022;
typedef struct Tidobj196015 Tidobj196015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttypeseq223843 Ttypeseq223843;
typedef struct Tscope223835 Tscope223835;
typedef struct TY223944 TY223944;
typedef struct Tstrtable223813 Tstrtable223813;
typedef struct Tsymseq223811 Tsymseq223811;
typedef struct Ttype223847 Ttype223847;
typedef struct Tident196021 Tident196021;
typedef struct Tlineinfo188352 Tlineinfo188352;
typedef struct Tloc223823 Tloc223823;
typedef struct Ropeobj174009 Ropeobj174009;
typedef struct Tlib223827 Tlib223827;
typedef struct Tctx277048 Tctx277048;
typedef struct TY579197 TY579197;
typedef struct TY277254 TY277254;
typedef struct TY189417 TY189417;
typedef struct PprocHEX3Aobjecttype277233 PprocHEX3Aobjecttype277233;
typedef struct TY277273 TY277273;
typedef struct TY122809 TY122809;
typedef struct Cell48947 Cell48947;
typedef struct Cellseq48963 Cellseq48963;
typedef struct Gcheap51018 Gcheap51018;
typedef struct Gcstack51016 Gcstack51016;
typedef struct Cellset48959 Cellset48959;
typedef struct Pagedesc48955 Pagedesc48955;
typedef struct Memregion30891 Memregion30891;
typedef struct Smallchunk30843 Smallchunk30843;
typedef struct Llchunk30885 Llchunk30885;
typedef struct Bigchunk30845 Bigchunk30845;
typedef struct Intset30817 Intset30817;
typedef struct Trunk30813 Trunk30813;
typedef struct Avlnode30889 Avlnode30889;
typedef struct Gcstat51014 Gcstat51014;
typedef struct Vmargs277042 Vmargs277042;
typedef struct Exception Exception;
typedef struct TSafePoint TSafePoint;
typedef struct TY129408 TY129408;
typedef struct Tllstream211204 Tllstream211204;
typedef struct Tnodeseq223803 Tnodeseq223803;
typedef struct TY223932 TY223932;
typedef struct Tindex266028 Tindex266028;
typedef struct Tiitable231274 Tiitable231274;
typedef struct Tiipairseq231272 Tiipairseq231272;
typedef struct Table266063 Table266063;
typedef struct Keyvaluepairseq266066 Keyvaluepairseq266066;
typedef struct Memfile264208 Memfile264208;
typedef struct Tinstantiation223831 Tinstantiation223831;
typedef struct TY277234 TY277234;
typedef struct TY277239 TY277239;
typedef struct TY277274 TY277274;
typedef struct Basechunk30841 Basechunk30841;
typedef struct Freecell30833 Freecell30833;
typedef struct Tiipair231270 Tiipair231270;
typedef struct Keyvaluepair266069 Keyvaluepair266069;
typedef struct Tblock277030 Tblock277030;
typedef struct TY277214 TY277214;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef N_NIMCALL_PTR(Tnode223809*, TY275069) (Tsym223841* m, NI32 fileidx);
typedef N_NIMCALL_PTR(Tsym223841*, TY275064) (Tsym223841* m, NI32 fileidx);
typedef N_NIMCALL_PTR(Tpasscontext275005*, Tpassopen275009) (Tsym223841* module);
typedef N_NIMCALL_PTR(Tpasscontext275005*, Tpassopencached275011) (Tsym223841* module, Trodreader266030* rd);
typedef N_NIMCALL_PTR(Tnode223809*, Tpassprocess275015) (Tpasscontext275005* p, Tnode223809* toplevelstmt);
typedef N_NIMCALL_PTR(Tnode223809*, Tpassclose275013) (Tpasscontext275005* p, Tnode223809* n);
struct Tpass275017 {
Tpassopen275009 Field0;
Tpassopencached275011 Field1;
Tpassprocess275015 Field2;
Tpassclose275013 Field3;
};
struct  Tlinkedlist139028  {
Tlistentry139022* head;
Tlistentry139022* tail;
NI counter;
};
typedef N_NIMCALL_PTR(void, TY3889) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3894) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3889 marker;
TY3894 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Tidobj196015  {
  TNimObject Sup;
NI id;
};
struct  Tstrtable223813  {
NI counter;
Tsymseq223811* data;
};
struct  Tlineinfo188352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tloc223823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype223847* t;
Ropeobj174009* r;
Ropeobj174009* heaproot;
};
struct  Tsym223841  {
  Tidobj196015 Sup;
NU8 kind;
union{
struct {Ttypeseq223843* typeinstcache;
Tscope223835* typscope;
} S1;
struct {TY223944* procinstcache;
Tsym223841* gcunsafetyreason;
} S2;
struct {TY223944* usedgenerics;
Tstrtable223813 tab;
} S3;
struct {Tsym223841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype223847* typ;
Tident196021* name;
Tlineinfo188352 info;
Tsym223841* owner;
NU32 flags;
Tnode223809* ast;
NU32 options;
NI position;
NI offset;
Tloc223823 loc;
Tlib223827* annex;
Tnode223809* constraint;
};
struct  TY579197  {
NI HEX3Astate;
NimStringDesc* errormsg579094;
NimStringDesc* vthisdir579095;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Tpasscontext275005  {
  TNimObject Sup;
NIM_BOOL fromcache;
};
struct  Tctx277048  {
  Tpasscontext275005 Sup;
TY277254* code;
TY189417* debug;
Tnode223809* globals;
Tnode223809* constants;
Ttypeseq223843* types;
Tnode223809* currentexceptiona;
Tnode223809* currentexceptionb;
NI exceptioninstr;
PprocHEX3Aobjecttype277233* prc;
Tsym223841* module;
Tnode223809* callsite;
NU8 mode;
NU8 features;
NIM_BOOL traceactive;
NI loopiterations;
Tlineinfo188352 comesfromheuristic;
TY277273* callbacks;
NimStringDesc* errorflag;
};
struct TY122809 {
NimStringDesc* Field0;
NimStringDesc* Field1;
NimStringDesc* Field2;
};
struct  Cell48947  {
NI refcount;
TNimType* typ;
};
struct  Cellseq48963  {
NI len;
NI cap;
Cell48947** d;
};
struct  Cellset48959  {
NI counter;
NI max;
Pagedesc48955* head;
Pagedesc48955** data;
};
typedef Smallchunk30843* TY30906[512];
typedef Trunk30813* Trunkbuckets30815[256];
struct  Intset30817  {
Trunkbuckets30815 data;
};
struct  Memregion30891  {
NI minlargeobj;
NI maxlargeobj;
TY30906 freesmallchunks;
Llchunk30885* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk30845* freechunkslist;
Intset30817 chunkstarts;
Avlnode30889* root;
Avlnode30889* deleted;
Avlnode30889* last;
Avlnode30889* freeavlnodes;
};
struct  Gcstat51014  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap51018  {
Gcstack51016* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq48963 zct;
Cellseq48963 decstack;
Cellset48959 cycleroots;
Cellseq48963 tempstack;
NI recgclock;
Memregion30891 region;
Gcstat51014 stat;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (Vmargs277042* args, void* ClEnv);
void* ClEnv;
} Vmcallback277044;
struct  Exception  {
  TNimObject Sup;
Exception* parent;
NCSTRING name;
NimStringDesc* message;
NimStringDesc* trace;
};
typedef struct {
N_NIMCALL_PTR(NIM_BOOL, ClPrc) (Exception* e, void* ClEnv);
void* ClEnv;
} TY19211;
struct  TSafePoint  {
TSafePoint* prev;
NI status;
jmp_buf context;
NIM_BOOL hasRaiseAction;
TY19211 raiseAction;
};
typedef NIM_CHAR TY113383[256];
typedef N_CLOSURE_PTR(void, TMP3675) (Vmargs277042* args, void* ClEnv);
typedef N_CLOSURE_PTR(void, TMP3677) (Vmargs277042* args, void* ClEnv);
typedef N_CLOSURE_PTR(void, TMP3679) (Vmargs277042* args, void* ClEnv);
typedef N_CLOSURE_PTR(void, TMP3681) (Vmargs277042* args, void* ClEnv);
typedef N_CLOSURE_PTR(void, TMP3684) (Vmargs277042* args, void* ClEnv);
typedef N_CLOSURE_PTR(void, TMP3686) (Vmargs277042* args, void* ClEnv);
typedef N_CLOSURE_PTR(void, TMP3688) (Vmargs277042* args, void* ClEnv);
typedef N_CLOSURE_PTR(void, TMP3690) (Vmargs277042* args, void* ClEnv);
typedef N_CLOSURE_PTR(void, TMP3693) (Vmargs277042* args, void* ClEnv);
typedef N_CLOSURE_PTR(void, TMP3695) (Vmargs277042* args, void* ClEnv);
typedef N_CLOSURE_PTR(void, TMP3697) (Vmargs277042* args, void* ClEnv);
typedef N_CLOSURE_PTR(void, TMP3699) (Vmargs277042* args, void* ClEnv);
typedef N_CLOSURE_PTR(void, TMP3702) (Vmargs277042* args, void* ClEnv);
typedef N_CLOSURE_PTR(void, TMP3704) (Vmargs277042* args, void* ClEnv);
typedef N_CLOSURE_PTR(void, TMP3706) (Vmargs277042* args, void* ClEnv);
struct  Tnode223809  {
Ttype223847* typ;
Tlineinfo188352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym223841* sym;
} S4;
struct {Tident196021* ident;
} S5;
struct {Tnodeseq223803* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Tiitable231274  {
NI counter;
Tiipairseq231272* data;
};
struct  Tindex266028  {
NI lastidxkey;
NI lastidxval;
Tiitable231274 tab;
NimStringDesc* r;
NI offset;
};
struct  Table266063  {
Keyvaluepairseq266066* data;
NI counter;
};
struct  Memfile264208  {
void* mem;
NI size;
int handle;
};
struct  Trodreader266030  {
  TNimObject Sup;
NI pos;
NCSTRING s;
NU32 options;
NU8 reason;
TY223932* moddeps;
TY223932* files;
NI dataidx;
NI convertersidx;
NI initidx;
NI interfidx;
NI compilerprocsidx;
NI methodsidx;
NimStringDesc* filename;
Tindex266028 index;
Tindex266028 imports;
NI readerindex;
NI line;
NI moduleid;
Table266063 syms;
Memfile264208 memfile;
Tsymseq223811* methods;
NimStringDesc* origfile;
NIM_BOOL inviewmode;
};
struct  Tlistentry139022  {
  TNimObject Sup;
Tlistentry139022* prev;
Tlistentry139022* next;
};
struct  Tscope223835  {
NI depthlevel;
Tstrtable223813 symbols;
Tnodeseq223803* usingsyms;
Tscope223835* parent;
};
struct  Ttype223847  {
  Tidobj196015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq223843* sons;
Tnode223809* n;
Tsym223841* owner;
Tsym223841* sym;
Tsym223841* destructor;
Tsym223841* deepcopy;
Tsym223841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc223823 loc;
};
struct  Tident196021  {
  Tidobj196015 Sup;
NimStringDesc* s;
Tident196021* next;
NI h;
};
struct  Ropeobj174009  {
  TNimObject Sup;
Ropeobj174009* left;
Ropeobj174009* right;
NI length;
NimStringDesc* data;
};
struct  Tlib223827  {
  Tlistentry139022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj174009* name;
Tnode223809* path;
};
struct TY277239 {
NIM_BOOL Field0;
NU8 Field1;
};
typedef TY277239 TY277242[256];
struct  PprocHEX3Aobjecttype277233  {
TY277234* blocks;
Tsym223841* sym;
TY277242 slots;
NI maxslots;
};
struct TY277274 {
NimStringDesc* Field0;
Vmcallback277044 Field1;
};
struct  Gcstack51016  {
Gcstack51016* prev;
Gcstack51016* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY30822[8];
struct  Pagedesc48955  {
Pagedesc48955* next;
NI key;
TY30822 bits;
};
struct  Basechunk30841  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk30843  {
  Basechunk30841 Sup;
Smallchunk30843* next;
Smallchunk30843* prev;
Freecell30833* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk30885  {
NI size;
NI acc;
Llchunk30885* next;
};
struct  Bigchunk30845  {
  Basechunk30841 Sup;
Bigchunk30845* next;
Bigchunk30845* prev;
NI align;
NF data;
};
struct  Trunk30813  {
Trunk30813* next;
NI key;
TY30822 bits;
};
typedef Avlnode30889* TY30896[2];
struct  Avlnode30889  {
TY30896 link;
NI key;
NI upperbound;
NI level;
};
struct  Vmargs277042  {
NI ra;
NI rb;
NI rc;
void* slots;
Tnode223809* currentexception;
};
struct  Tllstream211204  {
  TNimObject Sup;
NU8 kind;
FILE* f;
NimStringDesc* s;
NI rd;
NI wr;
NI lineoffset;
};
struct  Tiipair231270  {
NI key;
NI val;
};
struct Keyvaluepair266069 {
NI Field0;
NI Field1;
Tsym223841* Field2;
};
struct  Tinstantiation223831  {
Tsym223841* sym;
Ttypeseq223843* concretetypes;
TY223932* usedby;
NI compilesid;
};
struct  Tblock277030  {
Tsym223841* label;
TY277214* fixups;
};
struct  Freecell30833  {
Freecell30833* next;
NI zerofield;
};
struct TY129408 {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct Ttypeseq223843 {
  TGenericSeq Sup;
  Ttype223847* data[SEQ_DECL_SIZE];
};
struct TY223944 {
  TGenericSeq Sup;
  Tinstantiation223831* data[SEQ_DECL_SIZE];
};
struct Tsymseq223811 {
  TGenericSeq Sup;
  Tsym223841* data[SEQ_DECL_SIZE];
};
struct TY277254 {
  TGenericSeq Sup;
  NU32 data[SEQ_DECL_SIZE];
};
struct TY189417 {
  TGenericSeq Sup;
  Tlineinfo188352 data[SEQ_DECL_SIZE];
};
struct TY277273 {
  TGenericSeq Sup;
  TY277274 data[SEQ_DECL_SIZE];
};
struct Tnodeseq223803 {
  TGenericSeq Sup;
  Tnode223809* data[SEQ_DECL_SIZE];
};
struct TY223932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct Tiipairseq231272 {
  TGenericSeq Sup;
  Tiipair231270 data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq266066 {
  TGenericSeq Sup;
  Keyvaluepair266069 data[SEQ_DECL_SIZE];
};
struct TY277234 {
  TGenericSeq Sup;
  Tblock277030 data[SEQ_DECL_SIZE];
};
struct TY277214 {
  TGenericSeq Sup;
  NI data[SEQ_DECL_SIZE];
};
N_NIMCALL(Tnode223809*, includemodule_574860)(Tsym223841* s, NI32 fileidx);
N_NIMCALL(Tsym223841*, importmodule_574824)(Tsym223841* s, NI32 fileidx);
N_NIMCALL(void, initdefines_197254)(void);
N_NIMCALL(void, definesymbol_197013)(NimStringDesc* symbol);
N_NIMCALL(void, registerpass_275190)(Tpass275017* p);
N_NIMCALL(Tpasscontext275005*, myopen_500741)(Tsym223841* module);
N_NIMCALL(Tpasscontext275005*, myopencached_500778)(Tsym223841* module, Trodreader266030* rd);
N_NIMCALL(Tnode223809*, myprocess_500917)(Tpasscontext275005* context, Tnode223809* n);
N_NIMCALL(Tnode223809*, myclose_500933)(Tpasscontext275005* context, Tnode223809* n);
N_NIMCALL(Tpasscontext275005*, myopen_443295)(Tsym223841* module);
N_NIMCALL(Tnode223809*, myprocess_443412)(Tpasscontext275005* c, Tnode223809* n);
N_NIMCALL(void, appendstr_139268)(Tlinkedlist139028* list, NimStringDesc* data);
N_NIMCALL(Tsym223841*, makemodule_575007)(NimStringDesc* filename);
N_NIMCALL(Tctx277048*, setupvm_579089)(Tsym223841* module, NimStringDesc* scriptname);
N_NIMCALL(void, nimGCvisit)(void* d, NI op);
N_NIMCALL(void, TMP3644)(void* p, NI op);
N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
N_NIMCALL(Tctx277048*, newctx_277282)(Tsym223841* module);
N_NIMCALL(void, registeradditionalops_443102)(Tctx277048* c);
N_NIMCALL(void, nossplitFile)(NimStringDesc* path, TY122809* Result);
N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(Cell48947*, usrtocell_52646)(void* usr);
static N_INLINE(void, rtladdzct_54204)(Cell48947* c);
N_NOINLINE(void, addzct_52617)(Cellseq48963* s, Cell48947* c);
N_NIMCALL(void, registercallback_277401)(Tctx277048* c, NimStringDesc* name, Vmcallback277044 callback);
N_CLOSURE(void, HEX3Aanonymous_579108)(Vmargs277042* a, void* ClEnv);
static N_INLINE(void, pushSafePoint)(TSafePoint* s);
N_NIMCALL(void, listdirs_579015)(Vmargs277042* a, NU8 filter);
N_NIMCALL(NimStringDesc*, getstring_431072)(Vmargs277042* a, NI i);
N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
N_NIMCALL(NimStringDesc*, cstrToNimstr)(NCSTRING str);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(NimStringDesc*, HEX2F_122481)(NimStringDesc* head, NimStringDesc* tail);
N_NIMCALL(TGenericSeq*, incrSeqV2)(TGenericSeq* seq, NI elemsize);
N_NIMCALL(void, setresult_430963)(Vmargs277042* a, TY129408* v);
static N_INLINE(void, popSafePoint)(void);
N_NIMCALL(NIM_BOOL, isObj)(TNimType* obj, TNimType* subclass);
static N_INLINE(Exception*, getCurrentException)(void);
static N_INLINE(NimStringDesc*, getcurrentexceptionmsg_89208)(void);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
static N_INLINE(void, popCurrentException)(void);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incref_55022)(Cell48947* c);
static N_INLINE(NIM_BOOL, canbecycleroot_52667)(Cell48947* c);
static N_INLINE(void, rtladdcycleroot_53423)(Cell48947* c);
N_NOINLINE(void, incl_49665)(Cellset48959* s, Cell48947* cell);
static N_INLINE(void, decref_54604)(Cell48947* c);
N_NIMCALL(void, reraiseException)(void);
N_CLOSURE(void, HEX3Aanonymous_579112)(Vmargs277042* a, void* ClEnv);
N_CLOSURE(void, HEX3Aanonymous_579116)(Vmargs277042* a, void* ClEnv);
N_NIMCALL(void, nosremoveDir)(NimStringDesc* dir);
N_CLOSURE(void, HEX3Aanonymous_579119)(Vmargs277042* a, void* ClEnv);
N_NIMCALL(void, nosremoveFile)(NimStringDesc* file);
N_CLOSURE(void, HEX3Aanonymous_579122)(Vmargs277042* a, void* ClEnv);
N_NIMCALL(void, noscreateDir)(NimStringDesc* dir);
N_CLOSURE(void, HEX3Aanonymous_579125)(Vmargs277042* a, void* ClEnv);
N_NIMCALL(void, setresult_430915)(Vmargs277042* a, NimStringDesc* v);
N_CLOSURE(void, HEX3Aanonymous_579128)(Vmargs277042* a, void* ClEnv);
static N_INLINE(void, setcurrentdir_127007)(NimStringDesc* newdir);
N_NOINLINE(void, raiseoserror_125009)(NI32 errorcode, NimStringDesc* additionalinfo);
N_NIMCALL(NI32, oslasterror_125034)(void);
N_CLOSURE(void, HEX3Aanonymous_579131)(Vmargs277042* a, void* ClEnv);
N_NIMCALL(NimStringDesc*, nosgetCurrentDir)(void);
N_CLOSURE(void, HEX3Aanonymous_579134)(Vmargs277042* a, void* ClEnv);
N_NIMCALL(void, nosmoveFile)(NimStringDesc* source, NimStringDesc* dest);
N_CLOSURE(void, HEX3Aanonymous_579137)(Vmargs277042* a, void* ClEnv);
N_NIMCALL(void, noscopyFile)(NimStringDesc* source, NimStringDesc* dest);
N_CLOSURE(void, HEX3Aanonymous_579140)(Vmargs277042* a, void* ClEnv);
N_NIMCALL(void, setresult_430860)(Vmargs277042* a, NF v);
N_NIMCALL(NF, toseconds_108512)(time_t time);
N_NIMCALL(time_t, nosgetLastModificationTime)(NimStringDesc* file);
N_CLOSURE(void, HEX3Aanonymous_579143)(Vmargs277042* a, void* ClEnv);
N_NIMCALL(void, setresult_430837)(Vmargs277042* a, NI64 v);
N_NIMCALL(NI, nospexecCmd)(NimStringDesc* command);
N_NIMCALL(void, HEX3Aanonymous_579146)(Vmargs277042* a);
N_NIMCALL(NimStringDesc*, getenv_130044)(NimStringDesc* key);
N_NIMCALL(void, HEX3Aanonymous_579149)(Vmargs277042* a);
N_NIMCALL(void, setresult_430883)(Vmargs277042* a, NIM_BOOL v_430886);
N_NIMCALL(NIM_BOOL, existsenv_130059)(NimStringDesc* key);
N_NIMCALL(void, HEX3Aanonymous_579152)(Vmargs277042* a);
static N_INLINE(NIM_BOOL, direxists_126020)(NimStringDesc* dir);
N_NIMCALL(NIM_BOOL, nosexistsDir)(NimStringDesc* dir);
N_NIMCALL(void, HEX3Aanonymous_579155)(Vmargs277042* a);
static N_INLINE(NIM_BOOL, fileexists_126010)(NimStringDesc* filename);
N_NIMCALL(NIM_BOOL, nosexistsFile)(NimStringDesc* filename);
N_CLOSURE(void, HEX3Aanonymous_579158)(Vmargs277042* a, void* ClEnv);
N_NIMCALL(void, HEX3Aanonymous_579161)(Vmargs277042* a);
N_NIMCALL(void, setconfigvar_165345)(NimStringDesc* key, NimStringDesc* val);
N_NIMCALL(void, HEX3Aanonymous_579164)(Vmargs277042* a);
N_NIMCALL(NimStringDesc*, getconfigvar_165335)(NimStringDesc* key);
N_NIMCALL(void, HEX3Aanonymous_579167)(Vmargs277042* a);
N_NIMCALL(NIM_BOOL, existsconfigvar_165325)(NimStringDesc* key);
N_NIMCALL(void, HEX3Aanonymous_579170)(Vmargs277042* a);
N_NIMCALL(NimStringDesc*, getnimcachedir_165628)(void);
N_NIMCALL(void, HEX3Aanonymous_579173)(Vmargs277042* a);
N_NIMCALL(NimStringDesc*, paramstr_135013)(NI i);
N_NIMCALL(NI64, getint_431020)(Vmargs277042* a, NI i);
N_NIMCALL(void, HEX3Aanonymous_579177)(Vmargs277042* a);
N_NIMCALL(NI, paramcount_135035)(void);
N_NIMCALL(void, HEX3Aanonymous_579180)(Vmargs277042* a);
N_NIMCALL(NI, nsuCmpIgnoreStyle)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(void, HEX3Aanonymous_579183)(Vmargs277042* a);
N_NIMCALL(NI, nsuCmpIgnoreCase)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(void, HEX3Aanonymous_579186)(Vmargs277042* a);
N_NIMCALL(NimStringDesc*, canonicalizepath_165409)(NimStringDesc* path);
N_NIMCALL(void, HEX3Aanonymous_579190)(Vmargs277042* a);
N_NIMCALL(void, HEX3Aanonymous_579193)(Vmargs277042* a);
N_NIMCALL(void, processswitch_209040)(NimStringDesc* switch_209042, NimStringDesc* arg, NU8 pass, Tlineinfo188352 info);
N_NIMCALL(Tlineinfo188352, unknownlineinfo_189408)(void);
N_NIMCALL(void, compilesystemmodule_574910)(void);
N_NIMCALL(void, processmodule_275056)(Tsym223841* module, Tllstream211204* stream, Trodreader266030* rd);
N_NIMCALL(Tllstream211204*, llstreamopen_211256)(NimStringDesc* filename, NU8 mode);
N_NIMCALL(void, resetallmoduleshard_574439)(void);
N_NIMCALL(void, undefsymbol_197022)(NimStringDesc* symbol);
STRING_LITERAL(TMP2024, "nimscript", 9);
STRING_LITERAL(TMP2025, "nimconfig", 9);
STRING_LITERAL(TMP3645, "stdlib.system.listFiles", 23);
STRING_LITERAL(TMP3647, ".", 1);
STRING_LITERAL(TMP3648, "..", 2);
STRING_LITERAL(TMP3649, "", 0);
STRING_LITERAL(TMP3650, "stdlib.system.listDirs", 22);
STRING_LITERAL(TMP3652, "stdlib.system.removeDir", 23);
STRING_LITERAL(TMP3656, "stdlib.system.removeFile", 24);
STRING_LITERAL(TMP3658, "stdlib.system.createDir", 23);
STRING_LITERAL(TMP3660, "stdlib.system.getOsError", 24);
STRING_LITERAL(TMP3662, "stdlib.system.setCurrentDir", 27);
STRING_LITERAL(TMP3664, "stdlib.system.getCurrentDir", 27);
STRING_LITERAL(TMP3666, "stdlib.system.moveFile", 22);
STRING_LITERAL(TMP3668, "stdlib.system.copyFile", 22);
STRING_LITERAL(TMP3670, "stdlib.system.getLastModificationTime", 37);
STRING_LITERAL(TMP3672, "stdlib.system.rawExec", 21);
STRING_LITERAL(TMP3674, "stdlib.system.getEnv", 20);
STRING_LITERAL(TMP3676, "stdlib.system.existsEnv", 23);
STRING_LITERAL(TMP3678, "stdlib.system.dirExists", 23);
STRING_LITERAL(TMP3680, "stdlib.system.fileExists", 24);
STRING_LITERAL(TMP3682, "stdlib.system.thisDir", 21);
STRING_LITERAL(TMP3683, "stdlib.system.put", 17);
STRING_LITERAL(TMP3685, "stdlib.system.get", 17);
STRING_LITERAL(TMP3687, "stdlib.system.exists", 20);
STRING_LITERAL(TMP3689, "stdlib.system.nimcacheDir", 25);
STRING_LITERAL(TMP3691, "stdlib.system.paramStr", 22);
STRING_LITERAL(TMP3694, "stdlib.system.paramCount", 24);
STRING_LITERAL(TMP3696, "stdlib.system.cmpIgnoreStyle", 28);
STRING_LITERAL(TMP3698, "stdlib.system.cmpIgnoreCase", 27);
STRING_LITERAL(TMP3700, "stdlib.system.setCommand", 24);
STRING_LITERAL(TMP3703, "stdlib.system.getCommand", 24);
STRING_LITERAL(TMP3705, "stdlib.system.switch", 20);
extern TY275069 gincludefile_275073;
extern TY275064 gimportmodule_275068;
extern Tlinkedlist139028 searchpaths_165136;
extern NimStringDesc* libpath_165233;
extern Tctx277048* globalctx_443273;
TNimType NTI579197; /* object */
extern TNimType NTI344033; /* range -1..0(int) */
extern TNimType NTI149; /* string */
TNimType NTI579313; /* ref object */
extern Gcheap51018 gch_51059;
extern TSafePoint* exchandler_20843;
extern TNimType NTI129408; /* seq[string] */
extern TNimType NTI4033; /* OSError */
extern Exception* currexception_20845;
extern NimStringDesc* command_165240;
extern NimStringDesc* gprojectname_165234;
extern NimStringDesc* gprojectfull_165236;
extern NimStringDesc* gprojectpath_165235;
N_NIMCALL(void, TMP3644)(void* p, NI op) {
	TY579197* a;
	a = (TY579197*)p;
	nimGCvisit((void*)(*a).errormsg579094, op);
	nimGCvisit((void*)(*a).vthisdir579095, op);
}

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

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

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

static N_INLINE(void, pushSafePoint)(TSafePoint* s) {
	(*s).hasRaiseAction = NIM_FALSE;
	(*s).prev = exchandler_20843;
	exchandler_20843 = s;
}

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, listdirs_579015)(Vmargs277042* a, NU8 filter) {
	NimStringDesc* dir;
	TY129408* result;
	dir = getstring_431072(a, ((NI) 0));
	result = (TY129408*) newSeq((&NTI129408), 0);
	{
		NU8 kind_579039;
		NimStringDesc* path_579040;
		DIR* d_579065;
		kind_579039 = 0;
		path_579040 = 0;
		d_579065 = opendir(dir->data);
		{
			int LOC42;
			if (!!((d_579065 == NIM_NIL))) goto LA4;
			{
				while (1) {
					struct dirent* x_579067;
					NimStringDesc* y_579069;
					x_579067 = readdir(d_579065);
					{
						if (!(x_579067 == NIM_NIL)) goto LA10;
						goto LA6;
					}
					LA10: ;
					y_579069 = cstrToNimstr(((NCSTRING) ((*x_579067).d_name)));
					{
						NIM_BOOL LOC14;
						struct stat s_579071;
						NU8 k_579073;
						LOC14 = 0;
						LOC14 = !(eqStrings(y_579069, ((NimStringDesc*) &TMP3647)));
						if (!(LOC14)) goto LA15;
						LOC14 = !(eqStrings(y_579069, ((NimStringDesc*) &TMP3648)));
						LA15: ;
						if (!LOC14) goto LA16;
						memset((void*)(&s_579071), 0, sizeof(s_579071));
						{
							if (!NIM_TRUE) goto LA20;
							y_579069 = HEX2F_122481(dir, y_579069);
						}
						LA20: ;
						k_579073 = ((NU8) 0);
						{
							int LOC24;
							LOC24 = 0;
							LOC24 = lstat(y_579069->data, (&s_579071));
							if (!(LOC24 < ((NI32) 0))) goto LA25;
							goto LA6;
						}
						LA25: ;
						{
							NIM_BOOL LOC29;
							LOC29 = 0;
							LOC29 = S_ISDIR(s_579071.st_mode);
							if (!LOC29) goto LA30;
							k_579073 = ((NU8) 2);
						}
						LA30: ;
						{
							NIM_BOOL LOC34;
							LOC34 = 0;
							LOC34 = S_ISLNK(s_579071.st_mode);
							if (!LOC34) goto LA35;
							k_579073 = (NU8)(k_579073 + ((NI) 1));
						}
						LA35: ;
						kind_579039 = k_579073;
						path_579040 = y_579069;
						{
							NimStringDesc* LOC41;
							if (!((filter &(1<<((kind_579039)&7)))!=0)) goto LA39;
							result = (TY129408*) incrSeqV2(&(result)->Sup, sizeof(NimStringDesc*));
							LOC41 = 0;
							LOC41 = result->data[result->Sup.len]; result->data[result->Sup.len] = copyStringRC1(path_579040);
							if (LOC41) nimGCunrefNoCycle(LOC41);
							++result->Sup.len;
						}
						LA39: ;
					}
					LA16: ;
				}
			} LA6: ;
			LOC42 = 0;
			LOC42 = closedir(d_579065);
		}
		LA4: ;
	}
	setresult_430963(a, result);
}

static N_INLINE(void, popSafePoint)(void) {
	exchandler_20843 = (*exchandler_20843).prev;
}

static N_INLINE(Exception*, getCurrentException)(void) {
	Exception* result;
	result = 0;
	result = currexception_20845;
	return result;
}

static N_INLINE(NimStringDesc*, getcurrentexceptionmsg_89208)(void) {
	NimStringDesc* result;
	Exception* e;
{	result = 0;
	e = getCurrentException();
	{
		if (!(e == NIM_NIL)) goto LA3;
		result = copyString(((NimStringDesc*) &TMP3649));
	}
	goto LA1;
	LA3: ;
	{
		result = copyString((*e).message);
	}
	LA1: ;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

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

static N_INLINE(NIM_BOOL, canbecycleroot_52667)(Cell48947* c) {
	NIM_BOOL result;
	result = 0;
	result = !((((*(*c).typ).flags &(1<<((((NU8) 1))&7)))!=0));
	return result;
}

static N_INLINE(void, rtladdcycleroot_53423)(Cell48947* c) {
	{
		if (!!((((NI) ((NI)((*c).refcount & ((NI) 3)))) == ((NI) 3)))) goto LA3;
		(*c).refcount = (NI)((NI)((*c).refcount & ((NI) -4)) | ((NI) 3));
		incl_49665((&gch_51059.cycleroots), c);
	}
	LA3: ;
}

static N_INLINE(void, incref_55022)(Cell48947* c) {
	(*c).refcount = (NI)((NU64)((*c).refcount) + (NU64)(((NI) 8)));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = canbecycleroot_52667(c);
		if (!LOC3) goto LA4;
		rtladdcycleroot_53423(c);
	}
	LA4: ;
}

static N_INLINE(void, decref_54604)(Cell48947* c) {
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU64)((*c).refcount) < (NU64)(((NI) 8)))) goto LA3;
		rtladdzct_54204(c);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = canbecycleroot_52667(c);
		if (!LOC6) goto LA7;
		rtladdcycleroot_53423(c);
	}
	goto LA1;
	LA7: ;
	LA1: ;
}

static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		Cell48947* LOC5;
		if (!!((src == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = usrtocell_52646(src);
		incref_55022(LOC5);
	}
	LA3: ;
	{
		Cell48947* LOC10;
		if (!!(((*dest) == NIM_NIL))) goto LA8;
		LOC10 = 0;
		LOC10 = usrtocell_52646((*dest));
		decref_54604(LOC10);
	}
	LA8: ;
	(*dest) = src;
}

static N_INLINE(void, popCurrentException)(void) {
	asgnRef((void**) (&currexception_20845), NIM_NIL);
}

N_CLOSURE(void, HEX3Aanonymous_579108)(Vmargs277042* a, void* ClEnv) {
	TY579197* HEX3Aenvp_579203;
	TSafePoint TMP3646;
	HEX3Aenvp_579203 = (TY579197*) ClEnv;
	pushSafePoint(&TMP3646);
	TMP3646.status = setjmp(TMP3646.context);
	if (TMP3646.status == 0) {
		listdirs_579015(a, 3);
		popSafePoint();
	}
	else {
		popSafePoint();
		if (isObj(getCurrentException()->Sup.m_type, (&NTI4033))) {
			TMP3646.status = 0;
			asgnRefNoCycle((void**) (&(*HEX3Aenvp_579203).errormsg579094), getcurrentexceptionmsg_89208());
			popCurrentException();
		}
	}
	if (TMP3646.status != 0) reraiseException();
}

N_CLOSURE(void, HEX3Aanonymous_579112)(Vmargs277042* a, void* ClEnv) {
	TY579197* HEX3Aenvp_579209;
	TSafePoint TMP3651;
	HEX3Aenvp_579209 = (TY579197*) ClEnv;
	pushSafePoint(&TMP3651);
	TMP3651.status = setjmp(TMP3651.context);
	if (TMP3651.status == 0) {
		listdirs_579015(a, 4);
		popSafePoint();
	}
	else {
		popSafePoint();
		if (isObj(getCurrentException()->Sup.m_type, (&NTI4033))) {
			TMP3651.status = 0;
			asgnRefNoCycle((void**) (&(*HEX3Aenvp_579209).errormsg579094), getcurrentexceptionmsg_89208());
			popCurrentException();
		}
	}
	if (TMP3651.status != 0) reraiseException();
}

N_CLOSURE(void, HEX3Aanonymous_579116)(Vmargs277042* a, void* ClEnv) {
	TY579197* HEX3Aenvp_579214;
	TSafePoint TMP3653;
	HEX3Aenvp_579214 = (TY579197*) ClEnv;
	pushSafePoint(&TMP3653);
	TMP3653.status = setjmp(TMP3653.context);
	if (TMP3653.status == 0) {
		NimStringDesc* LOC2;
		LOC2 = 0;
		LOC2 = getstring_431072(a, ((NI) 0));
		nosremoveDir(LOC2);
		popSafePoint();
	}
	else {
		popSafePoint();
		if (isObj(getCurrentException()->Sup.m_type, (&NTI4033))) {
			TMP3653.status = 0;
			asgnRefNoCycle((void**) (&(*HEX3Aenvp_579214).errormsg579094), getcurrentexceptionmsg_89208());
			popCurrentException();
		}
	}
	if (TMP3653.status != 0) reraiseException();
}

N_CLOSURE(void, HEX3Aanonymous_579119)(Vmargs277042* a, void* ClEnv) {
	TY579197* HEX3Aenvp_579219;
	TSafePoint TMP3657;
	HEX3Aenvp_579219 = (TY579197*) ClEnv;
	pushSafePoint(&TMP3657);
	TMP3657.status = setjmp(TMP3657.context);
	if (TMP3657.status == 0) {
		NimStringDesc* LOC2;
		LOC2 = 0;
		LOC2 = getstring_431072(a, ((NI) 0));
		nosremoveFile(LOC2);
		popSafePoint();
	}
	else {
		popSafePoint();
		if (isObj(getCurrentException()->Sup.m_type, (&NTI4033))) {
			TMP3657.status = 0;
			asgnRefNoCycle((void**) (&(*HEX3Aenvp_579219).errormsg579094), getcurrentexceptionmsg_89208());
			popCurrentException();
		}
	}
	if (TMP3657.status != 0) reraiseException();
}

N_CLOSURE(void, HEX3Aanonymous_579122)(Vmargs277042* a, void* ClEnv) {
	TY579197* HEX3Aenvp_579224;
	TSafePoint TMP3659;
	HEX3Aenvp_579224 = (TY579197*) ClEnv;
	pushSafePoint(&TMP3659);
	TMP3659.status = setjmp(TMP3659.context);
	if (TMP3659.status == 0) {
		NimStringDesc* LOC2;
		LOC2 = 0;
		LOC2 = getstring_431072(a, ((NI) 0));
		noscreateDir(LOC2);
		popSafePoint();
	}
	else {
		popSafePoint();
		if (isObj(getCurrentException()->Sup.m_type, (&NTI4033))) {
			TMP3659.status = 0;
			asgnRefNoCycle((void**) (&(*HEX3Aenvp_579224).errormsg579094), getcurrentexceptionmsg_89208());
			popCurrentException();
		}
	}
	if (TMP3659.status != 0) reraiseException();
}

N_CLOSURE(void, HEX3Aanonymous_579125)(Vmargs277042* a, void* ClEnv) {
	TY579197* HEX3Aenvp_579229;
	TSafePoint TMP3661;
	HEX3Aenvp_579229 = (TY579197*) ClEnv;
	pushSafePoint(&TMP3661);
	TMP3661.status = setjmp(TMP3661.context);
	if (TMP3661.status == 0) {
		setresult_430915(a, (*HEX3Aenvp_579229).errormsg579094);
		popSafePoint();
	}
	else {
		popSafePoint();
		if (isObj(getCurrentException()->Sup.m_type, (&NTI4033))) {
			TMP3661.status = 0;
			asgnRefNoCycle((void**) (&(*HEX3Aenvp_579229).errormsg579094), getcurrentexceptionmsg_89208());
			popCurrentException();
		}
	}
	if (TMP3661.status != 0) reraiseException();
}

static N_INLINE(void, setcurrentdir_127007)(NimStringDesc* newdir) {
	{
		int LOC3;
		NI32 LOC6;
		LOC3 = 0;
		LOC3 = chdir(newdir->data);
		if (!!((LOC3 == ((NI32) 0)))) goto LA4;
		LOC6 = 0;
		LOC6 = oslasterror_125034();
		raiseoserror_125009(LOC6, ((NimStringDesc*) &TMP3649));
	}
	LA4: ;
}

N_CLOSURE(void, HEX3Aanonymous_579128)(Vmargs277042* a, void* ClEnv) {
	TY579197* HEX3Aenvp_579234;
	TSafePoint TMP3663;
	HEX3Aenvp_579234 = (TY579197*) ClEnv;
	pushSafePoint(&TMP3663);
	TMP3663.status = setjmp(TMP3663.context);
	if (TMP3663.status == 0) {
		NimStringDesc* LOC2;
		LOC2 = 0;
		LOC2 = getstring_431072(a, ((NI) 0));
		setcurrentdir_127007(LOC2);
		popSafePoint();
	}
	else {
		popSafePoint();
		if (isObj(getCurrentException()->Sup.m_type, (&NTI4033))) {
			TMP3663.status = 0;
			asgnRefNoCycle((void**) (&(*HEX3Aenvp_579234).errormsg579094), getcurrentexceptionmsg_89208());
			popCurrentException();
		}
	}
	if (TMP3663.status != 0) reraiseException();
}

N_CLOSURE(void, HEX3Aanonymous_579131)(Vmargs277042* a, void* ClEnv) {
	TY579197* HEX3Aenvp_579239;
	TSafePoint TMP3665;
	HEX3Aenvp_579239 = (TY579197*) ClEnv;
	pushSafePoint(&TMP3665);
	TMP3665.status = setjmp(TMP3665.context);
	if (TMP3665.status == 0) {
		NimStringDesc* LOC2;
		LOC2 = 0;
		LOC2 = nosgetCurrentDir();
		setresult_430915(a, LOC2);
		popSafePoint();
	}
	else {
		popSafePoint();
		if (isObj(getCurrentException()->Sup.m_type, (&NTI4033))) {
			TMP3665.status = 0;
			asgnRefNoCycle((void**) (&(*HEX3Aenvp_579239).errormsg579094), getcurrentexceptionmsg_89208());
			popCurrentException();
		}
	}
	if (TMP3665.status != 0) reraiseException();
}

N_CLOSURE(void, HEX3Aanonymous_579134)(Vmargs277042* a, void* ClEnv) {
	TY579197* HEX3Aenvp_579244;
	TSafePoint TMP3667;
	HEX3Aenvp_579244 = (TY579197*) ClEnv;
	pushSafePoint(&TMP3667);
	TMP3667.status = setjmp(TMP3667.context);
	if (TMP3667.status == 0) {
		NimStringDesc* LOC2;
		NimStringDesc* LOC3;
		LOC2 = 0;
		LOC2 = getstring_431072(a, ((NI) 0));
		LOC3 = 0;
		LOC3 = getstring_431072(a, ((NI) 1));
		nosmoveFile(LOC2, LOC3);
		popSafePoint();
	}
	else {
		popSafePoint();
		if (isObj(getCurrentException()->Sup.m_type, (&NTI4033))) {
			TMP3667.status = 0;
			asgnRefNoCycle((void**) (&(*HEX3Aenvp_579244).errormsg579094), getcurrentexceptionmsg_89208());
			popCurrentException();
		}
	}
	if (TMP3667.status != 0) reraiseException();
}

N_CLOSURE(void, HEX3Aanonymous_579137)(Vmargs277042* a, void* ClEnv) {
	TY579197* HEX3Aenvp_579249;
	TSafePoint TMP3669;
	HEX3Aenvp_579249 = (TY579197*) ClEnv;
	pushSafePoint(&TMP3669);
	TMP3669.status = setjmp(TMP3669.context);
	if (TMP3669.status == 0) {
		NimStringDesc* LOC2;
		NimStringDesc* LOC3;
		LOC2 = 0;
		LOC2 = getstring_431072(a, ((NI) 0));
		LOC3 = 0;
		LOC3 = getstring_431072(a, ((NI) 1));
		noscopyFile(LOC2, LOC3);
		popSafePoint();
	}
	else {
		popSafePoint();
		if (isObj(getCurrentException()->Sup.m_type, (&NTI4033))) {
			TMP3669.status = 0;
			asgnRefNoCycle((void**) (&(*HEX3Aenvp_579249).errormsg579094), getcurrentexceptionmsg_89208());
			popCurrentException();
		}
	}
	if (TMP3669.status != 0) reraiseException();
}

N_CLOSURE(void, HEX3Aanonymous_579140)(Vmargs277042* a, void* ClEnv) {
	TY579197* HEX3Aenvp_579254;
	TSafePoint TMP3671;
	HEX3Aenvp_579254 = (TY579197*) ClEnv;
	pushSafePoint(&TMP3671);
	TMP3671.status = setjmp(TMP3671.context);
	if (TMP3671.status == 0) {
		NimStringDesc* LOC2;
		time_t LOC3;
		NF LOC4;
		LOC2 = 0;
		LOC2 = getstring_431072(a, ((NI) 0));
		LOC3 = 0;
		LOC3 = nosgetLastModificationTime(LOC2);
		LOC4 = 0;
		LOC4 = toseconds_108512(LOC3);
		setresult_430860(a, LOC4);
		popSafePoint();
	}
	else {
		popSafePoint();
		if (isObj(getCurrentException()->Sup.m_type, (&NTI4033))) {
			TMP3671.status = 0;
			asgnRefNoCycle((void**) (&(*HEX3Aenvp_579254).errormsg579094), getcurrentexceptionmsg_89208());
			popCurrentException();
		}
	}
	if (TMP3671.status != 0) reraiseException();
}

N_CLOSURE(void, HEX3Aanonymous_579143)(Vmargs277042* a, void* ClEnv) {
	TY579197* HEX3Aenvp_579259;
	TSafePoint TMP3673;
	HEX3Aenvp_579259 = (TY579197*) ClEnv;
	pushSafePoint(&TMP3673);
	TMP3673.status = setjmp(TMP3673.context);
	if (TMP3673.status == 0) {
		NimStringDesc* LOC2;
		NI LOC3;
		LOC2 = 0;
		LOC2 = getstring_431072(a, ((NI) 0));
		LOC3 = 0;
		LOC3 = nospexecCmd(LOC2);
		setresult_430837(a, ((NI64) (LOC3)));
		popSafePoint();
	}
	else {
		popSafePoint();
		if (isObj(getCurrentException()->Sup.m_type, (&NTI4033))) {
			TMP3673.status = 0;
			asgnRefNoCycle((void**) (&(*HEX3Aenvp_579259).errormsg579094), getcurrentexceptionmsg_89208());
			popCurrentException();
		}
	}
	if (TMP3673.status != 0) reraiseException();
}

N_NIMCALL(void, HEX3Aanonymous_579146)(Vmargs277042* a) {
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	LOC1 = 0;
	LOC1 = getstring_431072(a, ((NI) 0));
	LOC2 = 0;
	LOC2 = getenv_130044(LOC1);
	setresult_430915(a, LOC2);
}

N_NIMCALL(void, HEX3Aanonymous_579149)(Vmargs277042* a) {
	NimStringDesc* LOC1;
	NIM_BOOL LOC2;
	LOC1 = 0;
	LOC1 = getstring_431072(a, ((NI) 0));
	LOC2 = 0;
	LOC2 = existsenv_130059(LOC1);
	setresult_430883(a, LOC2);
}

static N_INLINE(NIM_BOOL, direxists_126020)(NimStringDesc* dir) {
	NIM_BOOL result;
	result = 0;
	result = nosexistsDir(dir);
	return result;
}

N_NIMCALL(void, HEX3Aanonymous_579152)(Vmargs277042* a) {
	NimStringDesc* LOC1;
	NIM_BOOL LOC2;
	LOC1 = 0;
	LOC1 = getstring_431072(a, ((NI) 0));
	LOC2 = 0;
	LOC2 = direxists_126020(LOC1);
	setresult_430883(a, LOC2);
}

static N_INLINE(NIM_BOOL, fileexists_126010)(NimStringDesc* filename) {
	NIM_BOOL result;
	result = 0;
	result = nosexistsFile(filename);
	return result;
}

N_NIMCALL(void, HEX3Aanonymous_579155)(Vmargs277042* a) {
	NimStringDesc* LOC1;
	NIM_BOOL LOC2;
	LOC1 = 0;
	LOC1 = getstring_431072(a, ((NI) 0));
	LOC2 = 0;
	LOC2 = fileexists_126010(LOC1);
	setresult_430883(a, LOC2);
}

N_CLOSURE(void, HEX3Aanonymous_579158)(Vmargs277042* a, void* ClEnv) {
	TY579197* HEX3Aenvp_579276;
	HEX3Aenvp_579276 = (TY579197*) ClEnv;
	setresult_430915(a, (*HEX3Aenvp_579276).vthisdir579095);
}

N_NIMCALL(void, HEX3Aanonymous_579161)(Vmargs277042* a) {
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	LOC1 = 0;
	LOC1 = getstring_431072(a, ((NI) 0));
	LOC2 = 0;
	LOC2 = getstring_431072(a, ((NI) 1));
	setconfigvar_165345(LOC1, LOC2);
}

N_NIMCALL(void, HEX3Aanonymous_579164)(Vmargs277042* a) {
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	LOC1 = 0;
	LOC1 = getstring_431072(a, ((NI) 0));
	LOC2 = 0;
	LOC2 = getconfigvar_165335(LOC1);
	setresult_430915(a, LOC2);
}

N_NIMCALL(void, HEX3Aanonymous_579167)(Vmargs277042* a) {
	NimStringDesc* LOC1;
	NIM_BOOL LOC2;
	LOC1 = 0;
	LOC1 = getstring_431072(a, ((NI) 0));
	LOC2 = 0;
	LOC2 = existsconfigvar_165325(LOC1);
	setresult_430883(a, LOC2);
}

N_NIMCALL(void, HEX3Aanonymous_579170)(Vmargs277042* a) {
	NimStringDesc* LOC1;
	LOC1 = 0;
	LOC1 = getnimcachedir_165628();
	setresult_430915(a, LOC1);
}

N_NIMCALL(void, HEX3Aanonymous_579173)(Vmargs277042* a) {
	NI64 LOC1;
	NimStringDesc* LOC2;
	LOC1 = 0;
	LOC1 = getint_431020(a, ((NI) 0));
	LOC2 = 0;
	LOC2 = paramstr_135013(((NI) (LOC1)));
	setresult_430915(a, LOC2);
}

N_NIMCALL(void, HEX3Aanonymous_579177)(Vmargs277042* a) {
	NI LOC1;
	LOC1 = 0;
	LOC1 = paramcount_135035();
	setresult_430837(a, ((NI64) (LOC1)));
}

N_NIMCALL(void, HEX3Aanonymous_579180)(Vmargs277042* a) {
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	NI LOC3;
	LOC1 = 0;
	LOC1 = getstring_431072(a, ((NI) 0));
	LOC2 = 0;
	LOC2 = getstring_431072(a, ((NI) 1));
	LOC3 = 0;
	LOC3 = nsuCmpIgnoreStyle(LOC1, LOC2);
	setresult_430837(a, ((NI64) (LOC3)));
}

N_NIMCALL(void, HEX3Aanonymous_579183)(Vmargs277042* a) {
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	NI LOC3;
	LOC1 = 0;
	LOC1 = getstring_431072(a, ((NI) 0));
	LOC2 = 0;
	LOC2 = getstring_431072(a, ((NI) 1));
	LOC3 = 0;
	LOC3 = nsuCmpIgnoreCase(LOC1, LOC2);
	setresult_430837(a, ((NI64) (LOC3)));
}

N_NIMCALL(void, HEX3Aanonymous_579186)(Vmargs277042* a) {
	NimStringDesc* arg;
	asgnRefNoCycle((void**) (&command_165240), getstring_431072(a, ((NI) 0)));
	arg = getstring_431072(a, ((NI) 1));
	{
		NimStringDesc* LOC5;
		TSafePoint TMP3701;
		if (!(((NI) 0) < (arg ? arg->Sup.len : 0))) goto LA3;
		LOC5 = 0;
		LOC5 = gprojectname_165234; gprojectname_165234 = copyStringRC1(arg);
		if (LOC5) nimGCunrefNoCycle(LOC5);
		pushSafePoint(&TMP3701);
		TMP3701.status = setjmp(TMP3701.context);
		if (TMP3701.status == 0) {
			NimStringDesc* LOC7;
			LOC7 = 0;
			LOC7 = HEX2F_122481(gprojectpath_165235, gprojectname_165234);
			asgnRefNoCycle((void**) (&gprojectfull_165236), canonicalizepath_165409(LOC7));
			popSafePoint();
		}
		else {
			popSafePoint();
			if (isObj(getCurrentException()->Sup.m_type, (&NTI4033))) {
				NimStringDesc* LOC10;
				TMP3701.status = 0;
				LOC10 = 0;
				LOC10 = gprojectfull_165236; gprojectfull_165236 = copyStringRC1(gprojectname_165234);
				if (LOC10) nimGCunrefNoCycle(LOC10);
				popCurrentException();
			}
		}
		if (TMP3701.status != 0) reraiseException();
	}
	LA3: ;
}

N_NIMCALL(void, HEX3Aanonymous_579190)(Vmargs277042* a) {
	setresult_430915(a, command_165240);
}

N_NIMCALL(void, HEX3Aanonymous_579193)(Vmargs277042* a) {
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	Tlineinfo188352 LOC3;
	LOC1 = 0;
	LOC1 = getstring_431072(a, ((NI) 0));
	LOC2 = 0;
	LOC2 = getstring_431072(a, ((NI) 1));
	LOC3 = unknownlineinfo_189408();
	processswitch_209040(LOC1, LOC2, ((NU8) 2), LOC3);
}

N_NIMCALL(Tctx277048*, setupvm_579089)(Tsym223841* module, NimStringDesc* scriptname) {
	Tctx277048* result;
	TY579197* HEX3Aenv_579312;
	TY122809 LOC1;
	NimStringDesc* LOC2;
	Vmcallback277044 LOC3;
	Vmcallback277044 LOC4;
	Vmcallback277044 LOC5;
	Vmcallback277044 LOC6;
	Vmcallback277044 LOC7;
	Vmcallback277044 LOC8;
	Vmcallback277044 LOC9;
	Vmcallback277044 LOC10;
	Vmcallback277044 LOC11;
	Vmcallback277044 LOC12;
	Vmcallback277044 LOC13;
	Vmcallback277044 LOC14;
	Vmcallback277044 LOC15;
	Vmcallback277044 LOC16;
	Vmcallback277044 LOC17;
	Vmcallback277044 LOC18;
	Vmcallback277044 LOC19;
	Vmcallback277044 LOC20;
	Vmcallback277044 LOC21;
	Vmcallback277044 LOC22;
	Vmcallback277044 LOC23;
	Vmcallback277044 LOC24;
	Vmcallback277044 LOC25;
	Vmcallback277044 LOC26;
	Vmcallback277044 LOC27;
	Vmcallback277044 LOC28;
	Vmcallback277044 LOC29;
	Vmcallback277044 LOC30;
	result = 0;
	HEX3Aenv_579312 = 0;
	HEX3Aenv_579312 = (TY579197*) newObj((&NTI579313), sizeof(TY579197));
	result = newctx_277282(module);
	(*result).mode = ((NU8) 0);
	registeradditionalops_443102(result);
	memset((void*)(&LOC1), 0, sizeof(LOC1));
	nossplitFile(scriptname, (&LOC1));
	LOC2 = 0;
	LOC2 = (*HEX3Aenv_579312).vthisdir579095; (*HEX3Aenv_579312).vthisdir579095 = copyStringRC1(LOC1.Field0);
	if (LOC2) nimGCunrefNoCycle(LOC2);
	memset((void*)(&LOC3), 0, sizeof(LOC3));
	LOC3.ClPrc = HEX3Aanonymous_579108; LOC3.ClEnv = HEX3Aenv_579312;
	registercallback_277401(result, ((NimStringDesc*) &TMP3645), LOC3);
	memset((void*)(&LOC4), 0, sizeof(LOC4));
	LOC4.ClPrc = HEX3Aanonymous_579112; LOC4.ClEnv = HEX3Aenv_579312;
	registercallback_277401(result, ((NimStringDesc*) &TMP3650), LOC4);
	memset((void*)(&LOC5), 0, sizeof(LOC5));
	LOC5.ClPrc = HEX3Aanonymous_579116; LOC5.ClEnv = HEX3Aenv_579312;
	registercallback_277401(result, ((NimStringDesc*) &TMP3652), LOC5);
	memset((void*)(&LOC6), 0, sizeof(LOC6));
	LOC6.ClPrc = HEX3Aanonymous_579119; LOC6.ClEnv = HEX3Aenv_579312;
	registercallback_277401(result, ((NimStringDesc*) &TMP3656), LOC6);
	memset((void*)(&LOC7), 0, sizeof(LOC7));
	LOC7.ClPrc = HEX3Aanonymous_579122; LOC7.ClEnv = HEX3Aenv_579312;
	registercallback_277401(result, ((NimStringDesc*) &TMP3658), LOC7);
	memset((void*)(&LOC8), 0, sizeof(LOC8));
	LOC8.ClPrc = HEX3Aanonymous_579125; LOC8.ClEnv = HEX3Aenv_579312;
	registercallback_277401(result, ((NimStringDesc*) &TMP3660), LOC8);
	memset((void*)(&LOC9), 0, sizeof(LOC9));
	LOC9.ClPrc = HEX3Aanonymous_579128; LOC9.ClEnv = HEX3Aenv_579312;
	registercallback_277401(result, ((NimStringDesc*) &TMP3662), LOC9);
	memset((void*)(&LOC10), 0, sizeof(LOC10));
	LOC10.ClPrc = HEX3Aanonymous_579131; LOC10.ClEnv = HEX3Aenv_579312;
	registercallback_277401(result, ((NimStringDesc*) &TMP3664), LOC10);
	memset((void*)(&LOC11), 0, sizeof(LOC11));
	LOC11.ClPrc = HEX3Aanonymous_579134; LOC11.ClEnv = HEX3Aenv_579312;
	registercallback_277401(result, ((NimStringDesc*) &TMP3666), LOC11);
	memset((void*)(&LOC12), 0, sizeof(LOC12));
	LOC12.ClPrc = HEX3Aanonymous_579137; LOC12.ClEnv = HEX3Aenv_579312;
	registercallback_277401(result, ((NimStringDesc*) &TMP3668), LOC12);
	memset((void*)(&LOC13), 0, sizeof(LOC13));
	LOC13.ClPrc = HEX3Aanonymous_579140; LOC13.ClEnv = HEX3Aenv_579312;
	registercallback_277401(result, ((NimStringDesc*) &TMP3670), LOC13);
	memset((void*)(&LOC14), 0, sizeof(LOC14));
	LOC14.ClPrc = HEX3Aanonymous_579143; LOC14.ClEnv = HEX3Aenv_579312;
	registercallback_277401(result, ((NimStringDesc*) &TMP3672), LOC14);
	memset((void*)(&LOC15), 0, sizeof(LOC15));
	LOC15.ClPrc = ((TMP3675) (HEX3Aanonymous_579146)); LOC15.ClEnv = NIM_NIL;
	registercallback_277401(result, ((NimStringDesc*) &TMP3674), LOC15);
	memset((void*)(&LOC16), 0, sizeof(LOC16));
	LOC16.ClPrc = ((TMP3677) (HEX3Aanonymous_579149)); LOC16.ClEnv = NIM_NIL;
	registercallback_277401(result, ((NimStringDesc*) &TMP3676), LOC16);
	memset((void*)(&LOC17), 0, sizeof(LOC17));
	LOC17.ClPrc = ((TMP3679) (HEX3Aanonymous_579152)); LOC17.ClEnv = NIM_NIL;
	registercallback_277401(result, ((NimStringDesc*) &TMP3678), LOC17);
	memset((void*)(&LOC18), 0, sizeof(LOC18));
	LOC18.ClPrc = ((TMP3681) (HEX3Aanonymous_579155)); LOC18.ClEnv = NIM_NIL;
	registercallback_277401(result, ((NimStringDesc*) &TMP3680), LOC18);
	memset((void*)(&LOC19), 0, sizeof(LOC19));
	LOC19.ClPrc = HEX3Aanonymous_579158; LOC19.ClEnv = HEX3Aenv_579312;
	registercallback_277401(result, ((NimStringDesc*) &TMP3682), LOC19);
	memset((void*)(&LOC20), 0, sizeof(LOC20));
	LOC20.ClPrc = ((TMP3684) (HEX3Aanonymous_579161)); LOC20.ClEnv = NIM_NIL;
	registercallback_277401(result, ((NimStringDesc*) &TMP3683), LOC20);
	memset((void*)(&LOC21), 0, sizeof(LOC21));
	LOC21.ClPrc = ((TMP3686) (HEX3Aanonymous_579164)); LOC21.ClEnv = NIM_NIL;
	registercallback_277401(result, ((NimStringDesc*) &TMP3685), LOC21);
	memset((void*)(&LOC22), 0, sizeof(LOC22));
	LOC22.ClPrc = ((TMP3688) (HEX3Aanonymous_579167)); LOC22.ClEnv = NIM_NIL;
	registercallback_277401(result, ((NimStringDesc*) &TMP3687), LOC22);
	memset((void*)(&LOC23), 0, sizeof(LOC23));
	LOC23.ClPrc = ((TMP3690) (HEX3Aanonymous_579170)); LOC23.ClEnv = NIM_NIL;
	registercallback_277401(result, ((NimStringDesc*) &TMP3689), LOC23);
	memset((void*)(&LOC24), 0, sizeof(LOC24));
	LOC24.ClPrc = ((TMP3693) (HEX3Aanonymous_579173)); LOC24.ClEnv = NIM_NIL;
	registercallback_277401(result, ((NimStringDesc*) &TMP3691), LOC24);
	memset((void*)(&LOC25), 0, sizeof(LOC25));
	LOC25.ClPrc = ((TMP3695) (HEX3Aanonymous_579177)); LOC25.ClEnv = NIM_NIL;
	registercallback_277401(result, ((NimStringDesc*) &TMP3694), LOC25);
	memset((void*)(&LOC26), 0, sizeof(LOC26));
	LOC26.ClPrc = ((TMP3697) (HEX3Aanonymous_579180)); LOC26.ClEnv = NIM_NIL;
	registercallback_277401(result, ((NimStringDesc*) &TMP3696), LOC26);
	memset((void*)(&LOC27), 0, sizeof(LOC27));
	LOC27.ClPrc = ((TMP3699) (HEX3Aanonymous_579183)); LOC27.ClEnv = NIM_NIL;
	registercallback_277401(result, ((NimStringDesc*) &TMP3698), LOC27);
	memset((void*)(&LOC28), 0, sizeof(LOC28));
	LOC28.ClPrc = ((TMP3702) (HEX3Aanonymous_579186)); LOC28.ClEnv = NIM_NIL;
	registercallback_277401(result, ((NimStringDesc*) &TMP3700), LOC28);
	memset((void*)(&LOC29), 0, sizeof(LOC29));
	LOC29.ClPrc = ((TMP3704) (HEX3Aanonymous_579190)); LOC29.ClEnv = NIM_NIL;
	registercallback_277401(result, ((NimStringDesc*) &TMP3703), LOC29);
	memset((void*)(&LOC30), 0, sizeof(LOC30));
	LOC30.ClPrc = ((TMP3706) (HEX3Aanonymous_579193)); LOC30.ClEnv = NIM_NIL;
	registercallback_277401(result, ((NimStringDesc*) &TMP3705), LOC30);
	return result;
}

N_NIMCALL(void, runnimscript_579324)(NimStringDesc* scriptname) {
	Tpass275017 LOC1;
	Tpass275017 LOC2;
	Tsym223841* m;
	Tllstream211204* LOC3;
	gincludefile_275073 = includemodule_574860;
	gimportmodule_275068 = importmodule_574824;
	initdefines_197254();
	definesymbol_197013(((NimStringDesc*) &TMP2024));
	definesymbol_197013(((NimStringDesc*) &TMP2025));
	LOC1.Field0 = myopen_500741;
	LOC1.Field1 = myopencached_500778;
	LOC1.Field2 = myprocess_500917;
	LOC1.Field3 = myclose_500933;
	registerpass_275190((&LOC1));
	LOC2.Field0 = myopen_443295;
	LOC2.Field1 = NIM_NIL;
	LOC2.Field2 = myprocess_443412;
	LOC2.Field3 = myprocess_443412;
	registerpass_275190((&LOC2));
	appendstr_139268((&searchpaths_165136), libpath_165233);
	m = makemodule_575007(scriptname);
	(*m).flags |= ((NU32)1)<<((((NU8) 12))%(sizeof(NU32)*8));
	asgnRef((void**) (&globalctx_443273), setupvm_579089(m, scriptname));
	compilesystemmodule_574910();
	LOC3 = 0;
	LOC3 = llstreamopen_211256(scriptname, ((NU8) 0));
	processmodule_275056(m, LOC3, NIM_NIL);
	resetallmoduleshard_574439();
	asgnRef((void**) (&globalctx_443273), NIM_NIL);
	undefsymbol_197022(((NimStringDesc*) &TMP2024));
	undefsymbol_197022(((NimStringDesc*) &TMP2025));
}
NIM_EXTERNC N_NOINLINE(void, compiler_scriptconfigInit000)(void) {
}

NIM_EXTERNC N_NOINLINE(void, compiler_scriptconfigDatInit000)(void) {
static TNimNode* TMP3643[3];
static TNimNode TMP1601[4];
NTI579197.size = sizeof(TY579197);
NTI579197.kind = 18;
NTI579197.base = 0;
NTI579197.flags = 2;
TMP3643[0] = &TMP1601[1];
TMP1601[1].kind = 1;
TMP1601[1].offset = offsetof(TY579197, HEX3Astate);
TMP1601[1].typ = (&NTI344033);
TMP1601[1].name = ":state";
TMP3643[1] = &TMP1601[2];
TMP1601[2].kind = 1;
TMP1601[2].offset = offsetof(TY579197, errormsg579094);
TMP1601[2].typ = (&NTI149);
TMP1601[2].name = "errorMsg579094";
TMP3643[2] = &TMP1601[3];
TMP1601[3].kind = 1;
TMP1601[3].offset = offsetof(TY579197, vthisdir579095);
TMP1601[3].typ = (&NTI149);
TMP1601[3].name = "vthisDir579095";
TMP1601[0].len = 3; TMP1601[0].kind = 2; TMP1601[0].sons = &TMP3643[0];
NTI579197.node = &TMP1601[0];
NTI579313.size = sizeof(TY579197*);
NTI579313.kind = 22;
NTI579313.base = (&NTI579197);
NTI579313.flags = 2;
NTI579313.marker = TMP3644;
}

