/* 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 Tident196021 Tident196021;
typedef struct Tnode223809 Tnode223809;
typedef struct Ttype223847 Ttype223847;
typedef struct Tlineinfo188352 Tlineinfo188352;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tsym223841 Tsym223841;
typedef struct Tnodeseq223803 Tnodeseq223803;
typedef struct Tidobj196015 Tidobj196015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttypeseq223843 Ttypeseq223843;
typedef struct Tscope223835 Tscope223835;
typedef struct TY223944 TY223944;
typedef struct Tstrtable223813 Tstrtable223813;
typedef struct Tsymseq223811 Tsymseq223811;
typedef struct Tloc223823 Tloc223823;
typedef struct Ropeobj174009 Ropeobj174009;
typedef struct Tlib223827 Tlib223827;
typedef struct Tcontext278023 Tcontext278023;
typedef struct Tpasscontext275005 Tpasscontext275005;
typedef struct Tproccon278011 Tproccon278011;
typedef struct Intset220056 Intset220056;
typedef struct Trunk220052 Trunk220052;
typedef struct Trunkseq220054 Trunkseq220054;
typedef struct Tlinkedlist139028 Tlinkedlist139028;
typedef struct Tlistentry139022 Tlistentry139022;
typedef struct Tidtable223859 Tidtable223859;
typedef struct Tidpairseq223857 Tidpairseq223857;
typedef struct Tctx277048 Tctx277048;
typedef struct TY278143 TY278143;
typedef struct Cell48947 Cell48947;
typedef struct Cellset48959 Cellset48959;
typedef struct Gcheap51018 Gcheap51018;
typedef struct Gcstack51016 Gcstack51016;
typedef struct Cellseq48963 Cellseq48963;
typedef struct Pagedesc48955 Pagedesc48955;
typedef struct Memregion30890 Memregion30890;
typedef struct Smallchunk30842 Smallchunk30842;
typedef struct Llchunk30884 Llchunk30884;
typedef struct Bigchunk30844 Bigchunk30844;
typedef struct Intset30817 Intset30817;
typedef struct Trunk30813 Trunk30813;
typedef struct Avlnode30888 Avlnode30888;
typedef struct Gcstat51014 Gcstat51014;
typedef struct Ttabiter231119 Ttabiter231119;
typedef struct Toverloaditer284431 Toverloaditer284431;
typedef struct Tidentiter231141 Tidentiter231141;
typedef struct Tinstantiation223831 Tinstantiation223831;
typedef struct Tidpair223855 Tidpair223855;
typedef struct TY277254 TY277254;
typedef struct TY189420 TY189420;
typedef struct PprocHEX3Aobjecttype277233 PprocHEX3Aobjecttype277233;
typedef struct TY277273 TY277273;
typedef struct Tinstantiationpair278013 Tinstantiationpair278013;
typedef struct Basechunk30840 Basechunk30840;
typedef struct Freecell30832 Freecell30832;
typedef struct TY223932 TY223932;
typedef struct TY277234 TY277234;
typedef struct TY277239 TY277239;
typedef struct TY277274 TY277274;
typedef struct Vmargs277042 Vmargs277042;
typedef struct Tblock277030 Tblock277030;
typedef struct TY277214 TY277214;
struct  Tlineinfo188352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tnode223809  {
Ttype223847* typ;
Tlineinfo188352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym223841* sym;
} S4;
struct {Tident196021* ident;
} S5;
struct {Tnodeseq223803* 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  Tidobj196015  {
  TNimObject Sup;
NI id;
};
struct  Tstrtable223813  {
NI counter;
Tsymseq223811* data;
};
struct  Tloc223823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype223847* t;
Ropeobj174009* r;
Ropeobj174009* heaproot;
};
struct  Tsym223841  {
  Tidobj196015 Sup;
NU8 kind;
union{
struct {Ttypeseq223843* typeinstcache;
Tscope223835* typscope;
} S1;
struct {TY223944* procinstcache;
Tsym223841* gcunsafetyreason;
} S2;
struct {TY223944* usedgenerics;
Tstrtable223813 tab;
} S3;
struct {Tsym223841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype223847* typ;
Tident196021* name;
Tlineinfo188352 info;
Tsym223841* owner;
NU32 flags;
Tnode223809* ast;
NU32 options;
NI position;
NI offset;
Tloc223823 loc;
Tlib223827* annex;
Tnode223809* constraint;
};
struct  Tident196021  {
  Tidobj196015 Sup;
NimStringDesc* s;
Tident196021* next;
NI h;
};
struct  Tscope223835  {
NI depthlevel;
Tstrtable223813 symbols;
Tnodeseq223803* usingsyms;
Tscope223835* parent;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Tpasscontext275005  {
  TNimObject Sup;
NIM_BOOL fromcache;
};
struct  Intset220056  {
NI counter;
NI max;
Trunk220052* head;
Trunkseq220054* data;
};
struct  Tlinkedlist139028  {
Tlistentry139022* head;
Tlistentry139022* tail;
NI counter;
};
struct  Tidtable223859  {
NI counter;
Tidpairseq223857* data;
};
typedef N_NIMCALL_PTR(Tnode223809*, TY278074) (Tcontext278023* c, Tnode223809* n);
typedef N_NIMCALL_PTR(Tnode223809*, TY278079) (Tcontext278023* c, Tnode223809* n, NU16 flags);
typedef N_NIMCALL_PTR(Tnode223809*, TY278087) (Tcontext278023* c, Tnode223809* n, NU16 flags);
typedef N_NIMCALL_PTR(Tnode223809*, TY278095) (Tcontext278023* c, Tnode223809* n);
typedef N_NIMCALL_PTR(Tnode223809*, TY278100) (Tcontext278023* c, Tnode223809* n, NU16 flags);
typedef N_NIMCALL_PTR(Tnode223809*, TY278108) (Tcontext278023* c, Tnode223809* n);
typedef N_NIMCALL_PTR(Tnode223809*, TY278113) (Tcontext278023* c, Tnode223809* n, Tnode223809* norig, NU32 filter);
typedef N_NIMCALL_PTR(Ttype223847*, TY278120) (Tcontext278023* c, Tnode223809* n, Ttype223847* prev);
typedef struct {
N_NIMCALL_PTR(Tnode223809*, ClPrc) (Tcontext278023* c, Tidtable223859 pt, Tnode223809* n, void* ClEnv);
void* ClEnv;
} TY278126;
typedef struct {
N_NIMCALL_PTR(Tsym223841*, ClPrc) (Tcontext278023* c, Tsym223841* fn, Tidtable223859 pt, Tlineinfo188352 info, void* ClEnv);
void* ClEnv;
} TY278132;
typedef N_NIMCALL_PTR(Tsym223841*, TY278148) (Tcontext278023* c, Tsym223841* dc, Ttype223847* t, Tlineinfo188352 info, NU8 op);
struct  Tcontext278023  {
  Tpasscontext275005 Sup;
Tsym223841* module;
Tscope223835* currentscope;
Tscope223835* importtable;
Tscope223835* toplevelscope;
Tproccon278011* p;
Tsymseq223811* friendmodules;
NI instcounter;
Intset220056 ambiguoussymbols;
NI intypeclass;
NI ingenericcontext;
NI inunrolledcontext;
NI compilescontextid;
NI compilescontextidgenerator;
NI ingenericinst;
Tsymseq223811* converters;
Tsymseq223811* patterns;
Tlinkedlist139028 optionstack;
Tidtable223859 symmapping;
Tlinkedlist139028 libs;
TY278074 semconstexpr;
TY278079 semexpr;
TY278087 semtryexpr;
TY278095 semtryconstexpr;
TY278100 semoperand;
TY278108 semconstboolexpr;
TY278113 semoverloadedcall;
TY278120 semtypenode;
TY278126 seminferredlambda;
TY278132 semgenerateinstance;
Intset220056 includedfiles;
Tstrtable223813 userpragmas;
Tctx277048* evalcontext;
Intset220056 unknownidents;
TY278143* generics;
NI lastgenericidx;
NI hloloopdetector;
NI inparallelstmt;
TY278148 insttypeboundop;
};
struct  Cell48947  {
NI refcount;
TNimType* typ;
};
struct  Cellseq48963  {
NI len;
NI cap;
Cell48947** d;
};
struct  Cellset48959  {
NI counter;
NI max;
Pagedesc48955* head;
Pagedesc48955** data;
};
typedef Smallchunk30842* TY30905[512];
typedef Trunk30813* Trunkbuckets30815[256];
struct  Intset30817  {
Trunkbuckets30815 data;
};
struct  Memregion30890  {
NI minlargeobj;
NI maxlargeobj;
TY30905 freesmallchunks;
Llchunk30884* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk30844* freechunkslist;
Intset30817 chunkstarts;
Avlnode30888* root;
Avlnode30888* deleted;
Avlnode30888* last;
Avlnode30888* freeavlnodes;
};
struct  Gcstat51014  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap51018  {
Gcstack51016* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq48963 zct;
Cellseq48963 decstack;
Cellset48959 cycleroots;
Cellseq48963 tempstack;
NI recgclock;
Memregion30890 region;
Gcstat51014 stat;
};
struct  Ttabiter231119  {
NI h;
};
struct  Ttype223847  {
  Tidobj196015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq223843* sons;
Tnode223809* n;
Tsym223841* owner;
Tsym223841* sym;
Tsym223841* destructor;
Tsym223841* deepcopy;
Tsym223841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc223823 loc;
};
struct  Tidentiter231141  {
NI h;
Tident196021* name;
};
struct  Toverloaditer284431  {
Tidentiter231141 it;
Tsym223841* m;
NU8 mode;
NI symchoiceindex;
Tscope223835* scope;
Intset220056 insymchoice;
};
struct  Ropeobj174009  {
  TNimObject Sup;
Ropeobj174009* left;
Ropeobj174009* right;
NI length;
NimStringDesc* data;
};
struct  Tlistentry139022  {
  TNimObject Sup;
Tlistentry139022* prev;
Tlistentry139022* next;
};
struct  Tlib223827  {
  Tlistentry139022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj174009* name;
Tnode223809* path;
};
struct  Tproccon278011  {
Tsym223841* owner;
Tsym223841* resultsym;
NI nestedloopcounter;
NI nestedblockcounter;
NI intrystmt;
Tproccon278011* next;
NIM_BOOL wasforwarded;
Tnode223809* bracketexpr;
};
typedef NI TY30821[16];
struct  Trunk220052  {
Trunk220052* next;
NI key;
TY30821 bits;
};
struct  Tidpair223855  {
Tidobj196015* key;
TNimObject* val;
};
struct  Tctx277048  {
  Tpasscontext275005 Sup;
TY277254* code;
TY189420* debug;
Tnode223809* globals;
Tnode223809* constants;
Ttypeseq223843* types;
Tnode223809* currentexceptiona;
Tnode223809* currentexceptionb;
NI exceptioninstr;
PprocHEX3Aobjecttype277233* prc;
Tsym223841* module;
Tnode223809* callsite;
NU8 mode;
NU8 features;
NIM_BOOL traceactive;
NI loopiterations;
Tlineinfo188352 comesfromheuristic;
TY277273* callbacks;
NimStringDesc* errorflag;
};
struct  Tinstantiationpair278013  {
Tsym223841* genericsym;
Tinstantiation223831* inst;
};
struct  Gcstack51016  {
Gcstack51016* prev;
Gcstack51016* next;
void* starts;
void* pos;
NI maxstacksize;
};
struct  Pagedesc48955  {
Pagedesc48955* next;
NI key;
TY30821 bits;
};
struct  Basechunk30840  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk30842  {
  Basechunk30840 Sup;
Smallchunk30842* next;
Smallchunk30842* prev;
Freecell30832* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk30884  {
NI size;
NI acc;
Llchunk30884* next;
};
struct  Bigchunk30844  {
  Basechunk30840 Sup;
Bigchunk30844* next;
Bigchunk30844* prev;
NI align;
NF data;
};
struct  Trunk30813  {
Trunk30813* next;
NI key;
TY30821 bits;
};
typedef Avlnode30888* TY30895[2];
struct  Avlnode30888  {
TY30895 link;
NI key;
NI upperbound;
NI level;
};
struct  Tinstantiation223831  {
Tsym223841* sym;
Ttypeseq223843* concretetypes;
TY223932* usedby;
NI compilesid;
};
struct TY277239 {
NIM_BOOL Field0;
NU8 Field1;
};
typedef TY277239 TY277242[256];
struct  PprocHEX3Aobjecttype277233  {
TY277234* blocks;
Tsym223841* sym;
TY277242 slots;
NI maxslots;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (Vmargs277042* args, void* ClEnv);
void* ClEnv;
} Vmcallback277044;
struct TY277274 {
NimStringDesc* Field0;
Vmcallback277044 Field1;
};
struct  Freecell30832  {
Freecell30832* next;
NI zerofield;
};
struct  Tblock277030  {
Tsym223841* label;
TY277214* fixups;
};
struct  Vmargs277042  {
NI ra;
NI rb;
NI rc;
void* slots;
Tnode223809* currentexception;
};
struct Tnodeseq223803 {
  TGenericSeq Sup;
  Tnode223809* data[SEQ_DECL_SIZE];
};
struct Ttypeseq223843 {
  TGenericSeq Sup;
  Ttype223847* data[SEQ_DECL_SIZE];
};
struct TY223944 {
  TGenericSeq Sup;
  Tinstantiation223831* data[SEQ_DECL_SIZE];
};
struct Tsymseq223811 {
  TGenericSeq Sup;
  Tsym223841* data[SEQ_DECL_SIZE];
};
struct Trunkseq220054 {
  TGenericSeq Sup;
  Trunk220052* data[SEQ_DECL_SIZE];
};
struct Tidpairseq223857 {
  TGenericSeq Sup;
  Tidpair223855 data[SEQ_DECL_SIZE];
};
struct TY278143 {
  TGenericSeq Sup;
  Tinstantiationpair278013 data[SEQ_DECL_SIZE];
};
struct TY277254 {
  TGenericSeq Sup;
  NU32 data[SEQ_DECL_SIZE];
};
struct TY189420 {
  TGenericSeq Sup;
  Tlineinfo188352 data[SEQ_DECL_SIZE];
};
struct TY277273 {
  TGenericSeq Sup;
  TY277274 data[SEQ_DECL_SIZE];
};
struct TY223932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct TY277234 {
  TGenericSeq Sup;
  Tblock277030 data[SEQ_DECL_SIZE];
};
struct TY277214 {
  TGenericSeq Sup;
  NI data[SEQ_DECL_SIZE];
};
static N_INLINE(NI, len_224098)(Tnode223809* n);
N_NIMCALL(void, localerror_194128)(Tlineinfo188352 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, rendertree_245059)(Tnode223809* n, NU8 renderflags);
N_NIMCALL(Tident196021*, getident_196463)(NimStringDesc* identifier);
N_NIMCALL(Tident196021*, considerquotedident_284010)(Tnode223809* 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_55022)(Cell48947* c);
static N_INLINE(NIM_BOOL, canbecycleroot_52667)(Cell48947* c);
static N_INLINE(void, rtladdcycleroot_53423)(Cell48947* c);
N_NOINLINE(void, incl_49665)(Cellset48959* s, Cell48947* cell);
static N_INLINE(Cell48947*, usrtocell_52646)(void* usr);
static N_INLINE(void, decref_54604)(Cell48947* c);
static N_INLINE(void, rtladdzct_54204)(Cell48947* c);
N_NOINLINE(void, addzct_52617)(Cellseq48963* s, Cell48947* c);
N_NIMCALL(void, newstrtable_227027)(Tstrtable223813* Result);
static N_INLINE(NI, scopedepth_278236)(Tcontext278023* c);
N_NIMCALL(NIM_BOOL, adduniquesym_284079)(Tscope223835* scope, Tsym223841* s);
N_NIMCALL(NIM_BOOL, strtableincl_235607)(Tstrtable223813* t, Tsym223841* n);
N_NIMCALL(void, wrongredefinition_284588)(Tlineinfo188352 info, NimStringDesc* s);
N_NIMCALL(void, ensurenomissingorunusedsymbols_284004)(Tscope223835* scope);
N_NIMCALL(Tsym223841*, inittabiter_231124)(Ttabiter231119* ti, Tstrtable223813 tab);
N_NIMCALL(NimStringDesc*, getsymrepr_284447)(Tsym223841* s);
N_NIMCALL(NimStringDesc*, getprocheader_253447)(Tsym223841* sym, NU8 prefer);
N_NIMCALL(void, message_194161)(Tlineinfo188352 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(Tsym223841*, nextiter_231132)(Ttabiter231119* ti, Tstrtable223813 tab);
N_NIMCALL(void, rawclosescope_284102)(Tcontext278023* c);
N_NIMCALL(Tsym223841*, skipalias_284150)(Tsym223841* s, Tnode223809* n);
N_NIMCALL(void, replacedeprecated_283276)(Tlineinfo188352 info, Tsym223841* oldsym, Tsym223841* newsym);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(Tsym223841*, searchinscopes_284205)(Tcontext278023* c, Tident196021* s);
N_NIMCALL(Tsym223841*, strtableget_231111)(Tstrtable223813 t, Tident196021* name);
N_NIMCALL(Tsym223841*, errorsym_284372)(Tcontext278023* c, Tnode223809* n);
N_NIMCALL(Tsym223841*, newsym_224656)(NU8 symkind, Tident196021* name, Tsym223841* owner, Tlineinfo188352 info);
N_NIMCALL(Tsym223841*, getcurrowner_278258)(void);
N_NIMCALL(Ttype223847*, errortype_279161)(Tcontext278023* c);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(void, strtableadd_231103)(Tstrtable223813* t, Tsym223841* n);
N_NIMCALL(void, internalerror_194172)(Tlineinfo188352 info, NimStringDesc* errmsg);
N_NIMCALL(NIM_BOOL, contains_220829)(Intset220056 s, NI key);
N_NIMCALL(void, loadstub_269053)(Tsym223841* s);
N_NIMCALL(Tsym223841*, qualifiedlookup_284864)(Tcontext278023* c, Tnode223809* n, NU8 flags);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(Tsym223841*, initidentiter_231147)(Tidentiter231141* ti, Tstrtable223813 tab, Tident196021* s);
N_NIMCALL(void, initintset_220927)(Intset220056* Result);
N_NIMCALL(void, incl_220856)(Intset220056* s, NI key);
N_NIMCALL(Tsym223841*, nextidentiter_231156)(Tidentiter231141* ti, Tstrtable223813 tab);
N_NIMCALL(NI, sonslen_226387)(Tnode223809* n);
N_NIMCALL(Tsym223841*, firstidentexcluding_236154)(Tidentiter231141* ti, Tstrtable223813 tab, Tident196021* s, Intset220056 excluding);
N_NIMCALL(Tsym223841*, nextidentexcluding_236104)(Tidentiter231141* ti, Tstrtable223813 tab, Intset220056 excluding);
N_NIMCALL(void, adddecl_284607)(Tcontext278023* c, Tsym223841* sym);
N_NIMCALL(void, addinterfacedeclaux_284641)(Tcontext278023* c, Tsym223841* sym);
N_NIMCALL(void, addoverloadablesymat_284688)(Tscope223835* scope, Tsym223841* fn);
N_NIMCALL(void, adddeclat_284629)(Tscope223835* scope, Tsym223841* sym);
STRING_LITERAL(TMP2733, "<Error>", 7);
STRING_LITERAL(TMP2734, "", 0);
STRING_LITERAL(TMP2800, "use ", 4);
STRING_LITERAL(TMP2801, " instead; ", 10);
STRING_LITERAL(TMP2802, "err:", 4);
STRING_LITERAL(TMP2803, "lookUp", 6);
STRING_LITERAL(TMP3221, "addInterfaceDeclAux", 19);
STRING_LITERAL(TMP3292, "addOverloadableSymAt", 20);
extern TNimType NTI223837; /* PScope */
extern Gcheap51018 gch_51059;
extern NU8 gcmd_165134;

static N_INLINE(NI, len_224098)(Tnode223809* 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(Tident196021*, considerquotedident_284010)(Tnode223809* n) {
	Tident196021* 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_224098(n);
		switch (LOC4) {
		case ((NI) 0):
		{
			NimStringDesc* LOC6;
			LOC6 = 0;
			LOC6 = rendertree_245059(n, 0);
			localerror_194128((*n).info, ((NU16) 20), LOC6);
			result = getident_196463(((NimStringDesc*) &TMP2733));
		}
		break;
		case ((NI) 1):
		{
			result = considerquotedident_284010((*n).kindU.S6.sons->data[((NI) 0)]);
		}
		break;
		default:
		{
			NimStringDesc* id;
			id = copyString(((NimStringDesc*) &TMP2734));
			{
				NI i_284039;
				NI HEX3Atmp_284049;
				NI LOC10;
				NI res_284052;
				i_284039 = 0;
				HEX3Atmp_284049 = 0;
				LOC10 = 0;
				LOC10 = len_224098(n);
				HEX3Atmp_284049 = (LOC10 - 1);
				res_284052 = ((NI) 0);
				{
					while (1) {
						Tnode223809* x;
						if (!(res_284052 <= HEX3Atmp_284049)) goto LA12;
						i_284039 = res_284052;
						x = (*n).kindU.S6.sons->data[i_284039];
						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_245059(n, 0);
							localerror_194128((*n).info, ((NU16) 20), LOC16);
							result = getident_196463(((NimStringDesc*) &TMP2733));
							goto BeforeRet;
						}
						break;
						}
						res_284052 += ((NI) 1);
					} LA12: ;
				}
			}
			result = getident_196463(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_245059(n, 0);
		localerror_194128((*n).info, ((NU16) 20), LOC19);
		result = getident_196463(((NimStringDesc*) &TMP2733));
	}
	break;
	}
	}BeforeRet: ;
	return result;
}

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

static N_INLINE(void, rtladdcycleroot_53423)(Cell48947* c) {
	{
		if (!!((((NI) ((NI)((*c).refcount & ((NI) 3)))) == ((NI) 3)))) goto LA3;
		(*c).refcount = (NI)((NI)((*c).refcount & ((NI) -4)) | ((NI) 3));
		incl_49665((&gch_51059.cycleroots), c);
	}
	LA3: ;
}

static N_INLINE(void, incref_55022)(Cell48947* c) {
	(*c).refcount = (NI)((NU32)((*c).refcount) + (NU32)(((NI) 8)));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = canbecycleroot_52667(c);
		if (!LOC3) goto LA4;
		rtladdcycleroot_53423(c);
	}
	LA4: ;
}

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

static N_INLINE(void, rtladdzct_54204)(Cell48947* c) {
	addzct_52617((&gch_51059.zct), c);
}

static N_INLINE(void, decref_54604)(Cell48947* c) {
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA3;
		rtladdzct_54204(c);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = canbecycleroot_52667(c);
		if (!LOC6) goto LA7;
		rtladdcycleroot_53423(c);
	}
	goto LA1;
	LA7: ;
	LA1: ;
}

static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		Cell48947* LOC5;
		if (!!((src == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = usrtocell_52646(src);
		incref_55022(LOC5);
	}
	LA3: ;
	{
		Cell48947* LOC10;
		if (!!(((*dest) == NIM_NIL))) goto LA8;
		LOC10 = 0;
		LOC10 = usrtocell_52646((*dest));
		decref_54604(LOC10);
	}
	LA8: ;
	(*dest) = src;
}

static N_INLINE(NI, scopedepth_278236)(Tcontext278023* 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(Tscope223835*, openscope_284091)(Tcontext278023* c) {
	Tscope223835* result;
	Tscope223835* LOC1;
	NI LOC2;
	result = 0;
	LOC1 = 0;
	LOC1 = (Tscope223835*) newObj((&NTI223837), sizeof(Tscope223835));
	asgnRef((void**) (&(*LOC1).parent), (*c).currentscope);
	newstrtable_227027((&(*LOC1).symbols));
	LOC2 = 0;
	LOC2 = scopedepth_278236(c);
	(*LOC1).depthlevel = (NI)(LOC2 + ((NI) 1));
	result = LOC1;
	asgnRef((void**) (&(*c).currentscope), result);
	return result;
}

N_NIMCALL(NIM_BOOL, adduniquesym_284079)(Tscope223835* scope, Tsym223841* s) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = strtableincl_235607((&(*scope).symbols), s);
	result = !(LOC1);
	return result;
}

N_NIMCALL(void, wrongredefinition_284588)(Tlineinfo188352 info, NimStringDesc* s) {
	{
		if (!!((gcmd_165134 == ((NU8) 18)))) goto LA3;
		localerror_194128(info, ((NU16) 41), s);
	}
	LA3: ;
}

N_NIMCALL(void, adddecl_284607)(Tcontext278023* c, Tsym223841* sym) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = adduniquesym_284079((*c).currentscope, sym);
		if (!!(LOC3)) goto LA4;
		wrongredefinition_284588((*sym).info, (*(*sym).name).s);
	}
	LA4: ;
}

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

N_NIMCALL(void, ensurenomissingorunusedsymbols_284004)(Tscope223835* scope) {
	Ttabiter231119 it;
	Tsym223841* s;
	NI missingimpls;
	memset((void*)(&it), 0, sizeof(it));
	s = inittabiter_231124((&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_284447(s);
					localerror_194128((*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_284447(s);
						message_194161((*s).info, ((NU16) 271), LOC27);
					}
					LA25: ;
				}
				LA19: ;
			}
			goto LA3;
			LA15: ;
			LA3: ;
			s = nextiter_231132((&it), (*scope).symbols);
		} LA2: ;
	}
}

N_NIMCALL(void, rawclosescope_284102)(Tcontext278023* c) {
	asgnRef((void**) (&(*c).currentscope), (*(*c).currentscope).parent);
}

N_NIMCALL(void, closescope_284111)(Tcontext278023* c) {
	ensurenomissingorunusedsymbols_284004((*c).currentscope);
	rawclosescope_284102(c);
}

N_NIMCALL(Tsym223841*, skipalias_284150)(Tsym223841* s, Tnode223809* n) {
	Tsym223841* 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_165134 == ((NU8) 7))) goto LA10;
			replacedeprecated_283276((*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*) &TMP2800));
appendString(LOC13, (*(*result).name).s);
appendString(LOC13, ((NimStringDesc*) &TMP2801));
appendString(LOC13, (*(*s).name).s);
			message_194161((*n).info, ((NU16) 241), LOC13);
		}
		LA8: ;
	}
	LA1: ;
	return result;
}

N_NIMCALL(Tsym223841*, searchinscopes_284205)(Tcontext278023* c, Tident196021* s) {
	Tsym223841* result;
{	result = 0;
	{
		Tscope223835* scope_284210;
		Tscope223835* HEX3Atmp_284224;
		Tscope223835* current_284227;
		scope_284210 = 0;
		HEX3Atmp_284224 = 0;
		HEX3Atmp_284224 = (*c).currentscope;
		current_284227 = HEX3Atmp_284224;
		{
			while (1) {
				if (!!((current_284227 == NIM_NIL))) goto LA3;
				scope_284210 = current_284227;
				result = strtableget_231111((*scope_284210).symbols, s);
				{
					if (!!((result == NIM_NIL))) goto LA6;
					goto BeforeRet;
				}
				LA6: ;
				current_284227 = (*current_284227).parent;
			} LA3: ;
		}
	}
	result = NIM_NIL;
	}BeforeRet: ;
	return result;
}

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

N_NIMCALL(Tsym223841*, errorsym_284372)(Tcontext278023* c, Tnode223809* n) {
	Tsym223841* result;
	Tnode223809* m;
	Tident196021* ident;
	Tsym223841* 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_284010(m);
	}
	goto LA5;
	LA7: ;
	{
		NimStringDesc* LOC10;
		NimStringDesc* LOC11;
		LOC10 = 0;
		LOC11 = 0;
		LOC11 = rendertree_245059(m, 0);
		LOC10 = rawNewString(LOC11->Sup.len + 4);
appendString(LOC10, ((NimStringDesc*) &TMP2802));
appendString(LOC10, LOC11);
		ident = getident_196463(LOC10);
	}
	LA5: ;
	LOC12 = 0;
	LOC12 = getcurrowner_278258();
	result = newsym_224656(((NU8) 0), ident, LOC12, (*n).info);
	asgnRefNoCycle((void**) (&(*result).typ), errortype_279161(c));
	(*result).flags |= ((NU32)1)<<((((NU8) 29))%(sizeof(NU32)*8));
	{
		NIM_BOOL LOC15;
		LOC15 = 0;
		LOC15 = !((gcmd_165134 == ((NU8) 18)));
		if (!(LOC15)) goto LA16;
		LOC15 = ((*c).compilescontextid == ((NI) 0));
		LA16: ;
		if (!LOC15) goto LA17;
		strtableadd_231103((&(*(*c).importtable).symbols), result);
	}
	LA17: ;
	return result;
}

N_NIMCALL(Tsym223841*, lookup_284804)(Tcontext278023* c, Tnode223809* n) {
	Tsym223841* result;
{	result = 0;
	switch ((*n).kind) {
	case ((NU8) 2):
	{
		Tsym223841* LOC2;
		LOC2 = 0;
		LOC2 = searchinscopes_284205(c, (*n).kindU.S5.ident);
		result = skipalias_284150(LOC2, n);
		{
			if (!(result == NIM_NIL)) goto LA5;
			localerror_194128((*n).info, ((NU16) 63), (*(*n).kindU.S5.ident).s);
			result = errorsym_284372(c, n);
		}
		LA5: ;
	}
	break;
	case ((NU8) 3):
	{
		result = (*n).kindU.S4.sym;
	}
	break;
	case ((NU8) 53):
	{
		Tident196021* ident;
		Tsym223841* LOC9;
		ident = considerquotedident_284010(n);
		LOC9 = 0;
		LOC9 = searchinscopes_284205(c, ident);
		result = skipalias_284150(LOC9, n);
		{
			if (!(result == NIM_NIL)) goto LA12;
			localerror_194128((*n).info, ((NU16) 63), (*ident).s);
			result = errorsym_284372(c, n);
		}
		LA12: ;
	}
	break;
	default:
	{
		internalerror_194172((*n).info, ((NimStringDesc*) &TMP2803));
		goto BeforeRet;
	}
	break;
	}
	{
		NIM_BOOL LOC17;
		LOC17 = 0;
		LOC17 = contains_220829((*c).ambiguoussymbols, (*result).Sup.id);
		if (!LOC17) goto LA18;
		localerror_194128((*n).info, ((NU16) 66), (*(*result).name).s);
	}
	LA18: ;
	{
		if (!((*result).kind == ((NU8) 23))) goto LA22;
		loadstub_269053(result);
	}
	LA22: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tsym223841*, qualifiedlookup_284864)(Tcontext278023* c, Tnode223809* n, NU8 flags) {
	Tsym223841* result;
	result = 0;
	switch ((*n).kind) {
	case ((NU8) 2):
	case ((NU8) 53):
	{
		Tident196021* ident;
		Tsym223841* LOC2;
		ident = considerquotedident_284010(n);
		LOC2 = 0;
		LOC2 = searchinscopes_284205(c, ident);
		result = skipalias_284150(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_194128((*n).info, ((NU16) 63), (*ident).s);
			result = errorsym_284372(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_220829((*c).ambiguoussymbols, (*result).Sup.id);
			LA13: ;
			if (!LOC10) goto LA14;
			localerror_194128((*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_220829((*c).ambiguoussymbols, (*result).Sup.id);
			LA20: ;
			if (!LOC19) goto LA21;
			localerror_194128((*n).info, ((NU16) 66), (*(*(*n).kindU.S4.sym).name).s);
		}
		LA21: ;
	}
	break;
	case ((NU8) 45):
	{
		Tsym223841* m;
		result = NIM_NIL;
		m = qualifiedlookup_284864(c, (*n).kindU.S6.sons->data[((NI) 0)], (flags & 2));
		{
			NIM_BOOL LOC26;
			Tident196021* 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_284010((*n).kindU.S6.sons->data[((NI) 1)]);
			}
			goto LA30;
			LA35: ;
			LA30: ;
			{
				if (!!((ident == NIM_NIL))) goto LA39;
				{
					Tsym223841* LOC45;
					if (!(m == (*c).module)) goto LA43;
					LOC45 = 0;
					LOC45 = strtableget_231111((*(*c).toplevelscope).symbols, ident);
					result = skipalias_284150(LOC45, n);
				}
				goto LA41;
				LA43: ;
				{
					Tsym223841* LOC47;
					LOC47 = 0;
					LOC47 = strtableget_231111((*m).kindU.S3.tab, ident);
					result = skipalias_284150(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_194128((*(*n).kindU.S6.sons->data[((NI) 1)]).info, ((NU16) 63), (*ident).s);
					result = errorsym_284372(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_245059((*n).kindU.S6.sons->data[((NI) 1)], 0);
				localerror_194128((*(*n).kindU.S6.sons->data[((NI) 1)]).info, ((NU16) 20), LOC62);
				result = errorsym_284372(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_269053(result);
	}
	LA68: ;
	return result;
}

N_NIMCALL(Tsym223841*, initoverloaditer_285108)(Toverloaditer284431* o, Tcontext278023* c, Tnode223809* n) {
	Tsym223841* result;
	result = 0;
	switch ((*n).kind) {
	case ((NU8) 2):
	case ((NU8) 53):
	{
		Tident196021* ident;
		ident = considerquotedident_284010(n);
		unsureAsgnRef((void**) (&(*o).scope), (*c).currentscope);
		(*o).mode = ((NU8) 1);
		{
			while (1) {
				Tsym223841* LOC4;
				LOC4 = 0;
				LOC4 = initidentiter_231147((&(*o).it), (*(*o).scope).symbols, ident);
				result = skipalias_284150(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_284864(c, (*n).kindU.S6.sons->data[((NI) 0)], 2));
		{
			NIM_BOOL LOC18;
			Tident196021* 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_284010((*n).kindU.S6.sons->data[((NI) 1)]);
			}
			goto LA22;
			LA27: ;
			LA22: ;
			{
				if (!!((ident == NIM_NIL))) goto LA31;
				{
					Tsym223841* LOC37;
					if (!((*o).m == (*c).module)) goto LA35;
					LOC37 = 0;
					LOC37 = initidentiter_231147((&(*o).it), (*(*c).toplevelscope).symbols, ident);
					result = skipalias_284150(LOC37, n);
					(*o).mode = ((NU8) 2);
				}
				goto LA33;
				LA35: ;
				{
					Tsym223841* LOC39;
					LOC39 = 0;
					LOC39 = initidentiter_231147((&(*o).it), (*(*o).m).kindU.S3.tab, ident);
					result = skipalias_284150(LOC39, n);
				}
				LA33: ;
			}
			goto LA29;
			LA31: ;
			{
				NimStringDesc* LOC41;
				LOC41 = 0;
				LOC41 = rendertree_245059((*n).kindU.S6.sons->data[((NI) 1)], 0);
				localerror_194128((*(*n).kindU.S6.sons->data[((NI) 1)]).info, ((NU16) 20), LOC41);
				result = errorsym_284372(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_220927((&(*o).insymchoice));
		incl_220856((&(*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_269053(result);
	}
	LA48: ;
	return result;
}

N_NIMCALL(Tsym223841*, nextoverloaditer_285277)(Toverloaditer284431* o, Tcontext278023* c, Tnode223809* n) {
	Tsym223841* result;
	result = 0;
	switch ((*o).mode) {
	case ((NU8) 0):
	{
		result = NIM_NIL;
	}
	break;
	case ((NU8) 1):
	{
		{
			Tsym223841* LOC7;
			if (!!(((*o).scope == NIM_NIL))) goto LA5;
			LOC7 = 0;
			LOC7 = nextidentiter_231156((&(*o).it), (*(*o).scope).symbols);
			result = skipalias_284150(LOC7, n);
			{
				while (1) {
					Tsym223841* 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_231147((&(*o).it), (*(*o).scope).symbols, (*o).it.name);
					result = skipalias_284150(LOC14, n);
				} LA9: ;
			} LA8: ;
		}
		goto LA3;
		LA5: ;
		{
			result = NIM_NIL;
		}
		LA3: ;
	}
	break;
	case ((NU8) 2):
	{
		Tsym223841* LOC17;
		LOC17 = 0;
		LOC17 = nextidentiter_231156((&(*o).it), (*(*c).toplevelscope).symbols);
		result = skipalias_284150(LOC17, n);
	}
	break;
	case ((NU8) 3):
	{
		Tsym223841* LOC19;
		LOC19 = 0;
		LOC19 = nextidentiter_231156((&(*o).it), (*(*o).m).kindU.S3.tab);
		result = skipalias_284150(LOC19, n);
	}
	break;
	case ((NU8) 4):
	{
		{
			NI LOC23;
			LOC23 = 0;
			LOC23 = sonslen_226387(n);
			if (!((*o).symchoiceindex < LOC23)) goto LA24;
			result = (*(*n).kindU.S6.sons->data[(*o).symchoiceindex]).kindU.S4.sym;
			incl_220856((&(*o).insymchoice), (*result).Sup.id);
			(*o).symchoiceindex += ((NI) 1);
		}
		goto LA21;
		LA24: ;
		{
			Tsym223841* LOC29;
			if (!((*n).kind == ((NU8) 57))) goto LA27;
			(*o).mode = ((NU8) 5);
			unsureAsgnRef((void**) (&(*o).scope), (*c).currentscope);
			LOC29 = 0;
			LOC29 = firstidentexcluding_236154((&(*o).it), (*(*o).scope).symbols, (*(*(*n).kindU.S6.sons->data[((NI) 0)]).kindU.S4.sym).name, (*o).insymchoice);
			result = skipalias_284150(LOC29, n);
			{
				while (1) {
					Tsym223841* 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_236154((&(*o).it), (*(*o).scope).symbols, (*(*(*n).kindU.S6.sons->data[((NI) 0)]).kindU.S4.sym).name, (*o).insymchoice);
					result = skipalias_284150(LOC36, n);
				} LA31: ;
			} LA30: ;
		}
		goto LA21;
		LA27: ;
		LA21: ;
	}
	break;
	case ((NU8) 5):
	{
		Tsym223841* LOC38;
		LOC38 = 0;
		LOC38 = nextidentexcluding_236104((&(*o).it), (*(*o).scope).symbols, (*o).insymchoice);
		result = skipalias_284150(LOC38, n);
		{
			while (1) {
				Tsym223841* 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_236154((&(*o).it), (*(*o).scope).symbols, (*(*(*n).kindU.S6.sons->data[((NI) 0)]).kindU.S4.sym).name, (*o).insymchoice);
				result = skipalias_284150(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_269053(result);
	}
	LA50: ;
	return result;
}

N_NIMCALL(void, addprelimdecl_284619)(Tcontext278023* c, Tsym223841* sym) {
	NIM_BOOL LOC1;
	LOC1 = 0;
	LOC1 = adduniquesym_284079((*c).currentscope, sym);
}

N_NIMCALL(void, addinterfacedeclaux_284641)(Tcontext278023* c, Tsym223841* sym) {
	{
		if (!(((*sym).flags &(1<<((((NU8) 1))&31)))!=0)) goto LA3;
		{
			if (!!(((*c).module == NIM_NIL))) goto LA7;
			strtableadd_231103((&(*(*c).module).kindU.S3.tab), sym);
		}
		goto LA5;
		LA7: ;
		{
			internalerror_194172((*sym).info, ((NimStringDesc*) &TMP3221));
		}
		LA5: ;
	}
	LA3: ;
}

N_NIMCALL(void, addinterfacedecl_284736)(Tcontext278023* c, Tsym223841* sym) {
	adddecl_284607(c, sym);
	addinterfacedeclaux_284641(c, sym);
}

N_NIMCALL(NI, lastoverloadscope_285259)(Toverloaditer284431* 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(Tsym223841*, searchinscopes_284323)(Tcontext278023* c, Tident196021* s, NU32 filter) {
	Tsym223841* result;
{	result = 0;
	{
		Tscope223835* scope_284329;
		Tscope223835* HEX3Atmp_284353;
		Tscope223835* current_284356;
		scope_284329 = 0;
		HEX3Atmp_284353 = 0;
		HEX3Atmp_284353 = (*c).currentscope;
		current_284356 = HEX3Atmp_284353;
		{
			while (1) {
				if (!!((current_284356 == NIM_NIL))) goto LA3;
				scope_284329 = current_284356;
				result = strtableget_231111((*scope_284329).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_284356 = (*current_284356).parent;
			} LA3: ;
		}
	}
	result = NIM_NIL;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, addoverloadablesymat_284688)(Tscope223835* scope, Tsym223841* fn) {
	Tsym223841* check;
{	{
		if (!!(((520256 &(1<<(((*fn).kind)&31)))!=0))) goto LA3;
		internalerror_194172((*fn).info, ((NimStringDesc*) &TMP3292));
		goto BeforeRet;
	}
	LA3: ;
	check = strtableget_231111((*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_284588((*fn).info, (*(*fn).name).s);
	}
	goto LA5;
	LA9: ;
	{
		strtableadd_231103((&(*scope).symbols), fn);
	}
	LA5: ;
	}BeforeRet: ;
}

N_NIMCALL(void, addinterfaceoverloadablesymat_284746)(Tcontext278023* c, Tscope223835* scope, Tsym223841* sym) {
	addoverloadablesymat_284688(scope, sym);
	addinterfacedeclaux_284641(c, sym);
}

N_NIMCALL(void, adddeclat_284629)(Tscope223835* scope, Tsym223841* sym) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = adduniquesym_284079(scope, sym);
		if (!!(LOC3)) goto LA4;
		wrongredefinition_284588((*sym).info, (*(*sym).name).s);
	}
	LA4: ;
}

N_NIMCALL(void, addinterfacedeclat_284677)(Tcontext278023* c, Tscope223835* scope, Tsym223841* sym) {
	adddeclat_284629(scope, sym);
	addinterfacedeclaux_284641(c, sym);
}

N_NIMCALL(Tsym223841*, localsearchinscope_284194)(Tcontext278023* c, Tident196021* s) {
	Tsym223841* result;
	result = 0;
	result = strtableget_231111((*(*c).currentscope).symbols, s);
	return result;
}
NIM_EXTERNC N_NOINLINE(void, compiler_lookupsInit000)(void) {
}

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

