/* Generated by Nim Compiler v0.13.0 */
/*   (c) 2015 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_INTBITS 32

#include "nimbase.h"
#include <string.h>
typedef struct Ttype214828 Ttype214828;
typedef struct Tsym214822 Tsym214822;
typedef struct Tlineinfo182337 Tlineinfo182337;
typedef struct Tidobj189006 Tidobj189006;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttypeseq214824 Ttypeseq214824;
typedef struct Tnode214790 Tnode214790;
typedef struct Tloc214804 Tloc214804;
typedef struct Ropeobj169006 Ropeobj169006;
typedef struct Cell47504 Cell47504;
typedef struct Cellseq47520 Cellseq47520;
typedef struct Gcheap49818 Gcheap49818;
typedef struct Gcstack49816 Gcstack49816;
typedef struct Cellset47516 Cellset47516;
typedef struct Pagedesc47512 Pagedesc47512;
typedef struct Memregion29687 Memregion29687;
typedef struct Smallchunk29639 Smallchunk29639;
typedef struct Llchunk29681 Llchunk29681;
typedef struct Bigchunk29641 Bigchunk29641;
typedef struct Intset29614 Intset29614;
typedef struct Trunk29610 Trunk29610;
typedef struct Avlnode29685 Avlnode29685;
typedef struct Gcstat49814 Gcstat49814;
typedef struct Tscope214816 Tscope214816;
typedef struct TY214925 TY214925;
typedef struct Tstrtable214794 Tstrtable214794;
typedef struct Tsymseq214792 Tsymseq214792;
typedef struct Tident189012 Tident189012;
typedef struct Tlib214808 Tlib214808;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tnodeseq214784 Tnodeseq214784;
typedef struct TY88487 TY88487;
typedef struct Basechunk29637 Basechunk29637;
typedef struct Freecell29629 Freecell29629;
typedef struct Tinstantiation214812 Tinstantiation214812;
typedef struct Tlistentry135010 Tlistentry135010;
typedef struct TY214913 TY214913;
struct  Tlineinfo182337  {
NI16 line;
NI16 col;
NI32 fileindex;
};
typedef N_NIMCALL_PTR(void, TY3489) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3494) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3489 marker;
TY3494 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Tidobj189006  {
  TNimObject Sup;
NI id;
};
struct  Tloc214804  {
NU8 k;
NU8 s;
NU16 flags;
Ttype214828* t;
Ropeobj169006* r;
Ropeobj169006* heaproot;
};
struct  Ttype214828  {
  Tidobj189006 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq214824* sons;
Tnode214790* n;
Tsym214822* owner;
Tsym214822* sym;
Tsym214822* destructor;
Tsym214822* deepcopy;
Tsym214822* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc214804 loc;
};
struct  Cell47504  {
NI refcount;
TNimType* typ;
};
struct  Cellseq47520  {
NI len;
NI cap;
Cell47504** d;
};
struct  Cellset47516  {
NI counter;
NI max;
Pagedesc47512* head;
Pagedesc47512** data;
};
typedef Smallchunk29639* TY29702[512];
typedef Trunk29610* Trunkbuckets29612[256];
struct  Intset29614  {
Trunkbuckets29612 data;
};
struct  Memregion29687  {
NI minlargeobj;
NI maxlargeobj;
TY29702 freesmallchunks;
Llchunk29681* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk29641* freechunkslist;
Intset29614 chunkstarts;
Avlnode29685* root;
Avlnode29685* deleted;
Avlnode29685* last;
Avlnode29685* freeavlnodes;
};
struct  Gcstat49814  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap49818  {
Gcstack49816* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq47520 zct;
Cellseq47520 decstack;
Cellset47516 cycleroots;
Cellseq47520 tempstack;
NI recgclock;
Memregion29687 region;
Gcstat49814 stat;
};
struct  Tstrtable214794  {
NI counter;
Tsymseq214792* data;
};
struct  Tsym214822  {
  Tidobj189006 Sup;
NU8 kind;
union{
struct {Ttypeseq214824* typeinstcache;
Tscope214816* typscope;
} S1;
struct {TY214925* procinstcache;
Tsym214822* gcunsafetyreason;
} S2;
struct {TY214925* usedgenerics;
Tstrtable214794 tab;
} S3;
struct {Tsym214822* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype214828* typ;
Tident189012* name;
Tlineinfo182337 info;
Tsym214822* owner;
NU32 flags;
Tnode214790* ast;
NU32 options;
NI position;
NI offset;
Tloc214804 loc;
Tlib214808* annex;
Tnode214790* constraint;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tident189012  {
  Tidobj189006 Sup;
NimStringDesc* s;
Tident189012* next;
NI h;
};
struct  Tnode214790  {
Ttype214828* typ;
Tlineinfo182337 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym214822* sym;
} S4;
struct {Tident189012* ident;
} S5;
struct {Tnodeseq214784* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct TY88487 {
NimStringDesc* Field0;
NI Field1;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Ropeobj169006  {
  TNimObject Sup;
Ropeobj169006* left;
Ropeobj169006* right;
NI length;
NimStringDesc* data;
};
struct  Gcstack49816  {
Gcstack49816* prev;
Gcstack49816* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY29618[16];
struct  Pagedesc47512  {
Pagedesc47512* next;
NI key;
TY29618 bits;
};
struct  Basechunk29637  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk29639  {
  Basechunk29637 Sup;
Smallchunk29639* next;
Smallchunk29639* prev;
Freecell29629* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk29681  {
NI size;
NI acc;
Llchunk29681* next;
};
struct  Bigchunk29641  {
  Basechunk29637 Sup;
Bigchunk29641* next;
Bigchunk29641* prev;
NI align;
NF data;
};
struct  Trunk29610  {
Trunk29610* next;
NI key;
TY29618 bits;
};
typedef Avlnode29685* TY29692[2];
struct  Avlnode29685  {
TY29692 link;
NI key;
NI upperbound;
NI level;
};
struct  Tscope214816  {
NI depthlevel;
Tstrtable214794 symbols;
Tnodeseq214784* usingsyms;
Tscope214816* parent;
};
struct  Tlistentry135010  {
  TNimObject Sup;
Tlistentry135010* prev;
Tlistentry135010* next;
};
struct  Tlib214808  {
  Tlistentry135010 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj169006* name;
Tnode214790* path;
};
struct  Freecell29629  {
Freecell29629* next;
NI zerofield;
};
struct  Tinstantiation214812  {
Tsym214822* sym;
Ttypeseq214824* concretetypes;
TY214913* usedby;
NI compilesid;
};
struct Ttypeseq214824 {
  TGenericSeq Sup;
  Ttype214828* data[SEQ_DECL_SIZE];
};
struct TY214925 {
  TGenericSeq Sup;
  Tinstantiation214812* data[SEQ_DECL_SIZE];
};
struct Tsymseq214792 {
  TGenericSeq Sup;
  Tsym214822* data[SEQ_DECL_SIZE];
};
struct Tnodeseq214784 {
  TGenericSeq Sup;
  Tnode214790* data[SEQ_DECL_SIZE];
};
struct TY214913 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(Ttype214828*, newtype_217107)(NU8 kind, Tsym214822* owner);
N_NIMCALL(void, rawaddson_218408)(Ttype214828* father, Ttype214828* son);
N_NIMCALL(Tnode214790*, newnodei_216248)(NU8 kind, Tlineinfo182337 info);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
static N_INLINE(Cell47504*, usrtocell_51440)(void* usr);
static N_INLINE(void, rtladdzct_53001)(Cell47504* c);
N_NOINLINE(void, addzct_51417)(Cellseq47520* s, Cell47504* c);
N_NIMCALL(NI, sonslen_217351)(Tnode214790* n);
N_NIMCALL(void, addson_216807)(Tnode214790* father, Tnode214790* son);
N_NIMCALL(Tnode214790*, newsymnode_216234)(Tsym214822* sym);
N_NIMCALL(Tsym214822*, newsym_215684)(NU8 symkind, Tident189012* name, Tsym214822* owner, Tlineinfo182337 info);
N_NIMCALL(Tident189012*, getident_189441)(NimStringDesc* identifier);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
static N_INLINE(Ttype214828*, skipintlit_258651)(Ttype214828* t);
N_NIMCALL(Ttype214828*, getsystype_258130)(NU8 kind);
N_NIMCALL(Ttype214828*, skiptypes_218113)(Ttype214828* t, NU64 kinds);
N_NIMCALL(Tnode214790*, newnodei_216401)(NU8 kind, Tlineinfo182337 info, NI children);
N_NIMCALL(Tnode214790*, indirectaccess_377202)(Tnode214790* a, NimStringDesc* b, Tlineinfo182337 info);
N_NIMCALL(Tsym214822*, getsymfromlist_221135)(Tnode214790* list, Tident189012* ident, NI start);
N_NIMCALL(void, internalerror_187113)(NimStringDesc* errmsg);
N_NIMCALL(NimStringDesc*, HEX24_187183)(TY88487 x);
N_NIMCALL(Tsym214822*, lookupinrecord_221140)(Tnode214790* n, Tident189012* field);
static N_INLINE(Tnode214790*, HEX5BHEX5D_215238)(Tnode214790* n, NI i);
N_NIMCALL(void, add_215114)(Tnode214790* father, Tnode214790* son);
N_NIMCALL(Tnode214790*, newfastasgnstmt_376032)(Tnode214790* le, Tnode214790* ri);
N_NIMCALL(Tnode214790*, lastson_217364)(Tnode214790* n);
N_NIMCALL(void, addvar_376017)(Tnode214790* father, Tnode214790* v);
N_NIMCALL(Tnode214790*, newasgnstmt_376025)(Tnode214790* le, Tnode214790* ri);
static N_INLINE(NI, len_215059)(Tnode214790* n);
N_NIMCALL(Tnode214790*, newtupleaccess_376010)(Tnode214790* tup, NI i);
N_NIMCALL(Tnode214790*, newnodeit_216801)(NU8 kind, Tlineinfo182337 info, Ttype214828* typ);
N_NIMCALL(Tnode214790*, copytree_218822)(Tnode214790* src);
N_NIMCALL(Tnode214790*, newidentnode_216228)(Tident189012* ident, Tlineinfo182337 info);
N_NIMCALL(Tnode214790*, newtupleaccessraw_376254)(Tnode214790* tup, NI i);
N_NIMCALL(Tnode214790*, newintnode_215660)(NU8 kind, NI64 intval);
N_NIMCALL(Tnode214790*, newintlit_378359)(NI64 value);
N_NIMCALL(NI64, lastord_240004)(Ttype214828* t);
N_NIMCALL(Tsym214822*, createmagic_219600)(NimStringDesc* name, NU8 m);
static N_INLINE(NIM_BOOL, isemptytype_219513)(Ttype214828* t);
N_NIMCALL(NIM_BOOL, containsgarbagecollectedref_240106)(Ttype214828* typ);
N_NIMCALL(NU8, spawnresult_377947)(Ttype214828* t, NIM_BOOL inparallel);
N_NIMCALL(void, localerror_187085)(Tlineinfo182337 info, NimStringDesc* arg);
N_NIMCALL(Ttype214828*, createobj_376328)(Tsym214822* owner, Tlineinfo182337 info);
N_NIMCALL(Tnode214790*, createcastexpr_378263)(Tsym214822* argsparam, Ttype214828* objtype);
N_NIMCALL(void, addfield_376603)(Ttype214828* obj, Tsym214822* s);
N_NIMCALL(Tnode214790*, newdotexpr_377002)(Tsym214822* obj, Tsym214822* b);
N_NIMCALL(Tnode214790*, indirectaccess_377826)(Tnode214790* a, Tsym214822* b, Tlineinfo182337 info);
N_NIMCALL(void, setupargsforconcurrency_378271)(Tnode214790* n, Ttype214828* objtype, Tsym214822* scratchobj, Tnode214790* castexpr, Tnode214790* call, Tnode214790* varsection, Tnode214790* varinit, Tnode214790* result);
N_NIMCALL(Tsym214822*, addlocalvar_377992)(Tnode214790* varsection, Tnode214790* varinit, Tsym214822* owner, Ttype214828* typ, Tnode214790* v, NIM_BOOL useshallowcopy);
N_NIMCALL(NIM_BOOL, typeneedsnodeepcopy_377967)(Ttype214828* t_377969);
N_NIMCALL(void, setupargsforparallelism_378380)(Tnode214790* n_378382, Ttype214828* objtype, Tsym214822* scratchobj, Tnode214790* castexpr, Tnode214790* call, Tnode214790* varsection, Tnode214790* varinit, Tnode214790* result);
N_NIMCALL(NU8, getmagic_239323)(Tnode214790* op);
N_NIMCALL(Tnode214790*, genaddrof_377840)(Tnode214790* n);
N_NIMCALL(Tnode214790*, genhigh_378363)(Tnode214790* n);
N_NIMCALL(Tnode214790*, genderef_377845)(Tnode214790* n);
N_NIMCALL(NI64, computesize_240121)(Ttype214828* typ);
N_NIMCALL(Tsym214822*, getroot_378330)(Tnode214790* n);
N_NIMCALL(Tsym214822*, getcompilerproc_258746)(NimStringDesc* name);
N_NIMCALL(Tnode214790*, callproc_377932)(Tnode214790* a);
N_NIMCALL(Tnode214790*, callcodegenproc_377850)(NimStringDesc* name, Tnode214790* arg1, Tnode214790* arg2, Tnode214790* arg3, Tnode214790* optionalargs);
N_NIMCALL(void, localerror_187080)(Tlineinfo182337 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(Tsym214822*, createwrapperproc_378045)(Tnode214790* f, Tsym214822* threadparam, Tsym214822* argsparam, Tnode214790* varsection, Tnode214790* varinit, Tnode214790* call, Tnode214790* barrier, Tnode214790* fv, NU8 spawnkind);
N_NIMCALL(NU8, flowvarkind_377952)(Ttype214828* t);
N_NIMCALL(NimStringDesc*, typetostring_240017)(Ttype214828* typ, NU8 prefer);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(Tnode214790*, newprocnode_217040)(NU8 kind, Tlineinfo182337 info, Tnode214790* body, Tnode214790* params, Tnode214790* name, Tnode214790* pattern, Tnode214790* genericparams, Tnode214790* pragmas, Tnode214790* exceptions);
STRING_LITERAL(TMP1143, "compiler/lowerings.nim", 22);
NIM_CONST TY88487 TMP1142 = {((NimStringDesc*) &TMP1143),
((NI) 179)}
;
STRING_LITERAL(TMP2936, ":tmp", 4);
STRING_LITERAL(TMP3537, "high", 4);
NIM_CONST TY88487 TMP4236 = {((NimStringDesc*) &TMP1143),
((NI) 540)}
;
NIM_CONST TY88487 TMP4237 = {((NimStringDesc*) &TMP1143),
((NI) 543)}
;
STRING_LITERAL(TMP4238, "\'spawn\' must not be discarded", 29);
STRING_LITERAL(TMP4239, "\'spawn\' takes a call expression", 31);
STRING_LITERAL(TMP4240, "\'spawn\' takes a GC safe call expression", 39);
STRING_LITERAL(TMP4241, "thread", 6);
STRING_LITERAL(TMP4242, "args", 4);
STRING_LITERAL(TMP4243, "scratch", 7);
STRING_LITERAL(TMP4244, "fn", 2);
STRING_LITERAL(TMP4245, "iterator in spawn environment is not allowed", 44);
STRING_LITERAL(TMP4246, "closure in spawn environment is not allowed", 43);
STRING_LITERAL(TMP4247, "\'spawn\'ed function cannot have a \'var\' parameter", 48);
STRING_LITERAL(TMP4248, "deepCopy", 8);
STRING_LITERAL(TMP4249, "slice", 5);
STRING_LITERAL(TMP4250, "Barrier", 7);
STRING_LITERAL(TMP4251, "barrier", 7);
STRING_LITERAL(TMP4252, "fv", 2);
STRING_LITERAL(TMP4253, "nimFlowVarCreateSemaphore", 25);
STRING_LITERAL(TMP4254, "barrierEnter", 12);
NIM_CONST TY88487 TMP4255 = {((NimStringDesc*) &TMP1143),
((NI) 337)}
;
STRING_LITERAL(TMP4256, "owner", 5);
STRING_LITERAL(TMP4257, "nimArgsPassingDone", 18);
STRING_LITERAL(TMP4258, "cannot create a flowVar of type: ", 33);
STRING_LITERAL(TMP4259, "data", 4);
STRING_LITERAL(TMP4260, "blob", 4);
STRING_LITERAL(TMP4261, "GCref", 5);
STRING_LITERAL(TMP4262, "nimFlowVarSignal", 16);
STRING_LITERAL(TMP4263, "barrierLeave", 12);
STRING_LITERAL(TMP4264, "Wrapper", 7);
STRING_LITERAL(TMP4265, "nimSpawn", 8);
extern Gcheap49818 gch_49859;
extern Tnode214790* emptynode_215801;
extern NU32 gglobaloptions_160121;

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

static N_INLINE(void, rtladdzct_53001)(Cell47504* c) {
	addzct_51417((&gch_49859.zct), c);
}

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

N_NIMCALL(Ttype214828*, createobj_376328)(Tsym214822* owner, Tlineinfo182337 info) {
	Ttype214828* result;
	result = 0;
	result = newtype_217107(((NU8) 17), owner);
	rawaddson_218408(result, NIM_NIL);
	(*result).flags |= ((NU32)1)<<((((NU8) 2))%(sizeof(NU32)*8));
	asgnRefNoCycle((void**) (&(*result).n), newnodei_216248(((NU8) 138), info));
	return result;
}

N_NIMCALL(void, rawaddfield_376343)(Ttype214828* obj, Tsym214822* field) {
	Tnode214790* LOC1;
	(*field).position = sonslen_217351((*obj).n);
	LOC1 = 0;
	LOC1 = newsymnode_216234(field);
	addson_216807((*obj).n, LOC1);
}

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;
}

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

N_NIMCALL(void, addfield_376603)(Ttype214828* obj, Tsym214822* s) {
	Tsym214822* field;
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	Tident189012* LOC3;
	Ttype214828* t;
	Tnode214790* 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_189441(LOC1);
	field = newsym_215684(((NU8) 18), LOC3, (*s).owner, (*s).info);
	t = skipintlit_258651((*s).typ);
	asgnRefNoCycle((void**) (&(*field).typ), t);
	(*field).position = sonslen_217351((*obj).n);
	LOC4 = 0;
	LOC4 = newsymnode_216234(field);
	addson_216807((*obj).n, LOC4);
}

N_NIMCALL(Tnode214790*, rawindirectaccess_376402)(Tnode214790* a, Tsym214822* field, Tlineinfo182337 info) {
	Tnode214790* result;
	Tnode214790* deref;
	Ttype214828* LOC1;
	Tnode214790* LOC2;
	result = 0;
	deref = newnodei_216248(((NU8) 65), info);
	LOC1 = 0;
	LOC1 = skiptypes_218113((*a).typ, IL64(211106232576256));
	asgnRefNoCycle((void**) (&(*deref).typ), (*LOC1).sons->data[((NI) 0)]);
	addson_216807(deref, a);
	result = newnodei_216248(((NU8) 45), info);
	addson_216807(result, deref);
	LOC2 = 0;
	LOC2 = newsymnode_216234(field);
	addson_216807(result, LOC2);
	asgnRefNoCycle((void**) (&(*result).typ), (*field).typ);
	return result;
}

N_NIMCALL(void, addvar_376017)(Tnode214790* father, Tnode214790* v) {
	Tnode214790* vpart;
	vpart = newnodei_216401(((NU8) 35), (*v).info, ((NI) 3));
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 0)]), v);
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 1)]), emptynode_215801);
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 2)]), emptynode_215801);
	addson_216807(father, vpart);
}

N_NIMCALL(Tnode214790*, indirectaccess_377202)(Tnode214790* a, NimStringDesc* b, Tlineinfo182337 info) {
	Tnode214790* result;
	Tnode214790* deref;
	Ttype214828* LOC1;
	Ttype214828* t;
	Tsym214822* field;
	Tident189012* bb;
	Tnode214790* LOC17;
	result = 0;
	deref = newnodei_216248(((NU8) 65), info);
	LOC1 = 0;
	LOC1 = skiptypes_218113((*a).typ, IL64(211106232576256));
	asgnRefNoCycle((void**) (&(*deref).typ), (*LOC1).sons->data[((NI) 0)]);
	t = skiptypes_218113((*deref).typ, IL64(211106232576256));
	field = 0;
	bb = getident_189441(b);
	{
		while (1) {
			field = getsymfromlist_221135((*t).n, bb, ((NI) 0));
			{
				if (!!((field == NIM_NIL))) goto LA6;
				goto LA2;
			}
			LA6: ;
			t = (*t).sons->data[((NI) 0)];
			{
				if (!(t == NIM_NIL)) goto LA10;
				goto LA2;
			}
			LA10: ;
			t = skiptypes_218113(t, IL64(211106232576256));
		}
	} LA2: ;
	{
		NimStringDesc* LOC16;
		if (!!(!((field == NIM_NIL)))) goto LA14;
		LOC16 = 0;
		LOC16 = HEX24_187183(TMP1142);
		internalerror_187113(LOC16);
	}
	LA14: ;
	addson_216807(deref, a);
	result = newnodei_216248(((NU8) 45), info);
	addson_216807(result, deref);
	LOC17 = 0;
	LOC17 = newsymnode_216234(field);
	addson_216807(result, LOC17);
	asgnRefNoCycle((void**) (&(*result).typ), (*field).typ);
	return result;
}

N_NIMCALL(Tnode214790*, indirectaccess_377826)(Tnode214790* a, Tsym214822* b, Tlineinfo182337 info) {
	Tnode214790* result;
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	result = 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);
	result = indirectaccess_377202(a, LOC1, info);
	return result;
}

N_NIMCALL(void, adduniquefield_376802)(Ttype214828* obj, Tsym214822* s) {
	Tident189012* fieldname;
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	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);
	fieldname = getident_189441(LOC1);
	{
		Tsym214822* LOC5;
		Tsym214822* field;
		Ttype214828* t;
		Tnode214790* LOC8;
		LOC5 = 0;
		LOC5 = lookupinrecord_221140((*obj).n, fieldname);
		if (!(LOC5 == NIM_NIL)) goto LA6;
		field = newsym_215684(((NU8) 18), fieldname, (*s).owner, (*s).info);
		t = skipintlit_258651((*s).typ);
		asgnRefNoCycle((void**) (&(*field).typ), t);
		(*field).position = sonslen_217351((*obj).n);
		LOC8 = 0;
		LOC8 = newsymnode_216234(field);
		addson_216807((*obj).n, LOC8);
	}
	LA6: ;
}

N_NIMCALL(Tsym214822*, getfieldfromobj_377447)(Ttype214828* t_377449, Tsym214822* v) {
	Tsym214822* result;
	Tident189012* fieldname;
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	Ttype214828* t;
	result = 0;
	LOC1 = 0;
	LOC2 = 0;
	LOC2 = nimIntToStr((*v).Sup.id);
	LOC1 = rawNewString((*(*v).name).s->Sup.len + LOC2->Sup.len + 0);
appendString(LOC1, (*(*v).name).s);
appendString(LOC1, LOC2);
	fieldname = getident_189441(LOC1);
	t = t_377449;
	{
		while (1) {
			result = getsymfromlist_221135((*t).n, fieldname, ((NI) 0));
			{
				if (!!((result == NIM_NIL))) goto LA7;
				goto LA3;
			}
			LA7: ;
			t = (*t).sons->data[((NI) 0)];
			{
				if (!(t == NIM_NIL)) goto LA11;
				goto LA3;
			}
			LA11: ;
			t = skiptypes_218113(t, IL64(211106232576256));
		}
	} LA3: ;
	return result;
}

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

N_NIMCALL(Tnode214790*, newfastasgnstmt_376032)(Tnode214790* le, Tnode214790* ri) {
	Tnode214790* result;
	result = 0;
	result = newnodei_216401(((NU8) 74), (*le).info, ((NI) 2));
	asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[((NI) 0)]), le);
	asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[((NI) 1)]), ri);
	return result;
}

N_NIMCALL(Tnode214790*, lowerswap_376300)(Tnode214790* n, Tsym214822* owner) {
	Tnode214790* result;
	Tsym214822* temp;
	Tident189012* LOC1;
	Tnode214790* v;
	Tnode214790* tempasnode;
	Tnode214790* vpart;
	Tnode214790* LOC2;
	Tnode214790* LOC3;
	Tnode214790* LOC4;
	Tnode214790* LOC5;
	Tnode214790* LOC6;
	result = 0;
	result = newnodei_216248(((NU8) 115), (*n).info);
	LOC1 = 0;
	LOC1 = getident_189441(((NimStringDesc*) &TMP2936));
	temp = newsym_215684(((NU8) 8), LOC1, owner, (*n).info);
	asgnRefNoCycle((void**) (&(*temp).typ), (*(*n).kindU.S6.sons->data[((NI) 1)]).typ);
	(*temp).flags |= ((NU32)1)<<((((NU8) 2))%(sizeof(NU32)*8));
	v = newnodei_216248(((NU8) 99), (*n).info);
	tempasnode = newsymnode_216234(temp);
	vpart = newnodei_216401(((NU8) 35), (*v).info, ((NI) 3));
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 0)]), tempasnode);
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 1)]), emptynode_215801);
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 2)]), HEX5BHEX5D_215238(n, ((NI) 1)));
	addson_216807(v, vpart);
	add_215114(result, v);
	LOC2 = 0;
	LOC2 = HEX5BHEX5D_215238(n, ((NI) 1));
	LOC3 = 0;
	LOC3 = HEX5BHEX5D_215238(n, ((NI) 2));
	LOC4 = 0;
	LOC4 = newfastasgnstmt_376032(LOC2, LOC3);
	add_215114(result, LOC4);
	LOC5 = 0;
	LOC5 = HEX5BHEX5D_215238(n, ((NI) 2));
	LOC6 = 0;
	LOC6 = newfastasgnstmt_376032(LOC5, tempasnode);
	add_215114(result, LOC6);
	return result;
}

N_NIMCALL(Tnode214790*, newasgnstmt_376025)(Tnode214790* le, Tnode214790* ri) {
	Tnode214790* result;
	result = 0;
	result = newnodei_216401(((NU8) 73), (*le).info, ((NI) 2));
	asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[((NI) 0)]), le);
	asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[((NI) 1)]), ri);
	return result;
}

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

N_NIMCALL(Tnode214790*, newtupleaccess_376010)(Tnode214790* tup, NI i) {
	Tnode214790* result;
	Ttype214828* LOC1;
	Tnode214790* LOC2;
	Tnode214790* lit;
	Ttype214828* LOC3;
	result = 0;
	LOC1 = 0;
	LOC1 = skiptypes_218113((*tup).typ, IL64(211106232576256));
	result = newnodeit_216801(((NU8) 42), (*tup).info, (*LOC1).sons->data[i]);
	LOC2 = 0;
	LOC2 = copytree_218822(tup);
	addson_216807(result, LOC2);
	LOC3 = 0;
	LOC3 = getsystype_258130(((NU8) 31));
	lit = newnodeit_216801(((NU8) 6), (*tup).info, LOC3);
	(*lit).kindU.S1.intval = ((NI64) (i));
	addson_216807(result, lit);
	return result;
}

N_NIMCALL(Tnode214790*, lowertupleunpacking_376039)(Tnode214790* n, Tsym214822* owner) {
	Tnode214790* result;
	Tnode214790* value;
	Tsym214822* temp;
	Tident189012* LOC1;
	Tnode214790* v;
	Tnode214790* tempasnode;
	Tnode214790* LOC2;
	result = 0;
	value = lastson_217364(n);
	result = newnodei_216248(((NU8) 115), (*n).info);
	LOC1 = 0;
	LOC1 = getident_189441(((NimStringDesc*) &TMP2936));
	temp = newsym_215684(((NU8) 5), LOC1, owner, (*value).info);
	asgnRefNoCycle((void**) (&(*temp).typ), skiptypes_218113((*value).typ, IL64(211106232576256)));
	(*temp).flags |= ((NU32)1)<<((((NU8) 2))%(sizeof(NU32)*8));
	v = newnodei_216248(((NU8) 99), (*value).info);
	tempasnode = newsymnode_216234(temp);
	addvar_376017(v, tempasnode);
	add_215114(result, v);
	LOC2 = 0;
	LOC2 = newasgnstmt_376025(tempasnode, value);
	add_215114(result, LOC2);
	{
		NI i_376231;
		NI HEX3Atmp_376247;
		NI LOC4;
		NI res_376250;
		i_376231 = 0;
		HEX3Atmp_376247 = 0;
		LOC4 = 0;
		LOC4 = len_215059(n);
		HEX3Atmp_376247 = (NI)(LOC4 - ((NI) 3));
		res_376250 = ((NI) 0);
		{
			while (1) {
				Tnode214790* LOC11;
				Tnode214790* LOC12;
				if (!(res_376250 <= HEX3Atmp_376247)) goto LA6;
				i_376231 = res_376250;
				{
					if (!((*(*n).kindU.S6.sons->data[i_376231]).kind == ((NU8) 3))) goto LA9;
					addvar_376017(v, (*n).kindU.S6.sons->data[i_376231]);
				}
				LA9: ;
				LOC11 = 0;
				LOC11 = newtupleaccess_376010(tempasnode, i_376231);
				LOC12 = 0;
				LOC12 = newasgnstmt_376025((*n).kindU.S6.sons->data[i_376231], LOC11);
				add_215114(result, LOC12);
				res_376250 += ((NI) 1);
			} LA6: ;
		}
	}
	return result;
}

N_NIMCALL(Tnode214790*, newtupleaccessraw_376254)(Tnode214790* tup, NI i) {
	Tnode214790* result;
	Tnode214790* LOC1;
	Tnode214790* lit;
	result = 0;
	result = newnodei_216248(((NU8) 42), (*tup).info);
	LOC1 = 0;
	LOC1 = copytree_218822(tup);
	addson_216807(result, LOC1);
	lit = newnodei_216248(((NU8) 6), (*tup).info);
	(*lit).kindU.S1.intval = ((NI64) (i));
	addson_216807(result, lit);
	return result;
}

N_NIMCALL(Tnode214790*, lowertupleunpackingforasgn_376261)(Tnode214790* n, Tsym214822* owner) {
	Tnode214790* result;
	Tnode214790* value;
	Tsym214822* temp;
	Tident189012* LOC1;
	Tnode214790* v;
	Tnode214790* tempasnode;
	NimStringDesc* LOC2;
	NimStringDesc* LOC3;
	Tident189012* LOC4;
	Tnode214790* vpart;
	Tnode214790* lhs;
	result = 0;
	value = lastson_217364(n);
	result = newnodei_216248(((NU8) 115), (*n).info);
	LOC1 = 0;
	LOC1 = getident_189441(((NimStringDesc*) &TMP2936));
	temp = newsym_215684(((NU8) 5), LOC1, owner, (*value).info);
	v = newnodei_216248(((NU8) 100), (*value).info);
	LOC2 = 0;
	LOC3 = 0;
	LOC3 = nimIntToStr((*temp).Sup.id);
	LOC2 = rawNewString(LOC3->Sup.len + 4);
appendString(LOC2, ((NimStringDesc*) &TMP2936));
appendString(LOC2, LOC3);
	LOC4 = 0;
	LOC4 = getident_189441(LOC2);
	tempasnode = newidentnode_216228(LOC4, (*value).info);
	vpart = newnodei_216401(((NU8) 35), (*tempasnode).info, ((NI) 3));
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 0)]), tempasnode);
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 1)]), emptynode_215801);
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 2)]), value);
	addson_216807(v, vpart);
	add_215114(result, v);
	lhs = (*n).kindU.S6.sons->data[((NI) 0)];
	{
		NI i_376289;
		NI HEX3Atmp_376293;
		NI LOC6;
		NI res_376296;
		i_376289 = 0;
		HEX3Atmp_376293 = 0;
		LOC6 = 0;
		LOC6 = len_215059(lhs);
		HEX3Atmp_376293 = (NI)(LOC6 - ((NI) 1));
		res_376296 = ((NI) 0);
		{
			while (1) {
				Tnode214790* LOC9;
				Tnode214790* LOC10;
				if (!(res_376296 <= HEX3Atmp_376293)) goto LA8;
				i_376289 = res_376296;
				LOC9 = 0;
				LOC9 = newtupleaccessraw_376254(tempasnode, i_376289);
				LOC10 = 0;
				LOC10 = newasgnstmt_376025((*lhs).kindU.S6.sons->data[i_376289], LOC9);
				add_215114(result, LOC10);
				res_376296 += ((NI) 1);
			} LA8: ;
		}
	}
	return result;
}

N_NIMCALL(Tnode214790*, newintlit_378359)(NI64 value) {
	Tnode214790* result;
	result = 0;
	result = newintnode_215660(((NU8) 6), value);
	asgnRefNoCycle((void**) (&(*result).typ), getsystype_258130(((NU8) 31)));
	return result;
}

N_NIMCALL(Tnode214790*, genhigh_378363)(Tnode214790* n) {
	Tnode214790* result;
	result = 0;
	{
		Ttype214828* LOC3;
		Ttype214828* LOC6;
		NI64 LOC7;
		LOC3 = 0;
		LOC3 = skiptypes_218113((*n).typ, IL64(211106240964864));
		if (!((*LOC3).kind == ((NU8) 4) || (*LOC3).kind == ((NU8) 16))) goto LA4;
		LOC6 = 0;
		LOC6 = skiptypes_218113((*n).typ, IL64(211106240964864));
		LOC7 = 0;
		LOC7 = lastord_240004(LOC6);
		result = newintlit_378359(LOC7);
	}
	goto LA1;
	LA4: ;
	{
		Tsym214822* LOC9;
		result = newnodei_216401(((NU8) 27), (*n).info, ((NI) 2));
		asgnRefNoCycle((void**) (&(*result).typ), getsystype_258130(((NU8) 31)));
		LOC9 = 0;
		LOC9 = createmagic_219600(((NimStringDesc*) &TMP3537), ((NU8) 8));
		asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[((NI) 0)]), newsymnode_216234(LOC9));
		asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[((NI) 1)]), n);
	}
	LA1: ;
	return result;
}

static N_INLINE(NIM_BOOL, isemptytype_219513)(Ttype214828* 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;
}

N_NIMCALL(NU8, spawnresult_377947)(Ttype214828* t, NIM_BOOL inparallel) {
	NU8 result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = isemptytype_219513(t);
		if (!LOC3) goto LA4;
		result = ((NU8) 0);
	}
	goto LA1;
	LA4: ;
	{
		NIM_BOOL LOC7;
		NIM_BOOL LOC9;
		LOC7 = 0;
		LOC7 = inparallel;
		if (!(LOC7)) goto LA8;
		LOC9 = 0;
		LOC9 = containsgarbagecollectedref_240106(t);
		LOC7 = !(LOC9);
		LA8: ;
		if (!LOC7) goto LA10;
		result = ((NU8) 2);
	}
	goto LA1;
	LA10: ;
	{
		result = ((NU8) 1);
	}
	LA1: ;
	return result;
}

N_NIMCALL(Tnode214790*, createcastexpr_378263)(Tsym214822* argsparam, Ttype214828* objtype) {
	Tnode214790* result;
	Tnode214790* LOC1;
	result = 0;
	result = newnodei_216248(((NU8) 61), (*argsparam).info);
	add_215114(result, emptynode_215801);
	LOC1 = 0;
	LOC1 = newsymnode_216234(argsparam);
	add_215114(result, LOC1);
	asgnRefNoCycle((void**) (&(*result).typ), newtype_217107(((NU8) 21), (*objtype).owner));
	rawaddson_218408((*result).typ, objtype);
	return result;
}

N_NIMCALL(Tnode214790*, newdotexpr_377002)(Tsym214822* obj, Tsym214822* b) {
	Tnode214790* result;
	Tsym214822* field;
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	Tident189012* LOC3;
	Tnode214790* LOC4;
	Tnode214790* LOC5;
	result = 0;
	result = newnodei_216248(((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_189441(LOC1);
	field = getsymfromlist_221135((*(*obj).typ).n, LOC3, ((NI) 0));
	LOC4 = 0;
	LOC4 = newsymnode_216234(obj);
	addson_216807(result, LOC4);
	LOC5 = 0;
	LOC5 = newsymnode_216234(field);
	addson_216807(result, LOC5);
	asgnRefNoCycle((void**) (&(*result).typ), (*field).typ);
	return result;
}

N_NIMCALL(NIM_BOOL, typeneedsnodeepcopy_377967)(Ttype214828* t_377969) {
	NIM_BOOL result;
	Ttype214828* t;
	NIM_BOOL LOC9;
{	result = 0;
	t = skiptypes_218113(t_377969, IL64(211106232576256));
	{
		if (!((*t).kind == ((NU8) 28))) goto LA3;
		result = NIM_TRUE;
		goto BeforeRet;
	}
	LA3: ;
	{
		if (!((*t).kind == ((NU8) 23) || (*t).kind == ((NU8) 24))) goto LA7;
		t = (*t).sons->data[((NI) 0)];
	}
	LA7: ;
	LOC9 = 0;
	LOC9 = containsgarbagecollectedref_240106(t);
	result = !(LOC9);
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tsym214822*, addlocalvar_377992)(Tnode214790* varsection, Tnode214790* varinit, Tsym214822* owner, Ttype214828* typ, Tnode214790* v, NIM_BOOL useshallowcopy) {
	Tsym214822* result;
	Tident189012* LOC1;
	Tnode214790* vpart;
	result = 0;
	LOC1 = 0;
	LOC1 = getident_189441(((NimStringDesc*) &TMP2936));
	result = newsym_215684(((NU8) 5), LOC1, owner, (*varsection).info);
	asgnRefNoCycle((void**) (&(*result).typ), typ);
	(*result).flags |= ((NU32)1)<<((((NU8) 2))%(sizeof(NU32)*8));
	vpart = newnodei_216401(((NU8) 35), (*varsection).info, ((NI) 3));
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 0)]), newsymnode_216234(result));
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 1)]), emptynode_215801);
	{
		if (!varinit == 0) goto LA4;
		asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 2)]), v);
	}
	goto LA2;
	LA4: ;
	{
		asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 2)]), emptynode_215801);
	}
	LA2: ;
	add_215114(varsection, vpart);
	{
		if (!!((varinit == NIM_NIL))) goto LA9;
		{
			NIM_BOOL LOC13;
			Tnode214790* LOC17;
			Tnode214790* LOC18;
			LOC13 = 0;
			LOC13 = useshallowcopy;
			if (!(LOC13)) goto LA14;
			LOC13 = typeneedsnodeepcopy_377967(typ);
			LA14: ;
			if (!LOC13) goto LA15;
			LOC17 = 0;
			LOC17 = newsymnode_216234(result);
			LOC18 = 0;
			LOC18 = newfastasgnstmt_376032(LOC17, v);
			add_215114(varinit, LOC18);
		}
		goto LA11;
		LA15: ;
		{
			Tnode214790* deepcopycall;
			Tsym214822* LOC20;
			deepcopycall = newnodei_216401(((NU8) 27), (*varinit).info, ((NI) 3));
			LOC20 = 0;
			LOC20 = createmagic_219600(((NimStringDesc*) &TMP4248), ((NU8) 202));
			asgnRefNoCycle((void**) (&(*deepcopycall).kindU.S6.sons->data[((NI) 0)]), newsymnode_216234(LOC20));
			asgnRefNoCycle((void**) (&(*deepcopycall).kindU.S6.sons->data[((NI) 1)]), newsymnode_216234(result));
			asgnRefNoCycle((void**) (&(*deepcopycall).kindU.S6.sons->data[((NI) 2)]), v);
			add_215114(varinit, deepcopycall);
		}
		LA11: ;
	}
	LA9: ;
	return result;
}

N_NIMCALL(void, setupargsforconcurrency_378271)(Tnode214790* n, Ttype214828* objtype, Tsym214822* scratchobj, Tnode214790* castexpr, Tnode214790* call, Tnode214790* varsection, Tnode214790* varinit, Tnode214790* result) {
	Tnode214790* formals;
	Tnode214790* LOC1;
	Tident189012* tmpname;
	LOC1 = 0;
	LOC1 = HEX5BHEX5D_215238(n, ((NI) 0));
	formals = (*(*LOC1).typ).n;
	tmpname = getident_189441(((NimStringDesc*) &TMP2936));
	{
		NI i_378301;
		NI HEX3Atmp_378323;
		NI LOC3;
		NI res_378326;
		i_378301 = 0;
		HEX3Atmp_378323 = 0;
		LOC3 = 0;
		LOC3 = len_215059(n);
		HEX3Atmp_378323 = (LOC3 - 1);
		res_378326 = ((NI) 1);
		{
			while (1) {
				Ttype214828* argtype;
				Tnode214790* LOC6;
				Tident189012* fieldname;
				Tsym214822* field;
				Tnode214790* LOC23;
				Tnode214790* LOC24;
				Tnode214790* LOC25;
				Tsym214822* temp;
				Tnode214790* LOC26;
				Tnode214790* LOC27;
				if (!(res_378326 <= HEX3Atmp_378323)) goto LA5;
				i_378301 = res_378326;
				LOC6 = 0;
				LOC6 = HEX5BHEX5D_215238(n, i_378301);
				argtype = skiptypes_218113((*LOC6).typ, IL64(211106232576256));
				{
					NIM_BOOL LOC9;
					NI LOC10;
					Tnode214790* LOC12;
					Tnode214790* LOC15;
					LOC9 = 0;
					LOC10 = 0;
					LOC10 = len_215059(formals);
					LOC9 = (i_378301 < LOC10);
					if (!(LOC9)) goto LA11;
					LOC12 = 0;
					LOC12 = HEX5BHEX5D_215238(formals, i_378301);
					LOC9 = ((*(*LOC12).typ).kind == ((NU8) 23));
					LA11: ;
					if (!LOC9) goto LA13;
					LOC15 = 0;
					LOC15 = HEX5BHEX5D_215238(n, i_378301);
					localerror_187085((*LOC15).info, ((NimStringDesc*) &TMP4247));
				}
				LA13: ;
				{
					NI LOC18;
					Tnode214790* LOC21;
					LOC18 = 0;
					LOC18 = len_215059(formals);
					if (!(i_378301 < LOC18)) goto LA19;
					LOC21 = 0;
					LOC21 = HEX5BHEX5D_215238(formals, i_378301);
					fieldname = (*(*LOC21).kindU.S4.sym).name;
				}
				goto LA16;
				LA19: ;
				{
					fieldname = tmpname;
				}
				LA16: ;
				field = newsym_215684(((NU8) 18), fieldname, (*objtype).owner, (*n).info);
				asgnRefNoCycle((void**) (&(*field).typ), argtype);
				addfield_376603(objtype, field);
				LOC23 = 0;
				LOC23 = newdotexpr_377002(scratchobj, field);
				LOC24 = 0;
				LOC24 = HEX5BHEX5D_215238(n, i_378301);
				LOC25 = 0;
				LOC25 = newfastasgnstmt_376032(LOC23, LOC24);
				add_215114(result, LOC25);
				LOC26 = 0;
				LOC26 = indirectaccess_377826(castexpr, field, (*n).info);
				temp = addlocalvar_377992(varsection, varinit, (*objtype).owner, argtype, LOC26, NIM_FALSE);
				LOC27 = 0;
				LOC27 = newsymnode_216234(temp);
				add_215114(call, LOC27);
				res_378326 += ((NI) 1);
			} LA5: ;
		}
	}
}

N_NIMCALL(Tnode214790*, genaddrof_377840)(Tnode214790* n) {
	Tnode214790* result;
	result = 0;
	result = newnodei_216401(((NU8) 63), (*n).info, ((NI) 1));
	asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[((NI) 0)]), n);
	asgnRefNoCycle((void**) (&(*result).typ), newtype_217107(((NU8) 21), (*(*n).typ).owner));
	rawaddson_218408((*result).typ, (*n).typ);
	return result;
}

N_NIMCALL(Tnode214790*, genderef_377845)(Tnode214790* n) {
	Tnode214790* result;
	Ttype214828* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = skiptypes_218113((*n).typ, IL64(211106232576256));
	result = newnodeit_216801(((NU8) 65), (*n).info, (*LOC1).sons->data[((NI) 0)]);
	add_215114(result, n);
	return result;
}

N_NIMCALL(Tsym214822*, getroot_378330)(Tnode214790* n) {
	Tsym214822* result;
	result = 0;
	switch ((*n).kind) {
	case ((NU8) 3):
	{
		{
			if (!((1051424 &(1U<<((NU)((*(*n).kindU.S4.sym).kind)&31U)))!=0)) goto LA4;
			result = (*n).kindU.S4.sym;
		}
		LA4: ;
	}
	break;
	case ((NU8) 45):
	case ((NU8) 42):
	case ((NU8) 65):
	case ((NU8) 47):
	case ((NU8) 67):
	case ((NU8) 66):
	case ((NU8) 46):
	{
		result = getroot_378330((*n).kindU.S6.sons->data[((NI) 0)]);
	}
	break;
	case ((NU8) 58):
	case ((NU8) 59):
	case ((NU8) 60):
	{
		result = getroot_378330((*n).kindU.S6.sons->data[((NI) 1)]);
	}
	break;
	case ((NU8) 27):
	case ((NU8) 29):
	case ((NU8) 30):
	case ((NU8) 31):
	case ((NU8) 26):
	case ((NU8) 28):
	case ((NU8) 32):
	{
		{
			NU8 LOC11;
			LOC11 = 0;
			LOC11 = getmagic_239323(n);
			if (!(LOC11 == ((NU8) 138))) goto LA12;
			result = getroot_378330((*n).kindU.S6.sons->data[((NI) 1)]);
		}
		LA12: ;
	}
	break;
	default:
	{
	}
	break;
	}
	return result;
}

N_NIMCALL(void, setupargsforparallelism_378380)(Tnode214790* n_378382, Ttype214828* objtype, Tsym214822* scratchobj, Tnode214790* castexpr, Tnode214790* call, Tnode214790* varsection, Tnode214790* varinit, Tnode214790* result) {
	Tnode214790* formals;
	Tnode214790* LOC1;
	Tident189012* tmpname;
	LOC1 = 0;
	LOC1 = HEX5BHEX5D_215238(n_378382, ((NI) 0));
	formals = (*(*LOC1).typ).n;
	tmpname = getident_189441(((NimStringDesc*) &TMP2936));
	{
		NI i_378410;
		NI HEX3Atmp_378493;
		NI LOC3;
		NI res_378496;
		i_378410 = 0;
		HEX3Atmp_378493 = 0;
		LOC3 = 0;
		LOC3 = len_215059(n_378382);
		HEX3Atmp_378493 = (LOC3 - 1);
		res_378496 = ((NI) 1);
		{
			while (1) {
				Tnode214790* n;
				Ttype214828* argtype;
				Ttype214828* LOC6;
				Tident189012* fieldname;
				Tsym214822* field;
				if (!(res_378496 <= HEX3Atmp_378493)) goto LA5;
				i_378410 = res_378496;
				n = HEX5BHEX5D_215238(n_378382, i_378410);
				LOC6 = 0;
				{
					NI LOC9;
					Tnode214790* LOC12;
					LOC9 = 0;
					LOC9 = len_215059(formals);
					if (!(i_378410 < LOC9)) goto LA10;
					LOC12 = 0;
					LOC12 = HEX5BHEX5D_215238(formals, i_378410);
					LOC6 = (*LOC12).typ;
				}
				goto LA7;
				LA10: ;
				{
					LOC6 = (*n).typ;
				}
				LA7: ;
				argtype = skiptypes_218113(LOC6, IL64(211106232576256));
				{
					NI LOC16;
					Tnode214790* LOC19;
					LOC16 = 0;
					LOC16 = len_215059(formals);
					if (!(i_378410 < LOC16)) goto LA17;
					LOC19 = 0;
					LOC19 = HEX5BHEX5D_215238(formals, i_378410);
					fieldname = (*(*LOC19).kindU.S4.sym).name;
				}
				goto LA14;
				LA17: ;
				{
					fieldname = tmpname;
				}
				LA14: ;
				field = newsym_215684(((NU8) 18), fieldname, (*objtype).owner, (*n).info);
				{
					Tnode214790* slice;
					Tsym214822* LOC25;
					Tsym214822* fieldb;
					Tnode214790* LOC47;
					Tsym214822* threadlocal_378461;
					Tnode214790* LOC48;
					if (!((*argtype).kind == ((NU8) 48) || (*argtype).kind == ((NU8) 27))) goto LA23;
					slice = newnodei_216401(((NU8) 27), (*n).info, ((NI) 4));
					asgnRefNoCycle((void**) (&(*slice).typ), (*n).typ);
					LOC25 = 0;
					LOC25 = createmagic_219600(((NimStringDesc*) &TMP4249), ((NU8) 138));
					asgnRefNoCycle((void**) (&(*slice).kindU.S6.sons->data[((NI) 0)]), newsymnode_216234(LOC25));
					fieldb = newsym_215684(((NU8) 18), tmpname, (*objtype).owner, (*n).info);
					asgnRefNoCycle((void**) (&(*fieldb).typ), getsystype_258130(((NU8) 31)));
					addfield_376603(objtype, fieldb);
					{
						NU8 LOC28;
						Tnode214790* a;
						Tnode214790* LOC31;
						Tnode214790* LOC32;
						Tnode214790* LOC33;
						Tsym214822* fielda;
						Tnode214790* LOC34;
						Tnode214790* LOC35;
						Tnode214790* LOC36;
						Tnode214790* LOC37;
						Tnode214790* LOC38;
						Tnode214790* LOC39;
						Tsym214822* threadlocal_378451;
						Tnode214790* LOC40;
						LOC28 = 0;
						LOC28 = getmagic_239323(n);
						if (!(LOC28 == ((NU8) 138))) goto LA29;
						LOC31 = 0;
						LOC31 = HEX5BHEX5D_215238(n, ((NI) 1));
						a = genaddrof_377840(LOC31);
						asgnRefNoCycle((void**) (&(*field).typ), (*a).typ);
						addfield_376603(objtype, field);
						LOC32 = 0;
						LOC32 = newdotexpr_377002(scratchobj, field);
						LOC33 = 0;
						LOC33 = newfastasgnstmt_376032(LOC32, a);
						add_215114(result, LOC33);
						fielda = newsym_215684(((NU8) 18), tmpname, (*objtype).owner, (*n).info);
						asgnRefNoCycle((void**) (&(*fielda).typ), getsystype_258130(((NU8) 31)));
						addfield_376603(objtype, fielda);
						LOC34 = 0;
						LOC34 = newdotexpr_377002(scratchobj, fielda);
						LOC35 = 0;
						LOC35 = HEX5BHEX5D_215238(n, ((NI) 2));
						LOC36 = 0;
						LOC36 = newfastasgnstmt_376032(LOC34, LOC35);
						add_215114(result, LOC36);
						LOC37 = 0;
						LOC37 = newdotexpr_377002(scratchobj, fieldb);
						LOC38 = 0;
						LOC38 = HEX5BHEX5D_215238(n, ((NI) 3));
						LOC39 = 0;
						LOC39 = newfastasgnstmt_376032(LOC37, LOC38);
						add_215114(result, LOC39);
						LOC40 = 0;
						LOC40 = indirectaccess_377826(castexpr, fielda, (*n).info);
						threadlocal_378451 = addlocalvar_377992(varsection, NIM_NIL, (*objtype).owner, (*fielda).typ, LOC40, NIM_TRUE);
						asgnRefNoCycle((void**) (&(*slice).kindU.S6.sons->data[((NI) 2)]), newsymnode_216234(threadlocal_378451));
					}
					goto LA26;
					LA29: ;
					{
						Tnode214790* a;
						Tnode214790* LOC42;
						Tnode214790* LOC43;
						Tnode214790* LOC44;
						Tnode214790* LOC45;
						Tnode214790* LOC46;
						a = genaddrof_377840(n);
						asgnRefNoCycle((void**) (&(*field).typ), (*a).typ);
						addfield_376603(objtype, field);
						LOC42 = 0;
						LOC42 = newdotexpr_377002(scratchobj, field);
						LOC43 = 0;
						LOC43 = newfastasgnstmt_376032(LOC42, a);
						add_215114(result, LOC43);
						LOC44 = 0;
						LOC44 = newdotexpr_377002(scratchobj, fieldb);
						LOC45 = 0;
						LOC45 = genhigh_378363(n);
						LOC46 = 0;
						LOC46 = newfastasgnstmt_376032(LOC44, LOC45);
						add_215114(result, LOC46);
						asgnRefNoCycle((void**) (&(*slice).kindU.S6.sons->data[((NI) 2)]), newintlit_378359(IL64(0)));
					}
					LA26: ;
					LOC47 = 0;
					LOC47 = indirectaccess_377826(castexpr, field, (*n).info);
					asgnRefNoCycle((void**) (&(*slice).kindU.S6.sons->data[((NI) 1)]), genderef_377845(LOC47));
					LOC48 = 0;
					LOC48 = indirectaccess_377826(castexpr, fieldb, (*n).info);
					threadlocal_378461 = addlocalvar_377992(varsection, NIM_NIL, (*objtype).owner, (*fieldb).typ, LOC48, NIM_TRUE);
					asgnRefNoCycle((void**) (&(*slice).kindU.S6.sons->data[((NI) 3)]), newsymnode_216234(threadlocal_378461));
					add_215114(call, slice);
				}
				goto LA21;
				LA23: ;
				{
					NIM_BOOL LOC50;
					NI64 size;
					NIM_BOOL LOC51;
					Tsym214822* LOC54;
					Tnode214790* a;
					Tnode214790* LOC57;
					Tnode214790* LOC58;
					Tsym214822* threadlocal_378483;
					Tnode214790* LOC59;
					Tnode214790* LOC60;
					Tnode214790* LOC61;
					LOC50 = 0;
					size = computesize_240121(argtype);
					LOC51 = 0;
					LOC51 = (size < IL64(0));
					if (LOC51) goto LA52;
					LOC51 = (IL64(16) < size);
					LA52: ;
					LOC50 = LOC51;
					if (!(LOC50)) goto LA53;
					LOC54 = 0;
					LOC54 = getroot_378330(n);
					LOC50 = !((LOC54 == NIM_NIL));
					LA53: ;
					if (!LOC50) goto LA55;
					a = genaddrof_377840(n);
					asgnRefNoCycle((void**) (&(*field).typ), (*a).typ);
					addfield_376603(objtype, field);
					LOC57 = 0;
					LOC57 = newdotexpr_377002(scratchobj, field);
					LOC58 = 0;
					LOC58 = newfastasgnstmt_376032(LOC57, a);
					add_215114(result, LOC58);
					LOC59 = 0;
					LOC59 = indirectaccess_377826(castexpr, field, (*n).info);
					threadlocal_378483 = addlocalvar_377992(varsection, NIM_NIL, (*objtype).owner, (*field).typ, LOC59, NIM_TRUE);
					LOC60 = 0;
					LOC60 = newsymnode_216234(threadlocal_378483);
					LOC61 = 0;
					LOC61 = genderef_377845(LOC60);
					add_215114(call, LOC61);
				}
				goto LA21;
				LA55: ;
				{
					Tnode214790* LOC63;
					Tnode214790* LOC64;
					Tsym214822* threadlocal_378489;
					Tnode214790* LOC65;
					Tnode214790* LOC66;
					asgnRefNoCycle((void**) (&(*field).typ), argtype);
					addfield_376603(objtype, field);
					LOC63 = 0;
					LOC63 = newdotexpr_377002(scratchobj, field);
					LOC64 = 0;
					LOC64 = newfastasgnstmt_376032(LOC63, n);
					add_215114(result, LOC64);
					LOC65 = 0;
					LOC65 = indirectaccess_377826(castexpr, field, (*n).info);
					threadlocal_378489 = addlocalvar_377992(varsection, varinit, (*objtype).owner, (*field).typ, LOC65, NIM_TRUE);
					LOC66 = 0;
					LOC66 = newsymnode_216234(threadlocal_378489);
					add_215114(call, LOC66);
				}
				LA21: ;
				res_378496 += ((NI) 1);
			} LA5: ;
		}
	}
}

N_NIMCALL(Tnode214790*, callproc_377932)(Tnode214790* a) {
	Tnode214790* result;
	result = 0;
	result = newnodei_216248(((NU8) 27), (*a).info);
	add_215114(result, a);
	asgnRefNoCycle((void**) (&(*result).typ), (*(*a).typ).sons->data[((NI) 0)]);
	return result;
}

N_NIMCALL(Tnode214790*, callcodegenproc_377850)(NimStringDesc* name, Tnode214790* arg1, Tnode214790* arg2, Tnode214790* arg3, Tnode214790* optionalargs) {
	Tnode214790* result;
	Tsym214822* sym;
	result = 0;
	result = newnodei_216248(((NU8) 27), (*arg1).info);
	sym = getcompilerproc_258746(name);
	{
		if (!(sym == NIM_NIL)) goto LA3;
		localerror_187080((*arg1).info, ((NU16) 68), name);
	}
	goto LA1;
	LA3: ;
	{
		Tnode214790* LOC6;
		LOC6 = 0;
		LOC6 = newsymnode_216234(sym);
		add_215114(result, LOC6);
		add_215114(result, arg1);
		{
			if (!!((arg2 == NIM_NIL))) goto LA9;
			add_215114(result, arg2);
		}
		LA9: ;
		{
			if (!!((arg3 == NIM_NIL))) goto LA13;
			add_215114(result, arg3);
		}
		LA13: ;
		{
			if (!!((optionalargs == NIM_NIL))) goto LA17;
			{
				NI i_377921;
				NI HEX3Atmp_377925;
				NI LOC20;
				NI res_377928;
				i_377921 = 0;
				HEX3Atmp_377925 = 0;
				LOC20 = 0;
				LOC20 = len_215059(optionalargs);
				HEX3Atmp_377925 = (NI)(LOC20 - ((NI) 3));
				res_377928 = ((NI) 1);
				{
					while (1) {
						Tnode214790* LOC23;
						if (!(res_377928 <= HEX3Atmp_377925)) goto LA22;
						i_377921 = res_377928;
						LOC23 = 0;
						LOC23 = HEX5BHEX5D_215238(optionalargs, i_377921);
						add_215114(result, LOC23);
						res_377928 += ((NI) 1);
					} LA22: ;
				}
			}
		}
		LA17: ;
		asgnRefNoCycle((void**) (&(*result).typ), (*(*sym).typ).sons->data[((NI) 0)]);
	}
	LA1: ;
	return result;
}

N_NIMCALL(NU8, flowvarkind_377952)(Ttype214828* t) {
	NU8 result;
	result = 0;
	{
		Ttype214828* LOC3;
		LOC3 = 0;
		LOC3 = skiptypes_218113(t, IL64(211106232576256));
		if (!((*LOC3).kind == ((NU8) 22) || (*LOC3).kind == ((NU8) 28) || (*LOC3).kind == ((NU8) 24))) goto LA4;
		result = ((NU8) 1);
	}
	goto LA1;
	LA4: ;
	{
		NIM_BOOL LOC7;
		LOC7 = 0;
		LOC7 = containsgarbagecollectedref_240106(t);
		if (!LOC7) goto LA8;
		result = ((NU8) 0);
	}
	goto LA1;
	LA8: ;
	{
		result = ((NU8) 2);
	}
	LA1: ;
	return result;
}

N_NIMCALL(Tsym214822*, createwrapperproc_378045)(Tnode214790* f, Tsym214822* threadparam, Tsym214822* argsparam, Tnode214790* varsection, Tnode214790* varinit, Tnode214790* call, Tnode214790* barrier, Tnode214790* fv, NU8 spawnkind) {
	Tsym214822* result;
	Tnode214790* body;
	Tsym214822* threadlocalbarrier;
	Tsym214822* threadlocalprom;
	Tnode214790* LOC29;
	Tnode214790* LOC30;
	Tnode214790* params;
	Tnode214790* LOC75;
	Tnode214790* LOC76;
	Ttype214828* t;
	Tnode214790* LOC77;
	Tnode214790* LOC78;
	Tnode214790* LOC79;
	NimStringDesc* name;
	NimStringDesc* LOC80;
	NimStringDesc* LOC81;
	Tident189012* LOC87;
	Tnode214790* LOC88;
	result = 0;
	body = newnodei_216248(((NU8) 115), (*f).info);
	threadlocalbarrier = 0;
	{
		Tnode214790* varsection2;
		Tnode214790* LOC5;
		Tnode214790* LOC6;
		if (!!((barrier == NIM_NIL))) goto LA3;
		varsection2 = newnodei_216248(((NU8) 99), (*barrier).info);
		threadlocalbarrier = addlocalvar_377992(varsection2, NIM_NIL, (*argsparam).owner, (*barrier).typ, barrier, NIM_FALSE);
		add_215114(body, varsection2);
		LOC5 = 0;
		LOC5 = newsymnode_216234(threadlocalbarrier);
		LOC6 = 0;
		LOC6 = callcodegenproc_377850(((NimStringDesc*) &TMP4254), LOC5, NIM_NIL, NIM_NIL, NIM_NIL);
		add_215114(body, LOC6);
	}
	LA3: ;
	threadlocalprom = 0;
	{
		if (!(spawnkind == ((NU8) 2))) goto LA9;
		threadlocalprom = addlocalvar_377992(varsection, NIM_NIL, (*argsparam).owner, (*fv).typ, fv, NIM_FALSE);
	}
	goto LA7;
	LA9: ;
	{
		if (!!((fv == NIM_NIL))) goto LA12;
		{
			NimStringDesc* LOC18;
			if (!!(((*(*fv).typ).kind == ((NU8) 11)))) goto LA16;
			LOC18 = 0;
			LOC18 = HEX24_187183(TMP4255);
			internalerror_187113(LOC18);
		}
		LA16: ;
		threadlocalprom = addlocalvar_377992(varsection, NIM_NIL, (*argsparam).owner, (*fv).typ, fv, NIM_FALSE);
	}
	goto LA7;
	LA12: ;
	LA7: ;
	add_215114(body, varsection);
	add_215114(body, varinit);
	{
		NIM_BOOL LOC21;
		Tnode214790* LOC25;
		Tnode214790* LOC26;
		Tnode214790* LOC27;
		Tnode214790* LOC28;
		LOC21 = 0;
		LOC21 = !((fv == NIM_NIL));
		if (!(LOC21)) goto LA22;
		LOC21 = !((spawnkind == ((NU8) 2)));
		LA22: ;
		if (!LOC21) goto LA23;
		LOC25 = 0;
		LOC25 = newsymnode_216234(threadlocalprom);
		LOC26 = 0;
		LOC26 = indirectaccess_377202(LOC25, ((NimStringDesc*) &TMP4256), (*fv).info);
		LOC27 = 0;
		LOC27 = newsymnode_216234(threadparam);
		LOC28 = 0;
		LOC28 = newasgnstmt_376025(LOC26, LOC27);
		add_215114(body, LOC28);
	}
	LA23: ;
	LOC29 = 0;
	LOC29 = newsymnode_216234(threadparam);
	LOC30 = 0;
	LOC30 = callcodegenproc_377850(((NimStringDesc*) &TMP4257), LOC29, NIM_NIL, NIM_NIL, NIM_NIL);
	add_215114(body, LOC30);
	{
		Tnode214790* LOC35;
		Tnode214790* LOC36;
		Tnode214790* LOC37;
		if (!(spawnkind == ((NU8) 2))) goto LA33;
		LOC35 = 0;
		LOC35 = newsymnode_216234(threadlocalprom);
		LOC36 = 0;
		LOC36 = genderef_377845(LOC35);
		LOC37 = 0;
		LOC37 = newasgnstmt_376025(LOC36, call);
		add_215114(body, LOC37);
	}
	goto LA31;
	LA33: ;
	{
		NU8 fk;
		Tnode214790* LOC47;
		NimStringDesc* LOC48;
		Tnode214790* LOC54;
		Tnode214790* LOC55;
		if (!!((fv == NIM_NIL))) goto LA39;
		fk = flowvarkind_377952((*(*fv).typ).sons->data[((NI) 1)]);
		{
			NimStringDesc* LOC45;
			NimStringDesc* LOC46;
			if (!(fk == ((NU8) 0))) goto LA43;
			LOC45 = 0;
			LOC46 = 0;
			LOC46 = typetostring_240017((*(*fv).typ).sons->data[((NI) 1)], ((NU8) 0));
			LOC45 = rawNewString(LOC46->Sup.len + 33);
appendString(LOC45, ((NimStringDesc*) &TMP4258));
appendString(LOC45, LOC46);
			localerror_187085((*f).info, LOC45);
		}
		LA43: ;
		LOC47 = 0;
		LOC47 = newsymnode_216234(threadlocalprom);
		LOC48 = 0;
		{
			if (!(fk == ((NU8) 1))) goto LA51;
			LOC48 = copyString(((NimStringDesc*) &TMP4259));
		}
		goto LA49;
		LA51: ;
		{
			LOC48 = copyString(((NimStringDesc*) &TMP4260));
		}
		LA49: ;
		LOC54 = 0;
		LOC54 = indirectaccess_377202(LOC47, LOC48, (*fv).info);
		LOC55 = 0;
		LOC55 = newasgnstmt_376025(LOC54, call);
		add_215114(body, LOC55);
		{
			Tnode214790* increfcall;
			Tsym214822* LOC60;
			Tnode214790* LOC61;
			if (!(fk == ((NU8) 1))) goto LA58;
			increfcall = newnodei_216401(((NU8) 27), (*fv).info, ((NI) 2));
			LOC60 = 0;
			LOC60 = createmagic_219600(((NimStringDesc*) &TMP4261), ((NU8) 42));
			asgnRefNoCycle((void**) (&(*increfcall).kindU.S6.sons->data[((NI) 0)]), newsymnode_216234(LOC60));
			LOC61 = 0;
			LOC61 = newsymnode_216234(threadlocalprom);
			asgnRefNoCycle((void**) (&(*increfcall).kindU.S6.sons->data[((NI) 1)]), indirectaccess_377202(LOC61, ((NimStringDesc*) &TMP4259), (*fv).info));
			add_215114(body, increfcall);
		}
		LA58: ;
		{
			Tnode214790* LOC66;
			Tnode214790* LOC67;
			if (!(barrier == NIM_NIL)) goto LA64;
			LOC66 = 0;
			LOC66 = newsymnode_216234(threadlocalprom);
			LOC67 = 0;
			LOC67 = callcodegenproc_377850(((NimStringDesc*) &TMP4262), LOC66, NIM_NIL, NIM_NIL, NIM_NIL);
			add_215114(body, LOC67);
		}
		LA64: ;
	}
	goto LA31;
	LA39: ;
	{
		add_215114(body, call);
	}
	LA31: ;
	{
		Tnode214790* LOC73;
		Tnode214790* LOC74;
		if (!!((barrier == NIM_NIL))) goto LA71;
		LOC73 = 0;
		LOC73 = newsymnode_216234(threadlocalbarrier);
		LOC74 = 0;
		LOC74 = callcodegenproc_377850(((NimStringDesc*) &TMP4263), LOC73, NIM_NIL, NIM_NIL, NIM_NIL);
		add_215114(body, LOC74);
	}
	LA71: ;
	params = newnodei_216248(((NU8) 76), (*f).info);
	add_215114(params, emptynode_215801);
	LOC75 = 0;
	LOC75 = newsymnode_216234(threadparam);
	add_215114(params, LOC75);
	LOC76 = 0;
	LOC76 = newsymnode_216234(argsparam);
	add_215114(params, LOC76);
	t = newtype_217107(((NU8) 25), (*threadparam).owner);
	rawaddson_218408(t, NIM_NIL);
	rawaddson_218408(t, (*threadparam).typ);
	rawaddson_218408(t, (*argsparam).typ);
	asgnRefNoCycle((void**) (&(*t).n), newnodei_216248(((NU8) 76), (*f).info));
	LOC77 = 0;
	LOC77 = newnodei_216248(((NU8) 152), (*f).info);
	add_215114((*t).n, LOC77);
	LOC78 = 0;
	LOC78 = newsymnode_216234(threadparam);
	add_215114((*t).n, LOC78);
	LOC79 = 0;
	LOC79 = newsymnode_216234(argsparam);
	add_215114((*t).n, LOC79);
	LOC80 = 0;
	LOC81 = 0;
	{
		if (!((*f).kind == ((NU8) 3))) goto LA84;
		LOC81 = copyString((*(*(*f).kindU.S4.sym).name).s);
	}
	goto LA82;
	LA84: ;
	{
		LOC81 = copyString(((NimStringDesc*) &TMP2936));
	}
	LA82: ;
	LOC80 = rawNewString(LOC81->Sup.len + 7);
appendString(LOC80, LOC81);
appendString(LOC80, ((NimStringDesc*) &TMP4264));
	name = LOC80;
	LOC87 = 0;
	LOC87 = getident_189441(name);
	result = newsym_215684(((NU8) 12), LOC87, (*argsparam).owner, (*f).info);
	LOC88 = 0;
	LOC88 = newsymnode_216234(result);
	asgnRefNoCycle((void**) (&(*result).ast), newprocnode_217040(((NU8) 79), (*f).info, body, params, LOC88, emptynode_215801, emptynode_215801, emptynode_215801, emptynode_215801));
	asgnRefNoCycle((void**) (&(*result).typ), t);
	return result;
}

N_NIMCALL(Tnode214790*, wrapprocforspawn_378500)(Tsym214822* owner, Tnode214790* spawnexpr, Ttype214828* rettype, Tnode214790* barrier, Tnode214790* dest) {
	Tnode214790* result;
	Tnode214790* n;
	NI LOC1;
	NU8 spawnkind;
	Tsym214822* threadparam;
	Tident189012* LOC32;
	Tsym214822* argsparam;
	Tident189012* LOC33;
	Ttype214828* objtype;
	Tnode214790* castexpr;
	Tsym214822* scratchobj;
	Tident189012* LOC35;
	Tnode214790* call;
	Tnode214790* fn;
	Tnode214790* varsection;
	Tnode214790* varinit;
	Tnode214790* barrierasexpr;
	Tnode214790* fvfield;
	Tnode214790* fvasexpr;
	Tsym214822* wrapper;
	NimStringDesc* LOC91;
	NI LOC92;
	NimStringDesc* LOC93;
	Tnode214790* LOC94;
	Tnode214790* LOC95;
	Tnode214790* LOC96;
	Tnode214790* LOC97;
{	result = 0;
	LOC1 = 0;
	LOC1 = len_215059(spawnexpr);
	n = HEX5BHEX5D_215238(spawnexpr, (NI)(LOC1 - ((NI) 2)));
	spawnkind = spawnresult_377947(rettype, !((barrier == NIM_NIL)));
	switch (spawnkind) {
	case ((NU8) 0):
	{
		{
			NimStringDesc* LOC7;
			if (!!((dest == NIM_NIL))) goto LA5;
			LOC7 = 0;
			LOC7 = HEX24_187183(TMP4236);
			internalerror_187113(LOC7);
		}
		LA5: ;
		result = newnodei_216248(((NU8) 115), (*n).info);
	}
	break;
	case ((NU8) 1):
	{
		{
			NimStringDesc* LOC13;
			if (!!((dest == NIM_NIL))) goto LA11;
			LOC13 = 0;
			LOC13 = HEX24_187183(TMP4237);
			internalerror_187113(LOC13);
		}
		LA11: ;
		result = newnodeit_216801(((NU8) 126), (*n).info, rettype);
	}
	break;
	case ((NU8) 2):
	{
		{
			if (!(dest == NIM_NIL)) goto LA17;
			localerror_187085((*n).info, ((NimStringDesc*) &TMP4238));
		}
		LA17: ;
		result = newnodei_216248(((NU8) 115), (*n).info);
	}
	break;
	}
	{
		if (!!(((*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)))) goto LA21;
		localerror_187085((*n).info, ((NimStringDesc*) &TMP4239));
		goto BeforeRet;
	}
	LA21: ;
	{
		if (!((gglobaloptions_160121 &(1U<<((NU)(((NU8) 24))&31U)))!=0)) goto LA25;
		{
			Tnode214790* LOC29;
			LOC29 = 0;
			LOC29 = HEX5BHEX5D_215238(n, ((NI) 0));
			if (!((130 & (*(*LOC29).typ).flags) == 0)) goto LA30;
			localerror_187085((*n).info, ((NimStringDesc*) &TMP4240));
		}
		LA30: ;
	}
	LA25: ;
	LOC32 = 0;
	LOC32 = getident_189441(((NimStringDesc*) &TMP4241));
	threadparam = newsym_215684(((NU8) 3), LOC32, owner, (*n).info);
	LOC33 = 0;
	LOC33 = getident_189441(((NimStringDesc*) &TMP4242));
	argsparam = newsym_215684(((NU8) 3), LOC33, owner, (*n).info);
	{
		Ttype214828* ptrtype;
		ptrtype = getsystype_258130(((NU8) 26));
		asgnRefNoCycle((void**) (&(*threadparam).typ), ptrtype);
		asgnRefNoCycle((void**) (&(*argsparam).typ), ptrtype);
		(*argsparam).position = ((NI) 1);
	}
	objtype = createobj_376328(owner, (*n).info);
	(*objtype).flags |= ((NU32)1)<<((((NU8) 2))%(sizeof(NU32)*8));
	castexpr = createcastexpr_378263(argsparam, objtype);
	LOC35 = 0;
	LOC35 = getident_189441(((NimStringDesc*) &TMP4243));
	scratchobj = newsym_215684(((NU8) 8), LOC35, owner, (*n).info);
	{
		Tnode214790* varsectionb;
		Tnode214790* LOC37;
		asgnRefNoCycle((void**) (&(*scratchobj).typ), objtype);
		(*scratchobj).flags |= ((NU32)1)<<((((NU8) 2))%(sizeof(NU32)*8));
		varsectionb = newnodei_216248(((NU8) 99), (*n).info);
		LOC37 = 0;
		LOC37 = newsymnode_216234(scratchobj);
		addvar_376017(varsectionb, LOC37);
		add_215114(result, varsectionb);
	}
	call = newnodeit_216801(((NU8) 27), (*n).info, (*n).typ);
	fn = (*n).kindU.S6.sons->data[((NI) 0)];
	{
		NIM_BOOL LOC40;
		Ttype214828* argtype;
		Tnode214790* LOC44;
		Tsym214822* field;
		Tident189012* LOC45;
		Tnode214790* LOC46;
		Tnode214790* LOC47;
		Tnode214790* LOC48;
		LOC40 = 0;
		LOC40 = ((*fn).kind == ((NU8) 3));
		if (!(LOC40)) goto LA41;
		LOC40 = ((241664 &(1U<<((NU)((*(*fn).kindU.S4.sym).kind)&31U)))!=0);
		LA41: ;
		if (!!(LOC40)) goto LA42;
		LOC44 = 0;
		LOC44 = HEX5BHEX5D_215238(n, ((NI) 0));
		argtype = skiptypes_218113((*LOC44).typ, IL64(211106232576256));
		LOC45 = 0;
		LOC45 = getident_189441(((NimStringDesc*) &TMP4244));
		field = newsym_215684(((NU8) 18), LOC45, owner, (*n).info);
		asgnRefNoCycle((void**) (&(*field).typ), argtype);
		addfield_376603(objtype, field);
		LOC46 = 0;
		LOC46 = newdotexpr_377002(scratchobj, field);
		LOC47 = 0;
		LOC47 = HEX5BHEX5D_215238(n, ((NI) 0));
		LOC48 = 0;
		LOC48 = newfastasgnstmt_376032(LOC46, LOC47);
		add_215114(result, LOC48);
		fn = indirectaccess_377826(castexpr, field, (*n).info);
	}
	goto LA38;
	LA42: ;
	{
		NIM_BOOL LOC50;
		LOC50 = 0;
		LOC50 = ((*fn).kind == ((NU8) 3));
		if (!(LOC50)) goto LA51;
		LOC50 = ((*(*fn).kindU.S4.sym).kind == ((NU8) 14));
		LA51: ;
		if (!LOC50) goto LA52;
		localerror_187085((*n).info, ((NimStringDesc*) &TMP4245));
	}
	goto LA38;
	LA52: ;
	{
		if (!((*(*fn).typ).callconv == ((NU8) 8))) goto LA55;
		localerror_187085((*n).info, ((NimStringDesc*) &TMP4246));
	}
	goto LA38;
	LA55: ;
	LA38: ;
	add_215114(call, fn);
	varsection = newnodei_216248(((NU8) 99), (*n).info);
	varinit = newnodei_216248(((NU8) 115), (*n).info);
	{
		if (!barrier == 0) goto LA59;
		setupargsforconcurrency_378271(n, objtype, scratchobj, castexpr, call, varsection, varinit, result);
	}
	goto LA57;
	LA59: ;
	{
		setupargsforparallelism_378380(n, objtype, scratchobj, castexpr, call, varsection, varinit, result);
	}
	LA57: ;
	barrierasexpr = NIM_NIL;
	{
		Ttype214828* typ;
		Tsym214822* LOC66;
		Tsym214822* field;
		Tident189012* LOC67;
		Tnode214790* LOC68;
		Tnode214790* LOC69;
		if (!!((barrier == NIM_NIL))) goto LA64;
		typ = newtype_217107(((NU8) 21), owner);
		LOC66 = 0;
		LOC66 = getcompilerproc_258746(((NimStringDesc*) &TMP4250));
		rawaddson_218408(typ, (*LOC66).typ);
		LOC67 = 0;
		LOC67 = getident_189441(((NimStringDesc*) &TMP4251));
		field = newsym_215684(((NU8) 18), LOC67, owner, (*n).info);
		asgnRefNoCycle((void**) (&(*field).typ), typ);
		addfield_376603(objtype, field);
		LOC68 = 0;
		LOC68 = newdotexpr_377002(scratchobj, field);
		LOC69 = 0;
		LOC69 = newfastasgnstmt_376032(LOC68, barrier);
		add_215114(result, LOC69);
		barrierasexpr = indirectaccess_377826(castexpr, field, (*n).info);
	}
	LA64: ;
	fvfield = NIM_NIL;
	fvasexpr = NIM_NIL;
	{
		Tsym214822* field;
		Tident189012* LOC74;
		NI LOC75;
		Tnode214790* LOC76;
		Tnode214790* LOC77;
		Tnode214790* LOC78;
		if (!(spawnkind == ((NU8) 1))) goto LA72;
		LOC74 = 0;
		LOC74 = getident_189441(((NimStringDesc*) &TMP4252));
		field = newsym_215684(((NU8) 18), LOC74, owner, (*n).info);
		asgnRefNoCycle((void**) (&(*field).typ), rettype);
		addfield_376603(objtype, field);
		fvfield = newdotexpr_377002(scratchobj, field);
		fvasexpr = indirectaccess_377826(castexpr, field, (*n).info);
		LOC75 = 0;
		LOC75 = len_215059(spawnexpr);
		LOC76 = 0;
		LOC76 = HEX5BHEX5D_215238(spawnexpr, (NI)(LOC75 - ((NI) 1)));
		LOC77 = 0;
		LOC77 = callproc_377932(LOC76);
		LOC78 = 0;
		LOC78 = newfastasgnstmt_376032(fvfield, LOC77);
		add_215114(result, LOC78);
		{
			Tnode214790* LOC83;
			if (!(barrier == NIM_NIL)) goto LA81;
			LOC83 = 0;
			LOC83 = callcodegenproc_377850(((NimStringDesc*) &TMP4253), fvfield, NIM_NIL, NIM_NIL, NIM_NIL);
			add_215114(result, LOC83);
		}
		LA81: ;
	}
	goto LA70;
	LA72: ;
	{
		Tsym214822* field;
		Tident189012* LOC87;
		Tnode214790* LOC88;
		Tnode214790* LOC89;
		Tnode214790* LOC90;
		if (!(spawnkind == ((NU8) 2))) goto LA85;
		LOC87 = 0;
		LOC87 = getident_189441(((NimStringDesc*) &TMP4252));
		field = newsym_215684(((NU8) 18), LOC87, owner, (*n).info);
		asgnRefNoCycle((void**) (&(*field).typ), newtype_217107(((NU8) 21), (*objtype).owner));
		rawaddson_218408((*field).typ, rettype);
		addfield_376603(objtype, field);
		fvasexpr = indirectaccess_377826(castexpr, field, (*n).info);
		LOC88 = 0;
		LOC88 = newdotexpr_377002(scratchobj, field);
		LOC89 = 0;
		LOC89 = genaddrof_377840(dest);
		LOC90 = 0;
		LOC90 = newfastasgnstmt_376032(LOC88, LOC89);
		add_215114(result, LOC90);
	}
	goto LA70;
	LA85: ;
	LA70: ;
	wrapper = createwrapperproc_378045(fn, threadparam, argsparam, varsection, varinit, call, barrierasexpr, fvasexpr, spawnkind);
	LOC91 = 0;
	LOC92 = 0;
	LOC92 = len_215059(spawnexpr);
	LOC93 = 0;
	LOC93 = nimIntToStr(LOC92);
	LOC91 = rawNewString(LOC93->Sup.len + 8);
appendString(LOC91, ((NimStringDesc*) &TMP4265));
appendString(LOC91, LOC93);
	LOC94 = 0;
	LOC94 = newsymnode_216234(wrapper);
	LOC95 = 0;
	LOC95 = newsymnode_216234(scratchobj);
	LOC96 = 0;
	LOC96 = genaddrof_377840(LOC95);
	LOC97 = 0;
	LOC97 = callcodegenproc_377850(LOC91, LOC94, LOC96, NIM_NIL, spawnexpr);
	add_215114(result, LOC97);
	{
		if (!(spawnkind == ((NU8) 1))) goto LA100;
		add_215114(result, fvfield);
	}
	LA100: ;
	}BeforeRet: ;
	return result;
}
NIM_EXTERNC N_NOINLINE(void, compiler_loweringsInit000)(void) {
}

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

