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

#include <string.h>
typedef struct tsym188833 tsym188833;
typedef struct tidobj167013 tidobj167013;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct ttypeseq188835 ttypeseq188835;
typedef struct ttype188837 ttype188837;
typedef struct TGenericSeq TGenericSeq;
typedef struct tscope188827 tscope188827;
typedef struct TY188933 TY188933;
typedef struct tinstantiation188823 tinstantiation188823;
typedef struct tstrtable188807 tstrtable188807;
typedef struct tsymseq188805 tsymseq188805;
typedef struct tident167019 tident167019;
typedef struct tlineinfo163527 tlineinfo163527;
typedef struct tnode188803 tnode188803;
typedef struct tloc188817 tloc188817;
typedef struct trope145007 trope145007;
typedef struct tlib188821 tlib188821;
typedef struct NimStringDesc NimStringDesc;
typedef struct tnodeseq188797 tnodeseq188797;
typedef struct TY79484 TY79484;
typedef struct tcell41090 tcell41090;
typedef struct tcellseq41106 tcellseq41106;
typedef struct tgcheap43016 tgcheap43016;
typedef struct tcellset41102 tcellset41102;
typedef struct tpagedesc41098 tpagedesc41098;
typedef struct tmemregion23410 tmemregion23410;
typedef struct tsmallchunk22638 tsmallchunk22638;
typedef struct tllchunk23404 tllchunk23404;
typedef struct tbigchunk22640 tbigchunk22640;
typedef struct tintset22615 tintset22615;
typedef struct ttrunk22611 ttrunk22611;
typedef struct tavlnode23408 tavlnode23408;
typedef struct tgcstat43014 tgcstat43014;
typedef struct toutercontext368020 toutercontext368020;
typedef struct tenv368016 tenv368016;
typedef struct tintset185047 tintset185047;
typedef struct ttrunk185043 ttrunk185043;
typedef struct ttrunkseq185045 ttrunkseq185045;
typedef struct tidtable188849 tidtable188849;
typedef struct tidpairseq188847 tidpairseq188847;
typedef struct tidpair188845 tidpair188845;
typedef struct tidnodetable188855 tidnodetable188855;
typedef struct tidnodepairseq188853 tidnodepairseq188853;
typedef struct tidnodepair188851 tidnodepair188851;
typedef struct TY368028 TY368028;
typedef struct tdep368014 tdep368014;
typedef struct tinnercontext368018 tinnercontext368018;
typedef struct TY188922 TY188922;
typedef struct tlistentry118017 tlistentry118017;
typedef struct tbasechunk22636 tbasechunk22636;
typedef struct tfreecell22628 tfreecell22628;
typedef N_NIMCALL_PTR(void, TY2289) (void* p, NI op);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY2289 marker;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  tidobj167013  {
  TNimObject Sup;
NI Id;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  tstrtable188807  {
NI Counter;
tsymseq188805* Data;
};
struct  tlineinfo163527  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
struct  tloc188817  {
NU8 K;
NU8 S;
NU8 Flags;
ttype188837* T;
trope145007* R;
trope145007* Heaproot;
NI A;
};
struct  tsym188833  {
  tidobj167013 Sup;
NU8 Kind;
union {
struct {ttypeseq188835* Typeinstcache;
tscope188827* Typscope;
} S1;
struct {TY188933* Procinstcache;
tscope188827* Scope;
} S2;
struct {TY188933* Usedgenerics;
tstrtable188807 Tab;
} S3;
} kindU;
NU16 Magic;
ttype188837* Typ;
tident167019* Name;
tlineinfo163527 Info;
tsym188833* Owner;
NU32 Flags;
tnode188803* Ast;
NU32 Options;
NI Position;
NI Offset;
tloc188817 Loc;
tlib188821* Annex;
tnode188803* Constraint;
};
struct  ttype188837  {
  tidobj167013 Sup;
NU8 Kind;
NU8 Callconv;
NU32 Flags;
ttypeseq188835* Sons;
tnode188803* N;
tsym188833* Destructor;
tsym188833* Owner;
tsym188833* Sym;
NI64 Size;
NI Align;
tloc188817 Loc;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  tnode188803  {
ttype188837* Typ;
tlineinfo163527 Info;
NU16 Flags;
NU8 Kind;
union {
struct {NI64 Intval;
} S1;
struct {NF Floatval;
} S2;
struct {NimStringDesc* Strval;
} S3;
struct {tsym188833* Sym;
} S4;
struct {tident167019* Ident;
} S5;
struct {tnodeseq188797* Sons;
} S6;
} kindU;
NimStringDesc* Comment;
};
struct TY79484 {
NimStringDesc* Field0;
NI Field1;
};
struct  tcell41090  {
NI Refcount;
TNimType* Typ;
};
struct  tcellseq41106  {
NI Len;
NI Cap;
tcell41090** D;
};
struct  tcellset41102  {
NI Counter;
NI Max;
tpagedesc41098* Head;
tpagedesc41098** Data;
};
typedef tsmallchunk22638* TY23422[512];
typedef ttrunk22611* ttrunkbuckets22613[256];
struct  tintset22615  {
ttrunkbuckets22613 Data;
};
struct  tmemregion23410  {
NI Minlargeobj;
NI Maxlargeobj;
TY23422 Freesmallchunks;
tllchunk23404* Llmem;
NI Currmem;
NI Maxmem;
NI Freemem;
NI Lastsize;
tbigchunk22640* Freechunkslist;
tintset22615 Chunkstarts;
tavlnode23408* Root;
tavlnode23408* Deleted;
tavlnode23408* Last;
tavlnode23408* Freeavlnodes;
};
struct  tgcstat43014  {
NI Stackscans;
NI Cyclecollections;
NI Maxthreshold;
NI Maxstacksize;
NI Maxstackcells;
NI Cycletablesize;
NI64 Maxpause;
};
struct  tgcheap43016  {
void* Stackbottom;
NI Cyclethreshold;
tcellseq41106 Zct;
tcellseq41106 Decstack;
tcellset41102 Cycleroots;
tcellseq41106 Tempstack;
NI Recgclock;
tmemregion23410 Region;
tgcstat43014 Stat;
};
struct  tintset185047  {
NI Counter;
NI Max;
ttrunk185043* Head;
ttrunkseq185045* Data;
};
struct  tidpair188845  {
tidobj167013* Key;
TNimObject* Val;
};
struct  tidtable188849  {
NI Counter;
tidpairseq188847* Data;
};
struct  tidnodepair188851  {
tidobj167013* Key;
tnode188803* Val;
};
struct  tidnodetable188855  {
NI Counter;
tidnodepairseq188853* Data;
};
struct  toutercontext368020  {
tsym188833* Fn;
tenv368016* Currentenv;
NIM_BOOL Isiter;
tintset185047 Capturedvars;
tintset185047 Processed;
tidtable188849 Localstoenv;
tidnodetable188855 Localstoaccess;
tidtable188849 Lambdastoenv;
toutercontext368020* Up;
tsym188833* Closureparam;
tsym188833* State;
tsym188833* Resultsym;
ttype188837* Obj;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct tdep368014 {
tenv368016* Field0;
tsym188833* Field1;
};
struct  tenv368016  {
  TNimObject Sup;
tnode188803* Attachednode;
tsym188833* Createdvar;
NIM_BOOL Createdvarcomesfromiter;
tsymseq188805* Capturedvars;
TY368028* Deps;
tenv368016* Up;
ttype188837* Obj;
};
struct  tident167019  {
  tidobj167013 Sup;
NimStringDesc* S;
tident167019* Next;
NI H;
};
struct  tinnercontext368018  {
tsym188833* Fn;
tsym188833* Closureparam;
tidnodetable188855 Localstoaccess;
};
struct  tscope188827  {
NI Depthlevel;
tstrtable188807 Symbols;
tnodeseq188797* Usingsyms;
tscope188827* Parent;
};
struct  tinstantiation188823  {
tsym188833* Sym;
ttypeseq188835* Concretetypes;
TY188922* Usedby;
};
struct  trope145007  {
  TNimObject Sup;
trope145007* Left;
trope145007* Right;
NI Length;
NimStringDesc* Data;
};
struct  tlistentry118017  {
  TNimObject Sup;
tlistentry118017* Prev;
tlistentry118017* Next;
};
struct  tlib188821  {
  tlistentry118017 Sup;
NU8 Kind;
NIM_BOOL Generated;
NIM_BOOL Isoverriden;
trope145007* Name;
tnode188803* Path;
};
typedef NI TY22618[16];
struct  tpagedesc41098  {
tpagedesc41098* Next;
NI Key;
TY22618 Bits;
};
struct  tbasechunk22636  {
NI Prevsize;
NI Size;
NIM_BOOL Used;
};
struct  tsmallchunk22638  {
  tbasechunk22636 Sup;
tsmallchunk22638* Next;
tsmallchunk22638* Prev;
tfreecell22628* Freelist;
NI Free;
NI Acc;
NF Data;
};
struct  tllchunk23404  {
NI Size;
NI Acc;
tllchunk23404* Next;
};
struct  tbigchunk22640  {
  tbasechunk22636 Sup;
tbigchunk22640* Next;
tbigchunk22640* Prev;
NI Align;
NF Data;
};
struct  ttrunk22611  {
ttrunk22611* Next;
NI Key;
TY22618 Bits;
};
typedef tavlnode23408* TY23414[2];
struct  tavlnode23408  {
TY23414 Link;
NI Key;
NI Upperbound;
NI Level;
};
struct  ttrunk185043  {
ttrunk185043* Next;
NI Key;
TY22618 Bits;
};
struct  tfreecell22628  {
tfreecell22628* Next;
NI Zerofield;
};
struct ttypeseq188835 {
  TGenericSeq Sup;
  ttype188837* data[SEQ_DECL_SIZE];
};
struct TY188933 {
  TGenericSeq Sup;
  tinstantiation188823* data[SEQ_DECL_SIZE];
};
struct tsymseq188805 {
  TGenericSeq Sup;
  tsym188833* data[SEQ_DECL_SIZE];
};
struct tnodeseq188797 {
  TGenericSeq Sup;
  tnode188803* data[SEQ_DECL_SIZE];
};
struct ttrunkseq185045 {
  TGenericSeq Sup;
  ttrunk185043* data[SEQ_DECL_SIZE];
};
struct tidpairseq188847 {
  TGenericSeq Sup;
  tidpair188845 data[SEQ_DECL_SIZE];
};
struct tidnodepairseq188853 {
  TGenericSeq Sup;
  tidnodepair188851 data[SEQ_DECL_SIZE];
};
struct TY368028 {
  TGenericSeq Sup;
  tdep368014 data[SEQ_DECL_SIZE];
};
struct TY188922 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
static N_INLINE(NIM_BOOL, interestingvar_369403)(tsym188833* s);
N_NIMCALL(NIM_BOOL, isgenericroutine_194927)(tsym188833* s);
static N_INLINE(NI, len_189264)(tnode188803* n);
static N_INLINE(tnode188803*, HEX5BHEX5D_189694)(tnode188803* n, NI i);
N_NIMCALL(void, internalerror_165606)(NimStringDesc* errmsg);
N_NIMCALL(NimStringDesc*, HEX24_165714)(TY79484 x_165718);
N_NIMCALL(tnode188803*, newnodei_189099)(NU8 kind, tlineinfo163527 info);
N_NIMCALL(tsym188833*, copysym_189147)(tsym188833* s, NIM_BOOL keepid);
N_NIMCALL(tsym188833*, gethiddenparam_368150)(tsym188833* routine);
static N_INLINE(tnode188803*, lastson_189189)(tnode188803* n);
static N_INLINE(NI, sonslen_189181)(tnode188803* n);
N_NIMCALL(void, addvar_366036)(tnode188803* father, tnode188803* v);
N_NIMCALL(tnode188803*, newsymnode_189095)(tsym188833* sym);
N_NIMCALL(void, add_189390)(tnode188803* father, tnode188803* son);
N_NIMCALL(tnode188803*, newcall_369028)(tsym188833* a, tsym188833* b);
N_NIMCALL(tsym188833*, getsyssym_242040)(NimStringDesc* name);
N_NIMCALL(tnode188803*, newnodei_190803)(NU8 kind, tlineinfo163527 info, NI children);
N_NIMCALL(tnode188803*, newinttypenode_189074)(NU8 kind, NI64 intval, ttype188837* typ);
N_NIMCALL(ttype188837*, getsystype_242024)(NU8 kind);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
static N_INLINE(tcell41090*, usrtocell_44443)(void* usr);
static N_INLINE(void, rtladdzct_46002)(tcell41090* c);
N_NOINLINE(void, addzct_44418)(tcellseq41106* s, tcell41090* c);
N_NIMCALL(void, addson_189207)(tnode188803* father, tnode188803* son);
N_NIMCALL(tnode188803*, makeclosure_369738)(tsym188833* prc, tsym188833* env, tlineinfo163527 info);
N_NIMCALL(tnode188803*, newnodeit_189104)(NU8 kind, tlineinfo163527 info, ttype188837* typ);
N_NIMCALL(toutercontext368020*, newoutercontext_368435)(tsym188833* fn, toutercontext368020* up);
N_NIMCALL(void, nimGCvisit)(void* d, NI op);
N_NIMCALL(void, TMP2973)(void* p, NI op);
N_NIMCALL(void, TMP2974)(void* p, NI op);
N_NIMCALL(void, TMP2975)(void* p, NI op);
N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
N_NIMCALL(void, initintset_185918)(tintset185047* Result);
N_NIMCALL(void, initidnodetable_189130)(tidnodetable188855* x);
N_NIMCALL(void, initidtable_189120)(tidtable188849* x);
N_NIMCALL(void, inititercontext_368276)(toutercontext368020* c, tsym188833* iter);
N_NIMCALL(tsym188833*, getenvparam_368217)(tsym188833* routine);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(ttype188837*, createobj_366252)(tsym188833* owner, tlineinfo163527 info);
N_NIMCALL(tsym188833*, newsym_189053)(NU8 symkind, tident167019* name, tsym188833* owner, tlineinfo163527 info);
N_NIMCALL(tident167019*, getident_167456)(NimStringDesc* identifier);
N_NIMCALL(ttype188837*, newtype_189060)(NU8 kind, tsym188833* owner);
N_NIMCALL(void, rawaddson_193092)(ttype188837* father, ttype188837* son);
N_NIMCALL(void, addhiddenparam_368113)(tsym188833* routine, tsym188833* param);
N_NIMCALL(tsym188833*, createstatefield_368056)(tsym188833* iter);
N_NIMCALL(ttype188837*, getstatetype_368049)(tsym188833* iter);
N_NIMCALL(tnode188803*, newintnode_189069)(NU8 kind, NI64 intval);
N_NIMCALL(void, addfield_366275)(ttype188837* obj, tsym188833* s);
N_NIMCALL(tsym188833*, newiterresult_368062)(tsym188833* iter);
N_NIMCALL(tnode188803*, closurecreationpoint_370312)(tnode188803* n);
N_NIMCALL(tenv368016*, newenv_368493)(tsym188833* outerproc, tenv368016* up, tnode188803* n);
static N_INLINE(void, nimGCunref)(void* p);
static N_INLINE(void, decref_46402)(tcell41090* c);
static N_INLINE(NIM_BOOL, canbecycleroot_44462)(tcell41090* c);
static N_INLINE(void, rtladdcycleroot_45235)(tcell41090* c);
N_NOINLINE(void, incl_41855)(tcellset41102* s, tcell41090* cell);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incref_46827)(tcell41090* c);
N_NIMCALL(void, internalerror_165591)(tlineinfo163527 info, NimStringDesc* errmsg);
N_NIMCALL(void, idtableput_197147)(tidtable188849* t, tidobj167013* key, TNimObject* val);
N_NIMCALL(void, searchforinnerprocs_370318)(toutercontext368020* o, tnode188803* n);
static N_INLINE(NIM_BOOL, isinnerproc_369035)(tsym188833* s, tsym188833* outerproc);
N_NIMCALL(tsym188833*, skipgenericowner_194972)(tsym188833* s);
N_NIMCALL(NIM_BOOL, containsorincl_185888)(tintset185047* s, NI key);
N_NIMCALL(tinnercontext368018*, newinnercontext_368470)(tsym188833* fn);
N_NIMCALL(void, TMP2983)(void* p, NI op);
N_NIMCALL(tnode188803*, getbody_239244)(tsym188833* s);
N_NIMCALL(void, gathervars_369468)(toutercontext368020* o, tinnercontext368018* i, tnode188803* n);
N_NIMCALL(void, capturevar_369274)(toutercontext368020* o, tinnercontext368018* i, tsym188833* local, tlineinfo163527 info);
N_NIMCALL(TNimObject*, idtableget_197137)(tidtable188849 t, tidobj167013* key);
static N_INLINE(NIM_BOOL, illegalcapture_369245)(tsym188833* s);
N_NIMCALL(ttype188837*, skiptypes_192793)(ttype188837* t, NU64 kinds);
N_NIMCALL(void, localerror_165571)(tlineinfo163527 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(tnode188803*, idnodetableget_197159)(tidnodetable188855 t, tidobj167013* key);
N_NIMCALL(void, addclosureparam_369072)(tinnercontext368018* i, tenv368016* e);
N_NIMCALL(void, addcapturedvar_368557)(tenv368016* e, tsym188833* v);
N_NIMCALL(TGenericSeq*, incrSeq)(TGenericSeq* seq, NI elemsize);
N_NIMCALL(tnode188803*, indirectaccess_366403)(tnode188803* a, tsym188833* b, tlineinfo163527 info);
N_NIMCALL(tsym188833*, adddep_368616)(tenv368016* e, tenv368016* d, tsym188833* owner);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(void, incl_185849)(tintset185047* s, NI key);
N_NIMCALL(void, idnodetableput_197164)(tidnodetable188855* t, tidobj167013* key, tnode188803* val);
N_NIMCALL(void, dummyclosureparam_369203)(toutercontext368020* o, tinnercontext368018* i);
N_NIMCALL(tnode188803*, transforminnerproc_369763)(toutercontext368020* o, tinnercontext368018* i, tnode188803* n);
N_NIMCALL(tnode188803*, liftiterator_372480)(toutercontext368020* c, tnode188803* body);
N_NIMCALL(tnode188803*, transformouterproc_371261)(toutercontext368020* o, tnode188803* n);
static N_INLINE(NIM_BOOL, interestingitervar_371228)(tsym188833* s);
N_NIMCALL(void, message_165584)(tlineinfo163527 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(tnode188803*, liftitersym_371505)(tnode188803* n);
N_NIMCALL(tsym188833*, generateiterclosurecreation_371020)(toutercontext368020* o, tenv368016* env, tnode188803* scope);
N_NIMCALL(tsym188833*, newclosurecreationvar_370894)(toutercontext368020* o, tenv368016* e);
N_NIMCALL(tnode188803*, rawclosurecreation_370941)(toutercontext368020* o, tenv368016* scope, tsym188833* env);
N_NIMCALL(tnode188803*, indirectaccess_366803)(tsym188833* a, tsym188833* b, tlineinfo163527 info);
N_NIMCALL(tnode188803*, newasgnstmt_370858)(tnode188803* le, tnode188803* ri, tlineinfo163527 info);
N_NIMCALL(tsym188833*, getclosurevar_370917)(toutercontext368020* o, tenv368016* e);
N_NIMCALL(tnode188803*, generateclosurecreation_371012)(toutercontext368020* o, tenv368016* scope);
N_NIMCALL(NIM_BOOL, contains_185821)(tintset185047 s, NI key);
N_NIMCALL(tnode188803*, transformouterconv_369675)(tnode188803* n);
N_NIMCALL(tnode188803*, generatethunk_369658)(tnode188803* prc, ttype188837* dest);
N_NIMCALL(tnode188803*, transformyield_371266)(toutercontext368020* c, tnode188803* n);
N_NIMCALL(void, outerprocsons_371435)(toutercontext368020* o, tnode188803* n);
N_NIMCALL(tnode188803*, transformreturn_371427)(toutercontext368020* c, tnode188803* n);
STRING_LITERAL(TMP2945, "compiler/lambdalifting.nim", 26);
NIM_CONST TY79484 TMP2944 = {((NimStringDesc*) &TMP2945),
807}
;
STRING_LITERAL(TMP2946, "internalNew", 11);
STRING_LITERAL(TMP2976, ":env", 4);
STRING_LITERAL(TMP2977, ":state", 6);
STRING_LITERAL(TMP2978, ":result", 7);
STRING_LITERAL(TMP2979, "liftLambdas: strange params", 27);
STRING_LITERAL(TMP2984, ":up", 3);
STRING_LITERAL(TMP2985, "no environment computed", 23);
STRING_LITERAL(TMP2986, "too complex environment handling required", 41);
STRING_LITERAL(TMP2987, "transformOuter", 14);
extern tgcheap43016 gch_43044;
extern tnode188803* emptynode_189727;
extern NU8 gcmd_137113;
TNimType NTI368020; /* TOuterContext */
extern TNimType NTI188801; /* PSym */
extern TNimType NTI2409; /* TObject */
TNimType NTI368016; /* TEnv */
extern TNimType NTI188795; /* PNode */
extern TNimType NTI134; /* bool */
extern TNimType NTI188805; /* TSymSeq */
TNimType NTI368014; /* TDep */
TNimType NTI368028; /* seq[TDep] */
extern TNimType NTI188799; /* PType */
TNimType NTI368012; /* PEnv */
extern TNimType NTI185047; /* TIntSet */
extern TNimType NTI188849; /* TIdTable */
extern TNimType NTI188855; /* TIdNodeTable */
TNimType NTI368010; /* POuterContext */
TNimType NTI368018; /* TInnerContext */
TNimType NTI368008; /* PInnerContext */

static N_INLINE(NIM_BOOL, interestingvar_369403)(tsym188833* s) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = ((2100008 &(1<<(((*s).Kind)&31)))!=0);
	if (!(LOC1)) goto LA2;
	LOC1 = !((((*s).Flags &(1<<((((NU8) 3))&31)))!=0));
	LA2: ;
	result = LOC1;
	return result;
}

N_NIMCALL(void, semcapturesym_369436)(tsym188833* s, tsym188833* owner) {
	{
		NIM_BOOL LOC3;
		NIM_BOOL LOC4;
		LOC3 = 0;
		LOC4 = 0;
		LOC4 = interestingvar_369403(s);
		if (!(LOC4)) goto LA5;
		LOC4 = !(((*owner).Sup.Id == (*(*s).Owner).Sup.Id));
		LA5: ;
		LOC3 = LOC4;
		if (!(LOC3)) goto LA6;
		LOC3 = !(((*s).Kind == ((NU8) 11)));
		LA6: ;
		if (!LOC3) goto LA7;
		{
			NIM_BOOL LOC11;
			NIM_BOOL LOC13;
			LOC11 = 0;
			LOC11 = !(((*owner).Typ == NIM_NIL));
			if (!(LOC11)) goto LA12;
			LOC13 = 0;
			LOC13 = isgenericroutine_194927(owner);
			LOC11 = !(LOC13);
			LA12: ;
			if (!LOC11) goto LA14;
			(*(*owner).Typ).Callconv = ((NU8) 8);
		}
		LA14: ;
	}
	LA7: ;
}

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

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

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

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

N_NIMCALL(tsym188833*, gethiddenparam_368150)(tsym188833* routine) {
	tsym188833* result;
	tnode188803* params;
	tnode188803* hidden;
	result = 0;
	params = (*(*routine).Ast).kindU.S6.Sons->data[3];
	hidden = lastson_189189(params);
	result = (*hidden).kindU.S4.Sym;
	return result;
}

N_NIMCALL(tnode188803*, newcall_369028)(tsym188833* a, tsym188833* b) {
	tnode188803* result;
	tnode188803* LOC1;
	tnode188803* LOC2;
	result = 0;
	result = newnodei_189099(((NU8) 27), (*a).Info);
	LOC1 = 0;
	LOC1 = newsymnode_189095(a);
	add_189390(result, LOC1);
	LOC2 = 0;
	LOC2 = newsymnode_189095(b);
	add_189390(result, LOC2);
	return result;
}

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

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

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

N_NIMCALL(tnode188803*, makeclosure_369738)(tsym188833* prc, tsym188833* env, tlineinfo163527 info) {
	tnode188803* result;
	tnode188803* LOC1;
	result = 0;
	result = newnodeit_189104(((NU8) 153), info, (*prc).Typ);
	LOC1 = 0;
	LOC1 = newsymnode_189095(prc);
	add_189390(result, LOC1);
	{
		ttype188837* LOC6;
		tnode188803* LOC7;
		if (!(env == NIM_NIL)) goto LA4;
		LOC6 = 0;
		LOC6 = getsystype_242024(((NU8) 5));
		LOC7 = 0;
		LOC7 = newnodeit_189104(((NU8) 23), info, LOC6);
		add_189390(result, LOC7);
	}
	goto LA2;
	LA4: ;
	{
		tnode188803* LOC9;
		LOC9 = 0;
		LOC9 = newsymnode_189095(env);
		add_189390(result, LOC9);
	}
	LA2: ;
	return result;
}

N_NIMCALL(tnode188803*, liftforloop_372699)(tnode188803* body) {
	tnode188803* result;
	NI l;
	tnode188803* call;
	tsym188833* env;
	tnode188803* loopbody;
	tnode188803* whileloop;
	ttype188837* LOC22;
	tnode188803* v2;
	tnode188803* vpart;
	NU8 LOC23;
	NI i_373044;
	NI HEX3Atmp_373326;
	NI res_373328;
	tnode188803* bs;
	result = 0;
	l = len_189264(body);
	{
		NIM_BOOL LOC3;
		tnode188803* LOC5;
		NimStringDesc* LOC8;
		LOC3 = 0;
		LOC3 = ((*body).Kind == ((NU8) 94));
		if (!(LOC3)) goto LA4;
		LOC5 = 0;
		LOC5 = HEX5BHEX5D_189694(body, (NI32)(l - 2));
		LOC3 = ((*LOC5).Kind == ((NU8) 27) || (*LOC5).Kind == ((NU8) 29) || (*LOC5).Kind == ((NU8) 30) || (*LOC5).Kind == ((NU8) 31) || (*LOC5).Kind == ((NU8) 26) || (*LOC5).Kind == ((NU8) 28) || (*LOC5).Kind == ((NU8) 32));
		LA4: ;
		if (!!(LOC3)) goto LA6;
		LOC8 = 0;
		LOC8 = HEX24_165714(TMP2944);
		internalerror_165606(LOC8);
	}
	LA6: ;
	call = HEX5BHEX5D_189694(body, (NI32)(l - 2));
	result = newnodei_189099(((NU8) 114), (*body).Info);
	env = 0;
	{
		NIM_BOOL LOC11;
		tnode188803* LOC12;
		tnode188803* LOC14;
		tsym188833* iter;
		tnode188803* LOC17;
		tsym188833* LOC18;
		tnode188803* v;
		tnode188803* LOC19;
		tsym188833* LOC20;
		tnode188803* LOC21;
		LOC11 = 0;
		LOC12 = 0;
		LOC12 = HEX5BHEX5D_189694(call, 0);
		LOC11 = ((*LOC12).Kind == ((NU8) 3));
		if (!(LOC11)) goto LA13;
		LOC14 = 0;
		LOC14 = HEX5BHEX5D_189694(call, 0);
		LOC11 = ((*(*LOC14).kindU.S4.Sym).Kind == ((NU8) 15));
		LA13: ;
		if (!LOC11) goto LA15;
		LOC17 = 0;
		LOC17 = HEX5BHEX5D_189694(call, 0);
		iter = (*LOC17).kindU.S4.Sym;
		LOC18 = 0;
		LOC18 = gethiddenparam_368150(iter);
		env = copysym_189147(LOC18, NIM_FALSE);
		v = newnodei_189099(((NU8) 99), (*body).Info);
		LOC19 = 0;
		LOC19 = newsymnode_189095(env);
		addvar_366036(v, LOC19);
		add_189390(result, v);
		LOC20 = 0;
		LOC20 = getsyssym_242040(((NimStringDesc*) &TMP2946));
		LOC21 = 0;
		LOC21 = newcall_369028(LOC20, env);
		add_189390(result, LOC21);
	}
	LA15: ;
	loopbody = newnodei_190803(((NU8) 114), (*body).Info, 3);
	whileloop = newnodei_190803(((NU8) 96), (*body).Info, 2);
	LOC22 = 0;
	LOC22 = getsystype_242024(((NU8) 1));
	asgnRefNoCycle((void**) &(*whileloop).kindU.S6.Sons->data[0], newinttypenode_189074(((NU8) 6), 1, LOC22));
	asgnRefNoCycle((void**) &(*whileloop).kindU.S6.Sons->data[1], loopbody);
	add_189390(result, whileloop);
	v2 = newnodei_189099(((NU8) 100), (*body).Info);
	LOC23 = 0;
	{
		if (!(l == 3)) goto LA26;
		LOC23 = ((NU8) 35);
	}
	goto LA24;
	LA26: ;
	{
		LOC23 = ((NU8) 36);
	}
	LA24: ;
	vpart = newnodei_189099(LOC23, (*body).Info);
	i_373044 = 0;
	HEX3Atmp_373326 = 0;
	HEX3Atmp_373326 = (NI32)(l - 3);
	res_373328 = 0;
	while (1) {
		tnode188803* LOC30;
		tnode188803* LOC31;
		if (!(res_373328 <= HEX3Atmp_373326)) goto LA29;
		i_373044 = res_373328;
		LOC30 = 0;
		LOC30 = HEX5BHEX5D_189694(body, i_373044);
		(*(*LOC30).kindU.S4.Sym).Kind = ((NU8) 9);
		LOC31 = 0;
		LOC31 = HEX5BHEX5D_189694(body, i_373044);
		addson_189207(vpart, LOC31);
		res_373328 += 1;
	} LA29: ;
	addson_189207(vpart, emptynode_189727);
	{
		if (!!(env == 0)) goto LA34;
		asgnRefNoCycle((void**) &(*call).kindU.S6.Sons->data[0], makeclosure_369738((*(*call).kindU.S6.Sons->data[0]).kindU.S4.Sym, env, (*body).Info));
	}
	LA34: ;
	addson_189207(vpart, call);
	addson_189207(v2, vpart);
	asgnRefNoCycle((void**) &(*loopbody).kindU.S6.Sons->data[0], v2);
	bs = newnodei_189099(((NU8) 156), (*body).Info);
	addson_189207(bs, (*call).kindU.S6.Sons->data[0]);
	asgnRefNoCycle((void**) &(*loopbody).kindU.S6.Sons->data[1], bs);
	asgnRefNoCycle((void**) &(*loopbody).kindU.S6.Sons->data[2], HEX5BHEX5D_189694(body, (NI32)(l - 1)));
	return result;
}
N_NIMCALL(void, TMP2973)(void* p, NI op) {
	TY368028* a;
	NI LOC1;
	a = (TY368028*)p;
	LOC1 = 0;
	for (LOC1 = 0; LOC1 < a->Sup.len; LOC1++) {
	nimGCvisit((void*)a->data[LOC1].Field0, op);
	nimGCvisit((void*)a->data[LOC1].Field1, op);
	}
}
N_NIMCALL(void, TMP2974)(void* p, NI op) {
	tenv368016* a;
	a = (tenv368016*)p;
	nimGCvisit((void*)(*a).Attachednode, op);
	nimGCvisit((void*)(*a).Createdvar, op);
	nimGCvisit((void*)(*a).Capturedvars, op);
	nimGCvisit((void*)(*a).Deps, op);
	nimGCvisit((void*)(*a).Up, op);
	nimGCvisit((void*)(*a).Obj, op);
}
N_NIMCALL(void, TMP2975)(void* p, NI op) {
	toutercontext368020* a;
	a = (toutercontext368020*)p;
	nimGCvisit((void*)(*a).Fn, op);
	nimGCvisit((void*)(*a).Currentenv, op);
	nimGCvisit((void*)(*a).Capturedvars.Head, op);
	nimGCvisit((void*)(*a).Capturedvars.Data, op);
	nimGCvisit((void*)(*a).Processed.Head, op);
	nimGCvisit((void*)(*a).Processed.Data, op);
	nimGCvisit((void*)(*a).Localstoenv.Data, op);
	nimGCvisit((void*)(*a).Localstoaccess.Data, op);
	nimGCvisit((void*)(*a).Lambdastoenv.Data, op);
	nimGCvisit((void*)(*a).Up, op);
	nimGCvisit((void*)(*a).Closureparam, op);
	nimGCvisit((void*)(*a).State, op);
	nimGCvisit((void*)(*a).Resultsym, op);
	nimGCvisit((void*)(*a).Obj, op);
}

static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b) {
	NIM_BOOL result;
	NIM_BOOL LOC11;
	int LOC13;
	result = 0;
	{
		if (!(a == b)) goto LA3;
		result = NIM_TRUE;
		goto BeforeRet;
	}
	LA3: ;
	{
		NIM_BOOL LOC7;
		LOC7 = 0;
		LOC7 = (a == NIM_NIL);
		if (LOC7) goto LA8;
		LOC7 = (b == NIM_NIL);
		LA8: ;
		if (!LOC7) goto LA9;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA9: ;
	LOC11 = 0;
	LOC11 = ((*a).Sup.len == (*b).Sup.len);
	if (!(LOC11)) goto LA12;
	LOC13 = 0;
	LOC13 = memcmp(((NCSTRING) ((*a).data)), ((NCSTRING) ((*b).data)), (NI32)((*a).Sup.len * 1));
	LOC11 = (LOC13 == ((NI32) 0));
	LA12: ;
	result = LOC11;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(tsym188833*, getenvparam_368217)(tsym188833* routine) {
	tsym188833* result;
	tnode188803* params;
	tnode188803* hidden;
	result = 0;
	params = (*(*routine).Ast).kindU.S6.Sons->data[3];
	hidden = lastson_189189(params);
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = ((*hidden).Kind == ((NU8) 3));
		if (!(LOC3)) goto LA4;
		LOC3 = eqStrings((*(*(*hidden).kindU.S4.Sym).Name).S, ((NimStringDesc*) &TMP2976));
		LA4: ;
		if (!LOC3) goto LA5;
		result = (*hidden).kindU.S4.Sym;
	}
	LA5: ;
	return result;
}

N_NIMCALL(void, addhiddenparam_368113)(tsym188833* routine, tsym188833* param) {
	tnode188803* params;
	NI LOC1;
	tnode188803* LOC2;
	params = (*(*routine).Ast).kindU.S6.Sons->data[3];
	LOC1 = 0;
	LOC1 = len_189264(params);
	(*param).Position = (NI32)(LOC1 - 1);
	LOC2 = 0;
	LOC2 = newsymnode_189095(param);
	addson_189207(params, LOC2);
	(*(*routine).Typ).Flags |=((NI32)(1)<<((((NU8) 11))%(sizeof(NI32)*8)));
}

N_NIMCALL(ttype188837*, getstatetype_368049)(tsym188833* iter) {
	ttype188837* result;
	tnode188803* n;
	tnode188803* LOC1;
	tnode188803* LOC2;
	ttype188837* LOC3;
	result = 0;
	n = newnodei_189099(((NU8) 44), (*iter).Info);
	LOC1 = 0;
	LOC1 = newintnode_189069(((NU8) 6), -1);
	addson_189207(n, LOC1);
	LOC2 = 0;
	LOC2 = newintnode_189069(((NU8) 6), 0);
	addson_189207(n, LOC2);
	result = newtype_189060(((NU8) 20), iter);
	asgnRefNoCycle((void**) &(*result).N, n);
	LOC3 = 0;
	LOC3 = getsystype_242024(((NU8) 31));
	rawaddson_193092(result, LOC3);
	return result;
}

N_NIMCALL(tsym188833*, createstatefield_368056)(tsym188833* iter) {
	tsym188833* result;
	tident167019* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = getident_167456(((NimStringDesc*) &TMP2977));
	result = newsym_189053(((NU8) 19), LOC1, iter, (*iter).Info);
	asgnRefNoCycle((void**) &(*result).Typ, getstatetype_368049(iter));
	return result;
}

N_NIMCALL(tsym188833*, newiterresult_368062)(tsym188833* iter) {
	tsym188833* result;
	result = 0;
	{
		NI LOC3;
		LOC3 = 0;
		LOC3 = len_189264((*iter).Ast);
		if (!(7 < LOC3)) goto LA4;
		result = (*(*(*iter).Ast).kindU.S6.Sons->data[7]).kindU.S4.Sym;
	}
	goto LA1;
	LA4: ;
	{
		tident167019* LOC7;
		tnode188803* LOC8;
		LOC7 = 0;
		LOC7 = getident_167456(((NimStringDesc*) &TMP2978));
		result = newsym_189053(((NU8) 11), LOC7, iter, (*iter).Info);
		asgnRefNoCycle((void**) &(*result).Typ, (*(*iter).Typ).Sons->data[0]);
		(*result).Flags |=((NI32)(1)<<((((NU8) 0))%(sizeof(NI32)*8)));
		LOC8 = 0;
		LOC8 = newsymnode_189095(result);
		add_189390((*iter).Ast, LOC8);
	}
	LA1: ;
	return result;
}

N_NIMCALL(void, inititercontext_368276)(toutercontext368020* c, tsym188833* iter) {
	tsym188833* cp;
	asgnRefNoCycle((void**) &(*c).Fn, iter);
	initintset_185918(&(*c).Capturedvars);
	cp = getenvparam_368217(iter);
	{
		tident167019* LOC5;
		if (!(cp == NIM_NIL)) goto LA3;
		asgnRefNoCycle((void**) &(*c).Obj, createobj_366252(iter, (*iter).Info));
		LOC5 = 0;
		LOC5 = getident_167456(((NimStringDesc*) &TMP2976));
		cp = newsym_189053(((NU8) 3), LOC5, iter, (*iter).Info);
		(*cp).Flags |=((NI32)(1)<<((((NU8) 2))%(sizeof(NI32)*8)));
		asgnRefNoCycle((void**) &(*cp).Typ, newtype_189060(((NU8) 22), iter));
		rawaddson_193092((*cp).Typ, (*c).Obj);
		addhiddenparam_368113(iter, cp);
		asgnRefNoCycle((void**) &(*c).State, createstatefield_368056(iter));
		addfield_366275((*c).Obj, (*c).State);
	}
	goto LA1;
	LA3: ;
	{
		asgnRefNoCycle((void**) &(*c).Obj, (*(*cp).Typ).Sons->data[0]);
		{
			NI LOC9;
			tnode188803* LOC12;
			LOC9 = 0;
			LOC9 = len_189264((*(*c).Obj).N);
			if (!(0 < LOC9)) goto LA10;
			LOC12 = 0;
			LOC12 = HEX5BHEX5D_189694((*(*c).Obj).N, 0);
			asgnRefNoCycle((void**) &(*c).State, (*LOC12).kindU.S4.Sym);
		}
		goto LA7;
		LA10: ;
		{
			asgnRefNoCycle((void**) &(*c).State, createstatefield_368056(iter));
			addfield_366275((*c).Obj, (*c).State);
		}
		LA7: ;
	}
	LA1: ;
	asgnRefNoCycle((void**) &(*c).Closureparam, cp);
	{
		if (!!(((*(*iter).Typ).Sons->data[0] == NIM_NIL))) goto LA16;
		asgnRefNoCycle((void**) &(*c).Resultsym, newiterresult_368062(iter));
	}
	LA16: ;
}

N_NIMCALL(toutercontext368020*, newoutercontext_368435)(tsym188833* fn, toutercontext368020* up) {
	toutercontext368020* result;
	result = 0;
	result = (toutercontext368020*) newObj((&NTI368010), sizeof(toutercontext368020));
	asgnRefNoCycle((void**) &(*result).Fn, fn);
	initintset_185918(&(*result).Capturedvars);
	initintset_185918(&(*result).Processed);
	initidnodetable_189130(&(*result).Localstoaccess);
	initidtable_189120(&(*result).Localstoenv);
	initidtable_189120(&(*result).Lambdastoenv);
	(*result).Isiter = ((*fn).Kind == ((NU8) 15));
	{
		if (!(*result).Isiter) goto LA3;
		inititercontext_368276(result, fn);
	}
	LA3: ;
	return result;
}

N_NIMCALL(tnode188803*, closurecreationpoint_370312)(tnode188803* n) {
	tnode188803* result;
	result = 0;
	result = newnodei_189099(((NU8) 114), (*n).Info);
	add_189390(result, emptynode_189727);
	add_189390(result, n);
	return result;
}

static N_INLINE(NIM_BOOL, canbecycleroot_44462)(tcell41090* c) {
	NIM_BOOL result;
	result = 0;
	result = !((((*(*c).Typ).flags &(1<<((((NU8) 1))&7)))!=0));
	return result;
}

static N_INLINE(void, rtladdcycleroot_45235)(tcell41090* c) {
	{
		if (!!((((NI) ((NI)((*c).Refcount & 3))) == 3))) goto LA3;
		(*c).Refcount = (NI)((NI)((*c).Refcount & -4) | 3);
		incl_41855(&gch_43044.Cycleroots, c);
	}
	LA3: ;
}

static N_INLINE(void, decref_46402)(tcell41090* c) {
	{
		(*c).Refcount -= 8;
		if (!((NU32)((*c).Refcount) < (NU32)(8))) goto LA3;
		rtladdzct_46002(c);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = canbecycleroot_44462(c);
		if (!LOC6) goto LA7;
		rtladdcycleroot_45235(c);
	}
	goto LA1;
	LA7: ;
	LA1: ;
}

static N_INLINE(void, nimGCunref)(void* p) {
	tcell41090* LOC1;
	LOC1 = 0;
	LOC1 = usrtocell_44443(p);
	decref_46402(LOC1);
}

static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
	tcell41090* c;
	c = usrtocell_44443(p);
	{
		(*c).Refcount -= 8;
		if (!((NU32)((*c).Refcount) < (NU32)(8))) goto LA3;
		rtladdzct_46002(c);
	}
	LA3: ;
}

static N_INLINE(void, incref_46827)(tcell41090* c) {
	(*c).Refcount = (NI)((NU32)((*c).Refcount) + (NU32)(8));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = canbecycleroot_44462(c);
		if (!LOC3) goto LA4;
		rtladdcycleroot_45235(c);
	}
	LA4: ;
}

static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		tcell41090* LOC5;
		if (!!((src == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = usrtocell_44443(src);
		incref_46827(LOC5);
	}
	LA3: ;
	{
		tcell41090* LOC10;
		if (!!(((*dest) == NIM_NIL))) goto LA8;
		LOC10 = 0;
		LOC10 = usrtocell_44443((*dest));
		decref_46402(LOC10);
	}
	LA8: ;
	(*dest) = src;
}

N_NIMCALL(tenv368016*, newenv_368493)(tsym188833* outerproc, tenv368016* up, tnode188803* n) {
	tenv368016* result;
	result = 0;
	result = (tenv368016*) newObj((&NTI368012), sizeof(tenv368016));
	(*result).Sup.m_type = (&NTI368016);
	if ((*result).Deps) nimGCunref((*result).Deps);
	(*result).Deps = (TY368028*) newSeqRC1((&NTI368028), 0);
	if ((*result).Capturedvars) nimGCunrefNoCycle((*result).Capturedvars);
	(*result).Capturedvars = (tsymseq188805*) newSeqRC1((&NTI188805), 0);
	asgnRefNoCycle((void**) &(*result).Obj, createobj_366252(outerproc, (*outerproc).Info));
	asgnRef((void**) &(*result).Up, up);
	asgnRefNoCycle((void**) &(*result).Attachednode, n);
	return result;
}

static N_INLINE(NIM_BOOL, isinnerproc_369035)(tsym188833* s, tsym188833* outerproc) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	tsym188833* LOC3;
	result = 0;
	LOC1 = 0;
	LOC1 = ((110592 &(1<<(((*s).Kind)&31)))!=0);
	if (!(LOC1)) goto LA2;
	LOC3 = 0;
	LOC3 = skipgenericowner_194972(s);
	LOC1 = (LOC3 == outerproc);
	LA2: ;
	result = LOC1;
	return result;
}
N_NIMCALL(void, TMP2983)(void* p, NI op) {
	tinnercontext368018* a;
	a = (tinnercontext368018*)p;
	nimGCvisit((void*)(*a).Fn, op);
	nimGCvisit((void*)(*a).Closureparam, op);
	nimGCvisit((void*)(*a).Localstoaccess.Data, op);
}

N_NIMCALL(tinnercontext368018*, newinnercontext_368470)(tsym188833* fn) {
	tinnercontext368018* result;
	result = 0;
	result = (tinnercontext368018*) newObj((&NTI368008), sizeof(tinnercontext368018));
	asgnRefNoCycle((void**) &(*result).Fn, fn);
	initidnodetable_189130(&(*result).Localstoaccess);
	return result;
}

static N_INLINE(NIM_BOOL, illegalcapture_369245)(tsym188833* s) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	ttype188837* LOC2;
	result = 0;
	LOC1 = 0;
	LOC2 = 0;
	LOC2 = skiptypes_192793((*s).Typ, IL64(211106232576256));
	LOC1 = ((*LOC2).Kind == ((NU8) 23) || (*LOC2).Kind == ((NU8) 27) || (*LOC2).Kind == ((NU8) 48));
	if (LOC1) goto LA3;
	LOC1 = ((*s).Kind == ((NU8) 11));
	LA3: ;
	result = LOC1;
	return result;
}

N_NIMCALL(void, addclosureparam_369072)(tinnercontext368018* i, tenv368016* e) {
	tsym188833* cp;
	cp = getenvparam_368217((*i).Fn);
	{
		tident167019* LOC5;
		if (!(cp == NIM_NIL)) goto LA3;
		LOC5 = 0;
		LOC5 = getident_167456(((NimStringDesc*) &TMP2976));
		cp = newsym_189053(((NU8) 3), LOC5, (*i).Fn, (*(*i).Fn).Info);
		(*cp).Flags |=((NI32)(1)<<((((NU8) 2))%(sizeof(NI32)*8)));
		asgnRefNoCycle((void**) &(*cp).Typ, newtype_189060(((NU8) 22), (*i).Fn));
		rawaddson_193092((*cp).Typ, (*e).Obj);
		addhiddenparam_368113((*i).Fn, cp);
	}
	goto LA1;
	LA3: ;
	{
		asgnRefNoCycle((void**) &(*e).Obj, (*(*cp).Typ).Sons->data[0]);
	}
	LA1: ;
	asgnRefNoCycle((void**) &(*i).Closureparam, cp);
}

N_NIMCALL(void, addcapturedvar_368557)(tenv368016* e, tsym188833* v) {
	tsym188833* x_368573;
	tsymseq188805* HEX3Atmp_368608;
	NI i_368610;
	NI l_368612;
	x_368573 = 0;
	HEX3Atmp_368608 = 0;
	HEX3Atmp_368608 = (*e).Capturedvars;
	i_368610 = 0;
	l_368612 = HEX3Atmp_368608->Sup.len;
	while (1) {
		if (!(i_368610 < l_368612)) goto LA1;
		x_368573 = HEX3Atmp_368608->data[i_368610];
		{
			if (!(x_368573 == v)) goto LA4;
			goto BeforeRet;
		}
		LA4: ;
		i_368610 += 1;
	} LA1: ;
	{
		NI LOC8;
		tsym188833* LOC11;
		LOC8 = 0;
		LOC8 = len_189264((*(*e).Obj).N);
		if (!(LOC8 == 0)) goto LA9;
		LOC11 = 0;
		LOC11 = createstatefield_368056((*v).Owner);
		addfield_366275((*e).Obj, LOC11);
	}
	LA9: ;
	(*e).Capturedvars = (tsymseq188805*) incrSeq(&((*e).Capturedvars)->Sup, sizeof(tsym188833*));
	asgnRefNoCycle((void**) &(*e).Capturedvars->data[(*e).Capturedvars->Sup.len-1], v);
	addfield_366275((*e).Obj, v);
	BeforeRet: ;
}

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

N_NIMCALL(tsym188833*, adddep_368616)(tenv368016* e, tenv368016* d, tsym188833* owner) {
	tsym188833* result;
	tenv368016* x_368803;
	tsym188833* field_368804;
	TY368028* HEX3Atmp_369020;
	NI i_369022;
	NI l_369024;
	NI pos;
	NimStringDesc* LOC6;
	NimStringDesc* LOC7;
	tident167019* LOC8;
	tdep368014 LOC9;
	result = 0;
	x_368803 = 0;
	field_368804 = 0;
	HEX3Atmp_369020 = 0;
	HEX3Atmp_369020 = (*e).Deps;
	i_369022 = 0;
	l_369024 = HEX3Atmp_369020->Sup.len;
	while (1) {
		if (!(i_369022 < l_369024)) goto LA1;
		x_368803 = HEX3Atmp_369020->data[i_369022].Field0;
		field_368804 = HEX3Atmp_369020->data[i_369022].Field1;
		{
			if (!(x_368803 == d)) goto LA4;
			result = field_368804;
			goto BeforeRet;
		}
		LA4: ;
		i_369022 += 1;
	} LA1: ;
	pos = sonslen_189181((*(*e).Obj).N);
	LOC6 = 0;
	LOC7 = 0;
	LOC7 = nimIntToStr(pos);
	LOC6 = rawNewString(LOC7->Sup.len + 3);
appendString(LOC6, ((NimStringDesc*) &TMP2984));
appendString(LOC6, LOC7);
	LOC8 = 0;
	LOC8 = getident_167456(LOC6);
	result = newsym_189053(((NU8) 19), LOC8, owner, (*owner).Info);
	asgnRefNoCycle((void**) &(*result).Typ, newtype_189060(((NU8) 22), owner));
	(*result).Position = pos;
	rawaddson_193092((*result).Typ, (*d).Obj);
	addfield_366275((*e).Obj, result);
	memset((void*)&LOC9, 0, sizeof(LOC9));
	LOC9.Field0 = d;
	LOC9.Field1 = result;
	(*e).Deps = (TY368028*) incrSeq(&((*e).Deps)->Sup, sizeof(tdep368014));
	asgnRef((void**) &(*e).Deps->data[(*e).Deps->Sup.len-1].Field0, LOC9.Field0);
	asgnRefNoCycle((void**) &(*e).Deps->data[(*e).Deps->Sup.len-1].Field1, LOC9.Field1);
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, capturevar_369274)(toutercontext368020* o, tinnercontext368018* i, tsym188833* local, tlineinfo163527 info) {
	tenv368016* it;
	TNimObject* LOC1;
	tenv368016* e;
	tnode188803* access;
	LOC1 = 0;
	LOC1 = idtableget_197137((*o).Localstoenv, &local->Sup);
	it = ((tenv368016*) (LOC1));
	{
		if (!(it == NIM_NIL)) goto LA4;
		goto BeforeRet;
	}
	LA4: ;
	{
		NIM_BOOL LOC8;
		NIM_BOOL LOC9;
		LOC8 = 0;
		LOC9 = 0;
		LOC9 = illegalcapture_369245(local);
		if (LOC9) goto LA10;
		LOC9 = !(((*(*o).Fn).Sup.Id == (*(*local).Owner).Sup.Id));
		LA10: ;
		LOC8 = LOC9;
		if (LOC8) goto LA11;
		LOC8 = !(((257 &(1<<(((*(*(*i).Fn).Typ).Callconv)&15)))!=0));
		LA11: ;
		if (!LOC8) goto LA12;
		localerror_165571(info, ((NU16) 222), (*(*local).Name).S);
	}
	LA12: ;
	(*(*(*i).Fn).Typ).Callconv = ((NU8) 8);
	(*(*(*i).Fn).Typ).Flags |=((NI32)(1)<<((((NU8) 11))%(sizeof(NI32)*8)));
	e = (*o).Currentenv;
	{
		TNimObject* LOC16;
		LOC16 = 0;
		LOC16 = idtableget_197137((*o).Lambdastoenv, &(*i).Fn->Sup);
		if (!(LOC16 == NIM_NIL)) goto LA17;
		idtableput_197147(&(*o).Lambdastoenv, &(*i).Fn->Sup, &e->Sup);
	}
	LA17: ;
	{
		tnode188803* LOC21;
		LOC21 = 0;
		LOC21 = idnodetableget_197159((*i).Localstoaccess, &local->Sup);
		if (!!((LOC21 == NIM_NIL))) goto LA22;
		goto BeforeRet;
	}
	LA22: ;
	{
		if (!((*i).Closureparam == NIM_NIL)) goto LA26;
		addclosureparam_369072(i, e);
	}
	LA26: ;
	access = newsymnode_189095((*i).Closureparam);
	addcapturedvar_368557(it, local);
	{
		if (!(it == e)) goto LA30;
	}
	goto LA28;
	LA30: ;
	{
		tsym188833* LOC33;
		LOC33 = 0;
		LOC33 = adddep_368616(e, it, (*i).Fn);
		access = indirectaccess_366403(access, LOC33, info);
	}
	LA28: ;
	access = indirectaccess_366403(access, local, info);
	{
		if (!(*o).Isiter) goto LA36;
		{
			NIM_BOOL LOC40;
			LOC40 = 0;
			LOC40 = containsorincl_185888(&(*o).Capturedvars, (*local).Sup.Id);
			if (!!(LOC40)) goto LA41;
			addfield_366275((*o).Obj, local);
		}
		LA41: ;
	}
	goto LA34;
	LA36: ;
	{
		incl_185849(&(*o).Capturedvars, (*local).Sup.Id);
	}
	LA34: ;
	idnodetableput_197164(&(*i).Localstoaccess, &local->Sup, access);
	BeforeRet: ;
}

N_NIMCALL(void, gathervars_369468)(toutercontext368020* o, tinnercontext368018* i, tnode188803* n) {
	{
		if (!(n == NIM_NIL)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	switch ((*n).Kind) {
	case ((NU8) 3):
	{
		tsym188833* s;
		s = (*n).kindU.S4.Sym;
		{
			NIM_BOOL LOC8;
			LOC8 = 0;
			LOC8 = interestingvar_369403(s);
			if (!(LOC8)) goto LA9;
			LOC8 = !(((*(*i).Fn).Sup.Id == (*(*s).Owner).Sup.Id));
			LA9: ;
			if (!LOC8) goto LA10;
			capturevar_369274(o, i, s, (*n).Info);
		}
		goto LA6;
		LA10: ;
		{
			NIM_BOOL LOC13;
			NIM_BOOL LOC14;
			NIM_BOOL LOC15;
			tsym188833* LOC17;
			tenv368016* env;
			TNimObject* LOC22;
			LOC13 = 0;
			LOC14 = 0;
			LOC15 = 0;
			LOC15 = ((77824 &(1<<(((*s).Kind)&31)))!=0);
			if (!(LOC15)) goto LA16;
			LOC17 = 0;
			LOC17 = skipgenericowner_194972(s);
			LOC15 = (LOC17 == (*o).Fn);
			LA16: ;
			LOC14 = LOC15;
			if (!(LOC14)) goto LA18;
			LOC14 = (((*(*s).Typ).Flags &(1<<((((NU8) 11))&31)))!=0);
			LA18: ;
			LOC13 = LOC14;
			if (!(LOC13)) goto LA19;
			LOC13 = !((s == (*i).Fn));
			LA19: ;
			if (!LOC13) goto LA20;
			LOC22 = 0;
			LOC22 = idtableget_197137((*o).Lambdastoenv, &(*i).Fn->Sup);
			env = ((tenv368016*) (LOC22));
			{
				if (!(env == NIM_NIL)) goto LA25;
				internalerror_165591((*n).Info, ((NimStringDesc*) &TMP2985));
			}
			LA25: ;
			{
				tsym188833* LOC31;
				if (!!(((*o).Currentenv == env))) goto LA29;
				LOC31 = 0;
				LOC31 = adddep_368616((*o).Currentenv, env, (*i).Fn);
				internalerror_165591((*n).Info, ((NimStringDesc*) &TMP2986));
			}
			LA29: ;
		}
		goto LA6;
		LA20: ;
		LA6: ;
	}
	break;
	case ((NU8) 1) ... ((NU8) 2):
	case ((NU8) 4) ... ((NU8) 23):
	case ((NU8) 153):
	{
	}
	break;
	default:
	{
		NI k_369636;
		NI HEX3Atmp_369651;
		NI LOC34;
		NI res_369653;
		k_369636 = 0;
		HEX3Atmp_369651 = 0;
		LOC34 = 0;
		LOC34 = sonslen_189181(n);
		HEX3Atmp_369651 = (NI32)(LOC34 - 1);
		res_369653 = 0;
		while (1) {
			if (!(res_369653 <= HEX3Atmp_369651)) goto LA35;
			k_369636 = res_369653;
			gathervars_369468(o, i, (*n).kindU.S6.Sons->data[k_369636]);
			res_369653 += 1;
		} LA35: ;
	}
	break;
	}
	BeforeRet: ;
}

N_NIMCALL(void, dummyclosureparam_369203)(toutercontext368020* o, tinnercontext368018* i) {
	tenv368016* e;
	e = (*o).Currentenv;
	{
		TNimObject* LOC3;
		LOC3 = 0;
		LOC3 = idtableget_197137((*o).Lambdastoenv, &(*i).Fn->Sup);
		if (!(LOC3 == NIM_NIL)) goto LA4;
		idtableput_197147(&(*o).Lambdastoenv, &(*i).Fn->Sup, &e->Sup);
	}
	LA4: ;
	{
		if (!((*i).Closureparam == NIM_NIL)) goto LA8;
		addclosureparam_369072(i, e);
	}
	LA8: ;
}

N_NIMCALL(tnode188803*, transforminnerproc_369763)(toutercontext368020* o, tinnercontext368018* i, tnode188803* n) {
	tnode188803* result;
	result = 0;
	switch ((*n).Kind) {
	case ((NU8) 1) ... ((NU8) 2):
	case ((NU8) 4) ... ((NU8) 23):
	{
	}
	break;
	case ((NU8) 3):
	{
		tsym188833* s;
		s = (*n).kindU.S4.Sym;
		{
			if (!(s == (*i).Fn)) goto LA5;
			result = makeclosure_369738(s, (*i).Closureparam, (*n).Info);
		}
		goto LA3;
		LA5: ;
		{
			NIM_BOOL LOC8;
			LOC8 = 0;
			LOC8 = isinnerproc_369035(s, (*o).Fn);
			if (!(LOC8)) goto LA9;
			LOC8 = ((*(*s).Typ).Callconv == ((NU8) 8));
			LA9: ;
			if (!LOC8) goto LA10;
			result = makeclosure_369738(s, (*i).Closureparam, (*n).Info);
		}
		goto LA3;
		LA10: ;
		{
			result = idnodetableget_197159((*i).Localstoaccess, &(*n).kindU.S4.Sym->Sup);
		}
		LA3: ;
	}
	break;
	case ((NU8) 51):
	case ((NU8) 84):
	case ((NU8) 52):
	{
		{
			if (!!(((*n).Typ == NIM_NIL))) goto LA16;
			result = transforminnerproc_369763(o, i, (*n).kindU.S6.Sons->data[0]);
		}
		LA16: ;
	}
	break;
	case ((NU8) 79):
	case ((NU8) 80):
	case ((NU8) 81):
	case ((NU8) 82):
	case ((NU8) 83):
	case ((NU8) 153):
	{
	}
	break;
	default:
	{
		NI j_370258;
		NI HEX3Atmp_370305;
		NI LOC20;
		NI res_370307;
		j_370258 = 0;
		HEX3Atmp_370305 = 0;
		LOC20 = 0;
		LOC20 = sonslen_189181(n);
		HEX3Atmp_370305 = (NI32)(LOC20 - 1);
		res_370307 = 0;
		while (1) {
			tnode188803* x;
			if (!(res_370307 <= HEX3Atmp_370305)) goto LA21;
			j_370258 = res_370307;
			x = transforminnerproc_369763(o, i, (*n).kindU.S6.Sons->data[j_370258]);
			{
				if (!!((x == NIM_NIL))) goto LA24;
				asgnRefNoCycle((void**) &(*n).kindU.S6.Sons->data[j_370258], x);
			}
			LA24: ;
			res_370307 += 1;
		} LA21: ;
	}
	break;
	}
	return result;
}

N_NIMCALL(void, searchforinnerprocs_370318)(toutercontext368020* o, tnode188803* n) {
	{
		if (!(n == NIM_NIL)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	switch ((*n).Kind) {
	case ((NU8) 1) ... ((NU8) 2):
	case ((NU8) 4) ... ((NU8) 23):
	{
	}
	break;
	case ((NU8) 3):
	{
		{
			NIM_BOOL LOC9;
			NIM_BOOL LOC11;
			tinnercontext368018* inner;
			tnode188803* body;
			LOC9 = 0;
			LOC9 = isinnerproc_369035((*n).kindU.S4.Sym, (*o).Fn);
			if (!(LOC9)) goto LA10;
			LOC11 = 0;
			LOC11 = containsorincl_185888(&(*o).Processed, (*(*n).kindU.S4.Sym).Sup.Id);
			LOC9 = !(LOC11);
			LA10: ;
			if (!LOC9) goto LA12;
			inner = newinnercontext_368470((*n).kindU.S4.Sym);
			body = getbody_239244((*n).kindU.S4.Sym);
			gathervars_369468(o, inner, body);
			{
				NIM_BOOL LOC16;
				LOC16 = 0;
				LOC16 = ((*inner).Closureparam == NIM_NIL);
				if (!(LOC16)) goto LA17;
				LOC16 = ((*(*(*n).kindU.S4.Sym).Typ).Callconv == ((NU8) 8));
				LA17: ;
				if (!LOC16) goto LA18;
				dummyclosureparam_369203(o, inner);
			}
			LA18: ;
			{
				tnode188803* ti;
				if (!!(((*inner).Closureparam == NIM_NIL))) goto LA22;
				ti = transforminnerproc_369763(o, inner, body);
				{
					if (!!((ti == NIM_NIL))) goto LA26;
					asgnRefNoCycle((void**) &(*(*(*n).kindU.S4.Sym).Ast).kindU.S6.Sons->data[6], ti);
				}
				LA26: ;
			}
			LA22: ;
		}
		LA12: ;
	}
	break;
	case ((NU8) 51):
	case ((NU8) 84):
	case ((NU8) 52):
	{
		{
			if (!!(((*n).Typ == NIM_NIL))) goto LA31;
			searchforinnerprocs_370318(o, (*n).kindU.S6.Sons->data[0]);
		}
		LA31: ;
	}
	break;
	case ((NU8) 96):
	case ((NU8) 94):
	case ((NU8) 95):
	case ((NU8) 111):
	{
		NI body;
		NI LOC34;
		NI i_370571;
		NI HEX3Atmp_370836;
		NI res_370838;
		tenv368016* oldenv;
		tnode188803* ex;
		LOC34 = 0;
		LOC34 = len_189264(n);
		body = (NI32)(LOC34 - 1);
		i_370571 = 0;
		HEX3Atmp_370836 = 0;
		HEX3Atmp_370836 = (NI32)(body - 1);
		res_370838 = 0;
		while (1) {
			if (!(res_370838 <= HEX3Atmp_370836)) goto LA35;
			i_370571 = res_370838;
			searchforinnerprocs_370318(o, (*n).kindU.S6.Sons->data[i_370571]);
			res_370838 += 1;
		} LA35: ;
		oldenv = (*o).Currentenv;
		ex = closurecreationpoint_370312((*n).kindU.S6.Sons->data[body]);
		asgnRef((void**) &(*o).Currentenv, newenv_368493((*o).Fn, oldenv, ex));
		searchforinnerprocs_370318(o, (*n).kindU.S6.Sons->data[body]);
		asgnRefNoCycle((void**) &(*n).kindU.S6.Sons->data[body], ex);
		asgnRef((void**) &(*o).Currentenv, oldenv);
	}
	break;
	case ((NU8) 99):
	case ((NU8) 100):
	{
		NI i_370642;
		NI HEX3Atmp_370844;
		NI LOC37;
		NI res_370846;
		i_370642 = 0;
		HEX3Atmp_370844 = 0;
		LOC37 = 0;
		LOC37 = sonslen_189181(n);
		HEX3Atmp_370844 = (NI32)(LOC37 - 1);
		res_370846 = 0;
		while (1) {
			tnode188803* it;
			if (!(res_370846 <= HEX3Atmp_370844)) goto LA38;
			i_370642 = res_370846;
			it = (*n).kindU.S6.Sons->data[i_370642];
			{
				if (!((*it).Kind == ((NU8) 124))) goto LA41;
			}
			goto LA39;
			LA41: ;
			{
				NI l;
				if (!((*it).Kind == ((NU8) 35))) goto LA44;
				l = sonslen_189181(it);
				{
					if (!!(((*(*it).kindU.S6.Sons->data[0]).Kind == ((NU8) 3)))) goto LA48;
					internalerror_165591((*it).Info, ((NimStringDesc*) &TMP2987));
				}
				LA48: ;
				idtableput_197147(&(*o).Localstoenv, &(*(*it).kindU.S6.Sons->data[0]).kindU.S4.Sym->Sup, &(*o).Currentenv->Sup);
				searchforinnerprocs_370318(o, (*it).kindU.S6.Sons->data[(NI32)(l - 1)]);
			}
			goto LA39;
			LA44: ;
			{
				NI l;
				NI j_370765;
				NI HEX3Atmp_370840;
				NI res_370842;
				if (!((*it).Kind == ((NU8) 36))) goto LA51;
				l = sonslen_189181(it);
				j_370765 = 0;
				HEX3Atmp_370840 = 0;
				HEX3Atmp_370840 = (NI32)(l - 3);
				res_370842 = 0;
				while (1) {
					if (!(res_370842 <= HEX3Atmp_370840)) goto LA53;
					j_370765 = res_370842;
					idtableput_197147(&(*o).Localstoenv, &(*(*it).kindU.S6.Sons->data[j_370765]).kindU.S4.Sym->Sup, &(*o).Currentenv->Sup);
					res_370842 += 1;
				} LA53: ;
				searchforinnerprocs_370318(o, (*it).kindU.S6.Sons->data[(NI32)(l - 1)]);
			}
			goto LA39;
			LA51: ;
			{
				internalerror_165591((*it).Info, ((NimStringDesc*) &TMP2987));
			}
			LA39: ;
			res_370846 += 1;
		} LA38: ;
	}
	break;
	case ((NU8) 79):
	case ((NU8) 80):
	case ((NU8) 81):
	case ((NU8) 82):
	case ((NU8) 83):
	case ((NU8) 153):
	case ((NU8) 98):
	{
	}
	break;
	default:
	{
		NI i_370821;
		NI HEX3Atmp_370848;
		NI LOC57;
		NI res_370850;
		i_370821 = 0;
		HEX3Atmp_370848 = 0;
		LOC57 = 0;
		LOC57 = sonslen_189181(n);
		HEX3Atmp_370848 = (NI32)(LOC57 - 1);
		res_370850 = 0;
		while (1) {
			if (!(res_370850 <= HEX3Atmp_370848)) goto LA58;
			i_370821 = res_370850;
			searchforinnerprocs_370318(o, (*n).kindU.S6.Sons->data[i_370821]);
			res_370850 += 1;
		} LA58: ;
	}
	break;
	}
	BeforeRet: ;
}

static N_INLINE(NIM_BOOL, interestingitervar_371228)(tsym188833* s) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = ((2097952 &(1<<(((*s).Kind)&31)))!=0);
	if (!(LOC1)) goto LA2;
	LOC1 = !((((*s).Flags &(1<<((((NU8) 3))&31)))!=0));
	LA2: ;
	result = LOC1;
	return result;
}

N_NIMCALL(tnode188803*, liftitersym_371505)(tnode188803* n) {
	tnode188803* result;
	tsym188833* iter;
	tsym188833* env;
	tsym188833* LOC1;
	tnode188803* v;
	tnode188803* LOC2;
	tsym188833* LOC3;
	tnode188803* LOC4;
	tnode188803* LOC5;
	result = 0;
	iter = (*n).kindU.S4.Sym;
	result = newnodeit_189104(((NU8) 125), (*n).Info, (*n).Typ);
	LOC1 = 0;
	LOC1 = gethiddenparam_368150(iter);
	env = copysym_189147(LOC1, NIM_FALSE);
	(*env).Kind = ((NU8) 9);
	v = newnodei_189099(((NU8) 99), (*n).Info);
	LOC2 = 0;
	LOC2 = newsymnode_189095(env);
	addvar_366036(v, LOC2);
	add_189390(result, v);
	LOC3 = 0;
	LOC3 = getsyssym_242040(((NimStringDesc*) &TMP2946));
	LOC4 = 0;
	LOC4 = newcall_369028(LOC3, env);
	add_189390(result, LOC4);
	LOC5 = 0;
	LOC5 = makeclosure_369738(iter, env, (*n).Info);
	add_189390(result, LOC5);
	return result;
}

N_NIMCALL(tsym188833*, newclosurecreationvar_370894)(toutercontext368020* o, tenv368016* e) {
	tsym188833* result;
	tident167019* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = getident_167456(((NimStringDesc*) &TMP2976));
	result = newsym_189053(((NU8) 8), LOC1, (*o).Fn, (*(*e).Attachednode).Info);
	(*result).Flags |=((NI32)(1)<<((((NU8) 21))%(sizeof(NI32)*8)));
	asgnRefNoCycle((void**) &(*result).Typ, newtype_189060(((NU8) 22), (*o).Fn));
	rawaddson_193092((*result).Typ, (*e).Obj);
	return result;
}

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

N_NIMCALL(tsym188833*, getclosurevar_370917)(toutercontext368020* o, tenv368016* e) {
	tsym188833* result;
	result = 0;
	{
		if (!((*e).Createdvar == NIM_NIL)) goto LA3;
		result = newclosurecreationvar_370894(o, e);
		asgnRefNoCycle((void**) &(*e).Createdvar, result);
	}
	goto LA1;
	LA3: ;
	{
		result = (*e).Createdvar;
	}
	LA1: ;
	return result;
}

N_NIMCALL(tnode188803*, rawclosurecreation_370941)(toutercontext368020* o, tenv368016* scope, tsym188833* env) {
	tnode188803* result;
	tnode188803* v;
	tnode188803* LOC1;
	tsym188833* LOC2;
	tnode188803* LOC3;
	tsym188833* local_370960;
	tsymseq188805* HEX3Atmp_370998;
	NI i_371000;
	NI l_371002;
	tenv368016* e_370996;
	tsym188833* field_370997;
	TY368028* HEX3Atmp_371003;
	NI i_371005;
	NI l_371007;
	result = 0;
	result = newnodei_189099(((NU8) 114), (*env).Info);
	v = newnodei_189099(((NU8) 99), (*env).Info);
	LOC1 = 0;
	LOC1 = newsymnode_189095(env);
	addvar_366036(v, LOC1);
	add_189390(result, v);
	LOC2 = 0;
	LOC2 = getsyssym_242040(((NimStringDesc*) &TMP2946));
	LOC3 = 0;
	LOC3 = newcall_369028(LOC2, env);
	add_189390(result, LOC3);
	local_370960 = 0;
	HEX3Atmp_370998 = 0;
	HEX3Atmp_370998 = (*scope).Capturedvars;
	i_371000 = 0;
	l_371002 = HEX3Atmp_370998->Sup.len;
	while (1) {
		tnode188803* fieldaccess;
		tnode188803* existing;
		if (!(i_371000 < l_371002)) goto LA4;
		local_370960 = HEX3Atmp_370998->data[i_371000];
		fieldaccess = indirectaccess_366803(env, local_370960, (*env).Info);
		{
			tnode188803* LOC9;
			tnode188803* LOC10;
			if (!((*local_370960).Kind == ((NU8) 3))) goto LA7;
			LOC9 = 0;
			LOC9 = newsymnode_189095(local_370960);
			LOC10 = 0;
			LOC10 = newasgnstmt_370858(fieldaccess, LOC9, (*env).Info);
			add_189390(result, LOC10);
		}
		LA7: ;
		existing = idnodetableget_197159((*o).Localstoaccess, &local_370960->Sup);
		{
			if (!existing == 0) goto LA13;
			idnodetableput_197164(&(*o).Localstoaccess, &local_370960->Sup, fieldaccess);
		}
		goto LA11;
		LA13: ;
		{
			tnode188803* LOC16;
			LOC16 = 0;
			LOC16 = newasgnstmt_370858(fieldaccess, existing, (*env).Info);
			add_189390(result, LOC16);
		}
		LA11: ;
		i_371000 += 1;
	} LA4: ;
	e_370996 = 0;
	field_370997 = 0;
	HEX3Atmp_371003 = 0;
	HEX3Atmp_371003 = (*scope).Deps;
	i_371005 = 0;
	l_371007 = HEX3Atmp_371003->Sup.len;
	while (1) {
		tnode188803* LOC18;
		tsym188833* LOC19;
		tnode188803* LOC20;
		tnode188803* LOC21;
		if (!(i_371005 < l_371007)) goto LA17;
		e_370996 = HEX3Atmp_371003->data[i_371005].Field0;
		field_370997 = HEX3Atmp_371003->data[i_371005].Field1;
		LOC18 = 0;
		LOC18 = indirectaccess_366803(env, field_370997, (*env).Info);
		LOC19 = 0;
		LOC19 = getclosurevar_370917(o, e_370996);
		LOC20 = 0;
		LOC20 = newsymnode_189095(LOC19);
		LOC21 = 0;
		LOC21 = newasgnstmt_370858(LOC18, LOC20, (*env).Info);
		add_189390(result, LOC21);
		i_371005 += 1;
	} LA17: ;
	return result;
}

N_NIMCALL(tsym188833*, generateiterclosurecreation_371020)(toutercontext368020* o, tenv368016* env, tnode188803* scope) {
	tsym188833* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		tnode188803* cc;
		tnode188803* insertpoint;
		LOC3 = 0;
		LOC3 = (*env).Createdvarcomesfromiter;
		if (LOC3) goto LA4;
		LOC3 = (*env).Createdvar == 0;
		LA4: ;
		if (!LOC3) goto LA5;
		result = newclosurecreationvar_370894(o, env);
		cc = rawclosurecreation_370941(o, env, result);
		insertpoint = (*scope).kindU.S6.Sons->data[0];
		{
			if (!((*insertpoint).Kind == ((NU8) 1))) goto LA9;
			asgnRefNoCycle((void**) &(*scope).kindU.S6.Sons->data[0], cc);
		}
		goto LA7;
		LA9: ;
		{
			tnode188803* x_371201;
			NI i_371220;
			NI HEX3Atmp_371222;
			NI LOC12;
			NI res_371224;
			x_371201 = 0;
			i_371220 = 0;
			HEX3Atmp_371222 = 0;
			LOC12 = 0;
			LOC12 = len_189264(cc);
			HEX3Atmp_371222 = LOC12 - 1;
			res_371224 = 0;
			while (1) {
				if (!(res_371224 <= HEX3Atmp_371222)) goto LA13;
				i_371220 = res_371224;
				x_371201 = (*cc).kindU.S6.Sons->data[i_371220];
				add_189390(insertpoint, x_371201);
				res_371224 += 1;
			} LA13: ;
		}
		LA7: ;
		{
			if (!((*env).Createdvar == NIM_NIL)) goto LA16;
			asgnRefNoCycle((void**) &(*env).Createdvar, result);
		}
		LA16: ;
	}
	goto LA1;
	LA5: ;
	{
		result = (*env).Createdvar;
	}
	LA1: ;
	(*env).Createdvarcomesfromiter = NIM_TRUE;
	return result;
}

N_NIMCALL(tnode188803*, generateclosurecreation_371012)(toutercontext368020* o, tenv368016* scope) {
	tnode188803* result;
	tsym188833* env;
	result = 0;
	env = getclosurevar_370917(o, scope);
	result = rawclosurecreation_370941(o, scope, env);
	return result;
}

N_NIMCALL(tnode188803*, generatethunk_369658)(tnode188803* prc, ttype188837* dest) {
	tnode188803* result;
	tnode188803* conv;
	ttype188837* LOC5;
	tnode188803* LOC6;
	result = 0;
	{
		if (!(gcmd_137113 == ((NU8) 4))) goto LA3;
		result = prc;
		goto BeforeRet;
	}
	LA3: ;
	result = newnodeit_189104(((NU8) 153), (*prc).Info, dest);
	conv = newnodeit_189104(((NU8) 58), (*prc).Info, dest);
	add_189390(conv, emptynode_189727);
	add_189390(conv, prc);
	add_189390(result, conv);
	LOC5 = 0;
	LOC5 = getsystype_242024(((NU8) 5));
	LOC6 = 0;
	LOC6 = newnodeit_189104(((NU8) 23), (*prc).Info, LOC5);
	add_189390(result, LOC6);
	BeforeRet: ;
	return result;
}

N_NIMCALL(tnode188803*, transformouterconv_369675)(tnode188803* n) {
	tnode188803* result;
	ttype188837* dest;
	ttype188837* source;
	result = 0;
	dest = skiptypes_192793((*n).Typ, IL64(211106242013440));
	source = skiptypes_192793((*(*n).kindU.S6.Sons->data[1]).Typ, IL64(211106242013440));
	{
		if (!((*dest).Kind == ((NU8) 25))) goto LA3;
		{
			NIM_BOOL LOC7;
			LOC7 = 0;
			LOC7 = ((*dest).Callconv == ((NU8) 8));
			if (!(LOC7)) goto LA8;
			LOC7 = ((*source).Callconv == ((NU8) 0));
			LA8: ;
			if (!LOC7) goto LA9;
			result = generatethunk_369658((*n).kindU.S6.Sons->data[1], dest);
		}
		LA9: ;
	}
	LA3: ;
	return result;
}

N_NIMCALL(tnode188803*, transformyield_371266)(toutercontext368020* c, tnode188803* n) {
	tnode188803* result;
	NI64 stateno;
	tnode188803* stateasgnstmt;
	tnode188803* LOC1;
	tnode188803* LOC2;
	ttype188837* LOC3;
	tnode188803* LOC4;
	tnode188803* retstmt;
	tnode188803* statelabelstmt;
	ttype188837* LOC17;
	tnode188803* LOC18;
	result = 0;
	(*(*(*(*(*c).State).Typ).N).kindU.S6.Sons->data[1]).kindU.S1.Intval += 1;
	stateno = (*(*(*(*(*c).State).Typ).N).kindU.S6.Sons->data[1]).kindU.S1.Intval;
	stateasgnstmt = newnodei_189099(((NU8) 73), (*n).Info);
	LOC1 = 0;
	LOC1 = newsymnode_189095((*c).Closureparam);
	LOC2 = 0;
	LOC2 = indirectaccess_366403(LOC1, (*c).State, (*n).Info);
	add_189390(stateasgnstmt, LOC2);
	LOC3 = 0;
	LOC3 = getsystype_242024(((NU8) 31));
	LOC4 = 0;
	LOC4 = newinttypenode_189074(((NU8) 6), stateno, LOC3);
	add_189390(stateasgnstmt, LOC4);
	retstmt = newnodei_189099(((NU8) 108), (*n).Info);
	{
		tnode188803* a;
		tnode188803* retval;
		tnode188803* LOC9;
		tnode188803* LOC10;
		if (!!(((*(*n).kindU.S6.Sons->data[0]).Kind == ((NU8) 1)))) goto LA7;
		a = newnodei_189099(((NU8) 73), (*(*n).kindU.S6.Sons->data[0]).Info);
		retval = transformouterproc_371261(c, (*n).kindU.S6.Sons->data[0]);
		LOC9 = 0;
		LOC9 = newsymnode_189095((*c).Resultsym);
		addson_189207(a, LOC9);
		LOC10 = 0;
		{
			if (!retval == 0) goto LA13;
			LOC10 = (*n).kindU.S6.Sons->data[0];
		}
		goto LA11;
		LA13: ;
		{
			LOC10 = retval;
		}
		LA11: ;
		addson_189207(a, LOC10);
		add_189390(retstmt, a);
	}
	goto LA5;
	LA7: ;
	{
		add_189390(retstmt, emptynode_189727);
	}
	LA5: ;
	statelabelstmt = newnodei_189099(((NU8) 155), (*n).Info);
	LOC17 = 0;
	LOC17 = getsystype_242024(((NU8) 31));
	LOC18 = 0;
	LOC18 = newinttypenode_189074(((NU8) 6), stateno, LOC17);
	add_189390(statelabelstmt, LOC18);
	result = newnodei_189099(((NU8) 114), (*n).Info);
	add_189390(result, stateasgnstmt);
	add_189390(result, retstmt);
	add_189390(result, statelabelstmt);
	return result;
}

N_NIMCALL(void, outerprocsons_371435)(toutercontext368020* o, tnode188803* n) {
	NI i_371451;
	NI HEX3Atmp_371498;
	NI LOC1;
	NI res_371500;
	i_371451 = 0;
	HEX3Atmp_371498 = 0;
	LOC1 = 0;
	LOC1 = sonslen_189181(n);
	HEX3Atmp_371498 = (NI32)(LOC1 - 1);
	res_371500 = 0;
	while (1) {
		tnode188803* x;
		if (!(res_371500 <= HEX3Atmp_371498)) goto LA2;
		i_371451 = res_371500;
		x = transformouterproc_371261(o, (*n).kindU.S6.Sons->data[i_371451]);
		{
			if (!!((x == NIM_NIL))) goto LA5;
			asgnRefNoCycle((void**) &(*n).kindU.S6.Sons->data[i_371451], x);
		}
		LA5: ;
		res_371500 += 1;
	} LA2: ;
}

N_NIMCALL(tnode188803*, transformreturn_371427)(toutercontext368020* c, tnode188803* n) {
	tnode188803* result;
	tnode188803* stateasgnstmt;
	tnode188803* LOC1;
	tnode188803* LOC2;
	ttype188837* LOC3;
	tnode188803* LOC4;
	result = 0;
	result = newnodei_189099(((NU8) 114), (*n).Info);
	stateasgnstmt = newnodei_189099(((NU8) 73), (*n).Info);
	LOC1 = 0;
	LOC1 = newsymnode_189095((*c).Closureparam);
	LOC2 = 0;
	LOC2 = indirectaccess_366403(LOC1, (*c).State, (*n).Info);
	add_189390(stateasgnstmt, LOC2);
	LOC3 = 0;
	LOC3 = getsystype_242024(((NU8) 31));
	LOC4 = 0;
	LOC4 = newinttypenode_189074(((NU8) 6), -1, LOC3);
	add_189390(stateasgnstmt, LOC4);
	add_189390(result, stateasgnstmt);
	add_189390(result, n);
	return result;
}

N_NIMCALL(tnode188803*, transformouterproc_371261)(toutercontext368020* o, tnode188803* n) {
	tnode188803* result;
	result = 0;
	{
		if (!(n == NIM_NIL)) goto LA3;
		result = NIM_NIL;
		goto BeforeRet;
	}
	LA3: ;
	switch ((*n).Kind) {
	case ((NU8) 1) ... ((NU8) 2):
	case ((NU8) 4) ... ((NU8) 23):
	{
	}
	break;
	case ((NU8) 3):
	{
		tsym188833* local;
		tenv368016* closure;
		TNimObject* LOC21;
		tenv368016* env;
		TNimObject* LOC53;
		tnode188803* scope;
		local = (*n).kindU.S4.Sym;
		{
			NIM_BOOL LOC9;
			NIM_BOOL LOC10;
			tnode188803* LOC20;
			LOC9 = 0;
			LOC10 = 0;
			LOC10 = (*o).Isiter;
			if (!(LOC10)) goto LA11;
			LOC10 = interestingitervar_371228(local);
			LA11: ;
			LOC9 = LOC10;
			if (!(LOC9)) goto LA12;
			LOC9 = ((*(*o).Fn).Sup.Id == (*(*local).Owner).Sup.Id);
			LA12: ;
			if (!LOC9) goto LA13;
			{
				NIM_BOOL LOC17;
				LOC17 = 0;
				LOC17 = containsorincl_185888(&(*o).Capturedvars, (*local).Sup.Id);
				if (!!(LOC17)) goto LA18;
				addfield_366275((*o).Obj, local);
			}
			LA18: ;
			LOC20 = 0;
			LOC20 = newsymnode_189095((*o).Closureparam);
			result = indirectaccess_366403(LOC20, local, (*n).Info);
			goto BeforeRet;
		}
		LA13: ;
		LOC21 = 0;
		LOC21 = idtableget_197137((*o).Lambdastoenv, &local->Sup);
		closure = ((tenv368016*) (LOC21));
		{
			if (!((*local).Kind == ((NU8) 15))) goto LA24;
			{
				if (!(local == (*o).Fn)) goto LA28;
				message_165584((*n).Info, ((NU16) 25), (*(*local).Name).S);
			}
			LA28: ;
			{
				if (!closure == 0) goto LA32;
				result = liftitersym_371505(n);
				goto BeforeRet;
			}
			goto LA30;
			LA32: ;
			{
				tsym188833* createdvar;
				createdvar = generateiterclosurecreation_371020(o, closure, (*closure).Attachednode);
				result = makeclosure_369738(local, createdvar, (*n).Info);
				goto BeforeRet;
			}
			LA30: ;
		}
		LA24: ;
		{
			tsym188833* a;
			if (!!((closure == NIM_NIL))) goto LA37;
			a = (*closure).Createdvar;
			{
				if (!!((a == NIM_NIL))) goto LA41;
				result = makeclosure_369738(local, a, (*n).Info);
				goto BeforeRet;
			}
			goto LA39;
			LA41: ;
			{
				tnode188803* scope;
				tsym188833* x;
				scope = (*closure).Attachednode;
				{
					if (!((*(*scope).kindU.S6.Sons->data[0]).Kind == ((NU8) 1))) goto LA46;
					asgnRefNoCycle((void**) &(*scope).kindU.S6.Sons->data[0], generateclosurecreation_371012(o, closure));
				}
				LA46: ;
				x = (*closure).Createdvar;
				result = makeclosure_369738(local, x, (*n).Info);
				goto BeforeRet;
			}
			LA39: ;
		}
		LA37: ;
		{
			NIM_BOOL LOC50;
			LOC50 = 0;
			LOC50 = contains_185821((*o).Capturedvars, (*local).Sup.Id);
			if (!!(LOC50)) goto LA51;
			goto BeforeRet;
		}
		LA51: ;
		LOC53 = 0;
		LOC53 = idtableget_197137((*o).Localstoenv, &local->Sup);
		env = ((tenv368016*) (LOC53));
		{
			if (!(env == NIM_NIL)) goto LA56;
			goto BeforeRet;
		}
		LA56: ;
		scope = (*env).Attachednode;
		{
			if (!((*(*scope).kindU.S6.Sons->data[0]).Kind == ((NU8) 1))) goto LA60;
			asgnRefNoCycle((void**) &(*scope).kindU.S6.Sons->data[0], generateclosurecreation_371012(o, env));
		}
		LA60: ;
		result = idnodetableget_197159((*o).Localstoaccess, &local->Sup);
	}
	break;
	case ((NU8) 51):
	case ((NU8) 84):
	case ((NU8) 52):
	{
		{
			if (!!(((*n).Typ == NIM_NIL))) goto LA65;
			result = transformouterproc_371261(o, (*n).kindU.S6.Sons->data[0]);
		}
		LA65: ;
	}
	break;
	case ((NU8) 79):
	case ((NU8) 80):
	case ((NU8) 81):
	case ((NU8) 82):
	case ((NU8) 83):
	case ((NU8) 153):
	{
	}
	break;
	case ((NU8) 58):
	case ((NU8) 59):
	case ((NU8) 60):
	{
		tnode188803* x;
		x = transformouterproc_371261(o, (*n).kindU.S6.Sons->data[1]);
		{
			if (!!((x == NIM_NIL))) goto LA71;
			asgnRefNoCycle((void**) &(*n).kindU.S6.Sons->data[1], x);
		}
		LA71: ;
		result = transformouterconv_369675(n);
	}
	break;
	case ((NU8) 104):
	{
		{
			if (!(*o).Isiter) goto LA76;
			result = transformyield_371266(o, n);
		}
		goto LA74;
		LA76: ;
		{
			outerprocsons_371435(o, n);
		}
		LA74: ;
	}
	break;
	case ((NU8) 108):
	{
		{
			if (!(*o).Isiter) goto LA82;
			result = transformreturn_371427(o, n);
		}
		goto LA80;
		LA82: ;
		{
			outerprocsons_371435(o, n);
		}
		LA80: ;
	}
	break;
	default:
	{
		outerprocsons_371435(o, n);
	}
	break;
	}
	BeforeRet: ;
	return result;
}

N_NIMCALL(tnode188803*, liftiterator_372480)(toutercontext368020* c, tnode188803* body) {
	tnode188803* result;
	tsym188833* iter;
	tnode188803* gs;
	tnode188803* LOC1;
	tnode188803* LOC2;
	tnode188803* state0;
	tnode188803* LOC3;
	tnode188803* newbody;
	tnode188803* stateasgnstmt;
	tnode188803* LOC9;
	tnode188803* LOC10;
	ttype188837* LOC11;
	tnode188803* LOC12;
	result = 0;
	iter = (*c).Fn;
	result = newnodei_189099(((NU8) 114), (*iter).Info);
	gs = newnodei_189099(((NU8) 154), (*iter).Info);
	LOC1 = 0;
	LOC1 = newsymnode_189095((*c).Closureparam);
	LOC2 = 0;
	LOC2 = indirectaccess_366403(LOC1, (*c).State, (*iter).Info);
	add_189390(gs, LOC2);
	add_189390(result, gs);
	state0 = newnodei_189099(((NU8) 155), (*iter).Info);
	LOC3 = 0;
	LOC3 = newintnode_189069(((NU8) 6), 0);
	add_189390(state0, LOC3);
	add_189390(result, state0);
	newbody = transformouterproc_371261(c, body);
	{
		if (!!((newbody == NIM_NIL))) goto LA6;
		add_189390(result, newbody);
	}
	goto LA4;
	LA6: ;
	{
		add_189390(result, body);
	}
	LA4: ;
	stateasgnstmt = newnodei_189099(((NU8) 73), (*iter).Info);
	LOC9 = 0;
	LOC9 = newsymnode_189095((*c).Closureparam);
	LOC10 = 0;
	LOC10 = indirectaccess_366403(LOC9, (*c).State, (*iter).Info);
	add_189390(stateasgnstmt, LOC10);
	LOC11 = 0;
	LOC11 = getsystype_242024(((NU8) 31));
	LOC12 = 0;
	LOC12 = newinttypenode_189074(((NU8) 6), -1, LOC11);
	add_189390(stateasgnstmt, LOC12);
	add_189390(result, stateasgnstmt);
	return result;
}

N_NIMCALL(tnode188803*, liftlambdas_372509)(tsym188833* fn, tnode188803* body) {
	tnode188803* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = ((*body).Kind == ((NU8) 1));
		if (LOC3) goto LA4;
		LOC3 = (gcmd_137113 == ((NU8) 4));
		LA4: ;
		if (!LOC3) goto LA5;
		result = body;
	}
	goto LA1;
	LA5: ;
	{
		toutercontext368020* o;
		tnode188803* ex;
		tnode188803* params;
		NI i_372556;
		NI HEX3Atmp_372664;
		NI LOC8;
		NI res_372666;
		tnode188803* ast;
		o = newoutercontext_368435(fn, NIM_NIL);
		ex = closurecreationpoint_370312(body);
		asgnRef((void**) &(*o).Currentenv, newenv_368493(fn, NIM_NIL, ex));
		params = (*(*fn).Typ).N;
		i_372556 = 0;
		HEX3Atmp_372664 = 0;
		LOC8 = 0;
		LOC8 = len_189264(params);
		HEX3Atmp_372664 = LOC8 - 1;
		res_372666 = 1;
		while (1) {
			tsym188833* param;
			if (!(res_372666 <= HEX3Atmp_372664)) goto LA9;
			i_372556 = res_372666;
			{
				if (!!(((*(*params).kindU.S6.Sons->data[i_372556]).Kind == ((NU8) 3)))) goto LA12;
				internalerror_165591((*params).Info, ((NimStringDesc*) &TMP2979));
			}
			LA12: ;
			param = (*(*params).kindU.S6.Sons->data[i_372556]).kindU.S4.Sym;
			idtableput_197147(&(*o).Localstoenv, &param->Sup, &(*o).Currentenv->Sup);
			res_372666 += 1;
		} LA9: ;
		ast = (*fn).Ast;
		{
			NIM_BOOL LOC16;
			NI LOC17;
			LOC16 = 0;
			LOC17 = 0;
			LOC17 = sonslen_189181(ast);
			LOC16 = (7 < LOC17);
			if (!(LOC16)) goto LA18;
			LOC16 = ((*(*ast).kindU.S6.Sons->data[7]).Kind == ((NU8) 3));
			LA18: ;
			if (!LOC16) goto LA19;
			idtableput_197147(&(*o).Localstoenv, &(*(*ast).kindU.S6.Sons->data[7]).kindU.S4.Sym->Sup, &(*o).Currentenv->Sup);
		}
		LA19: ;
		searchforinnerprocs_370318(o, body);
		{
			if (!(*o).Isiter) goto LA23;
			result = liftiterator_372480(o, ex);
		}
		goto LA21;
		LA23: ;
		{
			tnode188803* LOC26;
			LOC26 = 0;
			LOC26 = transformouterproc_371261(o, body);
			result = ex;
		}
		LA21: ;
	}
	LA1: ;
	return result;
}

N_NIMCALL(tnode188803*, liftlambdasfortoplevel_372671)(tsym188833* module, tnode188803* body) {
	tnode188803* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = ((*body).Kind == ((NU8) 1));
		if (LOC3) goto LA4;
		LOC3 = (gcmd_137113 == ((NU8) 4));
		LA4: ;
		if (!LOC3) goto LA5;
		result = body;
	}
	goto LA1;
	LA5: ;
	{
		toutercontext368020* o;
		tnode188803* ex;
		tnode188803* LOC8;
		o = newoutercontext_368435(module, NIM_NIL);
		ex = closurecreationpoint_370312(body);
		asgnRef((void**) &(*o).Currentenv, newenv_368493(module, NIM_NIL, ex));
		searchforinnerprocs_370318(o, body);
		LOC8 = 0;
		LOC8 = transformouterproc_371261(o, body);
		result = ex;
	}
	LA1: ;
	return result;
}
N_NOINLINE(void, lambdaliftingInit)(void) {
}

N_NOINLINE(void, lambdaliftingDatInit)(void) {
static TNimNode* TMP2970[13];
static TNimNode* TMP2971[7];
static TNimNode* TMP2972[2];
static TNimNode* TMP2982[3];
static TNimNode TMP916[29];
NTI368020.size = sizeof(toutercontext368020);
NTI368020.kind = 18;
NTI368020.base = 0;
TMP2970[0] = &TMP916[1];
TMP916[1].kind = 1;
TMP916[1].offset = offsetof(toutercontext368020, Fn);
TMP916[1].typ = (&NTI188801);
TMP916[1].name = "fn";
TMP2970[1] = &TMP916[2];
NTI368016.size = sizeof(tenv368016);
NTI368016.kind = 17;
NTI368016.base = (&NTI2409);
TMP2971[0] = &TMP916[4];
TMP916[4].kind = 1;
TMP916[4].offset = offsetof(tenv368016, Attachednode);
TMP916[4].typ = (&NTI188795);
TMP916[4].name = "attachedNode";
TMP2971[1] = &TMP916[5];
TMP916[5].kind = 1;
TMP916[5].offset = offsetof(tenv368016, Createdvar);
TMP916[5].typ = (&NTI188801);
TMP916[5].name = "createdVar";
TMP2971[2] = &TMP916[6];
TMP916[6].kind = 1;
TMP916[6].offset = offsetof(tenv368016, Createdvarcomesfromiter);
TMP916[6].typ = (&NTI134);
TMP916[6].name = "createdVarComesFromIter";
TMP2971[3] = &TMP916[7];
TMP916[7].kind = 1;
TMP916[7].offset = offsetof(tenv368016, Capturedvars);
TMP916[7].typ = (&NTI188805);
TMP916[7].name = "capturedVars";
TMP2971[4] = &TMP916[8];
NTI368014.size = sizeof(tdep368014);
NTI368014.kind = 18;
NTI368014.base = 0;
TMP2972[0] = &TMP916[10];
TMP916[10].kind = 1;
TMP916[10].offset = offsetof(tdep368014, Field0);
TMP916[10].typ = (&NTI368012);
TMP916[10].name = "Field0";
TMP2972[1] = &TMP916[11];
TMP916[11].kind = 1;
TMP916[11].offset = offsetof(tdep368014, Field1);
TMP916[11].typ = (&NTI188801);
TMP916[11].name = "Field1";
TMP916[9].len = 2; TMP916[9].kind = 2; TMP916[9].sons = &TMP2972[0];
NTI368014.node = &TMP916[9];
NTI368028.size = sizeof(TY368028*);
NTI368028.kind = 24;
NTI368028.base = (&NTI368014);
NTI368028.marker = TMP2973;
TMP916[8].kind = 1;
TMP916[8].offset = offsetof(tenv368016, Deps);
TMP916[8].typ = (&NTI368028);
TMP916[8].name = "deps";
TMP2971[5] = &TMP916[12];
TMP916[12].kind = 1;
TMP916[12].offset = offsetof(tenv368016, Up);
TMP916[12].typ = (&NTI368012);
TMP916[12].name = "up";
TMP2971[6] = &TMP916[13];
TMP916[13].kind = 1;
TMP916[13].offset = offsetof(tenv368016, Obj);
TMP916[13].typ = (&NTI188799);
TMP916[13].name = "obj";
TMP916[3].len = 7; TMP916[3].kind = 2; TMP916[3].sons = &TMP2971[0];
NTI368016.node = &TMP916[3];
NTI368012.size = sizeof(tenv368016*);
NTI368012.kind = 22;
NTI368012.base = (&NTI368016);
NTI368012.marker = TMP2974;
TMP916[2].kind = 1;
TMP916[2].offset = offsetof(toutercontext368020, Currentenv);
TMP916[2].typ = (&NTI368012);
TMP916[2].name = "currentEnv";
TMP2970[2] = &TMP916[14];
TMP916[14].kind = 1;
TMP916[14].offset = offsetof(toutercontext368020, Isiter);
TMP916[14].typ = (&NTI134);
TMP916[14].name = "isIter";
TMP2970[3] = &TMP916[15];
TMP916[15].kind = 1;
TMP916[15].offset = offsetof(toutercontext368020, Capturedvars);
TMP916[15].typ = (&NTI185047);
TMP916[15].name = "capturedVars";
TMP2970[4] = &TMP916[16];
TMP916[16].kind = 1;
TMP916[16].offset = offsetof(toutercontext368020, Processed);
TMP916[16].typ = (&NTI185047);
TMP916[16].name = "processed";
TMP2970[5] = &TMP916[17];
TMP916[17].kind = 1;
TMP916[17].offset = offsetof(toutercontext368020, Localstoenv);
TMP916[17].typ = (&NTI188849);
TMP916[17].name = "localsToEnv";
TMP2970[6] = &TMP916[18];
TMP916[18].kind = 1;
TMP916[18].offset = offsetof(toutercontext368020, Localstoaccess);
TMP916[18].typ = (&NTI188855);
TMP916[18].name = "localsToAccess";
TMP2970[7] = &TMP916[19];
TMP916[19].kind = 1;
TMP916[19].offset = offsetof(toutercontext368020, Lambdastoenv);
TMP916[19].typ = (&NTI188849);
TMP916[19].name = "lambdasToEnv";
TMP2970[8] = &TMP916[20];
TMP916[20].kind = 1;
TMP916[20].offset = offsetof(toutercontext368020, Up);
TMP916[20].typ = (&NTI368010);
TMP916[20].name = "up";
TMP2970[9] = &TMP916[21];
TMP916[21].kind = 1;
TMP916[21].offset = offsetof(toutercontext368020, Closureparam);
TMP916[21].typ = (&NTI188801);
TMP916[21].name = "closureParam";
TMP2970[10] = &TMP916[22];
TMP916[22].kind = 1;
TMP916[22].offset = offsetof(toutercontext368020, State);
TMP916[22].typ = (&NTI188801);
TMP916[22].name = "state";
TMP2970[11] = &TMP916[23];
TMP916[23].kind = 1;
TMP916[23].offset = offsetof(toutercontext368020, Resultsym);
TMP916[23].typ = (&NTI188801);
TMP916[23].name = "resultSym";
TMP2970[12] = &TMP916[24];
TMP916[24].kind = 1;
TMP916[24].offset = offsetof(toutercontext368020, Obj);
TMP916[24].typ = (&NTI188799);
TMP916[24].name = "obj";
TMP916[0].len = 13; TMP916[0].kind = 2; TMP916[0].sons = &TMP2970[0];
NTI368020.node = &TMP916[0];
NTI368010.size = sizeof(toutercontext368020*);
NTI368010.kind = 22;
NTI368010.base = (&NTI368020);
NTI368010.marker = TMP2975;
NTI368018.size = sizeof(tinnercontext368018);
NTI368018.kind = 18;
NTI368018.base = 0;
TMP2982[0] = &TMP916[26];
TMP916[26].kind = 1;
TMP916[26].offset = offsetof(tinnercontext368018, Fn);
TMP916[26].typ = (&NTI188801);
TMP916[26].name = "fn";
TMP2982[1] = &TMP916[27];
TMP916[27].kind = 1;
TMP916[27].offset = offsetof(tinnercontext368018, Closureparam);
TMP916[27].typ = (&NTI188801);
TMP916[27].name = "closureParam";
TMP2982[2] = &TMP916[28];
TMP916[28].kind = 1;
TMP916[28].offset = offsetof(tinnercontext368018, Localstoaccess);
TMP916[28].typ = (&NTI188855);
TMP916[28].name = "localsToAccess";
TMP916[25].len = 3; TMP916[25].kind = 2; TMP916[25].sons = &TMP2982[0];
NTI368018.node = &TMP916[25];
NTI368008.size = sizeof(tinnercontext368018*);
NTI368008.kind = 22;
NTI368008.base = (&NTI368018);
NTI368008.marker = TMP2983;
}

