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

#include "nimbase.h"
#include <string.h>
typedef struct Tiitable221163 Tiitable221163;
typedef struct Tiipairseq221161 Tiipairseq221161;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Tiipair221159 Tiipair221159;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tsym214822 Tsym214822;
typedef struct Ttabiter221071 Ttabiter221071;
typedef struct Tstrtable214794 Tstrtable214794;
typedef struct Tsymseq214792 Tsymseq214792;
typedef struct Tident189012 Tident189012;
typedef struct Tidobj189006 Tidobj189006;
typedef struct TNimObject TNimObject;
typedef struct NimStringDesc NimStringDesc;
typedef struct Ttypeseq214824 Ttypeseq214824;
typedef struct Tscope214816 Tscope214816;
typedef struct TY214925 TY214925;
typedef struct Ttype214828 Ttype214828;
typedef struct Tlineinfo182337 Tlineinfo182337;
typedef struct Tnode214790 Tnode214790;
typedef struct Tloc214804 Tloc214804;
typedef struct Ropeobj169006 Ropeobj169006;
typedef struct Tlib214808 Tlib214808;
typedef struct Tidtable214840 Tidtable214840;
typedef struct Tidpairseq214838 Tidpairseq214838;
typedef struct Tidpair214836 Tidpair214836;
typedef struct Cell47505 Cell47505;
typedef struct Cellset47517 Cellset47517;
typedef struct Gcheap49818 Gcheap49818;
typedef struct Gcstack49816 Gcstack49816;
typedef struct Cellseq47521 Cellseq47521;
typedef struct Pagedesc47513 Pagedesc47513;
typedef struct Memregion29688 Memregion29688;
typedef struct Smallchunk29640 Smallchunk29640;
typedef struct Llchunk29682 Llchunk29682;
typedef struct Bigchunk29642 Bigchunk29642;
typedef struct Intset29614 Intset29614;
typedef struct Trunk29610 Trunk29610;
typedef struct Avlnode29686 Avlnode29686;
typedef struct Gcstat49814 Gcstat49814;
typedef struct Tnodeseq214784 Tnodeseq214784;
typedef struct Tidentiter221084 Tidentiter221084;
typedef struct Intset211035 Intset211035;
typedef struct Tidnodetable214846 Tidnodetable214846;
typedef struct Tidnodepairseq214844 Tidnodepairseq214844;
typedef struct Tidnodepair214842 Tidnodepair214842;
typedef struct Tinstantiation214812 Tinstantiation214812;
typedef struct Tlistentry135010 Tlistentry135010;
typedef struct Basechunk29638 Basechunk29638;
typedef struct Freecell29630 Freecell29630;
typedef struct Trunk211031 Trunk211031;
typedef struct Trunkseq211033 Trunkseq211033;
typedef struct TY214913 TY214913;
struct  Tiitable221163  {
NI counter;
Tiipairseq221161* data;
};
typedef N_NIMCALL_PTR(void, TY3489) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3494) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3489 marker;
TY3494 deepcopy;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Tiipair221159  {
NI key;
NI val;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  Tstrtable214794  {
NI counter;
Tsymseq214792* data;
};
struct  Ttabiter221071  {
NI h;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Tidobj189006  {
  TNimObject Sup;
NI id;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tident189012  {
  Tidobj189006 Sup;
NimStringDesc* s;
Tident189012* next;
NI h;
};
struct  Tlineinfo182337  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tloc214804  {
NU8 k;
NU8 s;
NU16 flags;
Ttype214828* t;
Ropeobj169006* r;
Ropeobj169006* heaproot;
};
struct  Tsym214822  {
  Tidobj189006 Sup;
NU8 kind;
union{
struct {Ttypeseq214824* typeinstcache;
Tscope214816* typscope;
} S1;
struct {TY214925* procinstcache;
Tsym214822* gcunsafetyreason;
} S2;
struct {TY214925* usedgenerics;
Tstrtable214794 tab;
} S3;
struct {Tsym214822* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype214828* typ;
Tident189012* name;
Tlineinfo182337 info;
Tsym214822* owner;
NU32 flags;
Tnode214790* ast;
NU32 options;
NI position;
NI offset;
Tloc214804 loc;
Tlib214808* annex;
Tnode214790* constraint;
};
struct  Tidtable214840  {
NI counter;
Tidpairseq214838* data;
};
struct  Tidpair214836  {
Tidobj189006* key;
TNimObject* val;
};
struct  Cell47505  {
NI refcount;
TNimType* typ;
};
struct  Cellseq47521  {
NI len;
NI cap;
Cell47505** d;
};
struct  Cellset47517  {
NI counter;
NI max;
Pagedesc47513* head;
Pagedesc47513** data;
};
typedef Smallchunk29640* TY29703[512];
typedef Trunk29610* Trunkbuckets29612[256];
struct  Intset29614  {
Trunkbuckets29612 data;
};
struct  Memregion29688  {
NI minlargeobj;
NI maxlargeobj;
TY29703 freesmallchunks;
Llchunk29682* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk29642* freechunkslist;
Intset29614 chunkstarts;
Avlnode29686* root;
Avlnode29686* deleted;
Avlnode29686* last;
Avlnode29686* freeavlnodes;
};
struct  Gcstat49814  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap49818  {
Gcstack49816* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq47521 zct;
Cellseq47521 decstack;
Cellset47517 cycleroots;
Cellseq47521 tempstack;
NI recgclock;
Memregion29688 region;
Gcstat49814 stat;
};
struct  Tnode214790  {
Ttype214828* typ;
Tlineinfo182337 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym214822* sym;
} S4;
struct {Tident189012* ident;
} S5;
struct {Tnodeseq214784* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Tidentiter221084  {
NI h;
Tident189012* name;
};
struct  Tidnodetable214846  {
NI counter;
Tidnodepairseq214844* data;
};
struct  Tidnodepair214842  {
Tidobj189006* key;
Tnode214790* val;
};
struct  Tscope214816  {
NI depthlevel;
Tstrtable214794 symbols;
Tnodeseq214784* usingsyms;
Tscope214816* parent;
};
struct  Ttype214828  {
  Tidobj189006 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq214824* sons;
Tnode214790* n;
Tsym214822* owner;
Tsym214822* sym;
Tsym214822* destructor;
Tsym214822* deepcopy;
Tsym214822* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc214804 loc;
};
struct  Ropeobj169006  {
  TNimObject Sup;
Ropeobj169006* left;
Ropeobj169006* right;
NI length;
NimStringDesc* data;
};
struct  Tlistentry135010  {
  TNimObject Sup;
Tlistentry135010* prev;
Tlistentry135010* next;
};
struct  Tlib214808  {
  Tlistentry135010 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj169006* name;
Tnode214790* path;
};
struct  Gcstack49816  {
Gcstack49816* prev;
Gcstack49816* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY29619[8];
struct  Pagedesc47513  {
Pagedesc47513* next;
NI key;
TY29619 bits;
};
struct  Basechunk29638  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk29640  {
  Basechunk29638 Sup;
Smallchunk29640* next;
Smallchunk29640* prev;
Freecell29630* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk29682  {
NI size;
NI acc;
Llchunk29682* next;
};
struct  Bigchunk29642  {
  Basechunk29638 Sup;
Bigchunk29642* next;
Bigchunk29642* prev;
NI align;
NF data;
};
struct  Trunk29610  {
Trunk29610* next;
NI key;
TY29619 bits;
};
typedef Avlnode29686* TY29693[2];
struct  Avlnode29686  {
TY29693 link;
NI key;
NI upperbound;
NI level;
};
struct  Intset211035  {
NI counter;
NI max;
Trunk211031* head;
Trunkseq211033* data;
};
struct  Tinstantiation214812  {
Tsym214822* sym;
Ttypeseq214824* concretetypes;
TY214913* usedby;
NI compilesid;
};
struct  Freecell29630  {
Freecell29630* next;
NI zerofield;
};
struct  Trunk211031  {
Trunk211031* next;
NI key;
TY29619 bits;
};
struct Tiipairseq221161 {
  TGenericSeq Sup;
  Tiipair221159 data[SEQ_DECL_SIZE];
};
struct Tidpairseq214838 {
  TGenericSeq Sup;
  Tidpair214836 data[SEQ_DECL_SIZE];
};
struct Tsymseq214792 {
  TGenericSeq Sup;
  Tsym214822* data[SEQ_DECL_SIZE];
};
struct Tidnodepairseq214844 {
  TGenericSeq Sup;
  Tidnodepair214842 data[SEQ_DECL_SIZE];
};
struct Ttypeseq214824 {
  TGenericSeq Sup;
  Ttype214828* data[SEQ_DECL_SIZE];
};
struct TY214925 {
  TGenericSeq Sup;
  Tinstantiation214812* data[SEQ_DECL_SIZE];
};
struct Tnodeseq214784 {
  TGenericSeq Sup;
  Tnode214790* data[SEQ_DECL_SIZE];
};
struct Trunkseq211033 {
  TGenericSeq Sup;
  Trunk211031* data[SEQ_DECL_SIZE];
};
struct TY214913 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, TMP908)(void* p, NI op);
N_NIMCALL(Tsym214822*, nextiter_221078)(Ttabiter221071* ti, Tstrtable214794 tab);
static N_INLINE(NI, nexttry_221151)(NI h, NI maxhash);
N_NIMCALL(NI, iitablerawget_227162)(Tiitable221163 t, NI key);
N_NIMCALL(NI, idtablerawget_225599)(Tidtable214840 t, NI key);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incref_53819)(Cell47505* c);
static N_INLINE(NIM_BOOL, canbecycleroot_51458)(Cell47505* c);
static N_INLINE(void, rtladdcycleroot_52220)(Cell47505* c);
N_NOINLINE(void, incl_48247)(Cellset47517* s, Cell47505* cell);
static N_INLINE(Cell47505*, usrtocell_51440)(void* usr);
static N_INLINE(void, decref_53401)(Cell47505* c);
static N_INLINE(void, rtladdzct_53001)(Cell47505* c);
N_NOINLINE(void, addzct_51417)(Cellseq47521* s, Cell47505* c);
N_NIMCALL(NIM_BOOL, mustrehash_221147)(NI length, NI counter);
N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
N_NIMCALL(void, idtablerawinsert_225685)(Tidpairseq214838** data, Tidobj189006* key, TNimObject* val);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(NI, sonslen_217351)(Tnode214790* n);
N_NIMCALL(Tsym214822*, lookupinrecord_221140)(Tnode214790* n, Tident189012* field);
N_NIMCALL(void, internalerror_187100)(Tlineinfo182337 info, NimStringDesc* errmsg);
N_NIMCALL(Tnode214790*, lastson_217364)(Tnode214790* n);
static N_INLINE(NIM_BOOL, reallysameident_224900)(NimStringDesc* a, NimStringDesc* b);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(void, strtableenlarge_224810)(Tstrtable214794* t);
N_NIMCALL(void, strtablerawinsert_224127)(Tsymseq214792** data, Tsym214822* n);
N_NIMCALL(void, iitablerawinsert_227176)(Tiipairseq221161** data, NI key, NI val);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
static N_INLINE(NI, cmpStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(NIM_BOOL, levalue_221233)(Tnode214790* a, Tnode214790* b);
N_NIMCALL(Tsym214822*, nextidentiter_221093)(Tidentiter221084* ti, Tstrtable214794 tab);
N_NIMCALL(Tsym214822*, nextidentexcluding_225462)(Tidentiter221084* ti, Tstrtable214794 tab, Intset211035* excluding);
N_NIMCALL(NIM_BOOL, contains_211811)(Intset211035* s, NI key);
N_NIMCALL(NI, idnodetablerawget_226464)(Tidnodetable214846 t, Tidobj189006* key);
N_NIMCALL(void, idnodetablerawinsert_226504)(Tidnodepairseq214844** data, Tidobj189006* key, Tnode214790* val);
N_NIMCALL(void, symtabreplaceraw_224414)(Tsymseq214792** data, Tsym214822* prevsym, Tsym214822* newsym);
STRING_LITERAL(TMP1134, "lookupInRecord", 14);
STRING_LITERAL(TMP1135, "lookupInRecord(record case branch)", 34);
STRING_LITERAL(TMP1136, "lookupInRecord()", 16);
STRING_LITERAL(TMP1141, "getSymFromList", 14);
TNimType NTI221163; /* TIITable */
extern TNimType NTI104; /* int */
TNimType NTI221159; /* TIIPair */
TNimType NTI221161; /* TIIPairSeq */
extern Gcheap49818 gch_49859;
extern TNimType NTI214838; /* TIdPairSeq */
extern TNimType NTI214792; /* TSymSeq */
extern TNimType NTI214844; /* TIdNodePairSeq */
N_NIMCALL(void, TMP908)(void* p, NI op) {
	Tiipairseq221161* a;
	NI LOC1;
	a = (Tiipairseq221161*)p;
	LOC1 = 0;
	for (LOC1 = 0; LOC1 < a->Sup.len; LOC1++) {
	}
}

N_NIMCALL(Tsym214822*, nextiter_221078)(Ttabiter221071* ti, Tstrtable214794 tab) {
	Tsym214822* result;
	result = 0;
	result = NIM_NIL;
	{
		while (1) {
			if (!((*ti).h <= (tab.data ? (tab.data->Sup.len-1) : -1))) goto LA2;
			result = tab.data->data[(*ti).h];
			(*ti).h += ((NI) 1);
			{
				if (!!((result == NIM_NIL))) goto LA5;
				goto LA1;
			}
			LA5: ;
		} LA2: ;
	} LA1: ;
	return result;
}

N_NIMCALL(Tsym214822*, inittabiter_221073)(Ttabiter221071* ti, Tstrtable214794 tab) {
	Tsym214822* result;
	result = 0;
	(*ti).h = ((NI) 0);
	{
		if (!(tab.counter == ((NI) 0))) goto LA3;
		result = NIM_NIL;
	}
	goto LA1;
	LA3: ;
	{
		result = nextiter_221078(ti, tab);
	}
	LA1: ;
	return result;
}

static N_INLINE(NI, nexttry_221151)(NI h, NI maxhash) {
	NI result;
	result = 0;
	result = (NI)((NI)((NI)(((NI) 5) * h) + ((NI) 1)) & maxhash);
	return result;
}

N_NIMCALL(Tsym214822*, strtableget_221066)(Tstrtable214794 t, Tident189012* name) {
	Tsym214822* result;
	NI h;
	result = 0;
	h = (NI)((*name).h & (t.data ? (t.data->Sup.len-1) : -1));
	{
		while (1) {
			result = t.data->data[h];
			{
				if (!(result == NIM_NIL)) goto LA5;
				goto LA1;
			}
			LA5: ;
			{
				if (!((*(*result).name).Sup.id == (*name).Sup.id)) goto LA9;
				goto LA1;
			}
			LA9: ;
			h = nexttry_221151(h, (t.data ? (t.data->Sup.len-1) : -1));
		}
	} LA1: ;
	return result;
}

N_NIMCALL(NI, iitablerawget_227162)(Tiitable221163 t, NI key) {
	NI result;
	NI h;
{	result = 0;
	h = 0;
	h = (NI)(key & (t.data ? (t.data->Sup.len-1) : -1));
	{
		while (1) {
			if (!!((t.data->data[h].key == ((NI) (IL64(-9223372036854775807) - IL64(1)))))) goto LA2;
			{
				if (!(t.data->data[h].key == key)) goto LA5;
				result = h;
				goto BeforeRet;
			}
			LA5: ;
			h = nexttry_221151(h, (t.data ? (t.data->Sup.len-1) : -1));
		} LA2: ;
	}
	result = ((NI) -1);
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NI, iitableget_221172)(Tiitable221163 t, NI key) {
	NI result;
	NI index;
	result = 0;
	index = iitablerawget_227162(t, key);
	{
		if (!(((NI) 0) <= index)) goto LA3;
		result = t.data->data[index].val;
	}
	goto LA1;
	LA3: ;
	{
		result = ((NI) (IL64(-9223372036854775807) - IL64(1)));
	}
	LA1: ;
	return result;
}

N_NIMCALL(NI, idtablerawget_225599)(Tidtable214840 t, NI key) {
	NI result;
	NI h;
{	result = 0;
	h = 0;
	h = (NI)(key & (t.data ? (t.data->Sup.len-1) : -1));
	{
		while (1) {
			if (!!((t.data->data[h].key == NIM_NIL))) goto LA2;
			{
				if (!((*t.data->data[h].key).id == key)) goto LA5;
				result = h;
				goto BeforeRet;
			}
			LA5: ;
			h = nexttry_221151(h, (t.data ? (t.data->Sup.len-1) : -1));
		} LA2: ;
	}
	result = ((NI) -1);
	}BeforeRet: ;
	return result;
}

N_NIMCALL(TNimObject*, idtableget_221111)(Tidtable214840 t, NI key) {
	TNimObject* result;
	NI index;
	result = 0;
	index = idtablerawget_225599(t, key);
	{
		if (!(((NI) 0) <= index)) goto LA3;
		result = t.data->data[index].val;
	}
	goto LA1;
	LA3: ;
	{
		result = NIM_NIL;
	}
	LA1: ;
	return result;
}

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

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

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

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

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

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

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

N_NIMCALL(NIM_BOOL, mustrehash_221147)(NI length, NI counter) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = ((NI)(length * ((NI) 2)) < (NI)(counter * ((NI) 3)));
	if (LOC1) goto LA2;
	LOC1 = ((NI)(length - counter) < ((NI) 4));
	LA2: ;
	result = LOC1;
	return result;
}

N_NIMCALL(void, idtablerawinsert_225685)(Tidpairseq214838** data, Tidobj189006* key, TNimObject* val) {
	NI h;
	h = 0;
	h = (NI)((*key).id & ((*data) ? ((*data)->Sup.len-1) : -1));
	{
		while (1) {
			if (!!(((*data)->data[h].key == NIM_NIL))) goto LA2;
			h = nexttry_221151(h, ((*data) ? ((*data)->Sup.len-1) : -1));
		} LA2: ;
	}
	asgnRef((void**) (&(*data)->data[h].key), key);
	asgnRef((void**) (&(*data)->data[h].val), val);
}

N_NIMCALL(void, idtableput_221115)(Tidtable214840* t, Tidobj189006* key, TNimObject* val) {
	NI index;
	Tidpairseq214838* n;
	index = 0;
	n = 0;
	index = idtablerawget_225599((*t), (*key).id);
	{
		if (!(((NI) 0) <= index)) goto LA3;
		asgnRef((void**) (&(*t).data->data[index].val), val);
	}
	goto LA1;
	LA3: ;
	{
		{
			NIM_BOOL LOC8;
			Tidpairseq214838* LOC18;
			LOC8 = 0;
			LOC8 = mustrehash_221147(((*t).data ? (*t).data->Sup.len : 0), (*t).counter);
			if (!LOC8) goto LA9;
			n = (Tidpairseq214838*) newSeq((&NTI214838), ((NI) ((NI)(((*t).data ? (*t).data->Sup.len : 0) * ((NI) 2)))));
			{
				NI i_226238;
				NI HEX3Atmp_226424;
				NI res_226427;
				i_226238 = 0;
				HEX3Atmp_226424 = 0;
				HEX3Atmp_226424 = ((*t).data ? ((*t).data->Sup.len-1) : -1);
				res_226427 = ((NI) 0);
				{
					while (1) {
						if (!(res_226427 <= HEX3Atmp_226424)) goto LA13;
						i_226238 = res_226427;
						{
							if (!!(((*t).data->data[i_226238].key == NIM_NIL))) goto LA16;
							idtablerawinsert_225685((&n), (*t).data->data[i_226238].key, (*t).data->data[i_226238].val);
						}
						LA16: ;
						res_226427 += ((NI) 1);
					} LA13: ;
				}
			}
			LOC18 = 0;
			LOC18 = (*t).data;
			unsureAsgnRef((void**) (&(*t).data), n);
			n = LOC18;
		}
		LA9: ;
		idtablerawinsert_225685((&(*t).data), key, val);
		(*t).counter += ((NI) 1);
	}
	LA1: ;
}

N_NIMCALL(Tsym214822*, lookupinrecord_221140)(Tnode214790* n, Tident189012* field) {
	Tsym214822* result;
{	result = 0;
	result = NIM_NIL;
	switch ((*n).kind) {
	case ((NU8) 138):
	{
		{
			NI i_221318;
			NI HEX3Atmp_221385;
			NI LOC3;
			NI res_221388;
			i_221318 = 0;
			HEX3Atmp_221385 = 0;
			LOC3 = 0;
			LOC3 = sonslen_217351(n);
			HEX3Atmp_221385 = (NI)(LOC3 - ((NI) 1));
			res_221388 = ((NI) 0);
			{
				while (1) {
					if (!(res_221388 <= HEX3Atmp_221385)) goto LA5;
					i_221318 = res_221388;
					result = lookupinrecord_221140((*n).kindU.S6.sons->data[i_221318], field);
					{
						if (!!((result == NIM_NIL))) goto LA8;
						goto BeforeRet;
					}
					LA8: ;
					res_221388 += ((NI) 1);
				} LA5: ;
			}
		}
	}
	break;
	case ((NU8) 139):
	{
		{
			if (!!(((*(*n).kindU.S6.sons->data[((NI) 0)]).kind == ((NU8) 3)))) goto LA13;
			internalerror_187100((*n).info, ((NimStringDesc*) &TMP1134));
		}
		LA13: ;
		result = lookupinrecord_221140((*n).kindU.S6.sons->data[((NI) 0)], field);
		{
			if (!!((result == NIM_NIL))) goto LA17;
			goto BeforeRet;
		}
		LA17: ;
		{
			NI i_221366;
			NI HEX3Atmp_221393;
			NI LOC20;
			NI res_221396;
			i_221366 = 0;
			HEX3Atmp_221393 = 0;
			LOC20 = 0;
			LOC20 = sonslen_217351(n);
			HEX3Atmp_221393 = (NI)(LOC20 - ((NI) 1));
			res_221396 = ((NI) 1);
			{
				while (1) {
					if (!(res_221396 <= HEX3Atmp_221393)) goto LA22;
					i_221366 = res_221396;
					switch ((*(*n).kindU.S6.sons->data[i_221366]).kind) {
					case ((NU8) 85):
					case ((NU8) 88):
					{
						Tnode214790* LOC24;
						LOC24 = 0;
						LOC24 = lastson_217364((*n).kindU.S6.sons->data[i_221366]);
						result = lookupinrecord_221140(LOC24, field);
						{
							if (!!((result == NIM_NIL))) goto LA27;
							goto BeforeRet;
						}
						LA27: ;
					}
					break;
					default:
					{
						internalerror_187100((*n).info, ((NimStringDesc*) &TMP1135));
					}
					break;
					}
					res_221396 += ((NI) 1);
				} LA22: ;
			}
		}
	}
	break;
	case ((NU8) 3):
	{
		{
			if (!((*(*(*n).kindU.S4.sym).name).Sup.id == (*field).Sup.id)) goto LA33;
			result = (*n).kindU.S4.sym;
		}
		LA33: ;
	}
	break;
	default:
	{
		internalerror_187100((*n).info, ((NimStringDesc*) &TMP1136));
	}
	break;
	}
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tsym214822*, getsymfromlist_221135)(Tnode214790* list, Tident189012* ident, NI start) {
	Tsym214822* result;
{	result = 0;
	{
		NI i_221641;
		NI HEX3Atmp_221656;
		NI LOC2;
		NI res_221659;
		i_221641 = 0;
		HEX3Atmp_221656 = 0;
		LOC2 = 0;
		LOC2 = sonslen_217351(list);
		HEX3Atmp_221656 = (NI)(LOC2 - ((NI) 1));
		res_221659 = start;
		{
			while (1) {
				if (!(res_221659 <= HEX3Atmp_221656)) goto LA4;
				i_221641 = res_221659;
				{
					if (!((*(*list).kindU.S6.sons->data[i_221641]).kind == ((NU8) 3))) goto LA7;
					result = (*(*list).kindU.S6.sons->data[i_221641]).kindU.S4.sym;
					{
						if (!((*(*result).name).Sup.id == (*ident).Sup.id)) goto LA11;
						goto BeforeRet;
					}
					LA11: ;
				}
				goto LA5;
				LA7: ;
				{
					internalerror_187100((*list).info, ((NimStringDesc*) &TMP1141));
				}
				LA5: ;
				res_221659 += ((NI) 1);
			} LA4: ;
		}
	}
	result = NIM_NIL;
	}BeforeRet: ;
	return result;
}

static N_INLINE(NIM_BOOL, reallysameident_224900)(NimStringDesc* a, NimStringDesc* b) {
	NIM_BOOL result;
	result = 0;
	result = NIM_TRUE;
	return result;
}

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

N_NIMCALL(void, strtablerawinsert_224127)(Tsymseq214792** data, Tsym214822* n) {
	NI h;
{	h = (NI)((*(*n).name).h & ((*data) ? ((*data)->Sup.len-1) : -1));
	{
		if (!!((((*n).flags &(1U<<((NU)(((NU8) 25))&31U)))!=0))) goto LA3;
		{
			while (1) {
				if (!!(((*data)->data[h] == NIM_NIL))) goto LA6;
				{
					if (!((*data)->data[h] == n)) goto LA9;
					goto BeforeRet;
				}
				LA9: ;
				h = nexttry_221151(h, ((*data) ? ((*data)->Sup.len-1) : -1));
			} LA6: ;
		}
		asgnRefNoCycle((void**) (&(*data)->data[h]), n);
	}
	goto LA1;
	LA3: ;
	{
		NI favpos;
		favpos = ((NI) -1);
		{
			while (1) {
				if (!!(((*data)->data[h] == NIM_NIL))) goto LA13;
				{
					if (!((*data)->data[h] == n)) goto LA16;
					goto BeforeRet;
				}
				LA16: ;
				{
					NIM_BOOL LOC20;
					LOC20 = 0;
					LOC20 = (favpos < ((NI) 0));
					if (!(LOC20)) goto LA21;
					LOC20 = ((*(*(*data)->data[h]).name).Sup.id == (*(*n).name).Sup.id);
					LA21: ;
					if (!LOC20) goto LA22;
					favpos = h;
				}
				LA22: ;
				h = nexttry_221151(h, ((*data) ? ((*data)->Sup.len-1) : -1));
			} LA13: ;
		}
		asgnRefNoCycle((void**) (&(*data)->data[h]), n);
		{
			Tsym214822* LOC28;
			if (!(((NI) 0) <= favpos)) goto LA26;
			LOC28 = 0;
			LOC28 = (*data)->data[h];
			asgnRefNoCycle((void**) (&(*data)->data[h]), (*data)->data[favpos]);
			asgnRefNoCycle((void**) (&(*data)->data[favpos]), LOC28);
		}
		LA26: ;
	}
	LA1: ;
	}BeforeRet: ;
}

N_NIMCALL(void, strtableenlarge_224810)(Tstrtable214794* t) {
	Tsymseq214792* n;
	Tsymseq214792* LOC8;
	n = 0;
	n = (Tsymseq214792*) newSeq((&NTI214792), ((NI) ((NI)(((*t).data ? (*t).data->Sup.len : 0) * ((NI) 2)))));
	{
		NI i_224844;
		NI HEX3Atmp_224870;
		NI res_224873;
		i_224844 = 0;
		HEX3Atmp_224870 = 0;
		HEX3Atmp_224870 = ((*t).data ? ((*t).data->Sup.len-1) : -1);
		res_224873 = ((NI) 0);
		{
			while (1) {
				if (!(res_224873 <= HEX3Atmp_224870)) goto LA3;
				i_224844 = res_224873;
				{
					if (!!(((*t).data->data[i_224844] == NIM_NIL))) goto LA6;
					strtablerawinsert_224127((&n), (*t).data->data[i_224844]);
				}
				LA6: ;
				res_224873 += ((NI) 1);
			} LA3: ;
		}
	}
	LOC8 = 0;
	LOC8 = (*t).data;
	unsureAsgnRef((void**) (&(*t).data), n);
	n = LOC8;
}

N_NIMCALL(NIM_BOOL, strtableincl_225001)(Tstrtable214794* t, Tsym214822* n) {
	NIM_BOOL result;
	NI h;
	NI replaceslot;
{	result = 0;
	h = (NI)((*(*n).name).h & ((*t).data ? ((*t).data->Sup.len-1) : -1));
	replaceslot = ((NI) -1);
	{
		while (1) {
			Tsym214822* it;
			it = (*t).data->data[h];
			{
				if (!(it == NIM_NIL)) goto LA5;
				goto LA1;
			}
			LA5: ;
			{
				NIM_BOOL LOC9;
				LOC9 = 0;
				LOC9 = ((*(*it).name).Sup.id == (*(*n).name).Sup.id);
				if (!(LOC9)) goto LA10;
				LOC9 = reallysameident_224900((*(*it).name).s, (*(*n).name).s);
				LA10: ;
				if (!LOC9) goto LA11;
				{
					if (!(it == n)) goto LA15;
					result = NIM_FALSE;
					goto BeforeRet;
				}
				LA15: ;
				replaceslot = h;
			}
			LA11: ;
			h = nexttry_221151(h, ((*t).data ? ((*t).data->Sup.len-1) : -1));
		}
	} LA1: ;
	{
		if (!(((NI) 0) <= replaceslot)) goto LA19;
		asgnRefNoCycle((void**) (&(*t).data->data[replaceslot]), n);
		result = NIM_TRUE;
		goto BeforeRet;
	}
	goto LA17;
	LA19: ;
	{
		NIM_BOOL LOC22;
		LOC22 = 0;
		LOC22 = mustrehash_221147(((*t).data ? (*t).data->Sup.len : 0), (*t).counter);
		if (!LOC22) goto LA23;
		strtableenlarge_224810(t);
		strtablerawinsert_224127((&(*t).data), n);
	}
	goto LA17;
	LA23: ;
	{
		asgnRefNoCycle((void**) (&(*t).data->data[h]), n);
	}
	LA17: ;
	(*t).counter += ((NI) 1);
	result = NIM_FALSE;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, strtableadd_221061)(Tstrtable214794* t, Tsym214822* n) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = mustrehash_221147(((*t).data ? (*t).data->Sup.len : 0), (*t).counter);
		if (!LOC3) goto LA4;
		strtableenlarge_224810(t);
	}
	LA4: ;
	strtablerawinsert_224127((&(*t).data), n);
	(*t).counter += ((NI) 1);
}

N_NIMCALL(void, initiitable_221168)(Tiitable221163* x) {
	(*x).counter = ((NI) 0);
	unsureAsgnRef((void**) (&(*x).data), (Tiipairseq221161*) newSeq((&NTI221161), ((NI) 8)));
	{
		NI i_227154;
		NI res_227158;
		i_227154 = 0;
		res_227158 = ((NI) 0);
		{
			while (1) {
				if (!(res_227158 <= ((NI) 7))) goto LA3;
				i_227154 = res_227158;
				(*x).data->data[i_227154].key = ((NI) (IL64(-9223372036854775807) - IL64(1)));
				res_227158 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, iitablerawinsert_227176)(Tiipairseq221161** data, NI key, NI val) {
	NI h;
	h = 0;
	h = (NI)(key & ((*data) ? ((*data)->Sup.len-1) : -1));
	{
		while (1) {
			if (!!(((*data)->data[h].key == ((NI) (IL64(-9223372036854775807) - IL64(1)))))) goto LA2;
			h = nexttry_221151(h, ((*data) ? ((*data)->Sup.len-1) : -1));
		} LA2: ;
	}
	(*data)->data[h].key = key;
	(*data)->data[h].val = val;
}

N_NIMCALL(void, iitableput_221176)(Tiitable221163* t, NI key, NI val) {
	NI index;
	index = iitablerawget_227162((*t), key);
	{
		if (!(((NI) 0) <= index)) goto LA3;
		(*t).data->data[index].val = val;
	}
	goto LA1;
	LA3: ;
	{
		{
			NIM_BOOL LOC8;
			Tiipairseq221161* n;
			Tiipairseq221161* LOC21;
			LOC8 = 0;
			LOC8 = mustrehash_221147(((*t).data ? (*t).data->Sup.len : 0), (*t).counter);
			if (!LOC8) goto LA9;
			n = 0;
			n = (Tiipairseq221161*) newSeq((&NTI221161), ((NI) ((NI)(((*t).data ? (*t).data->Sup.len : 0) * ((NI) 2)))));
			{
				NI i_227639;
				NI HEX3Atmp_227675;
				NI res_227678;
				i_227639 = 0;
				HEX3Atmp_227675 = 0;
				HEX3Atmp_227675 = (n ? (n->Sup.len-1) : -1);
				res_227678 = ((NI) 0);
				{
					while (1) {
						if (!(res_227678 <= HEX3Atmp_227675)) goto LA13;
						i_227639 = res_227678;
						n->data[i_227639].key = ((NI) (IL64(-9223372036854775807) - IL64(1)));
						res_227678 += ((NI) 1);
					} LA13: ;
				}
			}
			{
				NI i_227651;
				NI HEX3Atmp_227683;
				NI res_227686;
				i_227651 = 0;
				HEX3Atmp_227683 = 0;
				HEX3Atmp_227683 = ((*t).data ? ((*t).data->Sup.len-1) : -1);
				res_227686 = ((NI) 0);
				{
					while (1) {
						if (!(res_227686 <= HEX3Atmp_227683)) goto LA16;
						i_227651 = res_227686;
						{
							if (!!(((*t).data->data[i_227651].key == ((NI) (IL64(-9223372036854775807) - IL64(1)))))) goto LA19;
							iitablerawinsert_227176((&n), (*t).data->data[i_227651].key, (*t).data->data[i_227651].val);
						}
						LA19: ;
						res_227686 += ((NI) 1);
					} LA16: ;
				}
			}
			LOC21 = 0;
			LOC21 = (*t).data;
			unsureAsgnRef((void**) (&(*t).data), n);
			n = LOC21;
		}
		LA9: ;
		iitablerawinsert_227176((&(*t).data), key, val);
		(*t).counter += ((NI) 1);
	}
	LA1: ;
}

N_NIMCALL(Tsym214822*, getmodule_221144)(Tsym214822* s) {
	Tsym214822* result;
	result = 0;
	result = s;
	{
		while (1) {
			NIM_BOOL LOC3;
			LOC3 = 0;
			LOC3 = !((result == NIM_NIL));
			if (!(LOC3)) goto LA4;
			LOC3 = !(((*result).kind == ((NU8) 6)));
			LA4: ;
			if (!LOC3) goto LA2;
			result = (*result).owner;
		} LA2: ;
	}
	return result;
}

N_NIMCALL(TNimObject*, idtableget_221107)(Tidtable214840 t, Tidobj189006* key) {
	TNimObject* result;
	NI index;
	result = 0;
	index = idtablerawget_225599(t, (*key).id);
	{
		if (!(((NI) 0) <= index)) goto LA3;
		result = t.data->data[index].val;
	}
	goto LA1;
	LA3: ;
	{
		result = NIM_NIL;
	}
	LA1: ;
	return result;
}

static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b) {
	NIM_BOOL result;
	NIM_BOOL LOC11;
	int LOC13;
{	result = 0;
	{
		if (!(a == b)) goto LA3;
		result = NIM_TRUE;
		goto BeforeRet;
	}
	LA3: ;
	{
		NIM_BOOL LOC7;
		LOC7 = 0;
		LOC7 = (a == NIM_NIL);
		if (LOC7) goto LA8;
		LOC7 = (b == NIM_NIL);
		LA8: ;
		if (!LOC7) goto LA9;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA9: ;
	LOC11 = 0;
	LOC11 = ((*a).Sup.len == (*b).Sup.len);
	if (!(LOC11)) goto LA12;
	LOC13 = 0;
	LOC13 = memcmp(((NCSTRING) ((*a).data)), ((NCSTRING) ((*b).data)), (*a).Sup.len);
	LOC11 = (LOC13 == ((NI32) 0));
	LA12: ;
	result = LOC11;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, samevalue_221189)(Tnode214790* a, Tnode214790* b) {
	NIM_BOOL result;
	result = 0;
	result = NIM_FALSE;
	switch ((*a).kind) {
	case ((NU8) 5) ... ((NU8) 15):
	{
		{
			if (!((*b).kind >= ((NU8) 5) && (*b).kind <= ((NU8) 15))) goto LA4;
			result = ((*a).kindU.S1.intval == (*b).kindU.S1.intval);
		}
		LA4: ;
	}
	break;
	case ((NU8) 16) ... ((NU8) 18):
	{
		{
			if (!((*b).kind >= ((NU8) 16) && (*b).kind <= ((NU8) 18))) goto LA9;
			result = ((*a).kindU.S2.floatval == (*b).kindU.S2.floatval);
		}
		LA9: ;
	}
	break;
	case ((NU8) 20) ... ((NU8) 22):
	{
		{
			if (!((*b).kind >= ((NU8) 20) && (*b).kind <= ((NU8) 22))) goto LA14;
			result = eqStrings((*a).kindU.S3.strval, (*b).kindU.S3.strval);
		}
		LA14: ;
	}
	break;
	default:
	{
	}
	break;
	}
	return result;
}

static N_INLINE(NI, cmpStrings)(NimStringDesc* a, NimStringDesc* b) {
	NI result;
	int LOC13;
{	result = 0;
	{
		if (!(a == b)) goto LA3;
		result = ((NI) 0);
		goto BeforeRet;
	}
	LA3: ;
	{
		if (!(a == NIM_NIL)) goto LA7;
		result = ((NI) -1);
		goto BeforeRet;
	}
	LA7: ;
	{
		if (!(b == NIM_NIL)) goto LA11;
		result = ((NI) 1);
		goto BeforeRet;
	}
	LA11: ;
	LOC13 = 0;
	LOC13 = strcmp(((NCSTRING) ((*a).data)), ((NCSTRING) ((*b).data)));
	result = ((NI) (LOC13));
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, levalue_221233)(Tnode214790* a, Tnode214790* b) {
	NIM_BOOL result;
	result = 0;
	result = NIM_FALSE;
	switch ((*a).kind) {
	case ((NU8) 5) ... ((NU8) 14):
	{
		{
			if (!((*b).kind >= ((NU8) 5) && (*b).kind <= ((NU8) 14))) goto LA4;
			result = ((*a).kindU.S1.intval <= (*b).kindU.S1.intval);
		}
		LA4: ;
	}
	break;
	case ((NU8) 16) ... ((NU8) 18):
	{
		{
			if (!((*b).kind >= ((NU8) 16) && (*b).kind <= ((NU8) 18))) goto LA9;
			result = ((*a).kindU.S2.floatval <= (*b).kindU.S2.floatval);
		}
		LA9: ;
	}
	break;
	case ((NU8) 20) ... ((NU8) 22):
	{
		{
			if (!((*b).kind >= ((NU8) 20) && (*b).kind <= ((NU8) 22))) goto LA14;
			result = (cmpStrings((*a).kindU.S3.strval, (*b).kindU.S3.strval) <= 0);
		}
		LA14: ;
	}
	break;
	default:
	{
	}
	break;
	}
	return result;
}

N_NIMCALL(NU8, weaklevalue_221277)(Tnode214790* a, Tnode214790* b) {
	NU8 result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = !(((*a).kind >= ((NU8) 5) && (*a).kind <= ((NU8) 22)));
		if (LOC3) goto LA4;
		LOC3 = !(((*b).kind >= ((NU8) 5) && (*b).kind <= ((NU8) 22)));
		LA4: ;
		if (!LOC3) goto LA5;
		result = ((NU8) 0);
	}
	goto LA1;
	LA5: ;
	{
		{
			NIM_BOOL LOC10;
			LOC10 = 0;
			LOC10 = levalue_221233(a, b);
			if (!LOC10) goto LA11;
			result = ((NU8) 2);
		}
		goto LA8;
		LA11: ;
		{
			result = ((NU8) 1);
		}
		LA8: ;
	}
	LA1: ;
	return result;
}

N_NIMCALL(Tsym214822*, nextidentiter_221093)(Tidentiter221084* ti, Tstrtable214794 tab) {
	Tsym214822* result;
	NI h;
	NI start;
	result = 0;
	h = (NI)((*ti).h & (tab.data ? (tab.data->Sup.len-1) : -1));
	start = h;
	result = tab.data->data[h];
	{
		while (1) {
			if (!!((result == NIM_NIL))) goto LA2;
			{
				if (!((*(*result).name).Sup.id == (*(*ti).name).Sup.id)) goto LA5;
				goto LA1;
			}
			LA5: ;
			h = nexttry_221151(h, (tab.data ? (tab.data->Sup.len-1) : -1));
			{
				if (!(h == start)) goto LA9;
				result = NIM_NIL;
				goto LA1;
			}
			LA9: ;
			result = tab.data->data[h];
		} LA2: ;
	} LA1: ;
	(*ti).h = nexttry_221151(h, (tab.data ? (tab.data->Sup.len-1) : -1));
	return result;
}

N_NIMCALL(Tsym214822*, initidentiter_221087)(Tidentiter221084* ti, Tstrtable214794 tab, Tident189012* s) {
	Tsym214822* result;
	result = 0;
	(*ti).h = (*s).h;
	unsureAsgnRef((void**) (&(*ti).name), s);
	{
		if (!(tab.counter == ((NI) 0))) goto LA3;
		result = NIM_NIL;
	}
	goto LA1;
	LA3: ;
	{
		result = nextidentiter_221093(ti, tab);
	}
	LA1: ;
	return result;
}

N_NIMCALL(Tsym214822*, nextidentexcluding_225462)(Tidentiter221084* ti, Tstrtable214794 tab, Intset211035* excluding) {
	Tsym214822* result;
	NI h;
	NI start;
	result = 0;
	h = (NI)((*ti).h & (tab.data ? (tab.data->Sup.len-1) : -1));
	start = h;
	result = tab.data->data[h];
	{
		while (1) {
			if (!!((result == NIM_NIL))) goto LA2;
			{
				NIM_BOOL LOC5;
				NIM_BOOL LOC7;
				LOC5 = 0;
				LOC5 = ((*(*result).name).Sup.id == (*(*ti).name).Sup.id);
				if (!(LOC5)) goto LA6;
				LOC7 = 0;
				LOC7 = contains_211811(excluding, (*result).Sup.id);
				LOC5 = !(LOC7);
				LA6: ;
				if (!LOC5) goto LA8;
				goto LA1;
			}
			LA8: ;
			h = nexttry_221151(h, (tab.data ? (tab.data->Sup.len-1) : -1));
			{
				if (!(h == start)) goto LA12;
				result = NIM_NIL;
				goto LA1;
			}
			LA12: ;
			result = tab.data->data[h];
		} LA2: ;
	} LA1: ;
	(*ti).h = nexttry_221151(h, (tab.data ? (tab.data->Sup.len-1) : -1));
	{
		NIM_BOOL LOC16;
		LOC16 = 0;
		LOC16 = !((result == NIM_NIL));
		if (!(LOC16)) goto LA17;
		LOC16 = contains_211811(excluding, (*result).Sup.id);
		LA17: ;
		if (!LOC16) goto LA18;
		result = NIM_NIL;
	}
	LA18: ;
	return result;
}

N_NIMCALL(Tsym214822*, firstidentexcluding_225500)(Tidentiter221084* ti, Tstrtable214794 tab, Tident189012* s, Intset211035* excluding) {
	Tsym214822* result;
	result = 0;
	(*ti).h = (*s).h;
	unsureAsgnRef((void**) (&(*ti).name), s);
	{
		if (!(tab.counter == ((NI) 0))) goto LA3;
		result = NIM_NIL;
	}
	goto LA1;
	LA3: ;
	{
		result = nextidentexcluding_225462(ti, tab, excluding);
	}
	LA1: ;
	return result;
}

N_NIMCALL(NI, idnodetablerawget_226464)(Tidnodetable214846 t, Tidobj189006* key) {
	NI result;
	NI h;
{	result = 0;
	h = 0;
	h = (NI)((*key).id & (t.data ? (t.data->Sup.len-1) : -1));
	{
		while (1) {
			if (!!((t.data->data[h].key == NIM_NIL))) goto LA2;
			{
				if (!((*t.data->data[h].key).id == (*key).id)) goto LA5;
				result = h;
				goto BeforeRet;
			}
			LA5: ;
			h = nexttry_221151(h, (t.data ? (t.data->Sup.len-1) : -1));
		} LA2: ;
	}
	result = ((NI) -1);
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tnode214790*, idnodetableget_221125)(Tidnodetable214846 t, Tidobj189006* key) {
	Tnode214790* result;
	NI index;
	result = 0;
	index = 0;
	index = idnodetablerawget_226464(t, key);
	{
		if (!(((NI) 0) <= index)) goto LA3;
		result = t.data->data[index].val;
	}
	goto LA1;
	LA3: ;
	{
		result = NIM_NIL;
	}
	LA1: ;
	return result;
}

N_NIMCALL(void, idnodetablerawinsert_226504)(Tidnodepairseq214844** data, Tidobj189006* key, Tnode214790* val) {
	NI h;
	h = 0;
	h = (NI)((*key).id & ((*data) ? ((*data)->Sup.len-1) : -1));
	{
		while (1) {
			if (!!(((*data)->data[h].key == NIM_NIL))) goto LA2;
			h = nexttry_221151(h, ((*data) ? ((*data)->Sup.len-1) : -1));
		} LA2: ;
	}
	asgnRef((void**) (&(*data)->data[h].key), key);
	asgnRefNoCycle((void**) (&(*data)->data[h].val), val);
}

N_NIMCALL(void, idnodetableput_221129)(Tidnodetable214846* t, Tidobj189006* key, Tnode214790* val) {
	NI index;
	index = idnodetablerawget_226464((*t), key);
	{
		if (!(((NI) 0) <= index)) goto LA3;
		asgnRefNoCycle((void**) (&(*t).data->data[index].val), val);
	}
	goto LA1;
	LA3: ;
	{
		{
			NIM_BOOL LOC8;
			Tidnodepairseq214844* n;
			Tidnodepairseq214844* LOC18;
			LOC8 = 0;
			LOC8 = mustrehash_221147(((*t).data ? (*t).data->Sup.len : 0), (*t).counter);
			if (!LOC8) goto LA9;
			n = 0;
			n = (Tidnodepairseq214844*) newSeq((&NTI214844), ((NI) ((NI)(((*t).data ? (*t).data->Sup.len : 0) * ((NI) 2)))));
			{
				NI i_227039;
				NI HEX3Atmp_227075;
				NI res_227078;
				i_227039 = 0;
				HEX3Atmp_227075 = 0;
				HEX3Atmp_227075 = ((*t).data ? ((*t).data->Sup.len-1) : -1);
				res_227078 = ((NI) 0);
				{
					while (1) {
						if (!(res_227078 <= HEX3Atmp_227075)) goto LA13;
						i_227039 = res_227078;
						{
							if (!!(((*t).data->data[i_227039].key == NIM_NIL))) goto LA16;
							idnodetablerawinsert_226504((&n), (*t).data->data[i_227039].key, (*t).data->data[i_227039].val);
						}
						LA16: ;
						res_227078 += ((NI) 1);
					} LA13: ;
				}
			}
			LOC18 = 0;
			LOC18 = (*t).data;
			unsureAsgnRef((void**) (&(*t).data), n);
			n = LOC18;
		}
		LA9: ;
		idnodetablerawinsert_226504((&(*t).data), key, val);
		(*t).counter += ((NI) 1);
	}
	LA1: ;
}

N_NIMCALL(Tnode214790*, skipconvandclosure_221182)(Tnode214790* n) {
	Tnode214790* result;
	result = 0;
	result = n;
	{
		while (1) {
			switch ((*result).kind) {
			case ((NU8) 67):
			case ((NU8) 66):
			case ((NU8) 70):
			case ((NU8) 68):
			case ((NU8) 69):
			case ((NU8) 155):
			{
				result = (*result).kindU.S6.sons->data[((NI) 0)];
			}
			break;
			case ((NU8) 58):
			case ((NU8) 59):
			case ((NU8) 60):
			{
				result = (*result).kindU.S6.sons->data[((NI) 1)];
			}
			break;
			default:
			{
				goto LA1;
			}
			break;
			}
		}
	} LA1: ;
	return result;
}

N_NIMCALL(void, symtabreplaceraw_224414)(Tsymseq214792** data, Tsym214822* prevsym, Tsym214822* newsym) {
	NI h;
{	h = (NI)((*(*prevsym).name).h & ((*data) ? ((*data)->Sup.len-1) : -1));
	{
		while (1) {
			if (!!(((*data)->data[h] == NIM_NIL))) goto LA2;
			{
				if (!((*data)->data[h] == prevsym)) goto LA5;
				asgnRefNoCycle((void**) (&(*data)->data[h]), newsym);
				goto BeforeRet;
			}
			LA5: ;
			h = nexttry_221151(h, ((*data) ? ((*data)->Sup.len-1) : -1));
		} LA2: ;
	}
	}BeforeRet: ;
}

N_NIMCALL(void, symtabreplace_224803)(Tstrtable214794* t, Tsym214822* prevsym, Tsym214822* newsym) {
	symtabreplaceraw_224414((&(*t).data), prevsym, newsym);
}

N_NIMCALL(NIM_BOOL, idtablehasobjectaskey_221121)(Tidtable214840 t, Tidobj189006* key) {
	NIM_BOOL result;
	NI index;
	result = 0;
	index = idtablerawget_225599(t, (*key).id);
	{
		if (!(((NI) 0) <= index)) goto LA3;
		result = (t.data->data[index].key == key);
	}
	goto LA1;
	LA3: ;
	{
		result = NIM_FALSE;
	}
	LA1: ;
	return result;
}
NIM_EXTERNC N_NOINLINE(void, compiler_astalgoInit000)(void) {
}

NIM_EXTERNC N_NOINLINE(void, compiler_astalgoDatInit000)(void) {
static TNimNode* TMP906[2];
static TNimNode* TMP907[2];
static TNimNode TMP876[6];
NTI221163.size = sizeof(Tiitable221163);
NTI221163.kind = 18;
NTI221163.base = 0;
NTI221163.flags = 2;
TMP906[0] = &TMP876[1];
TMP876[1].kind = 1;
TMP876[1].offset = offsetof(Tiitable221163, counter);
TMP876[1].typ = (&NTI104);
TMP876[1].name = "counter";
TMP906[1] = &TMP876[2];
NTI221159.size = sizeof(Tiipair221159);
NTI221159.kind = 18;
NTI221159.base = 0;
NTI221159.flags = 3;
TMP907[0] = &TMP876[4];
TMP876[4].kind = 1;
TMP876[4].offset = offsetof(Tiipair221159, key);
TMP876[4].typ = (&NTI104);
TMP876[4].name = "key";
TMP907[1] = &TMP876[5];
TMP876[5].kind = 1;
TMP876[5].offset = offsetof(Tiipair221159, val);
TMP876[5].typ = (&NTI104);
TMP876[5].name = "val";
TMP876[3].len = 2; TMP876[3].kind = 2; TMP876[3].sons = &TMP907[0];
NTI221159.node = &TMP876[3];
NTI221161.size = sizeof(Tiipairseq221161*);
NTI221161.kind = 24;
NTI221161.base = (&NTI221159);
NTI221161.flags = 2;
NTI221161.marker = TMP908;
TMP876[2].kind = 1;
TMP876[2].offset = offsetof(Tiitable221163, data);
TMP876[2].typ = (&NTI221161);
TMP876[2].name = "data";
TMP876[0].len = 2; TMP876[0].kind = 2; TMP876[0].sons = &TMP906[0];
NTI221163.node = &TMP876[0];
}

