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

#include "nimbase.h"
#include <string.h>
typedef struct Tsym215822 Tsym215822;
typedef struct Ttype215828 Ttype215828;
typedef struct Tstrtable215794 Tstrtable215794;
typedef struct Tsymseq215792 Tsymseq215792;
typedef struct Tidobj190006 Tidobj190006;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttypeseq215824 Ttypeseq215824;
typedef struct Tnode215790 Tnode215790;
typedef struct Tloc215804 Tloc215804;
typedef struct Ropeobj170006 Ropeobj170006;
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 Memregion29688 Memregion29688;
typedef struct Smallchunk29640 Smallchunk29640;
typedef struct Llchunk29682 Llchunk29682;
typedef struct Bigchunk29642 Bigchunk29642;
typedef struct Intset29614 Intset29614;
typedef struct Trunk29610 Trunk29610;
typedef struct Avlnode29686 Avlnode29686;
typedef struct Gcstat49814 Gcstat49814;
typedef struct NimStringDesc NimStringDesc;
typedef struct Tident190012 Tident190012;
typedef struct Tscope215816 Tscope215816;
typedef struct TY215925 TY215925;
typedef struct Tlineinfo183337 Tlineinfo183337;
typedef struct Tlib215808 Tlib215808;
typedef struct Tidentiter222084 Tidentiter222084;
typedef struct Tnodeseq215784 Tnodeseq215784;
typedef struct Basechunk29638 Basechunk29638;
typedef struct Freecell29630 Freecell29630;
typedef struct Tinstantiation215812 Tinstantiation215812;
typedef struct Tlistentry135010 Tlistentry135010;
typedef struct TY215913 TY215913;
typedef Ttype215828* TY259011[62];
struct  Tstrtable215794  {
NI counter;
Tsymseq215792* data;
};
typedef Ttype215828* TY259196[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  Tidobj190006  {
  TNimObject Sup;
NI id;
};
struct  Tloc215804  {
NU8 k;
NU8 s;
NU16 flags;
Ttype215828* t;
Ropeobj170006* r;
Ropeobj170006* heaproot;
};
struct  Ttype215828  {
  Tidobj190006 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq215824* sons;
Tnode215790* n;
Tsym215822* owner;
Tsym215822* sym;
Tsym215822* destructor;
Tsym215822* deepcopy;
Tsym215822* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc215804 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 Smallchunk29640* TY29703[512];
typedef Trunk29610* Trunkbuckets29612[256];
struct  Intset29614  {
Trunkbuckets29612 data;
};
struct  Memregion29688  {
NI minlargeobj;
NI maxlargeobj;
TY29703 freesmallchunks;
Llchunk29682* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk29642* freechunkslist;
Intset29614 chunkstarts;
Avlnode29686* root;
Avlnode29686* deleted;
Avlnode29686* last;
Avlnode29686* 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;
Memregion29688 region;
Gcstat49814 stat;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tlineinfo183337  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tsym215822  {
  Tidobj190006 Sup;
NU8 kind;
union{
struct {Ttypeseq215824* typeinstcache;
Tscope215816* typscope;
} S1;
struct {TY215925* procinstcache;
Tsym215822* gcunsafetyreason;
} S2;
struct {TY215925* usedgenerics;
Tstrtable215794 tab;
} S3;
struct {Tsym215822* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype215828* typ;
Tident190012* name;
Tlineinfo183337 info;
Tsym215822* owner;
NU32 flags;
Tnode215790* ast;
NU32 options;
NI position;
NI offset;
Tloc215804 loc;
Tlib215808* annex;
Tnode215790* constraint;
};
struct  Tidentiter222084  {
NI h;
Tident190012* name;
};
struct  Tnode215790  {
Ttype215828* typ;
Tlineinfo183337 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym215822* sym;
} S4;
struct {Tident190012* ident;
} S5;
struct {Tnodeseq215784* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Ropeobj170006  {
  TNimObject Sup;
Ropeobj170006* left;
Ropeobj170006* right;
NI length;
NimStringDesc* data;
};
struct  Gcstack49816  {
Gcstack49816* prev;
Gcstack49816* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY29619[8];
struct  Pagedesc47512  {
Pagedesc47512* next;
NI key;
TY29619 bits;
};
struct  Basechunk29638  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk29640  {
  Basechunk29638 Sup;
Smallchunk29640* next;
Smallchunk29640* prev;
Freecell29630* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk29682  {
NI size;
NI acc;
Llchunk29682* next;
};
struct  Bigchunk29642  {
  Basechunk29638 Sup;
Bigchunk29642* next;
Bigchunk29642* prev;
NI align;
NF data;
};
struct  Trunk29610  {
Trunk29610* next;
NI key;
TY29619 bits;
};
typedef Avlnode29686* TY29693[2];
struct  Avlnode29686  {
TY29693 link;
NI key;
NI upperbound;
NI level;
};
struct  Tident190012  {
  Tidobj190006 Sup;
NimStringDesc* s;
Tident190012* next;
NI h;
};
struct  Tscope215816  {
NI depthlevel;
Tstrtable215794 symbols;
Tnodeseq215784* usingsyms;
Tscope215816* parent;
};
struct  Tlistentry135010  {
  TNimObject Sup;
Tlistentry135010* prev;
Tlistentry135010* next;
};
struct  Tlib215808  {
  Tlistentry135010 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj170006* name;
Tnode215790* path;
};
struct  Freecell29630  {
Freecell29630* next;
NI zerofield;
};
struct  Tinstantiation215812  {
Tsym215822* sym;
Ttypeseq215824* concretetypes;
TY215913* usedby;
NI compilesid;
};
struct Ttypeseq215824 {
  TGenericSeq Sup;
  Ttype215828* data[SEQ_DECL_SIZE];
};
struct Tsymseq215792 {
  TGenericSeq Sup;
  Tsym215822* data[SEQ_DECL_SIZE];
};
struct TY215925 {
  TGenericSeq Sup;
  Tinstantiation215812* data[SEQ_DECL_SIZE];
};
struct Tnodeseq215784 {
  TGenericSeq Sup;
  Tnode215790* data[SEQ_DECL_SIZE];
};
struct TY215913 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, initstrtable_219001)(Tstrtable215794* 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(Ttype215828*, skipintlit_259653)(Ttype215828* t);
N_NIMCALL(Ttype215828*, getsystype_259130)(NU8 kind);
N_NIMCALL(Ttype215828*, systypefromname_259125)(NimStringDesc* name);
N_NIMCALL(Tsym215822*, getsyssym_259041)(NimStringDesc* name);
N_NIMCALL(Tsym215822*, strtableget_222066)(Tstrtable215794 t, Tident190012* name);
N_NIMCALL(Tident190012*, getident_190441)(NimStringDesc* identifier);
N_NIMCALL(void, rawmessage_186612)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(Tsym215822*, newsym_216683)(NU8 symkind, Tident190012* name, Tsym215822* owner, Tlineinfo183337 info);
N_NIMCALL(Ttype215828*, newtype_218107)(NU8 kind, Tsym215822* owner);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(void, loadstub_255824)(Tsym215822* s);
N_NIMCALL(Ttype215828*, newsystype_259036)(NU8 kind, NI size);
N_NIMCALL(void, internalerror_188113)(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_219190)(Ttype215828* owner, Ttype215828* elem);
N_NIMCALL(Tsym215822*, initidentiter_222087)(Tidentiter222084* ti, Tstrtable215794 tab, Tident190012* s);
N_NIMCALL(Tsym215822*, nextidentiter_222093)(Tidentiter222084* ti, Tstrtable215794 tab);
N_NIMCALL(void, strtableadd_222061)(Tstrtable215794* t, Tsym215822* n);
N_NIMCALL(void, localerror_188085)(Tlineinfo183337 info, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, HEX24_184431)(Tlineinfo183337 info);
N_NIMCALL(Ttype215828*, copytype_218470)(Ttype215828* t, Tsym215822* owner, NIM_BOOL keepid);
N_NIMCALL(Ttype215828*, getintlittype_259627)(Tnode215790* literal);
N_NIMCALL(void, internalerror_188100)(Tlineinfo183337 info, NimStringDesc* errmsg);
STRING_LITERAL(TMP1090, "int", 3);
STRING_LITERAL(TMP1091, "int8", 4);
STRING_LITERAL(TMP1092, "int16", 5);
STRING_LITERAL(TMP1093, "int32", 5);
STRING_LITERAL(TMP1094, "int64", 5);
STRING_LITERAL(TMP1095, "uint", 4);
STRING_LITERAL(TMP1096, "uint8", 5);
STRING_LITERAL(TMP1097, "uint16", 6);
STRING_LITERAL(TMP1098, "uint32", 6);
STRING_LITERAL(TMP1099, "uint64", 6);
STRING_LITERAL(TMP1100, "float", 5);
STRING_LITERAL(TMP1101, "float32", 7);
STRING_LITERAL(TMP1102, "float64", 7);
STRING_LITERAL(TMP1103, "float128", 8);
STRING_LITERAL(TMP1104, "bool", 4);
STRING_LITERAL(TMP1105, "char", 4);
STRING_LITERAL(TMP1106, "string", 6);
STRING_LITERAL(TMP1107, "cstring", 7);
STRING_LITERAL(TMP1108, "pointer", 7);
STRING_LITERAL(TMP1109, "request for typekind: ", 22);
STRING_LITERAL(TMP1111, "wanted: ", 8);
STRING_LITERAL(TMP1112, " got: ", 6);
STRING_LITERAL(TMP1113, "type not found: ", 16);
STRING_LITERAL(TMP3274, "symbol conflicts with other .exportNims symbol at: ", 51);
STRING_LITERAL(TMP3559, "invalid int size", 16);
Tsym215822* systemmodule_259007;
TY259011 gsystypes_259012;
Tstrtable215794 compilerprocs_259013;
Tstrtable215794 exposed_259014;
TY259196 inttypecache_259197;
extern TNimType NTI215824; /* TTypeSeq */
extern Gcheap49818 gch_49859;
extern NI ptrsize_168617;
extern TNimType NTI215241; /* TTypeKind */
extern Tstrtable215794 rodcompilerprocs_253077;
extern NI intsize_168615;

static N_INLINE(Cell47504*, usrtocell_51440)(void* usr) {
	Cell47504* result;
	result = 0;
	result = ((Cell47504*) ((NI)((NU64)(((NI) (usr))) - (NU64)(((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 (!((NU64)((*c).refcount) < (NU64)(((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 (!((NU64)((*c).refcount) < (NU64)(((NI) 8)))) goto LA11;
			rtladdzct_53001(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

N_NIMCALL(Tsym215822*, getsyssym_259041)(NimStringDesc* name) {
	Tsym215822* result;
	Tident190012* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = getident_190441(name);
	result = strtableget_222066((*systemmodule_259007).kindU.S3.tab, LOC1);
	{
		Tident190012* LOC6;
		if (!(result == NIM_NIL)) goto LA4;
		rawmessage_186612(((NU16) 68), name);
		LOC6 = 0;
		LOC6 = getident_190441(name);
		result = newsym_216683(((NU8) 0), LOC6, systemmodule_259007, (*systemmodule_259007).info);
		asgnRefNoCycle((void**) (&(*result).typ), newtype_218107(((NU8) 50), systemmodule_259007));
	}
	LA4: ;
	{
		if (!((*result).kind == ((NU8) 22))) goto LA9;
		loadstub_255824(result);
	}
	LA9: ;
	{
		if (!((*result).kind == ((NU8) 24))) goto LA13;
		result = (*result).owner;
	}
	LA13: ;
	return result;
}

N_NIMCALL(Ttype215828*, systypefromname_259125)(NimStringDesc* name) {
	Ttype215828* result;
	Tsym215822* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = getsyssym_259041(name);
	result = (*LOC1).typ;
	return result;
}

N_NIMCALL(Ttype215828*, newsystype_259036)(NU8 kind, NI size) {
	Ttype215828* result;
	result = 0;
	result = newtype_218107(kind, systemmodule_259007);
	(*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(Ttype215828*, getsystype_259130)(NU8 kind) {
	Ttype215828* result;
{	result = 0;
	result = gsystypes_259012[(kind)- 0];
	{
		if (!(result == NIM_NIL)) goto LA3;
		switch (kind) {
		case ((NU8) 31):
		{
			result = systypefromname_259125(((NimStringDesc*) &TMP1090));
		}
		break;
		case ((NU8) 32):
		{
			result = systypefromname_259125(((NimStringDesc*) &TMP1091));
		}
		break;
		case ((NU8) 33):
		{
			result = systypefromname_259125(((NimStringDesc*) &TMP1092));
		}
		break;
		case ((NU8) 34):
		{
			result = systypefromname_259125(((NimStringDesc*) &TMP1093));
		}
		break;
		case ((NU8) 35):
		{
			result = systypefromname_259125(((NimStringDesc*) &TMP1094));
		}
		break;
		case ((NU8) 40):
		{
			result = systypefromname_259125(((NimStringDesc*) &TMP1095));
		}
		break;
		case ((NU8) 41):
		{
			result = systypefromname_259125(((NimStringDesc*) &TMP1096));
		}
		break;
		case ((NU8) 42):
		{
			result = systypefromname_259125(((NimStringDesc*) &TMP1097));
		}
		break;
		case ((NU8) 43):
		{
			result = systypefromname_259125(((NimStringDesc*) &TMP1098));
		}
		break;
		case ((NU8) 44):
		{
			result = systypefromname_259125(((NimStringDesc*) &TMP1099));
		}
		break;
		case ((NU8) 36):
		{
			result = systypefromname_259125(((NimStringDesc*) &TMP1100));
		}
		break;
		case ((NU8) 37):
		{
			result = systypefromname_259125(((NimStringDesc*) &TMP1101));
		}
		break;
		case ((NU8) 38):
		{
			result = systypefromname_259125(((NimStringDesc*) &TMP1102));
			goto BeforeRet;
		}
		break;
		case ((NU8) 39):
		{
			result = systypefromname_259125(((NimStringDesc*) &TMP1103));
		}
		break;
		case ((NU8) 1):
		{
			result = systypefromname_259125(((NimStringDesc*) &TMP1104));
		}
		break;
		case ((NU8) 2):
		{
			result = systypefromname_259125(((NimStringDesc*) &TMP1105));
		}
		break;
		case ((NU8) 28):
		{
			result = systypefromname_259125(((NimStringDesc*) &TMP1106));
		}
		break;
		case ((NU8) 29):
		{
			result = systypefromname_259125(((NimStringDesc*) &TMP1107));
		}
		break;
		case ((NU8) 26):
		{
			result = systypefromname_259125(((NimStringDesc*) &TMP1108));
		}
		break;
		case ((NU8) 5):
		{
			result = newsystype_259036(((NU8) 5), ptrsize_168617);
		}
		break;
		default:
		{
			NimStringDesc* LOC26;
			LOC26 = 0;
			LOC26 = rawNewString(reprEnum(kind, (&NTI215241))->Sup.len + 22);
appendString(LOC26, ((NimStringDesc*) &TMP1109));
appendString(LOC26, reprEnum(kind, (&NTI215241)));
			internalerror_188113(LOC26);
		}
		break;
		}
		asgnRefNoCycle((void**) (&gsystypes_259012[(kind)- 0]), result);
	}
	LA3: ;
	{
		NimStringDesc* LOC31;
		if (!!(((*result).kind == kind))) goto LA29;
		LOC31 = 0;
		LOC31 = rawNewString(reprEnum(kind, (&NTI215241))->Sup.len + reprEnum((*result).kind, (&NTI215241))->Sup.len + 14);
appendString(LOC31, ((NimStringDesc*) &TMP1111));
appendString(LOC31, reprEnum(kind, (&NTI215241)));
appendString(LOC31, ((NimStringDesc*) &TMP1112));
appendString(LOC31, reprEnum((*result).kind, (&NTI215241)));
		internalerror_188113(LOC31);
	}
	LA29: ;
	{
		NimStringDesc* LOC36;
		if (!(result == NIM_NIL)) goto LA34;
		LOC36 = 0;
		LOC36 = rawNewString(reprEnum(kind, (&NTI215241))->Sup.len + 16);
appendString(LOC36, ((NimStringDesc*) &TMP1113));
appendString(LOC36, reprEnum(kind, (&NTI215241)));
		internalerror_188113(LOC36);
	}
	LA34: ;
	}BeforeRet: ;
	return result;
}

static N_INLINE(Ttype215828*, skipintlit_259653)(Ttype215828* t) {
	Ttype215828* result;
{	result = 0;
	{
		if (!!(((*t).n == NIM_NIL))) goto LA3;
		{
			if (!((IL64(70866960384) &((NU64)1<<((NU)((*t).kind)&63U)))!=0)) goto LA7;
			result = getsystype_259130((*t).kind);
			goto BeforeRet;
		}
		LA7: ;
	}
	LA3: ;
	result = t;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, addsonskipintlit_259680)(Ttype215828* father, Ttype215828* son) {
	Ttype215828* s;
	{
		if (!(*father).sons == 0) goto LA3;
		if ((*father).sons) nimGCunrefNoCycle((*father).sons);
		(*father).sons = (Ttypeseq215824*) newSeqRC1((&NTI215824), 0);
	}
	LA3: ;
	s = skipintlit_259653(son);
	(*father).sons = (Ttypeseq215824*) incrSeqV2(&((*father).sons)->Sup, sizeof(Ttype215828*));
	asgnRefNoCycle((void**) (&(*father).sons->data[(*father).sons->Sup.len]), s);
	++(*father).sons->Sup.len;
	propagatetoowner_219190(father, s);
}

N_NIMCALL(Ttype215828*, nilorsysint_259018)(void) {
	Ttype215828* result;
	result = 0;
	result = gsystypes_259012[(((NU8) 31))- 0];
	return result;
}

N_NIMCALL(Tsym215822*, getsysmagic_259079)(NimStringDesc* name, NU8 m) {
	Tsym215822* result;
	Tidentiter222084 ti;
	Tident190012* id;
{	result = 0;
	memset((void*)(&ti), 0, sizeof(ti));
	id = getident_190441(name);
	result = initidentiter_222087((&ti), (*systemmodule_259007).kindU.S3.tab, id);
	{
		while (1) {
			if (!!((result == NIM_NIL))) goto LA2;
			{
				if (!((*result).kind == ((NU8) 22))) goto LA5;
				loadstub_255824(result);
			}
			LA5: ;
			{
				if (!((*result).magic == m)) goto LA9;
				goto BeforeRet;
			}
			LA9: ;
			result = nextidentiter_222093((&ti), (*systemmodule_259007).kindU.S3.tab);
		} LA2: ;
	}
	rawmessage_186612(((NU16) 68), name);
	result = newsym_216683(((NU8) 0), id, systemmodule_259007, (*systemmodule_259007).info);
	asgnRefNoCycle((void**) (&(*result).typ), newtype_218107(((NU8) 50), systemmodule_259007));
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tsym215822*, getcompilerproc_259748)(NimStringDesc* name) {
	Tsym215822* result;
	Tident190012* ident;
	result = 0;
	ident = getident_190441(name);
	result = strtableget_222066(compilerprocs_259013, ident);
	{
		if (!(result == NIM_NIL)) goto LA3;
		result = strtableget_222066(rodcompilerprocs_253077, ident);
		{
			if (!!((result == NIM_NIL))) goto LA7;
			strtableadd_222061((&compilerprocs_259013), result);
			{
				if (!((*result).kind == ((NU8) 22))) goto LA11;
				loadstub_255824(result);
			}
			LA11: ;
			{
				if (!((*result).kind == ((NU8) 24))) goto LA15;
				result = (*result).owner;
			}
			LA15: ;
		}
		LA7: ;
	}
	LA3: ;
	return result;
}

N_NIMCALL(void, registercompilerproc_259797)(Tsym215822* s) {
	strtableadd_222061((&compilerprocs_259013), s);
}

N_NIMCALL(void, registernimscriptsymbol_259801)(Tsym215822* s) {
	Tsym215822* conflict;
	conflict = strtableget_222066(exposed_259014, (*s).name);
	{
		if (!(conflict == NIM_NIL)) goto LA3;
		strtableadd_222061((&exposed_259014), s);
	}
	goto LA1;
	LA3: ;
	{
		NimStringDesc* LOC6;
		NimStringDesc* LOC7;
		LOC6 = 0;
		LOC7 = 0;
		LOC7 = HEX24_184431((*conflict).info);
		LOC6 = rawNewString(LOC7->Sup.len + 51);
appendString(LOC6, ((NimStringDesc*) &TMP3274));
appendString(LOC6, LOC7);
		localerror_188085((*s).info, LOC6);
	}
	LA1: ;
}

N_NIMCALL(Ttype215828*, getintlittype_259627)(Tnode215790* literal) {
	Ttype215828* 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_259197[(((NI) (value)))- -5];
		{
			Ttype215828* ti;
			if (!(result == NIM_NIL)) goto LA9;
			ti = getsystype_259130(((NU8) 31));
			result = copytype_218470(ti, (*ti).owner, NIM_FALSE);
			asgnRefNoCycle((void**) (&(*result).n), literal);
			asgnRefNoCycle((void**) (&inttypecache_259197[(((NI) (value)))- -5]), result);
		}
		LA9: ;
	}
	goto LA1;
	LA5: ;
	{
		Ttype215828* ti;
		ti = getsystype_259130(((NU8) 31));
		result = copytype_218470(ti, (*ti).owner, NIM_FALSE);
		asgnRefNoCycle((void**) (&(*result).n), literal);
	}
	LA1: ;
	return result;
}

N_NIMCALL(Ttype215828*, getfloatlittype_259649)(Tnode215790* literal) {
	Ttype215828* result;
	result = 0;
	result = newsystype_259036(((NU8) 36), ((NI) 8));
	asgnRefNoCycle((void**) (&(*result).n), literal);
	return result;
}

N_NIMCALL(void, setintlittype_259719)(Tnode215790* result) {
	NI64 i;
	i = (*result).kindU.S1.intval;
	switch (intsize_168615) {
	case ((NI) 8):
	{
		asgnRefNoCycle((void**) (&(*result).typ), getintlittype_259627(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_259627(result));
		}
		goto LA3;
		LA7: ;
		{
			asgnRefNoCycle((void**) (&(*result).typ), getsystype_259130(((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_259627(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_259130(((NU8) 34)));
		}
		goto LA11;
		LA20: ;
		{
			asgnRefNoCycle((void**) (&(*result).typ), getsystype_259130(((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_259627(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_259130(((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_259130(((NU8) 34)));
		}
		goto LA24;
		LA38: ;
		{
			asgnRefNoCycle((void**) (&(*result).typ), getsystype_259130(((NU8) 35)));
		}
		LA24: ;
	}
	break;
	default:
	{
		internalerror_188100((*result).info, ((NimStringDesc*) &TMP3559));
	}
	break;
	}
}

N_NIMCALL(void, resetsystypes_259199)(void) {
	asgnRefNoCycle((void**) (&systemmodule_259007), NIM_NIL);
	initstrtable_219001((&compilerprocs_259013));
	initstrtable_219001((&exposed_259014));
	{
		NU8 i_259414;
		NI res_259618;
		i_259414 = 0;
		res_259618 = ((NI) 0);
		{
			while (1) {
				if (!(res_259618 <= ((NI) 61))) goto LA3;
				i_259414 = ((NU8) (res_259618));
				asgnRefNoCycle((void**) (&gsystypes_259012[(i_259414)- 0]), NIM_NIL);
				res_259618 += ((NI) 1);
			} LA3: ;
		}
	}
	{
		NI i_259614;
		NI res_259624;
		i_259614 = 0;
		res_259624 = ((NI) -5);
		{
			while (1) {
				if (!(res_259624 <= ((NI) 64))) goto LA6;
				i_259614 = ((NI) (res_259624));
				asgnRefNoCycle((void**) (&inttypecache_259197[(i_259614)- -5]), NIM_NIL);
				res_259624 += ((NI) 1);
			} LA6: ;
		}
	}
}
NIM_EXTERNC N_NOINLINE(void, compiler_magicsysInit000)(void) {
	initstrtable_219001((&compilerprocs_259013));
	initstrtable_219001((&exposed_259014));
}

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

