/* 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 <glob.h>
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct Tlinkedlist139028 Tlinkedlist139028;
typedef struct Tlistentry139022 Tlistentry139022;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Cell48947 Cell48947;
typedef struct TNimType TNimType;
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 Stringtableobj144212 Stringtableobj144212;
typedef struct TNimNode TNimNode;
typedef struct TY129408 TY129408;
typedef struct Keyvaluepair144208 Keyvaluepair144208;
typedef struct TY122809 TY122809;
typedef struct Exception Exception;
typedef struct TNimObject TNimObject;
typedef struct TSafePoint TSafePoint;
typedef struct Tstrentry139024 Tstrentry139024;
typedef struct Basechunk30841 Basechunk30841;
typedef struct Freecell30833 Freecell30833;
typedef struct Keyvaluepairseq144210 Keyvaluepairseq144210;
struct  Tlinkedlist139028  {
Tlistentry139022* head;
Tlistentry139022* tail;
NI counter;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
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 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  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct Keyvaluepair144208 {
NimStringDesc* Field0;
NimStringDesc* Field1;
};
struct TY122809 {
NimStringDesc* Field0;
NimStringDesc* Field1;
NimStringDesc* Field2;
};
struct  TNimObject  {
TNimType* m_type;
};
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 NimStringDesc* TY190421[1];
typedef NimStringDesc* TY191306[2];
struct  Tlistentry139022  {
  TNimObject Sup;
Tlistentry139022* prev;
Tlistentry139022* next;
};
struct  Tstrentry139024  {
  Tlistentry139022 Sup;
NimStringDesc* data;
};
typedef NU8 TY211407[32];
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  Stringtableobj144212  {
  TNimObject Sup;
NI counter;
Keyvaluepairseq144210* data;
NU8 mode;
};
struct  Freecell30833  {
Freecell30833* next;
NI zerofield;
};
struct TY129408 {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq144210 {
  TGenericSeq Sup;
  Keyvaluepair144208 data[SEQ_DECL_SIZE];
};
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(Stringtableobj144212*, nstnewStringTable)(NU8 mode);
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*, newSeqRC1)(TNimType* typ, NI len);
N_NIMCALL(NimStringDesc*, nosexpandFilename)(NimStringDesc* filename);
N_NIMCALL(NimStringDesc*, getprefixdir_165366)(void);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(void, nossplitPath)(NimStringDesc* path, Keyvaluepair144208* Result);
N_NIMCALL(NimStringDesc*, nosgetAppDir)(void);
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(NIM_BOOL, nsuStartsWith)(NimStringDesc* s, NimStringDesc* prefix);
N_NIMCALL(NimStringDesc*, copyStr)(NimStringDesc* s, NI start);
N_NIMCALL(NimStringDesc*, copyStr)(NimStringDesc* s, NI first);
N_NIMCALL(NimStringDesc*, nosparentDir)(NimStringDesc* path);
N_NIMCALL(NIM_BOOL, nsthasKey)(Stringtableobj144212* t, NimStringDesc* key);
N_NIMCALL(NimStringDesc**, nstTake)(Stringtableobj144212* t, NimStringDesc* key);
N_NIMCALL(NimStringDesc*, HEX2F_122481)(NimStringDesc* head, NimStringDesc* tail);
N_NIMCALL(NimStringDesc*, cstrToNimstr)(NCSTRING str);
N_NIMCALL(void, nossplitFile)(NimStringDesc* path, TY122809* Result);
N_NIMCALL(void, nstPut)(Stringtableobj144212* t, NimStringDesc* key, NimStringDesc* val);
N_NIMCALL(NimStringDesc*, getnimcachedir_165628)(void);
N_NIMCALL(NimStringDesc*, shortendir_165607)(NimStringDesc* dir);
static N_INLINE(void, pushSafePoint)(TSafePoint* s);
N_NIMCALL(void, noscreateDir)(NimStringDesc* dir);
static N_INLINE(void, popSafePoint)(void);
N_NIMCALL(NIM_BOOL, isObj)(TNimType* obj, TNimType* subclass);
static N_INLINE(Exception*, getCurrentException)(void);
static N_INLINE(void, writeline_166405)(FILE* f, NimStringDesc** x, NI xLen0);
N_NIMCALL(void, write_16895)(FILE* f, NimStringDesc* s);
static N_INLINE(void, popCurrentException)(void);
N_NIMCALL(void, reraiseException)(void);
N_NIMCALL(NimStringDesc*, nosjoinPath)(NimStringDesc* head, NimStringDesc* tail);
N_NIMCALL(NimStringDesc*, nosjoinPathOpenArray)(NimStringDesc** parts, NI partsLen0);
N_NIMCALL(NimStringDesc*, noschangeFileExt)(NimStringDesc* filename, NimStringDesc* ext);
N_NIMCALL(NimStringDesc*, getpackagename_166025)(NimStringDesc* path);
N_NIMCALL(NimStringDesc*, nosaddFileExt)(NimStringDesc* filename, NimStringDesc* ext);
N_NIMCALL(NIM_BOOL, nosexistsFile)(NimStringDesc* filename);
N_NIMCALL(NimStringDesc*, findfile_166539)(NimStringDesc* f);
N_NIMCALL(NIM_BOOL, nosisAbsolute)(NimStringDesc* path);
N_NIMCALL(NimStringDesc*, rawfindfile_166480)(NimStringDesc* f);
N_NIMCALL(NimStringDesc*, canonicalizepath_165409)(NimStringDesc* path);
N_NIMCALL(NimStringDesc*, nsuToLowerStr)(NimStringDesc* s);
N_NIMCALL(NimStringDesc*, rawfindfile2_166506)(NimStringDesc* f);
N_NIMCALL(void, bringtofront_139705)(Tlinkedlist139028* list, Tlistentry139022* entry);
N_NIMCALL(NimStringDesc*, copyStrLast)(NimStringDesc* s, NI start_81016, NI last);
N_NIMCALL(NimStringDesc*, copyStrLast)(NimStringDesc* s, NI first, NI last);
N_NIMCALL(NimStringDesc*, getordefault_145020)(Stringtableobj144212* t, NimStringDesc* key);
N_NIMCALL(NimStringDesc*, canondynlibname_166659)(NimStringDesc* s);
N_NIMCALL(NI, nsuFindCharSet)(NimStringDesc* s, TY211407 chars, NI start);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(NI, nsuFindChar)(NimStringDesc* s, NIM_CHAR sub, NI start);
N_NIMCALL(void, libcandidates_166609)(NimStringDesc* s, TY129408** dest);
N_NIMCALL(TGenericSeq*, incrSeqV2)(TGenericSeq* seq, NI elemsize);
STRING_LITERAL(TMP41, "", 0);
STRING_LITERAL(TMP1522, "*.nimble", 8);
STRING_LITERAL(TMP1523, "*.babel", 7);
STRING_LITERAL(TMP1524, "nimcache", 8);
STRING_LITERAL(TMP1526, "\012", 1);
STRING_LITERAL(TMP1527, "cannot create directory: ", 25);
STRING_LITERAL(TMP1575, "nim", 3);
STRING_LITERAL(TMP1985, "lib", 3);
static NIM_CONST TY211407 TMP1986 = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
;
STRING_LITERAL(TMP1987, "true", 4);
STRING_LITERAL(TMP1996, "/usr", 4);
STRING_LITERAL(TMP1997, "/usr/lib/nim", 12);
STRING_LITERAL(TMP1998, "/usr/local", 10);
STRING_LITERAL(TMP1999, "/usr/local/lib/nim", 18);
STRING_LITERAL(TMP2064, "sug", 3);
STRING_LITERAL(TMP2065, "con", 3);
STRING_LITERAL(TMP2066, "def", 3);
STRING_LITERAL(TMP2067, "use", 3);
STRING_LITERAL(TMP2068, "dus", 3);
STRING_LITERAL(TMP2069, "none", 4);
NU8 gidecmd_165119;
NU32 goptions_165130;
NU32 gglobaloptions_165132;
NI8 gexitcode_165133;
NU8 gcmd_165134;
NU8 gselectedgc_165135;
Tlinkedlist139028 searchpaths_165136;
Tlinkedlist139028 lazypaths_165137;
NimStringDesc* outfile_165138;
extern Gcheap51018 gch_51059;
NimStringDesc* docseesrcurl_165139;
NimStringDesc* headerfile_165140;
NI gverbosity_165141;
NI gnumberofprocessors_165142;
NIM_BOOL gwholeproject_165143;
NimStringDesc* gevalexpr_165144;
NF glastcmdtime_165145;
NIM_BOOL glistfullpaths_165146;
NIM_BOOL isserving_165147;
NIM_BOOL gnonimblepath_165148;
NIM_BOOL gexperimentalmode_165149;
Stringtableobj144212* gconfigvars_165230;
Stringtableobj144212* gdlloverrides_165231;
NimStringDesc* gprefixdir_165232;
NimStringDesc* libpath_165233;
NimStringDesc* gprojectname_165234;
NimStringDesc* gprojectpath_165235;
NimStringDesc* gprojectfull_165236;
NIM_BOOL gprojectisstdin_165237;
NI32 gprojectmainidx_165238;
NimStringDesc* nimcachedir_165239;
NimStringDesc* command_165240;
TY129408* commandargs_165258;
extern TNimType NTI129408; /* seq[string] */
NIM_BOOL gkeepcomments_165259;
TY129408* implicitimports_165277;
TY129408* implicitincludes_165295;
Stringtableobj144212* packagecache_165801;
TNimType NTI165015; /* TOption */
TNimType NTI165017; /* TOptions */
extern TSafePoint* exchandler_20843;
extern TNimType NTI4033; /* OSError */
extern Exception* currexception_20845;
TNimType NTI165029; /* IdeCmd */

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(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;
}

N_NIMCALL(NimStringDesc*, canonicalizepath_165409)(NimStringDesc* path) {
	NimStringDesc* result;
	result = 0;
	result = nosexpandFilename(path);
	return result;
}

N_NIMCALL(NimStringDesc*, getprefixdir_165366)(void) {
	NimStringDesc* result;
	result = 0;
	{
		if (!!(((gprefixdir_165232) && (gprefixdir_165232)->Sup.len == 0))) goto LA3;
		result = copyString(gprefixdir_165232);
	}
	goto LA1;
	LA3: ;
	{
		NimStringDesc* LOC6;
		Keyvaluepair144208 LOC7;
		LOC6 = 0;
		LOC6 = nosgetAppDir();
		memset((void*)(&LOC7), 0, sizeof(LOC7));
		nossplitPath(LOC6, (&LOC7));
		result = copyString(LOC7.Field0);
	}
	LA1: ;
	return result;
}

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(NimStringDesc*, shortendir_165607)(NimStringDesc* dir) {
	NimStringDesc* result;
	NimStringDesc* prefix;
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	NimStringDesc* LOC8;
{	result = 0;
	LOC1 = 0;
	LOC2 = 0;
	LOC2 = getprefixdir_165366();
	LOC1 = rawNewString(LOC2->Sup.len + 1);
appendString(LOC1, LOC2);
appendChar(LOC1, 47);
	prefix = LOC1;
	{
		NIM_BOOL LOC5;
		LOC5 = 0;
		LOC5 = nsuStartsWith(dir, prefix);
		if (!LOC5) goto LA6;
		result = copyStr(dir, (prefix ? prefix->Sup.len : 0));
		goto BeforeRet;
	}
	LA6: ;
	LOC8 = 0;
	LOC8 = rawNewString(gprojectpath_165235->Sup.len + 1);
appendString(LOC8, gprojectpath_165235);
appendChar(LOC8, 47);
	prefix = LOC8;
	{
		NIM_BOOL LOC11;
		LOC11 = 0;
		LOC11 = nsuStartsWith(dir, prefix);
		if (!LOC11) goto LA12;
		result = copyStr(dir, (prefix ? prefix->Sup.len : 0));
		goto BeforeRet;
	}
	LA12: ;
	result = copyString(dir);
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NimStringDesc*, getpackagename_166025)(NimStringDesc* path) {
	NimStringDesc* result;
	NI parents;
{	result = 0;
	parents = ((NI) 0);
	{
		{
			NimStringDesc* d_166031;
			NimStringDesc* current_166088;
			d_166031 = 0;
			current_166088 = copyString(path);
			{
				while (1) {
					current_166088 = nosparentDir(current_166088);
					{
						if (!((current_166088 ? current_166088->Sup.len : 0) == ((NI) 0))) goto LA7;
						goto LA3;
					}
					LA7: ;
					d_166031 = current_166088;
					{
						NIM_BOOL LOC11;
						NimStringDesc** LOC14;
						LOC11 = 0;
						LOC11 = nsthasKey(packagecache_165801, d_166031);
						if (!LOC11) goto LA12;
						LOC14 = 0;
						LOC14 = nstTake(packagecache_165801, d_166031);
						result = copyString((*LOC14));
						goto BeforeRet;
					}
					LA12: ;
					parents += ((NI) 1);
					{
						NimStringDesc* file_166041;
						NimStringDesc* HEX3Atmp_166055;
						glob_t f_166059;
						NI res_166061;
						int LOC16;
						file_166041 = 0;
						HEX3Atmp_166055 = 0;
						HEX3Atmp_166055 = HEX2F_122481(d_166031, ((NimStringDesc*) &TMP1522));
						memset((void*)(&f_166059), 0, sizeof(f_166059));
						res_166061 = 0;
						f_166059.gl_offs = ((NI) 0);
						f_166059.gl_pathc = ((NI) 0);
						f_166059.gl_pathv = NIM_NIL;
						LOC16 = 0;
						LOC16 = glob(HEX3Atmp_166055->data, ((int) 0), NIM_NIL, (&f_166059));
						res_166061 = ((NI) (LOC16));
						{
							if (!(res_166061 == ((NI) 0))) goto LA19;
							{
								NI i_166063;
								NI HEX3Atmp_166065;
								NI res_166067;
								i_166063 = 0;
								HEX3Atmp_166065 = 0;
								HEX3Atmp_166065 = (NI)(f_166059.gl_pathc - ((NI) 1));
								res_166067 = ((NI) 0);
								{
									while (1) {
										TY122809 LOC24;
										if (!(res_166067 <= HEX3Atmp_166065)) goto LA23;
										i_166063 = res_166067;
										file_166041 = cstrToNimstr(f_166059.gl_pathv[(i_166063)- 0]);
										memset((void*)(&LOC24), 0, sizeof(LOC24));
										nossplitFile(file_166041, (&LOC24));
										result = copyString(LOC24.Field1);
										goto LA1;
										res_166067 += ((NI) 1);
									} LA23: ;
								}
							}
						}
						LA19: ;
						globfree((&f_166059));
					}
					{
						NimStringDesc* file_166042;
						NimStringDesc* HEX3Atmp_166071;
						glob_t f_166075;
						NI res_166077;
						int LOC26;
						file_166042 = 0;
						HEX3Atmp_166071 = 0;
						HEX3Atmp_166071 = HEX2F_122481(d_166031, ((NimStringDesc*) &TMP1523));
						memset((void*)(&f_166075), 0, sizeof(f_166075));
						res_166077 = 0;
						f_166075.gl_offs = ((NI) 0);
						f_166075.gl_pathc = ((NI) 0);
						f_166075.gl_pathv = NIM_NIL;
						LOC26 = 0;
						LOC26 = glob(HEX3Atmp_166071->data, ((int) 0), NIM_NIL, (&f_166075));
						res_166077 = ((NI) (LOC26));
						{
							if (!(res_166077 == ((NI) 0))) goto LA29;
							{
								NI i_166079;
								NI HEX3Atmp_166081;
								NI res_166083;
								i_166079 = 0;
								HEX3Atmp_166081 = 0;
								HEX3Atmp_166081 = (NI)(f_166075.gl_pathc - ((NI) 1));
								res_166083 = ((NI) 0);
								{
									while (1) {
										TY122809 LOC34;
										if (!(res_166083 <= HEX3Atmp_166081)) goto LA33;
										i_166079 = res_166083;
										file_166042 = cstrToNimstr(f_166075.gl_pathv[(i_166079)- 0]);
										memset((void*)(&LOC34), 0, sizeof(LOC34));
										nossplitFile(file_166042, (&LOC34));
										result = copyString(LOC34.Field1);
										goto LA1;
										res_166083 += ((NI) 1);
									} LA33: ;
								}
							}
						}
						LA29: ;
						globfree((&f_166075));
					}
				}
			} LA3: ;
		}
	} LA1: ;
	{
		if (!result == 0) goto LA37;
		result = copyString(((NimStringDesc*) &TMP41));
	}
	LA37: ;
	{
		NimStringDesc* d_166043;
		NimStringDesc* current_166092;
		d_166043 = 0;
		current_166092 = copyString(path);
		{
			while (1) {
				current_166092 = nosparentDir(current_166092);
				{
					if (!((current_166092 ? current_166092->Sup.len : 0) == ((NI) 0))) goto LA44;
					goto LA40;
				}
				LA44: ;
				d_166043 = current_166092;
				nstPut(packagecache_165801, d_166043, result);
				parents -= ((NI) 1);
				{
					if (!(parents <= ((NI) 0))) goto LA48;
					goto LA39;
				}
				LA48: ;
			}
		} LA40: ;
	} LA39: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NimStringDesc*, getnimcachedir_165628)(void) {
	NimStringDesc* result;
	result = 0;
	{
		if (!(((NI) 0) < (nimcachedir_165239 ? nimcachedir_165239->Sup.len : 0))) goto LA3;
		result = copyString(nimcachedir_165239);
	}
	goto LA1;
	LA3: ;
	{
		NimStringDesc* LOC6;
		LOC6 = 0;
		LOC6 = shortendir_165607(gprojectpath_165235);
		result = HEX2F_122481(LOC6, ((NimStringDesc*) &TMP1524));
	}
	LA1: ;
	return result;
}

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

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(void, writeline_166405)(FILE* f, NimStringDesc** x, NI xLen0) {
	{
		NimStringDesc* i_166421;
		NI i_166429;
		i_166421 = 0;
		i_166429 = ((NI) 0);
		{
			while (1) {
				if (!(i_166429 < xLen0)) goto LA3;
				i_166421 = x[i_166429];
				write_16895(f, i_166421);
				i_166429 += ((NI) 1);
			} LA3: ;
		}
	}
	write_16895(f, ((NimStringDesc*) &TMP1526));
}

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

N_NIMCALL(NimStringDesc*, completegeneratedfilepath_166201)(NimStringDesc* f, NIM_BOOL createsubdir) {
	NimStringDesc* result;
	Keyvaluepair144208 LOC1;
	NimStringDesc* head;
	NimStringDesc* tail;
	NimStringDesc* subdir;
	result = 0;
	memset((void*)(&LOC1), 0, sizeof(LOC1));
	nossplitPath(f, (&LOC1));
	head = 0;
	head = copyString(LOC1.Field0);
	tail = 0;
	tail = copyString(LOC1.Field1);
	subdir = getnimcachedir_165628();
	{
		TSafePoint TMP1525;
		if (!createsubdir) goto LA4;
		pushSafePoint(&TMP1525);
		TMP1525.status = _setjmp(TMP1525.context);
		if (TMP1525.status == 0) {
			noscreateDir(subdir);
			popSafePoint();
		}
		else {
			popSafePoint();
			if (isObj(getCurrentException()->Sup.m_type, (&NTI4033))) {
				TY190421 LOC9;
				NimStringDesc* LOC10;
				TMP1525.status = 0;
				memset((void*)LOC9, 0, sizeof(LOC9));
				LOC10 = 0;
				LOC10 = rawNewString(subdir->Sup.len + 25);
appendString(LOC10, ((NimStringDesc*) &TMP1527));
appendString(LOC10, subdir);
				LOC9[0] = LOC10;
				writeline_166405(stdout, LOC9, 1);
				exit(((NI) 1));
				popCurrentException();
			}
		}
		if (TMP1525.status != 0) reraiseException();
	}
	LA4: ;
	result = nosjoinPath(subdir, tail);
	return result;
}

N_NIMCALL(NimStringDesc*, togeneratedfile_166158)(NimStringDesc* path, NimStringDesc* ext) {
	NimStringDesc* result;
	Keyvaluepair144208 LOC1;
	NimStringDesc* head;
	NimStringDesc* tail;
	TY191306 LOC2;
	result = 0;
	memset((void*)(&LOC1), 0, sizeof(LOC1));
	nossplitPath(path, (&LOC1));
	head = 0;
	head = copyString(LOC1.Field0);
	tail = 0;
	tail = copyString(LOC1.Field1);
	memset((void*)LOC2, 0, sizeof(LOC2));
	LOC2[0] = getnimcachedir_165628();
	LOC2[1] = noschangeFileExt(tail, ext);
	result = nosjoinPathOpenArray(LOC2, 2);
	return result;
}

N_NIMCALL(NimStringDesc*, withpackagename_166144)(NimStringDesc* path) {
	NimStringDesc* result;
	NimStringDesc* x;
	result = 0;
	x = getpackagename_166025(path);
	{
		if (!((x ? x->Sup.len : 0) == ((NI) 0))) goto LA3;
		result = copyString(path);
	}
	goto LA1;
	LA3: ;
	{
		TY122809 LOC6;
		NimStringDesc* p;
		NimStringDesc* file;
		NimStringDesc* ext;
		NimStringDesc* LOC7;
		NimStringDesc* LOC8;
		NimStringDesc* LOC9;
		memset((void*)(&LOC6), 0, sizeof(LOC6));
		nossplitFile(path, (&LOC6));
		p = 0;
		p = LOC6.Field0;
		file = 0;
		file = LOC6.Field1;
		ext = 0;
		ext = LOC6.Field2;
		LOC7 = 0;
		LOC8 = 0;
		LOC8 = rawNewString(x->Sup.len + file->Sup.len + 1);
appendString(LOC8, x);
appendChar(LOC8, 95);
appendString(LOC8, file);
		LOC9 = 0;
		LOC9 = HEX2F_122481(p, LOC8);
		LOC7 = rawNewString(LOC9->Sup.len + ext->Sup.len + 0);
appendString(LOC7, LOC9);
appendString(LOC7, ext);
		result = LOC7;
	}
	LA1: ;
	return result;
}

N_NIMCALL(NimStringDesc*, rawfindfile_166480)(NimStringDesc* f) {
	NimStringDesc* result;
{	result = 0;
	{
		NimStringDesc* it_166484;
		Tstrentry139024* it_166490;
		it_166484 = 0;
		it_166490 = ((Tstrentry139024*) (searchpaths_165136.head));
		{
			while (1) {
				if (!!((it_166490 == NIM_NIL))) goto LA3;
				it_166484 = (*it_166490).data;
				result = nosjoinPath(it_166484, f);
				{
					NIM_BOOL LOC6;
					LOC6 = 0;
					LOC6 = nosexistsFile(result);
					if (!LOC6) goto LA7;
					result = canonicalizepath_165409(result);
					goto BeforeRet;
				}
				LA7: ;
				it_166490 = ((Tstrentry139024*) ((*it_166490).Sup.next));
			} LA3: ;
		}
	}
	result = copyString(((NimStringDesc*) &TMP41));
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NimStringDesc*, rawfindfile2_166506)(NimStringDesc* f) {
	NimStringDesc* result;
	Tstrentry139024* it;
{	result = 0;
	it = ((Tstrentry139024*) (lazypaths_165137.head));
	{
		while (1) {
			if (!!((it == NIM_NIL))) goto LA2;
			result = nosjoinPath((*it).data, f);
			{
				NIM_BOOL LOC5;
				Tlistentry139022* LOC8;
				LOC5 = 0;
				LOC5 = nosexistsFile(result);
				if (!LOC5) goto LA6;
				LOC8 = 0;
				LOC8 = &it->Sup;
				bringtofront_139705((&lazypaths_165137), LOC8);
				result = canonicalizepath_165409(result);
				goto BeforeRet;
			}
			LA6: ;
			it = ((Tstrentry139024*) ((*it).Sup.next));
		} LA2: ;
	}
	result = copyString(((NimStringDesc*) &TMP41));
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NimStringDesc*, findfile_166539)(NimStringDesc* f) {
	NimStringDesc* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = nosisAbsolute(f);
		if (!LOC3) goto LA4;
		{
			NIM_BOOL LOC8;
			LOC8 = 0;
			LOC8 = nosexistsFile(f);
			if (!LOC8) goto LA9;
			result = copyString(f);
		}
		goto LA6;
		LA9: ;
		{
			result = copyString(((NimStringDesc*) &TMP41));
		}
		LA6: ;
	}
	goto LA1;
	LA4: ;
	{
		result = rawfindfile_166480(f);
		{
			NimStringDesc* LOC17;
			if (!((result ? result->Sup.len : 0) == ((NI) 0))) goto LA15;
			LOC17 = 0;
			LOC17 = nsuToLowerStr(f);
			result = rawfindfile_166480(LOC17);
			{
				if (!((result ? result->Sup.len : 0) == ((NI) 0))) goto LA20;
				result = rawfindfile2_166506(f);
				{
					NimStringDesc* LOC26;
					if (!((result ? result->Sup.len : 0) == ((NI) 0))) goto LA24;
					LOC26 = 0;
					LOC26 = nsuToLowerStr(f);
					result = rawfindfile2_166506(LOC26);
				}
				LA24: ;
			}
			LA20: ;
		}
		LA15: ;
	}
	LA1: ;
	return result;
}

N_NIMCALL(NimStringDesc*, findmodule_166549)(NimStringDesc* modulename, NimStringDesc* currentmodule) {
	NimStringDesc* result;
	NimStringDesc* m;
	NimStringDesc* currentpath;
	TY122809 LOC1;
	result = 0;
	m = nosaddFileExt(modulename, ((NimStringDesc*) &TMP1575));
	memset((void*)(&LOC1), 0, sizeof(LOC1));
	nossplitFile(currentmodule, (&LOC1));
	currentpath = LOC1.Field0;
	result = HEX2F_122481(currentpath, m);
	{
		NIM_BOOL LOC4;
		LOC4 = 0;
		LOC4 = nosexistsFile(result);
		if (!!(LOC4)) goto LA5;
		result = findfile_166539(m);
	}
	LA5: ;
	return result;
}

N_NIMCALL(NimStringDesc*, removetrailingdirsep_165618)(NimStringDesc* path) {
	NimStringDesc* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = (((NI) 0) < (path ? path->Sup.len : 0));
		if (!(LOC3)) goto LA4;
		LOC3 = ((NU8)(path->data[(NI)((path ? path->Sup.len : 0) - ((NI) 1))]) == (NU8)(47));
		LA4: ;
		if (!LOC3) goto LA5;
		result = copyStrLast(path, ((NI) 0), (NI)((path ? path->Sup.len : 0) - ((NI) 2)));
	}
	goto LA1;
	LA5: ;
	{
		result = copyString(path);
	}
	LA1: ;
	return result;
}

N_NIMCALL(NimStringDesc*, getconfigvar_165335)(NimStringDesc* key) {
	NimStringDesc* result;
	result = 0;
	result = getordefault_145020(gconfigvars_165230, key);
	return result;
}

N_NIMCALL(NIM_BOOL, existsconfigvar_165325)(NimStringDesc* key) {
	NIM_BOOL result;
	result = 0;
	result = nsthasKey(gconfigvars_165230, key);
	return result;
}

N_NIMCALL(NimStringDesc*, canondynlibname_166659)(NimStringDesc* s) {
	NimStringDesc* result;
	NI start;
	NI ende;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = nsuStartsWith(s, ((NimStringDesc*) &TMP1985));
		if (!LOC3) goto LA4;
		start = ((NI) 3);
	}
	goto LA1;
	LA4: ;
	{
		start = ((NI) 0);
	}
	LA1: ;
	ende = nsuFindCharSet(s, TMP1986, ((NI) 0));
	{
		if (!(((NI) 0) <= ende)) goto LA9;
		result = copyStrLast(s, start, (NI)(ende - ((NI) 1)));
	}
	goto LA7;
	LA9: ;
	{
		result = copyStr(s, start);
	}
	LA7: ;
	return result;
}

N_NIMCALL(void, incldynliboverride_166672)(NimStringDesc* lib) {
	NimStringDesc* LOC1;
	LOC1 = 0;
	LOC1 = canondynlibname_166659(lib);
	nstPut(gdlloverrides_165231, LOC1, ((NimStringDesc*) &TMP1987));
}

N_NIMCALL(void, setconfigvar_165345)(NimStringDesc* key, NimStringDesc* val) {
	nstPut(gconfigvars_165230, key, val);
}

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;
}

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;
}

N_NIMCALL(void, setdefaultlibpath_165375)(void) {
	{
		NimStringDesc* prefix;
		if (!((libpath_165233) && (libpath_165233)->Sup.len == 0)) goto LA3;
		prefix = getprefixdir_165366();
		{
			NimStringDesc* LOC9;
			if (!eqStrings(prefix, ((NimStringDesc*) &TMP1996))) goto LA7;
			LOC9 = 0;
			LOC9 = libpath_165233; libpath_165233 = copyStringRC1(((NimStringDesc*) &TMP1997));
			if (LOC9) nimGCunrefNoCycle(LOC9);
		}
		goto LA5;
		LA7: ;
		{
			NimStringDesc* LOC13;
			if (!eqStrings(prefix, ((NimStringDesc*) &TMP1998))) goto LA11;
			LOC13 = 0;
			LOC13 = libpath_165233; libpath_165233 = copyStringRC1(((NimStringDesc*) &TMP1999));
			if (LOC13) nimGCunrefNoCycle(LOC13);
		}
		goto LA5;
		LA11: ;
		{
			asgnRefNoCycle((void**) (&libpath_165233), nosjoinPath(prefix, ((NimStringDesc*) &TMP1985)));
		}
		LA5: ;
	}
	LA3: ;
}

N_NIMCALL(NimStringDesc*, HEX24_166755)(NU8 c) {
	NimStringDesc* result;
	result = 0;
	switch (c) {
	case ((NU8) 1):
	{
		result = copyString(((NimStringDesc*) &TMP2064));
	}
	break;
	case ((NU8) 2):
	{
		result = copyString(((NimStringDesc*) &TMP2065));
	}
	break;
	case ((NU8) 3):
	{
		result = copyString(((NimStringDesc*) &TMP2066));
	}
	break;
	case ((NU8) 4):
	{
		result = copyString(((NimStringDesc*) &TMP2067));
	}
	break;
	case ((NU8) 5):
	{
		result = copyString(((NimStringDesc*) &TMP2068));
	}
	break;
	case ((NU8) 0):
	{
		result = copyString(((NimStringDesc*) &TMP2069));
	}
	break;
	}
	return result;
}

N_NIMCALL(NU8, parseidecmd_166745)(NimStringDesc* s) {
	NU8 result;
	result = 0;
	if (eqStrings(s, ((NimStringDesc*) &TMP2064))) goto LA1;
	if (eqStrings(s, ((NimStringDesc*) &TMP2065))) goto LA2;
	if (eqStrings(s, ((NimStringDesc*) &TMP2066))) goto LA3;
	if (eqStrings(s, ((NimStringDesc*) &TMP2067))) goto LA4;
	if (eqStrings(s, ((NimStringDesc*) &TMP2068))) goto LA5;
	goto LA6;
	LA1: ;
	{
		result = ((NU8) 1);
	}
	goto LA7;
	LA2: ;
	{
		result = ((NU8) 2);
	}
	goto LA7;
	LA3: ;
	{
		result = ((NU8) 3);
	}
	goto LA7;
	LA4: ;
	{
		result = ((NU8) 4);
	}
	goto LA7;
	LA5: ;
	{
		result = ((NU8) 5);
	}
	goto LA7;
	LA6: ;
	{
		result = ((NU8) 0);
	}
	LA7: ;
	return result;
}

N_NIMCALL(NIM_BOOL, isdynliboverride_166681)(NimStringDesc* lib) {
	NIM_BOOL result;
	NimStringDesc* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = canondynlibname_166659(lib);
	result = nsthasKey(gdlloverrides_165231, LOC1);
	return result;
}

N_NIMCALL(void, resetpackagecache_165805)(void) {
	asgnRef((void**) (&packagecache_165801), nstnewStringTable(((NU8) 1)));
}

N_NIMCALL(void, libcandidates_166609)(NimStringDesc* s, TY129408** dest) {
	NI le;
	NI ri;
	le = nsuFindChar(s, 40, ((NI) 0));
	ri = nsuFindChar(s, 41, ((NI) ((NI)(le + ((NI) 1)))));
	{
		NIM_BOOL LOC3;
		NimStringDesc* prefix;
		NimStringDesc* suffix;
		LOC3 = 0;
		LOC3 = (((NI) 0) <= le);
		if (!(LOC3)) goto LA4;
		LOC3 = (le < ri);
		LA4: ;
		if (!LOC3) goto LA5;
		prefix = copyStrLast(s, ((NI) 0), (NI)(le - ((NI) 1)));
		suffix = copyStr(s, (NI)(ri + ((NI) 1)));
		{
			NimStringDesc* middle_166619;
			NimStringDesc* HEX3Atmp_166631;
			NI last_166635;
			middle_166619 = 0;
			HEX3Atmp_166631 = 0;
			HEX3Atmp_166631 = copyStrLast(s, (NI)(le + ((NI) 1)), (NI)(ri - ((NI) 1)));
			last_166635 = ((NI) 0);
			{
				if (!(((NI) 0) < (HEX3Atmp_166631 ? HEX3Atmp_166631->Sup.len : 0))) goto LA10;
				{
					while (1) {
						NI first_166637;
						NimStringDesc* LOC18;
						if (!(last_166635 <= (HEX3Atmp_166631 ? HEX3Atmp_166631->Sup.len : 0))) goto LA13;
						first_166637 = last_166635;
						{
							while (1) {
								NIM_BOOL LOC16;
								LOC16 = 0;
								LOC16 = (last_166635 < (HEX3Atmp_166631 ? HEX3Atmp_166631->Sup.len : 0));
								if (!(LOC16)) goto LA17;
								LOC16 = !(((NU8)(HEX3Atmp_166631->data[last_166635]) == (NU8)(124)));
								LA17: ;
								if (!LOC16) goto LA15;
								last_166635 += ((NI) 1);
							} LA15: ;
						}
						middle_166619 = copyStrLast(HEX3Atmp_166631, first_166637, (NI)(last_166635 - ((NI) 1)));
						LOC18 = 0;
						LOC18 = rawNewString(prefix->Sup.len + middle_166619->Sup.len + suffix->Sup.len + 0);
appendString(LOC18, prefix);
appendString(LOC18, middle_166619);
appendString(LOC18, suffix);
						libcandidates_166609(LOC18, dest);
						last_166635 += ((NI) 1);
					} LA13: ;
				}
			}
			LA10: ;
		}
	}
	goto LA1;
	LA5: ;
	{
		NimStringDesc* LOC20;
		(*dest) = (TY129408*) incrSeqV2(&((*dest))->Sup, sizeof(NimStringDesc*));
		LOC20 = 0;
		LOC20 = (*dest)->data[(*dest)->Sup.len]; (*dest)->data[(*dest)->Sup.len] = copyStringRC1(s);
		if (LOC20) nimGCunrefNoCycle(LOC20);
		++(*dest)->Sup.len;
	}
	LA1: ;
}

N_NIMCALL(NimStringDesc*, getoutfile_165355)(NimStringDesc* filename, NimStringDesc* ext) {
	NimStringDesc* result;
	result = 0;
	{
		if (!!(((outfile_165138) && (outfile_165138)->Sup.len == 0))) goto LA3;
		result = copyString(outfile_165138);
	}
	goto LA1;
	LA3: ;
	{
		result = noschangeFileExt(filename, ext);
	}
	LA1: ;
	return result;
}

N_NIMCALL(NimStringDesc*, maincommandarg_165308)(void) {
	NimStringDesc* result;
	result = 0;
	{
		if (!(((NI) 0) < (commandargs_165258 ? commandargs_165258->Sup.len : 0))) goto LA3;
		result = copyString(commandargs_165258->data[((NI) 0)]);
	}
	goto LA1;
	LA3: ;
	{
		result = copyString(gprojectname_165234);
	}
	LA1: ;
	return result;
}
NIM_EXTERNC N_NOINLINE(void, compiler_optionsInit000)(void) {
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	NimStringDesc* LOC3;
	NimStringDesc* LOC4;
	NimStringDesc* LOC5;
	NimStringDesc* LOC6;
	NimStringDesc* LOC7;
	NimStringDesc* LOC8;
	NimStringDesc* LOC9;
	NimStringDesc* LOC10;
	NimStringDesc* LOC11;
	goptions_165130 = 2202238;
	gglobaloptions_165132 = 16777216;
	gcmd_165134 = ((NU8) 0);
	gselectedgc_165135 = ((NU8) 4);
	LOC1 = 0;
	LOC1 = outfile_165138; outfile_165138 = copyStringRC1(((NimStringDesc*) &TMP41));
	if (LOC1) nimGCunrefNoCycle(LOC1);
	LOC2 = 0;
	LOC2 = docseesrcurl_165139; docseesrcurl_165139 = copyStringRC1(((NimStringDesc*) &TMP41));
	if (LOC2) nimGCunrefNoCycle(LOC2);
	LOC3 = 0;
	LOC3 = headerfile_165140; headerfile_165140 = copyStringRC1(((NimStringDesc*) &TMP41));
	if (LOC3) nimGCunrefNoCycle(LOC3);
	gverbosity_165141 = ((NI) 1);
	LOC4 = 0;
	LOC4 = gevalexpr_165144; gevalexpr_165144 = copyStringRC1(((NimStringDesc*) &TMP41));
	if (LOC4) nimGCunrefNoCycle(LOC4);
	isserving_165147 = NIM_FALSE;
	gnonimblepath_165148 = NIM_FALSE;
	asgnRef((void**) (&gconfigvars_165230), nstnewStringTable(((NU8) 2)));
	asgnRef((void**) (&gdlloverrides_165231), nstnewStringTable(((NU8) 1)));
	LOC5 = 0;
	LOC5 = gprefixdir_165232; gprefixdir_165232 = copyStringRC1(((NimStringDesc*) &TMP41));
	if (LOC5) nimGCunrefNoCycle(LOC5);
	LOC6 = 0;
	LOC6 = libpath_165233; libpath_165233 = copyStringRC1(((NimStringDesc*) &TMP41));
	if (LOC6) nimGCunrefNoCycle(LOC6);
	LOC7 = 0;
	LOC7 = gprojectname_165234; gprojectname_165234 = copyStringRC1(((NimStringDesc*) &TMP41));
	if (LOC7) nimGCunrefNoCycle(LOC7);
	LOC8 = 0;
	LOC8 = gprojectpath_165235; gprojectpath_165235 = copyStringRC1(((NimStringDesc*) &TMP41));
	if (LOC8) nimGCunrefNoCycle(LOC8);
	LOC9 = 0;
	LOC9 = gprojectfull_165236; gprojectfull_165236 = copyStringRC1(((NimStringDesc*) &TMP41));
	if (LOC9) nimGCunrefNoCycle(LOC9);
	gprojectisstdin_165237 = NIM_FALSE;
	LOC10 = 0;
	LOC10 = nimcachedir_165239; nimcachedir_165239 = copyStringRC1(((NimStringDesc*) &TMP41));
	if (LOC10) nimGCunrefNoCycle(LOC10);
	LOC11 = 0;
	LOC11 = command_165240; command_165240 = copyStringRC1(((NimStringDesc*) &TMP41));
	if (LOC11) nimGCunrefNoCycle(LOC11);
	if (commandargs_165258) nimGCunrefNoCycle(commandargs_165258);
	commandargs_165258 = (TY129408*) newSeqRC1((&NTI129408), 0);
	gkeepcomments_165259 = NIM_TRUE;
	if (implicitimports_165277) nimGCunrefNoCycle(implicitimports_165277);
	implicitimports_165277 = (TY129408*) newSeqRC1((&NTI129408), 0);
	if (implicitincludes_165295) nimGCunrefNoCycle(implicitincludes_165295);
	implicitincludes_165295 = (TY129408*) newSeqRC1((&NTI129408), 0);
	asgnRef((void**) (&packagecache_165801), nstnewStringTable(((NU8) 1)));
}

NIM_EXTERNC N_NOINLINE(void, compiler_optionsDatInit000)(void) {
static TNimNode* TMP840[22];
NI TMP842;
static char* NIM_CONST TMP841[22] = {
"optNone", 
"optObjCheck", 
"optFieldCheck", 
"optRangeCheck", 
"optBoundsCheck", 
"optOverflowCheck", 
"optNilCheck", 
"optNaNCheck", 
"optInfCheck", 
"optAssert", 
"optLineDir", 
"optWarns", 
"optHints", 
"optOptimizeSpeed", 
"optOptimizeSize", 
"optStackTrace", 
"optLineTrace", 
"optEndb", 
"optByRef", 
"optProfiler", 
"optImplicitStatic", 
"optPatterns"};
static TNimNode* TMP2727[6];
NI TMP2729;
static char* NIM_CONST TMP2728[6] = {
"ideNone", 
"ideSug", 
"ideCon", 
"ideDef", 
"ideUse", 
"ideDus"};
static TNimNode TMP21[31];
NTI165015.size = sizeof(NU8);
NTI165015.kind = 14;
NTI165015.base = 0;
NTI165015.flags = 3;
for (TMP842 = 0; TMP842 < 22; TMP842++) {
TMP21[TMP842+0].kind = 1;
TMP21[TMP842+0].offset = TMP842;
TMP21[TMP842+0].name = TMP841[TMP842];
TMP840[TMP842] = &TMP21[TMP842+0];
}
TMP21[22].len = 22; TMP21[22].kind = 2; TMP21[22].sons = &TMP840[0];
NTI165015.node = &TMP21[22];
NTI165017.size = sizeof(NU32);
NTI165017.kind = 19;
NTI165017.base = (&NTI165015);
NTI165017.flags = 3;
TMP21[23].len = 0; TMP21[23].kind = 0;
NTI165017.node = &TMP21[23];
NTI165029.size = sizeof(NU8);
NTI165029.kind = 14;
NTI165029.base = 0;
NTI165029.flags = 3;
for (TMP2729 = 0; TMP2729 < 6; TMP2729++) {
TMP21[TMP2729+24].kind = 1;
TMP21[TMP2729+24].offset = TMP2729;
TMP21[TMP2729+24].name = TMP2728[TMP2729];
TMP2727[TMP2729] = &TMP21[TMP2729+24];
}
TMP21[30].len = 6; TMP21[30].kind = 2; TMP21[30].sons = &TMP2727[0];
NTI165029.node = &TMP21[30];
}

