/* Generated by Nim Compiler v0.10.2 */
/*   (c) 2014 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_INTBITS 64
#include "nimbase.h"

#include <string.h>
typedef struct tident200021 tident200021;
typedef struct tnode225816 tnode225816;
typedef struct ttype225852 ttype225852;
typedef struct tlineinfo195539 tlineinfo195539;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tsym225846 tsym225846;
typedef struct tnodeseq225810 tnodeseq225810;
typedef struct tidobj200015 tidobj200015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct ttypeseq225848 ttypeseq225848;
typedef struct tscope225840 tscope225840;
typedef struct TY225947 TY225947;
typedef struct tinstantiation225836 tinstantiation225836;
typedef struct tstrtable225820 tstrtable225820;
typedef struct tsymseq225818 tsymseq225818;
typedef struct tloc225830 tloc225830;
typedef struct trope177009 trope177009;
typedef struct tlib225834 tlib225834;
typedef struct tcontext290021 tcontext290021;
typedef struct tpasscontext286005 tpasscontext286005;
typedef struct tproccon290011 tproccon290011;
typedef struct intset222056 intset222056;
typedef struct ttrunk222052 ttrunk222052;
typedef struct ttrunkseq222054 ttrunkseq222054;
typedef struct tlinkedlist127028 tlinkedlist127028;
typedef struct tlistentry127022 tlistentry127022;
typedef struct tidtable225864 tidtable225864;
typedef struct tidpairseq225862 tidpairseq225862;
typedef struct tidpair225860 tidpair225860;
typedef struct tctx289048 tctx289048;
typedef struct TY290133 TY290133;
typedef struct tinstantiationpair290013 tinstantiationpair290013;
typedef struct tcell44935 tcell44935;
typedef struct tcellset44947 tcellset44947;
typedef struct tgcheap47016 tgcheap47016;
typedef struct tcellseq44951 tcellseq44951;
typedef struct tpagedesc44943 tpagedesc44943;
typedef struct tmemregion27210 tmemregion27210;
typedef struct tsmallchunk26440 tsmallchunk26440;
typedef struct tllchunk27204 tllchunk27204;
typedef struct tbigchunk26442 tbigchunk26442;
typedef struct tintset26417 tintset26417;
typedef struct ttrunk26413 ttrunk26413;
typedef struct tavlnode27208 tavlnode27208;
typedef struct tgcstat47014 tgcstat47014;
typedef struct ttabiter235119 ttabiter235119;
typedef struct toverloaditer295491 toverloaditer295491;
typedef struct tidentiter235141 tidentiter235141;
typedef struct TY225936 TY225936;
typedef struct TY289250 TY289250;
typedef struct TY196414 TY196414;
typedef struct pprocHEX3Aobjecttype289230 pprocHEX3Aobjecttype289230;
typedef struct TY289269 TY289269;
typedef struct TY289270 TY289270;
typedef struct vmargs289042 vmargs289042;
typedef struct tbasechunk26438 tbasechunk26438;
typedef struct tfreecell26430 tfreecell26430;
typedef struct TY289231 TY289231;
typedef struct tblock289030 tblock289030;
typedef struct TY289211 TY289211;
typedef struct TY289237 TY289237;
struct  tlineinfo195539  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  tnode225816  {
ttype225852* Typ;
tlineinfo195539 Info;
NU16 Flags;
NU8 Kind;
union {
struct {NI64 Intval;
} S1;
struct {NF Floatval;
} S2;
struct {NimStringDesc* Strval;
} S3;
struct {tsym225846* Sym;
} S4;
struct {tident200021* Ident;
} S5;
struct {tnodeseq225810* Sons;
} S6;
} kindU;
NimStringDesc* Comment;
};
typedef N_NIMCALL_PTR(void, TY3089) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3094) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3089 marker;
TY3094 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  tidobj200015  {
  TNimObject Sup;
NI Id;
};
struct  tstrtable225820  {
NI Counter;
tsymseq225818* Data;
};
struct  tloc225830  {
NU8 K;
NU8 S;
NU8 Flags;
ttype225852* T;
trope177009* R;
trope177009* Heaproot;
};
struct  tsym225846  {
  tidobj200015 Sup;
NU8 Kind;
union {
struct {ttypeseq225848* Typeinstcache;
tscope225840* Typscope;
} S1;
struct {TY225947* Procinstcache;
tscope225840* Scope;
} S2;
struct {TY225947* Usedgenerics;
tstrtable225820 Tab;
} S3;
struct {tsym225846* Guard;
} S4;
} kindU;
NU16 Magic;
ttype225852* Typ;
tident200021* Name;
tlineinfo195539 Info;
tsym225846* Owner;
NU32 Flags;
tnode225816* Ast;
NU32 Options;
NI Position;
NI Offset;
tloc225830 Loc;
tlib225834* Annex;
tnode225816* Constraint;
};
struct  tident200021  {
  tidobj200015 Sup;
NimStringDesc* S;
tident200021* Next;
NI H;
};
struct  tscope225840  {
NI Depthlevel;
tstrtable225820 Symbols;
tnodeseq225810* Usingsyms;
tscope225840* Parent;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  tpasscontext286005  {
  TNimObject Sup;
NIM_BOOL Fromcache;
};
struct  intset222056  {
NI Counter;
NI Max;
ttrunk222052* Head;
ttrunkseq222054* Data;
};
struct  tlinkedlist127028  {
tlistentry127022* Head;
tlistentry127022* Tail;
NI Counter;
};
struct  tidpair225860  {
tidobj200015* Key;
TNimObject* Val;
};
struct  tidtable225864  {
NI Counter;
tidpairseq225862* Data;
};
typedef N_NIMCALL_PTR(tnode225816*, TY290064) (tcontext290021* c, tnode225816* n);
typedef N_NIMCALL_PTR(tnode225816*, TY290069) (tcontext290021* c, tnode225816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode225816*, TY290077) (tcontext290021* c, tnode225816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode225816*, TY290085) (tcontext290021* c, tnode225816* n);
typedef N_NIMCALL_PTR(tnode225816*, TY290090) (tcontext290021* c, tnode225816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode225816*, TY290098) (tcontext290021* c, tnode225816* n);
typedef N_NIMCALL_PTR(tnode225816*, TY290103) (tcontext290021* c, tnode225816* n, tnode225816* norig, NU32 filter);
typedef N_NIMCALL_PTR(ttype225852*, TY290110) (tcontext290021* c, tnode225816* n, ttype225852* prev);
typedef struct {
N_NIMCALL_PTR(tnode225816*, ClPrc) (tcontext290021* c, tidtable225864 pt, tnode225816* n, void* ClEnv);
void* ClEnv;
} TY290116;
typedef struct {
N_NIMCALL_PTR(tsym225846*, ClPrc) (tcontext290021* c, tsym225846* fn, tidtable225864 pt, tlineinfo195539 info, void* ClEnv);
void* ClEnv;
} TY290122;
struct  tinstantiationpair290013  {
tsym225846* Genericsym;
tinstantiation225836* Inst;
};
typedef N_NIMCALL_PTR(tsym225846*, TY290138) (tcontext290021* c, tsym225846* dc, ttype225852* t, tlineinfo195539 info);
struct  tcontext290021  {
  tpasscontext286005 Sup;
tsym225846* Module;
tscope225840* Currentscope;
tscope225840* Importtable;
tscope225840* Toplevelscope;
tproccon290011* P;
tsymseq225818* Friendmodules;
NI Instcounter;
intset222056 Ambiguoussymbols;
NI Intypeclass;
NI Ingenericcontext;
NI Inunrolledcontext;
NI Incompilescontext;
NI Ingenericinst;
tsymseq225818* Converters;
tsymseq225818* Patterns;
tlinkedlist127028 Optionstack;
tidtable225864 Symmapping;
tlinkedlist127028 Libs;
TY290064 Semconstexpr;
TY290069 Semexpr;
TY290077 Semtryexpr;
TY290085 Semtryconstexpr;
TY290090 Semoperand;
TY290098 Semconstboolexpr;
TY290103 Semoverloadedcall;
TY290110 Semtypenode;
TY290116 Seminferredlambda;
TY290122 Semgenerateinstance;
intset222056 Includedfiles;
tstrtable225820 Userpragmas;
tctx289048* Evalcontext;
intset222056 Unknownidents;
TY290133* Generics;
NI Lastgenericidx;
NI Hloloopdetector;
NI Inparallelstmt;
TY290138 Instdeepcopy;
};
struct  tcell44935  {
NI Refcount;
TNimType* Typ;
};
struct  tcellseq44951  {
NI Len;
NI Cap;
tcell44935** D;
};
struct  tcellset44947  {
NI Counter;
NI Max;
tpagedesc44943* Head;
tpagedesc44943** Data;
};
typedef tsmallchunk26440* TY27222[512];
typedef ttrunk26413* ttrunkbuckets26415[256];
struct  tintset26417  {
ttrunkbuckets26415 Data;
};
struct  tmemregion27210  {
NI Minlargeobj;
NI Maxlargeobj;
TY27222 Freesmallchunks;
tllchunk27204* Llmem;
NI Currmem;
NI Maxmem;
NI Freemem;
NI Lastsize;
tbigchunk26442* Freechunkslist;
tintset26417 Chunkstarts;
tavlnode27208* Root;
tavlnode27208* Deleted;
tavlnode27208* Last;
tavlnode27208* Freeavlnodes;
};
struct  tgcstat47014  {
NI Stackscans;
NI Cyclecollections;
NI Maxthreshold;
NI Maxstacksize;
NI Maxstackcells;
NI Cycletablesize;
NI64 Maxpause;
};
struct  tgcheap47016  {
void* Stackbottom;
NI Cyclethreshold;
tcellseq44951 Zct;
tcellseq44951 Decstack;
tcellset44947 Cycleroots;
tcellseq44951 Tempstack;
NI Recgclock;
tmemregion27210 Region;
tgcstat47014 Stat;
};
struct  ttabiter235119  {
NI H;
};
struct  ttype225852  {
  tidobj200015 Sup;
NU8 Kind;
NU8 Callconv;
NU32 Flags;
ttypeseq225848* Sons;
tnode225816* N;
tsym225846* Owner;
tsym225846* Sym;
tsym225846* Destructor;
tsym225846* Deepcopy;
NI64 Size;
NI16 Align;
NI16 Locklevel;
tloc225830 Loc;
};
struct  tidentiter235141  {
NI H;
tident200021* Name;
};
struct  toverloaditer295491  {
tidentiter235141 It;
tsym225846* M;
NU8 Mode;
NI Symchoiceindex;
tscope225840* Scope;
intset222056 Insymchoice;
};
struct  tinstantiation225836  {
tsym225846* Sym;
ttypeseq225848* Concretetypes;
TY225936* Usedby;
};
struct  trope177009  {
  TNimObject Sup;
trope177009* Left;
trope177009* Right;
NI Length;
NimStringDesc* Data;
};
struct  tlistentry127022  {
  TNimObject Sup;
tlistentry127022* Prev;
tlistentry127022* Next;
};
struct  tlib225834  {
  tlistentry127022 Sup;
NU8 Kind;
NIM_BOOL Generated;
NIM_BOOL Isoverriden;
trope177009* Name;
tnode225816* Path;
};
struct  tproccon290011  {
tsym225846* Owner;
tsym225846* Resultsym;
NI Nestedloopcounter;
NI Nestedblockcounter;
NI Intrystmt;
tproccon290011* Next;
};
typedef NI TY26420[8];
struct  ttrunk222052  {
ttrunk222052* Next;
NI Key;
TY26420 Bits;
};
struct  vmargs289042  {
NI Ra;
NI Rb;
NI Rc;
void* Slots;
tnode225816* Currentexception;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (vmargs289042* args, void* ClEnv);
void* ClEnv;
} vmcallback289044;
struct TY289270 {
NimStringDesc* Field0;
vmcallback289044 Field1;
};
struct  tctx289048  {
  tpasscontext286005 Sup;
TY289250* Code;
TY196414* Debug;
tnode225816* Globals;
tnode225816* Constants;
ttypeseq225848* Types;
tnode225816* Currentexceptiona;
tnode225816* Currentexceptionb;
NI Exceptioninstr;
pprocHEX3Aobjecttype289230* Prc;
tsym225846* Module;
tnode225816* Callsite;
NU8 Mode;
NU8 Features;
NIM_BOOL Traceactive;
NI Loopiterations;
tlineinfo195539 Comesfromheuristic;
TY289269* Callbacks;
NimStringDesc* Errorflag;
};
struct  tpagedesc44943  {
tpagedesc44943* Next;
NI Key;
TY26420 Bits;
};
struct  tbasechunk26438  {
NI Prevsize;
NI Size;
NIM_BOOL Used;
};
struct  tsmallchunk26440  {
  tbasechunk26438 Sup;
tsmallchunk26440* Next;
tsmallchunk26440* Prev;
tfreecell26430* Freelist;
NI Free;
NI Acc;
NF Data;
};
struct  tllchunk27204  {
NI Size;
NI Acc;
tllchunk27204* Next;
};
struct  tbigchunk26442  {
  tbasechunk26438 Sup;
tbigchunk26442* Next;
tbigchunk26442* Prev;
NI Align;
NF Data;
};
struct  ttrunk26413  {
ttrunk26413* Next;
NI Key;
TY26420 Bits;
};
typedef tavlnode27208* TY27214[2];
struct  tavlnode27208  {
TY27214 Link;
NI Key;
NI Upperbound;
NI Level;
};
struct  tblock289030  {
tsym225846* Label;
TY289211* Fixups;
};
struct TY289237 {
NIM_BOOL Field0;
NU8 Field1;
};
typedef TY289237 TY289234[256];
struct  pprocHEX3Aobjecttype289230  {
TY289231* Blocks;
tsym225846* Sym;
TY289234 Slots;
NI Maxslots;
};
struct  tfreecell26430  {
tfreecell26430* Next;
NI Zerofield;
};
struct tnodeseq225810 {
  TGenericSeq Sup;
  tnode225816* data[SEQ_DECL_SIZE];
};
struct ttypeseq225848 {
  TGenericSeq Sup;
  ttype225852* data[SEQ_DECL_SIZE];
};
struct TY225947 {
  TGenericSeq Sup;
  tinstantiation225836* data[SEQ_DECL_SIZE];
};
struct tsymseq225818 {
  TGenericSeq Sup;
  tsym225846* data[SEQ_DECL_SIZE];
};
struct ttrunkseq222054 {
  TGenericSeq Sup;
  ttrunk222052* data[SEQ_DECL_SIZE];
};
struct tidpairseq225862 {
  TGenericSeq Sup;
  tidpair225860 data[SEQ_DECL_SIZE];
};
struct TY290133 {
  TGenericSeq Sup;
  tinstantiationpair290013 data[SEQ_DECL_SIZE];
};
struct TY225936 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct TY289250 {
  TGenericSeq Sup;
  NU32 data[SEQ_DECL_SIZE];
};
struct TY196414 {
  TGenericSeq Sup;
  tlineinfo195539 data[SEQ_DECL_SIZE];
};
struct TY289269 {
  TGenericSeq Sup;
  TY289270 data[SEQ_DECL_SIZE];
};
struct TY289211 {
  TGenericSeq Sup;
  NI data[SEQ_DECL_SIZE];
};
struct TY289231 {
  TGenericSeq Sup;
  tblock289030 data[SEQ_DECL_SIZE];
};
static N_INLINE(NI, len_226364)(tnode225816* n);
N_NIMCALL(void, globalerror_197934)(tlineinfo195539 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, rendertree_250058)(tnode225816* n, NU8 renderflags);
N_NIMCALL(tident200021*, considerquotedident_295010)(tnode225816* n);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
N_NIMCALL(tident200021*, getident_200472)(NimStringDesc* identifier);
N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incref_51025)(tcell44935* c);
static N_INLINE(NIM_BOOL, canbecycleroot_48667)(tcell44935* c);
static N_INLINE(void, rtladdcycleroot_49429)(tcell44935* c);
N_NOINLINE(void, incl_45671)(tcellset44947* s, tcell44935* cell);
static N_INLINE(tcell44935*, usrtocell_48646)(void* usr);
static N_INLINE(void, decref_50604)(tcell44935* c);
static N_INLINE(void, rtladdzct_50204)(tcell44935* c);
N_NOINLINE(void, addzct_48617)(tcellseq44951* s, tcell44935* c);
N_NIMCALL(void, newstrtable_229833)(tstrtable225820* Result);
static N_INLINE(NI, scopedepth_290228)(tcontext290021* c);
N_NIMCALL(NIM_BOOL, adduniquesym_295179)(tscope225840* scope, tsym225846* s);
N_NIMCALL(NIM_BOOL, strtableincl_240807)(tstrtable225820* t, tsym225846* n);
N_NIMCALL(void, wrongredefinition_295675)(tlineinfo195539 info, NimStringDesc* s);
N_NIMCALL(void, localerror_197955)(tlineinfo195539 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, ensurenomissingorunusedsymbols_295004)(tscope225840* scope);
N_NIMCALL(tsym225846*, inittabiter_235124)(ttabiter235119* ti, tstrtable225820 tab);
N_NIMCALL(NimStringDesc*, getsymrepr_295507)(tsym225846* s);
N_NIMCALL(NimStringDesc*, getprocheader_263519)(tsym225846* sym, NU8 prefer);
N_NIMCALL(void, message_197976)(tlineinfo195539 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(tsym225846*, nextiter_235132)(ttabiter235119* ti, tstrtable225820 tab);
N_NIMCALL(void, rawclosescope_295202)(tcontext290021* c);
N_NIMCALL(tsym225846*, skipalias_295255)(tsym225846* s, tnode225816* n);
N_NIMCALL(void, replacedeprecated_294324)(tlineinfo195539 info, tsym225846* oldsym, tsym225846* newsym);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(tsym225846*, searchinscopes_295312)(tcontext290021* c, tident200021* s);
N_NIMCALL(tsym225846*, strtableget_235111)(tstrtable225820 t, tident200021* name);
N_NIMCALL(tsym225846*, errorsym_295412)(tcontext290021* c, tnode225816* n);
N_NIMCALL(tsym225846*, newsym_226074)(NU8 symkind, tident200021* name, tsym225846* owner, tlineinfo195539 info);
N_NIMCALL(tsym225846*, getcurrowner_290255)(void);
N_NIMCALL(ttype225852*, errortype_291318)(tcontext290021* c);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(void, strtableadd_235103)(tstrtable225820* t, tsym225846* n);
N_NIMCALL(void, internalerror_197987)(tlineinfo195539 info, NimStringDesc* errmsg);
N_NIMCALL(NIM_BOOL, contains_222837)(intset222056* s, NI key);
N_NIMCALL(void, loadstub_279260)(tsym225846* s);
N_NIMCALL(tsym225846*, qualifiedlookup_296122)(tcontext290021* c, tnode225816* n, NU8 flags);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(tsym225846*, initidentiter_235147)(tidentiter235141* ti, tstrtable225820 tab, tident200021* s);
N_NIMCALL(void, initintset_222950)(intset222056* Result);
N_NIMCALL(void, incl_222869)(intset222056* s, NI key);
N_NIMCALL(tsym225846*, nextidentiter_235156)(tidentiter235141* ti, tstrtable225820 tab);
static N_INLINE(NI, sonslen_226249)(tnode225816* n);
N_NIMCALL(tsym225846*, firstidentexcluding_241374)(tidentiter235141* ti, tstrtable225820 tab, tident200021* s, intset222056* excluding);
N_NIMCALL(tsym225846*, nextidentexcluding_241317)(tidentiter235141* ti, tstrtable225820 tab, intset222056* excluding);
N_NIMCALL(void, adddecl_295694)(tcontext290021* c, tsym225846* sym);
N_NIMCALL(void, addinterfacedeclaux_295724)(tcontext290021* c, tsym225846* sym);
N_NIMCALL(void, addoverloadablesymat_295790)(tscope225840* scope, tsym225846* fn);
N_NIMCALL(void, adddeclat_295714)(tscope225840* scope, tsym225846* sym);
STRING_LITERAL(TMP2637, "", 0);
STRING_LITERAL(TMP2719, "use ", 4);
STRING_LITERAL(TMP2720, " instead; ", 10);
STRING_LITERAL(TMP2721, "err:", 4);
STRING_LITERAL(TMP2722, "lookUp", 6);
STRING_LITERAL(TMP2930, "AddInterfaceDeclAux", 19);
STRING_LITERAL(TMP3004, "addOverloadableSymAt", 20);
extern TNimType NTI225842; /* PScope */
extern tgcheap47016 gch_47044;
extern NU8 gcmd_169120;

static N_INLINE(NI, len_226364)(tnode225816* 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(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
	memcpy(((NCSTRING) ((&(*dest).data[((*dest).Sup.len)- 0]))), ((NCSTRING) ((*src).data)), (NI64)((*src).Sup.len + 1));
	(*dest).Sup.len += (*src).Sup.len;
}

N_NIMCALL(tident200021*, considerquotedident_295010)(tnode225816* n) {
	tident200021* result;
	result = 0;
	switch ((*n).Kind) {
	case ((NU8) 2):
	{
		result = (*n).kindU.S5.Ident;
	}
	break;
	case ((NU8) 3):
	{
		result = (*(*n).kindU.S4.Sym).Name;
	}
	break;
	case ((NU8) 53):
	{
		NI LOC4;
		LOC4 = 0;
		LOC4 = len_226364(n);
		switch (LOC4) {
		case 0:
		{
			NimStringDesc* LOC6;
			LOC6 = 0;
			LOC6 = rendertree_250058(n, 0);
			globalerror_197934((*n).Info, ((NU16) 19), LOC6);
		}
		break;
		case 1:
		{
			result = considerquotedident_295010((*n).kindU.S6.Sons->data[0]);
		}
		break;
		default:
		{
			NimStringDesc* id;
			id = copyString(((NimStringDesc*) &TMP2637));
			{
				NI i_295078;
				NI HEX3Atmp_295151;
				NI LOC10;
				NI res_295154;
				i_295078 = 0;
				HEX3Atmp_295151 = 0;
				LOC10 = 0;
				LOC10 = len_226364(n);
				HEX3Atmp_295151 = (LOC10 - 1);
				res_295154 = 0;
				{
					while (1) {
						tnode225816* x;
						if (!(res_295154 <= HEX3Atmp_295151)) goto LA12;
						i_295078 = res_295154;
						x = (*n).kindU.S6.Sons->data[i_295078];
						switch ((*x).Kind) {
						case ((NU8) 2):
						{
							id = resizeString(id, (*(*x).kindU.S5.Ident).S->Sup.len + 0);
appendString(id, (*(*x).kindU.S5.Ident).S);
						}
						break;
						case ((NU8) 3):
						{
							id = resizeString(id, (*(*(*x).kindU.S4.Sym).Name).S->Sup.len + 0);
appendString(id, (*(*(*x).kindU.S4.Sym).Name).S);
						}
						break;
						default:
						{
							NimStringDesc* LOC16;
							LOC16 = 0;
							LOC16 = rendertree_250058(n, 0);
							globalerror_197934((*n).Info, ((NU16) 19), LOC16);
						}
						break;
						}
						res_295154 += 1;
					} LA12: ;
				}
			}
			result = getident_200472(id);
		}
		break;
		}
	}
	break;
	case ((NU8) 57):
	case ((NU8) 56):
	{
		result = (*(*(*n).kindU.S6.Sons->data[0]).kindU.S4.Sym).Name;
	}
	break;
	default:
	{
		NimStringDesc* LOC19;
		LOC19 = 0;
		LOC19 = rendertree_250058(n, 0);
		globalerror_197934((*n).Info, ((NU16) 19), LOC19);
	}
	break;
	}
	return result;
}

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

static N_INLINE(void, rtladdcycleroot_49429)(tcell44935* c) {
	{
		if (!!((((NI) ((NI)((*c).Refcount & 3))) == 3))) goto LA3;
		(*c).Refcount = (NI)((NI)((*c).Refcount & -4) | 3);
		incl_45671((&gch_47044.Cycleroots), c);
	}
	LA3: ;
}

static N_INLINE(void, incref_51025)(tcell44935* c) {
	(*c).Refcount = (NI)((NU64)((*c).Refcount) + (NU64)(8));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = canbecycleroot_48667(c);
		if (!LOC3) goto LA4;
		rtladdcycleroot_49429(c);
	}
	LA4: ;
}

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

static N_INLINE(void, rtladdzct_50204)(tcell44935* c) {
	addzct_48617((&gch_47044.Zct), c);
}

static N_INLINE(void, decref_50604)(tcell44935* c) {
	{
		(*c).Refcount -= 8;
		if (!((NU64)((*c).Refcount) < (NU64)(8))) goto LA3;
		rtladdzct_50204(c);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = canbecycleroot_48667(c);
		if (!LOC6) goto LA7;
		rtladdcycleroot_49429(c);
	}
	goto LA1;
	LA7: ;
	LA1: ;
}

static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		tcell44935* LOC5;
		if (!!((src == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = usrtocell_48646(src);
		incref_51025(LOC5);
	}
	LA3: ;
	{
		tcell44935* LOC10;
		if (!!(((*dest) == NIM_NIL))) goto LA8;
		LOC10 = 0;
		LOC10 = usrtocell_48646((*dest));
		decref_50604(LOC10);
	}
	LA8: ;
	(*dest) = src;
}

static N_INLINE(NI, scopedepth_290228)(tcontext290021* c) {
	NI result;
	result = 0;
	{
		if (!!(((*c).Currentscope == NIM_NIL))) goto LA3;
		result = (*(*c).Currentscope).Depthlevel;
	}
	goto LA1;
	LA3: ;
	{
		result = 0;
	}
	LA1: ;
	return result;
}

N_NIMCALL(tscope225840*, openscope_295191)(tcontext290021* c) {
	tscope225840* result;
	tscope225840* LOC1;
	NI LOC2;
	result = 0;
	LOC1 = 0;
	LOC1 = (tscope225840*) newObj((&NTI225842), sizeof(tscope225840));
	asgnRef((void**) (&(*LOC1).Parent), (*c).Currentscope);
	newstrtable_229833((&(*LOC1).Symbols));
	LOC2 = 0;
	LOC2 = scopedepth_290228(c);
	(*LOC1).Depthlevel = (NI64)(LOC2 + 1);
	result = LOC1;
	asgnRef((void**) (&(*c).Currentscope), result);
	return result;
}

N_NIMCALL(NIM_BOOL, adduniquesym_295179)(tscope225840* scope, tsym225846* s) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = strtableincl_240807((&(*scope).Symbols), s);
	result = !(LOC1);
	return result;
}

N_NIMCALL(void, wrongredefinition_295675)(tlineinfo195539 info, NimStringDesc* s) {
	{
		if (!!((gcmd_169120 == ((NU8) 18)))) goto LA3;
		localerror_197955(info, ((NU16) 40), s);
	}
	LA3: ;
}

N_NIMCALL(void, adddecl_295694)(tcontext290021* c, tsym225846* sym) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = adduniquesym_295179((*c).Currentscope, sym);
		if (!!(LOC3)) goto LA4;
		wrongredefinition_295675((*sym).Info, (*(*sym).Name).S);
	}
	LA4: ;
}

N_NIMCALL(NimStringDesc*, getsymrepr_295507)(tsym225846* s) {
	NimStringDesc* result;
	result = 0;
	switch ((*s).Kind) {
	case ((NU8) 12):
	case ((NU8) 13):
	case ((NU8) 16):
	case ((NU8) 14):
	case ((NU8) 15):
	{
		result = getprocheader_263519(s, ((NU8) 0));
	}
	break;
	default:
	{
		result = copyString((*(*s).Name).S);
	}
	break;
	}
	return result;
}

N_NIMCALL(void, ensurenomissingorunusedsymbols_295004)(tscope225840* scope) {
	ttabiter235119 it;
	tsym225846* s;
	NI missingimpls;
	memset((void*)(&it), 0, sizeof(it));
	s = inittabiter_235124((&it), (*scope).Symbols);
	missingimpls = 0;
	{
		while (1) {
			if (!!((s == NIM_NIL))) goto LA2;
			{
				if (!(((*s).Flags &(1<<((((NU8) 4))&31)))!=0)) goto LA5;
				{
					NimStringDesc* LOC11;
					if (!(missingimpls == 0)) goto LA9;
					LOC11 = 0;
					LOC11 = getsymrepr_295507(s);
					localerror_197955((*s).Info, ((NU16) 138), LOC11);
				}
				LA9: ;
				missingimpls += 1;
			}
			goto LA3;
			LA5: ;
			{
				NIM_BOOL LOC13;
				LOC13 = 0;
				LOC13 = ((3 & (*s).Flags) == 0);
				if (!(LOC13)) goto LA14;
				LOC13 = (((*s).Options &(1<<((((NU8) 12))&31)))!=0);
				LA14: ;
				if (!LOC13) goto LA15;
				{
					if (!!(((2105369 &(1<<(((*s).Kind)&31)))!=0))) goto LA19;
					{
						NIM_BOOL LOC23;
						NimStringDesc* LOC27;
						LOC23 = 0;
						LOC23 = !(((*s).Typ == NIM_NIL));
						if (!(LOC23)) goto LA24;
						LOC23 = !((((*(*s).Typ).Flags &(1<<((((NU8) 24))&31)))!=0));
						LA24: ;
						if (!LOC23) goto LA25;
						LOC27 = 0;
						LOC27 = getsymrepr_295507(s);
						message_197976((*s).Info, ((NU16) 262), LOC27);
					}
					LA25: ;
				}
				LA19: ;
			}
			goto LA3;
			LA15: ;
			LA3: ;
			s = nextiter_235132((&it), (*scope).Symbols);
		} LA2: ;
	}
}

N_NIMCALL(void, rawclosescope_295202)(tcontext290021* c) {
	asgnRef((void**) (&(*c).Currentscope), (*(*c).Currentscope).Parent);
}

N_NIMCALL(void, closescope_295211)(tcontext290021* c) {
	ensurenomissingorunusedsymbols_295004((*c).Currentscope);
	rawclosescope_295202(c);
}

N_NIMCALL(tsym225846*, skipalias_295255)(tsym225846* s, tnode225816* n) {
	tsym225846* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = (s == NIM_NIL);
		if (LOC3) goto LA4;
		LOC3 = !(((*s).Kind == ((NU8) 25)));
		LA4: ;
		if (!LOC3) goto LA5;
		result = s;
	}
	goto LA1;
	LA5: ;
	{
		result = (*s).Owner;
		{
			if (!(gcmd_169120 == ((NU8) 7))) goto LA10;
			replacedeprecated_294324((*n).Info, s, result);
		}
		goto LA8;
		LA10: ;
		{
			NimStringDesc* LOC13;
			LOC13 = 0;
			LOC13 = rawNewString((*(*result).Name).S->Sup.len + (*(*s).Name).S->Sup.len + 14);
appendString(LOC13, ((NimStringDesc*) &TMP2719));
appendString(LOC13, (*(*result).Name).S);
appendString(LOC13, ((NimStringDesc*) &TMP2720));
appendString(LOC13, (*(*s).Name).S);
			message_197976((*n).Info, ((NU16) 234), LOC13);
		}
		LA8: ;
	}
	LA1: ;
	return result;
}

N_NIMCALL(tsym225846*, searchinscopes_295312)(tcontext290021* c, tident200021* s) {
	tsym225846* result;
	result = 0;
	{
		tscope225840* scope_295317;
		tscope225840* HEX3Atmp_295336;
		tscope225840* current_295339;
		scope_295317 = 0;
		HEX3Atmp_295336 = 0;
		HEX3Atmp_295336 = (*c).Currentscope;
		current_295339 = HEX3Atmp_295336;
		{
			while (1) {
				if (!!((current_295339 == NIM_NIL))) goto LA3;
				scope_295317 = current_295339;
				result = strtableget_235111((*scope_295317).Symbols, s);
				{
					if (!!((result == NIM_NIL))) goto LA6;
					goto BeforeRet;
				}
				LA6: ;
				current_295339 = (*current_295339).Parent;
			} LA3: ;
		}
	}
	result = NIM_NIL;
	BeforeRet: ;
	return result;
}

static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) {
	{
		tcell44935* c;
		if (!!((src == NIM_NIL))) goto LA3;
		c = usrtocell_48646(src);
		(*c).Refcount += 8;
	}
	LA3: ;
	{
		tcell44935* c;
		if (!!(((*dest) == NIM_NIL))) goto LA7;
		c = usrtocell_48646((*dest));
		{
			(*c).Refcount -= 8;
			if (!((NU64)((*c).Refcount) < (NU64)(8))) goto LA11;
			rtladdzct_50204(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

N_NIMCALL(tsym225846*, errorsym_295412)(tcontext290021* c, tnode225816* n) {
	tsym225846* result;
	tnode225816* m;
	tident200021* ident;
	tsym225846* LOC12;
	result = 0;
	m = n;
	{
		if (!((*m).Kind == ((NU8) 45))) goto LA3;
		m = (*m).kindU.S6.Sons->data[1];
	}
	LA3: ;
	{
		if (!((*m).Kind == ((NU8) 2) || (*m).Kind == ((NU8) 3) || (*m).Kind == ((NU8) 53))) goto LA7;
		ident = considerquotedident_295010(m);
	}
	goto LA5;
	LA7: ;
	{
		NimStringDesc* LOC10;
		NimStringDesc* LOC11;
		LOC10 = 0;
		LOC11 = 0;
		LOC11 = rendertree_250058(m, 0);
		LOC10 = rawNewString(LOC11->Sup.len + 4);
appendString(LOC10, ((NimStringDesc*) &TMP2721));
appendString(LOC10, LOC11);
		ident = getident_200472(LOC10);
	}
	LA5: ;
	LOC12 = 0;
	LOC12 = getcurrowner_290255();
	result = newsym_226074(((NU8) 0), ident, LOC12, (*n).Info);
	asgnRefNoCycle((void**) (&(*result).Typ), errortype_291318(c));
	(*result).Flags |= ((NI32)1)<<((((NU8) 29))%(sizeof(NI32)*8));
	{
		NIM_BOOL LOC15;
		LOC15 = 0;
		LOC15 = !((gcmd_169120 == ((NU8) 18)));
		if (!(LOC15)) goto LA16;
		LOC15 = ((*c).Incompilescontext == 0);
		LA16: ;
		if (!LOC15) goto LA17;
		strtableadd_235103((&(*(*c).Importtable).Symbols), result);
	}
	LA17: ;
	return result;
}

N_NIMCALL(tsym225846*, lookup_296004)(tcontext290021* c, tnode225816* n) {
	tsym225846* result;
	result = 0;
	switch ((*n).Kind) {
	case ((NU8) 2):
	{
		tsym225846* LOC2;
		LOC2 = 0;
		LOC2 = searchinscopes_295312(c, (*n).kindU.S5.Ident);
		result = skipalias_295255(LOC2, n);
		{
			if (!(result == NIM_NIL)) goto LA5;
			localerror_197955((*n).Info, ((NU16) 61), (*(*n).kindU.S5.Ident).S);
			result = errorsym_295412(c, n);
		}
		LA5: ;
	}
	break;
	case ((NU8) 3):
	{
		result = (*n).kindU.S4.Sym;
	}
	break;
	case ((NU8) 53):
	{
		tident200021* ident;
		tsym225846* LOC9;
		ident = considerquotedident_295010(n);
		LOC9 = 0;
		LOC9 = searchinscopes_295312(c, ident);
		result = skipalias_295255(LOC9, n);
		{
			if (!(result == NIM_NIL)) goto LA12;
			localerror_197955((*n).Info, ((NU16) 61), (*ident).S);
			result = errorsym_295412(c, n);
		}
		LA12: ;
	}
	break;
	default:
	{
		internalerror_197987((*n).Info, ((NimStringDesc*) &TMP2722));
		goto BeforeRet;
	}
	break;
	}
	{
		NIM_BOOL LOC17;
		LOC17 = 0;
		LOC17 = contains_222837((&(*c).Ambiguoussymbols), (*result).Sup.Id);
		if (!LOC17) goto LA18;
		localerror_197955((*n).Info, ((NU16) 62), (*(*result).Name).S);
	}
	LA18: ;
	{
		if (!((*result).Kind == ((NU8) 23))) goto LA22;
		loadstub_279260(result);
	}
	LA22: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(tsym225846*, qualifiedlookup_296122)(tcontext290021* c, tnode225816* n, NU8 flags) {
	tsym225846* result;
	result = 0;
	switch ((*n).Kind) {
	case ((NU8) 2):
	case ((NU8) 53):
	{
		tident200021* ident;
		tsym225846* LOC2;
		ident = considerquotedident_295010(n);
		LOC2 = 0;
		LOC2 = searchinscopes_295312(c, ident);
		result = skipalias_295255(LOC2, n);
		{
			NIM_BOOL LOC5;
			LOC5 = 0;
			LOC5 = (result == NIM_NIL);
			if (!(LOC5)) goto LA6;
			LOC5 = ((flags &(1<<((((NU8) 1))&7)))!=0);
			LA6: ;
			if (!LOC5) goto LA7;
			localerror_197955((*n).Info, ((NU16) 61), (*ident).S);
			result = errorsym_295412(c, n);
		}
		goto LA3;
		LA7: ;
		{
			NIM_BOOL LOC10;
			NIM_BOOL LOC11;
			LOC10 = 0;
			LOC11 = 0;
			LOC11 = ((flags &(1<<((((NU8) 0))&7)))!=0);
			if (!(LOC11)) goto LA12;
			LOC11 = !((result == NIM_NIL));
			LA12: ;
			LOC10 = LOC11;
			if (!(LOC10)) goto LA13;
			LOC10 = contains_222837((&(*c).Ambiguoussymbols), (*result).Sup.Id);
			LA13: ;
			if (!LOC10) goto LA14;
			localerror_197955((*n).Info, ((NU16) 62), (*ident).S);
		}
		goto LA3;
		LA14: ;
		LA3: ;
	}
	break;
	case ((NU8) 3):
	{
		result = (*n).kindU.S4.Sym;
		{
			NIM_BOOL LOC19;
			LOC19 = 0;
			LOC19 = ((flags &(1<<((((NU8) 0))&7)))!=0);
			if (!(LOC19)) goto LA20;
			LOC19 = contains_222837((&(*c).Ambiguoussymbols), (*result).Sup.Id);
			LA20: ;
			if (!LOC19) goto LA21;
			localerror_197955((*n).Info, ((NU16) 62), (*(*(*n).kindU.S4.Sym).Name).S);
		}
		LA21: ;
	}
	break;
	case ((NU8) 45):
	{
		tsym225846* m;
		result = NIM_NIL;
		m = qualifiedlookup_296122(c, (*n).kindU.S6.Sons->data[0], (flags & 2));
		{
			NIM_BOOL LOC26;
			tident200021* ident;
			LOC26 = 0;
			LOC26 = !((m == NIM_NIL));
			if (!(LOC26)) goto LA27;
			LOC26 = ((*m).Kind == ((NU8) 6));
			LA27: ;
			if (!LOC26) goto LA28;
			ident = NIM_NIL;
			{
				if (!((*(*n).kindU.S6.Sons->data[1]).Kind == ((NU8) 2))) goto LA32;
				ident = (*(*n).kindU.S6.Sons->data[1]).kindU.S5.Ident;
			}
			goto LA30;
			LA32: ;
			{
				if (!((*(*n).kindU.S6.Sons->data[1]).Kind == ((NU8) 53))) goto LA35;
				ident = considerquotedident_295010((*n).kindU.S6.Sons->data[1]);
			}
			goto LA30;
			LA35: ;
			LA30: ;
			{
				if (!!((ident == NIM_NIL))) goto LA39;
				{
					tsym225846* LOC45;
					if (!(m == (*c).Module)) goto LA43;
					LOC45 = 0;
					LOC45 = strtableget_235111((*(*c).Toplevelscope).Symbols, ident);
					result = skipalias_295255(LOC45, n);
				}
				goto LA41;
				LA43: ;
				{
					tsym225846* LOC47;
					LOC47 = 0;
					LOC47 = strtableget_235111((*m).kindU.S3.Tab, ident);
					result = skipalias_295255(LOC47, n);
				}
				LA41: ;
				{
					NIM_BOOL LOC50;
					LOC50 = 0;
					LOC50 = (result == NIM_NIL);
					if (!(LOC50)) goto LA51;
					LOC50 = ((flags &(1<<((((NU8) 1))&7)))!=0);
					LA51: ;
					if (!LOC50) goto LA52;
					localerror_197955((*(*n).kindU.S6.Sons->data[1]).Info, ((NU16) 61), (*ident).S);
					result = errorsym_295412(c, (*n).kindU.S6.Sons->data[1]);
				}
				LA52: ;
			}
			goto LA37;
			LA39: ;
			{
				if (!((*(*n).kindU.S6.Sons->data[1]).Kind == ((NU8) 3))) goto LA55;
				result = (*(*n).kindU.S6.Sons->data[1]).kindU.S4.Sym;
			}
			goto LA37;
			LA55: ;
			{
				NIM_BOOL LOC58;
				NimStringDesc* LOC62;
				LOC58 = 0;
				LOC58 = ((flags &(1<<((((NU8) 1))&7)))!=0);
				if (!(LOC58)) goto LA59;
				LOC58 = !(((*(*n).kindU.S6.Sons->data[1]).Kind == ((NU8) 57) || (*(*n).kindU.S6.Sons->data[1]).Kind == ((NU8) 56)));
				LA59: ;
				if (!LOC58) goto LA60;
				LOC62 = 0;
				LOC62 = rendertree_250058((*n).kindU.S6.Sons->data[1], 0);
				localerror_197955((*(*n).kindU.S6.Sons->data[1]).Info, ((NU16) 19), LOC62);
				result = errorsym_295412(c, (*n).kindU.S6.Sons->data[1]);
			}
			goto LA37;
			LA60: ;
			LA37: ;
		}
		LA28: ;
	}
	break;
	default:
	{
		result = NIM_NIL;
	}
	break;
	}
	{
		NIM_BOOL LOC66;
		LOC66 = 0;
		LOC66 = !((result == NIM_NIL));
		if (!(LOC66)) goto LA67;
		LOC66 = ((*result).Kind == ((NU8) 23));
		LA67: ;
		if (!LOC66) goto LA68;
		loadstub_279260(result);
	}
	LA68: ;
	return result;
}

N_NIMCALL(tsym225846*, initoverloaditer_296665)(toverloaditer295491* o, tcontext290021* c, tnode225816* n) {
	tsym225846* result;
	result = 0;
	switch ((*n).Kind) {
	case ((NU8) 2):
	case ((NU8) 53):
	{
		tident200021* ident;
		ident = considerquotedident_295010(n);
		unsureAsgnRef((void**) (&(*o).Scope), (*c).Currentscope);
		(*o).Mode = ((NU8) 1);
		{
			while (1) {
				tsym225846* LOC4;
				LOC4 = 0;
				LOC4 = initidentiter_235147((&(*o).It), (*(*o).Scope).Symbols, ident);
				result = skipalias_295255(LOC4, n);
				{
					if (!!((result == NIM_NIL))) goto LA7;
					goto LA2;
				}
				goto LA5;
				LA7: ;
				{
					unsureAsgnRef((void**) (&(*o).Scope), (*(*o).Scope).Parent);
					{
						if (!((*o).Scope == NIM_NIL)) goto LA12;
						goto LA2;
					}
					LA12: ;
				}
				LA5: ;
			}
		} LA2: ;
	}
	break;
	case ((NU8) 3):
	{
		result = (*n).kindU.S4.Sym;
		(*o).Mode = ((NU8) 0);
	}
	break;
	case ((NU8) 45):
	{
		(*o).Mode = ((NU8) 3);
		unsureAsgnRef((void**) (&(*o).M), qualifiedlookup_296122(c, (*n).kindU.S6.Sons->data[0], 2));
		{
			NIM_BOOL LOC18;
			tident200021* ident;
			LOC18 = 0;
			LOC18 = !(((*o).M == NIM_NIL));
			if (!(LOC18)) goto LA19;
			LOC18 = ((*(*o).M).Kind == ((NU8) 6));
			LA19: ;
			if (!LOC18) goto LA20;
			ident = NIM_NIL;
			{
				if (!((*(*n).kindU.S6.Sons->data[1]).Kind == ((NU8) 2))) goto LA24;
				ident = (*(*n).kindU.S6.Sons->data[1]).kindU.S5.Ident;
			}
			goto LA22;
			LA24: ;
			{
				if (!((*(*n).kindU.S6.Sons->data[1]).Kind == ((NU8) 53))) goto LA27;
				ident = considerquotedident_295010((*n).kindU.S6.Sons->data[1]);
			}
			goto LA22;
			LA27: ;
			LA22: ;
			{
				if (!!((ident == NIM_NIL))) goto LA31;
				{
					tsym225846* LOC37;
					if (!((*o).M == (*c).Module)) goto LA35;
					LOC37 = 0;
					LOC37 = initidentiter_235147((&(*o).It), (*(*c).Toplevelscope).Symbols, ident);
					result = skipalias_295255(LOC37, n);
					(*o).Mode = ((NU8) 2);
				}
				goto LA33;
				LA35: ;
				{
					tsym225846* LOC39;
					LOC39 = 0;
					LOC39 = initidentiter_235147((&(*o).It), (*(*o).M).kindU.S3.Tab, ident);
					result = skipalias_295255(LOC39, n);
				}
				LA33: ;
			}
			goto LA29;
			LA31: ;
			{
				NimStringDesc* LOC41;
				LOC41 = 0;
				LOC41 = rendertree_250058((*n).kindU.S6.Sons->data[1], 0);
				localerror_197955((*(*n).kindU.S6.Sons->data[1]).Info, ((NU16) 19), LOC41);
				result = errorsym_295412(c, (*n).kindU.S6.Sons->data[1]);
			}
			LA29: ;
		}
		LA20: ;
	}
	break;
	case ((NU8) 56):
	case ((NU8) 57):
	{
		(*o).Mode = ((NU8) 4);
		result = (*(*n).kindU.S6.Sons->data[0]).kindU.S4.Sym;
		(*o).Symchoiceindex = 1;
		initintset_222950((&(*o).Insymchoice));
		incl_222869((&(*o).Insymchoice), (*result).Sup.Id);
	}
	break;
	default:
	{
	}
	break;
	}
	{
		NIM_BOOL LOC46;
		LOC46 = 0;
		LOC46 = !((result == NIM_NIL));
		if (!(LOC46)) goto LA47;
		LOC46 = ((*result).Kind == ((NU8) 23));
		LA47: ;
		if (!LOC46) goto LA48;
		loadstub_279260(result);
	}
	LA48: ;
	return result;
}

static N_INLINE(NI, sonslen_226249)(tnode225816* 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;
}

N_NIMCALL(tsym225846*, nextoverloaditer_297032)(toverloaditer295491* o, tcontext290021* c, tnode225816* n) {
	tsym225846* result;
	result = 0;
	switch ((*o).Mode) {
	case ((NU8) 0):
	{
		result = NIM_NIL;
	}
	break;
	case ((NU8) 1):
	{
		{
			tsym225846* LOC7;
			if (!!(((*o).Scope == NIM_NIL))) goto LA5;
			LOC7 = 0;
			LOC7 = nextidentiter_235156((&(*o).It), (*(*o).Scope).Symbols);
			result = skipalias_295255(LOC7, n);
			{
				while (1) {
					tsym225846* LOC14;
					if (!(result == NIM_NIL)) goto LA9;
					unsureAsgnRef((void**) (&(*o).Scope), (*(*o).Scope).Parent);
					{
						if (!((*o).Scope == NIM_NIL)) goto LA12;
						goto LA8;
					}
					LA12: ;
					LOC14 = 0;
					LOC14 = initidentiter_235147((&(*o).It), (*(*o).Scope).Symbols, (*o).It.Name);
					result = skipalias_295255(LOC14, n);
				} LA9: ;
			} LA8: ;
		}
		goto LA3;
		LA5: ;
		{
			result = NIM_NIL;
		}
		LA3: ;
	}
	break;
	case ((NU8) 2):
	{
		tsym225846* LOC17;
		LOC17 = 0;
		LOC17 = nextidentiter_235156((&(*o).It), (*(*c).Toplevelscope).Symbols);
		result = skipalias_295255(LOC17, n);
	}
	break;
	case ((NU8) 3):
	{
		tsym225846* LOC19;
		LOC19 = 0;
		LOC19 = nextidentiter_235156((&(*o).It), (*(*o).M).kindU.S3.Tab);
		result = skipalias_295255(LOC19, n);
	}
	break;
	case ((NU8) 4):
	{
		{
			NI LOC23;
			LOC23 = 0;
			LOC23 = sonslen_226249(n);
			if (!((*o).Symchoiceindex < LOC23)) goto LA24;
			result = (*(*n).kindU.S6.Sons->data[(*o).Symchoiceindex]).kindU.S4.Sym;
			incl_222869((&(*o).Insymchoice), (*result).Sup.Id);
			(*o).Symchoiceindex += 1;
		}
		goto LA21;
		LA24: ;
		{
			tsym225846* LOC29;
			if (!((*n).Kind == ((NU8) 57))) goto LA27;
			(*o).Mode = ((NU8) 5);
			unsureAsgnRef((void**) (&(*o).Scope), (*c).Currentscope);
			LOC29 = 0;
			LOC29 = firstidentexcluding_241374((&(*o).It), (*(*o).Scope).Symbols, (*(*(*n).kindU.S6.Sons->data[0]).kindU.S4.Sym).Name, (&(*o).Insymchoice));
			result = skipalias_295255(LOC29, n);
			{
				while (1) {
					tsym225846* LOC36;
					if (!(result == NIM_NIL)) goto LA31;
					unsureAsgnRef((void**) (&(*o).Scope), (*(*o).Scope).Parent);
					{
						if (!((*o).Scope == NIM_NIL)) goto LA34;
						goto LA30;
					}
					LA34: ;
					LOC36 = 0;
					LOC36 = firstidentexcluding_241374((&(*o).It), (*(*o).Scope).Symbols, (*(*(*n).kindU.S6.Sons->data[0]).kindU.S4.Sym).Name, (&(*o).Insymchoice));
					result = skipalias_295255(LOC36, n);
				} LA31: ;
			} LA30: ;
		}
		goto LA21;
		LA27: ;
		LA21: ;
	}
	break;
	case ((NU8) 5):
	{
		tsym225846* LOC38;
		LOC38 = 0;
		LOC38 = nextidentexcluding_241317((&(*o).It), (*(*o).Scope).Symbols, (&(*o).Insymchoice));
		result = skipalias_295255(LOC38, n);
		{
			while (1) {
				tsym225846* LOC45;
				if (!(result == NIM_NIL)) goto LA40;
				unsureAsgnRef((void**) (&(*o).Scope), (*(*o).Scope).Parent);
				{
					if (!((*o).Scope == NIM_NIL)) goto LA43;
					goto LA39;
				}
				LA43: ;
				LOC45 = 0;
				LOC45 = firstidentexcluding_241374((&(*o).It), (*(*o).Scope).Symbols, (*(*(*n).kindU.S6.Sons->data[0]).kindU.S4.Sym).Name, (&(*o).Insymchoice));
				result = skipalias_295255(LOC45, n);
			} LA40: ;
		} LA39: ;
	}
	break;
	}
	{
		NIM_BOOL LOC48;
		LOC48 = 0;
		LOC48 = !((result == NIM_NIL));
		if (!(LOC48)) goto LA49;
		LOC48 = ((*result).Kind == ((NU8) 23));
		LA49: ;
		if (!LOC48) goto LA50;
		loadstub_279260(result);
	}
	LA50: ;
	return result;
}

N_NIMCALL(void, addprelimdecl_295704)(tcontext290021* c, tsym225846* sym) {
	NIM_BOOL LOC1;
	LOC1 = 0;
	LOC1 = adduniquesym_295179((*c).Currentscope, sym);
}

N_NIMCALL(void, addinterfacedeclaux_295724)(tcontext290021* c, tsym225846* sym) {
	{
		if (!(((*sym).Flags &(1<<((((NU8) 1))&31)))!=0)) goto LA3;
		{
			if (!!(((*c).Module == NIM_NIL))) goto LA7;
			strtableadd_235103((&(*(*c).Module).kindU.S3.Tab), sym);
		}
		goto LA5;
		LA7: ;
		{
			internalerror_197987((*sym).Info, ((NimStringDesc*) &TMP2930));
		}
		LA5: ;
	}
	LA3: ;
}

N_NIMCALL(void, addinterfacedecl_295845)(tcontext290021* c, tsym225846* sym) {
	adddecl_295694(c, sym);
	addinterfacedeclaux_295724(c, sym);
}

N_NIMCALL(NI, lastoverloadscope_297011)(toverloaditer295491* o) {
	NI result;
	result = 0;
	switch ((*o).Mode) {
	case ((NU8) 1):
	{
		{
			if (!(*o).Scope == 0) goto LA4;
			result = -1;
		}
		goto LA2;
		LA4: ;
		{
			result = (*(*o).Scope).Depthlevel;
		}
		LA2: ;
	}
	break;
	case ((NU8) 2):
	{
		result = 1;
	}
	break;
	case ((NU8) 3):
	{
		result = 0;
	}
	break;
	default:
	{
		result = -1;
	}
	break;
	}
	return result;
}

N_NIMCALL(tsym225846*, searchinscopes_295355)(tcontext290021* c, tident200021* s, NU32 filter) {
	tsym225846* result;
	result = 0;
	{
		tscope225840* scope_295361;
		tscope225840* HEX3Atmp_295393;
		tscope225840* current_295396;
		scope_295361 = 0;
		HEX3Atmp_295393 = 0;
		HEX3Atmp_295393 = (*c).Currentscope;
		current_295396 = HEX3Atmp_295393;
		{
			while (1) {
				if (!!((current_295396 == NIM_NIL))) goto LA3;
				scope_295361 = current_295396;
				result = strtableget_235111((*scope_295361).Symbols, s);
				{
					NIM_BOOL LOC6;
					LOC6 = 0;
					LOC6 = !((result == NIM_NIL));
					if (!(LOC6)) goto LA7;
					LOC6 = ((filter &(1<<(((*result).Kind)&31)))!=0);
					LA7: ;
					if (!LOC6) goto LA8;
					goto BeforeRet;
				}
				LA8: ;
				current_295396 = (*current_295396).Parent;
			} LA3: ;
		}
	}
	result = NIM_NIL;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, addoverloadablesymat_295790)(tscope225840* scope, tsym225846* fn) {
	tsym225846* check;
	{
		if (!!(((520256 &(1<<(((*fn).Kind)&31)))!=0))) goto LA3;
		internalerror_197987((*fn).Info, ((NimStringDesc*) &TMP3004));
		goto BeforeRet;
	}
	LA3: ;
	check = strtableget_235111((*scope).Symbols, (*fn).Name);
	{
		NIM_BOOL LOC7;
		LOC7 = 0;
		LOC7 = !((check == NIM_NIL));
		if (!(LOC7)) goto LA8;
		LOC7 = !(((520256 &(1<<(((*check).Kind)&31)))!=0));
		LA8: ;
		if (!LOC7) goto LA9;
		wrongredefinition_295675((*fn).Info, (*(*fn).Name).S);
	}
	goto LA5;
	LA9: ;
	{
		strtableadd_235103((&(*scope).Symbols), fn);
	}
	LA5: ;
	BeforeRet: ;
}

N_NIMCALL(void, addinterfaceoverloadablesymat_295855)(tcontext290021* c, tscope225840* scope, tsym225846* sym) {
	addoverloadablesymat_295790(scope, sym);
	addinterfacedeclaux_295724(c, sym);
}

N_NIMCALL(void, adddeclat_295714)(tscope225840* scope, tsym225846* sym) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = adduniquesym_295179(scope, sym);
		if (!!(LOC3)) goto LA4;
		wrongredefinition_295675((*sym).Info, (*(*sym).Name).S);
	}
	LA4: ;
}

N_NIMCALL(void, addinterfacedeclat_295779)(tcontext290021* c, tscope225840* scope, tsym225846* sym) {
	adddeclat_295714(scope, sym);
	addinterfacedeclaux_295724(c, sym);
}

N_NIMCALL(tsym225846*, localsearchinscope_295301)(tcontext290021* c, tident200021* s) {
	tsym225846* result;
	result = 0;
	result = strtableget_235111((*(*c).Currentscope).Symbols, s);
	return result;
}
NIM_EXTERNC N_NOINLINE(void, HEX00_lookupsInit)(void) {
}

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

