/* 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 tident201021 tident201021;
typedef struct tnode226816 tnode226816;
typedef struct ttype226852 ttype226852;
typedef struct tlineinfo196539 tlineinfo196539;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tsym226846 tsym226846;
typedef struct tnodeseq226810 tnodeseq226810;
typedef struct tidobj201015 tidobj201015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct ttypeseq226848 ttypeseq226848;
typedef struct tscope226840 tscope226840;
typedef struct TY226947 TY226947;
typedef struct tinstantiation226836 tinstantiation226836;
typedef struct tstrtable226820 tstrtable226820;
typedef struct tsymseq226818 tsymseq226818;
typedef struct tloc226830 tloc226830;
typedef struct trope178009 trope178009;
typedef struct tlib226834 tlib226834;
typedef struct tcontext291021 tcontext291021;
typedef struct tpasscontext287005 tpasscontext287005;
typedef struct tproccon291011 tproccon291011;
typedef struct intset223056 intset223056;
typedef struct ttrunk223052 ttrunk223052;
typedef struct ttrunkseq223054 ttrunkseq223054;
typedef struct tlinkedlist129028 tlinkedlist129028;
typedef struct tlistentry129022 tlistentry129022;
typedef struct tidtable226864 tidtable226864;
typedef struct tidpairseq226862 tidpairseq226862;
typedef struct tidpair226860 tidpair226860;
typedef struct tctx290048 tctx290048;
typedef struct TY291133 TY291133;
typedef struct tinstantiationpair291013 tinstantiationpair291013;
typedef struct tcell44733 tcell44733;
typedef struct tcellset44745 tcellset44745;
typedef struct tgcheap46816 tgcheap46816;
typedef struct tcellseq44749 tcellseq44749;
typedef struct tpagedesc44741 tpagedesc44741;
typedef struct tmemregion27010 tmemregion27010;
typedef struct tsmallchunk26240 tsmallchunk26240;
typedef struct tllchunk27004 tllchunk27004;
typedef struct tbigchunk26242 tbigchunk26242;
typedef struct tintset26217 tintset26217;
typedef struct ttrunk26213 ttrunk26213;
typedef struct tavlnode27008 tavlnode27008;
typedef struct tgcstat46814 tgcstat46814;
typedef struct ttabiter236119 ttabiter236119;
typedef struct toverloaditer296491 toverloaditer296491;
typedef struct tidentiter236141 tidentiter236141;
typedef struct TY226936 TY226936;
typedef struct TY290250 TY290250;
typedef struct TY197414 TY197414;
typedef struct pprocHEX3Aobjecttype290230 pprocHEX3Aobjecttype290230;
typedef struct TY290269 TY290269;
typedef struct TY290270 TY290270;
typedef struct vmargs290042 vmargs290042;
typedef struct tbasechunk26238 tbasechunk26238;
typedef struct tfreecell26230 tfreecell26230;
typedef struct TY290231 TY290231;
typedef struct tblock290030 tblock290030;
typedef struct TY290211 TY290211;
typedef struct TY290237 TY290237;
struct  tlineinfo196539  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  tnode226816  {
ttype226852* Typ;
tlineinfo196539 Info;
NU16 Flags;
NU8 Kind;
union {
struct {NI64 Intval;
} S1;
struct {NF Floatval;
} S2;
struct {NimStringDesc* Strval;
} S3;
struct {tsym226846* Sym;
} S4;
struct {tident201021* Ident;
} S5;
struct {tnodeseq226810* 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  tidobj201015  {
  TNimObject Sup;
NI Id;
};
struct  tstrtable226820  {
NI Counter;
tsymseq226818* Data;
};
struct  tloc226830  {
NU8 K;
NU8 S;
NU8 Flags;
ttype226852* T;
trope178009* R;
trope178009* Heaproot;
};
struct  tsym226846  {
  tidobj201015 Sup;
NU8 Kind;
union {
struct {ttypeseq226848* Typeinstcache;
tscope226840* Typscope;
} S1;
struct {TY226947* Procinstcache;
tscope226840* Scope;
} S2;
struct {TY226947* Usedgenerics;
tstrtable226820 Tab;
} S3;
struct {tsym226846* Guard;
} S4;
} kindU;
NU16 Magic;
ttype226852* Typ;
tident201021* Name;
tlineinfo196539 Info;
tsym226846* Owner;
NU32 Flags;
tnode226816* Ast;
NU32 Options;
NI Position;
NI Offset;
tloc226830 Loc;
tlib226834* Annex;
tnode226816* Constraint;
};
struct  tident201021  {
  tidobj201015 Sup;
NimStringDesc* S;
tident201021* Next;
NI H;
};
struct  tscope226840  {
NI Depthlevel;
tstrtable226820 Symbols;
tnodeseq226810* Usingsyms;
tscope226840* Parent;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  tpasscontext287005  {
  TNimObject Sup;
NIM_BOOL Fromcache;
};
struct  intset223056  {
NI Counter;
NI Max;
ttrunk223052* Head;
ttrunkseq223054* Data;
};
struct  tlinkedlist129028  {
tlistentry129022* Head;
tlistentry129022* Tail;
NI Counter;
};
struct  tidpair226860  {
tidobj201015* Key;
TNimObject* Val;
};
struct  tidtable226864  {
NI Counter;
tidpairseq226862* Data;
};
typedef N_NIMCALL_PTR(tnode226816*, TY291064) (tcontext291021* c, tnode226816* n);
typedef N_NIMCALL_PTR(tnode226816*, TY291069) (tcontext291021* c, tnode226816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode226816*, TY291077) (tcontext291021* c, tnode226816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode226816*, TY291085) (tcontext291021* c, tnode226816* n);
typedef N_NIMCALL_PTR(tnode226816*, TY291090) (tcontext291021* c, tnode226816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode226816*, TY291098) (tcontext291021* c, tnode226816* n);
typedef N_NIMCALL_PTR(tnode226816*, TY291103) (tcontext291021* c, tnode226816* n, tnode226816* norig, NU32 filter);
typedef N_NIMCALL_PTR(ttype226852*, TY291110) (tcontext291021* c, tnode226816* n, ttype226852* prev);
typedef struct {
N_NIMCALL_PTR(tnode226816*, ClPrc) (tcontext291021* c, tidtable226864 pt, tnode226816* n, void* ClEnv);
void* ClEnv;
} TY291116;
typedef struct {
N_NIMCALL_PTR(tsym226846*, ClPrc) (tcontext291021* c, tsym226846* fn, tidtable226864 pt, tlineinfo196539 info, void* ClEnv);
void* ClEnv;
} TY291122;
struct  tinstantiationpair291013  {
tsym226846* Genericsym;
tinstantiation226836* Inst;
};
typedef N_NIMCALL_PTR(tsym226846*, TY291138) (tcontext291021* c, tsym226846* dc, ttype226852* t, tlineinfo196539 info);
struct  tcontext291021  {
  tpasscontext287005 Sup;
tsym226846* Module;
tscope226840* Currentscope;
tscope226840* Importtable;
tscope226840* Toplevelscope;
tproccon291011* P;
tsymseq226818* Friendmodules;
NI Instcounter;
intset223056 Ambiguoussymbols;
NI Intypeclass;
NI Ingenericcontext;
NI Inunrolledcontext;
NI Incompilescontext;
NI Ingenericinst;
tsymseq226818* Converters;
tsymseq226818* Patterns;
tlinkedlist129028 Optionstack;
tidtable226864 Symmapping;
tlinkedlist129028 Libs;
TY291064 Semconstexpr;
TY291069 Semexpr;
TY291077 Semtryexpr;
TY291085 Semtryconstexpr;
TY291090 Semoperand;
TY291098 Semconstboolexpr;
TY291103 Semoverloadedcall;
TY291110 Semtypenode;
TY291116 Seminferredlambda;
TY291122 Semgenerateinstance;
intset223056 Includedfiles;
tstrtable226820 Userpragmas;
tctx290048* Evalcontext;
intset223056 Unknownidents;
TY291133* Generics;
NI Lastgenericidx;
NI Hloloopdetector;
NI Inparallelstmt;
TY291138 Instdeepcopy;
};
struct  tcell44733  {
NI Refcount;
TNimType* Typ;
};
struct  tcellseq44749  {
NI Len;
NI Cap;
tcell44733** D;
};
struct  tcellset44745  {
NI Counter;
NI Max;
tpagedesc44741* Head;
tpagedesc44741** Data;
};
typedef tsmallchunk26240* TY27022[512];
typedef ttrunk26213* ttrunkbuckets26215[256];
struct  tintset26217  {
ttrunkbuckets26215 Data;
};
struct  tmemregion27010  {
NI Minlargeobj;
NI Maxlargeobj;
TY27022 Freesmallchunks;
tllchunk27004* Llmem;
NI Currmem;
NI Maxmem;
NI Freemem;
NI Lastsize;
tbigchunk26242* Freechunkslist;
tintset26217 Chunkstarts;
tavlnode27008* Root;
tavlnode27008* Deleted;
tavlnode27008* Last;
tavlnode27008* Freeavlnodes;
};
struct  tgcstat46814  {
NI Stackscans;
NI Cyclecollections;
NI Maxthreshold;
NI Maxstacksize;
NI Maxstackcells;
NI Cycletablesize;
NI64 Maxpause;
};
struct  tgcheap46816  {
void* Stackbottom;
NI Cyclethreshold;
tcellseq44749 Zct;
tcellseq44749 Decstack;
tcellset44745 Cycleroots;
tcellseq44749 Tempstack;
NI Recgclock;
tmemregion27010 Region;
tgcstat46814 Stat;
};
struct  ttabiter236119  {
NI H;
};
struct  ttype226852  {
  tidobj201015 Sup;
NU8 Kind;
NU8 Callconv;
NU32 Flags;
ttypeseq226848* Sons;
tnode226816* N;
tsym226846* Owner;
tsym226846* Sym;
tsym226846* Destructor;
tsym226846* Deepcopy;
NI64 Size;
NI16 Align;
NI16 Locklevel;
tloc226830 Loc;
};
struct  tidentiter236141  {
NI H;
tident201021* Name;
};
struct  toverloaditer296491  {
tidentiter236141 It;
tsym226846* M;
NU8 Mode;
NI Symchoiceindex;
tscope226840* Scope;
intset223056 Insymchoice;
};
struct  tinstantiation226836  {
tsym226846* Sym;
ttypeseq226848* Concretetypes;
TY226936* Usedby;
};
struct  trope178009  {
  TNimObject Sup;
trope178009* Left;
trope178009* Right;
NI Length;
NimStringDesc* Data;
};
struct  tlistentry129022  {
  TNimObject Sup;
tlistentry129022* Prev;
tlistentry129022* Next;
};
struct  tlib226834  {
  tlistentry129022 Sup;
NU8 Kind;
NIM_BOOL Generated;
NIM_BOOL Isoverriden;
trope178009* Name;
tnode226816* Path;
};
struct  tproccon291011  {
tsym226846* Owner;
tsym226846* Resultsym;
NI Nestedloopcounter;
NI Nestedblockcounter;
NI Intrystmt;
tproccon291011* Next;
};
typedef NI TY26220[8];
struct  ttrunk223052  {
ttrunk223052* Next;
NI Key;
TY26220 Bits;
};
struct  vmargs290042  {
NI Ra;
NI Rb;
NI Rc;
void* Slots;
tnode226816* Currentexception;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (vmargs290042* args, void* ClEnv);
void* ClEnv;
} vmcallback290044;
struct TY290270 {
NimStringDesc* Field0;
vmcallback290044 Field1;
};
struct  tctx290048  {
  tpasscontext287005 Sup;
TY290250* Code;
TY197414* Debug;
tnode226816* Globals;
tnode226816* Constants;
ttypeseq226848* Types;
tnode226816* Currentexceptiona;
tnode226816* Currentexceptionb;
NI Exceptioninstr;
pprocHEX3Aobjecttype290230* Prc;
tsym226846* Module;
tnode226816* Callsite;
NU8 Mode;
NU8 Features;
NIM_BOOL Traceactive;
NI Loopiterations;
tlineinfo196539 Comesfromheuristic;
TY290269* Callbacks;
NimStringDesc* Errorflag;
};
struct  tpagedesc44741  {
tpagedesc44741* Next;
NI Key;
TY26220 Bits;
};
struct  tbasechunk26238  {
NI Prevsize;
NI Size;
NIM_BOOL Used;
};
struct  tsmallchunk26240  {
  tbasechunk26238 Sup;
tsmallchunk26240* Next;
tsmallchunk26240* Prev;
tfreecell26230* Freelist;
NI Free;
NI Acc;
NF Data;
};
struct  tllchunk27004  {
NI Size;
NI Acc;
tllchunk27004* Next;
};
struct  tbigchunk26242  {
  tbasechunk26238 Sup;
tbigchunk26242* Next;
tbigchunk26242* Prev;
NI Align;
NF Data;
};
struct  ttrunk26213  {
ttrunk26213* Next;
NI Key;
TY26220 Bits;
};
typedef tavlnode27008* TY27014[2];
struct  tavlnode27008  {
TY27014 Link;
NI Key;
NI Upperbound;
NI Level;
};
struct  tblock290030  {
tsym226846* Label;
TY290211* Fixups;
};
struct TY290237 {
NIM_BOOL Field0;
NU8 Field1;
};
typedef TY290237 TY290234[256];
struct  pprocHEX3Aobjecttype290230  {
TY290231* Blocks;
tsym226846* Sym;
TY290234 Slots;
NI Maxslots;
};
struct  tfreecell26230  {
tfreecell26230* Next;
NI Zerofield;
};
struct tnodeseq226810 {
  TGenericSeq Sup;
  tnode226816* data[SEQ_DECL_SIZE];
};
struct ttypeseq226848 {
  TGenericSeq Sup;
  ttype226852* data[SEQ_DECL_SIZE];
};
struct TY226947 {
  TGenericSeq Sup;
  tinstantiation226836* data[SEQ_DECL_SIZE];
};
struct tsymseq226818 {
  TGenericSeq Sup;
  tsym226846* data[SEQ_DECL_SIZE];
};
struct ttrunkseq223054 {
  TGenericSeq Sup;
  ttrunk223052* data[SEQ_DECL_SIZE];
};
struct tidpairseq226862 {
  TGenericSeq Sup;
  tidpair226860 data[SEQ_DECL_SIZE];
};
struct TY291133 {
  TGenericSeq Sup;
  tinstantiationpair291013 data[SEQ_DECL_SIZE];
};
struct TY226936 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct TY290250 {
  TGenericSeq Sup;
  NU32 data[SEQ_DECL_SIZE];
};
struct TY197414 {
  TGenericSeq Sup;
  tlineinfo196539 data[SEQ_DECL_SIZE];
};
struct TY290269 {
  TGenericSeq Sup;
  TY290270 data[SEQ_DECL_SIZE];
};
struct TY290211 {
  TGenericSeq Sup;
  NI data[SEQ_DECL_SIZE];
};
struct TY290231 {
  TGenericSeq Sup;
  tblock290030 data[SEQ_DECL_SIZE];
};
static N_INLINE(NI, len_227364)(tnode226816* n);
N_NIMCALL(void, globalerror_198934)(tlineinfo196539 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, rendertree_251058)(tnode226816* n, NU8 renderflags);
N_NIMCALL(tident201021*, considerquotedident_296010)(tnode226816* 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(tident201021*, getident_201472)(NimStringDesc* identifier);
N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incref_50825)(tcell44733* c);
static N_INLINE(NIM_BOOL, canbecycleroot_48467)(tcell44733* c);
static N_INLINE(void, rtladdcycleroot_49229)(tcell44733* c);
N_NOINLINE(void, incl_45471)(tcellset44745* s, tcell44733* cell);
static N_INLINE(tcell44733*, usrtocell_48446)(void* usr);
static N_INLINE(void, decref_50404)(tcell44733* c);
static N_INLINE(void, rtladdzct_50004)(tcell44733* c);
N_NOINLINE(void, addzct_48417)(tcellseq44749* s, tcell44733* c);
N_NIMCALL(void, newstrtable_230833)(tstrtable226820* Result);
static N_INLINE(NI, scopedepth_291228)(tcontext291021* c);
N_NIMCALL(NIM_BOOL, adduniquesym_296179)(tscope226840* scope, tsym226846* s);
N_NIMCALL(NIM_BOOL, strtableincl_241807)(tstrtable226820* t, tsym226846* n);
N_NIMCALL(void, wrongredefinition_296675)(tlineinfo196539 info, NimStringDesc* s);
N_NIMCALL(void, localerror_198955)(tlineinfo196539 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, ensurenomissingorunusedsymbols_296004)(tscope226840* scope);
N_NIMCALL(tsym226846*, inittabiter_236124)(ttabiter236119* ti, tstrtable226820 tab);
N_NIMCALL(NimStringDesc*, getsymrepr_296507)(tsym226846* s);
N_NIMCALL(NimStringDesc*, getprocheader_264519)(tsym226846* sym, NU8 prefer);
N_NIMCALL(void, message_198976)(tlineinfo196539 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(tsym226846*, nextiter_236132)(ttabiter236119* ti, tstrtable226820 tab);
N_NIMCALL(void, rawclosescope_296202)(tcontext291021* c);
N_NIMCALL(tsym226846*, skipalias_296255)(tsym226846* s, tnode226816* n);
N_NIMCALL(void, replacedeprecated_295324)(tlineinfo196539 info, tsym226846* oldsym, tsym226846* newsym);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(tsym226846*, searchinscopes_296312)(tcontext291021* c, tident201021* s);
N_NIMCALL(tsym226846*, strtableget_236111)(tstrtable226820 t, tident201021* name);
N_NIMCALL(tsym226846*, errorsym_296412)(tcontext291021* c, tnode226816* n);
N_NIMCALL(tsym226846*, newsym_227074)(NU8 symkind, tident201021* name, tsym226846* owner, tlineinfo196539 info);
N_NIMCALL(tsym226846*, getcurrowner_291255)(void);
N_NIMCALL(ttype226852*, errortype_292318)(tcontext291021* c);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(void, strtableadd_236103)(tstrtable226820* t, tsym226846* n);
N_NIMCALL(void, internalerror_198987)(tlineinfo196539 info, NimStringDesc* errmsg);
N_NIMCALL(NIM_BOOL, contains_223837)(intset223056* s, NI key);
N_NIMCALL(void, loadstub_280260)(tsym226846* s);
N_NIMCALL(tsym226846*, qualifiedlookup_297122)(tcontext291021* c, tnode226816* n, NU8 flags);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(tsym226846*, initidentiter_236147)(tidentiter236141* ti, tstrtable226820 tab, tident201021* s);
N_NIMCALL(void, initintset_223950)(intset223056* Result);
N_NIMCALL(void, incl_223869)(intset223056* s, NI key);
N_NIMCALL(tsym226846*, nextidentiter_236156)(tidentiter236141* ti, tstrtable226820 tab);
static N_INLINE(NI, sonslen_227249)(tnode226816* n);
N_NIMCALL(tsym226846*, firstidentexcluding_242374)(tidentiter236141* ti, tstrtable226820 tab, tident201021* s, intset223056* excluding);
N_NIMCALL(tsym226846*, nextidentexcluding_242317)(tidentiter236141* ti, tstrtable226820 tab, intset223056* excluding);
N_NIMCALL(void, adddecl_296694)(tcontext291021* c, tsym226846* sym);
N_NIMCALL(void, addinterfacedeclaux_296724)(tcontext291021* c, tsym226846* sym);
N_NIMCALL(void, addoverloadablesymat_296790)(tscope226840* scope, tsym226846* fn);
N_NIMCALL(void, adddeclat_296714)(tscope226840* scope, tsym226846* sym);
STRING_LITERAL(TMP2639, "", 0);
STRING_LITERAL(TMP2721, "use ", 4);
STRING_LITERAL(TMP2722, " instead; ", 10);
STRING_LITERAL(TMP2723, "err:", 4);
STRING_LITERAL(TMP2724, "lookUp", 6);
STRING_LITERAL(TMP2928, "AddInterfaceDeclAux", 19);
STRING_LITERAL(TMP3002, "addOverloadableSymAt", 20);
extern TNimType NTI226842; /* PScope */
extern tgcheap46816 gch_46844;
extern NU8 gcmd_170120;

static N_INLINE(NI, len_227364)(tnode226816* 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(tident201021*, considerquotedident_296010)(tnode226816* n) {
	tident201021* 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_227364(n);
		switch (LOC4) {
		case 0:
		{
			NimStringDesc* LOC6;
			LOC6 = 0;
			LOC6 = rendertree_251058(n, 0);
			globalerror_198934((*n).Info, ((NU16) 19), LOC6);
		}
		break;
		case 1:
		{
			result = considerquotedident_296010((*n).kindU.S6.Sons->data[0]);
		}
		break;
		default:
		{
			NimStringDesc* id;
			id = copyString(((NimStringDesc*) &TMP2639));
			{
				NI i_296078;
				NI HEX3Atmp_296151;
				NI LOC10;
				NI res_296154;
				i_296078 = 0;
				HEX3Atmp_296151 = 0;
				LOC10 = 0;
				LOC10 = len_227364(n);
				HEX3Atmp_296151 = (LOC10 - 1);
				res_296154 = 0;
				{
					while (1) {
						tnode226816* x;
						if (!(res_296154 <= HEX3Atmp_296151)) goto LA12;
						i_296078 = res_296154;
						x = (*n).kindU.S6.Sons->data[i_296078];
						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_251058(n, 0);
							globalerror_198934((*n).Info, ((NU16) 19), LOC16);
						}
						break;
						}
						res_296154 += 1;
					} LA12: ;
				}
			}
			result = getident_201472(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_251058(n, 0);
		globalerror_198934((*n).Info, ((NU16) 19), LOC19);
	}
	break;
	}
	return result;
}

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

static N_INLINE(void, rtladdcycleroot_49229)(tcell44733* c) {
	{
		if (!!((((NI) ((NI)((*c).Refcount & 3))) == 3))) goto LA3;
		(*c).Refcount = (NI)((NI)((*c).Refcount & -4) | 3);
		incl_45471((&gch_46844.Cycleroots), c);
	}
	LA3: ;
}

static N_INLINE(void, incref_50825)(tcell44733* c) {
	(*c).Refcount = (NI)((NU64)((*c).Refcount) + (NU64)(8));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = canbecycleroot_48467(c);
		if (!LOC3) goto LA4;
		rtladdcycleroot_49229(c);
	}
	LA4: ;
}

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

static N_INLINE(void, rtladdzct_50004)(tcell44733* c) {
	addzct_48417((&gch_46844.Zct), c);
}

static N_INLINE(void, decref_50404)(tcell44733* c) {
	{
		(*c).Refcount -= 8;
		if (!((NU64)((*c).Refcount) < (NU64)(8))) goto LA3;
		rtladdzct_50004(c);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = canbecycleroot_48467(c);
		if (!LOC6) goto LA7;
		rtladdcycleroot_49229(c);
	}
	goto LA1;
	LA7: ;
	LA1: ;
}

static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		tcell44733* LOC5;
		if (!!((src == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = usrtocell_48446(src);
		incref_50825(LOC5);
	}
	LA3: ;
	{
		tcell44733* LOC10;
		if (!!(((*dest) == NIM_NIL))) goto LA8;
		LOC10 = 0;
		LOC10 = usrtocell_48446((*dest));
		decref_50404(LOC10);
	}
	LA8: ;
	(*dest) = src;
}

static N_INLINE(NI, scopedepth_291228)(tcontext291021* 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(tscope226840*, openscope_296191)(tcontext291021* c) {
	tscope226840* result;
	tscope226840* LOC1;
	NI LOC2;
	result = 0;
	LOC1 = 0;
	LOC1 = (tscope226840*) newObj((&NTI226842), sizeof(tscope226840));
	asgnRef((void**) (&(*LOC1).Parent), (*c).Currentscope);
	newstrtable_230833((&(*LOC1).Symbols));
	LOC2 = 0;
	LOC2 = scopedepth_291228(c);
	(*LOC1).Depthlevel = (NI64)(LOC2 + 1);
	result = LOC1;
	asgnRef((void**) (&(*c).Currentscope), result);
	return result;
}

N_NIMCALL(NIM_BOOL, adduniquesym_296179)(tscope226840* scope, tsym226846* s) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = strtableincl_241807((&(*scope).Symbols), s);
	result = !(LOC1);
	return result;
}

N_NIMCALL(void, wrongredefinition_296675)(tlineinfo196539 info, NimStringDesc* s) {
	{
		if (!!((gcmd_170120 == ((NU8) 18)))) goto LA3;
		localerror_198955(info, ((NU16) 40), s);
	}
	LA3: ;
}

N_NIMCALL(void, adddecl_296694)(tcontext291021* c, tsym226846* sym) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = adduniquesym_296179((*c).Currentscope, sym);
		if (!!(LOC3)) goto LA4;
		wrongredefinition_296675((*sym).Info, (*(*sym).Name).S);
	}
	LA4: ;
}

N_NIMCALL(NimStringDesc*, getsymrepr_296507)(tsym226846* 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_264519(s, ((NU8) 0));
	}
	break;
	default:
	{
		result = copyString((*(*s).Name).S);
	}
	break;
	}
	return result;
}

N_NIMCALL(void, ensurenomissingorunusedsymbols_296004)(tscope226840* scope) {
	ttabiter236119 it;
	tsym226846* s;
	NI missingimpls;
	memset((void*)(&it), 0, sizeof(it));
	s = inittabiter_236124((&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_296507(s);
					localerror_198955((*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_296507(s);
						message_198976((*s).Info, ((NU16) 262), LOC27);
					}
					LA25: ;
				}
				LA19: ;
			}
			goto LA3;
			LA15: ;
			LA3: ;
			s = nextiter_236132((&it), (*scope).Symbols);
		} LA2: ;
	}
}

N_NIMCALL(void, rawclosescope_296202)(tcontext291021* c) {
	asgnRef((void**) (&(*c).Currentscope), (*(*c).Currentscope).Parent);
}

N_NIMCALL(void, closescope_296211)(tcontext291021* c) {
	ensurenomissingorunusedsymbols_296004((*c).Currentscope);
	rawclosescope_296202(c);
}

N_NIMCALL(tsym226846*, skipalias_296255)(tsym226846* s, tnode226816* n) {
	tsym226846* 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_170120 == ((NU8) 7))) goto LA10;
			replacedeprecated_295324((*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*) &TMP2721));
appendString(LOC13, (*(*result).Name).S);
appendString(LOC13, ((NimStringDesc*) &TMP2722));
appendString(LOC13, (*(*s).Name).S);
			message_198976((*n).Info, ((NU16) 234), LOC13);
		}
		LA8: ;
	}
	LA1: ;
	return result;
}

N_NIMCALL(tsym226846*, searchinscopes_296312)(tcontext291021* c, tident201021* s) {
	tsym226846* result;
	result = 0;
	{
		tscope226840* scope_296317;
		tscope226840* HEX3Atmp_296336;
		tscope226840* current_296339;
		scope_296317 = 0;
		HEX3Atmp_296336 = 0;
		HEX3Atmp_296336 = (*c).Currentscope;
		current_296339 = HEX3Atmp_296336;
		{
			while (1) {
				if (!!((current_296339 == NIM_NIL))) goto LA3;
				scope_296317 = current_296339;
				result = strtableget_236111((*scope_296317).Symbols, s);
				{
					if (!!((result == NIM_NIL))) goto LA6;
					goto BeforeRet;
				}
				LA6: ;
				current_296339 = (*current_296339).Parent;
			} LA3: ;
		}
	}
	result = NIM_NIL;
	BeforeRet: ;
	return result;
}

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

N_NIMCALL(tsym226846*, errorsym_296412)(tcontext291021* c, tnode226816* n) {
	tsym226846* result;
	tnode226816* m;
	tident201021* ident;
	tsym226846* 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_296010(m);
	}
	goto LA5;
	LA7: ;
	{
		NimStringDesc* LOC10;
		NimStringDesc* LOC11;
		LOC10 = 0;
		LOC11 = 0;
		LOC11 = rendertree_251058(m, 0);
		LOC10 = rawNewString(LOC11->Sup.len + 4);
appendString(LOC10, ((NimStringDesc*) &TMP2723));
appendString(LOC10, LOC11);
		ident = getident_201472(LOC10);
	}
	LA5: ;
	LOC12 = 0;
	LOC12 = getcurrowner_291255();
	result = newsym_227074(((NU8) 0), ident, LOC12, (*n).Info);
	asgnRefNoCycle((void**) (&(*result).Typ), errortype_292318(c));
	(*result).Flags |= ((NI32)1)<<((((NU8) 29))%(sizeof(NI32)*8));
	{
		NIM_BOOL LOC15;
		LOC15 = 0;
		LOC15 = !((gcmd_170120 == ((NU8) 18)));
		if (!(LOC15)) goto LA16;
		LOC15 = ((*c).Incompilescontext == 0);
		LA16: ;
		if (!LOC15) goto LA17;
		strtableadd_236103((&(*(*c).Importtable).Symbols), result);
	}
	LA17: ;
	return result;
}

N_NIMCALL(tsym226846*, lookup_297004)(tcontext291021* c, tnode226816* n) {
	tsym226846* result;
	result = 0;
	switch ((*n).Kind) {
	case ((NU8) 2):
	{
		tsym226846* LOC2;
		LOC2 = 0;
		LOC2 = searchinscopes_296312(c, (*n).kindU.S5.Ident);
		result = skipalias_296255(LOC2, n);
		{
			if (!(result == NIM_NIL)) goto LA5;
			localerror_198955((*n).Info, ((NU16) 61), (*(*n).kindU.S5.Ident).S);
			result = errorsym_296412(c, n);
		}
		LA5: ;
	}
	break;
	case ((NU8) 3):
	{
		result = (*n).kindU.S4.Sym;
	}
	break;
	case ((NU8) 53):
	{
		tident201021* ident;
		tsym226846* LOC9;
		ident = considerquotedident_296010(n);
		LOC9 = 0;
		LOC9 = searchinscopes_296312(c, ident);
		result = skipalias_296255(LOC9, n);
		{
			if (!(result == NIM_NIL)) goto LA12;
			localerror_198955((*n).Info, ((NU16) 61), (*ident).S);
			result = errorsym_296412(c, n);
		}
		LA12: ;
	}
	break;
	default:
	{
		internalerror_198987((*n).Info, ((NimStringDesc*) &TMP2724));
		goto BeforeRet;
	}
	break;
	}
	{
		NIM_BOOL LOC17;
		LOC17 = 0;
		LOC17 = contains_223837((&(*c).Ambiguoussymbols), (*result).Sup.Id);
		if (!LOC17) goto LA18;
		localerror_198955((*n).Info, ((NU16) 62), (*(*result).Name).S);
	}
	LA18: ;
	{
		if (!((*result).Kind == ((NU8) 23))) goto LA22;
		loadstub_280260(result);
	}
	LA22: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(tsym226846*, qualifiedlookup_297122)(tcontext291021* c, tnode226816* n, NU8 flags) {
	tsym226846* result;
	result = 0;
	switch ((*n).Kind) {
	case ((NU8) 2):
	case ((NU8) 53):
	{
		tident201021* ident;
		tsym226846* LOC2;
		ident = considerquotedident_296010(n);
		LOC2 = 0;
		LOC2 = searchinscopes_296312(c, ident);
		result = skipalias_296255(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_198955((*n).Info, ((NU16) 61), (*ident).S);
			result = errorsym_296412(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_223837((&(*c).Ambiguoussymbols), (*result).Sup.Id);
			LA13: ;
			if (!LOC10) goto LA14;
			localerror_198955((*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_223837((&(*c).Ambiguoussymbols), (*result).Sup.Id);
			LA20: ;
			if (!LOC19) goto LA21;
			localerror_198955((*n).Info, ((NU16) 62), (*(*(*n).kindU.S4.Sym).Name).S);
		}
		LA21: ;
	}
	break;
	case ((NU8) 45):
	{
		tsym226846* m;
		result = NIM_NIL;
		m = qualifiedlookup_297122(c, (*n).kindU.S6.Sons->data[0], (flags & 2));
		{
			NIM_BOOL LOC26;
			tident201021* 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_296010((*n).kindU.S6.Sons->data[1]);
			}
			goto LA30;
			LA35: ;
			LA30: ;
			{
				if (!!((ident == NIM_NIL))) goto LA39;
				{
					tsym226846* LOC45;
					if (!(m == (*c).Module)) goto LA43;
					LOC45 = 0;
					LOC45 = strtableget_236111((*(*c).Toplevelscope).Symbols, ident);
					result = skipalias_296255(LOC45, n);
				}
				goto LA41;
				LA43: ;
				{
					tsym226846* LOC47;
					LOC47 = 0;
					LOC47 = strtableget_236111((*m).kindU.S3.Tab, ident);
					result = skipalias_296255(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_198955((*(*n).kindU.S6.Sons->data[1]).Info, ((NU16) 61), (*ident).S);
					result = errorsym_296412(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_251058((*n).kindU.S6.Sons->data[1], 0);
				localerror_198955((*(*n).kindU.S6.Sons->data[1]).Info, ((NU16) 19), LOC62);
				result = errorsym_296412(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_280260(result);
	}
	LA68: ;
	return result;
}

N_NIMCALL(tsym226846*, initoverloaditer_297665)(toverloaditer296491* o, tcontext291021* c, tnode226816* n) {
	tsym226846* result;
	result = 0;
	switch ((*n).Kind) {
	case ((NU8) 2):
	case ((NU8) 53):
	{
		tident201021* ident;
		ident = considerquotedident_296010(n);
		unsureAsgnRef((void**) (&(*o).Scope), (*c).Currentscope);
		(*o).Mode = ((NU8) 1);
		{
			while (1) {
				tsym226846* LOC4;
				LOC4 = 0;
				LOC4 = initidentiter_236147((&(*o).It), (*(*o).Scope).Symbols, ident);
				result = skipalias_296255(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_297122(c, (*n).kindU.S6.Sons->data[0], 2));
		{
			NIM_BOOL LOC18;
			tident201021* 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_296010((*n).kindU.S6.Sons->data[1]);
			}
			goto LA22;
			LA27: ;
			LA22: ;
			{
				if (!!((ident == NIM_NIL))) goto LA31;
				{
					tsym226846* LOC37;
					if (!((*o).M == (*c).Module)) goto LA35;
					LOC37 = 0;
					LOC37 = initidentiter_236147((&(*o).It), (*(*c).Toplevelscope).Symbols, ident);
					result = skipalias_296255(LOC37, n);
					(*o).Mode = ((NU8) 2);
				}
				goto LA33;
				LA35: ;
				{
					tsym226846* LOC39;
					LOC39 = 0;
					LOC39 = initidentiter_236147((&(*o).It), (*(*o).M).kindU.S3.Tab, ident);
					result = skipalias_296255(LOC39, n);
				}
				LA33: ;
			}
			goto LA29;
			LA31: ;
			{
				NimStringDesc* LOC41;
				LOC41 = 0;
				LOC41 = rendertree_251058((*n).kindU.S6.Sons->data[1], 0);
				localerror_198955((*(*n).kindU.S6.Sons->data[1]).Info, ((NU16) 19), LOC41);
				result = errorsym_296412(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_223950((&(*o).Insymchoice));
		incl_223869((&(*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_280260(result);
	}
	LA48: ;
	return result;
}

static N_INLINE(NI, sonslen_227249)(tnode226816* 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(tsym226846*, nextoverloaditer_298032)(toverloaditer296491* o, tcontext291021* c, tnode226816* n) {
	tsym226846* result;
	result = 0;
	switch ((*o).Mode) {
	case ((NU8) 0):
	{
		result = NIM_NIL;
	}
	break;
	case ((NU8) 1):
	{
		{
			tsym226846* LOC7;
			if (!!(((*o).Scope == NIM_NIL))) goto LA5;
			LOC7 = 0;
			LOC7 = nextidentiter_236156((&(*o).It), (*(*o).Scope).Symbols);
			result = skipalias_296255(LOC7, n);
			{
				while (1) {
					tsym226846* 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_236147((&(*o).It), (*(*o).Scope).Symbols, (*o).It.Name);
					result = skipalias_296255(LOC14, n);
				} LA9: ;
			} LA8: ;
		}
		goto LA3;
		LA5: ;
		{
			result = NIM_NIL;
		}
		LA3: ;
	}
	break;
	case ((NU8) 2):
	{
		tsym226846* LOC17;
		LOC17 = 0;
		LOC17 = nextidentiter_236156((&(*o).It), (*(*c).Toplevelscope).Symbols);
		result = skipalias_296255(LOC17, n);
	}
	break;
	case ((NU8) 3):
	{
		tsym226846* LOC19;
		LOC19 = 0;
		LOC19 = nextidentiter_236156((&(*o).It), (*(*o).M).kindU.S3.Tab);
		result = skipalias_296255(LOC19, n);
	}
	break;
	case ((NU8) 4):
	{
		{
			NI LOC23;
			LOC23 = 0;
			LOC23 = sonslen_227249(n);
			if (!((*o).Symchoiceindex < LOC23)) goto LA24;
			result = (*(*n).kindU.S6.Sons->data[(*o).Symchoiceindex]).kindU.S4.Sym;
			incl_223869((&(*o).Insymchoice), (*result).Sup.Id);
			(*o).Symchoiceindex += 1;
		}
		goto LA21;
		LA24: ;
		{
			tsym226846* LOC29;
			if (!((*n).Kind == ((NU8) 57))) goto LA27;
			(*o).Mode = ((NU8) 5);
			unsureAsgnRef((void**) (&(*o).Scope), (*c).Currentscope);
			LOC29 = 0;
			LOC29 = firstidentexcluding_242374((&(*o).It), (*(*o).Scope).Symbols, (*(*(*n).kindU.S6.Sons->data[0]).kindU.S4.Sym).Name, (&(*o).Insymchoice));
			result = skipalias_296255(LOC29, n);
			{
				while (1) {
					tsym226846* 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_242374((&(*o).It), (*(*o).Scope).Symbols, (*(*(*n).kindU.S6.Sons->data[0]).kindU.S4.Sym).Name, (&(*o).Insymchoice));
					result = skipalias_296255(LOC36, n);
				} LA31: ;
			} LA30: ;
		}
		goto LA21;
		LA27: ;
		LA21: ;
	}
	break;
	case ((NU8) 5):
	{
		tsym226846* LOC38;
		LOC38 = 0;
		LOC38 = nextidentexcluding_242317((&(*o).It), (*(*o).Scope).Symbols, (&(*o).Insymchoice));
		result = skipalias_296255(LOC38, n);
		{
			while (1) {
				tsym226846* 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_242374((&(*o).It), (*(*o).Scope).Symbols, (*(*(*n).kindU.S6.Sons->data[0]).kindU.S4.Sym).Name, (&(*o).Insymchoice));
				result = skipalias_296255(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_280260(result);
	}
	LA50: ;
	return result;
}

N_NIMCALL(void, addprelimdecl_296704)(tcontext291021* c, tsym226846* sym) {
	NIM_BOOL LOC1;
	LOC1 = 0;
	LOC1 = adduniquesym_296179((*c).Currentscope, sym);
}

N_NIMCALL(void, addinterfacedeclaux_296724)(tcontext291021* c, tsym226846* sym) {
	{
		if (!(((*sym).Flags &(1<<((((NU8) 1))&31)))!=0)) goto LA3;
		{
			if (!!(((*c).Module == NIM_NIL))) goto LA7;
			strtableadd_236103((&(*(*c).Module).kindU.S3.Tab), sym);
		}
		goto LA5;
		LA7: ;
		{
			internalerror_198987((*sym).Info, ((NimStringDesc*) &TMP2928));
		}
		LA5: ;
	}
	LA3: ;
}

N_NIMCALL(void, addinterfacedecl_296845)(tcontext291021* c, tsym226846* sym) {
	adddecl_296694(c, sym);
	addinterfacedeclaux_296724(c, sym);
}

N_NIMCALL(NI, lastoverloadscope_298011)(toverloaditer296491* 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(tsym226846*, searchinscopes_296355)(tcontext291021* c, tident201021* s, NU32 filter) {
	tsym226846* result;
	result = 0;
	{
		tscope226840* scope_296361;
		tscope226840* HEX3Atmp_296393;
		tscope226840* current_296396;
		scope_296361 = 0;
		HEX3Atmp_296393 = 0;
		HEX3Atmp_296393 = (*c).Currentscope;
		current_296396 = HEX3Atmp_296393;
		{
			while (1) {
				if (!!((current_296396 == NIM_NIL))) goto LA3;
				scope_296361 = current_296396;
				result = strtableget_236111((*scope_296361).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_296396 = (*current_296396).Parent;
			} LA3: ;
		}
	}
	result = NIM_NIL;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, addoverloadablesymat_296790)(tscope226840* scope, tsym226846* fn) {
	tsym226846* check;
	{
		if (!!(((520256 &(1<<(((*fn).Kind)&31)))!=0))) goto LA3;
		internalerror_198987((*fn).Info, ((NimStringDesc*) &TMP3002));
		goto BeforeRet;
	}
	LA3: ;
	check = strtableget_236111((*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_296675((*fn).Info, (*(*fn).Name).S);
	}
	goto LA5;
	LA9: ;
	{
		strtableadd_236103((&(*scope).Symbols), fn);
	}
	LA5: ;
	BeforeRet: ;
}

N_NIMCALL(void, addinterfaceoverloadablesymat_296855)(tcontext291021* c, tscope226840* scope, tsym226846* sym) {
	addoverloadablesymat_296790(scope, sym);
	addinterfacedeclaux_296724(c, sym);
}

N_NIMCALL(void, adddeclat_296714)(tscope226840* scope, tsym226846* sym) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = adduniquesym_296179(scope, sym);
		if (!!(LOC3)) goto LA4;
		wrongredefinition_296675((*sym).Info, (*(*sym).Name).S);
	}
	LA4: ;
}

N_NIMCALL(void, addinterfacedeclat_296779)(tcontext291021* c, tscope226840* scope, tsym226846* sym) {
	adddeclat_296714(scope, sym);
	addinterfacedeclaux_296724(c, sym);
}

N_NIMCALL(tsym226846*, localsearchinscope_296301)(tcontext291021* c, tident201021* s) {
	tsym226846* result;
	result = 0;
	result = strtableget_236111((*(*c).Currentscope).Symbols, s);
	return result;
}
NIM_EXTERNC N_NOINLINE(void, HEX00_lookupsInit)(void) {
}

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

