/* Generated by Nim Compiler v2.2.4 */
#define NIM_INTBITS 32

#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
typedef struct tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg;
typedef struct RootObj RootObj;
typedef struct TNimTypeV2 TNimTypeV2;
typedef struct tySequence__xv3aaFd3JCw8NbmALHiezQ tySequence__xv3aaFd3JCw8NbmALHiezQ;
typedef struct tySequence__xv3aaFd3JCw8NbmALHiezQ_Content tySequence__xv3aaFd3JCw8NbmALHiezQ_Content;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyTuple__sPaDkVPSC0MkcoXCxPH9ccA tyTuple__sPaDkVPSC0MkcoXCxPH9ccA;
typedef struct tyObject_KeyError__jzGRfzBmxnPANjp71FNw5Q tyObject_KeyError__jzGRfzBmxnPANjp71FNw5Q;
typedef struct tyObject_ValueError__S29bKZF4TUS33IR7ZXb7fFA tyObject_ValueError__S29bKZF4TUS33IR7ZXb7fFA;
typedef struct tyObject_CatchableError__TCF9b1Y9b2ct0xPZvZnaY7gg tyObject_CatchableError__TCF9b1Y9b2ct0xPZvZnaY7gg;
typedef struct Exception Exception;
typedef struct tySequence__S89cE01OvNjsN9c71FKsSrqQ tySequence__S89cE01OvNjsN9c71FKsSrqQ;
typedef struct tySequence__S89cE01OvNjsN9c71FKsSrqQ_Content tySequence__S89cE01OvNjsN9c71FKsSrqQ_Content;
typedef struct tyObject_RefHeader__GDnGTjNyvwISJbkIvAst3A tyObject_RefHeader__GDnGTjNyvwISJbkIvAst3A;
typedef struct tyTuple__UV3llMMYFckfui8YMBuUZA tyTuple__UV3llMMYFckfui8YMBuUZA;
typedef struct tyObject_StackTraceEntry__RcJz5RXFIYjIseutvVFICA tyObject_StackTraceEntry__RcJz5RXFIYjIseutvVFICA;
typedef NU8 tyEnum_StringTableMode__u9a7txyB5iiP8Ga24K7XezA;
struct TNimTypeV2 {
	void* destructor;
	NI size;
	NI16 align;
	NI16 depth;
	NU32* display;
	void* traceImpl;
	void* typeInfoV1;
	NI flags;
	void* vTable[SEQ_DECL_SIZE];
};
struct RootObj {
	TNimTypeV2* m_type;
};
struct tySequence__xv3aaFd3JCw8NbmALHiezQ {
  NI len; tySequence__xv3aaFd3JCw8NbmALHiezQ_Content* p;
};
struct tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg {
	RootObj Sup;
	NI counter;
	tySequence__xv3aaFd3JCw8NbmALHiezQ data;
	tyEnum_StringTableMode__u9a7txyB5iiP8Ga24K7XezA mode;
};
struct NimStrPayload {
	NI cap;
	NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
	NI len;
	NimStrPayload* p;
};
struct tyTuple__sPaDkVPSC0MkcoXCxPH9ccA {
	NimStringV2 Field0;
	NimStringV2 Field1;
	NIM_BOOL Field2;
};
struct tySequence__S89cE01OvNjsN9c71FKsSrqQ {
  NI len; tySequence__S89cE01OvNjsN9c71FKsSrqQ_Content* p;
};
struct Exception {
	RootObj Sup;
	Exception* parent;
	NCSTRING name;
	NimStringV2 message;
	tySequence__S89cE01OvNjsN9c71FKsSrqQ trace;
	Exception* up;
};
struct tyObject_CatchableError__TCF9b1Y9b2ct0xPZvZnaY7gg {
	Exception Sup;
};
struct tyObject_ValueError__S29bKZF4TUS33IR7ZXb7fFA {
	tyObject_CatchableError__TCF9b1Y9b2ct0xPZvZnaY7gg Sup;
};
struct tyObject_KeyError__jzGRfzBmxnPANjp71FNw5Q {
	tyObject_ValueError__S29bKZF4TUS33IR7ZXb7fFA Sup;
};
struct tyObject_RefHeader__GDnGTjNyvwISJbkIvAst3A {
	NI rc;
	NI rootIdx;
};
struct tyTuple__UV3llMMYFckfui8YMBuUZA {
	NimStringV2 Field0;
	NimStringV2 Field1;
};
typedef NU8 tySet_tyEnum_FormatFlag__17DsQb3s9cHqWk1PCCl6uFQ;
typedef NU8 tyEnum_FormatFlag__17DsQb3s9cHqWk1PCCl6uFQ;
struct tySequence__xv3aaFd3JCw8NbmALHiezQ_Content { NI cap; tyTuple__sPaDkVPSC0MkcoXCxPH9ccA data[SEQ_DECL_SIZE]; };
struct tyObject_StackTraceEntry__RcJz5RXFIYjIseutvVFICA {
	NCSTRING procname;
	NI line;
	NCSTRING filename;
};
struct tySequence__S89cE01OvNjsN9c71FKsSrqQ_Content { NI cap; tyObject_StackTraceEntry__RcJz5RXFIYjIseutvVFICA data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NIMCALL(void*, nimNewObjUninit)(NI size_p0, NI alignment_p1);
N_LIB_PRIVATE N_NIMCALL(void, rttiDestroy__pureZstrtabs_u689)(void* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZstrtabs_u497)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZstrtabs_u98)(tySequence__xv3aaFd3JCw8NbmALHiezQ dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___system_u2627)(NimStringV2 dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, alignedDealloc)(void* p_p0, NI align_p1);
N_LIB_PRIVATE N_NIMCALL(tySequence__xv3aaFd3JCw8NbmALHiezQ, newSeq__pureZstrtabs_u485)(NI len_p0);
N_LIB_PRIVATE N_NIMCALL(NI, rawGet__pureZstrtabs_u285)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0, NimStringV2 key_p1);
N_LIB_PRIVATE N_NIMCALL(NI, myhash__pureZstrtabs_u265)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0, NimStringV2 key_p1);
N_LIB_PRIVATE N_NIMCALL(NI, hash__pureZhashes_u602)(NimStringV2 x_p0);
N_LIB_PRIVATE N_NIMCALL(NI, hashIgnoreCase__pureZhashes_u680)(NimStringV2 x_p0);
N_LIB_PRIVATE N_NIMCALL(NI, hashIgnoreStyle__pureZhashes_u613)(NimStringV2 x_p0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, myCmp__pureZstrtabs_u269)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0, NimStringV2 a_p1, NimStringV2 b_p2);
N_LIB_PRIVATE N_NIMCALL(NI, cmp__system_u1553)(NimStringV2 x_p0, NimStringV2 y_p1);
N_LIB_PRIVATE N_NIMCALL(NI, nsuCmpIgnoreCase)(NimStringV2 a_p0, NimStringV2 b_p1);
N_LIB_PRIVATE N_NIMCALL(NI, nsuCmpIgnoreStyle)(NimStringV2 a_p0, NimStringV2 b_p1);
static N_INLINE(NI, nextTry__pureZstrtabs_u281)(NI h_p0, NI maxHash_p1);
N_LIB_PRIVATE N_NIMCALL(void*, nimNewObj)(NI size_p0, NI alignment_p1);
static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1);
static N_INLINE(void, copyMem__system_u1718)(void* dest_p0, void* source_p1, NI size_p2);
static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space_p0);
N_LIB_PRIVATE N_NIMCALL(void, raiseExceptionEx)(Exception* e_p0, NCSTRING ename_p1, NCSTRING procname_p2, NCSTRING filename_p3, NI line_p4);
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___system_u2630)(NimStringV2* dest_p0, NimStringV2 src_p1);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, mustRehash__pureZstrtabs_u274)(NI length_p0, NI counter_p1);
N_LIB_PRIVATE N_NIMCALL(void, enlarge__pureZstrtabs_u416)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0);
N_LIB_PRIVATE N_NIMCALL(void, newSeq__pureZstrtabs_u422)(tySequence__xv3aaFd3JCw8NbmALHiezQ* s_p0, NI len_p1);
N_LIB_PRIVATE N_NIMCALL(void, rawInsert__pureZstrtabs_u404)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0, tySequence__xv3aaFd3JCw8NbmALHiezQ* data_p1, NimStringV2 key_p2, NimStringV2 val_p3);
N_LIB_PRIVATE N_NIMCALL(void, eqwasMoved___system_u2624)(NimStringV2* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___system_u2636)(NimStringV2* dest_p0, NimStringV2 src_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___pureZstrtabs_u173)(tyTuple__sPaDkVPSC0MkcoXCxPH9ccA* dest_p0, tyTuple__sPaDkVPSC0MkcoXCxPH9ccA src_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqwasMoved___pureZstrtabs_u161)(tyTuple__sPaDkVPSC0MkcoXCxPH9ccA* dest_p0);
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicDyn)(void* p_p0);
static N_INLINE(NI, minuspercent___system_u805)(NI x_p0, NI y_p1);
N_LIB_PRIVATE N_NOINLINE(void, rememberCycle__system_u3472)(NIM_BOOL isDestroyAction_p0, tyObject_RefHeader__GDnGTjNyvwISJbkIvAst3A* s_p1, TNimTypeV2* desc_p2);
N_LIB_PRIVATE N_NIMCALL(void, nimDestroyAndDispose)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg*, nstnewStringTable)(tyEnum_StringTableMode__u9a7txyB5iiP8Ga24K7XezA mode_p0);
N_LIB_PRIVATE N_NIMCALL(void, nstPut)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0, NimStringV2 key_p1, NimStringV2 val_p2);
static N_INLINE(void, nimAddCharV1)(NimStringV2* s_p0, NIM_CHAR c_p1);
N_LIB_PRIVATE N_NIMCALL(void, prepareAdd)(NimStringV2* s_p0, NI addLen_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, getValue__pureZstrtabs_u583)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0, tySet_tyEnum_FormatFlag__17DsQb3s9cHqWk1PCCl6uFQ flags_p1, NimStringV2 key_p2);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nsthasKey)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0, NimStringV2 key_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, getOrDefault__pureZstrtabs_u390)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0, NimStringV2 key_p1, NimStringV2 default_p2);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, getEnv__stdZenvvars_u16)(NimStringV2 key_p0, NimStringV2 default_p1);
static N_INLINE(void, appendChar)(NimStringV2* dest_p0, NIM_CHAR c_p1);
N_LIB_PRIVATE N_NIMCALL(void, raiseFormatException__pureZstrtabs_u580)(NimStringV2 s_p0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, substr__system_u8381)(NimStringV2 s_p0, NI first_p1, NI last_p2);
static N_INLINE(void, nimIncRefCyclic)(void* p_p0, NIM_BOOL cyclic_p1);
N_LIB_PRIVATE TNimTypeV2 NTIv2__eKsdjq89aDBcvVY68b206Qg_;
extern TNimTypeV2 NTIv2__jzGRfzBmxnPANjp71FNw5Q_;
static const struct {
  NI cap; NIM_CHAR data[15+1];
} TM__ZT9crccxweoChVXn9cHcxIXQ_3 = { 15 | NIM_STRLIT_FLAG, "key not found: " };
static const NimStringV2 TM__ZT9crccxweoChVXn9cHcxIXQ_4 = {15, (NimStrPayload*)&TM__ZT9crccxweoChVXn9cHcxIXQ_3};
static const struct {
  NI cap; NIM_CHAR data[0+1];
} TM__ZT9crccxweoChVXn9cHcxIXQ_5 = { 0 | NIM_STRLIT_FLAG, "" };
static const NimStringV2 TM__ZT9crccxweoChVXn9cHcxIXQ_6 = {0, (NimStrPayload*)&TM__ZT9crccxweoChVXn9cHcxIXQ_5};
static const NimStringV2 TM__ZT9crccxweoChVXn9cHcxIXQ_7 = {0, (NimStrPayload*)&TM__ZT9crccxweoChVXn9cHcxIXQ_5};
static const NimStringV2 TM__ZT9crccxweoChVXn9cHcxIXQ_8 = {0, (NimStrPayload*)&TM__ZT9crccxweoChVXn9cHcxIXQ_5};
static const NimStringV2 TM__ZT9crccxweoChVXn9cHcxIXQ_9 = {0, (NimStrPayload*)&TM__ZT9crccxweoChVXn9cHcxIXQ_5};
static const NimStringV2 TM__ZT9crccxweoChVXn9cHcxIXQ_10 = {0, (NimStrPayload*)&TM__ZT9crccxweoChVXn9cHcxIXQ_5};
static const NimStringV2 TM__ZT9crccxweoChVXn9cHcxIXQ_11 = {0, (NimStrPayload*)&TM__ZT9crccxweoChVXn9cHcxIXQ_5};
extern TNimTypeV2 NTIv2__S29bKZF4TUS33IR7ZXb7fFA_;
static const struct {
  NI cap; NIM_CHAR data[30+1];
} TM__ZT9crccxweoChVXn9cHcxIXQ_12 = { 30 | NIM_STRLIT_FLAG, "format string: key not found: " };
static const NimStringV2 TM__ZT9crccxweoChVXn9cHcxIXQ_13 = {30, (NimStrPayload*)&TM__ZT9crccxweoChVXn9cHcxIXQ_12};
static NIM_CONST NU32 TM__ZT9crccxweoChVXn9cHcxIXQ_2[2] = {3701606400, 2870840832};
N_LIB_PRIVATE TNimTypeV2 NTIv2__eKsdjq89aDBcvVY68b206Qg_ = {.destructor = (void*)rttiDestroy__pureZstrtabs_u689, .size = sizeof(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg), .align = (NI16) NIM_ALIGNOF(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg), .depth = 1, .display = TM__ZT9crccxweoChVXn9cHcxIXQ_2, .traceImpl = (void*)NIM_NIL, .flags = 0};
extern NIM_BOOL nimInErrorMode__system_u4306;
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZstrtabs_u98)(tySequence__xv3aaFd3JCw8NbmALHiezQ dest_p0) {
	NI colontmp_;
	colontmp_ = ((NI)0);
	{
		while (1) {
			NI T3_;
			T3_ = dest_p0.len;
			if (!(colontmp_ < T3_)) goto LA2;
			eqdestroy___system_u2627(dest_p0.p->data[colontmp_].Field0);
			eqdestroy___system_u2627(dest_p0.p->data[colontmp_].Field1);
			colontmp_ += ((NI)1);
		} LA2: ;
	}
	if (dest_p0.p && !(dest_p0.p->cap & NIM_STRLIT_FLAG)) {
 alignedDealloc(dest_p0.p, NIM_ALIGNOF(tyTuple__sPaDkVPSC0MkcoXCxPH9ccA));
}
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZstrtabs_u497)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* dest_p0) {
	eqdestroy___pureZstrtabs_u98((*dest_p0).data);
}
N_LIB_PRIVATE N_NIMCALL(void, rttiDestroy__pureZstrtabs_u689)(void* dest_p0) {
	eqdestroy___pureZstrtabs_u497((&(*((tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg*) (dest_p0)))));
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZstrtabs_u164)(tyTuple__sPaDkVPSC0MkcoXCxPH9ccA dest_p0) {
	eqdestroy___system_u2627(dest_p0.Field0);
	eqdestroy___system_u2627(dest_p0.Field1);
}
N_LIB_PRIVATE N_NIMCALL(void, eqwasMoved___pureZstrtabs_u161)(tyTuple__sPaDkVPSC0MkcoXCxPH9ccA* dest_p0) {
	(*dest_p0).Field0.len = 0; (*dest_p0).Field0.p = NIM_NIL;
	(*dest_p0).Field1.len = 0; (*dest_p0).Field1.p = NIM_NIL;
	(*dest_p0).Field2 = 0;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg*, nstnewStringTable)(tyEnum_StringTableMode__u9a7txyB5iiP8Ga24K7XezA mode_p0) {
	tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* result;
	tyEnum_StringTableMode__u9a7txyB5iiP8Ga24K7XezA colontmpD_;
	tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* T1_;
	colontmpD_ = (tyEnum_StringTableMode__u9a7txyB5iiP8Ga24K7XezA)0;
	T1_ = NIM_NIL;
	T1_ = (tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg*) nimNewObjUninit(sizeof(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg), NIM_ALIGNOF(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg));
	(*T1_).Sup.m_type = (&NTIv2__eKsdjq89aDBcvVY68b206Qg_);
	colontmpD_ = mode_p0;
	(*T1_).mode = colontmpD_;
	(*T1_).counter = ((NI)0);
	(*T1_).data = newSeq__pureZstrtabs_u485(((NI)64));
	result = T1_;
	return result;
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	result = (&nimInErrorMode__system_u4306);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, myhash__pureZstrtabs_u265)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0, NimStringV2 key_p1) {
	NI result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NI)0;
	switch ((*t_p0).mode) {
	case ((tyEnum_StringTableMode__u9a7txyB5iiP8Ga24K7XezA)0):
	{
		result = hash__pureZhashes_u602(key_p1);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	break;
	case ((tyEnum_StringTableMode__u9a7txyB5iiP8Ga24K7XezA)1):
	{
		result = hashIgnoreCase__pureZhashes_u680(key_p1);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	break;
	case ((tyEnum_StringTableMode__u9a7txyB5iiP8Ga24K7XezA)2):
	{
		result = hashIgnoreStyle__pureZhashes_u613(key_p1);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	break;
	default: __builtin_unreachable();
	}
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, myCmp__pureZstrtabs_u269)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0, NimStringV2 a_p1, NimStringV2 b_p2) {
	NIM_BOOL result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NIM_BOOL)0;
	switch ((*t_p0).mode) {
	case ((tyEnum_StringTableMode__u9a7txyB5iiP8Ga24K7XezA)0):
	{
		NI T2_;
		T2_ = (NI)0;
		T2_ = cmp__system_u1553(a_p1, b_p2);
		result = (T2_ == ((NI)0));
	}
	break;
	case ((tyEnum_StringTableMode__u9a7txyB5iiP8Ga24K7XezA)1):
	{
		NI T4_;
		T4_ = (NI)0;
		T4_ = nsuCmpIgnoreCase(a_p1, b_p2);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		result = (T4_ == ((NI)0));
	}
	break;
	case ((tyEnum_StringTableMode__u9a7txyB5iiP8Ga24K7XezA)2):
	{
		NI T6_;
		T6_ = (NI)0;
		T6_ = nsuCmpIgnoreStyle(a_p1, b_p2);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		result = (T6_ == ((NI)0));
	}
	break;
	default: __builtin_unreachable();
	}
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NI, nextTry__pureZstrtabs_u281)(NI h_p0, NI maxHash_p1) {
	NI result;
	result = (NI)((NI)(h_p0 + ((NI)1)) & maxHash_p1);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, rawGet__pureZstrtabs_u285)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0, NimStringV2 key_p1) {
	NI result;
	NI h_1;
	NI T1_;
	NI T2_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NI)0;
	T1_ = (NI)0;
	T1_ = myhash__pureZstrtabs_u265(t_p0, key_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T2_ = ((*t_p0).data.len-1);
	h_1 = (NI)(T1_ & T2_);
	{
		while (1) {
			NI T10_;
			if (!(*t_p0).data.p->data[h_1].Field2) goto LA4;
			{
				NIM_BOOL T7_;
				T7_ = (NIM_BOOL)0;
				T7_ = myCmp__pureZstrtabs_u269(t_p0, (*t_p0).data.p->data[h_1].Field0, key_p1);
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				if (!T7_) goto LA8_;
				result = h_1;
				goto BeforeRet_;
			}
LA8_: ;
			T10_ = ((*t_p0).data.len-1);
			h_1 = nextTry__pureZstrtabs_u281(h_1, T10_);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		} LA4: ;
	}
	result = ((NI)-1);
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nsthasKey)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0, NimStringV2 key_p1) {
	NIM_BOOL result;
	NI T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NIM_BOOL)0;
	T1_ = (NI)0;
	T1_ = rawGet__pureZstrtabs_u285(t_p0, key_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	result = (((NI)0) <= T1_);
	}BeforeRet_: ;
	return result;
}
static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2) {
	void* T1_;
	T1_ = (void*)0;
	T1_ = memcpy(dest_p0, source_p1, ((size_t) (size_p2)));
}
static N_INLINE(void, copyMem__system_u1718)(void* dest_p0, void* source_p1, NI size_p2) {
	nimCopyMem(dest_p0, source_p1, size_p2);
}
static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1) {
	{
		if (!(((NI)0) < src_p1.len)) goto LA3_;
		copyMem__system_u1718(((void*) ((&(*(*dest_p0).p).data[(*dest_p0).len]))), ((void*) ((&(*src_p1.p).data[((NI)0)]))), (src_p1.len));
		(*dest_p0).len += src_p1.len;
		(*(*dest_p0).p).data[(*dest_p0).len] = 0;
	}
LA3_: ;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2*, nstTake)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0, NimStringV2 key_p1) {
	NimStringV2* result;
	NI indexX60gensym3__1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NimStringV2*)0;
	indexX60gensym3__1 = rawGet__pureZstrtabs_u285(t_p0, key_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	{
		if (!(((NI)0) <= indexX60gensym3__1)) goto LA3_;
		result = (&(*t_p0).data.p->data[indexX60gensym3__1].Field1);
	}
	goto LA1_;
LA3_: ;
	{
		tyObject_KeyError__jzGRfzBmxnPANjp71FNw5Q* T6_;
		NimStringV2 T7_;
		T6_ = NIM_NIL;
		T6_ = (tyObject_KeyError__jzGRfzBmxnPANjp71FNw5Q*) nimNewObj(sizeof(tyObject_KeyError__jzGRfzBmxnPANjp71FNw5Q), NIM_ALIGNOF(tyObject_KeyError__jzGRfzBmxnPANjp71FNw5Q));
		(*T6_).Sup.Sup.Sup.Sup.m_type = (&NTIv2__jzGRfzBmxnPANjp71FNw5Q_);
		(*T6_).Sup.Sup.Sup.name = "KeyError";
		T7_.len = 0; T7_.p = NIM_NIL;
		T7_ = rawNewString(key_p1.len + 15);
appendString((&T7_), TM__ZT9crccxweoChVXn9cHcxIXQ_4);
appendString((&T7_), key_p1);
		(*T6_).Sup.Sup.Sup.message = T7_;
		(*T6_).Sup.Sup.Sup.parent = ((Exception*) NIM_NIL);
		raiseExceptionEx((Exception*)T6_, "KeyError", "[]", "strtabs.nim", 148);
goto BeforeRet_;
	}
LA1_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, mustRehash__pureZstrtabs_u274)(NI length_p0, NI counter_p1) {
	NIM_BOOL result;
	NIM_BOOL T1_;
	T1_ = (NIM_BOOL)0;
	T1_ = ((NI)(length_p0 * ((NI)2)) < (NI)(counter_p1 * ((NI)3)));
	if (T1_) goto LA2_;
	T1_ = ((NI)(length_p0 - counter_p1) < ((NI)4));
LA2_: ;
	result = T1_;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, rawInsert__pureZstrtabs_u404)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0, tySequence__xv3aaFd3JCw8NbmALHiezQ* data_p1, NimStringV2 key_p2, NimStringV2 val_p3) {
	NI h_1;
	NI T1_;
	NI T2_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	T1_ = (NI)0;
	T1_ = myhash__pureZstrtabs_u265(t_p0, key_p2);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T2_ = ((*data_p1).len-1);
	h_1 = (NI)(T1_ & T2_);
	{
		while (1) {
			NI T5_;
			if (!(*data_p1).p->data[h_1].Field2) goto LA4;
			T5_ = ((*data_p1).len-1);
			h_1 = nextTry__pureZstrtabs_u281(h_1, T5_);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		} LA4: ;
	}
	eqcopy___system_u2630((&(*data_p1).p->data[h_1].Field0), key_p2);
	eqcopy___system_u2630((&(*data_p1).p->data[h_1].Field1), val_p3);
	(*data_p1).p->data[h_1].Field2 = NIM_TRUE;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, enlarge__pureZstrtabs_u416)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0) {
	tySequence__xv3aaFd3JCw8NbmALHiezQ n_1;
	NI T1_;
	tySequence__xv3aaFd3JCw8NbmALHiezQ T10_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	n_1.len = 0; n_1.p = NIM_NIL;
	T1_ = (*t_p0).data.len;
	newSeq__pureZstrtabs_u422((&n_1), ((NI)(T1_ * ((NI)2))));
	{
		NI i_1;
		NI colontmp_;
		NI T3_;
		NI res_1;
		i_1 = (NI)0;
		colontmp_ = (NI)0;
		T3_ = ((*t_p0).data.len-1);
		colontmp_ = T3_;
		res_1 = ((NI)0);
		{
			while (1) {
				if (!(res_1 <= colontmp_)) goto LA5;
				i_1 = ((NI) (res_1));
				{
					NimStringV2 colontmpD_;
					NimStringV2 colontmpD__2;
					if (!(*t_p0).data.p->data[i_1].Field2) goto LA8_;
					colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
					colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
					colontmpD_ = (*t_p0).data.p->data[i_1].Field0;
					eqwasMoved___system_u2624((&(*t_p0).data.p->data[i_1].Field0));
					colontmpD__2 = (*t_p0).data.p->data[i_1].Field1;
					eqwasMoved___system_u2624((&(*t_p0).data.p->data[i_1].Field1));
					rawInsert__pureZstrtabs_u404(t_p0, (&n_1), colontmpD_, colontmpD__2);
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
					eqdestroy___system_u2627(colontmpD__2);
					eqdestroy___system_u2627(colontmpD_);
				}
LA8_: ;
				res_1 += ((NI)1);
			} LA5: ;
		}
	}
	T10_.len = 0; T10_.p = NIM_NIL;
	T10_ = (*t_p0).data;
	(*t_p0).data = n_1;
	n_1 = T10_;
	eqdestroy___pureZstrtabs_u98(n_1);
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, nstPut)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0, NimStringV2 key_p1, NimStringV2 val_p2) {
	NI index_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	index_1 = rawGet__pureZstrtabs_u285(t_p0, key_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	{
		if (!(((NI)0) <= index_1)) goto LA3_;
		eqcopy___system_u2630((&(*t_p0).data.p->data[index_1].Field1), val_p2);
	}
	goto LA1_;
LA3_: ;
	{
		tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* T12_;
		{
			NI T8_;
			NIM_BOOL T9_;
			T8_ = (*t_p0).data.len;
			T9_ = (NIM_BOOL)0;
			T9_ = mustRehash__pureZstrtabs_u274(T8_, (*t_p0).counter);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			if (!T9_) goto LA10_;
			enlarge__pureZstrtabs_u416(t_p0);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		}
LA10_: ;
		T12_ = NIM_NIL;
		T12_ = t_p0;
		rawInsert__pureZstrtabs_u404(T12_, (&(*t_p0).data), key_p1, val_p2);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		(*t_p0).counter += ((NI)1);
	}
LA1_: ;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, eqsink___pureZstrtabs_u173)(tyTuple__sPaDkVPSC0MkcoXCxPH9ccA* dest_p0, tyTuple__sPaDkVPSC0MkcoXCxPH9ccA src_p1) {
	if ((*dest_p0).Field0.p != src_p1.Field0.p) {	eqdestroy___system_u2627((*dest_p0).Field0);
	}
(*dest_p0).Field0.len = src_p1.Field0.len; (*dest_p0).Field0.p = src_p1.Field0.p;
	if ((*dest_p0).Field1.p != src_p1.Field1.p) {	eqdestroy___system_u2627((*dest_p0).Field1);
	}
(*dest_p0).Field1.len = src_p1.Field1.len; (*dest_p0).Field1.p = src_p1.Field1.p;
	(*dest_p0).Field2 = src_p1.Field2;
}
N_LIB_PRIVATE N_NIMCALL(void, del__pureZstrtabs_u622)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0, NimStringV2 key_p1) {
	NI i_1;
	NI msk_1;
	NI T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	i_1 = rawGet__pureZstrtabs_u285(t_p0, key_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T1_ = ((*t_p0).data.len-1);
	msk_1 = T1_;
	{
		if (!(((NI)0) <= i_1)) goto LA4_;
		(*t_p0).counter -= ((NI)1);
		{
			{
				while (1) {
					NI j_1;
					NI r_1;
					tyTuple__sPaDkVPSC0MkcoXCxPH9ccA T30_;
					j_1 = i_1;
					r_1 = j_1;
					(*t_p0).data.p->data[i_1].Field2 = NIM_FALSE;
					eqsink___system_u2636((&(*t_p0).data.p->data[i_1].Field0), TM__ZT9crccxweoChVXn9cHcxIXQ_6);
					eqsink___system_u2636((&(*t_p0).data.p->data[i_1].Field1), TM__ZT9crccxweoChVXn9cHcxIXQ_7);
					{
						while (1) {
							NI T15_;
							i_1 = (NI)((NI)(i_1 + ((NI)1)) & msk_1);
							{
								if (!!((*t_p0).data.p->data[i_1].Field2)) goto LA13_;
								goto LA6;
							}
LA13_: ;
							T15_ = (NI)0;
							T15_ = myhash__pureZstrtabs_u265(t_p0, (*t_p0).data.p->data[i_1].Field0);
							if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
							r_1 = (NI)(T15_ & msk_1);
							{
								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_1 <= i_1);
								if (!(T20_)) goto LA21_;
								T20_ = (j_1 < r_1);
LA21_: ;
								T19_ = T20_;
								if (T19_) goto LA22_;
								T23_ = (NIM_BOOL)0;
								T23_ = (j_1 < r_1);
								if (!(T23_)) goto LA24_;
								T23_ = (i_1 < j_1);
LA24_: ;
								T19_ = T23_;
LA22_: ;
								T18_ = T19_;
								if (T18_) goto LA25_;
								T26_ = (NIM_BOOL)0;
								T26_ = (i_1 < j_1);
								if (!(T26_)) goto LA27_;
								T26_ = (r_1 <= i_1);
LA27_: ;
								T18_ = T26_;
LA25_: ;
								if (!!(T18_)) goto LA28_;
								goto LA9;
							}
LA28_: ;
						}
					} LA9: ;
					T30_ = (*t_p0).data.p->data[i_1];
					eqwasMoved___pureZstrtabs_u161((&(*t_p0).data.p->data[i_1]));
					eqsink___pureZstrtabs_u173((&(*t_p0).data.p->data[j_1]), T30_);
				}
			}
		} LA6: ;
	}
LA4_: ;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(NI, nstlen)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0) {
	NI result;
	result = (*t_p0).counter;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, getOrDefault__pureZstrtabs_u390)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0, NimStringV2 key_p1, NimStringV2 default_p2) {
	NimStringV2 result;
	NI index_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result.len = 0; result.p = NIM_NIL;
	index_1 = rawGet__pureZstrtabs_u285(t_p0, key_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	{
		if (!(((NI)0) <= index_1)) goto LA3_;
		eqcopy___system_u2630((&result), (*t_p0).data.p->data[index_1].Field1);
	}
	goto LA1_;
LA3_: ;
	{
		eqcopy___system_u2630((&result), default_p2);
	}
LA1_: ;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NI, minuspercent___system_u805)(NI x_p0, NI y_p1) {
	NI result;
	result = ((NI) ((NU)((NU32)(((NU) (x_p0))) - (NU32)(((NU) (y_p1))))));
	return result;
}
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicDyn)(void* p_p0) {
	NIM_BOOL result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = NIM_FALSE;
	{
		tyObject_RefHeader__GDnGTjNyvwISJbkIvAst3A* cell_1;
		NI T5_;
		if (!!((p_p0 == NIM_NIL))) goto LA3_;
		T5_ = (NI)0;
		T5_ = minuspercent___system_u805(((NI) (ptrdiff_t) (p_p0)), ((NI)8));
		cell_1 = ((tyObject_RefHeader__GDnGTjNyvwISJbkIvAst3A*) (T5_));
		{
			if (!((NI)((*cell_1).rc & ((NI)-16)) == ((NI)0))) goto LA8_;
			result = NIM_TRUE;
		}
		goto LA6_;
LA8_: ;
		{
			(*cell_1).rc -= ((NI)16);
		}
LA6_: ;
		rememberCycle__system_u3472(result, cell_1, (*((TNimTypeV2**) (p_p0))));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA3_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqsink___pureZstrtabs_u536)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg** dest_p0, tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* src_p1) {
	tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* colontmp_;
	colontmp_ = (*dest_p0);
	(*dest_p0) = src_p1;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = nimDecRefIsLastCyclicDyn(colontmp_);
		if (!T3_) goto LA4_;
		nimDestroyAndDispose(colontmp_);
	}
LA4_: ;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg*, nstnewStringTableWithTableConstr)(tyTuple__UV3llMMYFckfui8YMBuUZA* keyValuePairs_p0, NI keyValuePairs_p0Len_0, tyEnum_StringTableMode__u9a7txyB5iiP8Ga24K7XezA mode_p1) {
	tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = NIM_NIL;
	result = nstnewStringTable(mode_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	{
		NimStringV2* key_1;
		NimStringV2* val_1;
		NI i_1;
		key_1 = (NimStringV2*)0;
		val_1 = (NimStringV2*)0;
		i_1 = ((NI)0);
		{
			while (1) {
				if (!(i_1 < keyValuePairs_p0Len_0)) goto LA3;
				key_1 = (&keyValuePairs_p0[i_1].Field0);
				val_1 = (&keyValuePairs_p0[i_1].Field1);
				nstPut(result, (*key_1), (*val_1));
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				i_1 += ((NI)1);
			} LA3: ;
		}
	}
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZstrtabs_u525)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* dest_p0) {
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = nimDecRefIsLastCyclicDyn(dest_p0);
		if (!T3_) goto LA4_;
		nimDestroyAndDispose(dest_p0);
	}
LA4_: ;
}
static N_INLINE(void, nimAddCharV1)(NimStringV2* s_p0, NIM_CHAR c_p1) {
	prepareAdd(s_p0, ((NI)1));
	(*(*s_p0).p).data[(*s_p0).len] = c_p1;
	(*s_p0).len += ((NI)1);
	(*(*s_p0).p).data[(*s_p0).len] = 0;
}
static N_INLINE(void, appendChar)(NimStringV2* dest_p0, NIM_CHAR c_p1) {
	(*(*dest_p0).p).data[(*dest_p0).len] = c_p1;
	(*dest_p0).len += ((NI)1);
	(*(*dest_p0).p).data[(*dest_p0).len] = 0;
}
N_LIB_PRIVATE N_NIMCALL(void, raiseFormatException__pureZstrtabs_u580)(NimStringV2 s_p0) {
	tyObject_ValueError__S29bKZF4TUS33IR7ZXb7fFA* T1_;
	NimStringV2 T2_;
{	T1_ = NIM_NIL;
	T1_ = (tyObject_ValueError__S29bKZF4TUS33IR7ZXb7fFA*) nimNewObj(sizeof(tyObject_ValueError__S29bKZF4TUS33IR7ZXb7fFA), NIM_ALIGNOF(tyObject_ValueError__S29bKZF4TUS33IR7ZXb7fFA));
	(*T1_).Sup.Sup.Sup.m_type = (&NTIv2__S29bKZF4TUS33IR7ZXb7fFA_);
	(*T1_).Sup.Sup.name = "ValueError";
	T2_.len = 0; T2_.p = NIM_NIL;
	T2_ = rawNewString(s_p0.len + 30);
appendString((&T2_), TM__ZT9crccxweoChVXn9cHcxIXQ_13);
appendString((&T2_), s_p0);
	(*T1_).Sup.Sup.message = T2_;
	(*T1_).Sup.Sup.parent = ((Exception*) NIM_NIL);
	raiseExceptionEx((Exception*)T1_, "ValueError", "raiseFormatException", "strtabs.nim", 300);
goto BeforeRet_;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, getValue__pureZstrtabs_u583)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0, tySet_tyEnum_FormatFlag__17DsQb3s9cHqWk1PCCl6uFQ flags_p1, NimStringV2 key_p2) {
	NimStringV2 result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result.len = 0; result.p = NIM_NIL;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = nsthasKey(t_p0, key_p2);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (!T3_) goto LA4_;
		result = getOrDefault__pureZstrtabs_u390(t_p0, key_p2, TM__ZT9crccxweoChVXn9cHcxIXQ_9);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		goto BeforeRet_;
	}
LA4_: ;
	{
		if (!((flags_p1 &((NU8)1<<((NU)((((tyEnum_FormatFlag__17DsQb3s9cHqWk1PCCl6uFQ)0)))&7U)))!=0)) goto LA8_;
		result = getEnv__stdZenvvars_u16(key_p2, TM__ZT9crccxweoChVXn9cHcxIXQ_10);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	goto LA6_;
LA8_: ;
	{
		result = TM__ZT9crccxweoChVXn9cHcxIXQ_11;
	}
LA6_: ;
	{
		if (!(result.len == ((NI)0))) goto LA13_;
		{
			NimStringV2 T19_;
			if (!((flags_p1 &((NU8)1<<((NU)((((tyEnum_FormatFlag__17DsQb3s9cHqWk1PCCl6uFQ)2)))&7U)))!=0)) goto LA17_;
			T19_.len = 0; T19_.p = NIM_NIL;
			T19_ = rawNewString(key_p2.len + 1);
appendChar((&T19_), 36);
appendString((&T19_), key_p2);
			eqsink___system_u2636((&result), T19_);
		}
		goto LA15_;
LA17_: ;
		{
			if (!!(((flags_p1 &((NU8)1<<((NU)((((tyEnum_FormatFlag__17DsQb3s9cHqWk1PCCl6uFQ)1)))&7U)))!=0))) goto LA21_;
			raiseFormatException__pureZstrtabs_u580(key_p2);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		}
		goto LA15_;
LA21_: ;
LA15_: ;
	}
LA13_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nstFormat)(NimStringV2 f_p0, tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p1, tySet_tyEnum_FormatFlag__17DsQb3s9cHqWk1PCCl6uFQ flags_p2) {
	NimStringV2 result;
	NI i_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = TM__ZT9crccxweoChVXn9cHcxIXQ_8;
	i_1 = ((NI)0);
	{
		while (1) {
			if (!(i_1 < f_p0.len)) goto LA2;
			{
				if (!((NU8)(f_p0.p->data[i_1]) == (NU8)(36))) goto LA5_;
				switch (((NU8)(f_p0.p->data[(NI)(i_1 + ((NI)1))]))) {
				case 36:
				{
					nimAddCharV1((&result), 36);
					i_1 += ((NI)2);
				}
				break;
				case 123:
				{
					NimStringV2 colontmpD_;
					NimStringV2 colontmpD__2;
					NI j_1;
					colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
					colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
					j_1 = (NI)(i_1 + ((NI)1));
					{
						while (1) {
							NIM_BOOL T12_;
							T12_ = (NIM_BOOL)0;
							T12_ = (j_1 < f_p0.len);
							if (!(T12_)) goto LA13_;
							T12_ = !(((NU8)(f_p0.p->data[j_1]) == (NU8)(125)));
LA13_: ;
							if (!T12_) goto LA11;
							j_1 += ((NI)1);
						} LA11: ;
					}
					colontmpD_ = substr__system_u8381(f_p0, (NI)(i_1 + ((NI)2)), (NI)(j_1 - ((NI)1)));
					colontmpD__2 = getValue__pureZstrtabs_u583(t_p1, flags_p2, colontmpD_);
					if (NIM_UNLIKELY(*nimErr_)) goto LA9_;
					prepareAdd((&result), colontmpD__2.len + 0);
appendString((&result), colontmpD__2);
					i_1 = (NI)(j_1 + ((NI)1));
					{
						LA9_:;
					}
					{
						eqdestroy___system_u2627(colontmpD__2);
						eqdestroy___system_u2627(colontmpD_);
					}
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				}
				break;
				case 97 ... 122:
				case 65 ... 90:
				case 128 ... 255:
				case 95:
				{
					NimStringV2 colontmpD__3;
					NimStringV2 colontmpD__4;
					NI j_2;
					colontmpD__3.len = 0; colontmpD__3.p = NIM_NIL;
					colontmpD__4.len = 0; colontmpD__4.p = NIM_NIL;
					j_2 = (NI)(i_1 + ((NI)1));
					{
						while (1) {
							NIM_BOOL T20_;
							T20_ = (NIM_BOOL)0;
							T20_ = (j_2 < f_p0.len);
							if (!(T20_)) goto LA21_;
							T20_ = (((NU8)(f_p0.p->data[j_2])) >= ((NU8)(97)) && ((NU8)(f_p0.p->data[j_2])) <= ((NU8)(122)) || ((NU8)(f_p0.p->data[j_2])) >= ((NU8)(65)) && ((NU8)(f_p0.p->data[j_2])) <= ((NU8)(90)) || ((NU8)(f_p0.p->data[j_2])) >= ((NU8)(48)) && ((NU8)(f_p0.p->data[j_2])) <= ((NU8)(57)) || ((NU8)(f_p0.p->data[j_2])) == ((NU8)(95)) || ((NU8)(f_p0.p->data[j_2])) >= ((NU8)(128)) && ((NU8)(f_p0.p->data[j_2])) <= ((NU8)(255)));
LA21_: ;
							if (!T20_) goto LA19;
							j_2 += ((NI)1);
						} LA19: ;
					}
					colontmpD__3 = substr__system_u8381(f_p0, (NI)(i_1 + ((NI)1)), (NI)(j_2 - ((NI)1)));
					colontmpD__4 = getValue__pureZstrtabs_u583(t_p1, flags_p2, colontmpD__3);
					if (NIM_UNLIKELY(*nimErr_)) goto LA17_;
					prepareAdd((&result), colontmpD__4.len + 0);
appendString((&result), colontmpD__4);
					i_1 = j_2;
					{
						LA17_:;
					}
					{
						eqdestroy___system_u2627(colontmpD__4);
						eqdestroy___system_u2627(colontmpD__3);
					}
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				}
				break;
				default:
				{
					nimAddCharV1((&result), f_p0.p->data[i_1]);
					i_1 += ((NI)1);
				}
				break;
				}
			}
			goto LA3_;
LA5_: ;
			{
				nimAddCharV1((&result), f_p0.p->data[i_1]);
				i_1 += ((NI)1);
			}
LA3_: ;
		} LA2: ;
	}
	}BeforeRet_: ;
	return result;
}
static N_INLINE(void, nimIncRefCyclic)(void* p_p0, NIM_BOOL cyclic_p1) {
	tyObject_RefHeader__GDnGTjNyvwISJbkIvAst3A* h_1;
	NI T1_;
	T1_ = (NI)0;
	T1_ = minuspercent___system_u805(((NI) (ptrdiff_t) (p_p0)), ((NI)8));
	h_1 = ((tyObject_RefHeader__GDnGTjNyvwISJbkIvAst3A*) (T1_));
	(*h_1).rc += ((NI)16);
}
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___pureZstrtabs_u528)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg** dest_p0, tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* src_p1, NIM_BOOL cyclic_p2) {
	tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* colontmp_;
	colontmp_ = (*dest_p0);
	{
		if (!src_p1) goto LA3_;
		nimIncRefCyclic(src_p1, cyclic_p2);
	}
LA3_: ;
	(*dest_p0) = src_p1;
	{
		NIM_BOOL T7_;
		T7_ = (NIM_BOOL)0;
		T7_ = nimDecRefIsLastCyclicDyn(colontmp_);
		if (!T7_) goto LA8_;
		nimDestroyAndDispose(colontmp_);
	}
LA8_: ;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, contains__pureZstrtabs_u400)(tyObject_StringTableObj__eKsdjq89aDBcvVY68b206Qg* t_p0, NimStringV2 key_p1) {
	NIM_BOOL result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NIM_BOOL)0;
	result = nsthasKey(t_p0, key_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
