/* Generated by Nim Compiler v2.2.10 */
/* Compiled for: MacOSX, arm64, clang */
/* Command for C compiler:
   clang -c  -w -ferror-limit=3 -fno-strict-aliasing -pthread -isysroot /Applications/Xcode_16.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -target arm64-apple-darwin24.2.0 -O3   -I/Users/runner/work/nightlies/nightlies/nim-2.2.10/lib -I/Users/runner/work/nightlies/nightlies/nim-2.2.10/dist/atlas/src -o /Users/runner/work/nightlies/nightlies/nim-2.2.10/dist/atlas/.nimcache/@phttpcore.nim.c.o /Users/runner/work/nightlies/nightlies/nim-2.2.10/dist/atlas/.nimcache/@phttpcore.nim.c */
#define NIM_INTBITS 64
#define NIM_EmulateOverflowChecks

#include "nimbase.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_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw;
typedef struct tyObject_RefHeader__BVEqx9abcuAhztUEHxbqQJA tyObject_RefHeader__BVEqx9abcuAhztUEHxbqQJA;
typedef struct tyObject_Table__9c9cL6DR4DCGVMI1lXj9akt8w tyObject_Table__9c9cL6DR4DCGVMI1lXj9akt8w;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ tySequence__sM4lkSb7zS6F7OVMvW9cffQ;
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content;
typedef struct tyObject_NimRawSeq__8ODFhI7GYUKt9cpVXMRXb9bQ tyObject_NimRawSeq__8ODFhI7GYUKt9cpVXMRXb9bQ;
struct tyObject_RefHeader__BVEqx9abcuAhztUEHxbqQJA {
	NI rc;
	NI rootIdx;
};
struct tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw {
	tyObject_Table__9c9cL6DR4DCGVMI1lXj9akt8w* table;
	NIM_BOOL isTitleCase;
};
struct NimStrPayload {
	NI cap;
	NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
	NI len;
	NimStrPayload* p;
};
typedef NU8 tyEnum_HttpMethod__4f4sGD4WkkWl9cb0irqiumA;
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ {
  NI len; tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content* p;
};
struct tyObject_NimRawSeq__8ODFhI7GYUKt9cpVXMRXb9bQ {
	NI len;
	void* p;
};
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content { NI cap; NimStringV2 data[SEQ_DECL_SIZE]; };
static N_INLINE(NIM_BOOL, nimDecRefIsLast)(void* p_p0);
static N_INLINE(NI, minuspercent___system_u813)(NI x_p0, NI y_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZhttpcore_u179)(tyObject_Table__9c9cL6DR4DCGVMI1lXj9akt8w* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, nimRawDispose)(void* p_p0, NI alignment_p1);
static N_INLINE(void, nimIncRef)(void* p_p0);
static N_INLINE(NI, pluspercent___system_u793)(NI x_p0, NI y_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZhttpcore_u251)(tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void*, nimNewObjUninit)(NI size_p0, NI alignment_p1);
N_LIB_PRIVATE N_NIMCALL(tyObject_Table__9c9cL6DR4DCGVMI1lXj9akt8w*, newTable__pureZhttpcore_u128)(NI initialSize_p0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, hasKey__pureZhttpcore_u412)(tyObject_Table__9c9cL6DR4DCGVMI1lXj9akt8w* t_p0, NimStringV2 key_p1);
static N_INLINE(NimStringV2, toCaseInsensitive__pureZhttpcore_u105)(tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw* headers_p0, NimStringV2 s_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, toTitleCase__pureZhttpcore_u96)(NimStringV2 s_p0);
N_NIMCALL(NimStringV2, mnewString)(NI len_p0);
N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i_p0, NI64 a_p1, NI64 b_p2);
static N_INLINE(NIM_BOOL, nimSubInt)(NI a_p0, NI b_p1, NI* res_p2);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError2)(NI i_p0, NI n_p1);
static N_INLINE(void, nimPrepareStrMutationV2)(NimStringV2* s_p0);
N_LIB_PRIVATE N_NIMCALL(void, nimPrepareStrMutationImpl__system_u2493)(NimStringV2* s_p0);
N_LIB_PRIVATE N_NIMCALL(NIM_CHAR, nsuToUpperAsciiChar)(NIM_CHAR c_p0);
N_LIB_PRIVATE N_NIMCALL(NIM_CHAR, nsuToLowerAsciiChar)(NIM_CHAR c_p0);
static N_INLINE(NIM_BOOL, nimAddInt)(NI a_p0, NI b_p1, NI* res_p2);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nsuToLowerAsciiStr)(NimStringV2 s_p0);
N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, X5BX5Deq___pureZhttpcore_u718)(tyObject_Table__9c9cL6DR4DCGVMI1lXj9akt8w* t_p0, NimStringV2 key_p1, tySequence__sM4lkSb7zS6F7OVMvW9cffQ val_p2);
N_LIB_PRIVATE N_NIMCALL(void*, newSeqPayload)(NI cap_p0, NI elemSize_p1, NI elemAlign_p2);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, eqdup___system_u2757)(NimStringV2 src_p0);
N_LIB_PRIVATE N_NIMCALL(void, add__stdZenumutils_u70)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ* x_p0, NimStringV2 y_p1);
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ*, X5BX5D___pureZhttpcore_u565)(tyObject_Table__9c9cL6DR4DCGVMI1lXj9akt8w* t_p0, NimStringV2 key_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___system_u2754)(NimStringV2* dest_p0, NimStringV2 src_p1);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, hasKey__pureZhttpcore_u2506)(tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw* headers_p0, NimStringV2 key_p1);
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ, X5BX5D___pureZhttpcore_u1519)(tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw* headers_p0, NimStringV2 key_p1);
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ, eqdup___system_u5588)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ src_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___pureZhttpcore_u1607)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ* dest_p0, tySequence__sM4lkSb7zS6F7OVMvW9cffQ src_p1);
static N_INLINE(NIM_BOOL, sameSeqPayload)(void* x_p0, void* y_p1);
N_LIB_PRIVATE N_NIMCALL(void, setLen__system_u5486)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ* s_p0, NI newlen_p1);
N_LIB_PRIVATE N_NIMCALL(void, alignedDealloc)(void* p_p0, NI align_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___system_u5585)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ* dest_p0, tySequence__sM4lkSb7zS6F7OVMvW9cffQ src_p1);
N_LIB_PRIVATE N_NIMCALL(void, del__pureZhttpcore_u1833)(tyObject_Table__9c9cL6DR4DCGVMI1lXj9akt8w* t_p0, NimStringV2 key_p1);
static const struct {
  NI cap; NIM_CHAR data[4+1];
} TM__Evu9b2R1utZubyCikahWx1g_2 = { 4 | NIM_STRLIT_FLAG, "HEAD" };
static const NimStringV2 TM__Evu9b2R1utZubyCikahWx1g_3 = {4, (NimStrPayload*)&TM__Evu9b2R1utZubyCikahWx1g_2};
static const struct {
  NI cap; NIM_CHAR data[3+1];
} TM__Evu9b2R1utZubyCikahWx1g_4 = { 3 | NIM_STRLIT_FLAG, "GET" };
static const NimStringV2 TM__Evu9b2R1utZubyCikahWx1g_5 = {3, (NimStrPayload*)&TM__Evu9b2R1utZubyCikahWx1g_4};
static const struct {
  NI cap; NIM_CHAR data[4+1];
} TM__Evu9b2R1utZubyCikahWx1g_6 = { 4 | NIM_STRLIT_FLAG, "POST" };
static const NimStringV2 TM__Evu9b2R1utZubyCikahWx1g_7 = {4, (NimStrPayload*)&TM__Evu9b2R1utZubyCikahWx1g_6};
static const struct {
  NI cap; NIM_CHAR data[3+1];
} TM__Evu9b2R1utZubyCikahWx1g_8 = { 3 | NIM_STRLIT_FLAG, "PUT" };
static const NimStringV2 TM__Evu9b2R1utZubyCikahWx1g_9 = {3, (NimStrPayload*)&TM__Evu9b2R1utZubyCikahWx1g_8};
static const struct {
  NI cap; NIM_CHAR data[6+1];
} TM__Evu9b2R1utZubyCikahWx1g_10 = { 6 | NIM_STRLIT_FLAG, "DELETE" };
static const NimStringV2 TM__Evu9b2R1utZubyCikahWx1g_11 = {6, (NimStrPayload*)&TM__Evu9b2R1utZubyCikahWx1g_10};
static const struct {
  NI cap; NIM_CHAR data[5+1];
} TM__Evu9b2R1utZubyCikahWx1g_12 = { 5 | NIM_STRLIT_FLAG, "TRACE" };
static const NimStringV2 TM__Evu9b2R1utZubyCikahWx1g_13 = {5, (NimStrPayload*)&TM__Evu9b2R1utZubyCikahWx1g_12};
static const struct {
  NI cap; NIM_CHAR data[7+1];
} TM__Evu9b2R1utZubyCikahWx1g_14 = { 7 | NIM_STRLIT_FLAG, "OPTIONS" };
static const NimStringV2 TM__Evu9b2R1utZubyCikahWx1g_15 = {7, (NimStrPayload*)&TM__Evu9b2R1utZubyCikahWx1g_14};
static const struct {
  NI cap; NIM_CHAR data[7+1];
} TM__Evu9b2R1utZubyCikahWx1g_16 = { 7 | NIM_STRLIT_FLAG, "CONNECT" };
static const NimStringV2 TM__Evu9b2R1utZubyCikahWx1g_17 = {7, (NimStrPayload*)&TM__Evu9b2R1utZubyCikahWx1g_16};
static const struct {
  NI cap; NIM_CHAR data[5+1];
} TM__Evu9b2R1utZubyCikahWx1g_18 = { 5 | NIM_STRLIT_FLAG, "PATCH" };
static const NimStringV2 TM__Evu9b2R1utZubyCikahWx1g_19 = {5, (NimStrPayload*)&TM__Evu9b2R1utZubyCikahWx1g_18};
static const struct {
  NI cap; NIM_CHAR data[0+1];
} TM__Evu9b2R1utZubyCikahWx1g_20 = { 0 | NIM_STRLIT_FLAG, "" };
static const NimStringV2 TM__Evu9b2R1utZubyCikahWx1g_21 = {0, (NimStrPayload*)&TM__Evu9b2R1utZubyCikahWx1g_20};
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4198;
static N_INLINE(NI, minuspercent___system_u813)(NI x_p0, NI y_p1) {
	NI result;
	result = ((NI) ((NU)((NU64)(((NU) (x_p0))) - (NU64)(((NU) (y_p1))))));
	return result;
}
static N_INLINE(NIM_BOOL, nimDecRefIsLast)(void* p_p0) {
	NIM_BOOL result;
	result = NIM_FALSE;
	{
		tyObject_RefHeader__BVEqx9abcuAhztUEHxbqQJA* cell_1;
		NI T5_;
		if (!!((p_p0 == NIM_NIL))) goto LA3_;
		T5_ = (NI)0;
		T5_ = minuspercent___system_u813(((NI) (ptrdiff_t) (p_p0)), ((NI)16));
		cell_1 = ((tyObject_RefHeader__BVEqx9abcuAhztUEHxbqQJA*) (T5_));
		{
			if (!((NI)((NI64)((*cell_1).rc) >> (NU64)(((NI)4) & (64 - 1))) == ((NI)0))) goto LA8_;
			result = NIM_TRUE;
		}
		goto LA6_;
LA8_: ;
		{
			(*cell_1).rc = minuspercent___system_u813((*cell_1).rc, ((NI)16));
		}
LA6_: ;
	}
LA3_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZhttpcore_u251)(tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw* dest_p0) {
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = nimDecRefIsLast((*dest_p0).table);
		if (!T3_) goto LA4_;
		eqdestroy___pureZhttpcore_u179((*dest_p0).table);
		nimRawDispose((*dest_p0).table, ((NI)8));
	}
LA4_: ;
}
static N_INLINE(NI, pluspercent___system_u793)(NI x_p0, NI y_p1) {
	NI result;
	result = ((NI) ((NU)((NU64)(((NU) (x_p0))) + (NU64)(((NU) (y_p1))))));
	return result;
}
static N_INLINE(void, nimIncRef)(void* p_p0) {
	NI T1_;
	NI T2_;
	T1_ = (NI)0;
	T1_ = minuspercent___system_u813(((NI) (ptrdiff_t) (p_p0)), ((NI)16));
	T2_ = (NI)0;
	T2_ = minuspercent___system_u813(((NI) (ptrdiff_t) (p_p0)), ((NI)16));
	(*((tyObject_RefHeader__BVEqx9abcuAhztUEHxbqQJA*) (T1_))).rc = pluspercent___system_u793((*((tyObject_RefHeader__BVEqx9abcuAhztUEHxbqQJA*) (T2_))).rc, ((NI)16));
}
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___pureZhttpcore_u280)(tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw** dest_p0, tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw* src_p1) {
	{
		if (!src_p1) goto LA3_;
		nimIncRef(src_p1);
	}
LA3_: ;
	{
		NIM_BOOL T7_;
		T7_ = (NIM_BOOL)0;
		T7_ = nimDecRefIsLast((*dest_p0));
		if (!T7_) goto LA8_;
		eqdestroy___pureZhttpcore_u251((&(*(*dest_p0))));
		nimRawDispose((*dest_p0), ((NI)8));
	}
LA8_: ;
	(*dest_p0) = src_p1;
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	result = (&nimInErrorMode__system_u4198);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw*, newHttpHeaders__pureZhttpcore_u109)(NIM_BOOL titleCase_p0) {
	tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw* result;
	tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw* T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = NIM_NIL;
	T1_ = NIM_NIL;
	T1_ = (tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw*) nimNewObjUninit(sizeof(tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw), NIM_ALIGNOF(tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw));
	(*T1_).table = newTable__pureZhttpcore_u128(((NI)32));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	(*T1_).isTitleCase = titleCase_p0;
	result = T1_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___pureZhttpcore_u29)(tyEnum_HttpMethod__4f4sGD4WkkWl9cb0irqiumA e_p0) {
	NimStringV2 result;
	switch (e_p0) {
	case ((tyEnum_HttpMethod__4f4sGD4WkkWl9cb0irqiumA)0):
	{
		result = TM__Evu9b2R1utZubyCikahWx1g_3;
	}
	break;
	case ((tyEnum_HttpMethod__4f4sGD4WkkWl9cb0irqiumA)1):
	{
		result = TM__Evu9b2R1utZubyCikahWx1g_5;
	}
	break;
	case ((tyEnum_HttpMethod__4f4sGD4WkkWl9cb0irqiumA)2):
	{
		result = TM__Evu9b2R1utZubyCikahWx1g_7;
	}
	break;
	case ((tyEnum_HttpMethod__4f4sGD4WkkWl9cb0irqiumA)3):
	{
		result = TM__Evu9b2R1utZubyCikahWx1g_9;
	}
	break;
	case ((tyEnum_HttpMethod__4f4sGD4WkkWl9cb0irqiumA)4):
	{
		result = TM__Evu9b2R1utZubyCikahWx1g_11;
	}
	break;
	case ((tyEnum_HttpMethod__4f4sGD4WkkWl9cb0irqiumA)5):
	{
		result = TM__Evu9b2R1utZubyCikahWx1g_13;
	}
	break;
	case ((tyEnum_HttpMethod__4f4sGD4WkkWl9cb0irqiumA)6):
	{
		result = TM__Evu9b2R1utZubyCikahWx1g_15;
	}
	break;
	case ((tyEnum_HttpMethod__4f4sGD4WkkWl9cb0irqiumA)7):
	{
		result = TM__Evu9b2R1utZubyCikahWx1g_17;
	}
	break;
	case ((tyEnum_HttpMethod__4f4sGD4WkkWl9cb0irqiumA)8):
	{
		result = TM__Evu9b2R1utZubyCikahWx1g_19;
	}
	break;
	default:
	{
		result = TM__Evu9b2R1utZubyCikahWx1g_21;
	}
	break;
	}
	return result;
}
static N_INLINE(NIM_BOOL, nimSubInt)(NI a_p0, NI b_p1, NI* res_p2) {
	NIM_BOOL result;
	NI r_1;
	result = (NIM_BOOL)0;
	r_1 = ((NI) ((NU)((NU64)(((NU) (a_p0))) - (NU64)(((NU) (b_p1))))));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (((NI)0) <= (NI)(r_1 ^ a_p0));
		if (T3_) goto LA4_;
		T3_ = (((NI)0) <= (NI)(r_1 ^ (NI)((NU64) ~(b_p1))));
LA4_: ;
		if (!T3_) goto LA5_;
		(*res_p2) = r_1;
	}
	goto LA1_;
LA5_: ;
	{
		result = NIM_TRUE;
	}
LA1_: ;
	return result;
}
static N_INLINE(void, nimPrepareStrMutationV2)(NimStringV2* s_p0) {
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = !(((*s_p0).p == ((NimStrPayload*) NIM_NIL)));
		if (!(T3_)) goto LA4_;
		T3_ = ((NI)((*(*s_p0).p).cap & ((NI)IL64(4611686018427387904))) == ((NI)IL64(4611686018427387904)));
LA4_: ;
		if (!T3_) goto LA5_;
		nimPrepareStrMutationImpl__system_u2493(s_p0);
	}
LA5_: ;
}
static N_INLINE(NIM_BOOL, nimAddInt)(NI a_p0, NI b_p1, NI* res_p2) {
	NIM_BOOL result;
	NI r_1;
	result = (NIM_BOOL)0;
	r_1 = ((NI) ((NU)((NU64)(((NU) (a_p0))) + (NU64)(((NU) (b_p1))))));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (((NI)0) <= (NI)(r_1 ^ a_p0));
		if (T3_) goto LA4_;
		T3_ = (((NI)0) <= (NI)(r_1 ^ b_p1));
LA4_: ;
		if (!T3_) goto LA5_;
		(*res_p2) = r_1;
	}
	goto LA1_;
LA5_: ;
	{
		result = NIM_TRUE;
	}
LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, toTitleCase__pureZhttpcore_u96)(NimStringV2 s_p0) {
	NimStringV2 result;
	NIM_BOOL upper_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result.len = 0; result.p = NIM_NIL;
	if ((s_p0.len) < ((NI)0) || (s_p0.len) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI(s_p0.len, ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_;
	}
	result = mnewString((s_p0.len));
	upper_1 = NIM_TRUE;
	{
		NI i_1;
		NI colontmp_;
		NI TM__Evu9b2R1utZubyCikahWx1g_22;
		NI res_1;
		i_1 = (NI)0;
		colontmp_ = (NI)0;
		if (nimSubInt(s_p0.len, ((NI)1), &TM__Evu9b2R1utZubyCikahWx1g_22)) { raiseOverflow(); goto BeforeRet_;
		};
		colontmp_ = (NI)(TM__Evu9b2R1utZubyCikahWx1g_22);
		res_1 = ((NI)0);
		{
			while (1) {
				NIM_CHAR T4_;
				NI TM__Evu9b2R1utZubyCikahWx1g_23;
				if (!(res_1 <= colontmp_)) goto LA3;
				i_1 = ((NI) (res_1));
				T4_ = (NIM_CHAR)0;
				{
					NIM_CHAR T9_;
					if (!upper_1) goto LA7_;
					if (i_1 < 0 || i_1 >= result.len){ raiseIndexError2(i_1,result.len-1); goto BeforeRet_;
					}
					nimPrepareStrMutationV2((&result));
					if (i_1 < 0 || i_1 >= s_p0.len){ raiseIndexError2(i_1,s_p0.len-1); goto BeforeRet_;
					}
					T9_ = (NIM_CHAR)0;
					T9_ = nsuToUpperAsciiChar(s_p0.p->data[i_1]);
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
					result.p->data[i_1] = T9_;
				}
				goto LA5_;
LA7_: ;
				{
					NIM_CHAR T11_;
					if (i_1 < 0 || i_1 >= result.len){ raiseIndexError2(i_1,result.len-1); goto BeforeRet_;
					}
					nimPrepareStrMutationV2((&result));
					if (i_1 < 0 || i_1 >= s_p0.len){ raiseIndexError2(i_1,s_p0.len-1); goto BeforeRet_;
					}
					T11_ = (NIM_CHAR)0;
					T11_ = nsuToLowerAsciiChar(s_p0.p->data[i_1]);
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
					result.p->data[i_1] = T11_;
				}
LA5_: ;
				if (i_1 < 0 || i_1 >= s_p0.len){ raiseIndexError2(i_1,s_p0.len-1); goto BeforeRet_;
				}
				upper_1 = ((NU8)(s_p0.p->data[i_1]) == (NU8)(45));
				if (nimAddInt(res_1, ((NI)1), &TM__Evu9b2R1utZubyCikahWx1g_23)) { raiseOverflow(); goto BeforeRet_;
				};
				res_1 = (NI)(TM__Evu9b2R1utZubyCikahWx1g_23);
			} LA3: ;
		}
	}
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NimStringV2, toCaseInsensitive__pureZhttpcore_u105)(tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw* headers_p0, NimStringV2 s_p1) {
	NimStringV2 result;
	NimStringV2 T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result.len = 0; result.p = NIM_NIL;
	T1_.len = 0; T1_.p = NIM_NIL;
	{
		if (!(*headers_p0).isTitleCase) goto LA4_;
		result = toTitleCase__pureZhttpcore_u96(s_p1);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	goto LA2_;
LA4_: ;
	{
		result = nsuToLowerAsciiStr(s_p1);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA2_: ;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, hasKey__pureZhttpcore_u2506)(tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw* headers_p0, NimStringV2 key_p1) {
	NIM_BOOL result;
	NimStringV2 colontmpD_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NIM_BOOL)0;
	colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
	colontmpD_ = toCaseInsensitive__pureZhttpcore_u105(headers_p0, key_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	result = hasKey__pureZhttpcore_u412((*headers_p0).table, colontmpD_);
	if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD_.p);
}
	goto BeforeRet_;
	{
		LA1_:;
	}
	{
		if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD_.p);
}
	}
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqsink___pureZhttpcore_u286)(tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw** dest_p0, tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw* src_p1) {
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = nimDecRefIsLast((*dest_p0));
		if (!T3_) goto LA4_;
		eqdestroy___pureZhttpcore_u251((&(*(*dest_p0))));
		nimRawDispose((*dest_p0), ((NI)8));
	}
LA4_: ;
	(*dest_p0) = src_p1;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZhttpcore_u277)(tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw* dest_p0) {
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = nimDecRefIsLast(dest_p0);
		if (!T3_) goto LA4_;
		eqdestroy___pureZhttpcore_u251((&(*dest_p0)));
		nimRawDispose(dest_p0, ((NI)8));
	}
LA4_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, add__pureZhttpcore_u2291)(tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw* headers_p0, NimStringV2 key_p1, NimStringV2 value_p2) {
	NimStringV2 colontmpD_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
	{
		NIM_BOOL T4_;
		NimStringV2 colontmpD__2;
		NimStringV2 colontmpD__3;
		tySequence__sM4lkSb7zS6F7OVMvW9cffQ T7_;
		colontmpD_ = toCaseInsensitive__pureZhttpcore_u105(headers_p0, key_p1);
		if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
		T4_ = (NIM_BOOL)0;
		T4_ = hasKey__pureZhttpcore_u412((*headers_p0).table, colontmpD_);
		if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
		if (!!(T4_)) goto LA5_;
		colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
		colontmpD__2 = toCaseInsensitive__pureZhttpcore_u105(headers_p0, key_p1);
		if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
		T7_.len = 0; T7_.p = NIM_NIL;
		T7_.len = 1; T7_.p = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content*) newSeqPayload(1, sizeof(NimStringV2), NIM_ALIGNOF(NimStringV2));
		colontmpD__3 = eqdup___system_u2757(value_p2);
		T7_.p->data[0] = colontmpD__3;
		X5BX5Deq___pureZhttpcore_u718((*headers_p0).table, colontmpD__2, T7_);
		if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
		if (colontmpD__2.p && !(colontmpD__2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD__2.p);
}
	}
	goto LA2_;
LA5_: ;
	{
		NimStringV2 colontmpD__4;
		NimStringV2 colontmpD__5;
		tySequence__sM4lkSb7zS6F7OVMvW9cffQ* T10_;
		colontmpD__4.len = 0; colontmpD__4.p = NIM_NIL;
		colontmpD__4 = toCaseInsensitive__pureZhttpcore_u105(headers_p0, key_p1);
		if (NIM_UNLIKELY(*nimErr_)) goto LA9_;
		T10_ = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*)0;
		T10_ = X5BX5D___pureZhttpcore_u565((*headers_p0).table, colontmpD__4);
		if (NIM_UNLIKELY(*nimErr_)) goto LA9_;
		colontmpD__5 = eqdup___system_u2757(value_p2);
		add__stdZenumutils_u70((&(*T10_)), colontmpD__5);
		{
			LA9_:;
		}
		{
			if (colontmpD__4.p && !(colontmpD__4.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD__4.p);
}
		}
		if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	}
LA2_: ;
	{
		LA1_:;
	}
	{
		if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD_.p);
}
	}
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, toString__pureZhttpcore_u1636)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ values_p0) {
	NimStringV2 result;
{	result.len = 0; result.p = NIM_NIL;
	if (((NI)0) < 0 || ((NI)0) >= values_p0.len){ raiseIndexError2(((NI)0),values_p0.len-1); goto BeforeRet_;
	}
	eqcopy___system_u2754((&result), values_p0.p->data[((NI)0)]);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ, X5BX5D___pureZhttpcore_u1519)(tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw* headers_p0, NimStringV2 key_p1) {
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ result;
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ tmp_1;
	NimStringV2 colontmpD_;
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ colontmpD__2;
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ* T2_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result.len = 0; result.p = NIM_NIL;
	tmp_1.len = 0; tmp_1.p = NIM_NIL;
	colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
	colontmpD_ = toCaseInsensitive__pureZhttpcore_u105(headers_p0, key_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	T2_ = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*)0;
	T2_ = X5BX5D___pureZhttpcore_u565((*headers_p0).table, colontmpD_);
	if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	tmp_1 = (*T2_);
	colontmpD__2 = eqdup___system_u5588(tmp_1);
	result = colontmpD__2;
	if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD_.p);
}
	goto BeforeRet_;
	{
		LA1_:;
	}
	{
		if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD_.p);
}
	}
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NIM_BOOL, sameSeqPayload)(void* x_p0, void* y_p1) {
	NIM_BOOL result;
	result = ((*((tyObject_NimRawSeq__8ODFhI7GYUKt9cpVXMRXb9bQ*) (x_p0))).p == (*((tyObject_NimRawSeq__8ODFhI7GYUKt9cpVXMRXb9bQ*) (y_p1))).p);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___pureZhttpcore_u1607)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ* dest_p0, tySequence__sM4lkSb7zS6F7OVMvW9cffQ src_p1) {
	NI T6_;
	NI colontmp_;
{	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = sameSeqPayload(dest_p0, (&src_p1));
		if (!T3_) goto LA4_;
		goto BeforeRet_;
	}
LA4_: ;
	T6_ = src_p1.len;
	setLen__system_u5486((&(*dest_p0)), T6_);
	colontmp_ = ((NI)0);
	{
		while (1) {
			NI T9_;
			T9_ = (*dest_p0).len;
			if (!(colontmp_ < T9_)) goto LA8;
			eqcopy___system_u2754((&(*dest_p0).p->data[colontmp_]), src_p1.p->data[colontmp_]);
			colontmp_ += ((NI)1);
		} LA8: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ, getOrDefault__pureZhttpcore_u2551)(tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw* headers_p0, NimStringV2 key_p1, tySequence__sM4lkSb7zS6F7OVMvW9cffQ default_p2) {
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result.len = 0; result.p = NIM_NIL;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = hasKey__pureZhttpcore_u2506(headers_p0, key_p1);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (!T3_) goto LA4_;
		result = X5BX5D___pureZhttpcore_u1519(headers_p0, key_p1);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		goto BeforeRet_;
	}
	goto LA1_;
LA4_: ;
	{
		eqcopy___pureZhttpcore_u1607((&result), default_p2);
		goto BeforeRet_;
	}
LA1_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZhttpcore_u1600)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ dest_p0) {
	NI colontmp_;
	colontmp_ = ((NI)0);
	{
		while (1) {
			NI T3_;
			T3_ = dest_p0.len;
			if (!(colontmp_ < T3_)) goto LA2;
			if (dest_p0.p->data[colontmp_].p && !(dest_p0.p->data[colontmp_].p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(dest_p0.p->data[colontmp_].p);
}
			colontmp_ += ((NI)1);
		} LA2: ;
	}
	if (dest_p0.p && !(dest_p0.p->cap & NIM_STRLIT_FLAG)) {
 alignedDealloc(dest_p0.p, NIM_ALIGNOF(NimStringV2));
}
}
N_LIB_PRIVATE N_NIMCALL(void, X5BX5Deq___pureZhttpcore_u1698)(tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw* headers_p0, NimStringV2 key_p1, NimStringV2 value_p2) {
	NimStringV2 colontmpD_;
	NimStringV2 colontmpD__2;
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
	colontmpD_ = toCaseInsensitive__pureZhttpcore_u105(headers_p0, key_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T1_.len = 0; T1_.p = NIM_NIL;
	T1_.len = 1; T1_.p = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content*) newSeqPayload(1, sizeof(NimStringV2), NIM_ALIGNOF(NimStringV2));
	colontmpD__2 = eqdup___system_u2757(value_p2);
	T1_.p->data[0] = colontmpD__2;
	X5BX5Deq___pureZhttpcore_u718((*headers_p0).table, colontmpD_, T1_);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD_.p);
}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, X5BX5Deq___pureZhttpcore_u1748)(tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw* headers_p0, NimStringV2 key_p1, tySequence__sM4lkSb7zS6F7OVMvW9cffQ value_p2) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	{
		NI T3_;
		NimStringV2 colontmpD_;
		tySequence__sM4lkSb7zS6F7OVMvW9cffQ colontmpD__2;
		T3_ = value_p2.len;
		if (!(((NI)0) < T3_)) goto LA4_;
		colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
		colontmpD_ = toCaseInsensitive__pureZhttpcore_u105(headers_p0, key_p1);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
		eqcopy___system_u5585((&colontmpD__2), value_p2);
		X5BX5Deq___pureZhttpcore_u718((*headers_p0).table, colontmpD_, colontmpD__2);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD_.p);
}
	}
	goto LA1_;
LA4_: ;
	{
		NimStringV2 colontmpD__3;
		colontmpD__3.len = 0; colontmpD__3.p = NIM_NIL;
		colontmpD__3 = toCaseInsensitive__pureZhttpcore_u105(headers_p0, key_p1);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		del__pureZhttpcore_u1833((*headers_p0).table, colontmpD__3);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (colontmpD__3.p && !(colontmpD__3.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD__3.p);
}
	}
LA1_: ;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, del__pureZhttpcore_u2440)(tyObject_HttpHeaderscolonObjectType___BaFYu4PR2nlvZibU89b3Qqw* headers_p0, NimStringV2 key_p1) {
	NimStringV2 colontmpD_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
	colontmpD_ = toCaseInsensitive__pureZhttpcore_u105(headers_p0, key_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	del__pureZhttpcore_u1833((*headers_p0).table, colontmpD_);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD_.p);
}
	}BeforeRet_: ;
}
