/* Generated by Nim Compiler v1.0.6 */
/*   (c) 2019 Andreas Rumpf */
/* The generated code is subject to the original license. */
#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 <signal.h>
#include <time.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 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_HSlice__EE5dzjqoOrHT6HJhIPXAvA tyObject_HSlice__EE5dzjqoOrHT6HJhIPXAvA;
typedef struct tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ tyObject_FileStreamObj__9bEVSsOIpkY9cf5lCtaS39bPQ;
typedef struct tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw;
typedef struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA;
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_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 raiseId;
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 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;
};
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__nHXaesL0DJZHyVS07ARPRA[1];
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;
};
struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA {
  Exception Sup;
};
struct tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw {
  tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA Sup;
};
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_63) (NI idx);
typedef NimStringDesc* tyArray__8ZvwQIddfpj2THRVPsFzIQ[1];
typedef N_CLOSURE_PTR(void, TM__HZdw8BhppcTQo8DIK46LSg_70) (NI idx, tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p);
typedef N_CLOSURE_PTR(void, TM__HZdw8BhppcTQo8DIK46LSg_71) (NI idx);
typedef N_CLOSURE_PTR(void, TM__HZdw8BhppcTQo8DIK46LSg_74) (NI idx);
typedef N_CLOSURE_PTR(void, TM__HZdw8BhppcTQo8DIK46LSg_75) (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__JE6t4x7Z3v2iVz27Nx0MRAmemory)(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__CWyPYlyH9a6rAuZckFyVxPA)(NI32 errorCode, NimStringDesc* additionalInfo);
N_LIB_PRIVATE N_NIMCALL(NI32, osLastError__9bUWNxbcGnToMWA9b79aTXLIw)(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(void, decRef__AT1eRuflKWyTTBdLjEDZbgsystem)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
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_NOINLINE(void, raiseIndexError2)(NI i, NI n);
N_NIMCALL(TGenericSeq*, incrSeqV3)(TGenericSeq* s, TNimType* typ);
static N_INLINE(NI, addInt)(NI a, NI b);
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(NI, subInt)(NI a, NI b);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, substr__iGg0RIKceRvsmvq8FUHOEw)(NimStringDesc* s, NI first);
N_LIB_PRIVATE N_NOCONV(void*, alloc0__1Sx5YIRdVWZ4weqfKjYzWA)(NI size);
N_NIMCALL(NI, mulInt)(NI a, NI b);
static N_INLINE(NI, chckRange)(NI i, NI a, NI b);
N_NOINLINE(void, raiseRangeError)(NI64 val);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
static N_INLINE(void, copyMem__M04YC71iJg1N7gBF3HZTngsystem)(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__1Sx5YIRdVWZ4weqfKjYzWA_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_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(size_t, nimCStrLen)(NCSTRING a);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, findExe__9cov9c3aI19bfbEIyMe9bNCSEA)(NimStringDesc* exe, NIM_BOOL followSymlinks, NimStringDesc** extensions, NI extensionsLen_0);
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__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_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_LIB_PRIVATE N_NIMCALL(int, exitStatusLikeShell__vmXOHpv9cjOB5AHi6OOlhbw)(int status);
static N_INLINE(NI, divInt)(NI a, NI b);
N_NOINLINE(void, raiseDivByZero)(void);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incRef__AT1eRuflKWyTTBdLjEDZbg_3system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
N_NIMCALL(void, raiseExceptionEx)(Exception* e, NCSTRING ename, NCSTRING procname, NCSTRING filename, NI line);
N_LIB_PRIVATE N_NIMCALL(void, close__y1KA3B0U09bKtU09am9a9avRYQ_3)(tyObject_StreamObj__THYguAi9bSgidczZ3ywEIMQ* s);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, isExitStatus__4HQqj3kS5lecDQDDt4sh7Q)(int status);
N_LIB_PRIVATE N_NIMCALL(NI, ncpicountProcessors)(void);
N_LIB_PRIVATE N_NIMCALL(tySequence__PrBYolTs4TOSgE8v5oqDUQ*, newSeq__RD02qAUSO9aHDYIhKtd9bW0g)(NI len);
N_LIB_PRIVATE N_NIMCALL(tySequence__qwqHTkRvwhrRyENtudHQ7g*, newSeq__9bDCA8oNTrvU3bBtRnwIhaA)(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);
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(NI, nospwaitForExit)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p, NI timeout);
extern TNimType NTI__ytyiCJqK439aF9cIibuRVpAg_;
TNimType NTI__2rGNQnv9bU4hanI2g3svReg_;
extern TNimType NTI__2gIj3gQlK3HZJjQaYCP6ZQ_;
extern TNimType NTI__r9bTMVI8f19ah9b11jMgY4kPg_;
extern TNimType NTI__1G0jiQbe7KwD5ADza5AZaw_;
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 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;
TNimType NTI__xgRnKnLIYRtnOkshMKhc9cA_;
extern TNimType NTI__77mFvmsOLKik79ci2hXkHEg_;
extern TNimType NTI__vCtGdhfQAmBlRFXaVFklkQ_;
extern TNimType NTI__S9agCYBinaYZnGWcjTdxclg_;
TNimType NTI__SKEqGXcReU4NvbQlH779b5Q_;
extern TSafePoint* excHandler__rqLlY5bs9atDw2OXYqJEn5g;
extern TSafePoint* excHandler__rqLlY5bs9atDw2OXYqJEn5g;
extern TNimType NTI__Ie1m0dv1ZHg72IgPRr1cDw_;
extern TNimType NTI__yoNlBGx0D2tRizIdhQuENw_;
STRING_LITERAL(TM__HZdw8BhppcTQo8DIK46LSg_6, "/bin/sh", 7);
STRING_LITERAL(TM__HZdw8BhppcTQo8DIK46LSg_7, "-c", 2);
STRING_LITERAL(TM__HZdw8BhppcTQo8DIK46LSg_8, "osproc.nim(857, 14) `args.len == 0` `args` has to be empty when"
" using poEvalCommand.", 84);
STRING_LITERAL(TM__HZdw8BhppcTQo8DIK46LSg_19, "=", 1);
NIM_CONST tyArray__nHXaesL0DJZHyVS07ARPRA TM__HZdw8BhppcTQo8DIK46LSg_33 = {((NimStringDesc*) NIM_NIL)}
;
STRING_LITERAL(TM__HZdw8BhppcTQo8DIK46LSg_34, "Could not find command: \'$1\'. OS error: $2", 42);
STRING_LITERAL(TM__HZdw8BhppcTQo8DIK46LSg_35, " ", 1);
STRING_LITERAL(TM__HZdw8BhppcTQo8DIK46LSg_36, "osproc.nim(1302, 17) `poParentStreams notin p.options` API usag"
"e error: stream access not allowed when you use poParentStreams", 126);
STRING_LITERAL(TM__HZdw8BhppcTQo8DIK46LSg_37, "osproc.nim(1308, 17) `poParentStreams notin p.options` API usag"
"e error: stream access not allowed when you use poParentStreams", 126);
STRING_LITERAL(TM__HZdw8BhppcTQo8DIK46LSg_44, "System time was modified", 24);
STRING_LITERAL(TM__HZdw8BhppcTQo8DIK46LSg_61, "osproc.nim(310, 10) `n > 0` ", 28);
static NIM_CONST tyProc__kElEuvYkhDcTHhB3d89aMYA TM__HZdw8BhppcTQo8DIK46LSg_62 = {NIM_NIL,NIM_NIL};
static NIM_CONST tyProc__FM4RO2zoXex9caTkjWpBmsw TM__HZdw8BhppcTQo8DIK46LSg_69 = {NIM_NIL,NIM_NIL};
static N_INLINE(void, nimSetMem__JE6t4x7Z3v2iVz27Nx0MRAmemory)(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__JE6t4x7Z3v2iVz27Nx0MRAmemory(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(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 = (NI)((NU32)((*c).refcount) - (NU32)(((NI) 8)));
	{
		if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA3_;
		rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_2system(c);
	}
	LA3_: ;
}
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem)(void* usr) {	tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* result;
	result = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
	result = ((tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*) ((NI)((NU32)(((NI) (ptrdiff_t) (usr))) - (NU32)(((NI) 8)))));
	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(NI, addInt)(NI a, NI b) {	NI result;
{	result = (NI)0;
	result = (NI)((NU32)(a) + (NU32)(b));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (((NI) 0) <= (NI)(result ^ a));
		if (T3_) goto LA4_;
		T3_ = (((NI) 0) <= (NI)(result ^ b));
		LA4_: ;
		if (!T3_) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	raiseOverflow();
	}BeforeRet_: ;
	return result;
}
static N_INLINE(void, pushSafePoint)(TSafePoint* s) {	(*s).hasRaiseAction = NIM_FALSE;
	(*s).prev = excHandler__rqLlY5bs9atDw2OXYqJEn5g;
	excHandler__rqLlY5bs9atDw2OXYqJEn5g = s;
}
static N_INLINE(NI, subInt)(NI a, NI b) {	NI result;
{	result = (NI)0;
	result = (NI)((NU32)(a) - (NU32)(b));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (((NI) 0) <= (NI)(result ^ a));
		if (T3_) goto LA4_;
		T3_ = (((NI) 0) <= (NI)(result ^ (NI)((NU32) ~(b))));
		LA4_: ;
		if (!T3_) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	raiseOverflow();
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NI, chckRange)(NI i, NI a, NI b) {	NI result;
{	result = (NI)0;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (a <= i);
		if (!(T3_)) goto LA4_;
		T3_ = (i <= b);
		LA4_: ;
		if (!T3_) goto LA5_;
		result = i;
		goto BeforeRet_;
	}
	goto LA1_;
	LA5_: ;
	{
		raiseRangeError(((NI64) (i)));
	}
	LA1_: ;
	}BeforeRet_: ;
	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__M04YC71iJg1N7gBF3HZTngsystem)(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__M04YC71iJg1N7gBF3HZTngsystem(((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);
					TM__HZdw8BhppcTQo8DIK46LSg_11 = subInt(p, ((NI) 1));
					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);
					TM__HZdw8BhppcTQo8DIK46LSg_12 = addInt(p, ((NI) 1));
					val = substr__iGg0RIKceRvsmvq8FUHOEw(environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[i], (NI)(TM__HZdw8BhppcTQo8DIK46LSg_12));
					TM__HZdw8BhppcTQo8DIK46LSg_13 = addInt(counter, ((NI) 1));
					counter = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_13);
					TM__HZdw8BhppcTQo8DIK46LSg_14 = addInt(res, ((NI) 1));
					res = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_14);
				} LA5: ;
			}
		}
	}
	TM__HZdw8BhppcTQo8DIK46LSg_15 = addInt(counter, ((NI) 1));
	TM__HZdw8BhppcTQo8DIK46LSg_16 = mulInt((NI)(TM__HZdw8BhppcTQo8DIK46LSg_15), ((NI) 4));
	T6_ = (void*)0;
	T6_ = alloc0__1Sx5YIRdVWZ4weqfKjYzWA(((NI)chckRange((NI)(TM__HZdw8BhppcTQo8DIK46LSg_16), ((NI) 0), ((NI) 2147483647))));
	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);
					TM__HZdw8BhppcTQo8DIK46LSg_17 = subInt(p_2, ((NI) 1));
					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);
					TM__HZdw8BhppcTQo8DIK46LSg_18 = addInt(p_2, ((NI) 1));
					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_;
					TM__HZdw8BhppcTQo8DIK46LSg_20 = addInt((x ? x->Sup.len : 0), ((NI) 1));
					T13_ = (void*)0;
					T13_ = alloc__1Sx5YIRdVWZ4weqfKjYzWA_2(((NI)chckRange((NI)(TM__HZdw8BhppcTQo8DIK46LSg_20), ((NI) 0), ((NI) 2147483647))));
					result[i_2] = ((NCSTRING) (T13_));
					if ((NU)(((NI) 0)) >= (NU)(x ? x->Sup.len : 0)) raiseIndexError2(((NI) 0),(x ? x->Sup.len : 0)-1);
					TM__HZdw8BhppcTQo8DIK46LSg_21 = addInt((x ? x->Sup.len : 0), ((NI) 1));
					copyMem__M04YC71iJg1N7gBF3HZTngsystem(((void*) (result[i_2])), ((void*) ((&x->data[((NI) 0)]))), ((NI)chckRange((NI)(TM__HZdw8BhppcTQo8DIK46LSg_21), ((NI) 0), ((NI) 2147483647))));
					TM__HZdw8BhppcTQo8DIK46LSg_22 = addInt(i_2, ((NI) 1));
					i_2 = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_22);
					TM__HZdw8BhppcTQo8DIK46LSg_23 = addInt(res_2, ((NI) 1));
					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);
	TM__HZdw8BhppcTQo8DIK46LSg_24 = addInt(T1_, ((NI) 1));
	TM__HZdw8BhppcTQo8DIK46LSg_25 = mulInt((NI)(TM__HZdw8BhppcTQo8DIK46LSg_24), ((NI) 4));
	T2_ = (void*)0;
	T2_ = alloc0__1Sx5YIRdVWZ4weqfKjYzWA(((NI)chckRange((NI)(TM__HZdw8BhppcTQo8DIK46LSg_25), ((NI) 0), ((NI) 2147483647))));
	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_;
						TM__HZdw8BhppcTQo8DIK46LSg_26 = addInt((x ? x->Sup.len : 0), ((NI) 1));
						T13_ = (void*)0;
						T13_ = alloc__1Sx5YIRdVWZ4weqfKjYzWA_2(((NI)chckRange((NI)(TM__HZdw8BhppcTQo8DIK46LSg_26), ((NI) 0), ((NI) 2147483647))));
						result[i] = ((NCSTRING) (T13_));
						if ((NU)(((NI) 0)) >= (NU)(x ? x->Sup.len : 0)) raiseIndexError2(((NI) 0),(x ? x->Sup.len : 0)-1);
						TM__HZdw8BhppcTQo8DIK46LSg_27 = addInt((x ? x->Sup.len : 0), ((NI) 1));
						copyMem__M04YC71iJg1N7gBF3HZTngsystem(((void*) (result[i])), ((void*) ((&x->data[((NI) 0)]))), ((NI)chckRange((NI)(TM__HZdw8BhppcTQo8DIK46LSg_27), ((NI) 0), ((NI) 2147483647))));
						TM__HZdw8BhppcTQo8DIK46LSg_28 = addInt(i, ((NI) 1));
						i = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_28);
					}
					LA10_: ;
					TM__HZdw8BhppcTQo8DIK46LSg_29 = addInt(res, ((NI) 1));
					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(size_t, nimCStrLen)(NCSTRING a) {	size_t result;
	result = (size_t)0;
	result = strlen(a);
	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_);
	{
		NimStringDesc* exe;
		int T48_;
		if (!(((*data).options &(1U<<((NU)(((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA) 1))&7U)))!=0)) goto LA46_;
		exe = findExe__9cov9c3aI19bfbEIyMe9bNCSEA((*data).sysCommand, NIM_TRUE, TM__HZdw8BhppcTQo8DIK46LSg_33, 1);
		T48_ = (int)0;
		T48_ = execve(nimToCStringConv(exe), (*data).sysArgs, (*data).sysEnv);
		(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_34), 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) 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 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_: ;
	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_);
		{
			if (!!((argsLen_0 == ((NI) 0)))) goto LA26_;
			failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__HZdw8BhppcTQo8DIK46LSg_8));
		}
		LA26_: ;
	}
	goto LA17_;
	LA19_: ;
	{
		NimStringDesc* T29_;
		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_);
					TM__HZdw8BhppcTQo8DIK46LSg_9 = addInt(i, ((NI) 1));
					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) {
			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__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_35));
				T46_[2] = nsuJoinSep(args, argsLen_0, ((NimStringDesc*) &TM__HZdw8BhppcTQo8DIK46LSg_35));
				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) reraiseException();
		popSafePoint();
	}
	else {
		popSafePoint();
	}
	{
		deallocCStringArray__4ixt9bnFA4tfz1dFgECtQLw(sysArgs);
	}
	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_36));
	}
	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_37));
	}
	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(NI, divInt)(NI a, NI b) {	NI result;
{	result = (NI)0;
	{
		if (!(b == ((NI) 0))) goto LA3_;
		raiseDivByZero();
	}
	LA3_: ;
	{
		NIM_BOOL T7_;
		T7_ = (NIM_BOOL)0;
		T7_ = (a == ((NI) (-2147483647 -1)));
		if (!(T7_)) goto LA8_;
		T7_ = (b == ((NI) -1));
		LA8_: ;
		if (!T7_) goto LA9_;
		raiseOverflow();
	}
	LA9_: ;
	result = (NI)(a / b);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(void, incRef__AT1eRuflKWyTTBdLjEDZbg_3system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {	(*c).refcount = (NI)((NU32)((*c).refcount) + (NU32)(((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(NI, nospwaitForExit)(tyObject_ProcessObj__2rGNQnv9bU4hanI2g3svReg* p, NI timeout) {	NI result;
	int T130_;
{	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_: ;
	{
		sigset_t nmask;
		sigset_t omask;
		siginfo_t sinfo;
		struct timespec stspec;
		struct timespec enspec;
		struct timespec tmspec;
		int T17_;
		int T18_;
		int T19_;
		TSafePoint TM__HZdw8BhppcTQo8DIK46LSg_41;
		nimZeroMem((void*)(&nmask), sizeof(sigset_t));
		nimZeroMem((void*)(&omask), sizeof(sigset_t));
		nimZeroMem((void*)(&sinfo), sizeof(siginfo_t));
		nimZeroMem((void*)(&stspec), sizeof(struct timespec));
		nimZeroMem((void*)(&enspec), sizeof(struct timespec));
		nimZeroMem((void*)(&tmspec), sizeof(struct timespec));
		T17_ = (int)0;
		T17_ = sigemptyset((&nmask));
		(void)(T17_);
		T18_ = (int)0;
		T18_ = sigemptyset((&omask));
		(void)(T18_);
		T19_ = (int)0;
		T19_ = sigaddset((&nmask), SIGCHLD);
		(void)(T19_);
		{
			int T22_;
			NI32 T25_;
			T22_ = (int)0;
			T22_ = sigprocmask(SIG_BLOCK, (&nmask), (&omask));
			if (!(T22_ == ((NI32) -1))) goto LA23_;
			T25_ = (NI32)0;
			T25_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
			raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T25_, ((NimStringDesc*) NIM_NIL));
		}
		LA23_: ;
		{
			NI TM__HZdw8BhppcTQo8DIK46LSg_38;
			NI TM__HZdw8BhppcTQo8DIK46LSg_39;
			if (!(((NI) 1000) <= timeout)) goto LA28_;
			TM__HZdw8BhppcTQo8DIK46LSg_38 = divInt(timeout, ((NI) 1000));
			tmspec.tv_sec = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_38);
			TM__HZdw8BhppcTQo8DIK46LSg_39 = mulInt((NI)((NU32)(timeout) % (NU32)(((NI) 1000))), ((NI) 1000000));
			tmspec.tv_nsec = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_39);
		}
		goto LA26_;
		LA28_: ;
		{
			NI TM__HZdw8BhppcTQo8DIK46LSg_40;
			tmspec.tv_sec = ((long) 0);
			TM__HZdw8BhppcTQo8DIK46LSg_40 = mulInt(timeout, ((NI) 1000000));
			tmspec.tv_nsec = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_40);
		}
		LA26_: ;
		pushSafePoint(&TM__HZdw8BhppcTQo8DIK46LSg_41);
		TM__HZdw8BhppcTQo8DIK46LSg_41.status = setjmp(TM__HZdw8BhppcTQo8DIK46LSg_41.context);
		if (TM__HZdw8BhppcTQo8DIK46LSg_41.status == 0) {
			{
				int T34_;
				NI32 T37_;
				T34_ = (int)0;
				T34_ = clock_gettime(((clockid_t) (CLOCK_REALTIME)), (&stspec));
				if (!(T34_ == ((NI32) -1))) goto LA35_;
				T37_ = (NI32)0;
				T37_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
				raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T37_, ((NimStringDesc*) NIM_NIL));
			}
			LA35_: ;
			{
				while (1) {
					int res;
					res = sigtimedwait((&nmask), (&sinfo), (&tmspec));
					{
						if (!(res == SIGCHLD)) goto LA42_;
						{
							int status_2;
							if (!(sinfo.si_pid == (*p).id)) goto LA46_;
							status_2 = ((int) 1);
							{
								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__9bUWNxbcGnToMWA9b79aTXLIw();
								raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T53_, ((NimStringDesc*) NIM_NIL));
							}
							LA51_: ;
							(*p).exitFlag = NIM_TRUE;
							(*p).exitStatus = status_2;
							goto LA38;
						}
						goto LA44_;
						LA46_: ;
						{
							NI volatile diffX60gensym425227_;
							struct timespec bX60gensym425228_;
							long TM__HZdw8BhppcTQo8DIK46LSg_42;
							long TM__HZdw8BhppcTQo8DIK46LSg_47;
							{
								int T57_;
								NI32 T60_;
								T57_ = (int)0;
								T57_ = clock_gettime(((clockid_t) (CLOCK_REALTIME)), (&enspec));
								if (!(T57_ == ((NI32) -1))) goto LA58_;
								T60_ = (NI32)0;
								T60_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
								raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T60_, ((NimStringDesc*) NIM_NIL));
							}
							LA58_: ;
							diffX60gensym425227_ = (NI)0;
							nimZeroMem((void*)(&bX60gensym425228_), sizeof(struct timespec));
							bX60gensym425228_.tv_sec = enspec.tv_sec;
							bX60gensym425228_.tv_nsec = enspec.tv_nsec;
							TM__HZdw8BhppcTQo8DIK46LSg_42 = subInt(enspec.tv_sec, stspec.tv_sec);
							enspec.tv_sec = (long)(TM__HZdw8BhppcTQo8DIK46LSg_42);
							{
								NI TM__HZdw8BhppcTQo8DIK46LSg_43;
								if (!(stspec.tv_nsec <= enspec.tv_nsec)) goto LA63_;
								TM__HZdw8BhppcTQo8DIK46LSg_43 = subInt(enspec.tv_nsec, stspec.tv_nsec);
								enspec.tv_nsec = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_43);
							}
							goto LA61_;
							LA63_: ;
							{
								{
									tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw* volatile eX60gensym425238_;
									NimStringDesc* T70_;
									if (!(enspec.tv_sec == ((long) 0))) goto LA68_;
									eX60gensym425238_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*)0;
									eX60gensym425238_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*) newObj((&NTI__Ie1m0dv1ZHg72IgPRr1cDw_), sizeof(tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw));
									(*eX60gensym425238_).Sup.Sup.Sup.m_type = (&NTI__yoNlBGx0D2tRizIdhQuENw_);
									(*eX60gensym425238_).Sup.Sup.name = "ValueError";
									T70_ = (NimStringDesc*)0;
									T70_ = (*eX60gensym425238_).Sup.Sup.message; (*eX60gensym425238_).Sup.Sup.message = copyStringRC1(((NimStringDesc*) &TM__HZdw8BhppcTQo8DIK46LSg_44));
									if (T70_) nimGCunrefNoCycle(T70_);
									asgnRef((void**) (&(*eX60gensym425238_).Sup.Sup.parent), NIM_NIL);
									raiseExceptionEx((Exception*)eX60gensym425238_, "ValueError", "waitForExit", "osproc.nim", 1187);
								}
								goto LA66_;
								LA68_: ;
								{
									NI TM__HZdw8BhppcTQo8DIK46LSg_45;
									NI TM__HZdw8BhppcTQo8DIK46LSg_46;
									TM__HZdw8BhppcTQo8DIK46LSg_45 = subInt(stspec.tv_nsec, enspec.tv_nsec);
									diffX60gensym425227_ = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_45);
									TM__HZdw8BhppcTQo8DIK46LSg_46 = subInt(((NI) 1000000000), diffX60gensym425227_);
									enspec.tv_nsec = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_46);
								}
								LA66_: ;
							}
							LA61_: ;
							TM__HZdw8BhppcTQo8DIK46LSg_47 = subInt(tmspec.tv_sec, enspec.tv_sec);
							tmspec.tv_sec = (long)(TM__HZdw8BhppcTQo8DIK46LSg_47);
							{
								NI TM__HZdw8BhppcTQo8DIK46LSg_48;
								if (!(enspec.tv_nsec <= tmspec.tv_nsec)) goto LA74_;
								TM__HZdw8BhppcTQo8DIK46LSg_48 = subInt(tmspec.tv_nsec, enspec.tv_nsec);
								tmspec.tv_nsec = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_48);
							}
							goto LA72_;
							LA74_: ;
							{
								long TM__HZdw8BhppcTQo8DIK46LSg_49;
								NI TM__HZdw8BhppcTQo8DIK46LSg_50;
								NI TM__HZdw8BhppcTQo8DIK46LSg_51;
								TM__HZdw8BhppcTQo8DIK46LSg_49 = subInt(tmspec.tv_sec, ((long) 1));
								tmspec.tv_sec = (long)(TM__HZdw8BhppcTQo8DIK46LSg_49);
								TM__HZdw8BhppcTQo8DIK46LSg_50 = subInt(enspec.tv_nsec, tmspec.tv_nsec);
								diffX60gensym425227_ = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_50);
								TM__HZdw8BhppcTQo8DIK46LSg_51 = subInt(((NI) 1000000000), diffX60gensym425227_);
								tmspec.tv_nsec = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_51);
							}
							LA72_: ;
							stspec.tv_sec = bX60gensym425228_.tv_sec;
							stspec.tv_nsec = bX60gensym425228_.tv_nsec;
						}
						LA44_: ;
					}
					goto LA40_;
					LA42_: ;
					{
						NI32 err;
						if (!(res < ((NI32) 0))) goto LA78_;
						err = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
						{
							NI volatile diffX60gensym425423_;
							struct timespec bX60gensym425424_;
							long TM__HZdw8BhppcTQo8DIK46LSg_52;
							long TM__HZdw8BhppcTQo8DIK46LSg_56;
							if (!(err == EINTR)) goto LA82_;
							{
								int T86_;
								NI32 T89_;
								T86_ = (int)0;
								T86_ = clock_gettime(((clockid_t) (CLOCK_REALTIME)), (&enspec));
								if (!(T86_ == ((NI32) -1))) goto LA87_;
								T89_ = (NI32)0;
								T89_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
								raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T89_, ((NimStringDesc*) NIM_NIL));
							}
							LA87_: ;
							diffX60gensym425423_ = (NI)0;
							nimZeroMem((void*)(&bX60gensym425424_), sizeof(struct timespec));
							bX60gensym425424_.tv_sec = enspec.tv_sec;
							bX60gensym425424_.tv_nsec = enspec.tv_nsec;
							TM__HZdw8BhppcTQo8DIK46LSg_52 = subInt(enspec.tv_sec, stspec.tv_sec);
							enspec.tv_sec = (long)(TM__HZdw8BhppcTQo8DIK46LSg_52);
							{
								NI TM__HZdw8BhppcTQo8DIK46LSg_53;
								if (!(stspec.tv_nsec <= enspec.tv_nsec)) goto LA92_;
								TM__HZdw8BhppcTQo8DIK46LSg_53 = subInt(enspec.tv_nsec, stspec.tv_nsec);
								enspec.tv_nsec = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_53);
							}
							goto LA90_;
							LA92_: ;
							{
								{
									tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw* volatile eX60gensym425434_;
									NimStringDesc* T99_;
									if (!(enspec.tv_sec == ((long) 0))) goto LA97_;
									eX60gensym425434_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*)0;
									eX60gensym425434_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*) newObj((&NTI__Ie1m0dv1ZHg72IgPRr1cDw_), sizeof(tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw));
									(*eX60gensym425434_).Sup.Sup.Sup.m_type = (&NTI__yoNlBGx0D2tRizIdhQuENw_);
									(*eX60gensym425434_).Sup.Sup.name = "ValueError";
									T99_ = (NimStringDesc*)0;
									T99_ = (*eX60gensym425434_).Sup.Sup.message; (*eX60gensym425434_).Sup.Sup.message = copyStringRC1(((NimStringDesc*) &TM__HZdw8BhppcTQo8DIK46LSg_44));
									if (T99_) nimGCunrefNoCycle(T99_);
									asgnRef((void**) (&(*eX60gensym425434_).Sup.Sup.parent), NIM_NIL);
									raiseExceptionEx((Exception*)eX60gensym425434_, "ValueError", "waitForExit", "osproc.nim", 1187);
								}
								goto LA95_;
								LA97_: ;
								{
									NI TM__HZdw8BhppcTQo8DIK46LSg_54;
									NI TM__HZdw8BhppcTQo8DIK46LSg_55;
									TM__HZdw8BhppcTQo8DIK46LSg_54 = subInt(stspec.tv_nsec, enspec.tv_nsec);
									diffX60gensym425423_ = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_54);
									TM__HZdw8BhppcTQo8DIK46LSg_55 = subInt(((NI) 1000000000), diffX60gensym425423_);
									enspec.tv_nsec = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_55);
								}
								LA95_: ;
							}
							LA90_: ;
							TM__HZdw8BhppcTQo8DIK46LSg_56 = subInt(tmspec.tv_sec, enspec.tv_sec);
							tmspec.tv_sec = (long)(TM__HZdw8BhppcTQo8DIK46LSg_56);
							{
								NI TM__HZdw8BhppcTQo8DIK46LSg_57;
								if (!(enspec.tv_nsec <= tmspec.tv_nsec)) goto LA103_;
								TM__HZdw8BhppcTQo8DIK46LSg_57 = subInt(tmspec.tv_nsec, enspec.tv_nsec);
								tmspec.tv_nsec = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_57);
							}
							goto LA101_;
							LA103_: ;
							{
								long TM__HZdw8BhppcTQo8DIK46LSg_58;
								NI TM__HZdw8BhppcTQo8DIK46LSg_59;
								NI TM__HZdw8BhppcTQo8DIK46LSg_60;
								TM__HZdw8BhppcTQo8DIK46LSg_58 = subInt(tmspec.tv_sec, ((long) 1));
								tmspec.tv_sec = (long)(TM__HZdw8BhppcTQo8DIK46LSg_58);
								TM__HZdw8BhppcTQo8DIK46LSg_59 = subInt(enspec.tv_nsec, tmspec.tv_nsec);
								diffX60gensym425423_ = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_59);
								TM__HZdw8BhppcTQo8DIK46LSg_60 = subInt(((NI) 1000000000), diffX60gensym425423_);
								tmspec.tv_nsec = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_60);
							}
							LA101_: ;
							stspec.tv_sec = bX60gensym425424_.tv_sec;
							stspec.tv_nsec = bX60gensym425424_.tv_nsec;
						}
						goto LA80_;
						LA82_: ;
						{
							int status_3;
							if (!(err == EAGAIN)) goto LA107_;
							{
								int T111_;
								NI32 T114_;
								T111_ = (int)0;
								T111_ = kill((*p).id, SIGKILL);
								if (!(T111_ == ((NI32) -1))) goto LA112_;
								T114_ = (NI32)0;
								T114_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
								raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T114_, ((NimStringDesc*) NIM_NIL));
							}
							LA112_: ;
							status_3 = ((int) 1);
							{
								pid_t T117_;
								NI32 T120_;
								T117_ = (pid_t)0;
								T117_ = waitpid((*p).id, (&status_3), ((int) 0));
								if (!(T117_ < ((NI32) 0))) goto LA118_;
								T120_ = (NI32)0;
								T120_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
								raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T120_, ((NimStringDesc*) NIM_NIL));
							}
							LA118_: ;
							(*p).exitFlag = NIM_TRUE;
							(*p).exitStatus = status_3;
							goto LA38;
						}
						goto LA80_;
						LA107_: ;
						{
							raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(err, ((NimStringDesc*) NIM_NIL));
						}
						LA80_: ;
					}
					goto LA40_;
					LA78_: ;
					LA40_: ;
				}
			} LA38: ;
			popSafePoint();
		}
		else {
			popSafePoint();
		}
		{
			{
				int T126_;
				NI32 T129_;
				T126_ = (int)0;
				T126_ = sigprocmask(SIG_UNBLOCK, (&nmask), (&omask));
				if (!(T126_ == ((NI32) -1))) goto LA127_;
				T129_ = (NI32)0;
				T129_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
				raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T129_, ((NimStringDesc*) NIM_NIL));
			}
			LA127_: ;
		}
		if (TM__HZdw8BhppcTQo8DIK46LSg_41.status != 0) reraiseException();
	}
	LA6_: ;
	T130_ = (int)0;
	T130_ = exitStatusLikeShell__vmXOHpv9cjOB5AHi6OOlhbw((*p).exitStatus);
	result = ((NI) (T130_));
	}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(NI, nospcountProcessors)(void) {	NI result;
	result = (NI)0;
	result = ncpicountProcessors();
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, nospexecCmd)(NimStringDesc* command) {	NI result;
	int tmp;
	int T1_;
	result = (NI)0;
	tmp = system(nimToCStringConv(command));
	T1_ = (int)0;
	{
		if (!(tmp == ((NI32) -1))) goto LA4_;
		T1_ = tmp;
	}
	goto LA2_;
	LA4_: ;
	{
		T1_ = exitStatusLikeShell__vmXOHpv9cjOB5AHi6OOlhbw(tmp);
	}
	LA2_: ;
	result = ((NI) (T1_));
	return result;
}
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_61));
	}
	LA3_: ;
	{
		NI i;
		tySequence__PrBYolTs4TOSgE8v5oqDUQ* q;
		tySequence__qwqHTkRvwhrRyENtudHQ7g* idxs;
		NI m;
		NI ecount;
		if (!(((NI) 1) < n)) goto LA7_;
		i = ((NI) 0);
		q = newSeq__RD02qAUSO9aHDYIhKtd9bW0g(((NI)chckRange(n, ((NI) 0), ((NI) 2147483647))));
		idxs = newSeq__9bDCA8oNTrvU3bBtRnwIhaA(((NI)chckRange(n, ((NI) 0), ((NI) 2147483647))));
		m = ((n <= cmdsLen_0) ? n : cmdsLen_0);
		{
			while (1) {
				tyArray__8ZvwQIddfpj2THRVPsFzIQ T15_;
				NI TM__HZdw8BhppcTQo8DIK46LSg_64;
				if (!(i < m)) goto LA10;
				{
					if (!!((beforeRunEvent.ClP_0 == TM__HZdw8BhppcTQo8DIK46LSg_62.ClP_0 && beforeRunEvent.ClE_0 == TM__HZdw8BhppcTQo8DIK46LSg_62.ClE_0))) goto LA13_;
					beforeRunEvent.ClE_0? beforeRunEvent.ClP_0(i, beforeRunEvent.ClE_0):((TM__HZdw8BhppcTQo8DIK46LSg_63)(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;
				TM__HZdw8BhppcTQo8DIK46LSg_64 = addInt(i, ((NI) 1));
				i = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_64);
			} 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_65;
							NI res_2;
							r = (NI)0;
							colontmp_ = (NI)0;
							TM__HZdw8BhppcTQo8DIK46LSg_65 = subInt(m, ((NI) 1));
							colontmp_ = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_65);
							res_2 = ((NI) 0);
							{
								while (1) {
									NI TM__HZdw8BhppcTQo8DIK46LSg_66;
									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_: ;
									TM__HZdw8BhppcTQo8DIK46LSg_66 = addInt(res_2, ((NI) 1));
									res_2 = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_66);
								} LA25: ;
							}
						} LA23: ;
					}
					goto LA19_;
					LA21_: ;
					{
						NI32 err;
						err = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
						{
							if (!(err == ECHILD)) goto LA41_;
							{
								NI r_2;
								NI colontmp__2;
								NI TM__HZdw8BhppcTQo8DIK46LSg_67;
								NI res_3;
								r_2 = (NI)0;
								colontmp__2 = (NI)0;
								TM__HZdw8BhppcTQo8DIK46LSg_67 = subInt(m, ((NI) 1));
								colontmp__2 = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_67);
								res_3 = ((NI) 0);
								{
									while (1) {
										NI TM__HZdw8BhppcTQo8DIK46LSg_68;
										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_: ;
										TM__HZdw8BhppcTQo8DIK46LSg_68 = addInt(res_3, ((NI) 1));
										res_3 = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_68);
									} 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_73;
						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_ == (-2147483647 -1)) raiseOverflow();
						result = ((result >= (T61_ > 0? (T61_) : -(T61_))) ? result : (T61_ > 0? (T61_) : -(T61_)));
						{
							if (!!((afterRunEvent.ClP_0 == TM__HZdw8BhppcTQo8DIK46LSg_69.ClP_0 && afterRunEvent.ClE_0 == TM__HZdw8BhppcTQo8DIK46LSg_69.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_70)(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_72;
							if (!(i < cmdsLen_0)) goto LA68_;
							{
								if (!!((beforeRunEvent.ClP_0 == TM__HZdw8BhppcTQo8DIK46LSg_62.ClP_0 && beforeRunEvent.ClE_0 == TM__HZdw8BhppcTQo8DIK46LSg_62.ClE_0))) goto LA72_;
								beforeRunEvent.ClE_0? beforeRunEvent.ClP_0(i, beforeRunEvent.ClE_0):((TM__HZdw8BhppcTQo8DIK46LSg_71)(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;
							TM__HZdw8BhppcTQo8DIK46LSg_72 = addInt(i, ((NI) 1));
							i = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_72);
						}
						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_: ;
						TM__HZdw8BhppcTQo8DIK46LSg_73 = subInt(ecount, ((NI) 1));
						ecount = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_73);
					}
					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_76;
					if (!(res_4 <= colontmp__3)) goto LA79;
					i_2 = res_4;
					{
						if (!!((beforeRunEvent.ClP_0 == TM__HZdw8BhppcTQo8DIK46LSg_62.ClP_0 && beforeRunEvent.ClE_0 == TM__HZdw8BhppcTQo8DIK46LSg_62.ClE_0))) goto LA82_;
						beforeRunEvent.ClE_0? beforeRunEvent.ClP_0(i_2, beforeRunEvent.ClE_0):((TM__HZdw8BhppcTQo8DIK46LSg_74)(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_ == (-2147483647 -1)) raiseOverflow();
					result = (((T85_ > 0? (T85_) : -(T85_)) >= result) ? (T85_ > 0? (T85_) : -(T85_)) : result);
					{
						if (!!((afterRunEvent.ClP_0 == TM__HZdw8BhppcTQo8DIK46LSg_69.ClP_0 && afterRunEvent.ClE_0 == TM__HZdw8BhppcTQo8DIK46LSg_69.ClE_0))) goto LA88_;
						afterRunEvent.ClE_0? afterRunEvent.ClP_0(i_2, p, afterRunEvent.ClE_0):((TM__HZdw8BhppcTQo8DIK46LSg_75)(afterRunEvent.ClP_0))(i_2, p);
					}
					LA88_: ;
					nospclose(p);
					TM__HZdw8BhppcTQo8DIK46LSg_76 = addInt(res_4, ((NI) 1));
					res_4 = (NI)(TM__HZdw8BhppcTQo8DIK46LSg_76);
				} 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];
}

