/* 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 Tidtable223859 Tidtable223859;
typedef struct Tidpairseq223857 Tidpairseq223857;
typedef struct Ttype223847 Ttype223847;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tidobj196015 Tidobj196015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttypeseq223843 Ttypeseq223843;
typedef struct Tnode223809 Tnode223809;
typedef struct Tsym223841 Tsym223841;
typedef struct Tloc223823 Tloc223823;
typedef struct Ropeobj174009 Ropeobj174009;
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 Tlineinfo188352 Tlineinfo188352;
typedef struct Tscope223835 Tscope223835;
typedef struct TY223944 TY223944;
typedef struct Tstrtable223813 Tstrtable223813;
typedef struct Tsymseq223811 Tsymseq223811;
typedef struct Tident196021 Tident196021;
typedef struct Tlib223827 Tlib223827;
typedef struct Tidpair223855 Tidpair223855;
typedef struct Tnodeseq223803 Tnodeseq223803;
typedef struct Tinfocpu172483 Tinfocpu172483;
typedef struct Basechunk30840 Basechunk30840;
typedef struct Freecell30832 Freecell30832;
typedef struct Tinstantiation223831 Tinstantiation223831;
typedef struct Tlistentry139022 Tlistentry139022;
typedef struct TY223932 TY223932;
struct  Tidtable223859  {
NI counter;
Tidpairseq223857* data;
};
typedef Tidtable223859 TY505274[62];
typedef Ttype223847* TY272026[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  Tidobj196015  {
  TNimObject Sup;
NI id;
};
struct  Tloc223823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype223847* t;
Ropeobj174009* r;
Ropeobj174009* heaproot;
};
struct  Ttype223847  {
  Tidobj196015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq223843* sons;
Tnode223809* n;
Tsym223841* owner;
Tsym223841* sym;
Tsym223841* destructor;
Tsym223841* deepcopy;
Tsym223841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc223823 loc;
};
struct  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  Tlineinfo188352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tstrtable223813  {
NI counter;
Tsymseq223811* data;
};
struct  Tsym223841  {
  Tidobj196015 Sup;
NU8 kind;
union{
struct {Ttypeseq223843* typeinstcache;
Tscope223835* typscope;
} S1;
struct {TY223944* procinstcache;
Tsym223841* gcunsafetyreason;
} S2;
struct {TY223944* usedgenerics;
Tstrtable223813 tab;
} S3;
struct {Tsym223841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype223847* typ;
Tident196021* name;
Tlineinfo188352 info;
Tsym223841* owner;
NU32 flags;
Tnode223809* ast;
NU32 options;
NI position;
NI offset;
Tloc223823 loc;
Tlib223827* annex;
Tnode223809* constraint;
};
struct  Tidpair223855  {
Tidobj196015* key;
TNimObject* val;
};
struct  Tnode223809  {
Ttype223847* typ;
Tlineinfo188352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym223841* sym;
} S4;
struct {Tident196021* ident;
} S5;
struct {Tnodeseq223803* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct Tinfocpu172483 {
NimStringDesc* Field0;
NI Field1;
NU8 Field2;
NI Field3;
NI Field4;
};
typedef Tinfocpu172483 TY172514[18];
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Ropeobj174009  {
  TNimObject Sup;
Ropeobj174009* left;
Ropeobj174009* 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  Tscope223835  {
NI depthlevel;
Tstrtable223813 symbols;
Tnodeseq223803* usingsyms;
Tscope223835* parent;
};
struct  Tident196021  {
  Tidobj196015 Sup;
NimStringDesc* s;
Tident196021* next;
NI h;
};
struct  Tlistentry139022  {
  TNimObject Sup;
Tlistentry139022* prev;
Tlistentry139022* next;
};
struct  Tlib223827  {
  Tlistentry139022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj174009* name;
Tnode223809* path;
};
struct  Freecell30832  {
Freecell30832* next;
NI zerofield;
};
struct  Tinstantiation223831  {
Tsym223841* sym;
Ttypeseq223843* concretetypes;
TY223932* usedby;
NI compilesid;
};
struct Tidpairseq223857 {
  TGenericSeq Sup;
  Tidpair223855 data[SEQ_DECL_SIZE];
};
struct Ttypeseq223843 {
  TGenericSeq Sup;
  Ttype223847* data[SEQ_DECL_SIZE];
};
struct TY223944 {
  TGenericSeq Sup;
  Tinstantiation223831* data[SEQ_DECL_SIZE];
};
struct Tsymseq223811 {
  TGenericSeq Sup;
  Tsym223841* data[SEQ_DECL_SIZE];
};
struct Tnodeseq223803 {
  TGenericSeq Sup;
  Tnode223809* data[SEQ_DECL_SIZE];
};
struct TY223932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, inittypetables_505285)(void);
N_NIMCALL(void, initidtable_227057)(Tidtable223859* 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_194172)(Tlineinfo188352 info, NimStringDesc* errmsg);
N_NIMCALL(void, internalerror_194191)(NimStringDesc* errmsg);
N_NIMCALL(Ttype223847*, getuniquetype_505656)(Ttype223847* key);
N_NIMCALL(Ttype223847*, lastson_226426)(Ttype223847* n);
N_NIMCALL(Ttype223847*, slowsearch_505601)(Ttype223847* key, NU8 k);
N_NIMCALL(NIM_BOOL, idtablehasobjectaskey_231205)(Tidtable223859 t, Tidobj196015* key);
N_NIMCALL(NIM_BOOL, samebackendtype_260024)(Ttype223847* x, Ttype223847* y);
N_NIMCALL(void, idtableput_231196)(Tidtable223859* t, Tidobj196015* key, TNimObject* val);
N_NIMCALL(TNimObject*, idtableget_231182)(Tidtable223859 t, Tidobj196015* key);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(NimStringDesc*, tocchar_188639)(NIM_CHAR c);
N_NIMCALL(Tnode223809*, getpragmastmt_505017)(Tnode223809* n, NU16 w);
static N_INLINE(NI, len_224098)(Tnode223809* n);
static N_INLINE(Tnode223809*, HEX5BHEX5D_224244)(Tnode223809* n, NI i);
N_NIMCALL(NU16, whichpragma_252687)(Tnode223809* n);
STRING_LITERAL(TMP3743, "N", 1);
STRING_LITERAL(TMP3744, "HEX", 3);
STRING_LITERAL(TMP3752, "metatype not eliminated", 23);
STRING_LITERAL(TMP3842, "\"", 1);
extern NIM_CONST TY172514 Cpu_172500;
TY505274 gtypetable_505275;
TY272026 gcanonicaltypes_505279;
extern Gcheap51018 gch_51059;
extern NU8 targetcpu_172628;

N_NIMCALL(void, inittypetables_505285)(void) {
	{
		NU8 i_505423;
		NI res_505430;
		i_505423 = 0;
		res_505430 = ((NI) 0);
		{
			while (1) {
				if (!(res_505430 <= ((NI) 61))) goto LA3;
				i_505423 = ((NU8) (res_505430));
				initidtable_227057((&gtypetable_505275[(i_505423)- 0]));
				res_505430 += ((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_505910)(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*) &TMP3743));
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*) &TMP3744));
appendString(LOC5, LOC6);
		result = LOC5;
	}
	break;
	}
	{
		NI i_505932;
		NI HEX3Atmp_505943;
		NI res_505946;
		i_505932 = 0;
		HEX3Atmp_505943 = 0;
		HEX3Atmp_505943 = (NI)((name ? name->Sup.len : 0) - ((NI) 1));
		res_505946 = ((NI) 1);
		{
			while (1) {
				NIM_CHAR c;
				if (!(res_505946 <= HEX3Atmp_505943)) goto LA9;
				i_505932 = res_505946;
				c = name->data[i_505932];
				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*) &TMP3744));
appendString(LOC15, LOC16);
					result = resizeString(result, LOC15->Sup.len + 0);
appendString(result, LOC15);
				}
				break;
				}
				res_505946 += ((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(Ttype223847*, slowsearch_505601)(Ttype223847* key, NU8 k) {
	Ttype223847* result;
	Tidobj196015* LOC16;
	TNimObject* LOC17;
{	result = 0;
	{
		Tidobj196015* LOC3;
		NIM_BOOL LOC4;
		LOC3 = 0;
		LOC3 = &key->Sup;
		LOC4 = 0;
		LOC4 = idtablehasobjectaskey_231205(gtypetable_505275[(k)- 0], LOC3);
		if (!LOC4) goto LA5;
		result = key;
		goto BeforeRet;
	}
	LA5: ;
	{
		NI h_505618;
		NI HEX3Atmp_505634;
		NI res_505637;
		h_505618 = 0;
		HEX3Atmp_505634 = 0;
		HEX3Atmp_505634 = (gtypetable_505275[(k)- 0].data ? (gtypetable_505275[(k)- 0].data->Sup.len-1) : -1);
		res_505637 = ((NI) 0);
		{
			while (1) {
				Ttype223847* t;
				if (!(res_505637 <= HEX3Atmp_505634)) goto LA9;
				h_505618 = res_505637;
				t = ((Ttype223847*) (gtypetable_505275[(k)- 0].data->data[h_505618].key));
				{
					NIM_BOOL LOC12;
					LOC12 = 0;
					LOC12 = !((t == NIM_NIL));
					if (!(LOC12)) goto LA13;
					LOC12 = samebackendtype_260024(t, key);
					LA13: ;
					if (!LOC12) goto LA14;
					result = t;
					goto BeforeRet;
				}
				LA14: ;
				res_505637 += ((NI) 1);
			} LA9: ;
		}
	}
	LOC16 = 0;
	LOC16 = &key->Sup;
	LOC17 = 0;
	LOC17 = &key->Sup.Sup;
	idtableput_231196((&gtypetable_505275[(k)- 0]), LOC16, LOC17);
	result = key;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Ttype223847*, getuniquetype_505656)(Ttype223847* key) {
	Ttype223847* 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_505279[(k)- 0];
		{
			if (!(result == NIM_NIL)) goto LA9;
			asgnRefNoCycle((void**) (&gcanonicaltypes_505279[(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_194172((*(*key).sym).info, ((NimStringDesc*) &TMP3752));
		}
		goto LA12;
		LA14: ;
		{
			internalerror_194191(((NimStringDesc*) &TMP3752));
		}
		LA12: ;
	}
	break;
	case ((NU8) 13):
	{
		{
			if (!!(((*key).deepcopy == NIM_NIL))) goto LA20;
			result = key;
		}
		goto LA18;
		LA20: ;
		{
			Ttype223847* LOC23;
			LOC23 = 0;
			LOC23 = lastson_226426(key);
			result = getuniquetype_505656(LOC23);
		}
		LA18: ;
	}
	break;
	case ((NU8) 11):
	case ((NU8) 15):
	case ((NU8) 47):
	case ((NU8) 46):
	case ((NU8) 49):
	case ((NU8) 59):
	{
		Ttype223847* LOC25;
		LOC25 = 0;
		LOC25 = lastson_226426(key);
		result = getuniquetype_505656(LOC25);
	}
	break;
	case ((NU8) 21):
	case ((NU8) 22):
	case ((NU8) 23):
	{
		Ttype223847* elemtype;
		elemtype = lastson_226426(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_505601(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_505601(key, k);
	}
	break;
	case ((NU8) 17):
	{
		{
			Tidobj196015* LOC38;
			TNimObject* LOC39;
			if (!!((((*key).flags &(1<<((((NU8) 8))&31)))!=0))) goto LA36;
			LOC38 = 0;
			LOC38 = &key->Sup;
			LOC39 = 0;
			LOC39 = idtableget_231182(gtypetable_505275[(k)- 0], LOC38);
			result = ((Ttype223847*) (LOC39));
			{
				Tidobj196015* LOC44;
				TNimObject* LOC45;
				if (!(result == NIM_NIL)) goto LA42;
				LOC44 = 0;
				LOC44 = &key->Sup;
				LOC45 = 0;
				LOC45 = &key->Sup.Sup;
				idtableput_231196((&gtypetable_505275[(k)- 0]), LOC44, LOC45);
				result = key;
			}
			LA42: ;
		}
		goto LA34;
		LA36: ;
		{
			Tidobj196015* LOC62;
			TNimObject* LOC63;
			{
				Tidobj196015* LOC49;
				NIM_BOOL LOC50;
				LOC49 = 0;
				LOC49 = &key->Sup;
				LOC50 = 0;
				LOC50 = idtablehasobjectaskey_231205(gtypetable_505275[(k)- 0], LOC49);
				if (!LOC50) goto LA51;
				result = key;
				goto BeforeRet;
			}
			LA51: ;
			{
				NI h_505757;
				NI HEX3Atmp_505795;
				NI res_505798;
				h_505757 = 0;
				HEX3Atmp_505795 = 0;
				HEX3Atmp_505795 = (gtypetable_505275[(k)- 0].data ? (gtypetable_505275[(k)- 0].data->Sup.len-1) : -1);
				res_505798 = ((NI) 0);
				{
					while (1) {
						Ttype223847* t;
						if (!(res_505798 <= HEX3Atmp_505795)) goto LA55;
						h_505757 = res_505798;
						t = ((Ttype223847*) (gtypetable_505275[(k)- 0].data->data[h_505757].key));
						{
							NIM_BOOL LOC58;
							LOC58 = 0;
							LOC58 = !((t == NIM_NIL));
							if (!(LOC58)) goto LA59;
							LOC58 = samebackendtype_260024(t, key);
							LA59: ;
							if (!LOC58) goto LA60;
							result = t;
							goto BeforeRet;
						}
						LA60: ;
						res_505798 += ((NI) 1);
					} LA55: ;
				}
			}
			LOC62 = 0;
			LOC62 = &key->Sup;
			LOC63 = 0;
			LOC63 = &key->Sup.Sup;
			idtableput_231196((&gtypetable_505275[(k)- 0]), LOC62, LOC63);
			result = key;
		}
		LA34: ;
	}
	break;
	case ((NU8) 14):
	{
		Tidobj196015* LOC65;
		TNimObject* LOC66;
		LOC65 = 0;
		LOC65 = &key->Sup;
		LOC66 = 0;
		LOC66 = idtableget_231182(gtypetable_505275[(k)- 0], LOC65);
		result = ((Ttype223847*) (LOC66));
		{
			Tidobj196015* LOC71;
			TNimObject* LOC72;
			if (!(result == NIM_NIL)) goto LA69;
			LOC71 = 0;
			LOC71 = &key->Sup;
			LOC72 = 0;
			LOC72 = &key->Sup.Sup;
			idtableput_231196((&gtypetable_505275[(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_505601(key, k);
		}
		LA74: ;
	}
	break;
	}
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NimStringDesc*, makesinglelinecstring_505883)(NimStringDesc* s) {
	NimStringDesc* result;
	result = 0;
	result = copyString(((NimStringDesc*) &TMP3842));
	{
		NIM_CHAR c_505888;
		NI i_505892;
		NI L_505894;
		c_505888 = 0;
		i_505892 = ((NI) 0);
		L_505894 = (s ? s->Sup.len : 0);
		{
			while (1) {
				NimStringDesc* LOC4;
				if (!(i_505892 < L_505894)) goto LA3;
				c_505888 = s->data[i_505892];
				LOC4 = 0;
				LOC4 = tocchar_188639(c_505888);
				result = resizeString(result, LOC4->Sup.len + 0);
appendString(result, LOC4);
				i_505892 += ((NI) 1);
			} LA3: ;
		}
	}
	result = addChar(result, 34);
	return result;
}

static N_INLINE(NI, len_224098)(Tnode223809* 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(Tnode223809*, HEX5BHEX5D_224244)(Tnode223809* n, NI i) {
	Tnode223809* result;
	result = 0;
	result = (*n).kindU.S6.sons->data[i];
	return result;
}

N_NIMCALL(Tnode223809*, getpragmastmt_505017)(Tnode223809* n, NU16 w) {
	Tnode223809* result;
{	result = 0;
	switch ((*n).kind) {
	case ((NU8) 115):
	{
		{
			NI i_505041;
			NI HEX3Atmp_505084;
			NI LOC3;
			NI res_505087;
			i_505041 = 0;
			HEX3Atmp_505084 = 0;
			LOC3 = 0;
			LOC3 = len_224098(n);
			HEX3Atmp_505084 = (LOC3 - 1);
			res_505087 = ((NI) 0);
			{
				while (1) {
					Tnode223809* LOC6;
					if (!(res_505087 <= HEX3Atmp_505084)) goto LA5;
					i_505041 = res_505087;
					LOC6 = 0;
					LOC6 = HEX5BHEX5D_224244(n, i_505041);
					result = getpragmastmt_505017(LOC6, w);
					{
						if (!!((result == NIM_NIL))) goto LA9;
						goto LA2;
					}
					LA9: ;
					res_505087 += ((NI) 1);
				} LA5: ;
			}
		} LA2: ;
	}
	break;
	case ((NU8) 90):
	{
		{
			NI i_505073;
			NI HEX3Atmp_505092;
			NI LOC13;
			NI res_505095;
			i_505073 = 0;
			HEX3Atmp_505092 = 0;
			LOC13 = 0;
			LOC13 = len_224098(n);
			HEX3Atmp_505092 = (LOC13 - 1);
			res_505095 = ((NI) 0);
			{
				while (1) {
					if (!(res_505095 <= HEX3Atmp_505092)) goto LA15;
					i_505073 = res_505095;
					{
						Tnode223809* LOC18;
						NU16 LOC19;
						LOC18 = 0;
						LOC18 = HEX5BHEX5D_224244(n, i_505073);
						LOC19 = 0;
						LOC19 = whichpragma_252687(LOC18);
						if (!(LOC19 == w)) goto LA20;
						result = HEX5BHEX5D_224244(n, i_505073);
						goto BeforeRet;
					}
					LA20: ;
					res_505095 += ((NI) 1);
				} LA15: ;
			}
		}
	}
	break;
	default:
	{
	}
	break;
	}
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, stmtscontainpragma_505123)(Tnode223809* n, NU16 w) {
	NIM_BOOL result;
	Tnode223809* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = getpragmastmt_505017(n, w);
	result = !((LOC1 == NIM_NIL));
	return result;
}

N_NIMCALL(NI64, hashstring_505146)(NimStringDesc* s) {
	NI64 result;
	result = 0;
	{
		NI64 b;
		if (!(Cpu_172500[(targetcpu_172628)- 1].Field4 == ((NI) 64))) goto LA3;
		b = IL64(0);
		{
			NI i_505163;
			NI HEX3Atmp_505232;
			NI res_505235;
			i_505163 = 0;
			HEX3Atmp_505232 = 0;
			HEX3Atmp_505232 = (NI)((s ? s->Sup.len : 0) - ((NI) 1));
			res_505235 = ((NI) 0);
			{
				while (1) {
					if (!(res_505235 <= HEX3Atmp_505232)) goto LA7;
					i_505163 = res_505235;
					b = (NI64)((NU64)(b) + (NU64)(((NI64) (((NU8)(s->data[i_505163]))))));
					b = (NI64)((NU64)(b) + (NU64)((NI64)((NU64)(b) << (NU64)(IL64(10)))));
					b = (NI64)(b ^ (NI64)((NU64)(b) >> (NU64)(IL64(6))));
					res_505235 += ((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_505185;
			NI HEX3Atmp_505241;
			NI res_505244;
			i_505185 = 0;
			HEX3Atmp_505241 = 0;
			HEX3Atmp_505241 = (NI)((s ? s->Sup.len : 0) - ((NI) 1));
			res_505244 = ((NI) 0);
			{
				while (1) {
					if (!(res_505244 <= HEX3Atmp_505241)) goto LA11;
					i_505185 = res_505244;
					a = (NI32)((NU32)(a) + (NU32)(((NI32) (((NU8)(s->data[i_505185]))))));
					a = (NI32)((NU32)(a) + (NU32)((NI32)((NU32)(a) << (NU32)(((NI32) 10)))));
					a = (NI32)(a ^ (NI32)((NU32)(a) >> (NU32)(((NI32) 6))));
					res_505244 += ((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_505448)(void) {
	inittypetables_505285();
	{
		NU8 i_505460;
		NI res_505464;
		i_505460 = 0;
		res_505464 = ((NI) 0);
		{
			while (1) {
				if (!(res_505464 <= ((NI) 61))) goto LA3;
				i_505460 = ((NU8) (res_505464));
				asgnRefNoCycle((void**) (&gcanonicaltypes_505279[(i_505460)- 0]), NIM_NIL);
				res_505464 += ((NI) 1);
			} LA3: ;
		}
	}
}
NIM_EXTERNC N_NOINLINE(void, compiler_ccgutilsInit000)(void) {
	inittypetables_505285();
}

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

