/* Generated by Nim Compiler v0.13.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 Tsym214822 Tsym214822;
typedef struct Ttype214828 Ttype214828;
typedef struct Tstrtable214794 Tstrtable214794;
typedef struct Tsymseq214792 Tsymseq214792;
typedef struct Tidobj189006 Tidobj189006;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttypeseq214824 Ttypeseq214824;
typedef struct Tnode214790 Tnode214790;
typedef struct Tloc214804 Tloc214804;
typedef struct Ropeobj169006 Ropeobj169006;
typedef struct TGenericSeq TGenericSeq;
typedef struct Cell47504 Cell47504;
typedef struct Cellseq47520 Cellseq47520;
typedef struct Gcheap49818 Gcheap49818;
typedef struct Gcstack49816 Gcstack49816;
typedef struct Cellset47516 Cellset47516;
typedef struct Pagedesc47512 Pagedesc47512;
typedef struct Memregion29687 Memregion29687;
typedef struct Smallchunk29639 Smallchunk29639;
typedef struct Llchunk29681 Llchunk29681;
typedef struct Bigchunk29641 Bigchunk29641;
typedef struct Intset29614 Intset29614;
typedef struct Trunk29610 Trunk29610;
typedef struct Avlnode29685 Avlnode29685;
typedef struct Gcstat49814 Gcstat49814;
typedef struct NimStringDesc NimStringDesc;
typedef struct Tident189012 Tident189012;
typedef struct Tscope214816 Tscope214816;
typedef struct TY214925 TY214925;
typedef struct Tlineinfo182337 Tlineinfo182337;
typedef struct Tlib214808 Tlib214808;
typedef struct Tidentiter221084 Tidentiter221084;
typedef struct Tnodeseq214784 Tnodeseq214784;
typedef struct Basechunk29637 Basechunk29637;
typedef struct Freecell29629 Freecell29629;
typedef struct Tinstantiation214812 Tinstantiation214812;
typedef struct Tlistentry135010 Tlistentry135010;
typedef struct TY214913 TY214913;
typedef Ttype214828* TY258011[62];
struct  Tstrtable214794  {
NI counter;
Tsymseq214792* data;
};
typedef Ttype214828* TY258196[70];
typedef N_NIMCALL_PTR(void, TY3489) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3494) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3489 marker;
TY3494 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Tidobj189006  {
  TNimObject Sup;
NI id;
};
struct  Tloc214804  {
NU8 k;
NU8 s;
NU16 flags;
Ttype214828* t;
Ropeobj169006* r;
Ropeobj169006* heaproot;
};
struct  Ttype214828  {
  Tidobj189006 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq214824* sons;
Tnode214790* n;
Tsym214822* owner;
Tsym214822* sym;
Tsym214822* destructor;
Tsym214822* deepcopy;
Tsym214822* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc214804 loc;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Cell47504  {
NI refcount;
TNimType* typ;
};
struct  Cellseq47520  {
NI len;
NI cap;
Cell47504** d;
};
struct  Cellset47516  {
NI counter;
NI max;
Pagedesc47512* head;
Pagedesc47512** data;
};
typedef Smallchunk29639* TY29702[512];
typedef Trunk29610* Trunkbuckets29612[256];
struct  Intset29614  {
Trunkbuckets29612 data;
};
struct  Memregion29687  {
NI minlargeobj;
NI maxlargeobj;
TY29702 freesmallchunks;
Llchunk29681* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk29641* freechunkslist;
Intset29614 chunkstarts;
Avlnode29685* root;
Avlnode29685* deleted;
Avlnode29685* last;
Avlnode29685* freeavlnodes;
};
struct  Gcstat49814  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap49818  {
Gcstack49816* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq47520 zct;
Cellseq47520 decstack;
Cellset47516 cycleroots;
Cellseq47520 tempstack;
NI recgclock;
Memregion29687 region;
Gcstat49814 stat;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tlineinfo182337  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tsym214822  {
  Tidobj189006 Sup;
NU8 kind;
union{
struct {Ttypeseq214824* typeinstcache;
Tscope214816* typscope;
} S1;
struct {TY214925* procinstcache;
Tsym214822* gcunsafetyreason;
} S2;
struct {TY214925* usedgenerics;
Tstrtable214794 tab;
} S3;
struct {Tsym214822* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype214828* typ;
Tident189012* name;
Tlineinfo182337 info;
Tsym214822* owner;
NU32 flags;
Tnode214790* ast;
NU32 options;
NI position;
NI offset;
Tloc214804 loc;
Tlib214808* annex;
Tnode214790* constraint;
};
struct  Tidentiter221084  {
NI h;
Tident189012* name;
};
struct  Tnode214790  {
Ttype214828* typ;
Tlineinfo182337 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym214822* sym;
} S4;
struct {Tident189012* ident;
} S5;
struct {Tnodeseq214784* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Ropeobj169006  {
  TNimObject Sup;
Ropeobj169006* left;
Ropeobj169006* right;
NI length;
NimStringDesc* data;
};
struct  Gcstack49816  {
Gcstack49816* prev;
Gcstack49816* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY29618[16];
struct  Pagedesc47512  {
Pagedesc47512* next;
NI key;
TY29618 bits;
};
struct  Basechunk29637  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk29639  {
  Basechunk29637 Sup;
Smallchunk29639* next;
Smallchunk29639* prev;
Freecell29629* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk29681  {
NI size;
NI acc;
Llchunk29681* next;
};
struct  Bigchunk29641  {
  Basechunk29637 Sup;
Bigchunk29641* next;
Bigchunk29641* prev;
NI align;
NF data;
};
struct  Trunk29610  {
Trunk29610* next;
NI key;
TY29618 bits;
};
typedef Avlnode29685* TY29692[2];
struct  Avlnode29685  {
TY29692 link;
NI key;
NI upperbound;
NI level;
};
struct  Tident189012  {
  Tidobj189006 Sup;
NimStringDesc* s;
Tident189012* next;
NI h;
};
struct  Tscope214816  {
NI depthlevel;
Tstrtable214794 symbols;
Tnodeseq214784* usingsyms;
Tscope214816* parent;
};
struct  Tlistentry135010  {
  TNimObject Sup;
Tlistentry135010* prev;
Tlistentry135010* next;
};
struct  Tlib214808  {
  Tlistentry135010 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj169006* name;
Tnode214790* path;
};
struct  Freecell29629  {
Freecell29629* next;
NI zerofield;
};
struct  Tinstantiation214812  {
Tsym214822* sym;
Ttypeseq214824* concretetypes;
TY214913* usedby;
NI compilesid;
};
struct Ttypeseq214824 {
  TGenericSeq Sup;
  Ttype214828* data[SEQ_DECL_SIZE];
};
struct Tsymseq214792 {
  TGenericSeq Sup;
  Tsym214822* data[SEQ_DECL_SIZE];
};
struct TY214925 {
  TGenericSeq Sup;
  Tinstantiation214812* data[SEQ_DECL_SIZE];
};
struct Tnodeseq214784 {
  TGenericSeq Sup;
  Tnode214790* data[SEQ_DECL_SIZE];
};
struct TY214913 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, initstrtable_218001)(Tstrtable214794* x);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(Cell47504*, usrtocell_51440)(void* usr);
static N_INLINE(void, rtladdzct_53001)(Cell47504* c);
N_NOINLINE(void, addzct_51417)(Cellseq47520* s, Cell47504* c);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
static N_INLINE(Ttype214828*, skipintlit_258651)(Ttype214828* t);
N_NIMCALL(Ttype214828*, getsystype_258130)(NU8 kind);
N_NIMCALL(Ttype214828*, systypefromname_258125)(NimStringDesc* name);
N_NIMCALL(Tsym214822*, getsyssym_258041)(NimStringDesc* name);
N_NIMCALL(Tsym214822*, strtableget_221066)(Tstrtable214794 t, Tident189012* name);
N_NIMCALL(Tident189012*, getident_189441)(NimStringDesc* identifier);
N_NIMCALL(void, rawmessage_185612)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(Tsym214822*, newsym_215684)(NU8 symkind, Tident189012* name, Tsym214822* owner, Tlineinfo182337 info);
N_NIMCALL(Ttype214828*, newtype_217107)(NU8 kind, Tsym214822* owner);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(void, loadstub_254825)(Tsym214822* s);
N_NIMCALL(Ttype214828*, newsystype_258036)(NU8 kind, NI size);
N_NIMCALL(void, internalerror_187113)(NimStringDesc* errmsg);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NimStringDesc*, reprEnum)(NI e_85009, TNimType* typ);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(TGenericSeq*, incrSeqV2)(TGenericSeq* seq, NI elemsize);
N_NIMCALL(void, propagatetoowner_218190)(Ttype214828* owner, Ttype214828* elem);
N_NIMCALL(Tsym214822*, initidentiter_221087)(Tidentiter221084* ti, Tstrtable214794 tab, Tident189012* s);
N_NIMCALL(Tsym214822*, nextidentiter_221093)(Tidentiter221084* ti, Tstrtable214794 tab);
N_NIMCALL(void, strtableadd_221061)(Tstrtable214794* t, Tsym214822* n);
N_NIMCALL(void, localerror_187085)(Tlineinfo182337 info, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, HEX24_183431)(Tlineinfo182337 info);
N_NIMCALL(Ttype214828*, copytype_217470)(Ttype214828* t, Tsym214822* owner, NIM_BOOL keepid);
N_NIMCALL(Ttype214828*, getintlittype_258627)(Tnode214790* literal);
N_NIMCALL(void, internalerror_187100)(Tlineinfo182337 info, NimStringDesc* errmsg);
STRING_LITERAL(TMP1088, "int", 3);
STRING_LITERAL(TMP1089, "int8", 4);
STRING_LITERAL(TMP1090, "int16", 5);
STRING_LITERAL(TMP1091, "int32", 5);
STRING_LITERAL(TMP1092, "int64", 5);
STRING_LITERAL(TMP1093, "uint", 4);
STRING_LITERAL(TMP1094, "uint8", 5);
STRING_LITERAL(TMP1095, "uint16", 6);
STRING_LITERAL(TMP1096, "uint32", 6);
STRING_LITERAL(TMP1097, "uint64", 6);
STRING_LITERAL(TMP1098, "float", 5);
STRING_LITERAL(TMP1099, "float32", 7);
STRING_LITERAL(TMP1100, "float64", 7);
STRING_LITERAL(TMP1101, "float128", 8);
STRING_LITERAL(TMP1102, "bool", 4);
STRING_LITERAL(TMP1103, "char", 4);
STRING_LITERAL(TMP1104, "string", 6);
STRING_LITERAL(TMP1105, "cstring", 7);
STRING_LITERAL(TMP1106, "pointer", 7);
STRING_LITERAL(TMP1107, "request for typekind: ", 22);
STRING_LITERAL(TMP1109, "wanted: ", 8);
STRING_LITERAL(TMP1110, " got: ", 6);
STRING_LITERAL(TMP1111, "type not found: ", 16);
STRING_LITERAL(TMP3271, "symbol conflicts with other .exportNims symbol at: ", 51);
STRING_LITERAL(TMP3556, "invalid int size", 16);
Tsym214822* systemmodule_258007;
TY258011 gsystypes_258012;
Tstrtable214794 compilerprocs_258013;
Tstrtable214794 exposed_258014;
TY258196 inttypecache_258197;
extern TNimType NTI214824; /* TTypeSeq */
extern Gcheap49818 gch_49859;
extern NI ptrsize_167617;
extern TNimType NTI214241; /* TTypeKind */
extern Tstrtable214794 rodcompilerprocs_252077;
extern NI intsize_167615;

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

static N_INLINE(void, rtladdzct_53001)(Cell47504* c) {
	addzct_51417((&gch_49859.zct), c);
}

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

static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) {
	{
		Cell47504* c;
		if (!!((src == NIM_NIL))) goto LA3;
		c = usrtocell_51440(src);
		(*c).refcount += ((NI) 8);
	}
	LA3: ;
	{
		Cell47504* c;
		if (!!(((*dest) == NIM_NIL))) goto LA7;
		c = usrtocell_51440((*dest));
		{
			(*c).refcount -= ((NI) 8);
			if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA11;
			rtladdzct_53001(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

N_NIMCALL(Tsym214822*, getsyssym_258041)(NimStringDesc* name) {
	Tsym214822* result;
	Tident189012* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = getident_189441(name);
	result = strtableget_221066((*systemmodule_258007).kindU.S3.tab, LOC1);
	{
		Tident189012* LOC6;
		if (!(result == NIM_NIL)) goto LA4;
		rawmessage_185612(((NU16) 68), name);
		LOC6 = 0;
		LOC6 = getident_189441(name);
		result = newsym_215684(((NU8) 0), LOC6, systemmodule_258007, (*systemmodule_258007).info);
		asgnRefNoCycle((void**) (&(*result).typ), newtype_217107(((NU8) 50), systemmodule_258007));
	}
	LA4: ;
	{
		if (!((*result).kind == ((NU8) 22))) goto LA9;
		loadstub_254825(result);
	}
	LA9: ;
	{
		if (!((*result).kind == ((NU8) 24))) goto LA13;
		result = (*result).owner;
	}
	LA13: ;
	return result;
}

N_NIMCALL(Ttype214828*, systypefromname_258125)(NimStringDesc* name) {
	Ttype214828* result;
	Tsym214822* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = getsyssym_258041(name);
	result = (*LOC1).typ;
	return result;
}

N_NIMCALL(Ttype214828*, newsystype_258036)(NU8 kind, NI size) {
	Ttype214828* result;
	result = 0;
	result = newtype_217107(kind, systemmodule_258007);
	(*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)), (NI)((*src).Sup.len + ((NI) 1)));
	(*dest).Sup.len += (*src).Sup.len;
}

N_NIMCALL(Ttype214828*, getsystype_258130)(NU8 kind) {
	Ttype214828* result;
{	result = 0;
	result = gsystypes_258012[(kind)- 0];
	{
		if (!(result == NIM_NIL)) goto LA3;
		switch (kind) {
		case ((NU8) 31):
		{
			result = systypefromname_258125(((NimStringDesc*) &TMP1088));
		}
		break;
		case ((NU8) 32):
		{
			result = systypefromname_258125(((NimStringDesc*) &TMP1089));
		}
		break;
		case ((NU8) 33):
		{
			result = systypefromname_258125(((NimStringDesc*) &TMP1090));
		}
		break;
		case ((NU8) 34):
		{
			result = systypefromname_258125(((NimStringDesc*) &TMP1091));
		}
		break;
		case ((NU8) 35):
		{
			result = systypefromname_258125(((NimStringDesc*) &TMP1092));
		}
		break;
		case ((NU8) 40):
		{
			result = systypefromname_258125(((NimStringDesc*) &TMP1093));
		}
		break;
		case ((NU8) 41):
		{
			result = systypefromname_258125(((NimStringDesc*) &TMP1094));
		}
		break;
		case ((NU8) 42):
		{
			result = systypefromname_258125(((NimStringDesc*) &TMP1095));
		}
		break;
		case ((NU8) 43):
		{
			result = systypefromname_258125(((NimStringDesc*) &TMP1096));
		}
		break;
		case ((NU8) 44):
		{
			result = systypefromname_258125(((NimStringDesc*) &TMP1097));
		}
		break;
		case ((NU8) 36):
		{
			result = systypefromname_258125(((NimStringDesc*) &TMP1098));
		}
		break;
		case ((NU8) 37):
		{
			result = systypefromname_258125(((NimStringDesc*) &TMP1099));
		}
		break;
		case ((NU8) 38):
		{
			result = systypefromname_258125(((NimStringDesc*) &TMP1100));
			goto BeforeRet;
		}
		break;
		case ((NU8) 39):
		{
			result = systypefromname_258125(((NimStringDesc*) &TMP1101));
		}
		break;
		case ((NU8) 1):
		{
			result = systypefromname_258125(((NimStringDesc*) &TMP1102));
		}
		break;
		case ((NU8) 2):
		{
			result = systypefromname_258125(((NimStringDesc*) &TMP1103));
		}
		break;
		case ((NU8) 28):
		{
			result = systypefromname_258125(((NimStringDesc*) &TMP1104));
		}
		break;
		case ((NU8) 29):
		{
			result = systypefromname_258125(((NimStringDesc*) &TMP1105));
		}
		break;
		case ((NU8) 26):
		{
			result = systypefromname_258125(((NimStringDesc*) &TMP1106));
		}
		break;
		case ((NU8) 5):
		{
			result = newsystype_258036(((NU8) 5), ptrsize_167617);
		}
		break;
		default:
		{
			NimStringDesc* LOC26;
			LOC26 = 0;
			LOC26 = rawNewString(reprEnum(kind, (&NTI214241))->Sup.len + 22);
appendString(LOC26, ((NimStringDesc*) &TMP1107));
appendString(LOC26, reprEnum(kind, (&NTI214241)));
			internalerror_187113(LOC26);
		}
		break;
		}
		asgnRefNoCycle((void**) (&gsystypes_258012[(kind)- 0]), result);
	}
	LA3: ;
	{
		NimStringDesc* LOC31;
		if (!!(((*result).kind == kind))) goto LA29;
		LOC31 = 0;
		LOC31 = rawNewString(reprEnum(kind, (&NTI214241))->Sup.len + reprEnum((*result).kind, (&NTI214241))->Sup.len + 14);
appendString(LOC31, ((NimStringDesc*) &TMP1109));
appendString(LOC31, reprEnum(kind, (&NTI214241)));
appendString(LOC31, ((NimStringDesc*) &TMP1110));
appendString(LOC31, reprEnum((*result).kind, (&NTI214241)));
		internalerror_187113(LOC31);
	}
	LA29: ;
	{
		NimStringDesc* LOC36;
		if (!(result == NIM_NIL)) goto LA34;
		LOC36 = 0;
		LOC36 = rawNewString(reprEnum(kind, (&NTI214241))->Sup.len + 16);
appendString(LOC36, ((NimStringDesc*) &TMP1111));
appendString(LOC36, reprEnum(kind, (&NTI214241)));
		internalerror_187113(LOC36);
	}
	LA34: ;
	}BeforeRet: ;
	return result;
}

static N_INLINE(Ttype214828*, skipintlit_258651)(Ttype214828* t) {
	Ttype214828* result;
{	result = 0;
	{
		if (!!(((*t).n == NIM_NIL))) goto LA3;
		{
			if (!((*t).kind == ((NU8) 31) || (*t).kind == ((NU8) 36))) goto LA7;
			result = getsystype_258130((*t).kind);
			goto BeforeRet;
		}
		LA7: ;
	}
	LA3: ;
	result = t;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, addsonskipintlit_258678)(Ttype214828* father, Ttype214828* son) {
	Ttype214828* s;
	{
		if (!(*father).sons == 0) goto LA3;
		if ((*father).sons) nimGCunrefNoCycle((*father).sons);
		(*father).sons = (Ttypeseq214824*) newSeqRC1((&NTI214824), 0);
	}
	LA3: ;
	s = skipintlit_258651(son);
	(*father).sons = (Ttypeseq214824*) incrSeqV2(&((*father).sons)->Sup, sizeof(Ttype214828*));
	asgnRefNoCycle((void**) (&(*father).sons->data[(*father).sons->Sup.len]), s);
	++(*father).sons->Sup.len;
	propagatetoowner_218190(father, s);
}

N_NIMCALL(Ttype214828*, nilorsysint_258018)(void) {
	Ttype214828* result;
	result = 0;
	result = gsystypes_258012[(((NU8) 31))- 0];
	return result;
}

N_NIMCALL(Tsym214822*, getsysmagic_258079)(NimStringDesc* name, NU8 m) {
	Tsym214822* result;
	Tidentiter221084 ti;
	Tident189012* id;
{	result = 0;
	memset((void*)(&ti), 0, sizeof(ti));
	id = getident_189441(name);
	result = initidentiter_221087((&ti), (*systemmodule_258007).kindU.S3.tab, id);
	{
		while (1) {
			if (!!((result == NIM_NIL))) goto LA2;
			{
				if (!((*result).kind == ((NU8) 22))) goto LA5;
				loadstub_254825(result);
			}
			LA5: ;
			{
				if (!((*result).magic == m)) goto LA9;
				goto BeforeRet;
			}
			LA9: ;
			result = nextidentiter_221093((&ti), (*systemmodule_258007).kindU.S3.tab);
		} LA2: ;
	}
	rawmessage_185612(((NU16) 68), name);
	result = newsym_215684(((NU8) 0), id, systemmodule_258007, (*systemmodule_258007).info);
	asgnRefNoCycle((void**) (&(*result).typ), newtype_217107(((NU8) 50), systemmodule_258007));
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tsym214822*, getcompilerproc_258746)(NimStringDesc* name) {
	Tsym214822* result;
	Tident189012* ident;
	result = 0;
	ident = getident_189441(name);
	result = strtableget_221066(compilerprocs_258013, ident);
	{
		if (!(result == NIM_NIL)) goto LA3;
		result = strtableget_221066(rodcompilerprocs_252077, ident);
		{
			if (!!((result == NIM_NIL))) goto LA7;
			strtableadd_221061((&compilerprocs_258013), result);
			{
				if (!((*result).kind == ((NU8) 22))) goto LA11;
				loadstub_254825(result);
			}
			LA11: ;
			{
				if (!((*result).kind == ((NU8) 24))) goto LA15;
				result = (*result).owner;
			}
			LA15: ;
		}
		LA7: ;
	}
	LA3: ;
	return result;
}

N_NIMCALL(void, registercompilerproc_258795)(Tsym214822* s) {
	strtableadd_221061((&compilerprocs_258013), s);
}

N_NIMCALL(void, registernimscriptsymbol_258799)(Tsym214822* s) {
	Tsym214822* conflict;
	conflict = strtableget_221066(exposed_258014, (*s).name);
	{
		if (!(conflict == NIM_NIL)) goto LA3;
		strtableadd_221061((&exposed_258014), s);
	}
	goto LA1;
	LA3: ;
	{
		NimStringDesc* LOC6;
		NimStringDesc* LOC7;
		LOC6 = 0;
		LOC7 = 0;
		LOC7 = HEX24_183431((*conflict).info);
		LOC6 = rawNewString(LOC7->Sup.len + 51);
appendString(LOC6, ((NimStringDesc*) &TMP3271));
appendString(LOC6, LOC7);
		localerror_187085((*s).info, LOC6);
	}
	LA1: ;
}

N_NIMCALL(Ttype214828*, getintlittype_258627)(Tnode214790* literal) {
	Ttype214828* 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_258197[(((NI) (value)))- -5];
		{
			Ttype214828* ti;
			if (!(result == NIM_NIL)) goto LA9;
			ti = getsystype_258130(((NU8) 31));
			result = copytype_217470(ti, (*ti).owner, NIM_FALSE);
			asgnRefNoCycle((void**) (&(*result).n), literal);
			asgnRefNoCycle((void**) (&inttypecache_258197[(((NI) (value)))- -5]), result);
		}
		LA9: ;
	}
	goto LA1;
	LA5: ;
	{
		Ttype214828* ti;
		ti = getsystype_258130(((NU8) 31));
		result = copytype_217470(ti, (*ti).owner, NIM_FALSE);
		asgnRefNoCycle((void**) (&(*result).n), literal);
	}
	LA1: ;
	return result;
}

N_NIMCALL(Ttype214828*, getfloatlittype_258647)(Tnode214790* literal) {
	Ttype214828* result;
	result = 0;
	result = newsystype_258036(((NU8) 36), ((NI) 8));
	asgnRefNoCycle((void**) (&(*result).n), literal);
	return result;
}

N_NIMCALL(void, setintlittype_258717)(Tnode214790* result) {
	NI64 i;
	i = (*result).kindU.S1.intval;
	switch (intsize_167615) {
	case ((NI) 8):
	{
		asgnRefNoCycle((void**) (&(*result).typ), getintlittype_258627(result));
	}
	break;
	case ((NI) 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_258627(result));
		}
		goto LA3;
		LA7: ;
		{
			asgnRefNoCycle((void**) (&(*result).typ), getsystype_258130(((NU8) 35)));
		}
		LA3: ;
	}
	break;
	case ((NI) 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_258627(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_258130(((NU8) 34)));
		}
		goto LA11;
		LA20: ;
		{
			asgnRefNoCycle((void**) (&(*result).typ), getsystype_258130(((NU8) 35)));
		}
		LA11: ;
	}
	break;
	case ((NI) 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_258627(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_258130(((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_258130(((NU8) 34)));
		}
		goto LA24;
		LA38: ;
		{
			asgnRefNoCycle((void**) (&(*result).typ), getsystype_258130(((NU8) 35)));
		}
		LA24: ;
	}
	break;
	default:
	{
		internalerror_187100((*result).info, ((NimStringDesc*) &TMP3556));
	}
	break;
	}
}

N_NIMCALL(void, resetsystypes_258199)(void) {
	asgnRefNoCycle((void**) (&systemmodule_258007), NIM_NIL);
	initstrtable_218001((&compilerprocs_258013));
	initstrtable_218001((&exposed_258014));
	{
		NU8 i_258414;
		NI res_258618;
		i_258414 = 0;
		res_258618 = ((NI) 0);
		{
			while (1) {
				if (!(res_258618 <= ((NI) 61))) goto LA3;
				i_258414 = ((NU8) (res_258618));
				asgnRefNoCycle((void**) (&gsystypes_258012[(i_258414)- 0]), NIM_NIL);
				res_258618 += ((NI) 1);
			} LA3: ;
		}
	}
	{
		NI i_258614;
		NI res_258624;
		i_258614 = 0;
		res_258624 = ((NI) -5);
		{
			while (1) {
				if (!(res_258624 <= ((NI) 64))) goto LA6;
				i_258614 = ((NI) (res_258624));
				asgnRefNoCycle((void**) (&inttypecache_258197[(i_258614)- -5]), NIM_NIL);
				res_258624 += ((NI) 1);
			} LA6: ;
		}
	}
}
NIM_EXTERNC N_NOINLINE(void, compiler_magicsysInit000)(void) {
	initstrtable_218001((&compilerprocs_258013));
	initstrtable_218001((&exposed_258014));
}

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

