/* Generated by Nim Compiler v0.17.0 */
/*   (c) 2017 Andreas Rumpf */
/* The generated code is subject to the original license. */
/* Compiled for: Linux, arm, gcc */
/* Command for C compiler:
   gcc -c  -w -O3 -fno-strict-aliasing -fPIC  -I/build/nim/src/Nim-0.17.0/lib -o lib/nimcache/stdlib_osproc.o lib/nimcache/stdlib_osproc.c */
#define NIM_NEW_MANGLING_RULES
#define NIM_INTBITS 32

#include "nimbase.h"
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <setjmp.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <signal.h>
#include <sys/wait.h>
#include <time.h>
#include <stdlib.h>
#undef linux
#undef near
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct ProcessObj_NHqciQYh8G1aN2n273mmYw ProcessObj_NHqciQYh8G1aN2n273mmYw;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct StreamObj_RShkcoDOPnoCVhtpN1hDPQ StreamObj_RShkcoDOPnoCVhtpN1hDPQ;
typedef struct TY_l0xXJxOLtcuhlSBHl64t5w TY_l0xXJxOLtcuhlSBHl64t5w;
typedef struct Cell_1zcF9cV8XIAtbN8h5HRUB8g Cell_1zcF9cV8XIAtbN8h5HRUB8g;
typedef struct StringTableObj_DKRIdH9c9cKI7YpQb9c0wKlEw StringTableObj_DKRIdH9c9cKI7YpQb9c0wKlEw;
typedef struct TY_sM4lkSb7zS6F7OVMvW9cffQ TY_sM4lkSb7zS6F7OVMvW9cffQ;
typedef struct Exception Exception;
typedef struct TSafePoint TSafePoint;
typedef struct TY_4eQHGndY6XBYpFOH09apV8Q TY_4eQHGndY6XBYpFOH09apV8Q;
typedef struct TY_UV3llMMYFckfui8YMBuUZA TY_UV3llMMYFckfui8YMBuUZA;
typedef struct StartProcessData_xgRnKnLIYRtnOkshMKhc9cA StartProcessData_xgRnKnLIYRtnOkshMKhc9cA;
typedef struct ValueError_Gi06FkNeykJn7mrqRZYrkA ValueError_Gi06FkNeykJn7mrqRZYrkA;
typedef struct FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef NU8 TY_nmiMWKVIe46vacnhAFrQvw_Set[32];
typedef NU8 TNimKind_jIBKr1ejBgsfM33Kxw4j7A;
typedef NU8 TNimTypeFlag_v8QUszD1sWlSIWZz7mC4bQ_Set;
typedef N_NIMCALL_PTR(void, TY_ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY_WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
struct  TNimType  {
NI size;
TNimKind_jIBKr1ejBgsfM33Kxw4j7A kind;
TNimTypeFlag_v8QUszD1sWlSIWZz7mC4bQ_Set flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY_ojoeKfW4VYIm36I9cpDTQIg marker;
TY_WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
typedef NU8 ProcessOption_bnU6W8LhTMnT4JaSWtGlSA_Set;
struct  ProcessObj_NHqciQYh8G1aN2n273mmYw  {
  TNimObject Sup;
int inHandle;
int outHandle;
int errHandle;
StreamObj_RShkcoDOPnoCVhtpN1hDPQ* inStream;
StreamObj_RShkcoDOPnoCVhtpN1hDPQ* outStream;
StreamObj_RShkcoDOPnoCVhtpN1hDPQ* errStream;
pid_t id;
int exitStatus;
ProcessOption_bnU6W8LhTMnT4JaSWtGlSA_Set options;
};
typedef struct {
N_NIMCALL_PTR(void, ClP_0) (NI idx, void* ClE_0);
void* ClE_0;
} TY_kElEuvYkhDcTHhB3d89aMYA;
typedef struct {
N_NIMCALL_PTR(void, ClP_0) (NI idx, ProcessObj_NHqciQYh8G1aN2n273mmYw* p, void* ClE_0);
void* ClE_0;
} TY_SfW5itioRNR8yop8fOJeNg;
typedef NU8 TNimNodeKind_unfNsxrcATrufDZmpBq4HQ;
struct  TNimNode  {
TNimNodeKind_unfNsxrcATrufDZmpBq4HQ kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
typedef NU8 ProcessOption_bnU6W8LhTMnT4JaSWtGlSA;
typedef N_CLOSURE_PTR(void, TM_HZdw8BhppcTQo8DIK46LSg_15) (NI idx);
typedef NimStringDesc* TY_8ZvwQIddfpj2THRVPsFzIQ[1];
struct  Cell_1zcF9cV8XIAtbN8h5HRUB8g  {
NI refcount;
TNimType* typ;
};
typedef N_CLOSURE_PTR(void, TM_HZdw8BhppcTQo8DIK46LSg_17) (NI idx, ProcessObj_NHqciQYh8G1aN2n273mmYw* p);
typedef N_CLOSURE_PTR(void, TM_HZdw8BhppcTQo8DIK46LSg_18) (NI idx);
typedef N_CLOSURE_PTR(void, TM_HZdw8BhppcTQo8DIK46LSg_19) (NI idx, ProcessObj_NHqciQYh8G1aN2n273mmYw* p);
typedef N_CLOSURE_PTR(void, TM_HZdw8BhppcTQo8DIK46LSg_20) (NI idx);
typedef N_CLOSURE_PTR(void, TM_HZdw8BhppcTQo8DIK46LSg_21) (NI idx, ProcessObj_NHqciQYh8G1aN2n273mmYw* p);
typedef int TY_SKEqGXcReU4NvbQlH779b5Q[2];
struct  Exception  {
  TNimObject Sup;
Exception* parent;
NCSTRING name;
NimStringDesc* message;
NimStringDesc* trace;
};
typedef struct {
N_NIMCALL_PTR(NIM_BOOL, ClP_0) (Exception* e, void* ClE_0);
void* ClE_0;
} TY_KeeAOYBd84Ofsw6Y7LizaQ;
struct  TSafePoint  {
TSafePoint* prev;
NI status;
jmp_buf context;
NIM_BOOL hasRaiseAction;
TY_KeeAOYBd84Ofsw6Y7LizaQ raiseAction;
};
typedef NU8 StringTableMode_G9c4wVDFIzf0xHmQvxso9a9cQ;
struct  StringTableObj_DKRIdH9c9cKI7YpQb9c0wKlEw  {
  TNimObject Sup;
NI counter;
TY_4eQHGndY6XBYpFOH09apV8Q* data;
StringTableMode_G9c4wVDFIzf0xHmQvxso9a9cQ mode;
};
struct TY_UV3llMMYFckfui8YMBuUZA {
NimStringDesc* Field0;
NimStringDesc* Field1;
};
struct  StartProcessData_xgRnKnLIYRtnOkshMKhc9cA  {
NCSTRING sysCommand;
NCSTRING* sysArgs;
NCSTRING* sysEnv;
NCSTRING workingDir;
TY_SKEqGXcReU4NvbQlH779b5Q pStdin;
TY_SKEqGXcReU4NvbQlH779b5Q pStdout;
TY_SKEqGXcReU4NvbQlH779b5Q pStderr;
TY_SKEqGXcReU4NvbQlH779b5Q pErrorPipe;
NIM_BOOL optionPoUsePath;
NIM_BOOL optionPoParentStreams;
NIM_BOOL optionPoStdErrToStdOut;
};
typedef NimStringDesc* TY_Re75IspeoxXy2oCZHwcRrA[2];
struct  ValueError_Gi06FkNeykJn7mrqRZYrkA  {
  Exception Sup;
};
typedef NU8 FileMode_fVUBHvW79bXUw1j55Oo9avSQ;
typedef N_NIMCALL_PTR(void, TY_cnkJEp9bna8U6yi9aVW9cAJ0Q) (StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s);
typedef N_NIMCALL_PTR(NIM_BOOL, TY_KjFcmLOhf4VQvVcyLJWXZw) (StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s);
typedef N_NIMCALL_PTR(void, TY_jlOYFw9cHausuCbPoWx2iiA) (StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s, NI pos);
typedef N_NIMCALL_PTR(NI, TY_Xzm85qBLb9cf9cu8VOfAr8PQ) (StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s);
typedef N_NIMCALL_PTR(NI, TY_tjaJtoUzLe1BMUbItlcGhQ) (StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s, void* buffer, NI bufLen);
typedef N_NIMCALL_PTR(void, TY_b9bsIuILxTLVZHPvJBW187A) (StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s, void* buffer, NI bufLen);
struct  StreamObj_RShkcoDOPnoCVhtpN1hDPQ  {
  TNimObject Sup;
TY_cnkJEp9bna8U6yi9aVW9cAJ0Q closeImpl;
TY_KjFcmLOhf4VQvVcyLJWXZw atEndImpl;
TY_jlOYFw9cHausuCbPoWx2iiA setPositionImpl;
TY_Xzm85qBLb9cf9cu8VOfAr8PQ getPositionImpl;
TY_tjaJtoUzLe1BMUbItlcGhQ readDataImpl;
TY_tjaJtoUzLe1BMUbItlcGhQ peekDataImpl;
TY_b9bsIuILxTLVZHPvJBW187A writeDataImpl;
TY_cnkJEp9bna8U6yi9aVW9cAJ0Q flushImpl;
};
struct  FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw  {
  StreamObj_RShkcoDOPnoCVhtpN1hDPQ Sup;
FILE* f;
};
struct TY_l0xXJxOLtcuhlSBHl64t5w {
  TGenericSeq Sup;
  ProcessObj_NHqciQYh8G1aN2n273mmYw* data[SEQ_DECL_SIZE];
};
struct TY_sM4lkSb7zS6F7OVMvW9cffQ {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct TY_4eQHGndY6XBYpFOH09apV8Q {
  TGenericSeq Sup;
  TY_UV3llMMYFckfui8YMBuUZA data[SEQ_DECL_SIZE];
};
N_LIB_EXPORT N_CDECL(NimStringDesc*, nospquoteShellWindows)(NimStringDesc* s);
N_NIMCALL(NIM_BOOL, contains_m1TSS3QwQPclQATuiRuVZg)(NimStringDesc* s, TY_nmiMWKVIe46vacnhAFrQvw_Set chars);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nimrtl_copyString)(NimStringDesc* src);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
static N_INLINE(void, copyMem_fPlwH3r9agN9aEHB6yCPMh0wsystem)(void* dest, void* source, NI size);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nimrtl_resizeString)(NimStringDesc* dest, NI addlen);
N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s, NIM_CHAR c);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nimrtl_setLengthStr)(NimStringDesc* s, NI newLen);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nospquoteShellPosix)(NimStringDesc* s);
N_NIMCALL(NIM_BOOL, allCharsInSet_wVfr4F6j4mVzI8ggLoMVdw)(NimStringDesc* s, TY_nmiMWKVIe46vacnhAFrQvw_Set theSet);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuReplaceStr)(NimStringDesc* s, NimStringDesc* sub, NimStringDesc* by);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nospquoteShell)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NI, nospprocessID)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p);
N_LIB_EXPORT N_CDECL(int, nospinputHandle)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p);
N_LIB_EXPORT N_CDECL(int, nospoutputHandle)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p);
N_LIB_EXPORT N_CDECL(int, nosperrorHandle)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p);
N_LIB_EXPORT N_CDECL(NI, nospcountProcessors)(void);
N_LIB_EXPORT N_CDECL(NI, ncpicountProcessors)(void);
N_LIB_EXPORT N_CDECL(NI, nospexecProcesses)(NimStringDesc** cmds, NI cmdsLen_0, ProcessOption_bnU6W8LhTMnT4JaSWtGlSA_Set options, NI n, TY_kElEuvYkhDcTHhB3d89aMYA beforeRunEvent, TY_SfW5itioRNR8yop8fOJeNg afterRunEvent);
N_LIB_EXPORT N_CDECL(void, nimrtl_nimGCvisit)(void* d, NI op);
static N_NIMCALL(void, Marker_TY_Ryg5db24dBRIzTUa2BQTPg)(void* p, NI op);
static N_NIMCALL(void, Marker_TY_l0xXJxOLtcuhlSBHl64t5w)(void* p, NI op);
N_LIB_EXPORT N_CDECL(void*, nimrtl_newSeq)(TNimType* typ, NI len);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incRef_9cAA5YuQAAC3MVbnGeV86swsystem)(Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(Cell_1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem)(void* usr);
static N_INLINE(void, decRef_MV4BBk6J1qu70IbBxwEn4wsystem)(Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_EXPORT N_CDECL(void, nimrtl_rtlAddZCT)(Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_EXPORT N_CDECL(void, nossleep)(NI milsecs);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nospexecProcess)(NimStringDesc* command, NimStringDesc** args, NI argsLen_0, StringTableObj_DKRIdH9c9cKI7YpQb9c0wKlEw* env, ProcessOption_bnU6W8LhTMnT4JaSWtGlSA_Set options);
N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
N_NIMCALL(NIM_BOOL, readLine_y89bfL07uXzOjT5XgI50WmQ)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s, NimStringDesc** line);
N_LIB_EXPORT N_CDECL(ProcessObj_NHqciQYh8G1aN2n273mmYw*, nospstartProcess)(NimStringDesc* command, NimStringDesc* workingDir, NimStringDesc** args, NI argsLen_0, StringTableObj_DKRIdH9c9cKI7YpQb9c0wKlEw* env, ProcessOption_bnU6W8LhTMnT4JaSWtGlSA_Set options);
N_LIB_EXPORT N_CDECL(void*, nimrtl_newObj)(TNimType* typ, NI size);
N_NOINLINE(void, raiseOSError_86HIIOlD5N61CWaO5GBgqA)(NI32 errorCode, NimStringDesc* additionalInfo);
N_NIMCALL(NI32, osLastError_YyC2FKP9bqQiUDq2XVqW9acA)(void);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nimrtl_copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
N_NIMCALL(TGenericSeq*, incrSeqV2)(TGenericSeq* seq, NI elemSize);
N_NIMCALL(NCSTRING*, allocCStringArray_TG6GWpa9cdnVJVGZxJaqBJg)(NimStringDesc** a, NI aLen_0);
N_LIB_EXPORT N_CDECL(void, nimrtl_pushSafePoint)(TSafePoint* s);
N_NIMCALL(NCSTRING*, envToCStringArray_5W8jibc9b9cn0LB5f6DkUbiA)(void);
N_NIMCALL(void, getEnvVarsC_xlXgIeBHBOL9cl4MJcFJ8xA)(void);
N_LIB_EXPORT N_CDECL(NI, nsuFindChar)(NimStringDesc* s, NIM_CHAR sub, NI start, NI last);
N_NIMCALL(NimStringDesc*, copyStrLast)(NimStringDesc* s, NI start, NI last);
N_NIMCALL(NimStringDesc*, copyStrLast)(NimStringDesc* s, NI first, NI last);
N_NIMCALL(NimStringDesc*, copyStr)(NimStringDesc* s, NI start);
N_NIMCALL(NimStringDesc*, copyStr)(NimStringDesc* s, NI first);
N_LIB_EXPORT N_NOCONV(void*, nimrtl_alloc0)(NI size);
N_LIB_EXPORT N_NOCONV(void*, nimrtl_alloc)(NI size);
N_NIMCALL(NCSTRING*, envToCStringArray_powWbjMeev5megN9bWVjfTw)(StringTableObj_DKRIdH9c9cKI7YpQb9c0wKlEw* t);
N_LIB_EXPORT N_CDECL(NI, nstlen)(StringTableObj_DKRIdH9c9cKI7YpQb9c0wKlEw* t);
N_NIMCALL(pid_t, startProcessAuxFork_VwNkkMfMOAO9b1isfsqmrNQ)(StartProcessData_xgRnKnLIYRtnOkshMKhc9cA* data);
N_CDECL(void, startProcessAfterFork_kP8IoxkYQ0xKBWMKeIF3Cw)(StartProcessData_xgRnKnLIYRtnOkshMKhc9cA* data);
N_NIMCALL(void, startProcessFail_1Q2da9a7NmGuR0Ogak2NKkw)(StartProcessData_xgRnKnLIYRtnOkshMKhc9cA* data);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuFormatOpenArray)(NimStringDesc* formatstr, NimStringDesc** a, NI aLen_0);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nimrtl_cstrToNimstr)(NCSTRING str);
N_LIB_EXPORT N_CDECL(void, nimrtl_popSafePoint)(void);
N_LIB_EXPORT N_CDECL(void, nimrtl_reraiseException)(void);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuJoinSep)(NimStringDesc** a, NI aLen_0, NimStringDesc* sep);
N_NIMCALL(void, deallocCStringArray_PrKbmufafP6J0HO6K4x3tQ)(NCSTRING* a);
N_LIB_EXPORT N_CDECL(void, nospclose)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p);
N_NIMCALL(void, close_4ed7IXme7lqtClFI7s2sTQ)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ* s);
N_LIB_EXPORT N_CDECL(void, nospsuspend)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p);
N_LIB_EXPORT N_CDECL(void, nospresume)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nosprunning)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p);
N_NIMCALL(NIM_BOOL, isExitStatus_LfdXbSxcFCX8jeiWMQhmLg)(int status);
N_LIB_EXPORT N_CDECL(void, nospterminate)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p);
N_LIB_EXPORT N_CDECL(void, nospkill)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p);
N_LIB_EXPORT N_CDECL(NI, nospwaitForExit)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p, NI timeout);
N_NIMCALL(int, exitStatus_UXYeVHPMK6MYSBxiXhkNfQ)(int status);
N_LIB_EXPORT N_CDECL(NI64, ntDiffTime)(time_t a, time_t b);
N_LIB_EXPORT N_CDECL(NIM_BOOL, ntEqTime)(time_t a, time_t b);
N_LIB_EXPORT N_CDECL(void, nimrtl_raiseException)(Exception* e, NCSTRING ename);
N_LIB_EXPORT N_CDECL(StreamObj_RShkcoDOPnoCVhtpN1hDPQ*, nospinputStream)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p);
N_NIMCALL(void, createStream_v8G6hIKoW7oNggVYf9a9c7dQ)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ** stream, int* handle, FileMode_fVUBHvW79bXUw1j55Oo9avSQ fileMode);
N_NIMCALL(NIM_BOOL, open_GRr4dBTChSldEteMxZDsuw)(FILE** f, int filehandle, FileMode_fVUBHvW79bXUw1j55Oo9avSQ mode);
N_NIMCALL(FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw*, newFileStream_j9aOzR9a9bXMSUnTXiGmXXGqQ)(FILE* f);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_LIB_EXPORT N_CDECL(StreamObj_RShkcoDOPnoCVhtpN1hDPQ*, nospoutputStream)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p);
N_LIB_EXPORT N_CDECL(StreamObj_RShkcoDOPnoCVhtpN1hDPQ*, nosperrorStream)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p);
N_LIB_EXPORT N_CDECL(NI, nospexecCmd)(NimStringDesc* command);
extern TNimType NTI_13RNkKqUOX1TtorOUlKtqA_;
TNimType NTI_NHqciQYh8G1aN2n273mmYw_;
extern TNimType NTI_UtShRB9b1wZO9cvpdowm9cefA_;
extern TNimType NTI_r3Wc5tOoxP8rz1DvGVTUvw_;
extern TNimType NTI_CHeEDdL3roTPu81s9cOH0Bw_;
extern TNimType NTI_nlCscttRCss70IBTyuBqnA_;
TNimType NTI_bnU6W8LhTMnT4JaSWtGlSA_;
TNimType NTI_HlmBYNr2gdAZMXOsuiSZ0A_;
TNimType NTI_Ryg5db24dBRIzTUa2BQTPg_;
TNimType NTI_l0xXJxOLtcuhlSBHl64t5w_;
extern TNimType NTI_sM4lkSb7zS6F7OVMvW9cffQ_;
extern TY_sM4lkSb7zS6F7OVMvW9cffQ* environment_mlhK49b6YMgc9cgrcYkKq9a3g;
extern TNimType NTI_yCEN9anxCD6mzBxGjuaRBdg_;
extern TNimType NTI_Gi06FkNeykJn7mrqRZYrkA_;
static NIM_CONST TY_nmiMWKVIe46vacnhAFrQvw_Set TM_HZdw8BhppcTQo8DIK46LSg_2 = {
0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
;
STRING_LITERAL(TM_HZdw8BhppcTQo8DIK46LSg_3, "", 0);
STRING_LITERAL(TM_HZdw8BhppcTQo8DIK46LSg_4, "\"", 1);
STRING_LITERAL(TM_HZdw8BhppcTQo8DIK46LSg_5, "\\\"", 2);
STRING_LITERAL(TM_HZdw8BhppcTQo8DIK46LSg_6, "\'\'", 2);
static NIM_CONST TY_nmiMWKVIe46vacnhAFrQvw_Set TM_HZdw8BhppcTQo8DIK46LSg_7 = {
0x00, 0x00, 0x00, 0x00, 0x20, 0xE8, 0xFF, 0x27,
0xFF, 0xFF, 0xFF, 0x87, 0xFE, 0xFF, 0xFF, 0x07,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
;
STRING_LITERAL(TM_HZdw8BhppcTQo8DIK46LSg_8, "\'", 1);
STRING_LITERAL(TM_HZdw8BhppcTQo8DIK46LSg_9, "\'\"\'\"\'", 5);
static NIM_CONST TY_kElEuvYkhDcTHhB3d89aMYA TM_HZdw8BhppcTQo8DIK46LSg_14 = {NIM_NIL,NIM_NIL};
static NIM_CONST TY_SfW5itioRNR8yop8fOJeNg TM_HZdw8BhppcTQo8DIK46LSg_16 = {NIM_NIL,NIM_NIL};
STRING_LITERAL(TM_HZdw8BhppcTQo8DIK46LSg_22, "", 0);
STRING_LITERAL(TM_HZdw8BhppcTQo8DIK46LSg_23, "\012", 1);
STRING_LITERAL(TM_HZdw8BhppcTQo8DIK46LSg_24, "/bin/sh", 7);
STRING_LITERAL(TM_HZdw8BhppcTQo8DIK46LSg_25, "-c", 2);
STRING_LITERAL(TM_HZdw8BhppcTQo8DIK46LSg_27, "=", 1);
STRING_LITERAL(TM_HZdw8BhppcTQo8DIK46LSg_30, "Could not find command: \'$1\'. OS error: $2", 42);
STRING_LITERAL(TM_HZdw8BhppcTQo8DIK46LSg_31, " ", 1);
STRING_LITERAL(TM_HZdw8BhppcTQo8DIK46LSg_33, "System time was modified", 24);

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

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

N_LIB_EXPORT N_CDECL(NimStringDesc*, nospquoteShellWindows)(NimStringDesc* s) {
	NimStringDesc* result;
	NIM_BOOL needQuote;
	NIM_BOOL T1_;
	NimStringDesc* backslashBuff;
	result = (NimStringDesc*)0;
	T1_ = (NIM_BOOL)0;
	T1_ = contains_m1TSS3QwQPclQATuiRuVZg(s, TM_HZdw8BhppcTQo8DIK46LSg_2);
	if (T1_) goto LA2_;
	T1_ = ((s ? s->Sup.len : 0) == ((NI) 0));
	LA2_: ;
	needQuote = T1_;
	result = nimrtl_copyString(((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3));
	backslashBuff = nimrtl_copyString(((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3));
	{
		if (!needQuote) goto LA5_;
		result = nimrtl_resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_4));
	}
	LA5_: ;
	{
		NIM_CHAR c;
		NI i;
		NI L;
		c = (NIM_CHAR)0;
		i = ((NI) 0);
		L = (s ? s->Sup.len : 0);
		{
			while (1) {
				if (!(i < L)) goto LA9;
				c = s->data[i];
				{
					if (!((NU8)(c) == (NU8)(92))) goto LA12_;
					backslashBuff = addChar(backslashBuff, c);
				}
				goto LA10_;
				LA12_: ;
				{
					if (!((NU8)(c) == (NU8)(34))) goto LA15_;
					result = nimrtl_resizeString(result, backslashBuff->Sup.len + 0);
appendString(result, backslashBuff);
					result = nimrtl_resizeString(result, backslashBuff->Sup.len + 0);
appendString(result, backslashBuff);
					backslashBuff = nimrtl_setLengthStr(backslashBuff, ((NI) 0));
					result = nimrtl_resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_5));
				}
				goto LA10_;
				LA15_: ;
				{
					{
						if (!!(((backslashBuff ? backslashBuff->Sup.len : 0) == ((NI) 0)))) goto LA20_;
						result = nimrtl_resizeString(result, backslashBuff->Sup.len + 0);
appendString(result, backslashBuff);
						backslashBuff = nimrtl_setLengthStr(backslashBuff, ((NI) 0));
					}
					LA20_: ;
					result = addChar(result, c);
				}
				LA10_: ;
				i += ((NI) 1);
			} LA9: ;
		}
	}
	{
		if (!needQuote) goto LA24_;
		result = nimrtl_resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_4));
	}
	LA24_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nospquoteShellPosix)(NimStringDesc* s) {
	NimStringDesc* result;
	NIM_BOOL safe;
{	result = (NimStringDesc*)0;
	{
		if (!((s ? s->Sup.len : 0) == ((NI) 0))) goto LA3_;
		result = nimrtl_copyString(((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_6));
		goto BeforeRet_;
	}
	LA3_: ;
	safe = allCharsInSet_wVfr4F6j4mVzI8ggLoMVdw(s, TM_HZdw8BhppcTQo8DIK46LSg_7);
	{
		if (!safe) goto LA7_;
		result = nimrtl_copyString(s);
		goto BeforeRet_;
	}
	goto LA5_;
	LA7_: ;
	{
		NimStringDesc* T10_;
		NimStringDesc* T11_;
		T10_ = (NimStringDesc*)0;
		T11_ = (NimStringDesc*)0;
		T11_ = nsuReplaceStr(s, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_8), ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_9));
		T10_ = rawNewString(T11_->Sup.len + 2);
appendString(T10_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_8));
appendString(T10_, T11_);
appendString(T10_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_8));
		result = T10_;
		goto BeforeRet_;
	}
	LA5_: ;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nospquoteShell)(NimStringDesc* s) {
	NimStringDesc* result;
{	result = (NimStringDesc*)0;
	result = nospquoteShellPosix(s);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NI, nospprocessID)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p) {
	NI result;
{	result = (NI)0;
	result = (*p).id;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(int, nospinputHandle)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p) {
	int result;
	result = (int)0;
	result = (*p).inHandle;
	return result;
}

N_LIB_EXPORT N_CDECL(int, nospoutputHandle)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p) {
	int result;
	result = (int)0;
	result = (*p).outHandle;
	return result;
}

N_LIB_EXPORT N_CDECL(int, nosperrorHandle)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p) {
	int result;
	result = (int)0;
	result = (*p).errHandle;
	return result;
}

N_LIB_EXPORT N_CDECL(NI, nospcountProcessors)(void) {
	NI result;
	result = (NI)0;
	result = ncpicountProcessors();
	return result;
}
static N_NIMCALL(void, Marker_TY_Ryg5db24dBRIzTUa2BQTPg)(void* p, NI op) {
	ProcessObj_NHqciQYh8G1aN2n273mmYw* a;
	a = (ProcessObj_NHqciQYh8G1aN2n273mmYw*)p;
	nimrtl_nimGCvisit((void*)(*a).inStream, op);
	nimrtl_nimGCvisit((void*)(*a).outStream, op);
	nimrtl_nimGCvisit((void*)(*a).errStream, op);
}
static N_NIMCALL(void, Marker_TY_l0xXJxOLtcuhlSBHl64t5w)(void* p, NI op) {
	TY_l0xXJxOLtcuhlSBHl64t5w* a;
	NI T1_;
	a = (TY_l0xXJxOLtcuhlSBHl64t5w*)p;
	T1_ = (NI)0;
	for (T1_ = 0; T1_ < a->Sup.len; T1_++) {
	nimrtl_nimGCvisit((void*)a->data[T1_], op);
	}
}

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

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

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

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

N_LIB_EXPORT N_CDECL(NI, nospexecProcesses)(NimStringDesc** cmds, NI cmdsLen_0, ProcessOption_bnU6W8LhTMnT4JaSWtGlSA_Set options, NI n, TY_kElEuvYkhDcTHhB3d89aMYA beforeRunEvent, TY_SfW5itioRNR8yop8fOJeNg afterRunEvent) {
	NI result;
	ProcessOption_bnU6W8LhTMnT4JaSWtGlSA_Set options_2;
	result = (NI)0;
	options_2 = (options & ~ 16);
	{
		TY_l0xXJxOLtcuhlSBHl64t5w* q;
		NI m;
		NI i_2;
		if (!(((NI) 1) < n)) goto LA3_;
		q = (TY_l0xXJxOLtcuhlSBHl64t5w*)0;
		q = (TY_l0xXJxOLtcuhlSBHl64t5w*) nimrtl_newSeq((&NTI_l0xXJxOLtcuhlSBHl64t5w_), ((NI) (n)));
		m = ((n <= cmdsLen_0) ? n : cmdsLen_0);
		{
			NI i;
			NI colontmp_;
			NI res;
			i = (NI)0;
			colontmp_ = (NI)0;
			colontmp_ = (NI)(m - ((NI) 1));
			res = ((NI) 0);
			{
				while (1) {
					TY_8ZvwQIddfpj2THRVPsFzIQ T12_;
					if (!(res <= colontmp_)) goto LA7;
					i = res;
					{
						if (!!((beforeRunEvent.ClP_0 == TM_HZdw8BhppcTQo8DIK46LSg_14.ClP_0 && beforeRunEvent.ClE_0 == TM_HZdw8BhppcTQo8DIK46LSg_14.ClE_0))) goto LA10_;
						beforeRunEvent.ClE_0? beforeRunEvent.ClP_0(i, beforeRunEvent.ClE_0):((TM_HZdw8BhppcTQo8DIK46LSg_15)(beforeRunEvent.ClP_0))(i);
					}
					LA10_: ;
					memset((void*)T12_, 0, sizeof(T12_));
					asgnRef((void**) (&q->data[i]), nospstartProcess(cmds[i], ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3), T12_, 0, NIM_NIL, (options_2 | 4)));
					res += ((NI) 1);
				} LA7: ;
			}
		}
		i_2 = m;
		{
			while (1) {
				if (!(i_2 <= (cmdsLen_0-1))) goto LA14;
				nossleep(((NI) 50));
				{
					NI r;
					NI colontmp__2;
					NI res_2;
					r = (NI)0;
					colontmp__2 = (NI)0;
					colontmp__2 = (NI)(n - ((NI) 1));
					res_2 = ((NI) 0);
					{
						while (1) {
							if (!(res_2 <= colontmp__2)) goto LA17;
							r = res_2;
							{
								NIM_BOOL T20_;
								NI T23_;
								TY_8ZvwQIddfpj2THRVPsFzIQ T36_;
								T20_ = (NIM_BOOL)0;
								T20_ = nosprunning(q->data[r]);
								if (!!(T20_)) goto LA21_;
								T23_ = (NI)0;
								T23_ = nospwaitForExit(q->data[r], ((NI) -1));
								result = ((T23_ >= result) ? T23_ : result);
								{
									if (!!((afterRunEvent.ClP_0 == TM_HZdw8BhppcTQo8DIK46LSg_16.ClP_0 && afterRunEvent.ClE_0 == TM_HZdw8BhppcTQo8DIK46LSg_16.ClE_0))) goto LA26_;
									afterRunEvent.ClE_0? afterRunEvent.ClP_0(r, q->data[r], afterRunEvent.ClE_0):((TM_HZdw8BhppcTQo8DIK46LSg_17)(afterRunEvent.ClP_0))(r, q->data[r]);
								}
								LA26_: ;
								{
									if (!!((q->data[r] == NIM_NIL))) goto LA30_;
									nospclose(q->data[r]);
								}
								LA30_: ;
								{
									if (!!((beforeRunEvent.ClP_0 == TM_HZdw8BhppcTQo8DIK46LSg_14.ClP_0 && beforeRunEvent.ClE_0 == TM_HZdw8BhppcTQo8DIK46LSg_14.ClE_0))) goto LA34_;
									beforeRunEvent.ClE_0? beforeRunEvent.ClP_0(i_2, beforeRunEvent.ClE_0):((TM_HZdw8BhppcTQo8DIK46LSg_18)(beforeRunEvent.ClP_0))(i_2);
								}
								LA34_: ;
								memset((void*)T36_, 0, sizeof(T36_));
								asgnRef((void**) (&q->data[r]), nospstartProcess(cmds[i_2], ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3), T36_, 0, NIM_NIL, (options_2 | 4)));
								i_2 += ((NI) 1);
								{
									if (!((cmdsLen_0-1) < i_2)) goto LA39_;
									goto LA15;
								}
								LA39_: ;
							}
							LA21_: ;
							res_2 += ((NI) 1);
						} LA17: ;
					}
				} LA15: ;
			} LA14: ;
		}
		{
			NI j;
			NI colontmp__3;
			NI res_3;
			j = (NI)0;
			colontmp__3 = (NI)0;
			colontmp__3 = (NI)(m - ((NI) 1));
			res_3 = ((NI) 0);
			{
				while (1) {
					NI T44_;
					if (!(res_3 <= colontmp__3)) goto LA43;
					j = res_3;
					T44_ = (NI)0;
					T44_ = nospwaitForExit(q->data[j], ((NI) -1));
					result = ((T44_ >= result) ? T44_ : result);
					{
						if (!!((afterRunEvent.ClP_0 == TM_HZdw8BhppcTQo8DIK46LSg_16.ClP_0 && afterRunEvent.ClE_0 == TM_HZdw8BhppcTQo8DIK46LSg_16.ClE_0))) goto LA47_;
						afterRunEvent.ClE_0? afterRunEvent.ClP_0(j, q->data[j], afterRunEvent.ClE_0):((TM_HZdw8BhppcTQo8DIK46LSg_19)(afterRunEvent.ClP_0))(j, q->data[j]);
					}
					LA47_: ;
					{
						if (!!((q->data[j] == NIM_NIL))) goto LA51_;
						nospclose(q->data[j]);
					}
					LA51_: ;
					res_3 += ((NI) 1);
				} LA43: ;
			}
		}
	}
	goto LA1_;
	LA3_: ;
	{
		{
			NI i_3;
			NI colontmp__4;
			NI res_4;
			i_3 = (NI)0;
			colontmp__4 = (NI)0;
			colontmp__4 = (cmdsLen_0-1);
			res_4 = ((NI) 0);
			{
				while (1) {
					ProcessObj_NHqciQYh8G1aN2n273mmYw* p;
					TY_8ZvwQIddfpj2THRVPsFzIQ T61_;
					NI T62_;
					if (!(res_4 <= colontmp__4)) goto LA56;
					i_3 = res_4;
					{
						if (!!((beforeRunEvent.ClP_0 == TM_HZdw8BhppcTQo8DIK46LSg_14.ClP_0 && beforeRunEvent.ClE_0 == TM_HZdw8BhppcTQo8DIK46LSg_14.ClE_0))) goto LA59_;
						beforeRunEvent.ClE_0? beforeRunEvent.ClP_0(i_3, beforeRunEvent.ClE_0):((TM_HZdw8BhppcTQo8DIK46LSg_20)(beforeRunEvent.ClP_0))(i_3);
					}
					LA59_: ;
					memset((void*)T61_, 0, sizeof(T61_));
					p = nospstartProcess(cmds[i_3], ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3), T61_, 0, NIM_NIL, (options_2 | 4));
					T62_ = (NI)0;
					T62_ = nospwaitForExit(p, ((NI) -1));
					result = ((T62_ >= result) ? T62_ : result);
					{
						if (!!((afterRunEvent.ClP_0 == TM_HZdw8BhppcTQo8DIK46LSg_16.ClP_0 && afterRunEvent.ClE_0 == TM_HZdw8BhppcTQo8DIK46LSg_16.ClE_0))) goto LA65_;
						afterRunEvent.ClE_0? afterRunEvent.ClP_0(i_3, p, afterRunEvent.ClE_0):((TM_HZdw8BhppcTQo8DIK46LSg_21)(afterRunEvent.ClP_0))(i_3, p);
					}
					LA65_: ;
					nospclose(p);
					res_4 += ((NI) 1);
				} LA56: ;
			}
		}
	}
	LA1_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nospexecProcess)(NimStringDesc* command, NimStringDesc** args, NI argsLen_0, StringTableObj_DKRIdH9c9cKI7YpQb9c0wKlEw* env, ProcessOption_bnU6W8LhTMnT4JaSWtGlSA_Set options) {
	NimStringDesc* result;
	ProcessObj_NHqciQYh8G1aN2n273mmYw* p;
	StreamObj_RShkcoDOPnoCVhtpN1hDPQ* outp;
	NimStringDesc* line;
	result = (NimStringDesc*)0;
	p = nospstartProcess(command, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3), args, argsLen_0, env, options);
	outp = nospoutputStream(p);
	result = nimrtl_copyString(((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_22));
	line = rawNewString(((NI) 120));
	{
		while (1) {
			{
				NIM_BOOL T5_;
				T5_ = (NIM_BOOL)0;
				T5_ = readLine_y89bfL07uXzOjT5XgI50WmQ(outp, (&line));
				if (!T5_) goto LA6_;
				result = nimrtl_resizeString(result, line->Sup.len + 0);
appendString(result, line);
				result = nimrtl_resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_23));
			}
			goto LA3_;
			LA6_: ;
			{
				NIM_BOOL T9_;
				T9_ = (NIM_BOOL)0;
				T9_ = nosprunning(p);
				if (!!(T9_)) goto LA10_;
				goto LA1;
			}
			goto LA3_;
			LA10_: ;
			LA3_: ;
		}
	} LA1: ;
	nospclose(p);
	return result;
}

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

N_NIMCALL(NCSTRING*, envToCStringArray_5W8jibc9b9cn0LB5f6DkUbiA)(void) {
	NCSTRING* result;
	NI counter;
	void* T5_;
	NI i_2;
	result = (NCSTRING*)0;
	counter = ((NI) 0);
	{
		NimStringDesc* key;
		NimStringDesc* val;
		key = (NimStringDesc*)0;
		val = (NimStringDesc*)0;
		getEnvVarsC_xlXgIeBHBOL9cl4MJcFJ8xA();
		{
			NI i;
			NI colontmp_;
			NI res;
			i = (NI)0;
			colontmp_ = (NI)0;
			colontmp_ = (environment_mlhK49b6YMgc9cgrcYkKq9a3g ? (environment_mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len-1) : -1);
			res = ((NI) 0);
			{
				while (1) {
					NI p;
					if (!(res <= colontmp_)) goto LA4;
					i = res;
					p = nsuFindChar(environment_mlhK49b6YMgc9cgrcYkKq9a3g->data[i], 61, ((NI) 0), ((NI) 0));
					key = copyStrLast(environment_mlhK49b6YMgc9cgrcYkKq9a3g->data[i], ((NI) 0), (NI)(p - ((NI) 1)));
					val = copyStr(environment_mlhK49b6YMgc9cgrcYkKq9a3g->data[i], (NI)(p + ((NI) 1)));
					counter += ((NI) 1);
					res += ((NI) 1);
				} LA4: ;
			}
		}
	}
	T5_ = (void*)0;
	T5_ = nimrtl_alloc0(((NI) ((NI)((NI)(counter + ((NI) 1)) * ((NI) 4)))));
	result = ((NCSTRING*) (T5_));
	i_2 = ((NI) 0);
	{
		NimStringDesc* key_2;
		NimStringDesc* val_2;
		key_2 = (NimStringDesc*)0;
		val_2 = (NimStringDesc*)0;
		getEnvVarsC_xlXgIeBHBOL9cl4MJcFJ8xA();
		{
			NI i_3;
			NI colontmp__2;
			NI res_2;
			i_3 = (NI)0;
			colontmp__2 = (NI)0;
			colontmp__2 = (environment_mlhK49b6YMgc9cgrcYkKq9a3g ? (environment_mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len-1) : -1);
			res_2 = ((NI) 0);
			{
				while (1) {
					NI p_2;
					NimStringDesc* x;
					NimStringDesc* T10_;
					void* T11_;
					if (!(res_2 <= colontmp__2)) goto LA9;
					i_3 = res_2;
					p_2 = nsuFindChar(environment_mlhK49b6YMgc9cgrcYkKq9a3g->data[i_3], 61, ((NI) 0), ((NI) 0));
					key_2 = copyStrLast(environment_mlhK49b6YMgc9cgrcYkKq9a3g->data[i_3], ((NI) 0), (NI)(p_2 - ((NI) 1)));
					val_2 = copyStr(environment_mlhK49b6YMgc9cgrcYkKq9a3g->data[i_3], (NI)(p_2 + ((NI) 1)));
					T10_ = (NimStringDesc*)0;
					T10_ = rawNewString(key_2->Sup.len + val_2->Sup.len + 1);
appendString(T10_, key_2);
appendString(T10_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_27));
appendString(T10_, val_2);
					x = T10_;
					T11_ = (void*)0;
					T11_ = nimrtl_alloc(((NI) ((NI)((x ? x->Sup.len : 0) + ((NI) 1)))));
					result[(i_2)- 0] = ((NCSTRING) (T11_));
					copyMem_fPlwH3r9agN9aEHB6yCPMh0wsystem(((void*) (result[(i_2)- 0])), ((void*) ((&x->data[((NI) 0)]))), ((NI) ((NI)((x ? x->Sup.len : 0) + ((NI) 1)))));
					i_2 += ((NI) 1);
					res_2 += ((NI) 1);
				} LA9: ;
			}
		}
	}
	return result;
}

N_NIMCALL(NCSTRING*, envToCStringArray_powWbjMeev5megN9bWVjfTw)(StringTableObj_DKRIdH9c9cKI7YpQb9c0wKlEw* t) {
	NCSTRING* result;
	NI T1_;
	void* T2_;
	NI i;
	result = (NCSTRING*)0;
	T1_ = (NI)0;
	T1_ = nstlen(t);
	T2_ = (void*)0;
	T2_ = nimrtl_alloc0(((NI) ((NI)((NI)(T1_ + ((NI) 1)) * ((NI) 4)))));
	result = ((NCSTRING*) (T2_));
	i = ((NI) 0);
	{
		NimStringDesc* key;
		NimStringDesc* val;
		key = (NimStringDesc*)0;
		val = (NimStringDesc*)0;
		{
			NI h;
			NI colontmp_;
			NI res;
			h = (NI)0;
			colontmp_ = (NI)0;
			colontmp_ = ((*t).data ? ((*t).data->Sup.len-1) : -1);
			res = ((NI) 0);
			{
				while (1) {
					if (!(res <= colontmp_)) goto LA6;
					h = res;
					{
						NimStringDesc* x;
						NimStringDesc* T11_;
						void* T12_;
						if (!!(((*t).data->data[h].Field0 == 0))) goto LA9_;
						key = (*t).data->data[h].Field0;
						val = (*t).data->data[h].Field1;
						T11_ = (NimStringDesc*)0;
						T11_ = rawNewString(key->Sup.len + val->Sup.len + 1);
appendString(T11_, key);
appendString(T11_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_27));
appendString(T11_, val);
						x = T11_;
						T12_ = (void*)0;
						T12_ = nimrtl_alloc(((NI) ((NI)((x ? x->Sup.len : 0) + ((NI) 1)))));
						result[(i)- 0] = ((NCSTRING) (T12_));
						copyMem_fPlwH3r9agN9aEHB6yCPMh0wsystem(((void*) (result[(i)- 0])), ((void*) ((&x->data[((NI) 0)]))), ((NI) ((NI)((x ? x->Sup.len : 0) + ((NI) 1)))));
						i += ((NI) 1);
					}
					LA9_: ;
					res += ((NI) 1);
				} LA6: ;
			}
		}
	}
	return result;
}

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

N_CDECL(void, startProcessAfterFork_kP8IoxkYQ0xKBWMKeIF3Cw)(StartProcessData_xgRnKnLIYRtnOkshMKhc9cA* data) {
	int T42_;
	int T43_;
	{
		int T5_;
		int T11_;
		int T17_;
		if (!!((*data).optionPoParentStreams)) goto LA3_;
		T5_ = (int)0;
		T5_ = close((*data).pStdin[(((NI) 1))- 0]);
		{
			int T8_;
			T8_ = (int)0;
			T8_ = dup2((*data).pStdin[(((NI) 0))- 0], ((int) 0));
			if (!(T8_ < ((NI32) 0))) goto LA9_;
			startProcessFail_1Q2da9a7NmGuR0Ogak2NKkw(data);
		}
		LA9_: ;
		T11_ = (int)0;
		T11_ = close((*data).pStdout[(((NI) 0))- 0]);
		{
			int T14_;
			T14_ = (int)0;
			T14_ = dup2((*data).pStdout[(((NI) 1))- 0], ((int) 1));
			if (!(T14_ < ((NI32) 0))) goto LA15_;
			startProcessFail_1Q2da9a7NmGuR0Ogak2NKkw(data);
		}
		LA15_: ;
		T17_ = (int)0;
		T17_ = close((*data).pStderr[(((NI) 0))- 0]);
		{
			if (!(*data).optionPoStdErrToStdOut) goto LA20_;
			{
				int T24_;
				T24_ = (int)0;
				T24_ = dup2((*data).pStdout[(((NI) 1))- 0], ((int) 2));
				if (!(T24_ < ((NI32) 0))) goto LA25_;
				startProcessFail_1Q2da9a7NmGuR0Ogak2NKkw(data);
			}
			LA25_: ;
		}
		goto LA18_;
		LA20_: ;
		{
			{
				int T30_;
				T30_ = (int)0;
				T30_ = dup2((*data).pStderr[(((NI) 1))- 0], ((int) 2));
				if (!(T30_ < ((NI32) 0))) goto LA31_;
				startProcessFail_1Q2da9a7NmGuR0Ogak2NKkw(data);
			}
			LA31_: ;
		}
		LA18_: ;
	}
	LA3_: ;
	{
		if (!(((NI) 0) < ((*data).workingDir ? strlen((*data).workingDir) : 0))) goto LA35_;
		{
			int T39_;
			T39_ = (int)0;
			T39_ = chdir((*data).workingDir);
			if (!(T39_ < ((NI32) 0))) goto LA40_;
			startProcessFail_1Q2da9a7NmGuR0Ogak2NKkw(data);
		}
		LA40_: ;
	}
	LA35_: ;
	T42_ = (int)0;
	T42_ = close((*data).pErrorPipe[(((NI) 0))- 0]);
	T43_ = (int)0;
	T43_ = fcntl((*data).pErrorPipe[(((NI) 1))- 0], F_SETFD, FD_CLOEXEC);
	{
		int T48_;
		if (!(*data).optionPoUsePath) goto LA46_;
		T48_ = (int)0;
		T48_ = execvpe((*data).sysCommand, (*data).sysArgs, (*data).sysEnv);
	}
	goto LA44_;
	LA46_: ;
	{
		int T50_;
		T50_ = (int)0;
		T50_ = execve((*data).sysCommand, (*data).sysArgs, (*data).sysEnv);
	}
	LA44_: ;
	startProcessFail_1Q2da9a7NmGuR0Ogak2NKkw(data);
}

N_NIMCALL(pid_t, startProcessAuxFork_VwNkkMfMOAO9b1isfsqmrNQ)(StartProcessData_xgRnKnLIYRtnOkshMKhc9cA* data) {
	pid_t volatile result;
	TSafePoint TM_HZdw8BhppcTQo8DIK46LSg_29;
{	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_YyC2FKP9bqQiUDq2XVqW9acA();
		raiseOSError_86HIIOlD5N61CWaO5GBgqA(T6_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3));
	}
	LA4_: ;
	nimrtl_pushSafePoint(&TM_HZdw8BhppcTQo8DIK46LSg_29);
	TM_HZdw8BhppcTQo8DIK46LSg_29.status = setjmp(TM_HZdw8BhppcTQo8DIK46LSg_29.context);
	if (TM_HZdw8BhppcTQo8DIK46LSg_29.status == 0) {
		pid_t volatile pid;
		StartProcessData_xgRnKnLIYRtnOkshMKhc9cA dataCopy;
		int T12_;
		int error;
		NI sizeRead;
		int T26_;
		pid = (pid_t)0;
		dataCopy = (*data);
		pid = fork();
		{
			if (!(pid == ((NI) 0))) goto LA10_;
			startProcessAfterFork_kP8IoxkYQ0xKBWMKeIF3Cw((&dataCopy));
			_exit(((NI) 1));
		}
		LA10_: ;
		T12_ = (int)0;
		T12_ = close((*data).pErrorPipe[(((NI) 1))- 0]);
		{
			NI32 T17_;
			if (!(pid < ((NI) 0))) goto LA15_;
			T17_ = (NI32)0;
			T17_ = osLastError_YyC2FKP9bqQiUDq2XVqW9acA();
			raiseOSError_86HIIOlD5N61CWaO5GBgqA(T17_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3));
		}
		LA15_: ;
		error = (int)0;
		sizeRead = read((*data).pErrorPipe[(((NI) 0))- 0], ((void*) ((&error))), ((NI) 4));
		{
			NI32 T22_;
			TY_Re75IspeoxXy2oCZHwcRrA T23_;
			NCSTRING T24_;
			NimStringDesc* T25_;
			if (!(sizeRead == ((NI) 4))) goto LA20_;
			T22_ = (NI32)0;
			T22_ = osLastError_YyC2FKP9bqQiUDq2XVqW9acA();
			memset((void*)T23_, 0, sizeof(T23_));
			T23_[0] = nimrtl_cstrToNimstr((*data).sysCommand);
			T24_ = (NCSTRING)0;
			T24_ = strerror(error);
			T23_[1] = nimrtl_cstrToNimstr(T24_);
			T25_ = (NimStringDesc*)0;
			T25_ = nsuFormatOpenArray(((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_30), T23_, 2);
			raiseOSError_86HIIOlD5N61CWaO5GBgqA(T22_, T25_);
		}
		LA20_: ;
		result = pid;
		nimrtl_popSafePoint();
		T26_ = (int)0;
		T26_ = close((*data).pErrorPipe[(((NI) 0))- 0]);
		goto BeforeRet_;
		nimrtl_popSafePoint();
	}
	else {
		nimrtl_popSafePoint();
	}
	{
		int T29_;
		T29_ = (int)0;
		T29_ = close((*data).pErrorPipe[(((NI) 0))- 0]);
	}
	if (TM_HZdw8BhppcTQo8DIK46LSg_29.status != 0) nimrtl_reraiseException();
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(ProcessObj_NHqciQYh8G1aN2n273mmYw*, nospstartProcess)(NimStringDesc* command, NimStringDesc* workingDir, NimStringDesc** args, NI argsLen_0, StringTableObj_DKRIdH9c9cKI7YpQb9c0wKlEw* env, ProcessOption_bnU6W8LhTMnT4JaSWtGlSA_Set options) {
	ProcessObj_NHqciQYh8G1aN2n273mmYw* result;
	TY_SKEqGXcReU4NvbQlH779b5Q pStdin;
	TY_SKEqGXcReU4NvbQlH779b5Q pStdout;
	TY_SKEqGXcReU4NvbQlH779b5Q pStderr;
	NimStringDesc* sysCommand;
	TY_sM4lkSb7zS6F7OVMvW9cffQ* sysArgsRaw;
	pid_t volatile pid;
	NCSTRING* sysArgs;
	TSafePoint TM_HZdw8BhppcTQo8DIK46LSg_26;
	result = (ProcessObj_NHqciQYh8G1aN2n273mmYw*)0;
	memset((void*)pStdin, 0, sizeof(pStdin));
	memset((void*)pStdout, 0, sizeof(pStdout));
	memset((void*)pStderr, 0, sizeof(pStderr));
	result = (ProcessObj_NHqciQYh8G1aN2n273mmYw*) nimrtl_newObj((&NTI_Ryg5db24dBRIzTUa2BQTPg_), sizeof(ProcessObj_NHqciQYh8G1aN2n273mmYw));
	(*result).Sup.m_type = (&NTI_NHqciQYh8G1aN2n273mmYw_);
	(*result).options = options;
	(*result).exitStatus = ((int) -3);
	{
		if (!!(((options &(1U<<((NU)(((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_YyC2FKP9bqQiUDq2XVqW9acA();
			raiseOSError_86HIIOlD5N61CWaO5GBgqA(T16_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3));
		}
		LA14_: ;
	}
	LA3_: ;
	sysCommand = (NimStringDesc*)0;
	sysArgsRaw = (TY_sM4lkSb7zS6F7OVMvW9cffQ*)0;
	{
		NimStringDesc* T21_;
		NimStringDesc* T22_;
		NimStringDesc* T23_;
		if (!((options &(1U<<((NU)(((ProcessOption_bnU6W8LhTMnT4JaSWtGlSA) 2))&7U)))!=0)) goto LA19_;
		sysCommand = nimrtl_copyString(((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_24));
		sysArgsRaw = (TY_sM4lkSb7zS6F7OVMvW9cffQ*) nimrtl_newSeq((&NTI_sM4lkSb7zS6F7OVMvW9cffQ_), 3);
		T21_ = (NimStringDesc*)0;
		T21_ = sysArgsRaw->data[0]; sysArgsRaw->data[0] = nimrtl_copyStringRC1(sysCommand);
		if (T21_) nimGCunrefNoCycle(T21_);
		T22_ = (NimStringDesc*)0;
		T22_ = sysArgsRaw->data[1]; sysArgsRaw->data[1] = nimrtl_copyStringRC1(((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_25));
		if (T22_) nimGCunrefNoCycle(T22_);
		T23_ = (NimStringDesc*)0;
		T23_ = sysArgsRaw->data[2]; sysArgsRaw->data[2] = nimrtl_copyStringRC1(command);
		if (T23_) nimGCunrefNoCycle(T23_);
	}
	goto LA17_;
	LA19_: ;
	{
		NimStringDesc* T25_;
		sysCommand = nimrtl_copyString(command);
		sysArgsRaw = (TY_sM4lkSb7zS6F7OVMvW9cffQ*) nimrtl_newSeq((&NTI_sM4lkSb7zS6F7OVMvW9cffQ_), 1);
		T25_ = (NimStringDesc*)0;
		T25_ = sysArgsRaw->data[0]; sysArgsRaw->data[0] = nimrtl_copyStringRC1(command);
		if (T25_) nimGCunrefNoCycle(T25_);
		{
			NimStringDesc* arg;
			NI i;
			arg = (NimStringDesc*)0;
			i = ((NI) 0);
			{
				while (1) {
					NimStringDesc* T29_;
					if (!(i < argsLen_0)) goto LA28;
					arg = args[i];
					sysArgsRaw = (TY_sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV2(&(sysArgsRaw)->Sup, sizeof(NimStringDesc*));
					T29_ = (NimStringDesc*)0;
					T29_ = sysArgsRaw->data[sysArgsRaw->Sup.len]; sysArgsRaw->data[sysArgsRaw->Sup.len] = nimrtl_copyStringRC1(arg);
					if (T29_) nimGCunrefNoCycle(T29_);
					++sysArgsRaw->Sup.len;
					i += ((NI) 1);
				} LA28: ;
			}
		}
	}
	LA17_: ;
	pid = (pid_t)0;
	sysArgs = allocCStringArray_TG6GWpa9cdnVJVGZxJaqBJg(sysArgsRaw->data, sysArgsRaw->Sup.len);
	nimrtl_pushSafePoint(&TM_HZdw8BhppcTQo8DIK46LSg_26);
	TM_HZdw8BhppcTQo8DIK46LSg_26.status = setjmp(TM_HZdw8BhppcTQo8DIK46LSg_26.context);
	if (TM_HZdw8BhppcTQo8DIK46LSg_26.status == 0) {
		NCSTRING* sysEnv;
		TSafePoint TM_HZdw8BhppcTQo8DIK46LSg_28;
		{
			if (!(env == NIM_NIL)) goto LA33_;
			sysEnv = envToCStringArray_5W8jibc9b9cn0LB5f6DkUbiA();
		}
		goto LA31_;
		LA33_: ;
		{
			sysEnv = envToCStringArray_powWbjMeev5megN9bWVjfTw(env);
		}
		LA31_: ;
		nimrtl_pushSafePoint(&TM_HZdw8BhppcTQo8DIK46LSg_28);
		TM_HZdw8BhppcTQo8DIK46LSg_28.status = setjmp(TM_HZdw8BhppcTQo8DIK46LSg_28.context);
		if (TM_HZdw8BhppcTQo8DIK46LSg_28.status == 0) {
			StartProcessData_xgRnKnLIYRtnOkshMKhc9cA data;
			memset((void*)(&data), 0, sizeof(data));
			data.sysCommand = sysCommand->data;
			data.sysArgs = sysArgs;
			data.sysEnv = sysEnv;
			memcpy((void*)data.pStdin, (NIM_CONST void*)pStdin, sizeof(TY_SKEqGXcReU4NvbQlH779b5Q));
			memcpy((void*)data.pStdout, (NIM_CONST void*)pStdout, sizeof(TY_SKEqGXcReU4NvbQlH779b5Q));
			memcpy((void*)data.pStderr, (NIM_CONST void*)pStderr, sizeof(TY_SKEqGXcReU4NvbQlH779b5Q));
			data.optionPoParentStreams = ((options &(1U<<((NU)(((ProcessOption_bnU6W8LhTMnT4JaSWtGlSA) 4))&7U)))!=0);
			data.optionPoUsePath = ((options &(1U<<((NU)(((ProcessOption_bnU6W8LhTMnT4JaSWtGlSA) 1))&7U)))!=0);
			data.optionPoStdErrToStdOut = ((options &(1U<<((NU)(((ProcessOption_bnU6W8LhTMnT4JaSWtGlSA) 3))&7U)))!=0);
			data.workingDir = workingDir->data;
			pid = startProcessAuxFork_VwNkkMfMOAO9b1isfsqmrNQ((&data));
			{
				NimStringDesc* T41_;
				if (!((options &(1U<<((NU)(((ProcessOption_bnU6W8LhTMnT4JaSWtGlSA) 0))&7U)))!=0)) goto LA39_;
				T41_ = (NimStringDesc*)0;
				T41_ = nsuJoinSep(args, argsLen_0, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_31));
				printf("%s%s%s\012", command? (command)->data:"nil", ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_31)? (((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_31))->data:"nil", T41_? (T41_)->data:"nil");
				fflush(stdout);
			}
			LA39_: ;
			(*result).id = pid;
			{
				if (!((options &(1U<<((NU)(((ProcessOption_bnU6W8LhTMnT4JaSWtGlSA) 4))&7U)))!=0)) goto LA44_;
				(*result).inHandle = ((int) 0);
				(*result).outHandle = ((int) 1);
				{
					if (!((options &(1U<<((NU)(((ProcessOption_bnU6W8LhTMnT4JaSWtGlSA) 3))&7U)))!=0)) goto LA48_;
					(*result).errHandle = (*result).outHandle;
				}
				goto LA46_;
				LA48_: ;
				{
					(*result).errHandle = ((int) 2);
				}
				LA46_: ;
			}
			goto LA42_;
			LA44_: ;
			{
				int T58_;
				int T59_;
				int T60_;
				(*result).inHandle = pStdin[(((NI) 1))- 0];
				(*result).outHandle = pStdout[(((NI) 0))- 0];
				{
					int T56_;
					if (!((options &(1U<<((NU)(((ProcessOption_bnU6W8LhTMnT4JaSWtGlSA) 3))&7U)))!=0)) goto LA54_;
					(*result).errHandle = (*result).outHandle;
					T56_ = (int)0;
					T56_ = close(pStderr[(((NI) 0))- 0]);
				}
				goto LA52_;
				LA54_: ;
				{
					(*result).errHandle = pStderr[(((NI) 0))- 0];
				}
				LA52_: ;
				T58_ = (int)0;
				T58_ = close(pStderr[(((NI) 1))- 0]);
				T59_ = (int)0;
				T59_ = close(pStdin[(((NI) 0))- 0]);
				T60_ = (int)0;
				T60_ = close(pStdout[(((NI) 1))- 0]);
			}
			LA42_: ;
			nimrtl_popSafePoint();
		}
		else {
			nimrtl_popSafePoint();
		}
		{
			deallocCStringArray_PrKbmufafP6J0HO6K4x3tQ(sysEnv);
		}
		if (TM_HZdw8BhppcTQo8DIK46LSg_28.status != 0) nimrtl_reraiseException();
		nimrtl_popSafePoint();
	}
	else {
		nimrtl_popSafePoint();
	}
	{
		deallocCStringArray_PrKbmufafP6J0HO6K4x3tQ(sysArgs);
	}
	if (TM_HZdw8BhppcTQo8DIK46LSg_26.status != 0) nimrtl_reraiseException();
	return result;
}

N_LIB_EXPORT N_CDECL(void, nospclose)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p) {
	{
		if (!!(((*p).inStream == NIM_NIL))) goto LA3_;
		close_4ed7IXme7lqtClFI7s2sTQ((*p).inStream);
	}
	LA3_: ;
	{
		if (!!(((*p).outStream == NIM_NIL))) goto LA7_;
		close_4ed7IXme7lqtClFI7s2sTQ((*p).outStream);
	}
	LA7_: ;
	{
		if (!!(((*p).errStream == NIM_NIL))) goto LA11_;
		close_4ed7IXme7lqtClFI7s2sTQ((*p).errStream);
	}
	LA11_: ;
	{
		int T17_;
		int T18_;
		int T19_;
		if (!!((((*p).options &(1U<<((NU)(((ProcessOption_bnU6W8LhTMnT4JaSWtGlSA) 4))&7U)))!=0))) goto LA15_;
		T17_ = (int)0;
		T17_ = close((*p).inHandle);
		T18_ = (int)0;
		T18_ = close((*p).outHandle);
		T19_ = (int)0;
		T19_ = close((*p).errHandle);
	}
	LA15_: ;
}

N_LIB_EXPORT N_CDECL(void, nospsuspend)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p) {
	{
		int T3_;
		NI32 T6_;
		T3_ = (int)0;
		T3_ = kill((*p).id, SIGSTOP);
		if (!!((T3_ == ((NI32) 0)))) goto LA4_;
		T6_ = (NI32)0;
		T6_ = osLastError_YyC2FKP9bqQiUDq2XVqW9acA();
		raiseOSError_86HIIOlD5N61CWaO5GBgqA(T6_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3));
	}
	LA4_: ;
}

N_LIB_EXPORT N_CDECL(void, nospresume)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p) {
	{
		int T3_;
		NI32 T6_;
		T3_ = (int)0;
		T3_ = kill((*p).id, SIGCONT);
		if (!!((T3_ == ((NI32) 0)))) goto LA4_;
		T6_ = (NI32)0;
		T6_ = osLastError_YyC2FKP9bqQiUDq2XVqW9acA();
		raiseOSError_86HIIOlD5N61CWaO5GBgqA(T6_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3));
	}
	LA4_: ;
}

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

N_LIB_EXPORT N_CDECL(NIM_BOOL, nosprunning)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p) {
	NIM_BOOL result;
	NI ret;
	int status;
{	result = (NIM_BOOL)0;
	ret = (NI)0;
	status = ((int) 1);
	ret = waitpid((*p).id, (&status), WNOHANG);
	{
		if (!(ret == (*p).id)) goto LA3_;
		{
			NIM_BOOL T7_;
			T7_ = (NIM_BOOL)0;
			T7_ = isExitStatus_LfdXbSxcFCX8jeiWMQhmLg(status);
			if (!T7_) goto LA8_;
			(*p).exitStatus = status;
			result = NIM_FALSE;
			goto BeforeRet_;
		}
		goto LA5_;
		LA8_: ;
		{
			result = NIM_TRUE;
			goto BeforeRet_;
		}
		LA5_: ;
	}
	goto LA1_;
	LA3_: ;
	{
		if (!(ret == ((NI) 0))) goto LA12_;
		result = NIM_TRUE;
		goto BeforeRet_;
	}
	goto LA1_;
	LA12_: ;
	{
		result = NIM_FALSE;
		goto BeforeRet_;
	}
	LA1_: ;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(void, nospterminate)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p) {
	{
		int T3_;
		NI32 T6_;
		T3_ = (int)0;
		T3_ = kill((*p).id, SIGTERM);
		if (!!((T3_ == ((NI32) 0)))) goto LA4_;
		T6_ = (NI32)0;
		T6_ = osLastError_YyC2FKP9bqQiUDq2XVqW9acA();
		raiseOSError_86HIIOlD5N61CWaO5GBgqA(T6_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3));
	}
	LA4_: ;
}

N_LIB_EXPORT N_CDECL(void, nospkill)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p) {
	{
		int T3_;
		NI32 T6_;
		T3_ = (int)0;
		T3_ = kill((*p).id, SIGKILL);
		if (!!((T3_ == ((NI32) 0)))) goto LA4_;
		T6_ = (NI32)0;
		T6_ = osLastError_YyC2FKP9bqQiUDq2XVqW9acA();
		raiseOSError_86HIIOlD5N61CWaO5GBgqA(T6_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3));
	}
	LA4_: ;
}

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

N_LIB_EXPORT N_CDECL(NI, nospwaitForExit)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p, NI timeout) {
	NI result;
	int T136_;
{	result = (NI)0;
	{
		int T5_;
		if (!!(((*p).exitStatus == ((NI32) -3)))) goto LA3_;
		T5_ = (int)0;
		T5_ = exitStatus_UXYeVHPMK6MYSBxiXhkNfQ((*p).exitStatus);
		result = ((NI) (T5_));
		goto BeforeRet_;
	}
	LA3_: ;
	{
		int status;
		if (!(timeout == ((NI) -1))) goto LA8_;
		status = ((int) 1);
		{
			pid_t T12_;
			NI32 T15_;
			T12_ = (pid_t)0;
			T12_ = waitpid((*p).id, (&status), ((int) 0));
			if (!(T12_ < ((NI) 0))) goto LA13_;
			T15_ = (NI32)0;
			T15_ = osLastError_YyC2FKP9bqQiUDq2XVqW9acA();
			raiseOSError_86HIIOlD5N61CWaO5GBgqA(T15_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3));
		}
		LA13_: ;
		(*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_32;
		memset((void*)(&nmask), 0, sizeof(nmask));
		memset((void*)(&omask), 0, sizeof(omask));
		memset((void*)(&sinfo), 0, sizeof(sinfo));
		memset((void*)(&stspec), 0, sizeof(stspec));
		memset((void*)(&enspec), 0, sizeof(enspec));
		memset((void*)(&tmspec), 0, sizeof(tmspec));
		T17_ = (int)0;
		T17_ = sigemptyset((&nmask));
		T18_ = (int)0;
		T18_ = sigemptyset((&omask));
		T19_ = (int)0;
		T19_ = sigaddset((&nmask), SIGCHLD);
		{
			int T22_;
			NI32 T25_;
			T22_ = (int)0;
			T22_ = sigprocmask(SIG_BLOCK, (&nmask), (&omask));
			if (!(T22_ == ((NI32) -1))) goto LA23_;
			T25_ = (NI32)0;
			T25_ = osLastError_YyC2FKP9bqQiUDq2XVqW9acA();
			raiseOSError_86HIIOlD5N61CWaO5GBgqA(T25_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3));
		}
		LA23_: ;
		{
			if (!(((NI) 1000) <= timeout)) goto LA28_;
			tmspec.tv_sec = (NI)(timeout / ((NI) 1000));
			tmspec.tv_nsec = ((NI) ((NI)(((NI) ((NI)((NU32)(timeout) % (NU32)(((NI) 1000))))) * ((NI) 1000000))));
		}
		goto LA26_;
		LA28_: ;
		{
			tmspec.tv_sec = ((time_t) 0);
			tmspec.tv_nsec = (NI)(timeout * ((NI) 1000000));
		}
		LA26_: ;
		nimrtl_pushSafePoint(&TM_HZdw8BhppcTQo8DIK46LSg_32);
		TM_HZdw8BhppcTQo8DIK46LSg_32.status = setjmp(TM_HZdw8BhppcTQo8DIK46LSg_32.context);
		if (TM_HZdw8BhppcTQo8DIK46LSg_32.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_YyC2FKP9bqQiUDq2XVqW9acA();
				raiseOSError_86HIIOlD5N61CWaO5GBgqA(T37_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3));
			}
			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_ < ((NI) 0))) goto LA51_;
								T53_ = (NI32)0;
								T53_ = osLastError_YyC2FKP9bqQiUDq2XVqW9acA();
								raiseOSError_86HIIOlD5N61CWaO5GBgqA(T53_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3));
							}
							LA51_: ;
							(*p).exitStatus = status_2;
							goto LA38;
						}
						goto LA44_;
						LA46_: ;
						{
							NI volatile diff;
							struct timespec b;
							NI64 T61_;
							NI64 T74_;
							{
								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_YyC2FKP9bqQiUDq2XVqW9acA();
								raiseOSError_86HIIOlD5N61CWaO5GBgqA(T60_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3));
							}
							LA58_: ;
							diff = (NI)0;
							memset((void*)(&b), 0, sizeof(b));
							b.tv_sec = enspec.tv_sec;
							b.tv_nsec = enspec.tv_nsec;
							T61_ = (NI64)0;
							T61_ = ntDiffTime(enspec.tv_sec, stspec.tv_sec);
							enspec.tv_sec = ((time_t) (T61_));
							{
								if (!(stspec.tv_nsec <= enspec.tv_nsec)) goto LA64_;
								enspec.tv_nsec -= stspec.tv_nsec;
							}
							goto LA62_;
							LA64_: ;
							{
								{
									NIM_BOOL T69_;
									ValueError_Gi06FkNeykJn7mrqRZYrkA* volatile e;
									NimStringDesc* T72_;
									T69_ = (NIM_BOOL)0;
									T69_ = ntEqTime(enspec.tv_sec, ((time_t) 0));
									if (!T69_) goto LA70_;
									e = (ValueError_Gi06FkNeykJn7mrqRZYrkA*)0;
									e = (ValueError_Gi06FkNeykJn7mrqRZYrkA*) nimrtl_newObj((&NTI_yCEN9anxCD6mzBxGjuaRBdg_), sizeof(ValueError_Gi06FkNeykJn7mrqRZYrkA));
									(*e).Sup.Sup.m_type = (&NTI_Gi06FkNeykJn7mrqRZYrkA_);
									T72_ = (NimStringDesc*)0;
									T72_ = (*e).Sup.message; (*e).Sup.message = nimrtl_copyStringRC1(((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_33));
									if (T72_) nimGCunrefNoCycle(T72_);
									asgnRef((void**) (&(*e).Sup.parent), NIM_NIL);
									nimrtl_raiseException((Exception*)e, "ValueError");
								}
								goto LA67_;
								LA70_: ;
								{
									diff = (NI)(stspec.tv_nsec - enspec.tv_nsec);
									enspec.tv_nsec = (NI)(((NI) 1000000000) - diff);
								}
								LA67_: ;
							}
							LA62_: ;
							T74_ = (NI64)0;
							T74_ = ntDiffTime(tmspec.tv_sec, enspec.tv_sec);
							tmspec.tv_sec = ((time_t) (T74_));
							{
								if (!(enspec.tv_nsec <= tmspec.tv_nsec)) goto LA77_;
								tmspec.tv_nsec -= enspec.tv_nsec;
							}
							goto LA75_;
							LA77_: ;
							{
								tmspec.tv_sec = (NI)(tmspec.tv_sec - ((NI) 1));
								diff = (NI)(enspec.tv_nsec - tmspec.tv_nsec);
								tmspec.tv_nsec = (NI)(((NI) 1000000000) - diff);
							}
							LA75_: ;
							stspec.tv_sec = b.tv_sec;
							stspec.tv_nsec = b.tv_nsec;
						}
						LA44_: ;
					}
					goto LA40_;
					LA42_: ;
					{
						NI32 err;
						if (!(res < ((NI32) 0))) goto LA81_;
						err = osLastError_YyC2FKP9bqQiUDq2XVqW9acA();
						{
							NI volatile diff_2;
							struct timespec b_2;
							NI64 T93_;
							NI64 T106_;
							if (!(err == EINTR)) goto LA85_;
							{
								int T89_;
								NI32 T92_;
								T89_ = (int)0;
								T89_ = clock_gettime(((clockid_t) (CLOCK_REALTIME)), (&enspec));
								if (!(T89_ == ((NI32) -1))) goto LA90_;
								T92_ = (NI32)0;
								T92_ = osLastError_YyC2FKP9bqQiUDq2XVqW9acA();
								raiseOSError_86HIIOlD5N61CWaO5GBgqA(T92_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3));
							}
							LA90_: ;
							diff_2 = (NI)0;
							memset((void*)(&b_2), 0, sizeof(b_2));
							b_2.tv_sec = enspec.tv_sec;
							b_2.tv_nsec = enspec.tv_nsec;
							T93_ = (NI64)0;
							T93_ = ntDiffTime(enspec.tv_sec, stspec.tv_sec);
							enspec.tv_sec = ((time_t) (T93_));
							{
								if (!(stspec.tv_nsec <= enspec.tv_nsec)) goto LA96_;
								enspec.tv_nsec -= stspec.tv_nsec;
							}
							goto LA94_;
							LA96_: ;
							{
								{
									NIM_BOOL T101_;
									ValueError_Gi06FkNeykJn7mrqRZYrkA* volatile e_2;
									NimStringDesc* T104_;
									T101_ = (NIM_BOOL)0;
									T101_ = ntEqTime(enspec.tv_sec, ((time_t) 0));
									if (!T101_) goto LA102_;
									e_2 = (ValueError_Gi06FkNeykJn7mrqRZYrkA*)0;
									e_2 = (ValueError_Gi06FkNeykJn7mrqRZYrkA*) nimrtl_newObj((&NTI_yCEN9anxCD6mzBxGjuaRBdg_), sizeof(ValueError_Gi06FkNeykJn7mrqRZYrkA));
									(*e_2).Sup.Sup.m_type = (&NTI_Gi06FkNeykJn7mrqRZYrkA_);
									T104_ = (NimStringDesc*)0;
									T104_ = (*e_2).Sup.message; (*e_2).Sup.message = nimrtl_copyStringRC1(((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_33));
									if (T104_) nimGCunrefNoCycle(T104_);
									asgnRef((void**) (&(*e_2).Sup.parent), NIM_NIL);
									nimrtl_raiseException((Exception*)e_2, "ValueError");
								}
								goto LA99_;
								LA102_: ;
								{
									diff_2 = (NI)(stspec.tv_nsec - enspec.tv_nsec);
									enspec.tv_nsec = (NI)(((NI) 1000000000) - diff_2);
								}
								LA99_: ;
							}
							LA94_: ;
							T106_ = (NI64)0;
							T106_ = ntDiffTime(tmspec.tv_sec, enspec.tv_sec);
							tmspec.tv_sec = ((time_t) (T106_));
							{
								if (!(enspec.tv_nsec <= tmspec.tv_nsec)) goto LA109_;
								tmspec.tv_nsec -= enspec.tv_nsec;
							}
							goto LA107_;
							LA109_: ;
							{
								tmspec.tv_sec = (NI)(tmspec.tv_sec - ((NI) 1));
								diff_2 = (NI)(enspec.tv_nsec - tmspec.tv_nsec);
								tmspec.tv_nsec = (NI)(((NI) 1000000000) - diff_2);
							}
							LA107_: ;
							stspec.tv_sec = b_2.tv_sec;
							stspec.tv_nsec = b_2.tv_nsec;
						}
						goto LA83_;
						LA85_: ;
						{
							int status_3;
							if (!(err == EAGAIN)) goto LA113_;
							{
								int T117_;
								NI32 T120_;
								T117_ = (int)0;
								T117_ = kill((*p).id, SIGKILL);
								if (!(T117_ == ((NI32) -1))) goto LA118_;
								T120_ = (NI32)0;
								T120_ = osLastError_YyC2FKP9bqQiUDq2XVqW9acA();
								raiseOSError_86HIIOlD5N61CWaO5GBgqA(T120_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3));
							}
							LA118_: ;
							status_3 = ((int) 1);
							{
								pid_t T123_;
								NI32 T126_;
								T123_ = (pid_t)0;
								T123_ = waitpid((*p).id, (&status_3), ((int) 0));
								if (!(T123_ < ((NI) 0))) goto LA124_;
								T126_ = (NI32)0;
								T126_ = osLastError_YyC2FKP9bqQiUDq2XVqW9acA();
								raiseOSError_86HIIOlD5N61CWaO5GBgqA(T126_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3));
							}
							LA124_: ;
							(*p).exitStatus = status_3;
							goto LA38;
						}
						goto LA83_;
						LA113_: ;
						{
							raiseOSError_86HIIOlD5N61CWaO5GBgqA(err, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3));
						}
						LA83_: ;
					}
					goto LA40_;
					LA81_: ;
					LA40_: ;
				}
			} LA38: ;
			nimrtl_popSafePoint();
		}
		else {
			nimrtl_popSafePoint();
		}
		{
			{
				int T132_;
				NI32 T135_;
				T132_ = (int)0;
				T132_ = sigprocmask(SIG_UNBLOCK, (&nmask), (&omask));
				if (!(T132_ == ((NI32) -1))) goto LA133_;
				T135_ = (NI32)0;
				T135_ = osLastError_YyC2FKP9bqQiUDq2XVqW9acA();
				raiseOSError_86HIIOlD5N61CWaO5GBgqA(T135_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3));
			}
			LA133_: ;
		}
		if (TM_HZdw8BhppcTQo8DIK46LSg_32.status != 0) nimrtl_reraiseException();
	}
	LA6_: ;
	T136_ = (int)0;
	T136_ = exitStatus_UXYeVHPMK6MYSBxiXhkNfQ((*p).exitStatus);
	result = ((NI) (T136_));
	}BeforeRet_: ;
	return result;
}

N_NIMCALL(void, createStream_v8G6hIKoW7oNggVYf9a9c7dQ)(StreamObj_RShkcoDOPnoCVhtpN1hDPQ** stream, int* handle, FileMode_fVUBHvW79bXUw1j55Oo9avSQ fileMode) {
	FILE* f;
	FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw* T7_;
	f = (FILE*)0;
	{
		NIM_BOOL T3_;
		NI32 T6_;
		T3_ = (NIM_BOOL)0;
		T3_ = open_GRr4dBTChSldEteMxZDsuw(&f, (*handle), fileMode);
		if (!!(T3_)) goto LA4_;
		T6_ = (NI32)0;
		T6_ = osLastError_YyC2FKP9bqQiUDq2XVqW9acA();
		raiseOSError_86HIIOlD5N61CWaO5GBgqA(T6_, ((NimStringDesc*) &TM_HZdw8BhppcTQo8DIK46LSg_3));
	}
	LA4_: ;
	T7_ = (FileStreamObj_qoDM8xYRV40zbhS9acPNT9bw*)0;
	T7_ = newFileStream_j9aOzR9a9bXMSUnTXiGmXXGqQ(f);
	unsureAsgnRef((void**) (&(*stream)), &T7_->Sup);
}

N_LIB_EXPORT N_CDECL(StreamObj_RShkcoDOPnoCVhtpN1hDPQ*, nospinputStream)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p) {
	StreamObj_RShkcoDOPnoCVhtpN1hDPQ* result;
{	result = (StreamObj_RShkcoDOPnoCVhtpN1hDPQ*)0;
	{
		if (!((*p).inStream == NIM_NIL)) goto LA3_;
		createStream_v8G6hIKoW7oNggVYf9a9c7dQ(&(*p).inStream, (&(*p).inHandle), ((FileMode_fVUBHvW79bXUw1j55Oo9avSQ) 1));
	}
	LA3_: ;
	result = (*p).inStream;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(StreamObj_RShkcoDOPnoCVhtpN1hDPQ*, nospoutputStream)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p) {
	StreamObj_RShkcoDOPnoCVhtpN1hDPQ* result;
{	result = (StreamObj_RShkcoDOPnoCVhtpN1hDPQ*)0;
	{
		if (!((*p).outStream == NIM_NIL)) goto LA3_;
		createStream_v8G6hIKoW7oNggVYf9a9c7dQ(&(*p).outStream, (&(*p).outHandle), ((FileMode_fVUBHvW79bXUw1j55Oo9avSQ) 0));
	}
	LA3_: ;
	result = (*p).outStream;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(StreamObj_RShkcoDOPnoCVhtpN1hDPQ*, nosperrorStream)(ProcessObj_NHqciQYh8G1aN2n273mmYw* p) {
	StreamObj_RShkcoDOPnoCVhtpN1hDPQ* result;
{	result = (StreamObj_RShkcoDOPnoCVhtpN1hDPQ*)0;
	{
		if (!((*p).errStream == NIM_NIL)) goto LA3_;
		createStream_v8G6hIKoW7oNggVYf9a9c7dQ(&(*p).errStream, (&(*p).errHandle), ((FileMode_fVUBHvW79bXUw1j55Oo9avSQ) 0));
	}
	LA3_: ;
	result = (*p).errStream;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NI, nospexecCmd)(NimStringDesc* command) {
	NI result;
	int tmp;
	int T1_;
	result = (NI)0;
	tmp = system(command->data);
	T1_ = (int)0;
	{
		if (!(tmp == ((NI32) -1))) goto LA4_;
		T1_ = tmp;
	}
	goto LA2_;
	LA4_: ;
	{
		T1_ = exitStatus_UXYeVHPMK6MYSBxiXhkNfQ(tmp);
	}
	LA2_: ;
	result = ((NI) (T1_));
	return result;
}
NIM_EXTERNC N_NOINLINE(void, stdlib_osprocInit000)(void) {
}

NIM_EXTERNC N_NOINLINE(void, stdlib_osprocDatInit000)(void) {
static TNimNode* TM_HZdw8BhppcTQo8DIK46LSg_10[9];
static TNimNode* TM_HZdw8BhppcTQo8DIK46LSg_11[7];
NI TM_HZdw8BhppcTQo8DIK46LSg_13;
static char* NIM_CONST TM_HZdw8BhppcTQo8DIK46LSg_12[7] = {
"poEchoCmd", 
"poUsePath", 
"poEvalCommand", 
"poStdErrToStdOut", 
"poParentStreams", 
"poInteractive", 
"poDemon"};
static TNimNode TM_HZdw8BhppcTQo8DIK46LSg_0[19];
NTI_NHqciQYh8G1aN2n273mmYw_.size = sizeof(ProcessObj_NHqciQYh8G1aN2n273mmYw);
NTI_NHqciQYh8G1aN2n273mmYw_.kind = 17;
NTI_NHqciQYh8G1aN2n273mmYw_.base = (&NTI_13RNkKqUOX1TtorOUlKtqA_);
TM_HZdw8BhppcTQo8DIK46LSg_10[0] = &TM_HZdw8BhppcTQo8DIK46LSg_0[1];
TM_HZdw8BhppcTQo8DIK46LSg_0[1].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[1].offset = offsetof(ProcessObj_NHqciQYh8G1aN2n273mmYw, inHandle);
TM_HZdw8BhppcTQo8DIK46LSg_0[1].typ = (&NTI_UtShRB9b1wZO9cvpdowm9cefA_);
TM_HZdw8BhppcTQo8DIK46LSg_0[1].name = "inHandle";
TM_HZdw8BhppcTQo8DIK46LSg_10[1] = &TM_HZdw8BhppcTQo8DIK46LSg_0[2];
TM_HZdw8BhppcTQo8DIK46LSg_0[2].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[2].offset = offsetof(ProcessObj_NHqciQYh8G1aN2n273mmYw, outHandle);
TM_HZdw8BhppcTQo8DIK46LSg_0[2].typ = (&NTI_UtShRB9b1wZO9cvpdowm9cefA_);
TM_HZdw8BhppcTQo8DIK46LSg_0[2].name = "outHandle";
TM_HZdw8BhppcTQo8DIK46LSg_10[2] = &TM_HZdw8BhppcTQo8DIK46LSg_0[3];
TM_HZdw8BhppcTQo8DIK46LSg_0[3].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[3].offset = offsetof(ProcessObj_NHqciQYh8G1aN2n273mmYw, errHandle);
TM_HZdw8BhppcTQo8DIK46LSg_0[3].typ = (&NTI_UtShRB9b1wZO9cvpdowm9cefA_);
TM_HZdw8BhppcTQo8DIK46LSg_0[3].name = "errHandle";
TM_HZdw8BhppcTQo8DIK46LSg_10[3] = &TM_HZdw8BhppcTQo8DIK46LSg_0[4];
TM_HZdw8BhppcTQo8DIK46LSg_0[4].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[4].offset = offsetof(ProcessObj_NHqciQYh8G1aN2n273mmYw, inStream);
TM_HZdw8BhppcTQo8DIK46LSg_0[4].typ = (&NTI_r3Wc5tOoxP8rz1DvGVTUvw_);
TM_HZdw8BhppcTQo8DIK46LSg_0[4].name = "inStream";
TM_HZdw8BhppcTQo8DIK46LSg_10[4] = &TM_HZdw8BhppcTQo8DIK46LSg_0[5];
TM_HZdw8BhppcTQo8DIK46LSg_0[5].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[5].offset = offsetof(ProcessObj_NHqciQYh8G1aN2n273mmYw, outStream);
TM_HZdw8BhppcTQo8DIK46LSg_0[5].typ = (&NTI_r3Wc5tOoxP8rz1DvGVTUvw_);
TM_HZdw8BhppcTQo8DIK46LSg_0[5].name = "outStream";
TM_HZdw8BhppcTQo8DIK46LSg_10[5] = &TM_HZdw8BhppcTQo8DIK46LSg_0[6];
TM_HZdw8BhppcTQo8DIK46LSg_0[6].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[6].offset = offsetof(ProcessObj_NHqciQYh8G1aN2n273mmYw, errStream);
TM_HZdw8BhppcTQo8DIK46LSg_0[6].typ = (&NTI_r3Wc5tOoxP8rz1DvGVTUvw_);
TM_HZdw8BhppcTQo8DIK46LSg_0[6].name = "errStream";
TM_HZdw8BhppcTQo8DIK46LSg_10[6] = &TM_HZdw8BhppcTQo8DIK46LSg_0[7];
TM_HZdw8BhppcTQo8DIK46LSg_0[7].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[7].offset = offsetof(ProcessObj_NHqciQYh8G1aN2n273mmYw, id);
TM_HZdw8BhppcTQo8DIK46LSg_0[7].typ = (&NTI_CHeEDdL3roTPu81s9cOH0Bw_);
TM_HZdw8BhppcTQo8DIK46LSg_0[7].name = "id";
TM_HZdw8BhppcTQo8DIK46LSg_10[7] = &TM_HZdw8BhppcTQo8DIK46LSg_0[8];
TM_HZdw8BhppcTQo8DIK46LSg_0[8].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[8].offset = offsetof(ProcessObj_NHqciQYh8G1aN2n273mmYw, exitStatus);
TM_HZdw8BhppcTQo8DIK46LSg_0[8].typ = (&NTI_nlCscttRCss70IBTyuBqnA_);
TM_HZdw8BhppcTQo8DIK46LSg_0[8].name = "exitStatus";
TM_HZdw8BhppcTQo8DIK46LSg_10[8] = &TM_HZdw8BhppcTQo8DIK46LSg_0[9];
NTI_bnU6W8LhTMnT4JaSWtGlSA_.size = sizeof(ProcessOption_bnU6W8LhTMnT4JaSWtGlSA);
NTI_bnU6W8LhTMnT4JaSWtGlSA_.kind = 14;
NTI_bnU6W8LhTMnT4JaSWtGlSA_.base = 0;
NTI_bnU6W8LhTMnT4JaSWtGlSA_.flags = 3;
for (TM_HZdw8BhppcTQo8DIK46LSg_13 = 0; TM_HZdw8BhppcTQo8DIK46LSg_13 < 7; TM_HZdw8BhppcTQo8DIK46LSg_13++) {
TM_HZdw8BhppcTQo8DIK46LSg_0[TM_HZdw8BhppcTQo8DIK46LSg_13+10].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[TM_HZdw8BhppcTQo8DIK46LSg_13+10].offset = TM_HZdw8BhppcTQo8DIK46LSg_13;
TM_HZdw8BhppcTQo8DIK46LSg_0[TM_HZdw8BhppcTQo8DIK46LSg_13+10].name = TM_HZdw8BhppcTQo8DIK46LSg_12[TM_HZdw8BhppcTQo8DIK46LSg_13];
TM_HZdw8BhppcTQo8DIK46LSg_11[TM_HZdw8BhppcTQo8DIK46LSg_13] = &TM_HZdw8BhppcTQo8DIK46LSg_0[TM_HZdw8BhppcTQo8DIK46LSg_13+10];
}
TM_HZdw8BhppcTQo8DIK46LSg_0[17].len = 7; TM_HZdw8BhppcTQo8DIK46LSg_0[17].kind = 2; TM_HZdw8BhppcTQo8DIK46LSg_0[17].sons = &TM_HZdw8BhppcTQo8DIK46LSg_11[0];
NTI_bnU6W8LhTMnT4JaSWtGlSA_.node = &TM_HZdw8BhppcTQo8DIK46LSg_0[17];
NTI_HlmBYNr2gdAZMXOsuiSZ0A_.size = sizeof(ProcessOption_bnU6W8LhTMnT4JaSWtGlSA_Set);
NTI_HlmBYNr2gdAZMXOsuiSZ0A_.kind = 19;
NTI_HlmBYNr2gdAZMXOsuiSZ0A_.base = (&NTI_bnU6W8LhTMnT4JaSWtGlSA_);
NTI_HlmBYNr2gdAZMXOsuiSZ0A_.flags = 3;
TM_HZdw8BhppcTQo8DIK46LSg_0[18].len = 0; TM_HZdw8BhppcTQo8DIK46LSg_0[18].kind = 0;
NTI_HlmBYNr2gdAZMXOsuiSZ0A_.node = &TM_HZdw8BhppcTQo8DIK46LSg_0[18];
TM_HZdw8BhppcTQo8DIK46LSg_0[9].kind = 1;
TM_HZdw8BhppcTQo8DIK46LSg_0[9].offset = offsetof(ProcessObj_NHqciQYh8G1aN2n273mmYw, options);
TM_HZdw8BhppcTQo8DIK46LSg_0[9].typ = (&NTI_HlmBYNr2gdAZMXOsuiSZ0A_);
TM_HZdw8BhppcTQo8DIK46LSg_0[9].name = "options";
TM_HZdw8BhppcTQo8DIK46LSg_0[0].len = 9; TM_HZdw8BhppcTQo8DIK46LSg_0[0].kind = 2; TM_HZdw8BhppcTQo8DIK46LSg_0[0].sons = &TM_HZdw8BhppcTQo8DIK46LSg_10[0];
NTI_NHqciQYh8G1aN2n273mmYw_.node = &TM_HZdw8BhppcTQo8DIK46LSg_0[0];
NTI_Ryg5db24dBRIzTUa2BQTPg_.size = sizeof(ProcessObj_NHqciQYh8G1aN2n273mmYw*);
NTI_Ryg5db24dBRIzTUa2BQTPg_.kind = 22;
NTI_Ryg5db24dBRIzTUa2BQTPg_.base = (&NTI_NHqciQYh8G1aN2n273mmYw_);
NTI_Ryg5db24dBRIzTUa2BQTPg_.marker = Marker_TY_Ryg5db24dBRIzTUa2BQTPg;
NTI_l0xXJxOLtcuhlSBHl64t5w_.size = sizeof(TY_l0xXJxOLtcuhlSBHl64t5w*);
NTI_l0xXJxOLtcuhlSBHl64t5w_.kind = 24;
NTI_l0xXJxOLtcuhlSBHl64t5w_.base = (&NTI_Ryg5db24dBRIzTUa2BQTPg_);
NTI_l0xXJxOLtcuhlSBHl64t5w_.marker = Marker_TY_l0xXJxOLtcuhlSBHl64t5w;
}

