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

#include "nimbase.h"
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <crt_externs.h>
#include <math.h>
#include <spawn.h>
#include <signal.h>
#include <sys/wait.h>
#include <stdio.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__XOVT24GHXwqiEj5GCsEGCA tyTuple__XOVT24GHXwqiEj5GCsEGCA;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyObject_StringTableObj__aB8otkyeeuZW5rawDMqajg tyObject_StringTableObj__aB8otkyeeuZW5rawDMqajg;
typedef struct tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w;
typedef struct tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ;
typedef struct RootObj RootObj;
typedef struct TNimTypeV2 TNimTypeV2;
typedef struct tyObject_StartProcessData__EQm3cPFtDimvFtpqhaDR1g tyObject_StartProcessData__EQm3cPFtDimvFtpqhaDR1g;
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ tySequence__sM4lkSb7zS6F7OVMvW9cffQ;
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content;
typedef struct tyObject_RefHeader__BVEqx9abcuAhztUEHxbqQJA tyObject_RefHeader__BVEqx9abcuAhztUEHxbqQJA;
typedef struct tyObject_GcEnv__1z8AJ0tfLlYlFBizZRHD7A tyObject_GcEnv__1z8AJ0tfLlYlFBizZRHD7A;
typedef struct tyObject_CellSeq__ssWvVk43J2HePNvNGK2tCw tyObject_CellSeq__ssWvVk43J2HePNvNGK2tCw;
typedef struct tyTuple__N4J9cV4JZGem3ljqqj5rT0Q tyTuple__N4J9cV4JZGem3ljqqj5rT0Q;
typedef struct tyObject_CellSeq__dIiPa2COtDnavhK2KIqxCQ tyObject_CellSeq__dIiPa2COtDnavhK2KIqxCQ;
typedef struct tyTuple__EMes4DT7YbRCwj3TmsFXyA tyTuple__EMes4DT7YbRCwj3TmsFXyA;
typedef struct tyTuple__UV3llMMYFckfui8YMBuUZA tyTuple__UV3llMMYFckfui8YMBuUZA;
typedef struct tySequence__xv3aaFd3JCw8NbmALHiezQ tySequence__xv3aaFd3JCw8NbmALHiezQ;
typedef struct tySequence__xv3aaFd3JCw8NbmALHiezQ_Content tySequence__xv3aaFd3JCw8NbmALHiezQ_Content;
typedef struct tyTuple__sPaDkVPSC0MkcoXCxPH9ccA tyTuple__sPaDkVPSC0MkcoXCxPH9ccA;
typedef struct tyObject_HSlice__atPNPXY5GObvliR9b4ZIorQ tyObject_HSlice__atPNPXY5GObvliR9b4ZIorQ;
typedef struct tyObject_FileStreamObj__55YZdAmhEXf1sGHQMYxWjw tyObject_FileStreamObj__55YZdAmhEXf1sGHQMYxWjw;
struct NimStrPayload {
	NI cap;
	NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
	NI len;
	NimStrPayload* p;
};
typedef NU8 tySet_tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg;
struct tyTuple__XOVT24GHXwqiEj5GCsEGCA {
	NimStringV2 Field0;
	NI Field1;
};
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 tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w {
	RootObj Sup;
	int inHandle;
	int outHandle;
	int errHandle;
	pid_t id;
	tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* inStream;
	tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* outStream;
	tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* errStream;
	int exitStatus;
	NIM_BOOL exitFlag;
	tySet_tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg options;
};
typedef int tyArray__Zwjt9bECqO23Zah8rGoMkoQ[2];
struct tyObject_StartProcessData__EQm3cPFtDimvFtpqhaDR1g {
	NimStringV2 sysCommand;
	NCSTRING* sysArgs;
	NCSTRING* sysEnv;
	NCSTRING workingDir;
	tyArray__Zwjt9bECqO23Zah8rGoMkoQ pStdin;
	tyArray__Zwjt9bECqO23Zah8rGoMkoQ pStdout;
	tyArray__Zwjt9bECqO23Zah8rGoMkoQ pStderr;
	tyArray__Zwjt9bECqO23Zah8rGoMkoQ pErrorPipe;
	tySet_tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg options;
};
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ {
  NI len; tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content* p;
};
struct tyObject_RefHeader__BVEqx9abcuAhztUEHxbqQJA {
	NI rc;
	NI rootIdx;
};
struct tyObject_CellSeq__ssWvVk43J2HePNvNGK2tCw {
	NI len;
	NI cap;
	tyTuple__N4J9cV4JZGem3ljqqj5rT0Q* d;
};
struct tyObject_CellSeq__dIiPa2COtDnavhK2KIqxCQ {
	NI len;
	NI cap;
	tyTuple__EMes4DT7YbRCwj3TmsFXyA* d;
};
struct tyObject_GcEnv__1z8AJ0tfLlYlFBizZRHD7A {
	tyObject_CellSeq__ssWvVk43J2HePNvNGK2tCw traceStack;
	tyObject_CellSeq__dIiPa2COtDnavhK2KIqxCQ toFree;
	NI freed;
	NI touched;
	NI edges;
	NI rcSum;
	NIM_BOOL keepThreshold;
};
struct tyTuple__N4J9cV4JZGem3ljqqj5rT0Q {
	void** Field0;
	TNimTypeV2* Field1;
};
typedef NU8 tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg;
typedef NCSTRING tyUncheckedArray__nvS6J9clHMUMHfoZd8Ad2zg[1];
struct tyTuple__UV3llMMYFckfui8YMBuUZA {
	NimStringV2 Field0;
	NimStringV2 Field1;
};
struct tySequence__xv3aaFd3JCw8NbmALHiezQ {
  NI len; tySequence__xv3aaFd3JCw8NbmALHiezQ_Content* p;
};
typedef NU8 tyEnum_StringTableMode__6ub39bO039a0E9aDYDUuazVSw;
struct tyObject_StringTableObj__aB8otkyeeuZW5rawDMqajg {
	RootObj Sup;
	NI counter;
	tySequence__xv3aaFd3JCw8NbmALHiezQ data;
	tyEnum_StringTableMode__6ub39bO039a0E9aDYDUuazVSw mode;
};
struct tyTuple__sPaDkVPSC0MkcoXCxPH9ccA {
	NimStringV2 Field0;
	NimStringV2 Field1;
	NIM_BOOL Field2;
};
typedef NimStringV2 tyArray__dyW7vpmfeTYw8kX3EXuaJA[3];
typedef NimStringV2 tyArray__TonP9cxJgj8gXu71dWIyNlA[1];
typedef N_NIMCALL_PTR(void, tyProc__E9aUxUbQfSfG9bDHtjp9bJx4Q) (tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* s_p0);
typedef N_NIMCALL_PTR(NIM_BOOL, tyProc__DMp9aUCWnCo4HurK9bbMFmZw) (tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* s_p0);
typedef N_NIMCALL_PTR(void, tyProc__itHc4jZtTpxT9bZ9cqWxzfDA) (tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* s_p0, NI pos_p1);
typedef N_NIMCALL_PTR(NI, tyProc__n8ia0SZOWi9aLDiLsBb0yjw) (tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* s_p0);
typedef N_NIMCALL_PTR(NI, tyProc__0hYqEcBlB9bEANPIuHrMMfA) (tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* s_p0, NimStringV2* buffer_p1, tyObject_HSlice__atPNPXY5GObvliR9b4ZIorQ slice_p2);
typedef N_NIMCALL_PTR(NIM_BOOL, tyProc__wUWG9arq0ePuG9awasbo69cSw) (tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* s_p0, NimStringV2* line_p1);
typedef N_NIMCALL_PTR(NI, tyProc__vPMGV5XMHXAc89bq9byt1r9ag) (tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* s_p0, void* buffer_p1, NI bufLen_p2);
typedef N_NIMCALL_PTR(void, tyProc__Xz9a8DVGoavze4NXIx9bBtkQ) (tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* s_p0, void* buffer_p1, NI bufLen_p2);
struct tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ {
	RootObj Sup;
	tyProc__E9aUxUbQfSfG9bDHtjp9bJx4Q closeImpl;
	tyProc__DMp9aUCWnCo4HurK9bbMFmZw atEndImpl;
	tyProc__itHc4jZtTpxT9bZ9cqWxzfDA setPositionImpl;
	tyProc__n8ia0SZOWi9aLDiLsBb0yjw getPositionImpl;
	tyProc__0hYqEcBlB9bEANPIuHrMMfA readDataStrImpl;
	tyProc__wUWG9arq0ePuG9awasbo69cSw readLineImpl;
	tyProc__vPMGV5XMHXAc89bq9byt1r9ag readDataImpl;
	tyProc__vPMGV5XMHXAc89bq9byt1r9ag peekDataImpl;
	tyProc__Xz9a8DVGoavze4NXIx9bBtkQ writeDataImpl;
	tyProc__E9aUxUbQfSfG9bDHtjp9bJx4Q flushImpl;
};
struct tyObject_FileStreamObj__55YZdAmhEXf1sGHQMYxWjw {
	tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ Sup;
	FILE* f;
};
typedef NU8 tyEnum_FileMode__wjF0STQGT1PBuQEl3p0tng;
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content { NI cap; NimStringV2 data[SEQ_DECL_SIZE]; };
struct tySequence__xv3aaFd3JCw8NbmALHiezQ_Content { NI cap; tyTuple__sPaDkVPSC0MkcoXCxPH9ccA data[SEQ_DECL_SIZE]; };
struct tyObject_HSlice__atPNPXY5GObvliR9b4ZIorQ {
	NI a;
	NI b;
};
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(tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w*, nospstartProcess)(NimStringV2 command_p0, NimStringV2 workingDir_p1, NimStringV2* args_p2, NI args_p2Len_0, tyObject_StringTableObj__aB8otkyeeuZW5rawDMqajg* env_p3, tySet_tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg options_p4);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_u228)(tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w* dest_p0);
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicDyn)(void* p_p0);
static N_INLINE(NI, minuspercent___system_u813)(NI x_p0, NI y_p1);
N_LIB_PRIVATE N_NOINLINE(void, rememberCycle__system_u3555)(NIM_BOOL isDestroyAction_p0, tyObject_RefHeader__BVEqx9abcuAhztUEHxbqQJA* s_p1, TNimTypeV2* desc_p2);
N_LIB_PRIVATE N_NIMCALL(void, nimDestroyAndDispose)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(void*, nimNewObj)(NI size_p0, NI alignment_p1);
N_LIB_PRIVATE N_NIMCALL(void, rttiDestroy__pureZosproc_u2121)(void* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_u248)(tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqtrace___pureZosproc_u260)(tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w* dest_p0, void* env_p1);
static N_INLINE(void, nimTraceRefDyn)(void* q_p0, void* env_p1);
static N_INLINE(void, add__system_u3076)(tyObject_CellSeq__ssWvVk43J2HePNvNGK2tCw* s_p0, void** c_p1, TNimTypeV2* t_p2);
N_LIB_PRIVATE N_NIMCALL(void, resize__system_u3084)(tyObject_CellSeq__ssWvVk43J2HePNvNGK2tCw* s_p0);
static N_INLINE(NI, pluspercent___system_u793)(NI x_p0, NI y_p1);
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(void, eqsink___system_u2760)(NimStringV2* dest_p0, NimStringV2 src_p1);
N_LIB_PRIVATE N_NIMCALL(void*, newSeqPayload)(NI cap_p0, NI elemSize_p1, NI elemAlign_p2);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, eqdup___system_u2757)(NimStringV2 src_p0);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u95)(NimStringV2 msg_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___system_u2754)(NimStringV2* dest_p0, NimStringV2 src_p1);
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError2)(NI i_p0, NI n_p1);
N_LIB_PRIVATE N_NIMCALL(void, add__stdZenumutils_u70)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ* x_p0, NimStringV2 y_p1);
N_LIB_PRIVATE N_NIMCALL(NCSTRING*, allocCStringArray__system_u5673)(NimStringV2* a_p0, NI a_p0Len_0);
N_LIB_PRIVATE N_NIMCALL(NCSTRING*, envToCStringArray__pureZosproc_u756)(void);
static N_INLINE(NIM_BOOL, eqeq___system_u9048)(NCSTRING x_p0, NCSTRING y_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, cstrToNimstr)(NCSTRING str_p0);
static N_INLINE(NIM_BOOL, nimAddInt)(NI a_p0, NI b_p1, NI* res_p2);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
static N_INLINE(NI, find__pureZparseutils_u628)(NimStringV2 a_p0, NIM_CHAR item_p1);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___stdZprivateZospaths2_u312)(tyTuple__UV3llMMYFckfui8YMBuUZA* dest_p0, tyTuple__UV3llMMYFckfui8YMBuUZA* src_p1);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, substr__system_u9096)(NimStringV2 s_p0, NI first_p1, NI last_p2);
static N_INLINE(NIM_BOOL, nimSubInt)(NI a_p0, NI b_p1, NI* res_p2);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, substr__system_u9109)(NimStringV2 s_p0, NI first_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqwasMoved___system_u2751)(NimStringV2* dest_p0);
N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___stdZprivateZospaths2_u303)(tyTuple__UV3llMMYFckfui8YMBuUZA* dest_p0);
N_LIB_PRIVATE N_NOCONV(void*, alloc0Impl__system_u1773)(NI size_p0);
static N_INLINE(NIM_BOOL, nimMulInt)(NI a_p0, NI b_p1, NI* res_p2);
static N_INLINE(NF, toFloat__system_u1705)(NI i_p0);
static N_INLINE(NF, abs__system_u5188)(NF x_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);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space_p0);
N_LIB_PRIVATE N_NOCONV(void*, allocImpl__system_u1771)(NI size_p0);
N_LIB_PRIVATE N_NIMCALL(NCSTRING*, envToCStringArray__pureZosproc_u744)(tyObject_StringTableObj__aB8otkyeeuZW5rawDMqajg* t_p0);
N_LIB_PRIVATE N_NIMCALL(NI, nstlen)(tyObject_StringTableObj__aB8otkyeeuZW5rawDMqajg* t_p0);
static N_INLINE(NCSTRING, nimToCStringConv)(NimStringV2 s_p0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosgetCurrentDir)(void);
N_LIB_PRIVATE N_NIMCALL(pid_t, startProcessAuxSpawn__pureZosproc_u786)(tyObject_StartProcessData__EQm3cPFtDimvFtpqhaDR1g* data_p0);
static N_INLINE(NI, nimCStrLen)(NCSTRING a_p0);
static N_INLINE(void, setCurrentDir__stdZprivateZosdirs_u506)(NimStringV2 newDir_p0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nsuJoinSep)(NimStringV2* a_p0, NI a_p0Len_0, NimStringV2 sep_p1);
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringV2* args_p0, NI args_p0Len_0);
N_LIB_PRIVATE N_NIMCALL(void, deallocCStringArray__system_u5727)(NCSTRING* a_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___system_u5582)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_u894)(tyObject_StartProcessData__EQm3cPFtDimvFtpqhaDR1g* dest_p0);
N_LIB_PRIVATE N_NIMCALL(tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ*, nospoutputStream)(tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___pureZstreams_u797)(tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ** dest_p0, tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* src_p1);
N_LIB_PRIVATE N_NIMCALL(tyObject_FileStreamObj__55YZdAmhEXf1sGHQMYxWjw*, createStream__pureZosproc_u1143)(int* handle_p0, tyEnum_FileMode__wjF0STQGT1PBuQEl3p0tng fileMode_p1);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, open__stdZsyncio_u482)(FILE** f_p0, int filehandle_p1, tyEnum_FileMode__wjF0STQGT1PBuQEl3p0tng mode_p2);
N_LIB_PRIVATE N_NIMCALL(tyObject_FileStreamObj__55YZdAmhEXf1sGHQMYxWjw*, newFileStream__pureZstreams_u1185)(FILE* f_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZstreams_u1093)(tyObject_FileStreamObj__55YZdAmhEXf1sGHQMYxWjw* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___pureZstreams_u789)(tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ** dest_p0, tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* src_p1, NIM_BOOL cyclic_p2);
N_LIB_PRIVATE N_NIMCALL(void, write__pureZstreams_u221)(tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* s_p0, NimStringV2 x_p1);
N_LIB_PRIVATE N_NIMCALL(tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ*, nospinputStream)(tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w* p_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZstreams_u786)(tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, close__pureZstreams_u57)(tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* s_p0);
N_NIMCALL(NimStringV2, rawNewString)(NI cap_p0);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, readLine__pureZstreams_u668)(tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* s_p0, NimStringV2* line_p1);
N_LIB_PRIVATE N_NIMCALL(void, prepareAdd)(NimStringV2* s_p0, NI addLen_p1);
N_LIB_PRIVATE N_NIMCALL(NI, nosppeekExitCode)(tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w* p_p0);
N_LIB_PRIVATE N_NIMCALL(int, exitStatusLikeShell__pureZos_u180)(int status_p0);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, isExitStatus__pureZosproc_u741)(int status_p0);
N_LIB_PRIVATE N_NIMCALL(void, nospclose)(tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w* p_p0);
N_LIB_PRIVATE TNimTypeV2 NTIv2__plQvvouhzGGVIaG8Gzyi1w_;
static const struct {
  NI cap; NIM_CHAR data[0+1];
} TM__HZdw8BhppcTQo8DIK46LSg_3 = { 0 | NIM_STRLIT_FLAG, "" };
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_4 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
static const struct {
  NI cap; NIM_CHAR data[7+1];
} TM__HZdw8BhppcTQo8DIK46LSg_5 = { 7 | NIM_STRLIT_FLAG, "/bin/sh" };
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_6 = {7, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_5};
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_7 = {7, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_5};
static const struct {
  NI cap; NIM_CHAR data[2+1];
} TM__HZdw8BhppcTQo8DIK46LSg_8 = { 2 | NIM_STRLIT_FLAG, "-c" };
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_9 = {2, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_8};
static const struct {
  NI cap; NIM_CHAR data[83+1];
} TM__HZdw8BhppcTQo8DIK46LSg_10 = { 83 | NIM_STRLIT_FLAG, "osproc.nim(983, 7) `args.len == 0` `args` has to be empty when using poEvalCommand." };
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_11 = {83, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_10};
static const struct {
  NI cap; NIM_CHAR data[93+1];
} TM__HZdw8BhppcTQo8DIK46LSg_14 = { 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__HZdw8BhppcTQo8DIK46LSg_15 = {93, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_14};
static const struct {
  NI cap; NIM_CHAR data[1+1];
} TM__HZdw8BhppcTQo8DIK46LSg_24 = { 1 | NIM_STRLIT_FLAG, "=" };
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_25 = {1, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_24};
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_31 = {1, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_24};
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_36 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_37 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_38 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_39 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_40 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_41 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_42 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_43 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_44 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_45 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_46 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_47 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_48 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
static const struct {
  NI cap; NIM_CHAR data[1+1];
} TM__HZdw8BhppcTQo8DIK46LSg_49 = { 1 | NIM_STRLIT_FLAG, " " };
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_50 = {1, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_49};
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_51 = {1, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_49};
static const struct {
  NI cap; NIM_CHAR data[126+1];
} TM__HZdw8BhppcTQo8DIK46LSg_52 = { 126 | NIM_STRLIT_FLAG, "osproc.nim(1448, 17) `poParentStreams notin p.options` API usage error: stream access not allowed when you use poParentStreams" };
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_53 = {126, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_52};
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_54 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
static const struct {
  NI cap; NIM_CHAR data[126+1];
} TM__HZdw8BhppcTQo8DIK46LSg_55 = { 126 | NIM_STRLIT_FLAG, "osproc.nim(1442, 17) `poParentStreams notin p.options` API usage error: stream access not allowed when you use poParentStreams" };
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_56 = {126, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_55};
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_57 = {0, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_3};
static const struct {
  NI cap; NIM_CHAR data[1+1];
} TM__HZdw8BhppcTQo8DIK46LSg_58 = { 1 | NIM_STRLIT_FLAG, "\012" };
static const NimStringV2 TM__HZdw8BhppcTQo8DIK46LSg_59 = {1, (NimStrPayload*)&TM__HZdw8BhppcTQo8DIK46LSg_58};
static NIM_CONST NU32 TM__HZdw8BhppcTQo8DIK46LSg_2[2] = {3701606400, 1412414976};
N_LIB_PRIVATE TNimTypeV2 NTIv2__plQvvouhzGGVIaG8Gzyi1w_ = {.destructor = (void*)rttiDestroy__pureZosproc_u2121, .size = sizeof(tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w), .align = (NI16) NIM_ALIGNOF(tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w), .depth = 1, .display = TM__HZdw8BhppcTQo8DIK46LSg_2, .traceImpl = (void*)eqtrace___pureZosproc_u260, .flags = 0};
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4198;
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(NI, minuspercent___system_u813)(NI x_p0, NI y_p1) {
	NI result;
	result = ((NI) ((NU)((NU64)(((NU) (x_p0))) - (NU64)(((NU) (y_p1))))));
	return result;
}
static N_INLINE(NIM_BOOL, nimDecRefIsLastCyclicDyn)(void* p_p0) {
	NIM_BOOL result;
	result = NIM_FALSE;
	{
		tyObject_RefHeader__BVEqx9abcuAhztUEHxbqQJA* cell_1;
		NI T5_;
		if (!!((p_p0 == NIM_NIL))) goto LA3_;
		T5_ = (NI)0;
		T5_ = minuspercent___system_u813(((NI) (ptrdiff_t) (p_p0)), ((NI)16));
		cell_1 = ((tyObject_RefHeader__BVEqx9abcuAhztUEHxbqQJA*) (T5_));
		{
			if (!((NI)((*cell_1).rc & ((NI)-16)) == ((NI)0))) goto LA8_;
			result = NIM_TRUE;
		}
		goto LA6_;
LA8_: ;
		{
			(*cell_1).rc = minuspercent___system_u813((*cell_1).rc, ((NI)16));
		}
LA6_: ;
		rememberCycle__system_u3555(result, cell_1, (*((TNimTypeV2**) (p_p0))));
	}
LA3_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_u228)(tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w* dest_p0) {
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = nimDecRefIsLastCyclicDyn(dest_p0);
		if (!T3_) goto LA4_;
		nimDestroyAndDispose(dest_p0);
	}
LA4_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_u248)(tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w* dest_p0) {
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = nimDecRefIsLastCyclicDyn((*dest_p0).errStream);
		if (!T3_) goto LA4_;
		nimDestroyAndDispose((*dest_p0).errStream);
	}
LA4_: ;
	{
		NIM_BOOL T8_;
		T8_ = (NIM_BOOL)0;
		T8_ = nimDecRefIsLastCyclicDyn((*dest_p0).outStream);
		if (!T8_) goto LA9_;
		nimDestroyAndDispose((*dest_p0).outStream);
	}
LA9_: ;
	{
		NIM_BOOL T13_;
		T13_ = (NIM_BOOL)0;
		T13_ = nimDecRefIsLastCyclicDyn((*dest_p0).inStream);
		if (!T13_) goto LA14_;
		nimDestroyAndDispose((*dest_p0).inStream);
	}
LA14_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, rttiDestroy__pureZosproc_u2121)(void* dest_p0) {
	eqdestroy___pureZosproc_u248(((tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w*) (dest_p0)));
}
static N_INLINE(NI, pluspercent___system_u793)(NI x_p0, NI y_p1) {
	NI result;
	result = ((NI) ((NU)((NU64)(((NU) (x_p0))) + (NU64)(((NU) (y_p1))))));
	return result;
}
static N_INLINE(void, add__system_u3076)(tyObject_CellSeq__ssWvVk43J2HePNvNGK2tCw* s_p0, void** c_p1, TNimTypeV2* t_p2) {
	void** colontmp_;
	TNimTypeV2* colontmp__2;
	{
		if (!((*s_p0).cap <= (*s_p0).len)) goto LA3_;
		resize__system_u3084(s_p0);
	}
LA3_: ;
	colontmp_ = c_p1;
	colontmp__2 = t_p2;
	(*s_p0).d[(*s_p0).len].Field0 = colontmp_;
	(*s_p0).d[(*s_p0).len].Field1 = colontmp__2;
	(*s_p0).len = pluspercent___system_u793((*s_p0).len, ((NI)1));
}
static N_INLINE(void, nimTraceRefDyn)(void* q_p0, void* env_p1) {
	void** p_1;
	p_1 = ((void**) (q_p0));
	{
		tyObject_GcEnv__1z8AJ0tfLlYlFBizZRHD7A* j_1;
		if (!!(((*p_1) == NIM_NIL))) goto LA3_;
		j_1 = ((tyObject_GcEnv__1z8AJ0tfLlYlFBizZRHD7A*) (env_p1));
		add__system_u3076((&(*j_1).traceStack), p_1, (*((TNimTypeV2**) ((*p_1)))));
	}
LA3_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, eqtrace___pureZosproc_u260)(tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w* dest_p0, void* env_p1) {
	nimTraceRefDyn(&(*dest_p0).inStream, env_p1);
	nimTraceRefDyn(&(*dest_p0).outStream, env_p1);
	nimTraceRefDyn(&(*dest_p0).errStream, env_p1);
}
static N_INLINE(NIM_BOOL, eqeq___system_u9048)(NCSTRING x_p0, NCSTRING y_p1) {
	NIM_BOOL result;
	{
		if (!(((void*) (x_p0)) == ((void*) (y_p1)))) goto LA3_;
		result = NIM_TRUE;
	}
	goto LA1_;
LA3_: ;
	{
		NIM_BOOL T6_;
		T6_ = (NIM_BOOL)0;
		T6_ = (((void*) (x_p0)) == NIM_NIL);
		if (T6_) goto LA7_;
		T6_ = (((void*) (y_p1)) == NIM_NIL);
LA7_: ;
		if (!T6_) goto LA8_;
		result = NIM_FALSE;
	}
	goto LA1_;
LA8_: ;
	{
		int T11_;
		T11_ = (int)0;
		T11_ = strcmp(x_p0, y_p1);
		result = (T11_ == ((NI32)0));
	}
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;
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	result = (&nimInErrorMode__system_u4198);
	return result;
}
static N_INLINE(NI, find__pureZparseutils_u628)(NimStringV2 a_p0, NIM_CHAR item_p1) {
	NI result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = ((NI)0);
	{
		NIM_CHAR i_1;
		NI i_2;
		NI L_1;
		i_1 = (NIM_CHAR)0;
		i_2 = ((NI)0);
		L_1 = a_p0.len;
		{
			while (1) {
				NI TM__HZdw8BhppcTQo8DIK46LSg_13;
				if (!(i_2 < L_1)) goto LA3;
				if (i_2 < 0 || i_2 >= a_p0.len){ raiseIndexError2(i_2,a_p0.len-1); goto BeforeRet_;
				}
				i_1 = a_p0.p->data[i_2];
				{
					if (!((NU8)(i_1) == (NU8)(item_p1))) goto LA6_;
					goto BeforeRet_;
				}
LA6_: ;
				if (nimAddInt(result, ((NI)1), &TM__HZdw8BhppcTQo8DIK46LSg_13)) { raiseOverflow(); goto BeforeRet_;
				};
				result = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_13);
				i_2 += ((NI)1);
				{
					if (!!((a_p0.len == L_1))) goto LA10_;
					failedAssertImpl__stdZassertions_u95(TM__HZdw8BhppcTQo8DIK46LSg_15);
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				}
LA10_: ;
			} LA3: ;
		}
	}
	result = ((NI)-1);
	}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(NF, toFloat__system_u1705)(NI i_p0) {
	NF result;
	result = ((NF) (i_p0));
	return result;
}
static N_INLINE(NF, abs__system_u5188)(NF x_p0) {
	NF result;
	result = (NF)0;
	result = fabs(x_p0);
	return result;
}
static N_INLINE(NIM_BOOL, nimMulInt)(NI a_p0, NI b_p1, NI* res_p2) {
	NIM_BOOL result;
	NI r_1;
	NF floatProd_1;
	NF T1_;
	NF T2_;
	NF resAsFloat_1;
	result = (NIM_BOOL)0;
	r_1 = ((NI) ((NU)((NU64)(((NU) (a_p0))) * (NU64)(((NU) (b_p1))))));
	T1_ = (NF)0;
	T1_ = toFloat__system_u1705(a_p0);
	T2_ = (NF)0;
	T2_ = toFloat__system_u1705(b_p1);
	floatProd_1 = ((NF)(T1_) * (NF)(T2_));
	resAsFloat_1 = toFloat__system_u1705(r_1);
	{
		if (!(resAsFloat_1 == floatProd_1)) goto LA5_;
		(*res_p2) = r_1;
	}
	goto LA3_;
LA5_: ;
	{
		{
			NF T10_;
			NF T11_;
			T10_ = (NF)0;
			T10_ = abs__system_u5188(((NF)(resAsFloat_1) - (NF)(floatProd_1)));
			T11_ = (NF)0;
			T11_ = abs__system_u5188(floatProd_1);
			if (!(((NF)(32.0) * (NF)(T10_)) <= T11_)) goto LA12_;
			(*res_p2) = r_1;
		}
		goto LA8_;
LA12_: ;
		{
			result = NIM_TRUE;
		}
LA8_: ;
	}
LA3_: ;
	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(NCSTRING*, envToCStringArray__pureZosproc_u756)(void) {
	NCSTRING* result;
	NI counter_1;
	NI TM__HZdw8BhppcTQo8DIK46LSg_19;
	NI TM__HZdw8BhppcTQo8DIK46LSg_20;
	void* T8_;
	NI i_2;
{	result = (NCSTRING*)0;
	counter_1 = ((NI)0);
	{
		NimStringV2 key_1;
		NimStringV2 val_1;
		key_1.len = 0; key_1.p = NIM_NIL;
		val_1.len = 0; val_1.p = NIM_NIL;
		{
			tyTuple__UV3llMMYFckfui8YMBuUZA ai_1;
			NI i_1;
			NCSTRING* gEnv_1;
			NCSTRING** T3_;
			nimZeroMem((void*)(&ai_1), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
			i_1 = ((NI)0);
			T3_ = (NCSTRING**)0;
			T3_ = _NSGetEnviron();
			gEnv_1 = (*T3_);
			{
				while (1) {
					NIM_BOOL T6_;
					NimStringV2 kv_1;
					NI TM__HZdw8BhppcTQo8DIK46LSg_12;
					NI p_1;
					tyTuple__UV3llMMYFckfui8YMBuUZA T7_;
					NI TM__HZdw8BhppcTQo8DIK46LSg_16;
					NI TM__HZdw8BhppcTQo8DIK46LSg_17;
					NI TM__HZdw8BhppcTQo8DIK46LSg_18;
					T6_ = (NIM_BOOL)0;
					T6_ = eqeq___system_u9048(gEnv_1[i_1], ((NCSTRING) NIM_NIL));
					if (!!(T6_)) goto LA5;
					kv_1.len = 0; kv_1.p = NIM_NIL;
					kv_1 = cstrToNimstr(gEnv_1[i_1]);
					if (nimAddInt(i_1, ((NI)1), &TM__HZdw8BhppcTQo8DIK46LSg_12)) { raiseOverflow(); goto BeforeRet_;
					};
					i_1 = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_12);
					p_1 = find__pureZparseutils_u628(kv_1, 61);
					if (nimSubInt(p_1, ((NI)1), &TM__HZdw8BhppcTQo8DIK46LSg_16)) { raiseOverflow(); goto BeforeRet_;
					};
					T7_.Field0 = substr__system_u9096(kv_1, ((NI)0), (NI)(TM__HZdw8BhppcTQo8DIK46LSg_16));
					if (nimAddInt(p_1, ((NI)1), &TM__HZdw8BhppcTQo8DIK46LSg_17)) { raiseOverflow(); goto BeforeRet_;
					};
					T7_.Field1 = substr__system_u9109(kv_1, (NI)(TM__HZdw8BhppcTQo8DIK46LSg_17));
					eqsink___stdZprivateZospaths2_u312((&ai_1), (&T7_));
					eqsink___system_u2760((&key_1), ai_1.Field0);
					eqwasMoved___system_u2751((&ai_1.Field0));
					eqsink___system_u2760((&val_1), ai_1.Field1);
					eqwasMoved___system_u2751((&ai_1.Field1));
					if (nimAddInt(counter_1, ((NI)1), &TM__HZdw8BhppcTQo8DIK46LSg_18)) { raiseOverflow(); goto BeforeRet_;
					};
					counter_1 = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_18);
					if (kv_1.p && !(kv_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(kv_1.p);
}
				} LA5: ;
			}
			eqdestroy___stdZprivateZospaths2_u303((&ai_1));
		}
		if (val_1.p && !(val_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(val_1.p);
}
		if (key_1.p && !(key_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(key_1.p);
}
	}
	if (nimAddInt(counter_1, ((NI)1), &TM__HZdw8BhppcTQo8DIK46LSg_19)) { raiseOverflow(); goto BeforeRet_;
	};
	if (nimMulInt((NI)(TM__HZdw8BhppcTQo8DIK46LSg_19), ((NI)8), &TM__HZdw8BhppcTQo8DIK46LSg_20)) { raiseOverflow(); goto BeforeRet_;
	};
	if (((NI)(TM__HZdw8BhppcTQo8DIK46LSg_20)) < ((NI)0) || ((NI)(TM__HZdw8BhppcTQo8DIK46LSg_20)) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__HZdw8BhppcTQo8DIK46LSg_20), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_;
	}
	T8_ = (void*)0;
	T8_ = alloc0Impl__system_u1773(((NI)(TM__HZdw8BhppcTQo8DIK46LSg_20)));
	result = ((NCSTRING*) (T8_));
	i_2 = ((NI)0);
	{
		NimStringV2 key_2;
		NimStringV2 val_2;
		key_2.len = 0; key_2.p = NIM_NIL;
		val_2.len = 0; val_2.p = NIM_NIL;
		{
			tyTuple__UV3llMMYFckfui8YMBuUZA ai_2;
			NI i_3;
			NCSTRING* gEnv_2;
			NCSTRING** T11_;
			nimZeroMem((void*)(&ai_2), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
			i_3 = ((NI)0);
			T11_ = (NCSTRING**)0;
			T11_ = _NSGetEnviron();
			gEnv_2 = (*T11_);
			{
				while (1) {
					NIM_BOOL T14_;
					NimStringV2 kv_2;
					NimStringV2 x_1;
					NI TM__HZdw8BhppcTQo8DIK46LSg_21;
					NI p_2;
					tyTuple__UV3llMMYFckfui8YMBuUZA T15_;
					NI TM__HZdw8BhppcTQo8DIK46LSg_22;
					NI TM__HZdw8BhppcTQo8DIK46LSg_23;
					NimStringV2 T16_;
					NI TM__HZdw8BhppcTQo8DIK46LSg_26;
					void* T17_;
					NI TM__HZdw8BhppcTQo8DIK46LSg_27;
					NI TM__HZdw8BhppcTQo8DIK46LSg_28;
					T14_ = (NIM_BOOL)0;
					T14_ = eqeq___system_u9048(gEnv_2[i_3], ((NCSTRING) NIM_NIL));
					if (!!(T14_)) goto LA13;
					kv_2.len = 0; kv_2.p = NIM_NIL;
					x_1.len = 0; x_1.p = NIM_NIL;
					kv_2 = cstrToNimstr(gEnv_2[i_3]);
					if (nimAddInt(i_3, ((NI)1), &TM__HZdw8BhppcTQo8DIK46LSg_21)) { raiseOverflow(); goto BeforeRet_;
					};
					i_3 = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_21);
					p_2 = find__pureZparseutils_u628(kv_2, 61);
					if (nimSubInt(p_2, ((NI)1), &TM__HZdw8BhppcTQo8DIK46LSg_22)) { raiseOverflow(); goto BeforeRet_;
					};
					T15_.Field0 = substr__system_u9096(kv_2, ((NI)0), (NI)(TM__HZdw8BhppcTQo8DIK46LSg_22));
					if (nimAddInt(p_2, ((NI)1), &TM__HZdw8BhppcTQo8DIK46LSg_23)) { raiseOverflow(); goto BeforeRet_;
					};
					T15_.Field1 = substr__system_u9109(kv_2, (NI)(TM__HZdw8BhppcTQo8DIK46LSg_23));
					eqsink___stdZprivateZospaths2_u312((&ai_2), (&T15_));
					eqsink___system_u2760((&key_2), ai_2.Field0);
					eqwasMoved___system_u2751((&ai_2.Field0));
					eqsink___system_u2760((&val_2), ai_2.Field1);
					eqwasMoved___system_u2751((&ai_2.Field1));
					T16_.len = 0; T16_.p = NIM_NIL;
					T16_ = rawNewString(key_2.len + val_2.len + 1);
appendString((&T16_), key_2);
appendString((&T16_), TM__HZdw8BhppcTQo8DIK46LSg_25);
appendString((&T16_), val_2);
					x_1 = T16_;
					if (nimAddInt(x_1.len, ((NI)1), &TM__HZdw8BhppcTQo8DIK46LSg_26)) { raiseOverflow(); goto BeforeRet_;
					};
					if (((NI)(TM__HZdw8BhppcTQo8DIK46LSg_26)) < ((NI)0) || ((NI)(TM__HZdw8BhppcTQo8DIK46LSg_26)) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__HZdw8BhppcTQo8DIK46LSg_26), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_;
					}
					T17_ = (void*)0;
					T17_ = allocImpl__system_u1771(((NI)(TM__HZdw8BhppcTQo8DIK46LSg_26)));
					result[i_2] = ((NCSTRING) (T17_));
					if (((NI)0) < 0 || ((NI)0) >= x_1.len){ raiseIndexError2(((NI)0),x_1.len-1); goto BeforeRet_;
					}
					if (nimAddInt(x_1.len, ((NI)1), &TM__HZdw8BhppcTQo8DIK46LSg_27)) { raiseOverflow(); goto BeforeRet_;
					};
					if (((NI)(TM__HZdw8BhppcTQo8DIK46LSg_27)) < ((NI)0) || ((NI)(TM__HZdw8BhppcTQo8DIK46LSg_27)) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__HZdw8BhppcTQo8DIK46LSg_27), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_;
					}
					copyMem__system_u1755(((void*) (result[i_2])), ((void*) ((&x_1.p->data[((NI)0)]))), ((NI)(TM__HZdw8BhppcTQo8DIK46LSg_27)));
					if (nimAddInt(i_2, ((NI)1), &TM__HZdw8BhppcTQo8DIK46LSg_28)) { raiseOverflow(); goto BeforeRet_;
					};
					i_2 = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_28);
					if (x_1.p && !(x_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(x_1.p);
}
					if (kv_2.p && !(kv_2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(kv_2.p);
}
				} LA13: ;
			}
			eqdestroy___stdZprivateZospaths2_u303((&ai_2));
		}
		if (val_2.p && !(val_2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(val_2.p);
}
		if (key_2.p && !(key_2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(key_2.p);
}
	}
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NCSTRING*, envToCStringArray__pureZosproc_u744)(tyObject_StringTableObj__aB8otkyeeuZW5rawDMqajg* t_p0) {
	NCSTRING* result;
	NI T1_;
	NI TM__HZdw8BhppcTQo8DIK46LSg_29;
	NI TM__HZdw8BhppcTQo8DIK46LSg_30;
	void* T2_;
	NI i_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NCSTRING*)0;
	T1_ = (NI)0;
	T1_ = nstlen(t_p0);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	if (nimAddInt(T1_, ((NI)1), &TM__HZdw8BhppcTQo8DIK46LSg_29)) { raiseOverflow(); goto BeforeRet_;
	};
	if (nimMulInt((NI)(TM__HZdw8BhppcTQo8DIK46LSg_29), ((NI)8), &TM__HZdw8BhppcTQo8DIK46LSg_30)) { raiseOverflow(); goto BeforeRet_;
	};
	if (((NI)(TM__HZdw8BhppcTQo8DIK46LSg_30)) < ((NI)0) || ((NI)(TM__HZdw8BhppcTQo8DIK46LSg_30)) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__HZdw8BhppcTQo8DIK46LSg_30), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_;
	}
	T2_ = (void*)0;
	T2_ = alloc0Impl__system_u1773(((NI)(TM__HZdw8BhppcTQo8DIK46LSg_30)));
	result = ((NCSTRING*) (T2_));
	i_1 = ((NI)0);
	{
		NimStringV2 key_1;
		NimStringV2 val_1;
		key_1.len = 0; key_1.p = NIM_NIL;
		val_1.len = 0; val_1.p = NIM_NIL;
		{
			NI h_1;
			NI colontmp_;
			NI T5_;
			NI res_1;
			h_1 = (NI)0;
			colontmp_ = (NI)0;
			T5_ = ((*t_p0).data.len-1);
			colontmp_ = T5_;
			res_1 = ((NI)0);
			{
				while (1) {
					NI TM__HZdw8BhppcTQo8DIK46LSg_35;
					if (!(res_1 <= colontmp_)) goto LA7;
					h_1 = ((NI) (res_1));
					{
						NimStringV2 x_1;
						NimStringV2 T12_;
						NI TM__HZdw8BhppcTQo8DIK46LSg_32;
						void* T13_;
						NI TM__HZdw8BhppcTQo8DIK46LSg_33;
						NI TM__HZdw8BhppcTQo8DIK46LSg_34;
						if (h_1 < 0 || h_1 >= (*t_p0).data.len){ raiseIndexError2(h_1,(*t_p0).data.len-1); goto BeforeRet_;
						}
						if (!(*t_p0).data.p->data[h_1].Field2) goto LA10_;
						x_1.len = 0; x_1.p = NIM_NIL;
						if (h_1 < 0 || h_1 >= (*t_p0).data.len){ raiseIndexError2(h_1,(*t_p0).data.len-1); goto BeforeRet_;
						}
						eqcopy___system_u2754((&key_1), (*t_p0).data.p->data[h_1].Field0);
						if (h_1 < 0 || h_1 >= (*t_p0).data.len){ raiseIndexError2(h_1,(*t_p0).data.len-1); goto BeforeRet_;
						}
						eqcopy___system_u2754((&val_1), (*t_p0).data.p->data[h_1].Field1);
						T12_.len = 0; T12_.p = NIM_NIL;
						T12_ = rawNewString(key_1.len + val_1.len + 1);
appendString((&T12_), key_1);
appendString((&T12_), TM__HZdw8BhppcTQo8DIK46LSg_31);
appendString((&T12_), val_1);
						x_1 = T12_;
						if (nimAddInt(x_1.len, ((NI)1), &TM__HZdw8BhppcTQo8DIK46LSg_32)) { raiseOverflow(); goto BeforeRet_;
						};
						if (((NI)(TM__HZdw8BhppcTQo8DIK46LSg_32)) < ((NI)0) || ((NI)(TM__HZdw8BhppcTQo8DIK46LSg_32)) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__HZdw8BhppcTQo8DIK46LSg_32), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_;
						}
						T13_ = (void*)0;
						T13_ = allocImpl__system_u1771(((NI)(TM__HZdw8BhppcTQo8DIK46LSg_32)));
						result[i_1] = ((NCSTRING) (T13_));
						if (((NI)0) < 0 || ((NI)0) >= x_1.len){ raiseIndexError2(((NI)0),x_1.len-1); goto BeforeRet_;
						}
						if (nimAddInt(x_1.len, ((NI)1), &TM__HZdw8BhppcTQo8DIK46LSg_33)) { raiseOverflow(); goto BeforeRet_;
						};
						if (((NI)(TM__HZdw8BhppcTQo8DIK46LSg_33)) < ((NI)0) || ((NI)(TM__HZdw8BhppcTQo8DIK46LSg_33)) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__HZdw8BhppcTQo8DIK46LSg_33), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_;
						}
						copyMem__system_u1755(((void*) (result[i_1])), ((void*) ((&x_1.p->data[((NI)0)]))), ((NI)(TM__HZdw8BhppcTQo8DIK46LSg_33)));
						if (nimAddInt(i_1, ((NI)1), &TM__HZdw8BhppcTQo8DIK46LSg_34)) { raiseOverflow(); goto BeforeRet_;
						};
						i_1 = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_34);
						if (x_1.p && !(x_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(x_1.p);
}
					}
LA10_: ;
					if (nimAddInt(res_1, ((NI)1), &TM__HZdw8BhppcTQo8DIK46LSg_35)) { raiseOverflow(); goto BeforeRet_;
					};
					res_1 = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_35);
				} LA7: ;
			}
		}
		if (val_1.p && !(val_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(val_1.p);
}
		if (key_1.p && !(key_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(key_1.p);
}
	}
	}BeforeRet_: ;
	return result;
}
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(NI, nimCStrLen)(NCSTRING a_p0) {
	NI result;
	size_t T5_;
{	{
		if (!(a_p0 == 0)) goto LA3_;
		result = ((NI)0);
		goto BeforeRet_;
	}
LA3_: ;
	T5_ = (size_t)0;
	T5_ = strlen(a_p0);
	result = ((NI) (T5_));
	}BeforeRet_: ;
	return result;
}
static N_INLINE(void, setCurrentDir__stdZprivateZosdirs_u506)(NimStringV2 newDir_p0) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	{
		int T3_;
		NI32 T6_;
		T3_ = (int)0;
		T3_ = chdir(nimToCStringConv(newDir_p0));
		if (!!((T3_ == ((NI32)0)))) goto LA4_;
		T6_ = (NI32)0;
		T6_ = osLastError__stdZoserrors_u122();
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		raiseOSError__stdZoserrors_u119(T6_, newDir_p0);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA4_: ;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(pid_t, startProcessAuxSpawn__pureZosproc_u786)(tyObject_StartProcessData__EQm3cPFtDimvFtpqhaDR1g* data_p0) {
	pid_t result;
	posix_spawnattr_t attr_1;
	posix_spawn_file_actions_t fops_1;
	sigset_t mask_1;
	NI32 flags_1;
	int res_1;
	pid_t pid_1;
	int T108_;
	int T109_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (pid_t)0;
	nimZeroMem((void*)(&attr_1), sizeof(posix_spawnattr_t));
	nimZeroMem((void*)(&fops_1), sizeof(posix_spawn_file_actions_t));
	{
		int T3_;
		NI32 T6_;
		T3_ = (int)0;
		T3_ = posix_spawn_file_actions_init((&fops_1));
		if (!!((T3_ == ((NI32)0)))) goto LA4_;
		T6_ = (NI32)0;
		T6_ = osLastError__stdZoserrors_u122();
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		raiseOSError__stdZoserrors_u119(T6_, TM__HZdw8BhppcTQo8DIK46LSg_36);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA4_: ;
	{
		int T9_;
		NI32 T12_;
		T9_ = (int)0;
		T9_ = posix_spawnattr_init((&attr_1));
		if (!!((T9_ == ((NI32)0)))) goto LA10_;
		T12_ = (NI32)0;
		T12_ = osLastError__stdZoserrors_u122();
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		raiseOSError__stdZoserrors_u119(T12_, TM__HZdw8BhppcTQo8DIK46LSg_37);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA10_: ;
	nimZeroMem((void*)(&mask_1), sizeof(sigset_t));
	{
		int T15_;
		NI32 T18_;
		T15_ = (int)0;
		T15_ = sigemptyset((&mask_1));
		if (!!((T15_ == ((NI32)0)))) goto LA16_;
		T18_ = (NI32)0;
		T18_ = osLastError__stdZoserrors_u122();
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		raiseOSError__stdZoserrors_u119(T18_, TM__HZdw8BhppcTQo8DIK46LSg_38);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA16_: ;
	{
		int T21_;
		NI32 T24_;
		T21_ = (int)0;
		T21_ = posix_spawnattr_setsigmask((&attr_1), (&mask_1));
		if (!!((T21_ == ((NI32)0)))) goto LA22_;
		T24_ = (NI32)0;
		T24_ = osLastError__stdZoserrors_u122();
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		raiseOSError__stdZoserrors_u119(T24_, TM__HZdw8BhppcTQo8DIK46LSg_39);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA22_: ;
	{
		if (!(((*data_p0).options &((NU8)1<<((NU)((((tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg)6)))&7U)))!=0)) goto LA27_;
		{
			int T31_;
			NI32 T34_;
			T31_ = (int)0;
			T31_ = posix_spawnattr_setpgroup((&attr_1), ((NI32)0));
			if (!!((T31_ == ((NI32)0)))) goto LA32_;
			T34_ = (NI32)0;
			T34_ = osLastError__stdZoserrors_u122();
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			raiseOSError__stdZoserrors_u119(T34_, TM__HZdw8BhppcTQo8DIK46LSg_40);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		}
LA32_: ;
	}
LA27_: ;
	flags_1 = (NI32)(((int)0) | POSIX_SPAWN_SETSIGMASK);
	{
		if (!(((*data_p0).options &((NU8)1<<((NU)((((tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg)6)))&7U)))!=0)) goto LA37_;
		flags_1 = (NI32)(flags_1 | POSIX_SPAWN_SETPGROUP);
	}
LA37_: ;
	{
		int T41_;
		NI32 T44_;
		T41_ = (int)0;
		T41_ = posix_spawnattr_setflags((&attr_1), flags_1);
		if (!!((T41_ == ((NI32)0)))) goto LA42_;
		T44_ = (NI32)0;
		T44_ = osLastError__stdZoserrors_u122();
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		raiseOSError__stdZoserrors_u119(T44_, TM__HZdw8BhppcTQo8DIK46LSg_41);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA42_: ;
	{
		if (!!((((*data_p0).options &((NU8)1<<((NU)((((tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg)4)))&7U)))!=0))) goto LA47_;
		{
			int T51_;
			NI32 T54_;
			T51_ = (int)0;
			T51_ = posix_spawn_file_actions_addclose((&fops_1), (*data_p0).pStdin[(((NI)1))- 0]);
			if (!!((T51_ == ((NI32)0)))) goto LA52_;
			T54_ = (NI32)0;
			T54_ = osLastError__stdZoserrors_u122();
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			raiseOSError__stdZoserrors_u119(T54_, TM__HZdw8BhppcTQo8DIK46LSg_42);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		}
LA52_: ;
		{
			int T57_;
			NI32 T60_;
			T57_ = (int)0;
			T57_ = posix_spawn_file_actions_adddup2((&fops_1), (*data_p0).pStdin[(((NI)0))- 0], ((int)0));
			if (!!((T57_ == ((NI32)0)))) goto LA58_;
			T60_ = (NI32)0;
			T60_ = osLastError__stdZoserrors_u122();
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			raiseOSError__stdZoserrors_u119(T60_, TM__HZdw8BhppcTQo8DIK46LSg_43);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		}
LA58_: ;
		{
			int T63_;
			NI32 T66_;
			T63_ = (int)0;
			T63_ = posix_spawn_file_actions_addclose((&fops_1), (*data_p0).pStdout[(((NI)0))- 0]);
			if (!!((T63_ == ((NI32)0)))) goto LA64_;
			T66_ = (NI32)0;
			T66_ = osLastError__stdZoserrors_u122();
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			raiseOSError__stdZoserrors_u119(T66_, TM__HZdw8BhppcTQo8DIK46LSg_44);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		}
LA64_: ;
		{
			int T69_;
			NI32 T72_;
			T69_ = (int)0;
			T69_ = posix_spawn_file_actions_adddup2((&fops_1), (*data_p0).pStdout[(((NI)1))- 0], ((int)1));
			if (!!((T69_ == ((NI32)0)))) goto LA70_;
			T72_ = (NI32)0;
			T72_ = osLastError__stdZoserrors_u122();
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			raiseOSError__stdZoserrors_u119(T72_, TM__HZdw8BhppcTQo8DIK46LSg_45);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		}
LA70_: ;
		{
			int T75_;
			NI32 T78_;
			T75_ = (int)0;
			T75_ = posix_spawn_file_actions_addclose((&fops_1), (*data_p0).pStderr[(((NI)0))- 0]);
			if (!!((T75_ == ((NI32)0)))) goto LA76_;
			T78_ = (NI32)0;
			T78_ = osLastError__stdZoserrors_u122();
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			raiseOSError__stdZoserrors_u119(T78_, TM__HZdw8BhppcTQo8DIK46LSg_46);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		}
LA76_: ;
		{
			if (!(((*data_p0).options &((NU8)1<<((NU)((((tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg)3)))&7U)))!=0)) goto LA81_;
			{
				int T85_;
				NI32 T88_;
				T85_ = (int)0;
				T85_ = posix_spawn_file_actions_adddup2((&fops_1), (*data_p0).pStdout[(((NI)1))- 0], ((int)2));
				if (!!((T85_ == ((NI32)0)))) goto LA86_;
				T88_ = (NI32)0;
				T88_ = osLastError__stdZoserrors_u122();
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				raiseOSError__stdZoserrors_u119(T88_, TM__HZdw8BhppcTQo8DIK46LSg_47);
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			}
LA86_: ;
		}
		goto LA79_;
LA81_: ;
		{
			{
				int T92_;
				NI32 T95_;
				T92_ = (int)0;
				T92_ = posix_spawn_file_actions_adddup2((&fops_1), (*data_p0).pStderr[(((NI)1))- 0], ((int)2));
				if (!!((T92_ == ((NI32)0)))) goto LA93_;
				T95_ = (NI32)0;
				T95_ = osLastError__stdZoserrors_u122();
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				raiseOSError__stdZoserrors_u119(T95_, TM__HZdw8BhppcTQo8DIK46LSg_48);
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			}
LA93_: ;
		}
LA79_: ;
	}
LA47_: ;
	res_1 = (int)0;
	{
		NimStringV2 colontmpD_;
		if (!(((NI)0) < nimCStrLen((*data_p0).workingDir))) goto LA98_;
		colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
		colontmpD_ = cstrToNimstr((*data_p0).workingDir);
		setCurrentDir__stdZprivateZosdirs_u506(colontmpD_);
		if (NIM_UNLIKELY(*nimErr_)) goto LA100_;
		{
			LA100_:;
		}
		{
			if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD_.p);
}
		}
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA98_: ;
	pid_1 = (pid_t)0;
	{
		if (!(((*data_p0).options &((NU8)1<<((NU)((((tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg)1)))&7U)))!=0)) goto LA105_;
		res_1 = posix_spawnp((&pid_1), nimToCStringConv((*data_p0).sysCommand), (&fops_1), (&attr_1), (*data_p0).sysArgs, (*data_p0).sysEnv);
	}
	goto LA103_;
LA105_: ;
	{
		res_1 = posix_spawn((&pid_1), nimToCStringConv((*data_p0).sysCommand), (&fops_1), (&attr_1), (*data_p0).sysArgs, (*data_p0).sysEnv);
	}
LA103_: ;
	T108_ = (int)0;
	T108_ = posix_spawn_file_actions_destroy((&fops_1));
	(void)(T108_);
	T109_ = (int)0;
	T109_ = posix_spawnattr_destroy((&attr_1));
	(void)(T109_);
	{
		if (!!((res_1 == ((NI32)0)))) goto LA112_;
		raiseOSError__stdZoserrors_u119(((NI32) (res_1)), (*data_p0).sysCommand);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA112_: ;
	result = pid_1;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_u894)(tyObject_StartProcessData__EQm3cPFtDimvFtpqhaDR1g* dest_p0) {
	if ((*dest_p0).sysCommand.p && !((*dest_p0).sysCommand.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared((*dest_p0).sysCommand.p);
}
}
N_LIB_PRIVATE N_NIMCALL(tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w*, nospstartProcess)(NimStringV2 command_p0, NimStringV2 workingDir_p1, NimStringV2* args_p2, NI args_p2Len_0, tyObject_StringTableObj__aB8otkyeeuZW5rawDMqajg* env_p3, tySet_tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg options_p4) {
	tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w* result;
	tyObject_StartProcessData__EQm3cPFtDimvFtpqhaDR1g data_1;
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ sysArgsRaw_1;
	tyArray__Zwjt9bECqO23Zah8rGoMkoQ pStdin_1;
	tyArray__Zwjt9bECqO23Zah8rGoMkoQ pStdout_1;
	tyArray__Zwjt9bECqO23Zah8rGoMkoQ pStderr_1;
	pid_t pid_1;
	NCSTRING* sysArgs_1;
	NCSTRING* colontmpD__4;
	NCSTRING* colontmpD__5;
	NCSTRING* sysEnv_1;
	NimStringV2 currentDir_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = NIM_NIL;
	nimZeroMem((void*)(&data_1), sizeof(tyObject_StartProcessData__EQm3cPFtDimvFtpqhaDR1g));
	sysArgsRaw_1.len = 0; sysArgsRaw_1.p = NIM_NIL;
	nimZeroMem((void*)pStdin_1, sizeof(tyArray__Zwjt9bECqO23Zah8rGoMkoQ));
	nimZeroMem((void*)pStdin_1, sizeof(tyArray__Zwjt9bECqO23Zah8rGoMkoQ));
	nimZeroMem((void*)pStdout_1, sizeof(tyArray__Zwjt9bECqO23Zah8rGoMkoQ));
	nimZeroMem((void*)pStdout_1, sizeof(tyArray__Zwjt9bECqO23Zah8rGoMkoQ));
	nimZeroMem((void*)pStderr_1, sizeof(tyArray__Zwjt9bECqO23Zah8rGoMkoQ));
	nimZeroMem((void*)pStderr_1, sizeof(tyArray__Zwjt9bECqO23Zah8rGoMkoQ));
	eqdestroy___pureZosproc_u228(result);
	result = (tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w*) nimNewObj(sizeof(tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w), NIM_ALIGNOF(tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w));
	(*result).Sup.m_type = (&NTIv2__plQvvouhzGGVIaG8Gzyi1w_);
	(*result).options = options_p4;
	(*result).exitFlag = NIM_TRUE;
	{
		if (!!(((options_p4 &((NU8)1<<((NU)((((tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg)4)))&7U)))!=0))) goto LA4_;
		{
			NIM_BOOL T8_;
			NIM_BOOL T9_;
			int T10_;
			int T12_;
			int T14_;
			NI32 T17_;
			T8_ = (NIM_BOOL)0;
			T9_ = (NIM_BOOL)0;
			T10_ = (int)0;
			T10_ = pipe(pStdin_1);
			T9_ = !((T10_ == ((NI32)0)));
			if (T9_) goto LA11_;
			T12_ = (int)0;
			T12_ = pipe(pStdout_1);
			T9_ = !((T12_ == ((NI32)0)));
LA11_: ;
			T8_ = T9_;
			if (T8_) goto LA13_;
			T14_ = (int)0;
			T14_ = pipe(pStderr_1);
			T8_ = !((T14_ == ((NI32)0)));
LA13_: ;
			if (!T8_) goto LA15_;
			T17_ = (NI32)0;
			T17_ = osLastError__stdZoserrors_u122();
			if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
			raiseOSError__stdZoserrors_u119(T17_, TM__HZdw8BhppcTQo8DIK46LSg_4);
			if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
		}
LA15_: ;
	}
LA4_: ;
	nimZeroMem((void*)(&data_1), sizeof(tyObject_StartProcessData__EQm3cPFtDimvFtpqhaDR1g));
	{
		NimStringV2 colontmpD_;
		if (!((options_p4 &((NU8)1<<((NU)((((tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg)2)))&7U)))!=0)) goto LA20_;
		eqsink___system_u2760((&data_1.sysCommand), TM__HZdw8BhppcTQo8DIK46LSg_6);
		sysArgsRaw_1.len = 3; sysArgsRaw_1.p = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content*) newSeqPayload(3, sizeof(NimStringV2), NIM_ALIGNOF(NimStringV2));
		sysArgsRaw_1.p->data[0] = TM__HZdw8BhppcTQo8DIK46LSg_7;
		sysArgsRaw_1.p->data[1] = TM__HZdw8BhppcTQo8DIK46LSg_9;
		colontmpD_ = eqdup___system_u2757(command_p0);
		sysArgsRaw_1.p->data[2] = colontmpD_;
		{
			if (!!((args_p2Len_0 == ((NI)0)))) goto LA24_;
			failedAssertImpl__stdZassertions_u95(TM__HZdw8BhppcTQo8DIK46LSg_11);
			if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
		}
LA24_: ;
	}
	goto LA18_;
LA20_: ;
	{
		NimStringV2 colontmpD__2;
		eqcopy___system_u2754((&data_1.sysCommand), command_p0);
		sysArgsRaw_1.len = 1; sysArgsRaw_1.p = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content*) newSeqPayload(1, sizeof(NimStringV2), NIM_ALIGNOF(NimStringV2));
		colontmpD__2 = eqdup___system_u2757(command_p0);
		sysArgsRaw_1.p->data[0] = colontmpD__2;
		{
			NimStringV2* arg_1;
			NI i_1;
			arg_1 = (NimStringV2*)0;
			i_1 = ((NI)0);
			{
				while (1) {
					NimStringV2 colontmpD__3;
					if (!(i_1 < args_p2Len_0)) goto LA29;
					if (i_1 < 0 || i_1 >= args_p2Len_0){ raiseIndexError2(i_1,args_p2Len_0-1); goto LA1_;
					}
					arg_1 = (&args_p2[i_1]);
					colontmpD__3 = eqdup___system_u2757((*arg_1));
					add__stdZenumutils_u70((&sysArgsRaw_1), colontmpD__3);
					i_1 += ((NI)1);
				} LA29: ;
			}
		}
	}
LA18_: ;
	pid_1 = (pid_t)0;
	sysArgs_1 = allocCStringArray__system_u5673(((sysArgsRaw_1).p) ? (sysArgsRaw_1.p->data) : NIM_NIL, sysArgsRaw_1.len);
	colontmpD__4 = (NCSTRING*)0;
	colontmpD__5 = (NCSTRING*)0;
	{
		if (!(env_p3 == ((tyObject_StringTableObj__aB8otkyeeuZW5rawDMqajg*) NIM_NIL))) goto LA33_;
		colontmpD__4 = envToCStringArray__pureZosproc_u756();
		if (NIM_UNLIKELY(*nimErr_)) goto LA30_;
		sysEnv_1 = colontmpD__4;
	}
	goto LA31_;
LA33_: ;
	{
		colontmpD__5 = envToCStringArray__pureZosproc_u744(env_p3);
		if (NIM_UNLIKELY(*nimErr_)) goto LA30_;
		sysEnv_1 = colontmpD__5;
	}
LA31_: ;
	currentDir_1.len = 0; currentDir_1.p = NIM_NIL;
	data_1.sysArgs = sysArgs_1;
	data_1.sysEnv = sysEnv_1;
	nimCopyMem((void*)data_1.pStdin, (NIM_CONST void*)pStdin_1, sizeof(tyArray__Zwjt9bECqO23Zah8rGoMkoQ));
	nimCopyMem((void*)data_1.pStdout, (NIM_CONST void*)pStdout_1, sizeof(tyArray__Zwjt9bECqO23Zah8rGoMkoQ));
	nimCopyMem((void*)data_1.pStderr, (NIM_CONST void*)pStderr_1, sizeof(tyArray__Zwjt9bECqO23Zah8rGoMkoQ));
	data_1.workingDir = nimToCStringConv(workingDir_p1);
	data_1.options = options_p4;
	currentDir_1 = nosgetCurrentDir();
	if (NIM_UNLIKELY(*nimErr_)) goto LA37_;
	pid_1 = startProcessAuxSpawn__pureZosproc_u786((&data_1));
	if (NIM_UNLIKELY(*nimErr_)) goto LA37_;
	{
		if (!(((NI)0) < workingDir_p1.len)) goto LA40_;
		setCurrentDir__stdZprivateZosdirs_u506(currentDir_1);
		if (NIM_UNLIKELY(*nimErr_)) goto LA37_;
	}
LA40_: ;
	{
		NimStringV2 colontmpD__6;
		tyArray__dyW7vpmfeTYw8kX3EXuaJA T47_;
		if (!((options_p4 &((NU8)1<<((NU)((((tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg)0)))&7U)))!=0)) goto LA44_;
		colontmpD__6.len = 0; colontmpD__6.p = NIM_NIL;
		T47_[0] = command_p0;
		T47_[1] = TM__HZdw8BhppcTQo8DIK46LSg_50;
		colontmpD__6 = nsuJoinSep(args_p2, args_p2Len_0, TM__HZdw8BhppcTQo8DIK46LSg_51);
		if (NIM_UNLIKELY(*nimErr_)) goto LA46_;
		T47_[2] = colontmpD__6;
		echoBinSafe(T47_, 3);
		{
			LA46_:;
		}
		{
			if (colontmpD__6.p && !(colontmpD__6.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD__6.p);
}
		}
		if (NIM_UNLIKELY(*nimErr_)) goto LA37_;
	}
LA44_: ;
	(*result).id = pid_1;
	(*result).exitFlag = NIM_FALSE;
	{
		if (!((options_p4 &((NU8)1<<((NU)((((tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg)4)))&7U)))!=0)) goto LA52_;
		(*result).inHandle = ((int)0);
		(*result).outHandle = ((int)1);
		{
			if (!((options_p4 &((NU8)1<<((NU)((((tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg)3)))&7U)))!=0)) goto LA56_;
			(*result).errHandle = (*result).outHandle;
		}
		goto LA54_;
LA56_: ;
		{
			(*result).errHandle = ((int)2);
		}
LA54_: ;
	}
	goto LA50_;
LA52_: ;
	{
		int T66_;
		int T67_;
		int T68_;
		(*result).inHandle = pStdin_1[(((NI)1))- 0];
		(*result).outHandle = pStdout_1[(((NI)0))- 0];
		{
			int T64_;
			if (!((options_p4 &((NU8)1<<((NU)((((tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg)3)))&7U)))!=0)) goto LA62_;
			(*result).errHandle = (*result).outHandle;
			T64_ = (int)0;
			T64_ = close(pStderr_1[(((NI)0))- 0]);
			(void)(T64_);
		}
		goto LA60_;
LA62_: ;
		{
			(*result).errHandle = pStderr_1[(((NI)0))- 0];
		}
LA60_: ;
		T66_ = (int)0;
		T66_ = close(pStderr_1[(((NI)1))- 0]);
		(void)(T66_);
		T67_ = (int)0;
		T67_ = close(pStdin_1[(((NI)0))- 0]);
		(void)(T67_);
		T68_ = (int)0;
		T68_ = close(pStdout_1[(((NI)1))- 0]);
		(void)(T68_);
	}
LA50_: ;
	{
		LA37_:;
	}
	{
		if (currentDir_1.p && !(currentDir_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(currentDir_1.p);
}
	}
	if (NIM_UNLIKELY(*nimErr_)) goto LA36_;
	{
		LA36_:;
	}
	{
		deallocCStringArray__system_u5727(sysEnv_1);
	}
	if (NIM_UNLIKELY(*nimErr_)) goto LA30_;
	{
		LA30_:;
	}
	{
		deallocCStringArray__system_u5727(sysArgs_1);
	}
	if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	{
		LA1_:;
	}
	{
		eqdestroy___system_u5582(sysArgsRaw_1);
		eqdestroy___pureZosproc_u894((&data_1));
	}
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_FileStreamObj__55YZdAmhEXf1sGHQMYxWjw*, createStream__pureZosproc_u1143)(int* handle_p0, tyEnum_FileMode__wjF0STQGT1PBuQEl3p0tng fileMode_p1) {
	tyObject_FileStreamObj__55YZdAmhEXf1sGHQMYxWjw* result;
	FILE* f_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = NIM_NIL;
	f_1 = 0;
	{
		NIM_BOOL T3_;
		NI32 T6_;
		T3_ = (NIM_BOOL)0;
		T3_ = open__stdZsyncio_u482(&f_1, (*handle_p0), fileMode_p1);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (!!(T3_)) goto LA4_;
		T6_ = (NI32)0;
		T6_ = osLastError__stdZoserrors_u122();
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		raiseOSError__stdZoserrors_u119(T6_, TM__HZdw8BhppcTQo8DIK46LSg_54);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA4_: ;
	result = newFileStream__pureZstreams_u1185(f_1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ*, nospoutputStream)(tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w* p_p0) {
	tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = NIM_NIL;
	{
		if (!!(!((((*p_p0).options &((NU8)1<<((NU)((((tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg)4)))&7U)))!=0)))) goto LA3_;
		failedAssertImpl__stdZassertions_u95(TM__HZdw8BhppcTQo8DIK46LSg_53);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA3_: ;
	{
		tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ** T9_;
		tyObject_FileStreamObj__55YZdAmhEXf1sGHQMYxWjw* T10_;
		if (!((*p_p0).outStream == ((tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ*) NIM_NIL))) goto LA7_;
		T9_ = (tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ**)0;
		T9_ = &(*p_p0).outStream;
		T10_ = NIM_NIL;
		T10_ = createStream__pureZosproc_u1143((&(*p_p0).outHandle), ((tyEnum_FileMode__wjF0STQGT1PBuQEl3p0tng)0));
		if (NIM_UNLIKELY(*nimErr_)) {eqdestroy___pureZstreams_u1093(T10_); goto BeforeRet_;}
		eqsink___pureZstreams_u797(T9_, &T10_->Sup);
	}
LA7_: ;
	eqcopy___pureZstreams_u789(&result, (*p_p0).outStream, NIM_FALSE);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ*, nospinputStream)(tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w* p_p0) {
	tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = NIM_NIL;
	{
		if (!!(!((((*p_p0).options &((NU8)1<<((NU)((((tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg)4)))&7U)))!=0)))) goto LA3_;
		failedAssertImpl__stdZassertions_u95(TM__HZdw8BhppcTQo8DIK46LSg_56);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA3_: ;
	{
		tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ** T9_;
		tyObject_FileStreamObj__55YZdAmhEXf1sGHQMYxWjw* T10_;
		if (!((*p_p0).inStream == ((tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ*) NIM_NIL))) goto LA7_;
		T9_ = (tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ**)0;
		T9_ = &(*p_p0).inStream;
		T10_ = NIM_NIL;
		T10_ = createStream__pureZosproc_u1143((&(*p_p0).inHandle), ((tyEnum_FileMode__wjF0STQGT1PBuQEl3p0tng)1));
		if (NIM_UNLIKELY(*nimErr_)) {eqdestroy___pureZstreams_u1093(T10_); goto BeforeRet_;}
		eqsink___pureZstreams_u797(T9_, &T10_->Sup);
	}
LA7_: ;
	eqcopy___pureZstreams_u789(&result, (*p_p0).inStream, NIM_FALSE);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, isExitStatus__pureZosproc_u741)(int status_p0) {
	NIM_BOOL result;
	NIM_BOOL T1_;
	T1_ = (NIM_BOOL)0;
	T1_ = WIFEXITED(status_p0);
	if (T1_) goto LA2_;
	T1_ = WIFSIGNALED(status_p0);
LA2_: ;
	result = T1_;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, nosppeekExitCode)(tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w* p_p0) {
	NI result;
	int status_1;
	pid_t ret_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	status_1 = ((int)0);
	result = ((NI)-1);
	{
		int T5_;
		if (!(*p_p0).exitFlag) goto LA3_;
		T5_ = (int)0;
		T5_ = exitStatusLikeShell__pureZos_u180((*p_p0).exitStatus);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		result = ((NI) (T5_));
		goto BeforeRet_;
	}
LA3_: ;
	ret_1 = waitpid((*p_p0).id, (&status_1), WNOHANG);
	{
		if (!(((NI32)0) < ret_1)) goto LA8_;
		{
			NIM_BOOL T12_;
			int T15_;
			T12_ = (NIM_BOOL)0;
			T12_ = isExitStatus__pureZosproc_u741(status_1);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			if (!T12_) goto LA13_;
			(*p_p0).exitFlag = NIM_TRUE;
			(*p_p0).exitStatus = status_1;
			T15_ = (int)0;
			T15_ = exitStatusLikeShell__pureZos_u180(status_1);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			result = ((NI) (T15_));
		}
LA13_: ;
	}
LA8_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, nospclose)(tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w* p_p0) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	{
		if (!!((((*p_p0).options &((NU8)1<<((NU)((((tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg)4)))&7U)))!=0))) goto LA3_;
		{
			if (!!(((*p_p0).inStream == ((tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ*) NIM_NIL)))) goto LA7_;
			close__pureZstreams_u57((*p_p0).inStream);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		}
		goto LA5_;
LA7_: ;
		{
			int T10_;
			T10_ = (int)0;
			T10_ = close((*p_p0).inHandle);
			(void)(T10_);
		}
LA5_: ;
		{
			if (!!(((*p_p0).outStream == ((tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ*) NIM_NIL)))) goto LA13_;
			close__pureZstreams_u57((*p_p0).outStream);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		}
		goto LA11_;
LA13_: ;
		{
			int T16_;
			T16_ = (int)0;
			T16_ = close((*p_p0).outHandle);
			(void)(T16_);
		}
LA11_: ;
		{
			if (!!(((*p_p0).errStream == ((tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ*) NIM_NIL)))) goto LA19_;
			close__pureZstreams_u57((*p_p0).errStream);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		}
		goto LA17_;
LA19_: ;
		{
			int T22_;
			T22_ = (int)0;
			T22_ = close((*p_p0).errHandle);
			(void)(T22_);
		}
LA17_: ;
	}
LA3_: ;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(tyTuple__XOVT24GHXwqiEj5GCsEGCA, execCmdEx__pureZosproc_u2044)(NimStringV2 command_p0, tySet_tyEnum_ProcessOption__m5rj7fxDbuVx8PVIV9af9aLg options_p1, tyObject_StringTableObj__aB8otkyeeuZW5rawDMqajg* env_p2, NimStringV2 workingDir_p3, NimStringV2 input_p4) {
	tyTuple__XOVT24GHXwqiEj5GCsEGCA result;
	tyObject_ProcessObj__plQvvouhzGGVIaG8Gzyi1w* p_1;
	tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* outp_1;
	tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* colontmpD_;
	NimStringV2 colontmp_;
	NimStringV2 line_1;
	tyArray__TonP9cxJgj8gXu71dWIyNlA T2_;
	NI colontmp__2;
	NimStringV2 blitTmp_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimZeroMem((void*)(&result), sizeof(tyTuple__XOVT24GHXwqiEj5GCsEGCA));
	p_1 = NIM_NIL;
	outp_1 = NIM_NIL;
	colontmpD_ = NIM_NIL;
	colontmp_.len = 0; colontmp_.p = NIM_NIL;
	line_1.len = 0; line_1.p = NIM_NIL;
	p_1 = nospstartProcess(command_p0, workingDir_p3, T2_, 0, env_p2, (options_p1 | 4));
	if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	outp_1 = nospoutputStream(p_1);
	if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	{
		tyObject_StreamObj__bsqueMN9aCOGm2aNaHkuxoQ* colontmpD__2;
		if (!(((NI)0) < input_p4.len)) goto LA5_;
		colontmpD__2 = NIM_NIL;
		colontmpD__2 = nospinputStream(p_1);
		if (NIM_UNLIKELY(*nimErr_)) goto LA7_;
		write__pureZstreams_u221(colontmpD__2, input_p4);
		if (NIM_UNLIKELY(*nimErr_)) goto LA7_;
		{
			LA7_:;
		}
		{
			eqdestroy___pureZstreams_u786(colontmpD__2);
		}
		if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	}
LA5_: ;
	colontmpD_ = nospinputStream(p_1);
	if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	close__pureZstreams_u57(colontmpD_);
	if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	colontmp_ = TM__HZdw8BhppcTQo8DIK46LSg_57;
	colontmp__2 = ((NI)-1);
	blitTmp_1 = colontmp_;
	eqwasMoved___system_u2751((&colontmp_));
	result.Field0 = blitTmp_1;
	result.Field1 = colontmp__2;
	line_1 = rawNewString(((NI)120));
	{
		while (1) {
			{
				NIM_BOOL T14_;
				T14_ = (NIM_BOOL)0;
				T14_ = readLine__pureZstreams_u668(outp_1, (&line_1));
				if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
				if (!T14_) goto LA15_;
				prepareAdd((&result.Field0), line_1.len + 0);
appendString((&result.Field0), line_1);
				prepareAdd((&result.Field0), 1);
appendString((&result.Field0), TM__HZdw8BhppcTQo8DIK46LSg_59);
			}
			goto LA12_;
LA15_: ;
			{
				NI T18_;
				T18_ = (NI)0;
				T18_ = nosppeekExitCode(p_1);
				if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
				result.Field1 = T18_;
				{
					if (!!((result.Field1 == ((NI)-1)))) goto LA21_;
					goto LA10;
				}
LA21_: ;
			}
LA12_: ;
		}
	} LA10: ;
	nospclose(p_1);
	if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	{
		LA1_:;
	}
	{
		if (line_1.p && !(line_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(line_1.p);
}
		if (colontmp_.p && !(colontmp_.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmp_.p);
}
		eqdestroy___pureZstreams_u786(colontmpD_);
		eqdestroy___pureZstreams_u786(outp_1);
		eqdestroy___pureZosproc_u228(p_1);
	}
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_u2088)(tyTuple__XOVT24GHXwqiEj5GCsEGCA* dest_p0) {
	if ((*dest_p0).Field0.p && !((*dest_p0).Field0.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared((*dest_p0).Field0.p);
}
}
