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

/* section: NIM_merge_HEADERS */

#include "nimbase.h"
#include <string.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix

/* section: NIM_merge_FRAME_DEFINES */
#define nimfr_(x, y)
#define nimln_(x, y)

/* section: NIM_merge_FORWARD_TYPES */
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg;
typedef struct RootObj RootObj;
typedef struct tySequence__xv3aaFd3JCw8NbmALHiezQ tySequence__xv3aaFd3JCw8NbmALHiezQ;
typedef struct tyTuple__sPaDkVPSC0MkcoXCxPH9ccA tyTuple__sPaDkVPSC0MkcoXCxPH9ccA;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyObject_KeyError__t7nhKLvXTQS9cS8ByJU9bIag tyObject_KeyError__t7nhKLvXTQS9cS8ByJU9bIag;
typedef struct tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw;
typedef struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA;
typedef struct Exception Exception;
typedef struct tySequence__uB9b75OUPRENsBAu4AnoePA tySequence__uB9b75OUPRENsBAu4AnoePA;
typedef struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA;

/* section: NIM_merge_TYPES */
typedef NU8 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A;
typedef NU8 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ;
typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
struct TNimType {
NI size;
NI align;
tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
TNimType* base;
TNimNode* node;
void* finalizer;
tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
struct TNimNode {
tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct RootObj {
TNimType* m_type;
};
typedef NU8 tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ;
struct tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg {
  RootObj Sup;
NI counter;
tySequence__xv3aaFd3JCw8NbmALHiezQ* data;
tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ mode;
};
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct tyTuple__sPaDkVPSC0MkcoXCxPH9ccA {
NimStringDesc* Field0;
NimStringDesc* Field1;
NIM_BOOL Field2;
};
struct Exception {
  RootObj Sup;
Exception* parent;
NCSTRING name;
NimStringDesc* message;
tySequence__uB9b75OUPRENsBAu4AnoePA* trace;
Exception* up;
};
struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA {
  Exception Sup;
};
struct tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw {
  tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA Sup;
};
struct tyObject_KeyError__t7nhKLvXTQS9cS8ByJU9bIag {
  tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw Sup;
};
struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA {
NCSTRING procname;
NI line;
NCSTRING filename;
};

/* section: NIM_merge_SEQ_TYPES */
struct tySequence__xv3aaFd3JCw8NbmALHiezQ {
  TGenericSeq Sup;
  tyTuple__sPaDkVPSC0MkcoXCxPH9ccA data[SEQ_DECL_SIZE];
};
struct tySequence__uB9b75OUPRENsBAu4AnoePA {
  TGenericSeq Sup;
  tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA data[SEQ_DECL_SIZE];
};

/* section: NIM_merge_PROC_HEADERS */
N_LIB_PRIVATE N_NIMCALL(void, nimGCvisit)(void* d, NI op);
static N_NIMCALL(void, Marker_tySequence__xv3aaFd3JCw8NbmALHiezQ)(void* p, NI op);
static N_NIMCALL(void, Marker_tyRef__n9cmoMXcDs47wYDFGEXuCfw)(void* p, NI op);
N_LIB_PRIVATE N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
N_LIB_PRIVATE N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
N_LIB_PRIVATE N_NIMCALL(NI, rawGet__X5BdUJaOXir9aSEySVC9auGg)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* key);
N_LIB_PRIVATE N_NIMCALL(NI, myhash__X5BdUJaOXir9aSEySVC9auGg_2)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* key);
N_LIB_PRIVATE N_NIMCALL(NI, hash__6PCYkKlCNhq9cnRLnqWKkwQ)(NimStringDesc* x);
N_LIB_PRIVATE N_NIMCALL(NI, hashIgnoreCase__6PCYkKlCNhq9cnRLnqWKkwQ_3)(NimStringDesc* x);
N_LIB_PRIVATE N_NIMCALL(NI, hashIgnoreStyle__6PCYkKlCNhq9cnRLnqWKkwQ_2)(NimStringDesc* x);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, myCmp__eVng2zDJS9b9clmhuRshG5qw)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* a, NimStringDesc* b);
N_LIB_PRIVATE N_NIMCALL(NI, cmp__NAicU5bAGXmkx2NJujGi7g)(NimStringDesc* x, NimStringDesc* y);
N_LIB_PRIVATE N_NIMCALL(NI, nsuCmpIgnoreCase)(NimStringDesc* a, NimStringDesc* b);
N_LIB_PRIVATE N_NIMCALL(NI, nsuCmpIgnoreStyle)(NimStringDesc* a, NimStringDesc* b);
static N_INLINE(NI, nextTry__utGEK6yQ09bIOKHFXfDbVlAstrtabs)(NI h, NI maxHash);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size);
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_LIB_PRIVATE N_NIMCALL(void, raiseExceptionEx)(Exception* e, NCSTRING ename, NCSTRING procname, NCSTRING filename, NI line);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, mustRehash__gluTWOK1wKKJeMdWZL2rtA)(NI length, NI counter);
N_LIB_PRIVATE N_NIMCALL(void, enlarge__cvA7ksxbnJWGPZwLRu9c1YQ)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t);
N_LIB_PRIVATE N_NIMCALL(void, rawInsert__9cW39b7ovVEYQC3Im9cP8NBfA)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, tySequence__xv3aaFd3JCw8NbmALHiezQ** data, NimStringDesc* key, NimStringDesc* val);

/* section: NIM_merge_DATA */
extern TNimType NTI__ytyiCJqK439aF9cIibuRVpAg_;
N_LIB_PRIVATE TNimType NTI__V5PVrt9bIxZEeV7lfvqqtNg_;
extern TNimType NTI__rR5Bzr1D5krxoo1NcNyeMA_;
N_LIB_PRIVATE TNimType NTI__sPaDkVPSC0MkcoXCxPH9ccA_;
extern TNimType NTI__77mFvmsOLKik79ci2hXkHEg_;
extern TNimType NTI__VaVACK0bpYmqIQ0mKcHfQQ_;
N_LIB_PRIVATE TNimType NTI__xv3aaFd3JCw8NbmALHiezQ_;
N_LIB_PRIVATE TNimType NTI__G9c4wVDFIzf0xHmQvxso9a9cQ_;
N_LIB_PRIVATE TNimType NTI__n9cmoMXcDs47wYDFGEXuCfw_;
extern TNimType NTI__8SzoIAgLw9ci2v0yafHj9b6Q_;
extern TNimType NTI__t7nhKLvXTQS9cS8ByJU9bIag_;
STRING_LITERAL(TM__ZT9crccxweoChVXn9cHcxIXQ_7, "key not found: ", 15);

/* section: NIM_merge_VARS */
extern NIM_BOOL nimInErrorMode__759bT87luu8XGcbkw13FUjA;

/* section: NIM_merge_PROCS */
static N_NIMCALL(void, Marker_tySequence__xv3aaFd3JCw8NbmALHiezQ)(void* p, NI op) {
	tySequence__xv3aaFd3JCw8NbmALHiezQ* a;
	NI T1_;
	a = (tySequence__xv3aaFd3JCw8NbmALHiezQ*)p;
	T1_ = (NI)0;
	for (T1_ = 0; T1_ < (a ? a->Sup.len : 0); T1_++) {
	nimGCvisit((void*)a->data[T1_].Field0, op);
	nimGCvisit((void*)a->data[T1_].Field1, op);
	}
}
static N_NIMCALL(void, Marker_tyRef__n9cmoMXcDs47wYDFGEXuCfw)(void* p, NI op) {
	tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* a;
	a = (tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg*)p;
	nimGCvisit((void*)(*a).data, op);
}
N_LIB_PRIVATE N_NIMCALL(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg*, nstnewStringTable)(tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ mode) {
	tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* result;
	result = (tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg*)0;
	result = (tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg*) newObj((&NTI__n9cmoMXcDs47wYDFGEXuCfw_), sizeof(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg));
	(*result).Sup.m_type = (&NTI__V5PVrt9bIxZEeV7lfvqqtNg_);
	(*result).mode = mode;
	(*result).counter = ((NI) 0);
	(*result).data = (tySequence__xv3aaFd3JCw8NbmALHiezQ*) newSeq((&NTI__xv3aaFd3JCw8NbmALHiezQ_), ((NI) 64));
	return result;
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	result = (NIM_BOOL*)0;
	result = (&nimInErrorMode__759bT87luu8XGcbkw13FUjA);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, myhash__X5BdUJaOXir9aSEySVC9auGg_2)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* key) {
	NI result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NI)0;
	switch ((*t).mode) {
	case ((tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ) 0):
	{
		result = hash__6PCYkKlCNhq9cnRLnqWKkwQ(key);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	break;
	case ((tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ) 1):
	{
		result = hashIgnoreCase__6PCYkKlCNhq9cnRLnqWKkwQ_3(key);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	break;
	case ((tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ) 2):
	{
		result = hashIgnoreStyle__6PCYkKlCNhq9cnRLnqWKkwQ_2(key);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	break;
	}
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, myCmp__eVng2zDJS9b9clmhuRshG5qw)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* a, NimStringDesc* b) {
	NIM_BOOL result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NIM_BOOL)0;
	switch ((*t).mode) {
	case ((tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ) 0):
	{
		NI T2_;
		T2_ = (NI)0;
		T2_ = cmp__NAicU5bAGXmkx2NJujGi7g(a, b);
		result = (T2_ == ((NI) 0));
	}
	break;
	case ((tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ) 1):
	{
		NI T4_;
		T4_ = (NI)0;
		T4_ = nsuCmpIgnoreCase(a, b);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		result = (T4_ == ((NI) 0));
	}
	break;
	case ((tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ) 2):
	{
		NI T6_;
		T6_ = (NI)0;
		T6_ = nsuCmpIgnoreStyle(a, b);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		result = (T6_ == ((NI) 0));
	}
	break;
	}
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NI, nextTry__utGEK6yQ09bIOKHFXfDbVlAstrtabs)(NI h, NI maxHash) {
	NI result;
	result = (NI)0;
	result = (NI)((NI)(h + ((NI) 1)) & maxHash);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, rawGet__X5BdUJaOXir9aSEySVC9auGg)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* key) {
	NI result;
	NI h;
	NI T1_;
	NI T2_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NI)0;
	T1_ = (NI)0;
	T1_ = myhash__X5BdUJaOXir9aSEySVC9auGg_2(t, key);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T2_ = (((*t).data ? (*t).data->Sup.len : 0)-1);
	h = (NI)(T1_ & T2_);
	{
		while (1) {
			NI T10_;
			if (!(*t).data->data[h].Field2) goto LA4;
			{
				NIM_BOOL T7_;
				T7_ = (NIM_BOOL)0;
				T7_ = myCmp__eVng2zDJS9b9clmhuRshG5qw(t, (*t).data->data[h].Field0, key);
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				if (!T7_) goto LA8_;
				result = h;
				goto BeforeRet_;
			}
			LA8_: ;
			T10_ = (((*t).data ? (*t).data->Sup.len : 0)-1);
			h = nextTry__utGEK6yQ09bIOKHFXfDbVlAstrtabs(h, T10_);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		} LA4: ;
	}
	result = ((NI) -1);
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nsthasKey)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* key) {
	NIM_BOOL result;
	NI T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NIM_BOOL)0;
	T1_ = (NI)0;
	T1_ = rawGet__X5BdUJaOXir9aSEySVC9auGg(t, key);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	result = (((NI) 0) <= T1_);
	}BeforeRet_: ;
	return result;
}
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) {
	void* T1_;
	T1_ = (void*)0;
	T1_ = memcpy(dest, source, ((size_t) (size)));
}
static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size) {
	nimCopyMem(dest, source, size);
}
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
	{
		void* T5_;
		void* T6_;
		if (!!((src == NIM_NIL))) goto LA3_;
		T5_ = (void*)0;
		T5_ = ((void*) ((&(*dest).data[(*dest).Sup.len])));
		T6_ = (void*)0;
		T6_ = ((void*) ((*src).data));
		copyMem__i80o3k0SgEI5gTRCzYdyWAsystem(T5_, T6_, ((NI) ((NI)((*src).Sup.len + ((NI) 1)))));
		(*dest).Sup.len += (*src).Sup.len;
	}
	LA3_: ;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc**, nstTake)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* key) {
	NimStringDesc** result;
	NI indexX60gensym3_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NimStringDesc**)0;
	indexX60gensym3_ = rawGet__X5BdUJaOXir9aSEySVC9auGg(t, key);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	{
		if (!(((NI) 0) <= indexX60gensym3_)) goto LA3_;
		result = (&(*t).data->data[indexX60gensym3_].Field1);
	}
	goto LA1_;
	LA3_: ;
	{
		tyObject_KeyError__t7nhKLvXTQS9cS8ByJU9bIag* T6_;
		NimStringDesc* T7_;
		T6_ = (tyObject_KeyError__t7nhKLvXTQS9cS8ByJU9bIag*)0;
		T6_ = (tyObject_KeyError__t7nhKLvXTQS9cS8ByJU9bIag*) newObj((&NTI__8SzoIAgLw9ci2v0yafHj9b6Q_), sizeof(tyObject_KeyError__t7nhKLvXTQS9cS8ByJU9bIag));
		(*T6_).Sup.Sup.Sup.Sup.m_type = (&NTI__t7nhKLvXTQS9cS8ByJU9bIag_);
		(*T6_).Sup.Sup.Sup.name = "KeyError";
		T7_ = (NimStringDesc*)0;
		T7_ = rawNewString((key ? key->Sup.len : 0) + 15);
appendString(T7_, ((NimStringDesc*) &TM__ZT9crccxweoChVXn9cHcxIXQ_7));
appendString(T7_, key);
		(*T6_).Sup.Sup.Sup.message = T7_;
		(*T6_).Sup.Sup.Sup.parent = NIM_NIL;
		raiseExceptionEx((Exception*)T6_, "KeyError", "[]", "strtabs.nim", 144);
		goto BeforeRet_;
	}
	LA1_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, mustRehash__gluTWOK1wKKJeMdWZL2rtA)(NI length, NI counter) {
	NIM_BOOL result;
	NIM_BOOL T1_;
	result = (NIM_BOOL)0;
	T1_ = (NIM_BOOL)0;
	T1_ = ((NI)(length * ((NI) 2)) < (NI)(counter * ((NI) 3)));
	if (T1_) goto LA2_;
	T1_ = ((NI)(length - counter) < ((NI) 4));
	LA2_: ;
	result = T1_;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, rawInsert__9cW39b7ovVEYQC3Im9cP8NBfA)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, tySequence__xv3aaFd3JCw8NbmALHiezQ** data, NimStringDesc* key, NimStringDesc* val) {
	NI h;
	NI T1_;
	NI T2_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	T1_ = (NI)0;
	T1_ = myhash__X5BdUJaOXir9aSEySVC9auGg_2(t, key);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T2_ = (((*data) ? (*data)->Sup.len : 0)-1);
	h = (NI)(T1_ & T2_);
	{
		while (1) {
			NI T5_;
			if (!(*data)->data[h].Field2) goto LA4;
			T5_ = (((*data) ? (*data)->Sup.len : 0)-1);
			h = nextTry__utGEK6yQ09bIOKHFXfDbVlAstrtabs(h, T5_);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		} LA4: ;
	}
	(*data)->data[h].Field0 = copyString(key);
	(*data)->data[h].Field1 = copyString(val);
	(*data)->data[h].Field2 = NIM_TRUE;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, enlarge__cvA7ksxbnJWGPZwLRu9c1YQ)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t) {
	tySequence__xv3aaFd3JCw8NbmALHiezQ* n;
	NI T1_;
	tySequence__xv3aaFd3JCw8NbmALHiezQ* T14_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	n = (tySequence__xv3aaFd3JCw8NbmALHiezQ*)0;
	T1_ = ((*t).data ? (*t).data->Sup.len : 0);
	n = (tySequence__xv3aaFd3JCw8NbmALHiezQ*) newSeq((&NTI__xv3aaFd3JCw8NbmALHiezQ_), ((NI) ((NI)(T1_ * ((NI) 2)))));
	{
		NI i;
		NI colontmp_;
		NI T3_;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		T3_ = (((*t).data ? (*t).data->Sup.len : 0)-1);
		colontmp_ = T3_;
		res = ((NI) 0);
		{
			while (1) {
				if (!(res <= colontmp_)) goto LA5;
				i = res;
				{
					tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* T10_;
					NimStringDesc* T11_;
					NimStringDesc* T12_;
					NimStringDesc* T13_;
					if (!(*t).data->data[i].Field2) goto LA8_;
					T10_ = (tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg*)0;
					T10_ = t;
					T11_ = (NimStringDesc*)0;
					T11_ = (*t).data->data[i].Field0;
					(*t).data->data[i].Field0 = NIM_NIL;
					T12_ = (NimStringDesc*)0;
					T12_ = T11_;
					T13_ = (NimStringDesc*)0;
					T13_ = (*t).data->data[i].Field1;
					(*t).data->data[i].Field1 = NIM_NIL;
					rawInsert__9cW39b7ovVEYQC3Im9cP8NBfA(T10_, (&n), T12_, T13_);
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				}
				LA8_: ;
				res += ((NI) 1);
			} LA5: ;
		}
	}
	T14_ = (tySequence__xv3aaFd3JCw8NbmALHiezQ*)0;
	T14_ = (*t).data;
	(*t).data = n;
	n = T14_;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, nstPut)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* key, NimStringDesc* val) {
	NI index;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	index = rawGet__X5BdUJaOXir9aSEySVC9auGg(t, key);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	{
		if (!(((NI) 0) <= index)) goto LA3_;
		(*t).data->data[index].Field1 = copyString(val);
	}
	goto LA1_;
	LA3_: ;
	{
		tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* T12_;
		{
			NI T8_;
			NIM_BOOL T9_;
			T8_ = ((*t).data ? (*t).data->Sup.len : 0);
			T9_ = (NIM_BOOL)0;
			T9_ = mustRehash__gluTWOK1wKKJeMdWZL2rtA(T8_, (*t).counter);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			if (!T9_) goto LA10_;
			enlarge__cvA7ksxbnJWGPZwLRu9c1YQ(t);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		}
		LA10_: ;
		T12_ = (tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg*)0;
		T12_ = t;
		rawInsert__9cW39b7ovVEYQC3Im9cP8NBfA(T12_, (&(*t).data), key, val);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		(*t).counter += ((NI) 1);
	}
	LA1_: ;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(NI, nstlen)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t) {
	NI result;
	result = (NI)0;
	result = (*t).counter;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, del__EUHa9bsfDUl6q3GrReV9cQaw)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* key) {
	NI i;
	NI msk;
	NI T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	i = rawGet__X5BdUJaOXir9aSEySVC9auGg(t, key);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T1_ = (((*t).data ? (*t).data->Sup.len : 0)-1);
	msk = T1_;
	{
		if (!(((NI) 0) <= i)) goto LA4_;
		(*t).counter -= ((NI) 1);
		{
			{
				while (1) {
					NI j;
					NI r;
					j = i;
					r = j;
					(*t).data->data[i].Field2 = NIM_FALSE;
					(*t).data->data[i].Field0 = ((NimStringDesc*) NIM_NIL);
					(*t).data->data[i].Field1 = ((NimStringDesc*) NIM_NIL);
					{
						while (1) {
							NI T15_;
							i = (NI)((NI)(i + ((NI) 1)) & msk);
							{
								if (!!((*t).data->data[i].Field2)) goto LA13_;
								goto LA6;
							}
							LA13_: ;
							T15_ = (NI)0;
							T15_ = myhash__X5BdUJaOXir9aSEySVC9auGg_2(t, (*t).data->data[i].Field0);
							if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
							r = (NI)(T15_ & msk);
							{
								NIM_BOOL T18_;
								NIM_BOOL T19_;
								NIM_BOOL T20_;
								NIM_BOOL T23_;
								NIM_BOOL T26_;
								T18_ = (NIM_BOOL)0;
								T19_ = (NIM_BOOL)0;
								T20_ = (NIM_BOOL)0;
								T20_ = (r <= i);
								if (!(T20_)) goto LA21_;
								T20_ = (j < r);
								LA21_: ;
								T19_ = T20_;
								if (T19_) goto LA22_;
								T23_ = (NIM_BOOL)0;
								T23_ = (j < r);
								if (!(T23_)) goto LA24_;
								T23_ = (i < j);
								LA24_: ;
								T19_ = T23_;
								LA22_: ;
								T18_ = T19_;
								if (T18_) goto LA25_;
								T26_ = (NIM_BOOL)0;
								T26_ = (i < j);
								if (!(T26_)) goto LA27_;
								T26_ = (r <= i);
								LA27_: ;
								T18_ = T26_;
								LA25_: ;
								if (!!(T18_)) goto LA28_;
								goto LA9;
							}
							LA28_: ;
						}
					} LA9: ;
					(*t).data->data[j].Field0 = (*t).data->data[i].Field0;
					(*t).data->data[j].Field1 = (*t).data->data[i].Field1;
					(*t).data->data[j].Field2 = (*t).data->data[i].Field2;
				}
			}
		} LA6: ;
	}
	LA4_: ;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, getOrDefault__2a0cbxcfpWcXtK45m9bR5Kg)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t, NimStringDesc* key, NimStringDesc* default_0) {
	NimStringDesc* result;
	NI index;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NimStringDesc*)0;
	index = rawGet__X5BdUJaOXir9aSEySVC9auGg(t, key);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	{
		if (!(((NI) 0) <= index)) goto LA3_;
		result = copyString((*t).data->data[index].Field1);
	}
	goto LA1_;
	LA3_: ;
	{
		result = copyString(default_0);
	}
	LA1_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, stdlib_strtabsDatInit000)(void) {

/* section: NIM_merge_TYPE_INIT1 */
static TNimNode* TM__ZT9crccxweoChVXn9cHcxIXQ_2_3[3];
static TNimNode* TM__ZT9crccxweoChVXn9cHcxIXQ_3_3[3];
static TNimNode* TM__ZT9crccxweoChVXn9cHcxIXQ_4_3[3];
NI TM__ZT9crccxweoChVXn9cHcxIXQ_6;
static char* NIM_CONST TM__ZT9crccxweoChVXn9cHcxIXQ_5[3] = {
"modeCaseSensitive", 
"modeCaseInsensitive", 
"modeStyleInsensitive"};
static TNimNode TM__ZT9crccxweoChVXn9cHcxIXQ_0[12];

/* section: NIM_merge_TYPE_INIT3 */
NTI__V5PVrt9bIxZEeV7lfvqqtNg_.size = sizeof(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg);
NTI__V5PVrt9bIxZEeV7lfvqqtNg_.align = NIM_ALIGNOF(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg);
NTI__V5PVrt9bIxZEeV7lfvqqtNg_.kind = 17;
NTI__V5PVrt9bIxZEeV7lfvqqtNg_.base = (&NTI__ytyiCJqK439aF9cIibuRVpAg_);
TM__ZT9crccxweoChVXn9cHcxIXQ_2_3[0] = &TM__ZT9crccxweoChVXn9cHcxIXQ_0[1];
TM__ZT9crccxweoChVXn9cHcxIXQ_0[1].kind = 1;
TM__ZT9crccxweoChVXn9cHcxIXQ_0[1].offset = offsetof(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg, counter);
TM__ZT9crccxweoChVXn9cHcxIXQ_0[1].typ = (&NTI__rR5Bzr1D5krxoo1NcNyeMA_);
TM__ZT9crccxweoChVXn9cHcxIXQ_0[1].name = "counter";
TM__ZT9crccxweoChVXn9cHcxIXQ_2_3[1] = &TM__ZT9crccxweoChVXn9cHcxIXQ_0[2];
NTI__sPaDkVPSC0MkcoXCxPH9ccA_.size = sizeof(tyTuple__sPaDkVPSC0MkcoXCxPH9ccA);
NTI__sPaDkVPSC0MkcoXCxPH9ccA_.align = NIM_ALIGNOF(tyTuple__sPaDkVPSC0MkcoXCxPH9ccA);
NTI__sPaDkVPSC0MkcoXCxPH9ccA_.kind = 18;
NTI__sPaDkVPSC0MkcoXCxPH9ccA_.base = 0;
NTI__sPaDkVPSC0MkcoXCxPH9ccA_.flags = 2;
TM__ZT9crccxweoChVXn9cHcxIXQ_3_3[0] = &TM__ZT9crccxweoChVXn9cHcxIXQ_0[4];
TM__ZT9crccxweoChVXn9cHcxIXQ_0[4].kind = 1;
TM__ZT9crccxweoChVXn9cHcxIXQ_0[4].offset = offsetof(tyTuple__sPaDkVPSC0MkcoXCxPH9ccA, Field0);
TM__ZT9crccxweoChVXn9cHcxIXQ_0[4].typ = (&NTI__77mFvmsOLKik79ci2hXkHEg_);
TM__ZT9crccxweoChVXn9cHcxIXQ_0[4].name = "Field0";
TM__ZT9crccxweoChVXn9cHcxIXQ_3_3[1] = &TM__ZT9crccxweoChVXn9cHcxIXQ_0[5];
TM__ZT9crccxweoChVXn9cHcxIXQ_0[5].kind = 1;
TM__ZT9crccxweoChVXn9cHcxIXQ_0[5].offset = offsetof(tyTuple__sPaDkVPSC0MkcoXCxPH9ccA, Field1);
TM__ZT9crccxweoChVXn9cHcxIXQ_0[5].typ = (&NTI__77mFvmsOLKik79ci2hXkHEg_);
TM__ZT9crccxweoChVXn9cHcxIXQ_0[5].name = "Field1";
TM__ZT9crccxweoChVXn9cHcxIXQ_3_3[2] = &TM__ZT9crccxweoChVXn9cHcxIXQ_0[6];
TM__ZT9crccxweoChVXn9cHcxIXQ_0[6].kind = 1;
TM__ZT9crccxweoChVXn9cHcxIXQ_0[6].offset = offsetof(tyTuple__sPaDkVPSC0MkcoXCxPH9ccA, Field2);
TM__ZT9crccxweoChVXn9cHcxIXQ_0[6].typ = (&NTI__VaVACK0bpYmqIQ0mKcHfQQ_);
TM__ZT9crccxweoChVXn9cHcxIXQ_0[6].name = "Field2";
TM__ZT9crccxweoChVXn9cHcxIXQ_0[3].len = 3; TM__ZT9crccxweoChVXn9cHcxIXQ_0[3].kind = 2; TM__ZT9crccxweoChVXn9cHcxIXQ_0[3].sons = &TM__ZT9crccxweoChVXn9cHcxIXQ_3_3[0];
NTI__sPaDkVPSC0MkcoXCxPH9ccA_.node = &TM__ZT9crccxweoChVXn9cHcxIXQ_0[3];
NTI__xv3aaFd3JCw8NbmALHiezQ_.size = sizeof(tySequence__xv3aaFd3JCw8NbmALHiezQ*);
NTI__xv3aaFd3JCw8NbmALHiezQ_.align = NIM_ALIGNOF(tySequence__xv3aaFd3JCw8NbmALHiezQ*);
NTI__xv3aaFd3JCw8NbmALHiezQ_.kind = 24;
NTI__xv3aaFd3JCw8NbmALHiezQ_.base = (&NTI__sPaDkVPSC0MkcoXCxPH9ccA_);
NTI__xv3aaFd3JCw8NbmALHiezQ_.flags = 2;
NTI__xv3aaFd3JCw8NbmALHiezQ_.marker = Marker_tySequence__xv3aaFd3JCw8NbmALHiezQ;
TM__ZT9crccxweoChVXn9cHcxIXQ_0[2].kind = 1;
TM__ZT9crccxweoChVXn9cHcxIXQ_0[2].offset = offsetof(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg, data);
TM__ZT9crccxweoChVXn9cHcxIXQ_0[2].typ = (&NTI__xv3aaFd3JCw8NbmALHiezQ_);
TM__ZT9crccxweoChVXn9cHcxIXQ_0[2].name = "data";
TM__ZT9crccxweoChVXn9cHcxIXQ_2_3[2] = &TM__ZT9crccxweoChVXn9cHcxIXQ_0[7];
NTI__G9c4wVDFIzf0xHmQvxso9a9cQ_.size = sizeof(tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ);
NTI__G9c4wVDFIzf0xHmQvxso9a9cQ_.align = NIM_ALIGNOF(tyEnum_StringTableMode__G9c4wVDFIzf0xHmQvxso9a9cQ);
NTI__G9c4wVDFIzf0xHmQvxso9a9cQ_.kind = 14;
NTI__G9c4wVDFIzf0xHmQvxso9a9cQ_.base = 0;
NTI__G9c4wVDFIzf0xHmQvxso9a9cQ_.flags = 3;
for (TM__ZT9crccxweoChVXn9cHcxIXQ_6 = 0; TM__ZT9crccxweoChVXn9cHcxIXQ_6 < 3; TM__ZT9crccxweoChVXn9cHcxIXQ_6++) {
TM__ZT9crccxweoChVXn9cHcxIXQ_0[TM__ZT9crccxweoChVXn9cHcxIXQ_6+8].kind = 1;
TM__ZT9crccxweoChVXn9cHcxIXQ_0[TM__ZT9crccxweoChVXn9cHcxIXQ_6+8].offset = TM__ZT9crccxweoChVXn9cHcxIXQ_6;
TM__ZT9crccxweoChVXn9cHcxIXQ_0[TM__ZT9crccxweoChVXn9cHcxIXQ_6+8].name = TM__ZT9crccxweoChVXn9cHcxIXQ_5[TM__ZT9crccxweoChVXn9cHcxIXQ_6];
TM__ZT9crccxweoChVXn9cHcxIXQ_4_3[TM__ZT9crccxweoChVXn9cHcxIXQ_6] = &TM__ZT9crccxweoChVXn9cHcxIXQ_0[TM__ZT9crccxweoChVXn9cHcxIXQ_6+8];
}
TM__ZT9crccxweoChVXn9cHcxIXQ_0[11].len = 3; TM__ZT9crccxweoChVXn9cHcxIXQ_0[11].kind = 2; TM__ZT9crccxweoChVXn9cHcxIXQ_0[11].sons = &TM__ZT9crccxweoChVXn9cHcxIXQ_4_3[0];
NTI__G9c4wVDFIzf0xHmQvxso9a9cQ_.node = &TM__ZT9crccxweoChVXn9cHcxIXQ_0[11];
TM__ZT9crccxweoChVXn9cHcxIXQ_0[7].kind = 1;
TM__ZT9crccxweoChVXn9cHcxIXQ_0[7].offset = offsetof(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg, mode);
TM__ZT9crccxweoChVXn9cHcxIXQ_0[7].typ = (&NTI__G9c4wVDFIzf0xHmQvxso9a9cQ_);
TM__ZT9crccxweoChVXn9cHcxIXQ_0[7].name = "mode";
TM__ZT9crccxweoChVXn9cHcxIXQ_0[0].len = 3; TM__ZT9crccxweoChVXn9cHcxIXQ_0[0].kind = 2; TM__ZT9crccxweoChVXn9cHcxIXQ_0[0].sons = &TM__ZT9crccxweoChVXn9cHcxIXQ_2_3[0];
NTI__V5PVrt9bIxZEeV7lfvqqtNg_.node = &TM__ZT9crccxweoChVXn9cHcxIXQ_0[0];
NTI__n9cmoMXcDs47wYDFGEXuCfw_.size = sizeof(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg*);
NTI__n9cmoMXcDs47wYDFGEXuCfw_.align = NIM_ALIGNOF(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg*);
NTI__n9cmoMXcDs47wYDFGEXuCfw_.kind = 22;
NTI__n9cmoMXcDs47wYDFGEXuCfw_.base = (&NTI__V5PVrt9bIxZEeV7lfvqqtNg_);
NTI__n9cmoMXcDs47wYDFGEXuCfw_.marker = Marker_tyRef__n9cmoMXcDs47wYDFGEXuCfw;
}

