/* Generated by Nim Compiler v0.19.4 */
/*   (c) 2018 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_NEW_MANGLING_RULES
#define NIM_INTBITS 32

#include "nimbase.h"
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <setjmp.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/wait.h>
#include <sys/event.h>
#include <sys/types.h>
                       #include <sys/event.h>
                       #include <sys/time.h>
#include <time.h>
#include <signal.h>
#include <stdlib.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 tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyObject_StringTableObj_V5PVrt9bIxZEeV7lfvqqtNg tyObject_StringTableObj_V5PVrt9bIxZEeV7lfvqqtNg;
typedef struct RootObj RootObj;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ;
typedef struct tySequence_sM4lkSb7zS6F7OVMvW9cffQ tySequence_sM4lkSb7zS6F7OVMvW9cffQ;
typedef struct tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g;
typedef struct tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w;
typedef struct tyObject_GcHeap_1TRH1TZMaVZTnLNcIHuNFQ tyObject_GcHeap_1TRH1TZMaVZTnLNcIHuNFQ;
typedef struct tyObject_GcStack_7fytPA5bBsob6See21YMRA tyObject_GcStack_7fytPA5bBsob6See21YMRA;
typedef struct tyObject_MemRegion_x81NhDv59b8ercDZ9bi85jyg tyObject_MemRegion_x81NhDv59b8ercDZ9bi85jyg;
typedef struct tyObject_SmallChunk_tXn60W2f8h3jgAYdEmy5NQ tyObject_SmallChunk_tXn60W2f8h3jgAYdEmy5NQ;
typedef struct tyObject_BigChunk_Rv9c70Uhp2TytkX7eH78qEg tyObject_BigChunk_Rv9c70Uhp2TytkX7eH78qEg;
typedef struct tyObject_LLChunk_XsENErzHIZV9bhvyJx56wGw tyObject_LLChunk_XsENErzHIZV9bhvyJx56wGw;
typedef struct tyObject_IntSet_EZObFrE3NC9bIb3YMkY9crZA tyObject_IntSet_EZObFrE3NC9bIb3YMkY9crZA;
typedef struct tyObject_Trunk_W0r8S0Y3UGke6T9bIUWnnuw tyObject_Trunk_W0r8S0Y3UGke6T9bIUWnnuw;
typedef struct tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw;
typedef struct tyObject_HeapLinks_PDV1HBZ8CQSQJC9aOBFNRSg tyObject_HeapLinks_PDV1HBZ8CQSQJC9aOBFNRSg;
typedef struct tyTuple_ujsjpB2O9cjj3uDHsXbnSzg tyTuple_ujsjpB2O9cjj3uDHsXbnSzg;
typedef struct tyObject_GcStat_0RwLoVBHZPfUAcLczmfQAg tyObject_GcStat_0RwLoVBHZPfUAcLczmfQAg;
typedef struct tyObject_CellSet_jG87P0AI9aZtss9ccTYBIISQ tyObject_CellSet_jG87P0AI9aZtss9ccTYBIISQ;
typedef struct tyObject_PageDesc_fublkgIY4LG3mT51LU2WHg tyObject_PageDesc_fublkgIY4LG3mT51LU2WHg;
typedef struct Exception Exception;
typedef struct tySequence_uB9b75OUPRENsBAu4AnoePA tySequence_uB9b75OUPRENsBAu4AnoePA;
typedef struct TSafePoint TSafePoint;
typedef struct tySequence_xv3aaFd3JCw8NbmALHiezQ tySequence_xv3aaFd3JCw8NbmALHiezQ;
typedef struct tyTuple_sPaDkVPSC0MkcoXCxPH9ccA tyTuple_sPaDkVPSC0MkcoXCxPH9ccA;
typedef struct tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA;
typedef struct tyObject_FileStreamObj_9bEVSsOIpkY9cf5lCtaS39bPQ tyObject_FileStreamObj_9bEVSsOIpkY9cf5lCtaS39bPQ;
typedef struct tySequence_PrBYolTs4TOSgE8v5oqDUQ tySequence_PrBYolTs4TOSgE8v5oqDUQ;
typedef struct tySequence_qwqHTkRvwhrRyENtudHQ7g tySequence_qwqHTkRvwhrRyENtudHQ7g;
typedef struct tyObject_StackTraceEntry_oLyohQ7O2XOvGnflOss8EA tyObject_StackTraceEntry_oLyohQ7O2XOvGnflOss8EA;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef NU8 tySet_tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA;
typedef int tyArray_SKEqGXcReU4NvbQlH779b5Q[2];
typedef NU8 tyEnum_TNimKind_jIBKr1ejBgsfM33Kxw4j7A;
typedef NU8 tySet_tyEnum_TNimTypeFlag_v8QUszD1sWlSIWZz7mC4bQ;
typedef N_NIMCALL_PTR(void, tyProc_ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, tyProc_WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
struct TNimType {
NI size;
tyEnum_TNimKind_jIBKr1ejBgsfM33Kxw4j7A kind;
tySet_tyEnum_TNimTypeFlag_v8QUszD1sWlSIWZz7mC4bQ flags;
TNimType* base;
TNimNode* node;
void* finalizer;
tyProc_ojoeKfW4VYIm36I9cpDTQIg marker;
tyProc_WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
struct RootObj {
TNimType* m_type;
};
struct tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg {
  RootObj Sup;
int inHandle;
int outHandle;
int errHandle;
tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* inStream;
tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* outStream;
tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* errStream;
pid_t id;
int exitStatus;
NIM_BOOL exitFlag;
tySet_tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA options;
};
typedef NU8 tyEnum_TNimNodeKind_unfNsxrcATrufDZmpBq4HQ;
struct TNimNode {
tyEnum_TNimNodeKind_unfNsxrcATrufDZmpBq4HQ kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
typedef NU8 tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA;
struct tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g {
NI refcount;
TNimType* typ;
};
struct tyObject_GcStack_7fytPA5bBsob6See21YMRA {
void* bottom;
};
struct tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w {
NI len;
NI cap;
tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g** d;
};
typedef tyObject_SmallChunk_tXn60W2f8h3jgAYdEmy5NQ* tyArray_SiRwrEKZdLgxqz9a9aoVBglg[512];
typedef NU32 tyArray_BHbOSqU1t9b3Gt7K2c6fQig[24];
typedef tyObject_BigChunk_Rv9c70Uhp2TytkX7eH78qEg* tyArray_N1u1nqOgmuJN9cSZrnMHgOQ[32];
typedef tyArray_N1u1nqOgmuJN9cSZrnMHgOQ tyArray_B6durA4ZCi1xjJvRtyYxMg[24];
typedef tyObject_Trunk_W0r8S0Y3UGke6T9bIUWnnuw* tyArray_lh2A89ahMmYg9bCmpVaplLbA[256];
struct tyObject_IntSet_EZObFrE3NC9bIb3YMkY9crZA {
tyArray_lh2A89ahMmYg9bCmpVaplLbA data;
};
typedef tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw* tyArray_0aOLqZchNi8nWtMTi8ND8w[2];
struct tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw {
tyArray_0aOLqZchNi8nWtMTi8ND8w link;
NI key;
NI upperBound;
NI level;
};
struct tyTuple_ujsjpB2O9cjj3uDHsXbnSzg {
tyObject_BigChunk_Rv9c70Uhp2TytkX7eH78qEg* Field0;
NI Field1;
};
typedef tyTuple_ujsjpB2O9cjj3uDHsXbnSzg tyArray_LzOv2eCDGiceMKQstCLmhw[30];
struct tyObject_HeapLinks_PDV1HBZ8CQSQJC9aOBFNRSg {
NI len;
tyArray_LzOv2eCDGiceMKQstCLmhw chunks;
tyObject_HeapLinks_PDV1HBZ8CQSQJC9aOBFNRSg* next;
};
struct tyObject_MemRegion_x81NhDv59b8ercDZ9bi85jyg {
NI minLargeObj;
NI maxLargeObj;
tyArray_SiRwrEKZdLgxqz9a9aoVBglg freeSmallChunks;
NU32 flBitmap;
tyArray_BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
tyArray_B6durA4ZCi1xjJvRtyYxMg matrix;
tyObject_LLChunk_XsENErzHIZV9bhvyJx56wGw* llmem;
NI currMem;
NI maxMem;
NI freeMem;
NI occ;
NI lastSize;
tyObject_IntSet_EZObFrE3NC9bIb3YMkY9crZA chunkStarts;
tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw* root;
tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw* deleted;
tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw* last;
tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw* freeAvlNodes;
NIM_BOOL locked;
NIM_BOOL blockChunkSizeIncrease;
NI nextChunkSize;
tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw bottomData;
tyObject_HeapLinks_PDV1HBZ8CQSQJC9aOBFNRSg heapLinks;
};
struct tyObject_GcStat_0RwLoVBHZPfUAcLczmfQAg {
NI stackScans;
NI cycleCollections;
NI maxThreshold;
NI maxStackSize;
NI maxStackCells;
NI cycleTableSize;
NI64 maxPause;
};
struct tyObject_CellSet_jG87P0AI9aZtss9ccTYBIISQ {
NI counter;
NI max;
tyObject_PageDesc_fublkgIY4LG3mT51LU2WHg* head;
tyObject_PageDesc_fublkgIY4LG3mT51LU2WHg** data;
};
struct tyObject_GcHeap_1TRH1TZMaVZTnLNcIHuNFQ {
tyObject_GcStack_7fytPA5bBsob6See21YMRA stack;
NI cycleThreshold;
NI zctThreshold;
tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w zct;
tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w decStack;
tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w tempStack;
NI recGcLock;
tyObject_MemRegion_x81NhDv59b8ercDZ9bi85jyg region;
tyObject_GcStat_0RwLoVBHZPfUAcLczmfQAg stat;
tyObject_CellSet_jG87P0AI9aZtss9ccTYBIISQ marked;
tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w additionalRoots;
NI gcThreadId;
};
struct Exception {
  RootObj Sup;
Exception* parent;
NCSTRING name;
NimStringDesc* message;
tySequence_uB9b75OUPRENsBAu4AnoePA* trace;
NU raise_id;
Exception* up;
};
typedef struct {
N_NIMCALL_PTR(NIM_BOOL, ClP_0) (Exception* e, void* ClE_0);
void* ClE_0;
} tyProc_NT9bSe2DDkjdtx7j9aov2Z6g;
struct TSafePoint {
TSafePoint* prev;
NI status;
jmp_buf context;
NIM_BOOL hasRaiseAction;
tyProc_NT9bSe2DDkjdtx7j9aov2Z6g raiseAction;
};
typedef NCSTRING tyArray_z9ac6Ez5VSEHe9bC2NMwuc7Q[1];
typedef NU8 tyEnum_StringTableMode_G9c4wVDFIzf0xHmQvxso9a9cQ;
struct tyObject_StringTableObj_V5PVrt9bIxZEeV7lfvqqtNg {
  RootObj Sup;
NI counter;
tySequence_xv3aaFd3JCw8NbmALHiezQ* data;
tyEnum_StringTableMode_G9c4wVDFIzf0xHmQvxso9a9cQ mode;
};
struct tyTuple_sPaDkVPSC0MkcoXCxPH9ccA {
NimStringDesc* Field0;
NimStringDesc* Field1;
NIM_BOOL Field2;
};
struct tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA {
NimStringDesc* sysCommand;
NCSTRING* sysArgs;
NCSTRING* sysEnv;
NCSTRING workingDir;
tyArray_SKEqGXcReU4NvbQlH779b5Q pStdin;
tyArray_SKEqGXcReU4NvbQlH779b5Q pStdout;
tyArray_SKEqGXcReU4NvbQlH779b5Q pStderr;
tyArray_SKEqGXcReU4NvbQlH779b5Q pErrorPipe;
tySet_tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA options;
};
typedef NimStringDesc* tyArray_Re75IspeoxXy2oCZHwcRrA[2];
typedef NimStringDesc* tyArray_24KAM9afIUgUaqBaEBB6r9bg[3];
typedef NU8 tyEnum_FileMode_fVUBHvW79bXUw1j55Oo9avSQ;
typedef N_NIMCALL_PTR(void, tyProc_JQrsH08b4uPTH9cyFPlVOZg) (tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* s);
typedef N_NIMCALL_PTR(NIM_BOOL, tyProc_9bmhFrLahRsL2hltfRDVtlQ) (tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* s);
typedef N_NIMCALL_PTR(void, tyProc_3svSoGIUJIsHkaBL7q4DAQ) (tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* s, NI pos);
typedef N_NIMCALL_PTR(NI, tyProc_xflqkf2D1uVClg70czEDHA) (tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* s);
typedef N_NIMCALL_PTR(NI, tyProc_2VVzVL9bOnKhj1eZKkf9cEuA) (tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen);
typedef N_NIMCALL_PTR(void, tyProc_ki6p1QyfOkJLQJ9aw5NI0AQ) (tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen);
struct tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ {
  RootObj Sup;
tyProc_JQrsH08b4uPTH9cyFPlVOZg closeImpl;
tyProc_9bmhFrLahRsL2hltfRDVtlQ atEndImpl;
tyProc_3svSoGIUJIsHkaBL7q4DAQ setPositionImpl;
tyProc_xflqkf2D1uVClg70czEDHA getPositionImpl;
tyProc_2VVzVL9bOnKhj1eZKkf9cEuA readDataImpl;
tyProc_2VVzVL9bOnKhj1eZKkf9cEuA peekDataImpl;
tyProc_ki6p1QyfOkJLQJ9aw5NI0AQ writeDataImpl;
tyProc_JQrsH08b4uPTH9cyFPlVOZg flushImpl;
};
struct tyObject_FileStreamObj_9bEVSsOIpkY9cf5lCtaS39bPQ {
  tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ Sup;
FILE* f;
};
typedef struct {
N_NIMCALL_PTR(void, ClP_0) (NI idx, void* ClE_0);
void* ClE_0;
} tyProc_kElEuvYkhDcTHhB3d89aMYA;
typedef struct {
N_NIMCALL_PTR(void, ClP_0) (NI idx, tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p, void* ClE_0);
void* ClE_0;
} tyProc_FM4RO2zoXex9caTkjWpBmsw;
typedef N_CLOSURE_PTR(void, TM_HZdw8BhppcTQo8DIK46LSg_17) (NI idx);
typedef NimStringDesc* tyArray_8ZvwQIddfpj2THRVPsFzIQ[1];
typedef N_CLOSURE_PTR(void, TM_HZdw8BhppcTQo8DIK46LSg_19) (NI idx, tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p);
typedef N_CLOSURE_PTR(void, TM_HZdw8BhppcTQo8DIK46LSg_20) (NI idx);
typedef N_CLOSURE_PTR(void, TM_HZdw8BhppcTQo8DIK46LSg_21) (NI idx);
typedef N_CLOSURE_PTR(void, TM_HZdw8BhppcTQo8DIK46LSg_22) (NI idx, tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p);
struct tyObject_StackTraceEntry_oLyohQ7O2XOvGnflOss8EA {
NCSTRING procname;
NI line;
NCSTRING filename;
};
struct tySequence_sM4lkSb7zS6F7OVMvW9cffQ {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct tySequence_PrBYolTs4TOSgE8v5oqDUQ {
  TGenericSeq Sup;
  tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* data[SEQ_DECL_SIZE];
};
struct tySequence_qwqHTkRvwhrRyENtudHQ7g {
  TGenericSeq Sup;
  NI data[SEQ_DECL_SIZE];
};
struct tySequence_uB9b75OUPRENsBAu4AnoePA {
  TGenericSeq Sup;
  tyObject_StackTraceEntry_oLyohQ7O2XOvGnflOss8EA data[SEQ_DECL_SIZE];
};
struct tySequence_xv3aaFd3JCw8NbmALHiezQ {
  TGenericSeq Sup;
  tyTuple_sPaDkVPSC0MkcoXCxPH9ccA data[SEQ_DECL_SIZE];
};
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem_2Mfumf6CnyNlShDWdIgobwsystem)(void* a, int v, NI size);
N_NIMCALL(void, nimGCvisit)(void* d, NI op);
static N_NIMCALL(void, Marker_tyRef_lw7iqc9cC7bi1oOZOAlJkJA)(void* p, NI op);
N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
N_LIB_PRIVATE N_NOINLINE(void, raiseOSError_bEwAamo1N7TKcaU9akpiyIg)(NI32 errorCode, NimStringDesc* additionalInfo);
N_LIB_PRIVATE N_NIMCALL(NI32, osLastError_tNPXXFl9cb3BG0pJKzUn9bew)(void);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem)(void* usr);
static N_INLINE(void, rtlAddZCT_MV4BBk6J1qu70IbBxwEn4w_2system)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_PRIVATE N_NOINLINE(void, addZCT_fCDI7oO1NNVXXURtxSzsRw)(tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w* s, tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
N_NIMCALL(TGenericSeq*, incrSeqV3)(TGenericSeq* s, TNimType* typ);
N_LIB_PRIVATE N_NIMCALL(NCSTRING*, allocCStringArray_TEzwlF389aOWujK0ZU6Ck9bA)(NimStringDesc** a, NI aLen_0);
static N_INLINE(void, pushSafePoint)(TSafePoint* s);
N_LIB_PRIVATE N_NIMCALL(NCSTRING*, envToCStringArray_leJndH17YzY3aGwRVeFh3Q)(void);
N_LIB_PRIVATE N_NIMCALL(void, getEnvVarsC_6FJHJTe87BjacqZFrlJfgw)(void);
N_LIB_PRIVATE N_NIMCALL(NI, nsuFindChar)(NimStringDesc* s, NIM_CHAR sub, NI start, NI last);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, substr_TWXUwbnq0SWWvDLfr8LXYw)(NimStringDesc* s, NI first, NI last);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, substr_9bUFQ4OV1temcDF0GZp317g)(NimStringDesc* s, NI first);
N_LIB_PRIVATE N_NOCONV(void*, alloc0_4cubgSerkjpuLcj5MXjiLw_2)(NI size);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
static N_INLINE(void, copyMem_fPlwH3r9agN9aEHB6yCPMh0wsystem)(void* dest, void* source, NI size);
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_LIB_PRIVATE N_NOCONV(void*, alloc_4cubgSerkjpuLcj5MXjiLw)(NI size);
N_LIB_PRIVATE N_NIMCALL(NCSTRING*, envToCStringArray_sh6ueW2TJVNPvj9agkC0rrA)(tyObject_StringTableObj_V5PVrt9bIxZEeV7lfvqqtNg* t);
N_LIB_PRIVATE N_NIMCALL(NI, nstlen)(tyObject_StringTableObj_V5PVrt9bIxZEeV7lfvqqtNg* t);
static N_INLINE(NCSTRING, nimToCStringConv)(NimStringDesc* s);
N_LIB_PRIVATE N_NIMCALL(pid_t, startProcessAuxFork_kyXrSGEU32inzxlRyiu1XA)(tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA* data);
N_NIMCALL(void, genericAssign)(void* dest, void* src, TNimType* mt);
N_LIB_PRIVATE N_CDECL(void, startProcessAfterFork_kP8IoxkYQ0xKBWMKeIF3Cw)(tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA* data);
N_LIB_PRIVATE N_NIMCALL(void, startProcessFail_1Q2da9a7NmGuR0Ogak2NKkw)(tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA* data);
static N_INLINE(size_t, nimCStrLen)(NCSTRING a);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuFormatOpenArray)(NimStringDesc* formatstr, NimStringDesc** a, NI aLen_0);
N_NIMCALL(NimStringDesc*, cstrToNimstr)(NCSTRING str);
static N_INLINE(void, popSafePoint)(void);
N_NIMCALL(void, reraiseException)(void);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuJoinSep)(NimStringDesc** a, NI aLen_0, NimStringDesc* sep);
N_NIMCALL(void, echoBinSafe)(NimStringDesc** args, NI argsLen_0);
N_LIB_PRIVATE N_NIMCALL(void, deallocCStringArray_C6iuca1Cowwvc7xYXRiSig)(NCSTRING* a);
N_LIB_PRIVATE N_NIMCALL(void, createStream_O9bqQ8kVMTSshRB6tlAkyjw)(tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ** stream, int* handle, tyEnum_FileMode_fVUBHvW79bXUw1j55Oo9avSQ fileMode);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, open_GRr4dBTChSldEteMxZDsuw)(FILE** f, int filehandle, tyEnum_FileMode_fVUBHvW79bXUw1j55Oo9avSQ mode);
N_LIB_PRIVATE N_NIMCALL(tyObject_FileStreamObj_9bEVSsOIpkY9cf5lCtaS39bPQ*, newFileStream_rT0vr5guf49c4PWwagLpAgQ)(FILE* f);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_LIB_PRIVATE N_NIMCALL(int, exitStatus_UXYeVHPMK6MYSBxiXhkNfQ)(int status);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, isExitStatus_LfdXbSxcFCX8jeiWMQhmLg)(int status);
N_LIB_PRIVATE N_NIMCALL(NI, ncpicountProcessors)(void);
N_LIB_PRIVATE N_NIMCALL(tySequence_PrBYolTs4TOSgE8v5oqDUQ*, newSeq_sR1OBdsDRiRfIJbzk6iUkg)(NI len);
N_LIB_PRIVATE N_NIMCALL(tySequence_qwqHTkRvwhrRyENtudHQ7g*, newSeq_BlrccvgyrVECLCXlhRK9cMw)(NI len);
N_LIB_PRIVATE N_NIMCALL(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg*, nospstartProcess)(NimStringDesc* command, NimStringDesc* workingDir, NimStringDesc** args, NI argsLen_0, tyObject_StringTableObj_V5PVrt9bIxZEeV7lfvqqtNg* env, tySet_tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA options);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incRef_9cAA5YuQAAC3MVbnGeV86swsystem)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(void, decRef_MV4BBk6J1qu70IbBxwEn4wsystem)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosprunning)(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p);
N_LIB_PRIVATE N_NIMCALL(NI, nosppeekExitCode)(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p);
N_LIB_PRIVATE N_NIMCALL(void, nospclose)(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p);
N_LIB_PRIVATE N_NIMCALL(void, close_Xz3YiEzNrT9cUBndwi4hNjw)(tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* s);
N_LIB_PRIVATE N_NIMCALL(NI, nospwaitForExit)(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p, NI timeout);
extern NCSTRING* environ;
extern TNimType NTI_ytyiCJqK439aF9cIibuRVpAg_;
TNimType NTI_2rGNQnv9bU4hanI2g3svReg_;
extern TNimType NTI_UtShRB9b1wZO9cvpdowm9cefA_;
extern TNimType NTI_1G0jiQbe7KwD5ADza5AZaw_;
extern TNimType NTI_r9bTMVI8f19ah9b11jMgY4kPg_;
extern TNimType NTI_nlCscttRCss70IBTyuBqnA_;
extern TNimType NTI_VaVACK0bpYmqIQ0mKcHfQQ_;
TNimType NTI_bnU6W8LhTMnT4JaSWtGlSA_;
TNimType NTI_HlmBYNr2gdAZMXOsuiSZ0A_;
TNimType NTI_lw7iqc9cC7bi1oOZOAlJkJA_;
extern TNimType NTI_sM4lkSb7zS6F7OVMvW9cffQ_;
extern tyObject_GcHeap_1TRH1TZMaVZTnLNcIHuNFQ gch_IcYaEuuWivYAS86vFMTS3Q;
extern TSafePoint* excHandler_rqLlY5bs9atDw2OXYqJEn5g;
extern tySequence_sM4lkSb7zS6F7OVMvW9cffQ* environment_rnCB7Cc69bd2mlM49cn9czO2Q;
TNimType NTI_xgRnKnLIYRtnOkshMKhc9cA_;
extern TNimType NTI_77mFvmsOLKik79ci2hXkHEg_;
extern TNimType NTI_Txh9bzc0AU9bDpIbDdD6jBsQ_;
extern TNimType NTI_S9agCYBinaYZnGWcjTdxclg_;
TNimType NTI_SKEqGXcReU4NvbQlH779b5Q_;
STRING_LITERAL(TM_HZdw8BhppcTQo8DIK46LSg_6, "/bin/sh", 7);
STRING_LITERAL(TM_HZdw8BhppcTQo8DIK46LSg_7, "-c", 2);
STRING_LITERAL(TM_HZdw8BhppcTQo8DIK46LSg_9, "=", 1);
STRING_LITERAL(TM_HZdw8BhppcTQo8DIK46LSg_13, "Could not find command: \'$1\'. OS error: $2", 42);
STRING_LITERAL(TM_HZdw8BhppcTQo8DIK46LSg_14, " ", 1);
static NIM_CONST tyProc_kElEuvYkhDcTHhB3d89aMYA TM_HZdw8BhppcTQo8DIK46LSg_16 = {NIM_NIL,NIM_NIL};
static NIM_CONST tyProc_FM4RO2zoXex9caTkjWpBmsw TM_HZdw8BhppcTQo8DIK46LSg_18 = {NIM_NIL,NIM_NIL};

static N_INLINE(void, nimSetMem_2Mfumf6CnyNlShDWdIgobwsystem)(void* a, int v, NI size) {
	void* T1_;
	T1_ = (void*)0;
	T1_ = memset(a, v, ((size_t) (size)));
}

static N_INLINE(void, nimZeroMem)(void* p, NI size) {
	nimSetMem_2Mfumf6CnyNlShDWdIgobwsystem(p, ((int) 0), size);
}
static N_NIMCALL(void, Marker_tyRef_lw7iqc9cC7bi1oOZOAlJkJA)(void* p, NI op) {
	tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* a;
	a = (tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg*)p;
	nimGCvisit((void*)(*a).inStream, op);
	nimGCvisit((void*)(*a).outStream, op);
	nimGCvisit((void*)(*a).errStream, op);
}

static N_INLINE(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem)(void* usr) {
	tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* result;
	result = (tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*)0;
	result = ((tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*) ((NI)((NU32)(((NI) (ptrdiff_t) (usr))) - (NU32)(((NI)sizeof(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g))))));
	return result;
}

static N_INLINE(void, rtlAddZCT_MV4BBk6J1qu70IbBxwEn4w_2system)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c) {
	addZCT_fCDI7oO1NNVXXURtxSzsRw((&gch_IcYaEuuWivYAS86vFMTS3Q.zct), c);
}

static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
	tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c;
	c = usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem(p);
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA3_;
		rtlAddZCT_MV4BBk6J1qu70IbBxwEn4w_2system(c);
	}
	LA3_: ;
}

static N_INLINE(void, pushSafePoint)(TSafePoint* s) {
	(*s).hasRaiseAction = NIM_FALSE;
	(*s).prev = excHandler_rqLlY5bs9atDw2OXYqJEn5g;
	excHandler_rqLlY5bs9atDw2OXYqJEn5g = s;
}

static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) {
	void* T1_;
	T1_ = (void*)0;
	T1_ = memcpy(dest, source, ((size_t) (size)));
}

static N_INLINE(void, copyMem_fPlwH3r9agN9aEHB6yCPMh0wsystem)(void* dest, void* source, NI size) {
	nimCopyMem(dest, source, size);
}

static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
	{
		if (!!((src == NIM_NIL))) goto LA3_;
		copyMem_fPlwH3r9agN9aEHB6yCPMh0wsystem(((void*) ((&(*dest).data[((*dest).Sup.len)- 0]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1)))));
		(*dest).Sup.len += (*src).Sup.len;
	}
	LA3_: ;
}

N_LIB_PRIVATE N_NIMCALL(NCSTRING*, envToCStringArray_leJndH17YzY3aGwRVeFh3Q)(void) {
	NCSTRING* result;
	NI counter;
	void* T6_;
	NI i_2;
	result = (NCSTRING*)0;
	counter = ((NI) 0);
	{
		NimStringDesc* key;
		NimStringDesc* val;
		key = (NimStringDesc*)0;
		val = (NimStringDesc*)0;
		getEnvVarsC_6FJHJTe87BjacqZFrlJfgw();
		{
			NI i;
			NI colontmp_;
			NI T3_;
			NI res;
			i = (NI)0;
			colontmp_ = (NI)0;
			T3_ = ((environment_rnCB7Cc69bd2mlM49cn9czO2Q ? environment_rnCB7Cc69bd2mlM49cn9czO2Q->Sup.len : 0)-1);
			colontmp_ = T3_;
			res = ((NI) 0);
			{
				while (1) {
					NI p;
					if (!(res <= colontmp_)) goto LA5;
					i = res;
					p = nsuFindChar(environment_rnCB7Cc69bd2mlM49cn9czO2Q->data[i], 61, ((NI) 0), ((NI) 0));
					key = substr_TWXUwbnq0SWWvDLfr8LXYw(environment_rnCB7Cc69bd2mlM49cn9czO2Q->data[i], ((NI) 0), (NI)(p - ((NI) 1)));
					val = substr_9bUFQ4OV1temcDF0GZp317g(environment_rnCB7Cc69bd2mlM49cn9czO2Q->data[i], (NI)(p + ((NI) 1)));
					counter += ((NI) 1);
					res += ((NI) 1);
				} LA5: ;
			}
		}
	}
	T6_ = (void*)0;
	T6_ = alloc0_4cubgSerkjpuLcj5MXjiLw_2(((NI) ((NI)((NI)(counter + ((NI) 1)) * ((NI) 4)))));
	result = ((NCSTRING*) (T6_));
	i_2 = ((NI) 0);
	{
		NimStringDesc* key_2;
		NimStringDesc* val_2;
		key_2 = (NimStringDesc*)0;
		val_2 = (NimStringDesc*)0;
		getEnvVarsC_6FJHJTe87BjacqZFrlJfgw();
		{
			NI i_3;
			NI colontmp__2;
			NI T9_;
			NI res_2;
			i_3 = (NI)0;
			colontmp__2 = (NI)0;
			T9_ = ((environment_rnCB7Cc69bd2mlM49cn9czO2Q ? environment_rnCB7Cc69bd2mlM49cn9czO2Q->Sup.len : 0)-1);
			colontmp__2 = T9_;
			res_2 = ((NI) 0);
			{
				while (1) {
					NI p_2;
					NimStringDesc* x;
					NimStringDesc* T12_;
					void* T13_;
					if (!(res_2 <= colontmp__2)) goto LA11;
					i_3 = res_2;
					p_2 = nsuFindChar(environment_rnCB7Cc69bd2mlM49cn9czO2Q->data[i_3], 61, ((NI) 0), ((NI) 0));
					key_2 = substr_TWXUwbnq0SWWvDLfr8LXYw(environment_rnCB7Cc69bd2mlM49cn9czO2Q->data[i_3], ((NI) 0), (NI)(p_2 - ((NI) 1)));
					val_2 = substr_9bUFQ4OV1temcDF0GZp317g(environment_rnCB7Cc69bd2mlM49cn9czO2Q->data[i_3], (NI)(p_2 + ((NI) 1)));
					T12_ = (NimStringDesc*)0;
					T12_ = rawNewString((key_2 ? key_2->Sup.len : 0) + (val_2 ? val_2->Sup.len : 0) + 1);
appendString(T12_, key_2);
appendString(T12_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_9));
appendString(T12_, val_2);
					x = T12_;
					T13_ = (void*)0;
					T13_ = alloc_4cubgSerkjpuLcj5MXjiLw(((NI) ((NI)((x ? x->Sup.len : 0) + ((NI) 1)))));
					result[(i_2)- 0] = ((NCSTRING) (T13_));
					copyMem_fPlwH3r9agN9aEHB6yCPMh0wsystem(((void*) (result[(i_2)- 0])), ((void*) ((&x->data[((NI) 0)]))), ((NI) ((NI)((x ? x->Sup.len : 0) + ((NI) 1)))));
					i_2 += ((NI) 1);
					res_2 += ((NI) 1);
				} LA11: ;
			}
		}
	}
	return result;
}

N_LIB_PRIVATE N_NIMCALL(NCSTRING*, envToCStringArray_sh6ueW2TJVNPvj9agkC0rrA)(tyObject_StringTableObj_V5PVrt9bIxZEeV7lfvqqtNg* t) {
	NCSTRING* result;
	NI T1_;
	void* T2_;
	NI i;
	result = (NCSTRING*)0;
	T1_ = (NI)0;
	T1_ = nstlen(t);
	T2_ = (void*)0;
	T2_ = alloc0_4cubgSerkjpuLcj5MXjiLw_2(((NI) ((NI)((NI)(T1_ + ((NI) 1)) * ((NI) 4)))));
	result = ((NCSTRING*) (T2_));
	i = ((NI) 0);
	{
		NimStringDesc* key;
		NimStringDesc* val;
		key = (NimStringDesc*)0;
		val = (NimStringDesc*)0;
		{
			NI h;
			NI colontmp_;
			NI T5_;
			NI res;
			h = (NI)0;
			colontmp_ = (NI)0;
			T5_ = (((*t).data ? (*t).data->Sup.len : 0)-1);
			colontmp_ = T5_;
			res = ((NI) 0);
			{
				while (1) {
					if (!(res <= colontmp_)) goto LA7;
					h = res;
					{
						NimStringDesc* x;
						NimStringDesc* T12_;
						void* T13_;
						if (!(*t).data->data[h].Field2) goto LA10_;
						key = (*t).data->data[h].Field0;
						val = (*t).data->data[h].Field1;
						T12_ = (NimStringDesc*)0;
						T12_ = rawNewString((key ? key->Sup.len : 0) + (val ? val->Sup.len : 0) + 1);
appendString(T12_, key);
appendString(T12_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_9));
appendString(T12_, val);
						x = T12_;
						T13_ = (void*)0;
						T13_ = alloc_4cubgSerkjpuLcj5MXjiLw(((NI) ((NI)((x ? x->Sup.len : 0) + ((NI) 1)))));
						result[(i)- 0] = ((NCSTRING) (T13_));
						copyMem_fPlwH3r9agN9aEHB6yCPMh0wsystem(((void*) (result[(i)- 0])), ((void*) ((&x->data[((NI) 0)]))), ((NI) ((NI)((x ? x->Sup.len : 0) + ((NI) 1)))));
						i += ((NI) 1);
					}
					LA10_: ;
					res += ((NI) 1);
				} LA7: ;
			}
		}
	}
	return result;
}

static N_INLINE(NCSTRING, nimToCStringConv)(NimStringDesc* s) {
	NCSTRING result;
	result = (NCSTRING)0;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (s == NIM_NIL);
		if (T3_) goto LA4_;
		T3_ = ((*s).Sup.len == ((NI) 0));
		LA4_: ;
		if (!T3_) goto LA5_;
		result = "";
	}
	goto LA1_;
	LA5_: ;
	{
		result = ((NCSTRING) ((*s).data));
	}
	LA1_: ;
	return result;
}

N_LIB_PRIVATE N_NIMCALL(void, startProcessFail_1Q2da9a7NmGuR0Ogak2NKkw)(tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA* data) {
	int error;
	NI T1_;
	error = errno;
	T1_ = (NI)0;
	T1_ = write((*data).pErrorPipe[(((NI) 1))- 0], ((void*) ((&error))), ((NI) 4));
	(void)(T1_);
	_exit(((NI) 1));
}

static N_INLINE(size_t, nimCStrLen)(NCSTRING a) {
	size_t result;
	result = (size_t)0;
	result = strlen(a);
	return result;
}

N_LIB_PRIVATE N_CDECL(void, startProcessAfterFork_kP8IoxkYQ0xKBWMKeIF3Cw)(tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA* data) {
	int T42_;
	int T43_;
	{
		int T5_;
		int T11_;
		int T17_;
		if (!!((((*data).options &(1U<<((NU)(((tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA) 4))&7U)))!=0))) goto LA3_;
		T5_ = (int)0;
		T5_ = close((*data).pStdin[(((NI) 1))- 0]);
		(void)(T5_);
		{
			int T8_;
			T8_ = (int)0;
			T8_ = dup2((*data).pStdin[(((NI) 0))- 0], ((int) 0));
			if (!(T8_ < ((NI32) 0))) goto LA9_;
			startProcessFail_1Q2da9a7NmGuR0Ogak2NKkw(data);
		}
		LA9_: ;
		T11_ = (int)0;
		T11_ = close((*data).pStdout[(((NI) 0))- 0]);
		(void)(T11_);
		{
			int T14_;
			T14_ = (int)0;
			T14_ = dup2((*data).pStdout[(((NI) 1))- 0], ((int) 1));
			if (!(T14_ < ((NI32) 0))) goto LA15_;
			startProcessFail_1Q2da9a7NmGuR0Ogak2NKkw(data);
		}
		LA15_: ;
		T17_ = (int)0;
		T17_ = close((*data).pStderr[(((NI) 0))- 0]);
		(void)(T17_);
		{
			if (!(((*data).options &(1U<<((NU)(((tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA) 3))&7U)))!=0)) goto LA20_;
			{
				int T24_;
				T24_ = (int)0;
				T24_ = dup2((*data).pStdout[(((NI) 1))- 0], ((int) 2));
				if (!(T24_ < ((NI32) 0))) goto LA25_;
				startProcessFail_1Q2da9a7NmGuR0Ogak2NKkw(data);
			}
			LA25_: ;
		}
		goto LA18_;
		LA20_: ;
		{
			{
				int T30_;
				T30_ = (int)0;
				T30_ = dup2((*data).pStderr[(((NI) 1))- 0], ((int) 2));
				if (!(T30_ < ((NI32) 0))) goto LA31_;
				startProcessFail_1Q2da9a7NmGuR0Ogak2NKkw(data);
			}
			LA31_: ;
		}
		LA18_: ;
	}
	LA3_: ;
	{
		if (!(((NI) 0) < ((*data).workingDir ? nimCStrLen((*data).workingDir) : 0))) goto LA35_;
		{
			int T39_;
			T39_ = (int)0;
			T39_ = chdir((*data).workingDir);
			if (!(T39_ < ((NI32) 0))) goto LA40_;
			startProcessFail_1Q2da9a7NmGuR0Ogak2NKkw(data);
		}
		LA40_: ;
	}
	LA35_: ;
	T42_ = (int)0;
	T42_ = close((*data).pErrorPipe[(((NI) 0))- 0]);
	(void)(T42_);
	T43_ = (int)0;
	T43_ = fcntl((*data).pErrorPipe[(((NI) 1))- 0], F_SETFD, FD_CLOEXEC);
	(void)(T43_);
	{
		int T48_;
		if (!(((*data).options &(1U<<((NU)(((tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA) 1))&7U)))!=0)) goto LA46_;
		environ = (*data).sysEnv;
		T48_ = (int)0;
		T48_ = execvp(nimToCStringConv((*data).sysCommand), (*data).sysArgs);
		(void)(T48_);
	}
	goto LA44_;
	LA46_: ;
	{
		int T50_;
		T50_ = (int)0;
		T50_ = execve(nimToCStringConv((*data).sysCommand), (*data).sysArgs, (*data).sysEnv);
		(void)(T50_);
	}
	LA44_: ;
	startProcessFail_1Q2da9a7NmGuR0Ogak2NKkw(data);
}

static N_INLINE(void, popSafePoint)(void) {
	excHandler_rqLlY5bs9atDw2OXYqJEn5g = (*excHandler_rqLlY5bs9atDw2OXYqJEn5g).prev;
}

N_LIB_PRIVATE N_NIMCALL(pid_t, startProcessAuxFork_kyXrSGEU32inzxlRyiu1XA)(tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA* data) {
	pid_t volatile result;
	TSafePoint TM_HZdw8BhppcTQo8DIK46LSg_11;
{	result = (pid_t)0;
	{
		int T3_;
		NI32 T6_;
		T3_ = (int)0;
		T3_ = pipe((*data).pErrorPipe);
		if (!!((T3_ == ((NI32) 0)))) goto LA4_;
		T6_ = (NI32)0;
		T6_ = osLastError_tNPXXFl9cb3BG0pJKzUn9bew();
		raiseOSError_bEwAamo1N7TKcaU9akpiyIg(T6_, ((NimStringDesc*) NIM_NIL));
	}
	LA4_: ;
	pushSafePoint(&TM_HZdw8BhppcTQo8DIK46LSg_11);
	TM_HZdw8BhppcTQo8DIK46LSg_11.status = _setjmp(TM_HZdw8BhppcTQo8DIK46LSg_11.context);
	if (TM_HZdw8BhppcTQo8DIK46LSg_11.status == 0) {
		pid_t volatile pid;
		tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA dataCopy;
		int T12_;
		int error;
		NI sizeRead;
		int T26_;
		pid = (pid_t)0;
		nimZeroMem((void*)(&dataCopy), sizeof(tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA));
		genericAssign((void*)(&dataCopy), (void*)data, (&NTI_xgRnKnLIYRtnOkshMKhc9cA_));
		pid = fork();
		{
			if (!(pid == ((NI32) 0))) goto LA10_;
			startProcessAfterFork_kP8IoxkYQ0xKBWMKeIF3Cw((&dataCopy));
			_exit(((NI) 1));
		}
		LA10_: ;
		T12_ = (int)0;
		T12_ = close((*data).pErrorPipe[(((NI) 1))- 0]);
		(void)(T12_);
		{
			NI32 T17_;
			if (!(pid < ((NI32) 0))) goto LA15_;
			T17_ = (NI32)0;
			T17_ = osLastError_tNPXXFl9cb3BG0pJKzUn9bew();
			raiseOSError_bEwAamo1N7TKcaU9akpiyIg(T17_, ((NimStringDesc*) NIM_NIL));
		}
		LA15_: ;
		error = (int)0;
		sizeRead = read((*data).pErrorPipe[(((NI) 0))- 0], ((void*) ((&error))), ((NI) 4));
		{
			NI32 T22_;
			tyArray_Re75IspeoxXy2oCZHwcRrA T23_;
			NCSTRING T24_;
			NimStringDesc* T25_;
			if (!(sizeRead == ((NI) 4))) goto LA20_;
			T22_ = (NI32)0;
			T22_ = osLastError_tNPXXFl9cb3BG0pJKzUn9bew();
			nimZeroMem((void*)T23_, sizeof(tyArray_Re75IspeoxXy2oCZHwcRrA));
			T23_[0] = copyString((*data).sysCommand);
			T24_ = (NCSTRING)0;
			T24_ = strerror(error);
			T23_[1] = cstrToNimstr(T24_);
			T25_ = (NimStringDesc*)0;
			T25_ = nsuFormatOpenArray(((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_13), T23_, 2);
			raiseOSError_bEwAamo1N7TKcaU9akpiyIg(T22_, T25_);
		}
		LA20_: ;
		result = pid;
		popSafePoint();
		T26_ = (int)0;
		T26_ = close((*data).pErrorPipe[(((NI) 0))- 0]);
		(void)(T26_);
		goto BeforeRet_;
		popSafePoint();
	}
	else {
		popSafePoint();
	}
	{
		int T29_;
		T29_ = (int)0;
		T29_ = close((*data).pErrorPipe[(((NI) 0))- 0]);
		(void)(T29_);
	}
	if (TM_HZdw8BhppcTQo8DIK46LSg_11.status != 0) reraiseException();
	}BeforeRet_: ;
	return result;
}

N_LIB_PRIVATE N_NIMCALL(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg*, nospstartProcess)(NimStringDesc* command, NimStringDesc* workingDir, NimStringDesc** args, NI argsLen_0, tyObject_StringTableObj_V5PVrt9bIxZEeV7lfvqqtNg* env, tySet_tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA options) {
	tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* result;
	tyArray_SKEqGXcReU4NvbQlH779b5Q pStdin;
	tyArray_SKEqGXcReU4NvbQlH779b5Q pStdout;
	tyArray_SKEqGXcReU4NvbQlH779b5Q pStderr;
	NimStringDesc* sysCommand;
	tySequence_sM4lkSb7zS6F7OVMvW9cffQ* sysArgsRaw;
	pid_t volatile pid;
	NCSTRING* sysArgs;
	TSafePoint TM_HZdw8BhppcTQo8DIK46LSg_8;
	result = (tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg*)0;
	nimZeroMem((void*)pStdin, sizeof(tyArray_SKEqGXcReU4NvbQlH779b5Q));
	nimZeroMem((void*)pStdout, sizeof(tyArray_SKEqGXcReU4NvbQlH779b5Q));
	nimZeroMem((void*)pStderr, sizeof(tyArray_SKEqGXcReU4NvbQlH779b5Q));
	result = (tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg*) newObj((&NTI_lw7iqc9cC7bi1oOZOAlJkJA_), sizeof(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg));
	(*result).Sup.m_type = (&NTI_2rGNQnv9bU4hanI2g3svReg_);
	(*result).options = options;
	(*result).exitFlag = NIM_TRUE;
	{
		if (!!(((options &(1U<<((NU)(((tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA) 4))&7U)))!=0))) goto LA3_;
		{
			NIM_BOOL T7_;
			NIM_BOOL T8_;
			int T9_;
			int T11_;
			int T13_;
			NI32 T16_;
			T7_ = (NIM_BOOL)0;
			T8_ = (NIM_BOOL)0;
			T9_ = (int)0;
			T9_ = pipe(pStdin);
			T8_ = !((T9_ == ((NI32) 0)));
			if (T8_) goto LA10_;
			T11_ = (int)0;
			T11_ = pipe(pStdout);
			T8_ = !((T11_ == ((NI32) 0)));
			LA10_: ;
			T7_ = T8_;
			if (T7_) goto LA12_;
			T13_ = (int)0;
			T13_ = pipe(pStderr);
			T7_ = !((T13_ == ((NI32) 0)));
			LA12_: ;
			if (!T7_) goto LA14_;
			T16_ = (NI32)0;
			T16_ = osLastError_tNPXXFl9cb3BG0pJKzUn9bew();
			raiseOSError_bEwAamo1N7TKcaU9akpiyIg(T16_, ((NimStringDesc*) NIM_NIL));
		}
		LA14_: ;
	}
	LA3_: ;
	sysCommand = (NimStringDesc*)0;
	sysArgsRaw = (tySequence_sM4lkSb7zS6F7OVMvW9cffQ*)0;
	{
		NimStringDesc* T21_;
		NimStringDesc* T22_;
		NimStringDesc* T23_;
		if (!((options &(1U<<((NU)(((tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA) 2))&7U)))!=0)) goto LA19_;
		sysCommand = copyString(((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_6));
		sysArgsRaw = (tySequence_sM4lkSb7zS6F7OVMvW9cffQ*) newSeq((&NTI_sM4lkSb7zS6F7OVMvW9cffQ_), 3);
		T21_ = (NimStringDesc*)0;
		T21_ = sysArgsRaw->data[0]; sysArgsRaw->data[0] = copyStringRC1(sysCommand);
		if (T21_) nimGCunrefNoCycle(T21_);
		T22_ = (NimStringDesc*)0;
		T22_ = sysArgsRaw->data[1]; sysArgsRaw->data[1] = copyStringRC1(((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_7));
		if (T22_) nimGCunrefNoCycle(T22_);
		T23_ = (NimStringDesc*)0;
		T23_ = sysArgsRaw->data[2]; sysArgsRaw->data[2] = copyStringRC1(command);
		if (T23_) nimGCunrefNoCycle(T23_);
	}
	goto LA17_;
	LA19_: ;
	{
		NimStringDesc* T25_;
		sysCommand = copyString(command);
		sysArgsRaw = (tySequence_sM4lkSb7zS6F7OVMvW9cffQ*) newSeq((&NTI_sM4lkSb7zS6F7OVMvW9cffQ_), 1);
		T25_ = (NimStringDesc*)0;
		T25_ = sysArgsRaw->data[0]; sysArgsRaw->data[0] = copyStringRC1(command);
		if (T25_) nimGCunrefNoCycle(T25_);
		{
			NimStringDesc* arg;
			NI i;
			arg = (NimStringDesc*)0;
			i = ((NI) 0);
			{
				while (1) {
					NI T29_;
					NimStringDesc* T30_;
					if (!(i < argsLen_0)) goto LA28;
					arg = args[i];
					sysArgsRaw = (tySequence_sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV3(&(sysArgsRaw)->Sup, (&NTI_sM4lkSb7zS6F7OVMvW9cffQ_));
					T29_ = sysArgsRaw->Sup.len++;
					T30_ = (NimStringDesc*)0;
					T30_ = sysArgsRaw->data[T29_]; sysArgsRaw->data[T29_] = copyStringRC1(arg);
					if (T30_) nimGCunrefNoCycle(T30_);
					i += ((NI) 1);
				} LA28: ;
			}
		}
	}
	LA17_: ;
	pid = (pid_t)0;
	sysArgs = allocCStringArray_TEzwlF389aOWujK0ZU6Ck9bA(sysArgsRaw->data, (sysArgsRaw ? sysArgsRaw->Sup.len : 0));
	pushSafePoint(&TM_HZdw8BhppcTQo8DIK46LSg_8);
	TM_HZdw8BhppcTQo8DIK46LSg_8.status = _setjmp(TM_HZdw8BhppcTQo8DIK46LSg_8.context);
	if (TM_HZdw8BhppcTQo8DIK46LSg_8.status == 0) {
		NCSTRING* sysEnv;
		TSafePoint TM_HZdw8BhppcTQo8DIK46LSg_10;
		{
			if (!(env == NIM_NIL)) goto LA34_;
			sysEnv = envToCStringArray_leJndH17YzY3aGwRVeFh3Q();
		}
		goto LA32_;
		LA34_: ;
		{
			sysEnv = envToCStringArray_sh6ueW2TJVNPvj9agkC0rrA(env);
		}
		LA32_: ;
		pushSafePoint(&TM_HZdw8BhppcTQo8DIK46LSg_10);
		TM_HZdw8BhppcTQo8DIK46LSg_10.status = _setjmp(TM_HZdw8BhppcTQo8DIK46LSg_10.context);
		if (TM_HZdw8BhppcTQo8DIK46LSg_10.status == 0) {
			tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA data;
			nimZeroMem((void*)(&data), sizeof(tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA));
			data.sysCommand = sysCommand;
			data.sysArgs = sysArgs;
			data.sysEnv = sysEnv;
			nimCopyMem((void*)data.pStdin, (NIM_CONST void*)pStdin, sizeof(tyArray_SKEqGXcReU4NvbQlH779b5Q));
			nimCopyMem((void*)data.pStdout, (NIM_CONST void*)pStdout, sizeof(tyArray_SKEqGXcReU4NvbQlH779b5Q));
			nimCopyMem((void*)data.pStderr, (NIM_CONST void*)pStderr, sizeof(tyArray_SKEqGXcReU4NvbQlH779b5Q));
			data.workingDir = nimToCStringConv(workingDir);
			data.options = options;
			pid = startProcessAuxFork_kyXrSGEU32inzxlRyiu1XA((&data));
			{
				tyArray_24KAM9afIUgUaqBaEBB6r9bg T42_;
				if (!((options &(1U<<((NU)(((tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA) 0))&7U)))!=0)) goto LA40_;
				nimZeroMem((void*)T42_, sizeof(tyArray_24KAM9afIUgUaqBaEBB6r9bg));
				T42_[0] = copyString(command);
				T42_[1] = copyString(((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_14));
				T42_[2] = nsuJoinSep(args, argsLen_0, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_14));
				echoBinSafe(T42_, 3);
			}
			LA40_: ;
			(*result).id = pid;
			(*result).exitFlag = NIM_FALSE;
			{
				if (!((options &(1U<<((NU)(((tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA) 4))&7U)))!=0)) goto LA45_;
				(*result).inHandle = ((int) 0);
				(*result).outHandle = ((int) 1);
				{
					if (!((options &(1U<<((NU)(((tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA) 3))&7U)))!=0)) goto LA49_;
					(*result).errHandle = (*result).outHandle;
				}
				goto LA47_;
				LA49_: ;
				{
					(*result).errHandle = ((int) 2);
				}
				LA47_: ;
			}
			goto LA43_;
			LA45_: ;
			{
				int T59_;
				int T60_;
				int T61_;
				(*result).inHandle = pStdin[(((NI) 1))- 0];
				(*result).outHandle = pStdout[(((NI) 0))- 0];
				{
					int T57_;
					if (!((options &(1U<<((NU)(((tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA) 3))&7U)))!=0)) goto LA55_;
					(*result).errHandle = (*result).outHandle;
					T57_ = (int)0;
					T57_ = close(pStderr[(((NI) 0))- 0]);
					(void)(T57_);
				}
				goto LA53_;
				LA55_: ;
				{
					(*result).errHandle = pStderr[(((NI) 0))- 0];
				}
				LA53_: ;
				T59_ = (int)0;
				T59_ = close(pStderr[(((NI) 1))- 0]);
				(void)(T59_);
				T60_ = (int)0;
				T60_ = close(pStdin[(((NI) 0))- 0]);
				(void)(T60_);
				T61_ = (int)0;
				T61_ = close(pStdout[(((NI) 1))- 0]);
				(void)(T61_);
			}
			LA43_: ;
			popSafePoint();
		}
		else {
			popSafePoint();
		}
		{
			deallocCStringArray_C6iuca1Cowwvc7xYXRiSig(sysEnv);
		}
		if (TM_HZdw8BhppcTQo8DIK46LSg_10.status != 0) reraiseException();
		popSafePoint();
	}
	else {
		popSafePoint();
	}
	{
		deallocCStringArray_C6iuca1Cowwvc7xYXRiSig(sysArgs);
	}
	if (TM_HZdw8BhppcTQo8DIK46LSg_8.status != 0) reraiseException();
	return result;
}

N_LIB_PRIVATE N_NIMCALL(void, createStream_O9bqQ8kVMTSshRB6tlAkyjw)(tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ** stream, int* handle, tyEnum_FileMode_fVUBHvW79bXUw1j55Oo9avSQ fileMode) {
	FILE* f;
	tyObject_FileStreamObj_9bEVSsOIpkY9cf5lCtaS39bPQ* T7_;
	f = (FILE*)0;
	{
		NIM_BOOL T3_;
		NI32 T6_;
		T3_ = (NIM_BOOL)0;
		T3_ = open_GRr4dBTChSldEteMxZDsuw(&f, (*handle), fileMode);
		if (!!(T3_)) goto LA4_;
		T6_ = (NI32)0;
		T6_ = osLastError_tNPXXFl9cb3BG0pJKzUn9bew();
		raiseOSError_bEwAamo1N7TKcaU9akpiyIg(T6_, ((NimStringDesc*) NIM_NIL));
	}
	LA4_: ;
	T7_ = (tyObject_FileStreamObj_9bEVSsOIpkY9cf5lCtaS39bPQ*)0;
	T7_ = newFileStream_rT0vr5guf49c4PWwagLpAgQ(f);
	unsureAsgnRef((void**) (&(*stream)), &T7_->Sup);
}

N_LIB_PRIVATE N_NIMCALL(tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ*, nospinputStream)(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p) {
	tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* result;
{	result = (tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ*)0;
	{
		if (!((*p).inStream == NIM_NIL)) goto LA3_;
		createStream_O9bqQ8kVMTSshRB6tlAkyjw(&(*p).inStream, (&(*p).inHandle), ((tyEnum_FileMode_fVUBHvW79bXUw1j55Oo9avSQ) 1));
	}
	LA3_: ;
	result = (*p).inStream;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_PRIVATE N_NIMCALL(tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ*, nospoutputStream)(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p) {
	tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* result;
{	result = (tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ*)0;
	{
		if (!((*p).outStream == NIM_NIL)) goto LA3_;
		createStream_O9bqQ8kVMTSshRB6tlAkyjw(&(*p).outStream, (&(*p).outHandle), ((tyEnum_FileMode_fVUBHvW79bXUw1j55Oo9avSQ) 0));
	}
	LA3_: ;
	result = (*p).outStream;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_PRIVATE N_NIMCALL(int, exitStatus_UXYeVHPMK6MYSBxiXhkNfQ)(int status) {
	int result;
	result = (int)0;
	{
		NIM_BOOL T3_;
		int T6_;
		T3_ = (NIM_BOOL)0;
		T3_ = WIFSIGNALED(status);
		if (!T3_) goto LA4_;
		T6_ = (int)0;
		T6_ = WTERMSIG(status);
		result = (NI32)(((NI32) 128) + T6_);
	}
	goto LA1_;
	LA4_: ;
	{
		result = WEXITSTATUS(status);
	}
	LA1_: ;
	return result;
}

N_LIB_PRIVATE N_NIMCALL(NI, nospwaitForExit)(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p, NI timeout) {
	NI result;
	int T72_;
{	result = (NI)0;
	{
		int T5_;
		if (!(*p).exitFlag) goto LA3_;
		T5_ = (int)0;
		T5_ = exitStatus_UXYeVHPMK6MYSBxiXhkNfQ((*p).exitStatus);
		result = ((NI) (T5_));
		goto BeforeRet_;
	}
	LA3_: ;
	{
		int status;
		if (!(timeout == ((NI) -1))) goto LA8_;
		status = ((int) 1);
		{
			pid_t T12_;
			NI32 T15_;
			T12_ = (pid_t)0;
			T12_ = waitpid((*p).id, (&status), ((int) 0));
			if (!(T12_ < ((NI32) 0))) goto LA13_;
			T15_ = (NI32)0;
			T15_ = osLastError_tNPXXFl9cb3BG0pJKzUn9bew();
			raiseOSError_bEwAamo1N7TKcaU9akpiyIg(T15_, ((NimStringDesc*) NIM_NIL));
		}
		LA13_: ;
		(*p).exitFlag = NIM_TRUE;
		(*p).exitStatus = status;
	}
	goto LA6_;
	LA8_: ;
	{
		int kqFD;
		struct kevent kevIn;
		struct kevent kevOut;
		struct timespec tmspec;
		TSafePoint TM_HZdw8BhppcTQo8DIK46LSg_15;
		kqFD = kqueue();
		{
			NI32 T21_;
			if (!(kqFD == ((NI32) -1))) goto LA19_;
			T21_ = (NI32)0;
			T21_ = osLastError_tNPXXFl9cb3BG0pJKzUn9bew();
			raiseOSError_bEwAamo1N7TKcaU9akpiyIg(T21_, ((NimStringDesc*) NIM_NIL));
		}
		LA19_: ;
		nimZeroMem((void*)(&kevIn), sizeof(struct kevent));
		kevIn.ident = ((NU) ((*p).id));
		kevIn.filter = ((short) -5);
		kevIn.flags = ((unsigned short) 1);
		kevIn.fflags = ((NU32) IL64(2147483648));
		nimZeroMem((void*)(&kevOut), sizeof(struct kevent));
		nimZeroMem((void*)(&tmspec), sizeof(struct timespec));
		{
			if (!(((NI) 1000) <= timeout)) goto LA24_;
			tmspec.tv_sec = (NI)(timeout / ((NI) 1000));
			tmspec.tv_nsec = (NI)((NI)((NU32)(timeout) % (NU32)(((NI) 1000))) * ((NI) 1000000));
		}
		goto LA22_;
		LA24_: ;
		{
			tmspec.tv_sec = ((long) 0);
			tmspec.tv_nsec = (NI)(timeout * ((NI) 1000000));
		}
		LA22_: ;
		pushSafePoint(&TM_HZdw8BhppcTQo8DIK46LSg_15);
		TM_HZdw8BhppcTQo8DIK46LSg_15.status = _setjmp(TM_HZdw8BhppcTQo8DIK46LSg_15.context);
		if (TM_HZdw8BhppcTQo8DIK46LSg_15.status == 0) {
			{
				while (1) {
					int status_2;
					int count;
					status_2 = ((int) 1);
					count = kevent(kqFD, (&kevIn), ((int) 1), (&kevOut), ((int) 1), (&tmspec));
					{
						NI32 err;
						if (!(count < ((NI32) 0))) goto LA32_;
						err = osLastError_tNPXXFl9cb3BG0pJKzUn9bew();
						{
							NI32 T38_;
							if (!!((err == EINTR))) goto LA36_;
							T38_ = (NI32)0;
							T38_ = osLastError_tNPXXFl9cb3BG0pJKzUn9bew();
							raiseOSError_bEwAamo1N7TKcaU9akpiyIg(T38_, ((NimStringDesc*) NIM_NIL));
						}
						LA36_: ;
					}
					goto LA30_;
					LA32_: ;
					{
						if (!(count == ((NI32) 0))) goto LA40_;
						{
							int T44_;
							NI32 T47_;
							T44_ = (int)0;
							T44_ = kill((*p).id, SIGKILL);
							if (!(T44_ == ((NI32) -1))) goto LA45_;
							T47_ = (NI32)0;
							T47_ = osLastError_tNPXXFl9cb3BG0pJKzUn9bew();
							raiseOSError_bEwAamo1N7TKcaU9akpiyIg(T47_, ((NimStringDesc*) NIM_NIL));
						}
						LA45_: ;
						{
							pid_t T50_;
							NI32 T53_;
							T50_ = (pid_t)0;
							T50_ = waitpid((*p).id, (&status_2), ((int) 0));
							if (!(T50_ < ((NI32) 0))) goto LA51_;
							T53_ = (NI32)0;
							T53_ = osLastError_tNPXXFl9cb3BG0pJKzUn9bew();
							raiseOSError_bEwAamo1N7TKcaU9akpiyIg(T53_, ((NimStringDesc*) NIM_NIL));
						}
						LA51_: ;
						(*p).exitFlag = NIM_TRUE;
						(*p).exitStatus = status_2;
						goto LA28;
					}
					goto LA30_;
					LA40_: ;
					{
						{
							NIM_BOOL T57_;
							T57_ = (NIM_BOOL)0;
							T57_ = (kevOut.ident == ((NU) ((*p).id)));
							if (!(T57_)) goto LA58_;
							T57_ = (kevOut.filter == ((NI16) -5));
							LA58_: ;
							if (!T57_) goto LA59_;
							{
								pid_t T63_;
								NI32 T66_;
								T63_ = (pid_t)0;
								T63_ = waitpid((*p).id, (&status_2), ((int) 0));
								if (!(T63_ < ((NI32) 0))) goto LA64_;
								T66_ = (NI32)0;
								T66_ = osLastError_tNPXXFl9cb3BG0pJKzUn9bew();
								raiseOSError_bEwAamo1N7TKcaU9akpiyIg(T66_, ((NimStringDesc*) NIM_NIL));
							}
							LA64_: ;
							(*p).exitFlag = NIM_TRUE;
							(*p).exitStatus = status_2;
							goto LA28;
						}
						goto LA55_;
						LA59_: ;
						{
							NI32 T68_;
							T68_ = (NI32)0;
							T68_ = osLastError_tNPXXFl9cb3BG0pJKzUn9bew();
							raiseOSError_bEwAamo1N7TKcaU9akpiyIg(T68_, ((NimStringDesc*) NIM_NIL));
						}
						LA55_: ;
					}
					LA30_: ;
				}
			} LA28: ;
			popSafePoint();
		}
		else {
			popSafePoint();
		}
		{
			int T71_;
			T71_ = (int)0;
			T71_ = close(kqFD);
			(void)(T71_);
		}
		if (TM_HZdw8BhppcTQo8DIK46LSg_15.status != 0) reraiseException();
	}
	LA6_: ;
	T72_ = (int)0;
	T72_ = exitStatus_UXYeVHPMK6MYSBxiXhkNfQ((*p).exitStatus);
	result = ((NI) (T72_));
	}BeforeRet_: ;
	return result;
}

N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, isExitStatus_LfdXbSxcFCX8jeiWMQhmLg)(int status) {
	NIM_BOOL result;
	NIM_BOOL T1_;
	result = (NIM_BOOL)0;
	T1_ = (NIM_BOOL)0;
	T1_ = WIFEXITED(status);
	if (T1_) goto LA2_;
	T1_ = WIFSIGNALED(status);
	LA2_: ;
	result = T1_;
	return result;
}

N_LIB_PRIVATE N_NIMCALL(NI, nosppeekExitCode)(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p) {
	NI result;
	int status;
	pid_t ret;
{	result = (NI)0;
	status = ((int) 0);
	result = ((NI) -1);
	{
		int T5_;
		if (!(*p).exitFlag) goto LA3_;
		T5_ = (int)0;
		T5_ = exitStatus_UXYeVHPMK6MYSBxiXhkNfQ((*p).exitStatus);
		result = ((NI) (T5_));
		goto BeforeRet_;
	}
	LA3_: ;
	ret = waitpid((*p).id, (&status), WNOHANG);
	{
		if (!(((NI32) 0) < ret)) goto LA8_;
		{
			NIM_BOOL T12_;
			int T15_;
			T12_ = (NIM_BOOL)0;
			T12_ = isExitStatus_LfdXbSxcFCX8jeiWMQhmLg(status);
			if (!T12_) goto LA13_;
			(*p).exitFlag = NIM_TRUE;
			(*p).exitStatus = status;
			T15_ = (int)0;
			T15_ = exitStatus_UXYeVHPMK6MYSBxiXhkNfQ(status);
			result = ((NI) (T15_));
		}
		LA13_: ;
	}
	LA8_: ;
	}BeforeRet_: ;
	return result;
}

N_LIB_PRIVATE N_NIMCALL(NI, nospcountProcessors)(void) {
	NI result;
	result = (NI)0;
	result = ncpicountProcessors();
	return result;
}

N_LIB_PRIVATE N_NIMCALL(NI, nospexecCmd)(NimStringDesc* command) {
	NI result;
	int T1_;
	result = (NI)0;
	T1_ = (int)0;
	T1_ = system(nimToCStringConv(command));
	result = ((NI) (T1_));
	return result;
}

static N_INLINE(void, incRef_9cAA5YuQAAC3MVbnGeV86swsystem)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c) {
	(*c).refcount = (NI)((NU32)((*c).refcount) + (NU32)(((NI) 8)));
}

static N_INLINE(void, decRef_MV4BBk6J1qu70IbBxwEn4wsystem)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c) {
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA3_;
		rtlAddZCT_MV4BBk6J1qu70IbBxwEn4w_2system(c);
	}
	LA3_: ;
}

static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* T5_;
		if (!!((src == NIM_NIL))) goto LA3_;
		T5_ = (tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*)0;
		T5_ = usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem(src);
		incRef_9cAA5YuQAAC3MVbnGeV86swsystem(T5_);
	}
	LA3_: ;
	{
		tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* T10_;
		if (!!(((*dest) == NIM_NIL))) goto LA8_;
		T10_ = (tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*)0;
		T10_ = usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem((*dest));
		decRef_MV4BBk6J1qu70IbBxwEn4wsystem(T10_);
	}
	LA8_: ;
	(*dest) = src;
}

N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosprunning)(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	{
		if (!(*p).exitFlag) goto LA3_;
		result = NIM_FALSE;
		goto BeforeRet_;
	}
	goto LA1_;
	LA3_: ;
	{
		int status;
		pid_t ret;
		status = ((int) 1);
		ret = waitpid((*p).id, (&status), WNOHANG);
		{
			if (!(((NI) (ret)) == ((NI) ((*p).id)))) goto LA8_;
			{
				NIM_BOOL T12_;
				T12_ = (NIM_BOOL)0;
				T12_ = isExitStatus_LfdXbSxcFCX8jeiWMQhmLg(status);
				if (!T12_) goto LA13_;
				(*p).exitFlag = NIM_TRUE;
				(*p).exitStatus = status;
				result = NIM_FALSE;
				goto BeforeRet_;
			}
			goto LA10_;
			LA13_: ;
			{
				result = NIM_TRUE;
				goto BeforeRet_;
			}
			LA10_: ;
		}
		goto LA6_;
		LA8_: ;
		{
			if (!(ret == ((NI32) 0))) goto LA17_;
			result = NIM_TRUE;
			goto BeforeRet_;
		}
		goto LA6_;
		LA17_: ;
		{
			NI32 T20_;
			T20_ = (NI32)0;
			T20_ = osLastError_tNPXXFl9cb3BG0pJKzUn9bew();
			raiseOSError_bEwAamo1N7TKcaU9akpiyIg(T20_, ((NimStringDesc*) NIM_NIL));
		}
		LA6_: ;
	}
	LA1_: ;
	}BeforeRet_: ;
	return result;
}

N_LIB_PRIVATE N_NIMCALL(void, nospclose)(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p) {
	{
		if (!!((((*p).options &(1U<<((NU)(((tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA) 4))&7U)))!=0))) goto LA3_;
		{
			if (!!(((*p).inStream == NIM_NIL))) goto LA7_;
			close_Xz3YiEzNrT9cUBndwi4hNjw((*p).inStream);
		}
		goto LA5_;
		LA7_: ;
		{
			int T10_;
			T10_ = (int)0;
			T10_ = close((*p).inHandle);
			(void)(T10_);
		}
		LA5_: ;
		{
			if (!!(((*p).outStream == NIM_NIL))) goto LA13_;
			close_Xz3YiEzNrT9cUBndwi4hNjw((*p).outStream);
		}
		goto LA11_;
		LA13_: ;
		{
			int T16_;
			T16_ = (int)0;
			T16_ = close((*p).outHandle);
			(void)(T16_);
		}
		LA11_: ;
		{
			if (!!(((*p).errStream == NIM_NIL))) goto LA19_;
			close_Xz3YiEzNrT9cUBndwi4hNjw((*p).errStream);
		}
		goto LA17_;
		LA19_: ;
		{
			int T22_;
			T22_ = (int)0;
			T22_ = close((*p).errHandle);
			(void)(T22_);
		}
		LA17_: ;
	}
	LA3_: ;
}

N_LIB_PRIVATE N_NIMCALL(NI, nospexecProcesses)(NimStringDesc** cmds, NI cmdsLen_0, tySet_tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA options, NI n, tyProc_kElEuvYkhDcTHhB3d89aMYA beforeRunEvent, tyProc_FM4RO2zoXex9caTkjWpBmsw afterRunEvent) {
	NI result;
	result = (NI)0;
	{
		NI i;
		tySequence_PrBYolTs4TOSgE8v5oqDUQ* q;
		tySequence_qwqHTkRvwhrRyENtudHQ7g* idxs;
		NI m;
		NI ecount;
		if (!(((NI) 1) < n)) goto LA3_;
		i = ((NI) 0);
		q = newSeq_sR1OBdsDRiRfIJbzk6iUkg(((NI) (n)));
		idxs = newSeq_BlrccvgyrVECLCXlhRK9cMw(((NI) (n)));
		m = ((n <= cmdsLen_0) ? n : cmdsLen_0);
		{
			while (1) {
				tyArray_8ZvwQIddfpj2THRVPsFzIQ T11_;
				if (!(i < m)) goto LA6;
				{
					if (!!((beforeRunEvent.ClP_0 == TM_HZdw8BhppcTQo8DIK46LSg_16.ClP_0 && beforeRunEvent.ClE_0 == TM_HZdw8BhppcTQo8DIK46LSg_16.ClE_0))) goto LA9_;
					beforeRunEvent.ClE_0? beforeRunEvent.ClP_0(i, beforeRunEvent.ClE_0):((TM_HZdw8BhppcTQo8DIK46LSg_17)(beforeRunEvent.ClP_0))(i);
				}
				LA9_: ;
				nimZeroMem((void*)T11_, sizeof(tyArray_8ZvwQIddfpj2THRVPsFzIQ));
				asgnRef((void**) (&q->data[i]), nospstartProcess(cmds[i], ((NimStringDesc*) NIM_NIL), T11_, 0, NIM_NIL, (options | 4)));
				idxs->data[i] = i;
				i += ((NI) 1);
			} LA6: ;
		}
		ecount = cmdsLen_0;
		{
			while (1) {
				if (!(((NI) 0) < ecount)) goto LA13;
				{
					NI rexit;
					int status;
					pid_t res;
					rexit = ((NI) -1);
					status = ((int) 1);
					res = waitpid(((pid_t) -1), (&status), ((int) 0));
					{
						if (!(((NI32) 0) < res)) goto LA17_;
						{
							NI r;
							NI colontmp_;
							NI res_2;
							r = (NI)0;
							colontmp_ = (NI)0;
							colontmp_ = (NI)(m - ((NI) 1));
							res_2 = ((NI) 0);
							{
								while (1) {
									if (!(res_2 <= colontmp_)) goto LA21;
									r = res_2;
									{
										NIM_BOOL T24_;
										T24_ = (NIM_BOOL)0;
										T24_ = !((q->data[r] == 0));
										if (!(T24_)) goto LA25_;
										T24_ = ((*q->data[r]).id == res);
										LA25_: ;
										if (!T24_) goto LA26_;
										{
											NIM_BOOL T30_;
											T30_ = (NIM_BOOL)0;
											T30_ = WIFEXITED(status);
											if (T30_) goto LA31_;
											T30_ = WIFSIGNALED(status);
											LA31_: ;
											if (!T30_) goto LA32_;
											(*q->data[r]).exitFlag = NIM_TRUE;
											(*q->data[r]).exitStatus = status;
											rexit = r;
											goto LA19;
										}
										LA32_: ;
									}
									LA26_: ;
									res_2 += ((NI) 1);
								} LA21: ;
							}
						} LA19: ;
					}
					goto LA15_;
					LA17_: ;
					{
						NI32 err;
						err = osLastError_tNPXXFl9cb3BG0pJKzUn9bew();
						{
							if (!(err == ECHILD)) goto LA37_;
							{
								NI r_2;
								NI colontmp__2;
								NI res_3;
								r_2 = (NI)0;
								colontmp__2 = (NI)0;
								colontmp__2 = (NI)(m - ((NI) 1));
								res_3 = ((NI) 0);
								{
									while (1) {
										if (!(res_3 <= colontmp__2)) goto LA41;
										r_2 = res_3;
										{
											NIM_BOOL T44_;
											NIM_BOOL T46_;
											T44_ = (NIM_BOOL)0;
											T44_ = !((q->data[r_2] == 0));
											if (!(T44_)) goto LA45_;
											T46_ = (NIM_BOOL)0;
											T46_ = nosprunning(q->data[r_2]);
											T44_ = !(T46_);
											LA45_: ;
											if (!T44_) goto LA47_;
											(*q->data[r_2]).exitFlag = NIM_TRUE;
											(*q->data[r_2]).exitStatus = status;
											rexit = r_2;
											goto LA39;
										}
										LA47_: ;
										res_3 += ((NI) 1);
									} LA41: ;
								}
							} LA39: ;
						}
						goto LA35_;
						LA37_: ;
						{
							if (!(err == EINTR)) goto LA50_;
							goto LA14;
						}
						goto LA35_;
						LA50_: ;
						{
							raiseOSError_bEwAamo1N7TKcaU9akpiyIg(err, ((NimStringDesc*) NIM_NIL));
						}
						LA35_: ;
					}
					LA15_: ;
					{
						NI T57_;
						if (!(((NI) 0) <= rexit)) goto LA55_;
						T57_ = (NI)0;
						T57_ = nosppeekExitCode(q->data[rexit]);
						result = ((result >= (T57_ > 0? (T57_) : -(T57_))) ? result : (T57_ > 0? (T57_) : -(T57_)));
						{
							if (!!((afterRunEvent.ClP_0 == TM_HZdw8BhppcTQo8DIK46LSg_18.ClP_0 && afterRunEvent.ClE_0 == TM_HZdw8BhppcTQo8DIK46LSg_18.ClE_0))) goto LA60_;
							afterRunEvent.ClE_0? afterRunEvent.ClP_0(idxs->data[rexit], q->data[rexit], afterRunEvent.ClE_0):((TM_HZdw8BhppcTQo8DIK46LSg_19)(afterRunEvent.ClP_0))(idxs->data[rexit], q->data[rexit]);
						}
						LA60_: ;
						nospclose(q->data[rexit]);
						{
							tyArray_8ZvwQIddfpj2THRVPsFzIQ T70_;
							if (!(i < cmdsLen_0)) goto LA64_;
							{
								if (!!((beforeRunEvent.ClP_0 == TM_HZdw8BhppcTQo8DIK46LSg_16.ClP_0 && beforeRunEvent.ClE_0 == TM_HZdw8BhppcTQo8DIK46LSg_16.ClE_0))) goto LA68_;
								beforeRunEvent.ClE_0? beforeRunEvent.ClP_0(i, beforeRunEvent.ClE_0):((TM_HZdw8BhppcTQo8DIK46LSg_20)(beforeRunEvent.ClP_0))(i);
							}
							LA68_: ;
							nimZeroMem((void*)T70_, sizeof(tyArray_8ZvwQIddfpj2THRVPsFzIQ));
							asgnRef((void**) (&q->data[rexit]), nospstartProcess(cmds[i], ((NimStringDesc*) NIM_NIL), T70_, 0, NIM_NIL, (options | 4)));
							idxs->data[rexit] = i;
							i += ((NI) 1);
						}
						goto LA62_;
						LA64_: ;
						{
							asgnRef((void**) (&q->data[rexit]), NIM_NIL);
						}
						LA62_: ;
						ecount -= ((NI) 1);
					}
					LA55_: ;
				} LA14: ;
			} LA13: ;
		}
	}
	goto LA1_;
	LA3_: ;
	{
		{
			NI i_2;
			NI colontmp__3;
			NI res_4;
			i_2 = (NI)0;
			colontmp__3 = (NI)0;
			colontmp__3 = (cmdsLen_0-1);
			res_4 = ((NI) 0);
			{
				while (1) {
					tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg* p;
					tyArray_8ZvwQIddfpj2THRVPsFzIQ T80_;
					NI T81_;
					if (!(res_4 <= colontmp__3)) goto LA75;
					i_2 = res_4;
					{
						if (!!((beforeRunEvent.ClP_0 == TM_HZdw8BhppcTQo8DIK46LSg_16.ClP_0 && beforeRunEvent.ClE_0 == TM_HZdw8BhppcTQo8DIK46LSg_16.ClE_0))) goto LA78_;
						beforeRunEvent.ClE_0? beforeRunEvent.ClP_0(i_2, beforeRunEvent.ClE_0):((TM_HZdw8BhppcTQo8DIK46LSg_21)(beforeRunEvent.ClP_0))(i_2);
					}
					LA78_: ;
					nimZeroMem((void*)T80_, sizeof(tyArray_8ZvwQIddfpj2THRVPsFzIQ));
					p = nospstartProcess(cmds[i_2], ((NimStringDesc*) NIM_NIL), T80_, 0, NIM_NIL, (options | 4));
					T81_ = (NI)0;
					T81_ = nospwaitForExit(p, ((NI) -1));
					result = (((T81_ > 0? (T81_) : -(T81_)) >= result) ? (T81_ > 0? (T81_) : -(T81_)) : result);
					{
						if (!!((afterRunEvent.ClP_0 == TM_HZdw8BhppcTQo8DIK46LSg_18.ClP_0 && afterRunEvent.ClE_0 == TM_HZdw8BhppcTQo8DIK46LSg_18.ClE_0))) goto LA84_;
						afterRunEvent.ClE_0? afterRunEvent.ClP_0(i_2, p, afterRunEvent.ClE_0):((TM_HZdw8BhppcTQo8DIK46LSg_22)(afterRunEvent.ClP_0))(i_2, p);
					}
					LA84_: ;
					nospclose(p);
					res_4 += ((NI) 1);
				} LA75: ;
			}
		}
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, stdlib_osprocInit000)(void) {
{
	TFrame FR_; FR_.len = 0;
}
}

N_LIB_PRIVATE N_NIMCALL(void, stdlib_osprocDatInit000)(void) {
static TNimNode* TM_HZdw8BhppcTQo8DIK46LSg_2[10];
static TNimNode* TM_HZdw8BhppcTQo8DIK46LSg_3[7];
NI TM_HZdw8BhppcTQo8DIK46LSg_5;
static char* NIM_CONST TM_HZdw8BhppcTQo8DIK46LSg_4[7] = {
"poEchoCmd", 
"poUsePath", 
"poEvalCommand", 
"poStdErrToStdOut", 
"poParentStreams", 
"poInteractive", 
"poDemon"};
static TNimNode* TM_HZdw8BhppcTQo8DIK46LSg_12[9];
static TNimNode TM_HZdw8BhppcTQo8DIK46LSg_0[30];
NTI_2rGNQnv9bU4hanI2g3svReg_.size = sizeof(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg);
NTI_2rGNQnv9bU4hanI2g3svReg_.kind = 17;
NTI_2rGNQnv9bU4hanI2g3svReg_.base = (&NTI_ytyiCJqK439aF9cIibuRVpAg_);
TM_HZdw8BhppcTQo8DIK46LSg_2[0] = &TM_HZdw8BhppcTQo8DIK46LSg_0[1];
TM_HZdw8BhppcTQo8DIK46LSg_0[1].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[1].offset = offsetof(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg, inHandle);
TM_HZdw8BhppcTQo8DIK46LSg_0[1].typ = (&NTI_UtShRB9b1wZO9cvpdowm9cefA_);
TM_HZdw8BhppcTQo8DIK46LSg_0[1].name = "inHandle";
TM_HZdw8BhppcTQo8DIK46LSg_2[1] = &TM_HZdw8BhppcTQo8DIK46LSg_0[2];
TM_HZdw8BhppcTQo8DIK46LSg_0[2].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[2].offset = offsetof(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg, outHandle);
TM_HZdw8BhppcTQo8DIK46LSg_0[2].typ = (&NTI_UtShRB9b1wZO9cvpdowm9cefA_);
TM_HZdw8BhppcTQo8DIK46LSg_0[2].name = "outHandle";
TM_HZdw8BhppcTQo8DIK46LSg_2[2] = &TM_HZdw8BhppcTQo8DIK46LSg_0[3];
TM_HZdw8BhppcTQo8DIK46LSg_0[3].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[3].offset = offsetof(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg, errHandle);
TM_HZdw8BhppcTQo8DIK46LSg_0[3].typ = (&NTI_UtShRB9b1wZO9cvpdowm9cefA_);
TM_HZdw8BhppcTQo8DIK46LSg_0[3].name = "errHandle";
TM_HZdw8BhppcTQo8DIK46LSg_2[3] = &TM_HZdw8BhppcTQo8DIK46LSg_0[4];
TM_HZdw8BhppcTQo8DIK46LSg_0[4].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[4].offset = offsetof(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg, inStream);
TM_HZdw8BhppcTQo8DIK46LSg_0[4].typ = (&NTI_1G0jiQbe7KwD5ADza5AZaw_);
TM_HZdw8BhppcTQo8DIK46LSg_0[4].name = "inStream";
TM_HZdw8BhppcTQo8DIK46LSg_2[4] = &TM_HZdw8BhppcTQo8DIK46LSg_0[5];
TM_HZdw8BhppcTQo8DIK46LSg_0[5].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[5].offset = offsetof(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg, outStream);
TM_HZdw8BhppcTQo8DIK46LSg_0[5].typ = (&NTI_1G0jiQbe7KwD5ADza5AZaw_);
TM_HZdw8BhppcTQo8DIK46LSg_0[5].name = "outStream";
TM_HZdw8BhppcTQo8DIK46LSg_2[5] = &TM_HZdw8BhppcTQo8DIK46LSg_0[6];
TM_HZdw8BhppcTQo8DIK46LSg_0[6].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[6].offset = offsetof(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg, errStream);
TM_HZdw8BhppcTQo8DIK46LSg_0[6].typ = (&NTI_1G0jiQbe7KwD5ADza5AZaw_);
TM_HZdw8BhppcTQo8DIK46LSg_0[6].name = "errStream";
TM_HZdw8BhppcTQo8DIK46LSg_2[6] = &TM_HZdw8BhppcTQo8DIK46LSg_0[7];
TM_HZdw8BhppcTQo8DIK46LSg_0[7].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[7].offset = offsetof(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg, id);
TM_HZdw8BhppcTQo8DIK46LSg_0[7].typ = (&NTI_r9bTMVI8f19ah9b11jMgY4kPg_);
TM_HZdw8BhppcTQo8DIK46LSg_0[7].name = "id";
TM_HZdw8BhppcTQo8DIK46LSg_2[7] = &TM_HZdw8BhppcTQo8DIK46LSg_0[8];
TM_HZdw8BhppcTQo8DIK46LSg_0[8].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[8].offset = offsetof(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg, exitStatus);
TM_HZdw8BhppcTQo8DIK46LSg_0[8].typ = (&NTI_nlCscttRCss70IBTyuBqnA_);
TM_HZdw8BhppcTQo8DIK46LSg_0[8].name = "exitStatus";
TM_HZdw8BhppcTQo8DIK46LSg_2[8] = &TM_HZdw8BhppcTQo8DIK46LSg_0[9];
TM_HZdw8BhppcTQo8DIK46LSg_0[9].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[9].offset = offsetof(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg, exitFlag);
TM_HZdw8BhppcTQo8DIK46LSg_0[9].typ = (&NTI_VaVACK0bpYmqIQ0mKcHfQQ_);
TM_HZdw8BhppcTQo8DIK46LSg_0[9].name = "exitFlag";
TM_HZdw8BhppcTQo8DIK46LSg_2[9] = &TM_HZdw8BhppcTQo8DIK46LSg_0[10];
NTI_bnU6W8LhTMnT4JaSWtGlSA_.size = sizeof(tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA);
NTI_bnU6W8LhTMnT4JaSWtGlSA_.kind = 14;
NTI_bnU6W8LhTMnT4JaSWtGlSA_.base = 0;
NTI_bnU6W8LhTMnT4JaSWtGlSA_.flags = 3;
for (TM_HZdw8BhppcTQo8DIK46LSg_5 = 0; TM_HZdw8BhppcTQo8DIK46LSg_5 < 7; TM_HZdw8BhppcTQo8DIK46LSg_5++) {
TM_HZdw8BhppcTQo8DIK46LSg_0[TM_HZdw8BhppcTQo8DIK46LSg_5+11].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[TM_HZdw8BhppcTQo8DIK46LSg_5+11].offset = TM_HZdw8BhppcTQo8DIK46LSg_5;
TM_HZdw8BhppcTQo8DIK46LSg_0[TM_HZdw8BhppcTQo8DIK46LSg_5+11].name = TM_HZdw8BhppcTQo8DIK46LSg_4[TM_HZdw8BhppcTQo8DIK46LSg_5];
TM_HZdw8BhppcTQo8DIK46LSg_3[TM_HZdw8BhppcTQo8DIK46LSg_5] = &TM_HZdw8BhppcTQo8DIK46LSg_0[TM_HZdw8BhppcTQo8DIK46LSg_5+11];
}
TM_HZdw8BhppcTQo8DIK46LSg_0[18].len = 7; TM_HZdw8BhppcTQo8DIK46LSg_0[18].kind = 2; TM_HZdw8BhppcTQo8DIK46LSg_0[18].sons = &TM_HZdw8BhppcTQo8DIK46LSg_3[0];
NTI_bnU6W8LhTMnT4JaSWtGlSA_.node = &TM_HZdw8BhppcTQo8DIK46LSg_0[18];
NTI_HlmBYNr2gdAZMXOsuiSZ0A_.size = sizeof(tySet_tyEnum_ProcessOption_bnU6W8LhTMnT4JaSWtGlSA);
NTI_HlmBYNr2gdAZMXOsuiSZ0A_.kind = 19;
NTI_HlmBYNr2gdAZMXOsuiSZ0A_.base = (&NTI_bnU6W8LhTMnT4JaSWtGlSA_);
NTI_HlmBYNr2gdAZMXOsuiSZ0A_.flags = 3;
TM_HZdw8BhppcTQo8DIK46LSg_0[19].len = 0; TM_HZdw8BhppcTQo8DIK46LSg_0[19].kind = 0;
NTI_HlmBYNr2gdAZMXOsuiSZ0A_.node = &TM_HZdw8BhppcTQo8DIK46LSg_0[19];
TM_HZdw8BhppcTQo8DIK46LSg_0[10].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[10].offset = offsetof(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg, options);
TM_HZdw8BhppcTQo8DIK46LSg_0[10].typ = (&NTI_HlmBYNr2gdAZMXOsuiSZ0A_);
TM_HZdw8BhppcTQo8DIK46LSg_0[10].name = "options";
TM_HZdw8BhppcTQo8DIK46LSg_0[0].len = 10; TM_HZdw8BhppcTQo8DIK46LSg_0[0].kind = 2; TM_HZdw8BhppcTQo8DIK46LSg_0[0].sons = &TM_HZdw8BhppcTQo8DIK46LSg_2[0];
NTI_2rGNQnv9bU4hanI2g3svReg_.node = &TM_HZdw8BhppcTQo8DIK46LSg_0[0];
NTI_lw7iqc9cC7bi1oOZOAlJkJA_.size = sizeof(tyObject_ProcessObj_2rGNQnv9bU4hanI2g3svReg*);
NTI_lw7iqc9cC7bi1oOZOAlJkJA_.kind = 22;
NTI_lw7iqc9cC7bi1oOZOAlJkJA_.base = (&NTI_2rGNQnv9bU4hanI2g3svReg_);
NTI_lw7iqc9cC7bi1oOZOAlJkJA_.marker = Marker_tyRef_lw7iqc9cC7bi1oOZOAlJkJA;
NTI_xgRnKnLIYRtnOkshMKhc9cA_.size = sizeof(tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA);
NTI_xgRnKnLIYRtnOkshMKhc9cA_.kind = 18;
NTI_xgRnKnLIYRtnOkshMKhc9cA_.base = 0;
NTI_xgRnKnLIYRtnOkshMKhc9cA_.flags = 2;
TM_HZdw8BhppcTQo8DIK46LSg_12[0] = &TM_HZdw8BhppcTQo8DIK46LSg_0[21];
TM_HZdw8BhppcTQo8DIK46LSg_0[21].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[21].offset = offsetof(tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA, sysCommand);
TM_HZdw8BhppcTQo8DIK46LSg_0[21].typ = (&NTI_77mFvmsOLKik79ci2hXkHEg_);
TM_HZdw8BhppcTQo8DIK46LSg_0[21].name = "sysCommand";
TM_HZdw8BhppcTQo8DIK46LSg_12[1] = &TM_HZdw8BhppcTQo8DIK46LSg_0[22];
TM_HZdw8BhppcTQo8DIK46LSg_0[22].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[22].offset = offsetof(tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA, sysArgs);
TM_HZdw8BhppcTQo8DIK46LSg_0[22].typ = (&NTI_Txh9bzc0AU9bDpIbDdD6jBsQ_);
TM_HZdw8BhppcTQo8DIK46LSg_0[22].name = "sysArgs";
TM_HZdw8BhppcTQo8DIK46LSg_12[2] = &TM_HZdw8BhppcTQo8DIK46LSg_0[23];
TM_HZdw8BhppcTQo8DIK46LSg_0[23].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[23].offset = offsetof(tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA, sysEnv);
TM_HZdw8BhppcTQo8DIK46LSg_0[23].typ = (&NTI_Txh9bzc0AU9bDpIbDdD6jBsQ_);
TM_HZdw8BhppcTQo8DIK46LSg_0[23].name = "sysEnv";
TM_HZdw8BhppcTQo8DIK46LSg_12[3] = &TM_HZdw8BhppcTQo8DIK46LSg_0[24];
TM_HZdw8BhppcTQo8DIK46LSg_0[24].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[24].offset = offsetof(tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA, workingDir);
TM_HZdw8BhppcTQo8DIK46LSg_0[24].typ = (&NTI_S9agCYBinaYZnGWcjTdxclg_);
TM_HZdw8BhppcTQo8DIK46LSg_0[24].name = "workingDir";
TM_HZdw8BhppcTQo8DIK46LSg_12[4] = &TM_HZdw8BhppcTQo8DIK46LSg_0[25];
NTI_SKEqGXcReU4NvbQlH779b5Q_.size = sizeof(tyArray_SKEqGXcReU4NvbQlH779b5Q);
NTI_SKEqGXcReU4NvbQlH779b5Q_.kind = 16;
NTI_SKEqGXcReU4NvbQlH779b5Q_.base = (&NTI_nlCscttRCss70IBTyuBqnA_);
NTI_SKEqGXcReU4NvbQlH779b5Q_.flags = 3;
TM_HZdw8BhppcTQo8DIK46LSg_0[25].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[25].offset = offsetof(tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA, pStdin);
TM_HZdw8BhppcTQo8DIK46LSg_0[25].typ = (&NTI_SKEqGXcReU4NvbQlH779b5Q_);
TM_HZdw8BhppcTQo8DIK46LSg_0[25].name = "pStdin";
TM_HZdw8BhppcTQo8DIK46LSg_12[5] = &TM_HZdw8BhppcTQo8DIK46LSg_0[26];
TM_HZdw8BhppcTQo8DIK46LSg_0[26].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[26].offset = offsetof(tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA, pStdout);
TM_HZdw8BhppcTQo8DIK46LSg_0[26].typ = (&NTI_SKEqGXcReU4NvbQlH779b5Q_);
TM_HZdw8BhppcTQo8DIK46LSg_0[26].name = "pStdout";
TM_HZdw8BhppcTQo8DIK46LSg_12[6] = &TM_HZdw8BhppcTQo8DIK46LSg_0[27];
TM_HZdw8BhppcTQo8DIK46LSg_0[27].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[27].offset = offsetof(tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA, pStderr);
TM_HZdw8BhppcTQo8DIK46LSg_0[27].typ = (&NTI_SKEqGXcReU4NvbQlH779b5Q_);
TM_HZdw8BhppcTQo8DIK46LSg_0[27].name = "pStderr";
TM_HZdw8BhppcTQo8DIK46LSg_12[7] = &TM_HZdw8BhppcTQo8DIK46LSg_0[28];
TM_HZdw8BhppcTQo8DIK46LSg_0[28].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[28].offset = offsetof(tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA, pErrorPipe);
TM_HZdw8BhppcTQo8DIK46LSg_0[28].typ = (&NTI_SKEqGXcReU4NvbQlH779b5Q_);
TM_HZdw8BhppcTQo8DIK46LSg_0[28].name = "pErrorPipe";
TM_HZdw8BhppcTQo8DIK46LSg_12[8] = &TM_HZdw8BhppcTQo8DIK46LSg_0[29];
TM_HZdw8BhppcTQo8DIK46LSg_0[29].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[29].offset = offsetof(tyObject_StartProcessData_xgRnKnLIYRtnOkshMKhc9cA, options);
TM_HZdw8BhppcTQo8DIK46LSg_0[29].typ = (&NTI_HlmBYNr2gdAZMXOsuiSZ0A_);
TM_HZdw8BhppcTQo8DIK46LSg_0[29].name = "options";
TM_HZdw8BhppcTQo8DIK46LSg_0[20].len = 9; TM_HZdw8BhppcTQo8DIK46LSg_0[20].kind = 2; TM_HZdw8BhppcTQo8DIK46LSg_0[20].sons = &TM_HZdw8BhppcTQo8DIK46LSg_12[0];
NTI_xgRnKnLIYRtnOkshMKhc9cA_.node = &TM_HZdw8BhppcTQo8DIK46LSg_0[20];
}

