/* 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 Tsym224841 Tsym224841;
typedef struct Ttype224847 Ttype224847;
typedef struct Tstrtable224813 Tstrtable224813;
typedef struct Tsymseq224811 Tsymseq224811;
typedef struct Tidobj197015 Tidobj197015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttypeseq224843 Ttypeseq224843;
typedef struct Tnode224809 Tnode224809;
typedef struct Tloc224823 Tloc224823;
typedef struct Ropeobj175009 Ropeobj175009;
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 Tident197021 Tident197021;
typedef struct Tscope224835 Tscope224835;
typedef struct TY224944 TY224944;
typedef struct Tlineinfo189352 Tlineinfo189352;
typedef struct Tlib224827 Tlib224827;
typedef struct Tidentiter232141 Tidentiter232141;
typedef struct Tnodeseq224803 Tnodeseq224803;
typedef struct Basechunk30840 Basechunk30840;
typedef struct Freecell30832 Freecell30832;
typedef struct Tinstantiation224831 Tinstantiation224831;
typedef struct Tlistentry140022 Tlistentry140022;
typedef struct TY224932 TY224932;
typedef Ttype224847* TY273026[62];
struct  Tstrtable224813  {
NI counter;
Tsymseq224811* data;
};
typedef Ttype224847* TY273262[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  Tidobj197015  {
  TNimObject Sup;
NI id;
};
struct  Tloc224823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype224847* t;
Ropeobj175009* r;
Ropeobj175009* heaproot;
};
struct  Ttype224847  {
  Tidobj197015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq224843* sons;
Tnode224809* n;
Tsym224841* owner;
Tsym224841* sym;
Tsym224841* destructor;
Tsym224841* deepcopy;
Tsym224841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc224823 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  Tlineinfo189352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tsym224841  {
  Tidobj197015 Sup;
NU8 kind;
union{
struct {Ttypeseq224843* typeinstcache;
Tscope224835* typscope;
} S1;
struct {TY224944* procinstcache;
Tsym224841* gcunsafetyreason;
} S2;
struct {TY224944* usedgenerics;
Tstrtable224813 tab;
} S3;
struct {Tsym224841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype224847* typ;
Tident197021* name;
Tlineinfo189352 info;
Tsym224841* owner;
NU32 flags;
Tnode224809* ast;
NU32 options;
NI position;
NI offset;
Tloc224823 loc;
Tlib224827* annex;
Tnode224809* constraint;
};
struct  Tidentiter232141  {
NI h;
Tident197021* name;
};
struct  Tnode224809  {
Ttype224847* typ;
Tlineinfo189352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym224841* sym;
} S4;
struct {Tident197021* ident;
} S5;
struct {Tnodeseq224803* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Ropeobj175009  {
  TNimObject Sup;
Ropeobj175009* left;
Ropeobj175009* 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  Tident197021  {
  Tidobj197015 Sup;
NimStringDesc* s;
Tident197021* next;
NI h;
};
struct  Tscope224835  {
NI depthlevel;
Tstrtable224813 symbols;
Tnodeseq224803* usingsyms;
Tscope224835* parent;
};
struct  Tlistentry140022  {
  TNimObject Sup;
Tlistentry140022* prev;
Tlistentry140022* next;
};
struct  Tlib224827  {
  Tlistentry140022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj175009* name;
Tnode224809* path;
};
struct  Freecell30832  {
Freecell30832* next;
NI zerofield;
};
struct  Tinstantiation224831  {
Tsym224841* sym;
Ttypeseq224843* concretetypes;
TY224932* usedby;
NI compilesid;
};
struct Ttypeseq224843 {
  TGenericSeq Sup;
  Ttype224847* data[SEQ_DECL_SIZE];
};
struct Tsymseq224811 {
  TGenericSeq Sup;
  Tsym224841* data[SEQ_DECL_SIZE];
};
struct TY224944 {
  TGenericSeq Sup;
  Tinstantiation224831* data[SEQ_DECL_SIZE];
};
struct Tnodeseq224803 {
  TGenericSeq Sup;
  Tnode224809* data[SEQ_DECL_SIZE];
};
struct TY224932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, initstrtable_228007)(Tstrtable224813* 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(Ttype224847*, skipintlit_273696)(Ttype224847* t);
N_NIMCALL(Ttype224847*, getsystype_273190)(NU8 kind);
N_NIMCALL(Ttype224847*, systypefromname_273179)(NimStringDesc* name);
N_NIMCALL(Tsym224841*, getsyssym_273077)(NimStringDesc* name);
N_NIMCALL(Tsym224841*, strtableget_232111)(Tstrtable224813 t, Tident197021* name);
N_NIMCALL(Tident197021*, getident_197463)(NimStringDesc* identifier);
N_NIMCALL(void, rawmessage_193636)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(Tsym224841*, newsym_225656)(NU8 symkind, Tident197021* name, Tsym224841* owner, Tlineinfo189352 info);
N_NIMCALL(Ttype224847*, newtype_227140)(NU8 kind, Tsym224841* owner);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(void, loadstub_270053)(Tsym224841* s);
N_NIMCALL(Ttype224847*, newsystype_273066)(NU8 kind, NI size);
N_NIMCALL(void, internalerror_195191)(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_228274)(Ttype224847* owner, Ttype224847* elem);
N_NIMCALL(Tsym224841*, initidentiter_232147)(Tidentiter232141* ti, Tstrtable224813 tab, Tident197021* s);
N_NIMCALL(Tsym224841*, nextidentiter_232156)(Tidentiter232141* ti, Tstrtable224813 tab);
N_NIMCALL(void, strtableadd_232103)(Tstrtable224813* t, Tsym224841* n);
N_NIMCALL(void, localerror_195139)(Tlineinfo189352 info, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, HEX24_190879)(Tlineinfo189352 info);
N_NIMCALL(Ttype224847*, copytype_227542)(Ttype224847* t, Tsym224841* owner, NIM_BOOL keepid);
N_NIMCALL(Ttype224847*, getintlittype_273660)(Tnode224809* literal);
N_NIMCALL(void, internalerror_195172)(Tlineinfo189352 info, NimStringDesc* errmsg);
STRING_LITERAL(TMP1089, "int", 3);
STRING_LITERAL(TMP1090, "int8", 4);
STRING_LITERAL(TMP1091, "int16", 5);
STRING_LITERAL(TMP1092, "int32", 5);
STRING_LITERAL(TMP1093, "int64", 5);
STRING_LITERAL(TMP1094, "uint", 4);
STRING_LITERAL(TMP1095, "uint8", 5);
STRING_LITERAL(TMP1096, "uint16", 6);
STRING_LITERAL(TMP1097, "uint32", 6);
STRING_LITERAL(TMP1098, "uint64", 6);
STRING_LITERAL(TMP1099, "float", 5);
STRING_LITERAL(TMP1100, "float32", 7);
STRING_LITERAL(TMP1101, "float64", 7);
STRING_LITERAL(TMP1102, "float128", 8);
STRING_LITERAL(TMP1103, "bool", 4);
STRING_LITERAL(TMP1104, "char", 4);
STRING_LITERAL(TMP1105, "string", 6);
STRING_LITERAL(TMP1106, "cstring", 7);
STRING_LITERAL(TMP1107, "pointer", 7);
STRING_LITERAL(TMP1108, "request for typekind: ", 22);
STRING_LITERAL(TMP1110, "wanted: ", 8);
STRING_LITERAL(TMP1111, " got: ", 6);
STRING_LITERAL(TMP1112, "type not found: ", 16);
STRING_LITERAL(TMP3234, "symbol conflicts with other .exportNims symbol at: ", 51);
STRING_LITERAL(TMP3542, "invalid int size", 16);
Tsym224841* systemmodule_273019;
TY273026 gsystypes_273027;
Tstrtable224813 compilerprocs_273028;
Tstrtable224813 exposed_273029;
TY273262 inttypecache_273263;
extern TNimType NTI224843; /* TTypeSeq */
extern Gcheap51018 gch_51059;
extern NI ptrsize_173653;
extern TNimType NTI224262; /* TTypeKind */
extern Tstrtable224813 rodcompilerprocs_267089;
extern NI intsize_173651;

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(Tsym224841*, getsyssym_273077)(NimStringDesc* name) {
	Tsym224841* result;
	Tident197021* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = getident_197463(name);
	result = strtableget_232111((*systemmodule_273019).kindU.S3.tab, LOC1);
	{
		Tident197021* LOC6;
		if (!(result == NIM_NIL)) goto LA4;
		rawmessage_193636(((NU16) 68), name);
		LOC6 = 0;
		LOC6 = getident_197463(name);
		result = newsym_225656(((NU8) 0), LOC6, systemmodule_273019, (*systemmodule_273019).info);
		asgnRefNoCycle((void**) (&(*result).typ), newtype_227140(((NU8) 50), systemmodule_273019));
	}
	LA4: ;
	{
		if (!((*result).kind == ((NU8) 23))) goto LA9;
		loadstub_270053(result);
	}
	LA9: ;
	{
		if (!((*result).kind == ((NU8) 25))) goto LA13;
		result = (*result).owner;
	}
	LA13: ;
	return result;
}

N_NIMCALL(Ttype224847*, systypefromname_273179)(NimStringDesc* name) {
	Ttype224847* result;
	Tsym224841* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = getsyssym_273077(name);
	result = (*LOC1).typ;
	return result;
}

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

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

N_NIMCALL(void, addsonskipintlit_273729)(Ttype224847* father, Ttype224847* son) {
	Ttype224847* s;
	{
		if (!(*father).sons == 0) goto LA3;
		if ((*father).sons) nimGCunrefNoCycle((*father).sons);
		(*father).sons = (Ttypeseq224843*) newSeqRC1((&NTI224843), 0);
	}
	LA3: ;
	s = skipintlit_273696(son);
	(*father).sons = (Ttypeseq224843*) incrSeqV2(&((*father).sons)->Sup, sizeof(Ttype224847*));
	asgnRefNoCycle((void**) (&(*father).sons->data[(*father).sons->Sup.len]), s);
	++(*father).sons->Sup.len;
	propagatetoowner_228274(father, s);
}

N_NIMCALL(Tsym224841*, getsysmagic_273121)(NimStringDesc* name, NU8 m) {
	Tsym224841* result;
	Tidentiter232141 ti;
	Tident197021* id;
{	result = 0;
	memset((void*)(&ti), 0, sizeof(ti));
	id = getident_197463(name);
	result = initidentiter_232147((&ti), (*systemmodule_273019).kindU.S3.tab, id);
	{
		while (1) {
			if (!!((result == NIM_NIL))) goto LA2;
			{
				if (!((*result).kind == ((NU8) 23))) goto LA5;
				loadstub_270053(result);
			}
			LA5: ;
			{
				if (!((*result).magic == m)) goto LA9;
				goto BeforeRet;
			}
			LA9: ;
			result = nextidentiter_232156((&ti), (*systemmodule_273019).kindU.S3.tab);
		} LA2: ;
	}
	rawmessage_193636(((NU16) 68), name);
	result = newsym_225656(((NU8) 0), id, systemmodule_273019, (*systemmodule_273019).info);
	asgnRefNoCycle((void**) (&(*result).typ), newtype_227140(((NU8) 50), systemmodule_273019));
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tsym224841*, getcompilerproc_273809)(NimStringDesc* name) {
	Tsym224841* result;
	Tident197021* ident;
	result = 0;
	ident = getident_197463(name);
	result = strtableget_232111(compilerprocs_273028, ident);
	{
		if (!(result == NIM_NIL)) goto LA3;
		result = strtableget_232111(rodcompilerprocs_267089, ident);
		{
			if (!!((result == NIM_NIL))) goto LA7;
			strtableadd_232103((&compilerprocs_273028), result);
			{
				if (!((*result).kind == ((NU8) 23))) goto LA11;
				loadstub_270053(result);
			}
			LA11: ;
			{
				if (!((*result).kind == ((NU8) 25))) goto LA15;
				result = (*result).owner;
			}
			LA15: ;
		}
		LA7: ;
	}
	LA3: ;
	return result;
}

N_NIMCALL(void, registercompilerproc_273864)(Tsym224841* s) {
	strtableadd_232103((&compilerprocs_273028), s);
}

N_NIMCALL(void, registernimscriptsymbol_273874)(Tsym224841* s) {
	Tsym224841* conflict;
	conflict = strtableget_232111(exposed_273029, (*s).name);
	{
		if (!(conflict == NIM_NIL)) goto LA3;
		strtableadd_232103((&exposed_273029), s);
	}
	goto LA1;
	LA3: ;
	{
		NimStringDesc* LOC6;
		NimStringDesc* LOC7;
		LOC6 = 0;
		LOC7 = 0;
		LOC7 = HEX24_190879((*conflict).info);
		LOC6 = rawNewString(LOC7->Sup.len + 51);
appendString(LOC6, ((NimStringDesc*) &TMP3234));
appendString(LOC6, LOC7);
		localerror_195139((*s).info, LOC6);
	}
	LA1: ;
}

N_NIMCALL(Ttype224847*, getintlittype_273660)(Tnode224809* literal) {
	Ttype224847* 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_273263[(((NI) (value)))- -5];
		{
			Ttype224847* ti;
			if (!(result == NIM_NIL)) goto LA9;
			ti = getsystype_273190(((NU8) 31));
			result = copytype_227542(ti, (*ti).owner, NIM_FALSE);
			asgnRefNoCycle((void**) (&(*result).n), literal);
			asgnRefNoCycle((void**) (&inttypecache_273263[(((NI) (value)))- -5]), result);
		}
		LA9: ;
	}
	goto LA1;
	LA5: ;
	{
		Ttype224847* ti;
		ti = getsystype_273190(((NU8) 31));
		result = copytype_227542(ti, (*ti).owner, NIM_FALSE);
		asgnRefNoCycle((void**) (&(*result).n), literal);
	}
	LA1: ;
	return result;
}

N_NIMCALL(Ttype224847*, getfloatlittype_273686)(Tnode224809* literal) {
	Ttype224847* result;
	result = 0;
	result = newsystype_273066(((NU8) 36), ((NI) 8));
	asgnRefNoCycle((void**) (&(*result).n), literal);
	return result;
}

N_NIMCALL(Ttype224847*, nilorsysint_273036)(void) {
	Ttype224847* result;
	result = 0;
	result = gsystypes_273027[(((NU8) 31))- 0];
	return result;
}

N_NIMCALL(void, setintlittype_273774)(Tnode224809* result) {
	NI64 i;
	i = (*result).kindU.S1.intval;
	switch (intsize_173651) {
	case ((NI) 8):
	{
		asgnRefNoCycle((void**) (&(*result).typ), getintlittype_273660(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_273660(result));
		}
		goto LA3;
		LA7: ;
		{
			asgnRefNoCycle((void**) (&(*result).typ), getsystype_273190(((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_273660(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_273190(((NU8) 34)));
		}
		goto LA11;
		LA20: ;
		{
			asgnRefNoCycle((void**) (&(*result).typ), getsystype_273190(((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_273660(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_273190(((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_273190(((NU8) 34)));
		}
		goto LA24;
		LA38: ;
		{
			asgnRefNoCycle((void**) (&(*result).typ), getsystype_273190(((NU8) 35)));
		}
		LA24: ;
	}
	break;
	default:
	{
		internalerror_195172((*result).info, ((NimStringDesc*) &TMP3542));
	}
	break;
	}
}

N_NIMCALL(void, resetsystypes_273268)(void) {
	asgnRefNoCycle((void**) (&systemmodule_273019), NIM_NIL);
	initstrtable_228007((&compilerprocs_273028));
	initstrtable_228007((&exposed_273029));
	{
		NU8 i_273423;
		NI res_273627;
		i_273423 = 0;
		res_273627 = ((NI) 0);
		{
			while (1) {
				if (!(res_273627 <= ((NI) 61))) goto LA3;
				i_273423 = ((NU8) (res_273627));
				asgnRefNoCycle((void**) (&gsystypes_273027[(i_273423)- 0]), NIM_NIL);
				res_273627 += ((NI) 1);
			} LA3: ;
		}
	}
	{
		NI i_273623;
		NI res_273633;
		i_273623 = 0;
		res_273633 = ((NI) -5);
		{
			while (1) {
				if (!(res_273633 <= ((NI) 64))) goto LA6;
				i_273623 = ((NI) (res_273633));
				asgnRefNoCycle((void**) (&inttypecache_273263[(i_273623)- -5]), NIM_NIL);
				res_273633 += ((NI) 1);
			} LA6: ;
		}
	}
}
NIM_EXTERNC N_NOINLINE(void, compiler_magicsysInit000)(void) {
	initstrtable_228007((&compilerprocs_273028));
	initstrtable_228007((&exposed_273029));
}

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

