/* Generated by Nim Compiler v1.2.4 */
/*   (c) 2020 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_INTBITS 64
#define NIM_EmulateOverflowChecks

#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
#define nimfr_(x, y)
#define nimln_(x, y)
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 tyObject_StartProcessData__xgRnKnLIYRtnOkshMKhc9cA tyObject_StartProcessData__xgRnKnLIYRtnOkshMKhc9cA;
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_HSlice__EE5dzjqoOrHT6HJhIPXAvA tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA;
typedef struct tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ;
typedef struct tyTuple__XOVT24GHXwqiEj5GCsEGCA tyTuple__XOVT24GHXwqiEj5GCsEGCA;
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;
pid_t id;
tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* inStream;
tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* outStream;
tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* errStream;
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_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;
};
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;
Exception* up;
};
struct TSafePoint {
TSafePoint* prev;
NI status;
jmp_buf context;
};
typedef NCSTRING tyUncheckedArray__nvS6J9clHMUMHfoZd8Ad2zg[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;
};
typedef NimStringDesc* tyArray__Re75IspeoxXy2oCZHwcRrA[2];
typedef NimStringDesc* tyArray__24KAM9afIUgUaqBaEBB6r9bg[3];
typedef NU8 tyEnum_FileMode__ZJfK20XeZ9bv2j1pZjw9aswg;
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__c9c0f59ak4YGQ6neEym8LPKw) (tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NimStringDesc** buffer, tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA slice);
typedef N_NIMCALL_PTR(NIM_BOOL, tyProc__7jFfqMk9ajToCz6Hv9atCA4A) (tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NimStringDesc** line);
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__c9c0f59ak4YGQ6neEym8LPKw readDataStrImpl;
tyProc__7jFfqMk9ajToCz6Hv9atCA4A readLineImpl;
tyProc__2VVzVL9bOnKhj1eZKkf9cEuA readDataImpl;
tyProc__2VVzVL9bOnKhj1eZKkf9cEuA peekDataImpl;
tyProc__ki6p1QyfOkJLQJ9aw5NI0AQ writeDataImpl;
tyProc__JQrsH08b4uPTH9cyFPlVOZg flushImpl;
};
struct tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ {
  tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ Sup;
FILE* f;
};
typedef NimStringDesc* tyArray__8ZvwQIddfpj2THRVPsFzIQ[1];
struct tyTuple__XOVT24GHXwqiEj5GCsEGCA {
NimStringDesc* Field0;
NI Field1;
};
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_44) (NI idx);
typedef N_CLOSURE_PTR(void, TM__HZdw8BhppcTQo8DIK46LSg_51) (NI idx, tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p);
typedef N_CLOSURE_PTR(void, TM__HZdw8BhppcTQo8DIK46LSg_52) (NI idx);
typedef N_CLOSURE_PTR(void, TM__HZdw8BhppcTQo8DIK46LSg_55) (NI idx);
typedef N_CLOSURE_PTR(void, TM__HZdw8BhppcTQo8DIK46LSg_56) (NI idx, tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p);
struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA {
NCSTRING procname;
NI line;
NCSTRING filename;
};
struct tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA {
NI a;
NI b;
};
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__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
N_LIB_PRIVATE N_NIMCALL(void, nimGCvisit)(void* d, NI op);
static N_NIMCALL(void, Marker_tyRef__lw7iqc9cC7bi1oOZOAlJkJA)(void* p, NI op);
N_LIB_PRIVATE N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
N_LIB_PRIVATE N_NOINLINE(void, raiseOSError__CWyPYlyH9a6rAuZckFyVxPA)(NI32 errorCode, NimStringDesc* additionalInfo);
N_LIB_PRIVATE N_NIMCALL(NI32, osLastError__9bUWNxbcGnToMWA9b79aTXLIw)(void);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_LIB_PRIVATE N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(void, decRef__AT1eRuflKWyTTBdLjEDZbgsystem)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(NI, minuspercent___dgYAo7RfdUVVpvkfKDym8w_2system)(NI x, NI y);
static N_INLINE(NIM_BOOL, ltpercent___hPljn3JCDQ00ua1R07X9bxQsystem)(NI x, NI y);
static N_INLINE(void, rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_2system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_PRIVATE N_NOINLINE(void, addZCT__Y66tOYFjgwJ0k4aLz4bc0Q)(tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w* s, tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem)(void* usr);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A)(NimStringDesc* msg);
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError2)(NI i, NI n);
N_LIB_PRIVATE N_NIMCALL(TGenericSeq*, incrSeqV3)(TGenericSeq* s, TNimType* typ);
static N_INLINE(NIM_BOOL, nimAddInt)(NI a, NI b, NI* res);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NIMCALL(NCSTRING*, allocCStringArray__LjSatDbwrF5hMmOARlJhEw)(NimStringDesc** a, NI aLen_0);
static N_INLINE(void, pushSafePoint)(TSafePoint* s);
N_LIB_PRIVATE N_NIMCALL(NCSTRING*, envToCStringArray__f7KyzfnKBI6fit7etE9c9aSA)(void);
N_LIB_PRIVATE N_NIMCALL(void, getEnvVarsC__580467zYn32AEdYj9cD4LLA)(void);
N_LIB_PRIVATE N_NIMCALL(NI, nsuFindChar)(NimStringDesc* s, NIM_CHAR sub, NI start, NI last);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, substr__2yh9cer0ymNRHlOOg8P7IuA)(NimStringDesc* s, NI first, NI last);
static N_INLINE(NIM_BOOL, nimSubInt)(NI a, NI b, NI* res);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, substr__iGg0RIKceRvsmvq8FUHOEw)(NimStringDesc* s, NI first);
N_LIB_PRIVATE N_NOCONV(void*, alloc0Impl__WrVG9abV9chlTLqkiXYLKwUg)(NI size);
static N_INLINE(NIM_BOOL, nimMulInt)(NI a, NI b, NI* res);
static N_INLINE(NF, toFloat__y1Fm9aHmxw9bS2jir137Fu5gsystem)(NI i);
static N_INLINE(NF, abs__BRaAqinz6OWTHkALb4oj6Qsystem)(NF x);
N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i, NI64 a, NI64 b);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size);
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_LIB_PRIVATE N_NOCONV(void*, allocImpl__WrVG9abV9chlTLqkiXYLKwUg_2)(NI size);
N_LIB_PRIVATE N_NIMCALL(NCSTRING*, envToCStringArray__ycBq0pnoixEzCDQfJtZIrQ)(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__fxpm29cY48fSnfKctT4HQMg)(tyObject_StartProcessData__xgRnKnLIYRtnOkshMKhc9cA* data);
N_LIB_PRIVATE N_NIMCALL(void, genericAssign)(void* dest, void* src, TNimType* mt);
N_LIB_PRIVATE N_CDECL(void, startProcessAfterFork__5VTCS7mBulbz9a1M2vwi9bew)(tyObject_StartProcessData__xgRnKnLIYRtnOkshMKhc9cA* data);
N_LIB_PRIVATE N_NIMCALL(void, startProcessFail__10xTBd9all9cp1ewzkhU9arJA)(tyObject_StartProcessData__xgRnKnLIYRtnOkshMKhc9cA* data);
static N_INLINE(NI, nimCStrLen)(NCSTRING a);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuFormatOpenArray)(NimStringDesc* formatstr, NimStringDesc** a, NI aLen_0);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, cstrToNimstr)(NCSTRING str);
static N_INLINE(void, popSafePoint)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimLeaveFinally)(void);
N_LIB_PRIVATE N_NIMCALL(void, reraiseException)(void);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuJoinSep)(NimStringDesc** a, NI aLen_0, NimStringDesc* sep);
N_LIB_PRIVATE N_NIMCALL(void, echoBinSafe)(NimStringDesc** args, NI argsLen_0);
N_LIB_PRIVATE N_NIMCALL(void, deallocCStringArray__4ixt9bnFA4tfz1dFgECtQLw)(NCSTRING* a);
N_LIB_PRIVATE N_NIMCALL(void, createStream__UfW7DT0wq9aKvWDJUXUomzw)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ** stream, int* handle, tyEnum_FileMode__ZJfK20XeZ9bv2j1pZjw9aswg fileMode);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, open__NY67RvH2AlO9b9a83QFwNNag)(FILE** f, int filehandle, tyEnum_FileMode__ZJfK20XeZ9bv2j1pZjw9aswg mode);
N_LIB_PRIVATE N_NIMCALL(tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*, newFileStream__L2sCmH55dBWs0l9aUTvGiSw)(FILE* f);
N_LIB_PRIVATE N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_LIB_PRIVATE N_NIMCALL(int, exitStatusLikeShell__vmXOHpv9cjOB5AHi6OOlhbw)(int status);
N_LIB_PRIVATE N_NOINLINE(void, chckNil)(void* p);
N_LIB_PRIVATE N_NOINLINE(void, raiseDivByZero)(void);
static N_INLINE(NIM_BOOL, nimDivInt)(NI a, NI b, NI* res);
static N_INLINE(NI, percentpercent___dgYAo7RfdUVVpvkfKDym8w_4system)(NI x, NI y);
N_LIB_PRIVATE N_NIMCALL(void, close__y1KA3B0U09bKtU09am9a9avRYQ_3)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s);
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);
N_LIB_PRIVATE N_NIMCALL(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ*, nospoutputStream)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p);
N_LIB_PRIVATE N_NIMCALL(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ*, nospinputStream)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p);
N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, readLine__9ab9cEjuwJspa9a1pTeb1Z1BQ_2)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s, NimStringDesc** line);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
N_LIB_PRIVATE N_NIMCALL(NI, nosppeekExitCode)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, isExitStatus__4HQqj3kS5lecDQDDt4sh7Q)(int status);
N_LIB_PRIVATE N_NIMCALL(void, nospclose)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p);
N_LIB_PRIVATE N_NIMCALL(NI, ncpicountProcessors)(void);
N_LIB_PRIVATE N_NIMCALL(tySequence__PrBYolTs4TOSgE8v5oqDUQ*, newSeq__ts9cTzRyL9a2RDNIcwmlP9bnw)(NI len);
N_LIB_PRIVATE N_NIMCALL(tySequence__qwqHTkRvwhrRyENtudHQ7g*, newSeq__eA9b5cYyFZe7gRm4F9aRTKlA)(NI len);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incRef__AT1eRuflKWyTTBdLjEDZbg_3system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(NI, pluspercent___dgYAo7RfdUVVpvkfKDym8wsystem)(NI x, NI y);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosprunning)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p);
N_LIB_PRIVATE N_NIMCALL(NI, nospwaitForExit)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p, NI timeout);
extern TNimType NTI__ytyiCJqK439aF9cIibuRVpAg_;
N_LIB_PRIVATE TNimType NTI__2rGNQnv9bU4hanI2g3svReg_;
extern TNimType NTI__2gIj3gQlK3HZJjQaYCP6ZQ_;
extern TNimType NTI__r9bTMVI8f19ah9b11jMgY4kPg_;
extern TNimType NTI__1G0jiQbe7KwD5ADza5AZaw_;
extern TNimType NTI__nlCscttRCss70IBTyuBqnA_;
extern TNimType NTI__VaVACK0bpYmqIQ0mKcHfQQ_;
N_LIB_PRIVATE TNimType NTI__bnU6W8LhTMnT4JaSWtGlSA_;
N_LIB_PRIVATE TNimType NTI__HlmBYNr2gdAZMXOsuiSZ0A_;
N_LIB_PRIVATE TNimType NTI__lw7iqc9cC7bi1oOZOAlJkJA_;
STRING_LITERAL(TM__HZdw8BhppcTQo8DIK46LSg_6, "/bin/sh", 7);
extern TNimType NTI__sM4lkSb7zS6F7OVMvW9cffQ_;
STRING_LITERAL(TM__HZdw8BhppcTQo8DIK46LSg_7, "-c", 2);
STRING_LITERAL(TM__HZdw8BhppcTQo8DIK46LSg_8, "osproc.nim(862, 14) `args.len == 0` `args` has to be empty when"
" using poEvalCommand.", 84);
STRING_LITERAL(TM__HZdw8BhppcTQo8DIK46LSg_19, "=", 1);
N_LIB_PRIVATE TNimType NTI__xgRnKnLIYRtnOkshMKhc9cA_;
extern TNimType NTI__77mFvmsOLKik79ci2hXkHEg_;
extern TNimType NTI__vCtGdhfQAmBlRFXaVFklkQ_;
extern TNimType NTI__S9agCYBinaYZnGWcjTdxclg_;
N_LIB_PRIVATE TNimType NTI__SKEqGXcReU4NvbQlH779b5Q_;
STRING_LITERAL(TM__HZdw8BhppcTQo8DIK46LSg_33, "Could not find command: \'$1\'. OS error: $2", 42);
STRING_LITERAL(TM__HZdw8BhppcTQo8DIK46LSg_34, " ", 1);
STRING_LITERAL(TM__HZdw8BhppcTQo8DIK46LSg_35, "osproc.nim(1306, 17) `poParentStreams notin p.options` API usag"
"e error: stream access not allowed when you use poParentStreams", 126);
STRING_LITERAL(TM__HZdw8BhppcTQo8DIK46LSg_36, "osproc.nim(1312, 17) `poParentStreams notin p.options` API usag"
"e error: stream access not allowed when you use poParentStreams", 126);
STRING_LITERAL(TM__HZdw8BhppcTQo8DIK46LSg_41, "\012", 1);
STRING_LITERAL(TM__HZdw8BhppcTQo8DIK46LSg_42, "osproc.nim(311, 10) `n > 0` ", 28);
static NIM_CONST tyProc__kElEuvYkhDcTHhB3d89aMYA TM__HZdw8BhppcTQo8DIK46LSg_43 = {NIM_NIL,NIM_NIL};
static NIM_CONST tyProc__FM4RO2zoXex9caTkjWpBmsw TM__HZdw8BhppcTQo8DIK46LSg_50 = {NIM_NIL,NIM_NIL};
extern NCSTRING* environ;
extern tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ gch__IcYaEuuWivYAS86vFMTS3Q;
extern TSafePoint* excHandler__rqLlY5bs9atDw2OXYqJEn5g;
extern TSafePoint* excHandler__rqLlY5bs9atDw2OXYqJEn5g;
extern tySequence__sM4lkSb7zS6F7OVMvW9cffQ* environment__mlhK49b6YMgc9cgrcYkKq9a3g;
extern tySequence__sM4lkSb7zS6F7OVMvW9cffQ* environment__mlhK49b6YMgc9cgrcYkKq9a3g;
extern tySequence__sM4lkSb7zS6F7OVMvW9cffQ* environment__mlhK49b6YMgc9cgrcYkKq9a3g;
extern tySequence__sM4lkSb7zS6F7OVMvW9cffQ* environment__mlhK49b6YMgc9cgrcYkKq9a3g;
extern tySequence__sM4lkSb7zS6F7OVMvW9cffQ* environment__mlhK49b6YMgc9cgrcYkKq9a3g;
extern tySequence__sM4lkSb7zS6F7OVMvW9cffQ* environment__mlhK49b6YMgc9cgrcYkKq9a3g;
extern tySequence__sM4lkSb7zS6F7OVMvW9cffQ* environment__mlhK49b6YMgc9cgrcYkKq9a3g;
extern tySequence__sM4lkSb7zS6F7OVMvW9cffQ* environment__mlhK49b6YMgc9cgrcYkKq9a3g;
extern TSafePoint* excHandler__rqLlY5bs9atDw2OXYqJEn5g;
extern TSafePoint* excHandler__rqLlY5bs9atDw2OXYqJEn5g;
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(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__zxfKBYntu9cBapkhrCOk1fgmemory(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(NI, minuspercent___dgYAo7RfdUVVpvkfKDym8w_2system)(NI x, NI y) {
	NI result;
	result = (NI)0;
	result = ((NI) ((NU)((NU64)(((NU) (x))) - (NU64)(((NU) (y))))));
	return result;
}
static N_INLINE(NIM_BOOL, ltpercent___hPljn3JCDQ00ua1R07X9bxQsystem)(NI x, NI y) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	result = ((NU64)(((NU) (x))) < (NU64)(((NU) (y))));
	return result;
}
static N_INLINE(void, rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_2system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
	addZCT__Y66tOYFjgwJ0k4aLz4bc0Q((&gch__IcYaEuuWivYAS86vFMTS3Q.zct), c);
}
static N_INLINE(void, decRef__AT1eRuflKWyTTBdLjEDZbgsystem)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
	(*c).refcount = minuspercent___dgYAo7RfdUVVpvkfKDym8w_2system((*c).refcount, ((NI) 8));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = ltpercent___hPljn3JCDQ00ua1R07X9bxQsystem((*c).refcount, ((NI) 8));
		if (!T3_) goto LA4_;
		rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_2system(c);
	}
	LA4_: ;
}
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem)(void* usr) {
	tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* result;
	NI T1_;
	result = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
	T1_ = (NI)0;
	T1_ = minuspercent___dgYAo7RfdUVVpvkfKDym8w_2system(((NI) (ptrdiff_t) (usr)), ((NI) 16));
	result = ((tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*) (T1_));
	return result;
}
static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
	tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T1_;
	T1_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
	T1_ = usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem(p);
	decRef__AT1eRuflKWyTTBdLjEDZbgsystem(T1_);
}
static N_INLINE(NIM_BOOL, nimAddInt)(NI a, NI b, NI* res) {
	NIM_BOOL result;
	NI r;
	result = (NIM_BOOL)0;
	r = ((NI) ((NU)((NU64)(((NU) (a))) + (NU64)(((NU) (b))))));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (((NI) 0) <= (NI)(r ^ a));
		if (T3_) goto LA4_;
		T3_ = (((NI) 0) <= (NI)(r ^ b));
		LA4_: ;
		if (!T3_) goto LA5_;
		(*res) = r;
	}
	goto LA1_;
	LA5_: ;
	{
		result = NIM_TRUE;
	}
	LA1_: ;
	return result;
}
static N_INLINE(void, pushSafePoint)(TSafePoint* s) {
	(*s).prev = excHandler__rqLlY5bs9atDw2OXYqJEn5g;
	excHandler__rqLlY5bs9atDw2OXYqJEn5g = s;
}
static N_INLINE(NIM_BOOL, nimSubInt)(NI a, NI b, NI* res) {
	NIM_BOOL result;
	NI r;
	result = (NIM_BOOL)0;
	r = ((NI) ((NU)((NU64)(((NU) (a))) - (NU64)(((NU) (b))))));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (((NI) 0) <= (NI)(r ^ a));
		if (T3_) goto LA4_;
		T3_ = (((NI) 0) <= (NI)(r ^ (NI)((NU64) ~(b))));
		LA4_: ;
		if (!T3_) goto LA5_;
		(*res) = r;
	}
	goto LA1_;
	LA5_: ;
	{
		result = NIM_TRUE;
	}
	LA1_: ;
	return result;
}
static N_INLINE(NF, toFloat__y1Fm9aHmxw9bS2jir137Fu5gsystem)(NI i) {
	NF result;
	result = (NF)0;
	result = ((NF) (i));
	return result;
}
static N_INLINE(NF, abs__BRaAqinz6OWTHkALb4oj6Qsystem)(NF x) {
	NF result;
	result = (NF)0;
	{
		if (!(x < 0.0)) goto LA3_;
		result = -(x);
	}
	goto LA1_;
	LA3_: ;
	{
		result = x;
	}
	LA1_: ;
	return result;
}
static N_INLINE(NIM_BOOL, nimMulInt)(NI a, NI b, NI* res) {
	NIM_BOOL result;
	NI r;
	NF floatProd;
	NF T1_;
	NF T2_;
	NF resAsFloat;
	result = (NIM_BOOL)0;
	r = ((NI) ((NU)((NU64)(((NU) (a))) * (NU64)(((NU) (b))))));
	T1_ = (NF)0;
	T1_ = toFloat__y1Fm9aHmxw9bS2jir137Fu5gsystem(a);
	T2_ = (NF)0;
	T2_ = toFloat__y1Fm9aHmxw9bS2jir137Fu5gsystem(b);
	floatProd = ((NF)(T1_) * (NF)(T2_));
	resAsFloat = toFloat__y1Fm9aHmxw9bS2jir137Fu5gsystem(r);
	{
		if (!(resAsFloat == floatProd)) goto LA5_;
		(*res) = r;
	}
	goto LA3_;
	LA5_: ;
	{
		{
			NF T10_;
			NF T11_;
			T10_ = (NF)0;
			T10_ = abs__BRaAqinz6OWTHkALb4oj6Qsystem(((NF)(resAsFloat) - (NF)(floatProd)));
			T11_ = (NF)0;
			T11_ = abs__BRaAqinz6OWTHkALb4oj6Qsystem(floatProd);
			if (!(((NF)(3.2000000000000000e+01) * (NF)(T10_)) <= T11_)) goto LA12_;
			(*res) = r;
		}
		goto LA8_;
		LA12_: ;
		{
			result = NIM_TRUE;
		}
		LA8_: ;
	}
	LA3_: ;
	return result;
}
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__i80o3k0SgEI5gTRCzYdyWAsystem)(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__i80o3k0SgEI5gTRCzYdyWAsystem(((void*) ((&(*dest).data[(*dest).Sup.len]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1)))));
		(*dest).Sup.len += (*src).Sup.len;
	}
	LA3_: ;
}
N_LIB_PRIVATE N_NIMCALL(NCSTRING*, envToCStringArray__f7KyzfnKBI6fit7etE9c9aSA)(void) {
	NCSTRING* result;
	NI counter;
	NI TM__HZdw8BhppcTQo8DIK46LSg_15;
	NI TM__HZdw8BhppcTQo8DIK46LSg_16;
	void* T6_;
	NI i_2;
	result = (NCSTRING*)0;
	counter = ((NI) 0);
	{
		NimStringDesc* key;
		NimStringDesc* val;
		key = (NimStringDesc*)0;
		val = (NimStringDesc*)0;
		getEnvVarsC__580467zYn32AEdYj9cD4LLA();
		{
			NI i;
			NI colontmp_;
			NI T3_;
			NI res;
			i = (NI)0;
			colontmp_ = (NI)0;
			T3_ = ((environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)-1);
			colontmp_ = T3_;
			res = ((NI) 0);
			{
				while (1) {
					NI p;
					NI TM__HZdw8BhppcTQo8DIK46LSg_11;
					NI TM__HZdw8BhppcTQo8DIK46LSg_12;
					NI TM__HZdw8BhppcTQo8DIK46LSg_13;
					NI TM__HZdw8BhppcTQo8DIK46LSg_14;
					if (!(res <= colontmp_)) goto LA5;
					i = res;
					if ((NU)(i) >= (NU)(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)){ raiseIndexError2(i,(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)-1); }
					p = nsuFindChar(environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[i], 61, ((NI) 0), ((NI) 0));
					if ((NU)(i) >= (NU)(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)){ raiseIndexError2(i,(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)-1); }
					if (nimSubInt(p, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_11)) { raiseOverflow(); };
					key = substr__2yh9cer0ymNRHlOOg8P7IuA(environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[i], ((NI) 0), (NI)(TM__HZdw8BhppcTQo8DIK46LSg_11));
					if ((NU)(i) >= (NU)(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)){ raiseIndexError2(i,(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)-1); }
					if (nimAddInt(p, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_12)) { raiseOverflow(); };
					val = substr__iGg0RIKceRvsmvq8FUHOEw(environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[i], (NI)(TM__HZdw8BhppcTQo8DIK46LSg_12));
					if (nimAddInt(counter, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_13)) { raiseOverflow(); };
					counter = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_13);
					if (nimAddInt(res, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_14)) { raiseOverflow(); };
					res = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_14);
				} LA5: ;
			}
		}
	}
	if (nimAddInt(counter, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_15)) { raiseOverflow(); };
	if (nimMulInt((NI)(TM__HZdw8BhppcTQo8DIK46LSg_15), ((NI) 8), &TM__HZdw8BhppcTQo8DIK46LSg_16)) { raiseOverflow(); };
	if (((NI)(TM__HZdw8BhppcTQo8DIK46LSg_16)) < ((NI) 0) || ((NI)(TM__HZdw8BhppcTQo8DIK46LSg_16)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__HZdw8BhppcTQo8DIK46LSg_16), ((NI) 0), ((NI) IL64(9223372036854775807))); }
	T6_ = (void*)0;
	T6_ = alloc0Impl__WrVG9abV9chlTLqkiXYLKwUg(((NI) ((NI)(TM__HZdw8BhppcTQo8DIK46LSg_16))));
	result = ((NCSTRING*) (T6_));
	i_2 = ((NI) 0);
	{
		NimStringDesc* key_2;
		NimStringDesc* val_2;
		key_2 = (NimStringDesc*)0;
		val_2 = (NimStringDesc*)0;
		getEnvVarsC__580467zYn32AEdYj9cD4LLA();
		{
			NI i_3;
			NI colontmp__2;
			NI T9_;
			NI res_2;
			i_3 = (NI)0;
			colontmp__2 = (NI)0;
			T9_ = ((environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)-1);
			colontmp__2 = T9_;
			res_2 = ((NI) 0);
			{
				while (1) {
					NI p_2;
					NI TM__HZdw8BhppcTQo8DIK46LSg_17;
					NI TM__HZdw8BhppcTQo8DIK46LSg_18;
					NimStringDesc* x;
					NimStringDesc* T12_;
					NI TM__HZdw8BhppcTQo8DIK46LSg_20;
					void* T13_;
					NI TM__HZdw8BhppcTQo8DIK46LSg_21;
					NI TM__HZdw8BhppcTQo8DIK46LSg_22;
					NI TM__HZdw8BhppcTQo8DIK46LSg_23;
					if (!(res_2 <= colontmp__2)) goto LA11;
					i_3 = res_2;
					if ((NU)(i_3) >= (NU)(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)){ raiseIndexError2(i_3,(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)-1); }
					p_2 = nsuFindChar(environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[i_3], 61, ((NI) 0), ((NI) 0));
					if ((NU)(i_3) >= (NU)(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)){ raiseIndexError2(i_3,(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)-1); }
					if (nimSubInt(p_2, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_17)) { raiseOverflow(); };
					key_2 = substr__2yh9cer0ymNRHlOOg8P7IuA(environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[i_3], ((NI) 0), (NI)(TM__HZdw8BhppcTQo8DIK46LSg_17));
					if ((NU)(i_3) >= (NU)(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)){ raiseIndexError2(i_3,(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)-1); }
					if (nimAddInt(p_2, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_18)) { raiseOverflow(); };
					val_2 = substr__iGg0RIKceRvsmvq8FUHOEw(environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[i_3], (NI)(TM__HZdw8BhppcTQo8DIK46LSg_18));
					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_19));
appendString(T12_, val_2);
					x = T12_;
					if (nimAddInt((x ? x->Sup.len : 0), ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_20)) { raiseOverflow(); };
					if (((NI)(TM__HZdw8BhppcTQo8DIK46LSg_20)) < ((NI) 0) || ((NI)(TM__HZdw8BhppcTQo8DIK46LSg_20)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__HZdw8BhppcTQo8DIK46LSg_20), ((NI) 0), ((NI) IL64(9223372036854775807))); }
					T13_ = (void*)0;
					T13_ = allocImpl__WrVG9abV9chlTLqkiXYLKwUg_2(((NI) ((NI)(TM__HZdw8BhppcTQo8DIK46LSg_20))));
					result[i_2] = ((NCSTRING) (T13_));
					if ((NU)(((NI) 0)) >= (NU)(x ? x->Sup.len : 0)){ raiseIndexError2(((NI) 0),(x ? x->Sup.len : 0)-1); }
					if (nimAddInt((x ? x->Sup.len : 0), ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_21)) { raiseOverflow(); };
					if (((NI)(TM__HZdw8BhppcTQo8DIK46LSg_21)) < ((NI) 0) || ((NI)(TM__HZdw8BhppcTQo8DIK46LSg_21)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__HZdw8BhppcTQo8DIK46LSg_21), ((NI) 0), ((NI) IL64(9223372036854775807))); }
					copyMem__i80o3k0SgEI5gTRCzYdyWAsystem(((void*) (result[i_2])), ((void*) ((&x->data[((NI) 0)]))), ((NI) ((NI)(TM__HZdw8BhppcTQo8DIK46LSg_21))));
					if (nimAddInt(i_2, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_22)) { raiseOverflow(); };
					i_2 = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_22);
					if (nimAddInt(res_2, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_23)) { raiseOverflow(); };
					res_2 = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_23);
				} LA11: ;
			}
		}
	}
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NCSTRING*, envToCStringArray__ycBq0pnoixEzCDQfJtZIrQ)(tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* t) {
	NCSTRING* result;
	NI T1_;
	NI TM__HZdw8BhppcTQo8DIK46LSg_24;
	NI TM__HZdw8BhppcTQo8DIK46LSg_25;
	void* T2_;
	NI i;
	result = (NCSTRING*)0;
	T1_ = (NI)0;
	T1_ = nstlen(t);
	if (nimAddInt(T1_, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_24)) { raiseOverflow(); };
	if (nimMulInt((NI)(TM__HZdw8BhppcTQo8DIK46LSg_24), ((NI) 8), &TM__HZdw8BhppcTQo8DIK46LSg_25)) { raiseOverflow(); };
	if (((NI)(TM__HZdw8BhppcTQo8DIK46LSg_25)) < ((NI) 0) || ((NI)(TM__HZdw8BhppcTQo8DIK46LSg_25)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__HZdw8BhppcTQo8DIK46LSg_25), ((NI) 0), ((NI) IL64(9223372036854775807))); }
	T2_ = (void*)0;
	T2_ = alloc0Impl__WrVG9abV9chlTLqkiXYLKwUg(((NI) ((NI)(TM__HZdw8BhppcTQo8DIK46LSg_25))));
	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) {
					NI TM__HZdw8BhppcTQo8DIK46LSg_29;
					if (!(res <= colontmp_)) goto LA7;
					h = res;
					{
						NimStringDesc* x;
						NimStringDesc* T12_;
						NI TM__HZdw8BhppcTQo8DIK46LSg_26;
						void* T13_;
						NI TM__HZdw8BhppcTQo8DIK46LSg_27;
						NI TM__HZdw8BhppcTQo8DIK46LSg_28;
						if ((NU)(h) >= (NU)((*t).data ? (*t).data->Sup.len : 0)){ raiseIndexError2(h,((*t).data ? (*t).data->Sup.len : 0)-1); }
						if (!(*t).data->data[h].Field2) goto LA10_;
						if ((NU)(h) >= (NU)((*t).data ? (*t).data->Sup.len : 0)){ raiseIndexError2(h,((*t).data ? (*t).data->Sup.len : 0)-1); }
						key = (*t).data->data[h].Field0;
						if ((NU)(h) >= (NU)((*t).data ? (*t).data->Sup.len : 0)){ raiseIndexError2(h,((*t).data ? (*t).data->Sup.len : 0)-1); }
						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_19));
appendString(T12_, val);
						x = T12_;
						if (nimAddInt((x ? x->Sup.len : 0), ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_26)) { raiseOverflow(); };
						if (((NI)(TM__HZdw8BhppcTQo8DIK46LSg_26)) < ((NI) 0) || ((NI)(TM__HZdw8BhppcTQo8DIK46LSg_26)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__HZdw8BhppcTQo8DIK46LSg_26), ((NI) 0), ((NI) IL64(9223372036854775807))); }
						T13_ = (void*)0;
						T13_ = allocImpl__WrVG9abV9chlTLqkiXYLKwUg_2(((NI) ((NI)(TM__HZdw8BhppcTQo8DIK46LSg_26))));
						result[i] = ((NCSTRING) (T13_));
						if ((NU)(((NI) 0)) >= (NU)(x ? x->Sup.len : 0)){ raiseIndexError2(((NI) 0),(x ? x->Sup.len : 0)-1); }
						if (nimAddInt((x ? x->Sup.len : 0), ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_27)) { raiseOverflow(); };
						if (((NI)(TM__HZdw8BhppcTQo8DIK46LSg_27)) < ((NI) 0) || ((NI)(TM__HZdw8BhppcTQo8DIK46LSg_27)) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI((NI)(TM__HZdw8BhppcTQo8DIK46LSg_27), ((NI) 0), ((NI) IL64(9223372036854775807))); }
						copyMem__i80o3k0SgEI5gTRCzYdyWAsystem(((void*) (result[i])), ((void*) ((&x->data[((NI) 0)]))), ((NI) ((NI)(TM__HZdw8BhppcTQo8DIK46LSg_27))));
						if (nimAddInt(i, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_28)) { raiseOverflow(); };
						i = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_28);
					}
					LA10_: ;
					if (nimAddInt(res, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_29)) { raiseOverflow(); };
					res = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_29);
				} 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__10xTBd9all9cp1ewzkhU9arJA)(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(NI, nimCStrLen)(NCSTRING a) {
	NI result;
	size_t T1_;
	result = (NI)0;
	T1_ = (size_t)0;
	T1_ = strlen(a);
	result = ((NI) (T1_));
	return result;
}
N_LIB_PRIVATE N_CDECL(void, startProcessAfterFork__5VTCS7mBulbz9a1M2vwi9bew)(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__10xTBd9all9cp1ewzkhU9arJA(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__10xTBd9all9cp1ewzkhU9arJA(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__10xTBd9all9cp1ewzkhU9arJA(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__10xTBd9all9cp1ewzkhU9arJA(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__10xTBd9all9cp1ewzkhU9arJA(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__10xTBd9all9cp1ewzkhU9arJA(data);
}
static N_INLINE(void, popSafePoint)(void) {
	excHandler__rqLlY5bs9atDw2OXYqJEn5g = (*excHandler__rqLlY5bs9atDw2OXYqJEn5g).prev;
}
N_LIB_PRIVATE N_NIMCALL(pid_t, startProcessAuxFork__fxpm29cY48fSnfKctT4HQMg)(tyObject_StartProcessData__xgRnKnLIYRtnOkshMKhc9cA* data) {
	pid_t result;
	TSafePoint TM__HZdw8BhppcTQo8DIK46LSg_31;
{	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__9bUWNxbcGnToMWA9b79aTXLIw();
		raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T6_, ((NimStringDesc*) NIM_NIL));
	}
	LA4_: ;
	pushSafePoint(&TM__HZdw8BhppcTQo8DIK46LSg_31);
	TM__HZdw8BhppcTQo8DIK46LSg_31.status = _setjmp(TM__HZdw8BhppcTQo8DIK46LSg_31.context);
	if (TM__HZdw8BhppcTQo8DIK46LSg_31.status == 0) {
		pid_t 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__5VTCS7mBulbz9a1M2vwi9bew((&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__9bUWNxbcGnToMWA9b79aTXLIw();
			raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(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__9bUWNxbcGnToMWA9b79aTXLIw();
			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_33), T23_, 2);
			raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(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_31.status != 0) nimLeaveFinally();
	}
	if (TM__HZdw8BhppcTQo8DIK46LSg_31.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;
	tyObject_StartProcessData__xgRnKnLIYRtnOkshMKhc9cA data;
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ* sysArgsRaw;
	pid_t pid;
	NCSTRING* sysArgs;
	TSafePoint TM__HZdw8BhppcTQo8DIK46LSg_10;
	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__9bUWNxbcGnToMWA9b79aTXLIw();
			raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T16_, ((NimStringDesc*) NIM_NIL));
		}
		LA14_: ;
	}
	LA3_: ;
	nimZeroMem((void*)(&data), sizeof(tyObject_StartProcessData__xgRnKnLIYRtnOkshMKhc9cA));
	sysArgsRaw = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*)0;
	{
		NimStringDesc* T21_;
		NimStringDesc* T22_;
		NimStringDesc* T23_;
		if (!((options &(1U<<((NU)(((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA) 2))&7U)))!=0)) goto LA19_;
		data.sysCommand = copyString(((NimStringDesc*) &TM__HZdw8BhppcTQo8DIK46LSg_6));
		sysArgsRaw = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*) newSeq((&NTI__sM4lkSb7zS6F7OVMvW9cffQ_), 3);
		T21_ = (NimStringDesc*)0;
		T21_ = sysArgsRaw->data[0]; sysArgsRaw->data[0] = copyStringRC1(data.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_);
		{
			if (!!((argsLen_0 == ((NI) 0)))) goto LA26_;
			failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__HZdw8BhppcTQo8DIK46LSg_8));
		}
		LA26_: ;
	}
	goto LA17_;
	LA19_: ;
	{
		NimStringDesc* T29_;
		data.sysCommand = copyString(command);
		sysArgsRaw = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*) newSeq((&NTI__sM4lkSb7zS6F7OVMvW9cffQ_), 1);
		T29_ = (NimStringDesc*)0;
		T29_ = sysArgsRaw->data[0]; sysArgsRaw->data[0] = copyStringRC1(command);
		if (T29_) nimGCunrefNoCycle(T29_);
		{
			NimStringDesc* arg;
			NI i;
			arg = (NimStringDesc*)0;
			i = ((NI) 0);
			{
				while (1) {
					NI T33_;
					NimStringDesc* T34_;
					NI TM__HZdw8BhppcTQo8DIK46LSg_9;
					if (!(i < argsLen_0)) goto LA32;
					if ((NU)(i) >= (NU)(argsLen_0)){ raiseIndexError2(i,argsLen_0-1); }
					arg = args[i];
					sysArgsRaw = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV3((TGenericSeq*)(sysArgsRaw), (&NTI__sM4lkSb7zS6F7OVMvW9cffQ_));
					T33_ = sysArgsRaw->Sup.len++;
					T34_ = (NimStringDesc*)0;
					T34_ = sysArgsRaw->data[T33_]; sysArgsRaw->data[T33_] = copyStringRC1(arg);
					if (T34_) nimGCunrefNoCycle(T34_);
					if (nimAddInt(i, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_9)) { raiseOverflow(); };
					i = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_9);
				} LA32: ;
			}
		}
	}
	LA17_: ;
	pid = (pid_t)0;
	sysArgs = allocCStringArray__LjSatDbwrF5hMmOARlJhEw(sysArgsRaw->data, (sysArgsRaw ? sysArgsRaw->Sup.len : 0));
	pushSafePoint(&TM__HZdw8BhppcTQo8DIK46LSg_10);
	TM__HZdw8BhppcTQo8DIK46LSg_10.status = _setjmp(TM__HZdw8BhppcTQo8DIK46LSg_10.context);
	if (TM__HZdw8BhppcTQo8DIK46LSg_10.status == 0) {
		NCSTRING* sysEnv;
		TSafePoint TM__HZdw8BhppcTQo8DIK46LSg_30;
		{
			if (!(env == NIM_NIL)) goto LA38_;
			sysEnv = envToCStringArray__f7KyzfnKBI6fit7etE9c9aSA();
		}
		goto LA36_;
		LA38_: ;
		{
			sysEnv = envToCStringArray__ycBq0pnoixEzCDQfJtZIrQ(env);
		}
		LA36_: ;
		pushSafePoint(&TM__HZdw8BhppcTQo8DIK46LSg_30);
		TM__HZdw8BhppcTQo8DIK46LSg_30.status = _setjmp(TM__HZdw8BhppcTQo8DIK46LSg_30.context);
		if (TM__HZdw8BhppcTQo8DIK46LSg_30.status == 0) {
			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__fxpm29cY48fSnfKctT4HQMg((&data));
			{
				tyArray__24KAM9afIUgUaqBaEBB6r9bg T46_;
				if (!((options &(1U<<((NU)(((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA) 0))&7U)))!=0)) goto LA44_;
				nimZeroMem((void*)T46_, sizeof(tyArray__24KAM9afIUgUaqBaEBB6r9bg));
				T46_[0] = copyString(command);
				T46_[1] = copyString(((NimStringDesc*) &TM__HZdw8BhppcTQo8DIK46LSg_34));
				T46_[2] = nsuJoinSep(args, argsLen_0, ((NimStringDesc*) &TM__HZdw8BhppcTQo8DIK46LSg_34));
				echoBinSafe(T46_, 3);
			}
			LA44_: ;
			(*result).id = pid;
			(*result).exitFlag = NIM_FALSE;
			{
				if (!((options &(1U<<((NU)(((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA) 4))&7U)))!=0)) goto LA49_;
				(*result).inHandle = ((int) 0);
				(*result).outHandle = ((int) 1);
				{
					if (!((options &(1U<<((NU)(((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA) 3))&7U)))!=0)) goto LA53_;
					(*result).errHandle = (*result).outHandle;
				}
				goto LA51_;
				LA53_: ;
				{
					(*result).errHandle = ((int) 2);
				}
				LA51_: ;
			}
			goto LA47_;
			LA49_: ;
			{
				int T63_;
				int T64_;
				int T65_;
				(*result).inHandle = pStdin[(((NI) 1))- 0];
				(*result).outHandle = pStdout[(((NI) 0))- 0];
				{
					int T61_;
					if (!((options &(1U<<((NU)(((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA) 3))&7U)))!=0)) goto LA59_;
					(*result).errHandle = (*result).outHandle;
					T61_ = (int)0;
					T61_ = close(pStderr[(((NI) 0))- 0]);
					(void)(T61_);
				}
				goto LA57_;
				LA59_: ;
				{
					(*result).errHandle = pStderr[(((NI) 0))- 0];
				}
				LA57_: ;
				T63_ = (int)0;
				T63_ = close(pStderr[(((NI) 1))- 0]);
				(void)(T63_);
				T64_ = (int)0;
				T64_ = close(pStdin[(((NI) 0))- 0]);
				(void)(T64_);
				T65_ = (int)0;
				T65_ = close(pStdout[(((NI) 1))- 0]);
				(void)(T65_);
			}
			LA47_: ;
			popSafePoint();
		}
		else {
			popSafePoint();
		}
		{
			deallocCStringArray__4ixt9bnFA4tfz1dFgECtQLw(sysEnv);
			if (TM__HZdw8BhppcTQo8DIK46LSg_30.status != 0) nimLeaveFinally();
		}
		if (TM__HZdw8BhppcTQo8DIK46LSg_30.status != 0) reraiseException();
		popSafePoint();
	}
	else {
		popSafePoint();
	}
	{
		deallocCStringArray__4ixt9bnFA4tfz1dFgECtQLw(sysArgs);
		if (TM__HZdw8BhppcTQo8DIK46LSg_10.status != 0) nimLeaveFinally();
	}
	if (TM__HZdw8BhppcTQo8DIK46LSg_10.status != 0) reraiseException();
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, createStream__UfW7DT0wq9aKvWDJUXUomzw)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ** stream, int* handle, tyEnum_FileMode__ZJfK20XeZ9bv2j1pZjw9aswg fileMode) {
	FILE* f;
	tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ* T7_;
	f = (FILE*)0;
	{
		NIM_BOOL T3_;
		NI32 T6_;
		T3_ = (NIM_BOOL)0;
		T3_ = open__NY67RvH2AlO9b9a83QFwNNag(&f, (*handle), fileMode);
		if (!!(T3_)) goto LA4_;
		T6_ = (NI32)0;
		T6_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
		raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T6_, ((NimStringDesc*) NIM_NIL));
	}
	LA4_: ;
	T7_ = (tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ*)0;
	T7_ = newFileStream__L2sCmH55dBWs0l9aUTvGiSw(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).options &(1U<<((NU)(((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA) 4))&7U)))!=0)))) goto LA3_;
		failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__HZdw8BhppcTQo8DIK46LSg_35));
	}
	LA3_: ;
	{
		if (!((*p).inStream == NIM_NIL)) goto LA7_;
		createStream__UfW7DT0wq9aKvWDJUXUomzw(&(*p).inStream, (&(*p).inHandle), ((tyEnum_FileMode__ZJfK20XeZ9bv2j1pZjw9aswg) 1));
	}
	LA7_: ;
	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).options &(1U<<((NU)(((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA) 4))&7U)))!=0)))) goto LA3_;
		failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__HZdw8BhppcTQo8DIK46LSg_36));
	}
	LA3_: ;
	{
		if (!((*p).outStream == NIM_NIL)) goto LA7_;
		createStream__UfW7DT0wq9aKvWDJUXUomzw(&(*p).outStream, (&(*p).outHandle), ((tyEnum_FileMode__ZJfK20XeZ9bv2j1pZjw9aswg) 0));
	}
	LA7_: ;
	result = (*p).outStream;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NIM_BOOL, nimDivInt)(NI a, NI b, NI* res) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (a == ((NI) (IL64(-9223372036854775807) - IL64(1))));
		if (!(T3_)) goto LA4_;
		T3_ = (b == ((NI) -1));
		LA4_: ;
		if (!T3_) goto LA5_;
		result = NIM_TRUE;
	}
	goto LA1_;
	LA5_: ;
	{
		(*res) = (NI)(a / b);
	}
	LA1_: ;
	return result;
}
static N_INLINE(NI, percentpercent___dgYAo7RfdUVVpvkfKDym8w_4system)(NI x, NI y) {
	NI result;
	result = (NI)0;
	result = ((NI) ((NU)((NU64)(((NU) (x))) % (NU64)(((NU) (y))))));
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, nospwaitForExit)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p, NI timeout) {
	NI result;
	int T73_;
{	result = (NI)0;
	{
		int T5_;
		if (!(*p).exitFlag) goto LA3_;
		T5_ = (int)0;
		T5_ = exitStatusLikeShell__vmXOHpv9cjOB5AHi6OOlhbw((*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__9bUWNxbcGnToMWA9b79aTXLIw();
			raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T15_, ((NimStringDesc*) NIM_NIL));
		}
		LA13_: ;
		(*p).exitFlag = NIM_TRUE;
		(*p).exitStatus = status;
	}
	goto LA6_;
	LA8_: ;
	{
		int kqFD;
		struct kevent volatile kevIn;
		struct kevent volatile kevOut;
		struct timespec volatile tmspec;
		TSafePoint TM__HZdw8BhppcTQo8DIK46LSg_40;
		kqFD = kqueue();
		{
			NI32 T21_;
			if (!(kqFD == ((NI32) -1))) goto LA19_;
			T21_ = (NI32)0;
			T21_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
			raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T21_, ((NimStringDesc*) NIM_NIL));
		}
		LA19_: ;
		chckNil((void*)(&kevIn));
		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));
		{
			NI TM__HZdw8BhppcTQo8DIK46LSg_37;
			NI T26_;
			NI TM__HZdw8BhppcTQo8DIK46LSg_38;
			if (!(((NI) 1000) <= timeout)) goto LA24_;
			if (((NI) 1000) == 0){ raiseDivByZero(); }
			if (nimDivInt(timeout, ((NI) 1000), &TM__HZdw8BhppcTQo8DIK46LSg_37)) { raiseOverflow(); };
			tmspec.tv_sec = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_37);
			T26_ = (NI)0;
			T26_ = percentpercent___dgYAo7RfdUVVpvkfKDym8w_4system(timeout, ((NI) 1000));
			if (nimMulInt(T26_, ((NI) 1000000), &TM__HZdw8BhppcTQo8DIK46LSg_38)) { raiseOverflow(); };
			tmspec.tv_nsec = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_38);
		}
		goto LA22_;
		LA24_: ;
		{
			NI TM__HZdw8BhppcTQo8DIK46LSg_39;
			tmspec.tv_sec = ((long) 0);
			if (nimMulInt(timeout, ((NI) 1000000), &TM__HZdw8BhppcTQo8DIK46LSg_39)) { raiseOverflow(); };
			tmspec.tv_nsec = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_39);
		}
		LA22_: ;
		pushSafePoint(&TM__HZdw8BhppcTQo8DIK46LSg_40);
		TM__HZdw8BhppcTQo8DIK46LSg_40.status = _setjmp(TM__HZdw8BhppcTQo8DIK46LSg_40.context);
		if (TM__HZdw8BhppcTQo8DIK46LSg_40.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 LA33_;
						err = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
						{
							NI32 T39_;
							if (!!((err == EINTR))) goto LA37_;
							T39_ = (NI32)0;
							T39_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
							raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T39_, ((NimStringDesc*) NIM_NIL));
						}
						LA37_: ;
					}
					goto LA31_;
					LA33_: ;
					{
						if (!(count == ((NI32) 0))) goto LA41_;
						{
							int T45_;
							NI32 T48_;
							T45_ = (int)0;
							T45_ = kill((*p).id, SIGKILL);
							if (!(T45_ == ((NI32) -1))) goto LA46_;
							T48_ = (NI32)0;
							T48_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
							raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T48_, ((NimStringDesc*) NIM_NIL));
						}
						LA46_: ;
						{
							pid_t T51_;
							NI32 T54_;
							T51_ = (pid_t)0;
							T51_ = waitpid((*p).id, (&status_2), ((int) 0));
							if (!(T51_ < ((NI32) 0))) goto LA52_;
							T54_ = (NI32)0;
							T54_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
							raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T54_, ((NimStringDesc*) NIM_NIL));
						}
						LA52_: ;
						(*p).exitFlag = NIM_TRUE;
						(*p).exitStatus = status_2;
						goto LA29;
					}
					goto LA31_;
					LA41_: ;
					{
						{
							NIM_BOOL T58_;
							T58_ = (NIM_BOOL)0;
							T58_ = (kevOut.ident == ((NU) ((*p).id)));
							if (!(T58_)) goto LA59_;
							T58_ = (kevOut.filter == ((NI16) -5));
							LA59_: ;
							if (!T58_) goto LA60_;
							{
								pid_t T64_;
								NI32 T67_;
								T64_ = (pid_t)0;
								T64_ = waitpid((*p).id, (&status_2), ((int) 0));
								if (!(T64_ < ((NI32) 0))) goto LA65_;
								T67_ = (NI32)0;
								T67_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
								raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T67_, ((NimStringDesc*) NIM_NIL));
							}
							LA65_: ;
							(*p).exitFlag = NIM_TRUE;
							(*p).exitStatus = status_2;
							goto LA29;
						}
						goto LA56_;
						LA60_: ;
						{
							NI32 T69_;
							T69_ = (NI32)0;
							T69_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
							raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T69_, ((NimStringDesc*) NIM_NIL));
						}
						LA56_: ;
					}
					LA31_: ;
				}
			} LA29: ;
			popSafePoint();
		}
		else {
			popSafePoint();
		}
		{
			int T72_;
			T72_ = (int)0;
			T72_ = close(kqFD);
			(void)(T72_);
			if (TM__HZdw8BhppcTQo8DIK46LSg_40.status != 0) nimLeaveFinally();
		}
		if (TM__HZdw8BhppcTQo8DIK46LSg_40.status != 0) reraiseException();
	}
	LA6_: ;
	T73_ = (int)0;
	T73_ = exitStatusLikeShell__vmXOHpv9cjOB5AHi6OOlhbw((*p).exitStatus);
	result = ((NI) (T73_));
	}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__y1KA3B0U09bKtU09am9a9avRYQ_3((*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__y1KA3B0U09bKtU09am9a9avRYQ_3((*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__y1KA3B0U09bKtU09am9a9avRYQ_3((*p).errStream);
		}
		goto LA17_;
		LA19_: ;
		{
			int T22_;
			T22_ = (int)0;
			T22_ = close((*p).errHandle);
			(void)(T22_);
		}
		LA17_: ;
	}
	LA3_: ;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, isExitStatus__4HQqj3kS5lecDQDDt4sh7Q)(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_ = exitStatusLikeShell__vmXOHpv9cjOB5AHi6OOlhbw((*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__4HQqj3kS5lecDQDDt4sh7Q(status);
			if (!T12_) goto LA13_;
			(*p).exitFlag = NIM_TRUE;
			(*p).exitStatus = status;
			T15_ = (int)0;
			T15_ = exitStatusLikeShell__vmXOHpv9cjOB5AHi6OOlhbw(status);
			result = ((NI) (T15_));
		}
		LA13_: ;
	}
	LA8_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, execCmdEx__9cTpvDl4v9c9c9aFgpXBZMyDDA)(NimStringDesc* command, tySet_tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA options, tyTuple__XOVT24GHXwqiEj5GCsEGCA* Result) {
	tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p;
	tyArray__8ZvwQIddfpj2THRVPsFzIQ T1_;
	tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* outp;
	tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* T2_;
	NimStringDesc* colontmp_;
	NI colontmp__2;
	NimStringDesc* line;
	nimZeroMem((void*)T1_, sizeof(tyArray__8ZvwQIddfpj2THRVPsFzIQ));
	p = nospstartProcess(command, ((NimStringDesc*) NIM_NIL), T1_, 0, NIM_NIL, (options | 4));
	outp = nospoutputStream(p);
	T2_ = (tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ*)0;
	T2_ = nospinputStream(p);
	close__y1KA3B0U09bKtU09am9a9avRYQ_3(T2_);
	colontmp_ = ((NimStringDesc*) NIM_NIL);
	colontmp__2 = ((NI) -1);
	unsureAsgnRef((void**) (&(*Result).Field0), copyString(colontmp_));
	(*Result).Field1 = colontmp__2;
	line = rawNewString(((NI) 120));
	{
		while (1) {
			{
				NIM_BOOL T7_;
				T7_ = (NIM_BOOL)0;
				T7_ = readLine__9ab9cEjuwJspa9a1pTeb1Z1BQ_2(outp, (&line));
				if (!T7_) goto LA8_;
				unsureAsgnRef((void**) (&(*Result).Field0), resizeString((*Result).Field0, (line ? line->Sup.len : 0) + 0));
appendString((*Result).Field0, line);
				unsureAsgnRef((void**) (&(*Result).Field0), resizeString((*Result).Field0, 1));
appendString((*Result).Field0, ((NimStringDesc*) &TM__HZdw8BhppcTQo8DIK46LSg_41));
			}
			goto LA5_;
			LA8_: ;
			{
				(*Result).Field1 = nosppeekExitCode(p);
				{
					if (!!(((*Result).Field1 == ((NI) -1)))) goto LA13_;
					goto LA3;
				}
				LA13_: ;
			}
			LA5_: ;
		}
	} LA3: ;
	nospclose(p);
}
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(NI, pluspercent___dgYAo7RfdUVVpvkfKDym8wsystem)(NI x, NI y) {
	NI result;
	result = (NI)0;
	result = ((NI) ((NU)((NU64)(((NU) (x))) + (NU64)(((NU) (y))))));
	return result;
}
static N_INLINE(void, incRef__AT1eRuflKWyTTBdLjEDZbg_3system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
	(*c).refcount = pluspercent___dgYAo7RfdUVVpvkfKDym8wsystem((*c).refcount, ((NI) 8));
}
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__QFQqcLB3lgOdwipkv9a60xwsystem(src);
		incRef__AT1eRuflKWyTTBdLjEDZbg_3system(T5_);
	}
	LA3_: ;
	{
		tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T10_;
		if (!!(((*dest) == NIM_NIL))) goto LA8_;
		T10_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
		T10_ = usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem((*dest));
		decRef__AT1eRuflKWyTTBdLjEDZbgsystem(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__4HQqj3kS5lecDQDDt4sh7Q(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__9bUWNxbcGnToMWA9b79aTXLIw();
			raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T20_, ((NimStringDesc*) NIM_NIL));
		}
		LA6_: ;
	}
	LA1_: ;
	}BeforeRet_: ;
	return result;
}
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;
	{
		if (!!((((NI) 0) < n))) goto LA3_;
		failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__HZdw8BhppcTQo8DIK46LSg_42));
	}
	LA3_: ;
	{
		NI i;
		tySequence__PrBYolTs4TOSgE8v5oqDUQ* q;
		tySequence__qwqHTkRvwhrRyENtudHQ7g* idxs;
		NI m;
		NI ecount;
		if (!(((NI) 1) < n)) goto LA7_;
		i = ((NI) 0);
		if ((n) < ((NI) 0) || (n) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI(n, ((NI) 0), ((NI) IL64(9223372036854775807))); }
		q = newSeq__ts9cTzRyL9a2RDNIcwmlP9bnw(((NI) (n)));
		if ((n) < ((NI) 0) || (n) > ((NI) IL64(9223372036854775807))){ raiseRangeErrorI(n, ((NI) 0), ((NI) IL64(9223372036854775807))); }
		idxs = newSeq__eA9b5cYyFZe7gRm4F9aRTKlA(((NI) (n)));
		m = ((n <= cmdsLen_0) ? n : cmdsLen_0);
		{
			while (1) {
				tyArray__8ZvwQIddfpj2THRVPsFzIQ T15_;
				NI TM__HZdw8BhppcTQo8DIK46LSg_45;
				if (!(i < m)) goto LA10;
				{
					if (!!((beforeRunEvent.ClP_0 == TM__HZdw8BhppcTQo8DIK46LSg_43.ClP_0 && beforeRunEvent.ClE_0 == TM__HZdw8BhppcTQo8DIK46LSg_43.ClE_0))) goto LA13_;
					beforeRunEvent.ClE_0? beforeRunEvent.ClP_0(i, beforeRunEvent.ClE_0):((TM__HZdw8BhppcTQo8DIK46LSg_44)(beforeRunEvent.ClP_0))(i);
				}
				LA13_: ;
				if ((NU)(i) >= (NU)(q ? q->Sup.len : 0)){ raiseIndexError2(i,(q ? q->Sup.len : 0)-1); }
				if ((NU)(i) >= (NU)(cmdsLen_0)){ raiseIndexError2(i,cmdsLen_0-1); }
				nimZeroMem((void*)T15_, sizeof(tyArray__8ZvwQIddfpj2THRVPsFzIQ));
				asgnRef((void**) (&q->data[i]), nospstartProcess(cmds[i], ((NimStringDesc*) NIM_NIL), T15_, 0, NIM_NIL, (options | 4)));
				if ((NU)(i) >= (NU)(idxs ? idxs->Sup.len : 0)){ raiseIndexError2(i,(idxs ? idxs->Sup.len : 0)-1); }
				idxs->data[i] = i;
				if (nimAddInt(i, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_45)) { raiseOverflow(); };
				i = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_45);
			} LA10: ;
		}
		ecount = cmdsLen_0;
		{
			while (1) {
				if (!(((NI) 0) < ecount)) goto LA17;
				{
					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 LA21_;
						{
							NI r;
							NI colontmp_;
							NI TM__HZdw8BhppcTQo8DIK46LSg_46;
							NI res_2;
							r = (NI)0;
							colontmp_ = (NI)0;
							if (nimSubInt(m, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_46)) { raiseOverflow(); };
							colontmp_ = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_46);
							res_2 = ((NI) 0);
							{
								while (1) {
									NI TM__HZdw8BhppcTQo8DIK46LSg_47;
									if (!(res_2 <= colontmp_)) goto LA25;
									r = res_2;
									{
										NIM_BOOL T28_;
										T28_ = (NIM_BOOL)0;
										if ((NU)(r) >= (NU)(q ? q->Sup.len : 0)){ raiseIndexError2(r,(q ? q->Sup.len : 0)-1); }
										T28_ = !((q->data[r] == 0));
										if (!(T28_)) goto LA29_;
										if ((NU)(r) >= (NU)(q ? q->Sup.len : 0)){ raiseIndexError2(r,(q ? q->Sup.len : 0)-1); }
										T28_ = ((*q->data[r]).id == res);
										LA29_: ;
										if (!T28_) goto LA30_;
										{
											NIM_BOOL T34_;
											T34_ = (NIM_BOOL)0;
											T34_ = WIFEXITED(status);
											if (T34_) goto LA35_;
											T34_ = WIFSIGNALED(status);
											LA35_: ;
											if (!T34_) goto LA36_;
											if ((NU)(r) >= (NU)(q ? q->Sup.len : 0)){ raiseIndexError2(r,(q ? q->Sup.len : 0)-1); }
											(*q->data[r]).exitFlag = NIM_TRUE;
											if ((NU)(r) >= (NU)(q ? q->Sup.len : 0)){ raiseIndexError2(r,(q ? q->Sup.len : 0)-1); }
											(*q->data[r]).exitStatus = status;
											rexit = r;
											goto LA23;
										}
										LA36_: ;
									}
									LA30_: ;
									if (nimAddInt(res_2, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_47)) { raiseOverflow(); };
									res_2 = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_47);
								} LA25: ;
							}
						} LA23: ;
					}
					goto LA19_;
					LA21_: ;
					{
						NI32 err;
						err = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
						{
							if (!(err == ECHILD)) goto LA41_;
							{
								NI r_2;
								NI colontmp__2;
								NI TM__HZdw8BhppcTQo8DIK46LSg_48;
								NI res_3;
								r_2 = (NI)0;
								colontmp__2 = (NI)0;
								if (nimSubInt(m, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_48)) { raiseOverflow(); };
								colontmp__2 = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_48);
								res_3 = ((NI) 0);
								{
									while (1) {
										NI TM__HZdw8BhppcTQo8DIK46LSg_49;
										if (!(res_3 <= colontmp__2)) goto LA45;
										r_2 = res_3;
										{
											NIM_BOOL T48_;
											NIM_BOOL T50_;
											T48_ = (NIM_BOOL)0;
											if ((NU)(r_2) >= (NU)(q ? q->Sup.len : 0)){ raiseIndexError2(r_2,(q ? q->Sup.len : 0)-1); }
											T48_ = !((q->data[r_2] == 0));
											if (!(T48_)) goto LA49_;
											if ((NU)(r_2) >= (NU)(q ? q->Sup.len : 0)){ raiseIndexError2(r_2,(q ? q->Sup.len : 0)-1); }
											T50_ = (NIM_BOOL)0;
											T50_ = nosprunning(q->data[r_2]);
											T48_ = !(T50_);
											LA49_: ;
											if (!T48_) goto LA51_;
											if ((NU)(r_2) >= (NU)(q ? q->Sup.len : 0)){ raiseIndexError2(r_2,(q ? q->Sup.len : 0)-1); }
											(*q->data[r_2]).exitFlag = NIM_TRUE;
											if ((NU)(r_2) >= (NU)(q ? q->Sup.len : 0)){ raiseIndexError2(r_2,(q ? q->Sup.len : 0)-1); }
											(*q->data[r_2]).exitStatus = status;
											rexit = r_2;
											goto LA43;
										}
										LA51_: ;
										if (nimAddInt(res_3, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_49)) { raiseOverflow(); };
										res_3 = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_49);
									} LA45: ;
								}
							} LA43: ;
						}
						goto LA39_;
						LA41_: ;
						{
							if (!(err == EINTR)) goto LA54_;
							goto LA18;
						}
						goto LA39_;
						LA54_: ;
						{
							raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(err, ((NimStringDesc*) NIM_NIL));
						}
						LA39_: ;
					}
					LA19_: ;
					{
						NI T61_;
						NI TM__HZdw8BhppcTQo8DIK46LSg_54;
						if (!(((NI) 0) <= rexit)) goto LA59_;
						if ((NU)(rexit) >= (NU)(q ? q->Sup.len : 0)){ raiseIndexError2(rexit,(q ? q->Sup.len : 0)-1); }
						T61_ = (NI)0;
						T61_ = nosppeekExitCode(q->data[rexit]);
						if (T61_ == (IL64(-9223372036854775807) - IL64(1))){ raiseOverflow(); }
						result = ((result >= (T61_ > 0? (T61_) : -(T61_))) ? result : (T61_ > 0? (T61_) : -(T61_)));
						{
							if (!!((afterRunEvent.ClP_0 == TM__HZdw8BhppcTQo8DIK46LSg_50.ClP_0 && afterRunEvent.ClE_0 == TM__HZdw8BhppcTQo8DIK46LSg_50.ClE_0))) goto LA64_;
							if ((NU)(rexit) >= (NU)(idxs ? idxs->Sup.len : 0)){ raiseIndexError2(rexit,(idxs ? idxs->Sup.len : 0)-1); }
							if ((NU)(rexit) >= (NU)(q ? q->Sup.len : 0)){ raiseIndexError2(rexit,(q ? q->Sup.len : 0)-1); }
							afterRunEvent.ClE_0? afterRunEvent.ClP_0(idxs->data[rexit], q->data[rexit], afterRunEvent.ClE_0):((TM__HZdw8BhppcTQo8DIK46LSg_51)(afterRunEvent.ClP_0))(idxs->data[rexit], q->data[rexit]);
						}
						LA64_: ;
						if ((NU)(rexit) >= (NU)(q ? q->Sup.len : 0)){ raiseIndexError2(rexit,(q ? q->Sup.len : 0)-1); }
						nospclose(q->data[rexit]);
						{
							tyArray__8ZvwQIddfpj2THRVPsFzIQ T74_;
							NI TM__HZdw8BhppcTQo8DIK46LSg_53;
							if (!(i < cmdsLen_0)) goto LA68_;
							{
								if (!!((beforeRunEvent.ClP_0 == TM__HZdw8BhppcTQo8DIK46LSg_43.ClP_0 && beforeRunEvent.ClE_0 == TM__HZdw8BhppcTQo8DIK46LSg_43.ClE_0))) goto LA72_;
								beforeRunEvent.ClE_0? beforeRunEvent.ClP_0(i, beforeRunEvent.ClE_0):((TM__HZdw8BhppcTQo8DIK46LSg_52)(beforeRunEvent.ClP_0))(i);
							}
							LA72_: ;
							if ((NU)(rexit) >= (NU)(q ? q->Sup.len : 0)){ raiseIndexError2(rexit,(q ? q->Sup.len : 0)-1); }
							if ((NU)(i) >= (NU)(cmdsLen_0)){ raiseIndexError2(i,cmdsLen_0-1); }
							nimZeroMem((void*)T74_, sizeof(tyArray__8ZvwQIddfpj2THRVPsFzIQ));
							asgnRef((void**) (&q->data[rexit]), nospstartProcess(cmds[i], ((NimStringDesc*) NIM_NIL), T74_, 0, NIM_NIL, (options | 4)));
							if ((NU)(rexit) >= (NU)(idxs ? idxs->Sup.len : 0)){ raiseIndexError2(rexit,(idxs ? idxs->Sup.len : 0)-1); }
							idxs->data[rexit] = i;
							if (nimAddInt(i, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_53)) { raiseOverflow(); };
							i = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_53);
						}
						goto LA66_;
						LA68_: ;
						{
							if ((NU)(rexit) >= (NU)(q ? q->Sup.len : 0)){ raiseIndexError2(rexit,(q ? q->Sup.len : 0)-1); }
							asgnRef((void**) (&q->data[rexit]), NIM_NIL);
						}
						LA66_: ;
						if (nimSubInt(ecount, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_54)) { raiseOverflow(); };
						ecount = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_54);
					}
					LA59_: ;
				} LA18: ;
			} LA17: ;
		}
	}
	goto LA5_;
	LA7_: ;
	{
		{
			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 T84_;
					NI T85_;
					NI TM__HZdw8BhppcTQo8DIK46LSg_57;
					if (!(res_4 <= colontmp__3)) goto LA79;
					i_2 = res_4;
					{
						if (!!((beforeRunEvent.ClP_0 == TM__HZdw8BhppcTQo8DIK46LSg_43.ClP_0 && beforeRunEvent.ClE_0 == TM__HZdw8BhppcTQo8DIK46LSg_43.ClE_0))) goto LA82_;
						beforeRunEvent.ClE_0? beforeRunEvent.ClP_0(i_2, beforeRunEvent.ClE_0):((TM__HZdw8BhppcTQo8DIK46LSg_55)(beforeRunEvent.ClP_0))(i_2);
					}
					LA82_: ;
					if ((NU)(i_2) >= (NU)(cmdsLen_0)){ raiseIndexError2(i_2,cmdsLen_0-1); }
					nimZeroMem((void*)T84_, sizeof(tyArray__8ZvwQIddfpj2THRVPsFzIQ));
					p = nospstartProcess(cmds[i_2], ((NimStringDesc*) NIM_NIL), T84_, 0, NIM_NIL, (options | 4));
					T85_ = (NI)0;
					T85_ = nospwaitForExit(p, ((NI) -1));
					if (T85_ == (IL64(-9223372036854775807) - IL64(1))){ raiseOverflow(); }
					result = (((T85_ > 0? (T85_) : -(T85_)) >= result) ? (T85_ > 0? (T85_) : -(T85_)) : result);
					{
						if (!!((afterRunEvent.ClP_0 == TM__HZdw8BhppcTQo8DIK46LSg_50.ClP_0 && afterRunEvent.ClE_0 == TM__HZdw8BhppcTQo8DIK46LSg_50.ClE_0))) goto LA88_;
						afterRunEvent.ClE_0? afterRunEvent.ClP_0(i_2, p, afterRunEvent.ClE_0):((TM__HZdw8BhppcTQo8DIK46LSg_56)(afterRunEvent.ClP_0))(i_2, p);
					}
					LA88_: ;
					nospclose(p);
					if (nimAddInt(res_4, ((NI) 1), &TM__HZdw8BhppcTQo8DIK46LSg_57)) { raiseOverflow(); };
					res_4 = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_57);
				} LA79: ;
			}
		}
	}
	LA5_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, stdlib_osprocDatInit000)(void) {
static TNimNode* TM__HZdw8BhppcTQo8DIK46LSg_2_10[10];
static TNimNode* TM__HZdw8BhppcTQo8DIK46LSg_3_7[7];
NI TM__HZdw8BhppcTQo8DIK46LSg_5;
static char* NIM_CONST TM__HZdw8BhppcTQo8DIK46LSg_4[7] = {
"poEchoCmd", 
"poUsePath", 
"poEvalCommand", 
"poStdErrToStdOut", 
"poParentStreams", 
"poInteractive", 
"poDaemon"};
static TNimNode* TM__HZdw8BhppcTQo8DIK46LSg_32_9[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_10[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__2gIj3gQlK3HZJjQaYCP6ZQ_);
TM__HZdw8BhppcTQo8DIK46LSg_0[1].name = "inHandle";
TM__HZdw8BhppcTQo8DIK46LSg_2_10[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__2gIj3gQlK3HZJjQaYCP6ZQ_);
TM__HZdw8BhppcTQo8DIK46LSg_0[2].name = "outHandle";
TM__HZdw8BhppcTQo8DIK46LSg_2_10[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__2gIj3gQlK3HZJjQaYCP6ZQ_);
TM__HZdw8BhppcTQo8DIK46LSg_0[3].name = "errHandle";
TM__HZdw8BhppcTQo8DIK46LSg_2_10[3] = &TM__HZdw8BhppcTQo8DIK46LSg_0[4];
TM__HZdw8BhppcTQo8DIK46LSg_0[4].kind = 1;
TM__HZdw8BhppcTQo8DIK46LSg_0[4].offset = offsetof(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg, id);
TM__HZdw8BhppcTQo8DIK46LSg_0[4].typ = (&NTI__r9bTMVI8f19ah9b11jMgY4kPg_);
TM__HZdw8BhppcTQo8DIK46LSg_0[4].name = "id";
TM__HZdw8BhppcTQo8DIK46LSg_2_10[4] = &TM__HZdw8BhppcTQo8DIK46LSg_0[5];
TM__HZdw8BhppcTQo8DIK46LSg_0[5].kind = 1;
TM__HZdw8BhppcTQo8DIK46LSg_0[5].offset = offsetof(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg, inStream);
TM__HZdw8BhppcTQo8DIK46LSg_0[5].typ = (&NTI__1G0jiQbe7KwD5ADza5AZaw_);
TM__HZdw8BhppcTQo8DIK46LSg_0[5].name = "inStream";
TM__HZdw8BhppcTQo8DIK46LSg_2_10[5] = &TM__HZdw8BhppcTQo8DIK46LSg_0[6];
TM__HZdw8BhppcTQo8DIK46LSg_0[6].kind = 1;
TM__HZdw8BhppcTQo8DIK46LSg_0[6].offset = offsetof(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg, outStream);
TM__HZdw8BhppcTQo8DIK46LSg_0[6].typ = (&NTI__1G0jiQbe7KwD5ADza5AZaw_);
TM__HZdw8BhppcTQo8DIK46LSg_0[6].name = "outStream";
TM__HZdw8BhppcTQo8DIK46LSg_2_10[6] = &TM__HZdw8BhppcTQo8DIK46LSg_0[7];
TM__HZdw8BhppcTQo8DIK46LSg_0[7].kind = 1;
TM__HZdw8BhppcTQo8DIK46LSg_0[7].offset = offsetof(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg, errStream);
TM__HZdw8BhppcTQo8DIK46LSg_0[7].typ = (&NTI__1G0jiQbe7KwD5ADza5AZaw_);
TM__HZdw8BhppcTQo8DIK46LSg_0[7].name = "errStream";
TM__HZdw8BhppcTQo8DIK46LSg_2_10[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_10[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_10[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_7[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_7[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_10[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_32_9[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_32_9[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__vCtGdhfQAmBlRFXaVFklkQ_);
TM__HZdw8BhppcTQo8DIK46LSg_0[22].name = "sysArgs";
TM__HZdw8BhppcTQo8DIK46LSg_32_9[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__vCtGdhfQAmBlRFXaVFklkQ_);
TM__HZdw8BhppcTQo8DIK46LSg_0[23].name = "sysEnv";
TM__HZdw8BhppcTQo8DIK46LSg_32_9[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_32_9[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_32_9[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_32_9[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_32_9[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_32_9[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_32_9[0];
NTI__xgRnKnLIYRtnOkshMKhc9cA_.node = &TM__HZdw8BhppcTQo8DIK46LSg_0[20];
}

