/* Generated by Nim Compiler v0.12.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 Tsym225841 Tsym225841;
typedef struct Ttype225847 Ttype225847;
typedef struct Tstrtable225813 Tstrtable225813;
typedef struct Tsymseq225811 Tsymseq225811;
typedef struct Tidobj198015 Tidobj198015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttypeseq225843 Ttypeseq225843;
typedef struct Tnode225809 Tnode225809;
typedef struct Tloc225823 Tloc225823;
typedef struct Ropeobj176009 Ropeobj176009;
typedef struct TGenericSeq TGenericSeq;
typedef struct Cell48947 Cell48947;
typedef struct Cellseq48963 Cellseq48963;
typedef struct Gcheap51018 Gcheap51018;
typedef struct Gcstack51016 Gcstack51016;
typedef struct Cellset48959 Cellset48959;
typedef struct Pagedesc48955 Pagedesc48955;
typedef struct Memregion30891 Memregion30891;
typedef struct Smallchunk30843 Smallchunk30843;
typedef struct Llchunk30885 Llchunk30885;
typedef struct Bigchunk30845 Bigchunk30845;
typedef struct Intset30817 Intset30817;
typedef struct Trunk30813 Trunk30813;
typedef struct Avlnode30889 Avlnode30889;
typedef struct Gcstat51014 Gcstat51014;
typedef struct NimStringDesc NimStringDesc;
typedef struct Tident198021 Tident198021;
typedef struct Tscope225835 Tscope225835;
typedef struct TY225944 TY225944;
typedef struct Tlineinfo190352 Tlineinfo190352;
typedef struct Tlib225827 Tlib225827;
typedef struct Tidentiter233141 Tidentiter233141;
typedef struct Tnodeseq225803 Tnodeseq225803;
typedef struct Basechunk30841 Basechunk30841;
typedef struct Freecell30833 Freecell30833;
typedef struct Tinstantiation225831 Tinstantiation225831;
typedef struct Tlistentry140022 Tlistentry140022;
typedef struct TY225932 TY225932;
typedef Ttype225847* TY274026[62];
struct  Tstrtable225813  {
NI counter;
Tsymseq225811* data;
};
typedef Ttype225847* TY274262[70];
typedef N_NIMCALL_PTR(void, TY3889) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3894) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3889 marker;
TY3894 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Tidobj198015  {
  TNimObject Sup;
NI id;
};
struct  Tloc225823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype225847* t;
Ropeobj176009* r;
Ropeobj176009* heaproot;
};
struct  Ttype225847  {
  Tidobj198015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq225843* sons;
Tnode225809* n;
Tsym225841* owner;
Tsym225841* sym;
Tsym225841* destructor;
Tsym225841* deepcopy;
Tsym225841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc225823 loc;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Cell48947  {
NI refcount;
TNimType* typ;
};
struct  Cellseq48963  {
NI len;
NI cap;
Cell48947** d;
};
struct  Cellset48959  {
NI counter;
NI max;
Pagedesc48955* head;
Pagedesc48955** data;
};
typedef Smallchunk30843* TY30906[512];
typedef Trunk30813* Trunkbuckets30815[256];
struct  Intset30817  {
Trunkbuckets30815 data;
};
struct  Memregion30891  {
NI minlargeobj;
NI maxlargeobj;
TY30906 freesmallchunks;
Llchunk30885* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk30845* freechunkslist;
Intset30817 chunkstarts;
Avlnode30889* root;
Avlnode30889* deleted;
Avlnode30889* last;
Avlnode30889* freeavlnodes;
};
struct  Gcstat51014  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap51018  {
Gcstack51016* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq48963 zct;
Cellseq48963 decstack;
Cellset48959 cycleroots;
Cellseq48963 tempstack;
NI recgclock;
Memregion30891 region;
Gcstat51014 stat;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tlineinfo190352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tsym225841  {
  Tidobj198015 Sup;
NU8 kind;
union{
struct {Ttypeseq225843* typeinstcache;
Tscope225835* typscope;
} S1;
struct {TY225944* procinstcache;
Tsym225841* gcunsafetyreason;
} S2;
struct {TY225944* usedgenerics;
Tstrtable225813 tab;
} S3;
struct {Tsym225841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype225847* typ;
Tident198021* name;
Tlineinfo190352 info;
Tsym225841* owner;
NU32 flags;
Tnode225809* ast;
NU32 options;
NI position;
NI offset;
Tloc225823 loc;
Tlib225827* annex;
Tnode225809* constraint;
};
struct  Tidentiter233141  {
NI h;
Tident198021* name;
};
struct  Tnode225809  {
Ttype225847* typ;
Tlineinfo190352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym225841* sym;
} S4;
struct {Tident198021* ident;
} S5;
struct {Tnodeseq225803* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Ropeobj176009  {
  TNimObject Sup;
Ropeobj176009* left;
Ropeobj176009* right;
NI length;
NimStringDesc* data;
};
struct  Gcstack51016  {
Gcstack51016* prev;
Gcstack51016* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY30822[8];
struct  Pagedesc48955  {
Pagedesc48955* next;
NI key;
TY30822 bits;
};
struct  Basechunk30841  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk30843  {
  Basechunk30841 Sup;
Smallchunk30843* next;
Smallchunk30843* prev;
Freecell30833* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk30885  {
NI size;
NI acc;
Llchunk30885* next;
};
struct  Bigchunk30845  {
  Basechunk30841 Sup;
Bigchunk30845* next;
Bigchunk30845* prev;
NI align;
NF data;
};
struct  Trunk30813  {
Trunk30813* next;
NI key;
TY30822 bits;
};
typedef Avlnode30889* TY30896[2];
struct  Avlnode30889  {
TY30896 link;
NI key;
NI upperbound;
NI level;
};
struct  Tident198021  {
  Tidobj198015 Sup;
NimStringDesc* s;
Tident198021* next;
NI h;
};
struct  Tscope225835  {
NI depthlevel;
Tstrtable225813 symbols;
Tnodeseq225803* usingsyms;
Tscope225835* parent;
};
struct  Tlistentry140022  {
  TNimObject Sup;
Tlistentry140022* prev;
Tlistentry140022* next;
};
struct  Tlib225827  {
  Tlistentry140022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj176009* name;
Tnode225809* path;
};
struct  Freecell30833  {
Freecell30833* next;
NI zerofield;
};
struct  Tinstantiation225831  {
Tsym225841* sym;
Ttypeseq225843* concretetypes;
TY225932* usedby;
NI compilesid;
};
struct Ttypeseq225843 {
  TGenericSeq Sup;
  Ttype225847* data[SEQ_DECL_SIZE];
};
struct Tsymseq225811 {
  TGenericSeq Sup;
  Tsym225841* data[SEQ_DECL_SIZE];
};
struct TY225944 {
  TGenericSeq Sup;
  Tinstantiation225831* data[SEQ_DECL_SIZE];
};
struct Tnodeseq225803 {
  TGenericSeq Sup;
  Tnode225809* data[SEQ_DECL_SIZE];
};
struct TY225932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, initstrtable_229007)(Tstrtable225813* x);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(Cell48947*, usrtocell_52646)(void* usr);
static N_INLINE(void, rtladdzct_54204)(Cell48947* c);
N_NOINLINE(void, addzct_52617)(Cellseq48963* s, Cell48947* c);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
static N_INLINE(Ttype225847*, skipintlit_274698)(Ttype225847* t);
N_NIMCALL(Ttype225847*, getsystype_274190)(NU8 kind);
N_NIMCALL(Ttype225847*, systypefromname_274179)(NimStringDesc* name);
N_NIMCALL(Tsym225841*, getsyssym_274077)(NimStringDesc* name);
N_NIMCALL(Tsym225841*, strtableget_233111)(Tstrtable225813 t, Tident198021* name);
N_NIMCALL(Tident198021*, getident_198463)(NimStringDesc* identifier);
N_NIMCALL(void, rawmessage_194636)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(Tsym225841*, newsym_226655)(NU8 symkind, Tident198021* name, Tsym225841* owner, Tlineinfo190352 info);
N_NIMCALL(Ttype225847*, newtype_228140)(NU8 kind, Tsym225841* owner);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(void, loadstub_271052)(Tsym225841* s);
N_NIMCALL(Ttype225847*, newsystype_274066)(NU8 kind, NI size);
N_NIMCALL(void, internalerror_196191)(NimStringDesc* errmsg);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NimStringDesc*, reprEnum)(NI e_86859, TNimType* typ);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(TGenericSeq*, incrSeqV2)(TGenericSeq* seq, NI elemsize);
N_NIMCALL(void, propagatetoowner_229274)(Ttype225847* owner, Ttype225847* elem);
N_NIMCALL(Tsym225841*, initidentiter_233147)(Tidentiter233141* ti, Tstrtable225813 tab, Tident198021* s);
N_NIMCALL(Tsym225841*, nextidentiter_233156)(Tidentiter233141* ti, Tstrtable225813 tab);
N_NIMCALL(void, strtableadd_233103)(Tstrtable225813* t, Tsym225841* n);
N_NIMCALL(void, localerror_196139)(Tlineinfo190352 info, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, HEX24_191879)(Tlineinfo190352 info);
N_NIMCALL(Ttype225847*, copytype_228542)(Ttype225847* t, Tsym225841* owner, NIM_BOOL keepid);
N_NIMCALL(Ttype225847*, getintlittype_274660)(Tnode225809* literal);
N_NIMCALL(void, internalerror_196172)(Tlineinfo190352 info, NimStringDesc* errmsg);
STRING_LITERAL(TMP1091, "int", 3);
STRING_LITERAL(TMP1092, "int8", 4);
STRING_LITERAL(TMP1093, "int16", 5);
STRING_LITERAL(TMP1094, "int32", 5);
STRING_LITERAL(TMP1095, "int64", 5);
STRING_LITERAL(TMP1096, "uint", 4);
STRING_LITERAL(TMP1097, "uint8", 5);
STRING_LITERAL(TMP1098, "uint16", 6);
STRING_LITERAL(TMP1099, "uint32", 6);
STRING_LITERAL(TMP1100, "uint64", 6);
STRING_LITERAL(TMP1101, "float", 5);
STRING_LITERAL(TMP1102, "float32", 7);
STRING_LITERAL(TMP1103, "float64", 7);
STRING_LITERAL(TMP1104, "float128", 8);
STRING_LITERAL(TMP1105, "bool", 4);
STRING_LITERAL(TMP1106, "char", 4);
STRING_LITERAL(TMP1107, "string", 6);
STRING_LITERAL(TMP1108, "cstring", 7);
STRING_LITERAL(TMP1109, "pointer", 7);
STRING_LITERAL(TMP1110, "request for typekind: ", 22);
STRING_LITERAL(TMP1112, "wanted: ", 8);
STRING_LITERAL(TMP1113, " got: ", 6);
STRING_LITERAL(TMP1114, "type not found: ", 16);
STRING_LITERAL(TMP3237, "symbol conflicts with other .exportNims symbol at: ", 51);
STRING_LITERAL(TMP3545, "invalid int size", 16);
Tsym225841* systemmodule_274019;
TY274026 gsystypes_274027;
Tstrtable225813 compilerprocs_274028;
Tstrtable225813 exposed_274029;
TY274262 inttypecache_274263;
extern TNimType NTI225843; /* TTypeSeq */
extern Gcheap51018 gch_51059;
extern NI ptrsize_174653;
extern TNimType NTI225262; /* TTypeKind */
extern Tstrtable225813 rodcompilerprocs_268089;
extern NI intsize_174651;

static N_INLINE(Cell48947*, usrtocell_52646)(void* usr) {
	Cell48947* result;
	result = 0;
	result = ((Cell48947*) ((NI)((NU64)(((NI) (usr))) - (NU64)(((NI)sizeof(Cell48947))))));
	return result;
}

static N_INLINE(void, rtladdzct_54204)(Cell48947* c) {
	addzct_52617((&gch_51059.zct), c);
}

static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
	Cell48947* c;
	c = usrtocell_52646(p);
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU64)((*c).refcount) < (NU64)(((NI) 8)))) goto LA3;
		rtladdzct_54204(c);
	}
	LA3: ;
}

static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) {
	{
		Cell48947* c;
		if (!!((src == NIM_NIL))) goto LA3;
		c = usrtocell_52646(src);
		(*c).refcount += ((NI) 8);
	}
	LA3: ;
	{
		Cell48947* c;
		if (!!(((*dest) == NIM_NIL))) goto LA7;
		c = usrtocell_52646((*dest));
		{
			(*c).refcount -= ((NI) 8);
			if (!((NU64)((*c).refcount) < (NU64)(((NI) 8)))) goto LA11;
			rtladdzct_54204(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

N_NIMCALL(Tsym225841*, getsyssym_274077)(NimStringDesc* name) {
	Tsym225841* result;
	Tident198021* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = getident_198463(name);
	result = strtableget_233111((*systemmodule_274019).kindU.S3.tab, LOC1);
	{
		Tident198021* LOC6;
		if (!(result == NIM_NIL)) goto LA4;
		rawmessage_194636(((NU16) 68), name);
		LOC6 = 0;
		LOC6 = getident_198463(name);
		result = newsym_226655(((NU8) 0), LOC6, systemmodule_274019, (*systemmodule_274019).info);
		asgnRefNoCycle((void**) (&(*result).typ), newtype_228140(((NU8) 50), systemmodule_274019));
	}
	LA4: ;
	{
		if (!((*result).kind == ((NU8) 23))) goto LA9;
		loadstub_271052(result);
	}
	LA9: ;
	{
		if (!((*result).kind == ((NU8) 25))) goto LA13;
		result = (*result).owner;
	}
	LA13: ;
	return result;
}

N_NIMCALL(Ttype225847*, systypefromname_274179)(NimStringDesc* name) {
	Ttype225847* result;
	Tsym225841* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = getsyssym_274077(name);
	result = (*LOC1).typ;
	return result;
}

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

static N_INLINE(Ttype225847*, skipintlit_274698)(Ttype225847* t) {
	Ttype225847* result;
{	result = 0;
	{
		if (!!(((*t).n == NIM_NIL))) goto LA3;
		{
			if (!((IL64(70866960384) &(IL64(1)<<(((*t).kind)&IL64(63))))!=0)) goto LA7;
			result = getsystype_274190((*t).kind);
			goto BeforeRet;
		}
		LA7: ;
	}
	LA3: ;
	result = t;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, addsonskipintlit_274731)(Ttype225847* father, Ttype225847* son) {
	Ttype225847* s;
	{
		if (!(*father).sons == 0) goto LA3;
		if ((*father).sons) nimGCunrefNoCycle((*father).sons);
		(*father).sons = (Ttypeseq225843*) newSeqRC1((&NTI225843), 0);
	}
	LA3: ;
	s = skipintlit_274698(son);
	(*father).sons = (Ttypeseq225843*) incrSeqV2(&((*father).sons)->Sup, sizeof(Ttype225847*));
	asgnRefNoCycle((void**) (&(*father).sons->data[(*father).sons->Sup.len]), s);
	++(*father).sons->Sup.len;
	propagatetoowner_229274(father, s);
}

N_NIMCALL(Tsym225841*, getsysmagic_274121)(NimStringDesc* name, NU8 m) {
	Tsym225841* result;
	Tidentiter233141 ti;
	Tident198021* id;
{	result = 0;
	memset((void*)(&ti), 0, sizeof(ti));
	id = getident_198463(name);
	result = initidentiter_233147((&ti), (*systemmodule_274019).kindU.S3.tab, id);
	{
		while (1) {
			if (!!((result == NIM_NIL))) goto LA2;
			{
				if (!((*result).kind == ((NU8) 23))) goto LA5;
				loadstub_271052(result);
			}
			LA5: ;
			{
				if (!((*result).magic == m)) goto LA9;
				goto BeforeRet;
			}
			LA9: ;
			result = nextidentiter_233156((&ti), (*systemmodule_274019).kindU.S3.tab);
		} LA2: ;
	}
	rawmessage_194636(((NU16) 68), name);
	result = newsym_226655(((NU8) 0), id, systemmodule_274019, (*systemmodule_274019).info);
	asgnRefNoCycle((void**) (&(*result).typ), newtype_228140(((NU8) 50), systemmodule_274019));
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tsym225841*, getcompilerproc_274811)(NimStringDesc* name) {
	Tsym225841* result;
	Tident198021* ident;
	result = 0;
	ident = getident_198463(name);
	result = strtableget_233111(compilerprocs_274028, ident);
	{
		if (!(result == NIM_NIL)) goto LA3;
		result = strtableget_233111(rodcompilerprocs_268089, ident);
		{
			if (!!((result == NIM_NIL))) goto LA7;
			strtableadd_233103((&compilerprocs_274028), result);
			{
				if (!((*result).kind == ((NU8) 23))) goto LA11;
				loadstub_271052(result);
			}
			LA11: ;
			{
				if (!((*result).kind == ((NU8) 25))) goto LA15;
				result = (*result).owner;
			}
			LA15: ;
		}
		LA7: ;
	}
	LA3: ;
	return result;
}

N_NIMCALL(void, registercompilerproc_274866)(Tsym225841* s) {
	strtableadd_233103((&compilerprocs_274028), s);
}

N_NIMCALL(void, registernimscriptsymbol_274876)(Tsym225841* s) {
	Tsym225841* conflict;
	conflict = strtableget_233111(exposed_274029, (*s).name);
	{
		if (!(conflict == NIM_NIL)) goto LA3;
		strtableadd_233103((&exposed_274029), s);
	}
	goto LA1;
	LA3: ;
	{
		NimStringDesc* LOC6;
		NimStringDesc* LOC7;
		LOC6 = 0;
		LOC7 = 0;
		LOC7 = HEX24_191879((*conflict).info);
		LOC6 = rawNewString(LOC7->Sup.len + 51);
appendString(LOC6, ((NimStringDesc*) &TMP3237));
appendString(LOC6, LOC7);
		localerror_196139((*s).info, LOC6);
	}
	LA1: ;
}

N_NIMCALL(Ttype225847*, getintlittype_274660)(Tnode225809* literal) {
	Ttype225847* 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_274263[(((NI) (value)))- -5];
		{
			Ttype225847* ti;
			if (!(result == NIM_NIL)) goto LA9;
			ti = getsystype_274190(((NU8) 31));
			result = copytype_228542(ti, (*ti).owner, NIM_FALSE);
			asgnRefNoCycle((void**) (&(*result).n), literal);
			asgnRefNoCycle((void**) (&inttypecache_274263[(((NI) (value)))- -5]), result);
		}
		LA9: ;
	}
	goto LA1;
	LA5: ;
	{
		Ttype225847* ti;
		ti = getsystype_274190(((NU8) 31));
		result = copytype_228542(ti, (*ti).owner, NIM_FALSE);
		asgnRefNoCycle((void**) (&(*result).n), literal);
	}
	LA1: ;
	return result;
}

N_NIMCALL(Ttype225847*, getfloatlittype_274688)(Tnode225809* literal) {
	Ttype225847* result;
	result = 0;
	result = newsystype_274066(((NU8) 36), ((NI) 8));
	asgnRefNoCycle((void**) (&(*result).n), literal);
	return result;
}

N_NIMCALL(Ttype225847*, nilorsysint_274036)(void) {
	Ttype225847* result;
	result = 0;
	result = gsystypes_274027[(((NU8) 31))- 0];
	return result;
}

N_NIMCALL(void, setintlittype_274776)(Tnode225809* result) {
	NI64 i;
	i = (*result).kindU.S1.intval;
	switch (intsize_174651) {
	case ((NI) 8):
	{
		asgnRefNoCycle((void**) (&(*result).typ), getintlittype_274660(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_274660(result));
		}
		goto LA3;
		LA7: ;
		{
			asgnRefNoCycle((void**) (&(*result).typ), getsystype_274190(((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_274660(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_274190(((NU8) 34)));
		}
		goto LA11;
		LA20: ;
		{
			asgnRefNoCycle((void**) (&(*result).typ), getsystype_274190(((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_274660(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_274190(((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_274190(((NU8) 34)));
		}
		goto LA24;
		LA38: ;
		{
			asgnRefNoCycle((void**) (&(*result).typ), getsystype_274190(((NU8) 35)));
		}
		LA24: ;
	}
	break;
	default:
	{
		internalerror_196172((*result).info, ((NimStringDesc*) &TMP3545));
	}
	break;
	}
}

N_NIMCALL(void, resetsystypes_274268)(void) {
	asgnRefNoCycle((void**) (&systemmodule_274019), NIM_NIL);
	initstrtable_229007((&compilerprocs_274028));
	initstrtable_229007((&exposed_274029));
	{
		NU8 i_274423;
		NI res_274627;
		i_274423 = 0;
		res_274627 = ((NI) 0);
		{
			while (1) {
				if (!(res_274627 <= ((NI) 61))) goto LA3;
				i_274423 = ((NU8) (res_274627));
				asgnRefNoCycle((void**) (&gsystypes_274027[(i_274423)- 0]), NIM_NIL);
				res_274627 += ((NI) 1);
			} LA3: ;
		}
	}
	{
		NI i_274623;
		NI res_274633;
		i_274623 = 0;
		res_274633 = ((NI) -5);
		{
			while (1) {
				if (!(res_274633 <= ((NI) 64))) goto LA6;
				i_274623 = ((NI) (res_274633));
				asgnRefNoCycle((void**) (&inttypecache_274263[(i_274623)- -5]), NIM_NIL);
				res_274633 += ((NI) 1);
			} LA6: ;
		}
	}
}
NIM_EXTERNC N_NOINLINE(void, compiler_magicsysInit000)(void) {
	initstrtable_229007((&compilerprocs_274028));
	initstrtable_229007((&exposed_274029));
}

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

