/* Generated by Nim Compiler v0.10.2 */
/*   (c) 2014 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_INTBITS 32
#include "nimbase.h"

#include <string.h>
typedef struct table194576 table194576;
typedef struct keyvaluepairseq194579 keyvaluepairseq194579;
typedef struct keyvaluepair194582 keyvaluepair194582;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct tcell44935 tcell44935;
typedef struct tcellseq44951 tcellseq44951;
typedef struct tgcheap47016 tgcheap47016;
typedef struct tcellset44947 tcellset44947;
typedef struct tpagedesc44943 tpagedesc44943;
typedef struct tmemregion27210 tmemregion27210;
typedef struct tsmallchunk26440 tsmallchunk26440;
typedef struct tllchunk27204 tllchunk27204;
typedef struct tbigchunk26442 tbigchunk26442;
typedef struct tintset26417 tintset26417;
typedef struct ttrunk26413 ttrunk26413;
typedef struct tavlnode27208 tavlnode27208;
typedef struct tgcstat47014 tgcstat47014;
typedef struct table357052 table357052;
typedef struct keyvaluepairseq357055 keyvaluepairseq357055;
typedef struct keyvaluepair357058 keyvaluepair357058;
typedef struct table358277 table358277;
typedef struct keyvaluepairseq358280 keyvaluepairseq358280;
typedef struct keyvaluepair358283 keyvaluepair358283;
typedef struct tindexentry358264 tindexentry358264;
typedef struct TY360804 TY360804;
typedef struct tbasechunk26438 tbasechunk26438;
typedef struct tfreecell26430 tfreecell26430;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct keyvaluepair194582 {
NU8 Field0;
NimStringDesc* Field1;
NI32 Field2;
};
struct  table194576  {
keyvaluepairseq194579* Data;
NI Counter;
};
typedef N_NIMCALL_PTR(void, TY3089) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3094) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3089 marker;
TY3094 deepcopy;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  tcell44935  {
NI Refcount;
TNimType* Typ;
};
struct  tcellseq44951  {
NI Len;
NI Cap;
tcell44935** D;
};
struct  tcellset44947  {
NI Counter;
NI Max;
tpagedesc44943* Head;
tpagedesc44943** Data;
};
typedef tsmallchunk26440* TY27222[512];
typedef ttrunk26413* ttrunkbuckets26415[256];
struct  tintset26417  {
ttrunkbuckets26415 Data;
};
struct  tmemregion27210  {
NI Minlargeobj;
NI Maxlargeobj;
TY27222 Freesmallchunks;
tllchunk27204* Llmem;
NI Currmem;
NI Maxmem;
NI Freemem;
NI Lastsize;
tbigchunk26442* Freechunkslist;
tintset26417 Chunkstarts;
tavlnode27208* Root;
tavlnode27208* Deleted;
tavlnode27208* Last;
tavlnode27208* Freeavlnodes;
};
struct  tgcstat47014  {
NI Stackscans;
NI Cyclecollections;
NI Maxthreshold;
NI Maxstacksize;
NI Maxstackcells;
NI Cycletablesize;
NI64 Maxpause;
};
struct  tgcheap47016  {
void* Stackbottom;
NI Cyclethreshold;
tcellseq44951 Zct;
tcellseq44951 Decstack;
tcellset44947 Cycleroots;
tcellseq44951 Tempstack;
NI Recgclock;
tmemregion27210 Region;
tgcstat47014 Stat;
};
struct keyvaluepair357058 {
NU8 Field0;
NimStringDesc* Field1;
NI Field2;
};
struct  table357052  {
keyvaluepairseq357055* Data;
NI Counter;
};
struct  tindexentry358264  {
NimStringDesc* Keyword;
NimStringDesc* Link;
NimStringDesc* Linktitle;
NimStringDesc* Linkdesc;
};
struct keyvaluepair358283 {
NU8 Field0;
tindexentry358264 Field1;
TY360804* Field2;
};
struct  table358277  {
keyvaluepairseq358280* Data;
NI Counter;
};
typedef NI TY26420[16];
struct  tpagedesc44943  {
tpagedesc44943* Next;
NI Key;
TY26420 Bits;
};
struct  tbasechunk26438  {
NI Prevsize;
NI Size;
NIM_BOOL Used;
};
struct  tsmallchunk26440  {
  tbasechunk26438 Sup;
tsmallchunk26440* Next;
tsmallchunk26440* Prev;
tfreecell26430* Freelist;
NI Free;
NI Acc;
NF Data;
};
struct  tllchunk27204  {
NI Size;
NI Acc;
tllchunk27204* Next;
};
struct  tbigchunk26442  {
  tbasechunk26438 Sup;
tbigchunk26442* Next;
tbigchunk26442* Prev;
NI Align;
NF Data;
};
struct  ttrunk26413  {
ttrunk26413* Next;
NI Key;
TY26420 Bits;
};
typedef tavlnode27208* TY27214[2];
struct  tavlnode27208  {
TY27214 Link;
NI Key;
NI Upperbound;
NI Level;
};
struct  tfreecell26430  {
tfreecell26430* Next;
NI Zerofield;
};
struct keyvaluepairseq194579 {
  TGenericSeq Sup;
  keyvaluepair194582 data[SEQ_DECL_SIZE];
};
struct keyvaluepairseq357055 {
  TGenericSeq Sup;
  keyvaluepair357058 data[SEQ_DECL_SIZE];
};
struct TY360804 {
  TGenericSeq Sup;
  tindexentry358264 data[SEQ_DECL_SIZE];
};
struct keyvaluepairseq358280 {
  TGenericSeq Sup;
  keyvaluepair358283 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, nimGCvisit)(void* d, NI op);
N_NIMCALL(void, TMP134)(void* p, NI op);
N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(NI, rawget_194770)(table194576 t_194777, NimStringDesc* key_194780);
N_NIMCALL(NI, hash_127839)(NimStringDesc* x);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
static N_INLINE(NI, nexttry_170409)(NI h, NI maxhash);
static N_INLINE(NIM_BOOL, mustrehash_170302)(NI length, NI counter);
N_NIMCALL(void, enlarge_194924)(table194576* t_194933);
N_NIMCALL(void, rawinsert_194994)(table194576* t_195003, keyvaluepairseq194579** data_195011, NimStringDesc* key_195015, NI32 val_195017);
N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(tcell44935*, usrtocell_48646)(void* usr);
static N_INLINE(void, rtladdzct_50204)(tcell44935* c);
N_NOINLINE(void, addzct_48617)(tcellseq44951* s, tcell44935* c);
N_NIMCALL(NI, rawget_357894)(table357052 t_357901, NimStringDesc* key_357904);
N_NIMCALL(void, enlarge_358019)(table357052* t_358028);
N_NIMCALL(void, TMP2446)(void* p, NI op);
N_NIMCALL(void, rawinsert_358089)(table357052* t_358098, keyvaluepairseq357055** data_358106, NimStringDesc* key_358110, NI val_358112);
N_NIMCALL(void, TMP4787)(void* p, NI op);
N_NIMCALL(NI, rawget_360312)(table358277 t_360319, tindexentry358264 key_360322);
N_NIMCALL(NI, hash_358309)(tindexentry358264 x);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_360335)(tindexentry358264 x_360339, tindexentry358264 y_360341);
N_NIMCALL(void, genericSeqAssign)(void* dest, void* src_79604, TNimType* mt);
N_NIMCALL(void, enlarge_361346)(table358277* t_361355);
N_NIMCALL(void, rawinsert_361416)(table358277* t_361425, keyvaluepairseq358280** data_361433, tindexentry358264 key_361437, TY360804* val_361439);
TNimType NTI194582; /* KeyValuePair */
TNimType NTI170017; /* SlotEnum */
extern TNimType NTI149; /* string */
extern TNimType NTI114; /* int32 */
TNimType NTI194579; /* KeyValuePairSeq */
TNimType NTI194576; /* Table */
extern TNimType NTI108; /* int */
extern tgcheap47016 gch_47044;
TNimType NTI357058; /* KeyValuePair */
TNimType NTI357055; /* KeyValuePairSeq */
TNimType NTI357052; /* Table */
TNimType NTI358283; /* KeyValuePair */
extern TNimType NTI358264; /* TIndexEntry */
extern TNimType NTI360804; /* seq[TIndexEntry] */
TNimType NTI358280; /* KeyValuePairSeq */
N_NIMCALL(void, TMP134)(void* p, NI op) {
	keyvaluepairseq194579* a;
	NI LOC1;
	a = (keyvaluepairseq194579*)p;
	LOC1 = 0;
	for (LOC1 = 0; LOC1 < a->Sup.len; LOC1++) {
	nimGCvisit((void*)a->data[LOC1].Field1, op);
	}
}

N_NIMCALL(void, inittable_194568)(NI initialsize_194573, table194576* Result) {
	(*Result).Counter = 0;
	unsureAsgnRef((void**) (&(*Result).Data), (keyvaluepairseq194579*) newSeq((&NTI194579), initialsize_194573));
}

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)), (NI32)((*a).Sup.len * 1));
	LOC11 = (LOC13 == ((NI32) 0));
	LA12: ;
	result = LOC11;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

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

N_NIMCALL(NI, rawget_194770)(table194576 t_194777, NimStringDesc* key_194780) {
	NI result;
	NI h;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = hash_127839(key_194780);
	h = (NI)(LOC1 & (t_194777.Data->Sup.len-1));
	{
		while (1) {
			if (!!((t_194777.Data->data[h].Field0 == ((NU8) 0)))) goto LA3;
			{
				NIM_BOOL LOC6;
				LOC6 = 0;
				LOC6 = eqStrings(t_194777.Data->data[h].Field1, key_194780);
				if (!(LOC6)) goto LA7;
				LOC6 = (t_194777.Data->data[h].Field0 == ((NU8) 1));
				LA7: ;
				if (!LOC6) goto LA8;
				result = h;
				goto BeforeRet;
			}
			LA8: ;
			h = nexttry_170409(h, (t_194777.Data->Sup.len-1));
		} LA3: ;
	}
	result = -1;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, haskey_194756)(table194576 t_194763, NimStringDesc* key_194766) {
	NIM_BOOL result;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = rawget_194770(t_194763, key_194766);
	result = (0 <= LOC1);
	return result;
}

N_NIMCALL(NI32, HEX5BHEX5D_194817)(table194576 t_194824, NimStringDesc* key_194827) {
	NI32 result;
	NI index;
	result = 0;
	index = rawget_194770(t_194824, key_194827);
	{
		if (!(0 <= index)) goto LA3;
		result = t_194824.Data->data[index].Field2;
	}
	LA3: ;
	return result;
}

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

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

static N_INLINE(void, rtladdzct_50204)(tcell44935* c) {
	addzct_48617((&gch_47044.Zct), c);
}

static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
	tcell44935* c;
	c = usrtocell_48646(p);
	{
		(*c).Refcount -= 8;
		if (!((NU32)((*c).Refcount) < (NU32)(8))) goto LA3;
		rtladdzct_50204(c);
	}
	LA3: ;
}

N_NIMCALL(void, rawinsert_194994)(table194576* t_195003, keyvaluepairseq194579** data_195011, NimStringDesc* key_195015, NI32 val_195017) {
	NI h;
	NI LOC1;
	NimStringDesc* LOC4;
	LOC1 = 0;
	LOC1 = hash_127839(key_195015);
	h = (NI)(LOC1 & ((*data_195011)->Sup.len-1));
	{
		while (1) {
			if (!((*data_195011)->data[h].Field0 == ((NU8) 1))) goto LA3;
			h = nexttry_170409(h, ((*data_195011)->Sup.len-1));
		} LA3: ;
	}
	LOC4 = 0;
	LOC4 = (*data_195011)->data[h].Field1; (*data_195011)->data[h].Field1 = copyStringRC1(key_195015);
	if (LOC4) nimGCunrefNoCycle(LOC4);
	(*data_195011)->data[h].Field2 = val_195017;
	(*data_195011)->data[h].Field0 = ((NU8) 1);
}

N_NIMCALL(void, enlarge_194924)(table194576* t_194933) {
	keyvaluepairseq194579* n;
	keyvaluepairseq194579* LOC8;
	n = 0;
	n = (keyvaluepairseq194579*) newSeq((&NTI194579), (NI32)((*t_194933).Data->Sup.len * 2));
	{
		NI i_194979;
		NI HEX3Atmp_195058;
		NI res_195061;
		i_194979 = 0;
		HEX3Atmp_195058 = 0;
		HEX3Atmp_195058 = ((*t_194933).Data->Sup.len-1);
		res_195061 = 0;
		{
			while (1) {
				if (!(res_195061 <= HEX3Atmp_195058)) goto LA3;
				i_194979 = res_195061;
				{
					if (!((*t_194933).Data->data[i_194979].Field0 == ((NU8) 1))) goto LA6;
					rawinsert_194994(t_194933, (&n), (*t_194933).Data->data[i_194979].Field1, (*t_194933).Data->data[i_194979].Field2);
				}
				LA6: ;
				res_195061 += 1;
			} LA3: ;
		}
	}
	LOC8 = 0;
	LOC8 = (*t_194933).Data;
	unsureAsgnRef((void**) (&(*t_194933).Data), n);
	n = LOC8;
}

N_NIMCALL(void, HEX5BHEX5DHEX3D_194879)(table194576* t_194888, NimStringDesc* key_194892, NI32 val_194894) {
	NI index;
	index = rawget_194770((*t_194888), key_194892);
	{
		if (!(0 <= index)) goto LA3;
		(*t_194888).Data->data[index].Field2 = val_194894;
	}
	goto LA1;
	LA3: ;
	{
		{
			NIM_BOOL LOC8;
			LOC8 = 0;
			LOC8 = mustrehash_170302((*t_194888).Data->Sup.len, (*t_194888).Counter);
			if (!LOC8) goto LA9;
			enlarge_194924(t_194888);
		}
		LA9: ;
		rawinsert_194994(t_194888, (&(*t_194888).Data), key_194892, val_194894);
		(*t_194888).Counter += 1;
	}
	LA1: ;
}

N_NIMCALL(NI, rawget_357894)(table357052 t_357901, NimStringDesc* key_357904) {
	NI result;
	NI h;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = hash_127839(key_357904);
	h = (NI)(LOC1 & (t_357901.Data->Sup.len-1));
	{
		while (1) {
			if (!!((t_357901.Data->data[h].Field0 == ((NU8) 0)))) goto LA3;
			{
				NIM_BOOL LOC6;
				LOC6 = 0;
				LOC6 = eqStrings(t_357901.Data->data[h].Field1, key_357904);
				if (!(LOC6)) goto LA7;
				LOC6 = (t_357901.Data->data[h].Field0 == ((NU8) 1));
				LA7: ;
				if (!LOC6) goto LA8;
				result = h;
				goto BeforeRet;
			}
			LA8: ;
			h = nexttry_170409(h, (t_357901.Data->Sup.len-1));
		} LA3: ;
	}
	result = -1;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, haskey_357880)(table357052 t_357887, NimStringDesc* key_357890) {
	NIM_BOOL result;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = rawget_357894(t_357887, key_357890);
	result = (0 <= LOC1);
	return result;
}
N_NIMCALL(void, TMP2446)(void* p, NI op) {
	keyvaluepairseq357055* a;
	NI LOC1;
	a = (keyvaluepairseq357055*)p;
	LOC1 = 0;
	for (LOC1 = 0; LOC1 < a->Sup.len; LOC1++) {
	nimGCvisit((void*)a->data[LOC1].Field1, op);
	}
}

N_NIMCALL(void, rawinsert_358089)(table357052* t_358098, keyvaluepairseq357055** data_358106, NimStringDesc* key_358110, NI val_358112) {
	NI h;
	NI LOC1;
	NimStringDesc* LOC4;
	LOC1 = 0;
	LOC1 = hash_127839(key_358110);
	h = (NI)(LOC1 & ((*data_358106)->Sup.len-1));
	{
		while (1) {
			if (!((*data_358106)->data[h].Field0 == ((NU8) 1))) goto LA3;
			h = nexttry_170409(h, ((*data_358106)->Sup.len-1));
		} LA3: ;
	}
	LOC4 = 0;
	LOC4 = (*data_358106)->data[h].Field1; (*data_358106)->data[h].Field1 = copyStringRC1(key_358110);
	if (LOC4) nimGCunrefNoCycle(LOC4);
	(*data_358106)->data[h].Field2 = val_358112;
	(*data_358106)->data[h].Field0 = ((NU8) 1);
}

N_NIMCALL(void, enlarge_358019)(table357052* t_358028) {
	keyvaluepairseq357055* n;
	keyvaluepairseq357055* LOC8;
	n = 0;
	n = (keyvaluepairseq357055*) newSeq((&NTI357055), (NI32)((*t_358028).Data->Sup.len * 2));
	{
		NI i_358074;
		NI HEX3Atmp_358153;
		NI res_358156;
		i_358074 = 0;
		HEX3Atmp_358153 = 0;
		HEX3Atmp_358153 = ((*t_358028).Data->Sup.len-1);
		res_358156 = 0;
		{
			while (1) {
				if (!(res_358156 <= HEX3Atmp_358153)) goto LA3;
				i_358074 = res_358156;
				{
					if (!((*t_358028).Data->data[i_358074].Field0 == ((NU8) 1))) goto LA6;
					rawinsert_358089(t_358028, (&n), (*t_358028).Data->data[i_358074].Field1, (*t_358028).Data->data[i_358074].Field2);
				}
				LA6: ;
				res_358156 += 1;
			} LA3: ;
		}
	}
	LOC8 = 0;
	LOC8 = (*t_358028).Data;
	unsureAsgnRef((void**) (&(*t_358028).Data), n);
	n = LOC8;
}

N_NIMCALL(void, HEX5BHEX5DHEX3D_357974)(table357052* t_357983, NimStringDesc* key_357987, NI val_357989) {
	NI index;
	index = rawget_357894((*t_357983), key_357987);
	{
		if (!(0 <= index)) goto LA3;
		(*t_357983).Data->data[index].Field2 = val_357989;
	}
	goto LA1;
	LA3: ;
	{
		{
			NIM_BOOL LOC8;
			LOC8 = 0;
			LOC8 = mustrehash_170302((*t_357983).Data->Sup.len, (*t_357983).Counter);
			if (!LOC8) goto LA9;
			enlarge_358019(t_357983);
		}
		LA9: ;
		rawinsert_358089(t_357983, (&(*t_357983).Data), key_357987, val_357989);
		(*t_357983).Counter += 1;
	}
	LA1: ;
}

N_NIMCALL(NI, HEX5BHEX5D_357943)(table357052 t_357950, NimStringDesc* key_357953) {
	NI result;
	NI index;
	result = 0;
	index = rawget_357894(t_357950, key_357953);
	{
		if (!(0 <= index)) goto LA3;
		result = t_357950.Data->data[index].Field2;
	}
	LA3: ;
	return result;
}

N_NIMCALL(void, inittable_357120)(NI initialsize_357125, table357052* Result) {
	(*Result).Counter = 0;
	unsureAsgnRef((void**) (&(*Result).Data), (keyvaluepairseq357055*) newSeq((&NTI357055), initialsize_357125));
}
N_NIMCALL(void, TMP4787)(void* p, NI op) {
	keyvaluepairseq358280* a;
	NI LOC1;
	a = (keyvaluepairseq358280*)p;
	LOC1 = 0;
	for (LOC1 = 0; LOC1 < a->Sup.len; LOC1++) {
	nimGCvisit((void*)a->data[LOC1].Field1.Keyword, op);
	nimGCvisit((void*)a->data[LOC1].Field1.Link, op);
	nimGCvisit((void*)a->data[LOC1].Field1.Linktitle, op);
	nimGCvisit((void*)a->data[LOC1].Field1.Linkdesc, op);
	nimGCvisit((void*)a->data[LOC1].Field2, op);
	}
}

N_NIMCALL(void, inittable_360830)(NI initialsize_360835, table358277* Result) {
	(*Result).Counter = 0;
	unsureAsgnRef((void**) (&(*Result).Data), (keyvaluepairseq358280*) newSeq((&NTI358280), initialsize_360835));
}

N_NIMCALL(NI, len_361285)(table358277 t_361292) {
	NI result;
	result = 0;
	result = t_361292.Counter;
	return result;
}

N_NIMCALL(NI, rawget_360312)(table358277 t_360319, tindexentry358264 key_360322) {
	NI result;
	NI h;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = hash_358309(key_360322);
	h = (NI)(LOC1 & (t_360319.Data->Sup.len-1));
	{
		while (1) {
			if (!!((t_360319.Data->data[h].Field0 == ((NU8) 0)))) goto LA3;
			{
				NIM_BOOL LOC6;
				LOC6 = 0;
				LOC6 = HEX3DHEX3D_360335(t_360319.Data->data[h].Field1, key_360322);
				if (!(LOC6)) goto LA7;
				LOC6 = (t_360319.Data->data[h].Field0 == ((NU8) 1));
				LA7: ;
				if (!LOC6) goto LA8;
				result = h;
				goto BeforeRet;
			}
			LA8: ;
			h = nexttry_170409(h, (t_360319.Data->Sup.len-1));
		} LA3: ;
	}
	result = -1;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, rawinsert_361416)(table358277* t_361425, keyvaluepairseq358280** data_361433, tindexentry358264 key_361437, TY360804* val_361439) {
	NI h;
	NI LOC1;
	NimStringDesc* LOC4;
	NimStringDesc* LOC5;
	NimStringDesc* LOC6;
	NimStringDesc* LOC7;
	LOC1 = 0;
	LOC1 = hash_358309(key_361437);
	h = (NI)(LOC1 & ((*data_361433)->Sup.len-1));
	{
		while (1) {
			if (!((*data_361433)->data[h].Field0 == ((NU8) 1))) goto LA3;
			h = nexttry_170409(h, ((*data_361433)->Sup.len-1));
		} LA3: ;
	}
	LOC4 = 0;
	LOC4 = (*data_361433)->data[h].Field1.Keyword; (*data_361433)->data[h].Field1.Keyword = copyStringRC1(key_361437.Keyword);
	if (LOC4) nimGCunrefNoCycle(LOC4);
	LOC5 = 0;
	LOC5 = (*data_361433)->data[h].Field1.Link; (*data_361433)->data[h].Field1.Link = copyStringRC1(key_361437.Link);
	if (LOC5) nimGCunrefNoCycle(LOC5);
	LOC6 = 0;
	LOC6 = (*data_361433)->data[h].Field1.Linktitle; (*data_361433)->data[h].Field1.Linktitle = copyStringRC1(key_361437.Linktitle);
	if (LOC6) nimGCunrefNoCycle(LOC6);
	LOC7 = 0;
	LOC7 = (*data_361433)->data[h].Field1.Linkdesc; (*data_361433)->data[h].Field1.Linkdesc = copyStringRC1(key_361437.Linkdesc);
	if (LOC7) nimGCunrefNoCycle(LOC7);
	genericSeqAssign((&(*data_361433)->data[h].Field2), val_361439, (&NTI360804));
	(*data_361433)->data[h].Field0 = ((NU8) 1);
}

N_NIMCALL(void, enlarge_361346)(table358277* t_361355) {
	keyvaluepairseq358280* n;
	keyvaluepairseq358280* LOC8;
	n = 0;
	n = (keyvaluepairseq358280*) newSeq((&NTI358280), (NI32)((*t_361355).Data->Sup.len * 2));
	{
		NI i_361401;
		NI HEX3Atmp_361480;
		NI res_361483;
		i_361401 = 0;
		HEX3Atmp_361480 = 0;
		HEX3Atmp_361480 = ((*t_361355).Data->Sup.len-1);
		res_361483 = 0;
		{
			while (1) {
				if (!(res_361483 <= HEX3Atmp_361480)) goto LA3;
				i_361401 = res_361483;
				{
					if (!((*t_361355).Data->data[i_361401].Field0 == ((NU8) 1))) goto LA6;
					rawinsert_361416(t_361355, (&n), (*t_361355).Data->data[i_361401].Field1, (*t_361355).Data->data[i_361401].Field2);
				}
				LA6: ;
				res_361483 += 1;
			} LA3: ;
		}
	}
	LOC8 = 0;
	LOC8 = (*t_361355).Data;
	unsureAsgnRef((void**) (&(*t_361355).Data), n);
	n = LOC8;
}

N_NIMCALL(void, HEX5BHEX5DHEX3D_361301)(table358277* t_361310, tindexentry358264 key_361314, TY360804* val_361316) {
	NI index;
	index = rawget_360312((*t_361310), key_361314);
	{
		if (!(0 <= index)) goto LA3;
		genericSeqAssign((&(*t_361310).Data->data[index].Field2), val_361316, (&NTI360804));
	}
	goto LA1;
	LA3: ;
	{
		{
			NIM_BOOL LOC8;
			LOC8 = 0;
			LOC8 = mustrehash_170302((*t_361310).Data->Sup.len, (*t_361310).Counter);
			if (!LOC8) goto LA9;
			enlarge_361346(t_361310);
		}
		LA9: ;
		rawinsert_361416(t_361310, (&(*t_361310).Data), key_361314, val_361316);
		(*t_361310).Counter += 1;
	}
	LA1: ;
}

N_NIMCALL(TY360804*, HEX5BHEX5D_360298)(table358277 t_360305, tindexentry358264 key_360308) {
	TY360804* result;
	NI index;
	result = 0;
	index = rawget_360312(t_360305, key_360308);
	{
		if (!(0 <= index)) goto LA3;
		genericSeqAssign((&result), t_360305.Data->data[index].Field2, (&NTI360804));
	}
	LA3: ;
	return result;
}
NIM_EXTERNC N_NOINLINE(void, stdlib_tablesInit)(void) {
}

NIM_EXTERNC N_NOINLINE(void, stdlib_tablesDatInit)(void) {
static TNimNode* TMP130[3];
static TNimNode* TMP131[3];
NI TMP133;
static char* NIM_CONST TMP132[3] = {
"seEmpty", 
"seFilled", 
"seDeleted"};
static TNimNode* TMP137[2];
static TNimNode* TMP2445[3];
static TNimNode* TMP4629[2];
static TNimNode* TMP4784[3];
static TNimNode TMP53[22];
NTI194582.size = sizeof(keyvaluepair194582);
NTI194582.kind = 18;
NTI194582.base = 0;
NTI194582.flags = 2;
TMP130[0] = &TMP53[1];
NTI170017.size = sizeof(NU8);
NTI170017.kind = 14;
NTI170017.base = 0;
NTI170017.flags = 3;
for (TMP133 = 0; TMP133 < 3; TMP133++) {
TMP53[TMP133+2].kind = 1;
TMP53[TMP133+2].offset = TMP133;
TMP53[TMP133+2].name = TMP132[TMP133];
TMP131[TMP133] = &TMP53[TMP133+2];
}
TMP53[5].len = 3; TMP53[5].kind = 2; TMP53[5].sons = &TMP131[0];
NTI170017.node = &TMP53[5];
TMP53[1].kind = 1;
TMP53[1].offset = offsetof(keyvaluepair194582, Field0);
TMP53[1].typ = (&NTI170017);
TMP53[1].name = "Field0";
TMP130[1] = &TMP53[6];
TMP53[6].kind = 1;
TMP53[6].offset = offsetof(keyvaluepair194582, Field1);
TMP53[6].typ = (&NTI149);
TMP53[6].name = "Field1";
TMP130[2] = &TMP53[7];
TMP53[7].kind = 1;
TMP53[7].offset = offsetof(keyvaluepair194582, Field2);
TMP53[7].typ = (&NTI114);
TMP53[7].name = "Field2";
TMP53[0].len = 3; TMP53[0].kind = 2; TMP53[0].sons = &TMP130[0];
NTI194582.node = &TMP53[0];
NTI194579.size = sizeof(keyvaluepairseq194579*);
NTI194579.kind = 24;
NTI194579.base = (&NTI194582);
NTI194579.flags = 2;
NTI194579.marker = TMP134;
NTI194576.size = sizeof(table194576);
NTI194576.kind = 18;
NTI194576.base = 0;
NTI194576.flags = 2;
TMP137[0] = &TMP53[9];
TMP53[9].kind = 1;
TMP53[9].offset = offsetof(table194576, Data);
TMP53[9].typ = (&NTI194579);
TMP53[9].name = "data";
TMP137[1] = &TMP53[10];
TMP53[10].kind = 1;
TMP53[10].offset = offsetof(table194576, Counter);
TMP53[10].typ = (&NTI108);
TMP53[10].name = "counter";
TMP53[8].len = 2; TMP53[8].kind = 2; TMP53[8].sons = &TMP137[0];
NTI194576.node = &TMP53[8];
NTI357058.size = sizeof(keyvaluepair357058);
NTI357058.kind = 18;
NTI357058.base = 0;
NTI357058.flags = 2;
TMP2445[0] = &TMP53[12];
TMP53[12].kind = 1;
TMP53[12].offset = offsetof(keyvaluepair357058, Field0);
TMP53[12].typ = (&NTI170017);
TMP53[12].name = "Field0";
TMP2445[1] = &TMP53[13];
TMP53[13].kind = 1;
TMP53[13].offset = offsetof(keyvaluepair357058, Field1);
TMP53[13].typ = (&NTI149);
TMP53[13].name = "Field1";
TMP2445[2] = &TMP53[14];
TMP53[14].kind = 1;
TMP53[14].offset = offsetof(keyvaluepair357058, Field2);
TMP53[14].typ = (&NTI108);
TMP53[14].name = "Field2";
TMP53[11].len = 3; TMP53[11].kind = 2; TMP53[11].sons = &TMP2445[0];
NTI357058.node = &TMP53[11];
NTI357055.size = sizeof(keyvaluepairseq357055*);
NTI357055.kind = 24;
NTI357055.base = (&NTI357058);
NTI357055.flags = 2;
NTI357055.marker = TMP2446;
NTI357052.size = sizeof(table357052);
NTI357052.kind = 18;
NTI357052.base = 0;
NTI357052.flags = 2;
TMP4629[0] = &TMP53[16];
TMP53[16].kind = 1;
TMP53[16].offset = offsetof(table357052, Data);
TMP53[16].typ = (&NTI357055);
TMP53[16].name = "data";
TMP4629[1] = &TMP53[17];
TMP53[17].kind = 1;
TMP53[17].offset = offsetof(table357052, Counter);
TMP53[17].typ = (&NTI108);
TMP53[17].name = "counter";
TMP53[15].len = 2; TMP53[15].kind = 2; TMP53[15].sons = &TMP4629[0];
NTI357052.node = &TMP53[15];
NTI358283.size = sizeof(keyvaluepair358283);
NTI358283.kind = 18;
NTI358283.base = 0;
NTI358283.flags = 2;
TMP4784[0] = &TMP53[19];
TMP53[19].kind = 1;
TMP53[19].offset = offsetof(keyvaluepair358283, Field0);
TMP53[19].typ = (&NTI170017);
TMP53[19].name = "Field0";
TMP4784[1] = &TMP53[20];
TMP53[20].kind = 1;
TMP53[20].offset = offsetof(keyvaluepair358283, Field1);
TMP53[20].typ = (&NTI358264);
TMP53[20].name = "Field1";
TMP4784[2] = &TMP53[21];
TMP53[21].kind = 1;
TMP53[21].offset = offsetof(keyvaluepair358283, Field2);
TMP53[21].typ = (&NTI360804);
TMP53[21].name = "Field2";
TMP53[18].len = 3; TMP53[18].kind = 2; TMP53[18].sons = &TMP4784[0];
NTI358283.node = &TMP53[18];
NTI358280.size = sizeof(keyvaluepairseq358280*);
NTI358280.kind = 24;
NTI358280.base = (&NTI358283);
NTI358280.flags = 2;
NTI358280.marker = TMP4787;
}

