/* Generated by Nimrod Compiler v0.9.5 */
/*   (c) 2014 Andreas Rumpf */
/* The generated code is subject to the original license. */
/* Compiled for: Linux, i386, gcc */
/* Command for C compiler:
   gcc -c  -w -O3 -fno-strict-aliasing  -I/build/nimrod/src/nimrod/lib -o compiler/nimcache/lowerings.o compiler/nimcache/lowerings.c */
#define NIM_INTBITS 32
#include "nimbase.h"

#include <string.h>
typedef struct tnode188803 tnode188803;
typedef struct tsym188833 tsym188833;
typedef struct ttype188837 ttype188837;
typedef struct tlineinfo163527 tlineinfo163527;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tident167019 tident167019;
typedef struct tnodeseq188797 tnodeseq188797;
typedef struct tidobj167013 tidobj167013;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct ttypeseq188835 ttypeseq188835;
typedef struct tscope188827 tscope188827;
typedef struct TY188933 TY188933;
typedef struct tinstantiation188823 tinstantiation188823;
typedef struct tstrtable188807 tstrtable188807;
typedef struct tsymseq188805 tsymseq188805;
typedef struct tloc188817 tloc188817;
typedef struct trope145007 trope145007;
typedef struct tlib188821 tlib188821;
typedef struct tcell41090 tcell41090;
typedef struct tcellseq41106 tcellseq41106;
typedef struct tgcheap43016 tgcheap43016;
typedef struct tcellset41102 tcellset41102;
typedef struct tpagedesc41098 tpagedesc41098;
typedef struct tmemregion23410 tmemregion23410;
typedef struct tsmallchunk22638 tsmallchunk22638;
typedef struct tllchunk23404 tllchunk23404;
typedef struct tbigchunk22640 tbigchunk22640;
typedef struct tintset22615 tintset22615;
typedef struct ttrunk22611 ttrunk22611;
typedef struct tavlnode23408 tavlnode23408;
typedef struct tgcstat43014 tgcstat43014;
typedef struct TY188922 TY188922;
typedef struct tlistentry118017 tlistentry118017;
typedef struct tbasechunk22636 tbasechunk22636;
typedef struct tfreecell22628 tfreecell22628;
struct  tlineinfo163527  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  tnode188803  {
ttype188837* Typ;
tlineinfo163527 Info;
NU16 Flags;
NU8 Kind;
union {
struct {NI64 Intval;
} S1;
struct {NF Floatval;
} S2;
struct {NimStringDesc* Strval;
} S3;
struct {tsym188833* Sym;
} S4;
struct {tident167019* Ident;
} S5;
struct {tnodeseq188797* Sons;
} S6;
} kindU;
NimStringDesc* Comment;
};
typedef N_NIMCALL_PTR(void, TY2289) (void* p, NI op);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY2289 marker;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  tidobj167013  {
  TNimObject Sup;
NI Id;
};
struct  tstrtable188807  {
NI Counter;
tsymseq188805* Data;
};
struct  tloc188817  {
NU8 K;
NU8 S;
NU8 Flags;
ttype188837* T;
trope145007* R;
trope145007* Heaproot;
NI A;
};
struct  tsym188833  {
  tidobj167013 Sup;
NU8 Kind;
union {
struct {ttypeseq188835* Typeinstcache;
tscope188827* Typscope;
} S1;
struct {TY188933* Procinstcache;
tscope188827* Scope;
} S2;
struct {TY188933* Usedgenerics;
tstrtable188807 Tab;
} S3;
} kindU;
NU16 Magic;
ttype188837* Typ;
tident167019* Name;
tlineinfo163527 Info;
tsym188833* Owner;
NU32 Flags;
tnode188803* Ast;
NU32 Options;
NI Position;
NI Offset;
tloc188817 Loc;
tlib188821* Annex;
tnode188803* Constraint;
};
struct  tcell41090  {
NI Refcount;
TNimType* Typ;
};
struct  tcellseq41106  {
NI Len;
NI Cap;
tcell41090** D;
};
struct  tcellset41102  {
NI Counter;
NI Max;
tpagedesc41098* Head;
tpagedesc41098** Data;
};
typedef tsmallchunk22638* TY23422[512];
typedef ttrunk22611* ttrunkbuckets22613[256];
struct  tintset22615  {
ttrunkbuckets22613 Data;
};
struct  tmemregion23410  {
NI Minlargeobj;
NI Maxlargeobj;
TY23422 Freesmallchunks;
tllchunk23404* Llmem;
NI Currmem;
NI Maxmem;
NI Freemem;
NI Lastsize;
tbigchunk22640* Freechunkslist;
tintset22615 Chunkstarts;
tavlnode23408* Root;
tavlnode23408* Deleted;
tavlnode23408* Last;
tavlnode23408* Freeavlnodes;
};
struct  tgcstat43014  {
NI Stackscans;
NI Cyclecollections;
NI Maxthreshold;
NI Maxstacksize;
NI Maxstackcells;
NI Cycletablesize;
NI64 Maxpause;
};
struct  tgcheap43016  {
void* Stackbottom;
NI Cyclethreshold;
tcellseq41106 Zct;
tcellseq41106 Decstack;
tcellset41102 Cycleroots;
tcellseq41106 Tempstack;
NI Recgclock;
tmemregion23410 Region;
tgcstat43014 Stat;
};
struct  ttype188837  {
  tidobj167013 Sup;
NU8 Kind;
NU8 Callconv;
NU32 Flags;
ttypeseq188835* Sons;
tnode188803* N;
tsym188833* Destructor;
tsym188833* Owner;
tsym188833* Sym;
NI64 Size;
NI Align;
tloc188817 Loc;
};
struct  tident167019  {
  tidobj167013 Sup;
NimStringDesc* S;
tident167019* Next;
NI H;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  tscope188827  {
NI Depthlevel;
tstrtable188807 Symbols;
tnodeseq188797* Usingsyms;
tscope188827* Parent;
};
struct  tinstantiation188823  {
tsym188833* Sym;
ttypeseq188835* Concretetypes;
TY188922* Usedby;
};
struct  trope145007  {
  TNimObject Sup;
trope145007* Left;
trope145007* Right;
NI Length;
NimStringDesc* Data;
};
struct  tlistentry118017  {
  TNimObject Sup;
tlistentry118017* Prev;
tlistentry118017* Next;
};
struct  tlib188821  {
  tlistentry118017 Sup;
NU8 Kind;
NIM_BOOL Generated;
NIM_BOOL Isoverriden;
trope145007* Name;
tnode188803* Path;
};
typedef NI TY22618[16];
struct  tpagedesc41098  {
tpagedesc41098* Next;
NI Key;
TY22618 Bits;
};
struct  tbasechunk22636  {
NI Prevsize;
NI Size;
NIM_BOOL Used;
};
struct  tsmallchunk22638  {
  tbasechunk22636 Sup;
tsmallchunk22638* Next;
tsmallchunk22638* Prev;
tfreecell22628* Freelist;
NI Free;
NI Acc;
NF Data;
};
struct  tllchunk23404  {
NI Size;
NI Acc;
tllchunk23404* Next;
};
struct  tbigchunk22640  {
  tbasechunk22636 Sup;
tbigchunk22640* Next;
tbigchunk22640* Prev;
NI Align;
NF Data;
};
struct  ttrunk22611  {
ttrunk22611* Next;
NI Key;
TY22618 Bits;
};
typedef tavlnode23408* TY23414[2];
struct  tavlnode23408  {
TY23414 Link;
NI Key;
NI Upperbound;
NI Level;
};
struct  tfreecell22628  {
tfreecell22628* Next;
NI Zerofield;
};
struct tnodeseq188797 {
  TGenericSeq Sup;
  tnode188803* data[SEQ_DECL_SIZE];
};
struct ttypeseq188835 {
  TGenericSeq Sup;
  ttype188837* data[SEQ_DECL_SIZE];
};
struct TY188933 {
  TGenericSeq Sup;
  tinstantiation188823* data[SEQ_DECL_SIZE];
};
struct tsymseq188805 {
  TGenericSeq Sup;
  tsym188833* data[SEQ_DECL_SIZE];
};
struct TY188922 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
static N_INLINE(tnode188803*, lastson_189189)(tnode188803* n);
static N_INLINE(NI, sonslen_189181)(tnode188803* n);
N_NIMCALL(tnode188803*, newnodei_189099)(NU8 kind, tlineinfo163527 info);
N_NIMCALL(tsym188833*, newsym_189053)(NU8 symkind, tident167019* name, tsym188833* owner, tlineinfo163527 info);
N_NIMCALL(tident167019*, getident_167456)(NimStringDesc* identifier);
N_NIMCALL(ttype188837*, skiptypes_192793)(ttype188837* t, NU64 kinds);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
static N_INLINE(tcell41090*, usrtocell_44443)(void* usr);
static N_INLINE(void, rtladdzct_46002)(tcell41090* c);
N_NOINLINE(void, addzct_44418)(tcellseq41106* s, tcell41090* c);
N_NIMCALL(void, addvar_366036)(tnode188803* father, tnode188803* v);
N_NIMCALL(tnode188803*, newnodei_190803)(NU8 kind, tlineinfo163527 info, NI children);
N_NIMCALL(void, addson_189207)(tnode188803* father, tnode188803* son);
N_NIMCALL(tnode188803*, newsymnode_189095)(tsym188833* sym);
N_NIMCALL(void, add_189390)(tnode188803* father, tnode188803* son);
N_NIMCALL(tnode188803*, newasgnstmt_366085)(tnode188803* le, tnode188803* ri);
static N_INLINE(NI, len_189264)(tnode188803* n);
N_NIMCALL(tnode188803*, newtupleaccess_366014)(tnode188803* tup, NI i);
N_NIMCALL(tnode188803*, newnodeit_189104)(NU8 kind, tlineinfo163527 info, ttype188837* typ);
N_NIMCALL(tnode188803*, copytree_189237)(tnode188803* src);
N_NIMCALL(ttype188837*, getsystype_242024)(NU8 kind);
N_NIMCALL(ttype188837*, newtype_189060)(NU8 kind, tsym188833* owner);
N_NIMCALL(void, rawaddson_193092)(ttype188837* father, ttype188837* son);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
static N_INLINE(ttype188837*, skipintlit_242424)(ttype188837* t);
N_NIMCALL(tsym188833*, getsymfromlist_197172)(tnode188803* list, tident167019* ident, NI start);
N_NIMCALL(tnode188803*, indirectaccess_366403)(tnode188803* a, tsym188833* b, tlineinfo163527 info);
static N_INLINE(NIM_BOOL, isemptytype_195210)(ttype188837* t);
N_NIMCALL(void, localerror_165578)(tlineinfo163527 info, NimStringDesc* arg);
static N_INLINE(tnode188803*, HEX5BHEX5D_189694)(tnode188803* n, NI i);
N_NIMCALL(ttype188837*, createobj_366252)(tsym188833* owner, tlineinfo163527 info);
N_NIMCALL(tnode188803*, createcastexpr_366929)(tsym188833* argsparam, ttype188837* objtype);
N_NIMCALL(void, addfield_366275)(ttype188837* obj, tsym188833* s);
N_NIMCALL(tnode188803*, newfastasgnstmt_366120)(tnode188803* le, tnode188803* ri);
N_NIMCALL(tnode188803*, newdotexpr_366283)(tsym188833* obj, tsym188833* b);
N_NIMCALL(NIM_BOOL, containstyref_224831)(ttype188837* typ);
N_NIMCALL(tsym188833*, createwrapperproc_366892)(tnode188803* f, tsym188833* threadparam, tsym188833* argsparam, tnode188803* varsection, tnode188803* call);
N_NIMCALL(tnode188803*, callcodegenproc_366831)(NimStringDesc* name, tnode188803* arg1, tnode188803* arg2, tnode188803* arg3);
N_NIMCALL(tsym188833*, getcompilerproc_242028)(NimStringDesc* name);
N_NIMCALL(void, localerror_165571)(tlineinfo163527 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(tnode188803*, newprocnode_191214)(NU8 kind, tlineinfo163527 info, tnode188803* body, tnode188803* params, tnode188803* name, tnode188803* pattern, tnode188803* genericparams, tnode188803* pragmas, tnode188803* exceptions);
N_NIMCALL(tnode188803*, genaddrof_366811)(tnode188803* n);
STRING_LITERAL(TMP2598, ":tmp", 4);
STRING_LITERAL(TMP3597, "\'spawn\' takes a call expression of type void", 44);
STRING_LITERAL(TMP3598, "\'spawn\' takes a GC safe call expression", 39);
STRING_LITERAL(TMP3599, "thread", 6);
STRING_LITERAL(TMP3600, "args", 4);
STRING_LITERAL(TMP3601, "scratch", 7);
STRING_LITERAL(TMP3602, "fn", 2);
STRING_LITERAL(TMP3603, "iterator in spawn environment is not allowed", 44);
STRING_LITERAL(TMP3604, "closure in spawn environment is not allowed", 43);
STRING_LITERAL(TMP3605, "\'spawn\'ed function cannot have a \'var\' parameter", 48);
STRING_LITERAL(TMP3606, "\'spawn\'ed function cannot refer to \'ref\'/closure", 48);
STRING_LITERAL(TMP3607, "nimArgsPassingDone", 18);
STRING_LITERAL(TMP3608, "Wrapper", 7);
STRING_LITERAL(TMP3609, "nimSpawn", 8);
extern tgcheap43016 gch_43044;
extern tnode188803* emptynode_189727;
extern NU32 gglobaloptions_137111;

static N_INLINE(NI, sonslen_189181)(tnode188803* n) {
	NI result;
	result = 0;
	{
		if (!(*n).kindU.S6.Sons == 0) goto LA3;
		result = 0;
	}
	goto LA1;
	LA3: ;
	{
		result = (*n).kindU.S6.Sons->Sup.len;
	}
	LA1: ;
	return result;
}

static N_INLINE(tnode188803*, lastson_189189)(tnode188803* n) {
	tnode188803* result;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = sonslen_189181(n);
	result = (*n).kindU.S6.Sons->data[(NI32)(LOC1 - 1)];
	return result;
}

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

static N_INLINE(void, rtladdzct_46002)(tcell41090* c) {
	addzct_44418(&gch_43044.Zct, c);
}

static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) {
	{
		tcell41090* c;
		if (!!((src == NIM_NIL))) goto LA3;
		c = usrtocell_44443(src);
		(*c).Refcount += 8;
	}
	LA3: ;
	{
		tcell41090* c;
		if (!!(((*dest) == NIM_NIL))) goto LA7;
		c = usrtocell_44443((*dest));
		{
			(*c).Refcount -= 8;
			if (!((NU32)((*c).Refcount) < (NU32)(8))) goto LA11;
			rtladdzct_46002(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

N_NIMCALL(void, addvar_366036)(tnode188803* father, tnode188803* v) {
	tnode188803* vpart;
	vpart = newnodei_190803(((NU8) 35), (*v).Info, 3);
	asgnRefNoCycle((void**) &(*vpart).kindU.S6.Sons->data[0], v);
	asgnRefNoCycle((void**) &(*vpart).kindU.S6.Sons->data[1], emptynode_189727);
	asgnRefNoCycle((void**) &(*vpart).kindU.S6.Sons->data[2], emptynode_189727);
	addson_189207(father, vpart);
}

N_NIMCALL(tnode188803*, newasgnstmt_366085)(tnode188803* le, tnode188803* ri) {
	tnode188803* result;
	result = 0;
	result = newnodei_190803(((NU8) 73), (*le).Info, 2);
	asgnRefNoCycle((void**) &(*result).kindU.S6.Sons->data[0], le);
	asgnRefNoCycle((void**) &(*result).kindU.S6.Sons->data[1], ri);
	return result;
}

static N_INLINE(NI, len_189264)(tnode188803* n) {
	NI result;
	result = 0;
	{
		if (!(*n).kindU.S6.Sons == 0) goto LA3;
		result = 0;
	}
	goto LA1;
	LA3: ;
	{
		result = (*n).kindU.S6.Sons->Sup.len;
	}
	LA1: ;
	return result;
}

N_NIMCALL(tnode188803*, newtupleaccess_366014)(tnode188803* tup, NI i) {
	tnode188803* result;
	ttype188837* LOC1;
	tnode188803* LOC2;
	tnode188803* lit;
	ttype188837* LOC3;
	result = 0;
	LOC1 = 0;
	LOC1 = skiptypes_192793((*tup).Typ, IL64(211106232576256));
	result = newnodeit_189104(((NU8) 42), (*tup).Info, (*LOC1).Sons->data[i]);
	LOC2 = 0;
	LOC2 = copytree_189237(tup);
	addson_189207(result, LOC2);
	LOC3 = 0;
	LOC3 = getsystype_242024(((NU8) 31));
	lit = newnodeit_189104(((NU8) 6), (*tup).Info, LOC3);
	(*lit).kindU.S1.Intval = ((NI64) (i));
	addson_189207(result, lit);
	return result;
}

N_NIMCALL(tnode188803*, lowertupleunpacking_366155)(tnode188803* n, tsym188833* owner) {
	tnode188803* result;
	tnode188803* value;
	tsym188833* temp;
	tident167019* LOC1;
	tnode188803* v;
	tnode188803* LOC2;
	tnode188803* LOC3;
	tnode188803* LOC4;
	NI i_366230;
	NI HEX3Atmp_366245;
	NI LOC5;
	NI res_366247;
	result = 0;
	value = lastson_189189(n);
	result = newnodei_189099(((NU8) 114), (*n).Info);
	LOC1 = 0;
	LOC1 = getident_167456(((NimStringDesc*) &TMP2598));
	temp = newsym_189053(((NU8) 5), LOC1, owner, (*value).Info);
	asgnRefNoCycle((void**) &(*temp).Typ, skiptypes_192793((*value).Typ, IL64(211106232576256)));
	(*temp).Flags |=((NI32)(1)<<((((NU8) 2))%(sizeof(NI32)*8)));
	v = newnodei_189099(((NU8) 99), (*value).Info);
	LOC2 = 0;
	LOC2 = newsymnode_189095(temp);
	addvar_366036(v, LOC2);
	add_189390(result, v);
	LOC3 = 0;
	LOC3 = newsymnode_189095(temp);
	LOC4 = 0;
	LOC4 = newasgnstmt_366085(LOC3, value);
	add_189390(result, LOC4);
	i_366230 = 0;
	HEX3Atmp_366245 = 0;
	LOC5 = 0;
	LOC5 = len_189264(n);
	HEX3Atmp_366245 = (NI32)(LOC5 - 3);
	res_366247 = 0;
	while (1) {
		tnode188803* LOC7;
		tnode188803* LOC8;
		if (!(res_366247 <= HEX3Atmp_366245)) goto LA6;
		i_366230 = res_366247;
		LOC7 = 0;
		LOC7 = newtupleaccess_366014(value, i_366230);
		LOC8 = 0;
		LOC8 = newasgnstmt_366085((*n).kindU.S6.Sons->data[i_366230], LOC7);
		add_189390(result, LOC8);
		res_366247 += 1;
	} LA6: ;
	return result;
}

N_NIMCALL(ttype188837*, createobj_366252)(tsym188833* owner, tlineinfo163527 info) {
	ttype188837* result;
	result = 0;
	result = newtype_189060(((NU8) 17), owner);
	rawaddson_193092(result, NIM_NIL);
	(*result).Flags |=((NI32)(1)<<((((NU8) 2))%(sizeof(NI32)*8)));
	asgnRefNoCycle((void**) &(*result).N, newnodei_189099(((NU8) 136), info));
	return result;
}

static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
	memcpy(((NCSTRING) (&(*dest).data[((*dest).Sup.len)- 0])), ((NCSTRING) ((*src).data)), (NI32)((*src).Sup.len + 1));
	(*dest).Sup.len += (*src).Sup.len;
}

static N_INLINE(ttype188837*, skipintlit_242424)(ttype188837* t) {
	ttype188837* result;
	result = 0;
	{
		if (!!(((*t).N == NIM_NIL))) goto LA3;
		{
			if (!((*t).Kind == ((NU8) 31) || (*t).Kind == ((NU8) 36))) goto LA7;
			result = getsystype_242024((*t).Kind);
			goto BeforeRet;
		}
		LA7: ;
	}
	LA3: ;
	result = t;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, addfield_366275)(ttype188837* obj, tsym188833* s) {
	tsym188833* field;
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	tident167019* LOC3;
	ttype188837* t;
	tnode188803* LOC4;
	LOC1 = 0;
	LOC2 = 0;
	LOC2 = nimIntToStr((*s).Sup.Id);
	LOC1 = rawNewString((*(*s).Name).S->Sup.len + LOC2->Sup.len + 0);
appendString(LOC1, (*(*s).Name).S);
appendString(LOC1, LOC2);
	LOC3 = 0;
	LOC3 = getident_167456(LOC1);
	field = newsym_189053(((NU8) 19), LOC3, (*s).Owner, (*s).Info);
	t = skipintlit_242424((*s).Typ);
	asgnRefNoCycle((void**) &(*field).Typ, t);
	(*field).Position = sonslen_189181((*obj).N);
	LOC4 = 0;
	LOC4 = newsymnode_189095(field);
	addson_189207((*obj).N, LOC4);
}

N_NIMCALL(tnode188803*, indirectaccess_366403)(tnode188803* a, tsym188833* b, tlineinfo163527 info) {
	tnode188803* result;
	tnode188803* deref;
	tsym188833* field;
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	tident167019* LOC3;
	tnode188803* LOC4;
	result = 0;
	deref = newnodei_189099(((NU8) 65), info);
	asgnRefNoCycle((void**) &(*deref).Typ, (*(*a).Typ).Sons->data[0]);
	LOC1 = 0;
	LOC2 = 0;
	LOC2 = nimIntToStr((*b).Sup.Id);
	LOC1 = rawNewString((*(*b).Name).S->Sup.len + LOC2->Sup.len + 0);
appendString(LOC1, (*(*b).Name).S);
appendString(LOC1, LOC2);
	LOC3 = 0;
	LOC3 = getident_167456(LOC1);
	field = getsymfromlist_197172((*(*deref).Typ).N, LOC3, 0);
	addson_189207(deref, a);
	result = newnodei_189099(((NU8) 45), info);
	addson_189207(result, deref);
	LOC4 = 0;
	LOC4 = newsymnode_189095(field);
	addson_189207(result, LOC4);
	asgnRefNoCycle((void**) &(*result).Typ, (*field).Typ);
	return result;
}

N_NIMCALL(tnode188803*, indirectaccess_366803)(tsym188833* a, tsym188833* b, tlineinfo163527 info) {
	tnode188803* result;
	tnode188803* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = newsymnode_189095(a);
	result = indirectaccess_366403(LOC1, b, info);
	return result;
}

static N_INLINE(NIM_BOOL, isemptytype_195210)(ttype188837* t) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = (t == NIM_NIL);
	if (LOC1) goto LA2;
	LOC1 = ((*t).Kind == ((NU8) 3) || (*t).Kind == ((NU8) 7));
	LA2: ;
	result = LOC1;
	return result;
}

static N_INLINE(tnode188803*, HEX5BHEX5D_189694)(tnode188803* n, NI i) {
	tnode188803* result;
	result = 0;
	result = (*n).kindU.S6.Sons->data[i];
	return result;
}

N_NIMCALL(tnode188803*, createcastexpr_366929)(tsym188833* argsparam, ttype188837* objtype) {
	tnode188803* result;
	tnode188803* LOC1;
	result = 0;
	result = newnodei_189099(((NU8) 61), (*argsparam).Info);
	add_189390(result, emptynode_189727);
	LOC1 = 0;
	LOC1 = newsymnode_189095(argsparam);
	add_189390(result, LOC1);
	asgnRefNoCycle((void**) &(*result).Typ, newtype_189060(((NU8) 21), (*objtype).Owner));
	rawaddson_193092((*result).Typ, objtype);
	return result;
}

N_NIMCALL(tnode188803*, newfastasgnstmt_366120)(tnode188803* le, tnode188803* ri) {
	tnode188803* result;
	result = 0;
	result = newnodei_190803(((NU8) 74), (*le).Info, 2);
	asgnRefNoCycle((void**) &(*result).kindU.S6.Sons->data[0], le);
	asgnRefNoCycle((void**) &(*result).kindU.S6.Sons->data[1], ri);
	return result;
}

N_NIMCALL(tnode188803*, newdotexpr_366283)(tsym188833* obj, tsym188833* b) {
	tnode188803* result;
	tsym188833* field;
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	tident167019* LOC3;
	tnode188803* LOC4;
	tnode188803* LOC5;
	result = 0;
	result = newnodei_189099(((NU8) 45), (*obj).Info);
	LOC1 = 0;
	LOC2 = 0;
	LOC2 = nimIntToStr((*b).Sup.Id);
	LOC1 = rawNewString((*(*b).Name).S->Sup.len + LOC2->Sup.len + 0);
appendString(LOC1, (*(*b).Name).S);
appendString(LOC1, LOC2);
	LOC3 = 0;
	LOC3 = getident_167456(LOC1);
	field = getsymfromlist_197172((*(*obj).Typ).N, LOC3, 0);
	LOC4 = 0;
	LOC4 = newsymnode_189095(obj);
	addson_189207(result, LOC4);
	LOC5 = 0;
	LOC5 = newsymnode_189095(field);
	addson_189207(result, LOC5);
	asgnRefNoCycle((void**) &(*result).Typ, (*field).Typ);
	return result;
}

N_NIMCALL(tnode188803*, callcodegenproc_366831)(NimStringDesc* name, tnode188803* arg1, tnode188803* arg2, tnode188803* arg3) {
	tnode188803* result;
	tsym188833* sym;
	result = 0;
	result = newnodei_189099(((NU8) 27), (*arg1).Info);
	sym = getcompilerproc_242028(name);
	{
		if (!(sym == NIM_NIL)) goto LA3;
		localerror_165571((*arg1).Info, ((NU16) 64), name);
	}
	goto LA1;
	LA3: ;
	{
		tnode188803* LOC6;
		LOC6 = 0;
		LOC6 = newsymnode_189095(sym);
		add_189390(result, LOC6);
		add_189390(result, arg1);
		{
			if (!!((arg2 == NIM_NIL))) goto LA9;
			add_189390(result, arg2);
		}
		LA9: ;
		{
			if (!!((arg3 == NIM_NIL))) goto LA13;
			add_189390(result, arg3);
		}
		LA13: ;
	}
	LA1: ;
	return result;
}

N_NIMCALL(tsym188833*, createwrapperproc_366892)(tnode188803* f, tsym188833* threadparam, tsym188833* argsparam, tnode188803* varsection, tnode188803* call) {
	tsym188833* result;
	tnode188803* body;
	tnode188803* LOC1;
	tnode188803* LOC2;
	tnode188803* params;
	tnode188803* LOC3;
	tnode188803* LOC4;
	ttype188837* t;
	tnode188803* LOC5;
	tnode188803* LOC6;
	tnode188803* LOC7;
	NimStringDesc* name;
	NimStringDesc* LOC8;
	NimStringDesc* LOC9;
	tident167019* LOC15;
	tnode188803* LOC16;
	result = 0;
	body = newnodei_189099(((NU8) 114), (*f).Info);
	add_189390(body, varsection);
	LOC1 = 0;
	LOC1 = newsymnode_189095(threadparam);
	LOC2 = 0;
	LOC2 = callcodegenproc_366831(((NimStringDesc*) &TMP3607), LOC1, NIM_NIL, NIM_NIL);
	add_189390(body, LOC2);
	add_189390(body, call);
	params = newnodei_189099(((NU8) 76), (*f).Info);
	add_189390(params, emptynode_189727);
	LOC3 = 0;
	LOC3 = newsymnode_189095(threadparam);
	add_189390(params, LOC3);
	LOC4 = 0;
	LOC4 = newsymnode_189095(argsparam);
	add_189390(params, LOC4);
	t = newtype_189060(((NU8) 25), (*threadparam).Owner);
	rawaddson_193092(t, NIM_NIL);
	rawaddson_193092(t, (*threadparam).Typ);
	rawaddson_193092(t, (*argsparam).Typ);
	asgnRefNoCycle((void**) &(*t).N, newnodei_189099(((NU8) 76), (*f).Info));
	LOC5 = 0;
	LOC5 = newnodei_189099(((NU8) 150), (*f).Info);
	add_189390((*t).N, LOC5);
	LOC6 = 0;
	LOC6 = newsymnode_189095(threadparam);
	add_189390((*t).N, LOC6);
	LOC7 = 0;
	LOC7 = newsymnode_189095(argsparam);
	add_189390((*t).N, LOC7);
	LOC8 = 0;
	LOC9 = 0;
	{
		if (!((*f).Kind == ((NU8) 3))) goto LA12;
		LOC9 = copyString((*(*(*f).kindU.S4.Sym).Name).S);
	}
	goto LA10;
	LA12: ;
	{
		LOC9 = copyString(((NimStringDesc*) &TMP2598));
	}
	LA10: ;
	LOC8 = rawNewString(LOC9->Sup.len + 7);
appendString(LOC8, LOC9);
appendString(LOC8, ((NimStringDesc*) &TMP3608));
	name = LOC8;
	LOC15 = 0;
	LOC15 = getident_167456(name);
	result = newsym_189053(((NU8) 12), LOC15, (*argsparam).Owner, (*f).Info);
	LOC16 = 0;
	LOC16 = newsymnode_189095(result);
	asgnRefNoCycle((void**) &(*result).Ast, newprocnode_191214(((NU8) 79), (*f).Info, body, params, LOC16, emptynode_189727, emptynode_189727, emptynode_189727, emptynode_189727));
	asgnRefNoCycle((void**) &(*result).Typ, t);
	return result;
}

N_NIMCALL(tnode188803*, genaddrof_366811)(tnode188803* n) {
	tnode188803* result;
	result = 0;
	result = newnodei_190803(((NU8) 63), (*n).Info, 1);
	asgnRefNoCycle((void**) &(*result).kindU.S6.Sons->data[0], n);
	asgnRefNoCycle((void**) &(*result).Typ, newtype_189060(((NU8) 21), (*(*n).Typ).Owner));
	rawaddson_193092((*result).Typ, (*n).Typ);
	return result;
}

N_NIMCALL(tnode188803*, wrapprocforspawn_366936)(tsym188833* owner, tnode188803* n) {
	tnode188803* result;
	tsym188833* threadparam;
	tident167019* LOC17;
	tsym188833* argsparam;
	tident167019* LOC18;
	ttype188837* objtype;
	tnode188803* castexpr;
	tsym188833* scratchobj;
	tident167019* LOC20;
	tnode188803* call;
	tnode188803* fn;
	tnode188803* varsection;
	tnode188803* formals;
	tnode188803* LOC42;
	tident167019* tmpname;
	NI i_367168;
	NI HEX3Atmp_367260;
	NI LOC43;
	NI res_367262;
	tsym188833* wrapper;
	tnode188803* LOC71;
	tnode188803* LOC72;
	tnode188803* LOC73;
	tnode188803* LOC74;
	result = 0;
	result = newnodei_189099(((NU8) 114), (*n).Info);
	{
		NIM_BOOL LOC3;
		NIM_BOOL LOC5;
		LOC3 = 0;
		LOC3 = !(((*n).Kind == ((NU8) 27) || (*n).Kind == ((NU8) 29) || (*n).Kind == ((NU8) 30) || (*n).Kind == ((NU8) 31) || (*n).Kind == ((NU8) 26) || (*n).Kind == ((NU8) 28) || (*n).Kind == ((NU8) 32)));
		if (LOC3) goto LA4;
		LOC5 = 0;
		LOC5 = isemptytype_195210((*n).Typ);
		LOC3 = !(LOC5);
		LA4: ;
		if (!LOC3) goto LA6;
		localerror_165578((*n).Info, ((NimStringDesc*) &TMP3597));
		goto BeforeRet;
	}
	LA6: ;
	{
		if (!((gglobaloptions_137111 &(1<<((((NU8) 27))&31)))!=0)) goto LA10;
		{
			tnode188803* LOC14;
			LOC14 = 0;
			LOC14 = HEX5BHEX5D_189694(n, 0);
			if (!((130 & (*(*LOC14).Typ).Flags) == 0)) goto LA15;
			localerror_165578((*n).Info, ((NimStringDesc*) &TMP3598));
		}
		LA15: ;
	}
	LA10: ;
	LOC17 = 0;
	LOC17 = getident_167456(((NimStringDesc*) &TMP3599));
	threadparam = newsym_189053(((NU8) 3), LOC17, owner, (*n).Info);
	LOC18 = 0;
	LOC18 = getident_167456(((NimStringDesc*) &TMP3600));
	argsparam = newsym_189053(((NU8) 3), LOC18, owner, (*n).Info);
	{
		ttype188837* ptrtype;
		ptrtype = getsystype_242024(((NU8) 26));
		asgnRefNoCycle((void**) &(*threadparam).Typ, ptrtype);
		asgnRefNoCycle((void**) &(*argsparam).Typ, ptrtype);
		(*argsparam).Position = 1;
	}
	objtype = createobj_366252(owner, (*n).Info);
	(*objtype).Flags |=((NI32)(1)<<((((NU8) 2))%(sizeof(NI32)*8)));
	castexpr = createcastexpr_366929(argsparam, objtype);
	LOC20 = 0;
	LOC20 = getident_167456(((NimStringDesc*) &TMP3601));
	scratchobj = newsym_189053(((NU8) 8), LOC20, owner, (*n).Info);
	{
		tnode188803* varsectionb;
		tnode188803* LOC22;
		asgnRefNoCycle((void**) &(*scratchobj).Typ, objtype);
		(*scratchobj).Flags |=((NI32)(1)<<((((NU8) 2))%(sizeof(NI32)*8)));
		varsectionb = newnodei_189099(((NU8) 99), (*n).Info);
		LOC22 = 0;
		LOC22 = newsymnode_189095(scratchobj);
		addvar_366036(varsectionb, LOC22);
		add_189390(result, varsectionb);
	}
	call = newnodei_189099(((NU8) 27), (*n).Info);
	fn = (*n).kindU.S6.Sons->data[0];
	{
		NIM_BOOL LOC25;
		ttype188837* argtype;
		tnode188803* LOC29;
		tsym188833* field;
		tident167019* LOC30;
		tnode188803* LOC31;
		tnode188803* LOC32;
		tnode188803* LOC33;
		LOC25 = 0;
		LOC25 = ((*fn).Kind == ((NU8) 3));
		if (!(LOC25)) goto LA26;
		LOC25 = ((471040 &(1<<(((*(*fn).kindU.S4.Sym).Kind)&31)))!=0);
		LA26: ;
		if (!!(LOC25)) goto LA27;
		LOC29 = 0;
		LOC29 = HEX5BHEX5D_189694(n, 0);
		argtype = skiptypes_192793((*LOC29).Typ, IL64(211106232576256));
		LOC30 = 0;
		LOC30 = getident_167456(((NimStringDesc*) &TMP3602));
		field = newsym_189053(((NU8) 19), LOC30, owner, (*n).Info);
		asgnRefNoCycle((void**) &(*field).Typ, argtype);
		addfield_366275(objtype, field);
		LOC31 = 0;
		LOC31 = newdotexpr_366283(scratchobj, field);
		LOC32 = 0;
		LOC32 = HEX5BHEX5D_189694(n, 0);
		LOC33 = 0;
		LOC33 = newfastasgnstmt_366120(LOC31, LOC32);
		add_189390(result, LOC33);
		fn = indirectaccess_366403(castexpr, field, (*n).Info);
	}
	goto LA23;
	LA27: ;
	{
		NIM_BOOL LOC35;
		LOC35 = 0;
		LOC35 = ((*fn).Kind == ((NU8) 3));
		if (!(LOC35)) goto LA36;
		LOC35 = ((49152 &(1<<(((*(*fn).kindU.S4.Sym).Kind)&31)))!=0);
		LA36: ;
		if (!LOC35) goto LA37;
		localerror_165578((*n).Info, ((NimStringDesc*) &TMP3603));
	}
	goto LA23;
	LA37: ;
	{
		if (!((*(*fn).Typ).Callconv == ((NU8) 8))) goto LA40;
		localerror_165578((*n).Info, ((NimStringDesc*) &TMP3604));
	}
	goto LA23;
	LA40: ;
	LA23: ;
	add_189390(call, fn);
	varsection = newnodei_189099(((NU8) 99), (*n).Info);
	LOC42 = 0;
	LOC42 = HEX5BHEX5D_189694(n, 0);
	formals = (*(*LOC42).Typ).N;
	tmpname = getident_167456(((NimStringDesc*) &TMP2598));
	i_367168 = 0;
	HEX3Atmp_367260 = 0;
	LOC43 = 0;
	LOC43 = len_189264(n);
	HEX3Atmp_367260 = LOC43 - 1;
	res_367262 = 1;
	while (1) {
		ttype188837* argtype;
		tnode188803* LOC45;
		tident167019* fieldname;
		tsym188833* field;
		tnode188803* LOC67;
		tnode188803* LOC68;
		tnode188803* LOC69;
		tsym188833* temp;
		tnode188803* vpart;
		tnode188803* LOC70;
		if (!(res_367262 <= HEX3Atmp_367260)) goto LA44;
		i_367168 = res_367262;
		LOC45 = 0;
		LOC45 = HEX5BHEX5D_189694(n, i_367168);
		argtype = skiptypes_192793((*LOC45).Typ, IL64(211106232576256));
		{
			NIM_BOOL LOC48;
			NI LOC49;
			tnode188803* LOC51;
			tnode188803* LOC54;
			LOC48 = 0;
			LOC49 = 0;
			LOC49 = len_189264(formals);
			LOC48 = (i_367168 < LOC49);
			if (!(LOC48)) goto LA50;
			LOC51 = 0;
			LOC51 = HEX5BHEX5D_189694(formals, i_367168);
			LOC48 = ((*(*LOC51).Typ).Kind == ((NU8) 23));
			LA50: ;
			if (!LOC48) goto LA52;
			LOC54 = 0;
			LOC54 = HEX5BHEX5D_189694(n, i_367168);
			localerror_165578((*LOC54).Info, ((NimStringDesc*) &TMP3605));
		}
		goto LA46;
		LA52: ;
		{
			NIM_BOOL LOC56;
			tnode188803* LOC59;
			LOC56 = 0;
			LOC56 = containstyref_224831(argtype);
			if (!LOC56) goto LA57;
			LOC59 = 0;
			LOC59 = HEX5BHEX5D_189694(n, i_367168);
			localerror_165578((*LOC59).Info, ((NimStringDesc*) &TMP3606));
		}
		goto LA46;
		LA57: ;
		LA46: ;
		{
			NI LOC62;
			tnode188803* LOC65;
			LOC62 = 0;
			LOC62 = len_189264(formals);
			if (!(i_367168 < LOC62)) goto LA63;
			LOC65 = 0;
			LOC65 = HEX5BHEX5D_189694(formals, i_367168);
			fieldname = (*(*LOC65).kindU.S4.Sym).Name;
		}
		goto LA60;
		LA63: ;
		{
			fieldname = tmpname;
		}
		LA60: ;
		field = newsym_189053(((NU8) 19), fieldname, owner, (*n).Info);
		asgnRefNoCycle((void**) &(*field).Typ, argtype);
		addfield_366275(objtype, field);
		LOC67 = 0;
		LOC67 = newdotexpr_366283(scratchobj, field);
		LOC68 = 0;
		LOC68 = HEX5BHEX5D_189694(n, i_367168);
		LOC69 = 0;
		LOC69 = newfastasgnstmt_366120(LOC67, LOC68);
		add_189390(result, LOC69);
		temp = newsym_189053(((NU8) 5), tmpname, owner, (*n).Info);
		asgnRefNoCycle((void**) &(*temp).Typ, argtype);
		(*temp).Flags |=((NI32)(1)<<((((NU8) 2))%(sizeof(NI32)*8)));
		vpart = newnodei_190803(((NU8) 35), (*n).Info, 3);
		asgnRefNoCycle((void**) &(*vpart).kindU.S6.Sons->data[0], newsymnode_189095(temp));
		asgnRefNoCycle((void**) &(*vpart).kindU.S6.Sons->data[1], emptynode_189727);
		asgnRefNoCycle((void**) &(*vpart).kindU.S6.Sons->data[2], indirectaccess_366403(castexpr, field, (*n).Info));
		add_189390(varsection, vpart);
		LOC70 = 0;
		LOC70 = newsymnode_189095(temp);
		add_189390(call, LOC70);
		res_367262 += 1;
	} LA44: ;
	wrapper = createwrapperproc_366892(fn, threadparam, argsparam, varsection, call);
	LOC71 = 0;
	LOC71 = newsymnode_189095(wrapper);
	LOC72 = 0;
	LOC72 = newsymnode_189095(scratchobj);
	LOC73 = 0;
	LOC73 = genaddrof_366811(LOC72);
	LOC74 = 0;
	LOC74 = callcodegenproc_366831(((NimStringDesc*) &TMP3609), LOC71, LOC73, NIM_NIL);
	add_189390(result, LOC74);
	BeforeRet: ;
	return result;
}
N_NOINLINE(void, loweringsInit)(void) {
}

N_NOINLINE(void, loweringsDatInit)(void) {
}

