/* Generated by Nim Compiler v0.10.2 */
/*   (c) 2014 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_INTBITS 32
#include "nimbase.h"

#include <string.h>
typedef struct tsym224846 tsym224846;
typedef struct ttype224852 ttype224852;
typedef struct tstrtable224820 tstrtable224820;
typedef struct tsymseq224818 tsymseq224818;
typedef struct TGenericSeq TGenericSeq;
typedef struct NimStringDesc NimStringDesc;
typedef struct tident199021 tident199021;
typedef struct tidobj199015 tidobj199015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct ttypeseq224848 ttypeseq224848;
typedef struct tscope224840 tscope224840;
typedef struct TY224947 TY224947;
typedef struct tinstantiation224836 tinstantiation224836;
typedef struct tlineinfo194539 tlineinfo194539;
typedef struct tnode224816 tnode224816;
typedef struct tloc224830 tloc224830;
typedef struct trope176009 trope176009;
typedef struct tlib224834 tlib224834;
typedef struct tcell44935 tcell44935;
typedef struct tcellseq44951 tcellseq44951;
typedef struct tgcheap47016 tgcheap47016;
typedef struct tcellset44947 tcellset44947;
typedef struct tpagedesc44943 tpagedesc44943;
typedef struct tmemregion27210 tmemregion27210;
typedef struct tsmallchunk26440 tsmallchunk26440;
typedef struct tllchunk27204 tllchunk27204;
typedef struct tbigchunk26442 tbigchunk26442;
typedef struct tintset26417 tintset26417;
typedef struct ttrunk26413 ttrunk26413;
typedef struct tavlnode27208 tavlnode27208;
typedef struct tgcstat47014 tgcstat47014;
typedef struct tidentiter234141 tidentiter234141;
typedef struct tnodeseq224810 tnodeseq224810;
typedef struct TY224936 TY224936;
typedef struct tlistentry126022 tlistentry126022;
typedef struct tbasechunk26438 tbasechunk26438;
typedef struct tfreecell26430 tfreecell26430;
typedef ttype224852* TY281060[62];
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  tstrtable224820  {
NI Counter;
tsymseq224818* Data;
};
typedef ttype224852* TY281352[70];
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef N_NIMCALL_PTR(void, TY3089) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3094) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3089 marker;
TY3094 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  tidobj199015  {
  TNimObject Sup;
NI Id;
};
struct  tlineinfo194539  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
struct  tloc224830  {
NU8 K;
NU8 S;
NU8 Flags;
ttype224852* T;
trope176009* R;
trope176009* Heaproot;
};
struct  tsym224846  {
  tidobj199015 Sup;
NU8 Kind;
union {
struct {ttypeseq224848* Typeinstcache;
tscope224840* Typscope;
} S1;
struct {TY224947* Procinstcache;
tscope224840* Scope;
} S2;
struct {TY224947* Usedgenerics;
tstrtable224820 Tab;
} S3;
struct {tsym224846* Guard;
} S4;
} kindU;
NU16 Magic;
ttype224852* Typ;
tident199021* Name;
tlineinfo194539 Info;
tsym224846* Owner;
NU32 Flags;
tnode224816* Ast;
NU32 Options;
NI Position;
NI Offset;
tloc224830 Loc;
tlib224834* Annex;
tnode224816* Constraint;
};
struct  tcell44935  {
NI Refcount;
TNimType* Typ;
};
struct  tcellseq44951  {
NI Len;
NI Cap;
tcell44935** D;
};
struct  tcellset44947  {
NI Counter;
NI Max;
tpagedesc44943* Head;
tpagedesc44943** Data;
};
typedef tsmallchunk26440* TY27222[512];
typedef ttrunk26413* ttrunkbuckets26415[256];
struct  tintset26417  {
ttrunkbuckets26415 Data;
};
struct  tmemregion27210  {
NI Minlargeobj;
NI Maxlargeobj;
TY27222 Freesmallchunks;
tllchunk27204* Llmem;
NI Currmem;
NI Maxmem;
NI Freemem;
NI Lastsize;
tbigchunk26442* Freechunkslist;
tintset26417 Chunkstarts;
tavlnode27208* Root;
tavlnode27208* Deleted;
tavlnode27208* Last;
tavlnode27208* Freeavlnodes;
};
struct  tgcstat47014  {
NI Stackscans;
NI Cyclecollections;
NI Maxthreshold;
NI Maxstacksize;
NI Maxstackcells;
NI Cycletablesize;
NI64 Maxpause;
};
struct  tgcheap47016  {
void* Stackbottom;
NI Cyclethreshold;
tcellseq44951 Zct;
tcellseq44951 Decstack;
tcellset44947 Cycleroots;
tcellseq44951 Tempstack;
NI Recgclock;
tmemregion27210 Region;
tgcstat47014 Stat;
};
struct  ttype224852  {
  tidobj199015 Sup;
NU8 Kind;
NU8 Callconv;
NU32 Flags;
ttypeseq224848* Sons;
tnode224816* N;
tsym224846* Owner;
tsym224846* Sym;
tsym224846* Destructor;
tsym224846* Deepcopy;
NI64 Size;
NI16 Align;
NI16 Locklevel;
tloc224830 Loc;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  tidentiter234141  {
NI H;
tident199021* Name;
};
struct  tnode224816  {
ttype224852* Typ;
tlineinfo194539 Info;
NU16 Flags;
NU8 Kind;
union {
struct {NI64 Intval;
} S1;
struct {NF Floatval;
} S2;
struct {NimStringDesc* Strval;
} S3;
struct {tsym224846* Sym;
} S4;
struct {tident199021* Ident;
} S5;
struct {tnodeseq224810* Sons;
} S6;
} kindU;
NimStringDesc* Comment;
};
struct  tident199021  {
  tidobj199015 Sup;
NimStringDesc* S;
tident199021* Next;
NI H;
};
struct  tscope224840  {
NI Depthlevel;
tstrtable224820 Symbols;
tnodeseq224810* Usingsyms;
tscope224840* Parent;
};
struct  tinstantiation224836  {
tsym224846* Sym;
ttypeseq224848* Concretetypes;
TY224936* Usedby;
};
struct  trope176009  {
  TNimObject Sup;
trope176009* Left;
trope176009* Right;
NI Length;
NimStringDesc* Data;
};
struct  tlistentry126022  {
  TNimObject Sup;
tlistentry126022* Prev;
tlistentry126022* Next;
};
struct  tlib224834  {
  tlistentry126022 Sup;
NU8 Kind;
NIM_BOOL Generated;
NIM_BOOL Isoverriden;
trope176009* Name;
tnode224816* Path;
};
typedef NI TY26420[16];
struct  tpagedesc44943  {
tpagedesc44943* Next;
NI Key;
TY26420 Bits;
};
struct  tbasechunk26438  {
NI Prevsize;
NI Size;
NIM_BOOL Used;
};
struct  tsmallchunk26440  {
  tbasechunk26438 Sup;
tsmallchunk26440* Next;
tsmallchunk26440* Prev;
tfreecell26430* Freelist;
NI Free;
NI Acc;
NF Data;
};
struct  tllchunk27204  {
NI Size;
NI Acc;
tllchunk27204* Next;
};
struct  tbigchunk26442  {
  tbasechunk26438 Sup;
tbigchunk26442* Next;
tbigchunk26442* Prev;
NI Align;
NF Data;
};
struct  ttrunk26413  {
ttrunk26413* Next;
NI Key;
TY26420 Bits;
};
typedef tavlnode27208* TY27214[2];
struct  tavlnode27208  {
TY27214 Link;
NI Key;
NI Upperbound;
NI Level;
};
struct  tfreecell26430  {
tfreecell26430* Next;
NI Zerofield;
};
struct tsymseq224818 {
  TGenericSeq Sup;
  tsym224846* data[SEQ_DECL_SIZE];
};
struct ttypeseq224848 {
  TGenericSeq Sup;
  ttype224852* data[SEQ_DECL_SIZE];
};
struct TY224947 {
  TGenericSeq Sup;
  tinstantiation224836* data[SEQ_DECL_SIZE];
};
struct tnodeseq224810 {
  TGenericSeq Sup;
  tnode224816* data[SEQ_DECL_SIZE];
};
struct TY224936 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, initstrtable_225153)(tstrtable224820* x);
N_NIMCALL(ttype224852*, systypefromname_281261)(NimStringDesc* name);
N_NIMCALL(tsym224846*, getsyssym_281054)(NimStringDesc* name);
N_NIMCALL(tsym224846*, strtableget_234111)(tstrtable224820 t, tident199021* name);
N_NIMCALL(tident199021*, getident_199472)(NimStringDesc* identifier);
N_NIMCALL(void, rawmessage_196733)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(tsym224846*, newsym_225074)(NU8 symkind, tident199021* name, tsym224846* owner, tlineinfo194539 info);
N_NIMCALL(ttype224852*, newtype_225083)(NU8 kind, tsym224846* owner);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
static N_INLINE(tcell44935*, usrtocell_48646)(void* usr);
static N_INLINE(void, rtladdzct_50204)(tcell44935* c);
N_NOINLINE(void, addzct_48617)(tcellseq44951* s, tcell44935* c);
N_NIMCALL(void, loadstub_278261)(tsym224846* s);
N_NIMCALL(ttype224852*, newsystype_281105)(NU8 kind, NI size);
N_NIMCALL(void, internalerror_197006)(NimStringDesc* errmsg);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NimStringDesc*, reprEnum)(NI e_80907, TNimType* typ);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
static N_INLINE(ttype224852*, skipintlit_281531)(ttype224852* t);
N_NIMCALL(ttype224852*, getsystype_281030)(NU8 kind);
N_NIMCALL(TGenericSeq*, incrSeq)(TGenericSeq* seq, NI elemsize);
N_NIMCALL(void, propagatetoowner_229318)(ttype224852* owner, ttype224852* elem);
N_NIMCALL(tsym224846*, initidentiter_234147)(tidentiter234141* ti, tstrtable224820 tab, tident199021* s);
N_NIMCALL(tsym224846*, nextidentiter_234156)(tidentiter234141* ti, tstrtable224820 tab);
N_NIMCALL(void, strtableadd_234103)(tstrtable224820* t, tsym224846* n);
N_NIMCALL(ttype224852*, copytype_225195)(ttype224852* t, tsym224846* owner, NIM_BOOL keepid);
N_NIMCALL(tident199021*, getident_199482)(NimStringDesc* identifier, NI h);
N_NIMCALL(NI, hashignorestyle_127885)(NimStringDesc* x);
N_NIMCALL(ttype224852*, getintlittype_281477)(tnode224816* literal);
N_NIMCALL(void, internalerror_196987)(tlineinfo194539 info, NimStringDesc* errmsg);
STRING_LITERAL(TMP2639, "int", 3);
STRING_LITERAL(TMP2640, "int8", 4);
STRING_LITERAL(TMP2641, "int16", 5);
STRING_LITERAL(TMP2642, "int32", 5);
STRING_LITERAL(TMP2643, "int64", 5);
STRING_LITERAL(TMP2644, "uint", 4);
STRING_LITERAL(TMP2645, "uint8", 5);
STRING_LITERAL(TMP2646, "uint16", 6);
STRING_LITERAL(TMP2647, "uint32", 6);
STRING_LITERAL(TMP2648, "uint64", 6);
STRING_LITERAL(TMP2649, "float", 5);
STRING_LITERAL(TMP2650, "float32", 7);
STRING_LITERAL(TMP2651, "float64", 7);
STRING_LITERAL(TMP2652, "float128", 8);
STRING_LITERAL(TMP2653, "bool", 4);
STRING_LITERAL(TMP2654, "char", 4);
STRING_LITERAL(TMP2655, "string", 6);
STRING_LITERAL(TMP2656, "cstring", 7);
STRING_LITERAL(TMP2657, "pointer", 7);
STRING_LITERAL(TMP2658, "request for typekind: ", 22);
STRING_LITERAL(TMP2659, "wanted: ", 8);
STRING_LITERAL(TMP2660, " got: ", 6);
STRING_LITERAL(TMP2661, "type not found: ", 16);
STRING_LITERAL(TMP3253, "invalid int size", 16);
tsym224846* systemmodule_281019;
TY281060 gsystypes_281063;
tstrtable224820 compilerprocs_281064;
TY281352 inttypecache_281354;
extern tgcheap47016 gch_47044;
extern NI ptrsize_173612;
extern TNimType NTI224258; /* TTypeKind */
extern TNimType NTI224848; /* TTypeSeq */
extern tstrtable224820 rodcompilerprocs_275066;
extern NI intsize_173610;

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

static N_INLINE(void, rtladdzct_50204)(tcell44935* c) {
	addzct_48617((&gch_47044.Zct), c);
}

static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) {
	{
		tcell44935* c;
		if (!!((src == NIM_NIL))) goto LA3;
		c = usrtocell_48646(src);
		(*c).Refcount += 8;
	}
	LA3: ;
	{
		tcell44935* c;
		if (!!(((*dest) == NIM_NIL))) goto LA7;
		c = usrtocell_48646((*dest));
		{
			(*c).Refcount -= 8;
			if (!((NU32)((*c).Refcount) < (NU32)(8))) goto LA11;
			rtladdzct_50204(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

N_NIMCALL(tsym224846*, getsyssym_281054)(NimStringDesc* name) {
	tsym224846* result;
	tident199021* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = getident_199472(name);
	result = strtableget_234111((*systemmodule_281019).kindU.S3.Tab, LOC1);
	{
		tident199021* LOC6;
		if (!(result == NIM_NIL)) goto LA4;
		rawmessage_196733(((NU16) 64), name);
		LOC6 = 0;
		LOC6 = getident_199472(name);
		result = newsym_225074(((NU8) 0), LOC6, systemmodule_281019, (*systemmodule_281019).Info);
		asgnRefNoCycle((void**) (&(*result).Typ), newtype_225083(((NU8) 50), systemmodule_281019));
	}
	LA4: ;
	{
		if (!((*result).Kind == ((NU8) 23))) goto LA9;
		loadstub_278261(result);
	}
	LA9: ;
	{
		if (!((*result).Kind == ((NU8) 25))) goto LA13;
		result = (*result).Owner;
	}
	LA13: ;
	return result;
}

N_NIMCALL(ttype224852*, systypefromname_281261)(NimStringDesc* name) {
	ttype224852* result;
	tsym224846* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = getsyssym_281054(name);
	result = (*LOC1).Typ;
	return result;
}

N_NIMCALL(ttype224852*, newsystype_281105)(NU8 kind, NI size) {
	ttype224852* result;
	result = 0;
	result = newtype_225083(kind, systemmodule_281019);
	(*result).Size = ((NI64) (size));
	(*result).Align = ((NI16) (size));
	return result;
}

static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
	memcpy(((NCSTRING) ((&(*dest).data[((*dest).Sup.len)- 0]))), ((NCSTRING) ((*src).data)), (NI32)((*src).Sup.len + 1));
	(*dest).Sup.len += (*src).Sup.len;
}

N_NIMCALL(ttype224852*, getsystype_281030)(NU8 kind) {
	ttype224852* result;
	result = 0;
	result = gsystypes_281063[(kind)- 0];
	{
		if (!(result == NIM_NIL)) goto LA3;
		switch (kind) {
		case ((NU8) 31):
		{
			result = systypefromname_281261(((NimStringDesc*) &TMP2639));
		}
		break;
		case ((NU8) 32):
		{
			result = systypefromname_281261(((NimStringDesc*) &TMP2640));
		}
		break;
		case ((NU8) 33):
		{
			result = systypefromname_281261(((NimStringDesc*) &TMP2641));
		}
		break;
		case ((NU8) 34):
		{
			result = systypefromname_281261(((NimStringDesc*) &TMP2642));
		}
		break;
		case ((NU8) 35):
		{
			result = systypefromname_281261(((NimStringDesc*) &TMP2643));
		}
		break;
		case ((NU8) 40):
		{
			result = systypefromname_281261(((NimStringDesc*) &TMP2644));
		}
		break;
		case ((NU8) 41):
		{
			result = systypefromname_281261(((NimStringDesc*) &TMP2645));
		}
		break;
		case ((NU8) 42):
		{
			result = systypefromname_281261(((NimStringDesc*) &TMP2646));
		}
		break;
		case ((NU8) 43):
		{
			result = systypefromname_281261(((NimStringDesc*) &TMP2647));
		}
		break;
		case ((NU8) 44):
		{
			result = systypefromname_281261(((NimStringDesc*) &TMP2648));
		}
		break;
		case ((NU8) 36):
		{
			result = systypefromname_281261(((NimStringDesc*) &TMP2649));
		}
		break;
		case ((NU8) 37):
		{
			result = systypefromname_281261(((NimStringDesc*) &TMP2650));
		}
		break;
		case ((NU8) 38):
		{
			result = systypefromname_281261(((NimStringDesc*) &TMP2651));
			goto BeforeRet;
		}
		break;
		case ((NU8) 39):
		{
			result = systypefromname_281261(((NimStringDesc*) &TMP2652));
		}
		break;
		case ((NU8) 1):
		{
			result = systypefromname_281261(((NimStringDesc*) &TMP2653));
		}
		break;
		case ((NU8) 2):
		{
			result = systypefromname_281261(((NimStringDesc*) &TMP2654));
		}
		break;
		case ((NU8) 28):
		{
			result = systypefromname_281261(((NimStringDesc*) &TMP2655));
		}
		break;
		case ((NU8) 29):
		{
			result = systypefromname_281261(((NimStringDesc*) &TMP2656));
		}
		break;
		case ((NU8) 26):
		{
			result = systypefromname_281261(((NimStringDesc*) &TMP2657));
		}
		break;
		case ((NU8) 5):
		{
			result = newsystype_281105(((NU8) 5), ptrsize_173612);
		}
		break;
		default:
		{
			NimStringDesc* LOC26;
			LOC26 = 0;
			LOC26 = rawNewString(reprEnum(kind, (&NTI224258))->Sup.len + 22);
appendString(LOC26, ((NimStringDesc*) &TMP2658));
appendString(LOC26, reprEnum(kind, (&NTI224258)));
			internalerror_197006(LOC26);
		}
		break;
		}
		asgnRefNoCycle((void**) (&gsystypes_281063[(kind)- 0]), result);
	}
	LA3: ;
	{
		NimStringDesc* LOC31;
		if (!!(((*result).Kind == kind))) goto LA29;
		LOC31 = 0;
		LOC31 = rawNewString(reprEnum(kind, (&NTI224258))->Sup.len + reprEnum((*result).Kind, (&NTI224258))->Sup.len + 14);
appendString(LOC31, ((NimStringDesc*) &TMP2659));
appendString(LOC31, reprEnum(kind, (&NTI224258)));
appendString(LOC31, ((NimStringDesc*) &TMP2660));
appendString(LOC31, reprEnum((*result).Kind, (&NTI224258)));
		internalerror_197006(LOC31);
	}
	LA29: ;
	{
		NimStringDesc* LOC36;
		if (!(result == NIM_NIL)) goto LA34;
		LOC36 = 0;
		LOC36 = rawNewString(reprEnum(kind, (&NTI224258))->Sup.len + 16);
appendString(LOC36, ((NimStringDesc*) &TMP2661));
appendString(LOC36, reprEnum(kind, (&NTI224258)));
		internalerror_197006(LOC36);
	}
	LA34: ;
	BeforeRet: ;
	return result;
}

static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
	tcell44935* c;
	c = usrtocell_48646(p);
	{
		(*c).Refcount -= 8;
		if (!((NU32)((*c).Refcount) < (NU32)(8))) goto LA3;
		rtladdzct_50204(c);
	}
	LA3: ;
}

static N_INLINE(ttype224852*, skipintlit_281531)(ttype224852* t) {
	ttype224852* result;
	result = 0;
	{
		if (!!(((*t).N == NIM_NIL))) goto LA3;
		{
			if (!((*t).Kind == ((NU8) 31) || (*t).Kind == ((NU8) 36))) goto LA7;
			result = getsystype_281030((*t).Kind);
			goto BeforeRet;
		}
		LA7: ;
	}
	LA3: ;
	result = t;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, addsonskipintlit_281572)(ttype224852* father, ttype224852* son) {
	ttype224852* s;
	{
		if (!(*father).Sons == 0) goto LA3;
		if ((*father).Sons) nimGCunrefNoCycle((*father).Sons);
		(*father).Sons = (ttypeseq224848*) newSeqRC1((&NTI224848), 0);
	}
	LA3: ;
	s = skipintlit_281531(son);
	(*father).Sons = (ttypeseq224848*) incrSeq(&((*father).Sons)->Sup, sizeof(ttype224852*));
	asgnRefNoCycle((void**) (&(*father).Sons->data[(*father).Sons->Sup.len-1]), s);
	propagatetoowner_229318(father, s);
}

N_NIMCALL(tsym224846*, getsysmagic_281175)(NimStringDesc* name, NU16 m) {
	tsym224846* result;
	tidentiter234141 ti;
	tident199021* id;
	result = 0;
	memset((void*)(&ti), 0, sizeof(ti));
	id = getident_199472(name);
	result = initidentiter_234147((&ti), (*systemmodule_281019).kindU.S3.Tab, id);
	{
		while (1) {
			if (!!((result == NIM_NIL))) goto LA2;
			{
				if (!((*result).Kind == ((NU8) 23))) goto LA5;
				loadstub_278261(result);
			}
			LA5: ;
			{
				if (!((*result).Magic == m)) goto LA9;
				goto BeforeRet;
			}
			LA9: ;
			result = nextidentiter_234156((&ti), (*systemmodule_281019).kindU.S3.Tab);
		} LA2: ;
	}
	rawmessage_196733(((NU16) 64), name);
	result = newsym_225074(((NU8) 0), id, systemmodule_281019, (*systemmodule_281019).Info);
	asgnRefNoCycle((void**) (&(*result).Typ), newtype_225083(((NU8) 50), systemmodule_281019));
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, registercompilerproc_281042)(tsym224846* s) {
	strtableadd_234103((&compilerprocs_281064), s);
}

N_NIMCALL(ttype224852*, getintlittype_281477)(tnode224816* literal) {
	ttype224852* result;
	NI64 value;
	result = 0;
	value = (*literal).kindU.S1.Intval;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = (IL64(-5) <= value);
		if (!(LOC3)) goto LA4;
		LOC3 = (value <= IL64(64));
		LA4: ;
		if (!LOC3) goto LA5;
		result = inttypecache_281354[(((NI) (value)))- -5];
		{
			ttype224852* ti;
			if (!(result == NIM_NIL)) goto LA9;
			ti = getsystype_281030(((NU8) 31));
			result = copytype_225195(ti, (*ti).Owner, NIM_FALSE);
			asgnRefNoCycle((void**) (&(*result).N), literal);
			asgnRefNoCycle((void**) (&inttypecache_281354[(((NI) (value)))- -5]), result);
		}
		LA9: ;
	}
	goto LA1;
	LA5: ;
	{
		ttype224852* ti;
		ti = getsystype_281030(((NU8) 31));
		result = copytype_225195(ti, (*ti).Owner, NIM_FALSE);
		asgnRefNoCycle((void**) (&(*result).N), literal);
	}
	LA1: ;
	return result;
}

N_NIMCALL(ttype224852*, getfloatlittype_281521)(tnode224816* literal) {
	ttype224852* result;
	result = 0;
	result = newsystype_281105(((NU8) 36), 8);
	asgnRefNoCycle((void**) (&(*result).N), literal);
	return result;
}

N_NIMCALL(tsym224846*, getcompilerproc_281036)(NimStringDesc* name) {
	tsym224846* result;
	tident199021* ident;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = hashignorestyle_127885(name);
	ident = getident_199482(name, LOC1);
	result = strtableget_234111(compilerprocs_281064, ident);
	{
		if (!(result == NIM_NIL)) goto LA4;
		result = strtableget_234111(rodcompilerprocs_275066, ident);
		{
			if (!!((result == NIM_NIL))) goto LA8;
			strtableadd_234103((&compilerprocs_281064), result);
			{
				if (!((*result).Kind == ((NU8) 23))) goto LA12;
				loadstub_278261(result);
			}
			LA12: ;
			{
				if (!((*result).Kind == ((NU8) 25))) goto LA16;
				result = (*result).Owner;
			}
			LA16: ;
		}
		LA8: ;
	}
	LA4: ;
	return result;
}

N_NIMCALL(ttype224852*, nilorsysint_281070)(void) {
	ttype224852* result;
	result = 0;
	result = gsystypes_281063[(((NU8) 31))- 0];
	return result;
}

N_NIMCALL(void, setintlittype_281632)(tnode224816* result) {
	NI64 i;
	i = (*result).kindU.S1.Intval;
	switch (intsize_173610) {
	case 8:
	{
		asgnRefNoCycle((void**) (&(*result).Typ), getintlittype_281477(result));
	}
	break;
	case 4:
	{
		{
			NIM_BOOL LOC5;
			LOC5 = 0;
			LOC5 = (IL64(-2147483648) <= i);
			if (!(LOC5)) goto LA6;
			LOC5 = (i <= IL64(2147483647));
			LA6: ;
			if (!LOC5) goto LA7;
			asgnRefNoCycle((void**) (&(*result).Typ), getintlittype_281477(result));
		}
		goto LA3;
		LA7: ;
		{
			asgnRefNoCycle((void**) (&(*result).Typ), getsystype_281030(((NU8) 35)));
		}
		LA3: ;
	}
	break;
	case 2:
	{
		{
			NIM_BOOL LOC13;
			LOC13 = 0;
			LOC13 = (IL64(-32768) <= i);
			if (!(LOC13)) goto LA14;
			LOC13 = (i <= IL64(32767));
			LA14: ;
			if (!LOC13) goto LA15;
			asgnRefNoCycle((void**) (&(*result).Typ), getintlittype_281477(result));
		}
		goto LA11;
		LA15: ;
		{
			NIM_BOOL LOC18;
			LOC18 = 0;
			LOC18 = (IL64(-2147483648) <= i);
			if (!(LOC18)) goto LA19;
			LOC18 = (i <= IL64(2147483647));
			LA19: ;
			if (!LOC18) goto LA20;
			asgnRefNoCycle((void**) (&(*result).Typ), getsystype_281030(((NU8) 34)));
		}
		goto LA11;
		LA20: ;
		{
			asgnRefNoCycle((void**) (&(*result).Typ), getsystype_281030(((NU8) 35)));
		}
		LA11: ;
	}
	break;
	case 1:
	{
		{
			NIM_BOOL LOC26;
			LOC26 = 0;
			LOC26 = (IL64(-128) <= i);
			if (!(LOC26)) goto LA27;
			LOC26 = (i <= IL64(127));
			LA27: ;
			if (!LOC26) goto LA28;
			asgnRefNoCycle((void**) (&(*result).Typ), getintlittype_281477(result));
		}
		goto LA24;
		LA28: ;
		{
			NIM_BOOL LOC31;
			LOC31 = 0;
			LOC31 = (IL64(-32768) <= i);
			if (!(LOC31)) goto LA32;
			LOC31 = (i <= IL64(32767));
			LA32: ;
			if (!LOC31) goto LA33;
			asgnRefNoCycle((void**) (&(*result).Typ), getsystype_281030(((NU8) 33)));
		}
		goto LA24;
		LA33: ;
		{
			NIM_BOOL LOC36;
			LOC36 = 0;
			LOC36 = (IL64(-2147483648) <= i);
			if (!(LOC36)) goto LA37;
			LOC36 = (i <= IL64(2147483647));
			LA37: ;
			if (!LOC36) goto LA38;
			asgnRefNoCycle((void**) (&(*result).Typ), getsystype_281030(((NU8) 34)));
		}
		goto LA24;
		LA38: ;
		{
			asgnRefNoCycle((void**) (&(*result).Typ), getsystype_281030(((NU8) 35)));
		}
		LA24: ;
	}
	break;
	default:
	{
		internalerror_196987((*result).Info, ((NimStringDesc*) &TMP3253));
	}
	break;
	}
}

N_NIMCALL(void, resetsystypes_281359)(void) {
	asgnRefNoCycle((void**) (&systemmodule_281019), NIM_NIL);
	initstrtable_225153((&compilerprocs_281064));
	{
		NU8 i_281406;
		NU8 res_281446;
		i_281406 = 0;
		res_281446 = ((NU8) 0);
		{
			while (1) {
				if (!(res_281446 <= ((NU8) 61))) goto LA3;
				i_281406 = res_281446;
				asgnRefNoCycle((void**) (&gsystypes_281063[(i_281406)- 0]), NIM_NIL);
				res_281446 += 1;
			} LA3: ;
		}
	}
	{
		NI i_281442;
		NI res_281451;
		i_281442 = 0;
		res_281451 = -5;
		{
			while (1) {
				if (!(((NI) (res_281451)) <= 64)) goto LA6;
				i_281442 = res_281451;
				asgnRefNoCycle((void**) (&inttypecache_281354[(i_281442)- -5]), NIM_NIL);
				res_281451 += 1;
			} LA6: ;
		}
	}
}
NIM_EXTERNC N_NOINLINE(void, HEX00_magicsysInit)(void) {
	initstrtable_225153((&compilerprocs_281064));
}

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

