/* Generated by Nim Compiler v0.12.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 Tident197021 Tident197021;
typedef struct Tnode224809 Tnode224809;
typedef struct Ttype224847 Ttype224847;
typedef struct Tlineinfo189352 Tlineinfo189352;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tsym224841 Tsym224841;
typedef struct Tnodeseq224803 Tnodeseq224803;
typedef struct Tidobj197015 Tidobj197015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttypeseq224843 Ttypeseq224843;
typedef struct Tscope224835 Tscope224835;
typedef struct TY224944 TY224944;
typedef struct Tstrtable224813 Tstrtable224813;
typedef struct Tsymseq224811 Tsymseq224811;
typedef struct Tloc224823 Tloc224823;
typedef struct Ropeobj175009 Ropeobj175009;
typedef struct Tlib224827 Tlib224827;
typedef struct Tcontext279023 Tcontext279023;
typedef struct Tpasscontext276005 Tpasscontext276005;
typedef struct Tproccon279011 Tproccon279011;
typedef struct Intset221056 Intset221056;
typedef struct Trunk221052 Trunk221052;
typedef struct Trunkseq221054 Trunkseq221054;
typedef struct Tlinkedlist140028 Tlinkedlist140028;
typedef struct Tlistentry140022 Tlistentry140022;
typedef struct Tidtable224859 Tidtable224859;
typedef struct Tidpairseq224857 Tidpairseq224857;
typedef struct Tctx278048 Tctx278048;
typedef struct TY279143 TY279143;
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 Memregion30891 Memregion30891;
typedef struct Smallchunk30843 Smallchunk30843;
typedef struct Llchunk30885 Llchunk30885;
typedef struct Bigchunk30845 Bigchunk30845;
typedef struct Intset30817 Intset30817;
typedef struct Trunk30813 Trunk30813;
typedef struct Avlnode30889 Avlnode30889;
typedef struct Gcstat51014 Gcstat51014;
typedef struct Ttabiter232119 Ttabiter232119;
typedef struct Toverloaditer285431 Toverloaditer285431;
typedef struct Tidentiter232141 Tidentiter232141;
typedef struct Tinstantiation224831 Tinstantiation224831;
typedef struct Tidpair224855 Tidpair224855;
typedef struct TY278254 TY278254;
typedef struct TY190417 TY190417;
typedef struct PprocHEX3Aobjecttype278233 PprocHEX3Aobjecttype278233;
typedef struct TY278273 TY278273;
typedef struct Tinstantiationpair279013 Tinstantiationpair279013;
typedef struct Basechunk30841 Basechunk30841;
typedef struct Freecell30833 Freecell30833;
typedef struct TY224932 TY224932;
typedef struct TY278234 TY278234;
typedef struct TY278239 TY278239;
typedef struct TY278274 TY278274;
typedef struct Vmargs278042 Vmargs278042;
typedef struct Tblock278030 Tblock278030;
typedef struct TY278214 TY278214;
struct  Tlineinfo189352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tnode224809  {
Ttype224847* typ;
Tlineinfo189352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym224841* sym;
} S4;
struct {Tident197021* ident;
} S5;
struct {Tnodeseq224803* 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  Tidobj197015  {
  TNimObject Sup;
NI id;
};
struct  Tstrtable224813  {
NI counter;
Tsymseq224811* data;
};
struct  Tloc224823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype224847* t;
Ropeobj175009* r;
Ropeobj175009* heaproot;
};
struct  Tsym224841  {
  Tidobj197015 Sup;
NU8 kind;
union{
struct {Ttypeseq224843* typeinstcache;
Tscope224835* typscope;
} S1;
struct {TY224944* procinstcache;
Tsym224841* gcunsafetyreason;
} S2;
struct {TY224944* usedgenerics;
Tstrtable224813 tab;
} S3;
struct {Tsym224841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype224847* typ;
Tident197021* name;
Tlineinfo189352 info;
Tsym224841* owner;
NU32 flags;
Tnode224809* ast;
NU32 options;
NI position;
NI offset;
Tloc224823 loc;
Tlib224827* annex;
Tnode224809* constraint;
};
struct  Tident197021  {
  Tidobj197015 Sup;
NimStringDesc* s;
Tident197021* next;
NI h;
};
struct  Tscope224835  {
NI depthlevel;
Tstrtable224813 symbols;
Tnodeseq224803* usingsyms;
Tscope224835* parent;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Tpasscontext276005  {
  TNimObject Sup;
NIM_BOOL fromcache;
};
struct  Intset221056  {
NI counter;
NI max;
Trunk221052* head;
Trunkseq221054* data;
};
struct  Tlinkedlist140028  {
Tlistentry140022* head;
Tlistentry140022* tail;
NI counter;
};
struct  Tidtable224859  {
NI counter;
Tidpairseq224857* data;
};
typedef N_NIMCALL_PTR(Tnode224809*, TY279074) (Tcontext279023* c, Tnode224809* n);
typedef N_NIMCALL_PTR(Tnode224809*, TY279079) (Tcontext279023* c, Tnode224809* n, NU16 flags);
typedef N_NIMCALL_PTR(Tnode224809*, TY279087) (Tcontext279023* c, Tnode224809* n, NU16 flags);
typedef N_NIMCALL_PTR(Tnode224809*, TY279095) (Tcontext279023* c, Tnode224809* n);
typedef N_NIMCALL_PTR(Tnode224809*, TY279100) (Tcontext279023* c, Tnode224809* n, NU16 flags);
typedef N_NIMCALL_PTR(Tnode224809*, TY279108) (Tcontext279023* c, Tnode224809* n);
typedef N_NIMCALL_PTR(Tnode224809*, TY279113) (Tcontext279023* c, Tnode224809* n, Tnode224809* norig, NU32 filter);
typedef N_NIMCALL_PTR(Ttype224847*, TY279120) (Tcontext279023* c, Tnode224809* n, Ttype224847* prev);
typedef struct {
N_NIMCALL_PTR(Tnode224809*, ClPrc) (Tcontext279023* c, Tidtable224859 pt, Tnode224809* n, void* ClEnv);
void* ClEnv;
} TY279126;
typedef struct {
N_NIMCALL_PTR(Tsym224841*, ClPrc) (Tcontext279023* c, Tsym224841* fn, Tidtable224859 pt, Tlineinfo189352 info, void* ClEnv);
void* ClEnv;
} TY279132;
typedef N_NIMCALL_PTR(Tsym224841*, TY279148) (Tcontext279023* c, Tsym224841* dc, Ttype224847* t, Tlineinfo189352 info, NU8 op);
struct  Tcontext279023  {
  Tpasscontext276005 Sup;
Tsym224841* module;
Tscope224835* currentscope;
Tscope224835* importtable;
Tscope224835* toplevelscope;
Tproccon279011* p;
Tsymseq224811* friendmodules;
NI instcounter;
Intset221056 ambiguoussymbols;
NI intypeclass;
NI ingenericcontext;
NI inunrolledcontext;
NI compilescontextid;
NI compilescontextidgenerator;
NI ingenericinst;
Tsymseq224811* converters;
Tsymseq224811* patterns;
Tlinkedlist140028 optionstack;
Tidtable224859 symmapping;
Tlinkedlist140028 libs;
TY279074 semconstexpr;
TY279079 semexpr;
TY279087 semtryexpr;
TY279095 semtryconstexpr;
TY279100 semoperand;
TY279108 semconstboolexpr;
TY279113 semoverloadedcall;
TY279120 semtypenode;
TY279126 seminferredlambda;
TY279132 semgenerateinstance;
Intset221056 includedfiles;
Tstrtable224813 userpragmas;
Tctx278048* evalcontext;
Intset221056 unknownidents;
TY279143* generics;
NI lastgenericidx;
NI hloloopdetector;
NI inparallelstmt;
TY279148 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 Smallchunk30843* TY30906[512];
typedef Trunk30813* Trunkbuckets30815[256];
struct  Intset30817  {
Trunkbuckets30815 data;
};
struct  Memregion30891  {
NI minlargeobj;
NI maxlargeobj;
TY30906 freesmallchunks;
Llchunk30885* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk30845* freechunkslist;
Intset30817 chunkstarts;
Avlnode30889* root;
Avlnode30889* deleted;
Avlnode30889* last;
Avlnode30889* 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;
Memregion30891 region;
Gcstat51014 stat;
};
struct  Ttabiter232119  {
NI h;
};
struct  Ttype224847  {
  Tidobj197015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq224843* sons;
Tnode224809* n;
Tsym224841* owner;
Tsym224841* sym;
Tsym224841* destructor;
Tsym224841* deepcopy;
Tsym224841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc224823 loc;
};
struct  Tidentiter232141  {
NI h;
Tident197021* name;
};
struct  Toverloaditer285431  {
Tidentiter232141 it;
Tsym224841* m;
NU8 mode;
NI symchoiceindex;
Tscope224835* scope;
Intset221056 insymchoice;
};
struct  Ropeobj175009  {
  TNimObject Sup;
Ropeobj175009* left;
Ropeobj175009* right;
NI length;
NimStringDesc* data;
};
struct  Tlistentry140022  {
  TNimObject Sup;
Tlistentry140022* prev;
Tlistentry140022* next;
};
struct  Tlib224827  {
  Tlistentry140022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj175009* name;
Tnode224809* path;
};
struct  Tproccon279011  {
Tsym224841* owner;
Tsym224841* resultsym;
NI nestedloopcounter;
NI nestedblockcounter;
NI intrystmt;
Tproccon279011* next;
NIM_BOOL wasforwarded;
Tnode224809* bracketexpr;
};
typedef NI TY30822[8];
struct  Trunk221052  {
Trunk221052* next;
NI key;
TY30822 bits;
};
struct  Tidpair224855  {
Tidobj197015* key;
TNimObject* val;
};
struct  Tctx278048  {
  Tpasscontext276005 Sup;
TY278254* code;
TY190417* debug;
Tnode224809* globals;
Tnode224809* constants;
Ttypeseq224843* types;
Tnode224809* currentexceptiona;
Tnode224809* currentexceptionb;
NI exceptioninstr;
PprocHEX3Aobjecttype278233* prc;
Tsym224841* module;
Tnode224809* callsite;
NU8 mode;
NU8 features;
NIM_BOOL traceactive;
NI loopiterations;
Tlineinfo189352 comesfromheuristic;
TY278273* callbacks;
NimStringDesc* errorflag;
};
struct  Tinstantiationpair279013  {
Tsym224841* genericsym;
Tinstantiation224831* inst;
};
struct  Gcstack51016  {
Gcstack51016* prev;
Gcstack51016* next;
void* starts;
void* pos;
NI maxstacksize;
};
struct  Pagedesc48955  {
Pagedesc48955* next;
NI key;
TY30822 bits;
};
struct  Basechunk30841  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk30843  {
  Basechunk30841 Sup;
Smallchunk30843* next;
Smallchunk30843* prev;
Freecell30833* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk30885  {
NI size;
NI acc;
Llchunk30885* next;
};
struct  Bigchunk30845  {
  Basechunk30841 Sup;
Bigchunk30845* next;
Bigchunk30845* prev;
NI align;
NF data;
};
struct  Trunk30813  {
Trunk30813* next;
NI key;
TY30822 bits;
};
typedef Avlnode30889* TY30896[2];
struct  Avlnode30889  {
TY30896 link;
NI key;
NI upperbound;
NI level;
};
struct  Tinstantiation224831  {
Tsym224841* sym;
Ttypeseq224843* concretetypes;
TY224932* usedby;
NI compilesid;
};
struct TY278239 {
NIM_BOOL Field0;
NU8 Field1;
};
typedef TY278239 TY278242[256];
struct  PprocHEX3Aobjecttype278233  {
TY278234* blocks;
Tsym224841* sym;
TY278242 slots;
NI maxslots;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (Vmargs278042* args, void* ClEnv);
void* ClEnv;
} Vmcallback278044;
struct TY278274 {
NimStringDesc* Field0;
Vmcallback278044 Field1;
};
struct  Freecell30833  {
Freecell30833* next;
NI zerofield;
};
struct  Tblock278030  {
Tsym224841* label;
TY278214* fixups;
};
struct  Vmargs278042  {
NI ra;
NI rb;
NI rc;
void* slots;
Tnode224809* currentexception;
};
struct Tnodeseq224803 {
  TGenericSeq Sup;
  Tnode224809* data[SEQ_DECL_SIZE];
};
struct Ttypeseq224843 {
  TGenericSeq Sup;
  Ttype224847* data[SEQ_DECL_SIZE];
};
struct TY224944 {
  TGenericSeq Sup;
  Tinstantiation224831* data[SEQ_DECL_SIZE];
};
struct Tsymseq224811 {
  TGenericSeq Sup;
  Tsym224841* data[SEQ_DECL_SIZE];
};
struct Trunkseq221054 {
  TGenericSeq Sup;
  Trunk221052* data[SEQ_DECL_SIZE];
};
struct Tidpairseq224857 {
  TGenericSeq Sup;
  Tidpair224855 data[SEQ_DECL_SIZE];
};
struct TY279143 {
  TGenericSeq Sup;
  Tinstantiationpair279013 data[SEQ_DECL_SIZE];
};
struct TY278254 {
  TGenericSeq Sup;
  NU32 data[SEQ_DECL_SIZE];
};
struct TY190417 {
  TGenericSeq Sup;
  Tlineinfo189352 data[SEQ_DECL_SIZE];
};
struct TY278273 {
  TGenericSeq Sup;
  TY278274 data[SEQ_DECL_SIZE];
};
struct TY224932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct TY278234 {
  TGenericSeq Sup;
  Tblock278030 data[SEQ_DECL_SIZE];
};
struct TY278214 {
  TGenericSeq Sup;
  NI data[SEQ_DECL_SIZE];
};
static N_INLINE(NI, len_225098)(Tnode224809* n);
N_NIMCALL(void, localerror_195128)(Tlineinfo189352 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, rendertree_246059)(Tnode224809* n, NU8 renderflags);
N_NIMCALL(Tident197021*, getident_197463)(NimStringDesc* identifier);
N_NIMCALL(Tident197021*, considerquotedident_285010)(Tnode224809* 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_228027)(Tstrtable224813* Result);
static N_INLINE(NI, scopedepth_279235)(Tcontext279023* c);
N_NIMCALL(NIM_BOOL, adduniquesym_285079)(Tscope224835* scope, Tsym224841* s);
N_NIMCALL(NIM_BOOL, strtableincl_236607)(Tstrtable224813* t, Tsym224841* n);
N_NIMCALL(void, wrongredefinition_285588)(Tlineinfo189352 info, NimStringDesc* s);
N_NIMCALL(void, ensurenomissingorunusedsymbols_285004)(Tscope224835* scope);
N_NIMCALL(Tsym224841*, inittabiter_232124)(Ttabiter232119* ti, Tstrtable224813 tab);
N_NIMCALL(NimStringDesc*, getsymrepr_285447)(Tsym224841* s);
N_NIMCALL(NimStringDesc*, getprocheader_254447)(Tsym224841* sym, NU8 prefer);
N_NIMCALL(void, message_195161)(Tlineinfo189352 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(Tsym224841*, nextiter_232132)(Ttabiter232119* ti, Tstrtable224813 tab);
N_NIMCALL(void, rawclosescope_285102)(Tcontext279023* c);
N_NIMCALL(Tsym224841*, skipalias_285150)(Tsym224841* s, Tnode224809* n);
N_NIMCALL(void, replacedeprecated_284276)(Tlineinfo189352 info, Tsym224841* oldsym, Tsym224841* newsym);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(Tsym224841*, searchinscopes_285205)(Tcontext279023* c, Tident197021* s);
N_NIMCALL(Tsym224841*, strtableget_232111)(Tstrtable224813 t, Tident197021* name);
N_NIMCALL(Tsym224841*, errorsym_285372)(Tcontext279023* c, Tnode224809* n);
N_NIMCALL(Tsym224841*, newsym_225655)(NU8 symkind, Tident197021* name, Tsym224841* owner, Tlineinfo189352 info);
N_NIMCALL(Tsym224841*, getcurrowner_279257)(void);
N_NIMCALL(Ttype224847*, errortype_280161)(Tcontext279023* c);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(void, strtableadd_232103)(Tstrtable224813* t, Tsym224841* n);
N_NIMCALL(void, internalerror_195172)(Tlineinfo189352 info, NimStringDesc* errmsg);
N_NIMCALL(NIM_BOOL, contains_221829)(Intset221056* s, NI key);
N_NIMCALL(void, loadstub_270052)(Tsym224841* s);
N_NIMCALL(Tsym224841*, qualifiedlookup_285864)(Tcontext279023* c, Tnode224809* n, NU8 flags);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(Tsym224841*, initidentiter_232147)(Tidentiter232141* ti, Tstrtable224813 tab, Tident197021* s);
N_NIMCALL(void, initintset_221927)(Intset221056* Result);
N_NIMCALL(void, incl_221856)(Intset221056* s, NI key);
N_NIMCALL(Tsym224841*, nextidentiter_232156)(Tidentiter232141* ti, Tstrtable224813 tab);
N_NIMCALL(NI, sonslen_227387)(Tnode224809* n);
N_NIMCALL(Tsym224841*, firstidentexcluding_237154)(Tidentiter232141* ti, Tstrtable224813 tab, Tident197021* s, Intset221056* excluding);
N_NIMCALL(Tsym224841*, nextidentexcluding_237104)(Tidentiter232141* ti, Tstrtable224813 tab, Intset221056* excluding);
N_NIMCALL(void, adddecl_285607)(Tcontext279023* c, Tsym224841* sym);
N_NIMCALL(void, addinterfacedeclaux_285641)(Tcontext279023* c, Tsym224841* sym);
N_NIMCALL(void, addoverloadablesymat_285688)(Tscope224835* scope, Tsym224841* fn);
N_NIMCALL(void, adddeclat_285629)(Tscope224835* scope, Tsym224841* sym);
STRING_LITERAL(TMP2734, "<Error>", 7);
STRING_LITERAL(TMP2735, "", 0);
STRING_LITERAL(TMP2801, "use ", 4);
STRING_LITERAL(TMP2802, " instead; ", 10);
STRING_LITERAL(TMP2803, "err:", 4);
STRING_LITERAL(TMP2804, "lookUp", 6);
STRING_LITERAL(TMP3220, "addInterfaceDeclAux", 19);
STRING_LITERAL(TMP3291, "addOverloadableSymAt", 20);
extern TNimType NTI224837; /* PScope */
extern Gcheap51018 gch_51059;
extern NU8 gcmd_166134;

static N_INLINE(NI, len_225098)(Tnode224809* 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(Tident197021*, considerquotedident_285010)(Tnode224809* n) {
	Tident197021* 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_225098(n);
		switch (LOC4) {
		case ((NI) 0):
		{
			NimStringDesc* LOC6;
			LOC6 = 0;
			LOC6 = rendertree_246059(n, 0);
			localerror_195128((*n).info, ((NU16) 20), LOC6);
			result = getident_197463(((NimStringDesc*) &TMP2734));
		}
		break;
		case ((NI) 1):
		{
			result = considerquotedident_285010((*n).kindU.S6.sons->data[((NI) 0)]);
		}
		break;
		default:
		{
			NimStringDesc* id;
			id = copyString(((NimStringDesc*) &TMP2735));
			{
				NI i_285039;
				NI HEX3Atmp_285049;
				NI LOC10;
				NI res_285052;
				i_285039 = 0;
				HEX3Atmp_285049 = 0;
				LOC10 = 0;
				LOC10 = len_225098(n);
				HEX3Atmp_285049 = (LOC10 - 1);
				res_285052 = ((NI) 0);
				{
					while (1) {
						Tnode224809* x;
						if (!(res_285052 <= HEX3Atmp_285049)) goto LA12;
						i_285039 = res_285052;
						x = (*n).kindU.S6.sons->data[i_285039];
						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_246059(n, 0);
							localerror_195128((*n).info, ((NU16) 20), LOC16);
							result = getident_197463(((NimStringDesc*) &TMP2734));
							goto BeforeRet;
						}
						break;
						}
						res_285052 += ((NI) 1);
					} LA12: ;
				}
			}
			result = getident_197463(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_246059(n, 0);
		localerror_195128((*n).info, ((NU16) 20), LOC19);
		result = getident_197463(((NimStringDesc*) &TMP2734));
	}
	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)((NU64)((*c).refcount) + (NU64)(((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)((NU64)(((NI) (usr))) - (NU64)(((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 (!((NU64)((*c).refcount) < (NU64)(((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_279235)(Tcontext279023* 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(Tscope224835*, openscope_285091)(Tcontext279023* c) {
	Tscope224835* result;
	Tscope224835* LOC1;
	NI LOC2;
	result = 0;
	LOC1 = 0;
	LOC1 = (Tscope224835*) newObj((&NTI224837), sizeof(Tscope224835));
	asgnRef((void**) (&(*LOC1).parent), (*c).currentscope);
	newstrtable_228027((&(*LOC1).symbols));
	LOC2 = 0;
	LOC2 = scopedepth_279235(c);
	(*LOC1).depthlevel = (NI)(LOC2 + ((NI) 1));
	result = LOC1;
	asgnRef((void**) (&(*c).currentscope), result);
	return result;
}

N_NIMCALL(NIM_BOOL, adduniquesym_285079)(Tscope224835* scope, Tsym224841* s) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = strtableincl_236607((&(*scope).symbols), s);
	result = !(LOC1);
	return result;
}

N_NIMCALL(void, wrongredefinition_285588)(Tlineinfo189352 info, NimStringDesc* s) {
	{
		if (!!((gcmd_166134 == ((NU8) 18)))) goto LA3;
		localerror_195128(info, ((NU16) 41), s);
	}
	LA3: ;
}

N_NIMCALL(void, adddecl_285607)(Tcontext279023* c, Tsym224841* sym) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = adduniquesym_285079((*c).currentscope, sym);
		if (!!(LOC3)) goto LA4;
		wrongredefinition_285588((*sym).info, (*(*sym).name).s);
	}
	LA4: ;
}

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

N_NIMCALL(void, ensurenomissingorunusedsymbols_285004)(Tscope224835* scope) {
	Ttabiter232119 it;
	Tsym224841* s;
	NI missingimpls;
	memset((void*)(&it), 0, sizeof(it));
	s = inittabiter_232124((&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_285447(s);
					localerror_195128((*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_285447(s);
						message_195161((*s).info, ((NU16) 271), LOC27);
					}
					LA25: ;
				}
				LA19: ;
			}
			goto LA3;
			LA15: ;
			LA3: ;
			s = nextiter_232132((&it), (*scope).symbols);
		} LA2: ;
	}
}

N_NIMCALL(void, rawclosescope_285102)(Tcontext279023* c) {
	asgnRef((void**) (&(*c).currentscope), (*(*c).currentscope).parent);
}

N_NIMCALL(void, closescope_285111)(Tcontext279023* c) {
	ensurenomissingorunusedsymbols_285004((*c).currentscope);
	rawclosescope_285102(c);
}

N_NIMCALL(Tsym224841*, skipalias_285150)(Tsym224841* s, Tnode224809* n) {
	Tsym224841* 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_166134 == ((NU8) 7))) goto LA10;
			replacedeprecated_284276((*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*) &TMP2801));
appendString(LOC13, (*(*result).name).s);
appendString(LOC13, ((NimStringDesc*) &TMP2802));
appendString(LOC13, (*(*s).name).s);
			message_195161((*n).info, ((NU16) 241), LOC13);
		}
		LA8: ;
	}
	LA1: ;
	return result;
}

N_NIMCALL(Tsym224841*, searchinscopes_285205)(Tcontext279023* c, Tident197021* s) {
	Tsym224841* result;
{	result = 0;
	{
		Tscope224835* scope_285210;
		Tscope224835* HEX3Atmp_285224;
		Tscope224835* current_285227;
		scope_285210 = 0;
		HEX3Atmp_285224 = 0;
		HEX3Atmp_285224 = (*c).currentscope;
		current_285227 = HEX3Atmp_285224;
		{
			while (1) {
				if (!!((current_285227 == NIM_NIL))) goto LA3;
				scope_285210 = current_285227;
				result = strtableget_232111((*scope_285210).symbols, s);
				{
					if (!!((result == NIM_NIL))) goto LA6;
					goto BeforeRet;
				}
				LA6: ;
				current_285227 = (*current_285227).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 (!((NU64)((*c).refcount) < (NU64)(((NI) 8)))) goto LA11;
			rtladdzct_54204(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

N_NIMCALL(Tsym224841*, errorsym_285372)(Tcontext279023* c, Tnode224809* n) {
	Tsym224841* result;
	Tnode224809* m;
	Tident197021* ident;
	Tsym224841* 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_285010(m);
	}
	goto LA5;
	LA7: ;
	{
		NimStringDesc* LOC10;
		NimStringDesc* LOC11;
		LOC10 = 0;
		LOC11 = 0;
		LOC11 = rendertree_246059(m, 0);
		LOC10 = rawNewString(LOC11->Sup.len + 4);
appendString(LOC10, ((NimStringDesc*) &TMP2803));
appendString(LOC10, LOC11);
		ident = getident_197463(LOC10);
	}
	LA5: ;
	LOC12 = 0;
	LOC12 = getcurrowner_279257();
	result = newsym_225655(((NU8) 0), ident, LOC12, (*n).info);
	asgnRefNoCycle((void**) (&(*result).typ), errortype_280161(c));
	(*result).flags |= ((NU32)1)<<((((NU8) 29))%(sizeof(NU32)*8));
	{
		NIM_BOOL LOC15;
		LOC15 = 0;
		LOC15 = !((gcmd_166134 == ((NU8) 18)));
		if (!(LOC15)) goto LA16;
		LOC15 = ((*c).compilescontextid == ((NI) 0));
		LA16: ;
		if (!LOC15) goto LA17;
		strtableadd_232103((&(*(*c).importtable).symbols), result);
	}
	LA17: ;
	return result;
}

N_NIMCALL(Tsym224841*, lookup_285804)(Tcontext279023* c, Tnode224809* n) {
	Tsym224841* result;
{	result = 0;
	switch ((*n).kind) {
	case ((NU8) 2):
	{
		Tsym224841* LOC2;
		LOC2 = 0;
		LOC2 = searchinscopes_285205(c, (*n).kindU.S5.ident);
		result = skipalias_285150(LOC2, n);
		{
			if (!(result == NIM_NIL)) goto LA5;
			localerror_195128((*n).info, ((NU16) 63), (*(*n).kindU.S5.ident).s);
			result = errorsym_285372(c, n);
		}
		LA5: ;
	}
	break;
	case ((NU8) 3):
	{
		result = (*n).kindU.S4.sym;
	}
	break;
	case ((NU8) 53):
	{
		Tident197021* ident;
		Tsym224841* LOC9;
		ident = considerquotedident_285010(n);
		LOC9 = 0;
		LOC9 = searchinscopes_285205(c, ident);
		result = skipalias_285150(LOC9, n);
		{
			if (!(result == NIM_NIL)) goto LA12;
			localerror_195128((*n).info, ((NU16) 63), (*ident).s);
			result = errorsym_285372(c, n);
		}
		LA12: ;
	}
	break;
	default:
	{
		internalerror_195172((*n).info, ((NimStringDesc*) &TMP2804));
		goto BeforeRet;
	}
	break;
	}
	{
		NIM_BOOL LOC17;
		LOC17 = 0;
		LOC17 = contains_221829((&(*c).ambiguoussymbols), (*result).Sup.id);
		if (!LOC17) goto LA18;
		localerror_195128((*n).info, ((NU16) 66), (*(*result).name).s);
	}
	LA18: ;
	{
		if (!((*result).kind == ((NU8) 23))) goto LA22;
		loadstub_270052(result);
	}
	LA22: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tsym224841*, qualifiedlookup_285864)(Tcontext279023* c, Tnode224809* n, NU8 flags) {
	Tsym224841* result;
	result = 0;
	switch ((*n).kind) {
	case ((NU8) 2):
	case ((NU8) 53):
	{
		Tident197021* ident;
		Tsym224841* LOC2;
		ident = considerquotedident_285010(n);
		LOC2 = 0;
		LOC2 = searchinscopes_285205(c, ident);
		result = skipalias_285150(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_195128((*n).info, ((NU16) 63), (*ident).s);
			result = errorsym_285372(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_221829((&(*c).ambiguoussymbols), (*result).Sup.id);
			LA13: ;
			if (!LOC10) goto LA14;
			localerror_195128((*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_221829((&(*c).ambiguoussymbols), (*result).Sup.id);
			LA20: ;
			if (!LOC19) goto LA21;
			localerror_195128((*n).info, ((NU16) 66), (*(*(*n).kindU.S4.sym).name).s);
		}
		LA21: ;
	}
	break;
	case ((NU8) 45):
	{
		Tsym224841* m;
		result = NIM_NIL;
		m = qualifiedlookup_285864(c, (*n).kindU.S6.sons->data[((NI) 0)], (flags & 2));
		{
			NIM_BOOL LOC26;
			Tident197021* 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_285010((*n).kindU.S6.sons->data[((NI) 1)]);
			}
			goto LA30;
			LA35: ;
			LA30: ;
			{
				if (!!((ident == NIM_NIL))) goto LA39;
				{
					Tsym224841* LOC45;
					if (!(m == (*c).module)) goto LA43;
					LOC45 = 0;
					LOC45 = strtableget_232111((*(*c).toplevelscope).symbols, ident);
					result = skipalias_285150(LOC45, n);
				}
				goto LA41;
				LA43: ;
				{
					Tsym224841* LOC47;
					LOC47 = 0;
					LOC47 = strtableget_232111((*m).kindU.S3.tab, ident);
					result = skipalias_285150(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_195128((*(*n).kindU.S6.sons->data[((NI) 1)]).info, ((NU16) 63), (*ident).s);
					result = errorsym_285372(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_246059((*n).kindU.S6.sons->data[((NI) 1)], 0);
				localerror_195128((*(*n).kindU.S6.sons->data[((NI) 1)]).info, ((NU16) 20), LOC62);
				result = errorsym_285372(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_270052(result);
	}
	LA68: ;
	return result;
}

N_NIMCALL(Tsym224841*, initoverloaditer_286108)(Toverloaditer285431* o, Tcontext279023* c, Tnode224809* n) {
	Tsym224841* result;
	result = 0;
	switch ((*n).kind) {
	case ((NU8) 2):
	case ((NU8) 53):
	{
		Tident197021* ident;
		ident = considerquotedident_285010(n);
		unsureAsgnRef((void**) (&(*o).scope), (*c).currentscope);
		(*o).mode = ((NU8) 1);
		{
			while (1) {
				Tsym224841* LOC4;
				LOC4 = 0;
				LOC4 = initidentiter_232147((&(*o).it), (*(*o).scope).symbols, ident);
				result = skipalias_285150(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_285864(c, (*n).kindU.S6.sons->data[((NI) 0)], 2));
		{
			NIM_BOOL LOC18;
			Tident197021* 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_285010((*n).kindU.S6.sons->data[((NI) 1)]);
			}
			goto LA22;
			LA27: ;
			LA22: ;
			{
				if (!!((ident == NIM_NIL))) goto LA31;
				{
					Tsym224841* LOC37;
					if (!((*o).m == (*c).module)) goto LA35;
					LOC37 = 0;
					LOC37 = initidentiter_232147((&(*o).it), (*(*c).toplevelscope).symbols, ident);
					result = skipalias_285150(LOC37, n);
					(*o).mode = ((NU8) 2);
				}
				goto LA33;
				LA35: ;
				{
					Tsym224841* LOC39;
					LOC39 = 0;
					LOC39 = initidentiter_232147((&(*o).it), (*(*o).m).kindU.S3.tab, ident);
					result = skipalias_285150(LOC39, n);
				}
				LA33: ;
			}
			goto LA29;
			LA31: ;
			{
				NimStringDesc* LOC41;
				LOC41 = 0;
				LOC41 = rendertree_246059((*n).kindU.S6.sons->data[((NI) 1)], 0);
				localerror_195128((*(*n).kindU.S6.sons->data[((NI) 1)]).info, ((NU16) 20), LOC41);
				result = errorsym_285372(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_221927((&(*o).insymchoice));
		incl_221856((&(*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_270052(result);
	}
	LA48: ;
	return result;
}

N_NIMCALL(Tsym224841*, nextoverloaditer_286277)(Toverloaditer285431* o, Tcontext279023* c, Tnode224809* n) {
	Tsym224841* result;
	result = 0;
	switch ((*o).mode) {
	case ((NU8) 0):
	{
		result = NIM_NIL;
	}
	break;
	case ((NU8) 1):
	{
		{
			Tsym224841* LOC7;
			if (!!(((*o).scope == NIM_NIL))) goto LA5;
			LOC7 = 0;
			LOC7 = nextidentiter_232156((&(*o).it), (*(*o).scope).symbols);
			result = skipalias_285150(LOC7, n);
			{
				while (1) {
					Tsym224841* 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_232147((&(*o).it), (*(*o).scope).symbols, (*o).it.name);
					result = skipalias_285150(LOC14, n);
				} LA9: ;
			} LA8: ;
		}
		goto LA3;
		LA5: ;
		{
			result = NIM_NIL;
		}
		LA3: ;
	}
	break;
	case ((NU8) 2):
	{
		Tsym224841* LOC17;
		LOC17 = 0;
		LOC17 = nextidentiter_232156((&(*o).it), (*(*c).toplevelscope).symbols);
		result = skipalias_285150(LOC17, n);
	}
	break;
	case ((NU8) 3):
	{
		Tsym224841* LOC19;
		LOC19 = 0;
		LOC19 = nextidentiter_232156((&(*o).it), (*(*o).m).kindU.S3.tab);
		result = skipalias_285150(LOC19, n);
	}
	break;
	case ((NU8) 4):
	{
		{
			NI LOC23;
			LOC23 = 0;
			LOC23 = sonslen_227387(n);
			if (!((*o).symchoiceindex < LOC23)) goto LA24;
			result = (*(*n).kindU.S6.sons->data[(*o).symchoiceindex]).kindU.S4.sym;
			incl_221856((&(*o).insymchoice), (*result).Sup.id);
			(*o).symchoiceindex += ((NI) 1);
		}
		goto LA21;
		LA24: ;
		{
			Tsym224841* LOC29;
			if (!((*n).kind == ((NU8) 57))) goto LA27;
			(*o).mode = ((NU8) 5);
			unsureAsgnRef((void**) (&(*o).scope), (*c).currentscope);
			LOC29 = 0;
			LOC29 = firstidentexcluding_237154((&(*o).it), (*(*o).scope).symbols, (*(*(*n).kindU.S6.sons->data[((NI) 0)]).kindU.S4.sym).name, (&(*o).insymchoice));
			result = skipalias_285150(LOC29, n);
			{
				while (1) {
					Tsym224841* 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_237154((&(*o).it), (*(*o).scope).symbols, (*(*(*n).kindU.S6.sons->data[((NI) 0)]).kindU.S4.sym).name, (&(*o).insymchoice));
					result = skipalias_285150(LOC36, n);
				} LA31: ;
			} LA30: ;
		}
		goto LA21;
		LA27: ;
		LA21: ;
	}
	break;
	case ((NU8) 5):
	{
		Tsym224841* LOC38;
		LOC38 = 0;
		LOC38 = nextidentexcluding_237104((&(*o).it), (*(*o).scope).symbols, (&(*o).insymchoice));
		result = skipalias_285150(LOC38, n);
		{
			while (1) {
				Tsym224841* 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_237154((&(*o).it), (*(*o).scope).symbols, (*(*(*n).kindU.S6.sons->data[((NI) 0)]).kindU.S4.sym).name, (&(*o).insymchoice));
				result = skipalias_285150(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_270052(result);
	}
	LA50: ;
	return result;
}

N_NIMCALL(void, addprelimdecl_285619)(Tcontext279023* c, Tsym224841* sym) {
	NIM_BOOL LOC1;
	LOC1 = 0;
	LOC1 = adduniquesym_285079((*c).currentscope, sym);
}

N_NIMCALL(void, addinterfacedeclaux_285641)(Tcontext279023* c, Tsym224841* sym) {
	{
		if (!(((*sym).flags &(1<<((((NU8) 1))&31)))!=0)) goto LA3;
		{
			if (!!(((*c).module == NIM_NIL))) goto LA7;
			strtableadd_232103((&(*(*c).module).kindU.S3.tab), sym);
		}
		goto LA5;
		LA7: ;
		{
			internalerror_195172((*sym).info, ((NimStringDesc*) &TMP3220));
		}
		LA5: ;
	}
	LA3: ;
}

N_NIMCALL(void, addinterfacedecl_285736)(Tcontext279023* c, Tsym224841* sym) {
	adddecl_285607(c, sym);
	addinterfacedeclaux_285641(c, sym);
}

N_NIMCALL(NI, lastoverloadscope_286259)(Toverloaditer285431* 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(Tsym224841*, searchinscopes_285323)(Tcontext279023* c, Tident197021* s, NU32 filter) {
	Tsym224841* result;
{	result = 0;
	{
		Tscope224835* scope_285329;
		Tscope224835* HEX3Atmp_285353;
		Tscope224835* current_285356;
		scope_285329 = 0;
		HEX3Atmp_285353 = 0;
		HEX3Atmp_285353 = (*c).currentscope;
		current_285356 = HEX3Atmp_285353;
		{
			while (1) {
				if (!!((current_285356 == NIM_NIL))) goto LA3;
				scope_285329 = current_285356;
				result = strtableget_232111((*scope_285329).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_285356 = (*current_285356).parent;
			} LA3: ;
		}
	}
	result = NIM_NIL;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, addoverloadablesymat_285688)(Tscope224835* scope, Tsym224841* fn) {
	Tsym224841* check;
{	{
		if (!!(((520256 &(1<<(((*fn).kind)&31)))!=0))) goto LA3;
		internalerror_195172((*fn).info, ((NimStringDesc*) &TMP3291));
		goto BeforeRet;
	}
	LA3: ;
	check = strtableget_232111((*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_285588((*fn).info, (*(*fn).name).s);
	}
	goto LA5;
	LA9: ;
	{
		strtableadd_232103((&(*scope).symbols), fn);
	}
	LA5: ;
	}BeforeRet: ;
}

N_NIMCALL(void, addinterfaceoverloadablesymat_285746)(Tcontext279023* c, Tscope224835* scope, Tsym224841* sym) {
	addoverloadablesymat_285688(scope, sym);
	addinterfacedeclaux_285641(c, sym);
}

N_NIMCALL(void, adddeclat_285629)(Tscope224835* scope, Tsym224841* sym) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = adduniquesym_285079(scope, sym);
		if (!!(LOC3)) goto LA4;
		wrongredefinition_285588((*sym).info, (*(*sym).name).s);
	}
	LA4: ;
}

N_NIMCALL(void, addinterfacedeclat_285677)(Tcontext279023* c, Tscope224835* scope, Tsym224841* sym) {
	adddeclat_285629(scope, sym);
	addinterfacedeclaux_285641(c, sym);
}

N_NIMCALL(Tsym224841*, localsearchinscope_285194)(Tcontext279023* c, Tident197021* s) {
	Tsym224841* result;
	result = 0;
	result = strtableget_232111((*(*c).currentscope).symbols, s);
	return result;
}
NIM_EXTERNC N_NOINLINE(void, compiler_lookupsInit000)(void) {
}

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

