/* 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/@puri.nim.c.o /Users/runner/work/nightlies/nightlies/nim-2.2.10/dist/atlas/.nimcache/@puri.nim.c */
#define NIM_INTBITS 64
#define NIM_EmulateOverflowChecks

#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_Uri__MX62yCLGQmnfVYEE3Hjm9cA tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_HSlice__LlH5wTnoA9aQeGwJu9b9bzAYg tyObject_HSlice__LlH5wTnoA9aQeGwJu9b9bzAYg;
typedef struct tyObject_HSlice__atPNPXY5GObvliR9b4ZIorQ tyObject_HSlice__atPNPXY5GObvliR9b4ZIorQ;
struct NimStrPayload {
	NI cap;
	NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
	NI len;
	NimStrPayload* p;
};
struct tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA {
	NimStringV2 scheme;
	NimStringV2 username;
	NimStringV2 password;
	NimStringV2 hostname;
	NimStringV2 port;
	NimStringV2 path;
	NimStringV2 query;
	NimStringV2 anchor;
	NIM_BOOL opaque;
	NIM_BOOL isIpv6;
};
typedef NU8 tySet_tyChar__nmiMWKVIe46vacnhAFrQvw[32];
struct tyObject_HSlice__LlH5wTnoA9aQeGwJu9b9bzAYg {
	NI a;
	NI b;
};
struct tyObject_HSlice__atPNPXY5GObvliR9b4ZIorQ {
	NI a;
	NI b;
};
N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0);
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__system_u2188)(void* a_p0, int v_p1, NI size_p2);
N_LIB_PRIVATE N_NIMCALL(void, initUri__pureZuri_u207)(NIM_BOOL isIpv6_p0, tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* Result);
N_LIB_PRIVATE N_NIMCALL(void, parseUri__pureZuri_u261)(NimStringV2 uri_p0, tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* result_p1);
N_LIB_PRIVATE N_NIMCALL(void, resetUri__pureZuri_u246)(tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* uri_p0);
N_LIB_PRIVATE N_NIMCALL(void, setLengthStrV2)(NimStringV2* s_p0, NI newLen_p1);
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError2)(NI i_p0, NI n_p1);
N_LIB_PRIVATE N_NIMCALL(void, parsePath__pureZuri_u178)(NimStringV2 uri_p0, NI* i_p1, tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* result_p2);
static N_INLINE(NI, parseUntil__pureZparseutils_u946)(NimStringV2 s_p0, NimStringV2* token_p1, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw until_p2, NI start_p3);
static N_INLINE(NI, parseUntil__pureZparseutils_u234)(NIM_CHAR* s_p0, NI s_p0Len_0, NimStringV2* token_p1, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw until_p2);
static N_INLINE(NIM_BOOL, nimAddInt)(NI a_p0, NI b_p1, NI* res_p2);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NIMCALL(void, fastSubstr__pureZparseutils_u225)(NIM_CHAR* s_p0, NI s_p0Len_0, NimStringV2* token_p1, NI length_p2);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError4)(NI l1_p0, NI h1_p1, NI h2_p2);
N_LIB_PRIVATE N_NIMCALL(NI, nsuCmpIgnoreCase)(NimStringV2 a_p0, NimStringV2 b_p1);
N_LIB_PRIVATE N_NIMCALL(void, parseAuthority__pureZuri_u159)(NimStringV2 authority_p0, tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* result_p1);
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);
static N_INLINE(NI, parseWhile__pureZparseutils_u964)(NimStringV2 s_p0, NimStringV2* token_p1, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw validChars_p2, NI start_p3);
static N_INLINE(NI, parseWhile__pureZparseutils_u293)(NIM_CHAR* s_p0, NI s_p0Len_0, NimStringV2* token_p1, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw validChars_p2);
N_NIMCALL(NimStringV2, rawNewString)(NI cap_p0);
N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i_p0, NI64 a_p1, NI64 b_p2);
static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1);
static N_INLINE(void, copyMem__system_u1755)(void* dest_p0, void* source_p1, NI size_p2);
static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2);
static N_INLINE(NIM_BOOL, endsWith__pureZstrutils_u1481)(NimStringV2 s_p0, NIM_CHAR suffix_p1);
static N_INLINE(NimStringV2, X5BX5D___pureZstrutils_u1319)(NimStringV2 s_p0, tyObject_HSlice__LlH5wTnoA9aQeGwJu9b9bzAYg x_p1);
static N_INLINE(NIM_BOOL, nimSubInt)(NI a_p0, NI b_p1, NI* res_p2);
N_NIMCALL(NimStringV2, mnewString)(NI len_p0);
static N_INLINE(void, nimPrepareStrMutationV2)(NimStringV2* s_p0);
N_LIB_PRIVATE N_NIMCALL(void, nimPrepareStrMutationImpl__system_u2493)(NimStringV2* s_p0);
static N_INLINE(tyObject_HSlice__LlH5wTnoA9aQeGwJu9b9bzAYg, dotdot___stdZenumutils_u105)(NI a_p0, NI b_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___system_u2754)(NimStringV2* dest_p0, NimStringV2 src_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, eqdup___system_u2757)(NimStringV2 src_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___pureZuri_u216)(tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* dest_p0, tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* src_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___system_u2760)(NimStringV2* dest_p0, NimStringV2 src_p1);
static N_INLINE(NimStringV2, X5BX5D___pureZstrutils_u1291)(NimStringV2 s_p0, tyObject_HSlice__atPNPXY5GObvliR9b4ZIorQ x_p1);
static N_INLINE(tyObject_HSlice__atPNPXY5GObvliR9b4ZIorQ, dotdot___stdZstrbasics_u48)(NI a_p0, NI b_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, toHex__pureZstrutils_u2181)(NI x_p0, NI len_p1);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u95)(NimStringV2 msg_p0);
static const struct {
  NI cap; NIM_CHAR data[0+1];
} TM__VzbRQH9cb1xm1tSKH4PwBSw_2 = { 0 | NIM_STRLIT_FLAG, "" };
static const NimStringV2 TM__VzbRQH9cb1xm1tSKH4PwBSw_3 = {0, (NimStrPayload*)&TM__VzbRQH9cb1xm1tSKH4PwBSw_2};
static const NimStringV2 TM__VzbRQH9cb1xm1tSKH4PwBSw_4 = {0, (NimStrPayload*)&TM__VzbRQH9cb1xm1tSKH4PwBSw_2};
static const NimStringV2 TM__VzbRQH9cb1xm1tSKH4PwBSw_5 = {0, (NimStrPayload*)&TM__VzbRQH9cb1xm1tSKH4PwBSw_2};
static const NimStringV2 TM__VzbRQH9cb1xm1tSKH4PwBSw_6 = {0, (NimStrPayload*)&TM__VzbRQH9cb1xm1tSKH4PwBSw_2};
static const NimStringV2 TM__VzbRQH9cb1xm1tSKH4PwBSw_7 = {0, (NimStrPayload*)&TM__VzbRQH9cb1xm1tSKH4PwBSw_2};
static const NimStringV2 TM__VzbRQH9cb1xm1tSKH4PwBSw_8 = {0, (NimStrPayload*)&TM__VzbRQH9cb1xm1tSKH4PwBSw_2};
static const NimStringV2 TM__VzbRQH9cb1xm1tSKH4PwBSw_9 = {0, (NimStrPayload*)&TM__VzbRQH9cb1xm1tSKH4PwBSw_2};
static const NimStringV2 TM__VzbRQH9cb1xm1tSKH4PwBSw_10 = {0, (NimStrPayload*)&TM__VzbRQH9cb1xm1tSKH4PwBSw_2};
static NIM_CONST tySet_tyChar__nmiMWKVIe46vacnhAFrQvw TM__VzbRQH9cb1xm1tSKH4PwBSw_12 = {
0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x80,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
;
static const struct {
  NI cap; NIM_CHAR data[6+1];
} TM__VzbRQH9cb1xm1tSKH4PwBSw_14 = { 6 | NIM_STRLIT_FLAG, "mailto" };
static const NimStringV2 TM__VzbRQH9cb1xm1tSKH4PwBSw_15 = {6, (NimStrPayload*)&TM__VzbRQH9cb1xm1tSKH4PwBSw_14};
static NIM_CONST tySet_tyChar__nmiMWKVIe46vacnhAFrQvw TM__VzbRQH9cb1xm1tSKH4PwBSw_18 = {
0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
;
static NIM_CONST tySet_tyChar__nmiMWKVIe46vacnhAFrQvw TM__VzbRQH9cb1xm1tSKH4PwBSw_23 = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0xff, 0x03,
0xfe, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0x07,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
;
static const NimStringV2 TM__VzbRQH9cb1xm1tSKH4PwBSw_29 = {0, (NimStrPayload*)&TM__VzbRQH9cb1xm1tSKH4PwBSw_2};
static NIM_CONST tySet_tyChar__nmiMWKVIe46vacnhAFrQvw TM__VzbRQH9cb1xm1tSKH4PwBSw_30 = {
0x00, 0x00, 0x00, 0x00, 0x08, 0x80, 0x00, 0x80,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
;
static const struct {
  NI cap; NIM_CHAR data[1+1];
} TM__VzbRQH9cb1xm1tSKH4PwBSw_45 = { 1 | NIM_STRLIT_FLAG, "/" };
static const NimStringV2 TM__VzbRQH9cb1xm1tSKH4PwBSw_46 = {1, (NimStrPayload*)&TM__VzbRQH9cb1xm1tSKH4PwBSw_45};
static const struct {
  NI cap; NIM_CHAR data[1+1];
} TM__VzbRQH9cb1xm1tSKH4PwBSw_54 = { 1 | NIM_STRLIT_FLAG, "+" };
static const NimStringV2 TM__VzbRQH9cb1xm1tSKH4PwBSw_55 = {1, (NimStrPayload*)&TM__VzbRQH9cb1xm1tSKH4PwBSw_54};
static const struct {
  NI cap; NIM_CHAR data[3+1];
} TM__VzbRQH9cb1xm1tSKH4PwBSw_56 = { 3 | NIM_STRLIT_FLAG, "%20" };
static const NimStringV2 TM__VzbRQH9cb1xm1tSKH4PwBSw_57 = {3, (NimStrPayload*)&TM__VzbRQH9cb1xm1tSKH4PwBSw_56};
static const struct {
  NI cap; NIM_CHAR data[93+1];
} TM__VzbRQH9cb1xm1tSKH4PwBSw_58 = { 93 | NIM_STRLIT_FLAG, "iterators.nim(272, 11) `len(a) == L` the length of the string changed while iterating over it" };
static const NimStringV2 TM__VzbRQH9cb1xm1tSKH4PwBSw_59 = {93, (NimStrPayload*)&TM__VzbRQH9cb1xm1tSKH4PwBSw_58};
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4198;
N_LIB_PRIVATE N_NIMCALL(void, eqsink___pureZuri_u222)(tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* dest_p0, tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* src_p1) {
	if ((*dest_p0).scheme.p != (*src_p1).scheme.p) {	if ((*dest_p0).scheme.p && !((*dest_p0).scheme.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared((*dest_p0).scheme.p);
}
	}
(*dest_p0).scheme.len = (*src_p1).scheme.len; (*dest_p0).scheme.p = (*src_p1).scheme.p;
	if ((*dest_p0).username.p != (*src_p1).username.p) {	if ((*dest_p0).username.p && !((*dest_p0).username.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared((*dest_p0).username.p);
}
	}
(*dest_p0).username.len = (*src_p1).username.len; (*dest_p0).username.p = (*src_p1).username.p;
	if ((*dest_p0).password.p != (*src_p1).password.p) {	if ((*dest_p0).password.p && !((*dest_p0).password.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared((*dest_p0).password.p);
}
	}
(*dest_p0).password.len = (*src_p1).password.len; (*dest_p0).password.p = (*src_p1).password.p;
	if ((*dest_p0).hostname.p != (*src_p1).hostname.p) {	if ((*dest_p0).hostname.p && !((*dest_p0).hostname.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared((*dest_p0).hostname.p);
}
	}
(*dest_p0).hostname.len = (*src_p1).hostname.len; (*dest_p0).hostname.p = (*src_p1).hostname.p;
	if ((*dest_p0).port.p != (*src_p1).port.p) {	if ((*dest_p0).port.p && !((*dest_p0).port.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared((*dest_p0).port.p);
}
	}
(*dest_p0).port.len = (*src_p1).port.len; (*dest_p0).port.p = (*src_p1).port.p;
	if ((*dest_p0).path.p != (*src_p1).path.p) {	if ((*dest_p0).path.p && !((*dest_p0).path.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared((*dest_p0).path.p);
}
	}
(*dest_p0).path.len = (*src_p1).path.len; (*dest_p0).path.p = (*src_p1).path.p;
	if ((*dest_p0).query.p != (*src_p1).query.p) {	if ((*dest_p0).query.p && !((*dest_p0).query.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared((*dest_p0).query.p);
}
	}
(*dest_p0).query.len = (*src_p1).query.len; (*dest_p0).query.p = (*src_p1).query.p;
	if ((*dest_p0).anchor.p != (*src_p1).anchor.p) {	if ((*dest_p0).anchor.p && !((*dest_p0).anchor.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared((*dest_p0).anchor.p);
}
	}
(*dest_p0).anchor.len = (*src_p1).anchor.len; (*dest_p0).anchor.p = (*src_p1).anchor.p;
	(*dest_p0).opaque = (*src_p1).opaque;
	(*dest_p0).isIpv6 = (*src_p1).isIpv6;
}
static N_INLINE(void, nimSetMem__system_u2188)(void* a_p0, int v_p1, NI size_p2) {
	void* T1_;
	T1_ = (void*)0;
	T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
	nimSetMem__system_u2188(p_p0, ((int)0), size_p1);
}
N_LIB_PRIVATE N_NIMCALL(void, initUri__pureZuri_u207)(NIM_BOOL isIpv6_p0, tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* Result) {
	nimZeroMem((void*)Result, sizeof(tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA));
	(*Result).scheme = TM__VzbRQH9cb1xm1tSKH4PwBSw_3;
	(*Result).username = TM__VzbRQH9cb1xm1tSKH4PwBSw_4;
	(*Result).password = TM__VzbRQH9cb1xm1tSKH4PwBSw_5;
	(*Result).hostname = TM__VzbRQH9cb1xm1tSKH4PwBSw_6;
	(*Result).port = TM__VzbRQH9cb1xm1tSKH4PwBSw_7;
	(*Result).path = TM__VzbRQH9cb1xm1tSKH4PwBSw_8;
	(*Result).query = TM__VzbRQH9cb1xm1tSKH4PwBSw_9;
	(*Result).anchor = TM__VzbRQH9cb1xm1tSKH4PwBSw_10;
	(*Result).isIpv6 = isIpv6_p0;
}
N_LIB_PRIVATE N_NIMCALL(void, resetUri__pureZuri_u246)(tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* uri_p0) {
	{
		if (!NIM_TRUE) goto LA3_;
		setLengthStrV2((&(*uri_p0).scheme), ((NI)0));
	}
LA3_: ;
	{
		if (!NIM_TRUE) goto LA7_;
		setLengthStrV2((&(*uri_p0).username), ((NI)0));
	}
LA7_: ;
	{
		if (!NIM_TRUE) goto LA11_;
		setLengthStrV2((&(*uri_p0).password), ((NI)0));
	}
LA11_: ;
	{
		if (!NIM_TRUE) goto LA15_;
		setLengthStrV2((&(*uri_p0).hostname), ((NI)0));
	}
LA15_: ;
	{
		if (!NIM_TRUE) goto LA19_;
		setLengthStrV2((&(*uri_p0).port), ((NI)0));
	}
LA19_: ;
	{
		if (!NIM_TRUE) goto LA23_;
		setLengthStrV2((&(*uri_p0).path), ((NI)0));
	}
LA23_: ;
	{
		if (!NIM_TRUE) goto LA27_;
		setLengthStrV2((&(*uri_p0).query), ((NI)0));
	}
LA27_: ;
	{
		if (!NIM_TRUE) goto LA31_;
		setLengthStrV2((&(*uri_p0).anchor), ((NI)0));
	}
LA31_: ;
	{
		if (!NIM_TRUE) goto LA35_;
		(*uri_p0).opaque = NIM_FALSE;
	}
LA35_: ;
	{
		if (!NIM_TRUE) goto LA39_;
		(*uri_p0).isIpv6 = NIM_FALSE;
	}
LA39_: ;
}
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;
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	result = (&nimInErrorMode__system_u4198);
	return result;
}
static N_INLINE(NI, parseUntil__pureZparseutils_u234)(NIM_CHAR* s_p0, NI s_p0Len_0, NimStringV2* token_p1, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw until_p2) {
	NI result;
	NI i_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	i_1 = ((NI)0);
	{
		while (1) {
			NIM_BOOL T3_;
			NI TM__VzbRQH9cb1xm1tSKH4PwBSw_11;
			T3_ = (NIM_BOOL)0;
			T3_ = (i_1 < s_p0Len_0);
			if (!(T3_)) goto LA4_;
			if (i_1 < 0 || i_1 >= s_p0Len_0){ raiseIndexError2(i_1,s_p0Len_0-1); goto BeforeRet_;
			}
			T3_ = !(((until_p2[(NU)((((NU8)(s_p0[i_1]))))>>3] &(1U<<((NU)((((NU8)(s_p0[i_1]))))&7U)))!=0));
LA4_: ;
			if (!T3_) goto LA2;
			if (nimAddInt(i_1, ((NI)1), &TM__VzbRQH9cb1xm1tSKH4PwBSw_11)) { raiseOverflow(); goto BeforeRet_;
			};
			i_1 = (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_11);
		} LA2: ;
	}
	result = i_1;
	fastSubstr__pureZparseutils_u225(s_p0, s_p0Len_0, token_p1, result);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NI, parseUntil__pureZparseutils_u946)(NimStringV2 s_p0, NimStringV2* token_p1, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw until_p2, NI start_p3) {
	NI result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NI)0;
	if ((s_p0.len-1)-start_p3 != -1 && (start_p3 < 0 || start_p3 >= s_p0.len || (s_p0.len-1) < 0 || (s_p0.len-1) >= s_p0.len)){ raiseIndexError4(start_p3, (s_p0.len-1), s_p0.len); goto BeforeRet_;
	}
	result = parseUntil__pureZparseutils_u234((((s_p0).p) ? ((NIM_CHAR*)s_p0.p->data+(start_p3)) : NIM_NIL), ((s_p0.len-1))-(start_p3)+1, token_p1, until_p2);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
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;
}
N_LIB_PRIVATE N_NIMCALL(void, parseAuthority__pureZuri_u159)(NimStringV2 authority_p0, tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* result_p1) {
	NI i_1;
	NIM_BOOL inPort_1;
	NIM_BOOL inIPv6_1;
{	i_1 = ((NI)0);
	inPort_1 = NIM_FALSE;
	inIPv6_1 = NIM_FALSE;
	{
		while (1) {
			NI TM__VzbRQH9cb1xm1tSKH4PwBSw_16;
			if (!(i_1 < authority_p0.len)) goto LA2;
			if (i_1 < 0 || i_1 >= authority_p0.len){ raiseIndexError2(i_1,authority_p0.len-1); goto BeforeRet_;
			}
			switch (((NU8)(authority_p0.p->data[i_1]))) {
			case 64:
			{
				NimStringV2 T4_;
				NimStringV2 T5_;
				T4_.len = 0; T4_.p = NIM_NIL;
				T4_ = (*result_p1).password;
				(*result_p1).password = (*result_p1).port;
				(*result_p1).port = T4_;
				setLengthStrV2((&(*result_p1).port), ((NI)0));
				T5_.len = 0; T5_.p = NIM_NIL;
				T5_ = (*result_p1).username;
				(*result_p1).username = (*result_p1).hostname;
				(*result_p1).hostname = T5_;
				setLengthStrV2((&(*result_p1).hostname), ((NI)0));
				inPort_1 = NIM_FALSE;
			}
			break;
			case 58:
			{
				{
					if (!inIPv6_1) goto LA9_;
					if (i_1 < 0 || i_1 >= authority_p0.len){ raiseIndexError2(i_1,authority_p0.len-1); goto BeforeRet_;
					}
					nimAddCharV1((&(*result_p1).hostname), authority_p0.p->data[i_1]);
				}
				goto LA7_;
LA9_: ;
				{
					inPort_1 = NIM_TRUE;
				}
LA7_: ;
			}
			break;
			case 91:
			{
				inIPv6_1 = NIM_TRUE;
				(*result_p1).isIpv6 = NIM_TRUE;
			}
			break;
			case 93:
			{
				inIPv6_1 = NIM_FALSE;
			}
			break;
			default:
			{
				{
					if (!inPort_1) goto LA17_;
					if (i_1 < 0 || i_1 >= authority_p0.len){ raiseIndexError2(i_1,authority_p0.len-1); goto BeforeRet_;
					}
					nimAddCharV1((&(*result_p1).port), authority_p0.p->data[i_1]);
				}
				goto LA15_;
LA17_: ;
				{
					if (i_1 < 0 || i_1 >= authority_p0.len){ raiseIndexError2(i_1,authority_p0.len-1); goto BeforeRet_;
					}
					nimAddCharV1((&(*result_p1).hostname), authority_p0.p->data[i_1]);
				}
LA15_: ;
			}
			break;
			}
			if (nimAddInt(i_1, ((NI)1), &TM__VzbRQH9cb1xm1tSKH4PwBSw_16)) { raiseOverflow(); goto BeforeRet_;
			};
			i_1 = (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_16);
		} LA2: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, parsePath__pureZuri_u178)(NimStringV2 uri_p0, NI* i_p1, tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* result_p2) {
	NI T1_;
	NI TM__VzbRQH9cb1xm1tSKH4PwBSw_13;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	T1_ = (NI)0;
	T1_ = parseUntil__pureZparseutils_u946(uri_p0, (&(*result_p2).path), TM__VzbRQH9cb1xm1tSKH4PwBSw_12, (*i_p1));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	if (nimAddInt((*i_p1), T1_, &TM__VzbRQH9cb1xm1tSKH4PwBSw_13)) { raiseOverflow(); goto BeforeRet_;
	};
	(*i_p1) = (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_13);
	{
		NI T4_;
		T4_ = (NI)0;
		T4_ = nsuCmpIgnoreCase((*result_p2).scheme, TM__VzbRQH9cb1xm1tSKH4PwBSw_15);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (!(T4_ == ((NI)0))) goto LA5_;
		parseAuthority__pureZuri_u159((*result_p2).path, result_p2);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		setLengthStrV2((&(*result_p2).path), ((NI)0));
	}
LA5_: ;
	{
		NIM_BOOL T9_;
		NI TM__VzbRQH9cb1xm1tSKH4PwBSw_17;
		NI T13_;
		NI TM__VzbRQH9cb1xm1tSKH4PwBSw_19;
		T9_ = (NIM_BOOL)0;
		T9_ = ((*i_p1) < uri_p0.len);
		if (!(T9_)) goto LA10_;
		if ((*i_p1) < 0 || (*i_p1) >= uri_p0.len){ raiseIndexError2((*i_p1),uri_p0.len-1); goto BeforeRet_;
		}
		T9_ = ((NU8)(uri_p0.p->data[(*i_p1)]) == (NU8)(63));
LA10_: ;
		if (!T9_) goto LA11_;
		if (nimAddInt((*i_p1), ((NI)1), &TM__VzbRQH9cb1xm1tSKH4PwBSw_17)) { raiseOverflow(); goto BeforeRet_;
		};
		(*i_p1) = (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_17);
		T13_ = (NI)0;
		T13_ = parseUntil__pureZparseutils_u946(uri_p0, (&(*result_p2).query), TM__VzbRQH9cb1xm1tSKH4PwBSw_18, (*i_p1));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (nimAddInt((*i_p1), T13_, &TM__VzbRQH9cb1xm1tSKH4PwBSw_19)) { raiseOverflow(); goto BeforeRet_;
		};
		(*i_p1) = (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_19);
	}
LA11_: ;
	{
		NIM_BOOL T16_;
		NI TM__VzbRQH9cb1xm1tSKH4PwBSw_20;
		tySet_tyChar__nmiMWKVIe46vacnhAFrQvw T20_;
		NI T21_;
		NI TM__VzbRQH9cb1xm1tSKH4PwBSw_21;
		T16_ = (NIM_BOOL)0;
		T16_ = ((*i_p1) < uri_p0.len);
		if (!(T16_)) goto LA17_;
		if ((*i_p1) < 0 || (*i_p1) >= uri_p0.len){ raiseIndexError2((*i_p1),uri_p0.len-1); goto BeforeRet_;
		}
		T16_ = ((NU8)(uri_p0.p->data[(*i_p1)]) == (NU8)(35));
LA17_: ;
		if (!T16_) goto LA18_;
		if (nimAddInt((*i_p1), ((NI)1), &TM__VzbRQH9cb1xm1tSKH4PwBSw_20)) { raiseOverflow(); goto BeforeRet_;
		};
		(*i_p1) = (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_20);
		nimZeroMem(T20_, sizeof(tySet_tyChar__nmiMWKVIe46vacnhAFrQvw));
		T21_ = (NI)0;
		T21_ = parseUntil__pureZparseutils_u946(uri_p0, (&(*result_p2).anchor), T20_, (*i_p1));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (nimAddInt((*i_p1), T21_, &TM__VzbRQH9cb1xm1tSKH4PwBSw_21)) { raiseOverflow(); goto BeforeRet_;
		};
		(*i_p1) = (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_21);
	}
LA18_: ;
	}BeforeRet_: ;
}
static N_INLINE(NI, parseWhile__pureZparseutils_u293)(NIM_CHAR* s_p0, NI s_p0Len_0, NimStringV2* token_p1, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw validChars_p2) {
	NI result;
	NI i_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	i_1 = ((NI)0);
	{
		while (1) {
			NIM_BOOL T3_;
			NI TM__VzbRQH9cb1xm1tSKH4PwBSw_22;
			T3_ = (NIM_BOOL)0;
			T3_ = (i_1 < s_p0Len_0);
			if (!(T3_)) goto LA4_;
			if (i_1 < 0 || i_1 >= s_p0Len_0){ raiseIndexError2(i_1,s_p0Len_0-1); goto BeforeRet_;
			}
			T3_ = ((validChars_p2[(NU)((((NU8)(s_p0[i_1]))))>>3] &(1U<<((NU)((((NU8)(s_p0[i_1]))))&7U)))!=0);
LA4_: ;
			if (!T3_) goto LA2;
			if (nimAddInt(i_1, ((NI)1), &TM__VzbRQH9cb1xm1tSKH4PwBSw_22)) { raiseOverflow(); goto BeforeRet_;
			};
			i_1 = (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_22);
		} LA2: ;
	}
	result = i_1;
	fastSubstr__pureZparseutils_u225(s_p0, s_p0Len_0, token_p1, result);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NI, parseWhile__pureZparseutils_u964)(NimStringV2 s_p0, NimStringV2* token_p1, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw validChars_p2, NI start_p3) {
	NI result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NI)0;
	if ((s_p0.len-1)-start_p3 != -1 && (start_p3 < 0 || start_p3 >= s_p0.len || (s_p0.len-1) < 0 || (s_p0.len-1) >= s_p0.len)){ raiseIndexError4(start_p3, (s_p0.len-1), s_p0.len); goto BeforeRet_;
	}
	result = parseWhile__pureZparseutils_u293((((s_p0).p) ? ((NIM_CHAR*)s_p0.p->data+(start_p3)) : NIM_NIL), ((s_p0.len-1))-(start_p3)+1, token_p1, validChars_p2);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, parseUri__pureZuri_u261)(NimStringV2 uri_p0, tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* result_p1) {
	NI i_1;
	NIM_BOOL doubleSlash_1;
	NIM_BOOL T1_;
	NIM_BOOL T2_;
	NI T15_;
	NI TM__VzbRQH9cb1xm1tSKH4PwBSw_24;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	resetUri__pureZuri_u246(result_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	i_1 = ((NI)0);
	T1_ = (NIM_BOOL)0;
	T2_ = (NIM_BOOL)0;
	T2_ = (((NI)1) < uri_p0.len);
	if (!(T2_)) goto LA3_;
	if (((NI)0) < 0 || ((NI)0) >= uri_p0.len){ raiseIndexError2(((NI)0),uri_p0.len-1); goto BeforeRet_;
	}
	T2_ = ((NU8)(uri_p0.p->data[((NI)0)]) == (NU8)(47));
LA3_: ;
	T1_ = T2_;
	if (!(T1_)) goto LA4_;
	if (((NI)1) < 0 || ((NI)1) >= uri_p0.len){ raiseIndexError2(((NI)1),uri_p0.len-1); goto BeforeRet_;
	}
	T1_ = ((NU8)(uri_p0.p->data[((NI)1)]) == (NU8)(47));
LA4_: ;
	doubleSlash_1 = T1_;
	{
		NIM_BOOL T7_;
		T7_ = (NIM_BOOL)0;
		T7_ = (i_1 < uri_p0.len);
		if (!(T7_)) goto LA8_;
		if (i_1 < 0 || i_1 >= uri_p0.len){ raiseIndexError2(i_1,uri_p0.len-1); goto BeforeRet_;
		}
		T7_ = ((NU8)(uri_p0.p->data[i_1]) == (NU8)(47));
LA8_: ;
		if (!T7_) goto LA9_;
		{
			if (!!(doubleSlash_1)) goto LA13_;
			parsePath__pureZuri_u178(uri_p0, (&i_1), result_p1);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			goto BeforeRet_;
		}
LA13_: ;
	}
LA9_: ;
	T15_ = (NI)0;
	T15_ = parseWhile__pureZparseutils_u964(uri_p0, (&(*result_p1).scheme), TM__VzbRQH9cb1xm1tSKH4PwBSw_23, i_1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	if (nimAddInt(i_1, T15_, &TM__VzbRQH9cb1xm1tSKH4PwBSw_24)) { raiseOverflow(); goto BeforeRet_;
	};
	i_1 = (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_24);
	{
		NIM_BOOL T18_;
		NIM_BOOL T19_;
		T18_ = (NIM_BOOL)0;
		T19_ = (NIM_BOOL)0;
		T19_ = (uri_p0.len <= i_1);
		if (T19_) goto LA20_;
		if (i_1 < 0 || i_1 >= uri_p0.len){ raiseIndexError2(i_1,uri_p0.len-1); goto BeforeRet_;
		}
		T19_ = !(((NU8)(uri_p0.p->data[i_1]) == (NU8)(58)));
LA20_: ;
		T18_ = T19_;
		if (!(T18_)) goto LA21_;
		T18_ = !(doubleSlash_1);
LA21_: ;
		if (!T18_) goto LA22_;
		i_1 = ((NI)0);
		setLengthStrV2((&(*result_p1).scheme), ((NI)0));
		parsePath__pureZuri_u178(uri_p0, (&i_1), result_p1);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		goto BeforeRet_;
	}
LA22_: ;
	{
		NI TM__VzbRQH9cb1xm1tSKH4PwBSw_25;
		if (!!(doubleSlash_1)) goto LA26_;
		if (nimAddInt(i_1, ((NI)1), &TM__VzbRQH9cb1xm1tSKH4PwBSw_25)) { raiseOverflow(); goto BeforeRet_;
		};
		i_1 = (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_25);
	}
LA26_: ;
	{
		NIM_BOOL T30_;
		NIM_BOOL T31_;
		NI TM__VzbRQH9cb1xm1tSKH4PwBSw_26;
		NI TM__VzbRQH9cb1xm1tSKH4PwBSw_27;
		NimStringV2 authority_1;
		NI TM__VzbRQH9cb1xm1tSKH4PwBSw_28;
		NI T36_;
		NI TM__VzbRQH9cb1xm1tSKH4PwBSw_31;
		T30_ = (NIM_BOOL)0;
		T31_ = (NIM_BOOL)0;
		if (nimAddInt(i_1, ((NI)1), &TM__VzbRQH9cb1xm1tSKH4PwBSw_26)) { raiseOverflow(); goto BeforeRet_;
		};
		T31_ = ((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_26) < uri_p0.len);
		if (!(T31_)) goto LA32_;
		if (i_1 < 0 || i_1 >= uri_p0.len){ raiseIndexError2(i_1,uri_p0.len-1); goto BeforeRet_;
		}
		T31_ = ((NU8)(uri_p0.p->data[i_1]) == (NU8)(47));
LA32_: ;
		T30_ = T31_;
		if (!(T30_)) goto LA33_;
		if (nimAddInt(i_1, ((NI)1), &TM__VzbRQH9cb1xm1tSKH4PwBSw_27)) { raiseOverflow(); goto BeforeRet_;
		};
		if ((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_27) < 0 || (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_27) >= uri_p0.len){ raiseIndexError2((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_27),uri_p0.len-1); goto BeforeRet_;
		}
		T30_ = ((NU8)(uri_p0.p->data[(NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_27)]) == (NU8)(47));
LA33_: ;
		if (!T30_) goto LA34_;
		authority_1.len = 0; authority_1.p = NIM_NIL;
		if (nimAddInt(i_1, ((NI)2), &TM__VzbRQH9cb1xm1tSKH4PwBSw_28)) { raiseOverflow(); goto BeforeRet_;
		};
		i_1 = (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_28);
		authority_1 = TM__VzbRQH9cb1xm1tSKH4PwBSw_29;
		T36_ = (NI)0;
		T36_ = parseUntil__pureZparseutils_u946(uri_p0, (&authority_1), TM__VzbRQH9cb1xm1tSKH4PwBSw_30, i_1);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (nimAddInt(i_1, T36_, &TM__VzbRQH9cb1xm1tSKH4PwBSw_31)) { raiseOverflow(); goto BeforeRet_;
		};
		i_1 = (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_31);
		{
			if (!(((NI)0) < authority_1.len)) goto LA39_;
			parseAuthority__pureZuri_u159(authority_1, result_p1);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		}
LA39_: ;
		if (authority_1.p && !(authority_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(authority_1.p);
}
	}
	goto LA28_;
LA34_: ;
	{
		(*result_p1).opaque = NIM_TRUE;
	}
LA28_: ;
	parsePath__pureZuri_u178(uri_p0, (&i_1), result_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, parseUri__pureZuri_u295)(NimStringV2 uri_p0, tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* Result) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimZeroMem((void*)Result, sizeof(tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA));
	initUri__pureZuri_u207(NIM_FALSE, Result);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	parseUri__pureZuri_u261(uri_p0, Result);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, eqwasMoved___pureZuri_u210)(tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* dest_p0) {
	(*dest_p0).scheme.len = 0; (*dest_p0).scheme.p = NIM_NIL;
	(*dest_p0).username.len = 0; (*dest_p0).username.p = NIM_NIL;
	(*dest_p0).password.len = 0; (*dest_p0).password.p = NIM_NIL;
	(*dest_p0).hostname.len = 0; (*dest_p0).hostname.p = NIM_NIL;
	(*dest_p0).port.len = 0; (*dest_p0).port.p = NIM_NIL;
	(*dest_p0).path.len = 0; (*dest_p0).path.p = NIM_NIL;
	(*dest_p0).query.len = 0; (*dest_p0).query.p = NIM_NIL;
	(*dest_p0).anchor.len = 0; (*dest_p0).anchor.p = NIM_NIL;
	(*dest_p0).opaque = 0;
	(*dest_p0).isIpv6 = 0;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZuri_u213)(tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* dest_p0) {
	if ((*dest_p0).anchor.p && !((*dest_p0).anchor.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared((*dest_p0).anchor.p);
}
	if ((*dest_p0).query.p && !((*dest_p0).query.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared((*dest_p0).query.p);
}
	if ((*dest_p0).path.p && !((*dest_p0).path.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared((*dest_p0).path.p);
}
	if ((*dest_p0).port.p && !((*dest_p0).port.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared((*dest_p0).port.p);
}
	if ((*dest_p0).hostname.p && !((*dest_p0).hostname.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared((*dest_p0).hostname.p);
}
	if ((*dest_p0).password.p && !((*dest_p0).password.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared((*dest_p0).password.p);
}
	if ((*dest_p0).username.p && !((*dest_p0).username.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared((*dest_p0).username.p);
}
	if ((*dest_p0).scheme.p && !((*dest_p0).scheme.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared((*dest_p0).scheme.p);
}
}
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_u1755)(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_u1755(((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_: ;
}
static N_INLINE(NIM_BOOL, endsWith__pureZstrutils_u1481)(NimStringV2 s_p0, NIM_CHAR suffix_p1) {
	NIM_BOOL result;
	NIM_BOOL T1_;
{	T1_ = (NIM_BOOL)0;
	T1_ = (((NI)0) < s_p0.len);
	if (!(T1_)) goto LA2_;
	if ((s_p0.len-1) < 0 || (s_p0.len-1) >= s_p0.len){ raiseIndexError2((s_p0.len-1),s_p0.len-1); goto BeforeRet_;
	}
	T1_ = ((NU8)(s_p0.p->data[(s_p0.len-1)]) == (NU8)(suffix_p1));
LA2_: ;
	result = T1_;
	}BeforeRet_: ;
	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(NimStringV2, X5BX5D___pureZstrutils_u1319)(NimStringV2 s_p0, tyObject_HSlice__LlH5wTnoA9aQeGwJu9b9bzAYg x_p1) {
	NimStringV2 result;
	NI a_1;
	NI L_1;
	NI TM__VzbRQH9cb1xm1tSKH4PwBSw_40;
	NI TM__VzbRQH9cb1xm1tSKH4PwBSw_41;
	NI TM__VzbRQH9cb1xm1tSKH4PwBSw_42;
{	result.len = 0; result.p = NIM_NIL;
	a_1 = x_p1.a;
	if (nimSubInt(s_p0.len, x_p1.b, &TM__VzbRQH9cb1xm1tSKH4PwBSw_40)) { raiseOverflow(); goto BeforeRet_;
	};
	if (nimSubInt((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_40), a_1, &TM__VzbRQH9cb1xm1tSKH4PwBSw_41)) { raiseOverflow(); goto BeforeRet_;
	};
	if (nimAddInt((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_41), ((NI)1), &TM__VzbRQH9cb1xm1tSKH4PwBSw_42)) { raiseOverflow(); goto BeforeRet_;
	};
	L_1 = (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_42);
	if ((L_1) < ((NI)0) || (L_1) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI(L_1, ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_;
	}
	result = mnewString((L_1));
	{
		NI i_1;
		NI i_2;
		i_1 = (NI)0;
		i_2 = ((NI)0);
		{
			while (1) {
				NI TM__VzbRQH9cb1xm1tSKH4PwBSw_43;
				NI TM__VzbRQH9cb1xm1tSKH4PwBSw_44;
				if (!(i_2 < L_1)) goto LA3;
				i_1 = i_2;
				if (i_1 < 0 || i_1 >= result.len){ raiseIndexError2(i_1,result.len-1); goto BeforeRet_;
				}
				nimPrepareStrMutationV2((&result));
				if (nimAddInt(i_1, a_1, &TM__VzbRQH9cb1xm1tSKH4PwBSw_43)) { raiseOverflow(); goto BeforeRet_;
				};
				if ((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_43) < 0 || (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_43) >= s_p0.len){ raiseIndexError2((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_43),s_p0.len-1); goto BeforeRet_;
				}
				result.p->data[i_1] = s_p0.p->data[(NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_43)];
				if (nimAddInt(i_2, ((NI)1), &TM__VzbRQH9cb1xm1tSKH4PwBSw_44)) { raiseOverflow(); goto BeforeRet_;
				};
				i_2 = (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_44);
			} LA3: ;
		}
	}
	}BeforeRet_: ;
	return result;
}
static N_INLINE(tyObject_HSlice__LlH5wTnoA9aQeGwJu9b9bzAYg, dotdot___stdZenumutils_u105)(NI a_p0, NI b_p1) {
	tyObject_HSlice__LlH5wTnoA9aQeGwJu9b9bzAYg result;
	result.a = a_p0;
	result.b = b_p1;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___pureZuri_u409)(tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* u_p0) {
	NimStringV2 result;
	NI schemeLen_1;
	NI usernameLen_1;
	NI passwordLen_1;
	NI hostnameLen_1;
	NI portLen_1;
	NI pathLen_1;
	NI queryLen_1;
	NI anchorLen_1;
	NI TM__VzbRQH9cb1xm1tSKH4PwBSw_32;
	NI TM__VzbRQH9cb1xm1tSKH4PwBSw_33;
	NI TM__VzbRQH9cb1xm1tSKH4PwBSw_34;
	NI TM__VzbRQH9cb1xm1tSKH4PwBSw_35;
	NI TM__VzbRQH9cb1xm1tSKH4PwBSw_36;
	NI TM__VzbRQH9cb1xm1tSKH4PwBSw_37;
	NI TM__VzbRQH9cb1xm1tSKH4PwBSw_38;
	NI TM__VzbRQH9cb1xm1tSKH4PwBSw_39;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result.len = 0; result.p = NIM_NIL;
	schemeLen_1 = (*u_p0).scheme.len;
	usernameLen_1 = (*u_p0).username.len;
	passwordLen_1 = (*u_p0).password.len;
	hostnameLen_1 = (*u_p0).hostname.len;
	portLen_1 = (*u_p0).port.len;
	pathLen_1 = (*u_p0).path.len;
	queryLen_1 = (*u_p0).query.len;
	anchorLen_1 = (*u_p0).anchor.len;
	if (nimAddInt(schemeLen_1, usernameLen_1, &TM__VzbRQH9cb1xm1tSKH4PwBSw_32)) { raiseOverflow(); goto BeforeRet_;
	};
	if (nimAddInt((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_32), passwordLen_1, &TM__VzbRQH9cb1xm1tSKH4PwBSw_33)) { raiseOverflow(); goto BeforeRet_;
	};
	if (nimAddInt((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_33), hostnameLen_1, &TM__VzbRQH9cb1xm1tSKH4PwBSw_34)) { raiseOverflow(); goto BeforeRet_;
	};
	if (nimAddInt((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_34), portLen_1, &TM__VzbRQH9cb1xm1tSKH4PwBSw_35)) { raiseOverflow(); goto BeforeRet_;
	};
	if (nimAddInt((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_35), pathLen_1, &TM__VzbRQH9cb1xm1tSKH4PwBSw_36)) { raiseOverflow(); goto BeforeRet_;
	};
	if (nimAddInt((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_36), queryLen_1, &TM__VzbRQH9cb1xm1tSKH4PwBSw_37)) { raiseOverflow(); goto BeforeRet_;
	};
	if (nimAddInt((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_37), anchorLen_1, &TM__VzbRQH9cb1xm1tSKH4PwBSw_38)) { raiseOverflow(); goto BeforeRet_;
	};
	if (nimAddInt((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_38), ((NI)12), &TM__VzbRQH9cb1xm1tSKH4PwBSw_39)) { raiseOverflow(); goto BeforeRet_;
	};
	if (((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_39)) < ((NI)0) || ((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_39)) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_39), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_;
	}
	result = rawNewString(((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_39)));
	{
		if (!(((NI)0) < schemeLen_1)) goto LA3_;
		prepareAdd((&result), (*u_p0).scheme.len + 0);
appendString((&result), (*u_p0).scheme);
		nimAddCharV1((&result), 58);
		{
			if (!!((*u_p0).opaque)) goto LA7_;
			nimAddCharV1((&result), 47);
			nimAddCharV1((&result), 47);
		}
LA7_: ;
	}
LA3_: ;
	{
		if (!(((NI)0) < usernameLen_1)) goto LA11_;
		prepareAdd((&result), (*u_p0).username.len + 0);
appendString((&result), (*u_p0).username);
		{
			if (!(((NI)0) < passwordLen_1)) goto LA15_;
			nimAddCharV1((&result), 58);
			prepareAdd((&result), (*u_p0).password.len + 0);
appendString((&result), (*u_p0).password);
		}
LA15_: ;
		nimAddCharV1((&result), 64);
	}
LA11_: ;
	{
		NIM_BOOL T19_;
		T19_ = (NIM_BOOL)0;
		T19_ = endsWith__pureZstrutils_u1481((*u_p0).hostname, 47);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (!T19_) goto LA20_;
		{
			NimStringV2 colontmpD_;
			tyObject_HSlice__LlH5wTnoA9aQeGwJu9b9bzAYg T26_;
			if (!(*u_p0).isIpv6) goto LA24_;
			colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
			nimAddCharV1((&result), 91);
			T26_ = dotdot___stdZenumutils_u105(((NI)0), ((NI)2));
			colontmpD_ = X5BX5D___pureZstrutils_u1319((*u_p0).hostname, T26_);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			prepareAdd((&result), colontmpD_.len + 0);
appendString((&result), colontmpD_);
			nimAddCharV1((&result), 93);
			if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD_.p);
}
		}
		goto LA22_;
LA24_: ;
		{
			NimStringV2 colontmpD__2;
			tyObject_HSlice__LlH5wTnoA9aQeGwJu9b9bzAYg T28_;
			colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
			T28_ = dotdot___stdZenumutils_u105(((NI)0), ((NI)2));
			colontmpD__2 = X5BX5D___pureZstrutils_u1319((*u_p0).hostname, T28_);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			prepareAdd((&result), colontmpD__2.len + 0);
appendString((&result), colontmpD__2);
			if (colontmpD__2.p && !(colontmpD__2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD__2.p);
}
		}
LA22_: ;
	}
	goto LA17_;
LA20_: ;
	{
		{
			if (!(*u_p0).isIpv6) goto LA32_;
			nimAddCharV1((&result), 91);
			prepareAdd((&result), (*u_p0).hostname.len + 0);
appendString((&result), (*u_p0).hostname);
			nimAddCharV1((&result), 93);
		}
		goto LA30_;
LA32_: ;
		{
			prepareAdd((&result), (*u_p0).hostname.len + 0);
appendString((&result), (*u_p0).hostname);
		}
LA30_: ;
	}
LA17_: ;
	{
		if (!(((NI)0) < portLen_1)) goto LA37_;
		nimAddCharV1((&result), 58);
		prepareAdd((&result), (*u_p0).port.len + 0);
appendString((&result), (*u_p0).port);
	}
LA37_: ;
	{
		if (!(((NI)0) < pathLen_1)) goto LA41_;
		{
			NIM_BOOL T45_;
			T45_ = (NIM_BOOL)0;
			T45_ = (((NI)0) < hostnameLen_1);
			if (!(T45_)) goto LA46_;
			if (((NI)0) < 0 || ((NI)0) >= (*u_p0).path.len){ raiseIndexError2(((NI)0),(*u_p0).path.len-1); goto BeforeRet_;
			}
			T45_ = !(((NU8)((*u_p0).path.p->data[((NI)0)]) == (NU8)(47)));
LA46_: ;
			if (!T45_) goto LA47_;
			nimAddCharV1((&result), 47);
		}
LA47_: ;
		prepareAdd((&result), (*u_p0).path.len + 0);
appendString((&result), (*u_p0).path);
	}
LA41_: ;
	{
		if (!(((NI)0) < queryLen_1)) goto LA51_;
		nimAddCharV1((&result), 63);
		prepareAdd((&result), (*u_p0).query.len + 0);
appendString((&result), (*u_p0).query);
	}
LA51_: ;
	{
		if (!(((NI)0) < anchorLen_1)) goto LA55_;
		nimAddCharV1((&result), 35);
		prepareAdd((&result), (*u_p0).anchor.len + 0);
appendString((&result), (*u_p0).anchor);
	}
LA55_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___pureZuri_u216)(tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* dest_p0, tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* src_p1) {
	eqcopy___system_u2754((&(*dest_p0).scheme), (*src_p1).scheme);
	eqcopy___system_u2754((&(*dest_p0).username), (*src_p1).username);
	eqcopy___system_u2754((&(*dest_p0).password), (*src_p1).password);
	eqcopy___system_u2754((&(*dest_p0).hostname), (*src_p1).hostname);
	eqcopy___system_u2754((&(*dest_p0).port), (*src_p1).port);
	eqcopy___system_u2754((&(*dest_p0).path), (*src_p1).path);
	eqcopy___system_u2754((&(*dest_p0).query), (*src_p1).query);
	eqcopy___system_u2754((&(*dest_p0).anchor), (*src_p1).anchor);
	(*dest_p0).opaque = (*src_p1).opaque;
	(*dest_p0).isIpv6 = (*src_p1).isIpv6;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdup___pureZuri_u219)(tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* src_p0, tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* Result) {
	nimZeroMem((void*)Result, sizeof(tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA));
	(*Result).scheme = eqdup___system_u2757((*src_p0).scheme);
	(*Result).username = eqdup___system_u2757((*src_p0).username);
	(*Result).password = eqdup___system_u2757((*src_p0).password);
	(*Result).hostname = eqdup___system_u2757((*src_p0).hostname);
	(*Result).port = eqdup___system_u2757((*src_p0).port);
	(*Result).path = eqdup___system_u2757((*src_p0).path);
	(*Result).query = eqdup___system_u2757((*src_p0).query);
	(*Result).anchor = eqdup___system_u2757((*src_p0).anchor);
	(*Result).opaque = (*src_p0).opaque;
	(*Result).isIpv6 = (*src_p0).isIpv6;
}
static N_INLINE(NimStringV2, X5BX5D___pureZstrutils_u1291)(NimStringV2 s_p0, tyObject_HSlice__atPNPXY5GObvliR9b4ZIorQ x_p1) {
	NimStringV2 result;
	NI a_1;
	NI L_1;
	NI TM__VzbRQH9cb1xm1tSKH4PwBSw_48;
	NI TM__VzbRQH9cb1xm1tSKH4PwBSw_49;
{	result.len = 0; result.p = NIM_NIL;
	a_1 = x_p1.a;
	if (nimSubInt(x_p1.b, a_1, &TM__VzbRQH9cb1xm1tSKH4PwBSw_48)) { raiseOverflow(); goto BeforeRet_;
	};
	if (nimAddInt((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_48), ((NI)1), &TM__VzbRQH9cb1xm1tSKH4PwBSw_49)) { raiseOverflow(); goto BeforeRet_;
	};
	L_1 = (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_49);
	if ((L_1) < ((NI)0) || (L_1) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI(L_1, ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_;
	}
	result = mnewString((L_1));
	{
		NI i_1;
		NI i_2;
		i_1 = (NI)0;
		i_2 = ((NI)0);
		{
			while (1) {
				NI TM__VzbRQH9cb1xm1tSKH4PwBSw_50;
				NI TM__VzbRQH9cb1xm1tSKH4PwBSw_51;
				if (!(i_2 < L_1)) goto LA3;
				i_1 = i_2;
				if (i_1 < 0 || i_1 >= result.len){ raiseIndexError2(i_1,result.len-1); goto BeforeRet_;
				}
				nimPrepareStrMutationV2((&result));
				if (nimAddInt(i_1, a_1, &TM__VzbRQH9cb1xm1tSKH4PwBSw_50)) { raiseOverflow(); goto BeforeRet_;
				};
				if ((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_50) < 0 || (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_50) >= s_p0.len){ raiseIndexError2((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_50),s_p0.len-1); goto BeforeRet_;
				}
				result.p->data[i_1] = s_p0.p->data[(NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_50)];
				if (nimAddInt(i_2, ((NI)1), &TM__VzbRQH9cb1xm1tSKH4PwBSw_51)) { raiseOverflow(); goto BeforeRet_;
				};
				i_2 = (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_51);
			} LA3: ;
		}
	}
	}BeforeRet_: ;
	return result;
}
static N_INLINE(tyObject_HSlice__atPNPXY5GObvliR9b4ZIorQ, dotdot___stdZstrbasics_u48)(NI a_p0, NI b_p1) {
	tyObject_HSlice__atPNPXY5GObvliR9b4ZIorQ result;
	result.a = a_p0;
	result.b = b_p1;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, slash___pureZuri_u383)(tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* x_p0, NimStringV2 path_p1, tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA* Result) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimZeroMem((void*)Result, sizeof(tyObject_Uri__MX62yCLGQmnfVYEE3Hjm9cA));
	eqcopy___pureZuri_u216(Result, x_p0);
	{
		if (!((*Result).path.len == ((NI)0))) goto LA3_;
		{
			NIM_BOOL T7_;
			T7_ = (NIM_BOOL)0;
			T7_ = (path_p1.len == ((NI)0));
			if (T7_) goto LA8_;
			if (((NI)0) < 0 || ((NI)0) >= path_p1.len){ raiseIndexError2(((NI)0),path_p1.len-1); goto BeforeRet_;
			}
			T7_ = !(((NU8)(path_p1.p->data[((NI)0)]) == (NU8)(47)));
LA8_: ;
			if (!T7_) goto LA9_;
			eqsink___system_u2760((&(*Result).path), TM__VzbRQH9cb1xm1tSKH4PwBSw_46);
		}
LA9_: ;
		prepareAdd((&(*Result).path), path_p1.len + 0);
appendString((&(*Result).path), path_p1);
		goto BeforeRet_;
	}
LA3_: ;
	{
		NIM_BOOL T13_;
		NI TM__VzbRQH9cb1xm1tSKH4PwBSw_47;
		T13_ = (NIM_BOOL)0;
		T13_ = (((NI)0) < (*Result).path.len);
		if (!(T13_)) goto LA14_;
		if (nimSubInt((*Result).path.len, ((NI)1), &TM__VzbRQH9cb1xm1tSKH4PwBSw_47)) { raiseOverflow(); goto BeforeRet_;
		};
		if ((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_47) < 0 || (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_47) >= (*Result).path.len){ raiseIndexError2((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_47),(*Result).path.len-1); goto BeforeRet_;
		}
		T13_ = ((NU8)((*Result).path.p->data[(NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_47)]) == (NU8)(47));
LA14_: ;
		if (!T13_) goto LA15_;
		{
			NIM_BOOL T19_;
			NimStringV2 colontmpD_;
			NI TM__VzbRQH9cb1xm1tSKH4PwBSw_52;
			tyObject_HSlice__atPNPXY5GObvliR9b4ZIorQ T23_;
			T19_ = (NIM_BOOL)0;
			T19_ = (((NI)0) < path_p1.len);
			if (!(T19_)) goto LA20_;
			if (((NI)0) < 0 || ((NI)0) >= path_p1.len){ raiseIndexError2(((NI)0),path_p1.len-1); goto BeforeRet_;
			}
			T19_ = ((NU8)(path_p1.p->data[((NI)0)]) == (NU8)(47));
LA20_: ;
			if (!T19_) goto LA21_;
			colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
			if (nimSubInt(path_p1.len, ((NI)1), &TM__VzbRQH9cb1xm1tSKH4PwBSw_52)) { raiseOverflow(); goto BeforeRet_;
			};
			T23_ = dotdot___stdZstrbasics_u48(((NI)1), (NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_52));
			colontmpD_ = X5BX5D___pureZstrutils_u1291(path_p1, T23_);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			prepareAdd((&(*Result).path), colontmpD_.len + 0);
appendString((&(*Result).path), colontmpD_);
			if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD_.p);
}
		}
		goto LA17_;
LA21_: ;
		{
			prepareAdd((&(*Result).path), path_p1.len + 0);
appendString((&(*Result).path), path_p1);
		}
LA17_: ;
	}
	goto LA11_;
LA15_: ;
	{
		{
			NIM_BOOL T28_;
			T28_ = (NIM_BOOL)0;
			T28_ = (path_p1.len == ((NI)0));
			if (T28_) goto LA29_;
			if (((NI)0) < 0 || ((NI)0) >= path_p1.len){ raiseIndexError2(((NI)0),path_p1.len-1); goto BeforeRet_;
			}
			T28_ = !(((NU8)(path_p1.p->data[((NI)0)]) == (NU8)(47)));
LA29_: ;
			if (!T28_) goto LA30_;
			nimAddCharV1((&(*Result).path), 47);
		}
LA30_: ;
		prepareAdd((&(*Result).path), path_p1.len + 0);
appendString((&(*Result).path), path_p1);
	}
LA11_: ;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, encodeUrl__pureZuri_u83)(NimStringV2 s_p0, NIM_BOOL usePlus_p1) {
	NimStringV2 result;
	NimStringV2 fromSpace_1;
	NI TM__VzbRQH9cb1xm1tSKH4PwBSw_53;
	NimStringV2 T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result.len = 0; result.p = NIM_NIL;
	fromSpace_1.len = 0; fromSpace_1.p = NIM_NIL;
	if (nimAddInt(s_p0.len, (NI)((NI64)(s_p0.len) >> (NU64)(((NI)2) & (64 - 1))), &TM__VzbRQH9cb1xm1tSKH4PwBSw_53)) { raiseOverflow(); goto BeforeRet_;
	};
	if (((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_53)) < ((NI)0) || ((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_53)) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_53), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_;
	}
	result = rawNewString(((NI)(TM__VzbRQH9cb1xm1tSKH4PwBSw_53)));
	T1_.len = 0; T1_.p = NIM_NIL;
	{
		if (!usePlus_p1) goto LA4_;
		fromSpace_1 = TM__VzbRQH9cb1xm1tSKH4PwBSw_55;
	}
	goto LA2_;
LA4_: ;
	{
		fromSpace_1 = TM__VzbRQH9cb1xm1tSKH4PwBSw_57;
	}
LA2_: ;
	{
		NIM_CHAR c_1;
		NI i_1;
		NI L_1;
		c_1 = (NIM_CHAR)0;
		i_1 = ((NI)0);
		L_1 = s_p0.len;
		{
			while (1) {
				if (!(i_1 < L_1)) goto LA9;
				if (i_1 < 0 || i_1 >= s_p0.len){ raiseIndexError2(i_1,s_p0.len-1); goto BeforeRet_;
				}
				c_1 = s_p0.p->data[i_1];
				switch (((NU8)(c_1))) {
				case 97 ... 122:
				case 65 ... 90:
				case 48 ... 57:
				case 45:
				case 46:
				case 95:
				case 126:
				{
					nimAddCharV1((&result), c_1);
				}
				break;
				case 32:
				{
					prepareAdd((&result), fromSpace_1.len + 0);
appendString((&result), fromSpace_1);
				}
				break;
				default:
				{
					NimStringV2 colontmpD_;
					colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
					nimAddCharV1((&result), 37);
					colontmpD_ = toHex__pureZstrutils_u2181(((NU8)(c_1)), ((NI)2));
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
					prepareAdd((&result), colontmpD_.len + 0);
appendString((&result), colontmpD_);
					if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD_.p);
}
				}
				break;
				}
				i_1 += ((NI)1);
				{
					if (!!((s_p0.len == L_1))) goto LA15_;
					failedAssertImpl__stdZassertions_u95(TM__VzbRQH9cb1xm1tSKH4PwBSw_59);
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				}
LA15_: ;
			} LA9: ;
		}
	}
	}BeforeRet_: ;
	return result;
}
