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

#include "nimbase.h"
#include <string.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
typedef struct tyTuple__UV3llMMYFckfui8YMBuUZA tyTuple__UV3llMMYFckfui8YMBuUZA;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_HSlice__OAVyDXS0QPw7LdXClfU2hA tyObject_HSlice__OAVyDXS0QPw7LdXClfU2hA;
struct NimStrPayload {
	NI cap;
	NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
	NI len;
	NimStrPayload* p;
};
struct tyTuple__UV3llMMYFckfui8YMBuUZA {
	NimStringV2 Field0;
	NimStringV2 Field1;
};
typedef NU8 tySet_tyChar__nmiMWKVIe46vacnhAFrQvw[32];
struct tyObject_HSlice__OAVyDXS0QPw7LdXClfU2hA {
	NI a;
	NI b;
};
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___system_u2630)(NimStringV2* dest_p0, NimStringV2 src_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqwasMoved___system_u2624)(NimStringV2* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___system_u2627)(NimStringV2 dest_p0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nsuReplaceChar)(NimStringV2 s_p0, NIM_CHAR sub_p1, NIM_CHAR by_p2);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nsuToUpperAsciiStr)(NimStringV2 s_p0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nsuStrip)(NimStringV2 s_p0, NIM_BOOL leading_p1, NIM_BOOL trailing_p2, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw chars_p3);
static N_INLINE(NimStringV2, X5BX5D___pureZstrutils_u1285)(NimStringV2 s_p0, tyObject_HSlice__OAVyDXS0QPw7LdXClfU2hA x_p1);
N_NIMCALL(NimStringV2, mnewString)(NI len_p0);
static N_INLINE(void, nimPrepareStrMutationV2)(NimStringV2* s_p0);
N_LIB_PRIVATE N_NIMCALL(void, nimPrepareStrMutationImpl__system_u2378)(NimStringV2* s_p0);
static N_INLINE(tyObject_HSlice__OAVyDXS0QPw7LdXClfU2hA, dotdot___stdZstrbasics_u49)(NI a_p0, NI b_p1);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringV2 a_p0, NimStringV2 b_p1);
static N_INLINE(NIM_BOOL, equalMem__system_u1726)(void* a_p0, void* b_p1, NI size_p2);
static N_INLINE(int, nimCmpMem)(void* a_p0, void* b_p1, NI size_p2);
N_LIB_PRIVATE N_NIMCALL(NI, nsuFindChar)(NimStringV2 s_p0, NIM_CHAR sub_p1, NI start_p2, NI last_p3);
static N_INLINE(NimStringV2, X5BX5D___pureZstrutils_u1313)(NimStringV2 s_p0, tyObject_HSlice__OAVyDXS0QPw7LdXClfU2hA x_p1);
static N_INLINE(tyObject_HSlice__OAVyDXS0QPw7LdXClfU2hA, dotdot___stdZenumutils_u106)(NI a_p0, NI b_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___stdZprivateZntpath_u128)(tyTuple__UV3llMMYFckfui8YMBuUZA* dest_p0, tyTuple__UV3llMMYFckfui8YMBuUZA src_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, eqdup___system_u2633)(NimStringV2 src_p0);
static const struct {
  NI cap; NIM_CHAR data[0+1];
} TM__zOq09cgA9b1N0AGiRzbR9aQww_2 = { 0 | NIM_STRLIT_FLAG, "" };
static const NimStringV2 TM__zOq09cgA9b1N0AGiRzbR9aQww_3 = {0, (NimStrPayload*)&TM__zOq09cgA9b1N0AGiRzbR9aQww_2};
static const struct {
  NI cap; NIM_CHAR data[7+1];
} TM__zOq09cgA9b1N0AGiRzbR9aQww_4 = { 7 | NIM_STRLIT_FLAG, "\\\\\?\\UNC" };
static const NimStringV2 TM__zOq09cgA9b1N0AGiRzbR9aQww_5 = {7, (NimStrPayload*)&TM__zOq09cgA9b1N0AGiRzbR9aQww_4};
static NIM_CONST tySet_tyChar__nmiMWKVIe46vacnhAFrQvw TM__zOq09cgA9b1N0AGiRzbR9aQww_6 = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
;
extern NIM_BOOL nimInErrorMode__system_u4304;
static N_INLINE(void, nimSetMem__systemZmemory_u7)(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(NIM_BOOL*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	result = (&nimInErrorMode__system_u4304);
	return result;
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimSetMem__systemZmemory_u7(p_p0, ((int)0), size_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
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)1073741824)) == ((NI)1073741824));
LA4_: ;
		if (!T3_) goto LA5_;
		nimPrepareStrMutationImpl__system_u2378(s_p0);
	}
LA5_: ;
}
static N_INLINE(NimStringV2, X5BX5D___pureZstrutils_u1285)(NimStringV2 s_p0, tyObject_HSlice__OAVyDXS0QPw7LdXClfU2hA x_p1) {
	NimStringV2 result;
	NI a_1;
	NI L_1;
	result.len = 0; result.p = NIM_NIL;
	a_1 = x_p1.a;
	L_1 = (NI)((NI)(x_p1.b - a_1) + ((NI)1));
	result = mnewString((L_1));
	{
		NI i_1;
		NI i_2;
		i_1 = (NI)0;
		i_2 = ((NI)0);
		{
			while (1) {
				if (!(i_2 < L_1)) goto LA3;
				i_1 = i_2;
				nimPrepareStrMutationV2((&result));
				result.p->data[i_1] = s_p0.p->data[(NI)(i_1 + a_1)];
				i_2 += ((NI)1);
			} LA3: ;
		}
	}
	return result;
}
static N_INLINE(tyObject_HSlice__OAVyDXS0QPw7LdXClfU2hA, dotdot___stdZstrbasics_u49)(NI a_p0, NI b_p1) {
	tyObject_HSlice__OAVyDXS0QPw7LdXClfU2hA result;
	result.a = a_p0;
	result.b = b_p1;
	return result;
}
static N_INLINE(int, nimCmpMem)(void* a_p0, void* b_p1, NI size_p2) {
	int result;
	result = memcmp(a_p0, b_p1, ((size_t) (size_p2)));
	return result;
}
static N_INLINE(NIM_BOOL, equalMem__system_u1726)(void* a_p0, void* b_p1, NI size_p2) {
	NIM_BOOL result;
	int T1_;
	T1_ = (int)0;
	T1_ = nimCmpMem(a_p0, b_p1, size_p2);
	result = (T1_ == ((NI32)0));
	return result;
}
static N_INLINE(NIM_BOOL, eqStrings)(NimStringV2 a_p0, NimStringV2 b_p1) {
	NIM_BOOL result;
	NI alen_1;
	NI blen_1;
{	result = NIM_FALSE;
	alen_1 = a_p0.len;
	blen_1 = b_p1.len;
	{
		if (!(alen_1 == blen_1)) goto LA3_;
		{
			if (!(alen_1 == ((NI)0))) goto LA7_;
			result = NIM_TRUE;
			goto BeforeRet_;
		}
LA7_: ;
		result = equalMem__system_u1726(((void*) ((&a_p0.p->data[((NI)0)]))), ((void*) ((&b_p1.p->data[((NI)0)]))), (alen_1));
		goto BeforeRet_;
	}
LA3_: ;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NimStringV2, X5BX5D___pureZstrutils_u1313)(NimStringV2 s_p0, tyObject_HSlice__OAVyDXS0QPw7LdXClfU2hA x_p1) {
	NimStringV2 result;
	NI a_1;
	NI L_1;
	result.len = 0; result.p = NIM_NIL;
	a_1 = x_p1.a;
	L_1 = (NI)((NI)((NI)(s_p0.len - x_p1.b) - a_1) + ((NI)1));
	result = mnewString((L_1));
	{
		NI i_1;
		NI i_2;
		i_1 = (NI)0;
		i_2 = ((NI)0);
		{
			while (1) {
				if (!(i_2 < L_1)) goto LA3;
				i_1 = i_2;
				nimPrepareStrMutationV2((&result));
				result.p->data[i_1] = s_p0.p->data[(NI)(i_1 + a_1)];
				i_2 += ((NI)1);
			} LA3: ;
		}
	}
	return result;
}
static N_INLINE(tyObject_HSlice__OAVyDXS0QPw7LdXClfU2hA, dotdot___stdZenumutils_u106)(NI a_p0, NI b_p1) {
	tyObject_HSlice__OAVyDXS0QPw7LdXClfU2hA result;
	result.a = a_p0;
	result.b = b_p1;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqsink___stdZprivateZntpath_u128)(tyTuple__UV3llMMYFckfui8YMBuUZA* dest_p0, tyTuple__UV3llMMYFckfui8YMBuUZA src_p1) {
	if ((*dest_p0).Field0.p != src_p1.Field0.p) {	eqdestroy___system_u2627((*dest_p0).Field0);
	}
(*dest_p0).Field0.len = src_p1.Field0.len; (*dest_p0).Field0.p = src_p1.Field0.p;
	if ((*dest_p0).Field1.p != src_p1.Field1.p) {	eqdestroy___system_u2627((*dest_p0).Field1);
	}
(*dest_p0).Field1.len = src_p1.Field1.len; (*dest_p0).Field1.p = src_p1.Field1.p;
}
N_LIB_PRIVATE N_NIMCALL(tyTuple__UV3llMMYFckfui8YMBuUZA, splitDrive__stdZprivateZntpath_u2)(NimStringV2 p_p0) {
	tyTuple__UV3llMMYFckfui8YMBuUZA result;
	NimStringV2 colontmp_;
	NimStringV2 colontmp__2;
	NimStringV2 normp_1;
	NimStringV2 blitTmp_1;
	NimStringV2 blitTmp_2;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimZeroMem((void*)(&result), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
	colontmp_.len = 0; colontmp_.p = NIM_NIL;
	colontmp__2.len = 0; colontmp__2.p = NIM_NIL;
	normp_1.len = 0; normp_1.p = NIM_NIL;
	colontmp_ = TM__zOq09cgA9b1N0AGiRzbR9aQww_3;
	eqcopy___system_u2630((&colontmp__2), p_p0);
	blitTmp_1 = colontmp_;
	eqwasMoved___system_u2624((&colontmp_));
	result.Field0 = blitTmp_1;
	blitTmp_2 = colontmp__2;
	eqwasMoved___system_u2624((&colontmp__2));
	result.Field1 = blitTmp_2;
	{
		if (!(p_p0.len < ((NI)2))) goto LA4_;
		eqdestroy___system_u2627(normp_1);
		eqdestroy___system_u2627(colontmp__2);
		eqdestroy___system_u2627(colontmp_);
		goto BeforeRet_;
	}
LA4_: ;
	normp_1 = nsuReplaceChar(p_p0, 47, 92);
	if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	{
		NIM_BOOL T8_;
		NIM_BOOL T9_;
		NIM_BOOL T10_;
		NI colontmpD_;
		NimStringV2 colontmp__3;
		NimStringV2 colontmp__4;
		NI start_1;
		NI index_1;
		NI index2_1;
		tyObject_HSlice__OAVyDXS0QPw7LdXClfU2hA T36_;
		tyObject_HSlice__OAVyDXS0QPw7LdXClfU2hA T37_;
		tyTuple__UV3llMMYFckfui8YMBuUZA T38_;
		NimStringV2 blitTmp_3;
		NimStringV2 blitTmp_4;
		T8_ = (NIM_BOOL)0;
		T9_ = (NIM_BOOL)0;
		T10_ = (NIM_BOOL)0;
		T10_ = (((NI)2) < p_p0.len);
		if (!(T10_)) goto LA11_;
		T10_ = ((NU8)(normp_1.p->data[((NI)0)]) == (NU8)(92));
LA11_: ;
		T9_ = T10_;
		if (!(T9_)) goto LA12_;
		T9_ = ((NU8)(normp_1.p->data[((NI)1)]) == (NU8)(92));
LA12_: ;
		T8_ = T9_;
		if (!(T8_)) goto LA13_;
		T8_ = !(((NU8)(normp_1.p->data[((NI)2)]) == (NU8)(92)));
LA13_: ;
		if (!T8_) goto LA14_;
		colontmpD_ = (NI)0;
		colontmp__3.len = 0; colontmp__3.p = NIM_NIL;
		colontmp__4.len = 0; colontmp__4.p = NIM_NIL;
		{
			NimStringV2 colontmpD__2;
			NimStringV2 colontmpD__3;
			NimStringV2 colontmpD__4;
			NI colontmpD__5;
			NI colontmpD__6;
			NI idx_1;
			colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
			colontmpD__3.len = 0; colontmpD__3.p = NIM_NIL;
			colontmpD__4.len = 0; colontmpD__4.p = NIM_NIL;
			colontmpD__5 = (NI)0;
			colontmpD__6 = (NI)0;
			idx_1 = ((((NI)8) <= normp_1.len) ? ((NI)8) : normp_1.len);
			{
				tyObject_HSlice__OAVyDXS0QPw7LdXClfU2hA T20_;
				T20_ = dotdot___stdZstrbasics_u49(((NI)0), (NI)(idx_1 - ((NI)1)));
				colontmpD__2 = X5BX5D___pureZstrutils_u1285(normp_1, T20_);
				if (NIM_UNLIKELY(*nimErr_)) goto LA16_;
				colontmpD__3 = nsuStrip(colontmpD__2, NIM_FALSE, NIM_TRUE, TM__zOq09cgA9b1N0AGiRzbR9aQww_6);
				if (NIM_UNLIKELY(*nimErr_)) goto LA16_;
				colontmpD__4 = nsuToUpperAsciiStr(colontmpD__3);
				if (NIM_UNLIKELY(*nimErr_)) goto LA16_;
				if (!eqStrings(TM__zOq09cgA9b1N0AGiRzbR9aQww_5, colontmpD__4)) goto LA21_;
				colontmpD__5 = ((NI)8);
				colontmpD_ = colontmpD__5;
			}
			goto LA18_;
LA21_: ;
			{
				colontmpD__6 = ((NI)2);
				colontmpD_ = colontmpD__6;
			}
LA18_: ;
			eqdestroy___system_u2627(colontmpD__4);
			eqdestroy___system_u2627(colontmpD__3);
			eqdestroy___system_u2627(colontmpD__2);
			start_1 = colontmpD_;
		}
		index_1 = nsuFindChar(normp_1, 92, (start_1), ((NI)-1));
		if (NIM_UNLIKELY(*nimErr_)) goto LA16_;
		{
			if (!(index_1 == ((NI)-1))) goto LA26_;
			eqdestroy___system_u2627(colontmp__4);
			eqdestroy___system_u2627(colontmp__3);
			eqdestroy___system_u2627(normp_1);
			eqdestroy___system_u2627(colontmp__2);
			eqdestroy___system_u2627(colontmp_);
			goto BeforeRet_;
		}
LA26_: ;
		index2_1 = nsuFindChar(normp_1, 92, ((NI)(index_1 + ((NI)1))), ((NI)-1));
		if (NIM_UNLIKELY(*nimErr_)) goto LA16_;
		{
			if (!(index2_1 == (NI)(index_1 + ((NI)1)))) goto LA30_;
			eqdestroy___system_u2627(colontmp__4);
			eqdestroy___system_u2627(colontmp__3);
			eqdestroy___system_u2627(normp_1);
			eqdestroy___system_u2627(colontmp__2);
			eqdestroy___system_u2627(colontmp_);
			goto BeforeRet_;
		}
LA30_: ;
		{
			if (!(index2_1 == ((NI)-1))) goto LA34_;
			index2_1 = p_p0.len;
		}
LA34_: ;
		T36_ = dotdot___stdZstrbasics_u49(((NI)0), (NI)(index2_1 - ((NI)1)));
		colontmp__3 = X5BX5D___pureZstrutils_u1285(p_p0, T36_);
		if (NIM_UNLIKELY(*nimErr_)) goto LA16_;
		T37_ = dotdot___stdZenumutils_u106(index2_1, ((NI)1));
		colontmp__4 = X5BX5D___pureZstrutils_u1313(p_p0, T37_);
		if (NIM_UNLIKELY(*nimErr_)) goto LA16_;
		blitTmp_3 = colontmp__3;
		eqwasMoved___system_u2624((&colontmp__3));
		T38_.Field0 = blitTmp_3;
		blitTmp_4 = colontmp__4;
		eqwasMoved___system_u2624((&colontmp__4));
		T38_.Field1 = blitTmp_4;
		eqsink___stdZprivateZntpath_u128((&result), T38_);
		eqdestroy___system_u2627(colontmp__4);
		eqdestroy___system_u2627(colontmp__3);
		eqdestroy___system_u2627(normp_1);
		eqdestroy___system_u2627(colontmp__2);
		eqdestroy___system_u2627(colontmp_);
		goto BeforeRet_;
		{
			LA16_:;
		}
		{
			eqdestroy___system_u2627(colontmp__4);
			eqdestroy___system_u2627(colontmp__3);
		}
		if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	}
LA14_: ;
	{
		NimStringV2 colontmp__5;
		NimStringV2 colontmp__6;
		tyObject_HSlice__OAVyDXS0QPw7LdXClfU2hA T46_;
		tyObject_HSlice__OAVyDXS0QPw7LdXClfU2hA T47_;
		tyTuple__UV3llMMYFckfui8YMBuUZA T48_;
		NimStringV2 blitTmp_5;
		NimStringV2 blitTmp_6;
		if (!((NU8)(p_p0.p->data[((NI)1)]) == (NU8)(58))) goto LA43_;
		colontmp__5.len = 0; colontmp__5.p = NIM_NIL;
		colontmp__6.len = 0; colontmp__6.p = NIM_NIL;
		T46_ = dotdot___stdZstrbasics_u49(((NI)0), ((NI)1));
		colontmp__5 = X5BX5D___pureZstrutils_u1285(p_p0, T46_);
		if (NIM_UNLIKELY(*nimErr_)) goto LA45_;
		T47_ = dotdot___stdZenumutils_u106(((NI)2), ((NI)1));
		colontmp__6 = X5BX5D___pureZstrutils_u1313(p_p0, T47_);
		if (NIM_UNLIKELY(*nimErr_)) goto LA45_;
		blitTmp_5 = colontmp__5;
		eqwasMoved___system_u2624((&colontmp__5));
		T48_.Field0 = blitTmp_5;
		blitTmp_6 = colontmp__6;
		eqwasMoved___system_u2624((&colontmp__6));
		T48_.Field1 = blitTmp_6;
		eqsink___stdZprivateZntpath_u128((&result), T48_);
		eqdestroy___system_u2627(colontmp__6);
		eqdestroy___system_u2627(colontmp__5);
		eqdestroy___system_u2627(normp_1);
		eqdestroy___system_u2627(colontmp__2);
		eqdestroy___system_u2627(colontmp_);
		goto BeforeRet_;
		{
			LA45_:;
		}
		{
			eqdestroy___system_u2627(colontmp__6);
			eqdestroy___system_u2627(colontmp__5);
		}
		if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	}
LA43_: ;
	{
		LA1_:;
	}
	{
		eqdestroy___system_u2627(normp_1);
		eqdestroy___system_u2627(colontmp__2);
		eqdestroy___system_u2627(colontmp_);
	}
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___stdZprivateZntpath_u119)(tyTuple__UV3llMMYFckfui8YMBuUZA dest_p0) {
	eqdestroy___system_u2627(dest_p0.Field0);
	eqdestroy___system_u2627(dest_p0.Field1);
}
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___stdZprivateZntpath_u122)(tyTuple__UV3llMMYFckfui8YMBuUZA* dest_p0, tyTuple__UV3llMMYFckfui8YMBuUZA src_p1) {
	eqcopy___system_u2630((&(*dest_p0).Field0), src_p1.Field0);
	eqcopy___system_u2630((&(*dest_p0).Field1), src_p1.Field1);
}
N_LIB_PRIVATE N_NIMCALL(void, eqwasMoved___stdZprivateZntpath_u116)(tyTuple__UV3llMMYFckfui8YMBuUZA* dest_p0) {
	(*dest_p0).Field0.len = 0; (*dest_p0).Field0.p = NIM_NIL;
	(*dest_p0).Field1.len = 0; (*dest_p0).Field1.p = NIM_NIL;
}
N_LIB_PRIVATE N_NIMCALL(tyTuple__UV3llMMYFckfui8YMBuUZA, eqdup___stdZprivateZntpath_u125)(tyTuple__UV3llMMYFckfui8YMBuUZA src_p0) {
	tyTuple__UV3llMMYFckfui8YMBuUZA result;
	nimZeroMem((void*)(&result), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
	result.Field0 = eqdup___system_u2633(src_p0.Field0);
	result.Field1 = eqdup___system_u2633(src_p0.Field1);
	return result;
}
