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

#include "nimbase.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
#include <string.h>
#include <dirent.h>
#include <time.h>
#include <unistd.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 NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_IOError__FsM2LSiW5usgjecIvsloBA tyObject_IOError__FsM2LSiW5usgjecIvsloBA;
typedef struct tyObject_CatchableError__liO6E8JNJNTVmf9cnXKZiug tyObject_CatchableError__liO6E8JNJNTVmf9cnXKZiug;
typedef struct Exception Exception;
typedef struct RootObj RootObj;
typedef struct TNimTypeV2 TNimTypeV2;
typedef struct tySequence__3EvzHGO0xyXGnJBUggwfKQ tySequence__3EvzHGO0xyXGnJBUggwfKQ;
typedef struct tySequence__3EvzHGO0xyXGnJBUggwfKQ_Content tySequence__3EvzHGO0xyXGnJBUggwfKQ_Content;
typedef struct tyTuple__UV3llMMYFckfui8YMBuUZA tyTuple__UV3llMMYFckfui8YMBuUZA;
typedef struct tyTuple__4ZA8Mtd29a9cAR3xLlz7LVrw tyTuple__4ZA8Mtd29a9cAR3xLlz7LVrw;
typedef struct tyObject_StackTraceEntry__lcKzdyiD6sm3eeh28rx7fw tyObject_StackTraceEntry__lcKzdyiD6sm3eeh28rx7fw;
struct NimStrPayload {
	NI cap;
	NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
	NI len;
	NimStrPayload* p;
};
struct TNimTypeV2 {
	void* destructor;
	NI size;
	NI16 align;
	NI16 depth;
	NU32* display;
	void* traceImpl;
	void* typeInfoV1;
	NI flags;
	void* vTable[SEQ_DECL_SIZE];
};
struct RootObj {
	TNimTypeV2* m_type;
};
struct tySequence__3EvzHGO0xyXGnJBUggwfKQ {
  NI len; tySequence__3EvzHGO0xyXGnJBUggwfKQ_Content* p;
};
struct Exception {
	RootObj Sup;
	Exception* parent;
	NCSTRING name;
	NimStringV2 message;
	tySequence__3EvzHGO0xyXGnJBUggwfKQ trace;
	Exception* up;
};
struct tyObject_CatchableError__liO6E8JNJNTVmf9cnXKZiug {
	Exception Sup;
};
struct tyObject_IOError__FsM2LSiW5usgjecIvsloBA {
	tyObject_CatchableError__liO6E8JNJNTVmf9cnXKZiug Sup;
};
typedef NU8 tyEnum_PathComponent__OiWviOlsjyqprC56d9bn9b4Q;
typedef NIM_CHAR tyArray__bErjiHmvISNmC2iIqkq21Q[256];
struct tyTuple__UV3llMMYFckfui8YMBuUZA {
	NimStringV2 Field0;
	NimStringV2 Field1;
};
struct tyTuple__4ZA8Mtd29a9cAR3xLlz7LVrw {
	tyEnum_PathComponent__OiWviOlsjyqprC56d9bn9b4Q Field0;
	NIM_BOOL Field1;
};
typedef NU8 tySet_tyEnum_CopyFlag__6cN1ZxVKOK6LwdRV7k5u2g;
struct tyObject_StackTraceEntry__lcKzdyiD6sm3eeh28rx7fw {
	NCSTRING procname;
	NI line;
	NCSTRING filename;
};
struct tySequence__3EvzHGO0xyXGnJBUggwfKQ_Content { NI cap; tyObject_StackTraceEntry__lcKzdyiD6sm3eeh28rx7fw data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosisAbsolute)(NimStringV2 path_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___system_u2754)(NimStringV2* dest_p0, NimStringV2 src_p1);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosexistsOrCreateDir)(NimStringV2 dir_p0);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, rawCreateDir__stdZprivateZosdirs_u467)(NimStringV2 dir_p0);
static N_INLINE(NCSTRING, nimToCStringConv)(NimStringV2 s_p0);
N_LIB_PRIVATE N_NOINLINE(void, raiseOSError__stdZoserrors_u119)(NI32 errorCode_p0, NimStringV2 additionalInfo_p1);
N_LIB_PRIVATE N_NIMCALL(NI32, osLastError__stdZoserrors_u122)(void);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosdirExists)(NimStringV2 dir_p0);
N_LIB_PRIVATE N_NIMCALL(void*, nimNewObj)(NI size_p0, NI alignment_p1);
static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1);
static N_INLINE(void, copyMem__system_u1755)(void* dest_p0, void* source_p1, NI size_p2);
static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space_p0);
N_LIB_PRIVATE N_NIMCALL(void, raiseExceptionEx)(Exception* e_p0, NCSTRING ename_p1, NCSTRING procname_p2, NCSTRING filename_p3, NI line_p4);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosisRootDir)(NimStringV2 path_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___system_u2760)(NimStringV2* dest_p0, NimStringV2 src_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosparentDir)(NimStringV2 path_p0);
static N_INLINE(void, eqdestroy___system_u281)(NimStringV2 x_p0);
N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0);
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);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, substr__system_u9096)(NimStringV2 s_p0, NI first_p1, NI last_p2);
static N_INLINE(NIM_BOOL, nimAddInt)(NI a_p0, NI b_p1, NI* res_p2);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, tryMoveFSObject__stdZprivateZoscommon_u86)(NimStringV2 source_p0, NimStringV2 dest_p1, NIM_BOOL isDir_p2);
N_LIB_PRIVATE N_NIMCALL(void, noscopyDir)(NimStringV2 source_p0, NimStringV2 dest_p1, NIM_BOOL skipSpecial_p2);
N_LIB_PRIVATE N_NIMCALL(void, noscreateDir)(NimStringV2 dir_p0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, cstrToNimstr)(NCSTRING str_p0);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringV2 a_p0, NimStringV2 b_p1);
static N_INLINE(NIM_BOOL, equalMem__system_u1763)(void* a_p0, void* b_p1, NI size_p2);
static N_INLINE(int, nimCmpMem)(void* a_p0, void* b_p1, NI size_p2);
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);
static N_INLINE(NimStringV2, slash___stdZprivateZospaths2_u88)(NimStringV2 head_p0, NimStringV2 tail_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosjoinPath)(NimStringV2 head_p0, NimStringV2 tail_p1);
N_LIB_PRIVATE N_NIMCALL(tyTuple__4ZA8Mtd29a9cAR3xLlz7LVrw, getSymlinkFileKind__stdZprivateZoscommon_u17)(NimStringV2 path_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___stdZprivateZospaths2_u303)(tyTuple__UV3llMMYFckfui8YMBuUZA* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqwasMoved___system_u2751)(NimStringV2* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, nossplitPath)(NimStringV2 path_p0, tyTuple__UV3llMMYFckfui8YMBuUZA* Result);
N_LIB_PRIVATE N_NIMCALL(void, noscopyFile)(NimStringV2 source_p0, NimStringV2 dest_p1, tySet_tyEnum_CopyFlag__6cN1ZxVKOK6LwdRV7k5u2g options_p2, NI bufferSize_p3);
N_LIB_PRIVATE N_NIMCALL(void, nosremoveDir)(NimStringV2 dir_p0, NIM_BOOL checkDir_p1);
N_LIB_PRIVATE N_NIMCALL(void, nosremoveFile)(NimStringV2 file_p0);
N_LIB_PRIVATE N_NIMCALL(void, rawRemoveDir__stdZprivateZosdirs_u460)(NimStringV2 dir_p0);
extern TNimTypeV2 NTIv2__FsM2LSiW5usgjecIvsloBA_;
static const struct {
  NI cap; NIM_CHAR data[18+1];
} TM__UhMx4BhJKblm8VrPrbmAGA_2 = { 18 | NIM_STRLIT_FLAG, "Failed to create \'" };
static const NimStringV2 TM__UhMx4BhJKblm8VrPrbmAGA_3 = {18, (NimStrPayload*)&TM__UhMx4BhJKblm8VrPrbmAGA_2};
static const struct {
  NI cap; NIM_CHAR data[1+1];
} TM__UhMx4BhJKblm8VrPrbmAGA_4 = { 1 | NIM_STRLIT_FLAG, "\'" };
static const NimStringV2 TM__UhMx4BhJKblm8VrPrbmAGA_5 = {1, (NimStrPayload*)&TM__UhMx4BhJKblm8VrPrbmAGA_4};
static const struct {
  NI cap; NIM_CHAR data[1+1];
} TM__UhMx4BhJKblm8VrPrbmAGA_9 = { 1 | NIM_STRLIT_FLAG, "." };
static const NimStringV2 TM__UhMx4BhJKblm8VrPrbmAGA_10 = {1, (NimStrPayload*)&TM__UhMx4BhJKblm8VrPrbmAGA_9};
static const struct {
  NI cap; NIM_CHAR data[2+1];
} TM__UhMx4BhJKblm8VrPrbmAGA_11 = { 2 | NIM_STRLIT_FLAG, ".." };
static const NimStringV2 TM__UhMx4BhJKblm8VrPrbmAGA_12 = {2, (NimStrPayload*)&TM__UhMx4BhJKblm8VrPrbmAGA_11};
static const NimStringV2 TM__UhMx4BhJKblm8VrPrbmAGA_13 = {1, (NimStrPayload*)&TM__UhMx4BhJKblm8VrPrbmAGA_9};
static const NimStringV2 TM__UhMx4BhJKblm8VrPrbmAGA_14 = {2, (NimStrPayload*)&TM__UhMx4BhJKblm8VrPrbmAGA_11};
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4198;
static N_INLINE(NCSTRING, nimToCStringConv)(NimStringV2 s_p0) {
	NCSTRING result;
	{
		if (!(s_p0.len == ((NI)0))) goto LA3_;
		result = "";
	}
	goto LA1_;
LA3_: ;
	{
		result = ((NCSTRING) ((*s_p0.p).data));
	}
LA1_: ;
	return result;
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	result = (&nimInErrorMode__system_u4198);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, rawCreateDir__stdZprivateZosdirs_u467)(NimStringV2 dir_p0) {
	NIM_BOOL result;
	int res_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NIM_BOOL)0;
	res_1 = mkdir(nimToCStringConv(dir_p0), ((mode_t)511));
	{
		if (!(res_1 == ((NI32)0))) goto LA3_;
		result = NIM_TRUE;
	}
	goto LA1_;
LA3_: ;
	{
		if (!(errno == EEXIST)) goto LA6_;
		result = NIM_FALSE;
	}
	goto LA1_;
LA6_: ;
	{
		NI32 T9_;
		T9_ = (NI32)0;
		T9_ = osLastError__stdZoserrors_u122();
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		raiseOSError__stdZoserrors_u119(T9_, dir_p0);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA1_: ;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2) {
	void* T1_;
	T1_ = (void*)0;
	T1_ = memcpy(dest_p0, source_p1, ((size_t) (size_p2)));
}
static N_INLINE(void, copyMem__system_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_: ;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosexistsOrCreateDir)(NimStringV2 dir_p0) {
	NIM_BOOL result;
	NIM_BOOL T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NIM_BOOL)0;
	T1_ = (NIM_BOOL)0;
	T1_ = rawCreateDir__stdZprivateZosdirs_u467(dir_p0);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	result = !(T1_);
	{
		if (!result) goto LA4_;
		{
			NIM_BOOL T8_;
			tyObject_IOError__FsM2LSiW5usgjecIvsloBA* T11_;
			NimStringV2 T12_;
			T8_ = (NIM_BOOL)0;
			T8_ = nosdirExists(dir_p0);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			if (!!(T8_)) goto LA9_;
			T11_ = NIM_NIL;
			T11_ = (tyObject_IOError__FsM2LSiW5usgjecIvsloBA*) nimNewObj(sizeof(tyObject_IOError__FsM2LSiW5usgjecIvsloBA), NIM_ALIGNOF(tyObject_IOError__FsM2LSiW5usgjecIvsloBA));
			(*T11_).Sup.Sup.Sup.m_type = (&NTIv2__FsM2LSiW5usgjecIvsloBA_);
			(*T11_).Sup.Sup.name = "IOError";
			T12_.len = 0; T12_.p = NIM_NIL;
			T12_ = rawNewString(dir_p0.len + 19);
appendString((&T12_), TM__UhMx4BhJKblm8VrPrbmAGA_3);
appendString((&T12_), dir_p0);
appendString((&T12_), TM__UhMx4BhJKblm8VrPrbmAGA_5);
			(*T11_).Sup.Sup.message = T12_;
			(*T11_).Sup.Sup.parent = ((Exception*) NIM_NIL);
			raiseExceptionEx((Exception*)T11_, "IOError", "existsOrCreateDir", "osdirs.nim", 416);
goto BeforeRet_;
		}
LA9_: ;
	}
LA4_: ;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(void, eqdestroy___system_u281)(NimStringV2 x_p0) {
}
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(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(void, noscreateDir)(NimStringV2 dir_p0) {
	NIM_BOOL omitNext_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	{
		if (!(dir_p0.len == 0)) goto LA3_;
		goto BeforeRet_;
	}
LA3_: ;
	omitNext_1 = nosisAbsolute(dir_p0);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	{
		NimStringV2 p_1;
		p_1.len = 0; p_1.p = NIM_NIL;
		{
			NimStringV2 current_1;
			if (!NIM_FALSE) goto LA9_;
			current_1.len = 0; current_1.p = NIM_NIL;
			eqcopy___system_u2754((&current_1), dir_p0);
			{
				if (!NIM_TRUE) goto LA14_;
				eqcopy___system_u2754((&p_1), dir_p0);
				{
					if (!omitNext_1) goto LA18_;
					omitNext_1 = NIM_FALSE;
				}
				goto LA16_;
LA18_: ;
				{
					NIM_BOOL T21_;
					T21_ = (NIM_BOOL)0;
					T21_ = nosexistsOrCreateDir(p_1);
					if (NIM_UNLIKELY(*nimErr_)) goto LA11_;
					(void)(T21_);
				}
LA16_: ;
			}
LA14_: ;
			{
				while (1) {
					NimStringV2 T29_;
					{
						NIM_BOOL T26_;
						T26_ = (NIM_BOOL)0;
						T26_ = nosisRootDir(current_1);
						if (NIM_UNLIKELY(*nimErr_)) goto LA11_;
						if (!T26_) goto LA27_;
						goto LA22;
					}
LA27_: ;
					T29_.len = 0; T29_.p = NIM_NIL;
					T29_ = nosparentDir(current_1);
					if (NIM_UNLIKELY(*nimErr_)) {eqdestroy___system_u281(T29_); goto LA11_;}
					eqsink___system_u2760((&current_1), T29_);
					eqcopy___system_u2754((&p_1), current_1);
					{
						if (!omitNext_1) goto LA32_;
						omitNext_1 = NIM_FALSE;
					}
					goto LA30_;
LA32_: ;
					{
						NIM_BOOL T35_;
						T35_ = (NIM_BOOL)0;
						T35_ = nosexistsOrCreateDir(p_1);
						if (NIM_UNLIKELY(*nimErr_)) goto LA11_;
						(void)(T35_);
					}
LA30_: ;
				}
			} LA22: ;
			{
				LA11_:;
			}
			{
				if (current_1.p && !(current_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(current_1.p);
}
			}
			if (NIM_UNLIKELY(*nimErr_)) goto LA6_;
		}
		goto LA7_;
LA9_: ;
		{
			{
				NI i_1;
				NI colontmp_;
				NI TM__UhMx4BhJKblm8VrPrbmAGA_6;
				NI res_1;
				i_1 = (NI)0;
				colontmp_ = (NI)0;
				if (nimSubInt(dir_p0.len, ((NI)2), &TM__UhMx4BhJKblm8VrPrbmAGA_6)) { raiseOverflow(); goto LA6_;
				};
				colontmp_ = (NI)(TM__UhMx4BhJKblm8VrPrbmAGA_6);
				res_1 = ((NI)0);
				{
					while (1) {
						NI TM__UhMx4BhJKblm8VrPrbmAGA_8;
						if (!(res_1 <= colontmp_)) goto LA41;
						i_1 = ((NI) (res_1));
						{
							NIM_BOOL T44_;
							NIM_BOOL T46_;
							NI TM__UhMx4BhJKblm8VrPrbmAGA_7;
							NimStringV2 T50_;
							T44_ = (NIM_BOOL)0;
							if (i_1 < 0 || i_1 >= dir_p0.len){ raiseIndexError2(i_1,dir_p0.len-1); goto LA6_;
							}
							T44_ = (((NU8)(dir_p0.p->data[i_1])) == ((NU8)(47)) || ((NU8)(dir_p0.p->data[i_1])) == ((NU8)(47)));
							if (!(T44_)) goto LA45_;
							T46_ = (NIM_BOOL)0;
							T46_ = (i_1 == ((NI)0));
							if (T46_) goto LA47_;
							if (nimSubInt(i_1, ((NI)1), &TM__UhMx4BhJKblm8VrPrbmAGA_7)) { raiseOverflow(); goto LA6_;
							};
							if ((NI)(TM__UhMx4BhJKblm8VrPrbmAGA_7) < 0 || (NI)(TM__UhMx4BhJKblm8VrPrbmAGA_7) >= dir_p0.len){ raiseIndexError2((NI)(TM__UhMx4BhJKblm8VrPrbmAGA_7),dir_p0.len-1); goto LA6_;
							}
							T46_ = !((((NU8)(dir_p0.p->data[(NI)(TM__UhMx4BhJKblm8VrPrbmAGA_7)])) == ((NU8)(47)) || ((NU8)(dir_p0.p->data[(NI)(TM__UhMx4BhJKblm8VrPrbmAGA_7)])) == ((NU8)(47))));
LA47_: ;
							T44_ = T46_;
LA45_: ;
							if (!T44_) goto LA48_;
							T50_.len = 0; T50_.p = NIM_NIL;
							T50_ = substr__system_u9096(dir_p0, ((NI)0), i_1);
							eqsink___system_u2760((&p_1), T50_);
							{
								if (!omitNext_1) goto LA53_;
								omitNext_1 = NIM_FALSE;
							}
							goto LA51_;
LA53_: ;
							{
								NIM_BOOL T56_;
								T56_ = (NIM_BOOL)0;
								T56_ = nosexistsOrCreateDir(p_1);
								if (NIM_UNLIKELY(*nimErr_)) goto LA6_;
								(void)(T56_);
							}
LA51_: ;
						}
LA48_: ;
						if (nimAddInt(res_1, ((NI)1), &TM__UhMx4BhJKblm8VrPrbmAGA_8)) { raiseOverflow(); goto LA6_;
						};
						res_1 = (NI)(TM__UhMx4BhJKblm8VrPrbmAGA_8);
					} LA41: ;
				}
			}
			{
				if (!NIM_TRUE) goto LA59_;
				eqcopy___system_u2754((&p_1), dir_p0);
				{
					if (!omitNext_1) goto LA63_;
					omitNext_1 = NIM_FALSE;
				}
				goto LA61_;
LA63_: ;
				{
					NIM_BOOL T66_;
					T66_ = (NIM_BOOL)0;
					T66_ = nosexistsOrCreateDir(p_1);
					if (NIM_UNLIKELY(*nimErr_)) goto LA6_;
					(void)(T66_);
				}
LA61_: ;
			}
LA59_: ;
		}
LA7_: ;
		{
			LA6_:;
		}
		{
			if (p_1.p && !(p_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(p_1.p);
}
		}
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	}BeforeRet_: ;
}
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_u1763)(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_u1763(((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(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);
}
static N_INLINE(NimStringV2, slash___stdZprivateZospaths2_u88)(NimStringV2 head_p0, NimStringV2 tail_p1) {
	NimStringV2 result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result.len = 0; result.p = NIM_NIL;
	result = nosjoinPath(head_p0, tail_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, noscopyDir)(NimStringV2 source_p0, NimStringV2 dest_p1, NIM_BOOL skipSpecial_p2) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	noscreateDir(dest_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	{
		NimStringV2 path_1;
		tyEnum_PathComponent__OiWviOlsjyqprC56d9bn9b4Q kind_1;
		DIR* d_1;
		path_1.len = 0; path_1.p = NIM_NIL;
		kind_1 = (tyEnum_PathComponent__OiWviOlsjyqprC56d9bn9b4Q)0;
		d_1 = opendir(nimToCStringConv(source_p0));
		{
			if (!(d_1 == ((DIR*) NIM_NIL))) goto LA5_;
			{
				NI32 T11_;
				if (!NIM_FALSE) goto LA9_;
				T11_ = (NI32)0;
				T11_ = osLastError__stdZoserrors_u122();
				if (NIM_UNLIKELY(*nimErr_)) goto LA2_;
				raiseOSError__stdZoserrors_u119(T11_, source_p0);
				if (NIM_UNLIKELY(*nimErr_)) goto LA2_;
			}
LA9_: ;
		}
		goto LA3_;
LA5_: ;
		{
			{
				while (1) {
					{
						NimStringV2 y_1;
						struct dirent* x_1;
						y_1.len = 0; y_1.p = NIM_NIL;
						x_1 = readdir(d_1);
						{
							if (!(x_1 == ((struct dirent*) NIM_NIL))) goto LA20_;
							if (y_1.p && !(y_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(y_1.p);
}
							goto LA14;
						}
LA20_: ;
						y_1 = cstrToNimstr(((NCSTRING) ((*x_1).d_name)));
						{
							NIM_BOOL T24_;
							NimStringV2 path_2;
							NimStringV2 noSource_1;
							tyTuple__UV3llMMYFckfui8YMBuUZA colontmpD_;
							struct stat s_1;
							tyEnum_PathComponent__OiWviOlsjyqprC56d9bn9b4Q k_1;
							T24_ = (NIM_BOOL)0;
							T24_ = !(eqStrings(y_1, TM__UhMx4BhJKblm8VrPrbmAGA_10));
							if (!(T24_)) goto LA25_;
							T24_ = !(eqStrings(y_1, TM__UhMx4BhJKblm8VrPrbmAGA_12));
LA25_: ;
							if (!T24_) goto LA26_;
							path_2.len = 0; path_2.p = NIM_NIL;
							noSource_1.len = 0; noSource_1.p = NIM_NIL;
							nimZeroMem((void*)(&colontmpD_), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
							nimZeroMem((void*)(&s_1), sizeof(struct stat));
							path_2 = slash___stdZprivateZospaths2_u88(source_p0, y_1);
							if (NIM_UNLIKELY(*nimErr_)) goto LA28_;
							{
								if (!NIM_TRUE) goto LA31_;
								eqcopy___system_u2754((&y_1), path_2);
							}
LA31_: ;
							k_1 = ((tyEnum_PathComponent__OiWviOlsjyqprC56d9bn9b4Q)0);
							switch ((*x_1).d_type) {
							case ((NI8)4):
							{
								k_1 = ((tyEnum_PathComponent__OiWviOlsjyqprC56d9bn9b4Q)2);
							}
							break;
							case ((NI8)10):
							{
								NIM_BOOL isSpecialX60gensym19__1;
								tyTuple__4ZA8Mtd29a9cAR3xLlz7LVrw tmpTupleAsgn;
								isSpecialX60gensym19__1 = (NIM_BOOL)0;
								tmpTupleAsgn = getSymlinkFileKind__stdZprivateZoscommon_u17(path_2);
								if (NIM_UNLIKELY(*nimErr_)) goto LA28_;
								k_1 = tmpTupleAsgn.Field0;
								isSpecialX60gensym19__1 = tmpTupleAsgn.Field1;
								{
									NIM_BOOL T37_;
									T37_ = (NIM_BOOL)0;
									T37_ = skipSpecial_p2;
									if (!(T37_)) goto LA38_;
									T37_ = isSpecialX60gensym19__1;
LA38_: ;
									if (!T37_) goto LA39_;
									eqdestroy___stdZprivateZospaths2_u303((&colontmpD_));
									if (noSource_1.p && !(noSource_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(noSource_1.p);
}
									if (path_2.p && !(path_2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(path_2.p);
}
									if (y_1.p && !(y_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(y_1.p);
}
									goto LA16;
								}
LA39_: ;
							}
							break;
							case ((NI8)0):
							{
								{
									int T44_;
									T44_ = (int)0;
									T44_ = lstat(nimToCStringConv(path_2), (&s_1));
									if (!(T44_ < ((NI32)0))) goto LA45_;
									eqdestroy___stdZprivateZospaths2_u303((&colontmpD_));
									if (noSource_1.p && !(noSource_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(noSource_1.p);
}
									if (path_2.p && !(path_2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(path_2.p);
}
									if (y_1.p && !(y_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(y_1.p);
}
									goto LA16;
								}
								goto LA42_;
LA45_: ;
								{
									NIM_BOOL T48_;
									T48_ = (NIM_BOOL)0;
									T48_ = S_ISDIR(s_1.st_mode);
									if (!T48_) goto LA49_;
									k_1 = ((tyEnum_PathComponent__OiWviOlsjyqprC56d9bn9b4Q)2);
								}
								goto LA42_;
LA49_: ;
								{
									NIM_BOOL T52_;
									NIM_BOOL isSpecialX60gensym21__1;
									tyTuple__4ZA8Mtd29a9cAR3xLlz7LVrw tmpTupleAsgn_2;
									T52_ = (NIM_BOOL)0;
									T52_ = S_ISLNK(s_1.st_mode);
									if (!T52_) goto LA53_;
									isSpecialX60gensym21__1 = (NIM_BOOL)0;
									tmpTupleAsgn_2 = getSymlinkFileKind__stdZprivateZoscommon_u17(path_2);
									if (NIM_UNLIKELY(*nimErr_)) goto LA28_;
									k_1 = tmpTupleAsgn_2.Field0;
									isSpecialX60gensym21__1 = tmpTupleAsgn_2.Field1;
									{
										NIM_BOOL T57_;
										T57_ = (NIM_BOOL)0;
										T57_ = skipSpecial_p2;
										if (!(T57_)) goto LA58_;
										T57_ = isSpecialX60gensym21__1;
LA58_: ;
										if (!T57_) goto LA59_;
										eqdestroy___stdZprivateZospaths2_u303((&colontmpD_));
										if (noSource_1.p && !(noSource_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(noSource_1.p);
}
										if (path_2.p && !(path_2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(path_2.p);
}
										if (y_1.p && !(y_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(y_1.p);
}
										goto LA16;
									}
LA59_: ;
								}
								goto LA42_;
LA53_: ;
								{
									NIM_BOOL T62_;
									NIM_BOOL T64_;
									T62_ = (NIM_BOOL)0;
									T62_ = skipSpecial_p2;
									if (!(T62_)) goto LA63_;
									T64_ = (NIM_BOOL)0;
									T64_ = S_ISREG(s_1.st_mode);
									T62_ = !(T64_);
LA63_: ;
									if (!T62_) goto LA65_;
									eqdestroy___stdZprivateZospaths2_u303((&colontmpD_));
									if (noSource_1.p && !(noSource_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(noSource_1.p);
}
									if (path_2.p && !(path_2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(path_2.p);
}
									if (y_1.p && !(y_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(y_1.p);
}
									goto LA16;
								}
								goto LA42_;
LA65_: ;
LA42_: ;
							}
							break;
							default:
							{
								{
									NIM_BOOL T70_;
									T70_ = (NIM_BOOL)0;
									T70_ = skipSpecial_p2;
									if (!(T70_)) goto LA71_;
									T70_ = !(((*x_1).d_type == ((NI8)8)));
LA71_: ;
									if (!T70_) goto LA72_;
									eqdestroy___stdZprivateZospaths2_u303((&colontmpD_));
									if (noSource_1.p && !(noSource_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(noSource_1.p);
}
									if (path_2.p && !(path_2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(path_2.p);
}
									if (y_1.p && !(y_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(y_1.p);
}
									goto LA16;
								}
								goto LA68_;
LA72_: ;
								{
								}
LA68_: ;
							}
							break;
							}
							kind_1 = k_1;
							eqsink___system_u2760((&path_1), y_1);
							eqwasMoved___system_u2751((&y_1));
							nossplitPath(path_1, (&colontmpD_));
							if (NIM_UNLIKELY(*nimErr_)) goto LA28_;
							noSource_1 = colontmpD_.Field1;
							eqwasMoved___system_u2751((&colontmpD_.Field1));
							{
								NimStringV2 colontmpD__2;
								if (!(kind_1 == ((tyEnum_PathComponent__OiWviOlsjyqprC56d9bn9b4Q)2))) goto LA77_;
								colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
								colontmpD__2 = slash___stdZprivateZospaths2_u88(dest_p1, noSource_1);
								if (NIM_UNLIKELY(*nimErr_)) goto LA79_;
								noscopyDir(path_1, colontmpD__2, skipSpecial_p2);
								if (NIM_UNLIKELY(*nimErr_)) goto LA79_;
								{
									LA79_:;
								}
								{
									if (colontmpD__2.p && !(colontmpD__2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD__2.p);
}
								}
								if (NIM_UNLIKELY(*nimErr_)) goto LA28_;
							}
							goto LA75_;
LA77_: ;
							{
								NimStringV2 colontmpD__3;
								colontmpD__3.len = 0; colontmpD__3.p = NIM_NIL;
								colontmpD__3 = slash___stdZprivateZospaths2_u88(dest_p1, noSource_1);
								if (NIM_UNLIKELY(*nimErr_)) goto LA83_;
								noscopyFile(path_1, colontmpD__3, 1, ((NI)16384));
								if (NIM_UNLIKELY(*nimErr_)) goto LA83_;
								{
									LA83_:;
								}
								{
									if (colontmpD__3.p && !(colontmpD__3.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD__3.p);
}
								}
								if (NIM_UNLIKELY(*nimErr_)) goto LA28_;
							}
LA75_: ;
							{
								LA28_:;
							}
							{
								eqdestroy___stdZprivateZospaths2_u303((&colontmpD_));
								if (noSource_1.p && !(noSource_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(noSource_1.p);
}
								if (path_2.p && !(path_2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(path_2.p);
}
							}
							if (NIM_UNLIKELY(*nimErr_)) goto LA17_;
						}
LA26_: ;
						{
							LA17_:;
						}
						{
							if (y_1.p && !(y_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(y_1.p);
}
						}
						if (NIM_UNLIKELY(*nimErr_)) goto LA13_;
					} LA16: ;
				}
			} LA14: ;
			{
				LA13_:;
			}
			{
				int T92_;
				T92_ = (int)0;
				T92_ = closedir(d_1);
				(void)(T92_);
			}
			if (NIM_UNLIKELY(*nimErr_)) goto LA2_;
		}
LA3_: ;
		{
			LA2_:;
		}
		{
			if (path_1.p && !(path_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(path_1.p);
}
		}
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, rawRemoveDir__stdZprivateZosdirs_u460)(NimStringV2 dir_p0) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	{
		NIM_BOOL T3_;
		int T4_;
		NI32 T8_;
		T3_ = (NIM_BOOL)0;
		T4_ = (int)0;
		T4_ = rmdir(nimToCStringConv(dir_p0));
		T3_ = !((T4_ == ((NI32)0)));
		if (!(T3_)) goto LA5_;
		T3_ = !((errno == ENOENT));
LA5_: ;
		if (!T3_) goto LA6_;
		T8_ = (NI32)0;
		T8_ = osLastError__stdZoserrors_u122();
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		raiseOSError__stdZoserrors_u119(T8_, dir_p0);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA6_: ;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, nosremoveDir)(NimStringV2 dir_p0, NIM_BOOL checkDir_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	{
		NimStringV2 path_1;
		tyEnum_PathComponent__OiWviOlsjyqprC56d9bn9b4Q kind_1;
		DIR* d_1;
		path_1.len = 0; path_1.p = NIM_NIL;
		kind_1 = (tyEnum_PathComponent__OiWviOlsjyqprC56d9bn9b4Q)0;
		d_1 = opendir(nimToCStringConv(dir_p0));
		{
			if (!(d_1 == ((DIR*) NIM_NIL))) goto LA5_;
			{
				NI32 T11_;
				if (!checkDir_p1) goto LA9_;
				T11_ = (NI32)0;
				T11_ = osLastError__stdZoserrors_u122();
				if (NIM_UNLIKELY(*nimErr_)) goto LA2_;
				raiseOSError__stdZoserrors_u119(T11_, dir_p0);
				if (NIM_UNLIKELY(*nimErr_)) goto LA2_;
			}
LA9_: ;
		}
		goto LA3_;
LA5_: ;
		{
			{
				while (1) {
					{
						NimStringV2 y_1;
						struct dirent* x_1;
						y_1.len = 0; y_1.p = NIM_NIL;
						x_1 = readdir(d_1);
						{
							if (!(x_1 == ((struct dirent*) NIM_NIL))) goto LA20_;
							if (y_1.p && !(y_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(y_1.p);
}
							goto LA14;
						}
LA20_: ;
						y_1 = cstrToNimstr(((NCSTRING) ((*x_1).d_name)));
						{
							NIM_BOOL T24_;
							NimStringV2 path_2;
							struct stat s_1;
							tyEnum_PathComponent__OiWviOlsjyqprC56d9bn9b4Q k_1;
							T24_ = (NIM_BOOL)0;
							T24_ = !(eqStrings(y_1, TM__UhMx4BhJKblm8VrPrbmAGA_13));
							if (!(T24_)) goto LA25_;
							T24_ = !(eqStrings(y_1, TM__UhMx4BhJKblm8VrPrbmAGA_14));
LA25_: ;
							if (!T24_) goto LA26_;
							path_2.len = 0; path_2.p = NIM_NIL;
							nimZeroMem((void*)(&s_1), sizeof(struct stat));
							path_2 = slash___stdZprivateZospaths2_u88(dir_p0, y_1);
							if (NIM_UNLIKELY(*nimErr_)) goto LA28_;
							{
								if (!NIM_TRUE) goto LA31_;
								eqcopy___system_u2754((&y_1), path_2);
							}
LA31_: ;
							k_1 = ((tyEnum_PathComponent__OiWviOlsjyqprC56d9bn9b4Q)0);
							switch ((*x_1).d_type) {
							case ((NI8)4):
							{
								k_1 = ((tyEnum_PathComponent__OiWviOlsjyqprC56d9bn9b4Q)2);
							}
							break;
							case ((NI8)10):
							{
								NIM_BOOL isSpecialX60gensym19__1;
								tyTuple__4ZA8Mtd29a9cAR3xLlz7LVrw tmpTupleAsgn;
								isSpecialX60gensym19__1 = (NIM_BOOL)0;
								tmpTupleAsgn = getSymlinkFileKind__stdZprivateZoscommon_u17(path_2);
								if (NIM_UNLIKELY(*nimErr_)) goto LA28_;
								k_1 = tmpTupleAsgn.Field0;
								isSpecialX60gensym19__1 = tmpTupleAsgn.Field1;
								{
									NIM_BOOL T37_;
									T37_ = (NIM_BOOL)0;
									T37_ = NIM_FALSE;
									if (!(T37_)) goto LA38_;
									T37_ = isSpecialX60gensym19__1;
LA38_: ;
									if (!T37_) goto LA39_;
									if (path_2.p && !(path_2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(path_2.p);
}
									if (y_1.p && !(y_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(y_1.p);
}
									goto LA16;
								}
LA39_: ;
							}
							break;
							case ((NI8)0):
							{
								{
									int T44_;
									T44_ = (int)0;
									T44_ = lstat(nimToCStringConv(path_2), (&s_1));
									if (!(T44_ < ((NI32)0))) goto LA45_;
									if (path_2.p && !(path_2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(path_2.p);
}
									if (y_1.p && !(y_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(y_1.p);
}
									goto LA16;
								}
								goto LA42_;
LA45_: ;
								{
									NIM_BOOL T48_;
									T48_ = (NIM_BOOL)0;
									T48_ = S_ISDIR(s_1.st_mode);
									if (!T48_) goto LA49_;
									k_1 = ((tyEnum_PathComponent__OiWviOlsjyqprC56d9bn9b4Q)2);
								}
								goto LA42_;
LA49_: ;
								{
									NIM_BOOL T52_;
									NIM_BOOL isSpecialX60gensym21__1;
									tyTuple__4ZA8Mtd29a9cAR3xLlz7LVrw tmpTupleAsgn_2;
									T52_ = (NIM_BOOL)0;
									T52_ = S_ISLNK(s_1.st_mode);
									if (!T52_) goto LA53_;
									isSpecialX60gensym21__1 = (NIM_BOOL)0;
									tmpTupleAsgn_2 = getSymlinkFileKind__stdZprivateZoscommon_u17(path_2);
									if (NIM_UNLIKELY(*nimErr_)) goto LA28_;
									k_1 = tmpTupleAsgn_2.Field0;
									isSpecialX60gensym21__1 = tmpTupleAsgn_2.Field1;
									{
										NIM_BOOL T57_;
										T57_ = (NIM_BOOL)0;
										T57_ = NIM_FALSE;
										if (!(T57_)) goto LA58_;
										T57_ = isSpecialX60gensym21__1;
LA58_: ;
										if (!T57_) goto LA59_;
										if (path_2.p && !(path_2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(path_2.p);
}
										if (y_1.p && !(y_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(y_1.p);
}
										goto LA16;
									}
LA59_: ;
								}
								goto LA42_;
LA53_: ;
								{
									NIM_BOOL T62_;
									NIM_BOOL T64_;
									T62_ = (NIM_BOOL)0;
									T62_ = NIM_FALSE;
									if (!(T62_)) goto LA63_;
									T64_ = (NIM_BOOL)0;
									T64_ = S_ISREG(s_1.st_mode);
									T62_ = !(T64_);
LA63_: ;
									if (!T62_) goto LA65_;
									if (path_2.p && !(path_2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(path_2.p);
}
									if (y_1.p && !(y_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(y_1.p);
}
									goto LA16;
								}
								goto LA42_;
LA65_: ;
LA42_: ;
							}
							break;
							default:
							{
								{
									NIM_BOOL T70_;
									T70_ = (NIM_BOOL)0;
									T70_ = NIM_FALSE;
									if (!(T70_)) goto LA71_;
									T70_ = !(((*x_1).d_type == ((NI8)8)));
LA71_: ;
									if (!T70_) goto LA72_;
									if (path_2.p && !(path_2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(path_2.p);
}
									if (y_1.p && !(y_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(y_1.p);
}
									goto LA16;
								}
								goto LA68_;
LA72_: ;
								{
								}
LA68_: ;
							}
							break;
							}
							kind_1 = k_1;
							eqsink___system_u2760((&path_1), y_1);
							eqwasMoved___system_u2751((&y_1));
							switch (kind_1) {
							case ((tyEnum_PathComponent__OiWviOlsjyqprC56d9bn9b4Q)0):
							case ((tyEnum_PathComponent__OiWviOlsjyqprC56d9bn9b4Q)1):
							case ((tyEnum_PathComponent__OiWviOlsjyqprC56d9bn9b4Q)3):
							{
								nosremoveFile(path_1);
								if (NIM_UNLIKELY(*nimErr_)) goto LA28_;
							}
							break;
							case ((tyEnum_PathComponent__OiWviOlsjyqprC56d9bn9b4Q)2):
							{
								nosremoveDir(path_1, NIM_TRUE);
								if (NIM_UNLIKELY(*nimErr_)) goto LA28_;
							}
							break;
							default: __builtin_unreachable();
							}
							{
								LA28_:;
							}
							{
								if (path_2.p && !(path_2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(path_2.p);
}
							}
							if (NIM_UNLIKELY(*nimErr_)) goto LA17_;
						}
LA26_: ;
						{
							LA17_:;
						}
						{
							if (y_1.p && !(y_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(y_1.p);
}
						}
						if (NIM_UNLIKELY(*nimErr_)) goto LA13_;
					} LA16: ;
				}
			} LA14: ;
			{
				LA13_:;
			}
			{
				int T83_;
				T83_ = (int)0;
				T83_ = closedir(d_1);
				(void)(T83_);
			}
			if (NIM_UNLIKELY(*nimErr_)) goto LA2_;
		}
LA3_: ;
		{
			LA2_:;
		}
		{
			if (path_1.p && !(path_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(path_1.p);
}
		}
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	rawRemoveDir__stdZprivateZosdirs_u460(dir_p0);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, moveDir__stdZprivateZosdirs_u503)(NimStringV2 source_p0, NimStringV2 dest_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = tryMoveFSObject__stdZprivateZoscommon_u86(source_p0, dest_p1, NIM_TRUE);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (!!(T3_)) goto LA4_;
		noscopyDir(source_p0, dest_p1, NIM_FALSE);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		nosremoveDir(source_p0, NIM_FALSE);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA4_: ;
	}BeforeRet_: ;
}
