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

#include "nimbase.h"
#include <string.h>
#include <sys/param.h>
#include <mach-o/dyld.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <time.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 tyTuple__7q7q3E6Oj24ZNVJb9aonhAg tyTuple__7q7q3E6Oj24ZNVJb9aonhAg;
typedef struct TNimTypeV2 TNimTypeV2;
typedef struct Exception Exception;
typedef struct RootObj RootObj;
typedef struct tySequence__S89cE01OvNjsN9c71FKsSrqQ tySequence__S89cE01OvNjsN9c71FKsSrqQ;
typedef struct tySequence__S89cE01OvNjsN9c71FKsSrqQ_Content tySequence__S89cE01OvNjsN9c71FKsSrqQ_Content;
typedef struct tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA;
typedef struct tyObject_StackTraceEntry__RcJz5RXFIYjIseutvVFICA tyObject_StackTraceEntry__RcJz5RXFIYjIseutvVFICA;
struct NimStrPayload {
	NI cap;
	NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
	NI len;
	NimStrPayload* p;
};
typedef NU8 tySet_tyChar__nmiMWKVIe46vacnhAFrQvw[32];
struct tyTuple__7q7q3E6Oj24ZNVJb9aonhAg {
	NimStringV2 Field0;
	NimStringV2 Field1;
	NimStringV2 Field2;
};
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__S89cE01OvNjsN9c71FKsSrqQ {
  NI len; tySequence__S89cE01OvNjsN9c71FKsSrqQ_Content* p;
};
struct Exception {
	RootObj Sup;
	Exception* parent;
	NCSTRING name;
	NimStringV2 message;
	tySequence__S89cE01OvNjsN9c71FKsSrqQ trace;
	Exception* up;
};
typedef NimStringV2 tyArray__YgExxhfgKcesA5EOUj1MOA[1];
struct tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA {
	NI64 seconds;
	NI nanosecond;
};
struct tyObject_StackTraceEntry__RcJz5RXFIYjIseutvVFICA {
	NCSTRING procname;
	NI line;
	NCSTRING filename;
};
struct tySequence__S89cE01OvNjsN9c71FKsSrqQ_Content { NI cap; tyObject_StackTraceEntry__RcJz5RXFIYjIseutvVFICA data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nospquoteShellPosix)(NimStringV2 s_p0);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, allCharsInSet__pureZstrutils_u1502)(NimStringV2 s_p0, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw theSet_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___system_u2694)(NimStringV2* dest_p0, NimStringV2 src_p1);
static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1);
static N_INLINE(void, copyMem__system_u1742)(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, nsuReplaceStr)(NimStringV2 s_p0, NimStringV2 sub_p1, NimStringV2 by_p2);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___system_u2691)(NimStringV2 dest_p0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, prepareAdd)(NimStringV2* s_p0, NI addLen_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nospquoteShell)(NimStringV2 s_p0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosgetHomeDir)(void);
static N_INLINE(NimStringV2, slash___stdZprivateZospaths2_u91)(NimStringV2 head_p0, NimStringV2 tail_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosjoinPath)(NimStringV2 head_p0, NimStringV2 tail_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, substr__system_u8655)(NimStringV2 s_p0, NI first_p1);
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__system_u2172)(void* a_p0, int v_p1, NI size_p2);
N_LIB_PRIVATE N_NIMCALL(tyTuple__7q7q3E6Oj24ZNVJb9aonhAg, nossplitFile)(NimStringV2 path_p0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosgetAppFilename)(void);
N_NIMCALL(NimStringV2, mnewString)(NI len_p0);
static N_INLINE(NCSTRING, nimToCStringConv)(NimStringV2 s_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___system_u2700)(NimStringV2* dest_p0, NimStringV2 src_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosexpandFilename)(NimStringV2 filename_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);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, cstrToNimstr)(NCSTRING str_p0);
static N_INLINE(NIM_BOOL, isObjDisplayCheck)(TNimTypeV2* source_p0, NI16 targetDepth_p1, NU32 token_p2);
static N_INLINE(Exception*, nimBorrowCurrentException)(void);
static N_INLINE(void, popCurrentException)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___system_u3661)(Exception** dest_p0, Exception* src_p1, NIM_BOOL cyclic_p2);
N_LIB_PRIVATE N_NIMCALL(void, eqwasMoved___system_u2688)(NimStringV2* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZos_u220)(tyTuple__7q7q3E6Oj24ZNVJb9aonhAg dest_p0);
static N_INLINE(NIM_BOOL, contains__stdZprivateZospaths2_u383)(NIM_CHAR* a_p0, NI a_p0Len_0, NIM_CHAR item_p1);
static N_INLINE(NI, find__stdZprivateZospaths2_u388)(NIM_CHAR* a_p0, NI a_p0Len_0, NIM_CHAR item_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosaddFileExt)(NimStringV2 filename_p0, NimStringV2 ext_p1);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosfileExists)(NimStringV2 filename_p0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, getEnv__stdZenvvars_u16)(NimStringV2 key_p0, NimStringV2 default_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, substr__system_u8642)(NimStringV2 s_p0, NI first_p1, NI last_p2);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, expandTilde__pureZos_u35)(NimStringV2 path_p0);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nossymlinkExists)(NimStringV2 link_p0);
N_LIB_PRIVATE N_NIMCALL(void, setLengthStrV2)(NimStringV2* s_p0, NI newLen_p1);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosisAbsolute)(NimStringV2 path_p0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosparentDir)(NimStringV2 path_p0);
N_LIB_PRIVATE N_NIMCALL(int, exitStatusLikeShell__pureZos_u183)(int status_p0);
static N_INLINE(tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA, toTime__pureZos_u27)(struct timespec ts_p0);
N_LIB_PRIVATE N_NIMCALL(tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA, initTime__pureZtimes_u1213)(NI64 unix_p0, NI nanosecond_p1);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, ntLtTime)(tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA a_p0, tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA b_p1);
N_LIB_PRIVATE N_NIMCALL(tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA, nosgetLastModificationTime)(NimStringV2 file_p0);
static const struct {
  NI cap; NIM_CHAR data[2+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_2 = { 2 | NIM_STRLIT_FLAG, "\'\'" };
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_3 = {2, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_2};
static NIM_CONST tySet_tyChar__nmiMWKVIe46vacnhAFrQvw TM__yu6cxgKBBXbNsTkT9cyMd4g_4 = {
0x00, 0x00, 0x00, 0x00, 0x20, 0xe8, 0xff, 0x27,
0xff, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x07,
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__yu6cxgKBBXbNsTkT9cyMd4g_5 = { 1 | NIM_STRLIT_FLAG, "\'" };
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_6 = {1, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_5};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_7 = {1, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_5};
static const struct {
  NI cap; NIM_CHAR data[5+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_8 = { 5 | NIM_STRLIT_FLAG, "\'\"\'\"\'" };
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_9 = {5, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_8};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_10 = {1, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_5};
static const struct {
  NI cap; NIM_CHAR data[0+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_11 = { 0 | NIM_STRLIT_FLAG, "" };
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_12 = {0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_11};
static const struct {
  NI cap; NIM_CHAR data[1+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_13 = { 1 | NIM_STRLIT_FLAG, " " };
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_14 = {1, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_13};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_15 = {0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_11};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_16 = {0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_11};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_17 = {0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_11};
static const struct {
  NI cap; NIM_CHAR data[4+1];
} TM__yu6cxgKBBXbNsTkT9cyMd4g_18 = { 4 | NIM_STRLIT_FLAG, "PATH" };
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_19 = {4, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_18};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_20 = {0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_11};
static const NimStringV2 TM__yu6cxgKBBXbNsTkT9cyMd4g_21 = {0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_11};
N_LIB_PRIVATE NIM_CONST tyArray__YgExxhfgKcesA5EOUj1MOA ExeExts__pureZos_u75 = {{0, (NimStrPayload*)&TM__yu6cxgKBBXbNsTkT9cyMd4g_11}}
;
extern NIM_BOOL nimInErrorMode__system_u4143;
extern Exception* currException__system_u3628;
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_u1742)(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_u1742(((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*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	result = (&nimInErrorMode__system_u4143);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nospquoteShellPosix)(NimStringV2 s_p0) {
	NimStringV2 result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result.len = 0; result.p = NIM_NIL;
	{
		if (!(s_p0.len == ((NI)0))) goto LA3_;
		result = TM__yu6cxgKBBXbNsTkT9cyMd4g_3;
	}
	goto LA1_;
LA3_: ;
	{
		NIM_BOOL T6_;
		T6_ = (NIM_BOOL)0;
		T6_ = allCharsInSet__pureZstrutils_u1502(s_p0, TM__yu6cxgKBBXbNsTkT9cyMd4g_4);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (!T6_) goto LA7_;
		eqcopy___system_u2694((&result), s_p0);
	}
	goto LA1_;
LA7_: ;
	{
		NimStringV2 colontmpD_;
		NimStringV2 T10_;
		colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
		T10_.len = 0; T10_.p = NIM_NIL;
		colontmpD_ = nsuReplaceStr(s_p0, TM__yu6cxgKBBXbNsTkT9cyMd4g_7, TM__yu6cxgKBBXbNsTkT9cyMd4g_9);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		T10_ = rawNewString(colontmpD_.len + 2);
appendString((&T10_), TM__yu6cxgKBBXbNsTkT9cyMd4g_6);
appendString((&T10_), colontmpD_);
appendString((&T10_), TM__yu6cxgKBBXbNsTkT9cyMd4g_10);
		result = T10_;
		eqdestroy___system_u2691(colontmpD_);
	}
LA1_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nospquoteShell)(NimStringV2 s_p0) {
	NimStringV2 result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result.len = 0; result.p = NIM_NIL;
	result = nospquoteShellPosix(s_p0);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, quoteShellCommand__pureZos_u60)(NimStringV2* args_p0, NI args_p0Len_0) {
	NimStringV2 result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = TM__yu6cxgKBBXbNsTkT9cyMd4g_12;
	{
		NI i_1;
		NI colontmp_;
		NI i_2;
		i_1 = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = args_p0Len_0;
		i_2 = ((NI)0);
		{
			while (1) {
				NimStringV2 colontmpD_;
				if (!(i_2 < colontmp_)) goto LA3;
				colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
				i_1 = i_2;
				{
					if (!(((NI)0) < i_1)) goto LA6_;
					prepareAdd((&result), 1);
appendString((&result), TM__yu6cxgKBBXbNsTkT9cyMd4g_14);
				}
LA6_: ;
				colontmpD_ = nospquoteShell(args_p0[i_1]);
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				prepareAdd((&result), colontmpD_.len + 0);
appendString((&result), colontmpD_);
				i_2 += ((NI)1);
				eqdestroy___system_u2691(colontmpD_);
			} LA3: ;
		}
	}
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NimStringV2, slash___stdZprivateZospaths2_u91)(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(NimStringV2, expandTilde__pureZos_u35)(NimStringV2 path_p0) {
	NimStringV2 result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result.len = 0; result.p = NIM_NIL;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (path_p0.len == ((NI)0));
		if (T3_) goto LA4_;
		T3_ = !(((NU8)(path_p0.p->data[((NI)0)]) == (NU8)(126)));
LA4_: ;
		if (!T3_) goto LA5_;
		eqcopy___system_u2694((&result), path_p0);
	}
	goto LA1_;
LA5_: ;
	{
		if (!(path_p0.len == ((NI)1))) goto LA8_;
		result = nosgetHomeDir();
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	goto LA1_;
LA8_: ;
	{
		NimStringV2 colontmpD_;
		NimStringV2 colontmpD__2;
		if (!(((NU8)(path_p0.p->data[((NI)1)])) == ((NU8)(47)) || ((NU8)(path_p0.p->data[((NI)1)])) == ((NU8)(47)))) goto LA11_;
		colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
		colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
		colontmpD_ = nosgetHomeDir();
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		colontmpD__2 = substr__system_u8655(path_p0, ((NI)2));
		result = slash___stdZprivateZospaths2_u91(colontmpD_, colontmpD__2);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		eqdestroy___system_u2691(colontmpD__2);
		eqdestroy___system_u2691(colontmpD_);
	}
	goto LA1_;
LA11_: ;
	{
		eqcopy___system_u2694((&result), path_p0);
	}
LA1_: ;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(void, nimSetMem__system_u2172)(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_u2172(p_p0, ((int)0), size_p1);
}
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;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosexpandFilename)(NimStringV2 filename_p0) {
	NimStringV2 result;
	NCSTRING r_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = TM__yu6cxgKBBXbNsTkT9cyMd4g_16;
	r_1 = realpath(nimToCStringConv(filename_p0), ((NCSTRING) NIM_NIL));
	{
		NI32 T5_;
		if (!(r_1 == 0)) goto LA3_;
		T5_ = (NI32)0;
		T5_ = osLastError__stdZoserrors_u122();
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		raiseOSError__stdZoserrors_u119(T5_, filename_p0);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	goto LA1_;
LA3_: ;
	{
		NimStringV2 T7_;
		T7_.len = 0; T7_.p = NIM_NIL;
		T7_ = cstrToNimstr(r_1);
		eqsink___system_u2700((&result), T7_);
		free(((void*) (r_1)));
	}
LA1_: ;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NIM_BOOL, isObjDisplayCheck)(TNimTypeV2* source_p0, NI16 targetDepth_p1, NU32 token_p2) {
	NIM_BOOL result;
	NIM_BOOL T1_;
	T1_ = (NIM_BOOL)0;
	T1_ = (targetDepth_p1 <= (*source_p0).depth);
	if (!(T1_)) goto LA2_;
	T1_ = ((*source_p0).display[targetDepth_p1] == token_p2);
LA2_: ;
	result = T1_;
	return result;
}
static N_INLINE(Exception*, nimBorrowCurrentException)(void) {
	Exception* result;
	result = currException__system_u3628;
	return result;
}
static N_INLINE(void, popCurrentException)(void) {
	eqcopy___system_u3661(&currException__system_u3628, (*currException__system_u3628).up, NIM_FALSE);
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosgetAppFilename)(void) {
	NimStringV2 result;
	unsigned int size_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result.len = 0; result.p = NIM_NIL;
	size_1 = ((NI)0);
	_NSGetExecutablePath(((NCSTRING) NIM_NIL), (&size_1));
	result = mnewString((((NI) (size_1))));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = _NSGetExecutablePath(nimToCStringConv(result), (&size_1));
		if (!T3_) goto LA4_;
		eqsink___system_u2700((&result), TM__yu6cxgKBBXbNsTkT9cyMd4g_15);
	}
LA4_: ;
	{
		NimStringV2 T11_;
		if (!(((NI)0) < result.len)) goto LA8_;
		T11_.len = 0; T11_.p = NIM_NIL;
		T11_ = nosexpandFilename(result);
		if (NIM_UNLIKELY(*nimErr_)) {eqdestroy___system_u2691(T11_); goto LA10_;}
		eqsink___system_u2700((&result), T11_);
		if (NIM_UNLIKELY(*nimErr_)) {
			LA10_:;
			if (isObjDisplayCheck(nimBorrowCurrentException()->Sup.m_type, 3, 3796386048)) {
				*nimErr_ = NIM_FALSE;
				eqsink___system_u2700((&result), TM__yu6cxgKBBXbNsTkT9cyMd4g_17);
				popCurrentException();
				LA13_:;
			}
		}
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA8_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosgetAppDir)(void) {
	NimStringV2 result;
	tyTuple__7q7q3E6Oj24ZNVJb9aonhAg colontmpD_;
	NimStringV2 colontmpD__2;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result.len = 0; result.p = NIM_NIL;
	nimZeroMem((void*)(&colontmpD_), sizeof(tyTuple__7q7q3E6Oj24ZNVJb9aonhAg));
	colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
	colontmpD__2 = nosgetAppFilename();
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	colontmpD_ = nossplitFile(colontmpD__2);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	result = colontmpD_.Field0;
	eqwasMoved___system_u2688((&colontmpD_.Field0));
	eqdestroy___system_u2691(colontmpD__2);
	eqdestroy___pureZos_u220(colontmpD_);
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NI, find__stdZprivateZospaths2_u388)(NIM_CHAR* a_p0, NI a_p0Len_0, NIM_CHAR item_p1) {
	NI result;
{	result = ((NI)0);
	{
		NIM_CHAR i_1;
		NI i_2;
		i_1 = (NIM_CHAR)0;
		i_2 = ((NI)0);
		{
			while (1) {
				if (!(i_2 < a_p0Len_0)) goto LA3;
				i_1 = a_p0[i_2];
				{
					if (!((NU8)(i_1) == (NU8)(item_p1))) goto LA6_;
					goto BeforeRet_;
				}
LA6_: ;
				result += ((NI)1);
				i_2 += ((NI)1);
			} LA3: ;
		}
	}
	result = ((NI)-1);
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NIM_BOOL, contains__stdZprivateZospaths2_u383)(NIM_CHAR* a_p0, NI a_p0Len_0, NIM_CHAR item_p1) {
	NIM_BOOL result;
	NI T1_;
{	T1_ = (NI)0;
	T1_ = find__stdZprivateZospaths2_u388(a_p0, a_p0Len_0, item_p1);
	result = (((NI)0) <= T1_);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, findExe__pureZos_u76)(NimStringV2 exe_p0, NIM_BOOL followSymlinks_p1, NimStringV2* extensions_p2, NI extensions_p2Len_0) {
	NimStringV2 result;
	NimStringV2 path_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result.len = 0; result.p = NIM_NIL;
	path_1.len = 0; path_1.p = NIM_NIL;
	{
		if (!(exe_p0.len == ((NI)0))) goto LA4_;
		eqdestroy___system_u2691(path_1);
		goto BeforeRet_;
	}
LA4_: ;
	{
		NIM_BOOL T8_;
		T8_ = (NIM_BOOL)0;
		T8_ = contains__stdZprivateZospaths2_u383(((exe_p0).p) ? (exe_p0.p->data) : NIM_NIL, exe_p0.len, 47);
		if (!T8_) goto LA9_;
		{
			NimStringV2* extX60gensym9__1;
			NI i_1;
			extX60gensym9__1 = (NimStringV2*)0;
			i_1 = ((NI)0);
			{
				while (1) {
					NimStringV2 T14_;
					if (!(i_1 < extensions_p2Len_0)) goto LA13;
					extX60gensym9__1 = (&extensions_p2[i_1]);
					T14_.len = 0; T14_.p = NIM_NIL;
					T14_ = nosaddFileExt(exe_p0, (*extX60gensym9__1));
					if (NIM_UNLIKELY(*nimErr_)) {eqdestroy___system_u2691(T14_); goto LA1_;}
					eqsink___system_u2700((&result), T14_);
					{
						NIM_BOOL T17_;
						T17_ = (NIM_BOOL)0;
						T17_ = nosfileExists(result);
						if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
						if (!T17_) goto LA18_;
						eqdestroy___system_u2691(path_1);
						goto BeforeRet_;
					}
LA18_: ;
					i_1 += ((NI)1);
				} LA13: ;
			}
		}
	}
LA9_: ;
	path_1 = getEnv__stdZenvvars_u16(TM__yu6cxgKBBXbNsTkT9cyMd4g_19, TM__yu6cxgKBBXbNsTkT9cyMd4g_20);
	if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	{
		NimStringV2 candidate_1;
		NI lastX60gensym34__1;
		NI splitsX60gensym34__1;
		candidate_1.len = 0; candidate_1.p = NIM_NIL;
		lastX60gensym34__1 = ((NI)0);
		splitsX60gensym34__1 = ((NI)-1);
		{
			while (1) {
				NI firstX60gensym34__1;
				NimStringV2 T32_;
				if (!(lastX60gensym34__1 <= path_1.len)) goto LA23;
				firstX60gensym34__1 = lastX60gensym34__1;
				{
					while (1) {
						NIM_BOOL T26_;
						T26_ = (NIM_BOOL)0;
						T26_ = (lastX60gensym34__1 < path_1.len);
						if (!(T26_)) goto LA27_;
						T26_ = !(((NU8)(path_1.p->data[lastX60gensym34__1]) == (NU8)(58)));
LA27_: ;
						if (!T26_) goto LA25;
						lastX60gensym34__1 += ((NI)1);
					} LA25: ;
				}
				{
					if (!(splitsX60gensym34__1 == ((NI)0))) goto LA30_;
					lastX60gensym34__1 = path_1.len;
				}
LA30_: ;
				T32_.len = 0; T32_.p = NIM_NIL;
				T32_ = substr__system_u8642(path_1, firstX60gensym34__1, (NI)(lastX60gensym34__1 - ((NI)1)));
				eqsink___system_u2700((&candidate_1), T32_);
				{
					NimStringV2 x_1;
					NimStringV2 colontmpD_;
					x_1.len = 0; x_1.p = NIM_NIL;
					colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
					{
						if (!(candidate_1.len == ((NI)0))) goto LA37_;
						eqdestroy___system_u2691(colontmpD_);
						eqdestroy___system_u2691(x_1);
						goto LA33;
					}
LA37_: ;
					colontmpD_ = expandTilde__pureZos_u35(candidate_1);
					if (NIM_UNLIKELY(*nimErr_)) goto LA34_;
					x_1 = slash___stdZprivateZospaths2_u91(colontmpD_, exe_p0);
					if (NIM_UNLIKELY(*nimErr_)) goto LA34_;
					{
						NimStringV2* ext_1;
						NI i_2;
						ext_1 = (NimStringV2*)0;
						i_2 = ((NI)0);
						{
							while (1) {
								NimStringV2 x_2;
								if (!(i_2 < extensions_p2Len_0)) goto LA41;
								x_2.len = 0; x_2.p = NIM_NIL;
								ext_1 = (&extensions_p2[i_2]);
								x_2 = nosaddFileExt(x_1, (*ext_1));
								if (NIM_UNLIKELY(*nimErr_)) goto LA42_;
								{
									NIM_BOOL T45_;
									T45_ = (NIM_BOOL)0;
									T45_ = nosfileExists(x_2);
									if (NIM_UNLIKELY(*nimErr_)) goto LA42_;
									if (!T45_) goto LA46_;
									{
										while (1) {
											if (!followSymlinks_p1) goto LA49;
											{
												NIM_BOOL T52_;
												NimStringV2 r_1;
												NI len_1;
												T52_ = (NIM_BOOL)0;
												T52_ = nossymlinkExists(x_2);
												if (NIM_UNLIKELY(*nimErr_)) goto LA42_;
												if (!T52_) goto LA53_;
												r_1.len = 0; r_1.p = NIM_NIL;
												r_1 = mnewString(((NI)1024));
												len_1 = readlink(nimToCStringConv(x_2), nimToCStringConv(r_1), ((NI)1024));
												{
													NI32 T60_;
													if (!(len_1 < ((NI)0))) goto LA58_;
													T60_ = (NI32)0;
													T60_ = osLastError__stdZoserrors_u122();
													if (NIM_UNLIKELY(*nimErr_)) goto LA55_;
													raiseOSError__stdZoserrors_u119(T60_, exe_p0);
													if (NIM_UNLIKELY(*nimErr_)) goto LA55_;
												}
LA58_: ;
												{
													NimStringV2 T65_;
													if (!(((NI)1024) < len_1)) goto LA63_;
													T65_.len = 0; T65_.p = NIM_NIL;
													T65_ = mnewString(((NI)(len_1 + ((NI)1))));
													eqsink___system_u2700((&r_1), T65_);
													len_1 = readlink(nimToCStringConv(x_2), nimToCStringConv(r_1), len_1);
												}
LA63_: ;
												setLengthStrV2((&r_1), (len_1));
												{
													NIM_BOOL T68_;
													T68_ = (NIM_BOOL)0;
													T68_ = nosisAbsolute(r_1);
													if (NIM_UNLIKELY(*nimErr_)) goto LA55_;
													if (!T68_) goto LA69_;
													eqsink___system_u2700((&x_2), r_1);
													eqwasMoved___system_u2688((&r_1));
												}
												goto LA66_;
LA69_: ;
												{
													NimStringV2 colontmpD__2;
													NimStringV2 T72_;
													colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
													colontmpD__2 = nosparentDir(x_2);
													if (NIM_UNLIKELY(*nimErr_)) goto LA55_;
													T72_.len = 0; T72_.p = NIM_NIL;
													T72_ = slash___stdZprivateZospaths2_u91(colontmpD__2, r_1);
													if (NIM_UNLIKELY(*nimErr_)) {eqdestroy___system_u2691(T72_); goto LA55_;}
													eqsink___system_u2700((&x_2), T72_);
													eqdestroy___system_u2691(colontmpD__2);
												}
LA66_: ;
												{
													LA55_:;
												}
												{
													eqdestroy___system_u2691(r_1);
												}
												if (NIM_UNLIKELY(*nimErr_)) goto LA42_;
											}
											goto LA50_;
LA53_: ;
											{
												goto LA48;
											}
LA50_: ;
										} LA49: ;
									} LA48: ;
									result = x_2;
									eqwasMoved___system_u2688((&x_2));
									eqdestroy___system_u2691(x_2);
									eqdestroy___system_u2691(colontmpD_);
									eqdestroy___system_u2691(x_1);
									eqdestroy___system_u2691(candidate_1);
									eqdestroy___system_u2691(path_1);
									goto BeforeRet_;
								}
LA46_: ;
								i_2 += ((NI)1);
								{
									LA42_:;
								}
								{
									eqdestroy___system_u2691(x_2);
								}
								if (NIM_UNLIKELY(*nimErr_)) goto LA34_;
							} LA41: ;
						}
					}
					{
						LA34_:;
					}
					{
						eqdestroy___system_u2691(colontmpD_);
						eqdestroy___system_u2691(x_1);
					}
					if (NIM_UNLIKELY(*nimErr_)) goto LA21_;
				} LA33: ;
				{
					if (!(splitsX60gensym34__1 == ((NI)0))) goto LA82_;
					goto LA22;
				}
LA82_: ;
				splitsX60gensym34__1 -= ((NI)1);
				lastX60gensym34__1 += ((NI)1);
			} LA23: ;
		} LA22: ;
		{
			LA21_:;
		}
		{
			eqdestroy___system_u2691(candidate_1);
		}
		if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	}
	result = TM__yu6cxgKBBXbNsTkT9cyMd4g_21;
	{
		LA1_:;
	}
	{
		eqdestroy___system_u2691(path_1);
	}
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(int, exitStatusLikeShell__pureZos_u183)(int status_p0) {
	int result;
	NI32 colontmpD_;
	int colontmpD__2;
	colontmpD_ = (NI32)0;
	colontmpD__2 = (int)0;
	{
		NIM_BOOL T3_;
		int T6_;
		T3_ = (NIM_BOOL)0;
		T3_ = WIFSIGNALED(status_p0);
		if (!T3_) goto LA4_;
		T6_ = (int)0;
		T6_ = WTERMSIG(status_p0);
		colontmpD_ = (NI32)(((NI32)128) + T6_);
		result = colontmpD_;
	}
	goto LA1_;
LA4_: ;
	{
		colontmpD__2 = WEXITSTATUS(status_p0);
		result = colontmpD__2;
	}
LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, nosexecShellCmd)(NimStringV2 command_p0) {
	NI result;
	int T1_;
	int T2_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NI)0;
	T1_ = (int)0;
	T1_ = system(nimToCStringConv(command_p0));
	T2_ = (int)0;
	T2_ = exitStatusLikeShell__pureZos_u183(T1_);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	result = ((NI) (T2_));
	}BeforeRet_: ;
	return result;
}
static N_INLINE(tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA, toTime__pureZos_u27)(struct timespec ts_p0) {
	tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimZeroMem((void*)(&result), sizeof(tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA));
	result = initTime__pureZtimes_u1213(((NI64) (ts_p0.tv_sec)), (ts_p0.tv_nsec));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA, nosgetLastModificationTime)(NimStringV2 file_p0) {
	tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA result;
	struct stat res_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimZeroMem((void*)(&result), sizeof(tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA));
	nimZeroMem((void*)(&res_1), sizeof(struct stat));
	{
		int T3_;
		NI32 T6_;
		T3_ = (int)0;
		T3_ = stat(nimToCStringConv(file_p0), (&res_1));
		if (!(T3_ < ((NI32)0))) goto LA4_;
		T6_ = (NI32)0;
		T6_ = osLastError__stdZoserrors_u122();
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		raiseOSError__stdZoserrors_u119(T6_, file_p0);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA4_: ;
	result = toTime__pureZos_u27(res_1.st_mtim);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosfileNewer)(NimStringV2 a_p0, NimStringV2 b_p1) {
	NIM_BOOL result;
	tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA T1_;
	tyObject_Time__f9czJU2iP3D49bUN3jzSsOfA T2_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NIM_BOOL)0;
	T1_ = nosgetLastModificationTime(b_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T2_ = nosgetLastModificationTime(a_p0);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	result = ntLtTime(T1_, T2_);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
