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

#include "nimbase.h"
#include <string.h>
typedef struct Tnode224809 Tnode224809;
typedef struct Tsym224841 Tsym224841;
typedef struct Tlineinfo189352 Tlineinfo189352;
typedef struct Ttype224847 Ttype224847;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tident197021 Tident197021;
typedef struct Tnodeseq224803 Tnodeseq224803;
typedef struct Tidobj197015 Tidobj197015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttypeseq224843 Ttypeseq224843;
typedef struct Tscope224835 Tscope224835;
typedef struct TY224944 TY224944;
typedef struct Tstrtable224813 Tstrtable224813;
typedef struct Tsymseq224811 Tsymseq224811;
typedef struct Tloc224823 Tloc224823;
typedef struct Ropeobj175009 Ropeobj175009;
typedef struct Tlib224827 Tlib224827;
typedef struct Cell48947 Cell48947;
typedef struct Cellseq48963 Cellseq48963;
typedef struct Gcheap51018 Gcheap51018;
typedef struct Gcstack51016 Gcstack51016;
typedef struct Cellset48959 Cellset48959;
typedef struct Pagedesc48955 Pagedesc48955;
typedef struct Memregion30891 Memregion30891;
typedef struct Smallchunk30843 Smallchunk30843;
typedef struct Llchunk30885 Llchunk30885;
typedef struct Bigchunk30845 Bigchunk30845;
typedef struct Intset30817 Intset30817;
typedef struct Trunk30813 Trunk30813;
typedef struct Avlnode30889 Avlnode30889;
typedef struct Gcstat51014 Gcstat51014;
typedef struct TY90959 TY90959;
typedef struct Tinstantiation224831 Tinstantiation224831;
typedef struct Tlistentry140022 Tlistentry140022;
typedef struct Basechunk30841 Basechunk30841;
typedef struct Freecell30833 Freecell30833;
typedef struct TY224932 TY224932;
struct  Tlineinfo189352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tnode224809  {
Ttype224847* typ;
Tlineinfo189352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym224841* sym;
} S4;
struct {Tident197021* ident;
} S5;
struct {Tnodeseq224803* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
typedef N_NIMCALL_PTR(void, TY3889) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3894) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3889 marker;
TY3894 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Tidobj197015  {
  TNimObject Sup;
NI id;
};
struct  Tstrtable224813  {
NI counter;
Tsymseq224811* data;
};
struct  Tloc224823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype224847* t;
Ropeobj175009* r;
Ropeobj175009* heaproot;
};
struct  Tsym224841  {
  Tidobj197015 Sup;
NU8 kind;
union{
struct {Ttypeseq224843* typeinstcache;
Tscope224835* typscope;
} S1;
struct {TY224944* procinstcache;
Tsym224841* gcunsafetyreason;
} S2;
struct {TY224944* usedgenerics;
Tstrtable224813 tab;
} S3;
struct {Tsym224841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype224847* typ;
Tident197021* name;
Tlineinfo189352 info;
Tsym224841* owner;
NU32 flags;
Tnode224809* ast;
NU32 options;
NI position;
NI offset;
Tloc224823 loc;
Tlib224827* annex;
Tnode224809* constraint;
};
struct  Cell48947  {
NI refcount;
TNimType* typ;
};
struct  Cellseq48963  {
NI len;
NI cap;
Cell48947** d;
};
struct  Cellset48959  {
NI counter;
NI max;
Pagedesc48955* head;
Pagedesc48955** data;
};
typedef Smallchunk30843* TY30906[512];
typedef Trunk30813* Trunkbuckets30815[256];
struct  Intset30817  {
Trunkbuckets30815 data;
};
struct  Memregion30891  {
NI minlargeobj;
NI maxlargeobj;
TY30906 freesmallchunks;
Llchunk30885* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk30845* freechunkslist;
Intset30817 chunkstarts;
Avlnode30889* root;
Avlnode30889* deleted;
Avlnode30889* last;
Avlnode30889* freeavlnodes;
};
struct  Gcstat51014  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap51018  {
Gcstack51016* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq48963 zct;
Cellseq48963 decstack;
Cellset48959 cycleroots;
Cellseq48963 tempstack;
NI recgclock;
Memregion30891 region;
Gcstat51014 stat;
};
struct  Ttype224847  {
  Tidobj197015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq224843* sons;
Tnode224809* n;
Tsym224841* owner;
Tsym224841* sym;
Tsym224841* destructor;
Tsym224841* deepcopy;
Tsym224841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc224823 loc;
};
struct  Tident197021  {
  Tidobj197015 Sup;
NimStringDesc* s;
Tident197021* next;
NI h;
};
struct TY90959 {
NimStringDesc* Field0;
NI Field1;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Tscope224835  {
NI depthlevel;
Tstrtable224813 symbols;
Tnodeseq224803* usingsyms;
Tscope224835* parent;
};
struct  Ropeobj175009  {
  TNimObject Sup;
Ropeobj175009* left;
Ropeobj175009* right;
NI length;
NimStringDesc* data;
};
struct  Tlistentry140022  {
  TNimObject Sup;
Tlistentry140022* prev;
Tlistentry140022* next;
};
struct  Tlib224827  {
  Tlistentry140022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj175009* name;
Tnode224809* path;
};
struct  Gcstack51016  {
Gcstack51016* prev;
Gcstack51016* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY30822[8];
struct  Pagedesc48955  {
Pagedesc48955* next;
NI key;
TY30822 bits;
};
struct  Basechunk30841  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk30843  {
  Basechunk30841 Sup;
Smallchunk30843* next;
Smallchunk30843* prev;
Freecell30833* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk30885  {
NI size;
NI acc;
Llchunk30885* next;
};
struct  Bigchunk30845  {
  Basechunk30841 Sup;
Bigchunk30845* next;
Bigchunk30845* prev;
NI align;
NF data;
};
struct  Trunk30813  {
Trunk30813* next;
NI key;
TY30822 bits;
};
typedef Avlnode30889* TY30896[2];
struct  Avlnode30889  {
TY30896 link;
NI key;
NI upperbound;
NI level;
};
struct  Tinstantiation224831  {
Tsym224841* sym;
Ttypeseq224843* concretetypes;
TY224932* usedby;
NI compilesid;
};
struct  Freecell30833  {
Freecell30833* next;
NI zerofield;
};
struct Tnodeseq224803 {
  TGenericSeq Sup;
  Tnode224809* data[SEQ_DECL_SIZE];
};
struct Ttypeseq224843 {
  TGenericSeq Sup;
  Ttype224847* data[SEQ_DECL_SIZE];
};
struct TY224944 {
  TGenericSeq Sup;
  Tinstantiation224831* data[SEQ_DECL_SIZE];
};
struct Tsymseq224811 {
  TGenericSeq Sup;
  Tsym224841* data[SEQ_DECL_SIZE];
};
struct TY224932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(Tnode224809*, newnodei_226351)(NU8 kind, Tlineinfo189352 info);
N_NIMCALL(Tsym224841*, newsym_225655)(NU8 symkind, Tident197021* name, Tsym224841* owner, Tlineinfo189352 info);
N_NIMCALL(Tident197021*, getident_197463)(NimStringDesc* identifier);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
static N_INLINE(Cell48947*, usrtocell_52646)(void* usr);
static N_INLINE(void, rtladdzct_54204)(Cell48947* c);
N_NOINLINE(void, addzct_52617)(Cellseq48963* s, Cell48947* c);
N_NIMCALL(Tnode224809*, newsymnode_226325)(Tsym224841* sym);
N_NIMCALL(Tnode224809*, newnodei_226407)(NU8 kind, Tlineinfo189352 info, NI children);
static N_INLINE(Tnode224809*, HEX5BHEX5D_225244)(Tnode224809* n, NI i);
N_NIMCALL(void, addson_226819)(Tnode224809* father, Tnode224809* son);
N_NIMCALL(void, add_225165)(Tnode224809* father, Tnode224809* son);
N_NIMCALL(Tnode224809*, newfastasgnstmt_401074)(Tnode224809* le, Tnode224809* ri);
N_NIMCALL(Tnode224809*, lastson_227406)(Tnode224809* n);
N_NIMCALL(Ttype224847*, skiptypes_228167)(Ttype224847* t, NU64 kinds);
N_NIMCALL(void, addvar_401047)(Tnode224809* father, Tnode224809* v);
N_NIMCALL(Tnode224809*, newasgnstmt_401061)(Tnode224809* le, Tnode224809* ri);
static N_INLINE(NI, len_225098)(Tnode224809* n);
N_NIMCALL(Tnode224809*, newtupleaccess_401034)(Tnode224809* tup, NI i);
N_NIMCALL(Tnode224809*, newnodeit_226807)(NU8 kind, Tlineinfo189352 info, Ttype224847* typ);
N_NIMCALL(Tnode224809*, copytree_229028)(Tnode224809* src);
N_NIMCALL(Ttype224847*, getsystype_273190)(NU8 kind);
N_NIMCALL(Ttype224847*, newtype_227140)(NU8 kind, Tsym224841* owner);
N_NIMCALL(void, rawaddson_228498)(Ttype224847* father, Ttype224847* son);
N_NIMCALL(NI, sonslen_227387)(Tnode224809* n);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
static N_INLINE(Ttype224847*, skipintlit_273698)(Ttype224847* t);
N_NIMCALL(Tsym224841*, lookupinrecord_232236)(Tnode224809* n, Tident197021* field);
N_NIMCALL(Tnode224809*, indirectaccess_402408)(Tnode224809* a, NimStringDesc* b, Tlineinfo189352 info);
N_NIMCALL(Tsym224841*, getsymfromlist_232228)(Tnode224809* list, Tident197021* ident, NI start);
N_NIMCALL(void, internalerror_195191)(NimStringDesc* errmsg);
N_NIMCALL(NimStringDesc*, HEX24_195279)(TY90959 x);
N_NIMCALL(Tnode224809*, newidentnode_226313)(Tident197021* ident, Tlineinfo189352 info);
N_NIMCALL(Tnode224809*, newtupleaccessraw_401270)(Tnode224809* tup, NI i);
N_NIMCALL(Tnode224809*, newintnode_225607)(NU8 kind, NI64 intval);
N_NIMCALL(Tnode224809*, newintlit_403681)(NI64 value);
N_NIMCALL(NI64, lastord_254010)(Ttype224847* t);
N_NIMCALL(Tsym224841*, createmagic_230048)(NimStringDesc* name, NU8 m);
static N_INLINE(NIM_BOOL, isemptytype_229933)(Ttype224847* t);
N_NIMCALL(NIM_BOOL, containsgarbagecollectedref_254154)(Ttype224847* typ);
N_NIMCALL(NU8, spawnresult_403208)(Ttype224847* t, NIM_BOOL inparallel);
N_NIMCALL(void, localerror_195139)(Tlineinfo189352 info, NimStringDesc* arg);
N_NIMCALL(Ttype224847*, createobj_401372)(Tsym224841* owner, Tlineinfo189352 info);
N_NIMCALL(Tnode224809*, createcastexpr_403557)(Tsym224841* argsparam, Ttype224847* objtype);
N_NIMCALL(void, addfield_401809)(Ttype224847* obj, Tsym224841* s);
N_NIMCALL(Tnode224809*, newdotexpr_402208)(Tsym224841* obj, Tsym224841* b);
N_NIMCALL(Tnode224809*, indirectaccess_403038)(Tnode224809* a, Tsym224841* b, Tlineinfo189352 info);
N_NIMCALL(void, setupargsforconcurrency_403571)(Tnode224809* n, Ttype224847* objtype, Tsym224841* scratchobj, Tnode224809* castexpr, Tnode224809* call, Tnode224809* varsection, Tnode224809* varinit, Tnode224809* result);
N_NIMCALL(Tsym224841*, addlocalvar_403271)(Tnode224809* varsection, Tnode224809* varinit, Tsym224841* owner, Ttype224847* typ, Tnode224809* v, NIM_BOOL useshallowcopy);
N_NIMCALL(NIM_BOOL, typeneedsnodeepcopy_403240)(Ttype224847* t_403242);
N_NIMCALL(void, setupargsforparallelism_403714)(Tnode224809* n_403716, Ttype224847* objtype, Tsym224841* scratchobj, Tnode224809* castexpr, Tnode224809* call, Tnode224809* varsection, Tnode224809* varinit, Tnode224809* result);
N_NIMCALL(NU8, getmagic_253417)(Tnode224809* op);
N_NIMCALL(Tnode224809*, genaddrof_403064)(Tnode224809* n);
N_NIMCALL(Tnode224809*, genhigh_403691)(Tnode224809* n);
N_NIMCALL(Tnode224809*, genderef_403075)(Tnode224809* n);
N_NIMCALL(NI64, computesize_254184)(Ttype224847* typ);
N_NIMCALL(Tsym224841*, getroot_403646)(Tnode224809* n);
N_NIMCALL(Tsym224841*, getcompilerproc_273811)(NimStringDesc* name);
N_NIMCALL(Tnode224809*, callproc_403184)(Tnode224809* a);
N_NIMCALL(Tnode224809*, callcodegenproc_403086)(NimStringDesc* name, Tnode224809* arg1, Tnode224809* arg2, Tnode224809* arg3, Tnode224809* optionalargs);
N_NIMCALL(void, localerror_195128)(Tlineinfo189352 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(Tsym224841*, createwrapperproc_403333)(Tnode224809* f, Tsym224841* threadparam, Tsym224841* argsparam, Tnode224809* varsection, Tnode224809* varinit, Tnode224809* call, Tnode224809* barrier, Tnode224809* fv, NU8 spawnkind);
N_NIMCALL(NU8, flowvarkind_403219)(Ttype224847* t);
N_NIMCALL(NimStringDesc*, typetostring_254032)(Ttype224847* typ, NU8 prefer);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(Tnode224809*, newprocnode_227058)(NU8 kind, Tlineinfo189352 info, Tnode224809* body, Tnode224809* params, Tnode224809* name, Tnode224809* pattern, Tnode224809* genericparams, Tnode224809* pragmas, Tnode224809* exceptions);
STRING_LITERAL(TMP2893, ":tmp", 4);
STRING_LITERAL(TMP3457, "compiler/lowerings.nim", 22);
NIM_CONST TY90959 TMP3456 = {((NimStringDesc*) &TMP3457),
((NI) 178)}
;
STRING_LITERAL(TMP3524, "high", 4);
NIM_CONST TY90959 TMP4224 = {((NimStringDesc*) &TMP3457),
((NI) 539)}
;
NIM_CONST TY90959 TMP4225 = {((NimStringDesc*) &TMP3457),
((NI) 542)}
;
STRING_LITERAL(TMP4226, "\'spawn\' must not be discarded", 29);
STRING_LITERAL(TMP4227, "\'spawn\' takes a call expression", 31);
STRING_LITERAL(TMP4228, "\'spawn\' takes a GC safe call expression", 39);
STRING_LITERAL(TMP4229, "thread", 6);
STRING_LITERAL(TMP4230, "args", 4);
STRING_LITERAL(TMP4231, "scratch", 7);
STRING_LITERAL(TMP4232, "fn", 2);
STRING_LITERAL(TMP4233, "iterator in spawn environment is not allowed", 44);
STRING_LITERAL(TMP4234, "closure in spawn environment is not allowed", 43);
STRING_LITERAL(TMP4235, "\'spawn\'ed function cannot have a \'var\' parameter", 48);
STRING_LITERAL(TMP4236, "deepCopy", 8);
STRING_LITERAL(TMP4237, "slice", 5);
STRING_LITERAL(TMP4238, "Barrier", 7);
STRING_LITERAL(TMP4239, "barrier", 7);
STRING_LITERAL(TMP4240, "fv", 2);
STRING_LITERAL(TMP4241, "nimFlowVarCreateSemaphore", 25);
STRING_LITERAL(TMP4242, "barrierEnter", 12);
NIM_CONST TY90959 TMP4243 = {((NimStringDesc*) &TMP3457),
((NI) 336)}
;
STRING_LITERAL(TMP4244, "owner", 5);
STRING_LITERAL(TMP4245, "nimArgsPassingDone", 18);
STRING_LITERAL(TMP4246, "cannot create a flowVar of type: ", 33);
STRING_LITERAL(TMP4247, "data", 4);
STRING_LITERAL(TMP4248, "blob", 4);
STRING_LITERAL(TMP4249, "GCref", 5);
STRING_LITERAL(TMP4250, "nimFlowVarSignal", 16);
STRING_LITERAL(TMP4251, "barrierLeave", 12);
STRING_LITERAL(TMP4252, "Wrapper", 7);
STRING_LITERAL(TMP4253, "nimSpawn", 8);
extern Gcheap51018 gch_51059;
extern Tnode224809* emptynode_225807;
extern NU32 gglobaloptions_166132;

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

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

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

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

N_NIMCALL(Tnode224809*, newfastasgnstmt_401074)(Tnode224809* le, Tnode224809* ri) {
	Tnode224809* result;
	result = 0;
	result = newnodei_226407(((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(Tnode224809*, lowerswap_401338)(Tnode224809* n, Tsym224841* owner) {
	Tnode224809* result;
	Tsym224841* temp;
	Tident197021* LOC1;
	Tnode224809* v;
	Tnode224809* tempasnode;
	Tnode224809* vpart;
	Tnode224809* LOC2;
	Tnode224809* LOC3;
	Tnode224809* LOC4;
	Tnode224809* LOC5;
	Tnode224809* LOC6;
	result = 0;
	result = newnodei_226351(((NU8) 115), (*n).info);
	LOC1 = 0;
	LOC1 = getident_197463(((NimStringDesc*) &TMP2893));
	temp = newsym_225655(((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_226351(((NU8) 99), (*n).info);
	tempasnode = newsymnode_226325(temp);
	vpart = newnodei_226407(((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_225807);
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 2)]), HEX5BHEX5D_225244(n, ((NI) 1)));
	addson_226819(v, vpart);
	add_225165(result, v);
	LOC2 = 0;
	LOC2 = HEX5BHEX5D_225244(n, ((NI) 1));
	LOC3 = 0;
	LOC3 = HEX5BHEX5D_225244(n, ((NI) 2));
	LOC4 = 0;
	LOC4 = newfastasgnstmt_401074(LOC2, LOC3);
	add_225165(result, LOC4);
	LOC5 = 0;
	LOC5 = HEX5BHEX5D_225244(n, ((NI) 2));
	LOC6 = 0;
	LOC6 = newfastasgnstmt_401074(LOC5, tempasnode);
	add_225165(result, LOC6);
	return result;
}

N_NIMCALL(void, addvar_401047)(Tnode224809* father, Tnode224809* v) {
	Tnode224809* vpart;
	vpart = newnodei_226407(((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_225807);
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 2)]), emptynode_225807);
	addson_226819(father, vpart);
}

N_NIMCALL(Tnode224809*, newasgnstmt_401061)(Tnode224809* le, Tnode224809* ri) {
	Tnode224809* result;
	result = 0;
	result = newnodei_226407(((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_225098)(Tnode224809* 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(Tnode224809*, newtupleaccess_401034)(Tnode224809* tup, NI i) {
	Tnode224809* result;
	Ttype224847* LOC1;
	Tnode224809* LOC2;
	Tnode224809* lit;
	Ttype224847* LOC3;
	result = 0;
	LOC1 = 0;
	LOC1 = skiptypes_228167((*tup).typ, IL64(211106232576256));
	result = newnodeit_226807(((NU8) 42), (*tup).info, (*LOC1).sons->data[i]);
	LOC2 = 0;
	LOC2 = copytree_229028(tup);
	addson_226819(result, LOC2);
	LOC3 = 0;
	LOC3 = getsystype_273190(((NU8) 31));
	lit = newnodeit_226807(((NU8) 6), (*tup).info, LOC3);
	(*lit).kindU.S1.intval = ((NI64) (i));
	addson_226819(result, lit);
	return result;
}

N_NIMCALL(Tnode224809*, lowertupleunpacking_401087)(Tnode224809* n, Tsym224841* owner) {
	Tnode224809* result;
	Tnode224809* value;
	Tsym224841* temp;
	Tident197021* LOC1;
	Tnode224809* v;
	Tnode224809* tempasnode;
	Tnode224809* LOC2;
	result = 0;
	value = lastson_227406(n);
	result = newnodei_226351(((NU8) 115), (*n).info);
	LOC1 = 0;
	LOC1 = getident_197463(((NimStringDesc*) &TMP2893));
	temp = newsym_225655(((NU8) 5), LOC1, owner, (*value).info);
	asgnRefNoCycle((void**) (&(*temp).typ), skiptypes_228167((*value).typ, IL64(211106232576256)));
	(*temp).flags |= ((NU32)1)<<((((NU8) 2))%(sizeof(NU32)*8));
	v = newnodei_226351(((NU8) 99), (*value).info);
	tempasnode = newsymnode_226325(temp);
	addvar_401047(v, tempasnode);
	add_225165(result, v);
	LOC2 = 0;
	LOC2 = newasgnstmt_401061(tempasnode, value);
	add_225165(result, LOC2);
	{
		NI i_401232;
		NI HEX3Atmp_401248;
		NI LOC4;
		NI res_401251;
		i_401232 = 0;
		HEX3Atmp_401248 = 0;
		LOC4 = 0;
		LOC4 = len_225098(n);
		HEX3Atmp_401248 = (NI)(LOC4 - ((NI) 3));
		res_401251 = ((NI) 0);
		{
			while (1) {
				Tnode224809* LOC11;
				Tnode224809* LOC12;
				if (!(res_401251 <= HEX3Atmp_401248)) goto LA6;
				i_401232 = res_401251;
				{
					if (!((*(*n).kindU.S6.sons->data[i_401232]).kind == ((NU8) 3))) goto LA9;
					addvar_401047(v, (*n).kindU.S6.sons->data[i_401232]);
				}
				LA9: ;
				LOC11 = 0;
				LOC11 = newtupleaccess_401034(tempasnode, i_401232);
				LOC12 = 0;
				LOC12 = newasgnstmt_401061((*n).kindU.S6.sons->data[i_401232], LOC11);
				add_225165(result, LOC12);
				res_401251 += ((NI) 1);
			} LA6: ;
		}
	}
	return result;
}

N_NIMCALL(Ttype224847*, createobj_401372)(Tsym224841* owner, Tlineinfo189352 info) {
	Ttype224847* result;
	result = 0;
	result = newtype_227140(((NU8) 17), owner);
	rawaddson_228498(result, NIM_NIL);
	(*result).flags |= ((NU32)1)<<((((NU8) 2))%(sizeof(NU32)*8));
	asgnRefNoCycle((void**) (&(*result).n), newnodei_226351(((NU8) 138), info));
	return result;
}

N_NIMCALL(void, rawaddfield_401393)(Ttype224847* obj, Tsym224841* field) {
	Tnode224809* LOC1;
	(*field).position = sonslen_227387((*obj).n);
	LOC1 = 0;
	LOC1 = newsymnode_226325(field);
	addson_226819((*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(Ttype224847*, skipintlit_273698)(Ttype224847* t) {
	Ttype224847* result;
{	result = 0;
	{
		if (!!(((*t).n == NIM_NIL))) goto LA3;
		{
			if (!((IL64(70866960384) &(IL64(1)<<(((*t).kind)&IL64(63))))!=0)) goto LA7;
			result = getsystype_273190((*t).kind);
			goto BeforeRet;
		}
		LA7: ;
	}
	LA3: ;
	result = t;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, addfield_401809)(Ttype224847* obj, Tsym224841* s) {
	Tsym224841* field;
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	Tident197021* LOC3;
	Ttype224847* t;
	Tnode224809* 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_197463(LOC1);
	field = newsym_225655(((NU8) 19), LOC3, (*s).owner, (*s).info);
	t = skipintlit_273698((*s).typ);
	asgnRefNoCycle((void**) (&(*field).typ), t);
	(*field).position = sonslen_227387((*obj).n);
	LOC4 = 0;
	LOC4 = newsymnode_226325(field);
	addson_226819((*obj).n, LOC4);
}

N_NIMCALL(void, adduniquefield_402008)(Ttype224847* obj, Tsym224841* s) {
	Tident197021* 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_197463(LOC1);
	{
		Tsym224841* LOC5;
		Tsym224841* field;
		Ttype224847* t;
		Tnode224809* LOC8;
		LOC5 = 0;
		LOC5 = lookupinrecord_232236((*obj).n, fieldname);
		if (!(LOC5 == NIM_NIL)) goto LA6;
		field = newsym_225655(((NU8) 19), fieldname, (*s).owner, (*s).info);
		t = skipintlit_273698((*s).typ);
		asgnRefNoCycle((void**) (&(*field).typ), t);
		(*field).position = sonslen_227387((*obj).n);
		LOC8 = 0;
		LOC8 = newsymnode_226325(field);
		addson_226819((*obj).n, LOC8);
	}
	LA6: ;
}

N_NIMCALL(Tnode224809*, indirectaccess_402408)(Tnode224809* a, NimStringDesc* b, Tlineinfo189352 info) {
	Tnode224809* result;
	Tnode224809* deref;
	Ttype224847* LOC1;
	Ttype224847* t;
	Tsym224841* field;
	Tnode224809* LOC18;
	result = 0;
	deref = newnodei_226351(((NU8) 65), info);
	LOC1 = 0;
	LOC1 = skiptypes_228167((*a).typ, IL64(211106232576256));
	asgnRefNoCycle((void**) (&(*deref).typ), (*LOC1).sons->data[((NI) 0)]);
	t = skiptypes_228167((*deref).typ, IL64(211106232576256));
	field = 0;
	{
		while (1) {
			Tident197021* LOC4;
			LOC4 = 0;
			LOC4 = getident_197463(b);
			field = getsymfromlist_232228((*t).n, LOC4, ((NI) 0));
			{
				if (!!((field == NIM_NIL))) goto LA7;
				goto LA2;
			}
			LA7: ;
			t = (*t).sons->data[((NI) 0)];
			{
				if (!(t == NIM_NIL)) goto LA11;
				goto LA2;
			}
			LA11: ;
			t = skiptypes_228167(t, IL64(211106232576256));
		}
	} LA2: ;
	{
		NimStringDesc* LOC17;
		if (!!(!((field == NIM_NIL)))) goto LA15;
		LOC17 = 0;
		LOC17 = HEX24_195279(TMP3456);
		internalerror_195191(LOC17);
	}
	LA15: ;
	addson_226819(deref, a);
	result = newnodei_226351(((NU8) 45), info);
	addson_226819(result, deref);
	LOC18 = 0;
	LOC18 = newsymnode_226325(field);
	addson_226819(result, LOC18);
	asgnRefNoCycle((void**) (&(*result).typ), (*field).typ);
	return result;
}

N_NIMCALL(Tnode224809*, indirectaccess_403038)(Tnode224809* a, Tsym224841* b, Tlineinfo189352 info) {
	Tnode224809* 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_402408(a, LOC1, info);
	return result;
}

N_NIMCALL(Tnode224809*, rawindirectaccess_401608)(Tnode224809* a, Tsym224841* field, Tlineinfo189352 info) {
	Tnode224809* result;
	Tnode224809* deref;
	Ttype224847* LOC1;
	Tnode224809* LOC2;
	result = 0;
	deref = newnodei_226351(((NU8) 65), info);
	LOC1 = 0;
	LOC1 = skiptypes_228167((*a).typ, IL64(211106232576256));
	asgnRefNoCycle((void**) (&(*deref).typ), (*LOC1).sons->data[((NI) 0)]);
	addson_226819(deref, a);
	result = newnodei_226351(((NU8) 45), info);
	addson_226819(result, deref);
	LOC2 = 0;
	LOC2 = newsymnode_226325(field);
	addson_226819(result, LOC2);
	asgnRefNoCycle((void**) (&(*result).typ), (*field).typ);
	return result;
}

N_NIMCALL(Tnode224809*, newtupleaccessraw_401270)(Tnode224809* tup, NI i) {
	Tnode224809* result;
	Tnode224809* LOC1;
	Tnode224809* lit;
	result = 0;
	result = newnodei_226351(((NU8) 42), (*tup).info);
	LOC1 = 0;
	LOC1 = copytree_229028(tup);
	addson_226819(result, LOC1);
	lit = newnodei_226351(((NU8) 6), (*tup).info);
	(*lit).kindU.S1.intval = ((NI64) (i));
	addson_226819(result, lit);
	return result;
}

N_NIMCALL(Tnode224809*, lowertupleunpackingforasgn_401283)(Tnode224809* n, Tsym224841* owner) {
	Tnode224809* result;
	Tnode224809* value;
	Tsym224841* temp;
	Tident197021* LOC1;
	Tnode224809* v;
	Tnode224809* tempasnode;
	NimStringDesc* LOC2;
	NimStringDesc* LOC3;
	Tident197021* LOC4;
	Tnode224809* vpart;
	Tnode224809* lhs;
	result = 0;
	value = lastson_227406(n);
	result = newnodei_226351(((NU8) 115), (*n).info);
	LOC1 = 0;
	LOC1 = getident_197463(((NimStringDesc*) &TMP2893));
	temp = newsym_225655(((NU8) 5), LOC1, owner, (*value).info);
	v = newnodei_226351(((NU8) 100), (*value).info);
	LOC2 = 0;
	LOC3 = 0;
	LOC3 = nimIntToStr((*temp).Sup.id);
	LOC2 = rawNewString(LOC3->Sup.len + 4);
appendString(LOC2, ((NimStringDesc*) &TMP2893));
appendString(LOC2, LOC3);
	LOC4 = 0;
	LOC4 = getident_197463(LOC2);
	tempasnode = newidentnode_226313(LOC4, (*value).info);
	vpart = newnodei_226407(((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_225807);
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 2)]), value);
	addson_226819(v, vpart);
	add_225165(result, v);
	lhs = (*n).kindU.S6.sons->data[((NI) 0)];
	{
		NI i_401312;
		NI HEX3Atmp_401316;
		NI LOC6;
		NI res_401319;
		i_401312 = 0;
		HEX3Atmp_401316 = 0;
		LOC6 = 0;
		LOC6 = len_225098(lhs);
		HEX3Atmp_401316 = (NI)(LOC6 - ((NI) 1));
		res_401319 = ((NI) 0);
		{
			while (1) {
				Tnode224809* LOC9;
				Tnode224809* LOC10;
				if (!(res_401319 <= HEX3Atmp_401316)) goto LA8;
				i_401312 = res_401319;
				LOC9 = 0;
				LOC9 = newtupleaccessraw_401270(tempasnode, i_401312);
				LOC10 = 0;
				LOC10 = newasgnstmt_401061((*lhs).kindU.S6.sons->data[i_401312], LOC9);
				add_225165(result, LOC10);
				res_401319 += ((NI) 1);
			} LA8: ;
		}
	}
	return result;
}

N_NIMCALL(Tnode224809*, newintlit_403681)(NI64 value) {
	Tnode224809* result;
	result = 0;
	result = newintnode_225607(((NU8) 6), value);
	asgnRefNoCycle((void**) (&(*result).typ), getsystype_273190(((NU8) 31)));
	return result;
}

N_NIMCALL(Tnode224809*, genhigh_403691)(Tnode224809* n) {
	Tnode224809* result;
	result = 0;
	{
		Ttype224847* LOC3;
		Ttype224847* LOC6;
		NI64 LOC7;
		LOC3 = 0;
		LOC3 = skiptypes_228167((*n).typ, IL64(211106240964864));
		if (!((65552 &(IL64(1)<<(((*LOC3).kind)&IL64(63))))!=0)) goto LA4;
		LOC6 = 0;
		LOC6 = skiptypes_228167((*n).typ, IL64(211106240964864));
		LOC7 = 0;
		LOC7 = lastord_254010(LOC6);
		result = newintlit_403681(LOC7);
	}
	goto LA1;
	LA4: ;
	{
		Tsym224841* LOC9;
		result = newnodei_226407(((NU8) 27), (*n).info, ((NI) 2));
		asgnRefNoCycle((void**) (&(*result).typ), getsystype_273190(((NU8) 31)));
		LOC9 = 0;
		LOC9 = createmagic_230048(((NimStringDesc*) &TMP3524), ((NU8) 8));
		asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[((NI) 0)]), newsymnode_226325(LOC9));
		asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[((NI) 1)]), n);
	}
	LA1: ;
	return result;
}

static N_INLINE(NIM_BOOL, isemptytype_229933)(Ttype224847* t) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = (t == NIM_NIL);
	if (LOC1) goto LA2;
	LOC1 = ((136 &(IL64(1)<<(((*t).kind)&IL64(63))))!=0);
	LA2: ;
	result = LOC1;
	return result;
}

N_NIMCALL(NU8, spawnresult_403208)(Ttype224847* t, NIM_BOOL inparallel) {
	NU8 result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = isemptytype_229933(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_254154(t);
		LOC7 = !(LOC9);
		LA8: ;
		if (!LOC7) goto LA10;
		result = ((NU8) 2);
	}
	goto LA1;
	LA10: ;
	{
		result = ((NU8) 1);
	}
	LA1: ;
	return result;
}

N_NIMCALL(Tnode224809*, createcastexpr_403557)(Tsym224841* argsparam, Ttype224847* objtype) {
	Tnode224809* result;
	Tnode224809* LOC1;
	result = 0;
	result = newnodei_226351(((NU8) 61), (*argsparam).info);
	add_225165(result, emptynode_225807);
	LOC1 = 0;
	LOC1 = newsymnode_226325(argsparam);
	add_225165(result, LOC1);
	asgnRefNoCycle((void**) (&(*result).typ), newtype_227140(((NU8) 21), (*objtype).owner));
	rawaddson_228498((*result).typ, objtype);
	return result;
}

N_NIMCALL(Tnode224809*, newdotexpr_402208)(Tsym224841* obj, Tsym224841* b) {
	Tnode224809* result;
	Tsym224841* field;
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	Tident197021* LOC3;
	Tnode224809* LOC4;
	Tnode224809* LOC5;
	result = 0;
	result = newnodei_226351(((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_197463(LOC1);
	field = getsymfromlist_232228((*(*obj).typ).n, LOC3, ((NI) 0));
	LOC4 = 0;
	LOC4 = newsymnode_226325(obj);
	addson_226819(result, LOC4);
	LOC5 = 0;
	LOC5 = newsymnode_226325(field);
	addson_226819(result, LOC5);
	asgnRefNoCycle((void**) (&(*result).typ), (*field).typ);
	return result;
}

N_NIMCALL(NIM_BOOL, typeneedsnodeepcopy_403240)(Ttype224847* t_403242) {
	NIM_BOOL result;
	Ttype224847* t;
	NIM_BOOL LOC9;
{	result = 0;
	t = skiptypes_228167(t_403242, IL64(211106232576256));
	{
		if (!((*t).kind == ((NU8) 28))) goto LA3;
		result = NIM_TRUE;
		goto BeforeRet;
	}
	LA3: ;
	{
		if (!((25165824 &(IL64(1)<<(((*t).kind)&IL64(63))))!=0)) goto LA7;
		t = (*t).sons->data[((NI) 0)];
	}
	LA7: ;
	LOC9 = 0;
	LOC9 = containsgarbagecollectedref_254154(t);
	result = !(LOC9);
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tsym224841*, addlocalvar_403271)(Tnode224809* varsection, Tnode224809* varinit, Tsym224841* owner, Ttype224847* typ, Tnode224809* v, NIM_BOOL useshallowcopy) {
	Tsym224841* result;
	Tident197021* LOC1;
	Tnode224809* vpart;
	result = 0;
	LOC1 = 0;
	LOC1 = getident_197463(((NimStringDesc*) &TMP2893));
	result = newsym_225655(((NU8) 5), LOC1, owner, (*varsection).info);
	asgnRefNoCycle((void**) (&(*result).typ), typ);
	(*result).flags |= ((NU32)1)<<((((NU8) 2))%(sizeof(NU32)*8));
	vpart = newnodei_226407(((NU8) 35), (*varsection).info, ((NI) 3));
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 0)]), newsymnode_226325(result));
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 1)]), emptynode_225807);
	{
		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_225807);
	}
	LA2: ;
	add_225165(varsection, vpart);
	{
		if (!!((varinit == NIM_NIL))) goto LA9;
		{
			NIM_BOOL LOC13;
			Tnode224809* LOC17;
			Tnode224809* LOC18;
			LOC13 = 0;
			LOC13 = useshallowcopy;
			if (!(LOC13)) goto LA14;
			LOC13 = typeneedsnodeepcopy_403240(typ);
			LA14: ;
			if (!LOC13) goto LA15;
			LOC17 = 0;
			LOC17 = newsymnode_226325(result);
			LOC18 = 0;
			LOC18 = newfastasgnstmt_401074(LOC17, v);
			add_225165(varinit, LOC18);
		}
		goto LA11;
		LA15: ;
		{
			Tnode224809* deepcopycall;
			Tsym224841* LOC20;
			deepcopycall = newnodei_226407(((NU8) 27), (*varinit).info, ((NI) 3));
			LOC20 = 0;
			LOC20 = createmagic_230048(((NimStringDesc*) &TMP4236), ((NU8) 202));
			asgnRefNoCycle((void**) (&(*deepcopycall).kindU.S6.sons->data[((NI) 0)]), newsymnode_226325(LOC20));
			asgnRefNoCycle((void**) (&(*deepcopycall).kindU.S6.sons->data[((NI) 1)]), newsymnode_226325(result));
			asgnRefNoCycle((void**) (&(*deepcopycall).kindU.S6.sons->data[((NI) 2)]), v);
			add_225165(varinit, deepcopycall);
		}
		LA11: ;
	}
	LA9: ;
	return result;
}

N_NIMCALL(void, setupargsforconcurrency_403571)(Tnode224809* n, Ttype224847* objtype, Tsym224841* scratchobj, Tnode224809* castexpr, Tnode224809* call, Tnode224809* varsection, Tnode224809* varinit, Tnode224809* result) {
	Tnode224809* formals;
	Tnode224809* LOC1;
	Tident197021* tmpname;
	LOC1 = 0;
	LOC1 = HEX5BHEX5D_225244(n, ((NI) 0));
	formals = (*(*LOC1).typ).n;
	tmpname = getident_197463(((NimStringDesc*) &TMP2893));
	{
		NI i_403602;
		NI HEX3Atmp_403624;
		NI LOC3;
		NI res_403627;
		i_403602 = 0;
		HEX3Atmp_403624 = 0;
		LOC3 = 0;
		LOC3 = len_225098(n);
		HEX3Atmp_403624 = (LOC3 - 1);
		res_403627 = ((NI) 1);
		{
			while (1) {
				Ttype224847* argtype;
				Tnode224809* LOC6;
				Tident197021* fieldname;
				Tsym224841* field;
				Tnode224809* LOC23;
				Tnode224809* LOC24;
				Tnode224809* LOC25;
				Tsym224841* temp;
				Tnode224809* LOC26;
				Tnode224809* LOC27;
				if (!(res_403627 <= HEX3Atmp_403624)) goto LA5;
				i_403602 = res_403627;
				LOC6 = 0;
				LOC6 = HEX5BHEX5D_225244(n, i_403602);
				argtype = skiptypes_228167((*LOC6).typ, IL64(211106232576256));
				{
					NIM_BOOL LOC9;
					NI LOC10;
					Tnode224809* LOC12;
					Tnode224809* LOC15;
					LOC9 = 0;
					LOC10 = 0;
					LOC10 = len_225098(formals);
					LOC9 = (i_403602 < LOC10);
					if (!(LOC9)) goto LA11;
					LOC12 = 0;
					LOC12 = HEX5BHEX5D_225244(formals, i_403602);
					LOC9 = ((*(*LOC12).typ).kind == ((NU8) 23));
					LA11: ;
					if (!LOC9) goto LA13;
					LOC15 = 0;
					LOC15 = HEX5BHEX5D_225244(n, i_403602);
					localerror_195139((*LOC15).info, ((NimStringDesc*) &TMP4235));
				}
				LA13: ;
				{
					NI LOC18;
					Tnode224809* LOC21;
					LOC18 = 0;
					LOC18 = len_225098(formals);
					if (!(i_403602 < LOC18)) goto LA19;
					LOC21 = 0;
					LOC21 = HEX5BHEX5D_225244(formals, i_403602);
					fieldname = (*(*LOC21).kindU.S4.sym).name;
				}
				goto LA16;
				LA19: ;
				{
					fieldname = tmpname;
				}
				LA16: ;
				field = newsym_225655(((NU8) 19), fieldname, (*objtype).owner, (*n).info);
				asgnRefNoCycle((void**) (&(*field).typ), argtype);
				addfield_401809(objtype, field);
				LOC23 = 0;
				LOC23 = newdotexpr_402208(scratchobj, field);
				LOC24 = 0;
				LOC24 = HEX5BHEX5D_225244(n, i_403602);
				LOC25 = 0;
				LOC25 = newfastasgnstmt_401074(LOC23, LOC24);
				add_225165(result, LOC25);
				LOC26 = 0;
				LOC26 = indirectaccess_403038(castexpr, field, (*n).info);
				temp = addlocalvar_403271(varsection, varinit, (*objtype).owner, argtype, LOC26, NIM_FALSE);
				LOC27 = 0;
				LOC27 = newsymnode_226325(temp);
				add_225165(call, LOC27);
				res_403627 += ((NI) 1);
			} LA5: ;
		}
	}
}

N_NIMCALL(Tnode224809*, genaddrof_403064)(Tnode224809* n) {
	Tnode224809* result;
	result = 0;
	result = newnodei_226407(((NU8) 63), (*n).info, ((NI) 1));
	asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[((NI) 0)]), n);
	asgnRefNoCycle((void**) (&(*result).typ), newtype_227140(((NU8) 21), (*(*n).typ).owner));
	rawaddson_228498((*result).typ, (*n).typ);
	return result;
}

N_NIMCALL(Tnode224809*, genderef_403075)(Tnode224809* n) {
	Tnode224809* result;
	Ttype224847* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = skiptypes_228167((*n).typ, IL64(211106232576256));
	result = newnodeit_226807(((NU8) 65), (*n).info, (*LOC1).sons->data[((NI) 0)]);
	add_225165(result, n);
	return result;
}

N_NIMCALL(Tsym224841*, getroot_403646)(Tnode224809* n) {
	Tsym224841* result;
	result = 0;
	switch ((*n).kind) {
	case ((NU8) 3):
	{
		{
			if (!((2100000 &(1<<(((*(*n).kindU.S4.sym).kind)&31)))!=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_403646((*n).kindU.S6.sons->data[((NI) 0)]);
	}
	break;
	case ((NU8) 58):
	case ((NU8) 59):
	case ((NU8) 60):
	{
		result = getroot_403646((*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_253417(n);
			if (!(LOC11 == ((NU8) 138))) goto LA12;
			result = getroot_403646((*n).kindU.S6.sons->data[((NI) 1)]);
		}
		LA12: ;
	}
	break;
	default:
	{
	}
	break;
	}
	return result;
}

N_NIMCALL(void, setupargsforparallelism_403714)(Tnode224809* n_403716, Ttype224847* objtype, Tsym224841* scratchobj, Tnode224809* castexpr, Tnode224809* call, Tnode224809* varsection, Tnode224809* varinit, Tnode224809* result) {
	Tnode224809* formals;
	Tnode224809* LOC1;
	Tident197021* tmpname;
	LOC1 = 0;
	LOC1 = HEX5BHEX5D_225244(n_403716, ((NI) 0));
	formals = (*(*LOC1).typ).n;
	tmpname = getident_197463(((NimStringDesc*) &TMP2893));
	{
		NI i_403745;
		NI HEX3Atmp_403828;
		NI LOC3;
		NI res_403831;
		i_403745 = 0;
		HEX3Atmp_403828 = 0;
		LOC3 = 0;
		LOC3 = len_225098(n_403716);
		HEX3Atmp_403828 = (LOC3 - 1);
		res_403831 = ((NI) 1);
		{
			while (1) {
				Tnode224809* n;
				Ttype224847* argtype;
				Ttype224847* LOC6;
				Tident197021* fieldname;
				Tsym224841* field;
				if (!(res_403831 <= HEX3Atmp_403828)) goto LA5;
				i_403745 = res_403831;
				n = HEX5BHEX5D_225244(n_403716, i_403745);
				LOC6 = 0;
				{
					NI LOC9;
					Tnode224809* LOC12;
					LOC9 = 0;
					LOC9 = len_225098(formals);
					if (!(i_403745 < LOC9)) goto LA10;
					LOC12 = 0;
					LOC12 = HEX5BHEX5D_225244(formals, i_403745);
					LOC6 = (*LOC12).typ;
				}
				goto LA7;
				LA10: ;
				{
					LOC6 = (*n).typ;
				}
				LA7: ;
				argtype = skiptypes_228167(LOC6, IL64(211106232576256));
				{
					NI LOC16;
					Tnode224809* LOC19;
					LOC16 = 0;
					LOC16 = len_225098(formals);
					if (!(i_403745 < LOC16)) goto LA17;
					LOC19 = 0;
					LOC19 = HEX5BHEX5D_225244(formals, i_403745);
					fieldname = (*(*LOC19).kindU.S4.sym).name;
				}
				goto LA14;
				LA17: ;
				{
					fieldname = tmpname;
				}
				LA14: ;
				field = newsym_225655(((NU8) 19), fieldname, (*objtype).owner, (*n).info);
				{
					Tnode224809* slice;
					Tsym224841* LOC25;
					Tsym224841* fieldb;
					Tnode224809* LOC47;
					Tsym224841* threadlocal_403796;
					Tnode224809* LOC48;
					if (!((IL64(281475110928384) &(IL64(1)<<(((*argtype).kind)&IL64(63))))!=0)) goto LA23;
					slice = newnodei_226407(((NU8) 27), (*n).info, ((NI) 4));
					asgnRefNoCycle((void**) (&(*slice).typ), (*n).typ);
					LOC25 = 0;
					LOC25 = createmagic_230048(((NimStringDesc*) &TMP4237), ((NU8) 138));
					asgnRefNoCycle((void**) (&(*slice).kindU.S6.sons->data[((NI) 0)]), newsymnode_226325(LOC25));
					fieldb = newsym_225655(((NU8) 19), tmpname, (*objtype).owner, (*n).info);
					asgnRefNoCycle((void**) (&(*fieldb).typ), getsystype_273190(((NU8) 31)));
					addfield_401809(objtype, fieldb);
					{
						NU8 LOC28;
						Tnode224809* a;
						Tnode224809* LOC31;
						Tnode224809* LOC32;
						Tnode224809* LOC33;
						Tsym224841* fielda;
						Tnode224809* LOC34;
						Tnode224809* LOC35;
						Tnode224809* LOC36;
						Tnode224809* LOC37;
						Tnode224809* LOC38;
						Tnode224809* LOC39;
						Tsym224841* threadlocal_403786;
						Tnode224809* LOC40;
						LOC28 = 0;
						LOC28 = getmagic_253417(n);
						if (!(LOC28 == ((NU8) 138))) goto LA29;
						LOC31 = 0;
						LOC31 = HEX5BHEX5D_225244(n, ((NI) 1));
						a = genaddrof_403064(LOC31);
						asgnRefNoCycle((void**) (&(*field).typ), (*a).typ);
						addfield_401809(objtype, field);
						LOC32 = 0;
						LOC32 = newdotexpr_402208(scratchobj, field);
						LOC33 = 0;
						LOC33 = newfastasgnstmt_401074(LOC32, a);
						add_225165(result, LOC33);
						fielda = newsym_225655(((NU8) 19), tmpname, (*objtype).owner, (*n).info);
						asgnRefNoCycle((void**) (&(*fielda).typ), getsystype_273190(((NU8) 31)));
						addfield_401809(objtype, fielda);
						LOC34 = 0;
						LOC34 = newdotexpr_402208(scratchobj, fielda);
						LOC35 = 0;
						LOC35 = HEX5BHEX5D_225244(n, ((NI) 2));
						LOC36 = 0;
						LOC36 = newfastasgnstmt_401074(LOC34, LOC35);
						add_225165(result, LOC36);
						LOC37 = 0;
						LOC37 = newdotexpr_402208(scratchobj, fieldb);
						LOC38 = 0;
						LOC38 = HEX5BHEX5D_225244(n, ((NI) 3));
						LOC39 = 0;
						LOC39 = newfastasgnstmt_401074(LOC37, LOC38);
						add_225165(result, LOC39);
						LOC40 = 0;
						LOC40 = indirectaccess_403038(castexpr, fielda, (*n).info);
						threadlocal_403786 = addlocalvar_403271(varsection, NIM_NIL, (*objtype).owner, (*fielda).typ, LOC40, NIM_TRUE);
						asgnRefNoCycle((void**) (&(*slice).kindU.S6.sons->data[((NI) 2)]), newsymnode_226325(threadlocal_403786));
					}
					goto LA26;
					LA29: ;
					{
						Tnode224809* a;
						Tnode224809* LOC42;
						Tnode224809* LOC43;
						Tnode224809* LOC44;
						Tnode224809* LOC45;
						Tnode224809* LOC46;
						a = genaddrof_403064(n);
						asgnRefNoCycle((void**) (&(*field).typ), (*a).typ);
						addfield_401809(objtype, field);
						LOC42 = 0;
						LOC42 = newdotexpr_402208(scratchobj, field);
						LOC43 = 0;
						LOC43 = newfastasgnstmt_401074(LOC42, a);
						add_225165(result, LOC43);
						LOC44 = 0;
						LOC44 = newdotexpr_402208(scratchobj, fieldb);
						LOC45 = 0;
						LOC45 = genhigh_403691(n);
						LOC46 = 0;
						LOC46 = newfastasgnstmt_401074(LOC44, LOC45);
						add_225165(result, LOC46);
						asgnRefNoCycle((void**) (&(*slice).kindU.S6.sons->data[((NI) 2)]), newintlit_403681(IL64(0)));
					}
					LA26: ;
					LOC47 = 0;
					LOC47 = indirectaccess_403038(castexpr, field, (*n).info);
					asgnRefNoCycle((void**) (&(*slice).kindU.S6.sons->data[((NI) 1)]), genderef_403075(LOC47));
					LOC48 = 0;
					LOC48 = indirectaccess_403038(castexpr, fieldb, (*n).info);
					threadlocal_403796 = addlocalvar_403271(varsection, NIM_NIL, (*objtype).owner, (*fieldb).typ, LOC48, NIM_TRUE);
					asgnRefNoCycle((void**) (&(*slice).kindU.S6.sons->data[((NI) 3)]), newsymnode_226325(threadlocal_403796));
					add_225165(call, slice);
				}
				goto LA21;
				LA23: ;
				{
					NIM_BOOL LOC50;
					NI64 size;
					NIM_BOOL LOC51;
					Tsym224841* LOC54;
					Tnode224809* a;
					Tnode224809* LOC57;
					Tnode224809* LOC58;
					Tsym224841* threadlocal_403818;
					Tnode224809* LOC59;
					Tnode224809* LOC60;
					Tnode224809* LOC61;
					LOC50 = 0;
					size = computesize_254184(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_403646(n);
					LOC50 = !((LOC54 == NIM_NIL));
					LA53: ;
					if (!LOC50) goto LA55;
					a = genaddrof_403064(n);
					asgnRefNoCycle((void**) (&(*field).typ), (*a).typ);
					addfield_401809(objtype, field);
					LOC57 = 0;
					LOC57 = newdotexpr_402208(scratchobj, field);
					LOC58 = 0;
					LOC58 = newfastasgnstmt_401074(LOC57, a);
					add_225165(result, LOC58);
					LOC59 = 0;
					LOC59 = indirectaccess_403038(castexpr, field, (*n).info);
					threadlocal_403818 = addlocalvar_403271(varsection, NIM_NIL, (*objtype).owner, (*field).typ, LOC59, NIM_TRUE);
					LOC60 = 0;
					LOC60 = newsymnode_226325(threadlocal_403818);
					LOC61 = 0;
					LOC61 = genderef_403075(LOC60);
					add_225165(call, LOC61);
				}
				goto LA21;
				LA55: ;
				{
					Tnode224809* LOC63;
					Tnode224809* LOC64;
					Tsym224841* threadlocal_403824;
					Tnode224809* LOC65;
					Tnode224809* LOC66;
					asgnRefNoCycle((void**) (&(*field).typ), argtype);
					addfield_401809(objtype, field);
					LOC63 = 0;
					LOC63 = newdotexpr_402208(scratchobj, field);
					LOC64 = 0;
					LOC64 = newfastasgnstmt_401074(LOC63, n);
					add_225165(result, LOC64);
					LOC65 = 0;
					LOC65 = indirectaccess_403038(castexpr, field, (*n).info);
					threadlocal_403824 = addlocalvar_403271(varsection, varinit, (*objtype).owner, (*field).typ, LOC65, NIM_TRUE);
					LOC66 = 0;
					LOC66 = newsymnode_226325(threadlocal_403824);
					add_225165(call, LOC66);
				}
				LA21: ;
				res_403831 += ((NI) 1);
			} LA5: ;
		}
	}
}

N_NIMCALL(Tnode224809*, callproc_403184)(Tnode224809* a) {
	Tnode224809* result;
	result = 0;
	result = newnodei_226351(((NU8) 27), (*a).info);
	add_225165(result, a);
	asgnRefNoCycle((void**) (&(*result).typ), (*(*a).typ).sons->data[((NI) 0)]);
	return result;
}

N_NIMCALL(Tnode224809*, callcodegenproc_403086)(NimStringDesc* name, Tnode224809* arg1, Tnode224809* arg2, Tnode224809* arg3, Tnode224809* optionalargs) {
	Tnode224809* result;
	Tsym224841* sym;
	result = 0;
	result = newnodei_226351(((NU8) 27), (*arg1).info);
	sym = getcompilerproc_273811(name);
	{
		if (!(sym == NIM_NIL)) goto LA3;
		localerror_195128((*arg1).info, ((NU16) 68), name);
	}
	goto LA1;
	LA3: ;
	{
		Tnode224809* LOC6;
		LOC6 = 0;
		LOC6 = newsymnode_226325(sym);
		add_225165(result, LOC6);
		add_225165(result, arg1);
		{
			if (!!((arg2 == NIM_NIL))) goto LA9;
			add_225165(result, arg2);
		}
		LA9: ;
		{
			if (!!((arg3 == NIM_NIL))) goto LA13;
			add_225165(result, arg3);
		}
		LA13: ;
		{
			if (!!((optionalargs == NIM_NIL))) goto LA17;
			{
				NI i_403158;
				NI HEX3Atmp_403162;
				NI LOC20;
				NI res_403165;
				i_403158 = 0;
				HEX3Atmp_403162 = 0;
				LOC20 = 0;
				LOC20 = len_225098(optionalargs);
				HEX3Atmp_403162 = (NI)(LOC20 - ((NI) 3));
				res_403165 = ((NI) 1);
				{
					while (1) {
						Tnode224809* LOC23;
						if (!(res_403165 <= HEX3Atmp_403162)) goto LA22;
						i_403158 = res_403165;
						LOC23 = 0;
						LOC23 = HEX5BHEX5D_225244(optionalargs, i_403158);
						add_225165(result, LOC23);
						res_403165 += ((NI) 1);
					} LA22: ;
				}
			}
		}
		LA17: ;
		asgnRefNoCycle((void**) (&(*result).typ), (*(*sym).typ).sons->data[((NI) 0)]);
	}
	LA1: ;
	return result;
}

N_NIMCALL(NU8, flowvarkind_403219)(Ttype224847* t) {
	NU8 result;
	result = 0;
	{
		Ttype224847* LOC3;
		LOC3 = 0;
		LOC3 = skiptypes_228167(t, IL64(211106232576256));
		if (!((289406976 &(IL64(1)<<(((*LOC3).kind)&IL64(63))))!=0)) goto LA4;
		result = ((NU8) 1);
	}
	goto LA1;
	LA4: ;
	{
		NIM_BOOL LOC7;
		LOC7 = 0;
		LOC7 = containsgarbagecollectedref_254154(t);
		if (!LOC7) goto LA8;
		result = ((NU8) 0);
	}
	goto LA1;
	LA8: ;
	{
		result = ((NU8) 2);
	}
	LA1: ;
	return result;
}

N_NIMCALL(Tsym224841*, createwrapperproc_403333)(Tnode224809* f, Tsym224841* threadparam, Tsym224841* argsparam, Tnode224809* varsection, Tnode224809* varinit, Tnode224809* call, Tnode224809* barrier, Tnode224809* fv, NU8 spawnkind) {
	Tsym224841* result;
	Tnode224809* body;
	Tsym224841* threadlocalbarrier;
	Tsym224841* threadlocalprom;
	Tnode224809* LOC29;
	Tnode224809* LOC30;
	Tnode224809* params;
	Tnode224809* LOC75;
	Tnode224809* LOC76;
	Ttype224847* t;
	Tnode224809* LOC77;
	Tnode224809* LOC78;
	Tnode224809* LOC79;
	NimStringDesc* name;
	NimStringDesc* LOC80;
	NimStringDesc* LOC81;
	Tident197021* LOC87;
	Tnode224809* LOC88;
	result = 0;
	body = newnodei_226351(((NU8) 115), (*f).info);
	threadlocalbarrier = 0;
	{
		Tnode224809* varsection2;
		Tnode224809* LOC5;
		Tnode224809* LOC6;
		if (!!((barrier == NIM_NIL))) goto LA3;
		varsection2 = newnodei_226351(((NU8) 99), (*barrier).info);
		threadlocalbarrier = addlocalvar_403271(varsection2, NIM_NIL, (*argsparam).owner, (*barrier).typ, barrier, NIM_FALSE);
		add_225165(body, varsection2);
		LOC5 = 0;
		LOC5 = newsymnode_226325(threadlocalbarrier);
		LOC6 = 0;
		LOC6 = callcodegenproc_403086(((NimStringDesc*) &TMP4242), LOC5, NIM_NIL, NIM_NIL, NIM_NIL);
		add_225165(body, LOC6);
	}
	LA3: ;
	threadlocalprom = 0;
	{
		if (!(spawnkind == ((NU8) 2))) goto LA9;
		threadlocalprom = addlocalvar_403271(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_195279(TMP4243);
			internalerror_195191(LOC18);
		}
		LA16: ;
		threadlocalprom = addlocalvar_403271(varsection, NIM_NIL, (*argsparam).owner, (*fv).typ, fv, NIM_FALSE);
	}
	goto LA7;
	LA12: ;
	LA7: ;
	add_225165(body, varsection);
	add_225165(body, varinit);
	{
		NIM_BOOL LOC21;
		Tnode224809* LOC25;
		Tnode224809* LOC26;
		Tnode224809* LOC27;
		Tnode224809* LOC28;
		LOC21 = 0;
		LOC21 = !((fv == NIM_NIL));
		if (!(LOC21)) goto LA22;
		LOC21 = !((spawnkind == ((NU8) 2)));
		LA22: ;
		if (!LOC21) goto LA23;
		LOC25 = 0;
		LOC25 = newsymnode_226325(threadlocalprom);
		LOC26 = 0;
		LOC26 = indirectaccess_402408(LOC25, ((NimStringDesc*) &TMP4244), (*fv).info);
		LOC27 = 0;
		LOC27 = newsymnode_226325(threadparam);
		LOC28 = 0;
		LOC28 = newasgnstmt_401061(LOC26, LOC27);
		add_225165(body, LOC28);
	}
	LA23: ;
	LOC29 = 0;
	LOC29 = newsymnode_226325(threadparam);
	LOC30 = 0;
	LOC30 = callcodegenproc_403086(((NimStringDesc*) &TMP4245), LOC29, NIM_NIL, NIM_NIL, NIM_NIL);
	add_225165(body, LOC30);
	{
		Tnode224809* LOC35;
		Tnode224809* LOC36;
		Tnode224809* LOC37;
		if (!(spawnkind == ((NU8) 2))) goto LA33;
		LOC35 = 0;
		LOC35 = newsymnode_226325(threadlocalprom);
		LOC36 = 0;
		LOC36 = genderef_403075(LOC35);
		LOC37 = 0;
		LOC37 = newasgnstmt_401061(LOC36, call);
		add_225165(body, LOC37);
	}
	goto LA31;
	LA33: ;
	{
		NU8 fk;
		Tnode224809* LOC47;
		NimStringDesc* LOC48;
		Tnode224809* LOC54;
		Tnode224809* LOC55;
		if (!!((fv == NIM_NIL))) goto LA39;
		fk = flowvarkind_403219((*(*fv).typ).sons->data[((NI) 1)]);
		{
			NimStringDesc* LOC45;
			NimStringDesc* LOC46;
			if (!(fk == ((NU8) 0))) goto LA43;
			LOC45 = 0;
			LOC46 = 0;
			LOC46 = typetostring_254032((*(*fv).typ).sons->data[((NI) 1)], ((NU8) 0));
			LOC45 = rawNewString(LOC46->Sup.len + 33);
appendString(LOC45, ((NimStringDesc*) &TMP4246));
appendString(LOC45, LOC46);
			localerror_195139((*f).info, LOC45);
		}
		LA43: ;
		LOC47 = 0;
		LOC47 = newsymnode_226325(threadlocalprom);
		LOC48 = 0;
		{
			if (!(fk == ((NU8) 1))) goto LA51;
			LOC48 = copyString(((NimStringDesc*) &TMP4247));
		}
		goto LA49;
		LA51: ;
		{
			LOC48 = copyString(((NimStringDesc*) &TMP4248));
		}
		LA49: ;
		LOC54 = 0;
		LOC54 = indirectaccess_402408(LOC47, LOC48, (*fv).info);
		LOC55 = 0;
		LOC55 = newasgnstmt_401061(LOC54, call);
		add_225165(body, LOC55);
		{
			Tnode224809* increfcall;
			Tsym224841* LOC60;
			Tnode224809* LOC61;
			if (!(fk == ((NU8) 1))) goto LA58;
			increfcall = newnodei_226407(((NU8) 27), (*fv).info, ((NI) 2));
			LOC60 = 0;
			LOC60 = createmagic_230048(((NimStringDesc*) &TMP4249), ((NU8) 42));
			asgnRefNoCycle((void**) (&(*increfcall).kindU.S6.sons->data[((NI) 0)]), newsymnode_226325(LOC60));
			LOC61 = 0;
			LOC61 = newsymnode_226325(threadlocalprom);
			asgnRefNoCycle((void**) (&(*increfcall).kindU.S6.sons->data[((NI) 1)]), indirectaccess_402408(LOC61, ((NimStringDesc*) &TMP4247), (*fv).info));
			add_225165(body, increfcall);
		}
		LA58: ;
		{
			Tnode224809* LOC66;
			Tnode224809* LOC67;
			if (!(barrier == NIM_NIL)) goto LA64;
			LOC66 = 0;
			LOC66 = newsymnode_226325(threadlocalprom);
			LOC67 = 0;
			LOC67 = callcodegenproc_403086(((NimStringDesc*) &TMP4250), LOC66, NIM_NIL, NIM_NIL, NIM_NIL);
			add_225165(body, LOC67);
		}
		LA64: ;
	}
	goto LA31;
	LA39: ;
	{
		add_225165(body, call);
	}
	LA31: ;
	{
		Tnode224809* LOC73;
		Tnode224809* LOC74;
		if (!!((barrier == NIM_NIL))) goto LA71;
		LOC73 = 0;
		LOC73 = newsymnode_226325(threadlocalbarrier);
		LOC74 = 0;
		LOC74 = callcodegenproc_403086(((NimStringDesc*) &TMP4251), LOC73, NIM_NIL, NIM_NIL, NIM_NIL);
		add_225165(body, LOC74);
	}
	LA71: ;
	params = newnodei_226351(((NU8) 76), (*f).info);
	add_225165(params, emptynode_225807);
	LOC75 = 0;
	LOC75 = newsymnode_226325(threadparam);
	add_225165(params, LOC75);
	LOC76 = 0;
	LOC76 = newsymnode_226325(argsparam);
	add_225165(params, LOC76);
	t = newtype_227140(((NU8) 25), (*threadparam).owner);
	rawaddson_228498(t, NIM_NIL);
	rawaddson_228498(t, (*threadparam).typ);
	rawaddson_228498(t, (*argsparam).typ);
	asgnRefNoCycle((void**) (&(*t).n), newnodei_226351(((NU8) 76), (*f).info));
	LOC77 = 0;
	LOC77 = newnodei_226351(((NU8) 152), (*f).info);
	add_225165((*t).n, LOC77);
	LOC78 = 0;
	LOC78 = newsymnode_226325(threadparam);
	add_225165((*t).n, LOC78);
	LOC79 = 0;
	LOC79 = newsymnode_226325(argsparam);
	add_225165((*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*) &TMP2893));
	}
	LA82: ;
	LOC80 = rawNewString(LOC81->Sup.len + 7);
appendString(LOC80, LOC81);
appendString(LOC80, ((NimStringDesc*) &TMP4252));
	name = LOC80;
	LOC87 = 0;
	LOC87 = getident_197463(name);
	result = newsym_225655(((NU8) 12), LOC87, (*argsparam).owner, (*f).info);
	LOC88 = 0;
	LOC88 = newsymnode_226325(result);
	asgnRefNoCycle((void**) (&(*result).ast), newprocnode_227058(((NU8) 79), (*f).info, body, params, LOC88, emptynode_225807, emptynode_225807, emptynode_225807, emptynode_225807));
	asgnRefNoCycle((void**) (&(*result).typ), t);
	return result;
}

N_NIMCALL(Tnode224809*, wrapprocforspawn_403850)(Tsym224841* owner, Tnode224809* spawnexpr, Ttype224847* rettype, Tnode224809* barrier, Tnode224809* dest) {
	Tnode224809* result;
	Tnode224809* n;
	NI LOC1;
	NU8 spawnkind;
	Tsym224841* threadparam;
	Tident197021* LOC32;
	Tsym224841* argsparam;
	Tident197021* LOC33;
	Ttype224847* objtype;
	Tnode224809* castexpr;
	Tsym224841* scratchobj;
	Tident197021* LOC35;
	Tnode224809* call;
	Tnode224809* fn;
	Tnode224809* varsection;
	Tnode224809* varinit;
	Tnode224809* barrierasexpr;
	Tnode224809* fvfield;
	Tnode224809* fvasexpr;
	Tsym224841* wrapper;
	NimStringDesc* LOC91;
	NI LOC92;
	NimStringDesc* LOC93;
	Tnode224809* LOC94;
	Tnode224809* LOC95;
	Tnode224809* LOC96;
	Tnode224809* LOC97;
{	result = 0;
	LOC1 = 0;
	LOC1 = len_225098(spawnexpr);
	n = HEX5BHEX5D_225244(spawnexpr, (NI)(LOC1 - ((NI) 2)));
	spawnkind = spawnresult_403208(rettype, !((barrier == NIM_NIL)));
	switch (spawnkind) {
	case ((NU8) 0):
	{
		{
			NimStringDesc* LOC7;
			if (!!((dest == NIM_NIL))) goto LA5;
			LOC7 = 0;
			LOC7 = HEX24_195279(TMP4224);
			internalerror_195191(LOC7);
		}
		LA5: ;
		result = newnodei_226351(((NU8) 115), (*n).info);
	}
	break;
	case ((NU8) 1):
	{
		{
			NimStringDesc* LOC13;
			if (!!((dest == NIM_NIL))) goto LA11;
			LOC13 = 0;
			LOC13 = HEX24_195279(TMP4225);
			internalerror_195191(LOC13);
		}
		LA11: ;
		result = newnodeit_226807(((NU8) 126), (*n).info, rettype);
	}
	break;
	case ((NU8) 2):
	{
		{
			if (!(dest == NIM_NIL)) goto LA17;
			localerror_195139((*n).info, ((NimStringDesc*) &TMP4226));
		}
		LA17: ;
		result = newnodei_226351(((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_195139((*n).info, ((NimStringDesc*) &TMP4227));
		goto BeforeRet;
	}
	LA21: ;
	{
		if (!((gglobaloptions_166132 &(1<<((((NU8) 24))&31)))!=0)) goto LA25;
		{
			Tnode224809* LOC29;
			LOC29 = 0;
			LOC29 = HEX5BHEX5D_225244(n, ((NI) 0));
			if (!((130 & (*(*LOC29).typ).flags) == 0)) goto LA30;
			localerror_195139((*n).info, ((NimStringDesc*) &TMP4228));
		}
		LA30: ;
	}
	LA25: ;
	LOC32 = 0;
	LOC32 = getident_197463(((NimStringDesc*) &TMP4229));
	threadparam = newsym_225655(((NU8) 3), LOC32, owner, (*n).info);
	LOC33 = 0;
	LOC33 = getident_197463(((NimStringDesc*) &TMP4230));
	argsparam = newsym_225655(((NU8) 3), LOC33, owner, (*n).info);
	{
		Ttype224847* ptrtype;
		ptrtype = getsystype_273190(((NU8) 26));
		asgnRefNoCycle((void**) (&(*threadparam).typ), ptrtype);
		asgnRefNoCycle((void**) (&(*argsparam).typ), ptrtype);
		(*argsparam).position = ((NI) 1);
	}
	objtype = createobj_401372(owner, (*n).info);
	(*objtype).flags |= ((NU32)1)<<((((NU8) 2))%(sizeof(NU32)*8));
	castexpr = createcastexpr_403557(argsparam, objtype);
	LOC35 = 0;
	LOC35 = getident_197463(((NimStringDesc*) &TMP4231));
	scratchobj = newsym_225655(((NU8) 8), LOC35, owner, (*n).info);
	{
		Tnode224809* varsectionb;
		Tnode224809* LOC37;
		asgnRefNoCycle((void**) (&(*scratchobj).typ), objtype);
		(*scratchobj).flags |= ((NU32)1)<<((((NU8) 2))%(sizeof(NU32)*8));
		varsectionb = newnodei_226351(((NU8) 99), (*n).info);
		LOC37 = 0;
		LOC37 = newsymnode_226325(scratchobj);
		addvar_401047(varsectionb, LOC37);
		add_225165(result, varsectionb);
	}
	call = newnodeit_226807(((NU8) 27), (*n).info, (*n).typ);
	fn = (*n).kindU.S6.sons->data[((NI) 0)];
	{
		NIM_BOOL LOC40;
		Ttype224847* argtype;
		Tnode224809* LOC44;
		Tsym224841* field;
		Tident197021* LOC45;
		Tnode224809* LOC46;
		Tnode224809* LOC47;
		Tnode224809* LOC48;
		LOC40 = 0;
		LOC40 = ((*fn).kind == ((NU8) 3));
		if (!(LOC40)) goto LA41;
		LOC40 = ((471040 &(1<<(((*(*fn).kindU.S4.sym).kind)&31)))!=0);
		LA41: ;
		if (!!(LOC40)) goto LA42;
		LOC44 = 0;
		LOC44 = HEX5BHEX5D_225244(n, ((NI) 0));
		argtype = skiptypes_228167((*LOC44).typ, IL64(211106232576256));
		LOC45 = 0;
		LOC45 = getident_197463(((NimStringDesc*) &TMP4232));
		field = newsym_225655(((NU8) 19), LOC45, owner, (*n).info);
		asgnRefNoCycle((void**) (&(*field).typ), argtype);
		addfield_401809(objtype, field);
		LOC46 = 0;
		LOC46 = newdotexpr_402208(scratchobj, field);
		LOC47 = 0;
		LOC47 = HEX5BHEX5D_225244(n, ((NI) 0));
		LOC48 = 0;
		LOC48 = newfastasgnstmt_401074(LOC46, LOC47);
		add_225165(result, LOC48);
		fn = indirectaccess_403038(castexpr, field, (*n).info);
	}
	goto LA38;
	LA42: ;
	{
		NIM_BOOL LOC50;
		LOC50 = 0;
		LOC50 = ((*fn).kind == ((NU8) 3));
		if (!(LOC50)) goto LA51;
		LOC50 = ((49152 &(1<<(((*(*fn).kindU.S4.sym).kind)&31)))!=0);
		LA51: ;
		if (!LOC50) goto LA52;
		localerror_195139((*n).info, ((NimStringDesc*) &TMP4233));
	}
	goto LA38;
	LA52: ;
	{
		if (!((*(*fn).typ).callconv == ((NU8) 8))) goto LA55;
		localerror_195139((*n).info, ((NimStringDesc*) &TMP4234));
	}
	goto LA38;
	LA55: ;
	LA38: ;
	add_225165(call, fn);
	varsection = newnodei_226351(((NU8) 99), (*n).info);
	varinit = newnodei_226351(((NU8) 115), (*n).info);
	{
		if (!barrier == 0) goto LA59;
		setupargsforconcurrency_403571(n, objtype, scratchobj, castexpr, call, varsection, varinit, result);
	}
	goto LA57;
	LA59: ;
	{
		setupargsforparallelism_403714(n, objtype, scratchobj, castexpr, call, varsection, varinit, result);
	}
	LA57: ;
	barrierasexpr = NIM_NIL;
	{
		Ttype224847* typ;
		Tsym224841* LOC66;
		Tsym224841* field;
		Tident197021* LOC67;
		Tnode224809* LOC68;
		Tnode224809* LOC69;
		if (!!((barrier == NIM_NIL))) goto LA64;
		typ = newtype_227140(((NU8) 21), owner);
		LOC66 = 0;
		LOC66 = getcompilerproc_273811(((NimStringDesc*) &TMP4238));
		rawaddson_228498(typ, (*LOC66).typ);
		LOC67 = 0;
		LOC67 = getident_197463(((NimStringDesc*) &TMP4239));
		field = newsym_225655(((NU8) 19), LOC67, owner, (*n).info);
		asgnRefNoCycle((void**) (&(*field).typ), typ);
		addfield_401809(objtype, field);
		LOC68 = 0;
		LOC68 = newdotexpr_402208(scratchobj, field);
		LOC69 = 0;
		LOC69 = newfastasgnstmt_401074(LOC68, barrier);
		add_225165(result, LOC69);
		barrierasexpr = indirectaccess_403038(castexpr, field, (*n).info);
	}
	LA64: ;
	fvfield = NIM_NIL;
	fvasexpr = NIM_NIL;
	{
		Tsym224841* field;
		Tident197021* LOC74;
		NI LOC75;
		Tnode224809* LOC76;
		Tnode224809* LOC77;
		Tnode224809* LOC78;
		if (!(spawnkind == ((NU8) 1))) goto LA72;
		LOC74 = 0;
		LOC74 = getident_197463(((NimStringDesc*) &TMP4240));
		field = newsym_225655(((NU8) 19), LOC74, owner, (*n).info);
		asgnRefNoCycle((void**) (&(*field).typ), rettype);
		addfield_401809(objtype, field);
		fvfield = newdotexpr_402208(scratchobj, field);
		fvasexpr = indirectaccess_403038(castexpr, field, (*n).info);
		LOC75 = 0;
		LOC75 = len_225098(spawnexpr);
		LOC76 = 0;
		LOC76 = HEX5BHEX5D_225244(spawnexpr, (NI)(LOC75 - ((NI) 1)));
		LOC77 = 0;
		LOC77 = callproc_403184(LOC76);
		LOC78 = 0;
		LOC78 = newfastasgnstmt_401074(fvfield, LOC77);
		add_225165(result, LOC78);
		{
			Tnode224809* LOC83;
			if (!(barrier == NIM_NIL)) goto LA81;
			LOC83 = 0;
			LOC83 = callcodegenproc_403086(((NimStringDesc*) &TMP4241), fvfield, NIM_NIL, NIM_NIL, NIM_NIL);
			add_225165(result, LOC83);
		}
		LA81: ;
	}
	goto LA70;
	LA72: ;
	{
		Tsym224841* field;
		Tident197021* LOC87;
		Tnode224809* LOC88;
		Tnode224809* LOC89;
		Tnode224809* LOC90;
		if (!(spawnkind == ((NU8) 2))) goto LA85;
		LOC87 = 0;
		LOC87 = getident_197463(((NimStringDesc*) &TMP4240));
		field = newsym_225655(((NU8) 19), LOC87, owner, (*n).info);
		asgnRefNoCycle((void**) (&(*field).typ), newtype_227140(((NU8) 21), (*objtype).owner));
		rawaddson_228498((*field).typ, rettype);
		addfield_401809(objtype, field);
		fvasexpr = indirectaccess_403038(castexpr, field, (*n).info);
		LOC88 = 0;
		LOC88 = newdotexpr_402208(scratchobj, field);
		LOC89 = 0;
		LOC89 = genaddrof_403064(dest);
		LOC90 = 0;
		LOC90 = newfastasgnstmt_401074(LOC88, LOC89);
		add_225165(result, LOC90);
	}
	goto LA70;
	LA85: ;
	LA70: ;
	wrapper = createwrapperproc_403333(fn, threadparam, argsparam, varsection, varinit, call, barrierasexpr, fvasexpr, spawnkind);
	LOC91 = 0;
	LOC92 = 0;
	LOC92 = len_225098(spawnexpr);
	LOC93 = 0;
	LOC93 = nimIntToStr(LOC92);
	LOC91 = rawNewString(LOC93->Sup.len + 8);
appendString(LOC91, ((NimStringDesc*) &TMP4253));
appendString(LOC91, LOC93);
	LOC94 = 0;
	LOC94 = newsymnode_226325(wrapper);
	LOC95 = 0;
	LOC95 = newsymnode_226325(scratchobj);
	LOC96 = 0;
	LOC96 = genaddrof_403064(LOC95);
	LOC97 = 0;
	LOC97 = callcodegenproc_403086(LOC91, LOC94, LOC96, NIM_NIL, spawnexpr);
	add_225165(result, LOC97);
	{
		if (!(spawnkind == ((NU8) 1))) goto LA100;
		add_225165(result, fvfield);
	}
	LA100: ;
	}BeforeRet: ;
	return result;
}
NIM_EXTERNC N_NOINLINE(void, compiler_loweringsInit000)(void) {
}

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

