/* 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 Tsym216822 Tsym216822;
typedef struct Ttype216828 Ttype216828;
typedef struct Tstrtable216794 Tstrtable216794;
typedef struct Tsymseq216792 Tsymseq216792;
typedef struct Tidobj191006 Tidobj191006;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttypeseq216824 Ttypeseq216824;
typedef struct Tnode216790 Tnode216790;
typedef struct Tloc216804 Tloc216804;
typedef struct Ropeobj172006 Ropeobj172006;
typedef struct TGenericSeq TGenericSeq;
typedef struct Cell47304 Cell47304;
typedef struct Cellseq47320 Cellseq47320;
typedef struct Gcheap49618 Gcheap49618;
typedef struct Gcstack49616 Gcstack49616;
typedef struct Cellset47316 Cellset47316;
typedef struct Pagedesc47312 Pagedesc47312;
typedef struct Memregion29487 Memregion29487;
typedef struct Smallchunk29439 Smallchunk29439;
typedef struct Llchunk29481 Llchunk29481;
typedef struct Bigchunk29441 Bigchunk29441;
typedef struct Intset29414 Intset29414;
typedef struct Trunk29410 Trunk29410;
typedef struct Avlnode29485 Avlnode29485;
typedef struct Gcstat49614 Gcstat49614;
typedef struct NimStringDesc NimStringDesc;
typedef struct Tident191012 Tident191012;
typedef struct Tscope216816 Tscope216816;
typedef struct TY216925 TY216925;
typedef struct Tlineinfo184337 Tlineinfo184337;
typedef struct Tlib216808 Tlib216808;
typedef struct Tidentiter223084 Tidentiter223084;
typedef struct Tnodeseq216784 Tnodeseq216784;
typedef struct Basechunk29437 Basechunk29437;
typedef struct Freecell29429 Freecell29429;
typedef struct Tinstantiation216812 Tinstantiation216812;
typedef struct Tlistentry138010 Tlistentry138010;
typedef struct TY216913 TY216913;
typedef Ttype216828* TY260011[62];
struct  Tstrtable216794  {
NI counter;
Tsymseq216792* data;
};
typedef Ttype216828* TY260196[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  Tidobj191006  {
  TNimObject Sup;
NI id;
};
struct  Tloc216804  {
NU8 k;
NU8 s;
NU16 flags;
Ttype216828* t;
Ropeobj172006* r;
Ropeobj172006* heaproot;
};
struct  Ttype216828  {
  Tidobj191006 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq216824* sons;
Tnode216790* n;
Tsym216822* owner;
Tsym216822* sym;
Tsym216822* destructor;
Tsym216822* deepcopy;
Tsym216822* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc216804 loc;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Cell47304  {
NI refcount;
TNimType* typ;
};
struct  Cellseq47320  {
NI len;
NI cap;
Cell47304** d;
};
struct  Cellset47316  {
NI counter;
NI max;
Pagedesc47312* head;
Pagedesc47312** data;
};
typedef Smallchunk29439* TY29502[512];
typedef Trunk29410* Trunkbuckets29412[256];
struct  Intset29414  {
Trunkbuckets29412 data;
};
struct  Memregion29487  {
NI minlargeobj;
NI maxlargeobj;
TY29502 freesmallchunks;
Llchunk29481* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk29441* freechunkslist;
Intset29414 chunkstarts;
Avlnode29485* root;
Avlnode29485* deleted;
Avlnode29485* last;
Avlnode29485* freeavlnodes;
};
struct  Gcstat49614  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap49618  {
Gcstack49616* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq47320 zct;
Cellseq47320 decstack;
Cellset47316 cycleroots;
Cellseq47320 tempstack;
NI recgclock;
Memregion29487 region;
Gcstat49614 stat;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tlineinfo184337  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tsym216822  {
  Tidobj191006 Sup;
NU8 kind;
union{
struct {Ttypeseq216824* typeinstcache;
Tscope216816* typscope;
} S1;
struct {TY216925* procinstcache;
Tsym216822* gcunsafetyreason;
} S2;
struct {TY216925* usedgenerics;
Tstrtable216794 tab;
} S3;
struct {Tsym216822* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype216828* typ;
Tident191012* name;
Tlineinfo184337 info;
Tsym216822* owner;
NU32 flags;
Tnode216790* ast;
NU32 options;
NI position;
NI offset;
Tloc216804 loc;
Tlib216808* annex;
Tnode216790* constraint;
};
struct  Tidentiter223084  {
NI h;
Tident191012* name;
};
struct  Tnode216790  {
Ttype216828* typ;
Tlineinfo184337 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym216822* sym;
} S4;
struct {Tident191012* ident;
} S5;
struct {Tnodeseq216784* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Ropeobj172006  {
  TNimObject Sup;
Ropeobj172006* left;
Ropeobj172006* right;
NI length;
NimStringDesc* data;
};
struct  Gcstack49616  {
Gcstack49616* prev;
Gcstack49616* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY29418[16];
struct  Pagedesc47312  {
Pagedesc47312* next;
NI key;
TY29418 bits;
};
struct  Basechunk29437  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk29439  {
  Basechunk29437 Sup;
Smallchunk29439* next;
Smallchunk29439* prev;
Freecell29429* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk29481  {
NI size;
NI acc;
Llchunk29481* next;
};
struct  Bigchunk29441  {
  Basechunk29437 Sup;
Bigchunk29441* next;
Bigchunk29441* prev;
NI align;
NF data;
};
struct  Trunk29410  {
Trunk29410* next;
NI key;
TY29418 bits;
};
typedef Avlnode29485* TY29492[2];
struct  Avlnode29485  {
TY29492 link;
NI key;
NI upperbound;
NI level;
};
struct  Tident191012  {
  Tidobj191006 Sup;
NimStringDesc* s;
Tident191012* next;
NI h;
};
struct  Tscope216816  {
NI depthlevel;
Tstrtable216794 symbols;
Tnodeseq216784* usingsyms;
Tscope216816* parent;
};
struct  Tlistentry138010  {
  TNimObject Sup;
Tlistentry138010* prev;
Tlistentry138010* next;
};
struct  Tlib216808  {
  Tlistentry138010 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj172006* name;
Tnode216790* path;
};
struct  Freecell29429  {
Freecell29429* next;
NI zerofield;
};
struct  Tinstantiation216812  {
Tsym216822* sym;
Ttypeseq216824* concretetypes;
TY216913* usedby;
NI compilesid;
};
struct Ttypeseq216824 {
  TGenericSeq Sup;
  Ttype216828* data[SEQ_DECL_SIZE];
};
struct Tsymseq216792 {
  TGenericSeq Sup;
  Tsym216822* data[SEQ_DECL_SIZE];
};
struct TY216925 {
  TGenericSeq Sup;
  Tinstantiation216812* data[SEQ_DECL_SIZE];
};
struct Tnodeseq216784 {
  TGenericSeq Sup;
  Tnode216790* data[SEQ_DECL_SIZE];
};
struct TY216913 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, initstrtable_220001)(Tstrtable216794* x);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(Cell47304*, usrtocell_51240)(void* usr);
static N_INLINE(void, rtladdzct_52801)(Cell47304* c);
N_NOINLINE(void, addzct_51217)(Cellseq47320* s, Cell47304* c);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
static N_INLINE(Ttype216828*, skipintlit_260651)(Ttype216828* t);
N_NIMCALL(Ttype216828*, getsystype_260130)(NU8 kind);
N_NIMCALL(Ttype216828*, systypefromname_260125)(NimStringDesc* name);
N_NIMCALL(Tsym216822*, getsyssym_260041)(NimStringDesc* name);
N_NIMCALL(Tsym216822*, strtableget_223066)(Tstrtable216794 t, Tident191012* name);
N_NIMCALL(Tident191012*, getident_191441)(NimStringDesc* identifier);
N_NIMCALL(void, rawmessage_187612)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(Tsym216822*, newsym_217684)(NU8 symkind, Tident191012* name, Tsym216822* owner, Tlineinfo184337 info);
N_NIMCALL(Ttype216828*, newtype_219107)(NU8 kind, Tsym216822* owner);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(void, loadstub_256825)(Tsym216822* s);
N_NIMCALL(Ttype216828*, newsystype_260036)(NU8 kind, NI size);
N_NIMCALL(void, internalerror_189113)(NimStringDesc* errmsg);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NimStringDesc*, reprEnum)(NI e_86409, TNimType* typ);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(TGenericSeq*, incrSeqV2)(TGenericSeq* seq, NI elemsize);
N_NIMCALL(void, propagatetoowner_220190)(Ttype216828* owner, Ttype216828* elem);
N_NIMCALL(Tsym216822*, initidentiter_223087)(Tidentiter223084* ti, Tstrtable216794 tab, Tident191012* s);
N_NIMCALL(Tsym216822*, nextidentiter_223093)(Tidentiter223084* ti, Tstrtable216794 tab);
N_NIMCALL(void, strtableadd_223061)(Tstrtable216794* t, Tsym216822* n);
N_NIMCALL(void, localerror_189085)(Tlineinfo184337 info, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, HEX24_185431)(Tlineinfo184337 info);
N_NIMCALL(Ttype216828*, copytype_219470)(Ttype216828* t, Tsym216822* owner, NIM_BOOL keepid);
N_NIMCALL(Ttype216828*, getintlittype_260627)(Tnode216790* literal);
N_NIMCALL(void, internalerror_189100)(Tlineinfo184337 info, NimStringDesc* errmsg);
STRING_LITERAL(TMP1098, "int", 3);
STRING_LITERAL(TMP1099, "int8", 4);
STRING_LITERAL(TMP1100, "int16", 5);
STRING_LITERAL(TMP1101, "int32", 5);
STRING_LITERAL(TMP1102, "int64", 5);
STRING_LITERAL(TMP1103, "uint", 4);
STRING_LITERAL(TMP1104, "uint8", 5);
STRING_LITERAL(TMP1105, "uint16", 6);
STRING_LITERAL(TMP1106, "uint32", 6);
STRING_LITERAL(TMP1107, "uint64", 6);
STRING_LITERAL(TMP1108, "float", 5);
STRING_LITERAL(TMP1109, "float32", 7);
STRING_LITERAL(TMP1110, "float64", 7);
STRING_LITERAL(TMP1111, "float128", 8);
STRING_LITERAL(TMP1112, "bool", 4);
STRING_LITERAL(TMP1113, "char", 4);
STRING_LITERAL(TMP1114, "string", 6);
STRING_LITERAL(TMP1115, "cstring", 7);
STRING_LITERAL(TMP1116, "pointer", 7);
STRING_LITERAL(TMP1117, "request for typekind: ", 22);
STRING_LITERAL(TMP1119, "wanted: ", 8);
STRING_LITERAL(TMP1120, " got: ", 6);
STRING_LITERAL(TMP1121, "type not found: ", 16);
STRING_LITERAL(TMP3277, "symbol conflicts with other .exportNims symbol at: ", 51);
STRING_LITERAL(TMP3562, "invalid int size", 16);
Tsym216822* systemmodule_260007;
TY260011 gsystypes_260012;
Tstrtable216794 compilerprocs_260013;
Tstrtable216794 exposed_260014;
TY260196 inttypecache_260197;
extern TNimType NTI216824; /* TTypeSeq */
extern Gcheap49618 gch_49659;
extern NI ptrsize_170617;
extern TNimType NTI216241; /* TTypeKind */
extern Tstrtable216794 rodcompilerprocs_254077;
extern NI intsize_170615;

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

static N_INLINE(void, rtladdzct_52801)(Cell47304* c) {
	addzct_51217((&gch_49659.zct), c);
}

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

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

N_NIMCALL(Tsym216822*, getsyssym_260041)(NimStringDesc* name) {
	Tsym216822* result;
	Tident191012* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = getident_191441(name);
	result = strtableget_223066((*systemmodule_260007).kindU.S3.tab, LOC1);
	{
		Tident191012* LOC6;
		if (!(result == NIM_NIL)) goto LA4;
		rawmessage_187612(((NU16) 68), name);
		LOC6 = 0;
		LOC6 = getident_191441(name);
		result = newsym_217684(((NU8) 0), LOC6, systemmodule_260007, (*systemmodule_260007).info);
		asgnRefNoCycle((void**) (&(*result).typ), newtype_219107(((NU8) 50), systemmodule_260007));
	}
	LA4: ;
	{
		if (!((*result).kind == ((NU8) 22))) goto LA9;
		loadstub_256825(result);
	}
	LA9: ;
	{
		if (!((*result).kind == ((NU8) 24))) goto LA13;
		result = (*result).owner;
	}
	LA13: ;
	return result;
}

N_NIMCALL(Ttype216828*, systypefromname_260125)(NimStringDesc* name) {
	Ttype216828* result;
	Tsym216822* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = getsyssym_260041(name);
	result = (*LOC1).typ;
	return result;
}

N_NIMCALL(Ttype216828*, newsystype_260036)(NU8 kind, NI size) {
	Ttype216828* result;
	result = 0;
	result = newtype_219107(kind, systemmodule_260007);
	(*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(Ttype216828*, getsystype_260130)(NU8 kind) {
	Ttype216828* result;
{	result = 0;
	result = gsystypes_260012[(kind)- 0];
	{
		if (!(result == NIM_NIL)) goto LA3;
		switch (kind) {
		case ((NU8) 31):
		{
			result = systypefromname_260125(((NimStringDesc*) &TMP1098));
		}
		break;
		case ((NU8) 32):
		{
			result = systypefromname_260125(((NimStringDesc*) &TMP1099));
		}
		break;
		case ((NU8) 33):
		{
			result = systypefromname_260125(((NimStringDesc*) &TMP1100));
		}
		break;
		case ((NU8) 34):
		{
			result = systypefromname_260125(((NimStringDesc*) &TMP1101));
		}
		break;
		case ((NU8) 35):
		{
			result = systypefromname_260125(((NimStringDesc*) &TMP1102));
		}
		break;
		case ((NU8) 40):
		{
			result = systypefromname_260125(((NimStringDesc*) &TMP1103));
		}
		break;
		case ((NU8) 41):
		{
			result = systypefromname_260125(((NimStringDesc*) &TMP1104));
		}
		break;
		case ((NU8) 42):
		{
			result = systypefromname_260125(((NimStringDesc*) &TMP1105));
		}
		break;
		case ((NU8) 43):
		{
			result = systypefromname_260125(((NimStringDesc*) &TMP1106));
		}
		break;
		case ((NU8) 44):
		{
			result = systypefromname_260125(((NimStringDesc*) &TMP1107));
		}
		break;
		case ((NU8) 36):
		{
			result = systypefromname_260125(((NimStringDesc*) &TMP1108));
		}
		break;
		case ((NU8) 37):
		{
			result = systypefromname_260125(((NimStringDesc*) &TMP1109));
		}
		break;
		case ((NU8) 38):
		{
			result = systypefromname_260125(((NimStringDesc*) &TMP1110));
			goto BeforeRet;
		}
		break;
		case ((NU8) 39):
		{
			result = systypefromname_260125(((NimStringDesc*) &TMP1111));
		}
		break;
		case ((NU8) 1):
		{
			result = systypefromname_260125(((NimStringDesc*) &TMP1112));
		}
		break;
		case ((NU8) 2):
		{
			result = systypefromname_260125(((NimStringDesc*) &TMP1113));
		}
		break;
		case ((NU8) 28):
		{
			result = systypefromname_260125(((NimStringDesc*) &TMP1114));
		}
		break;
		case ((NU8) 29):
		{
			result = systypefromname_260125(((NimStringDesc*) &TMP1115));
		}
		break;
		case ((NU8) 26):
		{
			result = systypefromname_260125(((NimStringDesc*) &TMP1116));
		}
		break;
		case ((NU8) 5):
		{
			result = newsystype_260036(((NU8) 5), ptrsize_170617);
		}
		break;
		default:
		{
			NimStringDesc* LOC26;
			LOC26 = 0;
			LOC26 = rawNewString(reprEnum(kind, (&NTI216241))->Sup.len + 22);
appendString(LOC26, ((NimStringDesc*) &TMP1117));
appendString(LOC26, reprEnum(kind, (&NTI216241)));
			internalerror_189113(LOC26);
		}
		break;
		}
		asgnRefNoCycle((void**) (&gsystypes_260012[(kind)- 0]), result);
	}
	LA3: ;
	{
		NimStringDesc* LOC31;
		if (!!(((*result).kind == kind))) goto LA29;
		LOC31 = 0;
		LOC31 = rawNewString(reprEnum(kind, (&NTI216241))->Sup.len + reprEnum((*result).kind, (&NTI216241))->Sup.len + 14);
appendString(LOC31, ((NimStringDesc*) &TMP1119));
appendString(LOC31, reprEnum(kind, (&NTI216241)));
appendString(LOC31, ((NimStringDesc*) &TMP1120));
appendString(LOC31, reprEnum((*result).kind, (&NTI216241)));
		internalerror_189113(LOC31);
	}
	LA29: ;
	{
		NimStringDesc* LOC36;
		if (!(result == NIM_NIL)) goto LA34;
		LOC36 = 0;
		LOC36 = rawNewString(reprEnum(kind, (&NTI216241))->Sup.len + 16);
appendString(LOC36, ((NimStringDesc*) &TMP1121));
appendString(LOC36, reprEnum(kind, (&NTI216241)));
		internalerror_189113(LOC36);
	}
	LA34: ;
	}BeforeRet: ;
	return result;
}

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

N_NIMCALL(void, addsonskipintlit_260678)(Ttype216828* father, Ttype216828* son) {
	Ttype216828* s;
	{
		if (!(*father).sons == 0) goto LA3;
		if ((*father).sons) nimGCunrefNoCycle((*father).sons);
		(*father).sons = (Ttypeseq216824*) newSeqRC1((&NTI216824), 0);
	}
	LA3: ;
	s = skipintlit_260651(son);
	(*father).sons = (Ttypeseq216824*) incrSeqV2(&((*father).sons)->Sup, sizeof(Ttype216828*));
	asgnRefNoCycle((void**) (&(*father).sons->data[(*father).sons->Sup.len]), s);
	++(*father).sons->Sup.len;
	propagatetoowner_220190(father, s);
}

N_NIMCALL(Ttype216828*, nilorsysint_260018)(void) {
	Ttype216828* result;
	result = 0;
	result = gsystypes_260012[(((NU8) 31))- 0];
	return result;
}

N_NIMCALL(Tsym216822*, getsysmagic_260079)(NimStringDesc* name, NU8 m) {
	Tsym216822* result;
	Tidentiter223084 ti;
	Tident191012* id;
{	result = 0;
	memset((void*)(&ti), 0, sizeof(ti));
	id = getident_191441(name);
	result = initidentiter_223087((&ti), (*systemmodule_260007).kindU.S3.tab, id);
	{
		while (1) {
			if (!!((result == NIM_NIL))) goto LA2;
			{
				if (!((*result).kind == ((NU8) 22))) goto LA5;
				loadstub_256825(result);
			}
			LA5: ;
			{
				if (!((*result).magic == m)) goto LA9;
				goto BeforeRet;
			}
			LA9: ;
			result = nextidentiter_223093((&ti), (*systemmodule_260007).kindU.S3.tab);
		} LA2: ;
	}
	rawmessage_187612(((NU16) 68), name);
	result = newsym_217684(((NU8) 0), id, systemmodule_260007, (*systemmodule_260007).info);
	asgnRefNoCycle((void**) (&(*result).typ), newtype_219107(((NU8) 50), systemmodule_260007));
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tsym216822*, getcompilerproc_260746)(NimStringDesc* name) {
	Tsym216822* result;
	Tident191012* ident;
	result = 0;
	ident = getident_191441(name);
	result = strtableget_223066(compilerprocs_260013, ident);
	{
		if (!(result == NIM_NIL)) goto LA3;
		result = strtableget_223066(rodcompilerprocs_254077, ident);
		{
			if (!!((result == NIM_NIL))) goto LA7;
			strtableadd_223061((&compilerprocs_260013), result);
			{
				if (!((*result).kind == ((NU8) 22))) goto LA11;
				loadstub_256825(result);
			}
			LA11: ;
			{
				if (!((*result).kind == ((NU8) 24))) goto LA15;
				result = (*result).owner;
			}
			LA15: ;
		}
		LA7: ;
	}
	LA3: ;
	return result;
}

N_NIMCALL(void, registercompilerproc_260795)(Tsym216822* s) {
	strtableadd_223061((&compilerprocs_260013), s);
}

N_NIMCALL(void, registernimscriptsymbol_260799)(Tsym216822* s) {
	Tsym216822* conflict;
	conflict = strtableget_223066(exposed_260014, (*s).name);
	{
		if (!(conflict == NIM_NIL)) goto LA3;
		strtableadd_223061((&exposed_260014), s);
	}
	goto LA1;
	LA3: ;
	{
		NimStringDesc* LOC6;
		NimStringDesc* LOC7;
		LOC6 = 0;
		LOC7 = 0;
		LOC7 = HEX24_185431((*conflict).info);
		LOC6 = rawNewString(LOC7->Sup.len + 51);
appendString(LOC6, ((NimStringDesc*) &TMP3277));
appendString(LOC6, LOC7);
		localerror_189085((*s).info, LOC6);
	}
	LA1: ;
}

N_NIMCALL(Ttype216828*, getintlittype_260627)(Tnode216790* literal) {
	Ttype216828* 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_260197[(((NI) (value)))- -5];
		{
			Ttype216828* ti;
			if (!(result == NIM_NIL)) goto LA9;
			ti = getsystype_260130(((NU8) 31));
			result = copytype_219470(ti, (*ti).owner, NIM_FALSE);
			asgnRefNoCycle((void**) (&(*result).n), literal);
			asgnRefNoCycle((void**) (&inttypecache_260197[(((NI) (value)))- -5]), result);
		}
		LA9: ;
	}
	goto LA1;
	LA5: ;
	{
		Ttype216828* ti;
		ti = getsystype_260130(((NU8) 31));
		result = copytype_219470(ti, (*ti).owner, NIM_FALSE);
		asgnRefNoCycle((void**) (&(*result).n), literal);
	}
	LA1: ;
	return result;
}

N_NIMCALL(Ttype216828*, getfloatlittype_260647)(Tnode216790* literal) {
	Ttype216828* result;
	result = 0;
	result = newsystype_260036(((NU8) 36), ((NI) 8));
	asgnRefNoCycle((void**) (&(*result).n), literal);
	return result;
}

N_NIMCALL(void, setintlittype_260717)(Tnode216790* result) {
	NI64 i;
	i = (*result).kindU.S1.intval;
	switch (intsize_170615) {
	case ((NI) 8):
	{
		asgnRefNoCycle((void**) (&(*result).typ), getintlittype_260627(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_260627(result));
		}
		goto LA3;
		LA7: ;
		{
			asgnRefNoCycle((void**) (&(*result).typ), getsystype_260130(((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_260627(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_260130(((NU8) 34)));
		}
		goto LA11;
		LA20: ;
		{
			asgnRefNoCycle((void**) (&(*result).typ), getsystype_260130(((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_260627(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_260130(((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_260130(((NU8) 34)));
		}
		goto LA24;
		LA38: ;
		{
			asgnRefNoCycle((void**) (&(*result).typ), getsystype_260130(((NU8) 35)));
		}
		LA24: ;
	}
	break;
	default:
	{
		internalerror_189100((*result).info, ((NimStringDesc*) &TMP3562));
	}
	break;
	}
}

N_NIMCALL(void, resetsystypes_260199)(void) {
	asgnRefNoCycle((void**) (&systemmodule_260007), NIM_NIL);
	initstrtable_220001((&compilerprocs_260013));
	initstrtable_220001((&exposed_260014));
	{
		NU8 i_260414;
		NI res_260618;
		i_260414 = 0;
		res_260618 = ((NI) 0);
		{
			while (1) {
				if (!(res_260618 <= ((NI) 61))) goto LA3;
				i_260414 = ((NU8) (res_260618));
				asgnRefNoCycle((void**) (&gsystypes_260012[(i_260414)- 0]), NIM_NIL);
				res_260618 += ((NI) 1);
			} LA3: ;
		}
	}
	{
		NI i_260614;
		NI res_260624;
		i_260614 = 0;
		res_260624 = ((NI) -5);
		{
			while (1) {
				if (!(res_260624 <= ((NI) 64))) goto LA6;
				i_260614 = ((NI) (res_260624));
				asgnRefNoCycle((void**) (&inttypecache_260197[(i_260614)- -5]), NIM_NIL);
				res_260624 += ((NI) 1);
			} LA6: ;
		}
	}
}
NIM_EXTERNC N_NOINLINE(void, compiler_magicsysInit000)(void) {
	initstrtable_220001((&compilerprocs_260013));
	initstrtable_220001((&exposed_260014));
}

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

