/* Generated by Nim Compiler v0.13.0 */
/*   (c) 2015 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_INTBITS 64

#include "nimbase.h"
#include <string.h>
typedef struct Tcontext265020 Tcontext265020;
typedef struct Tsym215822 Tsym215822;
typedef struct Tscope215816 Tscope215816;
typedef struct Tstrtable215794 Tstrtable215794;
typedef struct Tsymseq215792 Tsymseq215792;
typedef struct Tnodeseq215784 Tnodeseq215784;
typedef struct Tpasscontext262002 Tpasscontext262002;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Tproccon265008 Tproccon265008;
typedef struct Intset212035 Intset212035;
typedef struct Trunk212031 Trunk212031;
typedef struct Trunkseq212033 Trunkseq212033;
typedef struct Tlinkedlist135016 Tlinkedlist135016;
typedef struct Tlistentry135010 Tlistentry135010;
typedef struct Tidtable215840 Tidtable215840;
typedef struct Tidpairseq215838 Tidpairseq215838;
typedef struct Tnode215790 Tnode215790;
typedef struct Ttype215828 Ttype215828;
typedef struct Tlineinfo183337 Tlineinfo183337;
typedef struct Tctx264036 Tctx264036;
typedef struct TY265140 TY265140;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tidobj190006 Tidobj190006;
typedef struct Ttypeseq215824 Ttypeseq215824;
typedef struct TY215925 TY215925;
typedef struct Tident190012 Tident190012;
typedef struct Tloc215804 Tloc215804;
typedef struct Ropeobj170006 Ropeobj170006;
typedef struct Tlib215808 Tlib215808;
typedef struct Cell47504 Cell47504;
typedef struct Cellset47516 Cellset47516;
typedef struct Gcheap49818 Gcheap49818;
typedef struct Gcstack49816 Gcstack49816;
typedef struct Cellseq47520 Cellseq47520;
typedef struct Pagedesc47512 Pagedesc47512;
typedef struct Memregion29688 Memregion29688;
typedef struct Smallchunk29640 Smallchunk29640;
typedef struct Llchunk29682 Llchunk29682;
typedef struct Bigchunk29642 Bigchunk29642;
typedef struct Intset29614 Intset29614;
typedef struct Trunk29610 Trunk29610;
typedef struct Avlnode29686 Avlnode29686;
typedef struct Gcstat49814 Gcstat49814;
typedef struct Ttabiter222071 Ttabiter222071;
typedef struct Toverloaditer270296 Toverloaditer270296;
typedef struct Tidentiter222084 Tidentiter222084;
typedef struct Tidpair215836 Tidpair215836;
typedef struct TY264242 TY264242;
typedef struct TY184090 TY184090;
typedef struct PprocHEX3Aobjecttype264221 PprocHEX3Aobjecttype264221;
typedef struct TY264261 TY264261;
typedef struct Tinstantiationpair265010 Tinstantiationpair265010;
typedef struct Tinstantiation215812 Tinstantiation215812;
typedef struct Basechunk29638 Basechunk29638;
typedef struct Freecell29630 Freecell29630;
typedef struct TY264222 TY264222;
typedef struct TY264227 TY264227;
typedef struct TY264262 TY264262;
typedef struct Vmargs264030 Vmargs264030;
typedef struct TY215913 TY215913;
typedef struct Tblock264018 Tblock264018;
typedef struct TY264202 TY264202;
struct  Tstrtable215794  {
NI counter;
Tsymseq215792* data;
};
struct  Tscope215816  {
NI depthlevel;
Tstrtable215794 symbols;
Tnodeseq215784* usingsyms;
Tscope215816* parent;
};
typedef N_NIMCALL_PTR(void, TY3489) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3494) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3489 marker;
TY3494 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Tpasscontext262002  {
  TNimObject Sup;
NIM_BOOL fromcache;
};
struct  Intset212035  {
NI counter;
NI max;
Trunk212031* head;
Trunkseq212033* data;
};
struct  Tlinkedlist135016  {
Tlistentry135010* head;
Tlistentry135010* tail;
NI counter;
};
struct  Tidtable215840  {
NI counter;
Tidpairseq215838* data;
};
typedef N_NIMCALL_PTR(Tnode215790*, TY265071) (Tcontext265020* c, Tnode215790* n);
typedef N_NIMCALL_PTR(Tnode215790*, TY265076) (Tcontext265020* c, Tnode215790* n, NU16 flags);
typedef N_NIMCALL_PTR(Tnode215790*, TY265084) (Tcontext265020* c, Tnode215790* n, NU16 flags);
typedef N_NIMCALL_PTR(Tnode215790*, TY265092) (Tcontext265020* c, Tnode215790* n);
typedef N_NIMCALL_PTR(Tnode215790*, TY265097) (Tcontext265020* c, Tnode215790* n, NU16 flags);
typedef N_NIMCALL_PTR(Tnode215790*, TY265105) (Tcontext265020* c, Tnode215790* n);
typedef N_NIMCALL_PTR(Tnode215790*, TY265110) (Tcontext265020* c, Tnode215790* n, Tnode215790* norig, NU32 filter);
typedef N_NIMCALL_PTR(Ttype215828*, TY265117) (Tcontext265020* c, Tnode215790* n, Ttype215828* prev);
typedef struct {
N_NIMCALL_PTR(Tnode215790*, ClPrc) (Tcontext265020* c, Tidtable215840 pt, Tnode215790* n, void* ClEnv);
void* ClEnv;
} TY265123;
typedef struct {
N_NIMCALL_PTR(Tsym215822*, ClPrc) (Tcontext265020* c, Tsym215822* fn, Tidtable215840 pt, Tlineinfo183337 info, void* ClEnv);
void* ClEnv;
} TY265129;
typedef N_NIMCALL_PTR(Tsym215822*, TY265145) (Tcontext265020* c, Tsym215822* dc, Ttype215828* t, Tlineinfo183337 info, NU8 op);
struct  Tcontext265020  {
  Tpasscontext262002 Sup;
Tsym215822* module;
Tscope215816* currentscope;
Tscope215816* importtable;
Tscope215816* toplevelscope;
Tproccon265008* p;
Tsymseq215792* friendmodules;
NI instcounter;
Intset212035 ambiguoussymbols;
NI intypeclass;
NI ingenericcontext;
NI inunrolledcontext;
NI compilescontextid;
NI compilescontextidgenerator;
NI ingenericinst;
Tsymseq215792* converters;
Tsymseq215792* patterns;
Tlinkedlist135016 optionstack;
Tidtable215840 symmapping;
Tlinkedlist135016 libs;
TY265071 semconstexpr;
TY265076 semexpr;
TY265084 semtryexpr;
TY265092 semtryconstexpr;
TY265097 semoperand;
TY265105 semconstboolexpr;
TY265110 semoverloadedcall;
TY265117 semtypenode;
TY265123 seminferredlambda;
TY265129 semgenerateinstance;
Intset212035 includedfiles;
Tstrtable215794 userpragmas;
Tctx264036* evalcontext;
Intset212035 unknownidents;
TY265140* generics;
NI lastgenericidx;
NI hloloopdetector;
NI inparallelstmt;
TY265145 insttypeboundop;
};
struct  Tlineinfo183337  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tidobj190006  {
  TNimObject Sup;
NI id;
};
struct  Tloc215804  {
NU8 k;
NU8 s;
NU16 flags;
Ttype215828* t;
Ropeobj170006* r;
Ropeobj170006* heaproot;
};
struct  Tsym215822  {
  Tidobj190006 Sup;
NU8 kind;
union{
struct {Ttypeseq215824* typeinstcache;
Tscope215816* typscope;
} S1;
struct {TY215925* procinstcache;
Tsym215822* gcunsafetyreason;
} S2;
struct {TY215925* usedgenerics;
Tstrtable215794 tab;
} S3;
struct {Tsym215822* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype215828* typ;
Tident190012* name;
Tlineinfo183337 info;
Tsym215822* owner;
NU32 flags;
Tnode215790* ast;
NU32 options;
NI position;
NI offset;
Tloc215804 loc;
Tlib215808* annex;
Tnode215790* constraint;
};
struct  Tident190012  {
  Tidobj190006 Sup;
NimStringDesc* s;
Tident190012* next;
NI h;
};
struct  Tnode215790  {
Ttype215828* typ;
Tlineinfo183337 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym215822* sym;
} S4;
struct {Tident190012* ident;
} S5;
struct {Tnodeseq215784* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Cell47504  {
NI refcount;
TNimType* typ;
};
struct  Cellseq47520  {
NI len;
NI cap;
Cell47504** d;
};
struct  Cellset47516  {
NI counter;
NI max;
Pagedesc47512* head;
Pagedesc47512** data;
};
typedef Smallchunk29640* TY29703[512];
typedef Trunk29610* Trunkbuckets29612[256];
struct  Intset29614  {
Trunkbuckets29612 data;
};
struct  Memregion29688  {
NI minlargeobj;
NI maxlargeobj;
TY29703 freesmallchunks;
Llchunk29682* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk29642* freechunkslist;
Intset29614 chunkstarts;
Avlnode29686* root;
Avlnode29686* deleted;
Avlnode29686* last;
Avlnode29686* freeavlnodes;
};
struct  Gcstat49814  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap49818  {
Gcstack49816* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq47520 zct;
Cellseq47520 decstack;
Cellset47516 cycleroots;
Cellseq47520 tempstack;
NI recgclock;
Memregion29688 region;
Gcstat49814 stat;
};
struct  Ttabiter222071  {
NI h;
};
struct  Ttype215828  {
  Tidobj190006 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq215824* sons;
Tnode215790* n;
Tsym215822* owner;
Tsym215822* sym;
Tsym215822* destructor;
Tsym215822* deepcopy;
Tsym215822* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc215804 loc;
};
struct  Tidentiter222084  {
NI h;
Tident190012* name;
};
struct  Toverloaditer270296  {
Tidentiter222084 it;
Tsym215822* m;
NU8 mode;
NI symchoiceindex;
Tscope215816* scope;
Intset212035 insymchoice;
};
struct  Tproccon265008  {
Tsym215822* owner;
Tsym215822* resultsym;
NI nestedloopcounter;
NI nestedblockcounter;
NI intrystmt;
Tproccon265008* next;
NIM_BOOL wasforwarded;
Tnode215790* bracketexpr;
};
typedef NI TY29619[8];
struct  Trunk212031  {
Trunk212031* next;
NI key;
TY29619 bits;
};
struct  Tlistentry135010  {
  TNimObject Sup;
Tlistentry135010* prev;
Tlistentry135010* next;
};
struct  Tidpair215836  {
Tidobj190006* key;
TNimObject* val;
};
struct  Tctx264036  {
  Tpasscontext262002 Sup;
TY264242* code;
TY184090* debug;
Tnode215790* globals;
Tnode215790* constants;
Ttypeseq215824* types;
Tnode215790* currentexceptiona;
Tnode215790* currentexceptionb;
NI exceptioninstr;
PprocHEX3Aobjecttype264221* prc;
Tsym215822* module;
Tnode215790* callsite;
NU8 mode;
NU8 features;
NIM_BOOL traceactive;
NI loopiterations;
Tlineinfo183337 comesfromheuristic;
TY264261* callbacks;
NimStringDesc* errorflag;
};
struct  Tinstantiationpair265010  {
Tsym215822* genericsym;
Tinstantiation215812* inst;
};
struct  Ropeobj170006  {
  TNimObject Sup;
Ropeobj170006* left;
Ropeobj170006* right;
NI length;
NimStringDesc* data;
};
struct  Tlib215808  {
  Tlistentry135010 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj170006* name;
Tnode215790* path;
};
struct  Gcstack49816  {
Gcstack49816* prev;
Gcstack49816* next;
void* starts;
void* pos;
NI maxstacksize;
};
struct  Pagedesc47512  {
Pagedesc47512* next;
NI key;
TY29619 bits;
};
struct  Basechunk29638  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk29640  {
  Basechunk29638 Sup;
Smallchunk29640* next;
Smallchunk29640* prev;
Freecell29630* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk29682  {
NI size;
NI acc;
Llchunk29682* next;
};
struct  Bigchunk29642  {
  Basechunk29638 Sup;
Bigchunk29642* next;
Bigchunk29642* prev;
NI align;
NF data;
};
struct  Trunk29610  {
Trunk29610* next;
NI key;
TY29619 bits;
};
typedef Avlnode29686* TY29693[2];
struct  Avlnode29686  {
TY29693 link;
NI key;
NI upperbound;
NI level;
};
struct TY264227 {
NIM_BOOL Field0;
NU8 Field1;
};
typedef TY264227 TY264230[256];
struct  PprocHEX3Aobjecttype264221  {
TY264222* blocks;
Tsym215822* sym;
TY264230 slots;
NI maxslots;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (Vmargs264030* args, void* ClEnv);
void* ClEnv;
} Vmcallback264032;
struct TY264262 {
NimStringDesc* Field0;
Vmcallback264032 Field1;
};
struct  Tinstantiation215812  {
Tsym215822* sym;
Ttypeseq215824* concretetypes;
TY215913* usedby;
NI compilesid;
};
struct  Freecell29630  {
Freecell29630* next;
NI zerofield;
};
struct  Tblock264018  {
Tsym215822* label;
TY264202* fixups;
};
struct  Vmargs264030  {
NI ra;
NI rb;
NI rc;
void* slots;
Tnode215790* currentexception;
};
struct Tsymseq215792 {
  TGenericSeq Sup;
  Tsym215822* data[SEQ_DECL_SIZE];
};
struct Tnodeseq215784 {
  TGenericSeq Sup;
  Tnode215790* data[SEQ_DECL_SIZE];
};
struct Trunkseq212033 {
  TGenericSeq Sup;
  Trunk212031* data[SEQ_DECL_SIZE];
};
struct Tidpairseq215838 {
  TGenericSeq Sup;
  Tidpair215836 data[SEQ_DECL_SIZE];
};
struct TY265140 {
  TGenericSeq Sup;
  Tinstantiationpair265010 data[SEQ_DECL_SIZE];
};
struct Ttypeseq215824 {
  TGenericSeq Sup;
  Ttype215828* data[SEQ_DECL_SIZE];
};
struct TY215925 {
  TGenericSeq Sup;
  Tinstantiation215812* data[SEQ_DECL_SIZE];
};
struct TY264242 {
  TGenericSeq Sup;
  NU32 data[SEQ_DECL_SIZE];
};
struct TY184090 {
  TGenericSeq Sup;
  Tlineinfo183337 data[SEQ_DECL_SIZE];
};
struct TY264261 {
  TGenericSeq Sup;
  TY264262 data[SEQ_DECL_SIZE];
};
struct TY264222 {
  TGenericSeq Sup;
  Tblock264018 data[SEQ_DECL_SIZE];
};
struct TY215913 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct TY264202 {
  TGenericSeq Sup;
  NI data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, adddecl_270445)(Tcontext265020* c, Tsym215822* sym);
N_NIMCALL(NIM_BOOL, adduniquesym_270054)(Tscope215816* scope, Tsym215822* s);
N_NIMCALL(NIM_BOOL, strtableincl_226001)(Tstrtable215794* t, Tsym215822* n);
N_NIMCALL(void, wrongredefinition_270432)(Tlineinfo183337 info, NimStringDesc* s);
N_NIMCALL(void, localerror_188080)(Tlineinfo183337 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, addinterfacedeclaux_270461)(Tcontext265020* c, Tsym215822* sym);
N_NIMCALL(void, strtableadd_222061)(Tstrtable215794* t, Tsym215822* n);
N_NIMCALL(void, internalerror_188100)(Tlineinfo183337 info, NimStringDesc* errmsg);
static N_INLINE(NI, len_216059)(Tnode215790* n);
N_NIMCALL(NimStringDesc*, rendertree_234044)(Tnode215790* n, NU8 renderflags);
N_NIMCALL(Tident190012*, getident_190441)(NimStringDesc* identifier);
N_NIMCALL(Tident190012*, considerquotedident_270004)(Tnode215790* 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(void*, newObj)(TNimType* typ, NI size);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incref_53819)(Cell47504* c);
static N_INLINE(NIM_BOOL, canbecycleroot_51458)(Cell47504* c);
static N_INLINE(void, rtladdcycleroot_52220)(Cell47504* c);
N_NOINLINE(void, incl_48247)(Cellset47516* s, Cell47504* cell);
static N_INLINE(Cell47504*, usrtocell_51440)(void* usr);
static N_INLINE(void, decref_53401)(Cell47504* c);
static N_INLINE(void, rtladdzct_53001)(Cell47504* c);
N_NOINLINE(void, addzct_51417)(Cellseq47520* s, Cell47504* c);
N_NIMCALL(void, newstrtable_219015)(Tstrtable215794* Result);
static N_INLINE(NI, scopedepth_265193)(Tcontext265020* c);
N_NIMCALL(void, ensurenomissingorunusedsymbols_270001)(Tscope215816* scope);
N_NIMCALL(Tsym215822*, inittabiter_222073)(Ttabiter222071* ti, Tstrtable215794 tab);
N_NIMCALL(NimStringDesc*, getsymrepr_270309)(Tsym215822* s);
N_NIMCALL(NimStringDesc*, getprocheader_241324)(Tsym215822* sym, NU8 prefer);
N_NIMCALL(void, message_188095)(Tlineinfo183337 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(Tsym215822*, nextiter_222078)(Ttabiter222071* ti, Tstrtable215794 tab);
N_NIMCALL(void, rawclosescope_270065)(Tcontext265020* c);
N_NIMCALL(Tsym215822*, skipalias_270088)(Tsym215822* s, Tnode215790* n);
N_NIMCALL(void, replacedeprecated_269207)(Tlineinfo183337 info, Tsym215822* oldsym, Tsym215822* newsym);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(Tsym215822*, searchinscopes_270131)(Tcontext265020* c, Tident190012* s);
N_NIMCALL(Tsym215822*, strtableget_222066)(Tstrtable215794 t, Tident190012* name);
N_NIMCALL(Tsym215822*, errorsym_270243)(Tcontext265020* c, Tnode215790* n);
N_NIMCALL(Tsym215822*, newsym_216683)(NU8 symkind, Tident190012* name, Tsym215822* owner, Tlineinfo183337 info);
N_NIMCALL(Tsym215822*, getcurrowner_265209)(void);
N_NIMCALL(Ttype215828*, errortype_265901)(Tcontext265020* c);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(NIM_BOOL, contains_212811)(Intset212035* s, NI key);
N_NIMCALL(void, loadstub_255824)(Tsym215822* s);
N_NIMCALL(Tsym215822*, qualifiedlookup_270652)(Tcontext265020* c, Tnode215790* n, NU8 flags);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(Tsym215822*, initidentiter_222087)(Tidentiter222084* ti, Tstrtable215794 tab, Tident190012* s);
N_NIMCALL(void, initintset_212885)(Intset212035* Result);
N_NIMCALL(void, incl_212832)(Intset212035* s, NI key);
N_NIMCALL(Tsym215822*, nextidentiter_222093)(Tidentiter222084* ti, Tstrtable215794 tab);
N_NIMCALL(NI, sonslen_218351)(Tnode215790* n);
N_NIMCALL(Tsym215822*, firstidentexcluding_226500)(Tidentiter222084* ti, Tstrtable215794 tab, Tident190012* s, Intset212035* excluding);
N_NIMCALL(Tsym215822*, nextidentexcluding_226462)(Tidentiter222084* ti, Tstrtable215794 tab, Intset212035* excluding);
N_NIMCALL(void, addoverloadablesymat_270496)(Tscope215816* scope, Tsym215822* fn);
N_NIMCALL(void, adddeclat_270455)(Tscope215816* scope, Tsym215822* sym);
STRING_LITERAL(TMP1154, "addInterfaceDeclAux", 19);
STRING_LITERAL(TMP2776, "<Error>", 7);
STRING_LITERAL(TMP2777, "", 0);
STRING_LITERAL(TMP2838, "use ", 4);
STRING_LITERAL(TMP2839, " instead; ", 10);
STRING_LITERAL(TMP2840, "err:", 4);
STRING_LITERAL(TMP2841, "lookUp", 6);
STRING_LITERAL(TMP3328, "addOverloadableSymAt", 20);
extern NU8 gcmd_161123;
extern TNimType NTI215818; /* PScope */
extern Gcheap49818 gch_49859;

N_NIMCALL(NIM_BOOL, adduniquesym_270054)(Tscope215816* scope, Tsym215822* s) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = strtableincl_226001((&(*scope).symbols), s);
	result = !(LOC1);
	return result;
}

N_NIMCALL(void, wrongredefinition_270432)(Tlineinfo183337 info, NimStringDesc* s) {
	{
		if (!!((gcmd_161123 == ((NU8) 18)))) goto LA3;
		localerror_188080(info, ((NU16) 41), s);
	}
	LA3: ;
}

N_NIMCALL(void, adddecl_270445)(Tcontext265020* c, Tsym215822* sym) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = adduniquesym_270054((*c).currentscope, sym);
		if (!!(LOC3)) goto LA4;
		wrongredefinition_270432((*sym).info, (*(*sym).name).s);
	}
	LA4: ;
}

N_NIMCALL(void, addinterfacedeclaux_270461)(Tcontext265020* c, Tsym215822* sym) {
	{
		if (!(((*sym).flags &(1U<<((NU)(((NU8) 1))&31U)))!=0)) goto LA3;
		{
			if (!!(((*c).module == NIM_NIL))) goto LA7;
			strtableadd_222061((&(*(*c).module).kindU.S3.tab), sym);
		}
		goto LA5;
		LA7: ;
		{
			internalerror_188100((*sym).info, ((NimStringDesc*) &TMP1154));
		}
		LA5: ;
	}
	LA3: ;
}

N_NIMCALL(void, addinterfacedecl_270538)(Tcontext265020* c, Tsym215822* sym) {
	adddecl_270445(c, sym);
	addinterfacedeclaux_270461(c, sym);
}

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

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

N_NIMCALL(Tident190012*, considerquotedident_270004)(Tnode215790* n) {
	Tident190012* 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_216059(n);
		switch (LOC4) {
		case ((NI) 0):
		{
			NimStringDesc* LOC6;
			LOC6 = 0;
			LOC6 = rendertree_234044(n, 0);
			localerror_188080((*n).info, ((NU16) 20), LOC6);
			result = getident_190441(((NimStringDesc*) &TMP2776));
		}
		break;
		case ((NI) 1):
		{
			result = considerquotedident_270004((*n).kindU.S6.sons->data[((NI) 0)]);
		}
		break;
		default:
		{
			NimStringDesc* id;
			id = copyString(((NimStringDesc*) &TMP2777));
			{
				NI i_270032;
				NI HEX3Atmp_270042;
				NI LOC10;
				NI res_270045;
				i_270032 = 0;
				HEX3Atmp_270042 = 0;
				LOC10 = 0;
				LOC10 = len_216059(n);
				HEX3Atmp_270042 = (LOC10 - 1);
				res_270045 = ((NI) 0);
				{
					while (1) {
						Tnode215790* x;
						if (!(res_270045 <= HEX3Atmp_270042)) goto LA12;
						i_270032 = res_270045;
						x = (*n).kindU.S6.sons->data[i_270032];
						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_234044(n, 0);
							localerror_188080((*n).info, ((NU16) 20), LOC16);
							result = getident_190441(((NimStringDesc*) &TMP2776));
							goto BeforeRet;
						}
						break;
						}
						res_270045 += ((NI) 1);
					} LA12: ;
				}
			}
			result = getident_190441(id);
		}
		break;
		}
	}
	break;
	case ((NU8) 57):
	case ((NU8) 56):
	{
		result = (*(*(*n).kindU.S6.sons->data[((NI) 0)]).kindU.S4.sym).name;
	}
	break;
	default:
	{
		NimStringDesc* LOC19;
		LOC19 = 0;
		LOC19 = rendertree_234044(n, 0);
		localerror_188080((*n).info, ((NU16) 20), LOC19);
		result = getident_190441(((NimStringDesc*) &TMP2776));
	}
	break;
	}
	}BeforeRet: ;
	return result;
}

static N_INLINE(NIM_BOOL, canbecycleroot_51458)(Cell47504* c) {
	NIM_BOOL result;
	result = 0;
	result = !((((*(*c).typ).flags &(1U<<((NU)(((NU8) 1))&7U)))!=0));
	return result;
}

static N_INLINE(void, rtladdcycleroot_52220)(Cell47504* c) {
	{
		if (!!((((NI) ((NI)((*c).refcount & ((NI) 3)))) == ((NI) 3)))) goto LA3;
		(*c).refcount = (NI)((NI)((*c).refcount & ((NI) -4)) | ((NI) 3));
		incl_48247((&gch_49859.cycleroots), c);
	}
	LA3: ;
}

static N_INLINE(void, incref_53819)(Cell47504* c) {
	(*c).refcount = (NI)((NU64)((*c).refcount) + (NU64)(((NI) 8)));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = canbecycleroot_51458(c);
		if (!LOC3) goto LA4;
		rtladdcycleroot_52220(c);
	}
	LA4: ;
}

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

static N_INLINE(void, rtladdzct_53001)(Cell47504* c) {
	addzct_51417((&gch_49859.zct), c);
}

static N_INLINE(void, decref_53401)(Cell47504* c) {
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU64)((*c).refcount) < (NU64)(((NI) 8)))) goto LA3;
		rtladdzct_53001(c);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = canbecycleroot_51458(c);
		if (!LOC6) goto LA7;
		rtladdcycleroot_52220(c);
	}
	goto LA1;
	LA7: ;
	LA1: ;
}

static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		Cell47504* LOC5;
		if (!!((src == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = usrtocell_51440(src);
		incref_53819(LOC5);
	}
	LA3: ;
	{
		Cell47504* LOC10;
		if (!!(((*dest) == NIM_NIL))) goto LA8;
		LOC10 = 0;
		LOC10 = usrtocell_51440((*dest));
		decref_53401(LOC10);
	}
	LA8: ;
	(*dest) = src;
}

static N_INLINE(NI, scopedepth_265193)(Tcontext265020* c) {
	NI result;
	result = 0;
	{
		if (!!(((*c).currentscope == NIM_NIL))) goto LA3;
		result = (*(*c).currentscope).depthlevel;
	}
	goto LA1;
	LA3: ;
	{
		result = ((NI) 0);
	}
	LA1: ;
	return result;
}

N_NIMCALL(Tscope215816*, openscope_270060)(Tcontext265020* c) {
	Tscope215816* result;
	Tscope215816* LOC1;
	NI LOC2;
	result = 0;
	LOC1 = 0;
	LOC1 = (Tscope215816*) newObj((&NTI215818), sizeof(Tscope215816));
	asgnRef((void**) (&(*LOC1).parent), (*c).currentscope);
	newstrtable_219015((&(*LOC1).symbols));
	LOC2 = 0;
	LOC2 = scopedepth_265193(c);
	(*LOC1).depthlevel = (NI)(LOC2 + ((NI) 1));
	result = LOC1;
	asgnRef((void**) (&(*c).currentscope), result);
	return result;
}

N_NIMCALL(NimStringDesc*, getsymrepr_270309)(Tsym215822* s) {
	NimStringDesc* result;
	result = 0;
	switch ((*s).kind) {
	case ((NU8) 12):
	case ((NU8) 13):
	case ((NU8) 15):
	case ((NU8) 14):
	{
		result = getprocheader_241324(s, ((NU8) 0));
	}
	break;
	default:
	{
		result = copyString((*(*s).name).s);
	}
	break;
	}
	return result;
}

N_NIMCALL(void, ensurenomissingorunusedsymbols_270001)(Tscope215816* scope) {
	Ttabiter222071 it;
	Tsym215822* s;
	NI missingimpls;
	memset((void*)(&it), 0, sizeof(it));
	s = inittabiter_222073((&it), (*scope).symbols);
	missingimpls = ((NI) 0);
	{
		while (1) {
			if (!!((s == NIM_NIL))) goto LA2;
			{
				if (!(((*s).flags &(1U<<((NU)(((NU8) 4))&31U)))!=0)) goto LA5;
				{
					NimStringDesc* LOC11;
					if (!(missingimpls == ((NI) 0))) goto LA9;
					LOC11 = 0;
					LOC11 = getsymrepr_270309(s);
					localerror_188080((*s).info, ((NU16) 142), LOC11);
				}
				LA9: ;
				missingimpls += ((NI) 1);
			}
			goto LA3;
			LA5: ;
			{
				NIM_BOOL LOC13;
				LOC13 = 0;
				LOC13 = ((3 & (*s).flags) == 0);
				if (!(LOC13)) goto LA14;
				LOC13 = (((*s).options &(1U<<((NU)(((NU8) 12))&31U)))!=0);
				LA14: ;
				if (!LOC13) goto LA15;
				{
					if (!!(((1056793 &(1U<<((NU)((*s).kind)&31U)))!=0))) goto LA19;
					{
						NIM_BOOL LOC23;
						NimStringDesc* LOC27;
						LOC23 = 0;
						LOC23 = !(((*s).typ == NIM_NIL));
						if (!(LOC23)) goto LA24;
						LOC23 = !((((*(*s).typ).flags &(1U<<((NU)(((NU8) 24))&31U)))!=0));
						LA24: ;
						if (!LOC23) goto LA25;
						LOC27 = 0;
						LOC27 = getsymrepr_270309(s);
						message_188095((*s).info, ((NU16) 271), LOC27);
					}
					LA25: ;
				}
				LA19: ;
			}
			goto LA3;
			LA15: ;
			LA3: ;
			s = nextiter_222078((&it), (*scope).symbols);
		} LA2: ;
	}
}

N_NIMCALL(void, rawclosescope_270065)(Tcontext265020* c) {
	asgnRef((void**) (&(*c).currentscope), (*(*c).currentscope).parent);
}

N_NIMCALL(void, closescope_270068)(Tcontext265020* c) {
	ensurenomissingorunusedsymbols_270001((*c).currentscope);
	rawclosescope_270065(c);
}

N_NIMCALL(Tsym215822*, skipalias_270088)(Tsym215822* s, Tnode215790* n) {
	Tsym215822* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = (s == NIM_NIL);
		if (LOC3) goto LA4;
		LOC3 = !(((*s).kind == ((NU8) 24)));
		LA4: ;
		if (!LOC3) goto LA5;
		result = s;
	}
	goto LA1;
	LA5: ;
	{
		result = (*s).owner;
		{
			if (!(gcmd_161123 == ((NU8) 7))) goto LA10;
			replacedeprecated_269207((*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*) &TMP2838));
appendString(LOC13, (*(*result).name).s);
appendString(LOC13, ((NimStringDesc*) &TMP2839));
appendString(LOC13, (*(*s).name).s);
			message_188095((*n).info, ((NU16) 241), LOC13);
		}
		LA8: ;
	}
	LA1: ;
	return result;
}

N_NIMCALL(Tsym215822*, searchinscopes_270131)(Tcontext265020* c, Tident190012* s) {
	Tsym215822* result;
{	result = 0;
	{
		Tscope215816* scope_270136;
		Tscope215816* HEX3Atmp_270150;
		Tscope215816* current_270153;
		scope_270136 = 0;
		HEX3Atmp_270150 = 0;
		HEX3Atmp_270150 = (*c).currentscope;
		current_270153 = HEX3Atmp_270150;
		{
			while (1) {
				if (!!((current_270153 == NIM_NIL))) goto LA3;
				scope_270136 = current_270153;
				result = strtableget_222066((*scope_270136).symbols, s);
				{
					if (!!((result == NIM_NIL))) goto LA6;
					goto BeforeRet;
				}
				LA6: ;
				current_270153 = (*current_270153).parent;
			} LA3: ;
		}
	}
	result = NIM_NIL;
	}BeforeRet: ;
	return result;
}

static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) {
	{
		Cell47504* c;
		if (!!((src == NIM_NIL))) goto LA3;
		c = usrtocell_51440(src);
		(*c).refcount += ((NI) 8);
	}
	LA3: ;
	{
		Cell47504* c;
		if (!!(((*dest) == NIM_NIL))) goto LA7;
		c = usrtocell_51440((*dest));
		{
			(*c).refcount -= ((NI) 8);
			if (!((NU64)((*c).refcount) < (NU64)(((NI) 8)))) goto LA11;
			rtladdzct_53001(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

N_NIMCALL(Tsym215822*, errorsym_270243)(Tcontext265020* c, Tnode215790* n) {
	Tsym215822* result;
	Tnode215790* m;
	Tident190012* ident;
	Tsym215822* LOC12;
	result = 0;
	m = n;
	{
		if (!((*m).kind == ((NU8) 45))) goto LA3;
		m = (*m).kindU.S6.sons->data[((NI) 1)];
	}
	LA3: ;
	{
		if (!((*m).kind == ((NU8) 2) || (*m).kind == ((NU8) 3) || (*m).kind == ((NU8) 53))) goto LA7;
		ident = considerquotedident_270004(m);
	}
	goto LA5;
	LA7: ;
	{
		NimStringDesc* LOC10;
		NimStringDesc* LOC11;
		LOC10 = 0;
		LOC11 = 0;
		LOC11 = rendertree_234044(m, 0);
		LOC10 = rawNewString(LOC11->Sup.len + 4);
appendString(LOC10, ((NimStringDesc*) &TMP2840));
appendString(LOC10, LOC11);
		ident = getident_190441(LOC10);
	}
	LA5: ;
	LOC12 = 0;
	LOC12 = getcurrowner_265209();
	result = newsym_216683(((NU8) 0), ident, LOC12, (*n).info);
	asgnRefNoCycle((void**) (&(*result).typ), errortype_265901(c));
	(*result).flags |= ((NU32)1)<<((((NU8) 29))%(sizeof(NU32)*8));
	{
		NIM_BOOL LOC15;
		LOC15 = 0;
		LOC15 = !((gcmd_161123 == ((NU8) 18)));
		if (!(LOC15)) goto LA16;
		LOC15 = ((*c).compilescontextid == ((NI) 0));
		LA16: ;
		if (!LOC15) goto LA17;
		strtableadd_222061((&(*(*c).importtable).symbols), result);
	}
	LA17: ;
	return result;
}

N_NIMCALL(Tsym215822*, lookup_270601)(Tcontext265020* c, Tnode215790* n) {
	Tsym215822* result;
{	result = 0;
	switch ((*n).kind) {
	case ((NU8) 2):
	{
		Tsym215822* LOC2;
		LOC2 = 0;
		LOC2 = searchinscopes_270131(c, (*n).kindU.S5.ident);
		result = skipalias_270088(LOC2, n);
		{
			if (!(result == NIM_NIL)) goto LA5;
			localerror_188080((*n).info, ((NU16) 63), (*(*n).kindU.S5.ident).s);
			result = errorsym_270243(c, n);
		}
		LA5: ;
	}
	break;
	case ((NU8) 3):
	{
		result = (*n).kindU.S4.sym;
	}
	break;
	case ((NU8) 53):
	{
		Tident190012* ident;
		Tsym215822* LOC9;
		ident = considerquotedident_270004(n);
		LOC9 = 0;
		LOC9 = searchinscopes_270131(c, ident);
		result = skipalias_270088(LOC9, n);
		{
			if (!(result == NIM_NIL)) goto LA12;
			localerror_188080((*n).info, ((NU16) 63), (*ident).s);
			result = errorsym_270243(c, n);
		}
		LA12: ;
	}
	break;
	default:
	{
		internalerror_188100((*n).info, ((NimStringDesc*) &TMP2841));
		goto BeforeRet;
	}
	break;
	}
	{
		NIM_BOOL LOC17;
		LOC17 = 0;
		LOC17 = contains_212811((&(*c).ambiguoussymbols), (*result).Sup.id);
		if (!LOC17) goto LA18;
		localerror_188080((*n).info, ((NU16) 66), (*(*result).name).s);
	}
	LA18: ;
	{
		if (!((*result).kind == ((NU8) 22))) goto LA22;
		loadstub_255824(result);
	}
	LA22: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tsym215822*, qualifiedlookup_270652)(Tcontext265020* c, Tnode215790* n, NU8 flags) {
	Tsym215822* result;
	result = 0;
	switch ((*n).kind) {
	case ((NU8) 2):
	case ((NU8) 53):
	{
		Tident190012* ident;
		Tsym215822* LOC2;
		ident = considerquotedident_270004(n);
		LOC2 = 0;
		LOC2 = searchinscopes_270131(c, ident);
		result = skipalias_270088(LOC2, n);
		{
			NIM_BOOL LOC5;
			LOC5 = 0;
			LOC5 = (result == NIM_NIL);
			if (!(LOC5)) goto LA6;
			LOC5 = ((flags &(1U<<((NU)(((NU8) 1))&7U)))!=0);
			LA6: ;
			if (!LOC5) goto LA7;
			localerror_188080((*n).info, ((NU16) 63), (*ident).s);
			result = errorsym_270243(c, n);
		}
		goto LA3;
		LA7: ;
		{
			NIM_BOOL LOC10;
			NIM_BOOL LOC11;
			LOC10 = 0;
			LOC11 = 0;
			LOC11 = ((flags &(1U<<((NU)(((NU8) 0))&7U)))!=0);
			if (!(LOC11)) goto LA12;
			LOC11 = !((result == NIM_NIL));
			LA12: ;
			LOC10 = LOC11;
			if (!(LOC10)) goto LA13;
			LOC10 = contains_212811((&(*c).ambiguoussymbols), (*result).Sup.id);
			LA13: ;
			if (!LOC10) goto LA14;
			localerror_188080((*n).info, ((NU16) 66), (*ident).s);
		}
		goto LA3;
		LA14: ;
		LA3: ;
	}
	break;
	case ((NU8) 3):
	{
		result = (*n).kindU.S4.sym;
		{
			NIM_BOOL LOC19;
			LOC19 = 0;
			LOC19 = ((flags &(1U<<((NU)(((NU8) 0))&7U)))!=0);
			if (!(LOC19)) goto LA20;
			LOC19 = contains_212811((&(*c).ambiguoussymbols), (*result).Sup.id);
			LA20: ;
			if (!LOC19) goto LA21;
			localerror_188080((*n).info, ((NU16) 66), (*(*(*n).kindU.S4.sym).name).s);
		}
		LA21: ;
	}
	break;
	case ((NU8) 45):
	{
		Tsym215822* m;
		result = NIM_NIL;
		m = qualifiedlookup_270652(c, (*n).kindU.S6.sons->data[((NI) 0)], (flags & 2));
		{
			NIM_BOOL LOC26;
			Tident190012* 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[((NI) 1)]).kind == ((NU8) 2))) goto LA32;
				ident = (*(*n).kindU.S6.sons->data[((NI) 1)]).kindU.S5.ident;
			}
			goto LA30;
			LA32: ;
			{
				if (!((*(*n).kindU.S6.sons->data[((NI) 1)]).kind == ((NU8) 53))) goto LA35;
				ident = considerquotedident_270004((*n).kindU.S6.sons->data[((NI) 1)]);
			}
			goto LA30;
			LA35: ;
			LA30: ;
			{
				if (!!((ident == NIM_NIL))) goto LA39;
				{
					Tsym215822* LOC45;
					if (!(m == (*c).module)) goto LA43;
					LOC45 = 0;
					LOC45 = strtableget_222066((*(*c).toplevelscope).symbols, ident);
					result = skipalias_270088(LOC45, n);
				}
				goto LA41;
				LA43: ;
				{
					Tsym215822* LOC47;
					LOC47 = 0;
					LOC47 = strtableget_222066((*m).kindU.S3.tab, ident);
					result = skipalias_270088(LOC47, n);
				}
				LA41: ;
				{
					NIM_BOOL LOC50;
					LOC50 = 0;
					LOC50 = (result == NIM_NIL);
					if (!(LOC50)) goto LA51;
					LOC50 = ((flags &(1U<<((NU)(((NU8) 1))&7U)))!=0);
					LA51: ;
					if (!LOC50) goto LA52;
					localerror_188080((*(*n).kindU.S6.sons->data[((NI) 1)]).info, ((NU16) 63), (*ident).s);
					result = errorsym_270243(c, (*n).kindU.S6.sons->data[((NI) 1)]);
				}
				LA52: ;
			}
			goto LA37;
			LA39: ;
			{
				if (!((*(*n).kindU.S6.sons->data[((NI) 1)]).kind == ((NU8) 3))) goto LA55;
				result = (*(*n).kindU.S6.sons->data[((NI) 1)]).kindU.S4.sym;
			}
			goto LA37;
			LA55: ;
			{
				NIM_BOOL LOC58;
				NimStringDesc* LOC62;
				LOC58 = 0;
				LOC58 = ((flags &(1U<<((NU)(((NU8) 1))&7U)))!=0);
				if (!(LOC58)) goto LA59;
				LOC58 = !(((*(*n).kindU.S6.sons->data[((NI) 1)]).kind == ((NU8) 57) || (*(*n).kindU.S6.sons->data[((NI) 1)]).kind == ((NU8) 56)));
				LA59: ;
				if (!LOC58) goto LA60;
				LOC62 = 0;
				LOC62 = rendertree_234044((*n).kindU.S6.sons->data[((NI) 1)], 0);
				localerror_188080((*(*n).kindU.S6.sons->data[((NI) 1)]).info, ((NU16) 20), LOC62);
				result = errorsym_270243(c, (*n).kindU.S6.sons->data[((NI) 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) 22));
		LA67: ;
		if (!LOC66) goto LA68;
		loadstub_255824(result);
	}
	LA68: ;
	return result;
}

N_NIMCALL(Tsym215822*, initoverloaditer_270890)(Toverloaditer270296* o, Tcontext265020* c, Tnode215790* n) {
	Tsym215822* result;
	result = 0;
	switch ((*n).kind) {
	case ((NU8) 2):
	case ((NU8) 53):
	{
		Tident190012* ident;
		ident = considerquotedident_270004(n);
		unsureAsgnRef((void**) (&(*o).scope), (*c).currentscope);
		(*o).mode = ((NU8) 1);
		{
			while (1) {
				Tsym215822* LOC4;
				LOC4 = 0;
				LOC4 = initidentiter_222087((&(*o).it), (*(*o).scope).symbols, ident);
				result = skipalias_270088(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_270652(c, (*n).kindU.S6.sons->data[((NI) 0)], 2));
		{
			NIM_BOOL LOC18;
			Tident190012* 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[((NI) 1)]).kind == ((NU8) 2))) goto LA24;
				ident = (*(*n).kindU.S6.sons->data[((NI) 1)]).kindU.S5.ident;
			}
			goto LA22;
			LA24: ;
			{
				if (!((*(*n).kindU.S6.sons->data[((NI) 1)]).kind == ((NU8) 53))) goto LA27;
				ident = considerquotedident_270004((*n).kindU.S6.sons->data[((NI) 1)]);
			}
			goto LA22;
			LA27: ;
			LA22: ;
			{
				if (!!((ident == NIM_NIL))) goto LA31;
				{
					Tsym215822* LOC37;
					if (!((*o).m == (*c).module)) goto LA35;
					LOC37 = 0;
					LOC37 = initidentiter_222087((&(*o).it), (*(*c).toplevelscope).symbols, ident);
					result = skipalias_270088(LOC37, n);
					(*o).mode = ((NU8) 2);
				}
				goto LA33;
				LA35: ;
				{
					Tsym215822* LOC39;
					LOC39 = 0;
					LOC39 = initidentiter_222087((&(*o).it), (*(*o).m).kindU.S3.tab, ident);
					result = skipalias_270088(LOC39, n);
				}
				LA33: ;
			}
			goto LA29;
			LA31: ;
			{
				NimStringDesc* LOC41;
				LOC41 = 0;
				LOC41 = rendertree_234044((*n).kindU.S6.sons->data[((NI) 1)], 0);
				localerror_188080((*(*n).kindU.S6.sons->data[((NI) 1)]).info, ((NU16) 20), LOC41);
				result = errorsym_270243(c, (*n).kindU.S6.sons->data[((NI) 1)]);
			}
			LA29: ;
		}
		LA20: ;
	}
	break;
	case ((NU8) 56):
	case ((NU8) 57):
	{
		(*o).mode = ((NU8) 4);
		result = (*(*n).kindU.S6.sons->data[((NI) 0)]).kindU.S4.sym;
		(*o).symchoiceindex = ((NI) 1);
		initintset_212885((&(*o).insymchoice));
		incl_212832((&(*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) 22));
		LA47: ;
		if (!LOC46) goto LA48;
		loadstub_255824(result);
	}
	LA48: ;
	return result;
}

N_NIMCALL(Tsym215822*, nextoverloaditer_271041)(Toverloaditer270296* o, Tcontext265020* c, Tnode215790* n) {
	Tsym215822* result;
	result = 0;
	switch ((*o).mode) {
	case ((NU8) 0):
	{
		result = NIM_NIL;
	}
	break;
	case ((NU8) 1):
	{
		{
			Tsym215822* LOC7;
			if (!!(((*o).scope == NIM_NIL))) goto LA5;
			LOC7 = 0;
			LOC7 = nextidentiter_222093((&(*o).it), (*(*o).scope).symbols);
			result = skipalias_270088(LOC7, n);
			{
				while (1) {
					Tsym215822* 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_222087((&(*o).it), (*(*o).scope).symbols, (*o).it.name);
					result = skipalias_270088(LOC14, n);
				} LA9: ;
			} LA8: ;
		}
		goto LA3;
		LA5: ;
		{
			result = NIM_NIL;
		}
		LA3: ;
	}
	break;
	case ((NU8) 2):
	{
		Tsym215822* LOC17;
		LOC17 = 0;
		LOC17 = nextidentiter_222093((&(*o).it), (*(*c).toplevelscope).symbols);
		result = skipalias_270088(LOC17, n);
	}
	break;
	case ((NU8) 3):
	{
		Tsym215822* LOC19;
		LOC19 = 0;
		LOC19 = nextidentiter_222093((&(*o).it), (*(*o).m).kindU.S3.tab);
		result = skipalias_270088(LOC19, n);
	}
	break;
	case ((NU8) 4):
	{
		{
			NI LOC23;
			LOC23 = 0;
			LOC23 = sonslen_218351(n);
			if (!((*o).symchoiceindex < LOC23)) goto LA24;
			result = (*(*n).kindU.S6.sons->data[(*o).symchoiceindex]).kindU.S4.sym;
			incl_212832((&(*o).insymchoice), (*result).Sup.id);
			(*o).symchoiceindex += ((NI) 1);
		}
		goto LA21;
		LA24: ;
		{
			Tsym215822* LOC29;
			if (!((*n).kind == ((NU8) 57))) goto LA27;
			(*o).mode = ((NU8) 5);
			unsureAsgnRef((void**) (&(*o).scope), (*c).currentscope);
			LOC29 = 0;
			LOC29 = firstidentexcluding_226500((&(*o).it), (*(*o).scope).symbols, (*(*(*n).kindU.S6.sons->data[((NI) 0)]).kindU.S4.sym).name, (&(*o).insymchoice));
			result = skipalias_270088(LOC29, n);
			{
				while (1) {
					Tsym215822* 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_226500((&(*o).it), (*(*o).scope).symbols, (*(*(*n).kindU.S6.sons->data[((NI) 0)]).kindU.S4.sym).name, (&(*o).insymchoice));
					result = skipalias_270088(LOC36, n);
				} LA31: ;
			} LA30: ;
		}
		goto LA21;
		LA27: ;
		LA21: ;
	}
	break;
	case ((NU8) 5):
	{
		Tsym215822* LOC38;
		LOC38 = 0;
		LOC38 = nextidentexcluding_226462((&(*o).it), (*(*o).scope).symbols, (&(*o).insymchoice));
		result = skipalias_270088(LOC38, n);
		{
			while (1) {
				Tsym215822* 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_226500((&(*o).it), (*(*o).scope).symbols, (*(*(*n).kindU.S6.sons->data[((NI) 0)]).kindU.S4.sym).name, (&(*o).insymchoice));
				result = skipalias_270088(LOC45, n);
			} LA40: ;
		} LA39: ;
	}
	break;
	}
	{
		NIM_BOOL LOC48;
		LOC48 = 0;
		LOC48 = !((result == NIM_NIL));
		if (!(LOC48)) goto LA49;
		LOC48 = ((*result).kind == ((NU8) 22));
		LA49: ;
		if (!LOC48) goto LA50;
		loadstub_255824(result);
	}
	LA50: ;
	return result;
}

N_NIMCALL(void, addprelimdecl_270451)(Tcontext265020* c, Tsym215822* sym) {
	NIM_BOOL LOC1;
	LOC1 = 0;
	LOC1 = adduniquesym_270054((*c).currentscope, sym);
}

N_NIMCALL(NI, lastoverloadscope_271029)(Toverloaditer270296* o) {
	NI result;
	result = 0;
	switch ((*o).mode) {
	case ((NU8) 1):
	{
		{
			if (!(*o).scope == 0) goto LA4;
			result = ((NI) -1);
		}
		goto LA2;
		LA4: ;
		{
			result = (*(*o).scope).depthlevel;
		}
		LA2: ;
	}
	break;
	case ((NU8) 2):
	{
		result = ((NI) 1);
	}
	break;
	case ((NU8) 3):
	{
		result = ((NI) 0);
	}
	break;
	default:
	{
		result = ((NI) -1);
	}
	break;
	}
	return result;
}

N_NIMCALL(Tsym215822*, searchinscopes_270209)(Tcontext265020* c, Tident190012* s, NU32 filter) {
	Tsym215822* result;
{	result = 0;
	{
		Tscope215816* scope_270215;
		Tscope215816* HEX3Atmp_270239;
		Tscope215816* current_270242;
		scope_270215 = 0;
		HEX3Atmp_270239 = 0;
		HEX3Atmp_270239 = (*c).currentscope;
		current_270242 = HEX3Atmp_270239;
		{
			while (1) {
				if (!!((current_270242 == NIM_NIL))) goto LA3;
				scope_270215 = current_270242;
				result = strtableget_222066((*scope_270215).symbols, s);
				{
					NIM_BOOL LOC6;
					LOC6 = 0;
					LOC6 = !((result == NIM_NIL));
					if (!(LOC6)) goto LA7;
					LOC6 = ((filter &(1U<<((NU)((*result).kind)&31U)))!=0);
					LA7: ;
					if (!LOC6) goto LA8;
					goto BeforeRet;
				}
				LA8: ;
				current_270242 = (*current_270242).parent;
			} LA3: ;
		}
	}
	result = NIM_NIL;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, addoverloadablesymat_270496)(Tscope215816* scope, Tsym215822* fn) {
	Tsym215822* check;
{	{
		if (!!(((258112 &(1U<<((NU)((*fn).kind)&31U)))!=0))) goto LA3;
		internalerror_188100((*fn).info, ((NimStringDesc*) &TMP3328));
		goto BeforeRet;
	}
	LA3: ;
	check = strtableget_222066((*scope).symbols, (*fn).name);
	{
		NIM_BOOL LOC7;
		LOC7 = 0;
		LOC7 = !((check == NIM_NIL));
		if (!(LOC7)) goto LA8;
		LOC7 = !(((258112 &(1U<<((NU)((*check).kind)&31U)))!=0));
		LA8: ;
		if (!LOC7) goto LA9;
		wrongredefinition_270432((*fn).info, (*(*fn).name).s);
	}
	goto LA5;
	LA9: ;
	{
		strtableadd_222061((&(*scope).symbols), fn);
	}
	LA5: ;
	}BeforeRet: ;
}

N_NIMCALL(void, addinterfaceoverloadablesymat_270542)(Tcontext265020* c, Tscope215816* scope, Tsym215822* sym) {
	addoverloadablesymat_270496(scope, sym);
	addinterfacedeclaux_270461(c, sym);
}

N_NIMCALL(void, adddeclat_270455)(Tscope215816* scope, Tsym215822* sym) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = adduniquesym_270054(scope, sym);
		if (!!(LOC3)) goto LA4;
		wrongredefinition_270432((*sym).info, (*(*sym).name).s);
	}
	LA4: ;
}

N_NIMCALL(void, addinterfacedeclat_270491)(Tcontext265020* c, Tscope215816* scope, Tsym215822* sym) {
	adddeclat_270455(scope, sym);
	addinterfacedeclaux_270461(c, sym);
}

N_NIMCALL(Tsym215822*, localsearchinscope_270126)(Tcontext265020* c, Tident190012* s) {
	Tsym215822* result;
	result = 0;
	result = strtableget_222066((*(*c).currentscope).symbols, s);
	return result;
}
NIM_EXTERNC N_NOINLINE(void, compiler_lookupsInit000)(void) {
}

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

