/* 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 tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyObject_Table__qagh2zcXAhSb9aRfetCb26g tyObject_Table__qagh2zcXAhSb9aRfetCb26g;
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ tySequence__sM4lkSb7zS6F7OVMvW9cffQ;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA;
typedef struct tySequence__JiteSJxrvz63iP2o9bcn2Sg tySequence__JiteSJxrvz63iP2o9bcn2Sg;
typedef struct tyTuple__UV3llMMYFckfui8YMBuUZA tyTuple__UV3llMMYFckfui8YMBuUZA;
typedef struct tyTuple__g1w83cyyBYiVU9c8WEJWnjQ tyTuple__g1w83cyyBYiVU9c8WEJWnjQ;

/* section: NIM_merge_TYPES */
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA {
tyObject_Table__qagh2zcXAhSb9aRfetCb26g* table;
NIM_BOOL isTitleCase;
};
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;
};
typedef NU8 tyEnum_HttpMethod__wfZHspwVKQPl9aWhkIcMrAA;
struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA {
NI a;
NI b;
};
struct tyObject_Table__qagh2zcXAhSb9aRfetCb26g {
tySequence__JiteSJxrvz63iP2o9bcn2Sg* data;
NI counter;
};
struct tyTuple__UV3llMMYFckfui8YMBuUZA {
NimStringDesc* Field0;
NimStringDesc* Field1;
};
struct tyTuple__g1w83cyyBYiVU9c8WEJWnjQ {
NI Field0;
NimStringDesc* Field1;
tySequence__sM4lkSb7zS6F7OVMvW9cffQ* Field2;
};

/* section: NIM_merge_SEQ_TYPES */
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct tySequence__JiteSJxrvz63iP2o9bcn2Sg {
  TGenericSeq Sup;
  tyTuple__g1w83cyyBYiVU9c8WEJWnjQ data[SEQ_DECL_SIZE];
};

/* section: NIM_merge_PROC_HEADERS */
N_LIB_PRIVATE N_NIMCALL(void, X5BX5Deq___cCZ4Lm3CwSTyjJEZ4An8yw)(tyObject_Table__qagh2zcXAhSb9aRfetCb26g* t, NimStringDesc* key, tySequence__sM4lkSb7zS6F7OVMvW9cffQ* val);
static N_INLINE(NimStringDesc*, toCaseInsensitive__61qaIoqIEFnR1irnyarMvQhttpcore)(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA* headers, NimStringDesc* s);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toTitleCase__uO8A9bNhKJy4mafTDi0wqNA)(NimStringDesc* s);
N_NIMCALL(NimStringDesc*, mnewString)(NI len);
N_LIB_PRIVATE N_NIMCALL(NIM_CHAR, nsuToUpperAsciiChar)(NIM_CHAR c);
N_LIB_PRIVATE N_NIMCALL(NIM_CHAR, nsuToLowerAsciiChar)(NIM_CHAR c);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuToLowerAsciiStr)(NimStringDesc* s);
N_LIB_PRIVATE N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, hasKey__W32mVXeOomM1v9brOiEZsMQ)(tyObject_Table__qagh2zcXAhSb9aRfetCb26g* t, NimStringDesc* key);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuToUpperAsciiStr)(NimStringDesc* s);
static N_INLINE(NimStringDesc*, X5BX5D___ogYTOKbgqbjPfyC123US1gsystem)(NimStringDesc* s, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA x);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, reprEnum)(NI e, TNimType* typ);
static N_INLINE(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA, dotdot___xNR8BVBMWzS9bXXNMikmyLgsystem)(NI a, NI b);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
N_LIB_PRIVATE N_NIMCALL(void, nimGCvisit)(void* d, NI op);
static N_NIMCALL(void, Marker_tyRef__FbZeO4trJhT2CCJ9aLxejqw)(void* p, NI op);
N_LIB_PRIVATE N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
N_LIB_PRIVATE N_NIMCALL(tyObject_Table__qagh2zcXAhSb9aRfetCb26g*, newTable__j9aovL9c5jjTLwk0JUYr9b7Tg)(NI initialSize);
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ**, X5BX5D___Nb82lIHpq89cl6q2YU4EZlg)(tyObject_Table__qagh2zcXAhSb9aRfetCb26g* t, NimStringDesc* key);
N_LIB_PRIVATE N_NIMCALL(TGenericSeq*, incrSeqV3)(TGenericSeq* s, TNimType* typ);
N_LIB_PRIVATE N_NIMCALL(NI, len__J4hnoSPhc6KiK07n7KgZ9cQ)(tyObject_Table__qagh2zcXAhSb9aRfetCb26g* t);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, hasKey__jz0AniI5No9bnkMo9aqdkc2A)(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA* headers, NimStringDesc* key);
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ*, X5BX5D___F8UGF8XOf3lJ0eLDjh362w)(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA* headers, NimStringDesc* key);
N_LIB_PRIVATE N_NIMCALL(void, genericSeqAssign)(void* dest, void* src, TNimType* mt);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, contains__W32mVXeOomM1v9brOiEZsMQ_2)(tyObject_Table__qagh2zcXAhSb9aRfetCb26g* t, NimStringDesc* key);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___yhXmGIhb5BndEAAUCz4aXQ)(tyObject_Table__qagh2zcXAhSb9aRfetCb26g* t);

/* section: NIM_merge_DATA */
extern TNimType NTI__sM4lkSb7zS6F7OVMvW9cffQ_;
N_LIB_PRIVATE TNimType NTI__wfZHspwVKQPl9aWhkIcMrAA_;
N_LIB_PRIVATE TNimType NTI__GM611pWlOrQ7hvMPcuAACA_;
extern TNimType NTI__jUGi19aimy3OEChVtuezLZg_;
extern TNimType NTI__VaVACK0bpYmqIQ0mKcHfQQ_;
N_LIB_PRIVATE TNimType NTI__FbZeO4trJhT2CCJ9aLxejqw_;

/* section: NIM_merge_VARS */
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__759bT87luu8XGcbkw13FUjA;

/* section: NIM_merge_PROCS */
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	result = (NIM_BOOL*)0;
	result = (&nimInErrorMode__759bT87luu8XGcbkw13FUjA);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toTitleCase__uO8A9bNhKJy4mafTDi0wqNA)(NimStringDesc* s) {
	NimStringDesc* result;
	NIM_BOOL upper;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NimStringDesc*)0;
	result = mnewString(((NI) ((s ? s->Sup.len : 0))));
	upper = NIM_TRUE;
	{
		NI i;
		NI colontmp_;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (NI)((s ? s->Sup.len : 0) - ((NI) 1));
		res = ((NI) 0);
		{
			while (1) {
				if (!(res <= colontmp_)) goto LA3;
				i = res;
				{
					NIM_CHAR T8_;
					if (!upper) goto LA6_;
					T8_ = (NIM_CHAR)0;
					T8_ = nsuToUpperAsciiChar(s->data[i]);
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
					result->data[i] = T8_;
				}
				goto LA4_;
				LA6_: ;
				{
					NIM_CHAR T10_;
					T10_ = (NIM_CHAR)0;
					T10_ = nsuToLowerAsciiChar(s->data[i]);
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
					result->data[i] = T10_;
				}
				LA4_: ;
				upper = ((NU8)(s->data[i]) == (NU8)(45));
				res += ((NI) 1);
			} LA3: ;
		}
	}
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NimStringDesc*, toCaseInsensitive__61qaIoqIEFnR1irnyarMvQhttpcore)(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA* headers, NimStringDesc* s) {
	NimStringDesc* result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NimStringDesc*)0;
	{
		if (!(*headers).isTitleCase) goto LA3_;
		result = toTitleCase__uO8A9bNhKJy4mafTDi0wqNA(s);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	goto LA1_;
	LA3_: ;
	{
		result = nsuToLowerAsciiStr(s);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	LA1_: ;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, X5BX5Deq___Iy0txpq5svlfrlKS9bU28Kw)(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA* headers, NimStringDesc* key, NimStringDesc* value) {
	tyObject_Table__qagh2zcXAhSb9aRfetCb26g* T1_;
	NimStringDesc* T2_;
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ* T3_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	T1_ = (tyObject_Table__qagh2zcXAhSb9aRfetCb26g*)0;
	T1_ = (*headers).table;
	T2_ = (NimStringDesc*)0;
	T2_ = toCaseInsensitive__61qaIoqIEFnR1irnyarMvQhttpcore(headers, key);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T3_ = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*)0;
	T3_ = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*) newSeq((&NTI__sM4lkSb7zS6F7OVMvW9cffQ_), 1);
	T3_->data[0] = copyString(value);
	X5BX5Deq___cCZ4Lm3CwSTyjJEZ4An8yw(T1_, T2_, T3_);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, hasKey__jz0AniI5No9bnkMo9aqdkc2A)(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA* headers, NimStringDesc* key) {
	NIM_BOOL result;
	tyObject_Table__qagh2zcXAhSb9aRfetCb26g* T1_;
	NimStringDesc* T2_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NIM_BOOL)0;
	T1_ = (tyObject_Table__qagh2zcXAhSb9aRfetCb26g*)0;
	T1_ = (*headers).table;
	T2_ = (NimStringDesc*)0;
	T2_ = toCaseInsensitive__61qaIoqIEFnR1irnyarMvQhttpcore(headers, key);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	result = hasKey__W32mVXeOomM1v9brOiEZsMQ(T1_, T2_);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NimStringDesc*, X5BX5D___ogYTOKbgqbjPfyC123US1gsystem)(NimStringDesc* s, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA x) {
	NimStringDesc* result;
	NI a;
	NI L;
	result = (NimStringDesc*)0;
	a = x.a;
	L = (NI)((NI)((NI)((s ? s->Sup.len : 0) - x.b) - a) + ((NI) 1));
	result = mnewString(((NI) (L)));
	{
		NI i;
		NI i_2;
		i = (NI)0;
		i_2 = ((NI) 0);
		{
			while (1) {
				if (!(i_2 < L)) goto LA3;
				i = i_2;
				result->data[i] = s->data[(NI)(i + a)];
				i_2 += ((NI) 1);
			} LA3: ;
		}
	}
	return result;
}
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) {
	void* T1_;
	T1_ = (void*)0;
	T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
static N_INLINE(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA, dotdot___xNR8BVBMWzS9bXXNMikmyLgsystem)(NI a, NI b) {
	tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA result;
	nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA));
	nimZeroMem((void*)(&result), sizeof(tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA));
	result.a = a;
	result.b = b;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___JcSadDOgpYarTBAbeNWqTw)(tyEnum_HttpMethod__wfZHspwVKQPl9aWhkIcMrAA httpMethod) {
	NimStringDesc* result;
	tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA T1_;
	NimStringDesc* T2_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NimStringDesc*)0;
	T1_ = dotdot___xNR8BVBMWzS9bXXNMikmyLgsystem(((NI) 4), ((NI) 1));
	T2_ = (NimStringDesc*)0;
	T2_ = X5BX5D___ogYTOKbgqbjPfyC123US1gsystem(reprEnum((NI)httpMethod, (&NTI__wfZHspwVKQPl9aWhkIcMrAA_)), T1_);
	result = nsuToUpperAsciiStr(T2_);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
static N_NIMCALL(void, Marker_tyRef__FbZeO4trJhT2CCJ9aLxejqw)(void* p, NI op) {
	tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA* a;
	a = (tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA*)p;
	nimGCvisit((void*)(*a).table, op);
}
N_LIB_PRIVATE N_NIMCALL(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA*, newHttpHeaders__m5XuFRjmtJnvrQCk25khAA)(NIM_BOOL titleCase) {
	tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA* result;
	tyObject_Table__qagh2zcXAhSb9aRfetCb26g* T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA*)0;
	result = (tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA*) newObj((&NTI__FbZeO4trJhT2CCJ9aLxejqw_), sizeof(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA));
	T1_ = (tyObject_Table__qagh2zcXAhSb9aRfetCb26g*)0;
	T1_ = newTable__j9aovL9c5jjTLwk0JUYr9b7Tg(((NI) 32));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	(*result).table = T1_;
	(*result).isTitleCase = titleCase;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, add__Iy0txpq5svlfrlKS9bU28Kw_2)(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA* headers, NimStringDesc* key, NimStringDesc* value) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	{
		tyObject_Table__qagh2zcXAhSb9aRfetCb26g* T3_;
		NimStringDesc* T4_;
		NIM_BOOL T5_;
		tyObject_Table__qagh2zcXAhSb9aRfetCb26g* T8_;
		NimStringDesc* T9_;
		tySequence__sM4lkSb7zS6F7OVMvW9cffQ* T10_;
		T3_ = (tyObject_Table__qagh2zcXAhSb9aRfetCb26g*)0;
		T3_ = (*headers).table;
		T4_ = (NimStringDesc*)0;
		T4_ = toCaseInsensitive__61qaIoqIEFnR1irnyarMvQhttpcore(headers, key);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		T5_ = (NIM_BOOL)0;
		T5_ = hasKey__W32mVXeOomM1v9brOiEZsMQ(T3_, T4_);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (!!(T5_)) goto LA6_;
		T8_ = (tyObject_Table__qagh2zcXAhSb9aRfetCb26g*)0;
		T8_ = (*headers).table;
		T9_ = (NimStringDesc*)0;
		T9_ = toCaseInsensitive__61qaIoqIEFnR1irnyarMvQhttpcore(headers, key);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		T10_ = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*)0;
		T10_ = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*) newSeq((&NTI__sM4lkSb7zS6F7OVMvW9cffQ_), 1);
		T10_->data[0] = copyString(value);
		X5BX5Deq___cCZ4Lm3CwSTyjJEZ4An8yw(T8_, T9_, T10_);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	goto LA1_;
	LA6_: ;
	{
		tyObject_Table__qagh2zcXAhSb9aRfetCb26g* T12_;
		NimStringDesc* T13_;
		tySequence__sM4lkSb7zS6F7OVMvW9cffQ** T14_;
		NI T15_;
		T12_ = (tyObject_Table__qagh2zcXAhSb9aRfetCb26g*)0;
		T12_ = (*headers).table;
		T13_ = (NimStringDesc*)0;
		T13_ = toCaseInsensitive__61qaIoqIEFnR1irnyarMvQhttpcore(headers, key);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		T14_ = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ**)0;
		T14_ = X5BX5D___Nb82lIHpq89cl6q2YU4EZlg(T12_, T13_);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		(*T14_) = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV3((TGenericSeq*)((*T14_)), (&NTI__sM4lkSb7zS6F7OVMvW9cffQ_));
		T15_ = (*T14_)->Sup.len++;
		(*T14_)->data[T15_] = copyString(value);
	}
	LA1_: ;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(NI, len__u7Y7mis1lgEx9cfeUB58mwA)(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA* headers) {
	NI result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NI)0;
	result = len__J4hnoSPhc6KiK07n7KgZ9cQ((*headers).table);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, toString__vY9b9br9btFmrOxuFGpY9cNqbQ)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ* values) {
	NimStringDesc* result;
{	result = (NimStringDesc*)0;
	result = copyString(values->data[((NI) 0)]);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ*, X5BX5D___F8UGF8XOf3lJ0eLDjh362w)(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA* headers, NimStringDesc* key) {
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ* result;
	tyObject_Table__qagh2zcXAhSb9aRfetCb26g* T1_;
	NimStringDesc* T2_;
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ** T3_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*)0;
	T1_ = (tyObject_Table__qagh2zcXAhSb9aRfetCb26g*)0;
	T1_ = (*headers).table;
	T2_ = (NimStringDesc*)0;
	T2_ = toCaseInsensitive__61qaIoqIEFnR1irnyarMvQhttpcore(headers, key);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T3_ = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ**)0;
	T3_ = X5BX5D___Nb82lIHpq89cl6q2YU4EZlg(T1_, T2_);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	genericSeqAssign((&result), (*T3_), (&NTI__sM4lkSb7zS6F7OVMvW9cffQ_));
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ*, getOrDefault__aSNwyYYZ2RsZRzsI4edhhA)(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA* headers, NimStringDesc* key, tySequence__sM4lkSb7zS6F7OVMvW9cffQ* default_0) {
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ* result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*)0;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = hasKey__jz0AniI5No9bnkMo9aqdkc2A(headers, key);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (!T3_) goto LA4_;
		result = X5BX5D___F8UGF8XOf3lJ0eLDjh362w(headers, key);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		goto BeforeRet_;
	}
	goto LA1_;
	LA4_: ;
	{
		genericSeqAssign((&result), default_0, (&NTI__sM4lkSb7zS6F7OVMvW9cffQ_));
		goto BeforeRet_;
	}
	LA1_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, X5BX5Deq___ot6ARD7jycF5zD3Vxo4ZCw)(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA* headers, NimStringDesc* key, tySequence__sM4lkSb7zS6F7OVMvW9cffQ* value) {
	tyObject_Table__qagh2zcXAhSb9aRfetCb26g* T1_;
	NimStringDesc* T2_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	T1_ = (tyObject_Table__qagh2zcXAhSb9aRfetCb26g*)0;
	T1_ = (*headers).table;
	T2_ = (NimStringDesc*)0;
	T2_ = toCaseInsensitive__61qaIoqIEFnR1irnyarMvQhttpcore(headers, key);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	X5BX5Deq___cCZ4Lm3CwSTyjJEZ4An8yw(T1_, T2_, value);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA*, newHttpHeaders__OgMp9bWC8iYHI7SRLkYXelQ)(tyTuple__UV3llMMYFckfui8YMBuUZA* keyValuePairs, NI keyValuePairsLen_0, NIM_BOOL titleCase) {
	tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA* result;
	tyObject_Table__qagh2zcXAhSb9aRfetCb26g* T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA*)0;
	result = (tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA*) newObj((&NTI__FbZeO4trJhT2CCJ9aLxejqw_), sizeof(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA));
	T1_ = (tyObject_Table__qagh2zcXAhSb9aRfetCb26g*)0;
	T1_ = newTable__j9aovL9c5jjTLwk0JUYr9b7Tg(((NI) 32));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	(*result).table = T1_;
	(*result).isTitleCase = titleCase;
	{
		tyTuple__UV3llMMYFckfui8YMBuUZA* pair;
		NI i;
		pair = (tyTuple__UV3llMMYFckfui8YMBuUZA*)0;
		i = ((NI) 0);
		{
			while (1) {
				NimStringDesc* key;
				if (!(i < keyValuePairsLen_0)) goto LA4;
				pair = (&keyValuePairs[i]);
				key = toCaseInsensitive__61qaIoqIEFnR1irnyarMvQhttpcore(result, (*pair).Field0);
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				{
					NIM_BOOL T7_;
					tySequence__sM4lkSb7zS6F7OVMvW9cffQ** T10_;
					NI T11_;
					T7_ = (NIM_BOOL)0;
					T7_ = contains__W32mVXeOomM1v9brOiEZsMQ_2((*result).table, key);
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
					if (!T7_) goto LA8_;
					T10_ = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ**)0;
					T10_ = X5BX5D___Nb82lIHpq89cl6q2YU4EZlg((*result).table, key);
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
					(*T10_) = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV3((TGenericSeq*)((*T10_)), (&NTI__sM4lkSb7zS6F7OVMvW9cffQ_));
					T11_ = (*T10_)->Sup.len++;
					(*T10_)->data[T11_] = copyString((*pair).Field1);
				}
				goto LA5_;
				LA8_: ;
				{
					tySequence__sM4lkSb7zS6F7OVMvW9cffQ* T13_;
					T13_ = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*)0;
					T13_ = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*) newSeq((&NTI__sM4lkSb7zS6F7OVMvW9cffQ_), 1);
					T13_->data[0] = copyString((*pair).Field1);
					X5BX5Deq___cCZ4Lm3CwSTyjJEZ4An8yw((*result).table, key, T13_);
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				}
				LA5_: ;
				i += ((NI) 1);
			} LA4: ;
		}
	}
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___RhI4R24ytJi79cva0i5q24Q)(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA* headers) {
	NimStringDesc* result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NimStringDesc*)0;
	result = dollar___yhXmGIhb5BndEAAUCz4aXQ((*headers).table);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, is4xx__H9bBool5Ke9ajYGN7CfPerhw)(NI code) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	result = (((NI) (code)) >= ((NI) 400) && ((NI) (code)) <= ((NI) 499));
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, is5xx__H9bBool5Ke9ajYGN7CfPerhw_2)(NI code) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	result = (((NI) (code)) >= ((NI) 500) && ((NI) (code)) <= ((NI) 599));
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, stdlib_httpcoreDatInit000)(void) {

/* section: NIM_merge_TYPE_INIT1 */
static TNimNode* TM__Evu9b2R1utZubyCikahWx1g_2_9[9];
NI TM__Evu9b2R1utZubyCikahWx1g_4;
static char* NIM_CONST TM__Evu9b2R1utZubyCikahWx1g_3[9] = {
"HttpHead", 
"HttpGet", 
"HttpPost", 
"HttpPut", 
"HttpDelete", 
"HttpTrace", 
"HttpOptions", 
"HttpConnect", 
"HttpPatch"};
static TNimNode* TM__Evu9b2R1utZubyCikahWx1g_5_2[2];
static TNimNode TM__Evu9b2R1utZubyCikahWx1g_0[13];

/* section: NIM_merge_TYPE_INIT3 */
NTI__wfZHspwVKQPl9aWhkIcMrAA_.size = sizeof(tyEnum_HttpMethod__wfZHspwVKQPl9aWhkIcMrAA);
NTI__wfZHspwVKQPl9aWhkIcMrAA_.align = NIM_ALIGNOF(tyEnum_HttpMethod__wfZHspwVKQPl9aWhkIcMrAA);
NTI__wfZHspwVKQPl9aWhkIcMrAA_.kind = 14;
NTI__wfZHspwVKQPl9aWhkIcMrAA_.base = 0;
NTI__wfZHspwVKQPl9aWhkIcMrAA_.flags = 3;
for (TM__Evu9b2R1utZubyCikahWx1g_4 = 0; TM__Evu9b2R1utZubyCikahWx1g_4 < 9; TM__Evu9b2R1utZubyCikahWx1g_4++) {
TM__Evu9b2R1utZubyCikahWx1g_0[TM__Evu9b2R1utZubyCikahWx1g_4+0].kind = 1;
TM__Evu9b2R1utZubyCikahWx1g_0[TM__Evu9b2R1utZubyCikahWx1g_4+0].offset = TM__Evu9b2R1utZubyCikahWx1g_4;
TM__Evu9b2R1utZubyCikahWx1g_0[TM__Evu9b2R1utZubyCikahWx1g_4+0].name = TM__Evu9b2R1utZubyCikahWx1g_3[TM__Evu9b2R1utZubyCikahWx1g_4];
TM__Evu9b2R1utZubyCikahWx1g_2_9[TM__Evu9b2R1utZubyCikahWx1g_4] = &TM__Evu9b2R1utZubyCikahWx1g_0[TM__Evu9b2R1utZubyCikahWx1g_4+0];
}
TM__Evu9b2R1utZubyCikahWx1g_0[9].len = 9; TM__Evu9b2R1utZubyCikahWx1g_0[9].kind = 2; TM__Evu9b2R1utZubyCikahWx1g_0[9].sons = &TM__Evu9b2R1utZubyCikahWx1g_2_9[0];
NTI__wfZHspwVKQPl9aWhkIcMrAA_.node = &TM__Evu9b2R1utZubyCikahWx1g_0[9];
NTI__GM611pWlOrQ7hvMPcuAACA_.size = sizeof(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA);
NTI__GM611pWlOrQ7hvMPcuAACA_.align = NIM_ALIGNOF(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA);
NTI__GM611pWlOrQ7hvMPcuAACA_.kind = 18;
NTI__GM611pWlOrQ7hvMPcuAACA_.base = 0;
NTI__GM611pWlOrQ7hvMPcuAACA_.flags = 2;
TM__Evu9b2R1utZubyCikahWx1g_5_2[0] = &TM__Evu9b2R1utZubyCikahWx1g_0[11];
TM__Evu9b2R1utZubyCikahWx1g_0[11].kind = 1;
TM__Evu9b2R1utZubyCikahWx1g_0[11].offset = offsetof(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA, table);
TM__Evu9b2R1utZubyCikahWx1g_0[11].typ = (&NTI__jUGi19aimy3OEChVtuezLZg_);
TM__Evu9b2R1utZubyCikahWx1g_0[11].name = "table";
TM__Evu9b2R1utZubyCikahWx1g_5_2[1] = &TM__Evu9b2R1utZubyCikahWx1g_0[12];
TM__Evu9b2R1utZubyCikahWx1g_0[12].kind = 1;
TM__Evu9b2R1utZubyCikahWx1g_0[12].offset = offsetof(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA, isTitleCase);
TM__Evu9b2R1utZubyCikahWx1g_0[12].typ = (&NTI__VaVACK0bpYmqIQ0mKcHfQQ_);
TM__Evu9b2R1utZubyCikahWx1g_0[12].name = "isTitleCase";
TM__Evu9b2R1utZubyCikahWx1g_0[10].len = 2; TM__Evu9b2R1utZubyCikahWx1g_0[10].kind = 2; TM__Evu9b2R1utZubyCikahWx1g_0[10].sons = &TM__Evu9b2R1utZubyCikahWx1g_5_2[0];
NTI__GM611pWlOrQ7hvMPcuAACA_.node = &TM__Evu9b2R1utZubyCikahWx1g_0[10];
NTI__FbZeO4trJhT2CCJ9aLxejqw_.size = sizeof(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA*);
NTI__FbZeO4trJhT2CCJ9aLxejqw_.align = NIM_ALIGNOF(tyObject_HttpHeaderscolonObjectType___GM611pWlOrQ7hvMPcuAACA*);
NTI__FbZeO4trJhT2CCJ9aLxejqw_.kind = 22;
NTI__FbZeO4trJhT2CCJ9aLxejqw_.base = (&NTI__GM611pWlOrQ7hvMPcuAACA_);
NTI__FbZeO4trJhT2CCJ9aLxejqw_.flags = 2;
NTI__FbZeO4trJhT2CCJ9aLxejqw_.marker = Marker_tyRef__FbZeO4trJhT2CCJ9aLxejqw;
}

