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

#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 <setjmp.h>
#include <dirent.h>
#include <stdio.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
#define nimfr_(x, y)
#define nimln_(x, y)
typedef struct 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_IndexError__K39aEGuwNdydKn2WFEpUygg tyObject_IndexError__K39aEGuwNdydKn2WFEpUygg;
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__7q7q3E6Oj24ZNVJb9aonhAg tyTuple__7q7q3E6Oj24ZNVJb9aonhAg;
typedef struct tyTuple__UV3llMMYFckfui8YMBuUZA tyTuple__UV3llMMYFckfui8YMBuUZA;
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_PathIter__tllF14xUpDWpqG9ci5sg9bMg tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg;
typedef struct tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ;
typedef struct tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q;
typedef struct TSafePoint TSafePoint;
typedef struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef NU8 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A;
typedef NU8 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ;
typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
struct TNimType {
NI size;
tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
TNimType* base;
TNimNode* node;
void* finalizer;
tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
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__SiRwrEKZdLgxqz9a9aoVBglg[512];
typedef NU32 tyArray__BHbOSqU1t9b3Gt7K2c6fQig[24];
typedef tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* tyArray__N1u1nqOgmuJN9cSZrnMHgOQ[32];
typedef tyArray__N1u1nqOgmuJN9cSZrnMHgOQ tyArray__B6durA4ZCi1xjJvRtyYxMg[24];
typedef tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw* tyArray__lh2A89ahMmYg9bCmpVaplLbA[256];
struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA {
tyArray__lh2A89ahMmYg9bCmpVaplLbA data;
};
typedef tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* tyArray__0aOLqZchNi8nWtMTi8ND8w[2];
struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw {
tyArray__0aOLqZchNi8nWtMTi8ND8w link;
NI key;
NI upperBound;
NI level;
};
struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg {
tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* Field0;
NI Field1;
};
typedef tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyArray__LzOv2eCDGiceMKQstCLmhw[30];
struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg {
NI len;
tyArray__LzOv2eCDGiceMKQstCLmhw chunks;
tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg* next;
};
struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg {
NI minLargeObj;
NI maxLargeObj;
tyArray__SiRwrEKZdLgxqz9a9aoVBglg freeSmallChunks;
NU32 flBitmap;
tyArray__BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
tyArray__B6durA4ZCi1xjJvRtyYxMg matrix;
tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw* llmem;
NI currMem;
NI maxMem;
NI freeMem;
NI occ;
NI lastSize;
tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA chunkStarts;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* root;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* deleted;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* last;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* freeAvlNodes;
NIM_BOOL locked;
NIM_BOOL blockChunkSizeIncrease;
NI nextChunkSize;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw bottomData;
tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg heapLinks;
};
struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg {
NI stackScans;
NI cycleCollections;
NI maxThreshold;
NI maxStackSize;
NI maxStackCells;
NI cycleTableSize;
NI64 maxPause;
};
struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ {
NI counter;
NI max;
tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg* head;
tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg** data;
};
struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ {
tyObject_GcStack__7fytPA5bBsob6See21YMRA stack;
NI cycleThreshold;
NI zctThreshold;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w zct;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w decStack;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tempStack;
NI recGcLock;
tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg region;
tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg stat;
tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ marked;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w additionalRoots;
NI gcThreadId;
};
struct RootObj {
TNimType* m_type;
};
struct Exception {
  RootObj Sup;
Exception* parent;
NCSTRING name;
NimStringDesc* message;
tySequence__uB9b75OUPRENsBAu4AnoePA* trace;
NU raiseId;
Exception* up;
};
struct tyObject_Defect__LbeSGvgPzGzXnW9caIkJqMA {
  Exception Sup;
};
struct tyObject_IndexError__K39aEGuwNdydKn2WFEpUygg {
  tyObject_Defect__LbeSGvgPzGzXnW9caIkJqMA Sup;
};
typedef NU8 tySet_tyChar__nmiMWKVIe46vacnhAFrQvw[32];
struct tyTuple__7q7q3E6Oj24ZNVJb9aonhAg {
NimStringDesc* Field0;
NimStringDesc* Field1;
NimStringDesc* Field2;
};
struct tyTuple__UV3llMMYFckfui8YMBuUZA {
NimStringDesc* Field0;
NimStringDesc* Field1;
};
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_PathIter__tllF14xUpDWpqG9ci5sg9bMg {
NI i;
NI prev;
NIM_BOOL notFirst;
};
struct tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ {
NI Field0;
NI Field1;
};
typedef NU8 tyEnum_FileMode__ZJfK20XeZ9bv2j1pZjw9aswg;
struct tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q {
NI64 seconds;
NI nanosecond;
};
typedef struct {
N_NIMCALL_PTR(NIM_BOOL, ClP_0) (Exception* e, void* ClE_0);
void* ClE_0;
} tyProc__NT9bSe2DDkjdtx7j9aov2Z6g;
struct TSafePoint {
TSafePoint* prev;
NI status;
jmp_buf context;
NIM_BOOL hasRaiseAction;
tyProc__NT9bSe2DDkjdtx7j9aov2Z6g raiseAction;
};
typedef NU16 tySet_tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA;
typedef NU8 tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA;
typedef NIM_CHAR tyArray__dTlC27m9c9aWd5dvuePYanug[256];
struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA {
NCSTRING procname;
NI line;
NCSTRING filename;
};
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct tySequence__uB9b75OUPRENsBAu4AnoePA {
  TGenericSeq Sup;
  tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA data[SEQ_DECL_SIZE];
};
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_NIMCALL(void, nimRegisterThreadLocalMarker)(tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ markerProc);
N_NIMCALL(NimStringDesc*, setLengthStr)(NimStringDesc* s, NI newLen);
N_NOINLINE(void, raiseIndexError2)(NI i, NI n);
static N_INLINE(NI, addInt)(NI a, NI b);
N_NOINLINE(void, raiseOverflow)(void);
N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s, NIM_CHAR c);
N_NIMCALL(TGenericSeq*, incrSeqV3)(TGenericSeq* s, TNimType* typ);
N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(void, decRef__AT1eRuflKWyTTBdLjEDZbgsystem)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(void, rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_2system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_PRIVATE N_NOINLINE(void, addZCT__Y66tOYFjgwJ0k4aLz4bc0Q)(tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w* s, tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem)(void* usr);
static N_INLINE(NI, subInt)(NI a, NI b);
N_NIMCALL(NimStringDesc*, cstrToNimstr)(NCSTRING str);
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_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
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);
N_NIMCALL(void, raiseExceptionEx)(Exception* e, NCSTRING ename, NCSTRING procname, NCSTRING filename, NI line);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nospquoteShell)(NimStringDesc* s);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nospquoteShellPosix)(NimStringDesc* s);
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*, nosjoinPath)(NimStringDesc* head, NimStringDesc* tail);
N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
static N_INLINE(NI, chckRange)(NI i, NI a, NI b);
N_NOINLINE(void, raiseRangeError)(NI64 val);
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(NimStringDesc*, substr__iGg0RIKceRvsmvq8FUHOEw)(NimStringDesc* s, NI first);
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_NOINLINE(void, chckNil)(void* p);
N_NIMCALL(void, genericReset)(void* dest, TNimType* mt);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, substr__2yh9cer0ymNRHlOOg8P7IuA)(NimStringDesc* s, NI first, NI last);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
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, nosexistsFile)(NimStringDesc* filename);
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(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);
static N_INLINE(NIM_CHAR, X5BX5D___okzHJ6GE9cv0bYG3b4r5KCAsystem)(NimStringDesc* s, NI i);
N_LIB_PRIVATE N_NIMCALL(void, addQuoted__45fPtFhY4FavRaYwDhRfuA)(NimStringDesc** s, NimStringDesc* x);
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(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(NI, parentDirPos__sw9aya5BvknC6WiJX9aEYn9ag)(NimStringDesc* path);
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, nosexistsDir)(NimStringDesc* dir);
N_LIB_PRIVATE N_NIMCALL(NI, searchExtPos__sw9aya5BvknC6WiJX9aEYn9ag_2)(NimStringDesc* path);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, normExt__5YE1ExrSIVKLWtBPQtnFCw)(NimStringDesc* ext);
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);
N_LIB_PRIVATE N_NIMCALL(void, nossplitPath)(NimStringDesc* path, tyTuple__UV3llMMYFckfui8YMBuUZA* Result);
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*, alloc__WrVG9abV9chlTLqkiXYLKwUg_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, dealloc__lmwgHsdhTsrQaepFju8wew)(void* p);
N_LIB_PRIVATE N_NIMCALL(void, flushFile__fU6ZlJAtQ9bre04EDZLdGsA_2)(FILE* f);
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);
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, noscopyFile)(NimStringDesc* source, NimStringDesc* dest);
static N_INLINE(void, pushSafePoint)(TSafePoint* s);
N_LIB_PRIVATE N_NIMCALL(void, nossetFilePermissions)(NimStringDesc* filename, tySet_tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA permissions);
N_LIB_PRIVATE N_NIMCALL(tySet_tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA, nosgetFilePermissions)(NimStringDesc* filename);
static N_INLINE(void, popSafePoint)(void);
N_NIMCALL(void, reraiseException)(void);
static N_INLINE(void, popCurrentException)(void);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nostryRemoveFile)(NimStringDesc* file);
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(NIM_BOOL, nosisAbsolute)(NimStringDesc* path);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosparentDir)(NimStringDesc* path);
N_LIB_PRIVATE N_NIMCALL(int, exitStatusLikeShell__vmXOHpv9cjOB5AHi6OOlhbw)(int status);
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(tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg, getSymlinkFileKind__wTnLPNAWjgwVnuiJ9ax0ZGQ)(NimStringDesc* path);
N_LIB_PRIVATE N_NIMCALL(void, nosremoveFile)(NimStringDesc* file);
N_LIB_PRIVATE N_NIMCALL(void, nosremoveDir)(NimStringDesc* dir);
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(void, noscopyDir)(NimStringDesc* source, NimStringDesc* dest);
N_LIB_PRIVATE N_NIMCALL(void, noscreateDir)(NimStringDesc* dir);
N_LIB_PRIVATE N_NIMCALL(void, delete__FxJSSlM1HtYUBJdvsqL6Sg)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ** x, NI i);
NIM_BOOL envComputed__LLyFo9bsdu1ZXMDvAe8DhrQ;
tySequence__sM4lkSb7zS6F7OVMvW9cffQ* environment__mlhK49b6YMgc9cgrcYkKq9a3g;
extern TNimType NTI__77mFvmsOLKik79ci2hXkHEg_;
TNimType NTI__sM4lkSb7zS6F7OVMvW9cffQ_;
extern NCSTRING* environ;
extern int cmdCount;
extern NCSTRING* cmdLine;
extern tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ gch__IcYaEuuWivYAS86vFMTS3Q;
extern TNimType NTI__9bTGS9b5gqA3m1IgV71Csl0Q_;
extern TNimType NTI__K39aEGuwNdydKn2WFEpUygg_;
TNimType NTI__7q7q3E6Oj24ZNVJb9aonhAg_;
TNimType NTI__UV3llMMYFckfui8YMBuUZA_;
extern TNimType NTI__9clYsYwyjCqe2PFTuCI3Ubg_;
extern TNimType NTI__BeJgrOdDsczOwEWOZbRfKA_;
extern TNimType NTI__HMIVdYjdZYWskTmTQVo5BQ_;
extern TNimType NTI__iLZrPn9anoh9ad1MmO0RczFw_;
extern TSafePoint* excHandler__rqLlY5bs9atDw2OXYqJEn5g;
extern TSafePoint* excHandler__rqLlY5bs9atDw2OXYqJEn5g;
extern TSafePoint* excHandler__rqLlY5bs9atDw2OXYqJEn5g;
extern TSafePoint* excHandler__rqLlY5bs9atDw2OXYqJEn5g;
extern Exception* currException__9bVPeDJlYTi9bQApZpfH8wjg;
extern Exception* currException__9bVPeDJlYTi9bQApZpfH8wjg;
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_10, "index out of bounds, the container is empty", 43);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_11, "index ", 6);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_12, " not in 0 .. ", 13);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_14, " ", 1);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_15, "\'\'", 2);
static NIM_CONST tySet_tyChar__nmiMWKVIe46vacnhAFrQvw TM__yu6cxgKBBXbNsTkT9cyMd4g_16 = {
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_17, "\'", 1);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_18, "\'\"\'\"\'", 5);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_24, "HOME", 4);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_25, "/", 1);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_41, "/proc/", 6);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_42, "/path/a.out", 11);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_43, "PATH", 4);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_48, "os.nim(1212, 19) `bufsize >= 0` ", 32);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_50, "Additional info: ", 17);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_51, "unknown OS error", 16);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_52, "os.nim(1886, 11) `path != \"\"` ", 30);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_60, "Failed to create \'", 18);
NIM_CONST tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ TM__yu6cxgKBBXbNsTkT9cyMd4g_66 = {((NI) 0),
((NI) -1)}
;
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_72, "..", 2);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_88, "XDG_CONFIG_HOME", 15);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_89, ".config", 7);
STRING_LITERAL(TM__yu6cxgKBBXbNsTkT9cyMd4g_91, ".", 1);
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, addInt)(NI a, NI b) {	NI result;
{	result = (NI)0;
	result = (NI)((NU64)(a) + (NU64)(b));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (((NI) 0) <= (NI)(result ^ a));
		if (T3_) goto LA4_;
		T3_ = (((NI) 0) <= (NI)(result ^ b));
		LA4_: ;
		if (!T3_) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	raiseOverflow();
	}BeforeRet_: ;
	return result;
}
static N_INLINE(void, rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_2system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {	addZCT__Y66tOYFjgwJ0k4aLz4bc0Q((&gch__IcYaEuuWivYAS86vFMTS3Q.zct), c);
}
static N_INLINE(void, decRef__AT1eRuflKWyTTBdLjEDZbgsystem)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {	(*c).refcount = (NI)((NU64)((*c).refcount) - (NU64)(((NI) 8)));
	{
		if (!((NU64)((*c).refcount) < (NU64)(((NI) 8)))) goto LA3_;
		rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_2system(c);
	}
	LA3_: ;
}
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem)(void* usr) {	tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* result;
	result = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
	result = ((tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*) ((NI)((NU64)(((NI) (ptrdiff_t) (usr))) - (NU64)(((NI) 16)))));
	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_;
					NI TM__yu6cxgKBBXbNsTkT9cyMd4g_3;
					T5_ = (NIM_BOOL)0;
					T5_ = (i < (c ? c->Sup.len : 0));
					if (!(T5_)) goto LA6_;
					if ((NU)(i) >= (NU)(c ? c->Sup.len : 0)) raiseIndexError2(i,(c ? c->Sup.len : 0)-1);
					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;
					TM__yu6cxgKBBXbNsTkT9cyMd4g_3 = addInt(i, ((NI) 1));
					i = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_3);
				} LA4: ;
			}
			{
				if (!((c ? c->Sup.len : 0) <= i)) goto LA9_;
				goto LA1;
			}
			LA9_: ;
			if ((NU)(i) >= (NU)(c ? c->Sup.len : 0)) raiseIndexError2(i,(c ? c->Sup.len : 0)-1);
			switch (((NU8)(c->data[i]))) {
			case 39:
			case 34:
			{
				NIM_CHAR delim;
				NI TM__yu6cxgKBBXbNsTkT9cyMd4g_4;
				if ((NU)(i) >= (NU)(c ? c->Sup.len : 0)) raiseIndexError2(i,(c ? c->Sup.len : 0)-1);
				delim = c->data[i];
				TM__yu6cxgKBBXbNsTkT9cyMd4g_4 = addInt(i, ((NI) 1));
				i = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_4);
				{
					while (1) {
						NIM_BOOL T14_;
						NI TM__yu6cxgKBBXbNsTkT9cyMd4g_5;
						T14_ = (NIM_BOOL)0;
						T14_ = (i < (c ? c->Sup.len : 0));
						if (!(T14_)) goto LA15_;
						if ((NU)(i) >= (NU)(c ? c->Sup.len : 0)) raiseIndexError2(i,(c ? c->Sup.len : 0)-1);
						T14_ = !(((NU8)(c->data[i]) == (NU8)(delim)));
						LA15_: ;
						if (!T14_) goto LA13;
						if ((NU)(i) >= (NU)(c ? c->Sup.len : 0)) raiseIndexError2(i,(c ? c->Sup.len : 0)-1);
						a = addChar(a, c->data[i]);
						TM__yu6cxgKBBXbNsTkT9cyMd4g_5 = addInt(i, ((NI) 1));
						i = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_5);
					} LA13: ;
				}
				{
					NI TM__yu6cxgKBBXbNsTkT9cyMd4g_6;
					if (!(i < (c ? c->Sup.len : 0))) goto LA18_;
					TM__yu6cxgKBBXbNsTkT9cyMd4g_6 = addInt(i, ((NI) 1));
					i = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_6);
				}
				LA18_: ;
			}
			break;
			default:
			{
				{
					while (1) {
						NIM_BOOL T23_;
						NI TM__yu6cxgKBBXbNsTkT9cyMd4g_7;
						T23_ = (NIM_BOOL)0;
						T23_ = (i < (c ? c->Sup.len : 0));
						if (!(T23_)) goto LA24_;
						if ((NU)(i) >= (NU)(c ? c->Sup.len : 0)) raiseIndexError2(i,(c ? c->Sup.len : 0)-1);
						T23_ = ((NU8)(32) < (NU8)(c->data[i]));
						LA24_: ;
						if (!T23_) goto LA22;
						if ((NU)(i) >= (NU)(c ? c->Sup.len : 0)) raiseIndexError2(i,(c ? c->Sup.len : 0)-1);
						a = addChar(a, c->data[i]);
						TM__yu6cxgKBBXbNsTkT9cyMd4g_7 = addInt(i, ((NI) 1));
						i = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_7);
					} 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;
}
static N_INLINE(NI, subInt)(NI a, NI b) {	NI result;
{	result = (NI)0;
	result = (NI)((NU64)(a) - (NU64)(b));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (((NI) 0) <= (NI)(result ^ a));
		if (T3_) goto LA4_;
		T3_ = (((NI) 0) <= (NI)(result ^ (NI)((NU64) ~(b))));
		LA4_: ;
		if (!T3_) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	raiseOverflow();
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, paramCount__LYkRnwMk6UXTCs9c59cPvZsQ)(void) {	NI result;
	NI TM__yu6cxgKBBXbNsTkT9cyMd4g_8;
	result = (NI)0;
	TM__yu6cxgKBBXbNsTkT9cyMd4g_8 = subInt(cmdCount, ((NI32) 1));
	if (TM__yu6cxgKBBXbNsTkT9cyMd4g_8 < (-2147483647 -1) || TM__yu6cxgKBBXbNsTkT9cyMd4g_8 > 2147483647) raiseOverflow();
	result = ((NI) ((NI32)(TM__yu6cxgKBBXbNsTkT9cyMd4g_8)));
	return result;
}
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) {	void* T1_;
	T1_ = (void*)0;
	T1_ = memcpy(dest, source, ((size_t) (size)));
}
static N_INLINE(void, copyMem__i80o3k0SgEI5gTRCzYdyWAsystem)(void* dest, void* source, NI size) {	nimCopyMem(dest, source, size);
}
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {	{
		if (!!((src == NIM_NIL))) goto LA3_;
		copyMem__i80o3k0SgEI5gTRCzYdyWAsystem(((void*) ((&(*dest).data[(*dest).Sup.len]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1)))));
		(*dest).Sup.len += (*src).Sup.len;
	}
	LA3_: ;
}
static N_INLINE(void, incRef__AT1eRuflKWyTTBdLjEDZbg_3system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {	(*c).refcount = (NI)((NU64)((*c).refcount) + (NU64)(((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_IndexError__K39aEGuwNdydKn2WFEpUygg* eX60gensym344402_;
{	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_: ;
	eX60gensym344402_ = (tyObject_IndexError__K39aEGuwNdydKn2WFEpUygg*)0;
	eX60gensym344402_ = (tyObject_IndexError__K39aEGuwNdydKn2WFEpUygg*) newObj((&NTI__9bTGS9b5gqA3m1IgV71Csl0Q_), sizeof(tyObject_IndexError__K39aEGuwNdydKn2WFEpUygg));
	(*eX60gensym344402_).Sup.Sup.Sup.m_type = (&NTI__K39aEGuwNdydKn2WFEpUygg_);
	(*eX60gensym344402_).Sup.Sup.name = "IndexError";
	{
		NI TM__yu6cxgKBBXbNsTkT9cyMd4g_9;
		NimStringDesc* T11_;
		TM__yu6cxgKBBXbNsTkT9cyMd4g_9 = subInt(cmdCount, ((NI32) 1));
		if (TM__yu6cxgKBBXbNsTkT9cyMd4g_9 < (-2147483647 -1) || TM__yu6cxgKBBXbNsTkT9cyMd4g_9 > 2147483647) raiseOverflow();
		if (!((NI32)(TM__yu6cxgKBBXbNsTkT9cyMd4g_9) < ((NI32) 0))) goto LA9_;
		T11_ = (NimStringDesc*)0;
		T11_ = (*eX60gensym344402_).Sup.Sup.message; (*eX60gensym344402_).Sup.Sup.message = copyStringRC1(((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_10));
		if (T11_) nimGCunrefNoCycle(T11_);
	}
	goto LA7_;
	LA9_: ;
	{
		NimStringDesc* T13_;
		NimStringDesc* T14_;
		NI TM__yu6cxgKBBXbNsTkT9cyMd4g_13;
		NimStringDesc* T15_;
		T13_ = (NimStringDesc*)0;
		T14_ = (NimStringDesc*)0;
		T14_ = nimIntToStr(i);
		TM__yu6cxgKBBXbNsTkT9cyMd4g_13 = subInt(cmdCount, ((NI32) 1));
		if (TM__yu6cxgKBBXbNsTkT9cyMd4g_13 < (-2147483647 -1) || TM__yu6cxgKBBXbNsTkT9cyMd4g_13 > 2147483647) raiseOverflow();
		T15_ = (NimStringDesc*)0;
		T15_ = nimIntToStr(((NI) ((NI32)(TM__yu6cxgKBBXbNsTkT9cyMd4g_13))));
		T13_ = rawNewString((T14_ ? T14_->Sup.len : 0) + (T15_ ? T15_->Sup.len : 0) + 19);
appendString(T13_, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_11));
appendString(T13_, T14_);
appendString(T13_, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_12));
appendString(T13_, T15_);
		asgnRef((void**) (&(*eX60gensym344402_).Sup.Sup.message), T13_);
	}
	LA7_: ;
	asgnRef((void**) (&(*eX60gensym344402_).Sup.Sup.parent), NIM_NIL);
	raiseExceptionEx((Exception*)eX60gensym344402_, "IndexError", "paramStr", "os.nim", 2588);
	}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*, 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_15));
		goto BeforeRet_;
	}
	LA3_: ;
	safe = allCharsInSet__dubrHoRt3C9a0HlJjsxM5ig(s, TM__yu6cxgKBBXbNsTkT9cyMd4g_16);
	{
		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_17), ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_18));
		T10_ = rawNewString((T11_ ? T11_->Sup.len : 0) + 2);
appendString(T10_, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_17));
appendString(T10_, T11_);
appendString(T10_, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_17));
		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*, quoteShellCommand__hx0vnRJdI6UdpIN1CeQHNw)(NimStringDesc** args, NI argsLen_0) {	NimStringDesc* result;
	result = (NimStringDesc*)0;
	{
		NI i;
		NI colontmp_;
		NI i_2;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = argsLen_0;
		i_2 = ((NI) 0);
		{
			while (1) {
				NimStringDesc* T8_;
				NI TM__yu6cxgKBBXbNsTkT9cyMd4g_19;
				if (!(i_2 < colontmp_)) goto LA3;
				i = i_2;
				{
					if (!(((NI) 0) < i)) goto LA6_;
					result = resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_14));
				}
				LA6_: ;
				if ((NU)(i) >= (NU)(argsLen_0)) raiseIndexError2(i,argsLen_0-1);
				T8_ = (NimStringDesc*)0;
				T8_ = nospquoteShell(args[i]);
				result = resizeString(result, (T8_ ? T8_->Sup.len : 0) + 0);
appendString(result, T8_);
				TM__yu6cxgKBBXbNsTkT9cyMd4g_19 = addInt(i_2, ((NI) 1));
				i_2 = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_19);
			} LA3: ;
		}
	}
	return result;
}
static N_INLINE(NI, chckRange)(NI i, NI a, NI b) {	NI result;
{	result = (NI)0;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (a <= i);
		if (!(T3_)) goto LA4_;
		T3_ = (i <= b);
		LA4_: ;
		if (!T3_) goto LA5_;
		result = i;
		goto BeforeRet_;
	}
	goto LA1_;
	LA5_: ;
	{
		raiseRangeError(((NI64) (i)));
	}
	LA1_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosjoinPath)(NimStringDesc* head, NimStringDesc* tail) {	NimStringDesc* result;
	NI TM__yu6cxgKBBXbNsTkT9cyMd4g_20;
	NI state;
	result = (NimStringDesc*)0;
	TM__yu6cxgKBBXbNsTkT9cyMd4g_20 = addInt((head ? head->Sup.len : 0), (tail ? tail->Sup.len : 0));
	result = rawNewString(((NI)chckRange((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_20), ((NI) 0), ((NI) IL64(9223372036854775807)))));
	state = ((NI) 0);
	addNormalizePath__bx9csIXjBBeHkYSkIUixO1g(head, (&result), (&state), 47);
	{
		if (!((tail ? tail->Sup.len : 0) == ((NI) 0))) goto LA3_;
		result = addChar(result, 47);
	}
	goto LA1_;
	LA3_: ;
	{
		addNormalizePath__bx9csIXjBBeHkYSkIUixO1g(tail, (&result), (&state), 47);
	}
	LA1_: ;
	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) {
				NimStringDesc* T12_;
				NI T13_;
				NimStringDesc* T14_;
				NI TM__yu6cxgKBBXbNsTkT9cyMd4g_21;
				{
					NIM_BOOL T9_;
					T9_ = (NIM_BOOL)0;
					T9_ = eqeq___aqip9cmQIuefPKdd25wuEEwsystem(environ[i], NIM_NIL);
					if (!T9_) goto LA10_;
					goto LA5;
				}
				LA10_: ;
				T12_ = (NimStringDesc*)0;
				T12_ = cstrToNimstr(environ[i]);
				asgnRef((void**) (&environment__mlhK49b6YMgc9cgrcYkKq9a3g), (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV3((TGenericSeq*)(environment__mlhK49b6YMgc9cgrcYkKq9a3g), (&NTI__sM4lkSb7zS6F7OVMvW9cffQ_)));
				T13_ = environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len++;
				T14_ = (NimStringDesc*)0;
				T14_ = environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[T13_]; environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[T13_] = copyStringRC1(T12_);
				if (T14_) nimGCunrefNoCycle(T14_);
				TM__yu6cxgKBBXbNsTkT9cyMd4g_21 = addInt(i, ((NI) 1));
				i = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_21);
			}
		} LA5: ;
		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) {
				NI TM__yu6cxgKBBXbNsTkT9cyMd4g_22;
				if (!(res <= colontmp_)) goto LA5;
				i = res;
				{
					NIM_BOOL T8_;
					if ((NU)(i) >= (NU)(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)) raiseIndexError2(i,(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)-1);
					T8_ = (NIM_BOOL)0;
					T8_ = nsuStartsWith(environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[i], temp);
					if (!T8_) goto LA9_;
					result = i;
					goto BeforeRet_;
				}
				LA9_: ;
				TM__yu6cxgKBBXbNsTkT9cyMd4g_22 = addInt(res, ((NI) 1));
				res = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_22);
			} 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);
	{
		NI T5_;
		NI TM__yu6cxgKBBXbNsTkT9cyMd4g_23;
		if (!(((NI) 0) <= i)) goto LA3_;
		if ((NU)(i) >= (NU)(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)) raiseIndexError2(i,(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)-1);
		if ((NU)(i) >= (NU)(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)) raiseIndexError2(i,(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)-1);
		T5_ = (NI)0;
		T5_ = nsuFindChar(environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[i], 61, ((NI) 0), ((NI) 0));
		TM__yu6cxgKBBXbNsTkT9cyMd4g_23 = addInt(T5_, ((NI) 1));
		result = substr__iGg0RIKceRvsmvq8FUHOEw(environment__mlhK49b6YMgc9cgrcYkKq9a3g->data[i], (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_23));
		goto BeforeRet_;
	}
	goto LA1_;
	LA3_: ;
	{
		NCSTRING env;
		env = getenv(nimToCStringConv(key));
		{
			NIM_BOOL T9_;
			T9_ = (NIM_BOOL)0;
			T9_ = eqeq___aqip9cmQIuefPKdd25wuEEwsystem(env, NIM_NIL);
			if (!T9_) goto LA10_;
			result = copyString(default_0);
			goto BeforeRet_;
		}
		LA10_: ;
		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_24), ((NimStringDesc*) NIM_NIL));
	T1_ = rawNewString((T2_ ? T2_->Sup.len : 0) + 1);
appendString(T1_, T2_);
appendString(T1_, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_25));
	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;
	chckNil((void*)Result);
	genericReset((void*)Result, (&NTI__7q7q3E6Oj24ZNVJb9aonhAg_));
	namePos = ((NI) 0);
	dotPos = ((NI) 0);
	{
		NI i;
		NI colontmp_;
		NI TM__yu6cxgKBBXbNsTkT9cyMd4g_27;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		TM__yu6cxgKBBXbNsTkT9cyMd4g_27 = subInt((path ? path->Sup.len : 0), ((NI) 1));
		colontmp_ = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_27);
		res = colontmp_;
		{
			while (1) {
				NI TM__yu6cxgKBBXbNsTkT9cyMd4g_34;
				if (!(((NI) 0) <= res)) goto LA3;
				i = res;
				{
					NIM_BOOL T6_;
					T6_ = (NIM_BOOL)0;
					if ((NU)(i) >= (NU)(path ? path->Sup.len : 0)) raiseIndexError2(i,(path ? path->Sup.len : 0)-1);
					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 TM__yu6cxgKBBXbNsTkT9cyMd4g_28;
						NI TM__yu6cxgKBBXbNsTkT9cyMd4g_29;
						if ((NU)(i) >= (NU)(path ? path->Sup.len : 0)) raiseIndexError2(i,(path ? path->Sup.len : 0)-1);
						if (!(((NU8)(path->data[i])) == ((NU8)(47)) || ((NU8)(path->data[i])) == ((NU8)(47)))) goto LA12_;
						TM__yu6cxgKBBXbNsTkT9cyMd4g_28 = subInt(i, ((NI) 1));
						unsureAsgnRef((void**) (&(*Result).Field0), substr__2yh9cer0ymNRHlOOg8P7IuA(path, ((NI) 0), ((((NI) 0) >= (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_28)) ? ((NI) 0) : (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_28))));
						TM__yu6cxgKBBXbNsTkT9cyMd4g_29 = addInt(i, ((NI) 1));
						namePos = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_29);
					}
					LA12_: ;
					{
						NI TM__yu6cxgKBBXbNsTkT9cyMd4g_30;
						if (!(i < dotPos)) goto LA16_;
						TM__yu6cxgKBBXbNsTkT9cyMd4g_30 = subInt(dotPos, ((NI) 1));
						unsureAsgnRef((void**) (&(*Result).Field1), substr__2yh9cer0ymNRHlOOg8P7IuA(path, namePos, (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_30)));
						unsureAsgnRef((void**) (&(*Result).Field2), substr__iGg0RIKceRvsmvq8FUHOEw(path, dotPos));
					}
					goto LA14_;
					LA16_: ;
					{
						unsureAsgnRef((void**) (&(*Result).Field1), substr__iGg0RIKceRvsmvq8FUHOEw(path, namePos));
					}
					LA14_: ;
					goto LA1;
				}
				goto LA4_;
				LA8_: ;
				{
					NIM_BOOL T20_;
					NIM_BOOL T21_;
					NIM_BOOL T22_;
					NIM_BOOL T23_;
					NIM_BOOL T24_;
					NI TM__yu6cxgKBBXbNsTkT9cyMd4g_31;
					NI TM__yu6cxgKBBXbNsTkT9cyMd4g_32;
					NI TM__yu6cxgKBBXbNsTkT9cyMd4g_33;
					T20_ = (NIM_BOOL)0;
					T21_ = (NIM_BOOL)0;
					T22_ = (NIM_BOOL)0;
					T23_ = (NIM_BOOL)0;
					T24_ = (NIM_BOOL)0;
					if ((NU)(i) >= (NU)(path ? path->Sup.len : 0)) raiseIndexError2(i,(path ? path->Sup.len : 0)-1);
					T24_ = ((NU8)(path->data[i]) == (NU8)(46));
					if (!(T24_)) goto LA25_;
					T24_ = (((NI) 0) < i);
					LA25_: ;
					T23_ = T24_;
					if (!(T23_)) goto LA26_;
					TM__yu6cxgKBBXbNsTkT9cyMd4g_31 = subInt((path ? path->Sup.len : 0), ((NI) 1));
					T23_ = (i < (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_31));
					LA26_: ;
					T22_ = T23_;
					if (!(T22_)) goto LA27_;
					TM__yu6cxgKBBXbNsTkT9cyMd4g_32 = subInt(i, ((NI) 1));
					if ((NU)((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_32)) >= (NU)(path ? path->Sup.len : 0)) raiseIndexError2((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_32),(path ? path->Sup.len : 0)-1);
					T22_ = !((((NU8)(path->data[(NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_32)])) == ((NU8)(47)) || ((NU8)(path->data[(NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_32)])) == ((NU8)(47))));
					LA27_: ;
					T21_ = T22_;
					if (!(T21_)) goto LA28_;
					TM__yu6cxgKBBXbNsTkT9cyMd4g_33 = addInt(i, ((NI) 1));
					if ((NU)((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_33)) >= (NU)(path ? path->Sup.len : 0)) raiseIndexError2((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_33),(path ? path->Sup.len : 0)-1);
					T21_ = !(((NU8)(path->data[(NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_33)]) == (NU8)(46)));
					LA28_: ;
					T20_ = T21_;
					if (!(T20_)) goto LA29_;
					T20_ = (dotPos == ((NI) 0));
					LA29_: ;
					if (!T20_) goto LA30_;
					dotPos = i;
				}
				goto LA4_;
				LA30_: ;
				LA4_: ;
				TM__yu6cxgKBBXbNsTkT9cyMd4g_34 = subInt(res, ((NI) 1));
				res = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_34);
			} 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_: ;
	if ((NU)(((NI) 0)) >= (NU)(path ? path->Sup.len : 0)) raiseIndexError2(((NI) 0),(path ? path->Sup.len : 0)-1);
	result = ((NU8)(path->data[((NI) 0)]) == (NU8)(47));
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, nossplitPath)(NimStringDesc* path, tyTuple__UV3llMMYFckfui8YMBuUZA* Result) {	NI sepPos;
	chckNil((void*)Result);
	genericReset((void*)Result, (&NTI__UV3llMMYFckfui8YMBuUZA_));
	sepPos = ((NI) -1);
	{
		NI i;
		NI colontmp_;
		NI TM__yu6cxgKBBXbNsTkT9cyMd4g_36;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		TM__yu6cxgKBBXbNsTkT9cyMd4g_36 = subInt((path ? path->Sup.len : 0), ((NI) 1));
		colontmp_ = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_36);
		res = colontmp_;
		{
			while (1) {
				NI TM__yu6cxgKBBXbNsTkT9cyMd4g_37;
				if (!(((NI) 0) <= res)) goto LA3;
				i = res;
				{
					if ((NU)(i) >= (NU)(path ? path->Sup.len : 0)) raiseIndexError2(i,(path ? path->Sup.len : 0)-1);
					if (!(((NU8)(path->data[i])) == ((NU8)(47)) || ((NU8)(path->data[i])) == ((NU8)(47)))) goto LA6_;
					sepPos = i;
					goto LA1;
				}
				LA6_: ;
				TM__yu6cxgKBBXbNsTkT9cyMd4g_37 = subInt(res, ((NI) 1));
				res = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_37);
			} LA3: ;
		}
	} LA1: ;
	{
		NI TM__yu6cxgKBBXbNsTkT9cyMd4g_38;
		NI TM__yu6cxgKBBXbNsTkT9cyMd4g_39;
		if (!(((NI) 0) <= sepPos)) goto LA10_;
		TM__yu6cxgKBBXbNsTkT9cyMd4g_38 = subInt(sepPos, ((NI) 1));
		unsureAsgnRef((void**) (&(*Result).Field0), substr__2yh9cer0ymNRHlOOg8P7IuA(path, ((NI) 0), (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_38)));
		TM__yu6cxgKBBXbNsTkT9cyMd4g_39 = addInt(sepPos, ((NI) 1));
		unsureAsgnRef((void**) (&(*Result).Field1), substr__iGg0RIKceRvsmvq8FUHOEw(path, (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_39)));
	}
	goto LA8_;
	LA10_: ;
	{
		unsureAsgnRef((void**) (&(*Result).Field0), ((NimStringDesc*) NIM_NIL));
		unsureAsgnRef((void**) (&(*Result).Field1), copyString(path));
	}
	LA8_: ;
}
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));
	{
		NI TM__yu6cxgKBBXbNsTkT9cyMd4g_40;
		if (!(((NI) 256) < len)) goto LA3_;
		TM__yu6cxgKBBXbNsTkT9cyMd4g_40 = addInt(len, ((NI) 1));
		result = mnewString(((NI)chckRange((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_40), ((NI) 0), ((NI) IL64(9223372036854775807)))));
		len = readlink(nimToCStringConv(procPath), nimToCStringConv(result), len);
	}
	LA3_: ;
	result = setLengthStr(result, ((NI)chckRange(len, ((NI) 0), ((NI) IL64(9223372036854775807)))));
	return result;
}
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(NIM_BOOL, nosexistsFile)(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_;
		if ((NU)(((NI) 0)) >= (NU)(result ? result->Sup.len : 0)) raiseIndexError2(((NI) 0),(result ? result->Sup.len : 0)-1);
		T3_ = !(((NU8)(result->data[((NI) 0)]) == (NU8)(47)));
		LA4_: ;
		if (!T3_) goto LA5_;
		{
			NimStringDesc* p;
			NimStringDesc* colontmp_;
			NI lastX60gensym281861_;
			NI splitsX60gensym281862_;
			p = (NimStringDesc*)0;
			colontmp_ = (NimStringDesc*)0;
			colontmp_ = getEnv__hhED57tMl0Iaa5bOg9cJaig(((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_43), ((NimStringDesc*) NIM_NIL));
			lastX60gensym281861_ = ((NI) 0);
			splitsX60gensym281862_ = ((NI) -1);
			{
				while (1) {
					NI firstX60gensym281863_;
					NI TM__yu6cxgKBBXbNsTkT9cyMd4g_45;
					NimStringDesc* x;
					NI TM__yu6cxgKBBXbNsTkT9cyMd4g_46;
					NI TM__yu6cxgKBBXbNsTkT9cyMd4g_47;
					if (!(lastX60gensym281861_ <= (colontmp_ ? colontmp_->Sup.len : 0))) goto LA9;
					firstX60gensym281863_ = lastX60gensym281861_;
					{
						while (1) {
							NIM_BOOL T12_;
							NI TM__yu6cxgKBBXbNsTkT9cyMd4g_44;
							T12_ = (NIM_BOOL)0;
							T12_ = (lastX60gensym281861_ < (colontmp_ ? colontmp_->Sup.len : 0));
							if (!(T12_)) goto LA13_;
							if ((NU)(lastX60gensym281861_) >= (NU)(colontmp_ ? colontmp_->Sup.len : 0)) raiseIndexError2(lastX60gensym281861_,(colontmp_ ? colontmp_->Sup.len : 0)-1);
							T12_ = !((((NU8)(colontmp_->data[lastX60gensym281861_])) == ((NU8)(58))));
							LA13_: ;
							if (!T12_) goto LA11;
							TM__yu6cxgKBBXbNsTkT9cyMd4g_44 = addInt(lastX60gensym281861_, ((NI) 1));
							lastX60gensym281861_ = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_44);
						} LA11: ;
					}
					{
						if (!(splitsX60gensym281862_ == ((NI) 0))) goto LA16_;
						lastX60gensym281861_ = (colontmp_ ? colontmp_->Sup.len : 0);
					}
					LA16_: ;
					TM__yu6cxgKBBXbNsTkT9cyMd4g_45 = subInt(lastX60gensym281861_, ((NI) 1));
					p = substr__2yh9cer0ymNRHlOOg8P7IuA(colontmp_, firstX60gensym281863_, (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_45));
					x = nosjoinPath(p, result);
					{
						NIM_BOOL T20_;
						T20_ = (NIM_BOOL)0;
						T20_ = nosexistsFile(x);
						if (!T20_) goto LA21_;
						result = copyString(x);
						goto BeforeRet_;
					}
					LA21_: ;
					{
						if (!(splitsX60gensym281862_ == ((NI) 0))) goto LA25_;
						goto LA8;
					}
					LA25_: ;
					TM__yu6cxgKBBXbNsTkT9cyMd4g_46 = subInt(splitsX60gensym281862_, ((NI) 1));
					splitsX60gensym281862_ = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_46);
					TM__yu6cxgKBBXbNsTkT9cyMd4g_47 = addInt(lastX60gensym281861_, ((NI) 1));
					lastX60gensym281861_ = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_47);
				} 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_41));
appendString(T1_, T3_);
appendString(T1_, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_42));
	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;
}
static N_INLINE(NIM_CHAR, X5BX5D___okzHJ6GE9cv0bYG3b4r5KCAsystem)(NimStringDesc* s, NI i) {	NIM_CHAR result;
	NI TM__yu6cxgKBBXbNsTkT9cyMd4g_49;
	result = (NIM_CHAR)0;
	TM__yu6cxgKBBXbNsTkT9cyMd4g_49 = subInt((s ? s->Sup.len : 0), i);
	if ((NU)((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_49)) >= (NU)(s ? s->Sup.len : 0)) raiseIndexError2((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_49),(s ? s->Sup.len : 0)-1);
	result = s->data[(NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_49)];
	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_50));
		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_51));
		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)chckRange(bufsize, ((NI) 0), ((NI) IL64(9223372036854775807)))));
	{
		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)chckRange(T9_, ((NI) 0), ((NI) IL64(9223372036854775807)))));
				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_48));
					}
					LA17_: ;
					result = mnewString(((NI)chckRange(bufsize, ((NI) 0), ((NI) IL64(9223372036854775807)))));
				}
				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));
	{
		if (!!(!(((path ? path->Sup.len : 0) == 0)))) goto LA3_;
		failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_52));
	}
	LA3_: ;
	{
		NIM_BOOL T7_;
		int T8_;
		T7_ = (NIM_BOOL)0;
		T8_ = (int)0;
		T8_ = stat(nimToCStringConv(path), (&s));
		T7_ = (T8_ == ((NI32) 0));
		if (!(T7_)) goto LA9_;
		T7_ = S_ISDIR(s.st_mode);
		LA9_: ;
		if (!T7_) goto LA10_;
		result = ((tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg) 3);
	}
	goto LA5_;
	LA10_: ;
	{
		result = ((tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg) 1);
	}
	LA5_: ;
	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_;
		if ((NU)(((NI) 0)) >= (NU)(path ? path->Sup.len : 0)) raiseIndexError2(((NI) 0),(path ? path->Sup.len : 0)-1);
		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 ((NU)(((NI) 1)) >= (NU)(path ? path->Sup.len : 0)) raiseIndexError2(((NI) 1),(path ? path->Sup.len : 0)-1);
		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*, 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_, ((NimStringDesc*) NIM_NIL));
	}
	goto LA1_;
	LA3_: ;
	{
		result = cstrToNimstr(r);
		free(((void*) (r)));
	}
	LA1_: ;
	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) {
			NIM_BOOL T7_;
			NI TM__yu6cxgKBBXbNsTkT9cyMd4g_53;
			NI TM__yu6cxgKBBXbNsTkT9cyMd4g_54;
			T7_ = (NIM_BOOL)0;
			T7_ = (((NI) 1) <= i);
			if (!(T7_)) goto LA8_;
			TM__yu6cxgKBBXbNsTkT9cyMd4g_53 = subInt(i, ((NI) 1));
			if ((NU)((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_53)) >= (NU)((*path) ? (*path)->Sup.len : 0)) raiseIndexError2((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_53),((*path) ? (*path)->Sup.len : 0)-1);
			T7_ = (((NU8)((*path)->data[(NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_53)])) == ((NU8)(47)) || ((NU8)((*path)->data[(NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_53)])) == ((NU8)(47)));
			LA8_: ;
			if (!T7_) goto LA6;
			TM__yu6cxgKBBXbNsTkT9cyMd4g_54 = subInt(i, ((NI) 1));
			i = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_54);
		} LA6: ;
	}
	{
		if (!trailingSep) goto LA11_;
		unsureAsgnRef((void**) (&(*path)), setLengthStr((*path), ((NI)chckRange(i, ((NI) 0), ((NI) IL64(9223372036854775807))))));
		unsureAsgnRef((void**) (&(*path)), addChar((*path), 47));
	}
	goto LA9_;
	LA11_: ;
	{
		if (!(((NI) 0) < i)) goto LA14_;
		unsureAsgnRef((void**) (&(*path)), setLengthStr((*path), ((NI)chckRange(i, ((NI) 0), ((NI) IL64(9223372036854775807))))));
	}
	goto LA9_;
	LA14_: ;
	{
		unsureAsgnRef((void**) (&(*path)), copyString(((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_25)));
	}
	LA9_: ;
	}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(NI, parentDirPos__sw9aya5BvknC6WiJX9aEYn9ag)(NimStringDesc* path) {	NI result;
	NI q;
{	result = (NI)0;
	q = ((NI) 1);
	{
		NIM_BOOL T3_;
		NI TM__yu6cxgKBBXbNsTkT9cyMd4g_55;
		T3_ = (NIM_BOOL)0;
		T3_ = (((NI) 1) <= (path ? path->Sup.len : 0));
		if (!(T3_)) goto LA4_;
		TM__yu6cxgKBBXbNsTkT9cyMd4g_55 = subInt((path ? path->Sup.len : 0), ((NI) 1));
		if ((NU)((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_55)) >= (NU)(path ? path->Sup.len : 0)) raiseIndexError2((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_55),(path ? path->Sup.len : 0)-1);
		T3_ = (((NU8)(path->data[(NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_55)])) == ((NU8)(47)) || ((NU8)(path->data[(NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_55)])) == ((NU8)(47)));
		LA4_: ;
		if (!T3_) goto LA5_;
		q = ((NI) 2);
	}
	LA5_: ;
	{
		NI i;
		NI colontmp_;
		NI TM__yu6cxgKBBXbNsTkT9cyMd4g_56;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		TM__yu6cxgKBBXbNsTkT9cyMd4g_56 = subInt((path ? path->Sup.len : 0), q);
		colontmp_ = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_56);
		res = colontmp_;
		{
			while (1) {
				NI TM__yu6cxgKBBXbNsTkT9cyMd4g_57;
				if (!(((NI) 0) <= res)) goto LA9;
				i = res;
				{
					if ((NU)(i) >= (NU)(path ? path->Sup.len : 0)) raiseIndexError2(i,(path ? path->Sup.len : 0)-1);
					if (!(((NU8)(path->data[i])) == ((NU8)(47)) || ((NU8)(path->data[i])) == ((NU8)(47)))) goto LA12_;
					result = i;
					goto BeforeRet_;
				}
				LA12_: ;
				TM__yu6cxgKBBXbNsTkT9cyMd4g_57 = subInt(res, ((NI) 1));
				res = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_57);
			} LA9: ;
		}
	}
	result = ((NI) -1);
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nosparentDir)(NimStringDesc* path) {	NimStringDesc* result;
	NI sepPos;
	result = (NimStringDesc*)0;
	result = normalizePathEnd__cQ9bfE8YwK2s9aQkxFkMKhYg(path, NIM_FALSE);
	sepPos = parentDirPos__sw9aya5BvknC6WiJX9aEYn9ag(result);
	{
		if (!(((NI) 0) <= sepPos)) goto LA3_;
		{
			while (1) {
				NIM_BOOL T7_;
				NI TM__yu6cxgKBBXbNsTkT9cyMd4g_58;
				T7_ = (NIM_BOOL)0;
				T7_ = (((NI) 0) <= sepPos);
				if (!(T7_)) goto LA8_;
				if ((NU)(sepPos) >= (NU)(result ? result->Sup.len : 0)) raiseIndexError2(sepPos,(result ? result->Sup.len : 0)-1);
				T7_ = (((NU8)(result->data[sepPos])) == ((NU8)(47)) || ((NU8)(result->data[sepPos])) == ((NU8)(47)));
				LA8_: ;
				if (!T7_) goto LA6;
				TM__yu6cxgKBBXbNsTkT9cyMd4g_58 = subInt(sepPos, ((NI) 1));
				sepPos = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_58);
			} LA6: ;
		}
		result = substr__2yh9cer0ymNRHlOOg8P7IuA(result, ((NI) 0), sepPos);
	}
	goto LA1_;
	LA3_: ;
	{
		result = ((NimStringDesc*) NIM_NIL);
	}
	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)chckRange(EEXIST, ((NI) 0), ((NI) 65535))) || errno == ((NI)chckRange(ENOSYS, ((NI) 0), ((NI) 65535))))) 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, nosexistsDir)(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* eX60gensym342430_;
			NimStringDesc* T11_;
			T8_ = (NIM_BOOL)0;
			T8_ = nosexistsDir(dir);
			if (!!(T8_)) goto LA9_;
			eX60gensym342430_ = (tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw*)0;
			eX60gensym342430_ = (tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw*) newObj((&NTI__HMIVdYjdZYWskTmTQVo5BQ_), sizeof(tyObject_IOError__iLZrPn9anoh9ad1MmO0RczFw));
			(*eX60gensym342430_).Sup.Sup.Sup.m_type = (&NTI__iLZrPn9anoh9ad1MmO0RczFw_);
			(*eX60gensym342430_).Sup.Sup.name = "IOError";
			T11_ = (NimStringDesc*)0;
			T11_ = rawNewString((dir ? dir->Sup.len : 0) + 19);
appendString(T11_, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_60));
appendString(T11_, dir);
appendString(T11_, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_17));
			asgnRef((void**) (&(*eX60gensym342430_).Sup.Sup.message), T11_);
			asgnRef((void**) (&(*eX60gensym342430_).Sup.Sup.parent), NIM_NIL);
			raiseExceptionEx((Exception*)eX60gensym342430_, "IOError", "existsOrCreateDir", "os.nim", 2133);
		}
		LA9_: ;
	}
	LA4_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, noscreateDir)(NimStringDesc* dir) {	NIM_BOOL omitNext;
	omitNext = NIM_FALSE;
	{
		NI i;
		NI colontmp_;
		NI TM__yu6cxgKBBXbNsTkT9cyMd4g_59;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		TM__yu6cxgKBBXbNsTkT9cyMd4g_59 = subInt((dir ? dir->Sup.len : 0), ((NI) 1));
		colontmp_ = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_59);
		res = ((NI) 1);
		{
			while (1) {
				NI TM__yu6cxgKBBXbNsTkT9cyMd4g_62;
				if (!(res <= colontmp_)) goto LA3;
				i = res;
				{
					if ((NU)(i) >= (NU)(dir ? dir->Sup.len : 0)) raiseIndexError2(i,(dir ? dir->Sup.len : 0)-1);
					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_: ;
					{
						NI TM__yu6cxgKBBXbNsTkT9cyMd4g_61;
						NimStringDesc* T13_;
						NIM_BOOL T14_;
						TM__yu6cxgKBBXbNsTkT9cyMd4g_61 = subInt(i, ((NI) 1));
						T13_ = (NimStringDesc*)0;
						T13_ = substr__2yh9cer0ymNRHlOOg8P7IuA(dir, ((NI) 0), (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_61));
						T14_ = (NIM_BOOL)0;
						T14_ = nosexistsOrCreateDir(T13_);
						(void)(T14_);
					}
					LA8_: ;
				}
				LA6_: ;
				TM__yu6cxgKBBXbNsTkT9cyMd4g_62 = addInt(res, ((NI) 1));
				res = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_62);
			} 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 TM__yu6cxgKBBXbNsTkT9cyMd4g_63;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		TM__yu6cxgKBBXbNsTkT9cyMd4g_63 = subInt((path ? path->Sup.len : 0), ((NI) 1));
		colontmp_ = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_63);
		res = colontmp_;
		{
			while (1) {
				NI TM__yu6cxgKBBXbNsTkT9cyMd4g_64;
				if (!(((NI) 1) <= res)) goto LA3;
				i = res;
				{
					if ((NU)(i) >= (NU)(path ? path->Sup.len : 0)) raiseIndexError2(i,(path ? path->Sup.len : 0)-1);
					if (!((NU8)(path->data[i]) == (NU8)(46))) goto LA6_;
					result = i;
					goto LA1;
				}
				goto LA4_;
				LA6_: ;
				{
					if ((NU)(i) >= (NU)(path ? path->Sup.len : 0)) raiseIndexError2(i,(path ? path->Sup.len : 0)-1);
					if (!(((NU8)(path->data[i])) == ((NU8)(47)) || ((NU8)(path->data[i])) == ((NU8)(47)))) goto LA9_;
					goto LA1;
				}
				goto LA4_;
				LA9_: ;
				LA4_: ;
				TM__yu6cxgKBBXbNsTkT9cyMd4g_64 = subInt(res, ((NI) 1));
				res = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_64);
			} 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_;
		if ((NU)(((NI) 0)) >= (NU)(ext ? ext->Sup.len : 0)) raiseIndexError2(((NI) 0),(ext ? ext->Sup.len : 0)-1);
		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_;
		NI TM__yu6cxgKBBXbNsTkT9cyMd4g_65;
		NimStringDesc* T9_;
		NimStringDesc* T10_;
		T8_ = (NimStringDesc*)0;
		TM__yu6cxgKBBXbNsTkT9cyMd4g_65 = subInt(extPos, ((NI) 1));
		T9_ = (NimStringDesc*)0;
		T9_ = substr__2yh9cer0ymNRHlOOg8P7IuA(filename, ((NI) 0), (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_65));
		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(NimStringDesc*, nosrelativePath)(NimStringDesc* path, NimStringDesc* base, NIM_CHAR sep) {	NimStringDesc* result;
	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_: ;
	nimZeroMem((void*)(&f), sizeof(tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg));
	nimZeroMem((void*)(&b), sizeof(tyObject_PathIter__tllF14xUpDWpqG9ci5sg9bMg));
	ff = TM__yu6cxgKBBXbNsTkT9cyMd4g_66;
	bb = TM__yu6cxgKBBXbNsTkT9cyMd4g_66;
	result = rawNewString(((NI)chckRange((path ? path->Sup.len : 0), ((NI) 0), ((NI) IL64(9223372036854775807)))));
	{
		while (1) {
			NIM_BOOL T7_;
			NI diff;
			NI TM__yu6cxgKBBXbNsTkT9cyMd4g_67;
			NIM_BOOL same;
			NI colontmp_;
			NI colontmp__2;
			NI colontmp__3;
			NI colontmp__4;
			T7_ = (NIM_BOOL)0;
			T7_ = hasNext__ecfBf9bSnUlnf5OQ0NQMxpQ(f, path);
			if (!(T7_)) goto LA8_;
			T7_ = hasNext__ecfBf9bSnUlnf5OQ0NQMxpQ(b, base);
			LA8_: ;
			if (!T7_) goto LA6;
			ff = next__am1q4dBd9cls9au5CcmkX5oA((&f), path);
			bb = next__am1q4dBd9cls9au5CcmkX5oA((&b), base);
			TM__yu6cxgKBBXbNsTkT9cyMd4g_67 = subInt(ff.Field1, ff.Field0);
			diff = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_67);
			{
				NI TM__yu6cxgKBBXbNsTkT9cyMd4g_68;
				TM__yu6cxgKBBXbNsTkT9cyMd4g_68 = subInt(bb.Field1, bb.Field0);
				if (!!((diff == (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_68)))) goto LA11_;
				goto LA5;
			}
			LA11_: ;
			same = NIM_TRUE;
			{
				NI i;
				NI res;
				i = (NI)0;
				res = ((NI) 0);
				{
					while (1) {
						NI TM__yu6cxgKBBXbNsTkT9cyMd4g_71;
						if (!(res <= diff)) goto LA15;
						i = res;
						{
							NI TM__yu6cxgKBBXbNsTkT9cyMd4g_69;
							NI TM__yu6cxgKBBXbNsTkT9cyMd4g_70;
							TM__yu6cxgKBBXbNsTkT9cyMd4g_69 = addInt(i, ff.Field0);
							if ((NU)((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_69)) >= (NU)(path ? path->Sup.len : 0)) raiseIndexError2((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_69),(path ? path->Sup.len : 0)-1);
							TM__yu6cxgKBBXbNsTkT9cyMd4g_70 = addInt(i, bb.Field0);
							if ((NU)((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_70)) >= (NU)(base ? base->Sup.len : 0)) raiseIndexError2((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_70),(base ? base->Sup.len : 0)-1);
							if (!!(((NU8)(path->data[(NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_69)]) == (NU8)(base->data[(NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_70)])))) goto LA18_;
							same = NIM_FALSE;
							goto LA13;
						}
						LA18_: ;
						TM__yu6cxgKBBXbNsTkT9cyMd4g_71 = addInt(res, ((NI) 1));
						res = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_71);
					} LA15: ;
				}
			} LA13: ;
			{
				if (!!(same)) goto LA22_;
				goto LA5;
			}
			LA22_: ;
			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;
		} LA6: ;
	} LA5: ;
	{
		while (1) {
			{
				if (!(bb.Field0 <= bb.Field1)) goto LA28_;
				{
					NIM_BOOL T32_;
					NIM_CHAR T34_;
					T32_ = (NIM_BOOL)0;
					T32_ = (((NI) 0) < (result ? result->Sup.len : 0));
					if (!(T32_)) goto LA33_;
					T34_ = (NIM_CHAR)0;
					T34_ = X5BX5D___okzHJ6GE9cv0bYG3b4r5KCAsystem(result, ((NI) 1));
					T32_ = !(((NU8)(T34_) == (NU8)(sep)));
					LA33_: ;
					if (!T32_) goto LA35_;
					result = addChar(result, sep);
				}
				LA35_: ;
				result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_72));
			}
			LA28_: ;
			{
				NIM_BOOL T39_;
				T39_ = (NIM_BOOL)0;
				T39_ = hasNext__ecfBf9bSnUlnf5OQ0NQMxpQ(b, base);
				if (!!(T39_)) goto LA40_;
				goto LA24;
			}
			LA40_: ;
			bb = next__am1q4dBd9cls9au5CcmkX5oA((&b), base);
		}
	} LA24: ;
	{
		while (1) {
			{
				if (!(ff.Field0 <= ff.Field1)) goto LA46_;
				{
					NIM_BOOL T50_;
					NIM_CHAR T52_;
					T50_ = (NIM_BOOL)0;
					T50_ = (((NI) 0) < (result ? result->Sup.len : 0));
					if (!(T50_)) goto LA51_;
					T52_ = (NIM_CHAR)0;
					T52_ = X5BX5D___okzHJ6GE9cv0bYG3b4r5KCAsystem(result, ((NI) 1));
					T50_ = !(((NU8)(T52_) == (NU8)(sep)));
					LA51_: ;
					if (!T50_) goto LA53_;
					result = addChar(result, sep);
				}
				LA53_: ;
				{
					NI i_2;
					NI colontmp__5;
					NI TM__yu6cxgKBBXbNsTkT9cyMd4g_73;
					NI res_2;
					i_2 = (NI)0;
					colontmp__5 = (NI)0;
					TM__yu6cxgKBBXbNsTkT9cyMd4g_73 = subInt(ff.Field1, ff.Field0);
					colontmp__5 = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_73);
					res_2 = ((NI) 0);
					{
						while (1) {
							NI TM__yu6cxgKBBXbNsTkT9cyMd4g_74;
							NI TM__yu6cxgKBBXbNsTkT9cyMd4g_75;
							if (!(res_2 <= colontmp__5)) goto LA57;
							i_2 = res_2;
							TM__yu6cxgKBBXbNsTkT9cyMd4g_74 = addInt(i_2, ff.Field0);
							if ((NU)((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_74)) >= (NU)(path ? path->Sup.len : 0)) raiseIndexError2((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_74),(path ? path->Sup.len : 0)-1);
							result = addChar(result, path->data[(NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_74)]);
							TM__yu6cxgKBBXbNsTkT9cyMd4g_75 = addInt(res_2, ((NI) 1));
							res_2 = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_75);
						} LA57: ;
					}
				}
			}
			LA46_: ;
			{
				NIM_BOOL T60_;
				T60_ = (NIM_BOOL)0;
				T60_ = hasNext__ecfBf9bSnUlnf5OQ0NQMxpQ(f, path);
				if (!!(T60_)) goto LA61_;
				goto LA42;
			}
			LA61_: ;
			ff = next__am1q4dBd9cls9au5CcmkX5oA((&f), path);
		}
	} LA42: ;
	}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(NimStringDesc*, nosextractFilename)(NimStringDesc* path) {	NimStringDesc* result;
	result = (NimStringDesc*)0;
	{
		NIM_BOOL T3_;
		NI TM__yu6cxgKBBXbNsTkT9cyMd4g_76;
		T3_ = (NIM_BOOL)0;
		T3_ = ((path ? path->Sup.len : 0) == ((NI) 0));
		if (T3_) goto LA4_;
		TM__yu6cxgKBBXbNsTkT9cyMd4g_76 = subInt((path ? path->Sup.len : 0), ((NI) 1));
		if ((NU)((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_76)) >= (NU)(path ? path->Sup.len : 0)) raiseIndexError2((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_76),(path ? path->Sup.len : 0)-1);
		T3_ = (((NU8)(path->data[(NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_76)])) == ((NU8)(47)) || ((NU8)(path->data[(NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_76)])) == ((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(void, putEnv__YVZCqlK3fKyVR367JpYgKA)(NimStringDesc* key, NimStringDesc* val) {	NI indx;
	indx = findEnvVar__4kc4cxzsC7aY1IOKtOGazA(key);
	{
		NimStringDesc* T5_;
		if (!(((NI) 0) <= indx)) goto LA3_;
		if ((NU)(indx) >= (NU)(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)) raiseIndexError2(indx,(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)-1);
		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_;
		if ((NU)(indx) >= (NU)(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)) raiseIndexError2(indx,(environment__mlhK49b6YMgc9cgrcYkKq9a3g ? environment__mlhK49b6YMgc9cgrcYkKq9a3g->Sup.len : 0)-1);
		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_: ;
}
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_;
		NI TM__yu6cxgKBBXbNsTkT9cyMd4g_77;
		T3_ = (NIM_BOOL)0;
		T3_ = WIFSIGNALED(status);
		if (!T3_) goto LA4_;
		T6_ = (int)0;
		T6_ = WTERMSIG(status);
		TM__yu6cxgKBBXbNsTkT9cyMd4g_77 = addInt(((NI32) 128), T6_);
		if (TM__yu6cxgKBBXbNsTkT9cyMd4g_77 < (-2147483647 -1) || TM__yu6cxgKBBXbNsTkT9cyMd4g_77 > 2147483647) raiseOverflow();
		result = (NI32)(TM__yu6cxgKBBXbNsTkT9cyMd4g_77);
	}
	goto LA1_;
	LA4_: ;
	{
		result = WEXITSTATUS(status);
	}
	LA1_: ;
	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_, ((NimStringDesc*) NIM_NIL));
	}
	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_, ((NimStringDesc*) NIM_NIL));
	}
	LA10_: ;
	buf = alloc__WrVG9abV9chlTLqkiXYLKwUg_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)chckRange(bytesread, ((NI) 0), ((NI) IL64(9223372036854775807)))));
				{
					NI32 T23_;
					if (!!((bytesread == byteswritten))) goto LA21_;
					dealloc__lmwgHsdhTsrQaepFju8wew(buf);
					close__fU6ZlJAtQ9bre04EDZLdGsA_3(s);
					close__fU6ZlJAtQ9bre04EDZLdGsA_3(d);
					T23_ = (NI32)0;
					T23_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
					raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T23_, ((NimStringDesc*) NIM_NIL));
				}
				LA21_: ;
			}
			LA17_: ;
			{
				if (!!((bytesread == ((NI) 8000)))) goto LA26_;
				goto LA13;
			}
			LA26_: ;
		}
	} LA13: ;
	dealloc__lmwgHsdhTsrQaepFju8wew(buf);
	close__fU6ZlJAtQ9bre04EDZLdGsA_3(s);
	flushFile__fU6ZlJAtQ9bre04EDZLdGsA_2(d);
	close__fU6ZlJAtQ9bre04EDZLdGsA_3(d);
}
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)chckRange(ts.tv_nsec, ((NI) 0), ((NI) 999999999))));
	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_, ((NimStringDesc*) NIM_NIL));
	}
	LA4_: ;
	T7_ = st_mtim__pE9cdzno9aFK08QQxSwtkHRgposix(res);
	result = toTime__ijMjyFbtGRbszYH28YzkiQos(T7_);
	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_;
	result = (NIM_BOOL)0;
	T1_ = nosgetLastModificationTime(b);
	T2_ = nosgetLastModificationTime(a);
	result = ntLeTime(T1_, T2_);
	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;
}
static N_INLINE(void, pushSafePoint)(TSafePoint* s) {	(*s).hasRaiseAction = NIM_FALSE;
	(*s).prev = excHandler__rqLlY5bs9atDw2OXYqJEn5g;
	excHandler__rqLlY5bs9atDw2OXYqJEn5g = s;
}
N_LIB_PRIVATE N_NIMCALL(void, nossetFilePermissions)(NimStringDesc* filename, tySet_tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA permissions) {	mode_t p;
	p = ((mode_t) 0);
	{
		if (!((permissions &(1U<<((NU)(((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 2))&15U)))!=0)) goto LA3_;
		p = (NU32)(p | ((mode_t) (S_IRUSR)));
	}
	LA3_: ;
	{
		if (!((permissions &(1U<<((NU)(((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 1))&15U)))!=0)) goto LA7_;
		p = (NU32)(p | ((mode_t) (S_IWUSR)));
	}
	LA7_: ;
	{
		if (!((permissions &(1U<<((NU)(((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 0))&15U)))!=0)) goto LA11_;
		p = (NU32)(p | ((mode_t) (S_IXUSR)));
	}
	LA11_: ;
	{
		if (!((permissions &(1U<<((NU)(((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 5))&15U)))!=0)) goto LA15_;
		p = (NU32)(p | ((mode_t) (S_IRGRP)));
	}
	LA15_: ;
	{
		if (!((permissions &(1U<<((NU)(((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 4))&15U)))!=0)) goto LA19_;
		p = (NU32)(p | ((mode_t) (S_IWGRP)));
	}
	LA19_: ;
	{
		if (!((permissions &(1U<<((NU)(((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 3))&15U)))!=0)) goto LA23_;
		p = (NU32)(p | ((mode_t) (S_IXGRP)));
	}
	LA23_: ;
	{
		if (!((permissions &(1U<<((NU)(((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 8))&15U)))!=0)) goto LA27_;
		p = (NU32)(p | ((mode_t) (S_IROTH)));
	}
	LA27_: ;
	{
		if (!((permissions &(1U<<((NU)(((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 7))&15U)))!=0)) goto LA31_;
		p = (NU32)(p | ((mode_t) (S_IWOTH)));
	}
	LA31_: ;
	{
		if (!((permissions &(1U<<((NU)(((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) 6))&15U)))!=0)) goto LA35_;
		p = (NU32)(p | ((mode_t) (S_IXOTH)));
	}
	LA35_: ;
	{
		int T39_;
		NI32 T42_;
		T39_ = (int)0;
		T39_ = chmod(nimToCStringConv(filename), ((mode_t) (p)));
		if (!!((T39_ == ((NI32) 0)))) goto LA40_;
		T42_ = (NI32)0;
		T42_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
		raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T42_, ((NimStringDesc*) NIM_NIL));
	}
	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_, ((NimStringDesc*) NIM_NIL));
	}
	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;
}
static N_INLINE(void, popSafePoint)(void) {	excHandler__rqLlY5bs9atDw2OXYqJEn5g = (*excHandler__rqLlY5bs9atDw2OXYqJEn5g).prev;
}
static N_INLINE(void, popCurrentException)(void) {	asgnRef((void**) (&currException__9bVPeDJlYTi9bQApZpfH8wjg), (*currException__9bVPeDJlYTi9bQApZpfH8wjg).up);
}
N_LIB_PRIVATE N_NIMCALL(void, copyFileWithPermissions__H9b5Dl0Yjd60VeosKvlvXkA)(NimStringDesc* source, NimStringDesc* dest, NIM_BOOL ignorePermissionErrors) {	TSafePoint TM__yu6cxgKBBXbNsTkT9cyMd4g_78;
	noscopyFile(source, dest);
	pushSafePoint(&TM__yu6cxgKBBXbNsTkT9cyMd4g_78);
	TM__yu6cxgKBBXbNsTkT9cyMd4g_78.status = _setjmp(TM__yu6cxgKBBXbNsTkT9cyMd4g_78.context);
	if (TM__yu6cxgKBBXbNsTkT9cyMd4g_78.status == 0) {
		tySet_tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA T2_;
		T2_ = nosgetFilePermissions(source);
		nossetFilePermissions(dest, T2_);
		popSafePoint();
	}
	else {
		popSafePoint();
		{
			TM__yu6cxgKBBXbNsTkT9cyMd4g_78.status = 0;
			{
				if (!!(ignorePermissionErrors)) goto LA7_;
				reraiseException();
			}
			LA7_: ;
			popCurrentException();
		}
	}
	if (TM__yu6cxgKBBXbNsTkT9cyMd4g_78.status != 0) reraiseException();
}
N_LIB_PRIVATE N_NIMCALL(void, nosremoveFile)(NimStringDesc* file) {	{
		NIM_BOOL T3_;
		NI32 T6_;
		NCSTRING T7_;
		NimStringDesc* T8_;
		T3_ = (NIM_BOOL)0;
		T3_ = nostryRemoveFile(file);
		if (!!(T3_)) goto LA4_;
		T6_ = (NI32)0;
		T6_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
		T7_ = (NCSTRING)0;
		T7_ = strerror(errno);
		T8_ = (NimStringDesc*)0;
		T8_ = cstrToNimstr(T7_);
		raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T6_, T8_);
	}
	LA4_: ;
}
static N_INLINE(NI, find__31wM5Ui9c8jnrQ5QD4oPxOQsystem)(NIM_CHAR* a, NI aLen_0, NIM_CHAR item) {	NI result;
{	result = (NI)0;
	{
		NIM_CHAR i;
		NI i_2;
		i = (NIM_CHAR)0;
		i_2 = ((NI) 0);
		{
			while (1) {
				NI TM__yu6cxgKBBXbNsTkT9cyMd4g_79;
				NI TM__yu6cxgKBBXbNsTkT9cyMd4g_80;
				if (!(i_2 < aLen_0)) goto LA3;
				if ((NU)(i_2) >= (NU)(aLen_0)) raiseIndexError2(i_2,aLen_0-1);
				i = a[i_2];
				{
					if (!((NU8)(i) == (NU8)(item))) goto LA6_;
					goto BeforeRet_;
				}
				LA6_: ;
				TM__yu6cxgKBBXbNsTkT9cyMd4g_79 = addInt(result, ((NI) 1));
				result = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_79);
				TM__yu6cxgKBBXbNsTkT9cyMd4g_80 = addInt(i_2, ((NI) 1));
				i_2 = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_80);
			} 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* extX60gensym333408_;
			NI i;
			extX60gensym333408_ = (NimStringDesc*)0;
			i = ((NI) 0);
			{
				while (1) {
					NI TM__yu6cxgKBBXbNsTkT9cyMd4g_81;
					if (!(i < extensionsLen_0)) goto LA12;
					if ((NU)(i) >= (NU)(extensionsLen_0)) raiseIndexError2(i,extensionsLen_0-1);
					extX60gensym333408_ = extensions[i];
					result = nosaddFileExt(exe, extX60gensym333408_);
					{
						NIM_BOOL T15_;
						T15_ = (NIM_BOOL)0;
						T15_ = nosexistsFile(result);
						if (!T15_) goto LA16_;
						goto BeforeRet_;
					}
					LA16_: ;
					TM__yu6cxgKBBXbNsTkT9cyMd4g_81 = addInt(i, ((NI) 1));
					i = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_81);
				} LA12: ;
			}
		}
	}
	LA8_: ;
	path = getEnv__hhED57tMl0Iaa5bOg9cJaig(((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_43), ((NimStringDesc*) NIM_NIL));
	{
		NimStringDesc* candidate;
		NI lastX60gensym281812_;
		NI splitsX60gensym281813_;
		candidate = (NimStringDesc*)0;
		lastX60gensym281812_ = ((NI) 0);
		splitsX60gensym281813_ = ((NI) -1);
		{
			while (1) {
				NI firstX60gensym281814_;
				NI TM__yu6cxgKBBXbNsTkT9cyMd4g_83;
				NI TM__yu6cxgKBBXbNsTkT9cyMd4g_86;
				NI TM__yu6cxgKBBXbNsTkT9cyMd4g_87;
				if (!(lastX60gensym281812_ <= (path ? path->Sup.len : 0))) goto LA20;
				firstX60gensym281814_ = lastX60gensym281812_;
				{
					while (1) {
						NIM_BOOL T23_;
						NI TM__yu6cxgKBBXbNsTkT9cyMd4g_82;
						T23_ = (NIM_BOOL)0;
						T23_ = (lastX60gensym281812_ < (path ? path->Sup.len : 0));
						if (!(T23_)) goto LA24_;
						if ((NU)(lastX60gensym281812_) >= (NU)(path ? path->Sup.len : 0)) raiseIndexError2(lastX60gensym281812_,(path ? path->Sup.len : 0)-1);
						T23_ = !(((NU8)(path->data[lastX60gensym281812_]) == (NU8)(58)));
						LA24_: ;
						if (!T23_) goto LA22;
						TM__yu6cxgKBBXbNsTkT9cyMd4g_82 = addInt(lastX60gensym281812_, ((NI) 1));
						lastX60gensym281812_ = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_82);
					} LA22: ;
				}
				{
					if (!(splitsX60gensym281813_ == ((NI) 0))) goto LA27_;
					lastX60gensym281812_ = (path ? path->Sup.len : 0);
				}
				LA27_: ;
				TM__yu6cxgKBBXbNsTkT9cyMd4g_83 = subInt(lastX60gensym281812_, ((NI) 1));
				candidate = substr__2yh9cer0ymNRHlOOg8P7IuA(path, firstX60gensym281814_, (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_83));
				{
					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;
								NI TM__yu6cxgKBBXbNsTkT9cyMd4g_85;
								if (!(i_2 < extensionsLen_0)) goto LA37;
								if ((NU)(i_2) >= (NU)(extensionsLen_0)) raiseIndexError2(i_2,extensionsLen_0-1);
								ext = extensions[i_2];
								x_2 = nosaddFileExt(x, ext);
								{
									NIM_BOOL T40_;
									T40_ = (NIM_BOOL)0;
									T40_ = nosexistsFile(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_, ((NimStringDesc*) NIM_NIL));
												}
												LA52_: ;
												{
													NI TM__yu6cxgKBBXbNsTkT9cyMd4g_84;
													if (!(((NI) 256) < len)) goto LA57_;
													TM__yu6cxgKBBXbNsTkT9cyMd4g_84 = addInt(len, ((NI) 1));
													r = mnewString(((NI)chckRange((NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_84), ((NI) 0), ((NI) IL64(9223372036854775807)))));
													len = readlink(nimToCStringConv(x_2), nimToCStringConv(r), len);
												}
												LA57_: ;
												r = setLengthStr(r, ((NI)chckRange(len, ((NI) 0), ((NI) IL64(9223372036854775807)))));
												{
													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_: ;
								TM__yu6cxgKBBXbNsTkT9cyMd4g_85 = addInt(i_2, ((NI) 1));
								i_2 = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_85);
							} LA37: ;
						}
					}
				} LA29: ;
				{
					if (!(splitsX60gensym281813_ == ((NI) 0))) goto LA69_;
					goto LA19;
				}
				LA69_: ;
				TM__yu6cxgKBBXbNsTkT9cyMd4g_86 = subInt(splitsX60gensym281813_, ((NI) 1));
				splitsX60gensym281813_ = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_86);
				TM__yu6cxgKBBXbNsTkT9cyMd4g_87 = addInt(lastX60gensym281812_, ((NI) 1));
				lastX60gensym281812_ = (NI)(TM__yu6cxgKBBXbNsTkT9cyMd4g_87);
			} LA20: ;
		} LA19: ;
	}
	result = ((NimStringDesc*) NIM_NIL);
	}BeforeRet_: ;
	return result;
}
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_24), ((NimStringDesc*) NIM_NIL));
	T2_ = (NimStringDesc*)0;
	T2_ = slash___gEyhbzZ1UcxyenWRLJRXNQ(T1_, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_89));
	result = getEnv__hhED57tMl0Iaa5bOg9cJaig(((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_88), 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(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;
}
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(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_, ((NimStringDesc*) NIM_NIL));
	}
	LA6_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, nosremoveDir)(NimStringDesc* dir) {	{
		tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg kind;
		NimStringDesc* path;
		DIR* d;
		kind = (tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg)0;
		path = (NimStringDesc*)0;
		d = opendir(nimToCStringConv(dir));
		{
			TSafePoint TM__yu6cxgKBBXbNsTkT9cyMd4g_90;
			if (!!((d == NIM_NIL))) goto LA4_;
			pushSafePoint(&TM__yu6cxgKBBXbNsTkT9cyMd4g_90);
			TM__yu6cxgKBBXbNsTkT9cyMd4g_90.status = _setjmp(TM__yu6cxgKBBXbNsTkT9cyMd4g_90.context);
			if (TM__yu6cxgKBBXbNsTkT9cyMd4g_90.status == 0) {
				{
					while (1) {
						struct dirent* x;
						NimStringDesc* y;
						x = readdir(d);
						{
							if (!(x == NIM_NIL)) goto LA11_;
							goto LA7;
						}
						LA11_: ;
						y = cstrToNimstr(((NCSTRING) ((*x).d_name)));
						{
							NIM_BOOL T15_;
							struct stat s;
							NimStringDesc* path_2;
							tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg k;
							T15_ = (NIM_BOOL)0;
							T15_ = !(eqStrings(y, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_91)));
							if (!(T15_)) goto LA16_;
							T15_ = !(eqStrings(y, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_72)));
							LA16_: ;
							if (!T15_) goto LA17_;
							nimZeroMem((void*)(&s), sizeof(struct stat));
							path_2 = slash___gEyhbzZ1UcxyenWRLJRXNQ(dir, y);
							{
								if (!NIM_TRUE) goto LA21_;
								y = copyString(path_2);
							}
							LA21_: ;
							k = ((tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg) 0);
							{
								int T25_;
								T25_ = (int)0;
								T25_ = lstat(nimToCStringConv(path_2), (&s));
								if (!(T25_ < ((NI32) 0))) goto LA26_;
								goto LA7;
							}
							LA26_: ;
							{
								NIM_BOOL T30_;
								T30_ = (NIM_BOOL)0;
								T30_ = S_ISDIR(s.st_mode);
								if (!T30_) goto LA31_;
								k = ((tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg) 2);
							}
							goto LA28_;
							LA31_: ;
							{
								NIM_BOOL T34_;
								T34_ = (NIM_BOOL)0;
								T34_ = S_ISLNK(s.st_mode);
								if (!T34_) goto LA35_;
								k = getSymlinkFileKind__wTnLPNAWjgwVnuiJ9ax0ZGQ(path_2);
							}
							goto LA28_;
							LA35_: ;
							LA28_: ;
							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);
							}
							break;
							}
						}
						LA17_: ;
					}
				} LA7: ;
				popSafePoint();
			}
			else {
				popSafePoint();
			}
			{
				int T41_;
				T41_ = (int)0;
				T41_ = closedir(d);
				(void)(T41_);
			}
			if (TM__yu6cxgKBBXbNsTkT9cyMd4g_90.status != 0) reraiseException();
		}
		LA4_: ;
	}
	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_: ;
		{
			NCSTRING T11_;
			NimStringDesc* T12_;
			T11_ = (NCSTRING)0;
			T11_ = strerror(errno);
			T12_ = (NimStringDesc*)0;
			T12_ = cstrToNimstr(T11_);
			raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(err, T12_);
		}
		LA6_: ;
	}
	LA4_: ;
	result = NIM_TRUE;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, nosmoveFile)(NimStringDesc* source, NimStringDesc* dest) {	{
		NIM_BOOL T3_;
		TSafePoint TM__yu6cxgKBBXbNsTkT9cyMd4g_92;
		T3_ = (NIM_BOOL)0;
		T3_ = tryMoveFSObject__43wKg5fKy6XSTFw35EBkzA(source, dest);
		if (!!(T3_)) goto LA4_;
		noscopyFile(source, dest);
		pushSafePoint(&TM__yu6cxgKBBXbNsTkT9cyMd4g_92);
		TM__yu6cxgKBBXbNsTkT9cyMd4g_92.status = _setjmp(TM__yu6cxgKBBXbNsTkT9cyMd4g_92.context);
		if (TM__yu6cxgKBBXbNsTkT9cyMd4g_92.status == 0) {
			nosremoveFile(source);
			popSafePoint();
		}
		else {
			popSafePoint();
			{
				NIM_BOOL T9_;
				TM__yu6cxgKBBXbNsTkT9cyMd4g_92.status = 0;
				T9_ = (NIM_BOOL)0;
				T9_ = nostryRemoveFile(dest);
				(void)(T9_);
				reraiseException();
				popCurrentException();
			}
		}
		if (TM__yu6cxgKBBXbNsTkT9cyMd4g_92.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));
		{
			TSafePoint TM__yu6cxgKBBXbNsTkT9cyMd4g_93;
			if (!!((d == NIM_NIL))) goto LA4_;
			pushSafePoint(&TM__yu6cxgKBBXbNsTkT9cyMd4g_93);
			TM__yu6cxgKBBXbNsTkT9cyMd4g_93.status = _setjmp(TM__yu6cxgKBBXbNsTkT9cyMd4g_93.context);
			if (TM__yu6cxgKBBXbNsTkT9cyMd4g_93.status == 0) {
				{
					while (1) {
						struct dirent* x;
						NimStringDesc* y;
						x = readdir(d);
						{
							if (!(x == NIM_NIL)) goto LA11_;
							goto LA7;
						}
						LA11_: ;
						y = cstrToNimstr(((NCSTRING) ((*x).d_name)));
						{
							NIM_BOOL T15_;
							struct stat s;
							NimStringDesc* path_2;
							tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg k;
							NimStringDesc* noSource;
							tyTuple__UV3llMMYFckfui8YMBuUZA T37_;
							T15_ = (NIM_BOOL)0;
							T15_ = !(eqStrings(y, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_91)));
							if (!(T15_)) goto LA16_;
							T15_ = !(eqStrings(y, ((NimStringDesc*) &TM__yu6cxgKBBXbNsTkT9cyMd4g_72)));
							LA16_: ;
							if (!T15_) goto LA17_;
							nimZeroMem((void*)(&s), sizeof(struct stat));
							path_2 = slash___gEyhbzZ1UcxyenWRLJRXNQ(source, y);
							{
								if (!NIM_TRUE) goto LA21_;
								y = copyString(path_2);
							}
							LA21_: ;
							k = ((tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg) 0);
							{
								int T25_;
								T25_ = (int)0;
								T25_ = lstat(nimToCStringConv(path_2), (&s));
								if (!(T25_ < ((NI32) 0))) goto LA26_;
								goto LA7;
							}
							LA26_: ;
							{
								NIM_BOOL T30_;
								T30_ = (NIM_BOOL)0;
								T30_ = S_ISDIR(s.st_mode);
								if (!T30_) goto LA31_;
								k = ((tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg) 2);
							}
							goto LA28_;
							LA31_: ;
							{
								NIM_BOOL T34_;
								T34_ = (NIM_BOOL)0;
								T34_ = S_ISLNK(s.st_mode);
								if (!T34_) goto LA35_;
								k = getSymlinkFileKind__wTnLPNAWjgwVnuiJ9ax0ZGQ(path_2);
							}
							goto LA28_;
							LA35_: ;
							LA28_: ;
							kind = k;
							path = y;
							nimZeroMem((void*)(&T37_), sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA));
							nossplitPath(path, (&T37_));
							noSource = copyString(T37_.Field1);
							switch (kind) {
							case ((tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg) 0):
							{
								NimStringDesc* T39_;
								T39_ = (NimStringDesc*)0;
								T39_ = slash___gEyhbzZ1UcxyenWRLJRXNQ(dest, noSource);
								noscopyFile(path, T39_);
							}
							break;
							case ((tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg) 2):
							{
								NimStringDesc* T41_;
								T41_ = (NimStringDesc*)0;
								T41_ = slash___gEyhbzZ1UcxyenWRLJRXNQ(dest, noSource);
								noscopyDir(path, T41_);
							}
							break;
							default:
							{
							}
							break;
							}
						}
						LA17_: ;
					}
				} LA7: ;
				popSafePoint();
			}
			else {
				popSafePoint();
			}
			{
				int T45_;
				T45_ = (int)0;
				T45_ = closedir(d);
				(void)(T45_);
			}
			if (TM__yu6cxgKBBXbNsTkT9cyMd4g_93.status != 0) reraiseException();
		}
		LA4_: ;
	}
}
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);
	}
	LA4_: ;
}
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)chckRange(indx, ((NI) 0), ((NI) IL64(9223372036854775807)))));
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, stdlib_osInit000)(void) {
{

	nimRegisterThreadLocalMarker(TM__yu6cxgKBBXbNsTkT9cyMd4g_2);

}
}

N_LIB_PRIVATE N_NIMCALL(void, stdlib_osDatInit000)(void) {
static TNimNode* TM__yu6cxgKBBXbNsTkT9cyMd4g_26_3[3];
static TNimNode* TM__yu6cxgKBBXbNsTkT9cyMd4g_35_2[2];
static TNimNode TM__yu6cxgKBBXbNsTkT9cyMd4g_0[7];
NTI__sM4lkSb7zS6F7OVMvW9cffQ_.size = sizeof(tySequence__sM4lkSb7zS6F7OVMvW9cffQ*);
NTI__sM4lkSb7zS6F7OVMvW9cffQ_.kind = 24;
NTI__sM4lkSb7zS6F7OVMvW9cffQ_.base = (&NTI__77mFvmsOLKik79ci2hXkHEg_);
NTI__sM4lkSb7zS6F7OVMvW9cffQ_.flags = 2;
NTI__sM4lkSb7zS6F7OVMvW9cffQ_.marker = Marker_tySequence__sM4lkSb7zS6F7OVMvW9cffQ;
NTI__7q7q3E6Oj24ZNVJb9aonhAg_.size = sizeof(tyTuple__7q7q3E6Oj24ZNVJb9aonhAg);
NTI__7q7q3E6Oj24ZNVJb9aonhAg_.kind = 18;
NTI__7q7q3E6Oj24ZNVJb9aonhAg_.base = 0;
NTI__7q7q3E6Oj24ZNVJb9aonhAg_.flags = 2;
TM__yu6cxgKBBXbNsTkT9cyMd4g_26_3[0] = &TM__yu6cxgKBBXbNsTkT9cyMd4g_0[1];
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[1].kind = 1;
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[1].offset = offsetof(tyTuple__7q7q3E6Oj24ZNVJb9aonhAg, Field0);
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[1].typ = (&NTI__77mFvmsOLKik79ci2hXkHEg_);
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[1].name = "Field0";
TM__yu6cxgKBBXbNsTkT9cyMd4g_26_3[1] = &TM__yu6cxgKBBXbNsTkT9cyMd4g_0[2];
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[2].kind = 1;
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[2].offset = offsetof(tyTuple__7q7q3E6Oj24ZNVJb9aonhAg, Field1);
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[2].typ = (&NTI__77mFvmsOLKik79ci2hXkHEg_);
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[2].name = "Field1";
TM__yu6cxgKBBXbNsTkT9cyMd4g_26_3[2] = &TM__yu6cxgKBBXbNsTkT9cyMd4g_0[3];
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[3].kind = 1;
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[3].offset = offsetof(tyTuple__7q7q3E6Oj24ZNVJb9aonhAg, Field2);
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[3].typ = (&NTI__77mFvmsOLKik79ci2hXkHEg_);
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[3].name = "Field2";
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[0].len = 3; TM__yu6cxgKBBXbNsTkT9cyMd4g_0[0].kind = 2; TM__yu6cxgKBBXbNsTkT9cyMd4g_0[0].sons = &TM__yu6cxgKBBXbNsTkT9cyMd4g_26_3[0];
NTI__7q7q3E6Oj24ZNVJb9aonhAg_.node = &TM__yu6cxgKBBXbNsTkT9cyMd4g_0[0];
NTI__UV3llMMYFckfui8YMBuUZA_.size = sizeof(tyTuple__UV3llMMYFckfui8YMBuUZA);
NTI__UV3llMMYFckfui8YMBuUZA_.kind = 18;
NTI__UV3llMMYFckfui8YMBuUZA_.base = 0;
NTI__UV3llMMYFckfui8YMBuUZA_.flags = 2;
TM__yu6cxgKBBXbNsTkT9cyMd4g_35_2[0] = &TM__yu6cxgKBBXbNsTkT9cyMd4g_0[5];
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[5].kind = 1;
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[5].offset = offsetof(tyTuple__UV3llMMYFckfui8YMBuUZA, Field0);
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[5].typ = (&NTI__77mFvmsOLKik79ci2hXkHEg_);
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[5].name = "Field0";
TM__yu6cxgKBBXbNsTkT9cyMd4g_35_2[1] = &TM__yu6cxgKBBXbNsTkT9cyMd4g_0[6];
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[6].kind = 1;
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[6].offset = offsetof(tyTuple__UV3llMMYFckfui8YMBuUZA, Field1);
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[6].typ = (&NTI__77mFvmsOLKik79ci2hXkHEg_);
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[6].name = "Field1";
TM__yu6cxgKBBXbNsTkT9cyMd4g_0[4].len = 2; TM__yu6cxgKBBXbNsTkT9cyMd4g_0[4].kind = 2; TM__yu6cxgKBBXbNsTkT9cyMd4g_0[4].sons = &TM__yu6cxgKBBXbNsTkT9cyMd4g_35_2[0];
NTI__UV3llMMYFckfui8YMBuUZA_.node = &TM__yu6cxgKBBXbNsTkT9cyMd4g_0[4];
}

