/* 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>
typedef struct Tidtable224859 Tidtable224859;
typedef struct Tidpairseq224857 Tidpairseq224857;
typedef struct Ttype224847 Ttype224847;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tidobj197015 Tidobj197015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttypeseq224843 Ttypeseq224843;
typedef struct Tnode224809 Tnode224809;
typedef struct Tsym224841 Tsym224841;
typedef struct Tloc224823 Tloc224823;
typedef struct Ropeobj175009 Ropeobj175009;
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 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 Tlineinfo189352 Tlineinfo189352;
typedef struct Tscope224835 Tscope224835;
typedef struct TY224944 TY224944;
typedef struct Tstrtable224813 Tstrtable224813;
typedef struct Tsymseq224811 Tsymseq224811;
typedef struct Tident197021 Tident197021;
typedef struct Tlib224827 Tlib224827;
typedef struct Tidpair224855 Tidpair224855;
typedef struct Tnodeseq224803 Tnodeseq224803;
typedef struct Tinfocpu173483 Tinfocpu173483;
typedef struct Basechunk30840 Basechunk30840;
typedef struct Freecell30832 Freecell30832;
typedef struct Tinstantiation224831 Tinstantiation224831;
typedef struct Tlistentry140022 Tlistentry140022;
typedef struct TY224932 TY224932;
struct  Tidtable224859  {
NI counter;
Tidpairseq224857* data;
};
typedef Tidtable224859 TY506274[62];
typedef Ttype224847* TY273026[62];
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
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  Tidobj197015  {
  TNimObject Sup;
NI id;
};
struct  Tloc224823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype224847* t;
Ropeobj175009* r;
Ropeobj175009* heaproot;
};
struct  Ttype224847  {
  Tidobj197015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq224843* sons;
Tnode224809* n;
Tsym224841* owner;
Tsym224841* sym;
Tsym224841* destructor;
Tsym224841* deepcopy;
Tsym224841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc224823 loc;
};
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 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;
Cellseq48963 zct;
Cellseq48963 decstack;
Cellset48959 cycleroots;
Cellseq48963 tempstack;
NI recgclock;
Memregion30890 region;
Gcstat51014 stat;
};
struct  Tlineinfo189352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tstrtable224813  {
NI counter;
Tsymseq224811* data;
};
struct  Tsym224841  {
  Tidobj197015 Sup;
NU8 kind;
union{
struct {Ttypeseq224843* typeinstcache;
Tscope224835* typscope;
} S1;
struct {TY224944* procinstcache;
Tsym224841* gcunsafetyreason;
} S2;
struct {TY224944* usedgenerics;
Tstrtable224813 tab;
} S3;
struct {Tsym224841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype224847* typ;
Tident197021* name;
Tlineinfo189352 info;
Tsym224841* owner;
NU32 flags;
Tnode224809* ast;
NU32 options;
NI position;
NI offset;
Tloc224823 loc;
Tlib224827* annex;
Tnode224809* constraint;
};
struct  Tidpair224855  {
Tidobj197015* key;
TNimObject* val;
};
struct  Tnode224809  {
Ttype224847* typ;
Tlineinfo189352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym224841* sym;
} S4;
struct {Tident197021* ident;
} S5;
struct {Tnodeseq224803* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct Tinfocpu173483 {
NimStringDesc* Field0;
NI Field1;
NU8 Field2;
NI Field3;
NI Field4;
};
typedef Tinfocpu173483 TY173514[18];
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Ropeobj175009  {
  TNimObject Sup;
Ropeobj175009* left;
Ropeobj175009* right;
NI length;
NimStringDesc* data;
};
struct  Gcstack51016  {
Gcstack51016* prev;
Gcstack51016* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY30821[16];
struct  Pagedesc48955  {
Pagedesc48955* 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  Tscope224835  {
NI depthlevel;
Tstrtable224813 symbols;
Tnodeseq224803* usingsyms;
Tscope224835* parent;
};
struct  Tident197021  {
  Tidobj197015 Sup;
NimStringDesc* s;
Tident197021* next;
NI h;
};
struct  Tlistentry140022  {
  TNimObject Sup;
Tlistentry140022* prev;
Tlistentry140022* next;
};
struct  Tlib224827  {
  Tlistentry140022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj175009* name;
Tnode224809* path;
};
struct  Freecell30832  {
Freecell30832* next;
NI zerofield;
};
struct  Tinstantiation224831  {
Tsym224841* sym;
Ttypeseq224843* concretetypes;
TY224932* usedby;
NI compilesid;
};
struct Tidpairseq224857 {
  TGenericSeq Sup;
  Tidpair224855 data[SEQ_DECL_SIZE];
};
struct Ttypeseq224843 {
  TGenericSeq Sup;
  Ttype224847* data[SEQ_DECL_SIZE];
};
struct TY224944 {
  TGenericSeq Sup;
  Tinstantiation224831* data[SEQ_DECL_SIZE];
};
struct Tsymseq224811 {
  TGenericSeq Sup;
  Tsym224841* data[SEQ_DECL_SIZE];
};
struct Tnodeseq224803 {
  TGenericSeq Sup;
  Tnode224809* data[SEQ_DECL_SIZE];
};
struct TY224932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, inittypetables_506285)(void);
N_NIMCALL(void, initidtable_228057)(Tidtable224859* x);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s, NIM_CHAR c);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
static N_INLINE(void, appendChar)(NimStringDesc* dest, NIM_CHAR c);
N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
N_NIMCALL(NimStringDesc*, nsuToHex)(NI64 x, NI len);
N_NIMCALL(NIM_CHAR, nsuToLowerChar)(NIM_CHAR c);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
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, internalerror_195172)(Tlineinfo189352 info, NimStringDesc* errmsg);
N_NIMCALL(void, internalerror_195191)(NimStringDesc* errmsg);
N_NIMCALL(Ttype224847*, getuniquetype_506656)(Ttype224847* key);
N_NIMCALL(Ttype224847*, lastson_227426)(Ttype224847* n);
N_NIMCALL(Ttype224847*, slowsearch_506601)(Ttype224847* key, NU8 k);
N_NIMCALL(NIM_BOOL, idtablehasobjectaskey_232205)(Tidtable224859 t, Tidobj197015* key);
N_NIMCALL(NIM_BOOL, samebackendtype_261024)(Ttype224847* x, Ttype224847* y);
N_NIMCALL(void, idtableput_232196)(Tidtable224859* t, Tidobj197015* key, TNimObject* val);
N_NIMCALL(TNimObject*, idtableget_232182)(Tidtable224859 t, Tidobj197015* key);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(NimStringDesc*, tocchar_189639)(NIM_CHAR c);
N_NIMCALL(Tnode224809*, getpragmastmt_506017)(Tnode224809* n, NU16 w);
static N_INLINE(NI, len_225098)(Tnode224809* n);
static N_INLINE(Tnode224809*, HEX5BHEX5D_225244)(Tnode224809* n, NI i);
N_NIMCALL(NU16, whichpragma_253687)(Tnode224809* n);
STRING_LITERAL(TMP3742, "N", 1);
STRING_LITERAL(TMP3743, "HEX", 3);
STRING_LITERAL(TMP3751, "metatype not eliminated", 23);
STRING_LITERAL(TMP3841, "\"", 1);
extern NIM_CONST TY173514 Cpu_173500;
TY506274 gtypetable_506275;
TY273026 gcanonicaltypes_506279;
extern Gcheap51018 gch_51059;
extern NU8 targetcpu_173628;

N_NIMCALL(void, inittypetables_506285)(void) {
	{
		NU8 i_506423;
		NI res_506430;
		i_506423 = 0;
		res_506430 = ((NI) 0);
		{
			while (1) {
				if (!(res_506430 <= ((NI) 61))) goto LA3;
				i_506423 = ((NU8) (res_506430));
				initidtable_228057((&gtypetable_506275[(i_506423)- 0]));
				res_506430 += ((NI) 1);
			} LA3: ;
		}
	}
}

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*, mangle_506910)(NimStringDesc* name) {
	NimStringDesc* result;
	result = 0;
	result = rawNewString(((NI) ((name ? name->Sup.len : 0))));
	switch (((NU8)(name->data[((NI) 0)]))) {
	case 65 ... 90:
	case 97 ... 122:
	{
		result = addChar(result, name->data[((NI) 0)]);
	}
	break;
	case 48 ... 57:
	{
		NimStringDesc* LOC3;
		LOC3 = 0;
		LOC3 = rawNewString(2);
appendString(LOC3, ((NimStringDesc*) &TMP3742));
appendChar(LOC3, name->data[((NI) 0)]);
		result = resizeString(result, LOC3->Sup.len + 0);
appendString(result, LOC3);
	}
	break;
	default:
	{
		NimStringDesc* LOC5;
		NimStringDesc* LOC6;
		LOC5 = 0;
		LOC6 = 0;
		LOC6 = nsuToHex(((NI64) (((NU8)(name->data[((NI) 0)])))), ((NI) 2));
		LOC5 = rawNewString(LOC6->Sup.len + 3);
appendString(LOC5, ((NimStringDesc*) &TMP3743));
appendString(LOC5, LOC6);
		result = LOC5;
	}
	break;
	}
	{
		NI i_506932;
		NI HEX3Atmp_506943;
		NI res_506946;
		i_506932 = 0;
		HEX3Atmp_506943 = 0;
		HEX3Atmp_506943 = (NI)((name ? name->Sup.len : 0) - ((NI) 1));
		res_506946 = ((NI) 1);
		{
			while (1) {
				NIM_CHAR c;
				if (!(res_506946 <= HEX3Atmp_506943)) goto LA9;
				i_506932 = res_506946;
				c = name->data[i_506932];
				switch (((NU8)(c))) {
				case 65 ... 90:
				{
					NIM_CHAR LOC11;
					LOC11 = 0;
					LOC11 = nsuToLowerChar(c);
					result = addChar(result, LOC11);
				}
				break;
				case 95:
				{
				}
				break;
				case 97 ... 122:
				case 48 ... 57:
				{
					result = addChar(result, c);
				}
				break;
				default:
				{
					NimStringDesc* LOC15;
					NimStringDesc* LOC16;
					LOC15 = 0;
					LOC16 = 0;
					LOC16 = nsuToHex(((NI64) (((NU8)(c)))), ((NI) 2));
					LOC15 = rawNewString(LOC16->Sup.len + 3);
appendString(LOC15, ((NimStringDesc*) &TMP3743));
appendString(LOC15, LOC16);
					result = resizeString(result, LOC15->Sup.len + 0);
appendString(result, LOC15);
				}
				break;
				}
				res_506946 += ((NI) 1);
			} LA9: ;
		}
	}
	return result;
}

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

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

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

N_NIMCALL(Ttype224847*, slowsearch_506601)(Ttype224847* key, NU8 k) {
	Ttype224847* result;
	Tidobj197015* LOC16;
	TNimObject* LOC17;
{	result = 0;
	{
		Tidobj197015* LOC3;
		NIM_BOOL LOC4;
		LOC3 = 0;
		LOC3 = &key->Sup;
		LOC4 = 0;
		LOC4 = idtablehasobjectaskey_232205(gtypetable_506275[(k)- 0], LOC3);
		if (!LOC4) goto LA5;
		result = key;
		goto BeforeRet;
	}
	LA5: ;
	{
		NI h_506618;
		NI HEX3Atmp_506634;
		NI res_506637;
		h_506618 = 0;
		HEX3Atmp_506634 = 0;
		HEX3Atmp_506634 = (gtypetable_506275[(k)- 0].data ? (gtypetable_506275[(k)- 0].data->Sup.len-1) : -1);
		res_506637 = ((NI) 0);
		{
			while (1) {
				Ttype224847* t;
				if (!(res_506637 <= HEX3Atmp_506634)) goto LA9;
				h_506618 = res_506637;
				t = ((Ttype224847*) (gtypetable_506275[(k)- 0].data->data[h_506618].key));
				{
					NIM_BOOL LOC12;
					LOC12 = 0;
					LOC12 = !((t == NIM_NIL));
					if (!(LOC12)) goto LA13;
					LOC12 = samebackendtype_261024(t, key);
					LA13: ;
					if (!LOC12) goto LA14;
					result = t;
					goto BeforeRet;
				}
				LA14: ;
				res_506637 += ((NI) 1);
			} LA9: ;
		}
	}
	LOC16 = 0;
	LOC16 = &key->Sup;
	LOC17 = 0;
	LOC17 = &key->Sup.Sup;
	idtableput_232196((&gtypetable_506275[(k)- 0]), LOC16, LOC17);
	result = key;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Ttype224847*, getuniquetype_506656)(Ttype224847* key) {
	Ttype224847* result;
	NU8 k;
{	result = 0;
	{
		if (!(key == NIM_NIL)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	k = (*key).kind;
	switch (k) {
	case ((NU8) 1):
	case ((NU8) 2):
	case ((NU8) 31) ... ((NU8) 44):
	{
		result = key;
	}
	break;
	case ((NU8) 3):
	case ((NU8) 5):
	case ((NU8) 6):
	case ((NU8) 7):
	case ((NU8) 26):
	case ((NU8) 28):
	case ((NU8) 29):
	case ((NU8) 0):
	case ((NU8) 45):
	{
		result = gcanonicaltypes_506279[(k)- 0];
		{
			if (!(result == NIM_NIL)) goto LA9;
			asgnRefNoCycle((void**) (&gcanonicaltypes_506279[(k)- 0]), key);
			result = key;
		}
		LA9: ;
	}
	break;
	case ((NU8) 8):
	case ((NU8) 51):
	case ((NU8) 12):
	case ((NU8) 60):
	case ((NU8) 61):
	case ((NU8) 54):
	case ((NU8) 52):
	case ((NU8) 53):
	case ((NU8) 55):
	case ((NU8) 56):
	case ((NU8) 57):
	case ((NU8) 58):
	{
		{
			if (!!(((*key).sym == NIM_NIL))) goto LA14;
			internalerror_195172((*(*key).sym).info, ((NimStringDesc*) &TMP3751));
		}
		goto LA12;
		LA14: ;
		{
			internalerror_195191(((NimStringDesc*) &TMP3751));
		}
		LA12: ;
	}
	break;
	case ((NU8) 13):
	{
		{
			if (!!(((*key).deepcopy == NIM_NIL))) goto LA20;
			result = key;
		}
		goto LA18;
		LA20: ;
		{
			Ttype224847* LOC23;
			LOC23 = 0;
			LOC23 = lastson_227426(key);
			result = getuniquetype_506656(LOC23);
		}
		LA18: ;
	}
	break;
	case ((NU8) 11):
	case ((NU8) 15):
	case ((NU8) 47):
	case ((NU8) 46):
	case ((NU8) 49):
	case ((NU8) 59):
	{
		Ttype224847* LOC25;
		LOC25 = 0;
		LOC25 = lastson_227426(key);
		result = getuniquetype_506656(LOC25);
	}
	break;
	case ((NU8) 21):
	case ((NU8) 22):
	case ((NU8) 23):
	{
		Ttype224847* elemtype;
		elemtype = lastson_227426(key);
		{
			if (!((*elemtype).kind == ((NU8) 1) || (*elemtype).kind == ((NU8) 2) || (*elemtype).kind >= ((NU8) 31) && (*elemtype).kind <= ((NU8) 44))) goto LA29;
			result = key;
		}
		goto LA27;
		LA29: ;
		{
			result = slowsearch_506601(key, k);
		}
		LA27: ;
	}
	break;
	case ((NU8) 4):
	case ((NU8) 9):
	case ((NU8) 10):
	case ((NU8) 27):
	case ((NU8) 16):
	case ((NU8) 19):
	case ((NU8) 20):
	case ((NU8) 18):
	case ((NU8) 24):
	case ((NU8) 30):
	case ((NU8) 48):
	case ((NU8) 50):
	{
		result = slowsearch_506601(key, k);
	}
	break;
	case ((NU8) 17):
	{
		{
			Tidobj197015* LOC38;
			TNimObject* LOC39;
			if (!!((((*key).flags &(1<<((((NU8) 8))&31)))!=0))) goto LA36;
			LOC38 = 0;
			LOC38 = &key->Sup;
			LOC39 = 0;
			LOC39 = idtableget_232182(gtypetable_506275[(k)- 0], LOC38);
			result = ((Ttype224847*) (LOC39));
			{
				Tidobj197015* LOC44;
				TNimObject* LOC45;
				if (!(result == NIM_NIL)) goto LA42;
				LOC44 = 0;
				LOC44 = &key->Sup;
				LOC45 = 0;
				LOC45 = &key->Sup.Sup;
				idtableput_232196((&gtypetable_506275[(k)- 0]), LOC44, LOC45);
				result = key;
			}
			LA42: ;
		}
		goto LA34;
		LA36: ;
		{
			Tidobj197015* LOC62;
			TNimObject* LOC63;
			{
				Tidobj197015* LOC49;
				NIM_BOOL LOC50;
				LOC49 = 0;
				LOC49 = &key->Sup;
				LOC50 = 0;
				LOC50 = idtablehasobjectaskey_232205(gtypetable_506275[(k)- 0], LOC49);
				if (!LOC50) goto LA51;
				result = key;
				goto BeforeRet;
			}
			LA51: ;
			{
				NI h_506757;
				NI HEX3Atmp_506795;
				NI res_506798;
				h_506757 = 0;
				HEX3Atmp_506795 = 0;
				HEX3Atmp_506795 = (gtypetable_506275[(k)- 0].data ? (gtypetable_506275[(k)- 0].data->Sup.len-1) : -1);
				res_506798 = ((NI) 0);
				{
					while (1) {
						Ttype224847* t;
						if (!(res_506798 <= HEX3Atmp_506795)) goto LA55;
						h_506757 = res_506798;
						t = ((Ttype224847*) (gtypetable_506275[(k)- 0].data->data[h_506757].key));
						{
							NIM_BOOL LOC58;
							LOC58 = 0;
							LOC58 = !((t == NIM_NIL));
							if (!(LOC58)) goto LA59;
							LOC58 = samebackendtype_261024(t, key);
							LA59: ;
							if (!LOC58) goto LA60;
							result = t;
							goto BeforeRet;
						}
						LA60: ;
						res_506798 += ((NI) 1);
					} LA55: ;
				}
			}
			LOC62 = 0;
			LOC62 = &key->Sup;
			LOC63 = 0;
			LOC63 = &key->Sup.Sup;
			idtableput_232196((&gtypetable_506275[(k)- 0]), LOC62, LOC63);
			result = key;
		}
		LA34: ;
	}
	break;
	case ((NU8) 14):
	{
		Tidobj197015* LOC65;
		TNimObject* LOC66;
		LOC65 = 0;
		LOC65 = &key->Sup;
		LOC66 = 0;
		LOC66 = idtableget_232182(gtypetable_506275[(k)- 0], LOC65);
		result = ((Ttype224847*) (LOC66));
		{
			Tidobj197015* LOC71;
			TNimObject* LOC72;
			if (!(result == NIM_NIL)) goto LA69;
			LOC71 = 0;
			LOC71 = &key->Sup;
			LOC72 = 0;
			LOC72 = &key->Sup.Sup;
			idtableput_232196((&gtypetable_506275[(k)- 0]), LOC71, LOC72);
			result = key;
		}
		LA69: ;
	}
	break;
	case ((NU8) 25):
	{
		{
			if (!!(((*key).callconv == ((NU8) 8)))) goto LA76;
			result = key;
		}
		goto LA74;
		LA76: ;
		{
			result = slowsearch_506601(key, k);
		}
		LA74: ;
	}
	break;
	}
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NimStringDesc*, makesinglelinecstring_506883)(NimStringDesc* s) {
	NimStringDesc* result;
	result = 0;
	result = copyString(((NimStringDesc*) &TMP3841));
	{
		NIM_CHAR c_506888;
		NI i_506892;
		NI L_506894;
		c_506888 = 0;
		i_506892 = ((NI) 0);
		L_506894 = (s ? s->Sup.len : 0);
		{
			while (1) {
				NimStringDesc* LOC4;
				if (!(i_506892 < L_506894)) goto LA3;
				c_506888 = s->data[i_506892];
				LOC4 = 0;
				LOC4 = tocchar_189639(c_506888);
				result = resizeString(result, LOC4->Sup.len + 0);
appendString(result, LOC4);
				i_506892 += ((NI) 1);
			} LA3: ;
		}
	}
	result = addChar(result, 34);
	return result;
}

static N_INLINE(NI, len_225098)(Tnode224809* n) {
	NI result;
	result = 0;
	{
		if (!(*n).kindU.S6.sons == 0) goto LA3;
		result = ((NI) 0);
	}
	goto LA1;
	LA3: ;
	{
		result = ((*n).kindU.S6.sons ? (*n).kindU.S6.sons->Sup.len : 0);
	}
	LA1: ;
	return result;
}

static N_INLINE(Tnode224809*, HEX5BHEX5D_225244)(Tnode224809* n, NI i) {
	Tnode224809* result;
	result = 0;
	result = (*n).kindU.S6.sons->data[i];
	return result;
}

N_NIMCALL(Tnode224809*, getpragmastmt_506017)(Tnode224809* n, NU16 w) {
	Tnode224809* result;
{	result = 0;
	switch ((*n).kind) {
	case ((NU8) 115):
	{
		{
			NI i_506041;
			NI HEX3Atmp_506084;
			NI LOC3;
			NI res_506087;
			i_506041 = 0;
			HEX3Atmp_506084 = 0;
			LOC3 = 0;
			LOC3 = len_225098(n);
			HEX3Atmp_506084 = (LOC3 - 1);
			res_506087 = ((NI) 0);
			{
				while (1) {
					Tnode224809* LOC6;
					if (!(res_506087 <= HEX3Atmp_506084)) goto LA5;
					i_506041 = res_506087;
					LOC6 = 0;
					LOC6 = HEX5BHEX5D_225244(n, i_506041);
					result = getpragmastmt_506017(LOC6, w);
					{
						if (!!((result == NIM_NIL))) goto LA9;
						goto LA2;
					}
					LA9: ;
					res_506087 += ((NI) 1);
				} LA5: ;
			}
		} LA2: ;
	}
	break;
	case ((NU8) 90):
	{
		{
			NI i_506073;
			NI HEX3Atmp_506092;
			NI LOC13;
			NI res_506095;
			i_506073 = 0;
			HEX3Atmp_506092 = 0;
			LOC13 = 0;
			LOC13 = len_225098(n);
			HEX3Atmp_506092 = (LOC13 - 1);
			res_506095 = ((NI) 0);
			{
				while (1) {
					if (!(res_506095 <= HEX3Atmp_506092)) goto LA15;
					i_506073 = res_506095;
					{
						Tnode224809* LOC18;
						NU16 LOC19;
						LOC18 = 0;
						LOC18 = HEX5BHEX5D_225244(n, i_506073);
						LOC19 = 0;
						LOC19 = whichpragma_253687(LOC18);
						if (!(LOC19 == w)) goto LA20;
						result = HEX5BHEX5D_225244(n, i_506073);
						goto BeforeRet;
					}
					LA20: ;
					res_506095 += ((NI) 1);
				} LA15: ;
			}
		}
	}
	break;
	default:
	{
	}
	break;
	}
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, stmtscontainpragma_506123)(Tnode224809* n, NU16 w) {
	NIM_BOOL result;
	Tnode224809* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = getpragmastmt_506017(n, w);
	result = !((LOC1 == NIM_NIL));
	return result;
}

N_NIMCALL(NI64, hashstring_506146)(NimStringDesc* s) {
	NI64 result;
	result = 0;
	{
		NI64 b;
		if (!(Cpu_173500[(targetcpu_173628)- 1].Field4 == ((NI) 64))) goto LA3;
		b = IL64(0);
		{
			NI i_506163;
			NI HEX3Atmp_506232;
			NI res_506235;
			i_506163 = 0;
			HEX3Atmp_506232 = 0;
			HEX3Atmp_506232 = (NI)((s ? s->Sup.len : 0) - ((NI) 1));
			res_506235 = ((NI) 0);
			{
				while (1) {
					if (!(res_506235 <= HEX3Atmp_506232)) goto LA7;
					i_506163 = res_506235;
					b = (NI64)((NU64)(b) + (NU64)(((NI64) (((NU8)(s->data[i_506163]))))));
					b = (NI64)((NU64)(b) + (NU64)((NI64)((NU64)(b) << (NU64)(IL64(10)))));
					b = (NI64)(b ^ (NI64)((NU64)(b) >> (NU64)(IL64(6))));
					res_506235 += ((NI) 1);
				} LA7: ;
			}
		}
		b = (NI64)((NU64)(b) + (NU64)((NI64)((NU64)(b) << (NU64)(IL64(3)))));
		b = (NI64)(b ^ (NI64)((NU64)(b) >> (NU64)(IL64(11))));
		b = (NI64)((NU64)(b) + (NU64)((NI64)((NU64)(b) << (NU64)(IL64(15)))));
		result = b;
	}
	goto LA1;
	LA3: ;
	{
		NI32 a;
		a = ((NI32) 0);
		{
			NI i_506185;
			NI HEX3Atmp_506241;
			NI res_506244;
			i_506185 = 0;
			HEX3Atmp_506241 = 0;
			HEX3Atmp_506241 = (NI)((s ? s->Sup.len : 0) - ((NI) 1));
			res_506244 = ((NI) 0);
			{
				while (1) {
					if (!(res_506244 <= HEX3Atmp_506241)) goto LA11;
					i_506185 = res_506244;
					a = (NI32)((NU32)(a) + (NU32)(((NI32) (((NU8)(s->data[i_506185]))))));
					a = (NI32)((NU32)(a) + (NU32)((NI32)((NU32)(a) << (NU32)(((NI32) 10)))));
					a = (NI32)(a ^ (NI32)((NU32)(a) >> (NU32)(((NI32) 6))));
					res_506244 += ((NI) 1);
				} LA11: ;
			}
		}
		a = (NI32)((NU32)(a) + (NU32)((NI32)((NU32)(a) << (NU32)(((NI32) 3)))));
		a = (NI32)(a ^ (NI32)((NU32)(a) >> (NU32)(((NI32) 11))));
		a = (NI32)((NU32)(a) + (NU32)((NI32)((NU32)(a) << (NU32)(((NI32) 15)))));
		result = ((NI64) (a));
	}
	LA1: ;
	return result;
}

N_NIMCALL(void, resetcaches_506448)(void) {
	inittypetables_506285();
	{
		NU8 i_506460;
		NI res_506464;
		i_506460 = 0;
		res_506464 = ((NI) 0);
		{
			while (1) {
				if (!(res_506464 <= ((NI) 61))) goto LA3;
				i_506460 = ((NU8) (res_506464));
				asgnRefNoCycle((void**) (&gcanonicaltypes_506279[(i_506460)- 0]), NIM_NIL);
				res_506464 += ((NI) 1);
			} LA3: ;
		}
	}
}
NIM_EXTERNC N_NOINLINE(void, compiler_ccgutilsInit000)(void) {
	inittypetables_506285();
}

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

