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

#include "nimbase.h"
#include <string.h>
#include <glob.h>
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct Tlinkedlist140028 Tlinkedlist140028;
typedef struct Tlistentry140022 Tlistentry140022;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Cell48946 Cell48946;
typedef struct TNimType TNimType;
typedef struct Cellseq48962 Cellseq48962;
typedef struct Gcheap51018 Gcheap51018;
typedef struct Gcstack51016 Gcstack51016;
typedef struct Cellset48958 Cellset48958;
typedef struct Pagedesc48954 Pagedesc48954;
typedef struct Memregion30890 Memregion30890;
typedef struct Smallchunk30842 Smallchunk30842;
typedef struct Llchunk30884 Llchunk30884;
typedef struct Bigchunk30844 Bigchunk30844;
typedef struct Intset30817 Intset30817;
typedef struct Trunk30813 Trunk30813;
typedef struct Avlnode30888 Avlnode30888;
typedef struct Gcstat51014 Gcstat51014;
typedef struct Stringtableobj145212 Stringtableobj145212;
typedef struct TNimNode TNimNode;
typedef struct TY130408 TY130408;
typedef struct Keyvaluepair145208 Keyvaluepair145208;
typedef struct TY123809 TY123809;
typedef struct Exception Exception;
typedef struct TNimObject TNimObject;
typedef struct TSafePoint TSafePoint;
typedef struct Tstrentry140024 Tstrentry140024;
typedef struct Basechunk30840 Basechunk30840;
typedef struct Freecell30832 Freecell30832;
typedef struct Keyvaluepairseq145210 Keyvaluepairseq145210;
struct  Tlinkedlist140028  {
Tlistentry140022* head;
Tlistentry140022* tail;
NI counter;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Cell48946  {
NI refcount;
TNimType* typ;
};
struct  Cellseq48962  {
NI len;
NI cap;
Cell48946** d;
};
struct  Cellset48958  {
NI counter;
NI max;
Pagedesc48954* head;
Pagedesc48954** data;
};
typedef Smallchunk30842* TY30905[512];
typedef Trunk30813* Trunkbuckets30815[256];
struct  Intset30817  {
Trunkbuckets30815 data;
};
struct  Memregion30890  {
NI minlargeobj;
NI maxlargeobj;
TY30905 freesmallchunks;
Llchunk30884* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk30844* freechunkslist;
Intset30817 chunkstarts;
Avlnode30888* root;
Avlnode30888* deleted;
Avlnode30888* last;
Avlnode30888* 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;
Cellseq48962 zct;
Cellseq48962 decstack;
Cellset48958 cycleroots;
Cellseq48962 tempstack;
NI recgclock;
Memregion30890 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 Keyvaluepair145208 {
NimStringDesc* Field0;
NimStringDesc* Field1;
};
struct TY123809 {
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* TY192421[1];
typedef NimStringDesc* TY193306[2];
struct  Tlistentry140022  {
  TNimObject Sup;
Tlistentry140022* prev;
Tlistentry140022* next;
};
struct  Tstrentry140024  {
  Tlistentry140022 Sup;
NimStringDesc* data;
};
typedef NU8 TY213407[32];
struct  Gcstack51016  {
Gcstack51016* prev;
Gcstack51016* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY30821[16];
struct  Pagedesc48954  {
Pagedesc48954* next;
NI key;
TY30821 bits;
};
struct  Basechunk30840  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk30842  {
  Basechunk30840 Sup;
Smallchunk30842* next;
Smallchunk30842* prev;
Freecell30832* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk30884  {
NI size;
NI acc;
Llchunk30884* next;
};
struct  Bigchunk30844  {
  Basechunk30840 Sup;
Bigchunk30844* next;
Bigchunk30844* prev;
NI align;
NF data;
};
struct  Trunk30813  {
Trunk30813* next;
NI key;
TY30821 bits;
};
typedef Avlnode30888* TY30895[2];
struct  Avlnode30888  {
TY30895 link;
NI key;
NI upperbound;
NI level;
};
struct  Stringtableobj145212  {
  TNimObject Sup;
NI counter;
Keyvaluepairseq145210* data;
NU8 mode;
};
struct  Freecell30832  {
Freecell30832* next;
NI zerofield;
};
struct TY130408 {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq145210 {
  TGenericSeq Sup;
  Keyvaluepair145208 data[SEQ_DECL_SIZE];
};
N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(Cell48946*, usrtocell_52646)(void* usr);
static N_INLINE(void, rtladdzct_54204)(Cell48946* c);
N_NOINLINE(void, addzct_52617)(Cellseq48962* s, Cell48946* c);
N_NIMCALL(Stringtableobj145212*, nstnewStringTable)(NU8 mode);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incref_55022)(Cell48946* c);
static N_INLINE(NIM_BOOL, canbecycleroot_52667)(Cell48946* c);
static N_INLINE(void, rtladdcycleroot_53423)(Cell48946* c);
N_NOINLINE(void, incl_49665)(Cellset48958* s, Cell48946* cell);
static N_INLINE(void, decref_54604)(Cell48946* c);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
N_NIMCALL(NimStringDesc*, nosexpandFilename)(NimStringDesc* filename);
N_NIMCALL(NimStringDesc*, getprefixdir_167366)(void);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(void, nossplitPath)(NimStringDesc* path, Keyvaluepair145208* 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)(Stringtableobj145212* t, NimStringDesc* key);
N_NIMCALL(NimStringDesc**, nstTake)(Stringtableobj145212* t, NimStringDesc* key);
N_NIMCALL(NimStringDesc*, HEX2F_123481)(NimStringDesc* head, NimStringDesc* tail);
N_NIMCALL(NimStringDesc*, cstrToNimstr)(NCSTRING str);
N_NIMCALL(void, nossplitFile)(NimStringDesc* path, TY123809* Result);
N_NIMCALL(void, nstPut)(Stringtableobj145212* t, NimStringDesc* key, NimStringDesc* val);
N_NIMCALL(NimStringDesc*, getnimcachedir_167628)(void);
N_NIMCALL(NimStringDesc*, shortendir_167607)(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_168405)(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_168025)(NimStringDesc* path);
N_NIMCALL(NimStringDesc*, nosaddFileExt)(NimStringDesc* filename, NimStringDesc* ext);
N_NIMCALL(NIM_BOOL, nosexistsFile)(NimStringDesc* filename);
N_NIMCALL(NimStringDesc*, findfile_168539)(NimStringDesc* f);
N_NIMCALL(NIM_BOOL, nosisAbsolute)(NimStringDesc* path);
N_NIMCALL(NimStringDesc*, rawfindfile_168480)(NimStringDesc* f);
N_NIMCALL(NimStringDesc*, canonicalizepath_167409)(NimStringDesc* path);
N_NIMCALL(NimStringDesc*, nsuToLowerStr)(NimStringDesc* s);
N_NIMCALL(NimStringDesc*, rawfindfile2_168506)(NimStringDesc* f);
N_NIMCALL(void, bringtofront_140705)(Tlinkedlist140028* list, Tlistentry140022* 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_146020)(Stringtableobj145212* t, NimStringDesc* key);
N_NIMCALL(NimStringDesc*, canondynlibname_168659)(NimStringDesc* s);
N_NIMCALL(NI, nsuFindCharSet)(NimStringDesc* s, TY213407 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_168609)(NimStringDesc* s, TY130408** dest);
N_NIMCALL(TGenericSeq*, incrSeqV2)(TGenericSeq* seq, NI elemsize);
STRING_LITERAL(TMP43, "", 0);
STRING_LITERAL(TMP1524, "*.nimble", 8);
STRING_LITERAL(TMP1525, "*.babel", 7);
STRING_LITERAL(TMP1526, "nimcache", 8);
STRING_LITERAL(TMP1528, "\012", 1);
STRING_LITERAL(TMP1529, "cannot create directory: ", 25);
STRING_LITERAL(TMP1577, "nim", 3);
STRING_LITERAL(TMP1987, "lib", 3);
static NIM_CONST TY213407 TMP1988 = {
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(TMP1989, "true", 4);
STRING_LITERAL(TMP1998, "/usr", 4);
STRING_LITERAL(TMP1999, "/usr/lib/nim", 12);
STRING_LITERAL(TMP2000, "/usr/local", 10);
STRING_LITERAL(TMP2001, "/usr/local/lib/nim", 18);
STRING_LITERAL(TMP2066, "sug", 3);
STRING_LITERAL(TMP2067, "con", 3);
STRING_LITERAL(TMP2068, "def", 3);
STRING_LITERAL(TMP2069, "use", 3);
STRING_LITERAL(TMP2070, "dus", 3);
STRING_LITERAL(TMP2071, "none", 4);
NU8 gidecmd_167119;
NU32 goptions_167130;
NU32 gglobaloptions_167132;
NI8 gexitcode_167133;
NU8 gcmd_167134;
NU8 gselectedgc_167135;
Tlinkedlist140028 searchpaths_167136;
Tlinkedlist140028 lazypaths_167137;
NimStringDesc* outfile_167138;
extern Gcheap51018 gch_51059;
NimStringDesc* docseesrcurl_167139;
NimStringDesc* headerfile_167140;
NI gverbosity_167141;
NI gnumberofprocessors_167142;
NIM_BOOL gwholeproject_167143;
NimStringDesc* gevalexpr_167144;
NF glastcmdtime_167145;
NIM_BOOL glistfullpaths_167146;
NIM_BOOL isserving_167147;
NIM_BOOL gnonimblepath_167148;
NIM_BOOL gexperimentalmode_167149;
Stringtableobj145212* gconfigvars_167230;
Stringtableobj145212* gdlloverrides_167231;
NimStringDesc* gprefixdir_167232;
NimStringDesc* libpath_167233;
NimStringDesc* gprojectname_167234;
NimStringDesc* gprojectpath_167235;
NimStringDesc* gprojectfull_167236;
NIM_BOOL gprojectisstdin_167237;
NI32 gprojectmainidx_167238;
NimStringDesc* nimcachedir_167239;
NimStringDesc* command_167240;
TY130408* commandargs_167258;
extern TNimType NTI130408; /* seq[string] */
NIM_BOOL gkeepcomments_167259;
TY130408* implicitimports_167277;
TY130408* implicitincludes_167295;
Stringtableobj145212* packagecache_167801;
TNimType NTI167015; /* TOption */
TNimType NTI167017; /* TOptions */
extern TSafePoint* exchandler_20843;
extern TNimType NTI4033; /* OSError */
extern Exception* currexception_20845;
TNimType NTI167029; /* IdeCmd */

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

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

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

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

static N_INLINE(void, rtladdcycleroot_53423)(Cell48946* 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)(Cell48946* c) {
	(*c).refcount = (NI)((NU32)((*c).refcount) + (NU32)(((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)(Cell48946* c) {
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU32)((*c).refcount) < (NU32)(((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) {
	{
		Cell48946* LOC5;
		if (!!((src == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = usrtocell_52646(src);
		incref_55022(LOC5);
	}
	LA3: ;
	{
		Cell48946* LOC10;
		if (!!(((*dest) == NIM_NIL))) goto LA8;
		LOC10 = 0;
		LOC10 = usrtocell_52646((*dest));
		decref_54604(LOC10);
	}
	LA8: ;
	(*dest) = src;
}

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

N_NIMCALL(NimStringDesc*, getprefixdir_167366)(void) {
	NimStringDesc* result;
	result = 0;
	{
		if (!!(((gprefixdir_167232) && (gprefixdir_167232)->Sup.len == 0))) goto LA3;
		result = copyString(gprefixdir_167232);
	}
	goto LA1;
	LA3: ;
	{
		NimStringDesc* LOC6;
		Keyvaluepair145208 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_167607)(NimStringDesc* dir) {
	NimStringDesc* result;
	NimStringDesc* prefix;
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	NimStringDesc* LOC8;
{	result = 0;
	LOC1 = 0;
	LOC2 = 0;
	LOC2 = getprefixdir_167366();
	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_167235->Sup.len + 1);
appendString(LOC8, gprojectpath_167235);
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_168025)(NimStringDesc* path) {
	NimStringDesc* result;
	NI parents;
{	result = 0;
	parents = ((NI) 0);
	{
		{
			NimStringDesc* d_168031;
			NimStringDesc* current_168088;
			d_168031 = 0;
			current_168088 = copyString(path);
			{
				while (1) {
					current_168088 = nosparentDir(current_168088);
					{
						if (!((current_168088 ? current_168088->Sup.len : 0) == ((NI) 0))) goto LA7;
						goto LA3;
					}
					LA7: ;
					d_168031 = current_168088;
					{
						NIM_BOOL LOC11;
						NimStringDesc** LOC14;
						LOC11 = 0;
						LOC11 = nsthasKey(packagecache_167801, d_168031);
						if (!LOC11) goto LA12;
						LOC14 = 0;
						LOC14 = nstTake(packagecache_167801, d_168031);
						result = copyString((*LOC14));
						goto BeforeRet;
					}
					LA12: ;
					parents += ((NI) 1);
					{
						NimStringDesc* file_168041;
						NimStringDesc* HEX3Atmp_168055;
						glob_t f_168059;
						NI res_168061;
						int LOC16;
						file_168041 = 0;
						HEX3Atmp_168055 = 0;
						HEX3Atmp_168055 = HEX2F_123481(d_168031, ((NimStringDesc*) &TMP1524));
						memset((void*)(&f_168059), 0, sizeof(f_168059));
						res_168061 = 0;
						f_168059.gl_offs = ((NI) 0);
						f_168059.gl_pathc = ((NI) 0);
						f_168059.gl_pathv = NIM_NIL;
						LOC16 = 0;
						LOC16 = glob(HEX3Atmp_168055->data, ((int) 0), NIM_NIL, (&f_168059));
						res_168061 = ((NI) (LOC16));
						{
							if (!(res_168061 == ((NI) 0))) goto LA19;
							{
								NI i_168063;
								NI HEX3Atmp_168065;
								NI res_168067;
								i_168063 = 0;
								HEX3Atmp_168065 = 0;
								HEX3Atmp_168065 = (NI)(f_168059.gl_pathc - ((NI) 1));
								res_168067 = ((NI) 0);
								{
									while (1) {
										TY123809 LOC24;
										if (!(res_168067 <= HEX3Atmp_168065)) goto LA23;
										i_168063 = res_168067;
										file_168041 = cstrToNimstr(f_168059.gl_pathv[(i_168063)- 0]);
										memset((void*)(&LOC24), 0, sizeof(LOC24));
										nossplitFile(file_168041, (&LOC24));
										result = copyString(LOC24.Field1);
										goto LA1;
										res_168067 += ((NI) 1);
									} LA23: ;
								}
							}
						}
						LA19: ;
						globfree((&f_168059));
					}
					{
						NimStringDesc* file_168042;
						NimStringDesc* HEX3Atmp_168071;
						glob_t f_168075;
						NI res_168077;
						int LOC26;
						file_168042 = 0;
						HEX3Atmp_168071 = 0;
						HEX3Atmp_168071 = HEX2F_123481(d_168031, ((NimStringDesc*) &TMP1525));
						memset((void*)(&f_168075), 0, sizeof(f_168075));
						res_168077 = 0;
						f_168075.gl_offs = ((NI) 0);
						f_168075.gl_pathc = ((NI) 0);
						f_168075.gl_pathv = NIM_NIL;
						LOC26 = 0;
						LOC26 = glob(HEX3Atmp_168071->data, ((int) 0), NIM_NIL, (&f_168075));
						res_168077 = ((NI) (LOC26));
						{
							if (!(res_168077 == ((NI) 0))) goto LA29;
							{
								NI i_168079;
								NI HEX3Atmp_168081;
								NI res_168083;
								i_168079 = 0;
								HEX3Atmp_168081 = 0;
								HEX3Atmp_168081 = (NI)(f_168075.gl_pathc - ((NI) 1));
								res_168083 = ((NI) 0);
								{
									while (1) {
										TY123809 LOC34;
										if (!(res_168083 <= HEX3Atmp_168081)) goto LA33;
										i_168079 = res_168083;
										file_168042 = cstrToNimstr(f_168075.gl_pathv[(i_168079)- 0]);
										memset((void*)(&LOC34), 0, sizeof(LOC34));
										nossplitFile(file_168042, (&LOC34));
										result = copyString(LOC34.Field1);
										goto LA1;
										res_168083 += ((NI) 1);
									} LA33: ;
								}
							}
						}
						LA29: ;
						globfree((&f_168075));
					}
				}
			} LA3: ;
		}
	} LA1: ;
	{
		if (!result == 0) goto LA37;
		result = copyString(((NimStringDesc*) &TMP43));
	}
	LA37: ;
	{
		NimStringDesc* d_168043;
		NimStringDesc* current_168092;
		d_168043 = 0;
		current_168092 = copyString(path);
		{
			while (1) {
				current_168092 = nosparentDir(current_168092);
				{
					if (!((current_168092 ? current_168092->Sup.len : 0) == ((NI) 0))) goto LA44;
					goto LA40;
				}
				LA44: ;
				d_168043 = current_168092;
				nstPut(packagecache_167801, d_168043, result);
				parents -= ((NI) 1);
				{
					if (!(parents <= ((NI) 0))) goto LA48;
					goto LA39;
				}
				LA48: ;
			}
		} LA40: ;
	} LA39: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NimStringDesc*, getnimcachedir_167628)(void) {
	NimStringDesc* result;
	result = 0;
	{
		if (!(((NI) 0) < (nimcachedir_167239 ? nimcachedir_167239->Sup.len : 0))) goto LA3;
		result = copyString(nimcachedir_167239);
	}
	goto LA1;
	LA3: ;
	{
		NimStringDesc* LOC6;
		LOC6 = 0;
		LOC6 = shortendir_167607(gprojectpath_167235);
		result = HEX2F_123481(LOC6, ((NimStringDesc*) &TMP1526));
	}
	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_168405)(FILE* f, NimStringDesc** x, NI xLen0) {
	{
		NimStringDesc* i_168421;
		NI i_168429;
		i_168421 = 0;
		i_168429 = ((NI) 0);
		{
			while (1) {
				if (!(i_168429 < xLen0)) goto LA3;
				i_168421 = x[i_168429];
				write_16895(f, i_168421);
				i_168429 += ((NI) 1);
			} LA3: ;
		}
	}
	write_16895(f, ((NimStringDesc*) &TMP1528));
}

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

N_NIMCALL(NimStringDesc*, completegeneratedfilepath_168201)(NimStringDesc* f, NIM_BOOL createsubdir) {
	NimStringDesc* result;
	Keyvaluepair145208 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_167628();
	{
		TSafePoint TMP1527;
		if (!createsubdir) goto LA4;
		pushSafePoint(&TMP1527);
		TMP1527.status = setjmp(TMP1527.context);
		if (TMP1527.status == 0) {
			noscreateDir(subdir);
			popSafePoint();
		}
		else {
			popSafePoint();
			if (isObj(getCurrentException()->Sup.m_type, (&NTI4033))) {
				TY192421 LOC9;
				NimStringDesc* LOC10;
				TMP1527.status = 0;
				memset((void*)LOC9, 0, sizeof(LOC9));
				LOC10 = 0;
				LOC10 = rawNewString(subdir->Sup.len + 25);
appendString(LOC10, ((NimStringDesc*) &TMP1529));
appendString(LOC10, subdir);
				LOC9[0] = LOC10;
				writeline_168405(stdout, LOC9, 1);
				exit(((NI) 1));
				popCurrentException();
			}
		}
		if (TMP1527.status != 0) reraiseException();
	}
	LA4: ;
	result = nosjoinPath(subdir, tail);
	return result;
}

N_NIMCALL(NimStringDesc*, togeneratedfile_168158)(NimStringDesc* path, NimStringDesc* ext) {
	NimStringDesc* result;
	Keyvaluepair145208 LOC1;
	NimStringDesc* head;
	NimStringDesc* tail;
	TY193306 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_167628();
	LOC2[1] = noschangeFileExt(tail, ext);
	result = nosjoinPathOpenArray(LOC2, 2);
	return result;
}

N_NIMCALL(NimStringDesc*, withpackagename_168144)(NimStringDesc* path) {
	NimStringDesc* result;
	NimStringDesc* x;
	result = 0;
	x = getpackagename_168025(path);
	{
		if (!((x ? x->Sup.len : 0) == ((NI) 0))) goto LA3;
		result = copyString(path);
	}
	goto LA1;
	LA3: ;
	{
		TY123809 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_123481(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_168480)(NimStringDesc* f) {
	NimStringDesc* result;
{	result = 0;
	{
		NimStringDesc* it_168484;
		Tstrentry140024* it_168490;
		it_168484 = 0;
		it_168490 = ((Tstrentry140024*) (searchpaths_167136.head));
		{
			while (1) {
				if (!!((it_168490 == NIM_NIL))) goto LA3;
				it_168484 = (*it_168490).data;
				result = nosjoinPath(it_168484, f);
				{
					NIM_BOOL LOC6;
					LOC6 = 0;
					LOC6 = nosexistsFile(result);
					if (!LOC6) goto LA7;
					result = canonicalizepath_167409(result);
					goto BeforeRet;
				}
				LA7: ;
				it_168490 = ((Tstrentry140024*) ((*it_168490).Sup.next));
			} LA3: ;
		}
	}
	result = copyString(((NimStringDesc*) &TMP43));
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NimStringDesc*, rawfindfile2_168506)(NimStringDesc* f) {
	NimStringDesc* result;
	Tstrentry140024* it;
{	result = 0;
	it = ((Tstrentry140024*) (lazypaths_167137.head));
	{
		while (1) {
			if (!!((it == NIM_NIL))) goto LA2;
			result = nosjoinPath((*it).data, f);
			{
				NIM_BOOL LOC5;
				Tlistentry140022* LOC8;
				LOC5 = 0;
				LOC5 = nosexistsFile(result);
				if (!LOC5) goto LA6;
				LOC8 = 0;
				LOC8 = &it->Sup;
				bringtofront_140705((&lazypaths_167137), LOC8);
				result = canonicalizepath_167409(result);
				goto BeforeRet;
			}
			LA6: ;
			it = ((Tstrentry140024*) ((*it).Sup.next));
		} LA2: ;
	}
	result = copyString(((NimStringDesc*) &TMP43));
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NimStringDesc*, findfile_168539)(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*) &TMP43));
		}
		LA6: ;
	}
	goto LA1;
	LA4: ;
	{
		result = rawfindfile_168480(f);
		{
			NimStringDesc* LOC17;
			if (!((result ? result->Sup.len : 0) == ((NI) 0))) goto LA15;
			LOC17 = 0;
			LOC17 = nsuToLowerStr(f);
			result = rawfindfile_168480(LOC17);
			{
				if (!((result ? result->Sup.len : 0) == ((NI) 0))) goto LA20;
				result = rawfindfile2_168506(f);
				{
					NimStringDesc* LOC26;
					if (!((result ? result->Sup.len : 0) == ((NI) 0))) goto LA24;
					LOC26 = 0;
					LOC26 = nsuToLowerStr(f);
					result = rawfindfile2_168506(LOC26);
				}
				LA24: ;
			}
			LA20: ;
		}
		LA15: ;
	}
	LA1: ;
	return result;
}

N_NIMCALL(NimStringDesc*, findmodule_168549)(NimStringDesc* modulename, NimStringDesc* currentmodule) {
	NimStringDesc* result;
	NimStringDesc* m;
	NimStringDesc* currentpath;
	TY123809 LOC1;
	result = 0;
	m = nosaddFileExt(modulename, ((NimStringDesc*) &TMP1577));
	memset((void*)(&LOC1), 0, sizeof(LOC1));
	nossplitFile(currentmodule, (&LOC1));
	currentpath = LOC1.Field0;
	result = HEX2F_123481(currentpath, m);
	{
		NIM_BOOL LOC4;
		LOC4 = 0;
		LOC4 = nosexistsFile(result);
		if (!!(LOC4)) goto LA5;
		result = findfile_168539(m);
	}
	LA5: ;
	return result;
}

N_NIMCALL(NimStringDesc*, removetrailingdirsep_167618)(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_167335)(NimStringDesc* key) {
	NimStringDesc* result;
	result = 0;
	result = getordefault_146020(gconfigvars_167230, key);
	return result;
}

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

N_NIMCALL(NimStringDesc*, canondynlibname_168659)(NimStringDesc* s) {
	NimStringDesc* result;
	NI start;
	NI ende;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = nsuStartsWith(s, ((NimStringDesc*) &TMP1987));
		if (!LOC3) goto LA4;
		start = ((NI) 3);
	}
	goto LA1;
	LA4: ;
	{
		start = ((NI) 0);
	}
	LA1: ;
	ende = nsuFindCharSet(s, TMP1988, ((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_168672)(NimStringDesc* lib) {
	NimStringDesc* LOC1;
	LOC1 = 0;
	LOC1 = canondynlibname_168659(lib);
	nstPut(gdlloverrides_167231, LOC1, ((NimStringDesc*) &TMP1989));
}

N_NIMCALL(void, setconfigvar_167345)(NimStringDesc* key, NimStringDesc* val) {
	nstPut(gconfigvars_167230, 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) {
	{
		Cell48946* c;
		if (!!((src == NIM_NIL))) goto LA3;
		c = usrtocell_52646(src);
		(*c).refcount += ((NI) 8);
	}
	LA3: ;
	{
		Cell48946* c;
		if (!!(((*dest) == NIM_NIL))) goto LA7;
		c = usrtocell_52646((*dest));
		{
			(*c).refcount -= ((NI) 8);
			if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA11;
			rtladdzct_54204(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

N_NIMCALL(void, setdefaultlibpath_167375)(void) {
	{
		NimStringDesc* prefix;
		if (!((libpath_167233) && (libpath_167233)->Sup.len == 0)) goto LA3;
		prefix = getprefixdir_167366();
		{
			NimStringDesc* LOC9;
			if (!eqStrings(prefix, ((NimStringDesc*) &TMP1998))) goto LA7;
			LOC9 = 0;
			LOC9 = libpath_167233; libpath_167233 = copyStringRC1(((NimStringDesc*) &TMP1999));
			if (LOC9) nimGCunrefNoCycle(LOC9);
		}
		goto LA5;
		LA7: ;
		{
			NimStringDesc* LOC13;
			if (!eqStrings(prefix, ((NimStringDesc*) &TMP2000))) goto LA11;
			LOC13 = 0;
			LOC13 = libpath_167233; libpath_167233 = copyStringRC1(((NimStringDesc*) &TMP2001));
			if (LOC13) nimGCunrefNoCycle(LOC13);
		}
		goto LA5;
		LA11: ;
		{
			asgnRefNoCycle((void**) (&libpath_167233), nosjoinPath(prefix, ((NimStringDesc*) &TMP1987)));
		}
		LA5: ;
	}
	LA3: ;
}

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

N_NIMCALL(NU8, parseidecmd_168745)(NimStringDesc* s) {
	NU8 result;
	result = 0;
	if (eqStrings(s, ((NimStringDesc*) &TMP2066))) goto LA1;
	if (eqStrings(s, ((NimStringDesc*) &TMP2067))) goto LA2;
	if (eqStrings(s, ((NimStringDesc*) &TMP2068))) goto LA3;
	if (eqStrings(s, ((NimStringDesc*) &TMP2069))) goto LA4;
	if (eqStrings(s, ((NimStringDesc*) &TMP2070))) 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_168681)(NimStringDesc* lib) {
	NIM_BOOL result;
	NimStringDesc* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = canondynlibname_168659(lib);
	result = nsthasKey(gdlloverrides_167231, LOC1);
	return result;
}

N_NIMCALL(void, resetpackagecache_167805)(void) {
	asgnRef((void**) (&packagecache_167801), nstnewStringTable(((NU8) 1)));
}

N_NIMCALL(void, libcandidates_168609)(NimStringDesc* s, TY130408** 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_168619;
			NimStringDesc* HEX3Atmp_168631;
			NI last_168635;
			middle_168619 = 0;
			HEX3Atmp_168631 = 0;
			HEX3Atmp_168631 = copyStrLast(s, (NI)(le + ((NI) 1)), (NI)(ri - ((NI) 1)));
			last_168635 = ((NI) 0);
			{
				if (!(((NI) 0) < (HEX3Atmp_168631 ? HEX3Atmp_168631->Sup.len : 0))) goto LA10;
				{
					while (1) {
						NI first_168637;
						NimStringDesc* LOC18;
						if (!(last_168635 <= (HEX3Atmp_168631 ? HEX3Atmp_168631->Sup.len : 0))) goto LA13;
						first_168637 = last_168635;
						{
							while (1) {
								NIM_BOOL LOC16;
								LOC16 = 0;
								LOC16 = (last_168635 < (HEX3Atmp_168631 ? HEX3Atmp_168631->Sup.len : 0));
								if (!(LOC16)) goto LA17;
								LOC16 = !(((NU8)(HEX3Atmp_168631->data[last_168635]) == (NU8)(124)));
								LA17: ;
								if (!LOC16) goto LA15;
								last_168635 += ((NI) 1);
							} LA15: ;
						}
						middle_168619 = copyStrLast(HEX3Atmp_168631, first_168637, (NI)(last_168635 - ((NI) 1)));
						LOC18 = 0;
						LOC18 = rawNewString(prefix->Sup.len + middle_168619->Sup.len + suffix->Sup.len + 0);
appendString(LOC18, prefix);
appendString(LOC18, middle_168619);
appendString(LOC18, suffix);
						libcandidates_168609(LOC18, dest);
						last_168635 += ((NI) 1);
					} LA13: ;
				}
			}
			LA10: ;
		}
	}
	goto LA1;
	LA5: ;
	{
		NimStringDesc* LOC20;
		(*dest) = (TY130408*) 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_167355)(NimStringDesc* filename, NimStringDesc* ext) {
	NimStringDesc* result;
	result = 0;
	{
		if (!!(((outfile_167138) && (outfile_167138)->Sup.len == 0))) goto LA3;
		result = copyString(outfile_167138);
	}
	goto LA1;
	LA3: ;
	{
		result = noschangeFileExt(filename, ext);
	}
	LA1: ;
	return result;
}

N_NIMCALL(NimStringDesc*, maincommandarg_167308)(void) {
	NimStringDesc* result;
	result = 0;
	{
		if (!(((NI) 0) < (commandargs_167258 ? commandargs_167258->Sup.len : 0))) goto LA3;
		result = copyString(commandargs_167258->data[((NI) 0)]);
	}
	goto LA1;
	LA3: ;
	{
		result = copyString(gprojectname_167234);
	}
	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_167130 = 2202238;
	gglobaloptions_167132 = 16777216;
	gcmd_167134 = ((NU8) 0);
	gselectedgc_167135 = ((NU8) 4);
	LOC1 = 0;
	LOC1 = outfile_167138; outfile_167138 = copyStringRC1(((NimStringDesc*) &TMP43));
	if (LOC1) nimGCunrefNoCycle(LOC1);
	LOC2 = 0;
	LOC2 = docseesrcurl_167139; docseesrcurl_167139 = copyStringRC1(((NimStringDesc*) &TMP43));
	if (LOC2) nimGCunrefNoCycle(LOC2);
	LOC3 = 0;
	LOC3 = headerfile_167140; headerfile_167140 = copyStringRC1(((NimStringDesc*) &TMP43));
	if (LOC3) nimGCunrefNoCycle(LOC3);
	gverbosity_167141 = ((NI) 1);
	LOC4 = 0;
	LOC4 = gevalexpr_167144; gevalexpr_167144 = copyStringRC1(((NimStringDesc*) &TMP43));
	if (LOC4) nimGCunrefNoCycle(LOC4);
	isserving_167147 = NIM_FALSE;
	gnonimblepath_167148 = NIM_FALSE;
	asgnRef((void**) (&gconfigvars_167230), nstnewStringTable(((NU8) 2)));
	asgnRef((void**) (&gdlloverrides_167231), nstnewStringTable(((NU8) 1)));
	LOC5 = 0;
	LOC5 = gprefixdir_167232; gprefixdir_167232 = copyStringRC1(((NimStringDesc*) &TMP43));
	if (LOC5) nimGCunrefNoCycle(LOC5);
	LOC6 = 0;
	LOC6 = libpath_167233; libpath_167233 = copyStringRC1(((NimStringDesc*) &TMP43));
	if (LOC6) nimGCunrefNoCycle(LOC6);
	LOC7 = 0;
	LOC7 = gprojectname_167234; gprojectname_167234 = copyStringRC1(((NimStringDesc*) &TMP43));
	if (LOC7) nimGCunrefNoCycle(LOC7);
	LOC8 = 0;
	LOC8 = gprojectpath_167235; gprojectpath_167235 = copyStringRC1(((NimStringDesc*) &TMP43));
	if (LOC8) nimGCunrefNoCycle(LOC8);
	LOC9 = 0;
	LOC9 = gprojectfull_167236; gprojectfull_167236 = copyStringRC1(((NimStringDesc*) &TMP43));
	if (LOC9) nimGCunrefNoCycle(LOC9);
	gprojectisstdin_167237 = NIM_FALSE;
	LOC10 = 0;
	LOC10 = nimcachedir_167239; nimcachedir_167239 = copyStringRC1(((NimStringDesc*) &TMP43));
	if (LOC10) nimGCunrefNoCycle(LOC10);
	LOC11 = 0;
	LOC11 = command_167240; command_167240 = copyStringRC1(((NimStringDesc*) &TMP43));
	if (LOC11) nimGCunrefNoCycle(LOC11);
	if (commandargs_167258) nimGCunrefNoCycle(commandargs_167258);
	commandargs_167258 = (TY130408*) newSeqRC1((&NTI130408), 0);
	gkeepcomments_167259 = NIM_TRUE;
	if (implicitimports_167277) nimGCunrefNoCycle(implicitimports_167277);
	implicitimports_167277 = (TY130408*) newSeqRC1((&NTI130408), 0);
	if (implicitincludes_167295) nimGCunrefNoCycle(implicitincludes_167295);
	implicitincludes_167295 = (TY130408*) newSeqRC1((&NTI130408), 0);
	asgnRef((void**) (&packagecache_167801), nstnewStringTable(((NU8) 1)));
}

NIM_EXTERNC N_NOINLINE(void, compiler_optionsDatInit000)(void) {
static TNimNode* TMP842[22];
NI TMP844;
static char* NIM_CONST TMP843[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* TMP2729[6];
NI TMP2731;
static char* NIM_CONST TMP2730[6] = {
"ideNone", 
"ideSug", 
"ideCon", 
"ideDef", 
"ideUse", 
"ideDus"};
static TNimNode TMP21[31];
NTI167015.size = sizeof(NU8);
NTI167015.kind = 14;
NTI167015.base = 0;
NTI167015.flags = 3;
for (TMP844 = 0; TMP844 < 22; TMP844++) {
TMP21[TMP844+0].kind = 1;
TMP21[TMP844+0].offset = TMP844;
TMP21[TMP844+0].name = TMP843[TMP844];
TMP842[TMP844] = &TMP21[TMP844+0];
}
TMP21[22].len = 22; TMP21[22].kind = 2; TMP21[22].sons = &TMP842[0];
NTI167015.node = &TMP21[22];
NTI167017.size = sizeof(NU32);
NTI167017.kind = 19;
NTI167017.base = (&NTI167015);
NTI167017.flags = 3;
TMP21[23].len = 0; TMP21[23].kind = 0;
NTI167017.node = &TMP21[23];
NTI167029.size = sizeof(NU8);
NTI167029.kind = 14;
NTI167029.base = 0;
NTI167029.flags = 3;
for (TMP2731 = 0; TMP2731 < 6; TMP2731++) {
TMP21[TMP2731+24].kind = 1;
TMP21[TMP2731+24].offset = TMP2731;
TMP21[TMP2731+24].name = TMP2730[TMP2731];
TMP2729[TMP2731] = &TMP21[TMP2731+24];
}
TMP21[30].len = 6; TMP21[30].kind = 2; TMP21[30].sons = &TMP2729[0];
NTI167029.node = &TMP21[30];
}

