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

#include "nimbase.h"
#include <string.h>
typedef struct Tident198021 Tident198021;
typedef struct Tnode225809 Tnode225809;
typedef struct Ttype225847 Ttype225847;
typedef struct Tlineinfo190352 Tlineinfo190352;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tsym225841 Tsym225841;
typedef struct Tnodeseq225803 Tnodeseq225803;
typedef struct Tidobj198015 Tidobj198015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttypeseq225843 Ttypeseq225843;
typedef struct Tscope225835 Tscope225835;
typedef struct TY225944 TY225944;
typedef struct Tstrtable225813 Tstrtable225813;
typedef struct Tsymseq225811 Tsymseq225811;
typedef struct Tloc225823 Tloc225823;
typedef struct Ropeobj176009 Ropeobj176009;
typedef struct Tlib225827 Tlib225827;
typedef struct Tcontext280023 Tcontext280023;
typedef struct Tpasscontext277005 Tpasscontext277005;
typedef struct Tproccon280011 Tproccon280011;
typedef struct Intset222056 Intset222056;
typedef struct Trunk222052 Trunk222052;
typedef struct Trunkseq222054 Trunkseq222054;
typedef struct Tlinkedlist141028 Tlinkedlist141028;
typedef struct Tlistentry141022 Tlistentry141022;
typedef struct Tidtable225859 Tidtable225859;
typedef struct Tidpairseq225857 Tidpairseq225857;
typedef struct Tctx279048 Tctx279048;
typedef struct TY280143 TY280143;
typedef struct Cell49147 Cell49147;
typedef struct Cellset49159 Cellset49159;
typedef struct Gcheap51218 Gcheap51218;
typedef struct Gcstack51216 Gcstack51216;
typedef struct Cellseq49163 Cellseq49163;
typedef struct Pagedesc49155 Pagedesc49155;
typedef struct Memregion31090 Memregion31090;
typedef struct Smallchunk31042 Smallchunk31042;
typedef struct Llchunk31084 Llchunk31084;
typedef struct Bigchunk31044 Bigchunk31044;
typedef struct Intset31017 Intset31017;
typedef struct Trunk31013 Trunk31013;
typedef struct Avlnode31088 Avlnode31088;
typedef struct Gcstat51214 Gcstat51214;
typedef struct Ttabiter233119 Ttabiter233119;
typedef struct Toverloaditer286431 Toverloaditer286431;
typedef struct Tidentiter233141 Tidentiter233141;
typedef struct Tinstantiation225831 Tinstantiation225831;
typedef struct Tidpair225855 Tidpair225855;
typedef struct TY279254 TY279254;
typedef struct TY191420 TY191420;
typedef struct PprocHEX3Aobjecttype279233 PprocHEX3Aobjecttype279233;
typedef struct TY279273 TY279273;
typedef struct Tinstantiationpair280013 Tinstantiationpair280013;
typedef struct Basechunk31040 Basechunk31040;
typedef struct Freecell31032 Freecell31032;
typedef struct TY225932 TY225932;
typedef struct TY279234 TY279234;
typedef struct TY279239 TY279239;
typedef struct TY279274 TY279274;
typedef struct Vmargs279042 Vmargs279042;
typedef struct Tblock279030 Tblock279030;
typedef struct TY279214 TY279214;
struct  Tlineinfo190352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tnode225809  {
Ttype225847* typ;
Tlineinfo190352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym225841* sym;
} S4;
struct {Tident198021* ident;
} S5;
struct {Tnodeseq225803* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
typedef N_NIMCALL_PTR(void, TY3889) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3894) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3889 marker;
TY3894 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Tidobj198015  {
  TNimObject Sup;
NI id;
};
struct  Tstrtable225813  {
NI counter;
Tsymseq225811* data;
};
struct  Tloc225823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype225847* t;
Ropeobj176009* r;
Ropeobj176009* heaproot;
};
struct  Tsym225841  {
  Tidobj198015 Sup;
NU8 kind;
union{
struct {Ttypeseq225843* typeinstcache;
Tscope225835* typscope;
} S1;
struct {TY225944* procinstcache;
Tsym225841* gcunsafetyreason;
} S2;
struct {TY225944* usedgenerics;
Tstrtable225813 tab;
} S3;
struct {Tsym225841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype225847* typ;
Tident198021* name;
Tlineinfo190352 info;
Tsym225841* owner;
NU32 flags;
Tnode225809* ast;
NU32 options;
NI position;
NI offset;
Tloc225823 loc;
Tlib225827* annex;
Tnode225809* constraint;
};
struct  Tident198021  {
  Tidobj198015 Sup;
NimStringDesc* s;
Tident198021* next;
NI h;
};
struct  Tscope225835  {
NI depthlevel;
Tstrtable225813 symbols;
Tnodeseq225803* usingsyms;
Tscope225835* parent;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Tpasscontext277005  {
  TNimObject Sup;
NIM_BOOL fromcache;
};
struct  Intset222056  {
NI counter;
NI max;
Trunk222052* head;
Trunkseq222054* data;
};
struct  Tlinkedlist141028  {
Tlistentry141022* head;
Tlistentry141022* tail;
NI counter;
};
struct  Tidtable225859  {
NI counter;
Tidpairseq225857* data;
};
typedef N_NIMCALL_PTR(Tnode225809*, TY280074) (Tcontext280023* c, Tnode225809* n);
typedef N_NIMCALL_PTR(Tnode225809*, TY280079) (Tcontext280023* c, Tnode225809* n, NU16 flags);
typedef N_NIMCALL_PTR(Tnode225809*, TY280087) (Tcontext280023* c, Tnode225809* n, NU16 flags);
typedef N_NIMCALL_PTR(Tnode225809*, TY280095) (Tcontext280023* c, Tnode225809* n);
typedef N_NIMCALL_PTR(Tnode225809*, TY280100) (Tcontext280023* c, Tnode225809* n, NU16 flags);
typedef N_NIMCALL_PTR(Tnode225809*, TY280108) (Tcontext280023* c, Tnode225809* n);
typedef N_NIMCALL_PTR(Tnode225809*, TY280113) (Tcontext280023* c, Tnode225809* n, Tnode225809* norig, NU32 filter);
typedef N_NIMCALL_PTR(Ttype225847*, TY280120) (Tcontext280023* c, Tnode225809* n, Ttype225847* prev);
typedef struct {
N_NIMCALL_PTR(Tnode225809*, ClPrc) (Tcontext280023* c, Tidtable225859 pt, Tnode225809* n, void* ClEnv);
void* ClEnv;
} TY280126;
typedef struct {
N_NIMCALL_PTR(Tsym225841*, ClPrc) (Tcontext280023* c, Tsym225841* fn, Tidtable225859 pt, Tlineinfo190352 info, void* ClEnv);
void* ClEnv;
} TY280132;
typedef N_NIMCALL_PTR(Tsym225841*, TY280148) (Tcontext280023* c, Tsym225841* dc, Ttype225847* t, Tlineinfo190352 info, NU8 op);
struct  Tcontext280023  {
  Tpasscontext277005 Sup;
Tsym225841* module;
Tscope225835* currentscope;
Tscope225835* importtable;
Tscope225835* toplevelscope;
Tproccon280011* p;
Tsymseq225811* friendmodules;
NI instcounter;
Intset222056 ambiguoussymbols;
NI intypeclass;
NI ingenericcontext;
NI inunrolledcontext;
NI compilescontextid;
NI compilescontextidgenerator;
NI ingenericinst;
Tsymseq225811* converters;
Tsymseq225811* patterns;
Tlinkedlist141028 optionstack;
Tidtable225859 symmapping;
Tlinkedlist141028 libs;
TY280074 semconstexpr;
TY280079 semexpr;
TY280087 semtryexpr;
TY280095 semtryconstexpr;
TY280100 semoperand;
TY280108 semconstboolexpr;
TY280113 semoverloadedcall;
TY280120 semtypenode;
TY280126 seminferredlambda;
TY280132 semgenerateinstance;
Intset222056 includedfiles;
Tstrtable225813 userpragmas;
Tctx279048* evalcontext;
Intset222056 unknownidents;
TY280143* generics;
NI lastgenericidx;
NI hloloopdetector;
NI inparallelstmt;
TY280148 insttypeboundop;
};
struct  Cell49147  {
NI refcount;
TNimType* typ;
};
struct  Cellseq49163  {
NI len;
NI cap;
Cell49147** d;
};
struct  Cellset49159  {
NI counter;
NI max;
Pagedesc49155* head;
Pagedesc49155** data;
};
typedef Smallchunk31042* TY31105[512];
typedef Trunk31013* Trunkbuckets31015[256];
struct  Intset31017  {
Trunkbuckets31015 data;
};
struct  Memregion31090  {
NI minlargeobj;
NI maxlargeobj;
TY31105 freesmallchunks;
Llchunk31084* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk31044* freechunkslist;
Intset31017 chunkstarts;
Avlnode31088* root;
Avlnode31088* deleted;
Avlnode31088* last;
Avlnode31088* freeavlnodes;
};
struct  Gcstat51214  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap51218  {
Gcstack51216* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq49163 zct;
Cellseq49163 decstack;
Cellset49159 cycleroots;
Cellseq49163 tempstack;
NI recgclock;
Memregion31090 region;
Gcstat51214 stat;
};
struct  Ttabiter233119  {
NI h;
};
struct  Ttype225847  {
  Tidobj198015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq225843* sons;
Tnode225809* n;
Tsym225841* owner;
Tsym225841* sym;
Tsym225841* destructor;
Tsym225841* deepcopy;
Tsym225841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc225823 loc;
};
struct  Tidentiter233141  {
NI h;
Tident198021* name;
};
struct  Toverloaditer286431  {
Tidentiter233141 it;
Tsym225841* m;
NU8 mode;
NI symchoiceindex;
Tscope225835* scope;
Intset222056 insymchoice;
};
struct  Ropeobj176009  {
  TNimObject Sup;
Ropeobj176009* left;
Ropeobj176009* right;
NI length;
NimStringDesc* data;
};
struct  Tlistentry141022  {
  TNimObject Sup;
Tlistentry141022* prev;
Tlistentry141022* next;
};
struct  Tlib225827  {
  Tlistentry141022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj176009* name;
Tnode225809* path;
};
struct  Tproccon280011  {
Tsym225841* owner;
Tsym225841* resultsym;
NI nestedloopcounter;
NI nestedblockcounter;
NI intrystmt;
Tproccon280011* next;
NIM_BOOL wasforwarded;
Tnode225809* bracketexpr;
};
typedef NI TY31021[16];
struct  Trunk222052  {
Trunk222052* next;
NI key;
TY31021 bits;
};
struct  Tidpair225855  {
Tidobj198015* key;
TNimObject* val;
};
struct  Tctx279048  {
  Tpasscontext277005 Sup;
TY279254* code;
TY191420* debug;
Tnode225809* globals;
Tnode225809* constants;
Ttypeseq225843* types;
Tnode225809* currentexceptiona;
Tnode225809* currentexceptionb;
NI exceptioninstr;
PprocHEX3Aobjecttype279233* prc;
Tsym225841* module;
Tnode225809* callsite;
NU8 mode;
NU8 features;
NIM_BOOL traceactive;
NI loopiterations;
Tlineinfo190352 comesfromheuristic;
TY279273* callbacks;
NimStringDesc* errorflag;
};
struct  Tinstantiationpair280013  {
Tsym225841* genericsym;
Tinstantiation225831* inst;
};
struct  Gcstack51216  {
Gcstack51216* prev;
Gcstack51216* next;
void* starts;
void* pos;
NI maxstacksize;
};
struct  Pagedesc49155  {
Pagedesc49155* next;
NI key;
TY31021 bits;
};
struct  Basechunk31040  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk31042  {
  Basechunk31040 Sup;
Smallchunk31042* next;
Smallchunk31042* prev;
Freecell31032* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk31084  {
NI size;
NI acc;
Llchunk31084* next;
};
struct  Bigchunk31044  {
  Basechunk31040 Sup;
Bigchunk31044* next;
Bigchunk31044* prev;
NI align;
NF data;
};
struct  Trunk31013  {
Trunk31013* next;
NI key;
TY31021 bits;
};
typedef Avlnode31088* TY31095[2];
struct  Avlnode31088  {
TY31095 link;
NI key;
NI upperbound;
NI level;
};
struct  Tinstantiation225831  {
Tsym225841* sym;
Ttypeseq225843* concretetypes;
TY225932* usedby;
NI compilesid;
};
struct TY279239 {
NIM_BOOL Field0;
NU8 Field1;
};
typedef TY279239 TY279242[256];
struct  PprocHEX3Aobjecttype279233  {
TY279234* blocks;
Tsym225841* sym;
TY279242 slots;
NI maxslots;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (Vmargs279042* args, void* ClEnv);
void* ClEnv;
} Vmcallback279044;
struct TY279274 {
NimStringDesc* Field0;
Vmcallback279044 Field1;
};
struct  Freecell31032  {
Freecell31032* next;
NI zerofield;
};
struct  Tblock279030  {
Tsym225841* label;
TY279214* fixups;
};
struct  Vmargs279042  {
NI ra;
NI rb;
NI rc;
void* slots;
Tnode225809* currentexception;
};
struct Tnodeseq225803 {
  TGenericSeq Sup;
  Tnode225809* data[SEQ_DECL_SIZE];
};
struct Ttypeseq225843 {
  TGenericSeq Sup;
  Ttype225847* data[SEQ_DECL_SIZE];
};
struct TY225944 {
  TGenericSeq Sup;
  Tinstantiation225831* data[SEQ_DECL_SIZE];
};
struct Tsymseq225811 {
  TGenericSeq Sup;
  Tsym225841* data[SEQ_DECL_SIZE];
};
struct Trunkseq222054 {
  TGenericSeq Sup;
  Trunk222052* data[SEQ_DECL_SIZE];
};
struct Tidpairseq225857 {
  TGenericSeq Sup;
  Tidpair225855 data[SEQ_DECL_SIZE];
};
struct TY280143 {
  TGenericSeq Sup;
  Tinstantiationpair280013 data[SEQ_DECL_SIZE];
};
struct TY279254 {
  TGenericSeq Sup;
  NU32 data[SEQ_DECL_SIZE];
};
struct TY191420 {
  TGenericSeq Sup;
  Tlineinfo190352 data[SEQ_DECL_SIZE];
};
struct TY279273 {
  TGenericSeq Sup;
  TY279274 data[SEQ_DECL_SIZE];
};
struct TY225932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct TY279234 {
  TGenericSeq Sup;
  Tblock279030 data[SEQ_DECL_SIZE];
};
struct TY279214 {
  TGenericSeq Sup;
  NI data[SEQ_DECL_SIZE];
};
static N_INLINE(NI, len_226098)(Tnode225809* n);
N_NIMCALL(void, localerror_196128)(Tlineinfo190352 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, rendertree_247059)(Tnode225809* n, NU8 renderflags);
N_NIMCALL(Tident198021*, getident_198463)(NimStringDesc* identifier);
N_NIMCALL(Tident198021*, considerquotedident_286010)(Tnode225809* 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_55222)(Cell49147* c);
static N_INLINE(NIM_BOOL, canbecycleroot_52867)(Cell49147* c);
static N_INLINE(void, rtladdcycleroot_53623)(Cell49147* c);
N_NOINLINE(void, incl_49865)(Cellset49159* s, Cell49147* cell);
static N_INLINE(Cell49147*, usrtocell_52846)(void* usr);
static N_INLINE(void, decref_54804)(Cell49147* c);
static N_INLINE(void, rtladdzct_54404)(Cell49147* c);
N_NOINLINE(void, addzct_52817)(Cellseq49163* s, Cell49147* c);
N_NIMCALL(void, newstrtable_229027)(Tstrtable225813* Result);
static N_INLINE(NI, scopedepth_280236)(Tcontext280023* c);
N_NIMCALL(NIM_BOOL, adduniquesym_286079)(Tscope225835* scope, Tsym225841* s);
N_NIMCALL(NIM_BOOL, strtableincl_237607)(Tstrtable225813* t, Tsym225841* n);
N_NIMCALL(void, wrongredefinition_286588)(Tlineinfo190352 info, NimStringDesc* s);
N_NIMCALL(void, ensurenomissingorunusedsymbols_286004)(Tscope225835* scope);
N_NIMCALL(Tsym225841*, inittabiter_233124)(Ttabiter233119* ti, Tstrtable225813 tab);
N_NIMCALL(NimStringDesc*, getsymrepr_286447)(Tsym225841* s);
N_NIMCALL(NimStringDesc*, getprocheader_255447)(Tsym225841* sym, NU8 prefer);
N_NIMCALL(void, message_196161)(Tlineinfo190352 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(Tsym225841*, nextiter_233132)(Ttabiter233119* ti, Tstrtable225813 tab);
N_NIMCALL(void, rawclosescope_286102)(Tcontext280023* c);
N_NIMCALL(Tsym225841*, skipalias_286150)(Tsym225841* s, Tnode225809* n);
N_NIMCALL(void, replacedeprecated_285276)(Tlineinfo190352 info, Tsym225841* oldsym, Tsym225841* newsym);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(Tsym225841*, searchinscopes_286205)(Tcontext280023* c, Tident198021* s);
N_NIMCALL(Tsym225841*, strtableget_233111)(Tstrtable225813 t, Tident198021* name);
N_NIMCALL(Tsym225841*, errorsym_286372)(Tcontext280023* c, Tnode225809* n);
N_NIMCALL(Tsym225841*, newsym_226656)(NU8 symkind, Tident198021* name, Tsym225841* owner, Tlineinfo190352 info);
N_NIMCALL(Tsym225841*, getcurrowner_280258)(void);
N_NIMCALL(Ttype225847*, errortype_281161)(Tcontext280023* c);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(void, strtableadd_233103)(Tstrtable225813* t, Tsym225841* n);
N_NIMCALL(void, internalerror_196172)(Tlineinfo190352 info, NimStringDesc* errmsg);
N_NIMCALL(NIM_BOOL, contains_222829)(Intset222056 s, NI key);
N_NIMCALL(void, loadstub_271053)(Tsym225841* s);
N_NIMCALL(Tsym225841*, qualifiedlookup_286864)(Tcontext280023* c, Tnode225809* n, NU8 flags);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(Tsym225841*, initidentiter_233147)(Tidentiter233141* ti, Tstrtable225813 tab, Tident198021* s);
N_NIMCALL(void, initintset_222927)(Intset222056* Result);
N_NIMCALL(void, incl_222856)(Intset222056* s, NI key);
N_NIMCALL(Tsym225841*, nextidentiter_233156)(Tidentiter233141* ti, Tstrtable225813 tab);
N_NIMCALL(NI, sonslen_228387)(Tnode225809* n);
N_NIMCALL(Tsym225841*, firstidentexcluding_238154)(Tidentiter233141* ti, Tstrtable225813 tab, Tident198021* s, Intset222056 excluding);
N_NIMCALL(Tsym225841*, nextidentexcluding_238104)(Tidentiter233141* ti, Tstrtable225813 tab, Intset222056 excluding);
N_NIMCALL(void, adddecl_286607)(Tcontext280023* c, Tsym225841* sym);
N_NIMCALL(void, addinterfacedeclaux_286641)(Tcontext280023* c, Tsym225841* sym);
N_NIMCALL(void, addoverloadablesymat_286688)(Tscope225835* scope, Tsym225841* fn);
N_NIMCALL(void, adddeclat_286629)(Tscope225835* scope, Tsym225841* sym);
STRING_LITERAL(TMP2731, "<Error>", 7);
STRING_LITERAL(TMP2732, "", 0);
STRING_LITERAL(TMP2798, "use ", 4);
STRING_LITERAL(TMP2799, " instead; ", 10);
STRING_LITERAL(TMP2800, "err:", 4);
STRING_LITERAL(TMP2801, "lookUp", 6);
STRING_LITERAL(TMP3217, "addInterfaceDeclAux", 19);
STRING_LITERAL(TMP3288, "addOverloadableSymAt", 20);
extern TNimType NTI225837; /* PScope */
extern Gcheap51218 gch_51259;
extern NU8 gcmd_167134;

static N_INLINE(NI, len_226098)(Tnode225809* 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(Tident198021*, considerquotedident_286010)(Tnode225809* n) {
	Tident198021* 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_226098(n);
		switch (LOC4) {
		case ((NI) 0):
		{
			NimStringDesc* LOC6;
			LOC6 = 0;
			LOC6 = rendertree_247059(n, 0);
			localerror_196128((*n).info, ((NU16) 20), LOC6);
			result = getident_198463(((NimStringDesc*) &TMP2731));
		}
		break;
		case ((NI) 1):
		{
			result = considerquotedident_286010((*n).kindU.S6.sons->data[((NI) 0)]);
		}
		break;
		default:
		{
			NimStringDesc* id;
			id = copyString(((NimStringDesc*) &TMP2732));
			{
				NI i_286039;
				NI HEX3Atmp_286049;
				NI LOC10;
				NI res_286052;
				i_286039 = 0;
				HEX3Atmp_286049 = 0;
				LOC10 = 0;
				LOC10 = len_226098(n);
				HEX3Atmp_286049 = (LOC10 - 1);
				res_286052 = ((NI) 0);
				{
					while (1) {
						Tnode225809* x;
						if (!(res_286052 <= HEX3Atmp_286049)) goto LA12;
						i_286039 = res_286052;
						x = (*n).kindU.S6.sons->data[i_286039];
						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_247059(n, 0);
							localerror_196128((*n).info, ((NU16) 20), LOC16);
							result = getident_198463(((NimStringDesc*) &TMP2731));
							goto BeforeRet;
						}
						break;
						}
						res_286052 += ((NI) 1);
					} LA12: ;
				}
			}
			result = getident_198463(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_247059(n, 0);
		localerror_196128((*n).info, ((NU16) 20), LOC19);
		result = getident_198463(((NimStringDesc*) &TMP2731));
	}
	break;
	}
	}BeforeRet: ;
	return result;
}

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

static N_INLINE(void, rtladdcycleroot_53623)(Cell49147* c) {
	{
		if (!!((((NI) ((NI)((*c).refcount & ((NI) 3)))) == ((NI) 3)))) goto LA3;
		(*c).refcount = (NI)((NI)((*c).refcount & ((NI) -4)) | ((NI) 3));
		incl_49865((&gch_51259.cycleroots), c);
	}
	LA3: ;
}

static N_INLINE(void, incref_55222)(Cell49147* c) {
	(*c).refcount = (NI)((NU32)((*c).refcount) + (NU32)(((NI) 8)));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = canbecycleroot_52867(c);
		if (!LOC3) goto LA4;
		rtladdcycleroot_53623(c);
	}
	LA4: ;
}

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

static N_INLINE(void, rtladdzct_54404)(Cell49147* c) {
	addzct_52817((&gch_51259.zct), c);
}

static N_INLINE(void, decref_54804)(Cell49147* c) {
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA3;
		rtladdzct_54404(c);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = canbecycleroot_52867(c);
		if (!LOC6) goto LA7;
		rtladdcycleroot_53623(c);
	}
	goto LA1;
	LA7: ;
	LA1: ;
}

static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		Cell49147* LOC5;
		if (!!((src == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = usrtocell_52846(src);
		incref_55222(LOC5);
	}
	LA3: ;
	{
		Cell49147* LOC10;
		if (!!(((*dest) == NIM_NIL))) goto LA8;
		LOC10 = 0;
		LOC10 = usrtocell_52846((*dest));
		decref_54804(LOC10);
	}
	LA8: ;
	(*dest) = src;
}

static N_INLINE(NI, scopedepth_280236)(Tcontext280023* 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(Tscope225835*, openscope_286091)(Tcontext280023* c) {
	Tscope225835* result;
	Tscope225835* LOC1;
	NI LOC2;
	result = 0;
	LOC1 = 0;
	LOC1 = (Tscope225835*) newObj((&NTI225837), sizeof(Tscope225835));
	asgnRef((void**) (&(*LOC1).parent), (*c).currentscope);
	newstrtable_229027((&(*LOC1).symbols));
	LOC2 = 0;
	LOC2 = scopedepth_280236(c);
	(*LOC1).depthlevel = (NI)(LOC2 + ((NI) 1));
	result = LOC1;
	asgnRef((void**) (&(*c).currentscope), result);
	return result;
}

N_NIMCALL(NIM_BOOL, adduniquesym_286079)(Tscope225835* scope, Tsym225841* s) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = strtableincl_237607((&(*scope).symbols), s);
	result = !(LOC1);
	return result;
}

N_NIMCALL(void, wrongredefinition_286588)(Tlineinfo190352 info, NimStringDesc* s) {
	{
		if (!!((gcmd_167134 == ((NU8) 18)))) goto LA3;
		localerror_196128(info, ((NU16) 41), s);
	}
	LA3: ;
}

N_NIMCALL(void, adddecl_286607)(Tcontext280023* c, Tsym225841* sym) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = adduniquesym_286079((*c).currentscope, sym);
		if (!!(LOC3)) goto LA4;
		wrongredefinition_286588((*sym).info, (*(*sym).name).s);
	}
	LA4: ;
}

N_NIMCALL(NimStringDesc*, getsymrepr_286447)(Tsym225841* 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_255447(s, ((NU8) 0));
	}
	break;
	default:
	{
		result = copyString((*(*s).name).s);
	}
	break;
	}
	return result;
}

N_NIMCALL(void, ensurenomissingorunusedsymbols_286004)(Tscope225835* scope) {
	Ttabiter233119 it;
	Tsym225841* s;
	NI missingimpls;
	memset((void*)(&it), 0, sizeof(it));
	s = inittabiter_233124((&it), (*scope).symbols);
	missingimpls = ((NI) 0);
	{
		while (1) {
			if (!!((s == NIM_NIL))) goto LA2;
			{
				if (!(((*s).flags &(1<<((((NU8) 4))&31)))!=0)) goto LA5;
				{
					NimStringDesc* LOC11;
					if (!(missingimpls == ((NI) 0))) goto LA9;
					LOC11 = 0;
					LOC11 = getsymrepr_286447(s);
					localerror_196128((*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 &(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_286447(s);
						message_196161((*s).info, ((NU16) 271), LOC27);
					}
					LA25: ;
				}
				LA19: ;
			}
			goto LA3;
			LA15: ;
			LA3: ;
			s = nextiter_233132((&it), (*scope).symbols);
		} LA2: ;
	}
}

N_NIMCALL(void, rawclosescope_286102)(Tcontext280023* c) {
	asgnRef((void**) (&(*c).currentscope), (*(*c).currentscope).parent);
}

N_NIMCALL(void, closescope_286111)(Tcontext280023* c) {
	ensurenomissingorunusedsymbols_286004((*c).currentscope);
	rawclosescope_286102(c);
}

N_NIMCALL(Tsym225841*, skipalias_286150)(Tsym225841* s, Tnode225809* n) {
	Tsym225841* 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_167134 == ((NU8) 7))) goto LA10;
			replacedeprecated_285276((*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*) &TMP2798));
appendString(LOC13, (*(*result).name).s);
appendString(LOC13, ((NimStringDesc*) &TMP2799));
appendString(LOC13, (*(*s).name).s);
			message_196161((*n).info, ((NU16) 241), LOC13);
		}
		LA8: ;
	}
	LA1: ;
	return result;
}

N_NIMCALL(Tsym225841*, searchinscopes_286205)(Tcontext280023* c, Tident198021* s) {
	Tsym225841* result;
{	result = 0;
	{
		Tscope225835* scope_286210;
		Tscope225835* HEX3Atmp_286224;
		Tscope225835* current_286227;
		scope_286210 = 0;
		HEX3Atmp_286224 = 0;
		HEX3Atmp_286224 = (*c).currentscope;
		current_286227 = HEX3Atmp_286224;
		{
			while (1) {
				if (!!((current_286227 == NIM_NIL))) goto LA3;
				scope_286210 = current_286227;
				result = strtableget_233111((*scope_286210).symbols, s);
				{
					if (!!((result == NIM_NIL))) goto LA6;
					goto BeforeRet;
				}
				LA6: ;
				current_286227 = (*current_286227).parent;
			} LA3: ;
		}
	}
	result = NIM_NIL;
	}BeforeRet: ;
	return result;
}

static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) {
	{
		Cell49147* c;
		if (!!((src == NIM_NIL))) goto LA3;
		c = usrtocell_52846(src);
		(*c).refcount += ((NI) 8);
	}
	LA3: ;
	{
		Cell49147* c;
		if (!!(((*dest) == NIM_NIL))) goto LA7;
		c = usrtocell_52846((*dest));
		{
			(*c).refcount -= ((NI) 8);
			if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA11;
			rtladdzct_54404(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

N_NIMCALL(Tsym225841*, errorsym_286372)(Tcontext280023* c, Tnode225809* n) {
	Tsym225841* result;
	Tnode225809* m;
	Tident198021* ident;
	Tsym225841* 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_286010(m);
	}
	goto LA5;
	LA7: ;
	{
		NimStringDesc* LOC10;
		NimStringDesc* LOC11;
		LOC10 = 0;
		LOC11 = 0;
		LOC11 = rendertree_247059(m, 0);
		LOC10 = rawNewString(LOC11->Sup.len + 4);
appendString(LOC10, ((NimStringDesc*) &TMP2800));
appendString(LOC10, LOC11);
		ident = getident_198463(LOC10);
	}
	LA5: ;
	LOC12 = 0;
	LOC12 = getcurrowner_280258();
	result = newsym_226656(((NU8) 0), ident, LOC12, (*n).info);
	asgnRefNoCycle((void**) (&(*result).typ), errortype_281161(c));
	(*result).flags |= ((NU32)1)<<((((NU8) 29))%(sizeof(NU32)*8));
	{
		NIM_BOOL LOC15;
		LOC15 = 0;
		LOC15 = !((gcmd_167134 == ((NU8) 18)));
		if (!(LOC15)) goto LA16;
		LOC15 = ((*c).compilescontextid == ((NI) 0));
		LA16: ;
		if (!LOC15) goto LA17;
		strtableadd_233103((&(*(*c).importtable).symbols), result);
	}
	LA17: ;
	return result;
}

N_NIMCALL(Tsym225841*, lookup_286804)(Tcontext280023* c, Tnode225809* n) {
	Tsym225841* result;
{	result = 0;
	switch ((*n).kind) {
	case ((NU8) 2):
	{
		Tsym225841* LOC2;
		LOC2 = 0;
		LOC2 = searchinscopes_286205(c, (*n).kindU.S5.ident);
		result = skipalias_286150(LOC2, n);
		{
			if (!(result == NIM_NIL)) goto LA5;
			localerror_196128((*n).info, ((NU16) 63), (*(*n).kindU.S5.ident).s);
			result = errorsym_286372(c, n);
		}
		LA5: ;
	}
	break;
	case ((NU8) 3):
	{
		result = (*n).kindU.S4.sym;
	}
	break;
	case ((NU8) 53):
	{
		Tident198021* ident;
		Tsym225841* LOC9;
		ident = considerquotedident_286010(n);
		LOC9 = 0;
		LOC9 = searchinscopes_286205(c, ident);
		result = skipalias_286150(LOC9, n);
		{
			if (!(result == NIM_NIL)) goto LA12;
			localerror_196128((*n).info, ((NU16) 63), (*ident).s);
			result = errorsym_286372(c, n);
		}
		LA12: ;
	}
	break;
	default:
	{
		internalerror_196172((*n).info, ((NimStringDesc*) &TMP2801));
		goto BeforeRet;
	}
	break;
	}
	{
		NIM_BOOL LOC17;
		LOC17 = 0;
		LOC17 = contains_222829((*c).ambiguoussymbols, (*result).Sup.id);
		if (!LOC17) goto LA18;
		localerror_196128((*n).info, ((NU16) 66), (*(*result).name).s);
	}
	LA18: ;
	{
		if (!((*result).kind == ((NU8) 23))) goto LA22;
		loadstub_271053(result);
	}
	LA22: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tsym225841*, qualifiedlookup_286864)(Tcontext280023* c, Tnode225809* n, NU8 flags) {
	Tsym225841* result;
	result = 0;
	switch ((*n).kind) {
	case ((NU8) 2):
	case ((NU8) 53):
	{
		Tident198021* ident;
		Tsym225841* LOC2;
		ident = considerquotedident_286010(n);
		LOC2 = 0;
		LOC2 = searchinscopes_286205(c, ident);
		result = skipalias_286150(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_196128((*n).info, ((NU16) 63), (*ident).s);
			result = errorsym_286372(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_222829((*c).ambiguoussymbols, (*result).Sup.id);
			LA13: ;
			if (!LOC10) goto LA14;
			localerror_196128((*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 &(1<<((((NU8) 0))&7)))!=0);
			if (!(LOC19)) goto LA20;
			LOC19 = contains_222829((*c).ambiguoussymbols, (*result).Sup.id);
			LA20: ;
			if (!LOC19) goto LA21;
			localerror_196128((*n).info, ((NU16) 66), (*(*(*n).kindU.S4.sym).name).s);
		}
		LA21: ;
	}
	break;
	case ((NU8) 45):
	{
		Tsym225841* m;
		result = NIM_NIL;
		m = qualifiedlookup_286864(c, (*n).kindU.S6.sons->data[((NI) 0)], (flags & 2));
		{
			NIM_BOOL LOC26;
			Tident198021* 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_286010((*n).kindU.S6.sons->data[((NI) 1)]);
			}
			goto LA30;
			LA35: ;
			LA30: ;
			{
				if (!!((ident == NIM_NIL))) goto LA39;
				{
					Tsym225841* LOC45;
					if (!(m == (*c).module)) goto LA43;
					LOC45 = 0;
					LOC45 = strtableget_233111((*(*c).toplevelscope).symbols, ident);
					result = skipalias_286150(LOC45, n);
				}
				goto LA41;
				LA43: ;
				{
					Tsym225841* LOC47;
					LOC47 = 0;
					LOC47 = strtableget_233111((*m).kindU.S3.tab, ident);
					result = skipalias_286150(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_196128((*(*n).kindU.S6.sons->data[((NI) 1)]).info, ((NU16) 63), (*ident).s);
					result = errorsym_286372(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 &(1<<((((NU8) 1))&7)))!=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_247059((*n).kindU.S6.sons->data[((NI) 1)], 0);
				localerror_196128((*(*n).kindU.S6.sons->data[((NI) 1)]).info, ((NU16) 20), LOC62);
				result = errorsym_286372(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) 23));
		LA67: ;
		if (!LOC66) goto LA68;
		loadstub_271053(result);
	}
	LA68: ;
	return result;
}

N_NIMCALL(Tsym225841*, initoverloaditer_287108)(Toverloaditer286431* o, Tcontext280023* c, Tnode225809* n) {
	Tsym225841* result;
	result = 0;
	switch ((*n).kind) {
	case ((NU8) 2):
	case ((NU8) 53):
	{
		Tident198021* ident;
		ident = considerquotedident_286010(n);
		unsureAsgnRef((void**) (&(*o).scope), (*c).currentscope);
		(*o).mode = ((NU8) 1);
		{
			while (1) {
				Tsym225841* LOC4;
				LOC4 = 0;
				LOC4 = initidentiter_233147((&(*o).it), (*(*o).scope).symbols, ident);
				result = skipalias_286150(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_286864(c, (*n).kindU.S6.sons->data[((NI) 0)], 2));
		{
			NIM_BOOL LOC18;
			Tident198021* 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_286010((*n).kindU.S6.sons->data[((NI) 1)]);
			}
			goto LA22;
			LA27: ;
			LA22: ;
			{
				if (!!((ident == NIM_NIL))) goto LA31;
				{
					Tsym225841* LOC37;
					if (!((*o).m == (*c).module)) goto LA35;
					LOC37 = 0;
					LOC37 = initidentiter_233147((&(*o).it), (*(*c).toplevelscope).symbols, ident);
					result = skipalias_286150(LOC37, n);
					(*o).mode = ((NU8) 2);
				}
				goto LA33;
				LA35: ;
				{
					Tsym225841* LOC39;
					LOC39 = 0;
					LOC39 = initidentiter_233147((&(*o).it), (*(*o).m).kindU.S3.tab, ident);
					result = skipalias_286150(LOC39, n);
				}
				LA33: ;
			}
			goto LA29;
			LA31: ;
			{
				NimStringDesc* LOC41;
				LOC41 = 0;
				LOC41 = rendertree_247059((*n).kindU.S6.sons->data[((NI) 1)], 0);
				localerror_196128((*(*n).kindU.S6.sons->data[((NI) 1)]).info, ((NU16) 20), LOC41);
				result = errorsym_286372(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_222927((&(*o).insymchoice));
		incl_222856((&(*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_271053(result);
	}
	LA48: ;
	return result;
}

N_NIMCALL(Tsym225841*, nextoverloaditer_287277)(Toverloaditer286431* o, Tcontext280023* c, Tnode225809* n) {
	Tsym225841* result;
	result = 0;
	switch ((*o).mode) {
	case ((NU8) 0):
	{
		result = NIM_NIL;
	}
	break;
	case ((NU8) 1):
	{
		{
			Tsym225841* LOC7;
			if (!!(((*o).scope == NIM_NIL))) goto LA5;
			LOC7 = 0;
			LOC7 = nextidentiter_233156((&(*o).it), (*(*o).scope).symbols);
			result = skipalias_286150(LOC7, n);
			{
				while (1) {
					Tsym225841* 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_233147((&(*o).it), (*(*o).scope).symbols, (*o).it.name);
					result = skipalias_286150(LOC14, n);
				} LA9: ;
			} LA8: ;
		}
		goto LA3;
		LA5: ;
		{
			result = NIM_NIL;
		}
		LA3: ;
	}
	break;
	case ((NU8) 2):
	{
		Tsym225841* LOC17;
		LOC17 = 0;
		LOC17 = nextidentiter_233156((&(*o).it), (*(*c).toplevelscope).symbols);
		result = skipalias_286150(LOC17, n);
	}
	break;
	case ((NU8) 3):
	{
		Tsym225841* LOC19;
		LOC19 = 0;
		LOC19 = nextidentiter_233156((&(*o).it), (*(*o).m).kindU.S3.tab);
		result = skipalias_286150(LOC19, n);
	}
	break;
	case ((NU8) 4):
	{
		{
			NI LOC23;
			LOC23 = 0;
			LOC23 = sonslen_228387(n);
			if (!((*o).symchoiceindex < LOC23)) goto LA24;
			result = (*(*n).kindU.S6.sons->data[(*o).symchoiceindex]).kindU.S4.sym;
			incl_222856((&(*o).insymchoice), (*result).Sup.id);
			(*o).symchoiceindex += ((NI) 1);
		}
		goto LA21;
		LA24: ;
		{
			Tsym225841* LOC29;
			if (!((*n).kind == ((NU8) 57))) goto LA27;
			(*o).mode = ((NU8) 5);
			unsureAsgnRef((void**) (&(*o).scope), (*c).currentscope);
			LOC29 = 0;
			LOC29 = firstidentexcluding_238154((&(*o).it), (*(*o).scope).symbols, (*(*(*n).kindU.S6.sons->data[((NI) 0)]).kindU.S4.sym).name, (*o).insymchoice);
			result = skipalias_286150(LOC29, n);
			{
				while (1) {
					Tsym225841* 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_238154((&(*o).it), (*(*o).scope).symbols, (*(*(*n).kindU.S6.sons->data[((NI) 0)]).kindU.S4.sym).name, (*o).insymchoice);
					result = skipalias_286150(LOC36, n);
				} LA31: ;
			} LA30: ;
		}
		goto LA21;
		LA27: ;
		LA21: ;
	}
	break;
	case ((NU8) 5):
	{
		Tsym225841* LOC38;
		LOC38 = 0;
		LOC38 = nextidentexcluding_238104((&(*o).it), (*(*o).scope).symbols, (*o).insymchoice);
		result = skipalias_286150(LOC38, n);
		{
			while (1) {
				Tsym225841* 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_238154((&(*o).it), (*(*o).scope).symbols, (*(*(*n).kindU.S6.sons->data[((NI) 0)]).kindU.S4.sym).name, (*o).insymchoice);
				result = skipalias_286150(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_271053(result);
	}
	LA50: ;
	return result;
}

N_NIMCALL(void, addprelimdecl_286619)(Tcontext280023* c, Tsym225841* sym) {
	NIM_BOOL LOC1;
	LOC1 = 0;
	LOC1 = adduniquesym_286079((*c).currentscope, sym);
}

N_NIMCALL(void, addinterfacedeclaux_286641)(Tcontext280023* c, Tsym225841* sym) {
	{
		if (!(((*sym).flags &(1<<((((NU8) 1))&31)))!=0)) goto LA3;
		{
			if (!!(((*c).module == NIM_NIL))) goto LA7;
			strtableadd_233103((&(*(*c).module).kindU.S3.tab), sym);
		}
		goto LA5;
		LA7: ;
		{
			internalerror_196172((*sym).info, ((NimStringDesc*) &TMP3217));
		}
		LA5: ;
	}
	LA3: ;
}

N_NIMCALL(void, addinterfacedecl_286736)(Tcontext280023* c, Tsym225841* sym) {
	adddecl_286607(c, sym);
	addinterfacedeclaux_286641(c, sym);
}

N_NIMCALL(NI, lastoverloadscope_287259)(Toverloaditer286431* 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(Tsym225841*, searchinscopes_286323)(Tcontext280023* c, Tident198021* s, NU32 filter) {
	Tsym225841* result;
{	result = 0;
	{
		Tscope225835* scope_286329;
		Tscope225835* HEX3Atmp_286353;
		Tscope225835* current_286356;
		scope_286329 = 0;
		HEX3Atmp_286353 = 0;
		HEX3Atmp_286353 = (*c).currentscope;
		current_286356 = HEX3Atmp_286353;
		{
			while (1) {
				if (!!((current_286356 == NIM_NIL))) goto LA3;
				scope_286329 = current_286356;
				result = strtableget_233111((*scope_286329).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_286356 = (*current_286356).parent;
			} LA3: ;
		}
	}
	result = NIM_NIL;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, addoverloadablesymat_286688)(Tscope225835* scope, Tsym225841* fn) {
	Tsym225841* check;
{	{
		if (!!(((520256 &(1<<(((*fn).kind)&31)))!=0))) goto LA3;
		internalerror_196172((*fn).info, ((NimStringDesc*) &TMP3288));
		goto BeforeRet;
	}
	LA3: ;
	check = strtableget_233111((*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_286588((*fn).info, (*(*fn).name).s);
	}
	goto LA5;
	LA9: ;
	{
		strtableadd_233103((&(*scope).symbols), fn);
	}
	LA5: ;
	}BeforeRet: ;
}

N_NIMCALL(void, addinterfaceoverloadablesymat_286746)(Tcontext280023* c, Tscope225835* scope, Tsym225841* sym) {
	addoverloadablesymat_286688(scope, sym);
	addinterfacedeclaux_286641(c, sym);
}

N_NIMCALL(void, adddeclat_286629)(Tscope225835* scope, Tsym225841* sym) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = adduniquesym_286079(scope, sym);
		if (!!(LOC3)) goto LA4;
		wrongredefinition_286588((*sym).info, (*(*sym).name).s);
	}
	LA4: ;
}

N_NIMCALL(void, addinterfacedeclat_286677)(Tcontext280023* c, Tscope225835* scope, Tsym225841* sym) {
	adddeclat_286629(scope, sym);
	addinterfacedeclaux_286641(c, sym);
}

N_NIMCALL(Tsym225841*, localsearchinscope_286194)(Tcontext280023* c, Tident198021* s) {
	Tsym225841* result;
	result = 0;
	result = strtableget_233111((*(*c).currentscope).symbols, s);
	return result;
}
NIM_EXTERNC N_NOINLINE(void, compiler_lookupsInit000)(void) {
}

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

