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

#include "nimbase.h"
#include <string.h>
#include <stdio.h>
#undef linux
#undef near
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct TY_sM4lkSb7zS6F7OVMvW9cffQ TY_sM4lkSb7zS6F7OVMvW9cffQ;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Cell_1zcF9cV8XIAtbN8h5HRUB8g Cell_1zcF9cV8XIAtbN8h5HRUB8g;
typedef struct ValueError_Gi06FkNeykJn7mrqRZYrkA ValueError_Gi06FkNeykJn7mrqRZYrkA;
typedef struct Exception Exception;
typedef struct TNimObject TNimObject;
typedef struct Slice_qL3WGViqT0p5sVr4YFHsLg Slice_qL3WGViqT0p5sVr4YFHsLg;
typedef struct TY_qwqHTkRvwhrRyENtudHQ7g TY_qwqHTkRvwhrRyENtudHQ7g;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef NU8 TY_nmiMWKVIe46vacnhAFrQvw_Set[32];
typedef NU8 TNimKind_jIBKr1ejBgsfM33Kxw4j7A;
typedef NU8 TNimTypeFlag_v8QUszD1sWlSIWZz7mC4bQ_Set;
typedef N_NIMCALL_PTR(void, TY_ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY_WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
struct  TNimType  {
NI size;
TNimKind_jIBKr1ejBgsfM33Kxw4j7A kind;
TNimTypeFlag_v8QUszD1sWlSIWZz7mC4bQ_Set flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY_ojoeKfW4VYIm36I9cpDTQIg marker;
TY_WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
typedef NU8 TNimNodeKind_unfNsxrcATrufDZmpBq4HQ;
struct  TNimNode  {
TNimNodeKind_unfNsxrcATrufDZmpBq4HQ kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Cell_1zcF9cV8XIAtbN8h5HRUB8g  {
NI refcount;
TNimType* typ;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Exception  {
  TNimObject Sup;
Exception* parent;
NCSTRING name;
NimStringDesc* message;
NimStringDesc* trace;
};
struct  ValueError_Gi06FkNeykJn7mrqRZYrkA  {
  Exception Sup;
};
struct  Slice_qL3WGViqT0p5sVr4YFHsLg  {
NI a;
NI b;
};
typedef NI TY_9cc9aPiDa8VaWjVcFLabEDZQ[256];
typedef NU8 FloatFormatMode_pNvEoaqwoxKyoASD11vSgQ;
typedef NIM_CHAR TY_9bPFPkkEEeeNM9bKgiV8Q49cg[6];
typedef NIM_CHAR TY_Kn8ZOVsorvcNLB4isUeMzQ[2501];
typedef NIM_CHAR TY_vB7L5YKNrMfbzoUubCEcYg[3];
typedef NimStringDesc* TY_nHXaesL0DJZHyVS07ARPRA[1];
struct TY_sM4lkSb7zS6F7OVMvW9cffQ {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct TY_qwqHTkRvwhrRyENtudHQ7g {
  TGenericSeq Sup;
  NI data[SEQ_DECL_SIZE];
};
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsAlphaAsciiChar)(NIM_CHAR c);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsAlphaNumericChar)(NIM_CHAR c);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsDigitChar)(NIM_CHAR c);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsSpaceAsciiChar)(NIM_CHAR c);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsLowerAsciiChar)(NIM_CHAR c);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsUpperAsciiChar)(NIM_CHAR c);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsAlphaAsciiStr)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsAlphaNumericStr)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsDigitStr)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsSpaceAsciiStr)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsLowerAsciiStr)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsUpperAsciiStr)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NIM_CHAR, nsuToLowerAsciiChar)(NIM_CHAR c);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuToLowerAsciiStr)(NimStringDesc* s);
N_NIMCALL(NimStringDesc*, mnewString)(NI len);
N_NIMCALL(NimStringDesc*, mnewString)(NI len);
N_LIB_EXPORT N_CDECL(NIM_CHAR, nsuToUpperAsciiChar)(NIM_CHAR c);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuToUpperAsciiStr)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuCapitalizeAscii)(NimStringDesc* s);
static N_INLINE(void, appendChar)(NimStringDesc* dest, NIM_CHAR c);
N_NIMCALL(NimStringDesc*, copyStr)(NimStringDesc* s, NI start);
N_NIMCALL(NimStringDesc*, copyStr)(NimStringDesc* s, NI first);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
static N_INLINE(void, copyMem_fPlwH3r9agN9aEHB6yCPMh0wsystem)(void* dest, void* source, NI size);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsSpaceChar)(NIM_CHAR c);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsLowerChar)(NIM_CHAR c);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsUpperChar)(NIM_CHAR c);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsAlphaChar)(NIM_CHAR c);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsAlphaStr)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsSpaceStr)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsLowerStr)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsUpperStr)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NIM_CHAR, nsuToLowerChar)(NIM_CHAR c);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuToLowerStr)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NIM_CHAR, nsuToUpperChar)(NIM_CHAR c);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuToUpperStr)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuCapitalize)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuNormalize)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nimrtl_setLengthStr)(NimStringDesc* s, NI newLen);
N_LIB_EXPORT N_CDECL(NI, nsuCmpIgnoreCase)(NimStringDesc* a, NimStringDesc* b);
N_LIB_EXPORT N_CDECL(NI, nsuCmpIgnoreStyle)(NimStringDesc* a, NimStringDesc* b);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuStrip)(NimStringDesc* s, NIM_BOOL leading, NIM_BOOL trailing, TY_nmiMWKVIe46vacnhAFrQvw_Set chars);
N_NIMCALL(NimStringDesc*, copyStrLast)(NimStringDesc* s, NI start, NI last);
N_NIMCALL(NimStringDesc*, copyStrLast)(NimStringDesc* s, NI first, NI last);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuToOctal)(NIM_CHAR c);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsNilOrEmpty)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsNilOrWhitespace)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(TY_sM4lkSb7zS6F7OVMvW9cffQ*, nsuSplitWhitespace)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(void, nimrtl_nimGCvisit)(void* d, NI op);
static N_NIMCALL(void, Marker_TY_sM4lkSb7zS6F7OVMvW9cffQ)(void* p, NI op);
N_LIB_EXPORT N_CDECL(void*, nimrtl_newSeq)(TNimType* typ, NI len);
N_NIMCALL(TGenericSeq*, incrSeqV2)(TGenericSeq* seq, NI elemSize);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nimrtl_copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(Cell_1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem)(void* usr);
N_LIB_EXPORT N_CDECL(void, nimrtl_rtlAddZCT)(Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_EXPORT N_CDECL(TY_sM4lkSb7zS6F7OVMvW9cffQ*, nsuSplitLines)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NI, nsuCountLines)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(TY_sM4lkSb7zS6F7OVMvW9cffQ*, nsuSplitCharSet)(NimStringDesc* s, TY_nmiMWKVIe46vacnhAFrQvw_Set seps, NI maxsplit);
N_LIB_EXPORT N_CDECL(TY_sM4lkSb7zS6F7OVMvW9cffQ*, nsuSplitChar)(NimStringDesc* s, NIM_CHAR sep, NI maxsplit);
N_LIB_EXPORT N_CDECL(TY_sM4lkSb7zS6F7OVMvW9cffQ*, nsuSplitString)(NimStringDesc* s, NimStringDesc* sep, NI maxsplit);
N_NOINLINE(void, raiseAssert_PpfSiTIeNpMAb9a5o6SglJw_2)(NimStringDesc* msg);
N_NIMCALL(NIM_BOOL, substrEq_7ngl0F5lryTkSAj7sYQ7pw)(NimStringDesc* s, NI pos, NimStringDesc* substr);
N_LIB_EXPORT N_CDECL(TY_sM4lkSb7zS6F7OVMvW9cffQ*, nsuRSplitCharSet)(NimStringDesc* s, TY_nmiMWKVIe46vacnhAFrQvw_Set seps, NI maxsplit);
N_NIMCALL(void, reverse_LoixoqZetR6FfezoPedx8w)(NimStringDesc** a, NI aLen_0);
N_LIB_EXPORT N_CDECL(TY_sM4lkSb7zS6F7OVMvW9cffQ*, nsuRSplitChar)(NimStringDesc* s, NIM_CHAR sep, NI maxsplit);
N_LIB_EXPORT N_CDECL(TY_sM4lkSb7zS6F7OVMvW9cffQ*, nsuRSplitString)(NimStringDesc* s, NimStringDesc* sep, NI maxsplit);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuToHex)(NI64 x, NI len);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuIntToStr)(NI x, NI minchars);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nimrtl_nimIntToStr)(NI x);
N_LIB_EXPORT N_CDECL(NI, nsuParseInt)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NI, npuParseInt)(NimStringDesc* s, NI* number, NI start);
N_LIB_EXPORT N_CDECL(void*, nimrtl_newObj)(TNimType* typ, NI size);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incRef_9cAA5YuQAAC3MVbnGeV86swsystem)(Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(void, decRef_MV4BBk6J1qu70IbBxwEn4wsystem)(Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_EXPORT N_CDECL(void, nimrtl_raiseException)(Exception* e, NCSTRING ename);
N_LIB_EXPORT N_CDECL(NI64, nsuParseBiggestInt)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NI, npuParseBiggestInt)(NimStringDesc* s, NI64* number, NI start);
N_LIB_EXPORT N_CDECL(NU, nsuParseUInt)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NI, npuParseUInt)(NimStringDesc* s, NU* number, NI start);
N_LIB_EXPORT N_CDECL(NU64, nsuParseBiggestUInt)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NI, npuParseBiggestUInt)(NimStringDesc* s, NU64* number, NI start);
N_LIB_EXPORT N_CDECL(NF, nsuParseFloat)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NI, npuParseFloat)(NimStringDesc* s, NF* number, NI start);
N_LIB_EXPORT N_CDECL(NI, nsuParseHexInt)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuRepeatChar)(NIM_CHAR c, NI count);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuRepeatStr)(NimStringDesc* s, NI n);
N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nimrtl_resizeString)(NimStringDesc* dest, NI addlen);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuAlignString)(NimStringDesc* s, NI count, NIM_CHAR padding);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nimrtl_copyString)(NimStringDesc* src);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuWordWrap)(NimStringDesc* s, NI maxLineWidth, NIM_BOOL splitLongWords, TY_nmiMWKVIe46vacnhAFrQvw_Set seps, NimStringDesc* newLine);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuIndent)(NimStringDesc* s, NI count, NimStringDesc* padding);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuUnindent)(NimStringDesc* s, NI count, NimStringDesc* padding);
static N_INLINE(NimStringDesc*, X5BX5D__Sq9b57KCLKZryBwyHy49aBswstrutils)(NimStringDesc* s, Slice_qL3WGViqT0p5sVr4YFHsLg x);
static N_INLINE(Slice_qL3WGViqT0p5sVr4YFHsLg, dotdot__18yoMoUbfoITYgEZSwZDYAstrutils)(NI a, NI b);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
static N_INLINE(NIM_BOOL, equalMem_DCrUjdaMvFDHaR1hs7sQGwstrutils)(void* a, void* b, NI size);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuUnindentAll)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuStartsWith)(NimStringDesc* s, NimStringDesc* prefix);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuEndsWith)(NimStringDesc* s, NimStringDesc* suffix);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuContinuesWith)(NimStringDesc* s, NimStringDesc* substr, NI start);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuJoinSep)(NimStringDesc** a, NI aLen_0, NimStringDesc* sep);
N_LIB_EXPORT N_CDECL(NI, nsuFindStr)(NimStringDesc* s, NimStringDesc* sub, NI start, NI last);
N_NIMCALL(void, preprocessSub_IhQT0o4blhF4hbhCz0srsw)(NimStringDesc* sub, NI* a);
N_NIMCALL(NI, findAux_xYftXprbikG4pTQVPGgIjg)(NimStringDesc* s, NimStringDesc* sub, NI start, NI last, TY_9cc9aPiDa8VaWjVcFLabEDZQ a);
N_LIB_EXPORT N_CDECL(NI, nsuFindChar)(NimStringDesc* s, NIM_CHAR sub, NI start, NI last);
N_LIB_EXPORT N_CDECL(NI, nsuFindCharSet)(NimStringDesc* s, TY_nmiMWKVIe46vacnhAFrQvw_Set chars, NI start, NI last);
N_LIB_EXPORT N_CDECL(NI, nimrtl_rfind)(NimStringDesc* s, NIM_CHAR sub, NI start);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuCenterString)(NimStringDesc* s, NI width, NIM_CHAR fillChar);
N_LIB_EXPORT N_CDECL(NI, nsuCountString)(NimStringDesc* s, NimStringDesc* sub, NIM_BOOL overlapping);
N_LIB_EXPORT N_CDECL(NI, nsuCountChar)(NimStringDesc* s, NIM_CHAR sub);
N_LIB_EXPORT N_CDECL(NI, nsuCountCharSet)(NimStringDesc* s, TY_nmiMWKVIe46vacnhAFrQvw_Set subs);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuReplaceStr)(NimStringDesc* s, NimStringDesc* sub, NimStringDesc* by);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuReplaceChar)(NimStringDesc* s, NIM_CHAR sub, NIM_CHAR by);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuReplaceWord)(NimStringDesc* s, NimStringDesc* sub, NimStringDesc* by);
N_LIB_EXPORT N_CDECL(void, nsuDelete)(NimStringDesc** s, NI first, NI last);
N_LIB_EXPORT N_CDECL(NI, nsuParseOctInt)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuToOct)(NI64 x, NI len);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuToBin)(NI64 x, NI len);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuInsertSep)(NimStringDesc* s, NIM_CHAR sep, NI digits);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuEscape)(NimStringDesc* s, NimStringDesc* prefix, NimStringDesc* suffix);
N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s, NIM_CHAR c);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuUnescape)(NimStringDesc* s, NimStringDesc* prefix, NimStringDesc* suffix);
N_LIB_EXPORT N_CDECL(NI, npuParseHex)(NimStringDesc* s, NI* number, NI start, NI maxLen);
N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuValidIdentifier)(NimStringDesc* s);
N_LIB_EXPORT N_CDECL(NI, nsuEditDistance)(NimStringDesc* a, NimStringDesc* b);
static N_NIMCALL(void, Marker_TY_qwqHTkRvwhrRyENtudHQ7g)(void* p, NI op);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuformatBiggestFloat)(NF f, FloatFormatMode_pNvEoaqwoxKyoASD11vSgQ format, NI precision, NIM_CHAR decimalSep);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuformatFloat)(NF f, FloatFormatMode_pNvEoaqwoxKyoASD11vSgQ format, NI precision, NIM_CHAR decimalSep);
N_LIB_EXPORT N_CDECL(void, nsuAddf)(NimStringDesc** s, NimStringDesc* formatstr, NimStringDesc** a, NI aLen_0);
N_NOINLINE(void, invalidFormatString_61EJWW6vRISEo9a8gt0tusw)(void);
N_NIMCALL(NI, findNormalized_SW1VCMDsxPTtzxnYrf3N6w)(NimStringDesc* x, NimStringDesc** inArray, NI inArrayLen_0);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuFormatOpenArray)(NimStringDesc* formatstr, NimStringDesc** a, NI aLen_0);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuFormatSingleElem)(NimStringDesc* formatstr, NimStringDesc* a);
N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuFormatVarargs)(NimStringDesc* formatstr, NimStringDesc** a, NI aLen_0);
N_LIB_EXPORT N_CDECL(void, nsuRemoveSuffixCharSet)(NimStringDesc** s, TY_nmiMWKVIe46vacnhAFrQvw_Set chars);
N_LIB_EXPORT N_CDECL(void, nsuRemoveSuffixChar)(NimStringDesc** s, NIM_CHAR c);
N_LIB_EXPORT N_CDECL(void, nsuRemoveSuffixString)(NimStringDesc** s, NimStringDesc* suffix);
extern TNimType NTI_77mFvmsOLKik79ci2hXkHEg_;
TNimType NTI_sM4lkSb7zS6F7OVMvW9cffQ_;
extern TNimType NTI_yCEN9anxCD6mzBxGjuaRBdg_;
extern TNimType NTI_Gi06FkNeykJn7mrqRZYrkA_;
extern TNimType NTI_rR5Bzr1D5krxoo1NcNyeMA_;
TNimType NTI_qwqHTkRvwhrRyENtudHQ7g_;
STRING_LITERAL(TM_JGc9b9bh2D3nTdUR7TGyq8aA_2, "\012  0 < len(sep) ", 16);
STRING_LITERAL(TM_JGc9b9bh2D3nTdUR7TGyq8aA_3, "0123456789ABCDEF", 16);
STRING_LITERAL(TM_JGc9b9bh2D3nTdUR7TGyq8aA_4, "invalid integer: ", 17);
STRING_LITERAL(TM_JGc9b9bh2D3nTdUR7TGyq8aA_5, "invalid unsigned integer: ", 26);
STRING_LITERAL(TM_JGc9b9bh2D3nTdUR7TGyq8aA_6, "invalid float: ", 15);
STRING_LITERAL(TM_JGc9b9bh2D3nTdUR7TGyq8aA_7, "", 0);
STRING_LITERAL(TM_JGc9b9bh2D3nTdUR7TGyq8aA_8, "\012", 1);
STRING_LITERAL(TM_JGc9b9bh2D3nTdUR7TGyq8aA_9, " ", 1);
STRING_LITERAL(TM_JGc9b9bh2D3nTdUR7TGyq8aA_10, "\\x", 2);
STRING_LITERAL(TM_JGc9b9bh2D3nTdUR7TGyq8aA_11, "\\\\", 2);
STRING_LITERAL(TM_JGc9b9bh2D3nTdUR7TGyq8aA_12, "\\\'", 2);
STRING_LITERAL(TM_JGc9b9bh2D3nTdUR7TGyq8aA_13, "\\\"", 2);
STRING_LITERAL(TM_JGc9b9bh2D3nTdUR7TGyq8aA_14, "String does not start with a prefix of: ", 40);
STRING_LITERAL(TM_JGc9b9bh2D3nTdUR7TGyq8aA_15, "\\", 1);
STRING_LITERAL(TM_JGc9b9bh2D3nTdUR7TGyq8aA_16, "String does not end with a suffix of: ", 38);
NIM_CONST TY_vB7L5YKNrMfbzoUubCEcYg floatFormatToChar_WVISPus3ZqCVSuP9bzn9cVxw = {103,
102,
101}
;
STRING_LITERAL(TM_JGc9b9bh2D3nTdUR7TGyq8aA_17, "invalid format string", 21);
static NIM_CONST TY_nmiMWKVIe46vacnhAFrQvw_Set TM_JGc9b9bh2D3nTdUR7TGyq8aA_18 = {
0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
;

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsAlphaAsciiChar)(NIM_CHAR c) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	result = (((NU8)(c)) >= ((NU8)(65)) && ((NU8)(c)) <= ((NU8)(90)) || ((NU8)(c)) >= ((NU8)(97)) && ((NU8)(c)) <= ((NU8)(122)));
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsAlphaNumericChar)(NIM_CHAR c) {
	NIM_BOOL result;
	NIM_BOOL T1_;
{	result = (NIM_BOOL)0;
	T1_ = (NIM_BOOL)0;
	T1_ = (((NU8)(c)) >= ((NU8)(65)) && ((NU8)(c)) <= ((NU8)(90)) || ((NU8)(c)) >= ((NU8)(97)) && ((NU8)(c)) <= ((NU8)(122)));
	if (T1_) goto LA2_;
	T1_ = (((NU8)(c)) >= ((NU8)(48)) && ((NU8)(c)) <= ((NU8)(57)));
	LA2_: ;
	result = T1_;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsDigitChar)(NIM_CHAR c) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	result = (((NU8)(c)) >= ((NU8)(48)) && ((NU8)(c)) <= ((NU8)(57)));
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsSpaceAsciiChar)(NIM_CHAR c) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	result = (((NU8)(c)) == ((NU8)(32)) || ((NU8)(c)) == ((NU8)(9)) || ((NU8)(c)) == ((NU8)(11)) || ((NU8)(c)) == ((NU8)(13)) || ((NU8)(c)) == ((NU8)(10)) || ((NU8)(c)) == ((NU8)(12)));
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsLowerAsciiChar)(NIM_CHAR c) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	result = (((NU8)(c)) >= ((NU8)(97)) && ((NU8)(c)) <= ((NU8)(122)));
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsUpperAsciiChar)(NIM_CHAR c) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	result = (((NU8)(c)) >= ((NU8)(65)) && ((NU8)(c)) <= ((NU8)(90)));
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsAlphaAsciiStr)(NimStringDesc* s) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	{
		if (!((s ? s->Sup.len : 0) == ((NI) 0))) goto LA3_;
		result = NIM_FALSE;
		goto BeforeRet_;
	}
	LA3_: ;
	result = NIM_TRUE;
	{
		NIM_CHAR c;
		NI i;
		NI L;
		c = (NIM_CHAR)0;
		i = ((NI) 0);
		L = (s ? s->Sup.len : 0);
		{
			while (1) {
				NIM_BOOL T8_;
				if (!(i < L)) goto LA7;
				c = s->data[i];
				T8_ = (NIM_BOOL)0;
				T8_ = nsuIsAlphaAsciiChar(c);
				if (!(T8_)) goto LA9_;
				T8_ = result;
				LA9_: ;
				result = T8_;
				i += ((NI) 1);
			} LA7: ;
		}
	}
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsAlphaNumericStr)(NimStringDesc* s) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	{
		if (!((s ? s->Sup.len : 0) == ((NI) 0))) goto LA3_;
		result = NIM_FALSE;
		goto BeforeRet_;
	}
	LA3_: ;
	result = NIM_TRUE;
	{
		NIM_CHAR c;
		NI i;
		NI L;
		c = (NIM_CHAR)0;
		i = ((NI) 0);
		L = (s ? s->Sup.len : 0);
		{
			while (1) {
				NIM_BOOL T8_;
				if (!(i < L)) goto LA7;
				c = s->data[i];
				T8_ = (NIM_BOOL)0;
				T8_ = nsuIsAlphaNumericChar(c);
				if (!(T8_)) goto LA9_;
				T8_ = result;
				LA9_: ;
				result = T8_;
				i += ((NI) 1);
			} LA7: ;
		}
	}
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsDigitStr)(NimStringDesc* s) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	{
		if (!((s ? s->Sup.len : 0) == ((NI) 0))) goto LA3_;
		result = NIM_FALSE;
		goto BeforeRet_;
	}
	LA3_: ;
	result = NIM_TRUE;
	{
		NIM_CHAR c;
		NI i;
		NI L;
		c = (NIM_CHAR)0;
		i = ((NI) 0);
		L = (s ? s->Sup.len : 0);
		{
			while (1) {
				NIM_BOOL T8_;
				if (!(i < L)) goto LA7;
				c = s->data[i];
				T8_ = (NIM_BOOL)0;
				T8_ = nsuIsDigitChar(c);
				if (!(T8_)) goto LA9_;
				T8_ = result;
				LA9_: ;
				result = T8_;
				i += ((NI) 1);
			} LA7: ;
		}
	}
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsSpaceAsciiStr)(NimStringDesc* s) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	{
		if (!((s ? s->Sup.len : 0) == ((NI) 0))) goto LA3_;
		result = NIM_FALSE;
		goto BeforeRet_;
	}
	LA3_: ;
	result = NIM_TRUE;
	{
		NIM_CHAR c;
		NI i;
		NI L;
		c = (NIM_CHAR)0;
		i = ((NI) 0);
		L = (s ? s->Sup.len : 0);
		{
			while (1) {
				if (!(i < L)) goto LA7;
				c = s->data[i];
				{
					NIM_BOOL T10_;
					T10_ = (NIM_BOOL)0;
					T10_ = nsuIsSpaceAsciiChar(c);
					if (!!(T10_)) goto LA11_;
					result = NIM_FALSE;
					goto BeforeRet_;
				}
				LA11_: ;
				i += ((NI) 1);
			} LA7: ;
		}
	}
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsLowerAsciiStr)(NimStringDesc* s) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	{
		if (!((s ? s->Sup.len : 0) == ((NI) 0))) goto LA3_;
		result = NIM_FALSE;
		goto BeforeRet_;
	}
	LA3_: ;
	{
		NIM_CHAR c;
		NI i;
		NI L;
		c = (NIM_CHAR)0;
		i = ((NI) 0);
		L = (s ? s->Sup.len : 0);
		{
			while (1) {
				if (!(i < L)) goto LA7;
				c = s->data[i];
				{
					NIM_BOOL T10_;
					T10_ = (NIM_BOOL)0;
					T10_ = nsuIsLowerAsciiChar(c);
					if (!!(T10_)) goto LA11_;
					result = NIM_FALSE;
					goto BeforeRet_;
				}
				LA11_: ;
				i += ((NI) 1);
			} LA7: ;
		}
	}
	result = NIM_TRUE;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsUpperAsciiStr)(NimStringDesc* s) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	{
		if (!((s ? s->Sup.len : 0) == ((NI) 0))) goto LA3_;
		result = NIM_FALSE;
		goto BeforeRet_;
	}
	LA3_: ;
	{
		NIM_CHAR c;
		NI i;
		NI L;
		c = (NIM_CHAR)0;
		i = ((NI) 0);
		L = (s ? s->Sup.len : 0);
		{
			while (1) {
				if (!(i < L)) goto LA7;
				c = s->data[i];
				{
					NIM_BOOL T10_;
					T10_ = (NIM_BOOL)0;
					T10_ = nsuIsUpperAsciiChar(c);
					if (!!(T10_)) goto LA11_;
					result = NIM_FALSE;
					goto BeforeRet_;
				}
				LA11_: ;
				i += ((NI) 1);
			} LA7: ;
		}
	}
	result = NIM_TRUE;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_CHAR, nsuToLowerAsciiChar)(NIM_CHAR c) {
	NIM_CHAR result;
	result = (NIM_CHAR)0;
	{
		if (!(((NU8)(c)) >= ((NU8)(65)) && ((NU8)(c)) <= ((NU8)(90)))) goto LA3_;
		result = ((NIM_CHAR) (((NI) ((NI)(((NI) (((NU8)(c)))) + ((NI) 32))))));
	}
	goto LA1_;
	LA3_: ;
	{
		result = c;
	}
	LA1_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuToLowerAsciiStr)(NimStringDesc* s) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = mnewString(((NI) ((s ? s->Sup.len : 0))));
	{
		NI i;
		NI colontmp_;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (NI)((s ? s->Sup.len : 0) - ((NI) 1));
		res = ((NI) 0);
		{
			while (1) {
				if (!(res <= colontmp_)) goto LA3;
				i = res;
				result->data[i] = nsuToLowerAsciiChar(s->data[i]);
				res += ((NI) 1);
			} LA3: ;
		}
	}
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_CHAR, nsuToUpperAsciiChar)(NIM_CHAR c) {
	NIM_CHAR result;
	result = (NIM_CHAR)0;
	{
		if (!(((NU8)(c)) >= ((NU8)(97)) && ((NU8)(c)) <= ((NU8)(122)))) goto LA3_;
		result = ((NIM_CHAR) (((NI) ((NI)(((NI) (((NU8)(c)))) - ((NI) 32))))));
	}
	goto LA1_;
	LA3_: ;
	{
		result = c;
	}
	LA1_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuToUpperAsciiStr)(NimStringDesc* s) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = mnewString(((NI) ((s ? s->Sup.len : 0))));
	{
		NI i;
		NI colontmp_;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (NI)((s ? s->Sup.len : 0) - ((NI) 1));
		res = ((NI) 0);
		{
			while (1) {
				if (!(res <= colontmp_)) goto LA3;
				i = res;
				result->data[i] = nsuToUpperAsciiChar(s->data[i]);
				res += ((NI) 1);
			} LA3: ;
		}
	}
	return result;
}

static N_INLINE(void, appendChar)(NimStringDesc* dest, NIM_CHAR c) {
	(*dest).data[((*dest).Sup.len)- 0] = c;
	(*dest).data[((NI)((*dest).Sup.len + ((NI) 1)))- 0] = 0;
	(*dest).Sup.len += ((NI) 1);
}

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

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

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuCapitalizeAscii)(NimStringDesc* s) {
	NimStringDesc* result;
	NimStringDesc* T1_;
	NIM_CHAR T2_;
	NimStringDesc* T3_;
	result = (NimStringDesc*)0;
	T1_ = (NimStringDesc*)0;
	T2_ = (NIM_CHAR)0;
	T2_ = nsuToUpperAsciiChar(s->data[((NI) 0)]);
	T3_ = (NimStringDesc*)0;
	T3_ = copyStr(s, ((NI) 1));
	T1_ = rawNewString(T3_->Sup.len + 1);
appendChar(T1_, T2_);
appendString(T1_, T3_);
	result = T1_;
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsSpaceChar)(NIM_CHAR c) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	result = nsuIsSpaceAsciiChar(c);
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsLowerChar)(NIM_CHAR c) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	result = nsuIsLowerAsciiChar(c);
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsUpperChar)(NIM_CHAR c) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	result = nsuIsUpperAsciiChar(c);
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsAlphaChar)(NIM_CHAR c) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	result = nsuIsAlphaAsciiChar(c);
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsAlphaStr)(NimStringDesc* s) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	result = nsuIsAlphaAsciiStr(s);
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsSpaceStr)(NimStringDesc* s) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	result = nsuIsSpaceAsciiStr(s);
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsLowerStr)(NimStringDesc* s) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	result = nsuIsLowerAsciiStr(s);
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsUpperStr)(NimStringDesc* s) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	result = nsuIsUpperAsciiStr(s);
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_CHAR, nsuToLowerChar)(NIM_CHAR c) {
	NIM_CHAR result;
	result = (NIM_CHAR)0;
	result = nsuToLowerAsciiChar(c);
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuToLowerStr)(NimStringDesc* s) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = nsuToLowerAsciiStr(s);
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_CHAR, nsuToUpperChar)(NIM_CHAR c) {
	NIM_CHAR result;
	result = (NIM_CHAR)0;
	result = nsuToUpperAsciiChar(c);
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuToUpperStr)(NimStringDesc* s) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = nsuToUpperAsciiStr(s);
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuCapitalize)(NimStringDesc* s) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = nsuCapitalizeAscii(s);
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuNormalize)(NimStringDesc* s) {
	NimStringDesc* result;
	NI j;
	result = (NimStringDesc*)0;
	result = mnewString(((NI) ((s ? s->Sup.len : 0))));
	j = ((NI) 0);
	{
		NI i;
		NI colontmp_;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (NI)((s ? s->Sup.len : 0) - ((NI) 1));
		res = ((NI) 0);
		{
			while (1) {
				if (!(res <= colontmp_)) goto LA3;
				i = res;
				{
					if (!(((NU8)(s->data[i])) >= ((NU8)(65)) && ((NU8)(s->data[i])) <= ((NU8)(90)))) goto LA6_;
					result->data[j] = ((NIM_CHAR) (((NI) ((NI)(((NI) (((NU8)(s->data[i])))) + ((NI) 32))))));
					j += ((NI) 1);
				}
				goto LA4_;
				LA6_: ;
				{
					if (!!(((NU8)(s->data[i]) == (NU8)(95)))) goto LA9_;
					result->data[j] = s->data[i];
					j += ((NI) 1);
				}
				goto LA4_;
				LA9_: ;
				LA4_: ;
				res += ((NI) 1);
			} LA3: ;
		}
	}
	{
		if (!!((j == (s ? s->Sup.len : 0)))) goto LA13_;
		result = nimrtl_setLengthStr(result, ((NI) (j)));
	}
	LA13_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NI, nsuCmpIgnoreCase)(NimStringDesc* a, NimStringDesc* b) {
	NI result;
	NI i;
	NI m;
{	result = (NI)0;
	i = ((NI) 0);
	m = (((a ? a->Sup.len : 0) <= (b ? b->Sup.len : 0)) ? (a ? a->Sup.len : 0) : (b ? b->Sup.len : 0));
	{
		while (1) {
			NIM_CHAR T3_;
			NIM_CHAR T4_;
			if (!(i < m)) goto LA2;
			T3_ = (NIM_CHAR)0;
			T3_ = nsuToLowerAsciiChar(a->data[i]);
			T4_ = (NIM_CHAR)0;
			T4_ = nsuToLowerAsciiChar(b->data[i]);
			result = (NI)(((NI) (((NU8)(T3_)))) - ((NI) (((NU8)(T4_)))));
			{
				if (!!((result == ((NI) 0)))) goto LA7_;
				goto BeforeRet_;
			}
			LA7_: ;
			i += ((NI) 1);
		} LA2: ;
	}
	result = (NI)((a ? a->Sup.len : 0) - (b ? b->Sup.len : 0));
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NI, nsuCmpIgnoreStyle)(NimStringDesc* a, NimStringDesc* b) {
	NI result;
	NI i;
	NI j;
	result = (NI)0;
	i = ((NI) 0);
	j = ((NI) 0);
	{
		while (1) {
			NIM_CHAR aa;
			NIM_CHAR bb;
			{
				while (1) {
					if (!((NU8)(a->data[i]) == (NU8)(95))) goto LA4;
					i += ((NI) 1);
				} LA4: ;
			}
			{
				while (1) {
					if (!((NU8)(b->data[j]) == (NU8)(95))) goto LA6;
					j += ((NI) 1);
				} LA6: ;
			}
			aa = nsuToLowerAsciiChar(a->data[i]);
			bb = nsuToLowerAsciiChar(b->data[j]);
			result = (NI)(((NI) (((NU8)(aa)))) - ((NI) (((NU8)(bb)))));
			{
				NIM_BOOL T9_;
				T9_ = (NIM_BOOL)0;
				T9_ = !((result == ((NI) 0)));
				if (T9_) goto LA10_;
				T9_ = ((NU8)(aa) == (NU8)(0));
				LA10_: ;
				if (!T9_) goto LA11_;
				goto LA1;
			}
			LA11_: ;
			i += ((NI) 1);
			j += ((NI) 1);
		}
	} LA1: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuStrip)(NimStringDesc* s, NIM_BOOL leading, NIM_BOOL trailing, TY_nmiMWKVIe46vacnhAFrQvw_Set chars) {
	NimStringDesc* result;
	NI first;
	NI last;
	result = (NimStringDesc*)0;
	first = ((NI) 0);
	last = (NI)((s ? s->Sup.len : 0) - ((NI) 1));
	{
		if (!leading) goto LA3_;
		{
			while (1) {
				if (!((chars[(NU)(((NU8)(s->data[first])))>>3] &(1U<<((NU)(((NU8)(s->data[first])))&7U)))!=0)) goto LA6;
				first += ((NI) 1);
			} LA6: ;
		}
	}
	LA3_: ;
	{
		if (!trailing) goto LA9_;
		{
			while (1) {
				NIM_BOOL T13_;
				T13_ = (NIM_BOOL)0;
				T13_ = (((NI) 0) <= last);
				if (!(T13_)) goto LA14_;
				T13_ = ((chars[(NU)(((NU8)(s->data[last])))>>3] &(1U<<((NU)(((NU8)(s->data[last])))&7U)))!=0);
				LA14_: ;
				if (!T13_) goto LA12;
				last -= ((NI) 1);
			} LA12: ;
		}
	}
	LA9_: ;
	result = copyStrLast(s, first, last);
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuToOctal)(NIM_CHAR c) {
	NimStringDesc* result;
	NI val;
	result = (NimStringDesc*)0;
	result = mnewString(((NI) 3));
	val = ((NU8)(c));
	{
		NI i;
		NI res;
		i = (NI)0;
		res = ((NI) 2);
		{
			while (1) {
				if (!(((NI) 0) <= res)) goto LA3;
				i = res;
				result->data[i] = ((NIM_CHAR) (((NI) ((NI)(((NI) ((NI)(((NI) (val)) % ((NI) 8)))) + ((NI) 48))))));
				val = ((NI) ((NI)(((NI) (val)) / ((NI) 8))));
				res -= ((NI) 1);
			} LA3: ;
		}
	}
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsNilOrEmpty)(NimStringDesc* s) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	result = ((s ? s->Sup.len : 0) == ((NI) 0));
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuIsNilOrWhitespace)(NimStringDesc* s) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	{
		if (!((s ? s->Sup.len : 0) == ((NI) 0))) goto LA3_;
		result = NIM_TRUE;
		goto BeforeRet_;
	}
	LA3_: ;
	result = NIM_TRUE;
	{
		NIM_CHAR c;
		NI i;
		NI L;
		c = (NIM_CHAR)0;
		i = ((NI) 0);
		L = (s ? s->Sup.len : 0);
		{
			while (1) {
				if (!(i < L)) goto LA7;
				c = s->data[i];
				{
					NIM_BOOL T10_;
					T10_ = (NIM_BOOL)0;
					T10_ = nsuIsSpaceAsciiChar(c);
					if (!!(T10_)) goto LA11_;
					result = NIM_FALSE;
					goto BeforeRet_;
				}
				LA11_: ;
				i += ((NI) 1);
			} LA7: ;
		}
	}
	}BeforeRet_: ;
	return result;
}
static N_NIMCALL(void, Marker_TY_sM4lkSb7zS6F7OVMvW9cffQ)(void* p, NI op) {
	TY_sM4lkSb7zS6F7OVMvW9cffQ* a;
	NI T1_;
	a = (TY_sM4lkSb7zS6F7OVMvW9cffQ*)p;
	T1_ = (NI)0;
	for (T1_ = 0; T1_ < a->Sup.len; T1_++) {
	nimrtl_nimGCvisit((void*)a->data[T1_], op);
	}
}

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

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

N_LIB_EXPORT N_CDECL(TY_sM4lkSb7zS6F7OVMvW9cffQ*, nsuSplitWhitespace)(NimStringDesc* s) {
	TY_sM4lkSb7zS6F7OVMvW9cffQ* result;
	result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*)0;
	result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*) nimrtl_newSeq((&NTI_sM4lkSb7zS6F7OVMvW9cffQ_), 0);
	{
		NimStringDesc* x;
		NI last;
		NI splits;
		x = (NimStringDesc*)0;
		last = ((NI) 0);
		splits = ((NI) -1);
		{
			while (1) {
				NI first;
				if (!(last < (s ? s->Sup.len : 0))) goto LA3;
				{
					while (1) {
						if (!(((NU8)(s->data[last])) == ((NU8)(32)) || ((NU8)(s->data[last])) == ((NU8)(9)) || ((NU8)(s->data[last])) == ((NU8)(11)) || ((NU8)(s->data[last])) == ((NU8)(13)) || ((NU8)(s->data[last])) == ((NU8)(10)) || ((NU8)(s->data[last])) == ((NU8)(12)))) goto LA5;
						last += ((NI) 1);
					} LA5: ;
				}
				first = last;
				{
					while (1) {
						NIM_BOOL T8_;
						T8_ = (NIM_BOOL)0;
						T8_ = (last < (s ? s->Sup.len : 0));
						if (!(T8_)) goto LA9_;
						T8_ = !((((NU8)(s->data[last])) == ((NU8)(32)) || ((NU8)(s->data[last])) == ((NU8)(9)) || ((NU8)(s->data[last])) == ((NU8)(11)) || ((NU8)(s->data[last])) == ((NU8)(13)) || ((NU8)(s->data[last])) == ((NU8)(10)) || ((NU8)(s->data[last])) == ((NU8)(12))));
						LA9_: ;
						if (!T8_) goto LA7;
						last += ((NI) 1);
					} LA7: ;
				}
				{
					NimStringDesc* T18_;
					if (!(first <= (NI)(last - ((NI) 1)))) goto LA12_;
					{
						if (!(splits == ((NI) 0))) goto LA16_;
						last = (s ? s->Sup.len : 0);
					}
					LA16_: ;
					x = copyStrLast(s, first, (NI)(last - ((NI) 1)));
					result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV2(&(result)->Sup, sizeof(NimStringDesc*));
					T18_ = (NimStringDesc*)0;
					T18_ = result->data[result->Sup.len]; result->data[result->Sup.len] = nimrtl_copyStringRC1(x);
					if (T18_) nimGCunrefNoCycle(T18_);
					++result->Sup.len;
					{
						if (!(splits == ((NI) 0))) goto LA21_;
						goto LA2;
					}
					LA21_: ;
					splits -= ((NI) 1);
				}
				LA12_: ;
			} LA3: ;
		} LA2: ;
	}
	return result;
}

N_LIB_EXPORT N_CDECL(TY_sM4lkSb7zS6F7OVMvW9cffQ*, nsuSplitLines)(NimStringDesc* s) {
	TY_sM4lkSb7zS6F7OVMvW9cffQ* result;
	result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*)0;
	result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*) nimrtl_newSeq((&NTI_sM4lkSb7zS6F7OVMvW9cffQ_), 0);
	{
		NimStringDesc* x;
		NI first;
		NI last;
		x = (NimStringDesc*)0;
		first = ((NI) 0);
		last = ((NI) 0);
		{
			while (1) {
				NimStringDesc* T6_;
				{
					while (1) {
						if (!!((((NU8)(s->data[last])) == ((NU8)(0)) || ((NU8)(s->data[last])) == ((NU8)(13)) || ((NU8)(s->data[last])) == ((NU8)(10))))) goto LA5;
						last += ((NI) 1);
					} LA5: ;
				}
				x = copyStrLast(s, first, (NI)(last - ((NI) 1)));
				result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV2(&(result)->Sup, sizeof(NimStringDesc*));
				T6_ = (NimStringDesc*)0;
				T6_ = result->data[result->Sup.len]; result->data[result->Sup.len] = nimrtl_copyStringRC1(x);
				if (T6_) nimGCunrefNoCycle(T6_);
				++result->Sup.len;
				{
					if (!((NU8)(s->data[last]) == (NU8)(10))) goto LA9_;
					last += ((NI) 1);
				}
				goto LA7_;
				LA9_: ;
				{
					if (!((NU8)(s->data[last]) == (NU8)(13))) goto LA12_;
					last += ((NI) 1);
					{
						if (!((NU8)(s->data[last]) == (NU8)(10))) goto LA16_;
						last += ((NI) 1);
					}
					LA16_: ;
				}
				goto LA7_;
				LA12_: ;
				{
					goto LA2;
				}
				LA7_: ;
				first = last;
			}
		} LA2: ;
	}
	return result;
}

N_LIB_EXPORT N_CDECL(NI, nsuCountLines)(NimStringDesc* s) {
	NI result;
	NI i;
	result = (NI)0;
	i = ((NI) 1);
	{
		while (1) {
			if (!(i < (s ? s->Sup.len : 0))) goto LA2;
			switch (((NU8)(s->data[i]))) {
			case 13:
			{
				{
					if (!((NU8)(s->data[(NI)(i + ((NI) 1))]) == (NU8)(10))) goto LA6_;
					i += ((NI) 1);
				}
				LA6_: ;
				result += ((NI) 1);
			}
			break;
			case 10:
			{
				result += ((NI) 1);
			}
			break;
			default:
			{
			}
			break;
			}
			i += ((NI) 1);
		} LA2: ;
	}
	return result;
}

N_LIB_EXPORT N_CDECL(TY_sM4lkSb7zS6F7OVMvW9cffQ*, nsuSplitCharSet)(NimStringDesc* s, TY_nmiMWKVIe46vacnhAFrQvw_Set seps, NI maxsplit) {
	TY_sM4lkSb7zS6F7OVMvW9cffQ* result;
	result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*)0;
	result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*) nimrtl_newSeq((&NTI_sM4lkSb7zS6F7OVMvW9cffQ_), 0);
	{
		NimStringDesc* x;
		NI last;
		NI splits;
		x = (NimStringDesc*)0;
		last = ((NI) 0);
		splits = maxsplit;
		{
			if (!(((NI) 0) < (s ? s->Sup.len : 0))) goto LA4_;
			{
				while (1) {
					NI first;
					NimStringDesc* T16_;
					if (!(last <= (s ? s->Sup.len : 0))) goto LA7;
					first = last;
					{
						while (1) {
							NIM_BOOL T10_;
							T10_ = (NIM_BOOL)0;
							T10_ = (last < (s ? s->Sup.len : 0));
							if (!(T10_)) goto LA11_;
							T10_ = !(((seps[(NU)(((NU8)(s->data[last])))>>3] &(1U<<((NU)(((NU8)(s->data[last])))&7U)))!=0));
							LA11_: ;
							if (!T10_) goto LA9;
							last += ((NI) 1);
						} LA9: ;
					}
					{
						if (!(splits == ((NI) 0))) goto LA14_;
						last = (s ? s->Sup.len : 0);
					}
					LA14_: ;
					x = copyStrLast(s, first, (NI)(last - ((NI) 1)));
					result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV2(&(result)->Sup, sizeof(NimStringDesc*));
					T16_ = (NimStringDesc*)0;
					T16_ = result->data[result->Sup.len]; result->data[result->Sup.len] = nimrtl_copyStringRC1(x);
					if (T16_) nimGCunrefNoCycle(T16_);
					++result->Sup.len;
					{
						if (!(splits == ((NI) 0))) goto LA19_;
						goto LA6;
					}
					LA19_: ;
					splits -= ((NI) 1);
					last += ((NI) 1);
				} LA7: ;
			} LA6: ;
		}
		LA4_: ;
	}
	return result;
}

N_LIB_EXPORT N_CDECL(TY_sM4lkSb7zS6F7OVMvW9cffQ*, nsuSplitChar)(NimStringDesc* s, NIM_CHAR sep, NI maxsplit) {
	TY_sM4lkSb7zS6F7OVMvW9cffQ* result;
	result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*)0;
	result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*) nimrtl_newSeq((&NTI_sM4lkSb7zS6F7OVMvW9cffQ_), 0);
	{
		NimStringDesc* x;
		NI last;
		NI splits;
		x = (NimStringDesc*)0;
		last = ((NI) 0);
		splits = maxsplit;
		{
			if (!(((NI) 0) < (s ? s->Sup.len : 0))) goto LA4_;
			{
				while (1) {
					NI first;
					NimStringDesc* T16_;
					if (!(last <= (s ? s->Sup.len : 0))) goto LA7;
					first = last;
					{
						while (1) {
							NIM_BOOL T10_;
							T10_ = (NIM_BOOL)0;
							T10_ = (last < (s ? s->Sup.len : 0));
							if (!(T10_)) goto LA11_;
							T10_ = !(((NU8)(s->data[last]) == (NU8)(sep)));
							LA11_: ;
							if (!T10_) goto LA9;
							last += ((NI) 1);
						} LA9: ;
					}
					{
						if (!(splits == ((NI) 0))) goto LA14_;
						last = (s ? s->Sup.len : 0);
					}
					LA14_: ;
					x = copyStrLast(s, first, (NI)(last - ((NI) 1)));
					result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV2(&(result)->Sup, sizeof(NimStringDesc*));
					T16_ = (NimStringDesc*)0;
					T16_ = result->data[result->Sup.len]; result->data[result->Sup.len] = nimrtl_copyStringRC1(x);
					if (T16_) nimGCunrefNoCycle(T16_);
					++result->Sup.len;
					{
						if (!(splits == ((NI) 0))) goto LA19_;
						goto LA6;
					}
					LA19_: ;
					splits -= ((NI) 1);
					last += ((NI) 1);
				} LA7: ;
			} LA6: ;
		}
		LA4_: ;
	}
	return result;
}

N_NIMCALL(NIM_BOOL, substrEq_7ngl0F5lryTkSAj7sYQ7pw)(NimStringDesc* s, NI pos, NimStringDesc* substr) {
	NIM_BOOL result;
	NI i;
	NI length;
{	result = (NIM_BOOL)0;
	i = ((NI) 0);
	length = (substr ? substr->Sup.len : 0);
	{
		while (1) {
			NIM_BOOL T3_;
			T3_ = (NIM_BOOL)0;
			T3_ = (i < length);
			if (!(T3_)) goto LA4_;
			T3_ = ((NU8)(s->data[(NI)(pos + i)]) == (NU8)(substr->data[i]));
			LA4_: ;
			if (!T3_) goto LA2;
			i += ((NI) 1);
		} LA2: ;
	}
	result = (i == length);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(TY_sM4lkSb7zS6F7OVMvW9cffQ*, nsuSplitString)(NimStringDesc* s, NimStringDesc* sep, NI maxsplit) {
	TY_sM4lkSb7zS6F7OVMvW9cffQ* result;
	result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*)0;
	{
		if (!!((((NI) 0) < (sep ? sep->Sup.len : 0)))) goto LA3_;
		raiseAssert_PpfSiTIeNpMAb9a5o6SglJw_2(((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_2));
	}
	LA3_: ;
	result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*) nimrtl_newSeq((&NTI_sM4lkSb7zS6F7OVMvW9cffQ_), 0);
	{
		NimStringDesc* x;
		NI last;
		NI splits;
		x = (NimStringDesc*)0;
		last = ((NI) 0);
		splits = maxsplit;
		{
			if (!(((NI) 0) < (s ? s->Sup.len : 0))) goto LA8_;
			{
				while (1) {
					NI first;
					NimStringDesc* T21_;
					if (!(last <= (s ? s->Sup.len : 0))) goto LA11;
					first = last;
					{
						while (1) {
							NIM_BOOL T14_;
							NIM_BOOL T16_;
							T14_ = (NIM_BOOL)0;
							T14_ = (last < (s ? s->Sup.len : 0));
							if (!(T14_)) goto LA15_;
							T16_ = (NIM_BOOL)0;
							T16_ = substrEq_7ngl0F5lryTkSAj7sYQ7pw(s, last, sep);
							T14_ = !(T16_);
							LA15_: ;
							if (!T14_) goto LA13;
							last += ((NI) 1);
						} LA13: ;
					}
					{
						if (!(splits == ((NI) 0))) goto LA19_;
						last = (s ? s->Sup.len : 0);
					}
					LA19_: ;
					x = copyStrLast(s, first, (NI)(last - ((NI) 1)));
					result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV2(&(result)->Sup, sizeof(NimStringDesc*));
					T21_ = (NimStringDesc*)0;
					T21_ = result->data[result->Sup.len]; result->data[result->Sup.len] = nimrtl_copyStringRC1(x);
					if (T21_) nimGCunrefNoCycle(T21_);
					++result->Sup.len;
					{
						if (!(splits == ((NI) 0))) goto LA24_;
						goto LA10;
					}
					LA24_: ;
					splits -= ((NI) 1);
					last += (sep ? sep->Sup.len : 0);
				} LA11: ;
			} LA10: ;
		}
		LA8_: ;
	}
	return result;
}

N_LIB_EXPORT N_CDECL(TY_sM4lkSb7zS6F7OVMvW9cffQ*, nsuRSplitCharSet)(NimStringDesc* s, TY_nmiMWKVIe46vacnhAFrQvw_Set seps, NI maxsplit) {
	TY_sM4lkSb7zS6F7OVMvW9cffQ* result;
	result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*)0;
	result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*) nimrtl_newSeq((&NTI_sM4lkSb7zS6F7OVMvW9cffQ_), 0);
	{
		NimStringDesc* x;
		NI last;
		NI first;
		NI splits;
		NI startPos;
		x = (NimStringDesc*)0;
		last = (NI)((s ? s->Sup.len : 0) - ((NI) 1));
		first = last;
		splits = maxsplit;
		startPos = ((NI) 0);
		{
			if (!(((NI) 0) < (s ? s->Sup.len : 0))) goto LA4_;
			{
				while (1) {
					NimStringDesc* T21_;
					if (!(((NI) -1) <= first)) goto LA7;
					{
						while (1) {
							NIM_BOOL T10_;
							T10_ = (NIM_BOOL)0;
							T10_ = (((NI) 0) <= first);
							if (!(T10_)) goto LA11_;
							T10_ = !(((seps[(NU)(((NU8)(s->data[first])))>>3] &(1U<<((NU)(((NU8)(s->data[first])))&7U)))!=0));
							LA11_: ;
							if (!T10_) goto LA9;
							first -= ((NI) 1);
						} LA9: ;
					}
					{
						if (!(splits == ((NI) 0))) goto LA14_;
						first = ((NI) -1);
					}
					LA14_: ;
					{
						if (!(first == ((NI) -1))) goto LA18_;
						startPos = ((NI) 0);
					}
					goto LA16_;
					LA18_: ;
					{
						startPos = (NI)(first + ((NI) 1));
					}
					LA16_: ;
					x = copyStrLast(s, startPos, last);
					result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV2(&(result)->Sup, sizeof(NimStringDesc*));
					T21_ = (NimStringDesc*)0;
					T21_ = result->data[result->Sup.len]; result->data[result->Sup.len] = nimrtl_copyStringRC1(x);
					if (T21_) nimGCunrefNoCycle(T21_);
					++result->Sup.len;
					{
						if (!(splits == ((NI) 0))) goto LA24_;
						goto LA6;
					}
					LA24_: ;
					splits -= ((NI) 1);
					first -= ((NI) 1);
					last = first;
				} LA7: ;
			} LA6: ;
		}
		LA4_: ;
	}
	reverse_LoixoqZetR6FfezoPedx8w(result->data, result->Sup.len);
	return result;
}

N_LIB_EXPORT N_CDECL(TY_sM4lkSb7zS6F7OVMvW9cffQ*, nsuRSplitChar)(NimStringDesc* s, NIM_CHAR sep, NI maxsplit) {
	TY_sM4lkSb7zS6F7OVMvW9cffQ* result;
	result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*)0;
	result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*) nimrtl_newSeq((&NTI_sM4lkSb7zS6F7OVMvW9cffQ_), 0);
	{
		NimStringDesc* x;
		NI last;
		NI first;
		NI splits;
		NI startPos;
		x = (NimStringDesc*)0;
		last = (NI)((s ? s->Sup.len : 0) - ((NI) 1));
		first = last;
		splits = maxsplit;
		startPos = ((NI) 0);
		{
			if (!(((NI) 0) < (s ? s->Sup.len : 0))) goto LA4_;
			{
				while (1) {
					NimStringDesc* T21_;
					if (!(((NI) -1) <= first)) goto LA7;
					{
						while (1) {
							NIM_BOOL T10_;
							T10_ = (NIM_BOOL)0;
							T10_ = (((NI) 0) <= first);
							if (!(T10_)) goto LA11_;
							T10_ = !(((NU8)(s->data[first]) == (NU8)(sep)));
							LA11_: ;
							if (!T10_) goto LA9;
							first -= ((NI) 1);
						} LA9: ;
					}
					{
						if (!(splits == ((NI) 0))) goto LA14_;
						first = ((NI) -1);
					}
					LA14_: ;
					{
						if (!(first == ((NI) -1))) goto LA18_;
						startPos = ((NI) 0);
					}
					goto LA16_;
					LA18_: ;
					{
						startPos = (NI)(first + ((NI) 1));
					}
					LA16_: ;
					x = copyStrLast(s, startPos, last);
					result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV2(&(result)->Sup, sizeof(NimStringDesc*));
					T21_ = (NimStringDesc*)0;
					T21_ = result->data[result->Sup.len]; result->data[result->Sup.len] = nimrtl_copyStringRC1(x);
					if (T21_) nimGCunrefNoCycle(T21_);
					++result->Sup.len;
					{
						if (!(splits == ((NI) 0))) goto LA24_;
						goto LA6;
					}
					LA24_: ;
					splits -= ((NI) 1);
					first -= ((NI) 1);
					last = first;
				} LA7: ;
			} LA6: ;
		}
		LA4_: ;
	}
	reverse_LoixoqZetR6FfezoPedx8w(result->data, result->Sup.len);
	return result;
}

N_LIB_EXPORT N_CDECL(TY_sM4lkSb7zS6F7OVMvW9cffQ*, nsuRSplitString)(NimStringDesc* s, NimStringDesc* sep, NI maxsplit) {
	TY_sM4lkSb7zS6F7OVMvW9cffQ* result;
	result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*)0;
	result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*) nimrtl_newSeq((&NTI_sM4lkSb7zS6F7OVMvW9cffQ_), 0);
	{
		NimStringDesc* x;
		NI last;
		NI first;
		NI splits;
		NI startPos;
		x = (NimStringDesc*)0;
		last = (NI)((s ? s->Sup.len : 0) - ((NI) 1));
		first = last;
		splits = maxsplit;
		startPos = ((NI) 0);
		{
			if (!(((NI) 0) < (s ? s->Sup.len : 0))) goto LA4_;
			{
				while (1) {
					NimStringDesc* T22_;
					if (!(((NI) -1) <= first)) goto LA7;
					{
						while (1) {
							NIM_BOOL T10_;
							NIM_BOOL T12_;
							T10_ = (NIM_BOOL)0;
							T10_ = (((NI) 0) <= first);
							if (!(T10_)) goto LA11_;
							T12_ = (NIM_BOOL)0;
							T12_ = substrEq_7ngl0F5lryTkSAj7sYQ7pw(s, first, sep);
							T10_ = !(T12_);
							LA11_: ;
							if (!T10_) goto LA9;
							first -= ((NI) 1);
						} LA9: ;
					}
					{
						if (!(splits == ((NI) 0))) goto LA15_;
						first = ((NI) -1);
					}
					LA15_: ;
					{
						if (!(first == ((NI) -1))) goto LA19_;
						startPos = ((NI) 0);
					}
					goto LA17_;
					LA19_: ;
					{
						startPos = (NI)(first + (sep ? sep->Sup.len : 0));
					}
					LA17_: ;
					x = copyStrLast(s, startPos, last);
					result = (TY_sM4lkSb7zS6F7OVMvW9cffQ*) incrSeqV2(&(result)->Sup, sizeof(NimStringDesc*));
					T22_ = (NimStringDesc*)0;
					T22_ = result->data[result->Sup.len]; result->data[result->Sup.len] = nimrtl_copyStringRC1(x);
					if (T22_) nimGCunrefNoCycle(T22_);
					++result->Sup.len;
					{
						if (!(splits == ((NI) 0))) goto LA25_;
						goto LA6;
					}
					LA25_: ;
					splits -= ((NI) 1);
					first -= ((NI) 1);
					last = first;
				} LA7: ;
			} LA6: ;
		}
		LA4_: ;
	}
	reverse_LoixoqZetR6FfezoPedx8w(result->data, result->Sup.len);
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuToHex)(NI64 x, NI len) {
	NimStringDesc* result;
	NI64 n;
	result = (NimStringDesc*)0;
	n = x;
	result = mnewString(((NI) (len)));
	{
		NI j;
		NI colontmp_;
		NI res;
		j = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (NI)(((NI) (len)) - ((NI) 1));
		res = ((NI) (colontmp_));
		{
			while (1) {
				if (!(((NI) 0) <= res)) goto LA3;
				j = ((NI) (res));
				result->data[j] = ((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_3)->data[(NI64)(n & IL64(15))];
				n = (NI64)((NU64)(n) >> (NU64)(((NI) 4)));
				{
					NIM_BOOL T6_;
					T6_ = (NIM_BOOL)0;
					T6_ = (n == IL64(0));
					if (!(T6_)) goto LA7_;
					T6_ = (x < IL64(0));
					LA7_: ;
					if (!T6_) goto LA8_;
					n = IL64(-1);
				}
				LA8_: ;
				res -= ((NI) 1);
			} LA3: ;
		}
	}
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuIntToStr)(NI x, NI minchars) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = nimrtl_nimIntToStr((x > 0? (x) : -(x)));
	{
		NI i;
		NI colontmp_;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (NI)(((NI) (minchars)) - (result ? result->Sup.len : 0));
		res = ((NI) 1);
		{
			while (1) {
				NimStringDesc* T4_;
				if (!(res <= colontmp_)) goto LA3;
				i = res;
				T4_ = (NimStringDesc*)0;
				T4_ = rawNewString(result->Sup.len + 1);
appendChar(T4_, 48);
appendString(T4_, result);
				result = T4_;
				res += ((NI) 1);
			} LA3: ;
		}
	}
	{
		NimStringDesc* T9_;
		if (!(x < ((NI) 0))) goto LA7_;
		T9_ = (NimStringDesc*)0;
		T9_ = rawNewString(result->Sup.len + 1);
appendChar(T9_, 45);
appendString(T9_, result);
		result = T9_;
	}
	LA7_: ;
	return result;
}

static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) {
	{
		Cell_1zcF9cV8XIAtbN8h5HRUB8g* c;
		if (!!((src == NIM_NIL))) goto LA3_;
		c = usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem(src);
		(*c).refcount += ((NI) 8);
	}
	LA3_: ;
	{
		Cell_1zcF9cV8XIAtbN8h5HRUB8g* c_2;
		if (!!(((*dest) == NIM_NIL))) goto LA7_;
		c_2 = usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem((*dest));
		{
			(*c_2).refcount -= ((NI) 8);
			if (!((NU32)((*c_2).refcount) < (NU32)(((NI) 8)))) goto LA11_;
			nimrtl_rtlAddZCT(c_2);
		}
		LA11_: ;
	}
	LA7_: ;
	(*dest) = src;
}

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

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

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

N_LIB_EXPORT N_CDECL(NI, nsuParseInt)(NimStringDesc* s) {
	NI result;
	NI L;
	result = (NI)0;
	L = npuParseInt(s, (&result), ((NI) 0));
	{
		NIM_BOOL T3_;
		ValueError_Gi06FkNeykJn7mrqRZYrkA* e;
		NimStringDesc* T7_;
		T3_ = (NIM_BOOL)0;
		T3_ = !((L == (s ? s->Sup.len : 0)));
		if (T3_) goto LA4_;
		T3_ = (L == ((NI) 0));
		LA4_: ;
		if (!T3_) goto LA5_;
		e = (ValueError_Gi06FkNeykJn7mrqRZYrkA*)0;
		e = (ValueError_Gi06FkNeykJn7mrqRZYrkA*) nimrtl_newObj((&NTI_yCEN9anxCD6mzBxGjuaRBdg_), sizeof(ValueError_Gi06FkNeykJn7mrqRZYrkA));
		(*e).Sup.Sup.m_type = (&NTI_Gi06FkNeykJn7mrqRZYrkA_);
		T7_ = (NimStringDesc*)0;
		T7_ = rawNewString(s->Sup.len + 17);
appendString(T7_, ((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_4));
appendString(T7_, s);
		asgnRefNoCycle((void**) (&(*e).Sup.message), T7_);
		asgnRef((void**) (&(*e).Sup.parent), NIM_NIL);
		nimrtl_raiseException((Exception*)e, "ValueError");
	}
	LA5_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NI64, nsuParseBiggestInt)(NimStringDesc* s) {
	NI64 result;
	NI L;
	result = (NI64)0;
	L = npuParseBiggestInt(s, (&result), ((NI) 0));
	{
		NIM_BOOL T3_;
		ValueError_Gi06FkNeykJn7mrqRZYrkA* e;
		NimStringDesc* T7_;
		T3_ = (NIM_BOOL)0;
		T3_ = !((L == (s ? s->Sup.len : 0)));
		if (T3_) goto LA4_;
		T3_ = (L == ((NI) 0));
		LA4_: ;
		if (!T3_) goto LA5_;
		e = (ValueError_Gi06FkNeykJn7mrqRZYrkA*)0;
		e = (ValueError_Gi06FkNeykJn7mrqRZYrkA*) nimrtl_newObj((&NTI_yCEN9anxCD6mzBxGjuaRBdg_), sizeof(ValueError_Gi06FkNeykJn7mrqRZYrkA));
		(*e).Sup.Sup.m_type = (&NTI_Gi06FkNeykJn7mrqRZYrkA_);
		T7_ = (NimStringDesc*)0;
		T7_ = rawNewString(s->Sup.len + 17);
appendString(T7_, ((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_4));
appendString(T7_, s);
		asgnRefNoCycle((void**) (&(*e).Sup.message), T7_);
		asgnRef((void**) (&(*e).Sup.parent), NIM_NIL);
		nimrtl_raiseException((Exception*)e, "ValueError");
	}
	LA5_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NU, nsuParseUInt)(NimStringDesc* s) {
	NU result;
	NI L;
	result = (NU)0;
	L = npuParseUInt(s, (&result), ((NI) 0));
	{
		NIM_BOOL T3_;
		ValueError_Gi06FkNeykJn7mrqRZYrkA* e;
		NimStringDesc* T7_;
		T3_ = (NIM_BOOL)0;
		T3_ = !((L == (s ? s->Sup.len : 0)));
		if (T3_) goto LA4_;
		T3_ = (L == ((NI) 0));
		LA4_: ;
		if (!T3_) goto LA5_;
		e = (ValueError_Gi06FkNeykJn7mrqRZYrkA*)0;
		e = (ValueError_Gi06FkNeykJn7mrqRZYrkA*) nimrtl_newObj((&NTI_yCEN9anxCD6mzBxGjuaRBdg_), sizeof(ValueError_Gi06FkNeykJn7mrqRZYrkA));
		(*e).Sup.Sup.m_type = (&NTI_Gi06FkNeykJn7mrqRZYrkA_);
		T7_ = (NimStringDesc*)0;
		T7_ = rawNewString(s->Sup.len + 26);
appendString(T7_, ((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_5));
appendString(T7_, s);
		asgnRefNoCycle((void**) (&(*e).Sup.message), T7_);
		asgnRef((void**) (&(*e).Sup.parent), NIM_NIL);
		nimrtl_raiseException((Exception*)e, "ValueError");
	}
	LA5_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NU64, nsuParseBiggestUInt)(NimStringDesc* s) {
	NU64 result;
	NI L;
	result = (NU64)0;
	L = npuParseBiggestUInt(s, (&result), ((NI) 0));
	{
		NIM_BOOL T3_;
		ValueError_Gi06FkNeykJn7mrqRZYrkA* e;
		NimStringDesc* T7_;
		T3_ = (NIM_BOOL)0;
		T3_ = !((L == (s ? s->Sup.len : 0)));
		if (T3_) goto LA4_;
		T3_ = (L == ((NI) 0));
		LA4_: ;
		if (!T3_) goto LA5_;
		e = (ValueError_Gi06FkNeykJn7mrqRZYrkA*)0;
		e = (ValueError_Gi06FkNeykJn7mrqRZYrkA*) nimrtl_newObj((&NTI_yCEN9anxCD6mzBxGjuaRBdg_), sizeof(ValueError_Gi06FkNeykJn7mrqRZYrkA));
		(*e).Sup.Sup.m_type = (&NTI_Gi06FkNeykJn7mrqRZYrkA_);
		T7_ = (NimStringDesc*)0;
		T7_ = rawNewString(s->Sup.len + 26);
appendString(T7_, ((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_5));
appendString(T7_, s);
		asgnRefNoCycle((void**) (&(*e).Sup.message), T7_);
		asgnRef((void**) (&(*e).Sup.parent), NIM_NIL);
		nimrtl_raiseException((Exception*)e, "ValueError");
	}
	LA5_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NF, nsuParseFloat)(NimStringDesc* s) {
	NF result;
	NI L;
	result = (NF)0;
	L = npuParseFloat(s, (&result), ((NI) 0));
	{
		NIM_BOOL T3_;
		ValueError_Gi06FkNeykJn7mrqRZYrkA* e;
		NimStringDesc* T7_;
		T3_ = (NIM_BOOL)0;
		T3_ = !((L == (s ? s->Sup.len : 0)));
		if (T3_) goto LA4_;
		T3_ = (L == ((NI) 0));
		LA4_: ;
		if (!T3_) goto LA5_;
		e = (ValueError_Gi06FkNeykJn7mrqRZYrkA*)0;
		e = (ValueError_Gi06FkNeykJn7mrqRZYrkA*) nimrtl_newObj((&NTI_yCEN9anxCD6mzBxGjuaRBdg_), sizeof(ValueError_Gi06FkNeykJn7mrqRZYrkA));
		(*e).Sup.Sup.m_type = (&NTI_Gi06FkNeykJn7mrqRZYrkA_);
		T7_ = (NimStringDesc*)0;
		T7_ = rawNewString(s->Sup.len + 15);
appendString(T7_, ((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_6));
appendString(T7_, s);
		asgnRefNoCycle((void**) (&(*e).Sup.message), T7_);
		asgnRef((void**) (&(*e).Sup.parent), NIM_NIL);
		nimrtl_raiseException((Exception*)e, "ValueError");
	}
	LA5_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NI, nsuParseHexInt)(NimStringDesc* s) {
	NI result;
	NI i;
	result = (NI)0;
	i = ((NI) 0);
	{
		NIM_BOOL T3_;
		NIM_BOOL T5_;
		T3_ = (NIM_BOOL)0;
		T3_ = ((NU8)(s->data[i]) == (NU8)(48));
		if (!(T3_)) goto LA4_;
		T5_ = (NIM_BOOL)0;
		T5_ = ((NU8)(s->data[(NI)(i + ((NI) 1))]) == (NU8)(120));
		if (T5_) goto LA6_;
		T5_ = ((NU8)(s->data[(NI)(i + ((NI) 1))]) == (NU8)(88));
		LA6_: ;
		T3_ = T5_;
		LA4_: ;
		if (!T3_) goto LA7_;
		i += ((NI) 2);
	}
	goto LA1_;
	LA7_: ;
	{
		if (!((NU8)(s->data[i]) == (NU8)(35))) goto LA10_;
		i += ((NI) 1);
	}
	goto LA1_;
	LA10_: ;
	LA1_: ;
	{
		while (1) {
			switch (((NU8)(s->data[i]))) {
			case 95:
			{
				i += ((NI) 1);
			}
			break;
			case 48 ... 57:
			{
				result = (NI)((NI)((NU32)(result) << (NU32)(((NI) 4))) | ((NI) ((NI)(((NI) (((NU8)(s->data[i])))) - ((NI) 48)))));
				i += ((NI) 1);
			}
			break;
			case 97 ... 102:
			{
				result = (NI)((NI)((NU32)(result) << (NU32)(((NI) 4))) | ((NI) ((NI)(((NI) ((NI)(((NI) (((NU8)(s->data[i])))) - ((NI) 97)))) + ((NI) 10)))));
				i += ((NI) 1);
			}
			break;
			case 65 ... 70:
			{
				result = (NI)((NI)((NU32)(result) << (NU32)(((NI) 4))) | ((NI) ((NI)(((NI) ((NI)(((NI) (((NU8)(s->data[i])))) - ((NI) 65)))) + ((NI) 10)))));
				i += ((NI) 1);
			}
			break;
			case 0:
			{
				goto LA12;
			}
			break;
			default:
			{
				ValueError_Gi06FkNeykJn7mrqRZYrkA* e;
				NimStringDesc* T20_;
				e = (ValueError_Gi06FkNeykJn7mrqRZYrkA*)0;
				e = (ValueError_Gi06FkNeykJn7mrqRZYrkA*) nimrtl_newObj((&NTI_yCEN9anxCD6mzBxGjuaRBdg_), sizeof(ValueError_Gi06FkNeykJn7mrqRZYrkA));
				(*e).Sup.Sup.m_type = (&NTI_Gi06FkNeykJn7mrqRZYrkA_);
				T20_ = (NimStringDesc*)0;
				T20_ = rawNewString(s->Sup.len + 17);
appendString(T20_, ((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_4));
appendString(T20_, s);
				asgnRefNoCycle((void**) (&(*e).Sup.message), T20_);
				asgnRef((void**) (&(*e).Sup.parent), NIM_NIL);
				nimrtl_raiseException((Exception*)e, "ValueError");
			}
			break;
			}
		}
	} LA12: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuRepeatChar)(NIM_CHAR c, NI count) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = mnewString(count);
	{
		NI i;
		NI colontmp_;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (NI)(((NI) (count)) - ((NI) 1));
		res = ((NI) 0);
		{
			while (1) {
				if (!(res <= ((NI) (colontmp_)))) goto LA3;
				i = ((NI) (res));
				result->data[i] = c;
				res += ((NI) 1);
			} LA3: ;
		}
	}
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuRepeatStr)(NimStringDesc* s, NI n) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = rawNewString(((NI) ((NI)(((NI) (n)) * (s ? s->Sup.len : 0)))));
	{
		NI i;
		NI res;
		i = (NI)0;
		res = ((NI) 1);
		{
			while (1) {
				if (!(res <= ((NI) (n)))) goto LA3;
				i = ((NI) (res));
				result = nimrtl_resizeString(result, s->Sup.len + 0);
appendString(result, s);
				res += ((NI) 1);
			} LA3: ;
		}
	}
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuAlignString)(NimStringDesc* s, NI count, NIM_CHAR padding) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	{
		NI spaces;
		if (!((s ? s->Sup.len : 0) < ((NI) (count)))) goto LA3_;
		result = mnewString(count);
		spaces = (NI)(((NI) (count)) - (s ? s->Sup.len : 0));
		{
			NI i;
			NI colontmp_;
			NI res;
			i = (NI)0;
			colontmp_ = (NI)0;
			colontmp_ = (NI)(spaces - ((NI) 1));
			res = ((NI) 0);
			{
				while (1) {
					if (!(res <= colontmp_)) goto LA7;
					i = res;
					result->data[i] = padding;
					res += ((NI) 1);
				} LA7: ;
			}
		}
		{
			NI i_2;
			NI colontmp__2;
			NI res_2;
			i_2 = (NI)0;
			colontmp__2 = (NI)0;
			colontmp__2 = (NI)(((NI) (count)) - ((NI) 1));
			res_2 = spaces;
			{
				while (1) {
					if (!(res_2 <= ((NI) (colontmp__2)))) goto LA10;
					i_2 = ((NI) (res_2));
					result->data[i_2] = s->data[(NI)(((NI) (i_2)) - spaces)];
					res_2 += ((NI) 1);
				} LA10: ;
			}
		}
	}
	goto LA1_;
	LA3_: ;
	{
		result = nimrtl_copyString(s);
	}
	LA1_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuWordWrap)(NimStringDesc* s, NI maxLineWidth, NIM_BOOL splitLongWords, TY_nmiMWKVIe46vacnhAFrQvw_Set seps, NimStringDesc* newLine) {
	NimStringDesc* result;
	NI spaceLeft;
	NimStringDesc* lastSep;
	result = (NimStringDesc*)0;
	result = rawNewString(((NI) ((NI)((s ? s->Sup.len : 0) + (NI)((NU32)((s ? s->Sup.len : 0)) >> (NU32)(((NI) 6)))))));
	spaceLeft = maxLineWidth;
	lastSep = nimrtl_copyString(((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_7));
	{
		NimStringDesc* word;
		NIM_BOOL isSep;
		NI i;
		word = (NimStringDesc*)0;
		isSep = (NIM_BOOL)0;
		i = ((NI) 0);
		{
			while (1) {
				NI j;
				NIM_BOOL isSep_2;
				j = i;
				isSep_2 = ((seps[(NU)(((NU8)(s->data[j])))>>3] &(1U<<((NU)(((NU8)(s->data[j])))&7U)))!=0);
				{
					while (1) {
						NIM_BOOL T6_;
						T6_ = (NIM_BOOL)0;
						T6_ = (j < (s ? s->Sup.len : 0));
						if (!(T6_)) goto LA7_;
						T6_ = (((seps[(NU)(((NU8)(s->data[j])))>>3] &(1U<<((NU)(((NU8)(s->data[j])))&7U)))!=0) == isSep_2);
						LA7_: ;
						if (!T6_) goto LA5;
						j += ((NI) 1);
					} LA5: ;
				}
				{
					if (!(i < j)) goto LA10_;
					word = copyStrLast(s, i, (NI)(j - ((NI) 1)));
					isSep = isSep_2;
					{
						{
							if (!isSep) goto LA15_;
							lastSep = nimrtl_copyString(word);
							spaceLeft = (NI)(spaceLeft - (word ? word->Sup.len : 0));
							goto LA12;
						}
						LA15_: ;
						{
							if (!(spaceLeft < (word ? word->Sup.len : 0))) goto LA19_;
							{
								NIM_BOOL T23_;
								NimStringDesc* T27_;
								NI w;
								NI wordLeft;
								T23_ = (NIM_BOOL)0;
								T23_ = splitLongWords;
								if (!(T23_)) goto LA24_;
								T23_ = (maxLineWidth < (word ? word->Sup.len : 0));
								LA24_: ;
								if (!T23_) goto LA25_;
								T27_ = (NimStringDesc*)0;
								T27_ = copyStrLast(word, ((NI) 0), (NI)(spaceLeft - ((NI) 1)));
								result = nimrtl_resizeString(result, T27_->Sup.len + 0);
appendString(result, T27_);
								w = (NI)(spaceLeft + ((NI) 1));
								wordLeft = (NI)((word ? word->Sup.len : 0) - spaceLeft);
								{
									while (1) {
										NI L;
										NimStringDesc* T30_;
										if (!(((NI) 0) < wordLeft)) goto LA29;
										result = nimrtl_resizeString(result, newLine->Sup.len + 0);
appendString(result, newLine);
										L = ((maxLineWidth <= wordLeft) ? maxLineWidth : wordLeft);
										spaceLeft = (NI)(maxLineWidth - L);
										T30_ = (NimStringDesc*)0;
										T30_ = copyStrLast(word, w, (NI)((NI)(w + L) - ((NI) 1)));
										result = nimrtl_resizeString(result, T30_->Sup.len + 0);
appendString(result, T30_);
										w += L;
										wordLeft -= L;
									} LA29: ;
								}
							}
							goto LA21_;
							LA25_: ;
							{
								spaceLeft = (NI)(maxLineWidth - (word ? word->Sup.len : 0));
								result = nimrtl_resizeString(result, newLine->Sup.len + 0);
appendString(result, newLine);
								result = nimrtl_resizeString(result, word->Sup.len + 0);
appendString(result, word);
							}
							LA21_: ;
						}
						goto LA17_;
						LA19_: ;
						{
							NimStringDesc* T33_;
							spaceLeft = (NI)(spaceLeft - (word ? word->Sup.len : 0));
							T33_ = (NimStringDesc*)0;
							T33_ = rawNewString(lastSep->Sup.len + word->Sup.len + 0);
appendString(T33_, lastSep);
appendString(T33_, word);
							result = nimrtl_resizeString(result, T33_->Sup.len + 0);
appendString(result, T33_);
							lastSep = nimrtl_setLengthStr(lastSep, ((NI) 0));
						}
						LA17_: ;
					} LA12: ;
				}
				goto LA8_;
				LA10_: ;
				{
					goto LA2;
				}
				LA8_: ;
				i = j;
			}
		} LA2: ;
	}
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuIndent)(NimStringDesc* s, NI count, NimStringDesc* padding) {
	NimStringDesc* result;
	NI i;
	result = (NimStringDesc*)0;
	result = nimrtl_copyString(((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_7));
	i = ((NI) 0);
	{
		NimStringDesc* line;
		NI first;
		NI last;
		line = (NimStringDesc*)0;
		first = ((NI) 0);
		last = ((NI) 0);
		{
			while (1) {
				{
					while (1) {
						if (!!((((NU8)(s->data[last])) == ((NU8)(0)) || ((NU8)(s->data[last])) == ((NU8)(13)) || ((NU8)(s->data[last])) == ((NU8)(10))))) goto LA5;
						last += ((NI) 1);
					} LA5: ;
				}
				line = copyStrLast(s, first, (NI)(last - ((NI) 1)));
				{
					if (!!((i == ((NI) 0)))) goto LA8_;
					result = nimrtl_resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_8));
				}
				LA8_: ;
				{
					NI j;
					NI res;
					j = (NI)0;
					res = ((NI) 1);
					{
						while (1) {
							if (!(res <= ((NI) (count)))) goto LA12;
							j = ((NI) (res));
							result = nimrtl_resizeString(result, padding->Sup.len + 0);
appendString(result, padding);
							res += ((NI) 1);
						} LA12: ;
					}
				}
				result = nimrtl_resizeString(result, line->Sup.len + 0);
appendString(result, line);
				i += ((NI) 1);
				{
					if (!((NU8)(s->data[last]) == (NU8)(10))) goto LA15_;
					last += ((NI) 1);
				}
				goto LA13_;
				LA15_: ;
				{
					if (!((NU8)(s->data[last]) == (NU8)(13))) goto LA18_;
					last += ((NI) 1);
					{
						if (!((NU8)(s->data[last]) == (NU8)(10))) goto LA22_;
						last += ((NI) 1);
					}
					LA22_: ;
				}
				goto LA13_;
				LA18_: ;
				{
					goto LA2;
				}
				LA13_: ;
				first = last;
			}
		} LA2: ;
	}
	return result;
}

static N_INLINE(NimStringDesc*, X5BX5D__Sq9b57KCLKZryBwyHy49aBswstrutils)(NimStringDesc* s, Slice_qL3WGViqT0p5sVr4YFHsLg x) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = copyStrLast(s, x.a, x.b);
	return result;
}

static N_INLINE(Slice_qL3WGViqT0p5sVr4YFHsLg, dotdot__18yoMoUbfoITYgEZSwZDYAstrutils)(NI a, NI b) {
	Slice_qL3WGViqT0p5sVr4YFHsLg result;
	memset((void*)(&result), 0, sizeof(result));
	result.a = a;
	result.b = b;
	return result;
}

static N_INLINE(NIM_BOOL, equalMem_DCrUjdaMvFDHaR1hs7sQGwstrutils)(void* a, void* b, NI size) {
	NIM_BOOL result;
	int T1_;
	result = (NIM_BOOL)0;
	T1_ = (int)0;
	T1_ = memcmp(a, b, ((size_t) (size)));
	result = (T1_ == ((NI32) 0));
	return result;
}

static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b) {
	NIM_BOOL result;
	NIM_BOOL T11_;
{	result = (NIM_BOOL)0;
	{
		if (!(a == b)) goto LA3_;
		result = NIM_TRUE;
		goto BeforeRet_;
	}
	LA3_: ;
	{
		NIM_BOOL T7_;
		T7_ = (NIM_BOOL)0;
		T7_ = (a == NIM_NIL);
		if (T7_) goto LA8_;
		T7_ = (b == NIM_NIL);
		LA8_: ;
		if (!T7_) goto LA9_;
		result = NIM_FALSE;
		goto BeforeRet_;
	}
	LA9_: ;
	T11_ = (NIM_BOOL)0;
	T11_ = ((*a).Sup.len == (*b).Sup.len);
	if (!(T11_)) goto LA12_;
	T11_ = equalMem_DCrUjdaMvFDHaR1hs7sQGwstrutils(((void*) ((*a).data)), ((void*) ((*b).data)), ((NI) ((*a).Sup.len)));
	LA12_: ;
	result = T11_;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuUnindent)(NimStringDesc* s, NI count, NimStringDesc* padding) {
	NimStringDesc* result;
	NI i;
	result = (NimStringDesc*)0;
	result = nimrtl_copyString(((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_7));
	i = ((NI) 0);
	{
		NimStringDesc* line;
		NI first;
		NI last;
		line = (NimStringDesc*)0;
		first = ((NI) 0);
		last = ((NI) 0);
		{
			while (1) {
				NI indentCount;
				Slice_qL3WGViqT0p5sVr4YFHsLg T19_;
				NimStringDesc* T20_;
				{
					while (1) {
						if (!!((((NU8)(s->data[last])) == ((NU8)(0)) || ((NU8)(s->data[last])) == ((NU8)(13)) || ((NU8)(s->data[last])) == ((NU8)(10))))) goto LA5;
						last += ((NI) 1);
					} LA5: ;
				}
				line = copyStrLast(s, first, (NI)(last - ((NI) 1)));
				{
					if (!!((i == ((NI) 0)))) goto LA8_;
					result = nimrtl_resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_8));
				}
				LA8_: ;
				indentCount = ((NI) 0);
				{
					NI j;
					NI colontmp_;
					NI i_2;
					j = (NI)0;
					colontmp_ = (NI)0;
					colontmp_ = ((NI) (count));
					i_2 = ((NI) 0);
					{
						while (1) {
							if (!(i_2 < colontmp_)) goto LA12;
							j = i_2;
							indentCount += ((NI) 1);
							{
								Slice_qL3WGViqT0p5sVr4YFHsLg T15_;
								NimStringDesc* T16_;
								T15_ = dotdot__18yoMoUbfoITYgEZSwZDYAstrutils(j, (NI)(j + ((padding ? padding->Sup.len : 0) - 1)));
								T16_ = (NimStringDesc*)0;
								T16_ = X5BX5D__Sq9b57KCLKZryBwyHy49aBswstrutils(line, T15_);
								if (!!(eqStrings(T16_, padding))) goto LA17_;
								indentCount = j;
								goto LA10;
							}
							LA17_: ;
							i_2 += ((NI) 1);
						} LA12: ;
					}
				} LA10: ;
				T19_ = dotdot__18yoMoUbfoITYgEZSwZDYAstrutils((NI)(indentCount * (padding ? padding->Sup.len : 0)), (NI)((line ? line->Sup.len : 0) - ((NI) 1)));
				T20_ = (NimStringDesc*)0;
				T20_ = X5BX5D__Sq9b57KCLKZryBwyHy49aBswstrutils(line, T19_);
				result = nimrtl_resizeString(result, T20_->Sup.len + 0);
appendString(result, T20_);
				i += ((NI) 1);
				{
					if (!((NU8)(s->data[last]) == (NU8)(10))) goto LA23_;
					last += ((NI) 1);
				}
				goto LA21_;
				LA23_: ;
				{
					if (!((NU8)(s->data[last]) == (NU8)(13))) goto LA26_;
					last += ((NI) 1);
					{
						if (!((NU8)(s->data[last]) == (NU8)(10))) goto LA30_;
						last += ((NI) 1);
					}
					LA30_: ;
				}
				goto LA21_;
				LA26_: ;
				{
					goto LA2;
				}
				LA21_: ;
				first = last;
			}
		} LA2: ;
	}
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuUnindentAll)(NimStringDesc* s) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = nsuUnindent(s, ((NI) 1000), ((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_9));
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuStartsWith)(NimStringDesc* s, NimStringDesc* prefix) {
	NIM_BOOL result;
	NI i;
{	result = (NIM_BOOL)0;
	i = ((NI) 0);
	{
		while (1) {
			{
				if (!((NU8)(prefix->data[i]) == (NU8)(0))) goto LA5_;
				result = NIM_TRUE;
				goto BeforeRet_;
			}
			LA5_: ;
			{
				if (!!(((NU8)(s->data[i]) == (NU8)(prefix->data[i])))) goto LA9_;
				result = NIM_FALSE;
				goto BeforeRet_;
			}
			LA9_: ;
			i += ((NI) 1);
		}
	}
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuEndsWith)(NimStringDesc* s, NimStringDesc* suffix) {
	NIM_BOOL result;
	NI i;
	NI j;
{	result = (NIM_BOOL)0;
	i = ((NI) 0);
	j = (NI)((s ? s->Sup.len : 0) - (suffix ? suffix->Sup.len : 0));
	{
		while (1) {
			if (!((NU32)((NI)(i + j)) < (NU32)((s ? s->Sup.len : 0)))) goto LA2;
			{
				if (!!(((NU8)(s->data[(NI)(i + j)]) == (NU8)(suffix->data[i])))) goto LA5_;
				result = NIM_FALSE;
				goto BeforeRet_;
			}
			LA5_: ;
			i += ((NI) 1);
		} LA2: ;
	}
	{
		if (!((NU8)(suffix->data[i]) == (NU8)(0))) goto LA9_;
		result = NIM_TRUE;
		goto BeforeRet_;
	}
	LA9_: ;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuContinuesWith)(NimStringDesc* s, NimStringDesc* substr, NI start) {
	NIM_BOOL result;
	NI i;
{	result = (NIM_BOOL)0;
	i = ((NI) 0);
	{
		while (1) {
			{
				if (!((NU8)(substr->data[i]) == (NU8)(0))) goto LA5_;
				result = NIM_TRUE;
				goto BeforeRet_;
			}
			LA5_: ;
			{
				if (!!(((NU8)(s->data[(NI)(i + ((NI) (start)))]) == (NU8)(substr->data[i])))) goto LA9_;
				result = NIM_FALSE;
				goto BeforeRet_;
			}
			LA9_: ;
			i += ((NI) 1);
		}
	}
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuJoinSep)(NimStringDesc** a, NI aLen_0, NimStringDesc* sep) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	{
		NI L;
		if (!(((NI) 0) < aLen_0)) goto LA3_;
		L = (NI)((sep ? sep->Sup.len : 0) * (NI)(aLen_0 - ((NI) 1)));
		{
			NI i;
			NI colontmp_;
			NI res;
			i = (NI)0;
			colontmp_ = (NI)0;
			colontmp_ = (aLen_0-1);
			res = ((NI) 0);
			{
				while (1) {
					if (!(res <= colontmp_)) goto LA7;
					i = res;
					L += (a[i] ? a[i]->Sup.len : 0);
					res += ((NI) 1);
				} LA7: ;
			}
		}
		result = rawNewString(((NI) (L)));
		result = nimrtl_resizeString(result, a[((NI) 0)]->Sup.len + 0);
appendString(result, a[((NI) 0)]);
		{
			NI i_2;
			NI colontmp__2;
			NI res_2;
			i_2 = (NI)0;
			colontmp__2 = (NI)0;
			colontmp__2 = (aLen_0-1);
			res_2 = ((NI) 1);
			{
				while (1) {
					if (!(res_2 <= colontmp__2)) goto LA10;
					i_2 = res_2;
					result = nimrtl_resizeString(result, sep->Sup.len + 0);
appendString(result, sep);
					result = nimrtl_resizeString(result, a[i_2]->Sup.len + 0);
appendString(result, a[i_2]);
					res_2 += ((NI) 1);
				} LA10: ;
			}
		}
	}
	goto LA1_;
	LA3_: ;
	{
		result = nimrtl_copyString(((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_7));
	}
	LA1_: ;
	return result;
}

N_NIMCALL(void, preprocessSub_IhQT0o4blhF4hbhCz0srsw)(NimStringDesc* sub, NI* a) {
	NI m;
	m = (sub ? sub->Sup.len : 0);
	{
		NI i;
		NI res;
		i = (NI)0;
		res = ((NI) 0);
		{
			while (1) {
				if (!(res <= ((NI) 255))) goto LA3;
				i = res;
				a[(((NU8)(((NIM_CHAR) (((NI) (i)))))))- 0] = (NI)(m + ((NI) 1));
				res += ((NI) 1);
			} LA3: ;
		}
	}
	{
		NI i_2;
		NI colontmp_;
		NI res_2;
		i_2 = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (NI)(m - ((NI) 1));
		res_2 = ((NI) 0);
		{
			while (1) {
				if (!(res_2 <= colontmp_)) goto LA6;
				i_2 = res_2;
				a[(((NU8)(sub->data[i_2])))- 0] = (NI)(m - i_2);
				res_2 += ((NI) 1);
			} LA6: ;
		}
	}
}

N_NIMCALL(NI, findAux_xYftXprbikG4pTQVPGgIjg)(NimStringDesc* s, NimStringDesc* sub, NI start, NI last, TY_9cc9aPiDa8VaWjVcFLabEDZQ a) {
	NI result;
	NI m;
	NI n;
	NI j;
{	result = (NI)0;
	m = (sub ? sub->Sup.len : 0);
	n = (NI)(last + ((NI) 1));
	j = start;
	{
		while (1) {
			if (!(j <= (NI)(n - m))) goto LA2;
			{
				{
					NI k;
					NI colontmp_;
					NI res;
					k = (NI)0;
					colontmp_ = (NI)0;
					colontmp_ = (NI)(m - ((NI) 1));
					res = ((NI) 0);
					{
						while (1) {
							if (!(res <= colontmp_)) goto LA6;
							k = res;
							{
								if (!!(((NU8)(sub->data[k]) == (NU8)(s->data[(NI)(k + j)])))) goto LA9_;
								goto LA3;
							}
							LA9_: ;
							res += ((NI) 1);
						} LA6: ;
					}
				}
				result = j;
				goto BeforeRet_;
			} LA3: ;
			j += a[(((NU8)(s->data[(NI)(j + m)])))- 0];
		} LA2: ;
	}
	result = ((NI) -1);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NI, nsuFindStr)(NimStringDesc* s, NimStringDesc* sub, NI start, NI last) {
	NI result;
	TY_9cc9aPiDa8VaWjVcFLabEDZQ a;
	NI last_2;
	result = (NI)0;
	{
		if (!(((NI) (last)) == ((NI) 0))) goto LA3_;
		last_2 = (s ? (s->Sup.len-1) : -1);
	}
	goto LA1_;
	LA3_: ;
	{
		last_2 = ((NI) (last));
	}
	LA1_: ;
	preprocessSub_IhQT0o4blhF4hbhCz0srsw(sub, a);
	result = findAux_xYftXprbikG4pTQVPGgIjg(s, sub, ((NI) (start)), last_2, a);
	return result;
}

N_LIB_EXPORT N_CDECL(NI, nsuFindChar)(NimStringDesc* s, NIM_CHAR sub, NI start, NI last) {
	NI result;
	NI last_2;
	void* found;
{	result = (NI)0;
	{
		if (!(((NI) (last)) == ((NI) 0))) goto LA3_;
		last_2 = (s ? (s->Sup.len-1) : -1);
	}
	goto LA1_;
	LA3_: ;
	{
		last_2 = ((NI) (last));
	}
	LA1_: ;
	found = memchr(((void*) ((&s->data[start]))), sub, (NI)((NI)(last_2 - ((NI) (start))) + ((NI) 1)));
	{
		if (!!((found == 0))) goto LA8_;
		result = (NI)((NU32)(((NI) (found))) - (NU32)(((NI) (s->data))));
		goto BeforeRet_;
	}
	LA8_: ;
	result = ((NI) -1);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NI, nsuFindCharSet)(NimStringDesc* s, TY_nmiMWKVIe46vacnhAFrQvw_Set chars, NI start, NI last) {
	NI result;
	NI last_2;
{	result = (NI)0;
	{
		if (!(((NI) (last)) == ((NI) 0))) goto LA3_;
		last_2 = (s ? (s->Sup.len-1) : -1);
	}
	goto LA1_;
	LA3_: ;
	{
		last_2 = ((NI) (last));
	}
	LA1_: ;
	{
		NI i;
		NI res;
		i = (NI)0;
		res = ((NI) (start));
		{
			while (1) {
				if (!(res <= last_2)) goto LA8;
				i = res;
				{
					if (!((chars[(NU)(((NU8)(s->data[i])))>>3] &(1U<<((NU)(((NU8)(s->data[i])))&7U)))!=0)) goto LA11_;
					result = i;
					goto BeforeRet_;
				}
				LA11_: ;
				res += ((NI) 1);
			} LA8: ;
		}
	}
	result = ((NI) -1);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NI, nimrtl_rfind)(NimStringDesc* s, NIM_CHAR sub, NI start) {
	NI result;
	NI realStart;
{	result = (NI)0;
	{
		if (!(start == ((NI) -1))) goto LA3_;
		realStart = (NI)((s ? s->Sup.len : 0) - ((NI) 1));
	}
	goto LA1_;
	LA3_: ;
	{
		realStart = start;
	}
	LA1_: ;
	{
		NI i;
		NI res;
		i = (NI)0;
		res = realStart;
		{
			while (1) {
				if (!(((NI) 0) <= res)) goto LA8;
				i = res;
				{
					if (!((NU8)(sub) == (NU8)(s->data[i]))) goto LA11_;
					result = i;
					goto BeforeRet_;
				}
				LA11_: ;
				res -= ((NI) 1);
			} LA8: ;
		}
	}
	result = ((NI) -1);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuCenterString)(NimStringDesc* s, NI width, NIM_CHAR fillChar) {
	NimStringDesc* result;
	NI charsLeft;
	NI leftPadding;
{	result = (NimStringDesc*)0;
	{
		if (!(width <= (s ? s->Sup.len : 0))) goto LA3_;
		result = nimrtl_copyString(s);
		goto BeforeRet_;
	}
	LA3_: ;
	result = mnewString(((NI) (width)));
	charsLeft = (NI)(width - (s ? s->Sup.len : 0));
	leftPadding = (NI)(charsLeft / ((NI) 2));
	{
		NI i;
		NI i_2;
		i = (NI)0;
		i_2 = ((NI) 0);
		{
			while (1) {
				if (!(i_2 < width)) goto LA7;
				i = i_2;
				{
					NIM_BOOL T10_;
					T10_ = (NIM_BOOL)0;
					T10_ = (leftPadding <= i);
					if (!(T10_)) goto LA11_;
					T10_ = (i < (NI)(leftPadding + (s ? s->Sup.len : 0)));
					LA11_: ;
					if (!T10_) goto LA12_;
					result->data[i] = s->data[(NI)(i - leftPadding)];
				}
				goto LA8_;
				LA12_: ;
				{
					result->data[i] = fillChar;
				}
				LA8_: ;
				i_2 += ((NI) 1);
			} LA7: ;
		}
	}
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NI, nsuCountString)(NimStringDesc* s, NimStringDesc* sub, NIM_BOOL overlapping) {
	NI result;
	NI i;
	result = (NI)0;
	i = ((NI) 0);
	{
		while (1) {
			i = nsuFindStr(s, sub, ((NI) (i)), ((NI) 0));
			{
				if (!(i < ((NI) 0))) goto LA5_;
				goto LA1;
			}
			LA5_: ;
			{
				if (!overlapping) goto LA9_;
				i += ((NI) 1);
			}
			goto LA7_;
			LA9_: ;
			{
				i += (sub ? sub->Sup.len : 0);
			}
			LA7_: ;
			result += ((NI) 1);
		}
	} LA1: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NI, nsuCountChar)(NimStringDesc* s, NIM_CHAR sub) {
	NI result;
	result = (NI)0;
	{
		NIM_CHAR c;
		NI i;
		NI L;
		c = (NIM_CHAR)0;
		i = ((NI) 0);
		L = (s ? s->Sup.len : 0);
		{
			while (1) {
				if (!(i < L)) goto LA3;
				c = s->data[i];
				{
					if (!((NU8)(c) == (NU8)(sub))) goto LA6_;
					result += ((NI) 1);
				}
				LA6_: ;
				i += ((NI) 1);
			} LA3: ;
		}
	}
	return result;
}

N_LIB_EXPORT N_CDECL(NI, nsuCountCharSet)(NimStringDesc* s, TY_nmiMWKVIe46vacnhAFrQvw_Set subs) {
	NI result;
	result = (NI)0;
	{
		NIM_CHAR c;
		NI i;
		NI L;
		c = (NIM_CHAR)0;
		i = ((NI) 0);
		L = (s ? s->Sup.len : 0);
		{
			while (1) {
				if (!(i < L)) goto LA3;
				c = s->data[i];
				{
					if (!((subs[(NU)(((NU8)(c)))>>3] &(1U<<((NU)(((NU8)(c)))&7U)))!=0)) goto LA6_;
					result += ((NI) 1);
				}
				LA6_: ;
				i += ((NI) 1);
			} LA3: ;
		}
	}
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuReplaceStr)(NimStringDesc* s, NimStringDesc* sub, NimStringDesc* by) {
	NimStringDesc* result;
	TY_9cc9aPiDa8VaWjVcFLabEDZQ a;
	NI last;
	NI i;
	NimStringDesc* T8_;
	result = (NimStringDesc*)0;
	result = nimrtl_copyString(((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_7));
	preprocessSub_IhQT0o4blhF4hbhCz0srsw(sub, a);
	last = (s ? (s->Sup.len-1) : -1);
	i = ((NI) 0);
	{
		while (1) {
			NI j;
			NimStringDesc* T7_;
			j = findAux_xYftXprbikG4pTQVPGgIjg(s, sub, i, last, a);
			{
				if (!(j < ((NI) 0))) goto LA5_;
				goto LA1;
			}
			LA5_: ;
			T7_ = (NimStringDesc*)0;
			T7_ = copyStrLast(s, i, (NI)(j - ((NI) 1)));
			result = nimrtl_resizeString(result, T7_->Sup.len + 0);
appendString(result, T7_);
			result = nimrtl_resizeString(result, by->Sup.len + 0);
appendString(result, by);
			i = (NI)(j + (sub ? sub->Sup.len : 0));
		}
	} LA1: ;
	T8_ = (NimStringDesc*)0;
	T8_ = copyStr(s, i);
	result = nimrtl_resizeString(result, T8_->Sup.len + 0);
appendString(result, T8_);
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuReplaceChar)(NimStringDesc* s, NIM_CHAR sub, NIM_CHAR by) {
	NimStringDesc* result;
	NI i;
	result = (NimStringDesc*)0;
	result = mnewString(((NI) ((s ? s->Sup.len : 0))));
	i = ((NI) 0);
	{
		while (1) {
			if (!(i < (s ? s->Sup.len : 0))) goto LA2;
			{
				if (!((NU8)(s->data[i]) == (NU8)(sub))) goto LA5_;
				result->data[i] = by;
			}
			goto LA3_;
			LA5_: ;
			{
				result->data[i] = s->data[i];
			}
			LA3_: ;
			i += ((NI) 1);
		} LA2: ;
	}
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuReplaceWord)(NimStringDesc* s, NimStringDesc* sub, NimStringDesc* by) {
	NimStringDesc* result;
	TY_9cc9aPiDa8VaWjVcFLabEDZQ a;
	NI i;
	NI last;
	NimStringDesc* T20_;
	result = (NimStringDesc*)0;
	result = nimrtl_copyString(((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_7));
	preprocessSub_IhQT0o4blhF4hbhCz0srsw(sub, a);
	i = ((NI) 0);
	last = (s ? (s->Sup.len-1) : -1);
	{
		while (1) {
			NI j;
			j = findAux_xYftXprbikG4pTQVPGgIjg(s, sub, i, last, a);
			{
				if (!(j < ((NI) 0))) goto LA5_;
				goto LA1;
			}
			LA5_: ;
			{
				NIM_BOOL T9_;
				NIM_BOOL T10_;
				NIM_BOOL T13_;
				NimStringDesc* T17_;
				T9_ = (NIM_BOOL)0;
				T10_ = (NIM_BOOL)0;
				T10_ = (j == ((NI) 0));
				if (T10_) goto LA11_;
				T10_ = !((((NU8)(s->data[(NI)(j - ((NI) 1))])) >= ((NU8)(97)) && ((NU8)(s->data[(NI)(j - ((NI) 1))])) <= ((NU8)(122)) || ((NU8)(s->data[(NI)(j - ((NI) 1))])) >= ((NU8)(65)) && ((NU8)(s->data[(NI)(j - ((NI) 1))])) <= ((NU8)(90)) || ((NU8)(s->data[(NI)(j - ((NI) 1))])) >= ((NU8)(48)) && ((NU8)(s->data[(NI)(j - ((NI) 1))])) <= ((NU8)(57)) || ((NU8)(s->data[(NI)(j - ((NI) 1))])) == ((NU8)(95)) || ((NU8)(s->data[(NI)(j - ((NI) 1))])) >= ((NU8)(128)) && ((NU8)(s->data[(NI)(j - ((NI) 1))])) <= ((NU8)(255))));
				LA11_: ;
				T9_ = T10_;
				if (!(T9_)) goto LA12_;
				T13_ = (NIM_BOOL)0;
				T13_ = ((s ? s->Sup.len : 0) <= (NI)(j + (sub ? sub->Sup.len : 0)));
				if (T13_) goto LA14_;
				T13_ = !((((NU8)(s->data[(NI)(j + (sub ? sub->Sup.len : 0))])) >= ((NU8)(97)) && ((NU8)(s->data[(NI)(j + (sub ? sub->Sup.len : 0))])) <= ((NU8)(122)) || ((NU8)(s->data[(NI)(j + (sub ? sub->Sup.len : 0))])) >= ((NU8)(65)) && ((NU8)(s->data[(NI)(j + (sub ? sub->Sup.len : 0))])) <= ((NU8)(90)) || ((NU8)(s->data[(NI)(j + (sub ? sub->Sup.len : 0))])) >= ((NU8)(48)) && ((NU8)(s->data[(NI)(j + (sub ? sub->Sup.len : 0))])) <= ((NU8)(57)) || ((NU8)(s->data[(NI)(j + (sub ? sub->Sup.len : 0))])) == ((NU8)(95)) || ((NU8)(s->data[(NI)(j + (sub ? sub->Sup.len : 0))])) >= ((NU8)(128)) && ((NU8)(s->data[(NI)(j + (sub ? sub->Sup.len : 0))])) <= ((NU8)(255))));
				LA14_: ;
				T9_ = T13_;
				LA12_: ;
				if (!T9_) goto LA15_;
				T17_ = (NimStringDesc*)0;
				T17_ = copyStrLast(s, i, (NI)(j - ((NI) 1)));
				result = nimrtl_resizeString(result, T17_->Sup.len + 0);
appendString(result, T17_);
				result = nimrtl_resizeString(result, by->Sup.len + 0);
appendString(result, by);
				i = (NI)(j + (sub ? sub->Sup.len : 0));
			}
			goto LA7_;
			LA15_: ;
			{
				NimStringDesc* T19_;
				T19_ = (NimStringDesc*)0;
				T19_ = copyStrLast(s, i, j);
				result = nimrtl_resizeString(result, T19_->Sup.len + 0);
appendString(result, T19_);
				i = (NI)(j + ((NI) 1));
			}
			LA7_: ;
		}
	} LA1: ;
	T20_ = (NimStringDesc*)0;
	T20_ = copyStr(s, i);
	result = nimrtl_resizeString(result, T20_->Sup.len + 0);
appendString(result, T20_);
	return result;
}

N_LIB_EXPORT N_CDECL(void, nsuDelete)(NimStringDesc** s, NI first, NI last) {
	NI i;
	NI j;
	NI newLen;
	i = first;
	j = (NI)(last + ((NI) 1));
	newLen = (NI)((NI)(((*s) ? (*s)->Sup.len : 0) - j) + i);
	{
		while (1) {
			if (!(i < newLen)) goto LA2;
			(*s)->data[i] = (*s)->data[j];
			i += ((NI) 1);
			j += ((NI) 1);
		} LA2: ;
	}
	(*s) = nimrtl_setLengthStr((*s), ((NI) (newLen)));
}

N_LIB_EXPORT N_CDECL(NI, nsuParseOctInt)(NimStringDesc* s) {
	NI result;
	NI i;
	result = (NI)0;
	i = ((NI) 0);
	{
		NIM_BOOL T3_;
		NIM_BOOL T5_;
		T3_ = (NIM_BOOL)0;
		T3_ = ((NU8)(s->data[i]) == (NU8)(48));
		if (!(T3_)) goto LA4_;
		T5_ = (NIM_BOOL)0;
		T5_ = ((NU8)(s->data[(NI)(i + ((NI) 1))]) == (NU8)(111));
		if (T5_) goto LA6_;
		T5_ = ((NU8)(s->data[(NI)(i + ((NI) 1))]) == (NU8)(79));
		LA6_: ;
		T3_ = T5_;
		LA4_: ;
		if (!T3_) goto LA7_;
		i += ((NI) 2);
	}
	LA7_: ;
	{
		while (1) {
			switch (((NU8)(s->data[i]))) {
			case 95:
			{
				i += ((NI) 1);
			}
			break;
			case 48 ... 55:
			{
				result = (NI)((NI)((NU32)(result) << (NU32)(((NI) 3))) | ((NI) ((NI)(((NI) (((NU8)(s->data[i])))) - ((NI) 48)))));
				i += ((NI) 1);
			}
			break;
			case 0:
			{
				goto LA9;
			}
			break;
			default:
			{
				ValueError_Gi06FkNeykJn7mrqRZYrkA* e;
				NimStringDesc* T15_;
				e = (ValueError_Gi06FkNeykJn7mrqRZYrkA*)0;
				e = (ValueError_Gi06FkNeykJn7mrqRZYrkA*) nimrtl_newObj((&NTI_yCEN9anxCD6mzBxGjuaRBdg_), sizeof(ValueError_Gi06FkNeykJn7mrqRZYrkA));
				(*e).Sup.Sup.m_type = (&NTI_Gi06FkNeykJn7mrqRZYrkA_);
				T15_ = (NimStringDesc*)0;
				T15_ = rawNewString(s->Sup.len + 17);
appendString(T15_, ((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_4));
appendString(T15_, s);
				asgnRefNoCycle((void**) (&(*e).Sup.message), T15_);
				asgnRef((void**) (&(*e).Sup.parent), NIM_NIL);
				nimrtl_raiseException((Exception*)e, "ValueError");
			}
			break;
			}
		}
	} LA9: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuToOct)(NI64 x, NI len) {
	NimStringDesc* result;
	NI64 mask;
	NI64 shift;
	result = (NimStringDesc*)0;
	mask = IL64(7);
	shift = IL64(0);
	result = mnewString(((NI) (len)));
	{
		NI j;
		NI colontmp_;
		NI res;
		j = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (NI)(((NI) (len)) - ((NI) 1));
		res = ((NI) (colontmp_));
		{
			while (1) {
				if (!(((NI) 0) <= res)) goto LA3;
				j = ((NI) (res));
				result->data[j] = ((NIM_CHAR) (((NI) ((NI)(((NI) ((NI64)((NU64)((NI64)(x & mask)) >> (NU64)(shift)))) + ((NI) 48))))));
				shift = (NI64)(shift + IL64(3));
				mask = (NI64)((NU64)(mask) << (NU64)(((NI) 3)));
				res -= ((NI) 1);
			} LA3: ;
		}
	}
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuToBin)(NI64 x, NI len) {
	NimStringDesc* result;
	NI64 mask;
	NI64 shift;
	result = (NimStringDesc*)0;
	mask = IL64(1);
	shift = IL64(0);
	result = mnewString(((NI) (len)));
	{
		NI j;
		NI colontmp_;
		NI res;
		j = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (NI)(((NI) (len)) - ((NI) 1));
		res = ((NI) (colontmp_));
		{
			while (1) {
				if (!(((NI) 0) <= res)) goto LA3;
				j = ((NI) (res));
				result->data[j] = ((NIM_CHAR) (((NI) ((NI)(((NI) ((NI64)((NU64)((NI64)(x & mask)) >> (NU64)(shift)))) + ((NI) 48))))));
				shift = (NI64)(shift + IL64(1));
				mask = (NI64)((NU64)(mask) << (NU64)(((NI) 1)));
				res -= ((NI) 1);
			} LA3: ;
		}
	}
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuInsertSep)(NimStringDesc* s, NIM_CHAR sep, NI digits) {
	NimStringDesc* result;
	NI L;
	NI j;
	result = (NimStringDesc*)0;
	L = (NI)((NI)((NI)((s ? s->Sup.len : 0) - ((NI) 1)) / digits) + (s ? s->Sup.len : 0));
	result = mnewString(((NI) (L)));
	j = ((NI) 0);
	L -= ((NI) 1);
	{
		NI i;
		NI colontmp_;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (NI)((s ? s->Sup.len : 0) - ((NI) 1));
		res = colontmp_;
		{
			while (1) {
				if (!(((NI) 0) <= res)) goto LA3;
				i = res;
				{
					if (!(j == digits)) goto LA6_;
					result->data[L] = sep;
					L -= ((NI) 1);
					j = ((NI) 0);
				}
				LA6_: ;
				result->data[L] = s->data[i];
				j += ((NI) 1);
				L -= ((NI) 1);
				res -= ((NI) 1);
			} LA3: ;
		}
	}
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuEscape)(NimStringDesc* s, NimStringDesc* prefix, NimStringDesc* suffix) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = rawNewString(((NI) ((NI)((s ? s->Sup.len : 0) + (NI)((NU32)((s ? s->Sup.len : 0)) >> (NU32)(((NI) 2)))))));
	result = nimrtl_resizeString(result, prefix->Sup.len + 0);
appendString(result, prefix);
	{
		NIM_CHAR c;
		NI i;
		NI L;
		c = (NIM_CHAR)0;
		i = ((NI) 0);
		L = (s ? s->Sup.len : 0);
		{
			while (1) {
				if (!(i < L)) goto LA3;
				c = s->data[i];
				switch (((NU8)(c))) {
				case 0 ... 31:
				case 128 ... 255:
				{
					NimStringDesc* T5_;
					result = nimrtl_resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_10));
					T5_ = (NimStringDesc*)0;
					T5_ = nsuToHex(((NI64) (((NU8)(c)))), ((NI) 2));
					result = nimrtl_resizeString(result, T5_->Sup.len + 0);
appendString(result, T5_);
				}
				break;
				case 92:
				{
					result = nimrtl_resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_11));
				}
				break;
				case 39:
				{
					result = nimrtl_resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_12));
				}
				break;
				case 34:
				{
					result = nimrtl_resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_13));
				}
				break;
				default:
				{
					result = addChar(result, c);
				}
				break;
				}
				i += ((NI) 1);
			} LA3: ;
		}
	}
	result = nimrtl_resizeString(result, suffix->Sup.len + 0);
appendString(result, suffix);
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuUnescape)(NimStringDesc* s, NimStringDesc* prefix, NimStringDesc* suffix) {
	NimStringDesc* result;
	NI i;
	result = (NimStringDesc*)0;
	result = rawNewString(((NI) ((s ? s->Sup.len : 0))));
	i = (prefix ? prefix->Sup.len : 0);
	{
		NIM_BOOL T3_;
		ValueError_Gi06FkNeykJn7mrqRZYrkA* e;
		NimStringDesc* T6_;
		T3_ = (NIM_BOOL)0;
		T3_ = nsuStartsWith(s, prefix);
		if (!!(T3_)) goto LA4_;
		e = (ValueError_Gi06FkNeykJn7mrqRZYrkA*)0;
		e = (ValueError_Gi06FkNeykJn7mrqRZYrkA*) nimrtl_newObj((&NTI_yCEN9anxCD6mzBxGjuaRBdg_), sizeof(ValueError_Gi06FkNeykJn7mrqRZYrkA));
		(*e).Sup.Sup.m_type = (&NTI_Gi06FkNeykJn7mrqRZYrkA_);
		T6_ = (NimStringDesc*)0;
		T6_ = rawNewString(prefix->Sup.len + 40);
appendString(T6_, ((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_14));
appendString(T6_, prefix);
		asgnRefNoCycle((void**) (&(*e).Sup.message), T6_);
		asgnRef((void**) (&(*e).Sup.parent), NIM_NIL);
		nimrtl_raiseException((Exception*)e, "ValueError");
	}
	LA4_: ;
	{
		while (1) {
			{
				if (!(i == (NI)((s ? s->Sup.len : 0) - (suffix ? suffix->Sup.len : 0)))) goto LA11_;
				goto LA7;
			}
			LA11_: ;
			switch (((NU8)(s->data[i]))) {
			case 92:
			{
				switch (((NU8)(s->data[(NI)(i + ((NI) 1))]))) {
				case 120:
				{
					NI c;
					NI T15_;
					i += ((NI) 2);
					c = (NI)0;
					T15_ = (NI)0;
					T15_ = npuParseHex(s, (&c), i, ((NI) 2));
					i += T15_;
					result = addChar(result, ((NIM_CHAR) (((NI) (c)))));
					i -= ((NI) 2);
				}
				break;
				case 92:
				{
					result = addChar(result, 92);
				}
				break;
				case 39:
				{
					result = addChar(result, 39);
				}
				break;
				case 34:
				{
					result = addChar(result, 34);
				}
				break;
				default:
				{
					NimStringDesc* T20_;
					T20_ = (NimStringDesc*)0;
					T20_ = rawNewString(2);
appendString(T20_, ((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_15));
appendChar(T20_, s->data[(NI)(i + ((NI) 1))]);
					result = nimrtl_resizeString(result, T20_->Sup.len + 0);
appendString(result, T20_);
				}
				break;
				}
				i += ((NI) 1);
			}
			break;
			case 0:
			{
				goto LA7;
			}
			break;
			default:
			{
				result = addChar(result, s->data[i]);
			}
			break;
			}
			i += ((NI) 1);
		}
	} LA7: ;
	{
		NIM_BOOL T25_;
		ValueError_Gi06FkNeykJn7mrqRZYrkA* e_2;
		NimStringDesc* T28_;
		T25_ = (NIM_BOOL)0;
		T25_ = nsuEndsWith(s, suffix);
		if (!!(T25_)) goto LA26_;
		e_2 = (ValueError_Gi06FkNeykJn7mrqRZYrkA*)0;
		e_2 = (ValueError_Gi06FkNeykJn7mrqRZYrkA*) nimrtl_newObj((&NTI_yCEN9anxCD6mzBxGjuaRBdg_), sizeof(ValueError_Gi06FkNeykJn7mrqRZYrkA));
		(*e_2).Sup.Sup.m_type = (&NTI_Gi06FkNeykJn7mrqRZYrkA_);
		T28_ = (NimStringDesc*)0;
		T28_ = rawNewString(suffix->Sup.len + 38);
appendString(T28_, ((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_16));
appendString(T28_, suffix);
		asgnRefNoCycle((void**) (&(*e_2).Sup.message), T28_);
		asgnRef((void**) (&(*e_2).Sup.parent), NIM_NIL);
		nimrtl_raiseException((Exception*)e_2, "ValueError");
	}
	LA26_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NIM_BOOL, nsuValidIdentifier)(NimStringDesc* s) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	{
		if (!(((NU8)(s->data[((NI) 0)])) >= ((NU8)(97)) && ((NU8)(s->data[((NI) 0)])) <= ((NU8)(122)) || ((NU8)(s->data[((NI) 0)])) >= ((NU8)(65)) && ((NU8)(s->data[((NI) 0)])) <= ((NU8)(90)) || ((NU8)(s->data[((NI) 0)])) == ((NU8)(95)))) goto LA3_;
		{
			NI i;
			NI colontmp_;
			NI res;
			i = (NI)0;
			colontmp_ = (NI)0;
			colontmp_ = (NI)((s ? s->Sup.len : 0) - ((NI) 1));
			res = ((NI) 1);
			{
				while (1) {
					if (!(res <= colontmp_)) goto LA7;
					i = res;
					{
						if (!!((((NU8)(s->data[i])) >= ((NU8)(97)) && ((NU8)(s->data[i])) <= ((NU8)(122)) || ((NU8)(s->data[i])) >= ((NU8)(65)) && ((NU8)(s->data[i])) <= ((NU8)(90)) || ((NU8)(s->data[i])) >= ((NU8)(48)) && ((NU8)(s->data[i])) <= ((NU8)(57)) || ((NU8)(s->data[i])) == ((NU8)(95))))) goto LA10_;
						result = NIM_FALSE;
						goto BeforeRet_;
					}
					LA10_: ;
					res += ((NI) 1);
				} LA7: ;
			}
		}
		result = NIM_TRUE;
		goto BeforeRet_;
	}
	LA3_: ;
	}BeforeRet_: ;
	return result;
}
static N_NIMCALL(void, Marker_TY_qwqHTkRvwhrRyENtudHQ7g)(void* p, NI op) {
	TY_qwqHTkRvwhrRyENtudHQ7g* a;
	NI T1_;
	a = (TY_qwqHTkRvwhrRyENtudHQ7g*)p;
	T1_ = (NI)0;
	for (T1_ = 0; T1_ < a->Sup.len; T1_++) {
	}
}

N_LIB_EXPORT N_CDECL(NI, nsuEditDistance)(NimStringDesc* a, NimStringDesc* b) {
	NI result;
	NI len1;
	NI len2;
	NI s;
	NI half;
	TY_qwqHTkRvwhrRyENtudHQ7g* row;
	NI e;
{	result = (NI)0;
	len1 = (a ? a->Sup.len : 0);
	len2 = (b ? b->Sup.len : 0);
	{
		if (!(len2 < len1)) goto LA3_;
		result = nsuEditDistance(b, a);
		goto BeforeRet_;
	}
	LA3_: ;
	s = ((NI) 0);
	{
		while (1) {
			NIM_BOOL T7_;
			T7_ = (NIM_BOOL)0;
			T7_ = ((NU8)(a->data[s]) == (NU8)(b->data[s]));
			if (!(T7_)) goto LA8_;
			T7_ = !(((NU8)(a->data[s]) == (NU8)(0)));
			LA8_: ;
			if (!T7_) goto LA6;
			s += ((NI) 1);
			len1 -= ((NI) 1);
			len2 -= ((NI) 1);
		} LA6: ;
	}
	{
		while (1) {
			NIM_BOOL T11_;
			NIM_BOOL T12_;
			T11_ = (NIM_BOOL)0;
			T12_ = (NIM_BOOL)0;
			T12_ = (((NI) 0) < len1);
			if (!(T12_)) goto LA13_;
			T12_ = (((NI) 0) < len2);
			LA13_: ;
			T11_ = T12_;
			if (!(T11_)) goto LA14_;
			T11_ = ((NU8)(a->data[(NI)((NI)(s + len1) - ((NI) 1))]) == (NU8)(b->data[(NI)((NI)(s + len2) - ((NI) 1))]));
			LA14_: ;
			if (!T11_) goto LA10;
			len1 -= ((NI) 1);
			len2 -= ((NI) 1);
		} LA10: ;
	}
	{
		if (!(len1 == ((NI) 0))) goto LA17_;
		result = len2;
		goto BeforeRet_;
	}
	LA17_: ;
	{
		if (!(len2 == ((NI) 0))) goto LA21_;
		result = len1;
		goto BeforeRet_;
	}
	LA21_: ;
	{
		if (!(len1 == ((NI) 1))) goto LA25_;
		{
			NI j;
			NI colontmp_;
			NI res;
			j = (NI)0;
			colontmp_ = (NI)0;
			colontmp_ = (NI)((NI)(s + len2) - ((NI) 1));
			res = s;
			{
				while (1) {
					if (!(res <= colontmp_)) goto LA29;
					j = res;
					{
						if (!((NU8)(a->data[s]) == (NU8)(b->data[j]))) goto LA32_;
						result = (NI)(len2 - ((NI) 1));
						goto BeforeRet_;
					}
					LA32_: ;
					res += ((NI) 1);
				} LA29: ;
			}
		}
		result = len2;
		goto BeforeRet_;
	}
	LA25_: ;
	len1 += ((NI) 1);
	len2 += ((NI) 1);
	half = (NI)((NU32)(len1) >> (NU32)(((NI) 1)));
	row = (TY_qwqHTkRvwhrRyENtudHQ7g*)0;
	row = (TY_qwqHTkRvwhrRyENtudHQ7g*) nimrtl_newSeq((&NTI_qwqHTkRvwhrRyENtudHQ7g_), ((NI) (len2)));
	e = (NI)((NI)(s + len2) - ((NI) 1));
	{
		NI i;
		NI colontmp__2;
		NI res_2;
		i = (NI)0;
		colontmp__2 = (NI)0;
		colontmp__2 = (NI)((NI)(len2 - half) - ((NI) 1));
		res_2 = ((NI) 1);
		{
			while (1) {
				if (!(res_2 <= colontmp__2)) goto LA36;
				i = res_2;
				row->data[i] = i;
				res_2 += ((NI) 1);
			} LA36: ;
		}
	}
	row->data[((NI) 0)] = (NI)((NI)(len1 - half) - ((NI) 1));
	{
		NI i_2;
		NI colontmp__3;
		NI res_3;
		i_2 = (NI)0;
		colontmp__3 = (NI)0;
		colontmp__3 = (NI)(len1 - ((NI) 1));
		res_3 = ((NI) 1);
		{
			while (1) {
				NIM_CHAR char1;
				NI char2p;
				NI D;
				NI x;
				NI p;
				if (!(res_3 <= colontmp__3)) goto LA39;
				i_2 = res_3;
				char1 = a->data[(NI)((NI)(i_2 + s) - ((NI) 1))];
				char2p = (NI)0;
				D = (NI)0;
				x = (NI)0;
				p = (NI)0;
				{
					NI offset;
					NI c3;
					if (!((NI)(len1 - half) <= i_2)) goto LA42_;
					offset = (NI)((NI)(i_2 - len1) + half);
					char2p = offset;
					p = offset;
					c3 = (NI)(row->data[p] + ((NI) (!(((NU8)(char1) == (NU8)(b->data[(NI)(s + char2p)]))))));
					p += ((NI) 1);
					char2p += ((NI) 1);
					x = (NI)(row->data[p] + ((NI) 1));
					D = x;
					{
						if (!(c3 < x)) goto LA46_;
						x = c3;
					}
					LA46_: ;
					row->data[p] = x;
					p += ((NI) 1);
				}
				goto LA40_;
				LA42_: ;
				{
					p = ((NI) 1);
					char2p = ((NI) 0);
					D = i_2;
					x = i_2;
				}
				LA40_: ;
				{
					if (!(i_2 <= (NI)(half + ((NI) 1)))) goto LA51_;
					e = (NI)((NI)((NI)(len2 + i_2) - half) - ((NI) 2));
				}
				LA51_: ;
				{
					while (1) {
						NI c3_2;
						if (!(p <= e)) goto LA54;
						D -= ((NI) 1);
						c3_2 = (NI)(D + ((NI) (!(((NU8)(char1) == (NU8)(b->data[(NI)(char2p + s)]))))));
						char2p += ((NI) 1);
						x += ((NI) 1);
						{
							if (!(c3_2 < x)) goto LA57_;
							x = c3_2;
						}
						LA57_: ;
						D = (NI)(row->data[p] + ((NI) 1));
						{
							if (!(D < x)) goto LA61_;
							x = D;
						}
						LA61_: ;
						row->data[p] = x;
						p += ((NI) 1);
					} LA54: ;
				}
				{
					NI c3_3;
					if (!(i_2 <= half)) goto LA65_;
					D -= ((NI) 1);
					c3_3 = (NI)(D + ((NI) (!(((NU8)(char1) == (NU8)(b->data[(NI)(char2p + s)]))))));
					x += ((NI) 1);
					{
						if (!(c3_3 < x)) goto LA69_;
						x = c3_3;
					}
					LA69_: ;
					row->data[p] = x;
				}
				LA65_: ;
				res_3 += ((NI) 1);
			} LA39: ;
		}
	}
	result = row->data[e];
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuformatBiggestFloat)(NF f, FloatFormatMode_pNvEoaqwoxKyoASD11vSgQ format, NI precision, NIM_CHAR decimalSep) {
	NimStringDesc* result;
	TY_9bPFPkkEEeeNM9bKgiV8Q49cg frmtstr;
	TY_Kn8ZOVsorvcNLB4isUeMzQ buf;
	int L;
	result = (NimStringDesc*)0;
	L = (int)0;
	frmtstr[(((NI) 0))- 0] = 37;
	{
		if (!(((NI) 0) < ((NI) (precision)))) goto LA3_;
		frmtstr[(((NI) 1))- 0] = 35;
		frmtstr[(((NI) 2))- 0] = 46;
		frmtstr[(((NI) 3))- 0] = 42;
		frmtstr[(((NI) 4))- 0] = floatFormatToChar_WVISPus3ZqCVSuP9bzn9cVxw[(format)- 0];
		frmtstr[(((NI) 5))- 0] = 0;
		L = sprintf(((NCSTRING) (buf)), ((NCSTRING) (frmtstr)), precision, f);
	}
	goto LA1_;
	LA3_: ;
	{
		frmtstr[(((NI) 1))- 0] = floatFormatToChar_WVISPus3ZqCVSuP9bzn9cVxw[(format)- 0];
		frmtstr[(((NI) 2))- 0] = 0;
		L = sprintf(((NCSTRING) (buf)), ((NCSTRING) (frmtstr)), f);
	}
	LA1_: ;
	result = mnewString(((NI) (L)));
	{
		int i;
		int i_2;
		i = (int)0;
		i_2 = ((int) 0);
		{
			while (1) {
				if (!(i_2 < L)) goto LA8;
				i = i_2;
				{
					if (!(((NU8)(buf[(i)- 0])) == ((NU8)(46)) || ((NU8)(buf[(i)- 0])) == ((NU8)(44)))) goto LA11_;
					result->data[i] = decimalSep;
				}
				goto LA9_;
				LA11_: ;
				{
					result->data[i] = buf[(i)- 0];
				}
				LA9_: ;
				i_2 += ((NI) 1);
			} LA8: ;
		}
	}
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuformatFloat)(NF f, FloatFormatMode_pNvEoaqwoxKyoASD11vSgQ format, NI precision, NIM_CHAR decimalSep) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = nsuformatBiggestFloat(f, format, precision, decimalSep);
	return result;
}

N_NOINLINE(void, invalidFormatString_61EJWW6vRISEo9a8gt0tusw)(void) {
	ValueError_Gi06FkNeykJn7mrqRZYrkA* e;
	NimStringDesc* T1_;
	e = (ValueError_Gi06FkNeykJn7mrqRZYrkA*)0;
	e = (ValueError_Gi06FkNeykJn7mrqRZYrkA*) nimrtl_newObj((&NTI_yCEN9anxCD6mzBxGjuaRBdg_), sizeof(ValueError_Gi06FkNeykJn7mrqRZYrkA));
	(*e).Sup.Sup.m_type = (&NTI_Gi06FkNeykJn7mrqRZYrkA_);
	T1_ = (NimStringDesc*)0;
	T1_ = (*e).Sup.message; (*e).Sup.message = nimrtl_copyStringRC1(((NimStringDesc*) &TM_JGc9b9bh2D3nTdUR7TGyq8aA_17));
	if (T1_) nimGCunrefNoCycle(T1_);
	asgnRef((void**) (&(*e).Sup.parent), NIM_NIL);
	nimrtl_raiseException((Exception*)e, "ValueError");
}

N_NIMCALL(NI, findNormalized_SW1VCMDsxPTtzxnYrf3N6w)(NimStringDesc* x, NimStringDesc** inArray, NI inArrayLen_0) {
	NI result;
	NI i;
{	result = (NI)0;
	i = ((NI) 0);
	{
		while (1) {
			if (!(i < (inArrayLen_0-1))) goto LA2;
			{
				NI T5_;
				T5_ = (NI)0;
				T5_ = nsuCmpIgnoreStyle(x, inArray[i]);
				if (!(T5_ == ((NI) 0))) goto LA6_;
				result = i;
				goto BeforeRet_;
			}
			LA6_: ;
			i += ((NI) 2);
		} LA2: ;
	}
	result = ((NI) -1);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_EXPORT N_CDECL(void, nsuAddf)(NimStringDesc** s, NimStringDesc* formatstr, NimStringDesc** a, NI aLen_0) {
	NI i;
	NI num;
	i = ((NI) 0);
	num = ((NI) 0);
	{
		while (1) {
			if (!(i < (formatstr ? formatstr->Sup.len : 0))) goto LA2;
			{
				if (!((NU8)(formatstr->data[i]) == (NU8)(36))) goto LA5_;
				switch (((NU8)(formatstr->data[(NI)(i + ((NI) 1))]))) {
				case 35:
				{
					{
						if (!((NU32)((aLen_0-1)) < (NU32)(num))) goto LA10_;
						invalidFormatString_61EJWW6vRISEo9a8gt0tusw();
					}
					LA10_: ;
					(*s) = nimrtl_resizeString((*s), a[num]->Sup.len + 0);
appendString((*s), a[num]);
					i += ((NI) 2);
					num += ((NI) 1);
				}
				break;
				case 36:
				{
					(*s) = addChar((*s), 36);
					i += ((NI) 2);
				}
				break;
				case 49 ... 57:
				case 45:
				{
					NI j;
					NIM_BOOL negative;
					NI idx;
					j = ((NI) 0);
					i += ((NI) 1);
					negative = ((NU8)(formatstr->data[i]) == (NU8)(45));
					{
						if (!negative) goto LA16_;
						i += ((NI) 1);
					}
					LA16_: ;
					{
						while (1) {
							if (!(((NU8)(formatstr->data[i])) >= ((NU8)(48)) && ((NU8)(formatstr->data[i])) <= ((NU8)(57)))) goto LA19;
							j = (NI)((NI)((NI)(j * ((NI) 10)) + ((NI) (((NU8)(formatstr->data[i]))))) - ((NI) 48));
							i += ((NI) 1);
						} LA19: ;
					}
					{
						if (!!(negative)) goto LA22_;
						idx = (NI)(j - ((NI) 1));
					}
					goto LA20_;
					LA22_: ;
					{
						idx = (NI)(aLen_0 - j);
					}
					LA20_: ;
					{
						if (!((NU32)((aLen_0-1)) < (NU32)(idx))) goto LA27_;
						invalidFormatString_61EJWW6vRISEo9a8gt0tusw();
					}
					LA27_: ;
					(*s) = nimrtl_resizeString((*s), a[idx]->Sup.len + 0);
appendString((*s), a[idx]);
				}
				break;
				case 123:
				{
					NI j_2;
					NI x;
					NimStringDesc* T32_;
					j_2 = (NI)(i + ((NI) 1));
					{
						while (1) {
							if (!!((((NU8)(formatstr->data[j_2])) == ((NU8)(0)) || ((NU8)(formatstr->data[j_2])) == ((NU8)(125))))) goto LA31;
							j_2 += ((NI) 1);
						} LA31: ;
					}
					T32_ = (NimStringDesc*)0;
					T32_ = copyStrLast(formatstr, (NI)(i + ((NI) 2)), (NI)(j_2 - ((NI) 1)));
					x = findNormalized_SW1VCMDsxPTtzxnYrf3N6w(T32_, a, aLen_0);
					{
						NIM_BOOL T35_;
						T35_ = (NIM_BOOL)0;
						T35_ = (((NI) 0) <= x);
						if (!(T35_)) goto LA36_;
						T35_ = (x < (aLen_0-1));
						LA36_: ;
						if (!T35_) goto LA37_;
						(*s) = nimrtl_resizeString((*s), a[(NI)(x + ((NI) 1))]->Sup.len + 0);
appendString((*s), a[(NI)(x + ((NI) 1))]);
					}
					goto LA33_;
					LA37_: ;
					{
						invalidFormatString_61EJWW6vRISEo9a8gt0tusw();
					}
					LA33_: ;
					i = (NI)(j_2 + ((NI) 1));
				}
				break;
				case 97 ... 122:
				case 65 ... 90:
				case 128 ... 255:
				case 95:
				{
					NI j_3;
					NI x_2;
					NimStringDesc* T43_;
					j_3 = (NI)(i + ((NI) 1));
					{
						while (1) {
							if (!(((NU8)(formatstr->data[j_3])) >= ((NU8)(97)) && ((NU8)(formatstr->data[j_3])) <= ((NU8)(122)) || ((NU8)(formatstr->data[j_3])) >= ((NU8)(65)) && ((NU8)(formatstr->data[j_3])) <= ((NU8)(90)) || ((NU8)(formatstr->data[j_3])) >= ((NU8)(48)) && ((NU8)(formatstr->data[j_3])) <= ((NU8)(57)) || ((NU8)(formatstr->data[j_3])) >= ((NU8)(128)) && ((NU8)(formatstr->data[j_3])) <= ((NU8)(255)) || ((NU8)(formatstr->data[j_3])) == ((NU8)(95)))) goto LA42;
							j_3 += ((NI) 1);
						} LA42: ;
					}
					T43_ = (NimStringDesc*)0;
					T43_ = copyStrLast(formatstr, (NI)(i + ((NI) 1)), (NI)(j_3 - ((NI) 1)));
					x_2 = findNormalized_SW1VCMDsxPTtzxnYrf3N6w(T43_, a, aLen_0);
					{
						NIM_BOOL T46_;
						T46_ = (NIM_BOOL)0;
						T46_ = (((NI) 0) <= x_2);
						if (!(T46_)) goto LA47_;
						T46_ = (x_2 < (aLen_0-1));
						LA47_: ;
						if (!T46_) goto LA48_;
						(*s) = nimrtl_resizeString((*s), a[(NI)(x_2 + ((NI) 1))]->Sup.len + 0);
appendString((*s), a[(NI)(x_2 + ((NI) 1))]);
					}
					goto LA44_;
					LA48_: ;
					{
						invalidFormatString_61EJWW6vRISEo9a8gt0tusw();
					}
					LA44_: ;
					i = j_3;
				}
				break;
				default:
				{
					invalidFormatString_61EJWW6vRISEo9a8gt0tusw();
				}
				break;
				}
			}
			goto LA3_;
			LA5_: ;
			{
				(*s) = addChar((*s), formatstr->data[i]);
				i += ((NI) 1);
			}
			LA3_: ;
		} LA2: ;
	}
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuFormatOpenArray)(NimStringDesc* formatstr, NimStringDesc** a, NI aLen_0) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = rawNewString(((NI) ((NI)((formatstr ? formatstr->Sup.len : 0) + (NI)((NU32)(aLen_0) << (NU32)(((NI) 4)))))));
	nsuAddf((&result), formatstr, a, aLen_0);
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuFormatSingleElem)(NimStringDesc* formatstr, NimStringDesc* a) {
	NimStringDesc* result;
	TY_nHXaesL0DJZHyVS07ARPRA T1_;
	result = (NimStringDesc*)0;
	result = rawNewString(((NI) ((NI)((formatstr ? formatstr->Sup.len : 0) + (a ? a->Sup.len : 0)))));
	memset((void*)T1_, 0, sizeof(T1_));
	T1_[0] = nimrtl_copyString(a);
	nsuAddf((&result), formatstr, T1_, 1);
	return result;
}

N_LIB_EXPORT N_CDECL(NimStringDesc*, nsuFormatVarargs)(NimStringDesc* formatstr, NimStringDesc** a, NI aLen_0) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = rawNewString(((NI) ((NI)((formatstr ? formatstr->Sup.len : 0) + aLen_0))));
	nsuAddf((&result), formatstr, a, aLen_0);
	return result;
}

N_LIB_EXPORT N_CDECL(void, nsuRemoveSuffixCharSet)(NimStringDesc** s, TY_nmiMWKVIe46vacnhAFrQvw_Set chars) {
	NI last;
{	{
		if (!(((*s) ? (*s)->Sup.len : 0) == ((NI) 0))) goto LA3_;
		goto BeforeRet_;
	}
	LA3_: ;
	last = (NI)(((*s) ? (*s)->Sup.len : 0) - ((NI) 1));
	{
		if (!(memcmp(chars, TM_JGc9b9bh2D3nTdUR7TGyq8aA_18, 32)==0)) goto LA7_;
		{
			if (!((NU8)((*s)->data[last]) == (NU8)(10))) goto LA11_;
			last -= ((NI) 1);
		}
		LA11_: ;
		{
			if (!((NU8)((*s)->data[last]) == (NU8)(13))) goto LA15_;
			last -= ((NI) 1);
		}
		LA15_: ;
	}
	goto LA5_;
	LA7_: ;
	{
		{
			if (!((chars[(NU)(((NU8)((*s)->data[last])))>>3] &(1U<<((NU)(((NU8)((*s)->data[last])))&7U)))!=0)) goto LA20_;
			last -= ((NI) 1);
		}
		LA20_: ;
	}
	LA5_: ;
	(*s) = nimrtl_setLengthStr((*s), ((NI) ((NI)(last + ((NI) 1)))));
	}BeforeRet_: ;
}

N_LIB_EXPORT N_CDECL(void, nsuRemoveSuffixChar)(NimStringDesc** s, NIM_CHAR c) {
	TY_nmiMWKVIe46vacnhAFrQvw_Set T1_;
	memset(T1_, 0, sizeof(T1_));
	T1_[(NU)(((NU8)(c)))>>3] |=(1U<<((NU)(((NU8)(c)))&7U));
	nsuRemoveSuffixCharSet(s, T1_);
}

N_LIB_EXPORT N_CDECL(void, nsuRemoveSuffixString)(NimStringDesc** s, NimStringDesc* suffix) {
	NI newLen;
	newLen = ((*s) ? (*s)->Sup.len : 0);
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = nsuEndsWith((*s), suffix);
		if (!T3_) goto LA4_;
		newLen -= (suffix ? suffix->Sup.len : 0);
		(*s) = nimrtl_setLengthStr((*s), ((NI) (newLen)));
	}
	LA4_: ;
}

N_NIMCALL(NIM_BOOL, contains_m1TSS3QwQPclQATuiRuVZg)(NimStringDesc* s, TY_nmiMWKVIe46vacnhAFrQvw_Set chars) {
	NIM_BOOL result;
	NI T1_;
{	result = (NIM_BOOL)0;
	T1_ = (NI)0;
	T1_ = nsuFindCharSet(s, chars, ((NI) 0), ((NI) 0));
	result = (((NI) 0) <= T1_);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_NIMCALL(NIM_BOOL, allCharsInSet_wVfr4F6j4mVzI8ggLoMVdw)(NimStringDesc* s, TY_nmiMWKVIe46vacnhAFrQvw_Set theSet) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	{
		NIM_CHAR c;
		NI i;
		NI L;
		c = (NIM_CHAR)0;
		i = ((NI) 0);
		L = (s ? s->Sup.len : 0);
		{
			while (1) {
				if (!(i < L)) goto LA3;
				c = s->data[i];
				{
					if (!!(((theSet[(NU)(((NU8)(c)))>>3] &(1U<<((NU)(((NU8)(c)))&7U)))!=0))) goto LA6_;
					result = NIM_FALSE;
					goto BeforeRet_;
				}
				LA6_: ;
				i += ((NI) 1);
			} LA3: ;
		}
	}
	result = NIM_TRUE;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
NIM_EXTERNC N_NOINLINE(void, stdlib_strutilsInit000)(void) {
}

NIM_EXTERNC N_NOINLINE(void, stdlib_strutilsDatInit000)(void) {
NTI_sM4lkSb7zS6F7OVMvW9cffQ_.size = sizeof(TY_sM4lkSb7zS6F7OVMvW9cffQ*);
NTI_sM4lkSb7zS6F7OVMvW9cffQ_.kind = 24;
NTI_sM4lkSb7zS6F7OVMvW9cffQ_.base = (&NTI_77mFvmsOLKik79ci2hXkHEg_);
NTI_sM4lkSb7zS6F7OVMvW9cffQ_.flags = 2;
NTI_sM4lkSb7zS6F7OVMvW9cffQ_.marker = Marker_TY_sM4lkSb7zS6F7OVMvW9cffQ;
NTI_qwqHTkRvwhrRyENtudHQ7g_.size = sizeof(TY_qwqHTkRvwhrRyENtudHQ7g*);
NTI_qwqHTkRvwhrRyENtudHQ7g_.kind = 24;
NTI_qwqHTkRvwhrRyENtudHQ7g_.base = (&NTI_rR5Bzr1D5krxoo1NcNyeMA_);
NTI_qwqHTkRvwhrRyENtudHQ7g_.flags = 2;
NTI_qwqHTkRvwhrRyENtudHQ7g_.marker = Marker_TY_qwqHTkRvwhrRyENtudHQ7g;
}

