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

/* section: NIM_merge_HEADERS */

#include "nimbase.h"
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include <errno.h>
#include <sys/wait.h>
#include <dirent.h>
#include <setjmp.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

/* section: NIM_merge_FRAME_DEFINES */
#define nimfr_(x, y)
#define nimln_(x, y)

/* section: NIM_merge_FORWARD_TYPES */
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ tySequence__sM4lkSb7zS6F7OVMvW9cffQ;
typedef struct TGenericSeq TGenericSeq;
typedef struct NimStringDesc NimStringDesc;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
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 tyObject_IndexDefect__n6tGEPHKkh7E1AP9bj30WrQ tyObject_IndexDefect__n6tGEPHKkh7E1AP9bj30WrQ;
typedef struct tyObject_Defect__LbeSGvgPzGzXnW9caIkJqMA tyObject_Defect__LbeSGvgPzGzXnW9caIkJqMA;
typedef struct Exception Exception;
typedef struct RootObj RootObj;
typedef struct tySequence__uB9b75OUPRENsBAu4AnoePA tySequence__uB9b75OUPRENsBAu4AnoePA;
typedef struct tyTuple__UV3llMMYFckfui8YMBuUZA tyTuple__UV3llMMYFckfui8YMBuUZA;
typedef struct tyTuple__7q7q3E6Oj24ZNVJb9aonhAg tyTuple__7q7q3E6Oj24ZNVJb9aonhAg;
typedef struct tyObject_OSError__BeJgrOdDsczOwEWOZbRfKA tyObject_OSError__BeJgrOdDsczOwEWOZbRfKA;
typedef struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA;
typedef struct tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw;
typedef struct tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw;
typedef struct tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg;
typedef struct tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ;
typedef struct TSafePoint TSafePoint;
typedef struct tyTuple__flePlH29a9c9cGo1Wdll1KDOQ tyTuple__flePlH29a9c9cGo1Wdll1KDOQ;
typedef struct tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q;
typedef struct tyTuple__HFn8JzZZeLZ9aKrFg4S9a7HA tyTuple__HFn8JzZZeLZ9aKrFg4S9a7HA;
typedef struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA;

/* section: NIM_merge_TYPES */
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
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;
NI align;
tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
TNimType* base;
TNimNode* node;
void* finalizer;
tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
struct TNimNode {
tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
typedef N_NIMCALL_PTR(void, tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ) (void);
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__SPr7N6UKfuF549bNPiUvSRw[256];
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__SPr7N6UKfuF549bNPiUvSRw 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 RootObj {
TNimType* m_type;
};
struct Exception {
  RootObj Sup;
Exception* parent;
NCSTRING name;
NimStringDesc* message;
tySequence__uB9b75OUPRENsBAu4AnoePA* trace;
Exception* up;
};
struct tyObject_Defect__LbeSGvgPzGzXnW9caIkJqMA {
  Exception Sup;
};
struct tyObject_IndexDefect__n6tGEPHKkh7E1AP9bj30WrQ {
  tyObject_Defect__LbeSGvgPzGzXnW9caIkJqMA Sup;
};
typedef NU8 tySet_tyChar__nmiMWKVIe46vacnhAFrQvw[32];
struct tyTuple__UV3llMMYFckfui8YMBuUZA {
NimStringDesc* Field0;
NimStringDesc* Field1;
};
struct tyTuple__7q7q3E6Oj24ZNVJb9aonhAg {
NimStringDesc* Field0;
NimStringDesc* Field1;
NimStringDesc* Field2;
};
struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA {
  Exception Sup;
};
struct tyObject_OSError__BeJgrOdDsczOwEWOZbRfKA {
  tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA Sup;
NI32 errorCode;
};
typedef NU8 tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg;
struct tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw {
  tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA Sup;
};
struct tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw {
  tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA Sup;
};
struct tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg {
NI i;
NI prev;
NIM_BOOL notFirst;
};
struct tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ {
NI Field0;
NI Field1;
};
struct TSafePoint {
TSafePoint* prev;
NI status;
jmp_buf context;
};
typedef NIM_CHAR tyArray__dTlC27m9c9aWd5dvuePYanug[256];
struct tyTuple__flePlH29a9c9cGo1Wdll1KDOQ {
NimStringDesc* Field0;
NimStringDesc* Field1;
NCSTRING Field2;
};
typedef NU8 tyEnum_FileMode__ZJfK20XeZ9bv2j1pZjw9aswg;
struct tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q {
NI64 seconds;
NI nanosecond;
};
typedef NU16 tySet_tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA;
typedef NU8 tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA;
struct tyTuple__HFn8JzZZeLZ9aKrFg4S9a7HA {
NimStringDesc* Field0;
tySet_tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA Field1;
};
struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA {
NCSTRING procname;
NI line;
NCSTRING filename;
};

/* section: NIM_merge_SEQ_TYPES */
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct tySequence__uB9b75OUPRENsBAu4AnoePA {
  TGenericSeq Sup;
  tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA data[SEQ_DECL_SIZE];
};

/* section: NIM_merge_PROC_HEADERS */
N_LIB_PRIVATE N_NIMCALL(void, nimGCvisit)(void* d, NI op);
static N_NIMCALL(void, Marker_tySequence__sM4lkSb7zS6F7OVMvW9cffQ)(void* p, NI op);
static N_NIMCALL(void, TM__yu6cxgKBBXbNsTkT9cyMd4g_2)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimRegisterThreadLocalMarker)(tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ markerProc);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, setLengthStr)(NimStringDesc* s, NI newLen);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s, NIM_CHAR c);
N_LIB_PRIVATE N_NIMCALL(TGenericSeq*, incrSeqV3)(TGenericSeq* s, TNimType* typ);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(void, decRef__AT1eRuflKWyTTBdLjEDZbgsystem)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(NI, minuspercent___dgYAo7RfdUVVpvkfKDym8w_2system)(NI x, NI y);
static N_INLINE(NIM_BOOL, ltpercent___hPljn3JCDQ00ua1R07X9bxQsystem)(NI x, NI y);
static N_INLINE(void, rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_2system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_PRIVATE N_NOINLINE(void, addZCT__Y66tOYFjgwJ0k4aLz4bc0Q)(tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w* s, tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem)(void* usr);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, cstrToNimstr)(NCSTRING str);
N_LIB_PRIVATE N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size);
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incRef__AT1eRuflKWyTTBdLjEDZbg_3system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(NI, pluspercent___dgYAo7RfdUVVpvkfKDym8wsystem)(NI x, NI y);
N_LIB_PRIVATE N_NIMCALL(void, raiseExceptionEx)(Exception* e, NCSTRING ename, NCSTRING procname, NCSTRING filename, NI line);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nospquoteShellPosix)(NimStringDesc* s);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, allCharsInSet__dubrHoRt3C9a0HlJjsxM5ig)(NimStringDesc* s, tySet_tyChar__nmiMWKVIe46vacnhAFrQvw theSet);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuReplaceStr)(NimStringDesc* s, NimStringDesc* sub, NimStringDesc* by);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nospquoteShell)(NimStringDesc* s);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, normalizePathEnd__cQ9bfE8YwK2s9aQkxFkMKhYg)(NimStringDesc* path, NIM_BOOL trailingSep);
N_LIB_PRIVATE N_NIMCALL(void, normalizePathEnd__gKUeJXj8CrWvxdeNCA2BXg)(NimStringDesc** path, NIM_BOOL trailingSep);
N_LIB_PRIVATE N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosextractFilename)(NimStringDesc* path);
N_LIB_PRIVATE N_NIMCALL(void, nossplitPath)(NimStringDesc* path, tyTuple__UV3llMMYFckfui8YMBuUZA* Result);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, substr__2yh9cer0ymNRHlOOg8P7IuA)(NimStringDesc* s, NI first, NI last);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, substr__iGg0RIKceRvsmvq8FUHOEw)(NimStringDesc* s, NI first);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosjoinPath)(NimStringDesc* head, NimStringDesc* tail);
N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
N_LIB_PRIVATE N_NIMCALL(void, joinPathImpl__zwiv42T0z9bOei4bjr58A9cA)(NimStringDesc** result, NI* state, NimStringDesc* tail);
static N_INLINE(NIM_CHAR, X5BX5D___okzHJ6GE9cv0bYG3b4r5KCAsystem)(NimStringDesc* s, NI i);
N_LIB_PRIVATE N_NIMCALL(void, addNormalizePath__bx9csIXjBBeHkYSkIUixO1g)(NimStringDesc* x, NimStringDesc** result, NI* state, NIM_CHAR dirSep);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, getEnv__hhED57tMl0Iaa5bOg9cJaig)(NimStringDesc* key, NimStringDesc* default_0);
N_LIB_PRIVATE N_NIMCALL(NI, findEnvVar__4kc4cxzsC7aY1IOKtOGazA)(NimStringDesc* key);
N_LIB_PRIVATE N_NIMCALL(void, getEnvVarsC__580467zYn32AEdYj9cD4LLA)(void);
static N_INLINE(NIM_BOOL, eqeq___aqip9cmQIuefPKdd25wuEEwsystem)(NCSTRING x, NCSTRING y);
static N_INLINE(void, appendChar)(NimStringDesc* dest, NIM_CHAR c);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nsuStartsWith)(NimStringDesc* s, NimStringDesc* prefix);
N_LIB_PRIVATE N_NIMCALL(NI, nsuFindChar)(NimStringDesc* s, NIM_CHAR sub, NI start, NI last);
static N_INLINE(NCSTRING, nimToCStringConv)(NimStringDesc* s);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, normalizePath__gol9aBbIZpJYUPc6xBOBJDQ)(NimStringDesc* path, NIM_CHAR dirSep);
N_LIB_PRIVATE N_NIMCALL(NI, cmp__NAicU5bAGXmkx2NJujGi7g)(NimStringDesc* x, NimStringDesc* y);
N_LIB_PRIVATE N_NIMCALL(NI, nsuCmpIgnoreCase)(NimStringDesc* a, NimStringDesc* b);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosgetHomeDir)(void);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, slash___gEyhbzZ1UcxyenWRLJRXNQ)(NimStringDesc* head, NimStringDesc* tail);
N_LIB_PRIVATE N_NIMCALL(void, nossplitFile)(NimStringDesc* path, tyTuple__7q7q3E6Oj24ZNVJb9aonhAg* Result);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosgetAppFilename)(void);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, getApplAux__wpMsAlcjbgVsRya70vX0Ug)(NimStringDesc* procPath);
N_NIMCALL(NimStringDesc*, mnewString)(NI len);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, getApplHeuristic__9bfzMt7nzg9apH9cE9c5SozLJw)(void);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, paramStr__T0ST6UXXTEqaiXY9akIayng)(NI i);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosfileExists)(NimStringDesc* filename);
N_LIB_PRIVATE N_NIMCALL(NI32, osLastError__9bUWNxbcGnToMWA9b79aTXLIw)(void);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A)(NimStringDesc* msg);
N_LIB_PRIVATE N_NOINLINE(void, raiseOSError__CWyPYlyH9a6rAuZckFyVxPA)(NI32 errorCode, NimStringDesc* additionalInfo);
N_LIB_PRIVATE N_NOINLINE(tyObject_OSError__BeJgrOdDsczOwEWOZbRfKA*, newOSError__JXEuze9ctNbkn51HYBflQLg)(NI32 errorCode, NimStringDesc* additionalInfo);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, osErrorMsg__33xViSVWAmDrexoKkLfMhg)(NI32 errorCode);
N_LIB_PRIVATE N_NIMCALL(void, addQuoted__45fPtFhY4FavRaYwDhRfuA)(NimStringDesc** s, NimStringDesc* x);
N_LIB_PRIVATE N_NIMCALL(NI, parentDirPos__sw9aya5BvknC6WiJX9aEYn9ag)(NimStringDesc* path);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
static N_INLINE(NIM_BOOL, equalMem__9bGgqEk7RXXl6eqM9c1HdELAsystem)(void* a, void* b, NI size);
static N_INLINE(int, nimCmpMem)(void* a, void* b, NI size);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosexistsOrCreateDir)(NimStringDesc* dir);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, rawCreateDir__GHseAa61lv8Sp9b2kQD9baYQ)(NimStringDesc* dir);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosdirExists)(NimStringDesc* dir);
N_LIB_PRIVATE N_NIMCALL(NI, searchExtPos__sw9aya5BvknC6WiJX9aEYn9ag_2)(NimStringDesc* path);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, normExt__5YE1ExrSIVKLWtBPQtnFCw)(NimStringDesc* ext);
static N_INLINE(void, normalizePathAux__Vd3ai1bzXYPREMwN8HbsmQos)(NimStringDesc** path);
N_LIB_PRIVATE N_NIMCALL(void, nosnormalizePath)(NimStringDesc** path);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosisAbsolute)(NimStringDesc* path);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, absolutePathInternal__RmQRR8GLDFICboxWoCEpMw_2)(NimStringDesc* path);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, absolutePath__I16hivp0o49aEba9bSd0N6ng)(NimStringDesc* path, NimStringDesc* root);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosgetCurrentDir)(void);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, hasNext__ecfBf9bSnUlnf5OQ0NQMxpQ)(tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg it, NimStringDesc* x);
N_LIB_PRIVATE N_NIMCALL(tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ, next__am1q4dBd9cls9au5CcmkX5oA)(tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg* it, NimStringDesc* x);
static N_INLINE(NIM_BOOL, contains__Pa9a8m0kZYH6LC8N1EcZJdQsystem)(NIM_CHAR* a, NI aLen_0, NIM_CHAR item);
static N_INLINE(NI, find__31wM5Ui9c8jnrQ5QD4oPxOQsystem)(NIM_CHAR* a, NI aLen_0, NIM_CHAR item);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosaddFileExt)(NimStringDesc* filename, NimStringDesc* ext);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, expandTilde__RmQRR8GLDFICboxWoCEpMw)(NimStringDesc* path);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, checkSymlink__K8A5Y9b9bcyjk7pehBjrT8Kw)(NimStringDesc* path);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosparentDir)(NimStringDesc* path);
static N_INLINE(void, pushSafePoint)(TSafePoint* s);
N_LIB_PRIVATE N_NIMCALL(tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg, getSymlinkFileKind__wTnLPNAWjgwVnuiJ9ax0ZGQ)(NimStringDesc* path);
N_LIB_PRIVATE N_NIMCALL(void, nosremoveFile)(NimStringDesc* file);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nostryRemoveFile)(NimStringDesc* file);
N_LIB_PRIVATE N_NIMCALL(void, nosremoveDir)(NimStringDesc* dir, NIM_BOOL checkDir);
static N_INLINE(void, popSafePoint)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimLeaveFinally)(void);
N_LIB_PRIVATE N_NIMCALL(void, reraiseException)(void);
N_LIB_PRIVATE N_NIMCALL(void, rawRemoveDir__wSIx0z80fCn9axX6xdRqD8Q)(NimStringDesc* dir);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, tryMoveFSObject__43wKg5fKy6XSTFw35EBkzA)(NimStringDesc* source, NimStringDesc* dest);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___uRqZ9b9aRtL1gygwVfSa9bmlQ)(tyTuple__flePlH29a9c9cGo1Wdll1KDOQ x);
N_LIB_PRIVATE N_NIMCALL(void, noscopyFile)(NimStringDesc* source, NimStringDesc* dest);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, open__gq12VLhVO0NBzUTnGgz4nw)(FILE** f, NimStringDesc* filename, tyEnum_FileMode__ZJfK20XeZ9bv2j1pZjw9aswg mode, NI bufSize);
N_LIB_PRIVATE N_NIMCALL(void, close__fU6ZlJAtQ9bre04EDZLdGsA_3)(FILE* f);
N_LIB_PRIVATE N_NOCONV(void*, allocImpl__KzdpcuLT9aef9bsiSHlIu9aFg_2)(NI size);
N_LIB_PRIVATE N_NIMCALL(NI, readBuffer__Y9atVWUcVyKHG9aBP4D0P9czA_2)(FILE* f, void* buffer, NI len);
N_LIB_PRIVATE N_NIMCALL(NI, writeBuffer__Y9atVWUcVyKHG9aBP4D0P9czA)(FILE* f, void* buffer, NI len);
N_LIB_PRIVATE N_NOCONV(void, deallocImpl__SAtZpVrJ3o5FJvSdLQe9auA)(void* p);
N_LIB_PRIVATE N_NIMCALL(void, flushFile__fU6ZlJAtQ9bre04EDZLdGsA_2)(FILE* f);
static N_INLINE(void, popCurrentException)(void);
N_LIB_PRIVATE N_NIMCALL(void, noscopyDir)(NimStringDesc* source, NimStringDesc* dest);
N_LIB_PRIVATE N_NIMCALL(void, noscreateDir)(NimStringDesc* dir);
static N_INLINE(tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q, toTime__ijMjyFbtGRbszYH28YzkiQos)(struct timespec ts);
N_LIB_PRIVATE N_NIMCALL(tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q, initTime__JIXNH9cQMG3SbZ0hXqEYDvA)(NI64 unix_0, NI nanosecond);
static N_INLINE(struct timespec, st_mtim__pE9cdzno9aFK08QQxSwtkHRgposix)(struct stat s);
N_LIB_PRIVATE N_NIMCALL(void, delete__FxJSSlM1HtYUBJdvsqL6Sg)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ** x, NI i);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, ntLeTime)(tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q a, tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q b);
N_LIB_PRIVATE N_NIMCALL(tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q, nosgetLastModificationTime)(NimStringDesc* file);
N_LIB_PRIVATE N_NIMCALL(void, nossetFilePermissions)(NimStringDesc* filename, tySet_tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA permissions);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___VhyooW9cjC7wNKZM71oRg9cg)(tyTuple__HFn8JzZZeLZ9aKrFg4S9a7HA x);
N_LIB_PRIVATE N_NIMCALL(tySet_tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA, nosgetFilePermissions)(NimStringDesc* filename);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosrelativePath)(NimStringDesc* path, NimStringDesc* base, NIM_CHAR sep);
N_LIB_PRIVATE N_NIMCALL(int, exitStatusLikeShell__vmXOHpv9cjOB5AHi6OOlhbw)(int status);

/* section: NIM_merge_DATA */
extern TNimType NTI__77mFvmsOLKik79ci2hXkHEg_;
N_LIB_PRIVATE TNimType NTI__sM4lkSb7zS6F7OVMvW9cffQ_;
extern TNimType NTI__RJnHOb9cQV3neNC9cDkRgMyw_;
extern TNimType NTI__n6tGEPHKkh7E1AP9bj30WrQ_;
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_3, "index out of bounds, the container is empty", 43);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_4, "index ", 6);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_5, " not in 0 .. ", 13);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_6, "\'\'", 2);
static NIM_CONST tySet_tyChar__nmiMWKVIe46vacnhAFrQvw TM__yu6cxgKBBXbNsTkT9cyMd4g_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__yu6cxgKBBXbNsTkT9cyMd4g_8, "\'", 1);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_9, "\'\"\'\"\'", 5);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_10, " ", 1);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_11, "/", 1);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_12, "HOME", 4);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_13, "/proc/", 6);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_14, "/path/a.out", 11);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_15, "PATH", 4);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_16, "os.nim(1369, 21) `bufsize >= 0` ", 32);
extern TNimType NTI__9clYsYwyjCqe2PFTuCI3Ubg_;
extern TNimType NTI__BeJgrOdDsczOwEWOZbRfKA_;
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_17, "Additional info: ", 17);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_18, "unknown OS error", 16);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_19, "..", 2);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_20, ".", 1);
extern TNimType NTI__HMIVdYjdZYWskTmTQVo5BQ_;
extern TNimType NTI__iLZrPn9anoh9ad1MmO0RczFw_;
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_21, "Failed to create \'", 18);
extern TNimType NTI__Ie1m0dv1ZHg72IgPRr1cDw_;
extern TNimType NTI__yoNlBGx0D2tRizIdhQuENw_;
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_22, "The specified root is not absolute: ", 36);
static NIM_CONST tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ TM__yu6cxgKBBXbNsTkT9cyMd4g_23 = {((NI) 0),
((NI) -1)}
;
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_27, "XDG_CONFIG_HOME", 15);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_28, ".config", 7);
N_LIB_PRIVATE TNimType NTI__uTVeDpjCH6aWw9c74YkAskA_;

/* section: NIM_merge_VARS */
N_LIB_PRIVATE NIM_BOOL envComputed__LLyFo9bsdu1ZXMDvAe8DhrQ;
N_LIB_PRIVATE tySequence__sM4lkSb7zS6F7OVMvW9cffQ* environment__mlhK49b6YMgc9cgrcYkKq9a3g;
extern NCSTRING* environ;
extern int cmdCount;
extern NCSTRING* cmdLine;
extern tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ gch__IcYaEuuWivYAS86vFMTS3Q;
extern TSafePoint* excHandler__rqLlY5bs9atDw2OXYqJEn5g;
extern TSafePoint* excHandler__rqLlY5bs9atDw2OXYqJEn5g;
extern TSafePoint* excHandler__rqLlY5bs9atDw2OXYqJEn5g;
extern TSafePoint* excHandler__rqLlY5bs9atDw2OXYqJEn5g;
extern Exception* currException__9bVPeDJlYTi9bQApZpfH8wjg;
extern Exception* currException__9bVPeDJlYTi9bQApZpfH8wjg;

/* section: NIM_merge_PROCS */
static N_NIMCALL(void, Marker_tySequence__sM4lkSb7zS6F7OVMvW9cffQ)(void* p, NI op) {
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ* a;
	NI T1_;
	a = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*)p;
	T1_ = (NI)0;
	for (T1_ = 0; T1_ < (a ? a->Sup.len : 0); T1_++) {
	nimGCvisit((void*)a->data[T1_], op);
	}
}
static N_NIMCALL(void, TM__yu6cxgKBBXbNsTkT9cyMd4g_2)(void) {
	nimGCvisit((void*)environment__mlhK49b6YMgc9cgrcYkKq9a3g, 0);
}
static N_INLINE(NI, minuspercent___dgYAo7RfdUVVpvkfKDym8w_2system)(NI x, NI y) {
	NI result;
	result = (NI)0;
	result = ((NI) ((NU)((NU64)(((NU) (x))) - (NU64)(((NU) (y))))));
	return result;
}
static N_INLINE(NIM_BOOL, ltpercent___hPljn3JCDQ00ua1R07X9bxQsystem)(NI x, NI y) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	result = ((NU64)(((NU) (x))) < (NU64)(((NU) (y))));
	return result;
}
static N_INLINE(void, rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_2system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
	addZCT__Y66tOYFjgwJ0k4aLz4bc0Q((&gch__IcYaEuuWivYAS86vFMTS3Q.zct), c);
}
static N_INLINE(void, decRef__AT1eRuflKWyTTBdLjEDZbgsystem)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
	(*c).refcount = minuspercent___dgYAo7RfdUVVpvkfKDym8w_2system((*c).refcount, ((NI) 8));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = ltpercent___hPljn3JCDQ00ua1R07X9bxQsystem((*c).refcount, ((NI) 8));
		if (!T3_) goto LA4_;
		rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_2system(c);
	}
	LA4_: ;
}
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem)(void* usr) {
	tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* result;
	NI T1_;
	result = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
	T1_ = (NI)0;
	T1_ = minuspercent___dgYAo7RfdUVVpvkfKDym8w_2system(((NI) (ptrdiff_t) (usr)), ((NI) 16));
	result = ((tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*) (T1_));
	return result;
}
static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
	tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T1_;
	T1_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
	T1_ = usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem(p);
	decRef__AT1eRuflKWyTTBdLjEDZbgsystem(T1_);
}
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ*, nosparseCmdLine)(NimStringDesc* c) {
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ* result;
	NI i;
	NimStringDesc* a;
	result = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*)0;
	result = NIM_NIL;
	i = ((NI) 0);
	a = ((NimStringDesc*) NIM_NIL);
	{
		while (1) {
			NI T25_;
			NimStringDesc* T26_;
			a = setLengthStr(a, ((NI) 0));
			{
				while (1) {
					NIM_BOOL T5_;
					T5_ = (NIM_BOOL)0;
					T5_ = (i < (c ? c->Sup.len : 0));
					if (!(T5_)) goto LA6_;
					T5_ = (((NU8)(c->data[i])) == ((NU8)(32)) || ((NU8)(c->data[i])) == ((NU8)(9)) || ((NU8)(c->data[i])) == ((NU8)(10)) || ((NU8)(c->data[i])) == ((NU8)(13)));
					LA6_: ;
					if (!T5_) goto LA4;
					i += ((NI) 1);
				} LA4: ;
			}
			{
				if (!((c ? c->Sup.len : 0) <= i)) goto LA9_;
				goto LA1;
			}
			LA9_: ;
			switch (((NU8)(c->data[i]))) {
			case 39:
			case 34:
			{
				NIM_CHAR delim;
				delim = c->data[i];
				i += ((NI) 1);
				{
					while (1) {
						NIM_BOOL T14_;
						T14_ = (NIM_BOOL)0;
						T14_ = (i < (c ? c->Sup.len : 0));
						if (!(T14_)) goto LA15_;
						T14_ = !(((NU8)(c->data[i]) == (NU8)(delim)));
						LA15_: ;
						if (!T14_) goto LA13;
						a = addChar(a, c->data[i]);
						i += ((NI) 1);
					} LA13: ;
				}
				{
					if (!(i < (c ? c->Sup.len : 0))) goto LA18_;
					i += ((NI) 1);
				}
				LA18_: ;
			}
			break;
			default:
			{
				{
					while (1) {
						NIM_BOOL T23_;
						T23_ = (NIM_BOOL)0;
						T23_ = (i < (c ? c->Sup.len : 0));
						if (!(T23_)) goto LA24_;
						T23_ = ((NU8)(32) < (NU8)(c->data[i]));
						LA24_: ;
						if (!T23_) goto LA22;
						a = addChar(a, c->data[i]);
						i += ((NI) 1);
					} LA22: ;
				}
			}
			break;
			}
			result = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV3((TGenericSeq*)(result), (&NTI__sM4lkSb7zS6F7OVMvW9cffQ_));
			T25_ = result->Sup.len++;
			T26_ = (NimStringDesc*)0;
			T26_ = result->data[T25_]; result->data[T25_] = copyStringRC1(a);
			if (T26_) nimGCunrefNoCycle(T26_);
		}
	} LA1: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, paramCount__LYkRnwMk6UXTCs9c59cPvZsQ)(void) {
	NI result;
	result = (NI)0;
	result = ((NI) ((NI32)(cmdCount - ((NI32) 1))));
	return result;
}
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) {
	void* T1_;
	T1_ = (void*)0;
	T1_ = memcpy(dest, source, ((size_t) (size)));
}
static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size) {
	nimCopyMem(dest, source, size);
}
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
	{
		void* T5_;
		void* T6_;
		if (!!((src == NIM_NIL))) goto LA3_;
		T5_ = (void*)0;
		T5_ = ((void*) ((&(*dest).data[(*dest).Sup.len])));
		T6_ = (void*)0;
		T6_ = ((void*) ((*src).data));
		copyMem__i80o3k0SgEI5gTRCzYdyWAsystem(T5_, T6_, ((NI) ((NI)((*src).Sup.len + ((NI) 1)))));
		(*dest).Sup.len += (*src).Sup.len;
	}
	LA3_: ;
}
static N_INLINE(NI, pluspercent___dgYAo7RfdUVVpvkfKDym8wsystem)(NI x, NI y) {
	NI result;
	result = (NI)0;
	result = ((NI) ((NU)((NU64)(((NU) (x))) + (NU64)(((NU) (y))))));
	return result;
}
static N_INLINE(void, incRef__AT1eRuflKWyTTBdLjEDZbg_3system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
	(*c).refcount = pluspercent___dgYAo7RfdUVVpvkfKDym8wsystem((*c).refcount, ((NI) 8));
}
static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T5_;
		if (!!((src == NIM_NIL))) goto LA3_;
		T5_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
		T5_ = usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem(src);
		incRef__AT1eRuflKWyTTBdLjEDZbg_3system(T5_);
	}
	LA3_: ;
	{
		tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T10_;
		if (!!(((*dest) == NIM_NIL))) goto LA8_;
		T10_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
		T10_ = usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem((*dest));
		decRef__AT1eRuflKWyTTBdLjEDZbgsystem(T10_);
	}
	LA8_: ;
	(*dest) = src;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, paramStr__T0ST6UXXTEqaiXY9akIayng)(NI i) {
	NimStringDesc* result;
	tyObject_IndexDefect__n6tGEPHKkh7E1AP9bj30WrQ* T7_;
{	result = (NimStringDesc*)0;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (i < ((NI) (cmdCount)));
		if (!(T3_)) goto LA4_;
		T3_ = (((NI) 0) <= i);
		LA4_: ;
		if (!T3_) goto LA5_;
		result = cstrToNimstr(cmdLine[i]);
		goto BeforeRet_;
	}
	LA5_: ;
	T7_ = (tyObject_IndexDefect__n6tGEPHKkh7E1AP9bj30WrQ*)0;
	T7_ = (tyObject_IndexDefect__n6tGEPHKkh7E1AP9bj30WrQ*) newObj((&NTI__RJnHOb9cQV3neNC9cDkRgMyw_), sizeof(tyObject_IndexDefect__n6tGEPHKkh7E1AP9bj30WrQ));
	(*T7_).Sup.Sup.Sup.m_type = (&NTI__n6tGEPHKkh7E1AP9bj30WrQ_);
	(*T7_).Sup.Sup.name = "IndexDefect";
	{
		NimStringDesc* T12_;
		if (!((NI32)(cmdCount - ((NI32) 1)) < ((NI32) 0))) goto LA10_;
		T12_ = (NimStringDesc*)0;
		T12_ = (*T7_).Sup.Sup.message; (*T7_).Sup.Sup.message = copyStringRC1(((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_3));
		if (T12_) nimGCunrefNoCycle(T12_);
	}
	goto LA8_;
	LA10_: ;
	{
		NimStringDesc* T14_;
		NimStringDesc* T15_;
		NimStringDesc* T16_;
		T14_ = (NimStringDesc*)0;
		T15_ = (NimStringDesc*)0;
		T15_ = nimIntToStr(i);
		T16_ = (NimStringDesc*)0;
		T16_ = nimIntToStr(((NI) ((NI32)(cmdCount - ((NI32) 1)))));
		T14_ = rawNewString((T15_ ? T15_->Sup.len : 0) + (T16_ ? T16_->Sup.len : 0) + 19);
appendString(T14_, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_4));
appendString(T14_, T15_);
appendString(T14_, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_5));
appendString(T14_, T16_);
		asgnRef((void**) (&(*T7_).Sup.Sup.message), T14_);
	}
	LA8_: ;
	asgnRef((void**) (&(*T7_).Sup.Sup.parent), NIM_NIL);
	raiseExceptionEx((Exception*)T7_, "IndexDefect", "paramStr", "os.nim", 2783);
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nospquoteShellPosix)(NimStringDesc* s) {
	NimStringDesc* result;
	NIM_BOOL safe;
{	result = (NimStringDesc*)0;
	{
		if (!((s ? s->Sup.len : 0) == ((NI) 0))) goto LA3_;
		result = copyString(((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_6));
		goto BeforeRet_;
	}
	LA3_: ;
	safe = allCharsInSet__dubrHoRt3C9a0HlJjsxM5ig(s, TM__yu6cxgKBBXbNsTkT9cyMd4g_7);
	{
		if (!safe) goto LA7_;
		result = copyString(s);
		goto BeforeRet_;
	}
	goto LA5_;
	LA7_: ;
	{
		NimStringDesc* T10_;
		NimStringDesc* T11_;
		T10_ = (NimStringDesc*)0;
		T11_ = (NimStringDesc*)0;
		T11_ = nsuReplaceStr(s, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_8), ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_9));
		T10_ = rawNewString((T11_ ? T11_->Sup.len : 0) + 2);
appendString(T10_, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_8));
appendString(T10_, T11_);
appendString(T10_, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_8));
		result = T10_;
		goto BeforeRet_;
	}
	LA5_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nospquoteShell)(NimStringDesc* s) {
	NimStringDesc* result;
{	result = (NimStringDesc*)0;
	result = nospquoteShellPosix(s);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosunixToNativePath)(NimStringDesc* path, NimStringDesc* drive) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = copyString(path);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, quoteShellCommand__hx0vnRJdI6UdpIN1CeQHNw)(NimStringDesc** args, NI argsLen_0) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = ((NimStringDesc*) NIM_NIL);
	{
		NI i;
		NI colontmp_;
		NI i_2;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = argsLen_0;
		i_2 = ((NI) 0);
		{
			while (1) {
				NimStringDesc* T8_;
				if (!(i_2 < colontmp_)) goto LA3;
				i = i_2;
				{
					if (!(((NI) 0) < i)) goto LA6_;
					result = resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_10));
				}
				LA6_: ;
				T8_ = (NimStringDesc*)0;
				T8_ = nospquoteShell(args[i]);
				result = resizeString(result, (T8_ ? T8_->Sup.len : 0) + 0);
appendString(result, T8_);
				i_2 += ((NI) 1);
			} LA3: ;
		}
	}
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, normalizePathEnd__gKUeJXj8CrWvxdeNCA2BXg)(NimStringDesc** path, NIM_BOOL trailingSep) {
	NI i;
{	{
		if (!(((*path) ? (*path)->Sup.len : 0) == ((NI) 0))) goto LA3_;
		goto BeforeRet_;
	}
	LA3_: ;
	i = ((*path) ? (*path)->Sup.len : 0);
	{
		while (1) {
			if (!(((NI) 1) <= i)) goto LA6;
			{
				if (!(((NU8)((*path)->data[(NI)(i - ((NI) 1))])) == ((NU8)(47)) || ((NU8)((*path)->data[(NI)(i - ((NI) 1))])) == ((NU8)(47)))) goto LA9_;
				i -= ((NI) 1);
			}
			goto LA7_;
			LA9_: ;
			{
				NIM_BOOL T12_;
				NIM_BOOL T13_;
				T12_ = (NIM_BOOL)0;
				T13_ = (NIM_BOOL)0;
				T13_ = ((NU8)((*path)->data[(NI)(i - ((NI) 1))]) == (NU8)(46));
				if (!(T13_)) goto LA14_;
				T13_ = (((NI) 2) <= i);
				LA14_: ;
				T12_ = T13_;
				if (!(T12_)) goto LA15_;
				T12_ = (((NU8)((*path)->data[(NI)(i - ((NI) 2))])) == ((NU8)(47)) || ((NU8)((*path)->data[(NI)(i - ((NI) 2))])) == ((NU8)(47)));
				LA15_: ;
				if (!T12_) goto LA16_;
				i -= ((NI) 1);
			}
			goto LA7_;
			LA16_: ;
			{
				goto LA5;
			}
			LA7_: ;
		} LA6: ;
	} LA5: ;
	{
		if (!trailingSep) goto LA21_;
		unsureAsgnRef((void**) (&(*path)), setLengthStr((*path), ((NI) (i))));
		unsureAsgnRef((void**) (&(*path)), addChar((*path), 47));
	}
	goto LA19_;
	LA21_: ;
	{
		if (!(((NI) 0) < i)) goto LA24_;
		unsureAsgnRef((void**) (&(*path)), setLengthStr((*path), ((NI) (i))));
	}
	goto LA19_;
	LA24_: ;
	{
		unsureAsgnRef((void**) (&(*path)), copyString(((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_11)));
	}
	LA19_: ;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, normalizePathEnd__cQ9bfE8YwK2s9aQkxFkMKhYg)(NimStringDesc* path, NIM_BOOL trailingSep) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = copyString(path);
	normalizePathEnd__gKUeJXj8CrWvxdeNCA2BXg((&result), trailingSep);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, nossplitPath)(NimStringDesc* path, tyTuple__UV3llMMYFckfui8YMBuUZA* Result) {
	NI sepPos;
	unsureAsgnRef((void**)&(*Result).Field0, NIM_NIL);
	unsureAsgnRef((void**)&(*Result).Field1, NIM_NIL);
	sepPos = ((NI) -1);
	{
		NI i;
		NI colontmp_;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (NI)((path ? path->Sup.len : 0) - ((NI) 1));
		res = colontmp_;
		{
			while (1) {
				if (!(((NI) 0) <= res)) goto LA3;
				i = res;
				{
					if (!(((NU8)(path->data[i])) == ((NU8)(47)) || ((NU8)(path->data[i])) == ((NU8)(47)))) goto LA6_;
					sepPos = i;
					goto LA1;
				}
				LA6_: ;
				res -= ((NI) 1);
			} LA3: ;
		}
	} LA1: ;
	{
		NI T12_;
		if (!(((NI) 0) <= sepPos)) goto LA10_;
		T12_ = (NI)0;
		{
			NIM_BOOL T15_;
			T15_ = (NIM_BOOL)0;
			T15_ = NIM_LIKELY((((NI) 1) <= sepPos));
			if (!T15_) goto LA16_;
			T12_ = (NI)(sepPos - ((NI) 1));
		}
		goto LA13_;
		LA16_: ;
		{
			T12_ = ((NI) 0);
		}
		LA13_: ;
		unsureAsgnRef((void**) (&(*Result).Field0), substr__2yh9cer0ymNRHlOOg8P7IuA(path, ((NI) 0), T12_));
		unsureAsgnRef((void**) (&(*Result).Field1), substr__iGg0RIKceRvsmvq8FUHOEw(path, (NI)(sepPos + ((NI) 1))));
	}
	goto LA8_;
	LA10_: ;
	{
		unsureAsgnRef((void**) (&(*Result).Field0), ((NimStringDesc*) NIM_NIL));
		unsureAsgnRef((void**) (&(*Result).Field1), copyString(path));
	}
	LA8_: ;
}
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) {
	void* T1_;
	T1_ = (void*)0;
	T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
	nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosextractFilename)(NimStringDesc* path) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = ((path ? path->Sup.len : 0) == ((NI) 0));
		if (T3_) goto LA4_;
		T3_ = (((NU8)(path->data[(NI)((path ? path->Sup.len : 0) - ((NI) 1))])) == ((NU8)(47)) || ((NU8)(path->data[(NI)((path ? path->Sup.len : 0) - ((NI) 1))])) == ((NU8)(47)));
		LA4_: ;
		if (!T3_) goto LA5_;
		result = ((NimStringDesc*) NIM_NIL);
	}
	goto LA1_;
	LA5_: ;
	{
		tyTuple__UV3llMMYFckfui8YMBuUZA T8_;
		nimZeroMem((void*)(&T8_), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
		nossplitPath(path, (&T8_));
		result = copyString(T8_.Field1);
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, noslastPathPart)(NimStringDesc* path) {
	NimStringDesc* result;
	NimStringDesc* path_2;
	result = (NimStringDesc*)0;
	path_2 = normalizePathEnd__cQ9bfE8YwK2s9aQkxFkMKhYg(path, NIM_FALSE);
	result = nosextractFilename(path_2);
	return result;
}
static N_INLINE(NIM_CHAR, X5BX5D___okzHJ6GE9cv0bYG3b4r5KCAsystem)(NimStringDesc* s, NI i) {
	NIM_CHAR result;
	result = (NIM_CHAR)0;
	result = s->data[(NI)((s ? s->Sup.len : 0) - i)];
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, joinPathImpl__zwiv42T0z9bOei4bjr58A9cA)(NimStringDesc** result, NI* state, NimStringDesc* tail) {
	NIM_BOOL trailingSep;
	NIM_BOOL T1_;
	NIM_BOOL T2_;
	NIM_CHAR T4_;
	NIM_BOOL T6_;
	NIM_BOOL T8_;
	NIM_CHAR T10_;
	T1_ = (NIM_BOOL)0;
	T2_ = (NIM_BOOL)0;
	T2_ = (((NI) 0) < (tail ? tail->Sup.len : 0));
	if (!(T2_)) goto LA3_;
	T4_ = (NIM_CHAR)0;
	T4_ = X5BX5D___okzHJ6GE9cv0bYG3b4r5KCAsystem(tail, ((NI) 1));
	T2_ = (((NU8)(T4_)) == ((NU8)(47)) || ((NU8)(T4_)) == ((NU8)(47)));
	LA3_: ;
	T1_ = T2_;
	if (T1_) goto LA5_;
	T6_ = (NIM_BOOL)0;
	T6_ = ((tail ? tail->Sup.len : 0) == ((NI) 0));
	if (!(T6_)) goto LA7_;
	T8_ = (NIM_BOOL)0;
	T8_ = (((NI) 0) < ((*result) ? (*result)->Sup.len : 0));
	if (!(T8_)) goto LA9_;
	T10_ = (NIM_CHAR)0;
	T10_ = X5BX5D___okzHJ6GE9cv0bYG3b4r5KCAsystem((*result), ((NI) 1));
	T8_ = (((NU8)(T10_)) == ((NU8)(47)) || ((NU8)(T10_)) == ((NU8)(47)));
	LA9_: ;
	T6_ = T8_;
	LA7_: ;
	T1_ = T6_;
	LA5_: ;
	trailingSep = T1_;
	normalizePathEnd__gKUeJXj8CrWvxdeNCA2BXg(result, NIM_FALSE);
	addNormalizePath__bx9csIXjBBeHkYSkIUixO1g(tail, result, state, 47);
	normalizePathEnd__gKUeJXj8CrWvxdeNCA2BXg(result, trailingSep);
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosjoinPath)(NimStringDesc* head, NimStringDesc* tail) {
	NimStringDesc* result;
	NI state;
	result = (NimStringDesc*)0;
	result = rawNewString(((NI) ((NI)((head ? head->Sup.len : 0) + (tail ? tail->Sup.len : 0)))));
	state = ((NI) 0);
	joinPathImpl__zwiv42T0z9bOei4bjr58A9cA((&result), (&state), head);
	joinPathImpl__zwiv42T0z9bOei4bjr58A9cA((&result), (&state), tail);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, slash___gEyhbzZ1UcxyenWRLJRXNQ)(NimStringDesc* head, NimStringDesc* tail) {
	NimStringDesc* result;
{	result = (NimStringDesc*)0;
	result = nosjoinPath(head, tail);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NIM_BOOL, eqeq___aqip9cmQIuefPKdd25wuEEwsystem)(NCSTRING x, NCSTRING y) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	{
		if (!(((void*) (x)) == ((void*) (y)))) goto LA3_;
		result = NIM_TRUE;
	}
	goto LA1_;
	LA3_: ;
	{
		NIM_BOOL T6_;
		T6_ = (NIM_BOOL)0;
		T6_ = (x == 0);
		if (T6_) goto LA7_;
		T6_ = (y == 0);
		LA7_: ;
		if (!T6_) goto LA8_;
		result = NIM_FALSE;
	}
	goto LA1_;
	LA8_: ;
	{
		int T11_;
		T11_ = (int)0;
		T11_ = strcmp(x, y);
		result = (T11_ == ((NI32) 0));
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, getEnvVarsC__580467zYn32AEdYj9cD4LLA)(void) {
	{
		NI i;
		if (!!(envComputed__LLyFo9bsdu1ZXMDvAe8DhrQ)) goto LA3_;
		if (environment__mlhK49b6YMgc9cgrcYkKq9a3g) { nimGCunrefNoCycle(environment__mlhK49b6YMgc9cgrcYkKq9a3g); environment__mlhK49b6YMgc9cgrcYkKq9a3g = NIM_NIL; }
		i = ((NI) 0);
		{
			while (1) {
				NIM_BOOL T7_;
				NimStringDesc* T8_;
				NI T9_;
				NimStringDesc* T10_;
				T7_ = (NIM_BOOL)0;
				T7_ = eqeq___aqip9cmQIuefPKdd25wuEEwsystem(environ[i], NIM_NIL);
				if (!!(T7_)) goto LA6;
				T8_ = (NimStringDesc*)0;
				T8_ = cstrToNimstr(environ[i]);
				asgnRef((void**) (&environment__mlhK49b6YMgc9cgrcYkKq9a3g), (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV3((TGenericSeq*)(environment__mlhK49b6YMgc9cgrcYkKq9a3g), (&NTI__sM4lkSb7zS6F7OVMvW9cffQ_)));
				T9_ = environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len++;
				T10_ = (NimStringDesc*)0;
				T10_ = environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[T9_]; environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[T9_] = copyStringRC1(T8_);
				if (T10_) nimGCunrefNoCycle(T10_);
				i += ((NI) 1);
			} LA6: ;
		}
		envComputed__LLyFo9bsdu1ZXMDvAe8DhrQ = NIM_TRUE;
	}
	LA3_: ;
}
static N_INLINE(void, appendChar)(NimStringDesc* dest, NIM_CHAR c) {
	(*dest).data[(*dest).Sup.len] = c;
	(*dest).data[(NI)((*dest).Sup.len + ((NI) 1))] = 0;
	(*dest).Sup.len += ((NI) 1);
}
N_LIB_PRIVATE N_NIMCALL(NI, findEnvVar__4kc4cxzsC7aY1IOKtOGazA)(NimStringDesc* key) {
	NI result;
	NimStringDesc* temp;
	NimStringDesc* T1_;
{	result = (NI)0;
	getEnvVarsC__580467zYn32AEdYj9cD4LLA();
	T1_ = (NimStringDesc*)0;
	T1_ = rawNewString((key ? key->Sup.len : 0) + 1);
appendString(T1_, key);
appendChar(T1_, 61);
	temp = T1_;
	{
		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) {
				if (!(res <= colontmp_)) goto LA5;
				i = res;
				{
					NIM_BOOL T8_;
					T8_ = (NIM_BOOL)0;
					T8_ = nsuStartsWith(environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[i], temp);
					if (!T8_) goto LA9_;
					result = i;
					goto BeforeRet_;
				}
				LA9_: ;
				res += ((NI) 1);
			} LA5: ;
		}
	}
	result = ((NI) -1);
	goto BeforeRet_;
	}BeforeRet_: ;
	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(NimStringDesc*, getEnv__hhED57tMl0Iaa5bOg9cJaig)(NimStringDesc* key, NimStringDesc* default_0) {
	NimStringDesc* result;
	NI i;
{	result = (NimStringDesc*)0;
	i = findEnvVar__4kc4cxzsC7aY1IOKtOGazA(key);
	{
		NimStringDesc* T5_;
		NI T6_;
		if (!(((NI) 0) <= i)) goto LA3_;
		T5_ = (NimStringDesc*)0;
		T5_ = environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[i];
		T6_ = (NI)0;
		T6_ = nsuFindChar(environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[i], 61, ((NI) 0), ((NI) 0));
		result = substr__iGg0RIKceRvsmvq8FUHOEw(T5_, (NI)(T6_ + ((NI) 1)));
		goto BeforeRet_;
	}
	goto LA1_;
	LA3_: ;
	{
		NCSTRING env;
		env = getenv(nimToCStringConv(key));
		{
			NIM_BOOL T10_;
			T10_ = (NIM_BOOL)0;
			T10_ = eqeq___aqip9cmQIuefPKdd25wuEEwsystem(env, NIM_NIL);
			if (!T10_) goto LA11_;
			result = copyString(default_0);
			goto BeforeRet_;
		}
		LA11_: ;
		result = cstrToNimstr(env);
	}
	LA1_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosgetHomeDir)(void) {
	NimStringDesc* result;
	NimStringDesc* T1_;
	NimStringDesc* T2_;
{	result = (NimStringDesc*)0;
	T1_ = (NimStringDesc*)0;
	T2_ = (NimStringDesc*)0;
	T2_ = getEnv__hhED57tMl0Iaa5bOg9cJaig(((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_12), ((NimStringDesc*) NIM_NIL));
	T1_ = rawNewString((T2_ ? T2_->Sup.len : 0) + 1);
appendString(T1_, T2_);
appendString(T1_, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_11));
	result = T1_;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, noscmpPaths)(NimStringDesc* pathA, NimStringDesc* pathB) {
	NI result;
	NimStringDesc* a;
	NimStringDesc* b;
	result = (NI)0;
	a = normalizePath__gol9aBbIZpJYUPc6xBOBJDQ(pathA, 47);
	b = normalizePath__gol9aBbIZpJYUPc6xBOBJDQ(pathB, 47);
	{
		if (!NIM_TRUE) goto LA3_;
		result = cmp__NAicU5bAGXmkx2NJujGi7g(a, b);
	}
	goto LA1_;
	LA3_: ;
	{
		result = nsuCmpIgnoreCase(a, b);
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, nossplitFile)(NimStringDesc* path, tyTuple__7q7q3E6Oj24ZNVJb9aonhAg* Result) {
	NI namePos;
	NI dotPos;
	unsureAsgnRef((void**)&(*Result).Field0, NIM_NIL);
	unsureAsgnRef((void**)&(*Result).Field1, NIM_NIL);
	unsureAsgnRef((void**)&(*Result).Field2, NIM_NIL);
	namePos = ((NI) 0);
	dotPos = ((NI) 0);
	{
		NI i;
		NI colontmp_;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (NI)((path ? path->Sup.len : 0) - ((NI) 1));
		res = colontmp_;
		{
			while (1) {
				if (!(((NI) 0) <= res)) goto LA3;
				i = res;
				{
					NIM_BOOL T6_;
					T6_ = (NIM_BOOL)0;
					T6_ = (((NU8)(path->data[i])) == ((NU8)(47)) || ((NU8)(path->data[i])) == ((NU8)(47)));
					if (T6_) goto LA7_;
					T6_ = (i == ((NI) 0));
					LA7_: ;
					if (!T6_) goto LA8_;
					{
						NI T14_;
						if (!(((NU8)(path->data[i])) == ((NU8)(47)) || ((NU8)(path->data[i])) == ((NU8)(47)))) goto LA12_;
						T14_ = (NI)0;
						{
							NIM_BOOL T17_;
							T17_ = (NIM_BOOL)0;
							T17_ = NIM_LIKELY((((NI) 1) <= i));
							if (!T17_) goto LA18_;
							T14_ = (NI)(i - ((NI) 1));
						}
						goto LA15_;
						LA18_: ;
						{
							T14_ = ((NI) 0);
						}
						LA15_: ;
						unsureAsgnRef((void**) (&(*Result).Field0), substr__2yh9cer0ymNRHlOOg8P7IuA(path, ((NI) 0), T14_));
						namePos = (NI)(i + ((NI) 1));
					}
					LA12_: ;
					{
						if (!(i < dotPos)) goto LA23_;
						unsureAsgnRef((void**) (&(*Result).Field1), substr__2yh9cer0ymNRHlOOg8P7IuA(path, namePos, (NI)(dotPos - ((NI) 1))));
						unsureAsgnRef((void**) (&(*Result).Field2), substr__iGg0RIKceRvsmvq8FUHOEw(path, dotPos));
					}
					goto LA21_;
					LA23_: ;
					{
						unsureAsgnRef((void**) (&(*Result).Field1), substr__iGg0RIKceRvsmvq8FUHOEw(path, namePos));
					}
					LA21_: ;
					goto LA1;
				}
				goto LA4_;
				LA8_: ;
				{
					NIM_BOOL T27_;
					NIM_BOOL T28_;
					NIM_BOOL T29_;
					NIM_BOOL T30_;
					NIM_BOOL T31_;
					T27_ = (NIM_BOOL)0;
					T28_ = (NIM_BOOL)0;
					T29_ = (NIM_BOOL)0;
					T30_ = (NIM_BOOL)0;
					T31_ = (NIM_BOOL)0;
					T31_ = ((NU8)(path->data[i]) == (NU8)(46));
					if (!(T31_)) goto LA32_;
					T31_ = (((NI) 0) < i);
					LA32_: ;
					T30_ = T31_;
					if (!(T30_)) goto LA33_;
					T30_ = (i < (NI)((path ? path->Sup.len : 0) - ((NI) 1)));
					LA33_: ;
					T29_ = T30_;
					if (!(T29_)) goto LA34_;
					T29_ = !((((NU8)(path->data[(NI)(i - ((NI) 1))])) == ((NU8)(47)) || ((NU8)(path->data[(NI)(i - ((NI) 1))])) == ((NU8)(47))));
					LA34_: ;
					T28_ = T29_;
					if (!(T28_)) goto LA35_;
					T28_ = !(((NU8)(path->data[(NI)(i + ((NI) 1))]) == (NU8)(46)));
					LA35_: ;
					T27_ = T28_;
					if (!(T27_)) goto LA36_;
					T27_ = (dotPos == ((NI) 0));
					LA36_: ;
					if (!T27_) goto LA37_;
					dotPos = i;
				}
				goto LA4_;
				LA37_: ;
				LA4_: ;
				res -= ((NI) 1);
			} LA3: ;
		}
	} LA1: ;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosisAbsolute)(NimStringDesc* path) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	{
		if (!((path ? path->Sup.len : 0) == ((NI) 0))) goto LA3_;
		result = NIM_FALSE;
		goto BeforeRet_;
	}
	LA3_: ;
	result = ((NU8)(path->data[((NI) 0)]) == (NU8)(47));
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, expandTilde__RmQRR8GLDFICboxWoCEpMw)(NimStringDesc* path) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = ((path ? path->Sup.len : 0) == ((NI) 0));
		if (T3_) goto LA4_;
		T3_ = !(((NU8)(path->data[((NI) 0)]) == (NU8)(126)));
		LA4_: ;
		if (!T3_) goto LA5_;
		result = copyString(path);
	}
	goto LA1_;
	LA5_: ;
	{
		if (!((path ? path->Sup.len : 0) == ((NI) 1))) goto LA8_;
		result = nosgetHomeDir();
	}
	goto LA1_;
	LA8_: ;
	{
		NimStringDesc* T13_;
		NimStringDesc* T14_;
		if (!(((NU8)(path->data[((NI) 1)])) == ((NU8)(47)) || ((NU8)(path->data[((NI) 1)])) == ((NU8)(47)))) goto LA11_;
		T13_ = (NimStringDesc*)0;
		T13_ = nosgetHomeDir();
		T14_ = (NimStringDesc*)0;
		T14_ = substr__iGg0RIKceRvsmvq8FUHOEw(path, ((NI) 2));
		result = slash___gEyhbzZ1UcxyenWRLJRXNQ(T13_, T14_);
	}
	goto LA1_;
	LA11_: ;
	{
		result = copyString(path);
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, getApplAux__wpMsAlcjbgVsRya70vX0Ug)(NimStringDesc* procPath) {
	NimStringDesc* result;
	NI len;
	result = (NimStringDesc*)0;
	result = mnewString(((NI) 256));
	len = readlink(nimToCStringConv(procPath), nimToCStringConv(result), ((NI) 256));
	{
		if (!(((NI) 256) < len)) goto LA3_;
		result = mnewString(((NI) ((NI)(len + ((NI) 1)))));
		len = readlink(nimToCStringConv(procPath), nimToCStringConv(result), len);
	}
	LA3_: ;
	result = setLengthStr(result, ((NI) (len)));
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosfileExists)(NimStringDesc* filename) {
	NIM_BOOL result;
	struct stat res;
	NIM_BOOL T1_;
	int T2_;
{	result = (NIM_BOOL)0;
	nimZeroMem((void*)(&res), sizeof(struct stat));
	T1_ = (NIM_BOOL)0;
	T2_ = (int)0;
	T2_ = stat(nimToCStringConv(filename), (&res));
	T1_ = (((NI32) 0) <= T2_);
	if (!(T1_)) goto LA3_;
	T1_ = S_ISREG(res.st_mode);
	LA3_: ;
	result = T1_;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, getApplHeuristic__9bfzMt7nzg9apH9cE9c5SozLJw)(void) {
	NimStringDesc* result;
{	result = (NimStringDesc*)0;
	result = paramStr__T0ST6UXXTEqaiXY9akIayng(((NI) 0));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (((NI) 0) < (result ? result->Sup.len : 0));
		if (!(T3_)) goto LA4_;
		T3_ = !(((NU8)(result->data[((NI) 0)]) == (NU8)(47)));
		LA4_: ;
		if (!T3_) goto LA5_;
		{
			NimStringDesc* p;
			NimStringDesc* colontmp_;
			NI lastX60gensym29_;
			NI splitsX60gensym29_;
			p = (NimStringDesc*)0;
			colontmp_ = (NimStringDesc*)0;
			colontmp_ = getEnv__hhED57tMl0Iaa5bOg9cJaig(((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_15), ((NimStringDesc*) NIM_NIL));
			lastX60gensym29_ = ((NI) 0);
			splitsX60gensym29_ = ((NI) -1);
			{
				while (1) {
					NI firstX60gensym29_;
					NimStringDesc* x;
					if (!(lastX60gensym29_ <= (colontmp_ ? colontmp_->Sup.len : 0))) goto LA9;
					firstX60gensym29_ = lastX60gensym29_;
					{
						while (1) {
							NIM_BOOL T12_;
							T12_ = (NIM_BOOL)0;
							T12_ = (lastX60gensym29_ < (colontmp_ ? colontmp_->Sup.len : 0));
							if (!(T12_)) goto LA13_;
							T12_ = !((((NU8)(colontmp_->data[lastX60gensym29_])) == ((NU8)(58))));
							LA13_: ;
							if (!T12_) goto LA11;
							lastX60gensym29_ += ((NI) 1);
						} LA11: ;
					}
					{
						if (!(splitsX60gensym29_ == ((NI) 0))) goto LA16_;
						lastX60gensym29_ = (colontmp_ ? colontmp_->Sup.len : 0);
					}
					LA16_: ;
					p = substr__2yh9cer0ymNRHlOOg8P7IuA(colontmp_, firstX60gensym29_, (NI)(lastX60gensym29_ - ((NI) 1)));
					x = nosjoinPath(p, result);
					{
						NIM_BOOL T20_;
						T20_ = (NIM_BOOL)0;
						T20_ = nosfileExists(x);
						if (!T20_) goto LA21_;
						result = copyString(x);
						goto BeforeRet_;
					}
					LA21_: ;
					{
						if (!(splitsX60gensym29_ == ((NI) 0))) goto LA25_;
						goto LA8;
					}
					LA25_: ;
					splitsX60gensym29_ -= ((NI) 1);
					lastX60gensym29_ += ((NI) 1);
				} LA9: ;
			} LA8: ;
		}
	}
	LA5_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosgetAppFilename)(void) {
	NimStringDesc* result;
	NimStringDesc* T1_;
	pid_t T2_;
	NimStringDesc* T3_;
	result = (NimStringDesc*)0;
	T1_ = (NimStringDesc*)0;
	T2_ = (pid_t)0;
	T2_ = getpid();
	T3_ = (NimStringDesc*)0;
	T3_ = nimIntToStr(((NI) (T2_)));
	T1_ = rawNewString((T3_ ? T3_->Sup.len : 0) + 17);
appendString(T1_, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_13));
appendString(T1_, T3_);
appendString(T1_, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_14));
	result = getApplAux__wpMsAlcjbgVsRya70vX0Ug(T1_);
	{
		if (!((result ? result->Sup.len : 0) == ((NI) 0))) goto LA6_;
		result = getApplHeuristic__9bfzMt7nzg9apH9cE9c5SozLJw();
	}
	LA6_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosgetAppDir)(void) {
	NimStringDesc* result;
	NimStringDesc* T1_;
	tyTuple__7q7q3E6Oj24ZNVJb9aonhAg T2_;
	result = (NimStringDesc*)0;
	T1_ = (NimStringDesc*)0;
	T1_ = nosgetAppFilename();
	nimZeroMem((void*)(&T2_), sizeof(tyTuple__7q7q3E6Oj24ZNVJb9aonhAg));
	nossplitFile(T1_, (&T2_));
	result = copyString(T2_.Field0);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI32, osLastError__9bUWNxbcGnToMWA9b79aTXLIw)(void) {
	NI32 result;
	result = (NI32)0;
	result = errno;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, osErrorMsg__33xViSVWAmDrexoKkLfMhg)(NI32 errorCode) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = ((NimStringDesc*) NIM_NIL);
	{
		NCSTRING T5_;
		if (!!((errorCode == ((NI32) 0)))) goto LA3_;
		T5_ = (NCSTRING)0;
		T5_ = strerror(errorCode);
		result = cstrToNimstr(T5_);
	}
	LA3_: ;
	return result;
}
N_LIB_PRIVATE N_NOINLINE(tyObject_OSError__BeJgrOdDsczOwEWOZbRfKA*, newOSError__JXEuze9ctNbkn51HYBflQLg)(NI32 errorCode, NimStringDesc* additionalInfo) {
	tyObject_OSError__BeJgrOdDsczOwEWOZbRfKA* result;
	tyObject_OSError__BeJgrOdDsczOwEWOZbRfKA* e;
{	result = (tyObject_OSError__BeJgrOdDsczOwEWOZbRfKA*)0;
	e = (tyObject_OSError__BeJgrOdDsczOwEWOZbRfKA*)0;
	e = (tyObject_OSError__BeJgrOdDsczOwEWOZbRfKA*) newObj((&NTI__9clYsYwyjCqe2PFTuCI3Ubg_), sizeof(tyObject_OSError__BeJgrOdDsczOwEWOZbRfKA));
	(*e).Sup.Sup.Sup.m_type = (&NTI__BeJgrOdDsczOwEWOZbRfKA_);
	(*e).Sup.Sup.name = "OSError";
	(*e).errorCode = errorCode;
	asgnRef((void**) (&(*e).Sup.Sup.message), osErrorMsg__33xViSVWAmDrexoKkLfMhg(errorCode));
	{
		if (!(((NI) 0) < (additionalInfo ? additionalInfo->Sup.len : 0))) goto LA3_;
		{
			NIM_BOOL T7_;
			NIM_CHAR T9_;
			T7_ = (NIM_BOOL)0;
			T7_ = (((NI) 0) < ((*e).Sup.Sup.message ? (*e).Sup.Sup.message->Sup.len : 0));
			if (!(T7_)) goto LA8_;
			T9_ = (NIM_CHAR)0;
			T9_ = X5BX5D___okzHJ6GE9cv0bYG3b4r5KCAsystem((*e).Sup.Sup.message, ((NI) 1));
			T7_ = !(((NU8)(T9_) == (NU8)(10)));
			LA8_: ;
			if (!T7_) goto LA10_;
			asgnRef((void**) (&(*e).Sup.Sup.message), addChar((*e).Sup.Sup.message, 10));
		}
		LA10_: ;
		asgnRef((void**) (&(*e).Sup.Sup.message), resizeString((*e).Sup.Sup.message, 17));
appendString((*e).Sup.Sup.message, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_17));
		addQuoted__45fPtFhY4FavRaYwDhRfuA((&(*e).Sup.Sup.message), additionalInfo);
	}
	LA3_: ;
	{
		NimStringDesc* T16_;
		if (!(((*e).Sup.Sup.message ? (*e).Sup.Sup.message->Sup.len : 0) == 0)) goto LA14_;
		T16_ = (NimStringDesc*)0;
		T16_ = (*e).Sup.Sup.message; (*e).Sup.Sup.message = copyStringRC1(((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_18));
		if (T16_) nimGCunrefNoCycle(T16_);
	}
	LA14_: ;
	result = e;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NOINLINE(void, raiseOSError__CWyPYlyH9a6rAuZckFyVxPA)(NI32 errorCode, NimStringDesc* additionalInfo) {
	tyObject_OSError__BeJgrOdDsczOwEWOZbRfKA* T1_;
	T1_ = (tyObject_OSError__BeJgrOdDsczOwEWOZbRfKA*)0;
	T1_ = newOSError__JXEuze9ctNbkn51HYBflQLg(errorCode, additionalInfo);
	raiseExceptionEx((Exception*)T1_, "OSError", "raiseOSError", "oserr.nim", 94);
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosgetCurrentDir)(void) {
	NimStringDesc* result;
	NI bufsize;
	result = (NimStringDesc*)0;
	bufsize = ((NI) 1024);
	result = mnewString(((NI) (bufsize)));
	{
		while (1) {
			{
				NCSTRING T5_;
				NIM_BOOL T6_;
				int T9_;
				T5_ = (NCSTRING)0;
				T5_ = getcwd(nimToCStringConv(result), bufsize);
				T6_ = (NIM_BOOL)0;
				T6_ = eqeq___aqip9cmQIuefPKdd25wuEEwsystem(T5_, NIM_NIL);
				if (!!(T6_)) goto LA7_;
				T9_ = (int)0;
				T9_ = strlen(nimToCStringConv(result));
				result = setLengthStr(result, ((NI) (T9_)));
				goto LA1;
			}
			goto LA3_;
			LA7_: ;
			{
				NI32 err;
				err = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
				{
					if (!(err == ERANGE)) goto LA13_;
					bufsize = (NI)((NU64)(bufsize) << (NU64)(((NI) 1)));
					{
						if (!!((((NI) 0) <= bufsize))) goto LA17_;
						failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_16));
					}
					LA17_: ;
					result = mnewString(((NI) (bufsize)));
				}
				goto LA11_;
				LA13_: ;
				{
					NI32 T20_;
					T20_ = (NI32)0;
					T20_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
					raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T20_, ((NimStringDesc*) NIM_NIL));
				}
				LA11_: ;
			}
			LA3_: ;
		}
	} LA1: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg, getSymlinkFileKind__wTnLPNAWjgwVnuiJ9ax0ZGQ)(NimStringDesc* path) {
	tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg result;
	struct stat s;
	result = (tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg)0;
	nimZeroMem((void*)(&s), sizeof(struct stat));
	{
		NIM_BOOL T3_;
		int T4_;
		T3_ = (NIM_BOOL)0;
		T4_ = (int)0;
		T4_ = stat(nimToCStringConv(path), (&s));
		T3_ = (T4_ == ((NI32) 0));
		if (!(T3_)) goto LA5_;
		T3_ = S_ISDIR(s.st_mode);
		LA5_: ;
		if (!T3_) goto LA6_;
		result = ((tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg) 3);
	}
	goto LA1_;
	LA6_: ;
	{
		result = ((tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg) 1);
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosexpandFilename)(NimStringDesc* filename) {
	NimStringDesc* result;
	NCSTRING r;
	result = (NimStringDesc*)0;
	r = realpath(nimToCStringConv(filename), NIM_NIL);
	{
		NI32 T5_;
		if (!(r == 0)) goto LA3_;
		T5_ = (NI32)0;
		T5_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
		raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T5_, filename);
	}
	goto LA1_;
	LA3_: ;
	{
		result = cstrToNimstr(r);
		free(((void*) (r)));
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, parentDirPos__sw9aya5BvknC6WiJX9aEYn9ag)(NimStringDesc* path) {
	NI result;
	NI q;
{	result = (NI)0;
	q = ((NI) 1);
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (((NI) 1) <= (path ? path->Sup.len : 0));
		if (!(T3_)) goto LA4_;
		T3_ = (((NU8)(path->data[(NI)((path ? path->Sup.len : 0) - ((NI) 1))])) == ((NU8)(47)) || ((NU8)(path->data[(NI)((path ? path->Sup.len : 0) - ((NI) 1))])) == ((NU8)(47)));
		LA4_: ;
		if (!T3_) goto LA5_;
		q = ((NI) 2);
	}
	LA5_: ;
	{
		NI i;
		NI colontmp_;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (NI)((path ? path->Sup.len : 0) - q);
		res = colontmp_;
		{
			while (1) {
				if (!(((NI) 0) <= res)) goto LA9;
				i = res;
				{
					if (!(((NU8)(path->data[i])) == ((NU8)(47)) || ((NU8)(path->data[i])) == ((NU8)(47)))) goto LA12_;
					result = i;
					goto BeforeRet_;
				}
				LA12_: ;
				res -= ((NI) 1);
			} LA9: ;
		}
	}
	result = ((NI) -1);
	}BeforeRet_: ;
	return result;
}
static N_INLINE(int, nimCmpMem)(void* a, void* b, NI size) {
	int result;
	result = (int)0;
	result = memcmp(a, b, ((size_t) (size)));
	return result;
}
static N_INLINE(NIM_BOOL, equalMem__9bGgqEk7RXXl6eqM9c1HdELAsystem)(void* a, void* b, NI size) {
	NIM_BOOL result;
	int T1_;
	result = (NIM_BOOL)0;
	T1_ = (int)0;
	T1_ = nimCmpMem(a, b, size);
	result = (T1_ == ((NI32) 0));
	return result;
}
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b) {
	NIM_BOOL result;
	NI alen;
	NI blen;
{	result = (NIM_BOOL)0;
	alen = (a ? a->Sup.len : 0);
	blen = (b ? b->Sup.len : 0);
	{
		if (!(alen == blen)) goto LA3_;
		{
			if (!(alen == ((NI) 0))) goto LA7_;
			result = NIM_TRUE;
			goto BeforeRet_;
		}
		LA7_: ;
		result = equalMem__9bGgqEk7RXXl6eqM9c1HdELAsystem(((void*) ((&a->data[((NI) 0)]))), ((void*) ((&b->data[((NI) 0)]))), ((NI) (alen)));
		goto BeforeRet_;
	}
	LA3_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosparentDir)(NimStringDesc* path) {
	NimStringDesc* result;
	NI sepPos;
	result = (NimStringDesc*)0;
	result = normalizePath__gol9aBbIZpJYUPc6xBOBJDQ(path, 47);
	sepPos = parentDirPos__sw9aya5BvknC6WiJX9aEYn9ag(result);
	{
		if (!(((NI) 0) <= sepPos)) goto LA3_;
		result = substr__2yh9cer0ymNRHlOOg8P7IuA(result, ((NI) 0), sepPos);
		normalizePathEnd__gKUeJXj8CrWvxdeNCA2BXg((&result), NIM_FALSE);
	}
	goto LA1_;
	LA3_: ;
	{
		NIM_BOOL T6_;
		NIM_BOOL T7_;
		NIM_BOOL T8_;
		NIM_CHAR T12_;
		T6_ = (NIM_BOOL)0;
		T7_ = (NIM_BOOL)0;
		T8_ = (NIM_BOOL)0;
		T8_ = eqStrings(result, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_19));
		if (T8_) goto LA9_;
		T8_ = eqStrings(result, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_20));
		LA9_: ;
		T7_ = T8_;
		if (T7_) goto LA10_;
		T7_ = ((result ? result->Sup.len : 0) == ((NI) 0));
		LA10_: ;
		T6_ = T7_;
		if (T6_) goto LA11_;
		T12_ = (NIM_CHAR)0;
		T12_ = X5BX5D___okzHJ6GE9cv0bYG3b4r5KCAsystem(result, ((NI) 1));
		T6_ = (((NU8)(T12_)) == ((NU8)(47)) || ((NU8)(T12_)) == ((NU8)(47)));
		LA11_: ;
		if (!T6_) goto LA13_;
		result = ((NimStringDesc*) NIM_NIL);
	}
	goto LA1_;
	LA13_: ;
	{
		result = copyString(((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_20));
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, rawCreateDir__GHseAa61lv8Sp9b2kQD9baYQ)(NimStringDesc* dir) {
	NIM_BOOL result;
	int res;
	result = (NIM_BOOL)0;
	res = mkdir(nimToCStringConv(dir), ((mode_t) 511));
	{
		if (!(res == ((NI32) 0))) goto LA3_;
		result = NIM_TRUE;
	}
	goto LA1_;
	LA3_: ;
	{
		if (!(errno == ((NI) (EEXIST)) || errno == ((NI) (ENOSYS)))) goto LA6_;
		result = NIM_FALSE;
	}
	goto LA1_;
	LA6_: ;
	{
		NI32 T9_;
		T9_ = (NI32)0;
		T9_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
		raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T9_, dir);
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosdirExists)(NimStringDesc* dir) {
	NIM_BOOL result;
	struct stat res;
	NIM_BOOL T1_;
	int T2_;
{	result = (NIM_BOOL)0;
	nimZeroMem((void*)(&res), sizeof(struct stat));
	T1_ = (NIM_BOOL)0;
	T2_ = (int)0;
	T2_ = stat(nimToCStringConv(dir), (&res));
	T1_ = (((NI32) 0) <= T2_);
	if (!(T1_)) goto LA3_;
	T1_ = S_ISDIR(res.st_mode);
	LA3_: ;
	result = T1_;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosexistsOrCreateDir)(NimStringDesc* dir) {
	NIM_BOOL result;
	NIM_BOOL T1_;
	result = (NIM_BOOL)0;
	T1_ = (NIM_BOOL)0;
	T1_ = rawCreateDir__GHseAa61lv8Sp9b2kQD9baYQ(dir);
	result = !(T1_);
	{
		if (!result) goto LA4_;
		{
			NIM_BOOL T8_;
			tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw* T11_;
			NimStringDesc* T12_;
			T8_ = (NIM_BOOL)0;
			T8_ = nosdirExists(dir);
			if (!!(T8_)) goto LA9_;
			T11_ = (tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw*)0;
			T11_ = (tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw*) newObj((&NTI__HMIVdYjdZYWskTmTQVo5BQ_), sizeof(tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw));
			(*T11_).Sup.Sup.Sup.m_type = (&NTI__iLZrPn9anoh9ad1MmO0RczFw_);
			(*T11_).Sup.Sup.name = "IOError";
			T12_ = (NimStringDesc*)0;
			T12_ = rawNewString((dir ? dir->Sup.len : 0) + 19);
appendString(T12_, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_21));
appendString(T12_, dir);
appendString(T12_, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_8));
			asgnRef((void**) (&(*T11_).Sup.Sup.message), T12_);
			asgnRef((void**) (&(*T11_).Sup.Sup.parent), NIM_NIL);
			raiseExceptionEx((Exception*)T11_, "IOError", "existsOrCreateDir", "os.nim", 2327);
		}
		LA9_: ;
	}
	LA4_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, noscreateDir)(NimStringDesc* dir) {
	NIM_BOOL omitNext;
	omitNext = NIM_FALSE;
	{
		NI i;
		NI colontmp_;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (NI)((dir ? dir->Sup.len : 0) - ((NI) 1));
		res = ((NI) 1);
		{
			while (1) {
				if (!(res <= colontmp_)) goto LA3;
				i = res;
				{
					if (!(((NU8)(dir->data[i])) == ((NU8)(47)) || ((NU8)(dir->data[i])) == ((NU8)(47)))) goto LA6_;
					{
						if (!omitNext) goto LA10_;
						omitNext = NIM_FALSE;
					}
					goto LA8_;
					LA10_: ;
					{
						NimStringDesc* T13_;
						NIM_BOOL T14_;
						T13_ = (NimStringDesc*)0;
						T13_ = substr__2yh9cer0ymNRHlOOg8P7IuA(dir, ((NI) 0), (NI)(i - ((NI) 1)));
						T14_ = (NIM_BOOL)0;
						T14_ = nosexistsOrCreateDir(T13_);
						(void)(T14_);
					}
					LA8_: ;
				}
				LA6_: ;
				res += ((NI) 1);
			} LA3: ;
		}
	}
	{
		NIM_BOOL T17_;
		NIM_BOOL T18_;
		NIM_CHAR T21_;
		NIM_BOOL T24_;
		T17_ = (NIM_BOOL)0;
		T18_ = (NIM_BOOL)0;
		T18_ = (((NI) 0) < (dir ? dir->Sup.len : 0));
		if (!(T18_)) goto LA19_;
		T18_ = !(omitNext);
		LA19_: ;
		T17_ = T18_;
		if (!(T17_)) goto LA20_;
		T21_ = (NIM_CHAR)0;
		T21_ = X5BX5D___okzHJ6GE9cv0bYG3b4r5KCAsystem(dir, ((NI) 1));
		T17_ = !((((NU8)(T21_)) == ((NU8)(47)) || ((NU8)(T21_)) == ((NU8)(47))));
		LA20_: ;
		if (!T17_) goto LA22_;
		T24_ = (NIM_BOOL)0;
		T24_ = nosexistsOrCreateDir(dir);
		(void)(T24_);
	}
	LA22_: ;
}
N_LIB_PRIVATE N_NIMCALL(NI, searchExtPos__sw9aya5BvknC6WiJX9aEYn9ag_2)(NimStringDesc* path) {
	NI result;
	result = (NI)0;
	result = ((NI) -1);
	{
		NI i;
		NI colontmp_;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (NI)((path ? path->Sup.len : 0) - ((NI) 1));
		res = colontmp_;
		{
			while (1) {
				if (!(((NI) 1) <= res)) goto LA3;
				i = res;
				{
					if (!((NU8)(path->data[i]) == (NU8)(46))) goto LA6_;
					result = i;
					goto LA1;
				}
				goto LA4_;
				LA6_: ;
				{
					if (!(((NU8)(path->data[i])) == ((NU8)(47)) || ((NU8)(path->data[i])) == ((NU8)(47)))) goto LA9_;
					goto LA1;
				}
				goto LA4_;
				LA9_: ;
				LA4_: ;
				res -= ((NI) 1);
			} LA3: ;
		}
	} LA1: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, normExt__5YE1ExrSIVKLWtBPQtnFCw)(NimStringDesc* ext) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = ((ext ? ext->Sup.len : 0) == 0);
		if (T3_) goto LA4_;
		T3_ = ((NU8)(ext->data[((NI) 0)]) == (NU8)(46));
		LA4_: ;
		if (!T3_) goto LA5_;
		result = copyString(ext);
	}
	goto LA1_;
	LA5_: ;
	{
		NimStringDesc* T8_;
		T8_ = (NimStringDesc*)0;
		T8_ = rawNewString((ext ? ext->Sup.len : 0) + 1);
appendChar(T8_, 46);
appendString(T8_, ext);
		result = T8_;
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, noschangeFileExt)(NimStringDesc* filename, NimStringDesc* ext) {
	NimStringDesc* result;
	NI extPos;
	result = (NimStringDesc*)0;
	extPos = searchExtPos__sw9aya5BvknC6WiJX9aEYn9ag_2(filename);
	{
		NimStringDesc* T5_;
		NimStringDesc* T6_;
		if (!(extPos < ((NI) 0))) goto LA3_;
		T5_ = (NimStringDesc*)0;
		T6_ = (NimStringDesc*)0;
		T6_ = normExt__5YE1ExrSIVKLWtBPQtnFCw(ext);
		T5_ = rawNewString((filename ? filename->Sup.len : 0) + (T6_ ? T6_->Sup.len : 0) + 0);
appendString(T5_, filename);
appendString(T5_, T6_);
		result = T5_;
	}
	goto LA1_;
	LA3_: ;
	{
		NimStringDesc* T8_;
		NimStringDesc* T9_;
		NimStringDesc* T10_;
		T8_ = (NimStringDesc*)0;
		T9_ = (NimStringDesc*)0;
		T9_ = substr__2yh9cer0ymNRHlOOg8P7IuA(filename, ((NI) 0), (NI)(extPos - ((NI) 1)));
		T10_ = (NimStringDesc*)0;
		T10_ = normExt__5YE1ExrSIVKLWtBPQtnFCw(ext);
		T8_ = rawNewString((T9_ ? T9_->Sup.len : 0) + (T10_ ? T10_->Sup.len : 0) + 0);
appendString(T8_, T9_);
appendString(T8_, T10_);
		result = T8_;
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, nosnormalizePath)(NimStringDesc** path) {
	unsureAsgnRef((void**) (&(*path)), normalizePath__gol9aBbIZpJYUPc6xBOBJDQ((*path), 47));
}
static N_INLINE(void, normalizePathAux__Vd3ai1bzXYPREMwN8HbsmQos)(NimStringDesc** path) {
	nosnormalizePath(path);
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, absolutePath__I16hivp0o49aEba9bSd0N6ng)(NimStringDesc* path, NimStringDesc* root) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = nosisAbsolute(path);
		if (!T3_) goto LA4_;
		result = copyString(path);
	}
	goto LA1_;
	LA4_: ;
	{
		{
			NIM_BOOL T9_;
			tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw* T12_;
			NimStringDesc* T13_;
			T9_ = (NIM_BOOL)0;
			T9_ = nosisAbsolute(root);
			if (!!(T9_)) goto LA10_;
			T12_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*)0;
			T12_ = (tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw*) newObj((&NTI__Ie1m0dv1ZHg72IgPRr1cDw_), sizeof(tyObject_ValueError__yoNlBGx0D2tRizIdhQuENw));
			(*T12_).Sup.Sup.Sup.m_type = (&NTI__yoNlBGx0D2tRizIdhQuENw_);
			(*T12_).Sup.Sup.name = "ValueError";
			T13_ = (NimStringDesc*)0;
			T13_ = rawNewString((root ? root->Sup.len : 0) + 36);
appendString(T13_, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_22));
appendString(T13_, root);
			asgnRef((void**) (&(*T12_).Sup.Sup.message), T13_);
			asgnRef((void**) (&(*T12_).Sup.Sup.parent), NIM_NIL);
			raiseExceptionEx((Exception*)T12_, "ValueError", "absolutePath", "os.nim", 1407);
		}
		LA10_: ;
		result = nosjoinPath(root, path);
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, absolutePathInternal__RmQRR8GLDFICboxWoCEpMw_2)(NimStringDesc* path) {
	NimStringDesc* result;
	NimStringDesc* T1_;
	result = (NimStringDesc*)0;
	T1_ = (NimStringDesc*)0;
	T1_ = nosgetCurrentDir();
	result = absolutePath__I16hivp0o49aEba9bSd0N6ng(path, T1_);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosrelativePath)(NimStringDesc* path, NimStringDesc* base, NIM_CHAR sep) {
	NimStringDesc* result;
	NimStringDesc* base_2;
	NimStringDesc* path_2;
	NIM_BOOL a1;
	NIM_BOOL a2;
	tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg f;
	tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg b;
	tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ ff;
	tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ bb;
{	result = (NimStringDesc*)0;
	{
		if (!((path ? path->Sup.len : 0) == ((NI) 0))) goto LA3_;
		result = ((NimStringDesc*) NIM_NIL);
		goto BeforeRet_;
	}
	LA3_: ;
	{
		if (!eqStrings(base, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_20))) goto LA7_;
		base_2 = ((NimStringDesc*) NIM_NIL);
	}
	goto LA5_;
	LA7_: ;
	{
		base_2 = copyString(base);
	}
	LA5_: ;
	path_2 = copyString(path);
	normalizePathAux__Vd3ai1bzXYPREMwN8HbsmQos((&path_2));
	normalizePathAux__Vd3ai1bzXYPREMwN8HbsmQos((&base_2));
	a1 = nosisAbsolute(path_2);
	a2 = nosisAbsolute(base_2);
	{
		NIM_BOOL T12_;
		T12_ = (NIM_BOOL)0;
		T12_ = a1;
		if (!(T12_)) goto LA13_;
		T12_ = !(a2);
		LA13_: ;
		if (!T12_) goto LA14_;
		base_2 = absolutePathInternal__RmQRR8GLDFICboxWoCEpMw_2(base_2);
	}
	goto LA10_;
	LA14_: ;
	{
		NIM_BOOL T17_;
		T17_ = (NIM_BOOL)0;
		T17_ = a2;
		if (!(T17_)) goto LA18_;
		T17_ = !(a1);
		LA18_: ;
		if (!T17_) goto LA19_;
		path_2 = absolutePathInternal__RmQRR8GLDFICboxWoCEpMw_2(path_2);
	}
	goto LA10_;
	LA19_: ;
	LA10_: ;
	nimZeroMem((void*)(&f), sizeof(tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg));
	nimZeroMem((void*)(&b), sizeof(tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg));
	ff = TM__yu6cxgKBBXbNsTkT9cyMd4g_23;
	bb = TM__yu6cxgKBBXbNsTkT9cyMd4g_23;
	result = rawNewString(((NI) ((path_2 ? path_2->Sup.len : 0))));
	{
		while (1) {
			NIM_BOOL T23_;
			NI diff;
			NIM_BOOL same;
			NI colontmp_;
			NI colontmp__2;
			NI colontmp__3;
			NI colontmp__4;
			T23_ = (NIM_BOOL)0;
			T23_ = hasNext__ecfBf9bSnUlnf5OQ0NQMxpQ(f, path_2);
			if (!(T23_)) goto LA24_;
			T23_ = hasNext__ecfBf9bSnUlnf5OQ0NQMxpQ(b, base_2);
			LA24_: ;
			if (!T23_) goto LA22;
			ff = next__am1q4dBd9cls9au5CcmkX5oA((&f), path_2);
			bb = next__am1q4dBd9cls9au5CcmkX5oA((&b), base_2);
			diff = (NI)(ff.Field1 - ff.Field0);
			{
				if (!!((diff == (NI)(bb.Field1 - bb.Field0)))) goto LA27_;
				goto LA21;
			}
			LA27_: ;
			same = NIM_TRUE;
			{
				NI i;
				NI res;
				i = (NI)0;
				res = ((NI) 0);
				{
					while (1) {
						if (!(res <= diff)) goto LA31;
						i = res;
						{
							if (!!(((NU8)(path_2->data[(NI)(i + ff.Field0)]) == (NU8)(base_2->data[(NI)(i + bb.Field0)])))) goto LA34_;
							same = NIM_FALSE;
							goto LA29;
						}
						LA34_: ;
						res += ((NI) 1);
					} LA31: ;
				}
			} LA29: ;
			{
				if (!!(same)) goto LA38_;
				goto LA21;
			}
			LA38_: ;
			colontmp_ = ((NI) 0);
			colontmp__2 = ((NI) -1);
			ff.Field0 = colontmp_;
			ff.Field1 = colontmp__2;
			colontmp__3 = ((NI) 0);
			colontmp__4 = ((NI) -1);
			bb.Field0 = colontmp__3;
			bb.Field1 = colontmp__4;
		} LA22: ;
	} LA21: ;
	{
		while (1) {
			{
				if (!(bb.Field0 <= bb.Field1)) goto LA44_;
				{
					NIM_BOOL T48_;
					NIM_CHAR T50_;
					T48_ = (NIM_BOOL)0;
					T48_ = (((NI) 0) < (result ? result->Sup.len : 0));
					if (!(T48_)) goto LA49_;
					T50_ = (NIM_CHAR)0;
					T50_ = X5BX5D___okzHJ6GE9cv0bYG3b4r5KCAsystem(result, ((NI) 1));
					T48_ = !(((NU8)(T50_) == (NU8)(sep)));
					LA49_: ;
					if (!T48_) goto LA51_;
					result = addChar(result, sep);
				}
				LA51_: ;
				result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_19));
			}
			LA44_: ;
			{
				NIM_BOOL T55_;
				T55_ = (NIM_BOOL)0;
				T55_ = hasNext__ecfBf9bSnUlnf5OQ0NQMxpQ(b, base_2);
				if (!!(T55_)) goto LA56_;
				goto LA40;
			}
			LA56_: ;
			bb = next__am1q4dBd9cls9au5CcmkX5oA((&b), base_2);
		}
	} LA40: ;
	{
		while (1) {
			{
				if (!(ff.Field0 <= ff.Field1)) goto LA62_;
				{
					NIM_BOOL T66_;
					NIM_CHAR T68_;
					T66_ = (NIM_BOOL)0;
					T66_ = (((NI) 0) < (result ? result->Sup.len : 0));
					if (!(T66_)) goto LA67_;
					T68_ = (NIM_CHAR)0;
					T68_ = X5BX5D___okzHJ6GE9cv0bYG3b4r5KCAsystem(result, ((NI) 1));
					T66_ = !(((NU8)(T68_) == (NU8)(sep)));
					LA67_: ;
					if (!T66_) goto LA69_;
					result = addChar(result, sep);
				}
				LA69_: ;
				{
					NI i_2;
					NI colontmp__5;
					NI res_2;
					i_2 = (NI)0;
					colontmp__5 = (NI)0;
					colontmp__5 = (NI)(ff.Field1 - ff.Field0);
					res_2 = ((NI) 0);
					{
						while (1) {
							if (!(res_2 <= colontmp__5)) goto LA73;
							i_2 = res_2;
							result = addChar(result, path_2->data[(NI)(i_2 + ff.Field0)]);
							res_2 += ((NI) 1);
						} LA73: ;
					}
				}
			}
			LA62_: ;
			{
				NIM_BOOL T76_;
				T76_ = (NIM_BOOL)0;
				T76_ = hasNext__ecfBf9bSnUlnf5OQ0NQMxpQ(f, path_2);
				if (!!(T76_)) goto LA77_;
				goto LA58;
			}
			LA77_: ;
			ff = next__am1q4dBd9cls9au5CcmkX5oA((&f), path_2);
		}
	} LA58: ;
	{
		if (!((result ? result->Sup.len : 0) == ((NI) 0))) goto LA81_;
		result = resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_20));
	}
	LA81_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosaddFileExt)(NimStringDesc* filename, NimStringDesc* ext) {
	NimStringDesc* result;
	NI extPos;
	result = (NimStringDesc*)0;
	extPos = searchExtPos__sw9aya5BvknC6WiJX9aEYn9ag_2(filename);
	{
		NimStringDesc* T5_;
		NimStringDesc* T6_;
		if (!(extPos < ((NI) 0))) goto LA3_;
		T5_ = (NimStringDesc*)0;
		T6_ = (NimStringDesc*)0;
		T6_ = normExt__5YE1ExrSIVKLWtBPQtnFCw(ext);
		T5_ = rawNewString((filename ? filename->Sup.len : 0) + (T6_ ? T6_->Sup.len : 0) + 0);
appendString(T5_, filename);
appendString(T5_, T6_);
		result = T5_;
	}
	goto LA1_;
	LA3_: ;
	{
		result = copyString(filename);
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nostryRemoveFile)(NimStringDesc* file) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	result = NIM_TRUE;
	{
		NIM_BOOL T3_;
		int T4_;
		T3_ = (NIM_BOOL)0;
		T4_ = (int)0;
		T4_ = unlink(nimToCStringConv(file));
		T3_ = !((T4_ == ((NI32) 0)));
		if (!(T3_)) goto LA5_;
		T3_ = !((errno == ENOENT));
		LA5_: ;
		if (!T3_) goto LA6_;
		result = NIM_FALSE;
	}
	LA6_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, putEnv__YVZCqlK3fKyVR367JpYgKA)(NimStringDesc* key, NimStringDesc* val) {
	NI indx;
	indx = findEnvVar__4kc4cxzsC7aY1IOKtOGazA(key);
	{
		NimStringDesc* T5_;
		if (!(((NI) 0) <= indx)) goto LA3_;
		T5_ = (NimStringDesc*)0;
		T5_ = rawNewString((key ? key->Sup.len : 0) + (val ? val->Sup.len : 0) + 1);
appendString(T5_, key);
appendChar(T5_, 61);
appendString(T5_, val);
		asgnRef((void**) (&environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[indx]), T5_);
	}
	goto LA1_;
	LA3_: ;
	{
		NimStringDesc* T7_;
		NI T8_;
		NimStringDesc* T9_;
		NI T10_;
		T7_ = (NimStringDesc*)0;
		T7_ = rawNewString((key ? key->Sup.len : 0) + (val ? val->Sup.len : 0) + 1);
appendString(T7_, key);
appendChar(T7_, 61);
appendString(T7_, val);
		asgnRef((void**) (&environment__mlhK49b6YMgc9cgrcYkKq9a3g), (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV3((TGenericSeq*)(environment__mlhK49b6YMgc9cgrcYkKq9a3g), (&NTI__sM4lkSb7zS6F7OVMvW9cffQ_)));
		T8_ = environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len++;
		T9_ = (NimStringDesc*)0;
		T9_ = environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[T8_]; environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[T8_] = copyStringRC1(T7_);
		if (T9_) nimGCunrefNoCycle(T9_);
		T10_ = ((environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)-1);
		indx = T10_;
	}
	LA1_: ;
	{
		int T13_;
		NI32 T16_;
		T13_ = (int)0;
		T13_ = putenv(nimToCStringConv(environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[indx]));
		if (!!((T13_ == ((NI32) 0)))) goto LA14_;
		T16_ = (NI32)0;
		T16_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
		raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T16_, ((NimStringDesc*) NIM_NIL));
	}
	LA14_: ;
}
static N_INLINE(NI, find__31wM5Ui9c8jnrQ5QD4oPxOQsystem)(NIM_CHAR* a, NI aLen_0, NIM_CHAR item) {
	NI result;
{	result = (NI)0;
	result = ((NI) 0);
	{
		NIM_CHAR i;
		NI i_2;
		i = (NIM_CHAR)0;
		i_2 = ((NI) 0);
		{
			while (1) {
				if (!(i_2 < aLen_0)) goto LA3;
				i = a[i_2];
				{
					if (!((NU8)(i) == (NU8)(item))) goto LA6_;
					goto BeforeRet_;
				}
				LA6_: ;
				result += ((NI) 1);
				i_2 += ((NI) 1);
			} LA3: ;
		}
	}
	result = ((NI) -1);
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NIM_BOOL, contains__Pa9a8m0kZYH6LC8N1EcZJdQsystem)(NIM_CHAR* a, NI aLen_0, NIM_CHAR item) {
	NIM_BOOL result;
	NI T1_;
{	result = (NIM_BOOL)0;
	T1_ = (NI)0;
	T1_ = find__31wM5Ui9c8jnrQ5QD4oPxOQsystem(a, aLen_0, item);
	result = (((NI) 0) <= T1_);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, checkSymlink__K8A5Y9b9bcyjk7pehBjrT8Kw)(NimStringDesc* path) {
	NIM_BOOL result;
	struct stat rawInfo;
	result = (NIM_BOOL)0;
	nimZeroMem((void*)(&rawInfo), sizeof(struct stat));
	{
		int T3_;
		T3_ = (int)0;
		T3_ = lstat(nimToCStringConv(path), (&rawInfo));
		if (!(T3_ < ((NI32) 0))) goto LA4_;
		result = NIM_FALSE;
	}
	goto LA1_;
	LA4_: ;
	{
		result = S_ISLNK(rawInfo.st_mode);
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, findExe__9cov9c3aI19bfbEIyMe9bNCSEA)(NimStringDesc* exe, NIM_BOOL followSymlinks, NimStringDesc** extensions, NI extensionsLen_0) {
	NimStringDesc* result;
	NimStringDesc* path;
{	result = (NimStringDesc*)0;
	{
		if (!((exe ? exe->Sup.len : 0) == ((NI) 0))) goto LA3_;
		goto BeforeRet_;
	}
	LA3_: ;
	{
		NIM_BOOL T7_;
		T7_ = (NIM_BOOL)0;
		T7_ = contains__Pa9a8m0kZYH6LC8N1EcZJdQsystem(exe->data, (exe ? exe->Sup.len : 0), 47);
		if (!T7_) goto LA8_;
		{
			NimStringDesc** extX60gensym79_;
			NI i;
			extX60gensym79_ = (NimStringDesc**)0;
			i = ((NI) 0);
			{
				while (1) {
					if (!(i < extensionsLen_0)) goto LA12;
					extX60gensym79_ = (&extensions[i]);
					result = nosaddFileExt(exe, (*extX60gensym79_));
					{
						NIM_BOOL T15_;
						T15_ = (NIM_BOOL)0;
						T15_ = nosfileExists(result);
						if (!T15_) goto LA16_;
						goto BeforeRet_;
					}
					LA16_: ;
					i += ((NI) 1);
				} LA12: ;
			}
		}
	}
	LA8_: ;
	path = getEnv__hhED57tMl0Iaa5bOg9cJaig(((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_15), ((NimStringDesc*) NIM_NIL));
	{
		NimStringDesc* candidate;
		NI lastX60gensym26_;
		NI splitsX60gensym26_;
		candidate = (NimStringDesc*)0;
		lastX60gensym26_ = ((NI) 0);
		splitsX60gensym26_ = ((NI) -1);
		{
			while (1) {
				NI firstX60gensym26_;
				if (!(lastX60gensym26_ <= (path ? path->Sup.len : 0))) goto LA20;
				firstX60gensym26_ = lastX60gensym26_;
				{
					while (1) {
						NIM_BOOL T23_;
						T23_ = (NIM_BOOL)0;
						T23_ = (lastX60gensym26_ < (path ? path->Sup.len : 0));
						if (!(T23_)) goto LA24_;
						T23_ = !(((NU8)(path->data[lastX60gensym26_]) == (NU8)(58)));
						LA24_: ;
						if (!T23_) goto LA22;
						lastX60gensym26_ += ((NI) 1);
					} LA22: ;
				}
				{
					if (!(splitsX60gensym26_ == ((NI) 0))) goto LA27_;
					lastX60gensym26_ = (path ? path->Sup.len : 0);
				}
				LA27_: ;
				candidate = substr__2yh9cer0ymNRHlOOg8P7IuA(path, firstX60gensym26_, (NI)(lastX60gensym26_ - ((NI) 1)));
				{
					NimStringDesc* x;
					NimStringDesc* T34_;
					{
						if (!((candidate ? candidate->Sup.len : 0) == ((NI) 0))) goto LA32_;
						goto LA29;
					}
					LA32_: ;
					T34_ = (NimStringDesc*)0;
					T34_ = expandTilde__RmQRR8GLDFICboxWoCEpMw(candidate);
					x = slash___gEyhbzZ1UcxyenWRLJRXNQ(T34_, exe);
					{
						NimStringDesc** ext;
						NI i_2;
						ext = (NimStringDesc**)0;
						i_2 = ((NI) 0);
						{
							while (1) {
								NimStringDesc* x_2;
								if (!(i_2 < extensionsLen_0)) goto LA37;
								ext = (&extensions[i_2]);
								x_2 = nosaddFileExt(x, (*ext));
								{
									NIM_BOOL T40_;
									T40_ = (NIM_BOOL)0;
									T40_ = nosfileExists(x_2);
									if (!T40_) goto LA41_;
									{
										while (1) {
											if (!followSymlinks) goto LA44;
											{
												NIM_BOOL T47_;
												NimStringDesc* r;
												NI len;
												T47_ = (NIM_BOOL)0;
												T47_ = checkSymlink__K8A5Y9b9bcyjk7pehBjrT8Kw(x_2);
												if (!T47_) goto LA48_;
												r = mnewString(((NI) 256));
												len = readlink(nimToCStringConv(x_2), nimToCStringConv(r), ((NI) 256));
												{
													NI32 T54_;
													if (!(len < ((NI) 0))) goto LA52_;
													T54_ = (NI32)0;
													T54_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
													raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T54_, exe);
												}
												LA52_: ;
												{
													if (!(((NI) 256) < len)) goto LA57_;
													r = mnewString(((NI) ((NI)(len + ((NI) 1)))));
													len = readlink(nimToCStringConv(x_2), nimToCStringConv(r), len);
												}
												LA57_: ;
												r = setLengthStr(r, ((NI) (len)));
												{
													NIM_BOOL T61_;
													T61_ = (NIM_BOOL)0;
													T61_ = nosisAbsolute(r);
													if (!T61_) goto LA62_;
													x_2 = copyString(r);
												}
												goto LA59_;
												LA62_: ;
												{
													NimStringDesc* T65_;
													T65_ = (NimStringDesc*)0;
													T65_ = nosparentDir(x_2);
													x_2 = slash___gEyhbzZ1UcxyenWRLJRXNQ(T65_, r);
												}
												LA59_: ;
											}
											goto LA45_;
											LA48_: ;
											{
												goto LA43;
											}
											LA45_: ;
										} LA44: ;
									} LA43: ;
									result = copyString(x_2);
									goto BeforeRet_;
								}
								LA41_: ;
								i_2 += ((NI) 1);
							} LA37: ;
						}
					}
				} LA29: ;
				{
					if (!(splitsX60gensym26_ == ((NI) 0))) goto LA69_;
					goto LA19;
				}
				LA69_: ;
				splitsX60gensym26_ -= ((NI) 1);
				lastX60gensym26_ += ((NI) 1);
			} LA20: ;
		} LA19: ;
	}
	result = ((NimStringDesc*) NIM_NIL);
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, existsEnv__HhiDHRQxJ349a6FFxO51gqQ)(NimStringDesc* key) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	{
		NCSTRING T3_;
		NIM_BOOL T4_;
		T3_ = (NCSTRING)0;
		T3_ = getenv(nimToCStringConv(key));
		T4_ = (NIM_BOOL)0;
		T4_ = eqeq___aqip9cmQIuefPKdd25wuEEwsystem(T3_, NIM_NIL);
		if (!!(T4_)) goto LA5_;
		result = NIM_TRUE;
		goto BeforeRet_;
	}
	goto LA1_;
	LA5_: ;
	{
		NI T8_;
		T8_ = (NI)0;
		T8_ = findEnvVar__4kc4cxzsC7aY1IOKtOGazA(key);
		result = (((NI) 0) <= T8_);
		goto BeforeRet_;
	}
	LA1_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(int, exitStatusLikeShell__vmXOHpv9cjOB5AHi6OOlhbw)(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;
}
static N_INLINE(void, pushSafePoint)(TSafePoint* s) {
	(*s).prev = excHandler__rqLlY5bs9atDw2OXYqJEn5g;
	excHandler__rqLlY5bs9atDw2OXYqJEn5g = s;
}
N_LIB_PRIVATE N_NIMCALL(void, nosremoveFile)(NimStringDesc* file) {
	{
		NIM_BOOL T3_;
		NI32 T6_;
		T3_ = (NIM_BOOL)0;
		T3_ = nostryRemoveFile(file);
		if (!!(T3_)) goto LA4_;
		T6_ = (NI32)0;
		T6_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
		raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T6_, file);
	}
	LA4_: ;
}
static N_INLINE(void, popSafePoint)(void) {
	excHandler__rqLlY5bs9atDw2OXYqJEn5g = (*excHandler__rqLlY5bs9atDw2OXYqJEn5g).prev;
}
N_LIB_PRIVATE N_NIMCALL(void, rawRemoveDir__wSIx0z80fCn9axX6xdRqD8Q)(NimStringDesc* dir) {
	{
		NIM_BOOL T3_;
		int T4_;
		NI32 T8_;
		T3_ = (NIM_BOOL)0;
		T4_ = (int)0;
		T4_ = rmdir(nimToCStringConv(dir));
		T3_ = !((T4_ == ((NI32) 0)));
		if (!(T3_)) goto LA5_;
		T3_ = !((errno == ENOENT));
		LA5_: ;
		if (!T3_) goto LA6_;
		T8_ = (NI32)0;
		T8_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
		raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T8_, dir);
	}
	LA6_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, nosremoveDir)(NimStringDesc* dir, NIM_BOOL checkDir) {
	{
		tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg kind;
		NimStringDesc* path;
		DIR* d;
		kind = (tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg)0;
		path = (NimStringDesc*)0;
		d = opendir(nimToCStringConv(dir));
		{
			if (!(d == NIM_NIL)) goto LA4_;
			{
				NI32 T10_;
				if (!checkDir) goto LA8_;
				T10_ = (NI32)0;
				T10_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
				raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T10_, dir);
			}
			LA8_: ;
		}
		goto LA2_;
		LA4_: ;
		{
			TSafePoint TM__yu6cxgKBBXbNsTkT9cyMd4g_24;
			pushSafePoint(&TM__yu6cxgKBBXbNsTkT9cyMd4g_24);
			TM__yu6cxgKBBXbNsTkT9cyMd4g_24.status = _setjmp(TM__yu6cxgKBBXbNsTkT9cyMd4g_24.context);
			if (TM__yu6cxgKBBXbNsTkT9cyMd4g_24.status == 0) {
			{
				while (1) {
					struct dirent* x;
					NimStringDesc* y;
					x = readdir(d);
					{
						if (!(x == NIM_NIL)) goto LA16_;
						goto LA12;
					}
					LA16_: ;
					y = cstrToNimstr(((NCSTRING) ((*x).d_name)));
					{
						NIM_BOOL T20_;
						struct stat s;
						NimStringDesc* path_2;
						tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg k;
						T20_ = (NIM_BOOL)0;
						T20_ = !(eqStrings(y, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_20)));
						if (!(T20_)) goto LA21_;
						T20_ = !(eqStrings(y, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_19)));
						LA21_: ;
						if (!T20_) goto LA22_;
						nimZeroMem((void*)(&s), sizeof(struct stat));
						path_2 = slash___gEyhbzZ1UcxyenWRLJRXNQ(dir, y);
						{
							if (!NIM_TRUE) goto LA26_;
							y = copyString(path_2);
						}
						LA26_: ;
						k = ((tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg) 0);
						{
							int T30_;
							T30_ = (int)0;
							T30_ = lstat(nimToCStringConv(path_2), (&s));
							if (!(T30_ < ((NI32) 0))) goto LA31_;
							goto LA12;
						}
						LA31_: ;
						{
							NIM_BOOL T35_;
							T35_ = (NIM_BOOL)0;
							T35_ = S_ISDIR(s.st_mode);
							if (!T35_) goto LA36_;
							k = ((tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg) 2);
						}
						goto LA33_;
						LA36_: ;
						{
							NIM_BOOL T39_;
							T39_ = (NIM_BOOL)0;
							T39_ = S_ISLNK(s.st_mode);
							if (!T39_) goto LA40_;
							k = getSymlinkFileKind__wTnLPNAWjgwVnuiJ9ax0ZGQ(path_2);
						}
						goto LA33_;
						LA40_: ;
						LA33_: ;
						kind = k;
						path = y;
						switch (kind) {
						case ((tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg) 0):
						case ((tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg) 1):
						case ((tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg) 3):
						{
							nosremoveFile(path);
						}
						break;
						case ((tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg) 2):
						{
							nosremoveDir(path, NIM_TRUE);
						}
						break;
						}
					}
					LA22_: ;
				}
			} LA12: ;
			popSafePoint();
			}
			else {
				popSafePoint();
			}
			{
				int T46_;
				T46_ = (int)0;
				T46_ = closedir(d);
				(void)(T46_);
				if (TM__yu6cxgKBBXbNsTkT9cyMd4g_24.status != 0) nimLeaveFinally();
			}
			if (TM__yu6cxgKBBXbNsTkT9cyMd4g_24.status != 0) reraiseException();
		}
		LA2_: ;
	}
	rawRemoveDir__wSIx0z80fCn9axX6xdRqD8Q(dir);
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, tryMoveFSObject__43wKg5fKy6XSTFw35EBkzA)(NimStringDesc* source, NimStringDesc* dest) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	{
		int T3_;
		NI32 err;
		T3_ = (int)0;
		T3_ = rename(nimToCStringConv(source), nimToCStringConv(dest));
		if (!!((T3_ == ((NI32) 0)))) goto LA4_;
		err = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
		{
			if (!(err == EXDEV)) goto LA8_;
			result = NIM_FALSE;
			goto BeforeRet_;
		}
		goto LA6_;
		LA8_: ;
		{
			tyTuple__flePlH29a9c9cGo1Wdll1KDOQ T11_;
			NimStringDesc* T12_;
			nimZeroMem((void*)(&T11_), sizeof(tyTuple__flePlH29a9c9cGo1Wdll1KDOQ));
			T11_.Field0 = copyString(source);
			T11_.Field1 = copyString(dest);
			T11_.Field2 = strerror(errno);
			T12_ = (NimStringDesc*)0;
			T12_ = dollar___uRqZ9b9aRtL1gygwVfSa9bmlQ(T11_);
			raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(err, T12_);
		}
		LA6_: ;
	}
	LA4_: ;
	result = NIM_TRUE;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, noscopyFile)(NimStringDesc* source, NimStringDesc* dest) {
	FILE* d;
	FILE* s;
	void* buf;
	d = (FILE*)0;
	s = (FILE*)0;
	{
		NIM_BOOL T3_;
		NI32 T6_;
		T3_ = (NIM_BOOL)0;
		T3_ = open__gq12VLhVO0NBzUTnGgz4nw(&s, source, ((tyEnum_FileMode__ZJfK20XeZ9bv2j1pZjw9aswg) 0), ((NI) -1));
		if (!!(T3_)) goto LA4_;
		T6_ = (NI32)0;
		T6_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
		raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T6_, source);
	}
	LA4_: ;
	{
		NIM_BOOL T9_;
		NI32 T12_;
		T9_ = (NIM_BOOL)0;
		T9_ = open__gq12VLhVO0NBzUTnGgz4nw(&d, dest, ((tyEnum_FileMode__ZJfK20XeZ9bv2j1pZjw9aswg) 1), ((NI) -1));
		if (!!(T9_)) goto LA10_;
		close__fU6ZlJAtQ9bre04EDZLdGsA_3(s);
		T12_ = (NI32)0;
		T12_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
		raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T12_, dest);
	}
	LA10_: ;
	buf = allocImpl__KzdpcuLT9aef9bsiSHlIu9aFg_2(((NI) 8000));
	{
		while (1) {
			NI bytesread;
			bytesread = readBuffer__Y9atVWUcVyKHG9aBP4D0P9czA_2(s, buf, ((NI) 8000));
			{
				NI byteswritten;
				if (!(((NI) 0) < bytesread)) goto LA17_;
				byteswritten = writeBuffer__Y9atVWUcVyKHG9aBP4D0P9czA(d, buf, ((NI) (bytesread)));
				{
					NI32 T23_;
					if (!!((bytesread == byteswritten))) goto LA21_;
					deallocImpl__SAtZpVrJ3o5FJvSdLQe9auA(buf);
					close__fU6ZlJAtQ9bre04EDZLdGsA_3(s);
					close__fU6ZlJAtQ9bre04EDZLdGsA_3(d);
					T23_ = (NI32)0;
					T23_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
					raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T23_, dest);
				}
				LA21_: ;
			}
			LA17_: ;
			{
				if (!!((bytesread == ((NI) 8000)))) goto LA26_;
				goto LA13;
			}
			LA26_: ;
		}
	} LA13: ;
	deallocImpl__SAtZpVrJ3o5FJvSdLQe9auA(buf);
	close__fU6ZlJAtQ9bre04EDZLdGsA_3(s);
	flushFile__fU6ZlJAtQ9bre04EDZLdGsA_2(d);
	close__fU6ZlJAtQ9bre04EDZLdGsA_3(d);
}
static N_INLINE(void, popCurrentException)(void) {
	asgnRef((void**) (&currException__9bVPeDJlYTi9bQApZpfH8wjg), (*currException__9bVPeDJlYTi9bQApZpfH8wjg).up);
}
N_LIB_PRIVATE N_NIMCALL(void, nosmoveFile)(NimStringDesc* source, NimStringDesc* dest) {
	{
		NIM_BOOL T3_;
		TSafePoint TM__yu6cxgKBBXbNsTkT9cyMd4g_25;
		T3_ = (NIM_BOOL)0;
		T3_ = tryMoveFSObject__43wKg5fKy6XSTFw35EBkzA(source, dest);
		if (!!(T3_)) goto LA4_;
		noscopyFile(source, dest);
		pushSafePoint(&TM__yu6cxgKBBXbNsTkT9cyMd4g_25);
		TM__yu6cxgKBBXbNsTkT9cyMd4g_25.status = _setjmp(TM__yu6cxgKBBXbNsTkT9cyMd4g_25.context);
		if (TM__yu6cxgKBBXbNsTkT9cyMd4g_25.status == 0) {
		nosremoveFile(source);
		popSafePoint();
		}
		else {
			popSafePoint();
			{
				NIM_BOOL T8_;
				TM__yu6cxgKBBXbNsTkT9cyMd4g_25.status = 0;
				T8_ = (NIM_BOOL)0;
				T8_ = nostryRemoveFile(dest);
				(void)(T8_);
				reraiseException();
				popCurrentException();
			}
		}
		if (TM__yu6cxgKBBXbNsTkT9cyMd4g_25.status != 0) reraiseException();
	}
	LA4_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, noscopyDir)(NimStringDesc* source, NimStringDesc* dest) {
	noscreateDir(dest);
	{
		tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg kind;
		NimStringDesc* path;
		DIR* d;
		kind = (tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg)0;
		path = (NimStringDesc*)0;
		d = opendir(nimToCStringConv(source));
		{
			if (!(d == NIM_NIL)) goto LA4_;
			{
				NI32 T10_;
				if (!NIM_FALSE) goto LA8_;
				T10_ = (NI32)0;
				T10_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
				raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T10_, source);
			}
			LA8_: ;
		}
		goto LA2_;
		LA4_: ;
		{
			TSafePoint TM__yu6cxgKBBXbNsTkT9cyMd4g_26;
			pushSafePoint(&TM__yu6cxgKBBXbNsTkT9cyMd4g_26);
			TM__yu6cxgKBBXbNsTkT9cyMd4g_26.status = _setjmp(TM__yu6cxgKBBXbNsTkT9cyMd4g_26.context);
			if (TM__yu6cxgKBBXbNsTkT9cyMd4g_26.status == 0) {
			{
				while (1) {
					struct dirent* x;
					NimStringDesc* y;
					x = readdir(d);
					{
						if (!(x == NIM_NIL)) goto LA16_;
						goto LA12;
					}
					LA16_: ;
					y = cstrToNimstr(((NCSTRING) ((*x).d_name)));
					{
						NIM_BOOL T20_;
						struct stat s;
						NimStringDesc* path_2;
						tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg k;
						NimStringDesc* noSource;
						tyTuple__UV3llMMYFckfui8YMBuUZA T42_;
						T20_ = (NIM_BOOL)0;
						T20_ = !(eqStrings(y, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_20)));
						if (!(T20_)) goto LA21_;
						T20_ = !(eqStrings(y, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_19)));
						LA21_: ;
						if (!T20_) goto LA22_;
						nimZeroMem((void*)(&s), sizeof(struct stat));
						path_2 = slash___gEyhbzZ1UcxyenWRLJRXNQ(source, y);
						{
							if (!NIM_TRUE) goto LA26_;
							y = copyString(path_2);
						}
						LA26_: ;
						k = ((tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg) 0);
						{
							int T30_;
							T30_ = (int)0;
							T30_ = lstat(nimToCStringConv(path_2), (&s));
							if (!(T30_ < ((NI32) 0))) goto LA31_;
							goto LA12;
						}
						LA31_: ;
						{
							NIM_BOOL T35_;
							T35_ = (NIM_BOOL)0;
							T35_ = S_ISDIR(s.st_mode);
							if (!T35_) goto LA36_;
							k = ((tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg) 2);
						}
						goto LA33_;
						LA36_: ;
						{
							NIM_BOOL T39_;
							T39_ = (NIM_BOOL)0;
							T39_ = S_ISLNK(s.st_mode);
							if (!T39_) goto LA40_;
							k = getSymlinkFileKind__wTnLPNAWjgwVnuiJ9ax0ZGQ(path_2);
						}
						goto LA33_;
						LA40_: ;
						LA33_: ;
						kind = k;
						path = y;
						nimZeroMem((void*)(&T42_), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
						nossplitPath(path, (&T42_));
						noSource = copyString(T42_.Field1);
						switch (kind) {
						case ((tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg) 0):
						{
							NimStringDesc* T44_;
							T44_ = (NimStringDesc*)0;
							T44_ = slash___gEyhbzZ1UcxyenWRLJRXNQ(dest, noSource);
							noscopyFile(path, T44_);
						}
						break;
						case ((tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg) 2):
						{
							NimStringDesc* T46_;
							T46_ = (NimStringDesc*)0;
							T46_ = slash___gEyhbzZ1UcxyenWRLJRXNQ(dest, noSource);
							noscopyDir(path, T46_);
						}
						break;
						default:
						{
						}
						break;
						}
					}
					LA22_: ;
				}
			} LA12: ;
			popSafePoint();
			}
			else {
				popSafePoint();
			}
			{
				int T50_;
				T50_ = (int)0;
				T50_ = closedir(d);
				(void)(T50_);
				if (TM__yu6cxgKBBXbNsTkT9cyMd4g_26.status != 0) nimLeaveFinally();
			}
			if (TM__yu6cxgKBBXbNsTkT9cyMd4g_26.status != 0) reraiseException();
		}
		LA2_: ;
	}
}
N_LIB_PRIVATE N_NIMCALL(void, moveDir__ZIkDlvIsvzKWHk1wL9bH1lg)(NimStringDesc* source, NimStringDesc* dest) {
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = tryMoveFSObject__43wKg5fKy6XSTFw35EBkzA(source, dest);
		if (!!(T3_)) goto LA4_;
		noscopyDir(source, dest);
		nosremoveDir(source, NIM_FALSE);
	}
	LA4_: ;
}
static N_INLINE(tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q, toTime__ijMjyFbtGRbszYH28YzkiQos)(struct timespec ts) {
	tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q result;
	nimZeroMem((void*)(&result), sizeof(tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q));
	result = initTime__JIXNH9cQMG3SbZ0hXqEYDvA(((NI64) (ts.tv_sec)), ((NI) (ts.tv_nsec)));
	return result;
}
static N_INLINE(struct timespec, st_mtim__pE9cdzno9aFK08QQxSwtkHRgposix)(struct stat s) {
	struct timespec result;
	nimZeroMem((void*)(&result), sizeof(struct timespec));
	result.tv_sec = s.st_mtime;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q, nosgetLastModificationTime)(NimStringDesc* file) {
	tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q result;
	struct stat res;
	struct timespec T7_;
	nimZeroMem((void*)(&result), sizeof(tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q));
	nimZeroMem((void*)(&res), sizeof(struct stat));
	{
		int T3_;
		NI32 T6_;
		T3_ = (int)0;
		T3_ = stat(nimToCStringConv(file), (&res));
		if (!(T3_ < ((NI32) 0))) goto LA4_;
		T6_ = (NI32)0;
		T6_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
		raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T6_, file);
	}
	LA4_: ;
	T7_ = st_mtim__pE9cdzno9aFK08QQxSwtkHRgposix(res);
	result = toTime__ijMjyFbtGRbszYH28YzkiQos(T7_);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, delEnv__B4Cfq0UpEu7Wu9cYZh9cgVlw)(NimStringDesc* key) {
	NI indx;
{	indx = findEnvVar__4kc4cxzsC7aY1IOKtOGazA(key);
	{
		if (!(indx < ((NI) 0))) goto LA3_;
		goto BeforeRet_;
	}
	LA3_: ;
	{
		int T7_;
		NI32 T10_;
		T7_ = (int)0;
		T7_ = unsetenv(nimToCStringConv(key));
		if (!!((T7_ == ((NI32) 0)))) goto LA8_;
		T10_ = (NI32)0;
		T10_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
		raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T10_, ((NimStringDesc*) NIM_NIL));
	}
	LA8_: ;
	delete__FxJSSlM1HtYUBJdvsqL6Sg((&environment__mlhK49b6YMgc9cgrcYkKq9a3g), ((NI) (indx)));
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosgetConfigDir)(void) {
	NimStringDesc* result;
	NimStringDesc* T1_;
	NimStringDesc* T2_;
	result = (NimStringDesc*)0;
	T1_ = (NimStringDesc*)0;
	T1_ = getEnv__hhED57tMl0Iaa5bOg9cJaig(((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_12), ((NimStringDesc*) NIM_NIL));
	T2_ = (NimStringDesc*)0;
	T2_ = slash___gEyhbzZ1UcxyenWRLJRXNQ(T1_, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_28));
	result = getEnv__hhED57tMl0Iaa5bOg9cJaig(((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_27), T2_);
	normalizePathEnd__gKUeJXj8CrWvxdeNCA2BXg((&result), NIM_TRUE);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosisRootDir)(NimStringDesc* path) {
	NIM_BOOL result;
	NI T1_;
	result = (NIM_BOOL)0;
	T1_ = (NI)0;
	T1_ = parentDirPos__sw9aya5BvknC6WiJX9aEYn9ag(path);
	result = (T1_ < ((NI) 0));
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosfileNewer)(NimStringDesc* a, NimStringDesc* b) {
	NIM_BOOL result;
	tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q T1_;
	tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q T2_;
	tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q T3_;
	result = (NIM_BOOL)0;
	T1_ = nosgetLastModificationTime(b);
	T2_ = T1_;
	T3_ = nosgetLastModificationTime(a);
	result = ntLeTime(T2_, T3_);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, nossetFilePermissions)(NimStringDesc* filename, tySet_tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA permissions) {
	mode_t p;
	p = ((mode_t) 0);
	{
		if (!((permissions &((NU16)1<<((NU)(((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 2))&15U)))!=0)) goto LA3_;
		p = (NU32)(p | ((mode_t) (S_IRUSR)));
	}
	LA3_: ;
	{
		if (!((permissions &((NU16)1<<((NU)(((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 1))&15U)))!=0)) goto LA7_;
		p = (NU32)(p | ((mode_t) (S_IWUSR)));
	}
	LA7_: ;
	{
		if (!((permissions &((NU16)1<<((NU)(((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 0))&15U)))!=0)) goto LA11_;
		p = (NU32)(p | ((mode_t) (S_IXUSR)));
	}
	LA11_: ;
	{
		if (!((permissions &((NU16)1<<((NU)(((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 5))&15U)))!=0)) goto LA15_;
		p = (NU32)(p | ((mode_t) (S_IRGRP)));
	}
	LA15_: ;
	{
		if (!((permissions &((NU16)1<<((NU)(((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 4))&15U)))!=0)) goto LA19_;
		p = (NU32)(p | ((mode_t) (S_IWGRP)));
	}
	LA19_: ;
	{
		if (!((permissions &((NU16)1<<((NU)(((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 3))&15U)))!=0)) goto LA23_;
		p = (NU32)(p | ((mode_t) (S_IXGRP)));
	}
	LA23_: ;
	{
		if (!((permissions &((NU16)1<<((NU)(((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 8))&15U)))!=0)) goto LA27_;
		p = (NU32)(p | ((mode_t) (S_IROTH)));
	}
	LA27_: ;
	{
		if (!((permissions &((NU16)1<<((NU)(((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 7))&15U)))!=0)) goto LA31_;
		p = (NU32)(p | ((mode_t) (S_IWOTH)));
	}
	LA31_: ;
	{
		if (!((permissions &((NU16)1<<((NU)(((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 6))&15U)))!=0)) goto LA35_;
		p = (NU32)(p | ((mode_t) (S_IXOTH)));
	}
	LA35_: ;
	{
		int T39_;
		NI32 T42_;
		tyTuple__HFn8JzZZeLZ9aKrFg4S9a7HA T43_;
		NimStringDesc* T44_;
		T39_ = (int)0;
		T39_ = chmod(nimToCStringConv(filename), ((mode_t) (p)));
		if (!!((T39_ == ((NI32) 0)))) goto LA40_;
		T42_ = (NI32)0;
		T42_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
		nimZeroMem((void*)(&T43_), sizeof(tyTuple__HFn8JzZZeLZ9aKrFg4S9a7HA));
		T43_.Field0 = copyString(filename);
		T43_.Field1 = permissions;
		T44_ = (NimStringDesc*)0;
		T44_ = dollar___VhyooW9cjC7wNKZM71oRg9cg(T43_);
		raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T42_, T44_);
	}
	LA40_: ;
}
N_LIB_PRIVATE N_NIMCALL(tySet_tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA, nosgetFilePermissions)(NimStringDesc* filename) {
	tySet_tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA result;
	struct stat a;
	nimZeroMem((void*)(&result), sizeof(tySet_tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA));
	nimZeroMem((void*)(&a), sizeof(struct stat));
	{
		int T3_;
		NI32 T6_;
		T3_ = (int)0;
		T3_ = stat(nimToCStringConv(filename), (&a));
		if (!(T3_ < ((NI32) 0))) goto LA4_;
		T6_ = (NI32)0;
		T6_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
		raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T6_, filename);
	}
	LA4_: ;
	result = 0;
	{
		if (!!(((NU32)(a.st_mode & ((mode_t) (S_IRUSR))) == ((mode_t) 0)))) goto LA9_;
		result |= ((NU16)1)<<((((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 2)) & 15);
	}
	LA9_: ;
	{
		if (!!(((NU32)(a.st_mode & ((mode_t) (S_IWUSR))) == ((mode_t) 0)))) goto LA13_;
		result |= ((NU16)1)<<((((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 1)) & 15);
	}
	LA13_: ;
	{
		if (!!(((NU32)(a.st_mode & ((mode_t) (S_IXUSR))) == ((mode_t) 0)))) goto LA17_;
		result |= ((NU16)1)<<((((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 0)) & 15);
	}
	LA17_: ;
	{
		if (!!(((NU32)(a.st_mode & ((mode_t) (S_IRGRP))) == ((mode_t) 0)))) goto LA21_;
		result |= ((NU16)1)<<((((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 5)) & 15);
	}
	LA21_: ;
	{
		if (!!(((NU32)(a.st_mode & ((mode_t) (S_IWGRP))) == ((mode_t) 0)))) goto LA25_;
		result |= ((NU16)1)<<((((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 4)) & 15);
	}
	LA25_: ;
	{
		if (!!(((NU32)(a.st_mode & ((mode_t) (S_IXGRP))) == ((mode_t) 0)))) goto LA29_;
		result |= ((NU16)1)<<((((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 3)) & 15);
	}
	LA29_: ;
	{
		if (!!(((NU32)(a.st_mode & ((mode_t) (S_IROTH))) == ((mode_t) 0)))) goto LA33_;
		result |= ((NU16)1)<<((((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 8)) & 15);
	}
	LA33_: ;
	{
		if (!!(((NU32)(a.st_mode & ((mode_t) (S_IWOTH))) == ((mode_t) 0)))) goto LA37_;
		result |= ((NU16)1)<<((((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 7)) & 15);
	}
	LA37_: ;
	{
		if (!!(((NU32)(a.st_mode & ((mode_t) (S_IXOTH))) == ((mode_t) 0)))) goto LA41_;
		result |= ((NU16)1)<<((((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 6)) & 15);
	}
	LA41_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, copyFileWithPermissions__H9b5Dl0Yjd60VeosKvlvXkA)(NimStringDesc* source, NimStringDesc* dest, NIM_BOOL ignorePermissionErrors) {
	TSafePoint TM__yu6cxgKBBXbNsTkT9cyMd4g_29;
	tySet_tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA T1_;
	noscopyFile(source, dest);
	pushSafePoint(&TM__yu6cxgKBBXbNsTkT9cyMd4g_29);
	TM__yu6cxgKBBXbNsTkT9cyMd4g_29.status = _setjmp(TM__yu6cxgKBBXbNsTkT9cyMd4g_29.context);
	if (TM__yu6cxgKBBXbNsTkT9cyMd4g_29.status == 0) {
	T1_ = nosgetFilePermissions(source);
	nossetFilePermissions(dest, T1_);
	popSafePoint();
	}
	else {
		popSafePoint();
		{
			TM__yu6cxgKBBXbNsTkT9cyMd4g_29.status = 0;
			{
				if (!!(ignorePermissionErrors)) goto LA6_;
				reraiseException();
			}
			LA6_: ;
			popCurrentException();
		}
	}
	if (TM__yu6cxgKBBXbNsTkT9cyMd4g_29.status != 0) reraiseException();
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, isRelativeTo__7vk6fsmSRQYWfbjkLVX9bnA)(NimStringDesc* path, NimStringDesc* base) {
	NIM_BOOL result;
	NimStringDesc* path_2;
	NimStringDesc* base_2;
	NimStringDesc* ret;
	NIM_BOOL T1_;
	NIM_BOOL T3_;
	result = (NIM_BOOL)0;
	path_2 = normalizePath__gol9aBbIZpJYUPc6xBOBJDQ(path, 47);
	base_2 = normalizePath__gol9aBbIZpJYUPc6xBOBJDQ(base, 47);
	ret = nosrelativePath(path_2, base_2, 47);
	T1_ = (NIM_BOOL)0;
	T1_ = (((NI) 0) < (path_2 ? path_2->Sup.len : 0));
	if (!(T1_)) goto LA2_;
	T3_ = (NIM_BOOL)0;
	T3_ = nsuStartsWith(ret, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_19));
	T1_ = !(T3_);
	LA2_: ;
	result = T1_;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, nosexecShellCmd)(NimStringDesc* command) {
	NI result;
	int T1_;
	int T2_;
	result = (NI)0;
	T1_ = (int)0;
	T1_ = system(nimToCStringConv(command));
	T2_ = (int)0;
	T2_ = exitStatusLikeShell__vmXOHpv9cjOB5AHi6OOlhbw(T1_);
	result = ((NI) (T2_));
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, stdlib_osInit000)(void) {
{

	nimRegisterThreadLocalMarker(TM__yu6cxgKBBXbNsTkT9cyMd4g_2);

}
}

N_LIB_PRIVATE N_NIMCALL(void, stdlib_osDatInit000)(void) {

/* section: NIM_merge_TYPE_INIT1 */
static TNimNode* TM__yu6cxgKBBXbNsTkT9cyMd4g_30_9[9];
NI TM__yu6cxgKBBXbNsTkT9cyMd4g_32;
static char* NIM_CONST TM__yu6cxgKBBXbNsTkT9cyMd4g_31[9] = {
"fpUserExec", 
"fpUserWrite", 
"fpUserRead", 
"fpGroupExec", 
"fpGroupWrite", 
"fpGroupRead", 
"fpOthersExec", 
"fpOthersWrite", 
"fpOthersRead"};
static TNimNode TM__yu6cxgKBBXbNsTkT9cyMd4g_0[10];

/* section: NIM_merge_TYPE_INIT3 */
NTI__sM4lkSb7zS6F7OVMvW9cffQ_.size = sizeof(tySequence__sM4lkSb7zS6F7OVMvW9cffQ*);
NTI__sM4lkSb7zS6F7OVMvW9cffQ_.align = NIM_ALIGNOF(tySequence__sM4lkSb7zS6F7OVMvW9cffQ*);
NTI__sM4lkSb7zS6F7OVMvW9cffQ_.kind = 24;
NTI__sM4lkSb7zS6F7OVMvW9cffQ_.base = (&NTI__77mFvmsOLKik79ci2hXkHEg_);
NTI__sM4lkSb7zS6F7OVMvW9cffQ_.flags = 2;
NTI__sM4lkSb7zS6F7OVMvW9cffQ_.marker = Marker_tySequence__sM4lkSb7zS6F7OVMvW9cffQ;
NTI__uTVeDpjCH6aWw9c74YkAskA_.size = sizeof(tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA);
NTI__uTVeDpjCH6aWw9c74YkAskA_.align = NIM_ALIGNOF(tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA);
NTI__uTVeDpjCH6aWw9c74YkAskA_.kind = 14;
NTI__uTVeDpjCH6aWw9c74YkAskA_.base = 0;
NTI__uTVeDpjCH6aWw9c74YkAskA_.flags = 3;
for (TM__yu6cxgKBBXbNsTkT9cyMd4g_32 = 0; TM__yu6cxgKBBXbNsTkT9cyMd4g_32 < 9; TM__yu6cxgKBBXbNsTkT9cyMd4g_32++) {
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[TM__yu6cxgKBBXbNsTkT9cyMd4g_32+0].kind = 1;
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[TM__yu6cxgKBBXbNsTkT9cyMd4g_32+0].offset = TM__yu6cxgKBBXbNsTkT9cyMd4g_32;
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[TM__yu6cxgKBBXbNsTkT9cyMd4g_32+0].name = TM__yu6cxgKBBXbNsTkT9cyMd4g_31[TM__yu6cxgKBBXbNsTkT9cyMd4g_32];
TM__yu6cxgKBBXbNsTkT9cyMd4g_30_9[TM__yu6cxgKBBXbNsTkT9cyMd4g_32] = &TM__yu6cxgKBBXbNsTkT9cyMd4g_0[TM__yu6cxgKBBXbNsTkT9cyMd4g_32+0];
}
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[9].len = 9; TM__yu6cxgKBBXbNsTkT9cyMd4g_0[9].kind = 2; TM__yu6cxgKBBXbNsTkT9cyMd4g_0[9].sons = &TM__yu6cxgKBBXbNsTkT9cyMd4g_30_9[0];
NTI__uTVeDpjCH6aWw9c74YkAskA_.node = &TM__yu6cxgKBBXbNsTkT9cyMd4g_0[9];
}

