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

#include "nimbase.h"
#include <string.h>
typedef struct Tnode225809 Tnode225809;
typedef struct Tsym225841 Tsym225841;
typedef struct Tlineinfo190352 Tlineinfo190352;
typedef struct Ttype225847 Ttype225847;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tident198021 Tident198021;
typedef struct Tnodeseq225803 Tnodeseq225803;
typedef struct Tidobj198015 Tidobj198015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttypeseq225843 Ttypeseq225843;
typedef struct Tscope225835 Tscope225835;
typedef struct TY225944 TY225944;
typedef struct Tstrtable225813 Tstrtable225813;
typedef struct Tsymseq225811 Tsymseq225811;
typedef struct Tloc225823 Tloc225823;
typedef struct Ropeobj176009 Ropeobj176009;
typedef struct Tlib225827 Tlib225827;
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 Memregion30890 Memregion30890;
typedef struct Smallchunk30842 Smallchunk30842;
typedef struct Llchunk30884 Llchunk30884;
typedef struct Bigchunk30844 Bigchunk30844;
typedef struct Intset30817 Intset30817;
typedef struct Trunk30813 Trunk30813;
typedef struct Avlnode30888 Avlnode30888;
typedef struct Gcstat51014 Gcstat51014;
typedef struct TY90959 TY90959;
typedef struct Tinstantiation225831 Tinstantiation225831;
typedef struct Tlistentry140022 Tlistentry140022;
typedef struct Basechunk30840 Basechunk30840;
typedef struct Freecell30832 Freecell30832;
typedef struct TY225932 TY225932;
struct  Tlineinfo190352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tnode225809  {
Ttype225847* typ;
Tlineinfo190352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym225841* sym;
} S4;
struct {Tident198021* ident;
} S5;
struct {Tnodeseq225803* 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  Tidobj198015  {
  TNimObject Sup;
NI id;
};
struct  Tstrtable225813  {
NI counter;
Tsymseq225811* data;
};
struct  Tloc225823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype225847* t;
Ropeobj176009* r;
Ropeobj176009* heaproot;
};
struct  Tsym225841  {
  Tidobj198015 Sup;
NU8 kind;
union{
struct {Ttypeseq225843* typeinstcache;
Tscope225835* typscope;
} S1;
struct {TY225944* procinstcache;
Tsym225841* gcunsafetyreason;
} S2;
struct {TY225944* usedgenerics;
Tstrtable225813 tab;
} S3;
struct {Tsym225841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype225847* typ;
Tident198021* name;
Tlineinfo190352 info;
Tsym225841* owner;
NU32 flags;
Tnode225809* ast;
NU32 options;
NI position;
NI offset;
Tloc225823 loc;
Tlib225827* annex;
Tnode225809* 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 Smallchunk30842* TY30905[512];
typedef Trunk30813* Trunkbuckets30815[256];
struct  Intset30817  {
Trunkbuckets30815 data;
};
struct  Memregion30890  {
NI minlargeobj;
NI maxlargeobj;
TY30905 freesmallchunks;
Llchunk30884* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk30844* freechunkslist;
Intset30817 chunkstarts;
Avlnode30888* root;
Avlnode30888* deleted;
Avlnode30888* last;
Avlnode30888* freeavlnodes;
};
struct  Gcstat51014  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap51018  {
Gcstack51016* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq48963 zct;
Cellseq48963 decstack;
Cellset48959 cycleroots;
Cellseq48963 tempstack;
NI recgclock;
Memregion30890 region;
Gcstat51014 stat;
};
struct  Ttype225847  {
  Tidobj198015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq225843* sons;
Tnode225809* n;
Tsym225841* owner;
Tsym225841* sym;
Tsym225841* destructor;
Tsym225841* deepcopy;
Tsym225841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc225823 loc;
};
struct  Tident198021  {
  Tidobj198015 Sup;
NimStringDesc* s;
Tident198021* next;
NI h;
};
struct TY90959 {
NimStringDesc* Field0;
NI Field1;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Tscope225835  {
NI depthlevel;
Tstrtable225813 symbols;
Tnodeseq225803* usingsyms;
Tscope225835* parent;
};
struct  Ropeobj176009  {
  TNimObject Sup;
Ropeobj176009* left;
Ropeobj176009* right;
NI length;
NimStringDesc* data;
};
struct  Tlistentry140022  {
  TNimObject Sup;
Tlistentry140022* prev;
Tlistentry140022* next;
};
struct  Tlib225827  {
  Tlistentry140022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj176009* name;
Tnode225809* path;
};
struct  Gcstack51016  {
Gcstack51016* prev;
Gcstack51016* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY30821[16];
struct  Pagedesc48955  {
Pagedesc48955* next;
NI key;
TY30821 bits;
};
struct  Basechunk30840  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk30842  {
  Basechunk30840 Sup;
Smallchunk30842* next;
Smallchunk30842* prev;
Freecell30832* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk30884  {
NI size;
NI acc;
Llchunk30884* next;
};
struct  Bigchunk30844  {
  Basechunk30840 Sup;
Bigchunk30844* next;
Bigchunk30844* prev;
NI align;
NF data;
};
struct  Trunk30813  {
Trunk30813* next;
NI key;
TY30821 bits;
};
typedef Avlnode30888* TY30895[2];
struct  Avlnode30888  {
TY30895 link;
NI key;
NI upperbound;
NI level;
};
struct  Tinstantiation225831  {
Tsym225841* sym;
Ttypeseq225843* concretetypes;
TY225932* usedby;
NI compilesid;
};
struct  Freecell30832  {
Freecell30832* next;
NI zerofield;
};
struct Tnodeseq225803 {
  TGenericSeq Sup;
  Tnode225809* data[SEQ_DECL_SIZE];
};
struct Ttypeseq225843 {
  TGenericSeq Sup;
  Ttype225847* data[SEQ_DECL_SIZE];
};
struct TY225944 {
  TGenericSeq Sup;
  Tinstantiation225831* data[SEQ_DECL_SIZE];
};
struct Tsymseq225811 {
  TGenericSeq Sup;
  Tsym225841* data[SEQ_DECL_SIZE];
};
struct TY225932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(Tnode225809*, newnodei_227351)(NU8 kind, Tlineinfo190352 info);
N_NIMCALL(Tsym225841*, newsym_226656)(NU8 symkind, Tident198021* name, Tsym225841* owner, Tlineinfo190352 info);
N_NIMCALL(Tident198021*, getident_198463)(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(Tnode225809*, newsymnode_227325)(Tsym225841* sym);
N_NIMCALL(Tnode225809*, newnodei_227407)(NU8 kind, Tlineinfo190352 info, NI children);
static N_INLINE(Tnode225809*, HEX5BHEX5D_226244)(Tnode225809* n, NI i);
N_NIMCALL(void, addson_227819)(Tnode225809* father, Tnode225809* son);
N_NIMCALL(void, add_226165)(Tnode225809* father, Tnode225809* son);
N_NIMCALL(Tnode225809*, newfastasgnstmt_402074)(Tnode225809* le, Tnode225809* ri);
N_NIMCALL(Tnode225809*, lastson_228406)(Tnode225809* n);
N_NIMCALL(Ttype225847*, skiptypes_229167)(Ttype225847* t, NU64 kinds);
N_NIMCALL(void, addvar_402047)(Tnode225809* father, Tnode225809* v);
N_NIMCALL(Tnode225809*, newasgnstmt_402061)(Tnode225809* le, Tnode225809* ri);
static N_INLINE(NI, len_226098)(Tnode225809* n);
N_NIMCALL(Tnode225809*, newtupleaccess_402034)(Tnode225809* tup, NI i);
N_NIMCALL(Tnode225809*, newnodeit_227807)(NU8 kind, Tlineinfo190352 info, Ttype225847* typ);
N_NIMCALL(Tnode225809*, copytree_230028)(Tnode225809* src);
N_NIMCALL(Ttype225847*, getsystype_274190)(NU8 kind);
N_NIMCALL(Ttype225847*, newtype_228140)(NU8 kind, Tsym225841* owner);
N_NIMCALL(void, rawaddson_229498)(Ttype225847* father, Ttype225847* son);
N_NIMCALL(NI, sonslen_228387)(Tnode225809* 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(Ttype225847*, skipintlit_274696)(Ttype225847* t);
N_NIMCALL(Tsym225841*, lookupinrecord_233236)(Tnode225809* n, Tident198021* field);
N_NIMCALL(Tnode225809*, indirectaccess_403408)(Tnode225809* a, NimStringDesc* b, Tlineinfo190352 info);
N_NIMCALL(Tsym225841*, getsymfromlist_233228)(Tnode225809* list, Tident198021* ident, NI start);
N_NIMCALL(void, internalerror_196191)(NimStringDesc* errmsg);
N_NIMCALL(NimStringDesc*, HEX24_196279)(TY90959 x);
N_NIMCALL(Tnode225809*, newidentnode_227313)(Tident198021* ident, Tlineinfo190352 info);
N_NIMCALL(Tnode225809*, newtupleaccessraw_402270)(Tnode225809* tup, NI i);
N_NIMCALL(Tnode225809*, newintnode_226608)(NU8 kind, NI64 intval);
N_NIMCALL(Tnode225809*, newintlit_404681)(NI64 value);
N_NIMCALL(NI64, lastord_255010)(Ttype225847* t);
N_NIMCALL(Tsym225841*, createmagic_231047)(NimStringDesc* name, NU8 m);
static N_INLINE(NIM_BOOL, isemptytype_230932)(Ttype225847* t);
N_NIMCALL(NIM_BOOL, containsgarbagecollectedref_255154)(Ttype225847* typ);
N_NIMCALL(NU8, spawnresult_404208)(Ttype225847* t, NIM_BOOL inparallel);
N_NIMCALL(void, localerror_196139)(Tlineinfo190352 info, NimStringDesc* arg);
N_NIMCALL(Ttype225847*, createobj_402372)(Tsym225841* owner, Tlineinfo190352 info);
N_NIMCALL(Tnode225809*, createcastexpr_404557)(Tsym225841* argsparam, Ttype225847* objtype);
N_NIMCALL(void, addfield_402809)(Ttype225847* obj, Tsym225841* s);
N_NIMCALL(Tnode225809*, newdotexpr_403208)(Tsym225841* obj, Tsym225841* b);
N_NIMCALL(Tnode225809*, indirectaccess_404038)(Tnode225809* a, Tsym225841* b, Tlineinfo190352 info);
N_NIMCALL(void, setupargsforconcurrency_404571)(Tnode225809* n, Ttype225847* objtype, Tsym225841* scratchobj, Tnode225809* castexpr, Tnode225809* call, Tnode225809* varsection, Tnode225809* varinit, Tnode225809* result);
N_NIMCALL(Tsym225841*, addlocalvar_404271)(Tnode225809* varsection, Tnode225809* varinit, Tsym225841* owner, Ttype225847* typ, Tnode225809* v, NIM_BOOL useshallowcopy);
N_NIMCALL(NIM_BOOL, typeneedsnodeepcopy_404240)(Ttype225847* t_404242);
N_NIMCALL(void, setupargsforparallelism_404714)(Tnode225809* n_404716, Ttype225847* objtype, Tsym225841* scratchobj, Tnode225809* castexpr, Tnode225809* call, Tnode225809* varsection, Tnode225809* varinit, Tnode225809* result);
N_NIMCALL(NU8, getmagic_254417)(Tnode225809* op);
N_NIMCALL(Tnode225809*, genaddrof_404064)(Tnode225809* n);
N_NIMCALL(Tnode225809*, genhigh_404691)(Tnode225809* n);
N_NIMCALL(Tnode225809*, genderef_404075)(Tnode225809* n);
N_NIMCALL(NI64, computesize_255184)(Ttype225847* typ);
N_NIMCALL(Tsym225841*, getroot_404646)(Tnode225809* n);
N_NIMCALL(Tsym225841*, getcompilerproc_274809)(NimStringDesc* name);
N_NIMCALL(Tnode225809*, callproc_404184)(Tnode225809* a);
N_NIMCALL(Tnode225809*, callcodegenproc_404086)(NimStringDesc* name, Tnode225809* arg1, Tnode225809* arg2, Tnode225809* arg3, Tnode225809* optionalargs);
N_NIMCALL(void, localerror_196128)(Tlineinfo190352 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(Tsym225841*, createwrapperproc_404333)(Tnode225809* f, Tsym225841* threadparam, Tsym225841* argsparam, Tnode225809* varsection, Tnode225809* varinit, Tnode225809* call, Tnode225809* barrier, Tnode225809* fv, NU8 spawnkind);
N_NIMCALL(NU8, flowvarkind_404219)(Ttype225847* t);
N_NIMCALL(NimStringDesc*, typetostring_255032)(Ttype225847* typ, NU8 prefer);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(Tnode225809*, newprocnode_228058)(NU8 kind, Tlineinfo190352 info, Tnode225809* body, Tnode225809* params, Tnode225809* name, Tnode225809* pattern, Tnode225809* genericparams, Tnode225809* pragmas, Tnode225809* exceptions);
STRING_LITERAL(TMP2895, ":tmp", 4);
STRING_LITERAL(TMP3459, "compiler/lowerings.nim", 22);
NIM_CONST TY90959 TMP3458 = {((NimStringDesc*) &TMP3459),
((NI) 178)}
;
STRING_LITERAL(TMP3526, "high", 4);
NIM_CONST TY90959 TMP4226 = {((NimStringDesc*) &TMP3459),
((NI) 539)}
;
NIM_CONST TY90959 TMP4227 = {((NimStringDesc*) &TMP3459),
((NI) 542)}
;
STRING_LITERAL(TMP4228, "\'spawn\' must not be discarded", 29);
STRING_LITERAL(TMP4229, "\'spawn\' takes a call expression", 31);
STRING_LITERAL(TMP4230, "\'spawn\' takes a GC safe call expression", 39);
STRING_LITERAL(TMP4231, "thread", 6);
STRING_LITERAL(TMP4232, "args", 4);
STRING_LITERAL(TMP4233, "scratch", 7);
STRING_LITERAL(TMP4234, "fn", 2);
STRING_LITERAL(TMP4235, "iterator in spawn environment is not allowed", 44);
STRING_LITERAL(TMP4236, "closure in spawn environment is not allowed", 43);
STRING_LITERAL(TMP4237, "\'spawn\'ed function cannot have a \'var\' parameter", 48);
STRING_LITERAL(TMP4238, "deepCopy", 8);
STRING_LITERAL(TMP4239, "slice", 5);
STRING_LITERAL(TMP4240, "Barrier", 7);
STRING_LITERAL(TMP4241, "barrier", 7);
STRING_LITERAL(TMP4242, "fv", 2);
STRING_LITERAL(TMP4243, "nimFlowVarCreateSemaphore", 25);
STRING_LITERAL(TMP4244, "barrierEnter", 12);
NIM_CONST TY90959 TMP4245 = {((NimStringDesc*) &TMP3459),
((NI) 336)}
;
STRING_LITERAL(TMP4246, "owner", 5);
STRING_LITERAL(TMP4247, "nimArgsPassingDone", 18);
STRING_LITERAL(TMP4248, "cannot create a flowVar of type: ", 33);
STRING_LITERAL(TMP4249, "data", 4);
STRING_LITERAL(TMP4250, "blob", 4);
STRING_LITERAL(TMP4251, "GCref", 5);
STRING_LITERAL(TMP4252, "nimFlowVarSignal", 16);
STRING_LITERAL(TMP4253, "barrierLeave", 12);
STRING_LITERAL(TMP4254, "Wrapper", 7);
STRING_LITERAL(TMP4255, "nimSpawn", 8);
extern Gcheap51018 gch_51059;
extern Tnode225809* emptynode_226807;
extern NU32 gglobaloptions_167132;

static N_INLINE(Cell48947*, usrtocell_52646)(void* usr) {
	Cell48947* result;
	result = 0;
	result = ((Cell48947*) ((NI)((NU32)(((NI) (usr))) - (NU32)(((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 (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA11;
			rtladdzct_54204(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

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

N_NIMCALL(Tnode225809*, newfastasgnstmt_402074)(Tnode225809* le, Tnode225809* ri) {
	Tnode225809* result;
	result = 0;
	result = newnodei_227407(((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(Tnode225809*, lowerswap_402338)(Tnode225809* n, Tsym225841* owner) {
	Tnode225809* result;
	Tsym225841* temp;
	Tident198021* LOC1;
	Tnode225809* v;
	Tnode225809* tempasnode;
	Tnode225809* vpart;
	Tnode225809* LOC2;
	Tnode225809* LOC3;
	Tnode225809* LOC4;
	Tnode225809* LOC5;
	Tnode225809* LOC6;
	result = 0;
	result = newnodei_227351(((NU8) 115), (*n).info);
	LOC1 = 0;
	LOC1 = getident_198463(((NimStringDesc*) &TMP2895));
	temp = newsym_226656(((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_227351(((NU8) 99), (*n).info);
	tempasnode = newsymnode_227325(temp);
	vpart = newnodei_227407(((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_226807);
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 2)]), HEX5BHEX5D_226244(n, ((NI) 1)));
	addson_227819(v, vpart);
	add_226165(result, v);
	LOC2 = 0;
	LOC2 = HEX5BHEX5D_226244(n, ((NI) 1));
	LOC3 = 0;
	LOC3 = HEX5BHEX5D_226244(n, ((NI) 2));
	LOC4 = 0;
	LOC4 = newfastasgnstmt_402074(LOC2, LOC3);
	add_226165(result, LOC4);
	LOC5 = 0;
	LOC5 = HEX5BHEX5D_226244(n, ((NI) 2));
	LOC6 = 0;
	LOC6 = newfastasgnstmt_402074(LOC5, tempasnode);
	add_226165(result, LOC6);
	return result;
}

N_NIMCALL(void, addvar_402047)(Tnode225809* father, Tnode225809* v) {
	Tnode225809* vpart;
	vpart = newnodei_227407(((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_226807);
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 2)]), emptynode_226807);
	addson_227819(father, vpart);
}

N_NIMCALL(Tnode225809*, newasgnstmt_402061)(Tnode225809* le, Tnode225809* ri) {
	Tnode225809* result;
	result = 0;
	result = newnodei_227407(((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_226098)(Tnode225809* 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(Tnode225809*, newtupleaccess_402034)(Tnode225809* tup, NI i) {
	Tnode225809* result;
	Ttype225847* LOC1;
	Tnode225809* LOC2;
	Tnode225809* lit;
	Ttype225847* LOC3;
	result = 0;
	LOC1 = 0;
	LOC1 = skiptypes_229167((*tup).typ, IL64(211106232576256));
	result = newnodeit_227807(((NU8) 42), (*tup).info, (*LOC1).sons->data[i]);
	LOC2 = 0;
	LOC2 = copytree_230028(tup);
	addson_227819(result, LOC2);
	LOC3 = 0;
	LOC3 = getsystype_274190(((NU8) 31));
	lit = newnodeit_227807(((NU8) 6), (*tup).info, LOC3);
	(*lit).kindU.S1.intval = ((NI64) (i));
	addson_227819(result, lit);
	return result;
}

N_NIMCALL(Tnode225809*, lowertupleunpacking_402087)(Tnode225809* n, Tsym225841* owner) {
	Tnode225809* result;
	Tnode225809* value;
	Tsym225841* temp;
	Tident198021* LOC1;
	Tnode225809* v;
	Tnode225809* tempasnode;
	Tnode225809* LOC2;
	result = 0;
	value = lastson_228406(n);
	result = newnodei_227351(((NU8) 115), (*n).info);
	LOC1 = 0;
	LOC1 = getident_198463(((NimStringDesc*) &TMP2895));
	temp = newsym_226656(((NU8) 5), LOC1, owner, (*value).info);
	asgnRefNoCycle((void**) (&(*temp).typ), skiptypes_229167((*value).typ, IL64(211106232576256)));
	(*temp).flags |= ((NU32)1)<<((((NU8) 2))%(sizeof(NU32)*8));
	v = newnodei_227351(((NU8) 99), (*value).info);
	tempasnode = newsymnode_227325(temp);
	addvar_402047(v, tempasnode);
	add_226165(result, v);
	LOC2 = 0;
	LOC2 = newasgnstmt_402061(tempasnode, value);
	add_226165(result, LOC2);
	{
		NI i_402232;
		NI HEX3Atmp_402248;
		NI LOC4;
		NI res_402251;
		i_402232 = 0;
		HEX3Atmp_402248 = 0;
		LOC4 = 0;
		LOC4 = len_226098(n);
		HEX3Atmp_402248 = (NI)(LOC4 - ((NI) 3));
		res_402251 = ((NI) 0);
		{
			while (1) {
				Tnode225809* LOC11;
				Tnode225809* LOC12;
				if (!(res_402251 <= HEX3Atmp_402248)) goto LA6;
				i_402232 = res_402251;
				{
					if (!((*(*n).kindU.S6.sons->data[i_402232]).kind == ((NU8) 3))) goto LA9;
					addvar_402047(v, (*n).kindU.S6.sons->data[i_402232]);
				}
				LA9: ;
				LOC11 = 0;
				LOC11 = newtupleaccess_402034(tempasnode, i_402232);
				LOC12 = 0;
				LOC12 = newasgnstmt_402061((*n).kindU.S6.sons->data[i_402232], LOC11);
				add_226165(result, LOC12);
				res_402251 += ((NI) 1);
			} LA6: ;
		}
	}
	return result;
}

N_NIMCALL(Ttype225847*, createobj_402372)(Tsym225841* owner, Tlineinfo190352 info) {
	Ttype225847* result;
	result = 0;
	result = newtype_228140(((NU8) 17), owner);
	rawaddson_229498(result, NIM_NIL);
	(*result).flags |= ((NU32)1)<<((((NU8) 2))%(sizeof(NU32)*8));
	asgnRefNoCycle((void**) (&(*result).n), newnodei_227351(((NU8) 138), info));
	return result;
}

N_NIMCALL(void, rawaddfield_402393)(Ttype225847* obj, Tsym225841* field) {
	Tnode225809* LOC1;
	(*field).position = sonslen_228387((*obj).n);
	LOC1 = 0;
	LOC1 = newsymnode_227325(field);
	addson_227819((*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(Ttype225847*, skipintlit_274696)(Ttype225847* t) {
	Ttype225847* result;
{	result = 0;
	{
		if (!!(((*t).n == NIM_NIL))) goto LA3;
		{
			if (!((*t).kind == ((NU8) 31) || (*t).kind == ((NU8) 36))) goto LA7;
			result = getsystype_274190((*t).kind);
			goto BeforeRet;
		}
		LA7: ;
	}
	LA3: ;
	result = t;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, addfield_402809)(Ttype225847* obj, Tsym225841* s) {
	Tsym225841* field;
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	Tident198021* LOC3;
	Ttype225847* t;
	Tnode225809* 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_198463(LOC1);
	field = newsym_226656(((NU8) 19), LOC3, (*s).owner, (*s).info);
	t = skipintlit_274696((*s).typ);
	asgnRefNoCycle((void**) (&(*field).typ), t);
	(*field).position = sonslen_228387((*obj).n);
	LOC4 = 0;
	LOC4 = newsymnode_227325(field);
	addson_227819((*obj).n, LOC4);
}

N_NIMCALL(void, adduniquefield_403008)(Ttype225847* obj, Tsym225841* s) {
	Tident198021* 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_198463(LOC1);
	{
		Tsym225841* LOC5;
		Tsym225841* field;
		Ttype225847* t;
		Tnode225809* LOC8;
		LOC5 = 0;
		LOC5 = lookupinrecord_233236((*obj).n, fieldname);
		if (!(LOC5 == NIM_NIL)) goto LA6;
		field = newsym_226656(((NU8) 19), fieldname, (*s).owner, (*s).info);
		t = skipintlit_274696((*s).typ);
		asgnRefNoCycle((void**) (&(*field).typ), t);
		(*field).position = sonslen_228387((*obj).n);
		LOC8 = 0;
		LOC8 = newsymnode_227325(field);
		addson_227819((*obj).n, LOC8);
	}
	LA6: ;
}

N_NIMCALL(Tnode225809*, indirectaccess_403408)(Tnode225809* a, NimStringDesc* b, Tlineinfo190352 info) {
	Tnode225809* result;
	Tnode225809* deref;
	Ttype225847* LOC1;
	Ttype225847* t;
	Tsym225841* field;
	Tnode225809* LOC18;
	result = 0;
	deref = newnodei_227351(((NU8) 65), info);
	LOC1 = 0;
	LOC1 = skiptypes_229167((*a).typ, IL64(211106232576256));
	asgnRefNoCycle((void**) (&(*deref).typ), (*LOC1).sons->data[((NI) 0)]);
	t = skiptypes_229167((*deref).typ, IL64(211106232576256));
	field = 0;
	{
		while (1) {
			Tident198021* LOC4;
			LOC4 = 0;
			LOC4 = getident_198463(b);
			field = getsymfromlist_233228((*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_229167(t, IL64(211106232576256));
		}
	} LA2: ;
	{
		NimStringDesc* LOC17;
		if (!!(!((field == NIM_NIL)))) goto LA15;
		LOC17 = 0;
		LOC17 = HEX24_196279(TMP3458);
		internalerror_196191(LOC17);
	}
	LA15: ;
	addson_227819(deref, a);
	result = newnodei_227351(((NU8) 45), info);
	addson_227819(result, deref);
	LOC18 = 0;
	LOC18 = newsymnode_227325(field);
	addson_227819(result, LOC18);
	asgnRefNoCycle((void**) (&(*result).typ), (*field).typ);
	return result;
}

N_NIMCALL(Tnode225809*, indirectaccess_404038)(Tnode225809* a, Tsym225841* b, Tlineinfo190352 info) {
	Tnode225809* 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_403408(a, LOC1, info);
	return result;
}

N_NIMCALL(Tnode225809*, rawindirectaccess_402608)(Tnode225809* a, Tsym225841* field, Tlineinfo190352 info) {
	Tnode225809* result;
	Tnode225809* deref;
	Ttype225847* LOC1;
	Tnode225809* LOC2;
	result = 0;
	deref = newnodei_227351(((NU8) 65), info);
	LOC1 = 0;
	LOC1 = skiptypes_229167((*a).typ, IL64(211106232576256));
	asgnRefNoCycle((void**) (&(*deref).typ), (*LOC1).sons->data[((NI) 0)]);
	addson_227819(deref, a);
	result = newnodei_227351(((NU8) 45), info);
	addson_227819(result, deref);
	LOC2 = 0;
	LOC2 = newsymnode_227325(field);
	addson_227819(result, LOC2);
	asgnRefNoCycle((void**) (&(*result).typ), (*field).typ);
	return result;
}

N_NIMCALL(Tnode225809*, newtupleaccessraw_402270)(Tnode225809* tup, NI i) {
	Tnode225809* result;
	Tnode225809* LOC1;
	Tnode225809* lit;
	result = 0;
	result = newnodei_227351(((NU8) 42), (*tup).info);
	LOC1 = 0;
	LOC1 = copytree_230028(tup);
	addson_227819(result, LOC1);
	lit = newnodei_227351(((NU8) 6), (*tup).info);
	(*lit).kindU.S1.intval = ((NI64) (i));
	addson_227819(result, lit);
	return result;
}

N_NIMCALL(Tnode225809*, lowertupleunpackingforasgn_402283)(Tnode225809* n, Tsym225841* owner) {
	Tnode225809* result;
	Tnode225809* value;
	Tsym225841* temp;
	Tident198021* LOC1;
	Tnode225809* v;
	Tnode225809* tempasnode;
	NimStringDesc* LOC2;
	NimStringDesc* LOC3;
	Tident198021* LOC4;
	Tnode225809* vpart;
	Tnode225809* lhs;
	result = 0;
	value = lastson_228406(n);
	result = newnodei_227351(((NU8) 115), (*n).info);
	LOC1 = 0;
	LOC1 = getident_198463(((NimStringDesc*) &TMP2895));
	temp = newsym_226656(((NU8) 5), LOC1, owner, (*value).info);
	v = newnodei_227351(((NU8) 100), (*value).info);
	LOC2 = 0;
	LOC3 = 0;
	LOC3 = nimIntToStr((*temp).Sup.id);
	LOC2 = rawNewString(LOC3->Sup.len + 4);
appendString(LOC2, ((NimStringDesc*) &TMP2895));
appendString(LOC2, LOC3);
	LOC4 = 0;
	LOC4 = getident_198463(LOC2);
	tempasnode = newidentnode_227313(LOC4, (*value).info);
	vpart = newnodei_227407(((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_226807);
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 2)]), value);
	addson_227819(v, vpart);
	add_226165(result, v);
	lhs = (*n).kindU.S6.sons->data[((NI) 0)];
	{
		NI i_402312;
		NI HEX3Atmp_402316;
		NI LOC6;
		NI res_402319;
		i_402312 = 0;
		HEX3Atmp_402316 = 0;
		LOC6 = 0;
		LOC6 = len_226098(lhs);
		HEX3Atmp_402316 = (NI)(LOC6 - ((NI) 1));
		res_402319 = ((NI) 0);
		{
			while (1) {
				Tnode225809* LOC9;
				Tnode225809* LOC10;
				if (!(res_402319 <= HEX3Atmp_402316)) goto LA8;
				i_402312 = res_402319;
				LOC9 = 0;
				LOC9 = newtupleaccessraw_402270(tempasnode, i_402312);
				LOC10 = 0;
				LOC10 = newasgnstmt_402061((*lhs).kindU.S6.sons->data[i_402312], LOC9);
				add_226165(result, LOC10);
				res_402319 += ((NI) 1);
			} LA8: ;
		}
	}
	return result;
}

N_NIMCALL(Tnode225809*, newintlit_404681)(NI64 value) {
	Tnode225809* result;
	result = 0;
	result = newintnode_226608(((NU8) 6), value);
	asgnRefNoCycle((void**) (&(*result).typ), getsystype_274190(((NU8) 31)));
	return result;
}

N_NIMCALL(Tnode225809*, genhigh_404691)(Tnode225809* n) {
	Tnode225809* result;
	result = 0;
	{
		Ttype225847* LOC3;
		Ttype225847* LOC6;
		NI64 LOC7;
		LOC3 = 0;
		LOC3 = skiptypes_229167((*n).typ, IL64(211106240964864));
		if (!((*LOC3).kind == ((NU8) 4) || (*LOC3).kind == ((NU8) 16))) goto LA4;
		LOC6 = 0;
		LOC6 = skiptypes_229167((*n).typ, IL64(211106240964864));
		LOC7 = 0;
		LOC7 = lastord_255010(LOC6);
		result = newintlit_404681(LOC7);
	}
	goto LA1;
	LA4: ;
	{
		Tsym225841* LOC9;
		result = newnodei_227407(((NU8) 27), (*n).info, ((NI) 2));
		asgnRefNoCycle((void**) (&(*result).typ), getsystype_274190(((NU8) 31)));
		LOC9 = 0;
		LOC9 = createmagic_231047(((NimStringDesc*) &TMP3526), ((NU8) 8));
		asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[((NI) 0)]), newsymnode_227325(LOC9));
		asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[((NI) 1)]), n);
	}
	LA1: ;
	return result;
}

static N_INLINE(NIM_BOOL, isemptytype_230932)(Ttype225847* 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_404208)(Ttype225847* t, NIM_BOOL inparallel) {
	NU8 result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = isemptytype_230932(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_255154(t);
		LOC7 = !(LOC9);
		LA8: ;
		if (!LOC7) goto LA10;
		result = ((NU8) 2);
	}
	goto LA1;
	LA10: ;
	{
		result = ((NU8) 1);
	}
	LA1: ;
	return result;
}

N_NIMCALL(Tnode225809*, createcastexpr_404557)(Tsym225841* argsparam, Ttype225847* objtype) {
	Tnode225809* result;
	Tnode225809* LOC1;
	result = 0;
	result = newnodei_227351(((NU8) 61), (*argsparam).info);
	add_226165(result, emptynode_226807);
	LOC1 = 0;
	LOC1 = newsymnode_227325(argsparam);
	add_226165(result, LOC1);
	asgnRefNoCycle((void**) (&(*result).typ), newtype_228140(((NU8) 21), (*objtype).owner));
	rawaddson_229498((*result).typ, objtype);
	return result;
}

N_NIMCALL(Tnode225809*, newdotexpr_403208)(Tsym225841* obj, Tsym225841* b) {
	Tnode225809* result;
	Tsym225841* field;
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	Tident198021* LOC3;
	Tnode225809* LOC4;
	Tnode225809* LOC5;
	result = 0;
	result = newnodei_227351(((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_198463(LOC1);
	field = getsymfromlist_233228((*(*obj).typ).n, LOC3, ((NI) 0));
	LOC4 = 0;
	LOC4 = newsymnode_227325(obj);
	addson_227819(result, LOC4);
	LOC5 = 0;
	LOC5 = newsymnode_227325(field);
	addson_227819(result, LOC5);
	asgnRefNoCycle((void**) (&(*result).typ), (*field).typ);
	return result;
}

N_NIMCALL(NIM_BOOL, typeneedsnodeepcopy_404240)(Ttype225847* t_404242) {
	NIM_BOOL result;
	Ttype225847* t;
	NIM_BOOL LOC9;
{	result = 0;
	t = skiptypes_229167(t_404242, 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_255154(t);
	result = !(LOC9);
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tsym225841*, addlocalvar_404271)(Tnode225809* varsection, Tnode225809* varinit, Tsym225841* owner, Ttype225847* typ, Tnode225809* v, NIM_BOOL useshallowcopy) {
	Tsym225841* result;
	Tident198021* LOC1;
	Tnode225809* vpart;
	result = 0;
	LOC1 = 0;
	LOC1 = getident_198463(((NimStringDesc*) &TMP2895));
	result = newsym_226656(((NU8) 5), LOC1, owner, (*varsection).info);
	asgnRefNoCycle((void**) (&(*result).typ), typ);
	(*result).flags |= ((NU32)1)<<((((NU8) 2))%(sizeof(NU32)*8));
	vpart = newnodei_227407(((NU8) 35), (*varsection).info, ((NI) 3));
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 0)]), newsymnode_227325(result));
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 1)]), emptynode_226807);
	{
		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_226807);
	}
	LA2: ;
	add_226165(varsection, vpart);
	{
		if (!!((varinit == NIM_NIL))) goto LA9;
		{
			NIM_BOOL LOC13;
			Tnode225809* LOC17;
			Tnode225809* LOC18;
			LOC13 = 0;
			LOC13 = useshallowcopy;
			if (!(LOC13)) goto LA14;
			LOC13 = typeneedsnodeepcopy_404240(typ);
			LA14: ;
			if (!LOC13) goto LA15;
			LOC17 = 0;
			LOC17 = newsymnode_227325(result);
			LOC18 = 0;
			LOC18 = newfastasgnstmt_402074(LOC17, v);
			add_226165(varinit, LOC18);
		}
		goto LA11;
		LA15: ;
		{
			Tnode225809* deepcopycall;
			Tsym225841* LOC20;
			deepcopycall = newnodei_227407(((NU8) 27), (*varinit).info, ((NI) 3));
			LOC20 = 0;
			LOC20 = createmagic_231047(((NimStringDesc*) &TMP4238), ((NU8) 202));
			asgnRefNoCycle((void**) (&(*deepcopycall).kindU.S6.sons->data[((NI) 0)]), newsymnode_227325(LOC20));
			asgnRefNoCycle((void**) (&(*deepcopycall).kindU.S6.sons->data[((NI) 1)]), newsymnode_227325(result));
			asgnRefNoCycle((void**) (&(*deepcopycall).kindU.S6.sons->data[((NI) 2)]), v);
			add_226165(varinit, deepcopycall);
		}
		LA11: ;
	}
	LA9: ;
	return result;
}

N_NIMCALL(void, setupargsforconcurrency_404571)(Tnode225809* n, Ttype225847* objtype, Tsym225841* scratchobj, Tnode225809* castexpr, Tnode225809* call, Tnode225809* varsection, Tnode225809* varinit, Tnode225809* result) {
	Tnode225809* formals;
	Tnode225809* LOC1;
	Tident198021* tmpname;
	LOC1 = 0;
	LOC1 = HEX5BHEX5D_226244(n, ((NI) 0));
	formals = (*(*LOC1).typ).n;
	tmpname = getident_198463(((NimStringDesc*) &TMP2895));
	{
		NI i_404602;
		NI HEX3Atmp_404624;
		NI LOC3;
		NI res_404627;
		i_404602 = 0;
		HEX3Atmp_404624 = 0;
		LOC3 = 0;
		LOC3 = len_226098(n);
		HEX3Atmp_404624 = (LOC3 - 1);
		res_404627 = ((NI) 1);
		{
			while (1) {
				Ttype225847* argtype;
				Tnode225809* LOC6;
				Tident198021* fieldname;
				Tsym225841* field;
				Tnode225809* LOC23;
				Tnode225809* LOC24;
				Tnode225809* LOC25;
				Tsym225841* temp;
				Tnode225809* LOC26;
				Tnode225809* LOC27;
				if (!(res_404627 <= HEX3Atmp_404624)) goto LA5;
				i_404602 = res_404627;
				LOC6 = 0;
				LOC6 = HEX5BHEX5D_226244(n, i_404602);
				argtype = skiptypes_229167((*LOC6).typ, IL64(211106232576256));
				{
					NIM_BOOL LOC9;
					NI LOC10;
					Tnode225809* LOC12;
					Tnode225809* LOC15;
					LOC9 = 0;
					LOC10 = 0;
					LOC10 = len_226098(formals);
					LOC9 = (i_404602 < LOC10);
					if (!(LOC9)) goto LA11;
					LOC12 = 0;
					LOC12 = HEX5BHEX5D_226244(formals, i_404602);
					LOC9 = ((*(*LOC12).typ).kind == ((NU8) 23));
					LA11: ;
					if (!LOC9) goto LA13;
					LOC15 = 0;
					LOC15 = HEX5BHEX5D_226244(n, i_404602);
					localerror_196139((*LOC15).info, ((NimStringDesc*) &TMP4237));
				}
				LA13: ;
				{
					NI LOC18;
					Tnode225809* LOC21;
					LOC18 = 0;
					LOC18 = len_226098(formals);
					if (!(i_404602 < LOC18)) goto LA19;
					LOC21 = 0;
					LOC21 = HEX5BHEX5D_226244(formals, i_404602);
					fieldname = (*(*LOC21).kindU.S4.sym).name;
				}
				goto LA16;
				LA19: ;
				{
					fieldname = tmpname;
				}
				LA16: ;
				field = newsym_226656(((NU8) 19), fieldname, (*objtype).owner, (*n).info);
				asgnRefNoCycle((void**) (&(*field).typ), argtype);
				addfield_402809(objtype, field);
				LOC23 = 0;
				LOC23 = newdotexpr_403208(scratchobj, field);
				LOC24 = 0;
				LOC24 = HEX5BHEX5D_226244(n, i_404602);
				LOC25 = 0;
				LOC25 = newfastasgnstmt_402074(LOC23, LOC24);
				add_226165(result, LOC25);
				LOC26 = 0;
				LOC26 = indirectaccess_404038(castexpr, field, (*n).info);
				temp = addlocalvar_404271(varsection, varinit, (*objtype).owner, argtype, LOC26, NIM_FALSE);
				LOC27 = 0;
				LOC27 = newsymnode_227325(temp);
				add_226165(call, LOC27);
				res_404627 += ((NI) 1);
			} LA5: ;
		}
	}
}

N_NIMCALL(Tnode225809*, genaddrof_404064)(Tnode225809* n) {
	Tnode225809* result;
	result = 0;
	result = newnodei_227407(((NU8) 63), (*n).info, ((NI) 1));
	asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[((NI) 0)]), n);
	asgnRefNoCycle((void**) (&(*result).typ), newtype_228140(((NU8) 21), (*(*n).typ).owner));
	rawaddson_229498((*result).typ, (*n).typ);
	return result;
}

N_NIMCALL(Tnode225809*, genderef_404075)(Tnode225809* n) {
	Tnode225809* result;
	Ttype225847* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = skiptypes_229167((*n).typ, IL64(211106232576256));
	result = newnodeit_227807(((NU8) 65), (*n).info, (*LOC1).sons->data[((NI) 0)]);
	add_226165(result, n);
	return result;
}

N_NIMCALL(Tsym225841*, getroot_404646)(Tnode225809* n) {
	Tsym225841* 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_404646((*n).kindU.S6.sons->data[((NI) 0)]);
	}
	break;
	case ((NU8) 58):
	case ((NU8) 59):
	case ((NU8) 60):
	{
		result = getroot_404646((*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_254417(n);
			if (!(LOC11 == ((NU8) 138))) goto LA12;
			result = getroot_404646((*n).kindU.S6.sons->data[((NI) 1)]);
		}
		LA12: ;
	}
	break;
	default:
	{
	}
	break;
	}
	return result;
}

N_NIMCALL(void, setupargsforparallelism_404714)(Tnode225809* n_404716, Ttype225847* objtype, Tsym225841* scratchobj, Tnode225809* castexpr, Tnode225809* call, Tnode225809* varsection, Tnode225809* varinit, Tnode225809* result) {
	Tnode225809* formals;
	Tnode225809* LOC1;
	Tident198021* tmpname;
	LOC1 = 0;
	LOC1 = HEX5BHEX5D_226244(n_404716, ((NI) 0));
	formals = (*(*LOC1).typ).n;
	tmpname = getident_198463(((NimStringDesc*) &TMP2895));
	{
		NI i_404745;
		NI HEX3Atmp_404828;
		NI LOC3;
		NI res_404831;
		i_404745 = 0;
		HEX3Atmp_404828 = 0;
		LOC3 = 0;
		LOC3 = len_226098(n_404716);
		HEX3Atmp_404828 = (LOC3 - 1);
		res_404831 = ((NI) 1);
		{
			while (1) {
				Tnode225809* n;
				Ttype225847* argtype;
				Ttype225847* LOC6;
				Tident198021* fieldname;
				Tsym225841* field;
				if (!(res_404831 <= HEX3Atmp_404828)) goto LA5;
				i_404745 = res_404831;
				n = HEX5BHEX5D_226244(n_404716, i_404745);
				LOC6 = 0;
				{
					NI LOC9;
					Tnode225809* LOC12;
					LOC9 = 0;
					LOC9 = len_226098(formals);
					if (!(i_404745 < LOC9)) goto LA10;
					LOC12 = 0;
					LOC12 = HEX5BHEX5D_226244(formals, i_404745);
					LOC6 = (*LOC12).typ;
				}
				goto LA7;
				LA10: ;
				{
					LOC6 = (*n).typ;
				}
				LA7: ;
				argtype = skiptypes_229167(LOC6, IL64(211106232576256));
				{
					NI LOC16;
					Tnode225809* LOC19;
					LOC16 = 0;
					LOC16 = len_226098(formals);
					if (!(i_404745 < LOC16)) goto LA17;
					LOC19 = 0;
					LOC19 = HEX5BHEX5D_226244(formals, i_404745);
					fieldname = (*(*LOC19).kindU.S4.sym).name;
				}
				goto LA14;
				LA17: ;
				{
					fieldname = tmpname;
				}
				LA14: ;
				field = newsym_226656(((NU8) 19), fieldname, (*objtype).owner, (*n).info);
				{
					Tnode225809* slice;
					Tsym225841* LOC25;
					Tsym225841* fieldb;
					Tnode225809* LOC47;
					Tsym225841* threadlocal_404796;
					Tnode225809* LOC48;
					if (!((*argtype).kind == ((NU8) 48) || (*argtype).kind == ((NU8) 27))) goto LA23;
					slice = newnodei_227407(((NU8) 27), (*n).info, ((NI) 4));
					asgnRefNoCycle((void**) (&(*slice).typ), (*n).typ);
					LOC25 = 0;
					LOC25 = createmagic_231047(((NimStringDesc*) &TMP4239), ((NU8) 138));
					asgnRefNoCycle((void**) (&(*slice).kindU.S6.sons->data[((NI) 0)]), newsymnode_227325(LOC25));
					fieldb = newsym_226656(((NU8) 19), tmpname, (*objtype).owner, (*n).info);
					asgnRefNoCycle((void**) (&(*fieldb).typ), getsystype_274190(((NU8) 31)));
					addfield_402809(objtype, fieldb);
					{
						NU8 LOC28;
						Tnode225809* a;
						Tnode225809* LOC31;
						Tnode225809* LOC32;
						Tnode225809* LOC33;
						Tsym225841* fielda;
						Tnode225809* LOC34;
						Tnode225809* LOC35;
						Tnode225809* LOC36;
						Tnode225809* LOC37;
						Tnode225809* LOC38;
						Tnode225809* LOC39;
						Tsym225841* threadlocal_404786;
						Tnode225809* LOC40;
						LOC28 = 0;
						LOC28 = getmagic_254417(n);
						if (!(LOC28 == ((NU8) 138))) goto LA29;
						LOC31 = 0;
						LOC31 = HEX5BHEX5D_226244(n, ((NI) 1));
						a = genaddrof_404064(LOC31);
						asgnRefNoCycle((void**) (&(*field).typ), (*a).typ);
						addfield_402809(objtype, field);
						LOC32 = 0;
						LOC32 = newdotexpr_403208(scratchobj, field);
						LOC33 = 0;
						LOC33 = newfastasgnstmt_402074(LOC32, a);
						add_226165(result, LOC33);
						fielda = newsym_226656(((NU8) 19), tmpname, (*objtype).owner, (*n).info);
						asgnRefNoCycle((void**) (&(*fielda).typ), getsystype_274190(((NU8) 31)));
						addfield_402809(objtype, fielda);
						LOC34 = 0;
						LOC34 = newdotexpr_403208(scratchobj, fielda);
						LOC35 = 0;
						LOC35 = HEX5BHEX5D_226244(n, ((NI) 2));
						LOC36 = 0;
						LOC36 = newfastasgnstmt_402074(LOC34, LOC35);
						add_226165(result, LOC36);
						LOC37 = 0;
						LOC37 = newdotexpr_403208(scratchobj, fieldb);
						LOC38 = 0;
						LOC38 = HEX5BHEX5D_226244(n, ((NI) 3));
						LOC39 = 0;
						LOC39 = newfastasgnstmt_402074(LOC37, LOC38);
						add_226165(result, LOC39);
						LOC40 = 0;
						LOC40 = indirectaccess_404038(castexpr, fielda, (*n).info);
						threadlocal_404786 = addlocalvar_404271(varsection, NIM_NIL, (*objtype).owner, (*fielda).typ, LOC40, NIM_TRUE);
						asgnRefNoCycle((void**) (&(*slice).kindU.S6.sons->data[((NI) 2)]), newsymnode_227325(threadlocal_404786));
					}
					goto LA26;
					LA29: ;
					{
						Tnode225809* a;
						Tnode225809* LOC42;
						Tnode225809* LOC43;
						Tnode225809* LOC44;
						Tnode225809* LOC45;
						Tnode225809* LOC46;
						a = genaddrof_404064(n);
						asgnRefNoCycle((void**) (&(*field).typ), (*a).typ);
						addfield_402809(objtype, field);
						LOC42 = 0;
						LOC42 = newdotexpr_403208(scratchobj, field);
						LOC43 = 0;
						LOC43 = newfastasgnstmt_402074(LOC42, a);
						add_226165(result, LOC43);
						LOC44 = 0;
						LOC44 = newdotexpr_403208(scratchobj, fieldb);
						LOC45 = 0;
						LOC45 = genhigh_404691(n);
						LOC46 = 0;
						LOC46 = newfastasgnstmt_402074(LOC44, LOC45);
						add_226165(result, LOC46);
						asgnRefNoCycle((void**) (&(*slice).kindU.S6.sons->data[((NI) 2)]), newintlit_404681(IL64(0)));
					}
					LA26: ;
					LOC47 = 0;
					LOC47 = indirectaccess_404038(castexpr, field, (*n).info);
					asgnRefNoCycle((void**) (&(*slice).kindU.S6.sons->data[((NI) 1)]), genderef_404075(LOC47));
					LOC48 = 0;
					LOC48 = indirectaccess_404038(castexpr, fieldb, (*n).info);
					threadlocal_404796 = addlocalvar_404271(varsection, NIM_NIL, (*objtype).owner, (*fieldb).typ, LOC48, NIM_TRUE);
					asgnRefNoCycle((void**) (&(*slice).kindU.S6.sons->data[((NI) 3)]), newsymnode_227325(threadlocal_404796));
					add_226165(call, slice);
				}
				goto LA21;
				LA23: ;
				{
					NIM_BOOL LOC50;
					NI64 size;
					NIM_BOOL LOC51;
					Tsym225841* LOC54;
					Tnode225809* a;
					Tnode225809* LOC57;
					Tnode225809* LOC58;
					Tsym225841* threadlocal_404818;
					Tnode225809* LOC59;
					Tnode225809* LOC60;
					Tnode225809* LOC61;
					LOC50 = 0;
					size = computesize_255184(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_404646(n);
					LOC50 = !((LOC54 == NIM_NIL));
					LA53: ;
					if (!LOC50) goto LA55;
					a = genaddrof_404064(n);
					asgnRefNoCycle((void**) (&(*field).typ), (*a).typ);
					addfield_402809(objtype, field);
					LOC57 = 0;
					LOC57 = newdotexpr_403208(scratchobj, field);
					LOC58 = 0;
					LOC58 = newfastasgnstmt_402074(LOC57, a);
					add_226165(result, LOC58);
					LOC59 = 0;
					LOC59 = indirectaccess_404038(castexpr, field, (*n).info);
					threadlocal_404818 = addlocalvar_404271(varsection, NIM_NIL, (*objtype).owner, (*field).typ, LOC59, NIM_TRUE);
					LOC60 = 0;
					LOC60 = newsymnode_227325(threadlocal_404818);
					LOC61 = 0;
					LOC61 = genderef_404075(LOC60);
					add_226165(call, LOC61);
				}
				goto LA21;
				LA55: ;
				{
					Tnode225809* LOC63;
					Tnode225809* LOC64;
					Tsym225841* threadlocal_404824;
					Tnode225809* LOC65;
					Tnode225809* LOC66;
					asgnRefNoCycle((void**) (&(*field).typ), argtype);
					addfield_402809(objtype, field);
					LOC63 = 0;
					LOC63 = newdotexpr_403208(scratchobj, field);
					LOC64 = 0;
					LOC64 = newfastasgnstmt_402074(LOC63, n);
					add_226165(result, LOC64);
					LOC65 = 0;
					LOC65 = indirectaccess_404038(castexpr, field, (*n).info);
					threadlocal_404824 = addlocalvar_404271(varsection, varinit, (*objtype).owner, (*field).typ, LOC65, NIM_TRUE);
					LOC66 = 0;
					LOC66 = newsymnode_227325(threadlocal_404824);
					add_226165(call, LOC66);
				}
				LA21: ;
				res_404831 += ((NI) 1);
			} LA5: ;
		}
	}
}

N_NIMCALL(Tnode225809*, callproc_404184)(Tnode225809* a) {
	Tnode225809* result;
	result = 0;
	result = newnodei_227351(((NU8) 27), (*a).info);
	add_226165(result, a);
	asgnRefNoCycle((void**) (&(*result).typ), (*(*a).typ).sons->data[((NI) 0)]);
	return result;
}

N_NIMCALL(Tnode225809*, callcodegenproc_404086)(NimStringDesc* name, Tnode225809* arg1, Tnode225809* arg2, Tnode225809* arg3, Tnode225809* optionalargs) {
	Tnode225809* result;
	Tsym225841* sym;
	result = 0;
	result = newnodei_227351(((NU8) 27), (*arg1).info);
	sym = getcompilerproc_274809(name);
	{
		if (!(sym == NIM_NIL)) goto LA3;
		localerror_196128((*arg1).info, ((NU16) 68), name);
	}
	goto LA1;
	LA3: ;
	{
		Tnode225809* LOC6;
		LOC6 = 0;
		LOC6 = newsymnode_227325(sym);
		add_226165(result, LOC6);
		add_226165(result, arg1);
		{
			if (!!((arg2 == NIM_NIL))) goto LA9;
			add_226165(result, arg2);
		}
		LA9: ;
		{
			if (!!((arg3 == NIM_NIL))) goto LA13;
			add_226165(result, arg3);
		}
		LA13: ;
		{
			if (!!((optionalargs == NIM_NIL))) goto LA17;
			{
				NI i_404158;
				NI HEX3Atmp_404162;
				NI LOC20;
				NI res_404165;
				i_404158 = 0;
				HEX3Atmp_404162 = 0;
				LOC20 = 0;
				LOC20 = len_226098(optionalargs);
				HEX3Atmp_404162 = (NI)(LOC20 - ((NI) 3));
				res_404165 = ((NI) 1);
				{
					while (1) {
						Tnode225809* LOC23;
						if (!(res_404165 <= HEX3Atmp_404162)) goto LA22;
						i_404158 = res_404165;
						LOC23 = 0;
						LOC23 = HEX5BHEX5D_226244(optionalargs, i_404158);
						add_226165(result, LOC23);
						res_404165 += ((NI) 1);
					} LA22: ;
				}
			}
		}
		LA17: ;
		asgnRefNoCycle((void**) (&(*result).typ), (*(*sym).typ).sons->data[((NI) 0)]);
	}
	LA1: ;
	return result;
}

N_NIMCALL(NU8, flowvarkind_404219)(Ttype225847* t) {
	NU8 result;
	result = 0;
	{
		Ttype225847* LOC3;
		LOC3 = 0;
		LOC3 = skiptypes_229167(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_255154(t);
		if (!LOC7) goto LA8;
		result = ((NU8) 0);
	}
	goto LA1;
	LA8: ;
	{
		result = ((NU8) 2);
	}
	LA1: ;
	return result;
}

N_NIMCALL(Tsym225841*, createwrapperproc_404333)(Tnode225809* f, Tsym225841* threadparam, Tsym225841* argsparam, Tnode225809* varsection, Tnode225809* varinit, Tnode225809* call, Tnode225809* barrier, Tnode225809* fv, NU8 spawnkind) {
	Tsym225841* result;
	Tnode225809* body;
	Tsym225841* threadlocalbarrier;
	Tsym225841* threadlocalprom;
	Tnode225809* LOC29;
	Tnode225809* LOC30;
	Tnode225809* params;
	Tnode225809* LOC75;
	Tnode225809* LOC76;
	Ttype225847* t;
	Tnode225809* LOC77;
	Tnode225809* LOC78;
	Tnode225809* LOC79;
	NimStringDesc* name;
	NimStringDesc* LOC80;
	NimStringDesc* LOC81;
	Tident198021* LOC87;
	Tnode225809* LOC88;
	result = 0;
	body = newnodei_227351(((NU8) 115), (*f).info);
	threadlocalbarrier = 0;
	{
		Tnode225809* varsection2;
		Tnode225809* LOC5;
		Tnode225809* LOC6;
		if (!!((barrier == NIM_NIL))) goto LA3;
		varsection2 = newnodei_227351(((NU8) 99), (*barrier).info);
		threadlocalbarrier = addlocalvar_404271(varsection2, NIM_NIL, (*argsparam).owner, (*barrier).typ, barrier, NIM_FALSE);
		add_226165(body, varsection2);
		LOC5 = 0;
		LOC5 = newsymnode_227325(threadlocalbarrier);
		LOC6 = 0;
		LOC6 = callcodegenproc_404086(((NimStringDesc*) &TMP4244), LOC5, NIM_NIL, NIM_NIL, NIM_NIL);
		add_226165(body, LOC6);
	}
	LA3: ;
	threadlocalprom = 0;
	{
		if (!(spawnkind == ((NU8) 2))) goto LA9;
		threadlocalprom = addlocalvar_404271(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_196279(TMP4245);
			internalerror_196191(LOC18);
		}
		LA16: ;
		threadlocalprom = addlocalvar_404271(varsection, NIM_NIL, (*argsparam).owner, (*fv).typ, fv, NIM_FALSE);
	}
	goto LA7;
	LA12: ;
	LA7: ;
	add_226165(body, varsection);
	add_226165(body, varinit);
	{
		NIM_BOOL LOC21;
		Tnode225809* LOC25;
		Tnode225809* LOC26;
		Tnode225809* LOC27;
		Tnode225809* LOC28;
		LOC21 = 0;
		LOC21 = !((fv == NIM_NIL));
		if (!(LOC21)) goto LA22;
		LOC21 = !((spawnkind == ((NU8) 2)));
		LA22: ;
		if (!LOC21) goto LA23;
		LOC25 = 0;
		LOC25 = newsymnode_227325(threadlocalprom);
		LOC26 = 0;
		LOC26 = indirectaccess_403408(LOC25, ((NimStringDesc*) &TMP4246), (*fv).info);
		LOC27 = 0;
		LOC27 = newsymnode_227325(threadparam);
		LOC28 = 0;
		LOC28 = newasgnstmt_402061(LOC26, LOC27);
		add_226165(body, LOC28);
	}
	LA23: ;
	LOC29 = 0;
	LOC29 = newsymnode_227325(threadparam);
	LOC30 = 0;
	LOC30 = callcodegenproc_404086(((NimStringDesc*) &TMP4247), LOC29, NIM_NIL, NIM_NIL, NIM_NIL);
	add_226165(body, LOC30);
	{
		Tnode225809* LOC35;
		Tnode225809* LOC36;
		Tnode225809* LOC37;
		if (!(spawnkind == ((NU8) 2))) goto LA33;
		LOC35 = 0;
		LOC35 = newsymnode_227325(threadlocalprom);
		LOC36 = 0;
		LOC36 = genderef_404075(LOC35);
		LOC37 = 0;
		LOC37 = newasgnstmt_402061(LOC36, call);
		add_226165(body, LOC37);
	}
	goto LA31;
	LA33: ;
	{
		NU8 fk;
		Tnode225809* LOC47;
		NimStringDesc* LOC48;
		Tnode225809* LOC54;
		Tnode225809* LOC55;
		if (!!((fv == NIM_NIL))) goto LA39;
		fk = flowvarkind_404219((*(*fv).typ).sons->data[((NI) 1)]);
		{
			NimStringDesc* LOC45;
			NimStringDesc* LOC46;
			if (!(fk == ((NU8) 0))) goto LA43;
			LOC45 = 0;
			LOC46 = 0;
			LOC46 = typetostring_255032((*(*fv).typ).sons->data[((NI) 1)], ((NU8) 0));
			LOC45 = rawNewString(LOC46->Sup.len + 33);
appendString(LOC45, ((NimStringDesc*) &TMP4248));
appendString(LOC45, LOC46);
			localerror_196139((*f).info, LOC45);
		}
		LA43: ;
		LOC47 = 0;
		LOC47 = newsymnode_227325(threadlocalprom);
		LOC48 = 0;
		{
			if (!(fk == ((NU8) 1))) goto LA51;
			LOC48 = copyString(((NimStringDesc*) &TMP4249));
		}
		goto LA49;
		LA51: ;
		{
			LOC48 = copyString(((NimStringDesc*) &TMP4250));
		}
		LA49: ;
		LOC54 = 0;
		LOC54 = indirectaccess_403408(LOC47, LOC48, (*fv).info);
		LOC55 = 0;
		LOC55 = newasgnstmt_402061(LOC54, call);
		add_226165(body, LOC55);
		{
			Tnode225809* increfcall;
			Tsym225841* LOC60;
			Tnode225809* LOC61;
			if (!(fk == ((NU8) 1))) goto LA58;
			increfcall = newnodei_227407(((NU8) 27), (*fv).info, ((NI) 2));
			LOC60 = 0;
			LOC60 = createmagic_231047(((NimStringDesc*) &TMP4251), ((NU8) 42));
			asgnRefNoCycle((void**) (&(*increfcall).kindU.S6.sons->data[((NI) 0)]), newsymnode_227325(LOC60));
			LOC61 = 0;
			LOC61 = newsymnode_227325(threadlocalprom);
			asgnRefNoCycle((void**) (&(*increfcall).kindU.S6.sons->data[((NI) 1)]), indirectaccess_403408(LOC61, ((NimStringDesc*) &TMP4249), (*fv).info));
			add_226165(body, increfcall);
		}
		LA58: ;
		{
			Tnode225809* LOC66;
			Tnode225809* LOC67;
			if (!(barrier == NIM_NIL)) goto LA64;
			LOC66 = 0;
			LOC66 = newsymnode_227325(threadlocalprom);
			LOC67 = 0;
			LOC67 = callcodegenproc_404086(((NimStringDesc*) &TMP4252), LOC66, NIM_NIL, NIM_NIL, NIM_NIL);
			add_226165(body, LOC67);
		}
		LA64: ;
	}
	goto LA31;
	LA39: ;
	{
		add_226165(body, call);
	}
	LA31: ;
	{
		Tnode225809* LOC73;
		Tnode225809* LOC74;
		if (!!((barrier == NIM_NIL))) goto LA71;
		LOC73 = 0;
		LOC73 = newsymnode_227325(threadlocalbarrier);
		LOC74 = 0;
		LOC74 = callcodegenproc_404086(((NimStringDesc*) &TMP4253), LOC73, NIM_NIL, NIM_NIL, NIM_NIL);
		add_226165(body, LOC74);
	}
	LA71: ;
	params = newnodei_227351(((NU8) 76), (*f).info);
	add_226165(params, emptynode_226807);
	LOC75 = 0;
	LOC75 = newsymnode_227325(threadparam);
	add_226165(params, LOC75);
	LOC76 = 0;
	LOC76 = newsymnode_227325(argsparam);
	add_226165(params, LOC76);
	t = newtype_228140(((NU8) 25), (*threadparam).owner);
	rawaddson_229498(t, NIM_NIL);
	rawaddson_229498(t, (*threadparam).typ);
	rawaddson_229498(t, (*argsparam).typ);
	asgnRefNoCycle((void**) (&(*t).n), newnodei_227351(((NU8) 76), (*f).info));
	LOC77 = 0;
	LOC77 = newnodei_227351(((NU8) 152), (*f).info);
	add_226165((*t).n, LOC77);
	LOC78 = 0;
	LOC78 = newsymnode_227325(threadparam);
	add_226165((*t).n, LOC78);
	LOC79 = 0;
	LOC79 = newsymnode_227325(argsparam);
	add_226165((*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*) &TMP2895));
	}
	LA82: ;
	LOC80 = rawNewString(LOC81->Sup.len + 7);
appendString(LOC80, LOC81);
appendString(LOC80, ((NimStringDesc*) &TMP4254));
	name = LOC80;
	LOC87 = 0;
	LOC87 = getident_198463(name);
	result = newsym_226656(((NU8) 12), LOC87, (*argsparam).owner, (*f).info);
	LOC88 = 0;
	LOC88 = newsymnode_227325(result);
	asgnRefNoCycle((void**) (&(*result).ast), newprocnode_228058(((NU8) 79), (*f).info, body, params, LOC88, emptynode_226807, emptynode_226807, emptynode_226807, emptynode_226807));
	asgnRefNoCycle((void**) (&(*result).typ), t);
	return result;
}

N_NIMCALL(Tnode225809*, wrapprocforspawn_404850)(Tsym225841* owner, Tnode225809* spawnexpr, Ttype225847* rettype, Tnode225809* barrier, Tnode225809* dest) {
	Tnode225809* result;
	Tnode225809* n;
	NI LOC1;
	NU8 spawnkind;
	Tsym225841* threadparam;
	Tident198021* LOC32;
	Tsym225841* argsparam;
	Tident198021* LOC33;
	Ttype225847* objtype;
	Tnode225809* castexpr;
	Tsym225841* scratchobj;
	Tident198021* LOC35;
	Tnode225809* call;
	Tnode225809* fn;
	Tnode225809* varsection;
	Tnode225809* varinit;
	Tnode225809* barrierasexpr;
	Tnode225809* fvfield;
	Tnode225809* fvasexpr;
	Tsym225841* wrapper;
	NimStringDesc* LOC91;
	NI LOC92;
	NimStringDesc* LOC93;
	Tnode225809* LOC94;
	Tnode225809* LOC95;
	Tnode225809* LOC96;
	Tnode225809* LOC97;
{	result = 0;
	LOC1 = 0;
	LOC1 = len_226098(spawnexpr);
	n = HEX5BHEX5D_226244(spawnexpr, (NI)(LOC1 - ((NI) 2)));
	spawnkind = spawnresult_404208(rettype, !((barrier == NIM_NIL)));
	switch (spawnkind) {
	case ((NU8) 0):
	{
		{
			NimStringDesc* LOC7;
			if (!!((dest == NIM_NIL))) goto LA5;
			LOC7 = 0;
			LOC7 = HEX24_196279(TMP4226);
			internalerror_196191(LOC7);
		}
		LA5: ;
		result = newnodei_227351(((NU8) 115), (*n).info);
	}
	break;
	case ((NU8) 1):
	{
		{
			NimStringDesc* LOC13;
			if (!!((dest == NIM_NIL))) goto LA11;
			LOC13 = 0;
			LOC13 = HEX24_196279(TMP4227);
			internalerror_196191(LOC13);
		}
		LA11: ;
		result = newnodeit_227807(((NU8) 126), (*n).info, rettype);
	}
	break;
	case ((NU8) 2):
	{
		{
			if (!(dest == NIM_NIL)) goto LA17;
			localerror_196139((*n).info, ((NimStringDesc*) &TMP4228));
		}
		LA17: ;
		result = newnodei_227351(((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_196139((*n).info, ((NimStringDesc*) &TMP4229));
		goto BeforeRet;
	}
	LA21: ;
	{
		if (!((gglobaloptions_167132 &(1<<((((NU8) 24))&31)))!=0)) goto LA25;
		{
			Tnode225809* LOC29;
			LOC29 = 0;
			LOC29 = HEX5BHEX5D_226244(n, ((NI) 0));
			if (!((130 & (*(*LOC29).typ).flags) == 0)) goto LA30;
			localerror_196139((*n).info, ((NimStringDesc*) &TMP4230));
		}
		LA30: ;
	}
	LA25: ;
	LOC32 = 0;
	LOC32 = getident_198463(((NimStringDesc*) &TMP4231));
	threadparam = newsym_226656(((NU8) 3), LOC32, owner, (*n).info);
	LOC33 = 0;
	LOC33 = getident_198463(((NimStringDesc*) &TMP4232));
	argsparam = newsym_226656(((NU8) 3), LOC33, owner, (*n).info);
	{
		Ttype225847* ptrtype;
		ptrtype = getsystype_274190(((NU8) 26));
		asgnRefNoCycle((void**) (&(*threadparam).typ), ptrtype);
		asgnRefNoCycle((void**) (&(*argsparam).typ), ptrtype);
		(*argsparam).position = ((NI) 1);
	}
	objtype = createobj_402372(owner, (*n).info);
	(*objtype).flags |= ((NU32)1)<<((((NU8) 2))%(sizeof(NU32)*8));
	castexpr = createcastexpr_404557(argsparam, objtype);
	LOC35 = 0;
	LOC35 = getident_198463(((NimStringDesc*) &TMP4233));
	scratchobj = newsym_226656(((NU8) 8), LOC35, owner, (*n).info);
	{
		Tnode225809* varsectionb;
		Tnode225809* LOC37;
		asgnRefNoCycle((void**) (&(*scratchobj).typ), objtype);
		(*scratchobj).flags |= ((NU32)1)<<((((NU8) 2))%(sizeof(NU32)*8));
		varsectionb = newnodei_227351(((NU8) 99), (*n).info);
		LOC37 = 0;
		LOC37 = newsymnode_227325(scratchobj);
		addvar_402047(varsectionb, LOC37);
		add_226165(result, varsectionb);
	}
	call = newnodeit_227807(((NU8) 27), (*n).info, (*n).typ);
	fn = (*n).kindU.S6.sons->data[((NI) 0)];
	{
		NIM_BOOL LOC40;
		Ttype225847* argtype;
		Tnode225809* LOC44;
		Tsym225841* field;
		Tident198021* LOC45;
		Tnode225809* LOC46;
		Tnode225809* LOC47;
		Tnode225809* 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_226244(n, ((NI) 0));
		argtype = skiptypes_229167((*LOC44).typ, IL64(211106232576256));
		LOC45 = 0;
		LOC45 = getident_198463(((NimStringDesc*) &TMP4234));
		field = newsym_226656(((NU8) 19), LOC45, owner, (*n).info);
		asgnRefNoCycle((void**) (&(*field).typ), argtype);
		addfield_402809(objtype, field);
		LOC46 = 0;
		LOC46 = newdotexpr_403208(scratchobj, field);
		LOC47 = 0;
		LOC47 = HEX5BHEX5D_226244(n, ((NI) 0));
		LOC48 = 0;
		LOC48 = newfastasgnstmt_402074(LOC46, LOC47);
		add_226165(result, LOC48);
		fn = indirectaccess_404038(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_196139((*n).info, ((NimStringDesc*) &TMP4235));
	}
	goto LA38;
	LA52: ;
	{
		if (!((*(*fn).typ).callconv == ((NU8) 8))) goto LA55;
		localerror_196139((*n).info, ((NimStringDesc*) &TMP4236));
	}
	goto LA38;
	LA55: ;
	LA38: ;
	add_226165(call, fn);
	varsection = newnodei_227351(((NU8) 99), (*n).info);
	varinit = newnodei_227351(((NU8) 115), (*n).info);
	{
		if (!barrier == 0) goto LA59;
		setupargsforconcurrency_404571(n, objtype, scratchobj, castexpr, call, varsection, varinit, result);
	}
	goto LA57;
	LA59: ;
	{
		setupargsforparallelism_404714(n, objtype, scratchobj, castexpr, call, varsection, varinit, result);
	}
	LA57: ;
	barrierasexpr = NIM_NIL;
	{
		Ttype225847* typ;
		Tsym225841* LOC66;
		Tsym225841* field;
		Tident198021* LOC67;
		Tnode225809* LOC68;
		Tnode225809* LOC69;
		if (!!((barrier == NIM_NIL))) goto LA64;
		typ = newtype_228140(((NU8) 21), owner);
		LOC66 = 0;
		LOC66 = getcompilerproc_274809(((NimStringDesc*) &TMP4240));
		rawaddson_229498(typ, (*LOC66).typ);
		LOC67 = 0;
		LOC67 = getident_198463(((NimStringDesc*) &TMP4241));
		field = newsym_226656(((NU8) 19), LOC67, owner, (*n).info);
		asgnRefNoCycle((void**) (&(*field).typ), typ);
		addfield_402809(objtype, field);
		LOC68 = 0;
		LOC68 = newdotexpr_403208(scratchobj, field);
		LOC69 = 0;
		LOC69 = newfastasgnstmt_402074(LOC68, barrier);
		add_226165(result, LOC69);
		barrierasexpr = indirectaccess_404038(castexpr, field, (*n).info);
	}
	LA64: ;
	fvfield = NIM_NIL;
	fvasexpr = NIM_NIL;
	{
		Tsym225841* field;
		Tident198021* LOC74;
		NI LOC75;
		Tnode225809* LOC76;
		Tnode225809* LOC77;
		Tnode225809* LOC78;
		if (!(spawnkind == ((NU8) 1))) goto LA72;
		LOC74 = 0;
		LOC74 = getident_198463(((NimStringDesc*) &TMP4242));
		field = newsym_226656(((NU8) 19), LOC74, owner, (*n).info);
		asgnRefNoCycle((void**) (&(*field).typ), rettype);
		addfield_402809(objtype, field);
		fvfield = newdotexpr_403208(scratchobj, field);
		fvasexpr = indirectaccess_404038(castexpr, field, (*n).info);
		LOC75 = 0;
		LOC75 = len_226098(spawnexpr);
		LOC76 = 0;
		LOC76 = HEX5BHEX5D_226244(spawnexpr, (NI)(LOC75 - ((NI) 1)));
		LOC77 = 0;
		LOC77 = callproc_404184(LOC76);
		LOC78 = 0;
		LOC78 = newfastasgnstmt_402074(fvfield, LOC77);
		add_226165(result, LOC78);
		{
			Tnode225809* LOC83;
			if (!(barrier == NIM_NIL)) goto LA81;
			LOC83 = 0;
			LOC83 = callcodegenproc_404086(((NimStringDesc*) &TMP4243), fvfield, NIM_NIL, NIM_NIL, NIM_NIL);
			add_226165(result, LOC83);
		}
		LA81: ;
	}
	goto LA70;
	LA72: ;
	{
		Tsym225841* field;
		Tident198021* LOC87;
		Tnode225809* LOC88;
		Tnode225809* LOC89;
		Tnode225809* LOC90;
		if (!(spawnkind == ((NU8) 2))) goto LA85;
		LOC87 = 0;
		LOC87 = getident_198463(((NimStringDesc*) &TMP4242));
		field = newsym_226656(((NU8) 19), LOC87, owner, (*n).info);
		asgnRefNoCycle((void**) (&(*field).typ), newtype_228140(((NU8) 21), (*objtype).owner));
		rawaddson_229498((*field).typ, rettype);
		addfield_402809(objtype, field);
		fvasexpr = indirectaccess_404038(castexpr, field, (*n).info);
		LOC88 = 0;
		LOC88 = newdotexpr_403208(scratchobj, field);
		LOC89 = 0;
		LOC89 = genaddrof_404064(dest);
		LOC90 = 0;
		LOC90 = newfastasgnstmt_402074(LOC88, LOC89);
		add_226165(result, LOC90);
	}
	goto LA70;
	LA85: ;
	LA70: ;
	wrapper = createwrapperproc_404333(fn, threadparam, argsparam, varsection, varinit, call, barrierasexpr, fvasexpr, spawnkind);
	LOC91 = 0;
	LOC92 = 0;
	LOC92 = len_226098(spawnexpr);
	LOC93 = 0;
	LOC93 = nimIntToStr(LOC92);
	LOC91 = rawNewString(LOC93->Sup.len + 8);
appendString(LOC91, ((NimStringDesc*) &TMP4255));
appendString(LOC91, LOC93);
	LOC94 = 0;
	LOC94 = newsymnode_227325(wrapper);
	LOC95 = 0;
	LOC95 = newsymnode_227325(scratchobj);
	LOC96 = 0;
	LOC96 = genaddrof_404064(LOC95);
	LOC97 = 0;
	LOC97 = callcodegenproc_404086(LOC91, LOC94, LOC96, NIM_NIL, spawnexpr);
	add_226165(result, LOC97);
	{
		if (!(spawnkind == ((NU8) 1))) goto LA100;
		add_226165(result, fvfield);
	}
	LA100: ;
	}BeforeRet: ;
	return result;
}
NIM_EXTERNC N_NOINLINE(void, compiler_loweringsInit000)(void) {
}

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

