/* Generated by Nim Compiler v0.12.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 Tsym227841 Tsym227841;
typedef struct Ttype227847 Ttype227847;
typedef struct Tstrtable227813 Tstrtable227813;
typedef struct Tsymseq227811 Tsymseq227811;
typedef struct Tidobj200015 Tidobj200015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttypeseq227843 Ttypeseq227843;
typedef struct Tnode227809 Tnode227809;
typedef struct Tloc227823 Tloc227823;
typedef struct Ropeobj178009 Ropeobj178009;
typedef struct TGenericSeq TGenericSeq;
typedef struct Cell48946 Cell48946;
typedef struct Cellseq48962 Cellseq48962;
typedef struct Gcheap51018 Gcheap51018;
typedef struct Gcstack51016 Gcstack51016;
typedef struct Cellset48958 Cellset48958;
typedef struct Pagedesc48954 Pagedesc48954;
typedef struct Memregion30890 Memregion30890;
typedef struct Smallchunk30842 Smallchunk30842;
typedef struct Llchunk30884 Llchunk30884;
typedef struct Bigchunk30844 Bigchunk30844;
typedef struct Intset30817 Intset30817;
typedef struct Trunk30813 Trunk30813;
typedef struct Avlnode30888 Avlnode30888;
typedef struct Gcstat51014 Gcstat51014;
typedef struct NimStringDesc NimStringDesc;
typedef struct Tident200021 Tident200021;
typedef struct Tscope227835 Tscope227835;
typedef struct TY227944 TY227944;
typedef struct Tlineinfo192352 Tlineinfo192352;
typedef struct Tlib227827 Tlib227827;
typedef struct Tidentiter235141 Tidentiter235141;
typedef struct Tnodeseq227803 Tnodeseq227803;
typedef struct Basechunk30840 Basechunk30840;
typedef struct Freecell30832 Freecell30832;
typedef struct Tinstantiation227831 Tinstantiation227831;
typedef struct Tlistentry143022 Tlistentry143022;
typedef struct TY227932 TY227932;
typedef Ttype227847* TY276026[62];
struct  Tstrtable227813  {
NI counter;
Tsymseq227811* data;
};
typedef Ttype227847* TY276262[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  Tidobj200015  {
  TNimObject Sup;
NI id;
};
struct  Tloc227823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype227847* t;
Ropeobj178009* r;
Ropeobj178009* heaproot;
};
struct  Ttype227847  {
  Tidobj200015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq227843* sons;
Tnode227809* n;
Tsym227841* owner;
Tsym227841* sym;
Tsym227841* destructor;
Tsym227841* deepcopy;
Tsym227841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc227823 loc;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Cell48946  {
NI refcount;
TNimType* typ;
};
struct  Cellseq48962  {
NI len;
NI cap;
Cell48946** d;
};
struct  Cellset48958  {
NI counter;
NI max;
Pagedesc48954* head;
Pagedesc48954** data;
};
typedef Smallchunk30842* TY30905[512];
typedef Trunk30813* Trunkbuckets30815[256];
struct  Intset30817  {
Trunkbuckets30815 data;
};
struct  Memregion30890  {
NI minlargeobj;
NI maxlargeobj;
TY30905 freesmallchunks;
Llchunk30884* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk30844* freechunkslist;
Intset30817 chunkstarts;
Avlnode30888* root;
Avlnode30888* deleted;
Avlnode30888* last;
Avlnode30888* 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;
Cellseq48962 zct;
Cellseq48962 decstack;
Cellset48958 cycleroots;
Cellseq48962 tempstack;
NI recgclock;
Memregion30890 region;
Gcstat51014 stat;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tlineinfo192352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tsym227841  {
  Tidobj200015 Sup;
NU8 kind;
union{
struct {Ttypeseq227843* typeinstcache;
Tscope227835* typscope;
} S1;
struct {TY227944* procinstcache;
Tsym227841* gcunsafetyreason;
} S2;
struct {TY227944* usedgenerics;
Tstrtable227813 tab;
} S3;
struct {Tsym227841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype227847* typ;
Tident200021* name;
Tlineinfo192352 info;
Tsym227841* owner;
NU32 flags;
Tnode227809* ast;
NU32 options;
NI position;
NI offset;
Tloc227823 loc;
Tlib227827* annex;
Tnode227809* constraint;
};
struct  Tidentiter235141  {
NI h;
Tident200021* name;
};
struct  Tnode227809  {
Ttype227847* typ;
Tlineinfo192352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym227841* sym;
} S4;
struct {Tident200021* ident;
} S5;
struct {Tnodeseq227803* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Ropeobj178009  {
  TNimObject Sup;
Ropeobj178009* left;
Ropeobj178009* right;
NI length;
NimStringDesc* data;
};
struct  Gcstack51016  {
Gcstack51016* prev;
Gcstack51016* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY30821[16];
struct  Pagedesc48954  {
Pagedesc48954* next;
NI key;
TY30821 bits;
};
struct  Basechunk30840  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk30842  {
  Basechunk30840 Sup;
Smallchunk30842* next;
Smallchunk30842* prev;
Freecell30832* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk30884  {
NI size;
NI acc;
Llchunk30884* next;
};
struct  Bigchunk30844  {
  Basechunk30840 Sup;
Bigchunk30844* next;
Bigchunk30844* prev;
NI align;
NF data;
};
struct  Trunk30813  {
Trunk30813* next;
NI key;
TY30821 bits;
};
typedef Avlnode30888* TY30895[2];
struct  Avlnode30888  {
TY30895 link;
NI key;
NI upperbound;
NI level;
};
struct  Tident200021  {
  Tidobj200015 Sup;
NimStringDesc* s;
Tident200021* next;
NI h;
};
struct  Tscope227835  {
NI depthlevel;
Tstrtable227813 symbols;
Tnodeseq227803* usingsyms;
Tscope227835* parent;
};
struct  Tlistentry143022  {
  TNimObject Sup;
Tlistentry143022* prev;
Tlistentry143022* next;
};
struct  Tlib227827  {
  Tlistentry143022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj178009* name;
Tnode227809* path;
};
struct  Freecell30832  {
Freecell30832* next;
NI zerofield;
};
struct  Tinstantiation227831  {
Tsym227841* sym;
Ttypeseq227843* concretetypes;
TY227932* usedby;
NI compilesid;
};
struct Ttypeseq227843 {
  TGenericSeq Sup;
  Ttype227847* data[SEQ_DECL_SIZE];
};
struct Tsymseq227811 {
  TGenericSeq Sup;
  Tsym227841* data[SEQ_DECL_SIZE];
};
struct TY227944 {
  TGenericSeq Sup;
  Tinstantiation227831* data[SEQ_DECL_SIZE];
};
struct Tnodeseq227803 {
  TGenericSeq Sup;
  Tnode227809* data[SEQ_DECL_SIZE];
};
struct TY227932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, initstrtable_231007)(Tstrtable227813* x);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(Cell48946*, usrtocell_52646)(void* usr);
static N_INLINE(void, rtladdzct_54204)(Cell48946* c);
N_NOINLINE(void, addzct_52617)(Cellseq48962* s, Cell48946* c);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
static N_INLINE(Ttype227847*, skipintlit_276696)(Ttype227847* t);
N_NIMCALL(Ttype227847*, getsystype_276190)(NU8 kind);
N_NIMCALL(Ttype227847*, systypefromname_276179)(NimStringDesc* name);
N_NIMCALL(Tsym227841*, getsyssym_276077)(NimStringDesc* name);
N_NIMCALL(Tsym227841*, strtableget_235111)(Tstrtable227813 t, Tident200021* name);
N_NIMCALL(Tident200021*, getident_200463)(NimStringDesc* identifier);
N_NIMCALL(void, rawmessage_196636)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(Tsym227841*, newsym_228656)(NU8 symkind, Tident200021* name, Tsym227841* owner, Tlineinfo192352 info);
N_NIMCALL(Ttype227847*, newtype_230140)(NU8 kind, Tsym227841* owner);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(void, loadstub_273053)(Tsym227841* s);
N_NIMCALL(Ttype227847*, newsystype_276066)(NU8 kind, NI size);
N_NIMCALL(void, internalerror_198191)(NimStringDesc* errmsg);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NimStringDesc*, reprEnum)(NI e_88659, TNimType* typ);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(TGenericSeq*, incrSeqV2)(TGenericSeq* seq, NI elemsize);
N_NIMCALL(void, propagatetoowner_231274)(Ttype227847* owner, Ttype227847* elem);
N_NIMCALL(Tsym227841*, initidentiter_235147)(Tidentiter235141* ti, Tstrtable227813 tab, Tident200021* s);
N_NIMCALL(Tsym227841*, nextidentiter_235156)(Tidentiter235141* ti, Tstrtable227813 tab);
N_NIMCALL(void, strtableadd_235103)(Tstrtable227813* t, Tsym227841* n);
N_NIMCALL(void, localerror_198139)(Tlineinfo192352 info, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, HEX24_193879)(Tlineinfo192352 info);
N_NIMCALL(Ttype227847*, copytype_230542)(Ttype227847* t, Tsym227841* owner, NIM_BOOL keepid);
N_NIMCALL(Ttype227847*, getintlittype_276660)(Tnode227809* literal);
N_NIMCALL(void, internalerror_198172)(Tlineinfo192352 info, NimStringDesc* errmsg);
STRING_LITERAL(TMP1097, "int", 3);
STRING_LITERAL(TMP1098, "int8", 4);
STRING_LITERAL(TMP1099, "int16", 5);
STRING_LITERAL(TMP1100, "int32", 5);
STRING_LITERAL(TMP1101, "int64", 5);
STRING_LITERAL(TMP1102, "uint", 4);
STRING_LITERAL(TMP1103, "uint8", 5);
STRING_LITERAL(TMP1104, "uint16", 6);
STRING_LITERAL(TMP1105, "uint32", 6);
STRING_LITERAL(TMP1106, "uint64", 6);
STRING_LITERAL(TMP1107, "float", 5);
STRING_LITERAL(TMP1108, "float32", 7);
STRING_LITERAL(TMP1109, "float64", 7);
STRING_LITERAL(TMP1110, "float128", 8);
STRING_LITERAL(TMP1111, "bool", 4);
STRING_LITERAL(TMP1112, "char", 4);
STRING_LITERAL(TMP1113, "string", 6);
STRING_LITERAL(TMP1114, "cstring", 7);
STRING_LITERAL(TMP1115, "pointer", 7);
STRING_LITERAL(TMP1116, "request for typekind: ", 22);
STRING_LITERAL(TMP1118, "wanted: ", 8);
STRING_LITERAL(TMP1119, " got: ", 6);
STRING_LITERAL(TMP1120, "type not found: ", 16);
STRING_LITERAL(TMP3236, "symbol conflicts with other .exportNims symbol at: ", 51);
STRING_LITERAL(TMP3544, "invalid int size", 16);
Tsym227841* systemmodule_276019;
TY276026 gsystypes_276027;
Tstrtable227813 compilerprocs_276028;
Tstrtable227813 exposed_276029;
TY276262 inttypecache_276263;
extern TNimType NTI227843; /* TTypeSeq */
extern Gcheap51018 gch_51059;
extern NI ptrsize_176653;
extern TNimType NTI227262; /* TTypeKind */
extern Tstrtable227813 rodcompilerprocs_270089;
extern NI intsize_176651;

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

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

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

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

N_NIMCALL(Tsym227841*, getsyssym_276077)(NimStringDesc* name) {
	Tsym227841* result;
	Tident200021* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = getident_200463(name);
	result = strtableget_235111((*systemmodule_276019).kindU.S3.tab, LOC1);
	{
		Tident200021* LOC6;
		if (!(result == NIM_NIL)) goto LA4;
		rawmessage_196636(((NU16) 68), name);
		LOC6 = 0;
		LOC6 = getident_200463(name);
		result = newsym_228656(((NU8) 0), LOC6, systemmodule_276019, (*systemmodule_276019).info);
		asgnRefNoCycle((void**) (&(*result).typ), newtype_230140(((NU8) 50), systemmodule_276019));
	}
	LA4: ;
	{
		if (!((*result).kind == ((NU8) 23))) goto LA9;
		loadstub_273053(result);
	}
	LA9: ;
	{
		if (!((*result).kind == ((NU8) 25))) goto LA13;
		result = (*result).owner;
	}
	LA13: ;
	return result;
}

N_NIMCALL(Ttype227847*, systypefromname_276179)(NimStringDesc* name) {
	Ttype227847* result;
	Tsym227841* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = getsyssym_276077(name);
	result = (*LOC1).typ;
	return result;
}

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

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

N_NIMCALL(void, addsonskipintlit_276729)(Ttype227847* father, Ttype227847* son) {
	Ttype227847* s;
	{
		if (!(*father).sons == 0) goto LA3;
		if ((*father).sons) nimGCunrefNoCycle((*father).sons);
		(*father).sons = (Ttypeseq227843*) newSeqRC1((&NTI227843), 0);
	}
	LA3: ;
	s = skipintlit_276696(son);
	(*father).sons = (Ttypeseq227843*) incrSeqV2(&((*father).sons)->Sup, sizeof(Ttype227847*));
	asgnRefNoCycle((void**) (&(*father).sons->data[(*father).sons->Sup.len]), s);
	++(*father).sons->Sup.len;
	propagatetoowner_231274(father, s);
}

N_NIMCALL(Tsym227841*, getsysmagic_276121)(NimStringDesc* name, NU8 m) {
	Tsym227841* result;
	Tidentiter235141 ti;
	Tident200021* id;
{	result = 0;
	memset((void*)(&ti), 0, sizeof(ti));
	id = getident_200463(name);
	result = initidentiter_235147((&ti), (*systemmodule_276019).kindU.S3.tab, id);
	{
		while (1) {
			if (!!((result == NIM_NIL))) goto LA2;
			{
				if (!((*result).kind == ((NU8) 23))) goto LA5;
				loadstub_273053(result);
			}
			LA5: ;
			{
				if (!((*result).magic == m)) goto LA9;
				goto BeforeRet;
			}
			LA9: ;
			result = nextidentiter_235156((&ti), (*systemmodule_276019).kindU.S3.tab);
		} LA2: ;
	}
	rawmessage_196636(((NU16) 68), name);
	result = newsym_228656(((NU8) 0), id, systemmodule_276019, (*systemmodule_276019).info);
	asgnRefNoCycle((void**) (&(*result).typ), newtype_230140(((NU8) 50), systemmodule_276019));
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tsym227841*, getcompilerproc_276809)(NimStringDesc* name) {
	Tsym227841* result;
	Tident200021* ident;
	result = 0;
	ident = getident_200463(name);
	result = strtableget_235111(compilerprocs_276028, ident);
	{
		if (!(result == NIM_NIL)) goto LA3;
		result = strtableget_235111(rodcompilerprocs_270089, ident);
		{
			if (!!((result == NIM_NIL))) goto LA7;
			strtableadd_235103((&compilerprocs_276028), result);
			{
				if (!((*result).kind == ((NU8) 23))) goto LA11;
				loadstub_273053(result);
			}
			LA11: ;
			{
				if (!((*result).kind == ((NU8) 25))) goto LA15;
				result = (*result).owner;
			}
			LA15: ;
		}
		LA7: ;
	}
	LA3: ;
	return result;
}

N_NIMCALL(void, registercompilerproc_276864)(Tsym227841* s) {
	strtableadd_235103((&compilerprocs_276028), s);
}

N_NIMCALL(void, registernimscriptsymbol_276874)(Tsym227841* s) {
	Tsym227841* conflict;
	conflict = strtableget_235111(exposed_276029, (*s).name);
	{
		if (!(conflict == NIM_NIL)) goto LA3;
		strtableadd_235103((&exposed_276029), s);
	}
	goto LA1;
	LA3: ;
	{
		NimStringDesc* LOC6;
		NimStringDesc* LOC7;
		LOC6 = 0;
		LOC7 = 0;
		LOC7 = HEX24_193879((*conflict).info);
		LOC6 = rawNewString(LOC7->Sup.len + 51);
appendString(LOC6, ((NimStringDesc*) &TMP3236));
appendString(LOC6, LOC7);
		localerror_198139((*s).info, LOC6);
	}
	LA1: ;
}

N_NIMCALL(Ttype227847*, getintlittype_276660)(Tnode227809* literal) {
	Ttype227847* 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_276263[(((NI) (value)))- -5];
		{
			Ttype227847* ti;
			if (!(result == NIM_NIL)) goto LA9;
			ti = getsystype_276190(((NU8) 31));
			result = copytype_230542(ti, (*ti).owner, NIM_FALSE);
			asgnRefNoCycle((void**) (&(*result).n), literal);
			asgnRefNoCycle((void**) (&inttypecache_276263[(((NI) (value)))- -5]), result);
		}
		LA9: ;
	}
	goto LA1;
	LA5: ;
	{
		Ttype227847* ti;
		ti = getsystype_276190(((NU8) 31));
		result = copytype_230542(ti, (*ti).owner, NIM_FALSE);
		asgnRefNoCycle((void**) (&(*result).n), literal);
	}
	LA1: ;
	return result;
}

N_NIMCALL(Ttype227847*, getfloatlittype_276686)(Tnode227809* literal) {
	Ttype227847* result;
	result = 0;
	result = newsystype_276066(((NU8) 36), ((NI) 8));
	asgnRefNoCycle((void**) (&(*result).n), literal);
	return result;
}

N_NIMCALL(Ttype227847*, nilorsysint_276036)(void) {
	Ttype227847* result;
	result = 0;
	result = gsystypes_276027[(((NU8) 31))- 0];
	return result;
}

N_NIMCALL(void, setintlittype_276774)(Tnode227809* result) {
	NI64 i;
	i = (*result).kindU.S1.intval;
	switch (intsize_176651) {
	case ((NI) 8):
	{
		asgnRefNoCycle((void**) (&(*result).typ), getintlittype_276660(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_276660(result));
		}
		goto LA3;
		LA7: ;
		{
			asgnRefNoCycle((void**) (&(*result).typ), getsystype_276190(((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_276660(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_276190(((NU8) 34)));
		}
		goto LA11;
		LA20: ;
		{
			asgnRefNoCycle((void**) (&(*result).typ), getsystype_276190(((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_276660(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_276190(((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_276190(((NU8) 34)));
		}
		goto LA24;
		LA38: ;
		{
			asgnRefNoCycle((void**) (&(*result).typ), getsystype_276190(((NU8) 35)));
		}
		LA24: ;
	}
	break;
	default:
	{
		internalerror_198172((*result).info, ((NimStringDesc*) &TMP3544));
	}
	break;
	}
}

N_NIMCALL(void, resetsystypes_276268)(void) {
	asgnRefNoCycle((void**) (&systemmodule_276019), NIM_NIL);
	initstrtable_231007((&compilerprocs_276028));
	initstrtable_231007((&exposed_276029));
	{
		NU8 i_276423;
		NI res_276627;
		i_276423 = 0;
		res_276627 = ((NI) 0);
		{
			while (1) {
				if (!(res_276627 <= ((NI) 61))) goto LA3;
				i_276423 = ((NU8) (res_276627));
				asgnRefNoCycle((void**) (&gsystypes_276027[(i_276423)- 0]), NIM_NIL);
				res_276627 += ((NI) 1);
			} LA3: ;
		}
	}
	{
		NI i_276623;
		NI res_276633;
		i_276623 = 0;
		res_276633 = ((NI) -5);
		{
			while (1) {
				if (!(res_276633 <= ((NI) 64))) goto LA6;
				i_276623 = ((NI) (res_276633));
				asgnRefNoCycle((void**) (&inttypecache_276263[(i_276623)- -5]), NIM_NIL);
				res_276633 += ((NI) 1);
			} LA6: ;
		}
	}
}
NIM_EXTERNC N_NOINLINE(void, compiler_magicsysInit000)(void) {
	initstrtable_231007((&compilerprocs_276028));
	initstrtable_231007((&exposed_276029));
}

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

