/* Generated by Nim Compiler v0.11.2 */
/*   (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 Tnode190813 Tnode190813;
typedef struct Tsym190843 Tsym190843;
typedef struct Tlineinfo163338 Tlineinfo163338;
typedef struct Ttype190849 Ttype190849;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tident167021 Tident167021;
typedef struct Tnodeseq190807 Tnodeseq190807;
typedef struct Tidobj167015 Tidobj167015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttypeseq190845 Ttypeseq190845;
typedef struct Tscope190837 Tscope190837;
typedef struct TY190944 TY190944;
typedef struct Tstrtable190817 Tstrtable190817;
typedef struct Tsymseq190815 Tsymseq190815;
typedef struct Tloc190827 Tloc190827;
typedef struct Ropeobj161009 Ropeobj161009;
typedef struct Tlib190831 Tlib190831;
typedef struct Tcell46347 Tcell46347;
typedef struct Tcellseq46363 Tcellseq46363;
typedef struct Tgcheap48216 Tgcheap48216;
typedef struct Tcellset46359 Tcellset46359;
typedef struct Tpagedesc46355 Tpagedesc46355;
typedef struct Tmemregion28210 Tmemregion28210;
typedef struct Tsmallchunk27440 Tsmallchunk27440;
typedef struct Tllchunk28204 Tllchunk28204;
typedef struct Tbigchunk27442 Tbigchunk27442;
typedef struct Tintset27417 Tintset27417;
typedef struct Ttrunk27413 Ttrunk27413;
typedef struct Tavlnode28208 Tavlnode28208;
typedef struct Tgcstat48214 Tgcstat48214;
typedef struct TY86345 TY86345;
typedef struct Tinstantiation190833 Tinstantiation190833;
typedef struct Tlistentry130022 Tlistentry130022;
typedef struct Tbasechunk27438 Tbasechunk27438;
typedef struct Tfreecell27430 Tfreecell27430;
typedef struct TY190933 TY190933;
struct  Tlineinfo163338  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tnode190813  {
Ttype190849* typ;
Tlineinfo163338 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym190843* sym;
} S4;
struct {Tident167021* ident;
} S5;
struct {Tnodeseq190807* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
typedef N_NIMCALL_PTR(void, TY3289) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3294) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3289 marker;
TY3294 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Tidobj167015  {
  TNimObject Sup;
NI id;
};
struct  Tstrtable190817  {
NI counter;
Tsymseq190815* data;
};
struct  Tloc190827  {
NU8 k;
NU8 s;
NU16 flags;
Ttype190849* t;
Ropeobj161009* r;
Ropeobj161009* heaproot;
};
struct  Tsym190843  {
  Tidobj167015 Sup;
NU8 kind;
union{
struct {Ttypeseq190845* typeinstcache;
Tscope190837* typscope;
} S1;
struct {TY190944* procinstcache;
Tsym190843* gcunsafetyreason;
} S2;
struct {TY190944* usedgenerics;
Tstrtable190817 tab;
} S3;
struct {Tsym190843* guard;
} S4;
} kindU;
NU16 magic;
Ttype190849* typ;
Tident167021* name;
Tlineinfo163338 info;
Tsym190843* owner;
NU32 flags;
Tnode190813* ast;
NU32 options;
NI position;
NI offset;
Tloc190827 loc;
Tlib190831* annex;
Tnode190813* constraint;
};
struct  Tcell46347  {
NI refcount;
TNimType* typ;
};
struct  Tcellseq46363  {
NI len;
NI cap;
Tcell46347** d;
};
struct  Tcellset46359  {
NI counter;
NI max;
Tpagedesc46355* head;
Tpagedesc46355** data;
};
typedef Tsmallchunk27440* TY28222[512];
typedef Ttrunk27413* Ttrunkbuckets27415[256];
struct  Tintset27417  {
Ttrunkbuckets27415 data;
};
struct  Tmemregion28210  {
NI minlargeobj;
NI maxlargeobj;
TY28222 freesmallchunks;
Tllchunk28204* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Tbigchunk27442* freechunkslist;
Tintset27417 chunkstarts;
Tavlnode28208* root;
Tavlnode28208* deleted;
Tavlnode28208* last;
Tavlnode28208* freeavlnodes;
};
struct  Tgcstat48214  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Tgcheap48216  {
void* stackbottom;
NI cyclethreshold;
Tcellseq46363 zct;
Tcellseq46363 decstack;
Tcellset46359 cycleroots;
Tcellseq46363 tempstack;
NI recgclock;
Tmemregion28210 region;
Tgcstat48214 stat;
};
struct  Ttype190849  {
  Tidobj167015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq190845* sons;
Tnode190813* n;
Tsym190843* owner;
Tsym190843* sym;
Tsym190843* destructor;
Tsym190843* deepcopy;
Tsym190843* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc190827 loc;
};
struct  Tident167021  {
  Tidobj167015 Sup;
NimStringDesc* s;
Tident167021* next;
NI h;
};
struct TY86345 {
NimStringDesc* Field0;
NI Field1;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Tscope190837  {
NI depthlevel;
Tstrtable190817 symbols;
Tnodeseq190807* usingsyms;
Tscope190837* parent;
};
struct  Ropeobj161009  {
  TNimObject Sup;
Ropeobj161009* left;
Ropeobj161009* right;
NI length;
NimStringDesc* data;
};
struct  Tlistentry130022  {
  TNimObject Sup;
Tlistentry130022* prev;
Tlistentry130022* next;
};
struct  Tlib190831  {
  Tlistentry130022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj161009* name;
Tnode190813* path;
};
typedef NI TY27420[16];
struct  Tpagedesc46355  {
Tpagedesc46355* next;
NI key;
TY27420 bits;
};
struct  Tbasechunk27438  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Tsmallchunk27440  {
  Tbasechunk27438 Sup;
Tsmallchunk27440* next;
Tsmallchunk27440* prev;
Tfreecell27430* freelist;
NI free;
NI acc;
NF data;
};
struct  Tllchunk28204  {
NI size;
NI acc;
Tllchunk28204* next;
};
struct  Tbigchunk27442  {
  Tbasechunk27438 Sup;
Tbigchunk27442* next;
Tbigchunk27442* prev;
NI align;
NF data;
};
struct  Ttrunk27413  {
Ttrunk27413* next;
NI key;
TY27420 bits;
};
typedef Tavlnode28208* TY28214[2];
struct  Tavlnode28208  {
TY28214 link;
NI key;
NI upperbound;
NI level;
};
struct  Tinstantiation190833  {
Tsym190843* sym;
Ttypeseq190845* concretetypes;
TY190933* usedby;
};
struct  Tfreecell27430  {
Tfreecell27430* next;
NI zerofield;
};
struct Tnodeseq190807 {
  TGenericSeq Sup;
  Tnode190813* data[SEQ_DECL_SIZE];
};
struct Ttypeseq190845 {
  TGenericSeq Sup;
  Ttype190849* data[SEQ_DECL_SIZE];
};
struct TY190944 {
  TGenericSeq Sup;
  Tinstantiation190833* data[SEQ_DECL_SIZE];
};
struct Tsymseq190815 {
  TGenericSeq Sup;
  Tsym190843* data[SEQ_DECL_SIZE];
};
struct TY190933 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(Tnode190813*, lastson_193431)(Tnode190813* n);
N_NIMCALL(Tnode190813*, newnodei_192351)(NU8 kind, Tlineinfo163338 info);
N_NIMCALL(Tsym190843*, newsym_191656)(NU8 symkind, Tident167021* name, Tsym190843* owner, Tlineinfo163338 info);
N_NIMCALL(Tident167021*, getident_167463)(NimStringDesc* identifier);
N_NIMCALL(Ttype190849*, skiptypes_194167)(Ttype190849* t, NU64 kinds);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
static N_INLINE(Tcell46347*, usrtocell_49846)(void* usr);
static N_INLINE(void, rtladdzct_51404)(Tcell46347* c);
N_NOINLINE(void, addzct_49817)(Tcellseq46363* s, Tcell46347* c);
N_NIMCALL(Tnode190813*, newsymnode_192325)(Tsym190843* sym);
N_NIMCALL(void, addvar_357047)(Tnode190813* father, Tnode190813* v);
N_NIMCALL(Tnode190813*, newnodei_192407)(NU8 kind, Tlineinfo163338 info, NI children);
N_NIMCALL(void, addson_192819)(Tnode190813* father, Tnode190813* son);
N_NIMCALL(void, add_191164)(Tnode190813* father, Tnode190813* son);
N_NIMCALL(Tnode190813*, newasgnstmt_357061)(Tnode190813* le, Tnode190813* ri);
static N_INLINE(NI, len_191097)(Tnode190813* n);
N_NIMCALL(Tnode190813*, newtupleaccess_357034)(Tnode190813* tup, NI i);
N_NIMCALL(Tnode190813*, newnodeit_192807)(NU8 kind, Tlineinfo163338 info, Ttype190849* typ);
N_NIMCALL(Tnode190813*, copytree_195028)(Tnode190813* src);
N_NIMCALL(Ttype190849*, getsystype_238030)(NU8 kind);
N_NIMCALL(Ttype190849*, newtype_193140)(NU8 kind, Tsym190843* owner);
N_NIMCALL(void, rawaddson_194478)(Ttype190849* father, Ttype190849* son);
N_NIMCALL(NI, sonslen_193403)(Tnode190813* 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(Ttype190849*, skipintlit_238696)(Ttype190849* t);
N_NIMCALL(Tsym190843*, lookupinrecord_198236)(Tnode190813* n, Tident167021* field);
N_NIMCALL(Tnode190813*, indirectaccess_358208)(Tnode190813* a, NimStringDesc* b, Tlineinfo163338 info);
N_NIMCALL(Tsym190843*, getsymfromlist_198228)(Tnode190813* list, Tident167021* ident, NI start);
N_NIMCALL(void, internalerror_165218)(NimStringDesc* errmsg);
N_NIMCALL(NimStringDesc*, HEX24_165306)(TY86345 x);
N_NIMCALL(Tnode190813*, newintnode_191608)(NU8 kind, NI64 intval);
N_NIMCALL(Tnode190813*, newintlit_359438)(NI64 value);
N_NIMCALL(NI64, lastord_220010)(Ttype190849* t);
N_NIMCALL(Tsym190843*, createmagic_195986)(NimStringDesc* name, NU16 m);
static N_INLINE(NIM_BOOL, isemptytype_195933)(Ttype190849* t);
N_NIMCALL(NIM_BOOL, containsgarbagecollectedref_220154)(Ttype190849* typ);
static N_INLINE(Tnode190813*, HEX5BHEX5D_191244)(Tnode190813* n, NI i);
N_NIMCALL(NU8, spawnresult_358965)(Ttype190849* t, NIM_BOOL inparallel);
N_NIMCALL(void, localerror_165166)(Tlineinfo163338 info, NimStringDesc* arg);
N_NIMCALL(Ttype190849*, createobj_357270)(Tsym190843* owner, Tlineinfo163338 info);
N_NIMCALL(Tnode190813*, createcastexpr_359314)(Tsym190843* argsparam, Ttype190849* objtype);
N_NIMCALL(void, addfield_357609)(Ttype190849* obj, Tsym190843* s);
N_NIMCALL(Tnode190813*, newfastasgnstmt_357074)(Tnode190813* le, Tnode190813* ri);
N_NIMCALL(Tnode190813*, newdotexpr_358008)(Tsym190843* obj, Tsym190843* b);
N_NIMCALL(Tnode190813*, indirectaccess_358838)(Tnode190813* a, Tsym190843* b, Tlineinfo163338 info);
N_NIMCALL(void, setupargsforconcurrency_359328)(Tnode190813* n, Ttype190849* objtype, Tsym190843* scratchobj, Tnode190813* castexpr, Tnode190813* call, Tnode190813* varsection, Tnode190813* varinit, Tnode190813* result);
N_NIMCALL(Tsym190843*, addlocalvar_359028)(Tnode190813* varsection, Tnode190813* varinit, Tsym190843* owner, Ttype190849* typ, Tnode190813* v, NIM_BOOL useshallowcopy);
N_NIMCALL(NIM_BOOL, typeneedsnodeepcopy_358997)(Ttype190849* t_358999);
N_NIMCALL(void, setupargsforparallelism_359471)(Tnode190813* n_359473, Ttype190849* objtype, Tsym190843* scratchobj, Tnode190813* castexpr, Tnode190813* call, Tnode190813* varsection, Tnode190813* varinit, Tnode190813* result);
N_NIMCALL(NU16, getmagic_219403)(Tnode190813* op);
N_NIMCALL(Tnode190813*, genaddrof_358864)(Tnode190813* n);
N_NIMCALL(Tnode190813*, genhigh_359448)(Tnode190813* n);
N_NIMCALL(Tnode190813*, genderef_358875)(Tnode190813* n);
N_NIMCALL(NI64, computesize_220184)(Ttype190849* typ);
N_NIMCALL(Tsym190843*, getroot_359403)(Tnode190813* n);
N_NIMCALL(Tsym190843*, getcompilerproc_238036)(NimStringDesc* name);
N_NIMCALL(Tnode190813*, callproc_358941)(Tnode190813* a);
N_NIMCALL(Tnode190813*, callcodegenproc_358886)(NimStringDesc* name, Tnode190813* arg1, Tnode190813* arg2, Tnode190813* arg3);
N_NIMCALL(void, localerror_165155)(Tlineinfo163338 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(Tsym190843*, createwrapperproc_359090)(Tnode190813* f, Tsym190843* threadparam, Tsym190843* argsparam, Tnode190813* varsection, Tnode190813* varinit, Tnode190813* call, Tnode190813* barrier, Tnode190813* fv, NU8 spawnkind);
N_NIMCALL(NU8, flowvarkind_358976)(Ttype190849* t);
N_NIMCALL(NimStringDesc*, typetostring_220032)(Ttype190849* typ, NU8 prefer);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(Tnode190813*, newprocnode_193058)(NU8 kind, Tlineinfo163338 info, Tnode190813* body, Tnode190813* params, Tnode190813* name, Tnode190813* pattern, Tnode190813* genericparams, Tnode190813* pragmas, Tnode190813* exceptions);
STRING_LITERAL(TMP2795, ":tmp", 4);
STRING_LITERAL(TMP3307, "lowerings.nim", 13);
NIM_CONST TY86345 TMP3306 = {((NimStringDesc*) &TMP3307),
((NI) 132)}
;
STRING_LITERAL(TMP3372, "high", 4);
NIM_CONST TY86345 TMP3967 = {((NimStringDesc*) &TMP3307),
((NI) 490)}
;
NIM_CONST TY86345 TMP3968 = {((NimStringDesc*) &TMP3307),
((NI) 493)}
;
STRING_LITERAL(TMP3969, "\'spawn\' must not be discarded", 29);
STRING_LITERAL(TMP3970, "\'spawn\' takes a call expression", 31);
STRING_LITERAL(TMP3971, "\'spawn\' takes a GC safe call expression", 39);
STRING_LITERAL(TMP3972, "thread", 6);
STRING_LITERAL(TMP3973, "args", 4);
STRING_LITERAL(TMP3974, "scratch", 7);
STRING_LITERAL(TMP3975, "fn", 2);
STRING_LITERAL(TMP3976, "iterator in spawn environment is not allowed", 44);
STRING_LITERAL(TMP3977, "closure in spawn environment is not allowed", 43);
STRING_LITERAL(TMP3978, "\'spawn\'ed function cannot have a \'var\' parameter", 48);
STRING_LITERAL(TMP3979, "deepCopy", 8);
STRING_LITERAL(TMP3980, "slice", 5);
STRING_LITERAL(TMP3981, "Barrier", 7);
STRING_LITERAL(TMP3982, "barrier", 7);
STRING_LITERAL(TMP3983, "fv", 2);
STRING_LITERAL(TMP3984, "nimFlowVarCreateSemaphore", 25);
STRING_LITERAL(TMP3985, "barrierEnter", 12);
NIM_CONST TY86345 TMP3986 = {((NimStringDesc*) &TMP3307),
((NI) 287)}
;
STRING_LITERAL(TMP3987, "owner", 5);
STRING_LITERAL(TMP3988, "nimArgsPassingDone", 18);
STRING_LITERAL(TMP3989, "cannot create a flowVar of type: ", 33);
STRING_LITERAL(TMP3990, "data", 4);
STRING_LITERAL(TMP3991, "blob", 4);
STRING_LITERAL(TMP3992, "GCref", 5);
STRING_LITERAL(TMP3993, "nimFlowVarSignal", 16);
STRING_LITERAL(TMP3994, "barrierLeave", 12);
STRING_LITERAL(TMP3995, "Wrapper", 7);
STRING_LITERAL(TMP3996, "nimSpawn", 8);
extern Tgcheap48216 gch_48244;
extern Tnode190813* emptynode_191807;
extern NU32 gglobaloptions_154128;

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

static N_INLINE(void, rtladdzct_51404)(Tcell46347* c) {
	addzct_49817((&gch_48244.zct), c);
}

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

N_NIMCALL(void, addvar_357047)(Tnode190813* father, Tnode190813* v) {
	Tnode190813* vpart;
	vpart = newnodei_192407(((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_191807);
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 2)]), emptynode_191807);
	addson_192819(father, vpart);
}

N_NIMCALL(Tnode190813*, newasgnstmt_357061)(Tnode190813* le, Tnode190813* ri) {
	Tnode190813* result;
	result = 0;
	result = newnodei_192407(((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_191097)(Tnode190813* 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(Tnode190813*, newtupleaccess_357034)(Tnode190813* tup, NI i) {
	Tnode190813* result;
	Ttype190849* LOC1;
	Tnode190813* LOC2;
	Tnode190813* lit;
	Ttype190849* LOC3;
	result = 0;
	LOC1 = 0;
	LOC1 = skiptypes_194167((*tup).typ, IL64(211106232576256));
	result = newnodeit_192807(((NU8) 42), (*tup).info, (*LOC1).sons->data[i]);
	LOC2 = 0;
	LOC2 = copytree_195028(tup);
	addson_192819(result, LOC2);
	LOC3 = 0;
	LOC3 = getsystype_238030(((NU8) 31));
	lit = newnodeit_192807(((NU8) 6), (*tup).info, LOC3);
	(*lit).kindU.S1.intval = ((NI64) (i));
	addson_192819(result, lit);
	return result;
}

N_NIMCALL(Tnode190813*, lowertupleunpacking_357087)(Tnode190813* n, Tsym190843* owner) {
	Tnode190813* result;
	Tnode190813* value;
	Tsym190843* temp;
	Tident167021* LOC1;
	Tnode190813* v;
	Tnode190813* tempasnode;
	Tnode190813* LOC2;
	result = 0;
	value = lastson_193431(n);
	result = newnodei_192351(((NU8) 115), (*n).info);
	LOC1 = 0;
	LOC1 = getident_167463(((NimStringDesc*) &TMP2795));
	temp = newsym_191656(((NU8) 5), LOC1, owner, (*value).info);
	asgnRefNoCycle((void**) (&(*temp).typ), skiptypes_194167((*value).typ, IL64(211106232576256)));
	(*temp).flags |= ((NI32)1)<<((((NU8) 2))%(sizeof(NI32)*8));
	v = newnodei_192351(((NU8) 99), (*value).info);
	tempasnode = newsymnode_192325(temp);
	addvar_357047(v, tempasnode);
	add_191164(result, v);
	LOC2 = 0;
	LOC2 = newasgnstmt_357061(tempasnode, value);
	add_191164(result, LOC2);
	{
		NI i_357232;
		NI HEX3Atmp_357248;
		NI LOC4;
		NI res_357251;
		i_357232 = 0;
		HEX3Atmp_357248 = 0;
		LOC4 = 0;
		LOC4 = len_191097(n);
		HEX3Atmp_357248 = (NI)(LOC4 - ((NI) 3));
		res_357251 = ((NI) 0);
		{
			while (1) {
				Tnode190813* LOC11;
				Tnode190813* LOC12;
				if (!(res_357251 <= HEX3Atmp_357248)) goto LA6;
				i_357232 = res_357251;
				{
					if (!((*(*n).kindU.S6.sons->data[i_357232]).kind == ((NU8) 3))) goto LA9;
					addvar_357047(v, (*n).kindU.S6.sons->data[i_357232]);
				}
				LA9: ;
				LOC11 = 0;
				LOC11 = newtupleaccess_357034(tempasnode, i_357232);
				LOC12 = 0;
				LOC12 = newasgnstmt_357061((*n).kindU.S6.sons->data[i_357232], LOC11);
				add_191164(result, LOC12);
				res_357251 += ((NI) 1);
			} LA6: ;
		}
	}
	return result;
}

N_NIMCALL(Ttype190849*, createobj_357270)(Tsym190843* owner, Tlineinfo163338 info) {
	Ttype190849* result;
	result = 0;
	result = newtype_193140(((NU8) 17), owner);
	rawaddson_194478(result, NIM_NIL);
	(*result).flags |= ((NI32)1)<<((((NU8) 2))%(sizeof(NI32)*8));
	asgnRefNoCycle((void**) (&(*result).n), newnodei_192351(((NU8) 138), info));
	return result;
}

N_NIMCALL(void, rawaddfield_357291)(Ttype190849* obj, Tsym190843* field) {
	Tnode190813* LOC1;
	(*field).position = sonslen_193403((*obj).n);
	LOC1 = 0;
	LOC1 = newsymnode_192325(field);
	addson_192819((*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(Ttype190849*, skipintlit_238696)(Ttype190849* t) {
	Ttype190849* result;
{	result = 0;
	{
		if (!!(((*t).n == NIM_NIL))) goto LA3;
		{
			if (!((*t).kind == ((NU8) 31) || (*t).kind == ((NU8) 36))) goto LA7;
			result = getsystype_238030((*t).kind);
			goto BeforeRet;
		}
		LA7: ;
	}
	LA3: ;
	result = t;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, addfield_357609)(Ttype190849* obj, Tsym190843* s) {
	Tsym190843* field;
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	Tident167021* LOC3;
	Ttype190849* t;
	Tnode190813* 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_167463(LOC1);
	field = newsym_191656(((NU8) 19), LOC3, (*s).owner, (*s).info);
	t = skipintlit_238696((*s).typ);
	asgnRefNoCycle((void**) (&(*field).typ), t);
	(*field).position = sonslen_193403((*obj).n);
	LOC4 = 0;
	LOC4 = newsymnode_192325(field);
	addson_192819((*obj).n, LOC4);
}

N_NIMCALL(void, adduniquefield_357808)(Ttype190849* obj, Tsym190843* s) {
	Tident167021* 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_167463(LOC1);
	{
		Tsym190843* LOC5;
		Tsym190843* field;
		Ttype190849* t;
		Tnode190813* LOC8;
		LOC5 = 0;
		LOC5 = lookupinrecord_198236((*obj).n, fieldname);
		if (!(LOC5 == NIM_NIL)) goto LA6;
		field = newsym_191656(((NU8) 19), fieldname, (*s).owner, (*s).info);
		t = skipintlit_238696((*s).typ);
		asgnRefNoCycle((void**) (&(*field).typ), t);
		(*field).position = sonslen_193403((*obj).n);
		LOC8 = 0;
		LOC8 = newsymnode_192325(field);
		addson_192819((*obj).n, LOC8);
	}
	LA6: ;
}

N_NIMCALL(Tnode190813*, indirectaccess_358208)(Tnode190813* a, NimStringDesc* b, Tlineinfo163338 info) {
	Tnode190813* result;
	Tnode190813* deref;
	Ttype190849* LOC1;
	Ttype190849* t;
	Tsym190843* field;
	Tnode190813* LOC18;
	result = 0;
	deref = newnodei_192351(((NU8) 65), info);
	LOC1 = 0;
	LOC1 = skiptypes_194167((*a).typ, IL64(211106232576256));
	asgnRefNoCycle((void**) (&(*deref).typ), (*LOC1).sons->data[((NI) 0)]);
	t = skiptypes_194167((*deref).typ, IL64(211106232576256));
	field = 0;
	{
		while (1) {
			Tident167021* LOC4;
			LOC4 = 0;
			LOC4 = getident_167463(b);
			field = getsymfromlist_198228((*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_194167(t, IL64(211106232576256));
		}
	} LA2: ;
	{
		NimStringDesc* LOC17;
		if (!!(!((field == NIM_NIL)))) goto LA15;
		LOC17 = 0;
		LOC17 = HEX24_165306(TMP3306);
		internalerror_165218(LOC17);
	}
	LA15: ;
	addson_192819(deref, a);
	result = newnodei_192351(((NU8) 45), info);
	addson_192819(result, deref);
	LOC18 = 0;
	LOC18 = newsymnode_192325(field);
	addson_192819(result, LOC18);
	asgnRefNoCycle((void**) (&(*result).typ), (*field).typ);
	return result;
}

N_NIMCALL(Tnode190813*, indirectaccess_358838)(Tnode190813* a, Tsym190843* b, Tlineinfo163338 info) {
	Tnode190813* 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_358208(a, LOC1, info);
	return result;
}

N_NIMCALL(Tnode190813*, rawindirectaccess_357408)(Tnode190813* a, Tsym190843* field, Tlineinfo163338 info) {
	Tnode190813* result;
	Tnode190813* deref;
	Ttype190849* LOC1;
	Tnode190813* LOC2;
	result = 0;
	deref = newnodei_192351(((NU8) 65), info);
	LOC1 = 0;
	LOC1 = skiptypes_194167((*a).typ, IL64(211106232576256));
	asgnRefNoCycle((void**) (&(*deref).typ), (*LOC1).sons->data[((NI) 0)]);
	addson_192819(deref, a);
	result = newnodei_192351(((NU8) 45), info);
	addson_192819(result, deref);
	LOC2 = 0;
	LOC2 = newsymnode_192325(field);
	addson_192819(result, LOC2);
	asgnRefNoCycle((void**) (&(*result).typ), (*field).typ);
	return result;
}

N_NIMCALL(Tnode190813*, newintlit_359438)(NI64 value) {
	Tnode190813* result;
	result = 0;
	result = newintnode_191608(((NU8) 6), value);
	asgnRefNoCycle((void**) (&(*result).typ), getsystype_238030(((NU8) 31)));
	return result;
}

N_NIMCALL(Tnode190813*, genhigh_359448)(Tnode190813* n) {
	Tnode190813* result;
	result = 0;
	{
		Ttype190849* LOC3;
		Ttype190849* LOC6;
		NI64 LOC7;
		LOC3 = 0;
		LOC3 = skiptypes_194167((*n).typ, IL64(211106240964864));
		if (!((*LOC3).kind == ((NU8) 4) || (*LOC3).kind == ((NU8) 16))) goto LA4;
		LOC6 = 0;
		LOC6 = skiptypes_194167((*n).typ, IL64(211106240964864));
		LOC7 = 0;
		LOC7 = lastord_220010(LOC6);
		result = newintlit_359438(LOC7);
	}
	goto LA1;
	LA4: ;
	{
		Tsym190843* LOC9;
		result = newnodei_192407(((NU8) 27), (*n).info, ((NI) 2));
		asgnRefNoCycle((void**) (&(*result).typ), getsystype_238030(((NU8) 31)));
		LOC9 = 0;
		LOC9 = createmagic_195986(((NimStringDesc*) &TMP3372), ((NU16) 5));
		asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[((NI) 0)]), newsymnode_192325(LOC9));
		asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[((NI) 1)]), n);
	}
	LA1: ;
	return result;
}

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

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

N_NIMCALL(Tnode190813*, createcastexpr_359314)(Tsym190843* argsparam, Ttype190849* objtype) {
	Tnode190813* result;
	Tnode190813* LOC1;
	result = 0;
	result = newnodei_192351(((NU8) 61), (*argsparam).info);
	add_191164(result, emptynode_191807);
	LOC1 = 0;
	LOC1 = newsymnode_192325(argsparam);
	add_191164(result, LOC1);
	asgnRefNoCycle((void**) (&(*result).typ), newtype_193140(((NU8) 21), (*objtype).owner));
	rawaddson_194478((*result).typ, objtype);
	return result;
}

N_NIMCALL(Tnode190813*, newfastasgnstmt_357074)(Tnode190813* le, Tnode190813* ri) {
	Tnode190813* result;
	result = 0;
	result = newnodei_192407(((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(Tnode190813*, newdotexpr_358008)(Tsym190843* obj, Tsym190843* b) {
	Tnode190813* result;
	Tsym190843* field;
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	Tident167021* LOC3;
	Tnode190813* LOC4;
	Tnode190813* LOC5;
	result = 0;
	result = newnodei_192351(((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_167463(LOC1);
	field = getsymfromlist_198228((*(*obj).typ).n, LOC3, ((NI) 0));
	LOC4 = 0;
	LOC4 = newsymnode_192325(obj);
	addson_192819(result, LOC4);
	LOC5 = 0;
	LOC5 = newsymnode_192325(field);
	addson_192819(result, LOC5);
	asgnRefNoCycle((void**) (&(*result).typ), (*field).typ);
	return result;
}

N_NIMCALL(NIM_BOOL, typeneedsnodeepcopy_358997)(Ttype190849* t_358999) {
	NIM_BOOL result;
	Ttype190849* t;
	NIM_BOOL LOC9;
{	result = 0;
	t = skiptypes_194167(t_358999, 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_220154(t);
	result = !(LOC9);
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tsym190843*, addlocalvar_359028)(Tnode190813* varsection, Tnode190813* varinit, Tsym190843* owner, Ttype190849* typ, Tnode190813* v, NIM_BOOL useshallowcopy) {
	Tsym190843* result;
	Tident167021* LOC1;
	Tnode190813* vpart;
	result = 0;
	LOC1 = 0;
	LOC1 = getident_167463(((NimStringDesc*) &TMP2795));
	result = newsym_191656(((NU8) 5), LOC1, owner, (*varsection).info);
	asgnRefNoCycle((void**) (&(*result).typ), typ);
	(*result).flags |= ((NI32)1)<<((((NU8) 2))%(sizeof(NI32)*8));
	vpart = newnodei_192407(((NU8) 35), (*varsection).info, ((NI) 3));
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 0)]), newsymnode_192325(result));
	asgnRefNoCycle((void**) (&(*vpart).kindU.S6.sons->data[((NI) 1)]), emptynode_191807);
	{
		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_191807);
	}
	LA2: ;
	add_191164(varsection, vpart);
	{
		if (!!((varinit == NIM_NIL))) goto LA9;
		{
			NIM_BOOL LOC13;
			Tnode190813* LOC17;
			Tnode190813* LOC18;
			LOC13 = 0;
			LOC13 = useshallowcopy;
			if (!(LOC13)) goto LA14;
			LOC13 = typeneedsnodeepcopy_358997(typ);
			LA14: ;
			if (!LOC13) goto LA15;
			LOC17 = 0;
			LOC17 = newsymnode_192325(result);
			LOC18 = 0;
			LOC18 = newfastasgnstmt_357074(LOC17, v);
			add_191164(varinit, LOC18);
		}
		goto LA11;
		LA15: ;
		{
			Tnode190813* deepcopycall;
			Tsym190843* LOC20;
			deepcopycall = newnodei_192407(((NU8) 27), (*varinit).info, ((NI) 3));
			LOC20 = 0;
			LOC20 = createmagic_195986(((NimStringDesc*) &TMP3979), ((NU16) 214));
			asgnRefNoCycle((void**) (&(*deepcopycall).kindU.S6.sons->data[((NI) 0)]), newsymnode_192325(LOC20));
			asgnRefNoCycle((void**) (&(*deepcopycall).kindU.S6.sons->data[((NI) 1)]), newsymnode_192325(result));
			asgnRefNoCycle((void**) (&(*deepcopycall).kindU.S6.sons->data[((NI) 2)]), v);
			add_191164(varinit, deepcopycall);
		}
		LA11: ;
	}
	LA9: ;
	return result;
}

N_NIMCALL(void, setupargsforconcurrency_359328)(Tnode190813* n, Ttype190849* objtype, Tsym190843* scratchobj, Tnode190813* castexpr, Tnode190813* call, Tnode190813* varsection, Tnode190813* varinit, Tnode190813* result) {
	Tnode190813* formals;
	Tnode190813* LOC1;
	Tident167021* tmpname;
	LOC1 = 0;
	LOC1 = HEX5BHEX5D_191244(n, ((NI) 0));
	formals = (*(*LOC1).typ).n;
	tmpname = getident_167463(((NimStringDesc*) &TMP2795));
	{
		NI i_359359;
		NI HEX3Atmp_359381;
		NI LOC3;
		NI res_359384;
		i_359359 = 0;
		HEX3Atmp_359381 = 0;
		LOC3 = 0;
		LOC3 = len_191097(n);
		HEX3Atmp_359381 = (LOC3 - 1);
		res_359384 = ((NI) 1);
		{
			while (1) {
				Ttype190849* argtype;
				Tnode190813* LOC6;
				Tident167021* fieldname;
				Tsym190843* field;
				Tnode190813* LOC23;
				Tnode190813* LOC24;
				Tnode190813* LOC25;
				Tsym190843* temp;
				Tnode190813* LOC26;
				Tnode190813* LOC27;
				if (!(res_359384 <= HEX3Atmp_359381)) goto LA5;
				i_359359 = res_359384;
				LOC6 = 0;
				LOC6 = HEX5BHEX5D_191244(n, i_359359);
				argtype = skiptypes_194167((*LOC6).typ, IL64(211106232576256));
				{
					NIM_BOOL LOC9;
					NI LOC10;
					Tnode190813* LOC12;
					Tnode190813* LOC15;
					LOC9 = 0;
					LOC10 = 0;
					LOC10 = len_191097(formals);
					LOC9 = (i_359359 < LOC10);
					if (!(LOC9)) goto LA11;
					LOC12 = 0;
					LOC12 = HEX5BHEX5D_191244(formals, i_359359);
					LOC9 = ((*(*LOC12).typ).kind == ((NU8) 23));
					LA11: ;
					if (!LOC9) goto LA13;
					LOC15 = 0;
					LOC15 = HEX5BHEX5D_191244(n, i_359359);
					localerror_165166((*LOC15).info, ((NimStringDesc*) &TMP3978));
				}
				LA13: ;
				{
					NI LOC18;
					Tnode190813* LOC21;
					LOC18 = 0;
					LOC18 = len_191097(formals);
					if (!(i_359359 < LOC18)) goto LA19;
					LOC21 = 0;
					LOC21 = HEX5BHEX5D_191244(formals, i_359359);
					fieldname = (*(*LOC21).kindU.S4.sym).name;
				}
				goto LA16;
				LA19: ;
				{
					fieldname = tmpname;
				}
				LA16: ;
				field = newsym_191656(((NU8) 19), fieldname, (*objtype).owner, (*n).info);
				asgnRefNoCycle((void**) (&(*field).typ), argtype);
				addfield_357609(objtype, field);
				LOC23 = 0;
				LOC23 = newdotexpr_358008(scratchobj, field);
				LOC24 = 0;
				LOC24 = HEX5BHEX5D_191244(n, i_359359);
				LOC25 = 0;
				LOC25 = newfastasgnstmt_357074(LOC23, LOC24);
				add_191164(result, LOC25);
				LOC26 = 0;
				LOC26 = indirectaccess_358838(castexpr, field, (*n).info);
				temp = addlocalvar_359028(varsection, varinit, (*objtype).owner, argtype, LOC26, NIM_FALSE);
				LOC27 = 0;
				LOC27 = newsymnode_192325(temp);
				add_191164(call, LOC27);
				res_359384 += ((NI) 1);
			} LA5: ;
		}
	}
}

N_NIMCALL(Tnode190813*, genaddrof_358864)(Tnode190813* n) {
	Tnode190813* result;
	result = 0;
	result = newnodei_192407(((NU8) 63), (*n).info, ((NI) 1));
	asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[((NI) 0)]), n);
	asgnRefNoCycle((void**) (&(*result).typ), newtype_193140(((NU8) 21), (*(*n).typ).owner));
	rawaddson_194478((*result).typ, (*n).typ);
	return result;
}

N_NIMCALL(Tnode190813*, genderef_358875)(Tnode190813* n) {
	Tnode190813* result;
	Ttype190849* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = skiptypes_194167((*n).typ, IL64(211106232576256));
	result = newnodeit_192807(((NU8) 65), (*n).info, (*LOC1).sons->data[((NI) 0)]);
	add_191164(result, n);
	return result;
}

N_NIMCALL(Tsym190843*, getroot_359403)(Tnode190813* n) {
	Tsym190843* 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_359403((*n).kindU.S6.sons->data[((NI) 0)]);
	}
	break;
	case ((NU8) 58):
	case ((NU8) 59):
	case ((NU8) 60):
	{
		result = getroot_359403((*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):
	{
		{
			NU16 LOC11;
			LOC11 = 0;
			LOC11 = getmagic_219403(n);
			if (!(LOC11 == ((NU16) 150))) goto LA12;
			result = getroot_359403((*n).kindU.S6.sons->data[((NI) 1)]);
		}
		LA12: ;
	}
	break;
	default:
	{
	}
	break;
	}
	return result;
}

N_NIMCALL(void, setupargsforparallelism_359471)(Tnode190813* n_359473, Ttype190849* objtype, Tsym190843* scratchobj, Tnode190813* castexpr, Tnode190813* call, Tnode190813* varsection, Tnode190813* varinit, Tnode190813* result) {
	Tnode190813* formals;
	Tnode190813* LOC1;
	Tident167021* tmpname;
	LOC1 = 0;
	LOC1 = HEX5BHEX5D_191244(n_359473, ((NI) 0));
	formals = (*(*LOC1).typ).n;
	tmpname = getident_167463(((NimStringDesc*) &TMP2795));
	{
		NI i_359502;
		NI HEX3Atmp_359585;
		NI LOC3;
		NI res_359588;
		i_359502 = 0;
		HEX3Atmp_359585 = 0;
		LOC3 = 0;
		LOC3 = len_191097(n_359473);
		HEX3Atmp_359585 = (LOC3 - 1);
		res_359588 = ((NI) 1);
		{
			while (1) {
				Tnode190813* n;
				Ttype190849* argtype;
				Ttype190849* LOC6;
				Tident167021* fieldname;
				Tsym190843* field;
				if (!(res_359588 <= HEX3Atmp_359585)) goto LA5;
				i_359502 = res_359588;
				n = HEX5BHEX5D_191244(n_359473, i_359502);
				LOC6 = 0;
				{
					NI LOC9;
					Tnode190813* LOC12;
					LOC9 = 0;
					LOC9 = len_191097(formals);
					if (!(i_359502 < LOC9)) goto LA10;
					LOC12 = 0;
					LOC12 = HEX5BHEX5D_191244(formals, i_359502);
					LOC6 = (*LOC12).typ;
				}
				goto LA7;
				LA10: ;
				{
					LOC6 = (*n).typ;
				}
				LA7: ;
				argtype = skiptypes_194167(LOC6, IL64(211106232576256));
				{
					NI LOC16;
					Tnode190813* LOC19;
					LOC16 = 0;
					LOC16 = len_191097(formals);
					if (!(i_359502 < LOC16)) goto LA17;
					LOC19 = 0;
					LOC19 = HEX5BHEX5D_191244(formals, i_359502);
					fieldname = (*(*LOC19).kindU.S4.sym).name;
				}
				goto LA14;
				LA17: ;
				{
					fieldname = tmpname;
				}
				LA14: ;
				field = newsym_191656(((NU8) 19), fieldname, (*objtype).owner, (*n).info);
				{
					Tnode190813* slice;
					Tsym190843* LOC25;
					Tsym190843* fieldb;
					Tnode190813* LOC47;
					Tsym190843* threadlocal_359553;
					Tnode190813* LOC48;
					if (!((*argtype).kind == ((NU8) 48) || (*argtype).kind == ((NU8) 27))) goto LA23;
					slice = newnodei_192407(((NU8) 27), (*n).info, ((NI) 4));
					asgnRefNoCycle((void**) (&(*slice).typ), (*n).typ);
					LOC25 = 0;
					LOC25 = createmagic_195986(((NimStringDesc*) &TMP3980), ((NU16) 150));
					asgnRefNoCycle((void**) (&(*slice).kindU.S6.sons->data[((NI) 0)]), newsymnode_192325(LOC25));
					fieldb = newsym_191656(((NU8) 19), tmpname, (*objtype).owner, (*n).info);
					asgnRefNoCycle((void**) (&(*fieldb).typ), getsystype_238030(((NU8) 31)));
					addfield_357609(objtype, fieldb);
					{
						NU16 LOC28;
						Tnode190813* a;
						Tnode190813* LOC31;
						Tnode190813* LOC32;
						Tnode190813* LOC33;
						Tsym190843* fielda;
						Tnode190813* LOC34;
						Tnode190813* LOC35;
						Tnode190813* LOC36;
						Tnode190813* LOC37;
						Tnode190813* LOC38;
						Tnode190813* LOC39;
						Tsym190843* threadlocal_359543;
						Tnode190813* LOC40;
						LOC28 = 0;
						LOC28 = getmagic_219403(n);
						if (!(LOC28 == ((NU16) 150))) goto LA29;
						LOC31 = 0;
						LOC31 = HEX5BHEX5D_191244(n, ((NI) 1));
						a = genaddrof_358864(LOC31);
						asgnRefNoCycle((void**) (&(*field).typ), (*a).typ);
						addfield_357609(objtype, field);
						LOC32 = 0;
						LOC32 = newdotexpr_358008(scratchobj, field);
						LOC33 = 0;
						LOC33 = newfastasgnstmt_357074(LOC32, a);
						add_191164(result, LOC33);
						fielda = newsym_191656(((NU8) 19), tmpname, (*objtype).owner, (*n).info);
						asgnRefNoCycle((void**) (&(*fielda).typ), getsystype_238030(((NU8) 31)));
						addfield_357609(objtype, fielda);
						LOC34 = 0;
						LOC34 = newdotexpr_358008(scratchobj, fielda);
						LOC35 = 0;
						LOC35 = HEX5BHEX5D_191244(n, ((NI) 2));
						LOC36 = 0;
						LOC36 = newfastasgnstmt_357074(LOC34, LOC35);
						add_191164(result, LOC36);
						LOC37 = 0;
						LOC37 = newdotexpr_358008(scratchobj, fieldb);
						LOC38 = 0;
						LOC38 = HEX5BHEX5D_191244(n, ((NI) 3));
						LOC39 = 0;
						LOC39 = newfastasgnstmt_357074(LOC37, LOC38);
						add_191164(result, LOC39);
						LOC40 = 0;
						LOC40 = indirectaccess_358838(castexpr, fielda, (*n).info);
						threadlocal_359543 = addlocalvar_359028(varsection, NIM_NIL, (*objtype).owner, (*fielda).typ, LOC40, NIM_TRUE);
						asgnRefNoCycle((void**) (&(*slice).kindU.S6.sons->data[((NI) 2)]), newsymnode_192325(threadlocal_359543));
					}
					goto LA26;
					LA29: ;
					{
						Tnode190813* a;
						Tnode190813* LOC42;
						Tnode190813* LOC43;
						Tnode190813* LOC44;
						Tnode190813* LOC45;
						Tnode190813* LOC46;
						a = genaddrof_358864(n);
						asgnRefNoCycle((void**) (&(*field).typ), (*a).typ);
						addfield_357609(objtype, field);
						LOC42 = 0;
						LOC42 = newdotexpr_358008(scratchobj, field);
						LOC43 = 0;
						LOC43 = newfastasgnstmt_357074(LOC42, a);
						add_191164(result, LOC43);
						LOC44 = 0;
						LOC44 = newdotexpr_358008(scratchobj, fieldb);
						LOC45 = 0;
						LOC45 = genhigh_359448(n);
						LOC46 = 0;
						LOC46 = newfastasgnstmt_357074(LOC44, LOC45);
						add_191164(result, LOC46);
						asgnRefNoCycle((void**) (&(*slice).kindU.S6.sons->data[((NI) 2)]), newintlit_359438(IL64(0)));
					}
					LA26: ;
					LOC47 = 0;
					LOC47 = indirectaccess_358838(castexpr, field, (*n).info);
					asgnRefNoCycle((void**) (&(*slice).kindU.S6.sons->data[((NI) 1)]), genderef_358875(LOC47));
					LOC48 = 0;
					LOC48 = indirectaccess_358838(castexpr, fieldb, (*n).info);
					threadlocal_359553 = addlocalvar_359028(varsection, NIM_NIL, (*objtype).owner, (*fieldb).typ, LOC48, NIM_TRUE);
					asgnRefNoCycle((void**) (&(*slice).kindU.S6.sons->data[((NI) 3)]), newsymnode_192325(threadlocal_359553));
					add_191164(call, slice);
				}
				goto LA21;
				LA23: ;
				{
					NIM_BOOL LOC50;
					NI64 size;
					NIM_BOOL LOC51;
					Tsym190843* LOC54;
					Tnode190813* a;
					Tnode190813* LOC57;
					Tnode190813* LOC58;
					Tsym190843* threadlocal_359575;
					Tnode190813* LOC59;
					Tnode190813* LOC60;
					Tnode190813* LOC61;
					LOC50 = 0;
					size = computesize_220184(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_359403(n);
					LOC50 = !((LOC54 == NIM_NIL));
					LA53: ;
					if (!LOC50) goto LA55;
					a = genaddrof_358864(n);
					asgnRefNoCycle((void**) (&(*field).typ), (*a).typ);
					addfield_357609(objtype, field);
					LOC57 = 0;
					LOC57 = newdotexpr_358008(scratchobj, field);
					LOC58 = 0;
					LOC58 = newfastasgnstmt_357074(LOC57, a);
					add_191164(result, LOC58);
					LOC59 = 0;
					LOC59 = indirectaccess_358838(castexpr, field, (*n).info);
					threadlocal_359575 = addlocalvar_359028(varsection, NIM_NIL, (*objtype).owner, (*field).typ, LOC59, NIM_TRUE);
					LOC60 = 0;
					LOC60 = newsymnode_192325(threadlocal_359575);
					LOC61 = 0;
					LOC61 = genderef_358875(LOC60);
					add_191164(call, LOC61);
				}
				goto LA21;
				LA55: ;
				{
					Tnode190813* LOC63;
					Tnode190813* LOC64;
					Tsym190843* threadlocal_359581;
					Tnode190813* LOC65;
					Tnode190813* LOC66;
					asgnRefNoCycle((void**) (&(*field).typ), argtype);
					addfield_357609(objtype, field);
					LOC63 = 0;
					LOC63 = newdotexpr_358008(scratchobj, field);
					LOC64 = 0;
					LOC64 = newfastasgnstmt_357074(LOC63, n);
					add_191164(result, LOC64);
					LOC65 = 0;
					LOC65 = indirectaccess_358838(castexpr, field, (*n).info);
					threadlocal_359581 = addlocalvar_359028(varsection, varinit, (*objtype).owner, (*field).typ, LOC65, NIM_TRUE);
					LOC66 = 0;
					LOC66 = newsymnode_192325(threadlocal_359581);
					add_191164(call, LOC66);
				}
				LA21: ;
				res_359588 += ((NI) 1);
			} LA5: ;
		}
	}
}

N_NIMCALL(Tnode190813*, callproc_358941)(Tnode190813* a) {
	Tnode190813* result;
	result = 0;
	result = newnodei_192351(((NU8) 27), (*a).info);
	add_191164(result, a);
	asgnRefNoCycle((void**) (&(*result).typ), (*(*a).typ).sons->data[((NI) 0)]);
	return result;
}

N_NIMCALL(Tnode190813*, callcodegenproc_358886)(NimStringDesc* name, Tnode190813* arg1, Tnode190813* arg2, Tnode190813* arg3) {
	Tnode190813* result;
	Tsym190843* sym;
	result = 0;
	result = newnodei_192351(((NU8) 27), (*arg1).info);
	sym = getcompilerproc_238036(name);
	{
		if (!(sym == NIM_NIL)) goto LA3;
		localerror_165155((*arg1).info, ((NU16) 64), name);
	}
	goto LA1;
	LA3: ;
	{
		Tnode190813* LOC6;
		LOC6 = 0;
		LOC6 = newsymnode_192325(sym);
		add_191164(result, LOC6);
		add_191164(result, arg1);
		{
			if (!!((arg2 == NIM_NIL))) goto LA9;
			add_191164(result, arg2);
		}
		LA9: ;
		{
			if (!!((arg3 == NIM_NIL))) goto LA13;
			add_191164(result, arg3);
		}
		LA13: ;
		asgnRefNoCycle((void**) (&(*result).typ), (*(*sym).typ).sons->data[((NI) 0)]);
	}
	LA1: ;
	return result;
}

N_NIMCALL(NU8, flowvarkind_358976)(Ttype190849* t) {
	NU8 result;
	result = 0;
	{
		Ttype190849* LOC3;
		LOC3 = 0;
		LOC3 = skiptypes_194167(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_220154(t);
		if (!LOC7) goto LA8;
		result = ((NU8) 0);
	}
	goto LA1;
	LA8: ;
	{
		result = ((NU8) 2);
	}
	LA1: ;
	return result;
}

N_NIMCALL(Tsym190843*, createwrapperproc_359090)(Tnode190813* f, Tsym190843* threadparam, Tsym190843* argsparam, Tnode190813* varsection, Tnode190813* varinit, Tnode190813* call, Tnode190813* barrier, Tnode190813* fv, NU8 spawnkind) {
	Tsym190843* result;
	Tnode190813* body;
	Tsym190843* threadlocalbarrier;
	Tsym190843* threadlocalprom;
	Tnode190813* LOC29;
	Tnode190813* LOC30;
	Tnode190813* params;
	Tnode190813* LOC75;
	Tnode190813* LOC76;
	Ttype190849* t;
	Tnode190813* LOC77;
	Tnode190813* LOC78;
	Tnode190813* LOC79;
	NimStringDesc* name;
	NimStringDesc* LOC80;
	NimStringDesc* LOC81;
	Tident167021* LOC87;
	Tnode190813* LOC88;
	result = 0;
	body = newnodei_192351(((NU8) 115), (*f).info);
	threadlocalbarrier = 0;
	{
		Tnode190813* varsection2;
		Tnode190813* LOC5;
		Tnode190813* LOC6;
		if (!!((barrier == NIM_NIL))) goto LA3;
		varsection2 = newnodei_192351(((NU8) 99), (*barrier).info);
		threadlocalbarrier = addlocalvar_359028(varsection2, NIM_NIL, (*argsparam).owner, (*barrier).typ, barrier, NIM_FALSE);
		add_191164(body, varsection2);
		LOC5 = 0;
		LOC5 = newsymnode_192325(threadlocalbarrier);
		LOC6 = 0;
		LOC6 = callcodegenproc_358886(((NimStringDesc*) &TMP3985), LOC5, NIM_NIL, NIM_NIL);
		add_191164(body, LOC6);
	}
	LA3: ;
	threadlocalprom = 0;
	{
		if (!(spawnkind == ((NU8) 2))) goto LA9;
		threadlocalprom = addlocalvar_359028(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_165306(TMP3986);
			internalerror_165218(LOC18);
		}
		LA16: ;
		threadlocalprom = addlocalvar_359028(varsection, NIM_NIL, (*argsparam).owner, (*fv).typ, fv, NIM_FALSE);
	}
	goto LA7;
	LA12: ;
	LA7: ;
	add_191164(body, varsection);
	add_191164(body, varinit);
	{
		NIM_BOOL LOC21;
		Tnode190813* LOC25;
		Tnode190813* LOC26;
		Tnode190813* LOC27;
		Tnode190813* LOC28;
		LOC21 = 0;
		LOC21 = !((fv == NIM_NIL));
		if (!(LOC21)) goto LA22;
		LOC21 = !((spawnkind == ((NU8) 2)));
		LA22: ;
		if (!LOC21) goto LA23;
		LOC25 = 0;
		LOC25 = newsymnode_192325(threadlocalprom);
		LOC26 = 0;
		LOC26 = indirectaccess_358208(LOC25, ((NimStringDesc*) &TMP3987), (*fv).info);
		LOC27 = 0;
		LOC27 = newsymnode_192325(threadparam);
		LOC28 = 0;
		LOC28 = newasgnstmt_357061(LOC26, LOC27);
		add_191164(body, LOC28);
	}
	LA23: ;
	LOC29 = 0;
	LOC29 = newsymnode_192325(threadparam);
	LOC30 = 0;
	LOC30 = callcodegenproc_358886(((NimStringDesc*) &TMP3988), LOC29, NIM_NIL, NIM_NIL);
	add_191164(body, LOC30);
	{
		Tnode190813* LOC35;
		Tnode190813* LOC36;
		Tnode190813* LOC37;
		if (!(spawnkind == ((NU8) 2))) goto LA33;
		LOC35 = 0;
		LOC35 = newsymnode_192325(threadlocalprom);
		LOC36 = 0;
		LOC36 = genderef_358875(LOC35);
		LOC37 = 0;
		LOC37 = newasgnstmt_357061(LOC36, call);
		add_191164(body, LOC37);
	}
	goto LA31;
	LA33: ;
	{
		NU8 fk;
		Tnode190813* LOC47;
		NimStringDesc* LOC48;
		Tnode190813* LOC54;
		Tnode190813* LOC55;
		if (!!((fv == NIM_NIL))) goto LA39;
		fk = flowvarkind_358976((*(*fv).typ).sons->data[((NI) 1)]);
		{
			NimStringDesc* LOC45;
			NimStringDesc* LOC46;
			if (!(fk == ((NU8) 0))) goto LA43;
			LOC45 = 0;
			LOC46 = 0;
			LOC46 = typetostring_220032((*(*fv).typ).sons->data[((NI) 1)], ((NU8) 0));
			LOC45 = rawNewString(LOC46->Sup.len + 33);
appendString(LOC45, ((NimStringDesc*) &TMP3989));
appendString(LOC45, LOC46);
			localerror_165166((*f).info, LOC45);
		}
		LA43: ;
		LOC47 = 0;
		LOC47 = newsymnode_192325(threadlocalprom);
		LOC48 = 0;
		{
			if (!(fk == ((NU8) 1))) goto LA51;
			LOC48 = copyString(((NimStringDesc*) &TMP3990));
		}
		goto LA49;
		LA51: ;
		{
			LOC48 = copyString(((NimStringDesc*) &TMP3991));
		}
		LA49: ;
		LOC54 = 0;
		LOC54 = indirectaccess_358208(LOC47, LOC48, (*fv).info);
		LOC55 = 0;
		LOC55 = newasgnstmt_357061(LOC54, call);
		add_191164(body, LOC55);
		{
			Tnode190813* increfcall;
			Tsym190843* LOC60;
			Tnode190813* LOC61;
			if (!(fk == ((NU8) 1))) goto LA58;
			increfcall = newnodei_192407(((NU8) 27), (*fv).info, ((NI) 2));
			LOC60 = 0;
			LOC60 = createmagic_195986(((NimStringDesc*) &TMP3992), ((NU16) 39));
			asgnRefNoCycle((void**) (&(*increfcall).kindU.S6.sons->data[((NI) 0)]), newsymnode_192325(LOC60));
			LOC61 = 0;
			LOC61 = newsymnode_192325(threadlocalprom);
			asgnRefNoCycle((void**) (&(*increfcall).kindU.S6.sons->data[((NI) 1)]), indirectaccess_358208(LOC61, ((NimStringDesc*) &TMP3990), (*fv).info));
			add_191164(body, increfcall);
		}
		LA58: ;
		{
			Tnode190813* LOC66;
			Tnode190813* LOC67;
			if (!(barrier == NIM_NIL)) goto LA64;
			LOC66 = 0;
			LOC66 = newsymnode_192325(threadlocalprom);
			LOC67 = 0;
			LOC67 = callcodegenproc_358886(((NimStringDesc*) &TMP3993), LOC66, NIM_NIL, NIM_NIL);
			add_191164(body, LOC67);
		}
		LA64: ;
	}
	goto LA31;
	LA39: ;
	{
		add_191164(body, call);
	}
	LA31: ;
	{
		Tnode190813* LOC73;
		Tnode190813* LOC74;
		if (!!((barrier == NIM_NIL))) goto LA71;
		LOC73 = 0;
		LOC73 = newsymnode_192325(threadlocalbarrier);
		LOC74 = 0;
		LOC74 = callcodegenproc_358886(((NimStringDesc*) &TMP3994), LOC73, NIM_NIL, NIM_NIL);
		add_191164(body, LOC74);
	}
	LA71: ;
	params = newnodei_192351(((NU8) 76), (*f).info);
	add_191164(params, emptynode_191807);
	LOC75 = 0;
	LOC75 = newsymnode_192325(threadparam);
	add_191164(params, LOC75);
	LOC76 = 0;
	LOC76 = newsymnode_192325(argsparam);
	add_191164(params, LOC76);
	t = newtype_193140(((NU8) 25), (*threadparam).owner);
	rawaddson_194478(t, NIM_NIL);
	rawaddson_194478(t, (*threadparam).typ);
	rawaddson_194478(t, (*argsparam).typ);
	asgnRefNoCycle((void**) (&(*t).n), newnodei_192351(((NU8) 76), (*f).info));
	LOC77 = 0;
	LOC77 = newnodei_192351(((NU8) 152), (*f).info);
	add_191164((*t).n, LOC77);
	LOC78 = 0;
	LOC78 = newsymnode_192325(threadparam);
	add_191164((*t).n, LOC78);
	LOC79 = 0;
	LOC79 = newsymnode_192325(argsparam);
	add_191164((*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*) &TMP2795));
	}
	LA82: ;
	LOC80 = rawNewString(LOC81->Sup.len + 7);
appendString(LOC80, LOC81);
appendString(LOC80, ((NimStringDesc*) &TMP3995));
	name = LOC80;
	LOC87 = 0;
	LOC87 = getident_167463(name);
	result = newsym_191656(((NU8) 12), LOC87, (*argsparam).owner, (*f).info);
	LOC88 = 0;
	LOC88 = newsymnode_192325(result);
	asgnRefNoCycle((void**) (&(*result).ast), newprocnode_193058(((NU8) 79), (*f).info, body, params, LOC88, emptynode_191807, emptynode_191807, emptynode_191807, emptynode_191807));
	asgnRefNoCycle((void**) (&(*result).typ), t);
	return result;
}

N_NIMCALL(Tnode190813*, wrapprocforspawn_359607)(Tsym190843* owner, Tnode190813* spawnexpr, Ttype190849* rettype, Tnode190813* barrier, Tnode190813* dest) {
	Tnode190813* result;
	Tnode190813* n;
	NU8 spawnkind;
	Tsym190843* threadparam;
	Tident167021* LOC31;
	Tsym190843* argsparam;
	Tident167021* LOC32;
	Ttype190849* objtype;
	Tnode190813* castexpr;
	Tsym190843* scratchobj;
	Tident167021* LOC34;
	Tnode190813* call;
	Tnode190813* fn;
	Tnode190813* varsection;
	Tnode190813* varinit;
	Tnode190813* barrierasexpr;
	Tnode190813* fvfield;
	Tnode190813* fvasexpr;
	Tsym190843* wrapper;
	Tnode190813* LOC89;
	Tnode190813* LOC90;
	Tnode190813* LOC91;
	Tnode190813* LOC92;
{	result = 0;
	n = HEX5BHEX5D_191244(spawnexpr, ((NI) 1));
	spawnkind = spawnresult_358965(rettype, !((barrier == NIM_NIL)));
	switch (spawnkind) {
	case ((NU8) 0):
	{
		{
			NimStringDesc* LOC6;
			if (!!((dest == NIM_NIL))) goto LA4;
			LOC6 = 0;
			LOC6 = HEX24_165306(TMP3967);
			internalerror_165218(LOC6);
		}
		LA4: ;
		result = newnodei_192351(((NU8) 115), (*n).info);
	}
	break;
	case ((NU8) 1):
	{
		{
			NimStringDesc* LOC12;
			if (!!((dest == NIM_NIL))) goto LA10;
			LOC12 = 0;
			LOC12 = HEX24_165306(TMP3968);
			internalerror_165218(LOC12);
		}
		LA10: ;
		result = newnodeit_192807(((NU8) 126), (*n).info, rettype);
	}
	break;
	case ((NU8) 2):
	{
		{
			if (!(dest == NIM_NIL)) goto LA16;
			localerror_165166((*n).info, ((NimStringDesc*) &TMP3969));
		}
		LA16: ;
		result = newnodei_192351(((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 LA20;
		localerror_165166((*n).info, ((NimStringDesc*) &TMP3970));
		goto BeforeRet;
	}
	LA20: ;
	{
		if (!((gglobaloptions_154128 &(1<<((((NU8) 23))&31)))!=0)) goto LA24;
		{
			Tnode190813* LOC28;
			LOC28 = 0;
			LOC28 = HEX5BHEX5D_191244(n, ((NI) 0));
			if (!((130 & (*(*LOC28).typ).flags) == 0)) goto LA29;
			localerror_165166((*n).info, ((NimStringDesc*) &TMP3971));
		}
		LA29: ;
	}
	LA24: ;
	LOC31 = 0;
	LOC31 = getident_167463(((NimStringDesc*) &TMP3972));
	threadparam = newsym_191656(((NU8) 3), LOC31, owner, (*n).info);
	LOC32 = 0;
	LOC32 = getident_167463(((NimStringDesc*) &TMP3973));
	argsparam = newsym_191656(((NU8) 3), LOC32, owner, (*n).info);
	{
		Ttype190849* ptrtype;
		ptrtype = getsystype_238030(((NU8) 26));
		asgnRefNoCycle((void**) (&(*threadparam).typ), ptrtype);
		asgnRefNoCycle((void**) (&(*argsparam).typ), ptrtype);
		(*argsparam).position = ((NI) 1);
	}
	objtype = createobj_357270(owner, (*n).info);
	(*objtype).flags |= ((NI32)1)<<((((NU8) 2))%(sizeof(NI32)*8));
	castexpr = createcastexpr_359314(argsparam, objtype);
	LOC34 = 0;
	LOC34 = getident_167463(((NimStringDesc*) &TMP3974));
	scratchobj = newsym_191656(((NU8) 8), LOC34, owner, (*n).info);
	{
		Tnode190813* varsectionb;
		Tnode190813* LOC36;
		asgnRefNoCycle((void**) (&(*scratchobj).typ), objtype);
		(*scratchobj).flags |= ((NI32)1)<<((((NU8) 2))%(sizeof(NI32)*8));
		varsectionb = newnodei_192351(((NU8) 99), (*n).info);
		LOC36 = 0;
		LOC36 = newsymnode_192325(scratchobj);
		addvar_357047(varsectionb, LOC36);
		add_191164(result, varsectionb);
	}
	call = newnodeit_192807(((NU8) 27), (*n).info, (*n).typ);
	fn = (*n).kindU.S6.sons->data[((NI) 0)];
	{
		NIM_BOOL LOC39;
		Ttype190849* argtype;
		Tnode190813* LOC43;
		Tsym190843* field;
		Tident167021* LOC44;
		Tnode190813* LOC45;
		Tnode190813* LOC46;
		Tnode190813* LOC47;
		LOC39 = 0;
		LOC39 = ((*fn).kind == ((NU8) 3));
		if (!(LOC39)) goto LA40;
		LOC39 = ((471040 &(1<<(((*(*fn).kindU.S4.sym).kind)&31)))!=0);
		LA40: ;
		if (!!(LOC39)) goto LA41;
		LOC43 = 0;
		LOC43 = HEX5BHEX5D_191244(n, ((NI) 0));
		argtype = skiptypes_194167((*LOC43).typ, IL64(211106232576256));
		LOC44 = 0;
		LOC44 = getident_167463(((NimStringDesc*) &TMP3975));
		field = newsym_191656(((NU8) 19), LOC44, owner, (*n).info);
		asgnRefNoCycle((void**) (&(*field).typ), argtype);
		addfield_357609(objtype, field);
		LOC45 = 0;
		LOC45 = newdotexpr_358008(scratchobj, field);
		LOC46 = 0;
		LOC46 = HEX5BHEX5D_191244(n, ((NI) 0));
		LOC47 = 0;
		LOC47 = newfastasgnstmt_357074(LOC45, LOC46);
		add_191164(result, LOC47);
		fn = indirectaccess_358838(castexpr, field, (*n).info);
	}
	goto LA37;
	LA41: ;
	{
		NIM_BOOL LOC49;
		LOC49 = 0;
		LOC49 = ((*fn).kind == ((NU8) 3));
		if (!(LOC49)) goto LA50;
		LOC49 = ((49152 &(1<<(((*(*fn).kindU.S4.sym).kind)&31)))!=0);
		LA50: ;
		if (!LOC49) goto LA51;
		localerror_165166((*n).info, ((NimStringDesc*) &TMP3976));
	}
	goto LA37;
	LA51: ;
	{
		if (!((*(*fn).typ).callconv == ((NU8) 8))) goto LA54;
		localerror_165166((*n).info, ((NimStringDesc*) &TMP3977));
	}
	goto LA37;
	LA54: ;
	LA37: ;
	add_191164(call, fn);
	varsection = newnodei_192351(((NU8) 99), (*n).info);
	varinit = newnodei_192351(((NU8) 115), (*n).info);
	{
		if (!barrier == 0) goto LA58;
		setupargsforconcurrency_359328(n, objtype, scratchobj, castexpr, call, varsection, varinit, result);
	}
	goto LA56;
	LA58: ;
	{
		setupargsforparallelism_359471(n, objtype, scratchobj, castexpr, call, varsection, varinit, result);
	}
	LA56: ;
	barrierasexpr = NIM_NIL;
	{
		Ttype190849* typ;
		Tsym190843* LOC65;
		Tsym190843* field;
		Tident167021* LOC66;
		Tnode190813* LOC67;
		Tnode190813* LOC68;
		if (!!((barrier == NIM_NIL))) goto LA63;
		typ = newtype_193140(((NU8) 21), owner);
		LOC65 = 0;
		LOC65 = getcompilerproc_238036(((NimStringDesc*) &TMP3981));
		rawaddson_194478(typ, (*LOC65).typ);
		LOC66 = 0;
		LOC66 = getident_167463(((NimStringDesc*) &TMP3982));
		field = newsym_191656(((NU8) 19), LOC66, owner, (*n).info);
		asgnRefNoCycle((void**) (&(*field).typ), typ);
		addfield_357609(objtype, field);
		LOC67 = 0;
		LOC67 = newdotexpr_358008(scratchobj, field);
		LOC68 = 0;
		LOC68 = newfastasgnstmt_357074(LOC67, barrier);
		add_191164(result, LOC68);
		barrierasexpr = indirectaccess_358838(castexpr, field, (*n).info);
	}
	LA63: ;
	fvfield = NIM_NIL;
	fvasexpr = NIM_NIL;
	{
		Tsym190843* field;
		Tident167021* LOC73;
		Tnode190813* LOC74;
		Tnode190813* LOC75;
		Tnode190813* LOC76;
		if (!(spawnkind == ((NU8) 1))) goto LA71;
		LOC73 = 0;
		LOC73 = getident_167463(((NimStringDesc*) &TMP3983));
		field = newsym_191656(((NU8) 19), LOC73, owner, (*n).info);
		asgnRefNoCycle((void**) (&(*field).typ), rettype);
		addfield_357609(objtype, field);
		fvfield = newdotexpr_358008(scratchobj, field);
		fvasexpr = indirectaccess_358838(castexpr, field, (*n).info);
		LOC74 = 0;
		LOC74 = HEX5BHEX5D_191244(spawnexpr, ((NI) 2));
		LOC75 = 0;
		LOC75 = callproc_358941(LOC74);
		LOC76 = 0;
		LOC76 = newfastasgnstmt_357074(fvfield, LOC75);
		add_191164(result, LOC76);
		{
			Tnode190813* LOC81;
			if (!(barrier == NIM_NIL)) goto LA79;
			LOC81 = 0;
			LOC81 = callcodegenproc_358886(((NimStringDesc*) &TMP3984), fvfield, NIM_NIL, NIM_NIL);
			add_191164(result, LOC81);
		}
		LA79: ;
	}
	goto LA69;
	LA71: ;
	{
		Tsym190843* field;
		Tident167021* LOC85;
		Tnode190813* LOC86;
		Tnode190813* LOC87;
		Tnode190813* LOC88;
		if (!(spawnkind == ((NU8) 2))) goto LA83;
		LOC85 = 0;
		LOC85 = getident_167463(((NimStringDesc*) &TMP3983));
		field = newsym_191656(((NU8) 19), LOC85, owner, (*n).info);
		asgnRefNoCycle((void**) (&(*field).typ), newtype_193140(((NU8) 21), (*objtype).owner));
		rawaddson_194478((*field).typ, rettype);
		addfield_357609(objtype, field);
		fvasexpr = indirectaccess_358838(castexpr, field, (*n).info);
		LOC86 = 0;
		LOC86 = newdotexpr_358008(scratchobj, field);
		LOC87 = 0;
		LOC87 = genaddrof_358864(dest);
		LOC88 = 0;
		LOC88 = newfastasgnstmt_357074(LOC86, LOC87);
		add_191164(result, LOC88);
	}
	goto LA69;
	LA83: ;
	LA69: ;
	wrapper = createwrapperproc_359090(fn, threadparam, argsparam, varsection, varinit, call, barrierasexpr, fvasexpr, spawnkind);
	LOC89 = 0;
	LOC89 = newsymnode_192325(wrapper);
	LOC90 = 0;
	LOC90 = newsymnode_192325(scratchobj);
	LOC91 = 0;
	LOC91 = genaddrof_358864(LOC90);
	LOC92 = 0;
	LOC92 = callcodegenproc_358886(((NimStringDesc*) &TMP3996), LOC89, LOC91, NIM_NIL);
	add_191164(result, LOC92);
	{
		if (!(spawnkind == ((NU8) 1))) goto LA95;
		add_191164(result, fvfield);
	}
	LA95: ;
	}BeforeRet: ;
	return result;
}
NIM_EXTERNC N_NOINLINE(void, nimsrc_loweringsInit)(void) {
}

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

