/* 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/lookups.o compiler/nimcache/lookups.c */
#define NIM_INTBITS 32
#include "nimbase.h"

#include <string.h>
typedef struct tident167019 tident167019;
typedef struct tnode188803 tnode188803;
typedef struct ttype188837 ttype188837;
typedef struct tlineinfo163527 tlineinfo163527;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tsym188833 tsym188833;
typedef struct tnodeseq188797 tnodeseq188797;
typedef struct tidobj167013 tidobj167013;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct ttypeseq188835 ttypeseq188835;
typedef struct tscope188827 tscope188827;
typedef struct TY188933 TY188933;
typedef struct tinstantiation188823 tinstantiation188823;
typedef struct tstrtable188807 tstrtable188807;
typedef struct tsymseq188805 tsymseq188805;
typedef struct tloc188817 tloc188817;
typedef struct trope145007 trope145007;
typedef struct tlib188821 tlib188821;
typedef struct tcontext250019 tcontext250019;
typedef struct tpasscontext246003 tpasscontext246003;
typedef struct tproccon250009 tproccon250009;
typedef struct tintset185047 tintset185047;
typedef struct ttrunk185043 ttrunk185043;
typedef struct ttrunkseq185045 ttrunkseq185045;
typedef struct tlinkedlist118023 tlinkedlist118023;
typedef struct tlistentry118017 tlistentry118017;
typedef struct tidtable188849 tidtable188849;
typedef struct tidpairseq188847 tidpairseq188847;
typedef struct tidpair188845 tidpair188845;
typedef struct tctx249037 tctx249037;
typedef struct TY250131 TY250131;
typedef struct tinstantiationpair250011 tinstantiationpair250011;
typedef struct tcell41090 tcell41090;
typedef struct tcellset41102 tcellset41102;
typedef struct tgcheap43016 tgcheap43016;
typedef struct tcellseq41106 tcellseq41106;
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 ttabiter197090 ttabiter197090;
typedef struct toverloaditer252363 toverloaditer252363;
typedef struct tidentiter197106 tidentiter197106;
typedef struct TY188922 TY188922;
typedef struct TY249229 TY249229;
typedef struct TY164208 TY164208;
typedef struct pprocHEX3Aobjecttype249216 pprocHEX3Aobjecttype249216;
typedef struct tbasechunk22636 tbasechunk22636;
typedef struct tfreecell22628 tfreecell22628;
typedef struct TY249217 TY249217;
typedef struct tblock249023 tblock249023;
typedef struct TY249198 TY249198;
typedef struct TY249223 TY249223;
struct  tlineinfo163527  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
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;
};
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  tstrtable188807  {
NI Counter;
tsymseq188805* Data;
};
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  tident167019  {
  tidobj167013 Sup;
NimStringDesc* S;
tident167019* Next;
NI H;
};
struct  tscope188827  {
NI Depthlevel;
tstrtable188807 Symbols;
tnodeseq188797* Usingsyms;
tscope188827* Parent;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  tpasscontext246003  {
  TNimObject Sup;
NIM_BOOL Fromcache;
};
struct  tintset185047  {
NI Counter;
NI Max;
ttrunk185043* Head;
ttrunkseq185045* Data;
};
struct  tlinkedlist118023  {
tlistentry118017* Head;
tlistentry118017* Tail;
NI Counter;
};
struct  tidpair188845  {
tidobj167013* Key;
TNimObject* Val;
};
struct  tidtable188849  {
NI Counter;
tidpairseq188847* Data;
};
typedef N_NIMCALL_PTR(tnode188803*, TY250061) (tcontext250019* c, tnode188803* n);
typedef N_NIMCALL_PTR(tnode188803*, TY250066) (tcontext250019* c, tnode188803* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode188803*, TY250074) (tcontext250019* c, tnode188803* n, NU16 flags, NIM_BOOL buffererrors);
typedef N_NIMCALL_PTR(tnode188803*, TY250083) (tcontext250019* c, tnode188803* n);
typedef N_NIMCALL_PTR(tnode188803*, TY250088) (tcontext250019* c, tnode188803* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode188803*, TY250096) (tcontext250019* c, tnode188803* n);
typedef N_NIMCALL_PTR(tnode188803*, TY250101) (tcontext250019* c, tnode188803* n, tnode188803* norig, NU32 filter);
typedef N_NIMCALL_PTR(ttype188837*, TY250108) (tcontext250019* c, tnode188803* n, ttype188837* prev);
typedef struct {
N_NIMCALL_PTR(tnode188803*, ClPrc) (tcontext250019* c, tidtable188849 pt, tnode188803* n, void* ClEnv);
void* ClEnv;
} TY250114;
typedef struct {
N_NIMCALL_PTR(tsym188833*, ClPrc) (tcontext250019* c, tsym188833* fn, tidtable188849 pt, tlineinfo163527 info, void* ClEnv);
void* ClEnv;
} TY250120;
struct  tinstantiationpair250011  {
tsym188833* Genericsym;
tinstantiation188823* Inst;
};
struct  tcontext250019  {
  tpasscontext246003 Sup;
tsym188833* Module;
tscope188827* Currentscope;
tscope188827* Importtable;
tscope188827* Toplevelscope;
tproccon250009* P;
tsym188833* Friendmodule;
NI Instcounter;
tintset185047 Ambiguoussymbols;
NI Intypeclass;
NI Ingenericcontext;
NI Inunrolledcontext;
NI Incompilescontext;
NI Ingenericinst;
tsymseq188805* Converters;
tsymseq188805* Patterns;
tlinkedlist118023 Optionstack;
tidtable188849 Symmapping;
tlinkedlist118023 Libs;
TY250061 Semconstexpr;
TY250066 Semexpr;
TY250074 Semtryexpr;
TY250083 Semtryconstexpr;
TY250088 Semoperand;
TY250096 Semconstboolexpr;
TY250101 Semoverloadedcall;
TY250108 Semtypenode;
TY250114 Seminferredlambda;
TY250120 Semgenerateinstance;
tintset185047 Includedfiles;
tstrtable188807 Userpragmas;
tctx249037* Evalcontext;
tintset185047 Unknownidents;
TY250131* Generics;
NI Lastgenericidx;
NI Hloloopdetector;
};
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  ttabiter197090  {
NI H;
};
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  tidentiter197106  {
NI H;
tident167019* Name;
};
struct  toverloaditer252363  {
tidentiter197106 It;
tsym188833* M;
NU8 Mode;
NI Symchoiceindex;
tscope188827* Scope;
tintset185047 Insymchoice;
};
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;
};
struct  tproccon250009  {
tsym188833* Owner;
tsym188833* Resultsym;
NI Nestedloopcounter;
NI Nestedblockcounter;
NI Intrystmt;
tproccon250009* Next;
};
typedef NI TY22618[16];
struct  ttrunk185043  {
ttrunk185043* Next;
NI Key;
TY22618 Bits;
};
struct  tctx249037  {
  tpasscontext246003 Sup;
TY249229* Code;
TY164208* Debug;
tnode188803* Globals;
tnode188803* Constants;
ttypeseq188835* Types;
tnode188803* Currentexceptiona;
tnode188803* Currentexceptionb;
NI Exceptioninstr;
pprocHEX3Aobjecttype249216* Prc;
tsym188833* Module;
tnode188803* Callsite;
NU8 Mode;
NU8 Features;
NIM_BOOL Traceactive;
NI Loopiterations;
};
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  tblock249023  {
tsym188833* Label;
TY249198* Fixups;
};
struct TY249223 {
NIM_BOOL Field0;
NU8 Field1;
};
typedef TY249223 TY249220[256];
struct  pprocHEX3Aobjecttype249216  {
TY249217* Blocks;
tsym188833* Sym;
TY249220 Slots;
NI Maxslots;
};
struct  tfreecell22628  {
tfreecell22628* Next;
NI Zerofield;
};
struct tnodeseq188797 {
  TGenericSeq Sup;
  tnode188803* data[SEQ_DECL_SIZE];
};
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 ttrunkseq185045 {
  TGenericSeq Sup;
  ttrunk185043* data[SEQ_DECL_SIZE];
};
struct tidpairseq188847 {
  TGenericSeq Sup;
  tidpair188845 data[SEQ_DECL_SIZE];
};
struct TY250131 {
  TGenericSeq Sup;
  tinstantiationpair250011 data[SEQ_DECL_SIZE];
};
struct TY188922 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct TY249229 {
  TGenericSeq Sup;
  NU32 data[SEQ_DECL_SIZE];
};
struct TY164208 {
  TGenericSeq Sup;
  tlineinfo163527 data[SEQ_DECL_SIZE];
};
struct TY249198 {
  TGenericSeq Sup;
  NI data[SEQ_DECL_SIZE];
};
struct TY249217 {
  TGenericSeq Sup;
  tblock249023 data[SEQ_DECL_SIZE];
};
static N_INLINE(NI, len_189264)(tnode188803* n);
N_NIMCALL(void, globalerror_165558)(tlineinfo163527 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, rendertree_211051)(tnode188803* n, NU8 renderflags);
N_NIMCALL(tident167019*, consideracc_252006)(tnode188803* 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(tident167019*, getident_167456)(NimStringDesc* identifier);
N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incref_46827)(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);
static N_INLINE(tcell41090*, usrtocell_44443)(void* usr);
static N_INLINE(void, decref_46402)(tcell41090* c);
static N_INLINE(void, rtladdzct_46002)(tcell41090* c);
N_NOINLINE(void, addzct_44418)(tcellseq41106* s, tcell41090* c);
N_NIMCALL(void, newstrtable_192425)(tstrtable188807* Result);
static N_INLINE(NI, scopedepth_250191)(tcontext250019* c);
N_NIMCALL(NU8, adduniquesym_252159)(tscope188827* scope, tsym188833* s);
N_NIMCALL(NIM_BOOL, strtableincl_202135)(tstrtable188807* t, tsym188833* n);
N_NIMCALL(void, wrongredefinition_252535)(tlineinfo163527 info, NimStringDesc* s);
N_NIMCALL(void, localerror_165571)(tlineinfo163527 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, ensurenomissingorunusedsymbols_252002)(tscope188827* scope);
N_NIMCALL(tsym188833*, inittabiter_197093)(ttabiter197090* ti, tstrtable188807 tab);
N_NIMCALL(NimStringDesc*, getsymrepr_252377)(tsym188833* s);
N_NIMCALL(NimStringDesc*, getprocheader_223025)(tsym188833* sym);
N_NIMCALL(void, message_165584)(tlineinfo163527 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(tsym188833*, nextiter_197099)(ttabiter197090* ti, tstrtable188807 tab);
N_NIMCALL(void, rawclosescope_252174)(tcontext250019* c);
N_NIMCALL(tsym188833*, searchinscopes_252216)(tcontext250019* c, tident167019* s);
N_NIMCALL(tsym188833*, strtableget_197084)(tstrtable188807 t, tident167019* name);
N_NIMCALL(tsym188833*, errorsym_252288)(tcontext250019* c, tnode188803* n);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(tsym188833*, newsym_189053)(NU8 symkind, tident167019* name, tsym188833* owner, tlineinfo163527 info);
N_NIMCALL(tsym188833*, getcurrowner_250215)(void);
N_NIMCALL(ttype188837*, errortype_251136)(tcontext250019* c);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(void, strtableadd_197078)(tstrtable188807* t, tsym188833* n);
N_NIMCALL(void, internalerror_165591)(tlineinfo163527 info, NimStringDesc* errmsg);
N_NIMCALL(NIM_BOOL, contains_185821)(tintset185047 s, NI key);
N_NIMCALL(void, loadstub_239239)(tsym188833* s);
N_NIMCALL(tsym188833*, qualifiedlookup_252806)(tcontext250019* c, tnode188803* n, NU8 flags);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(tsym188833*, initidentiter_197110)(tidentiter197106* ti, tstrtable188807 tab, tident167019* s);
N_NIMCALL(void, initintset_185918)(tintset185047* Result);
N_NIMCALL(void, incl_185849)(tintset185047* s, NI key);
N_NIMCALL(tsym188833*, nextidentiter_197117)(tidentiter197106* ti, tstrtable188807 tab);
static N_INLINE(NI, sonslen_189181)(tnode188803* n);
N_NIMCALL(tsym188833*, firstidentexcluding_202534)(tidentiter197106* ti, tstrtable188807 tab, tident167019* s, tintset185047 excluding);
N_NIMCALL(tsym188833*, nextidentexcluding_202487)(tidentiter197106* ti, tstrtable188807 tab, tintset185047 excluding);
N_NIMCALL(void, addoverloadablesymat_252644)(tscope188827* scope, tsym188833* fn);
N_NIMCALL(void, addinterfacedeclaux_252586)(tcontext250019* c, tsym188833* sym);
N_NIMCALL(void, adddeclat_252571)(tscope188827* scope, tsym188833* sym);
N_NIMCALL(void, adddecl_252550)(tcontext250019* c, tsym188833* sym);
STRING_LITERAL(TMP2496, "", 0);
STRING_LITERAL(TMP2569, "err:", 4);
STRING_LITERAL(TMP2570, "lookUp", 6);
STRING_LITERAL(TMP2820, "addOverloadableSymAt", 20);
STRING_LITERAL(TMP2821, "AddInterfaceDeclAux", 19);
extern TNimType NTI188829; /* PScope */
extern tgcheap43016 gch_43044;
extern NU8 gcmd_137113;

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(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(tident167019*, consideracc_252006)(tnode188803* n) {
	tident167019* 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_189264(n);
		switch (LOC4) {
		case 0:
		{
			NimStringDesc* LOC6;
			LOC6 = 0;
			LOC6 = rendertree_211051(n, 0);
			globalerror_165558((*n).Info, ((NU16) 19), LOC6);
		}
		break;
		case 1:
		{
			result = consideracc_252006((*n).kindU.S6.Sons->data[0]);
		}
		break;
		default:
		{
			NimStringDesc* id;
			NI i_252074;
			NI HEX3Atmp_252146;
			NI LOC9;
			NI res_252148;
			id = copyString(((NimStringDesc*) &TMP2496));
			i_252074 = 0;
			HEX3Atmp_252146 = 0;
			LOC9 = 0;
			LOC9 = len_189264(n);
			HEX3Atmp_252146 = LOC9 - 1;
			res_252148 = 0;
			while (1) {
				tnode188803* x;
				if (!(res_252148 <= HEX3Atmp_252146)) goto LA10;
				i_252074 = res_252148;
				x = (*n).kindU.S6.Sons->data[i_252074];
				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* LOC14;
					LOC14 = 0;
					LOC14 = rendertree_211051(n, 0);
					globalerror_165558((*n).Info, ((NU16) 19), LOC14);
				}
				break;
				}
				res_252148 += 1;
			} LA10: ;
			result = getident_167456(id);
		}
		break;
		}
	}
	break;
	case ((NU8) 57):
	case ((NU8) 56):
	{
		result = (*(*(*n).kindU.S6.Sons->data[0]).kindU.S4.Sym).Name;
	}
	break;
	default:
	{
		NimStringDesc* LOC17;
		LOC17 = 0;
		LOC17 = rendertree_211051(n, 0);
		globalerror_165558((*n).Info, ((NU16) 19), LOC17);
	}
	break;
	}
	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, 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(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, 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, 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;
}

static N_INLINE(NI, scopedepth_250191)(tcontext250019* 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(tscope188827*, openscope_252167)(tcontext250019* c) {
	tscope188827* result;
	tscope188827* LOC1;
	NI LOC2;
	result = 0;
	LOC1 = 0;
	LOC1 = (tscope188827*) newObj((&NTI188829), sizeof(tscope188827));
	asgnRef((void**) &(*LOC1).Parent, (*c).Currentscope);
	newstrtable_192425(&(*LOC1).Symbols);
	LOC2 = 0;
	LOC2 = scopedepth_250191(c);
	(*LOC1).Depthlevel = (NI32)(LOC2 + 1);
	result = LOC1;
	asgnRef((void**) &(*c).Currentscope, result);
	return result;
}

N_NIMCALL(NU8, adduniquesym_252159)(tscope188827* scope, tsym188833* s) {
	NU8 result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = strtableincl_202135(&(*scope).Symbols, s);
		if (!LOC3) goto LA4;
		result = ((NU8) 0);
	}
	goto LA1;
	LA4: ;
	{
		result = ((NU8) 1);
	}
	LA1: ;
	return result;
}

N_NIMCALL(void, wrongredefinition_252535)(tlineinfo163527 info, NimStringDesc* s) {
	{
		if (!!((gcmd_137113 == ((NU8) 18)))) goto LA3;
		localerror_165571(info, ((NU16) 40), s);
	}
	LA3: ;
}

N_NIMCALL(void, adddecl_252550)(tcontext250019* c, tsym188833* sym) {
	{
		NU8 LOC3;
		LOC3 = 0;
		LOC3 = adduniquesym_252159((*c).Currentscope, sym);
		if (!(LOC3 == ((NU8) 0))) goto LA4;
		wrongredefinition_252535((*sym).Info, (*(*sym).Name).S);
	}
	LA4: ;
}

N_NIMCALL(NimStringDesc*, getsymrepr_252377)(tsym188833* 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_223025(s);
	}
	break;
	default:
	{
		result = copyString((*(*s).Name).S);
	}
	break;
	}
	return result;
}

N_NIMCALL(void, ensurenomissingorunusedsymbols_252002)(tscope188827* scope) {
	ttabiter197090 it;
	tsym188833* s;
	NI missingimpls;
	memset((void*)&it, 0, sizeof(it));
	s = inittabiter_197093(&it, (*scope).Symbols);
	missingimpls = 0;
	while (1) {
		if (!!((s == NIM_NIL))) goto LA1;
		{
			if (!(((*s).Flags &(1<<((((NU8) 4))&31)))!=0)) goto LA4;
			{
				NimStringDesc* LOC10;
				if (!(missingimpls == 0)) goto LA8;
				LOC10 = 0;
				LOC10 = getsymrepr_252377(s);
				localerror_165571((*s).Info, ((NU16) 138), LOC10);
			}
			LA8: ;
			missingimpls += 1;
		}
		goto LA2;
		LA4: ;
		{
			NIM_BOOL LOC12;
			LOC12 = 0;
			LOC12 = ((3 & (*s).Flags) == 0);
			if (!(LOC12)) goto LA13;
			LOC12 = (((*s).Options &(1<<((((NU8) 12))&31)))!=0);
			LA13: ;
			if (!LOC12) goto LA14;
			{
				if (!!(((2105369 &(1<<(((*s).Kind)&31)))!=0))) goto LA18;
				{
					NIM_BOOL LOC22;
					NimStringDesc* LOC26;
					LOC22 = 0;
					LOC22 = !(((*s).Typ == NIM_NIL));
					if (!(LOC22)) goto LA23;
					LOC22 = !((((*(*s).Typ).Flags &(1<<((((NU8) 24))&31)))!=0));
					LA23: ;
					if (!LOC22) goto LA24;
					LOC26 = 0;
					LOC26 = getsymrepr_252377(s);
					message_165584((*s).Info, ((NU16) 260), LOC26);
				}
				LA24: ;
			}
			LA18: ;
		}
		goto LA2;
		LA14: ;
		LA2: ;
		s = nextiter_197099(&it, (*scope).Symbols);
	} LA1: ;
}

N_NIMCALL(void, rawclosescope_252174)(tcontext250019* c) {
	asgnRef((void**) &(*c).Currentscope, (*(*c).Currentscope).Parent);
}

N_NIMCALL(void, closescope_252179)(tcontext250019* c) {
	ensurenomissingorunusedsymbols_252002((*c).Currentscope);
	rawclosescope_252174(c);
}

N_NIMCALL(tsym188833*, searchinscopes_252216)(tcontext250019* c, tident167019* s) {
	tsym188833* result;
	tscope188827* scope_252221;
	tscope188827* HEX3Atmp_252239;
	tscope188827* current_252241;
	result = 0;
	scope_252221 = 0;
	HEX3Atmp_252239 = 0;
	HEX3Atmp_252239 = (*c).Currentscope;
	current_252241 = HEX3Atmp_252239;
	while (1) {
		if (!!((current_252241 == NIM_NIL))) goto LA1;
		scope_252221 = current_252241;
		result = strtableget_197084((*scope_252221).Symbols, s);
		{
			if (!!((result == NIM_NIL))) goto LA4;
			goto BeforeRet;
		}
		LA4: ;
		current_252241 = (*current_252241).Parent;
	} LA1: ;
	result = NIM_NIL;
	BeforeRet: ;
	return result;
}

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(tsym188833*, errorsym_252288)(tcontext250019* c, tnode188803* n) {
	tsym188833* result;
	tnode188803* m;
	tident167019* ident;
	tsym188833* 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 = consideracc_252006(m);
	}
	goto LA5;
	LA7: ;
	{
		NimStringDesc* LOC10;
		NimStringDesc* LOC11;
		LOC10 = 0;
		LOC11 = 0;
		LOC11 = rendertree_211051(m, 0);
		LOC10 = rawNewString(LOC11->Sup.len + 4);
appendString(LOC10, ((NimStringDesc*) &TMP2569));
appendString(LOC10, LOC11);
		ident = getident_167456(LOC10);
	}
	LA5: ;
	LOC12 = 0;
	LOC12 = getcurrowner_250215();
	result = newsym_189053(((NU8) 0), ident, LOC12, (*n).Info);
	asgnRefNoCycle((void**) &(*result).Typ, errortype_251136(c));
	(*result).Flags |=((NI32)(1)<<((((NU8) 29))%(sizeof(NI32)*8)));
	{
		NIM_BOOL LOC15;
		LOC15 = 0;
		LOC15 = !((gcmd_137113 == ((NU8) 18)));
		if (!(LOC15)) goto LA16;
		LOC15 = ((*c).Incompilescontext == 0);
		LA16: ;
		if (!LOC15) goto LA17;
		strtableadd_197078(&(*(*c).Importtable).Symbols, result);
	}
	LA17: ;
	return result;
}

N_NIMCALL(tsym188833*, lookup_252708)(tcontext250019* c, tnode188803* n) {
	tsym188833* result;
	result = 0;
	switch ((*n).Kind) {
	case ((NU8) 2):
	{
		result = searchinscopes_252216(c, (*n).kindU.S5.Ident);
		{
			if (!(result == NIM_NIL)) goto LA4;
			localerror_165571((*n).Info, ((NU16) 61), (*(*n).kindU.S5.Ident).S);
			result = errorsym_252288(c, n);
		}
		LA4: ;
	}
	break;
	case ((NU8) 3):
	{
		result = (*n).kindU.S4.Sym;
	}
	break;
	case ((NU8) 53):
	{
		tident167019* ident;
		ident = consideracc_252006(n);
		result = searchinscopes_252216(c, ident);
		{
			if (!(result == NIM_NIL)) goto LA10;
			localerror_165571((*n).Info, ((NU16) 61), (*ident).S);
			result = errorsym_252288(c, n);
		}
		LA10: ;
	}
	break;
	default:
	{
		internalerror_165591((*n).Info, ((NimStringDesc*) &TMP2570));
		goto BeforeRet;
	}
	break;
	}
	{
		NIM_BOOL LOC15;
		LOC15 = 0;
		LOC15 = contains_185821((*c).Ambiguoussymbols, (*result).Sup.Id);
		if (!LOC15) goto LA16;
		localerror_165571((*n).Info, ((NU16) 62), (*(*result).Name).S);
	}
	LA16: ;
	{
		if (!((*result).Kind == ((NU8) 23))) goto LA20;
		loadstub_239239(result);
	}
	LA20: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(tsym188833*, qualifiedlookup_252806)(tcontext250019* c, tnode188803* n, NU8 flags) {
	tsym188833* result;
	result = 0;
	switch ((*n).Kind) {
	case ((NU8) 2):
	case ((NU8) 53):
	{
		tident167019* ident;
		ident = consideracc_252006(n);
		result = searchinscopes_252216(c, ident);
		{
			NIM_BOOL LOC4;
			LOC4 = 0;
			LOC4 = (result == NIM_NIL);
			if (!(LOC4)) goto LA5;
			LOC4 = ((flags &(1<<((((NU8) 1))&7)))!=0);
			LA5: ;
			if (!LOC4) goto LA6;
			localerror_165571((*n).Info, ((NU16) 61), (*ident).S);
			result = errorsym_252288(c, n);
		}
		goto LA2;
		LA6: ;
		{
			NIM_BOOL LOC9;
			NIM_BOOL LOC10;
			LOC9 = 0;
			LOC10 = 0;
			LOC10 = ((flags &(1<<((((NU8) 0))&7)))!=0);
			if (!(LOC10)) goto LA11;
			LOC10 = !((result == NIM_NIL));
			LA11: ;
			LOC9 = LOC10;
			if (!(LOC9)) goto LA12;
			LOC9 = contains_185821((*c).Ambiguoussymbols, (*result).Sup.Id);
			LA12: ;
			if (!LOC9) goto LA13;
			localerror_165571((*n).Info, ((NU16) 62), (*ident).S);
		}
		goto LA2;
		LA13: ;
		LA2: ;
	}
	break;
	case ((NU8) 3):
	{
		result = (*n).kindU.S4.Sym;
		{
			NIM_BOOL LOC18;
			LOC18 = 0;
			LOC18 = ((flags &(1<<((((NU8) 0))&7)))!=0);
			if (!(LOC18)) goto LA19;
			LOC18 = contains_185821((*c).Ambiguoussymbols, (*result).Sup.Id);
			LA19: ;
			if (!LOC18) goto LA20;
			localerror_165571((*n).Info, ((NU16) 62), (*(*(*n).kindU.S4.Sym).Name).S);
		}
		LA20: ;
	}
	break;
	case ((NU8) 45):
	{
		tsym188833* m;
		result = NIM_NIL;
		m = qualifiedlookup_252806(c, (*n).kindU.S6.Sons->data[0], (flags & 2));
		{
			NIM_BOOL LOC25;
			tident167019* ident;
			LOC25 = 0;
			LOC25 = !((m == NIM_NIL));
			if (!(LOC25)) goto LA26;
			LOC25 = ((*m).Kind == ((NU8) 6));
			LA26: ;
			if (!LOC25) goto LA27;
			ident = NIM_NIL;
			{
				if (!((*(*n).kindU.S6.Sons->data[1]).Kind == ((NU8) 2))) goto LA31;
				ident = (*(*n).kindU.S6.Sons->data[1]).kindU.S5.Ident;
			}
			goto LA29;
			LA31: ;
			{
				if (!((*(*n).kindU.S6.Sons->data[1]).Kind == ((NU8) 53))) goto LA34;
				ident = consideracc_252006((*n).kindU.S6.Sons->data[1]);
			}
			goto LA29;
			LA34: ;
			LA29: ;
			{
				if (!!((ident == NIM_NIL))) goto LA38;
				{
					if (!(m == (*c).Module)) goto LA42;
					result = strtableget_197084((*(*c).Toplevelscope).Symbols, ident);
				}
				goto LA40;
				LA42: ;
				{
					result = strtableget_197084((*m).kindU.S3.Tab, ident);
				}
				LA40: ;
				{
					NIM_BOOL LOC47;
					LOC47 = 0;
					LOC47 = (result == NIM_NIL);
					if (!(LOC47)) goto LA48;
					LOC47 = ((flags &(1<<((((NU8) 1))&7)))!=0);
					LA48: ;
					if (!LOC47) goto LA49;
					localerror_165571((*(*n).kindU.S6.Sons->data[1]).Info, ((NU16) 61), (*ident).S);
					result = errorsym_252288(c, (*n).kindU.S6.Sons->data[1]);
				}
				LA49: ;
			}
			goto LA36;
			LA38: ;
			{
				if (!((*(*n).kindU.S6.Sons->data[1]).Kind == ((NU8) 3))) goto LA52;
				result = (*(*n).kindU.S6.Sons->data[1]).kindU.S4.Sym;
			}
			goto LA36;
			LA52: ;
			{
				NIM_BOOL LOC55;
				NimStringDesc* LOC59;
				LOC55 = 0;
				LOC55 = ((flags &(1<<((((NU8) 1))&7)))!=0);
				if (!(LOC55)) goto LA56;
				LOC55 = !(((*(*n).kindU.S6.Sons->data[1]).Kind == ((NU8) 57) || (*(*n).kindU.S6.Sons->data[1]).Kind == ((NU8) 56)));
				LA56: ;
				if (!LOC55) goto LA57;
				LOC59 = 0;
				LOC59 = rendertree_211051((*n).kindU.S6.Sons->data[1], 0);
				localerror_165571((*(*n).kindU.S6.Sons->data[1]).Info, ((NU16) 19), LOC59);
				result = errorsym_252288(c, (*n).kindU.S6.Sons->data[1]);
			}
			goto LA36;
			LA57: ;
			LA36: ;
		}
		LA27: ;
	}
	break;
	default:
	{
		result = NIM_NIL;
	}
	break;
	}
	{
		NIM_BOOL LOC63;
		LOC63 = 0;
		LOC63 = !((result == NIM_NIL));
		if (!(LOC63)) goto LA64;
		LOC63 = ((*result).Kind == ((NU8) 23));
		LA64: ;
		if (!LOC63) goto LA65;
		loadstub_239239(result);
	}
	LA65: ;
	return result;
}

N_NIMCALL(tsym188833*, initoverloaditer_253331)(toverloaditer252363* o, tcontext250019* c, tnode188803* n) {
	tsym188833* result;
	result = 0;
	switch ((*n).Kind) {
	case ((NU8) 2):
	case ((NU8) 53):
	{
		tident167019* ident;
		ident = consideracc_252006(n);
		unsureAsgnRef((void**) &(*o).Scope, (*c).Currentscope);
		(*o).Mode = ((NU8) 1);
		while (1) {
			result = initidentiter_197110(&(*o).It, (*(*o).Scope).Symbols, ident);
			{
				if (!!((result == NIM_NIL))) goto LA5;
				goto LA2;
			}
			goto LA3;
			LA5: ;
			{
				unsureAsgnRef((void**) &(*o).Scope, (*(*o).Scope).Parent);
				{
					if (!((*o).Scope == NIM_NIL)) goto LA10;
					goto LA2;
				}
				LA10: ;
			}
			LA3: ;
		} 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_252806(c, (*n).kindU.S6.Sons->data[0], 2));
		{
			NIM_BOOL LOC16;
			tident167019* ident;
			LOC16 = 0;
			LOC16 = !(((*o).M == NIM_NIL));
			if (!(LOC16)) goto LA17;
			LOC16 = ((*(*o).M).Kind == ((NU8) 6));
			LA17: ;
			if (!LOC16) goto LA18;
			ident = NIM_NIL;
			{
				if (!((*(*n).kindU.S6.Sons->data[1]).Kind == ((NU8) 2))) goto LA22;
				ident = (*(*n).kindU.S6.Sons->data[1]).kindU.S5.Ident;
			}
			goto LA20;
			LA22: ;
			{
				if (!((*(*n).kindU.S6.Sons->data[1]).Kind == ((NU8) 53))) goto LA25;
				ident = consideracc_252006((*n).kindU.S6.Sons->data[1]);
			}
			goto LA20;
			LA25: ;
			LA20: ;
			{
				if (!!((ident == NIM_NIL))) goto LA29;
				{
					if (!((*o).M == (*c).Module)) goto LA33;
					result = initidentiter_197110(&(*o).It, (*(*c).Toplevelscope).Symbols, ident);
					(*o).Mode = ((NU8) 2);
				}
				goto LA31;
				LA33: ;
				{
					result = initidentiter_197110(&(*o).It, (*(*o).M).kindU.S3.Tab, ident);
				}
				LA31: ;
			}
			goto LA27;
			LA29: ;
			{
				NimStringDesc* LOC37;
				LOC37 = 0;
				LOC37 = rendertree_211051((*n).kindU.S6.Sons->data[1], 0);
				localerror_165571((*(*n).kindU.S6.Sons->data[1]).Info, ((NU16) 19), LOC37);
				result = errorsym_252288(c, (*n).kindU.S6.Sons->data[1]);
			}
			LA27: ;
		}
		LA18: ;
	}
	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_185918(&(*o).Insymchoice);
		incl_185849(&(*o).Insymchoice, (*result).Sup.Id);
	}
	break;
	default:
	{
	}
	break;
	}
	{
		NIM_BOOL LOC42;
		LOC42 = 0;
		LOC42 = !((result == NIM_NIL));
		if (!(LOC42)) goto LA43;
		LOC42 = ((*result).Kind == ((NU8) 23));
		LA43: ;
		if (!LOC42) goto LA44;
		loadstub_239239(result);
	}
	LA44: ;
	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;
}

N_NIMCALL(tsym188833*, nextoverloaditer_253684)(toverloaditer252363* o, tcontext250019* c, tnode188803* n) {
	tsym188833* result;
	result = 0;
	switch ((*o).Mode) {
	case ((NU8) 0):
	{
		result = NIM_NIL;
	}
	break;
	case ((NU8) 1):
	{
		{
			if (!!(((*o).Scope == NIM_NIL))) goto LA5;
			result = nextidentiter_197117(&(*o).It, (*(*o).Scope).Symbols);
			while (1) {
				if (!(result == NIM_NIL)) goto LA7;
				unsureAsgnRef((void**) &(*o).Scope, (*(*o).Scope).Parent);
				{
					if (!((*o).Scope == NIM_NIL)) goto LA10;
					goto LA7;
				}
				LA10: ;
				result = initidentiter_197110(&(*o).It, (*(*o).Scope).Symbols, (*o).It.Name);
			} LA7: ;
		}
		goto LA3;
		LA5: ;
		{
			result = NIM_NIL;
		}
		LA3: ;
	}
	break;
	case ((NU8) 2):
	{
		result = nextidentiter_197117(&(*o).It, (*(*c).Toplevelscope).Symbols);
	}
	break;
	case ((NU8) 3):
	{
		result = nextidentiter_197117(&(*o).It, (*(*o).M).kindU.S3.Tab);
	}
	break;
	case ((NU8) 4):
	{
		{
			NI LOC18;
			LOC18 = 0;
			LOC18 = sonslen_189181(n);
			if (!((*o).Symchoiceindex < LOC18)) goto LA19;
			result = (*(*n).kindU.S6.Sons->data[(*o).Symchoiceindex]).kindU.S4.Sym;
			incl_185849(&(*o).Insymchoice, (*result).Sup.Id);
			(*o).Symchoiceindex += 1;
		}
		goto LA16;
		LA19: ;
		{
			if (!((*n).Kind == ((NU8) 57))) goto LA22;
			(*o).Mode = ((NU8) 5);
			unsureAsgnRef((void**) &(*o).Scope, (*c).Currentscope);
			result = firstidentexcluding_202534(&(*o).It, (*(*o).Scope).Symbols, (*(*(*n).kindU.S6.Sons->data[0]).kindU.S4.Sym).Name, (*o).Insymchoice);
			while (1) {
				if (!(result == NIM_NIL)) goto LA24;
				unsureAsgnRef((void**) &(*o).Scope, (*(*o).Scope).Parent);
				{
					if (!((*o).Scope == NIM_NIL)) goto LA27;
					goto LA24;
				}
				LA27: ;
				result = firstidentexcluding_202534(&(*o).It, (*(*o).Scope).Symbols, (*(*(*n).kindU.S6.Sons->data[0]).kindU.S4.Sym).Name, (*o).Insymchoice);
			} LA24: ;
		}
		goto LA16;
		LA22: ;
		LA16: ;
	}
	break;
	case ((NU8) 5):
	{
		result = nextidentexcluding_202487(&(*o).It, (*(*o).Scope).Symbols, (*o).Insymchoice);
		while (1) {
			if (!(result == NIM_NIL)) goto LA30;
			unsureAsgnRef((void**) &(*o).Scope, (*(*o).Scope).Parent);
			{
				if (!((*o).Scope == NIM_NIL)) goto LA33;
				goto LA30;
			}
			LA33: ;
			result = firstidentexcluding_202534(&(*o).It, (*(*o).Scope).Symbols, (*(*(*n).kindU.S6.Sons->data[0]).kindU.S4.Sym).Name, (*o).Insymchoice);
		} LA30: ;
	}
	break;
	}
	{
		NIM_BOOL LOC37;
		LOC37 = 0;
		LOC37 = !((result == NIM_NIL));
		if (!(LOC37)) goto LA38;
		LOC37 = ((*result).Kind == ((NU8) 23));
		LA38: ;
		if (!LOC37) goto LA39;
		loadstub_239239(result);
	}
	LA39: ;
	return result;
}

N_NIMCALL(void, addprelimdecl_252565)(tcontext250019* c, tsym188833* sym) {
	NU8 LOC1;
	LOC1 = 0;
	LOC1 = adduniquesym_252159((*c).Currentscope, sym);
}

N_NIMCALL(NI, lastoverloadscope_253667)(toverloaditer252363* 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(tsym188833*, searchinscopes_252245)(tcontext250019* c, tident167019* s, NU32 filter) {
	tsym188833* result;
	tscope188827* scope_252251;
	tscope188827* HEX3Atmp_252282;
	tscope188827* current_252284;
	result = 0;
	scope_252251 = 0;
	HEX3Atmp_252282 = 0;
	HEX3Atmp_252282 = (*c).Currentscope;
	current_252284 = HEX3Atmp_252282;
	while (1) {
		if (!!((current_252284 == NIM_NIL))) goto LA1;
		scope_252251 = current_252284;
		result = strtableget_197084((*scope_252251).Symbols, s);
		{
			NIM_BOOL LOC4;
			LOC4 = 0;
			LOC4 = !((result == NIM_NIL));
			if (!(LOC4)) goto LA5;
			LOC4 = ((filter &(1<<(((*result).Kind)&31)))!=0);
			LA5: ;
			if (!LOC4) goto LA6;
			goto BeforeRet;
		}
		LA6: ;
		current_252284 = (*current_252284).Parent;
	} LA1: ;
	result = NIM_NIL;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, addoverloadablesymat_252644)(tscope188827* scope, tsym188833* fn) {
	tsym188833* check;
	{
		if (!!(((520256 &(1<<(((*fn).Kind)&31)))!=0))) goto LA3;
		internalerror_165591((*fn).Info, ((NimStringDesc*) &TMP2820));
		goto BeforeRet;
	}
	LA3: ;
	check = strtableget_197084((*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_252535((*fn).Info, (*(*fn).Name).S);
	}
	goto LA5;
	LA9: ;
	{
		strtableadd_197078(&(*scope).Symbols, fn);
	}
	LA5: ;
	BeforeRet: ;
}

N_NIMCALL(void, addinterfacedeclaux_252586)(tcontext250019* c, tsym188833* sym) {
	{
		if (!(((*sym).Flags &(1<<((((NU8) 1))&31)))!=0)) goto LA3;
		{
			if (!!(((*c).Module == NIM_NIL))) goto LA7;
			strtableadd_197078(&(*(*c).Module).kindU.S3.Tab, sym);
		}
		goto LA5;
		LA7: ;
		{
			internalerror_165591((*sym).Info, ((NimStringDesc*) &TMP2821));
		}
		LA5: ;
	}
	LA3: ;
}

N_NIMCALL(void, addinterfaceoverloadablesymat_252701)(tcontext250019* c, tscope188827* scope, tsym188833* sym) {
	addoverloadablesymat_252644(scope, sym);
	addinterfacedeclaux_252586(c, sym);
}

N_NIMCALL(void, adddeclat_252571)(tscope188827* scope, tsym188833* sym) {
	{
		NU8 LOC3;
		LOC3 = 0;
		LOC3 = adduniquesym_252159(scope, sym);
		if (!(LOC3 == ((NU8) 0))) goto LA4;
		wrongredefinition_252535((*sym).Info, (*(*sym).Name).S);
	}
	LA4: ;
}

N_NIMCALL(void, addinterfacedeclat_252637)(tcontext250019* c, tscope188827* scope, tsym188833* sym) {
	adddeclat_252571(scope, sym);
	addinterfacedeclaux_252586(c, sym);
}

N_NIMCALL(tsym188833*, localsearchinscope_252209)(tcontext250019* c, tident167019* s) {
	tsym188833* result;
	result = 0;
	result = strtableget_197084((*(*c).Currentscope).Symbols, s);
	return result;
}

N_NIMCALL(void, addinterfacedecl_252695)(tcontext250019* c, tsym188833* sym) {
	adddecl_252550(c, sym);
	addinterfacedeclaux_252586(c, sym);
}
N_NOINLINE(void, lookupsInit)(void) {
}

N_NOINLINE(void, lookupsDatInit)(void) {
}

