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

#include "nimbase.h"
#include <string.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
#define nimfr_(x, y)
#define nimln_(x, y)
typedef struct tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ;
typedef struct tySequence__i7xpiUsxyv6cQ1xK3JbcGQ tySequence__i7xpiUsxyv6cQ1xK3JbcGQ;
typedef struct TGenericSeq TGenericSeq;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct NimStringDesc NimStringDesc;
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ tySequence__sM4lkSb7zS6F7OVMvW9cffQ;
typedef struct tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw;
typedef struct tySequence__76wc9cnTOK9c6epudv8uYE0w tySequence__76wc9cnTOK9c6epudv8uYE0w;
typedef struct tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q;
typedef struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g;
typedef struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w;
typedef struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ;
typedef struct tyObject_GcStack__7fytPA5bBsob6See21YMRA tyObject_GcStack__7fytPA5bBsob6See21YMRA;
typedef struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg;
typedef struct tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ;
typedef struct tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg;
typedef struct tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw;
typedef struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA;
typedef struct tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw;
typedef struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw;
typedef struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg;
typedef struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyTuple__ujsjpB2O9cjj3uDHsXbnSzg;
typedef struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg;
typedef struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ;
typedef struct tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg;
typedef struct tySequence__9c1n3IOF5T6xvPNf6ipRnuQ tySequence__9c1n3IOF5T6xvPNf6ipRnuQ;
typedef struct tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA;
typedef struct tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ;
typedef struct tyObject_IndexEntry__G9ccBDFWfr9aYnLgXTNGDHDg tyObject_IndexEntry__G9ccBDFWfr9aYnLgXTNGDHDg;
typedef struct tySequence__5PunAJrNQYcB8dF0jau3pQ tySequence__5PunAJrNQYcB8dF0jau3pQ;
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ* x, tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ* y, void* ClE_0);
void* ClE_0;
} tyProc__oUBe9cr5fvX49bNNuH9bVbmnw;
typedef NU8 tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA;
struct TGenericSeq {
NI len;
NI reserved;
};
typedef NU8 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A;
typedef NU8 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ;
typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
struct TNimType {
NI size;
tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
TNimType* base;
TNimNode* node;
void* finalizer;
tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
struct TNimNode {
tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_8) (tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ* x, tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ* y);
struct NimStringDesc {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef NU8 tyEnum_IdeCmd__1Ced39bl5eePmZ1PKMPXigQ;
typedef NU8 tyEnum_PrefixMatch__Dkww2nY9cxJVLF9cfoQS5U6Q;
struct tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ {
tyEnum_IdeCmd__1Ced39bl5eePmZ1PKMPXigQ section;
tySequence__sM4lkSb7zS6F7OVMvW9cffQ* qualifiedPath;
NimStringDesc** name;
NimStringDesc* filePath;
NI line;
NI column;
NimStringDesc* doc;
NimStringDesc* forth;
NI quality;
NIM_BOOL isGlobal;
NIM_BOOL contextFits;
tyEnum_PrefixMatch__Dkww2nY9cxJVLF9cfoQS5U6Q prefix;
NU8 symkind;
NI scope;
NI localUsages;
NI globalUsages;
NI tokenLen;
NI version;
};
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_12) (tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ* x, tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ* y);
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (NimStringDesc* x, NimStringDesc* y, void* ClE_0);
void* ClE_0;
} tyProc__kTj9c3SX9agxDQPZYwemi6ug;
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_28) (NimStringDesc* x, NimStringDesc* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_31) (NimStringDesc* x, NimStringDesc* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_43) (NimStringDesc* x, NimStringDesc* y, void* ClE_0);
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q* x, tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q* y, void* ClE_0);
void* ClE_0;
} tyProc__BX9cYxd9cF2mTlqoQZOdSHDA;
struct tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q {
tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* pnode;
NI id;
NI idx;
NI lowLink;
NIM_BOOL onStack;
tySequence__76wc9cnTOK9c6epudv8uYE0w* kids;
NI hAQ;
NI hIS;
NI hB;
NI hCmd;
};
struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g {
NI refcount;
TNimType* typ;
};
struct tyObject_GcStack__7fytPA5bBsob6See21YMRA {
void* bottom;
};
struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w {
NI len;
NI cap;
tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g** d;
};
typedef tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ* tyArray__SiRwrEKZdLgxqz9a9aoVBglg[512];
typedef NU32 tyArray__BHbOSqU1t9b3Gt7K2c6fQig[24];
typedef tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* tyArray__N1u1nqOgmuJN9cSZrnMHgOQ[32];
typedef tyArray__N1u1nqOgmuJN9cSZrnMHgOQ tyArray__B6durA4ZCi1xjJvRtyYxMg[24];
typedef tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw* tyArray__lh2A89ahMmYg9bCmpVaplLbA[256];
struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA {
tyArray__lh2A89ahMmYg9bCmpVaplLbA data;
};
typedef tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* tyArray__0aOLqZchNi8nWtMTi8ND8w[2];
struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw {
tyArray__0aOLqZchNi8nWtMTi8ND8w link;
NI key;
NI upperBound;
NI level;
};
struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg {
tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* Field0;
NI Field1;
};
typedef tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyArray__LzOv2eCDGiceMKQstCLmhw[30];
struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg {
NI len;
tyArray__LzOv2eCDGiceMKQstCLmhw chunks;
tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg* next;
};
struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg {
NI minLargeObj;
NI maxLargeObj;
tyArray__SiRwrEKZdLgxqz9a9aoVBglg freeSmallChunks;
NU32 flBitmap;
tyArray__BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
tyArray__B6durA4ZCi1xjJvRtyYxMg matrix;
tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw* llmem;
NI currMem;
NI maxMem;
NI freeMem;
NI occ;
NI lastSize;
tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA chunkStarts;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* root;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* deleted;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* last;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* freeAvlNodes;
NIM_BOOL locked;
NIM_BOOL blockChunkSizeIncrease;
NI nextChunkSize;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw bottomData;
tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg heapLinks;
};
struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg {
NI stackScans;
NI cycleCollections;
NI maxThreshold;
NI maxStackSize;
NI maxStackCells;
NI cycleTableSize;
NI64 maxPause;
};
struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ {
NI counter;
NI max;
tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg* head;
tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg** data;
};
struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ {
tyObject_GcStack__7fytPA5bBsob6See21YMRA stack;
NI cycleThreshold;
NI zctThreshold;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w zct;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w decStack;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tempStack;
NI recGcLock;
tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg region;
tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg stat;
tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ marked;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w additionalRoots;
NI gcThreadId;
};
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_51) (tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q* x, tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_54) (tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q* x, tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q* y);
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA* x, tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA* y, void* ClE_0);
void* ClE_0;
} tyProc__yOjWJshC9bsazMthdLnSwrA;
struct tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ {
NI Field0;
NI Field1;
};
struct tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA {
NimStringDesc* source;
tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ original;
tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ generated;
NimStringDesc* name;
NIM_BOOL noSource;
NIM_BOOL noName;
};
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_71) (tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA* x, tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_74) (tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA* x, tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_86) (NimStringDesc* x, NimStringDesc* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_88) (NimStringDesc* x, NimStringDesc* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_89) (NimStringDesc* x, NimStringDesc* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_91) (NimStringDesc* x, NimStringDesc* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_93) (NimStringDesc* x, NimStringDesc* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_94) (NimStringDesc* x, NimStringDesc* y, void* ClE_0);
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (tyObject_IndexEntry__G9ccBDFWfr9aYnLgXTNGDHDg x, tyObject_IndexEntry__G9ccBDFWfr9aYnLgXTNGDHDg y, void* ClE_0);
void* ClE_0;
} tyProc__zzrK9cTwi9admDvOCMDMSIXQ;
struct tyObject_IndexEntry__G9ccBDFWfr9aYnLgXTNGDHDg {
NimStringDesc* keyword;
NimStringDesc* link;
NimStringDesc* linkTitle;
NimStringDesc* linkDesc;
};
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_99) (tyObject_IndexEntry__G9ccBDFWfr9aYnLgXTNGDHDg x, tyObject_IndexEntry__G9ccBDFWfr9aYnLgXTNGDHDg y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_102) (tyObject_IndexEntry__G9ccBDFWfr9aYnLgXTNGDHDg x, tyObject_IndexEntry__G9ccBDFWfr9aYnLgXTNGDHDg y);
struct tySequence__i7xpiUsxyv6cQ1xK3JbcGQ {
  TGenericSeq Sup;
  tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ* data[SEQ_DECL_SIZE];
};
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct tySequence__76wc9cnTOK9c6epudv8uYE0w {
  TGenericSeq Sup;
  tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q* data[SEQ_DECL_SIZE];
};
struct tySequence__9c1n3IOF5T6xvPNf6ipRnuQ {
  TGenericSeq Sup;
  tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA* data[SEQ_DECL_SIZE];
};
struct tySequence__5PunAJrNQYcB8dF0jau3pQ {
  TGenericSeq Sup;
  tyObject_IndexEntry__G9ccBDFWfr9aYnLgXTNGDHDg data[SEQ_DECL_SIZE];
};
N_LIB_PRIVATE N_NOINLINE(void, raiseDivByZero)(void);
static N_INLINE(NIM_BOOL, nimDivInt)(NI a, NI b, NI* res);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i, NI64 a, NI64 b);
N_LIB_PRIVATE N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
static N_INLINE(NIM_BOOL, nimSubInt)(NI a, NI b, NI* res);
N_LIB_PRIVATE N_NIMCALL(void, merge__6r30o9btqT1LYFtPsj530vg)(tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ** a, NI aLen_0, tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__oUBe9cr5fvX49bNNuH9bVbmnw cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
static N_INLINE(NI, star___kgZDSIMT2vrZak9bMmeL40walgorithm)(NI x, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError2)(NI i, NI n);
static N_INLINE(NIM_BOOL, nimAddInt)(NI a, NI b, NI* res);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A)(NimStringDesc* msg);
N_LIB_PRIVATE N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
static N_INLINE(NIM_BOOL, nimMulInt)(NI a, NI b, NI* res);
static N_INLINE(NF, toFloat__y1Fm9aHmxw9bS2jir137Fu5gsystem)(NI i);
static N_INLINE(NF, abs__BRaAqinz6OWTHkALb4oj6Qsystem)(NF x);
N_LIB_PRIVATE N_NIMCALL(void, sort__BLQ2Oe9csF8Sez29axQeuW6w)(NimStringDesc** a, NI aLen_0, tyProc__kTj9c3SX9agxDQPZYwemi6ug cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(void, merge__VVQbaBxW408lyw1OOwyNdQ)(NimStringDesc** a, NI aLen_0, NimStringDesc** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__kTj9c3SX9agxDQPZYwemi6ug cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(NI, cmp__NAicU5bAGXmkx2NJujGi7g_2)(NimStringDesc* x, NimStringDesc* y);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__JE6t4x7Z3v2iVz27Nx0MRAmemory)(void* a, int v, NI size);
N_LIB_PRIVATE N_NIMCALL(void, reverse__3Dh4Hivf0WC8Qer2dt4qSw)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw** a, NI aLen_0, NI first, NI last);
N_LIB_PRIVATE N_NIMCALL(tySequence__76wc9cnTOK9c6epudv8uYE0w*, newSeq__HX0fzMkXaVGbpAg39bd9bk9ag)(NI len);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incRef__AT1eRuflKWyTTBdLjEDZbg_3system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(NI, pluspercent___dgYAo7RfdUVVpvkfKDym8wsystem)(NI x, NI y);
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem)(void* usr);
static N_INLINE(NI, minuspercent___dgYAo7RfdUVVpvkfKDym8w_2system)(NI x, NI y);
static N_INLINE(void, decRef__AT1eRuflKWyTTBdLjEDZbgsystem)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(NIM_BOOL, ltpercent___hPljn3JCDQ00ua1R07X9bxQsystem)(NI x, NI y);
static N_INLINE(void, rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_2system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_PRIVATE N_NOINLINE(void, addZCT__Y66tOYFjgwJ0k4aLz4bc0Q)(tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w* s, tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_PRIVATE N_NIMCALL(void, sort__Vxb3by8QIdxiQga2mKXTcg)(tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q** a, NI aLen_0, tyProc__BX9cYxd9cF2mTlqoQZOdSHDA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(void, merge__iemomhlJ9bCvkwJyjR9c2ZWg)(tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q** a, NI aLen_0, tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__BX9cYxd9cF2mTlqoQZOdSHDA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(tySequence__9c1n3IOF5T6xvPNf6ipRnuQ*, newSeq__pV9cOe12RDY5XS9aptUz9bdpg)(NI len);
N_LIB_PRIVATE N_NIMCALL(void, sort__eYq5LpHw9cmQINjRgOSMIBg)(tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA** a, NI aLen_0, tyProc__yOjWJshC9bsazMthdLnSwrA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(void, merge__kGoy8RwjZPqBk9cKDdoXodg)(tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA** a, NI aLen_0, tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__yOjWJshC9bsazMthdLnSwrA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(NI, binarySearch__mXuSYz7TnkvkJ0CgoqjIDA)(NimStringDesc** a, NI aLen_0, NimStringDesc* key, tyProc__kTj9c3SX9agxDQPZYwemi6ug cmp);
N_LIB_PRIVATE N_NIMCALL(void, merge__8uGPISzqbd9ax9aI8lxSAOQA)(tyObject_IndexEntry__G9ccBDFWfr9aYnLgXTNGDHDg* a, NI aLen_0, tyObject_IndexEntry__G9ccBDFWfr9aYnLgXTNGDHDg* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__zzrK9cTwi9admDvOCMDMSIXQ cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
extern TNimType NTI__i7xpiUsxyv6cQ1xK3JbcGQ_;
STRING_LITERAL(TM__JdC9c6SaUkvO1XjYuWP1JWQ_9, "algorithm.nim(346, 10) `j <= m` ", 32);
extern TNimType NTI__sM4lkSb7zS6F7OVMvW9cffQ_;
extern TNimType NTI__76wc9cnTOK9c6epudv8uYE0w_;
extern TNimType NTI__9c1n3IOF5T6xvPNf6ipRnuQ_;
extern TNimType NTI__5PunAJrNQYcB8dF0jau3pQ_;
extern tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ gch__IcYaEuuWivYAS86vFMTS3Q;
static N_INLINE(NIM_BOOL, nimDivInt)(NI a, NI b, NI* res) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (a == ((NI) (-2147483647 -1)));
		if (!(T3_)) goto LA4_;
		T3_ = (b == ((NI) -1));
		LA4_: ;
		if (!T3_) goto LA5_;
		result = NIM_TRUE;
	}
	goto LA1_;
	LA5_: ;
	{
		(*res) = (NI)(a / b);
	}
	LA1_: ;
	return result;
}
static N_INLINE(NIM_BOOL, nimSubInt)(NI a, NI b, NI* res) {
	NIM_BOOL result;
	NI r;
	result = (NIM_BOOL)0;
	r = ((NI) ((NU)((NU32)(((NU) (a))) - (NU32)(((NU) (b))))));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (((NI) 0) <= (NI)(r ^ a));
		if (T3_) goto LA4_;
		T3_ = (((NI) 0) <= (NI)(r ^ (NI)((NU32) ~(b))));
		LA4_: ;
		if (!T3_) goto LA5_;
		(*res) = r;
	}
	goto LA1_;
	LA5_: ;
	{
		result = NIM_TRUE;
	}
	LA1_: ;
	return result;
}
static N_INLINE(NI, star___kgZDSIMT2vrZak9bMmeL40walgorithm)(NI x, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI result;
	NI y;
	NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_5;
	NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_6;
	result = (NI)0;
	if (nimSubInt(order, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_5)) { raiseOverflow(); };
	y = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_5);
	if (nimSubInt((NI)(x ^ y), y, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_6)) { raiseOverflow(); };
	result = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_6);
	return result;
}
static N_INLINE(NIM_BOOL, nimAddInt)(NI a, NI b, NI* res) {
	NIM_BOOL result;
	NI r;
	result = (NIM_BOOL)0;
	r = ((NI) ((NU)((NU32)(((NU) (a))) + (NU32)(((NU) (b))))));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (((NI) 0) <= (NI)(r ^ a));
		if (T3_) goto LA4_;
		T3_ = (((NI) 0) <= (NI)(r ^ b));
		LA4_: ;
		if (!T3_) goto LA5_;
		(*res) = r;
	}
	goto LA1_;
	LA5_: ;
	{
		result = NIM_TRUE;
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, merge__6r30o9btqT1LYFtPsj530vg)(tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ** a, NI aLen_0, tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__oUBe9cr5fvX49bNNuH9bVbmnw cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI j;
	NI bb;
	NI i;
	NI k;
{	{
		NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_7;
		NI T3_;
		NI T4_;
		if ((NU)(m) >= (NU)(aLen_0)){ raiseIndexError2(m,aLen_0-1); }
		if (nimAddInt(m, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_7)) { raiseOverflow(); };
		if ((NU)((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_7)) >= (NU)(aLen_0)){ raiseIndexError2((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_7),aLen_0-1); }
		T3_ = (NI)0;
		T3_ = cmp.ClE_0? cmp.ClP_0(a[m], a[(NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_7)], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_8)(cmp.ClP_0))(a[m], a[(NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_7)]);
		T4_ = (NI)0;
		T4_ = star___kgZDSIMT2vrZak9bMmeL40walgorithm(T3_, order);
		if (!(T4_ <= ((NI) 0))) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	j = lo;
	{
		if (!!((j <= m))) goto LA9_;
		failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__JdC9c6SaUkvO1XjYuWP1JWQ_9));
	}
	LA9_: ;
	bb = ((NI) 0);
	{
		while (1) {
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_10;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_11;
			if (!(j <= m)) goto LA12;
			if ((NU)(bb) >= (NU)(bLen_0)){ raiseIndexError2(bb,bLen_0-1); }
			if ((NU)(j) >= (NU)(aLen_0)){ raiseIndexError2(j,aLen_0-1); }
			unsureAsgnRef((void**) (&b[bb]), a[j]);
			if (nimAddInt(bb, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_10)) { raiseOverflow(); };
			bb = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_10);
			if (nimAddInt(j, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_11)) { raiseOverflow(); };
			j = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_11);
		} LA12: ;
	}
	i = ((NI) 0);
	k = lo;
	{
		while (1) {
			NIM_BOOL T15_;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_15;
			T15_ = (NIM_BOOL)0;
			T15_ = (k < j);
			if (!(T15_)) goto LA16_;
			T15_ = (j <= hi);
			LA16_: ;
			if (!T15_) goto LA14;
			{
				NI T19_;
				NI T20_;
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_13;
				if ((NU)(i) >= (NU)(bLen_0)){ raiseIndexError2(i,bLen_0-1); }
				if ((NU)(j) >= (NU)(aLen_0)){ raiseIndexError2(j,aLen_0-1); }
				T19_ = (NI)0;
				T19_ = cmp.ClE_0? cmp.ClP_0(b[i], a[j], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_12)(cmp.ClP_0))(b[i], a[j]);
				T20_ = (NI)0;
				T20_ = star___kgZDSIMT2vrZak9bMmeL40walgorithm(T19_, order);
				if (!(T20_ <= ((NI) 0))) goto LA21_;
				if ((NU)(k) >= (NU)(aLen_0)){ raiseIndexError2(k,aLen_0-1); }
				if ((NU)(i) >= (NU)(bLen_0)){ raiseIndexError2(i,bLen_0-1); }
				unsureAsgnRef((void**) (&a[k]), b[i]);
				if (nimAddInt(i, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_13)) { raiseOverflow(); };
				i = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_13);
			}
			goto LA17_;
			LA21_: ;
			{
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_14;
				if ((NU)(k) >= (NU)(aLen_0)){ raiseIndexError2(k,aLen_0-1); }
				if ((NU)(j) >= (NU)(aLen_0)){ raiseIndexError2(j,aLen_0-1); }
				unsureAsgnRef((void**) (&a[k]), a[j]);
				if (nimAddInt(j, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_14)) { raiseOverflow(); };
				j = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_14);
			}
			LA17_: ;
			if (nimAddInt(k, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_15)) { raiseOverflow(); };
			k = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_15);
		} LA14: ;
	}
	{
		while (1) {
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_16;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_17;
			if (!(k < j)) goto LA25;
			if ((NU)(k) >= (NU)(aLen_0)){ raiseIndexError2(k,aLen_0-1); }
			if ((NU)(i) >= (NU)(bLen_0)){ raiseIndexError2(i,bLen_0-1); }
			unsureAsgnRef((void**) (&a[k]), b[i]);
			if (nimAddInt(k, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_16)) { raiseOverflow(); };
			k = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_16);
			if (nimAddInt(i, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_17)) { raiseOverflow(); };
			i = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_17);
		} LA25: ;
	}
	}BeforeRet_: ;
}
static N_INLINE(NF, toFloat__y1Fm9aHmxw9bS2jir137Fu5gsystem)(NI i) {
	NF result;
	result = (NF)0;
	result = ((NF) (i));
	return result;
}
static N_INLINE(NF, abs__BRaAqinz6OWTHkALb4oj6Qsystem)(NF x) {
	NF result;
	result = (NF)0;
	{
		if (!(x < 0.0)) goto LA3_;
		result = -(x);
	}
	goto LA1_;
	LA3_: ;
	{
		result = x;
	}
	LA1_: ;
	return result;
}
static N_INLINE(NIM_BOOL, nimMulInt)(NI a, NI b, NI* res) {
	NIM_BOOL result;
	NI r;
	NF floatProd;
	NF T1_;
	NF T2_;
	NF resAsFloat;
	result = (NIM_BOOL)0;
	r = ((NI) ((NU)((NU32)(((NU) (a))) * (NU32)(((NU) (b))))));
	T1_ = (NF)0;
	T1_ = toFloat__y1Fm9aHmxw9bS2jir137Fu5gsystem(a);
	T2_ = (NF)0;
	T2_ = toFloat__y1Fm9aHmxw9bS2jir137Fu5gsystem(b);
	floatProd = ((NF)(T1_) * (NF)(T2_));
	resAsFloat = toFloat__y1Fm9aHmxw9bS2jir137Fu5gsystem(r);
	{
		if (!(resAsFloat == floatProd)) goto LA5_;
		(*res) = r;
	}
	goto LA3_;
	LA5_: ;
	{
		{
			NF T10_;
			NF T11_;
			T10_ = (NF)0;
			T10_ = abs__BRaAqinz6OWTHkALb4oj6Qsystem(((NF)(resAsFloat) - (NF)(floatProd)));
			T11_ = (NF)0;
			T11_ = abs__BRaAqinz6OWTHkALb4oj6Qsystem(floatProd);
			if (!(((NF)(3.2000000000000000e+01) * (NF)(T10_)) <= T11_)) goto LA12_;
			(*res) = r;
		}
		goto LA8_;
		LA12_: ;
		{
			result = NIM_TRUE;
		}
		LA8_: ;
	}
	LA3_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__kf6UDq4IFBhg8XC5ISz8gQ)(tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ** a, NI aLen_0, tyProc__oUBe9cr5fvX49bNNuH9bVbmnw cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI n;
	tySequence__i7xpiUsxyv6cQ1xK3JbcGQ* b;
	NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_2;
	NI s;
	n = aLen_0;
	b = (tySequence__i7xpiUsxyv6cQ1xK3JbcGQ*)0;
	if (((NI) 2) == 0){ raiseDivByZero(); }
	if (nimDivInt(n, ((NI) 2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_2)) { raiseOverflow(); };
	if (((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_2)) < ((NI) 0) || ((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_2)) > ((NI) 2147483647)){ raiseRangeErrorI((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_2), ((NI) 0), ((NI) 2147483647)); }
	b = (tySequence__i7xpiUsxyv6cQ1xK3JbcGQ*) newSeq((&NTI__i7xpiUsxyv6cQ1xK3JbcGQ_), ((NI) ((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_2))));
	s = ((NI) 1);
	{
		while (1) {
			NI m;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_3;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_4;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_23;
			if (!(s < n)) goto LA2;
			if (nimSubInt(n, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_3)) { raiseOverflow(); };
			if (nimSubInt((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_3), s, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_4)) { raiseOverflow(); };
			m = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_4);
			{
				while (1) {
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_18;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_19;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_20;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_21;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_22;
					if (!(((NI) 0) <= m)) goto LA4;
					if (nimSubInt(m, s, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_18)) { raiseOverflow(); };
					if (nimAddInt((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_18), ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_19)) { raiseOverflow(); };
					if (nimAddInt(m, s, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_20)) { raiseOverflow(); };
					merge__6r30o9btqT1LYFtPsj530vg(a, aLen_0, b->data, (b ? b->Sup.len : 0), (((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_19) >= ((NI) 0)) ? (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_19) : ((NI) 0)), m, (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_20), cmp, order);
					if (nimMulInt(s, ((NI) 2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_21)) { raiseOverflow(); };
					if (nimSubInt(m, (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_21), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_22)) { raiseOverflow(); };
					m = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_22);
				} LA4: ;
			}
			if (nimMulInt(s, ((NI) 2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_23)) { raiseOverflow(); };
			s = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_23);
		} LA2: ;
	}
}
N_LIB_PRIVATE N_NIMCALL(void, merge__VVQbaBxW408lyw1OOwyNdQ)(NimStringDesc** a, NI aLen_0, NimStringDesc** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__kTj9c3SX9agxDQPZYwemi6ug cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI j;
	NI bb;
	NI i;
	NI k;
{	{
		NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_27;
		NI T3_;
		NI T4_;
		if ((NU)(m) >= (NU)(aLen_0)){ raiseIndexError2(m,aLen_0-1); }
		if (nimAddInt(m, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_27)) { raiseOverflow(); };
		if ((NU)((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_27)) >= (NU)(aLen_0)){ raiseIndexError2((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_27),aLen_0-1); }
		T3_ = (NI)0;
		T3_ = cmp.ClE_0? cmp.ClP_0(a[m], a[(NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_27)], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_28)(cmp.ClP_0))(a[m], a[(NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_27)]);
		T4_ = (NI)0;
		T4_ = star___kgZDSIMT2vrZak9bMmeL40walgorithm(T3_, order);
		if (!(T4_ <= ((NI) 0))) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	j = lo;
	{
		if (!!((j <= m))) goto LA9_;
		failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__JdC9c6SaUkvO1XjYuWP1JWQ_9));
	}
	LA9_: ;
	bb = ((NI) 0);
	{
		while (1) {
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_29;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_30;
			if (!(j <= m)) goto LA12;
			if ((NU)(bb) >= (NU)(bLen_0)){ raiseIndexError2(bb,bLen_0-1); }
			if ((NU)(j) >= (NU)(aLen_0)){ raiseIndexError2(j,aLen_0-1); }
			unsureAsgnRef((void**) (&b[bb]), a[j]);
			if (nimAddInt(bb, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_29)) { raiseOverflow(); };
			bb = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_29);
			if (nimAddInt(j, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_30)) { raiseOverflow(); };
			j = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_30);
		} LA12: ;
	}
	i = ((NI) 0);
	k = lo;
	{
		while (1) {
			NIM_BOOL T15_;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_34;
			T15_ = (NIM_BOOL)0;
			T15_ = (k < j);
			if (!(T15_)) goto LA16_;
			T15_ = (j <= hi);
			LA16_: ;
			if (!T15_) goto LA14;
			{
				NI T19_;
				NI T20_;
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_32;
				if ((NU)(i) >= (NU)(bLen_0)){ raiseIndexError2(i,bLen_0-1); }
				if ((NU)(j) >= (NU)(aLen_0)){ raiseIndexError2(j,aLen_0-1); }
				T19_ = (NI)0;
				T19_ = cmp.ClE_0? cmp.ClP_0(b[i], a[j], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_31)(cmp.ClP_0))(b[i], a[j]);
				T20_ = (NI)0;
				T20_ = star___kgZDSIMT2vrZak9bMmeL40walgorithm(T19_, order);
				if (!(T20_ <= ((NI) 0))) goto LA21_;
				if ((NU)(k) >= (NU)(aLen_0)){ raiseIndexError2(k,aLen_0-1); }
				if ((NU)(i) >= (NU)(bLen_0)){ raiseIndexError2(i,bLen_0-1); }
				unsureAsgnRef((void**) (&a[k]), b[i]);
				if (nimAddInt(i, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_32)) { raiseOverflow(); };
				i = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_32);
			}
			goto LA17_;
			LA21_: ;
			{
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_33;
				if ((NU)(k) >= (NU)(aLen_0)){ raiseIndexError2(k,aLen_0-1); }
				if ((NU)(j) >= (NU)(aLen_0)){ raiseIndexError2(j,aLen_0-1); }
				unsureAsgnRef((void**) (&a[k]), a[j]);
				if (nimAddInt(j, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_33)) { raiseOverflow(); };
				j = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_33);
			}
			LA17_: ;
			if (nimAddInt(k, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_34)) { raiseOverflow(); };
			k = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_34);
		} LA14: ;
	}
	{
		while (1) {
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_35;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_36;
			if (!(k < j)) goto LA25;
			if ((NU)(k) >= (NU)(aLen_0)){ raiseIndexError2(k,aLen_0-1); }
			if ((NU)(i) >= (NU)(bLen_0)){ raiseIndexError2(i,bLen_0-1); }
			unsureAsgnRef((void**) (&a[k]), b[i]);
			if (nimAddInt(k, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_35)) { raiseOverflow(); };
			k = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_35);
			if (nimAddInt(i, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_36)) { raiseOverflow(); };
			i = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_36);
		} LA25: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__BLQ2Oe9csF8Sez29axQeuW6w)(NimStringDesc** a, NI aLen_0, tyProc__kTj9c3SX9agxDQPZYwemi6ug cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI n;
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ* b;
	NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_24;
	NI s;
	n = aLen_0;
	b = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*)0;
	if (((NI) 2) == 0){ raiseDivByZero(); }
	if (nimDivInt(n, ((NI) 2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_24)) { raiseOverflow(); };
	if (((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_24)) < ((NI) 0) || ((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_24)) > ((NI) 2147483647)){ raiseRangeErrorI((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_24), ((NI) 0), ((NI) 2147483647)); }
	b = (tySequence__sM4lkSb7zS6F7OVMvW9cffQ*) newSeq((&NTI__sM4lkSb7zS6F7OVMvW9cffQ_), ((NI) ((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_24))));
	s = ((NI) 1);
	{
		while (1) {
			NI m;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_25;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_26;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_42;
			if (!(s < n)) goto LA2;
			if (nimSubInt(n, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_25)) { raiseOverflow(); };
			if (nimSubInt((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_25), s, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_26)) { raiseOverflow(); };
			m = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_26);
			{
				while (1) {
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_37;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_38;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_39;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_40;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_41;
					if (!(((NI) 0) <= m)) goto LA4;
					if (nimSubInt(m, s, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_37)) { raiseOverflow(); };
					if (nimAddInt((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_37), ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_38)) { raiseOverflow(); };
					if (nimAddInt(m, s, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_39)) { raiseOverflow(); };
					merge__VVQbaBxW408lyw1OOwyNdQ(a, aLen_0, b->data, (b ? b->Sup.len : 0), (((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_38) >= ((NI) 0)) ? (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_38) : ((NI) 0)), m, (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_39), cmp, order);
					if (nimMulInt(s, ((NI) 2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_40)) { raiseOverflow(); };
					if (nimSubInt(m, (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_40), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_41)) { raiseOverflow(); };
					m = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_41);
				} LA4: ;
			}
			if (nimMulInt(s, ((NI) 2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_42)) { raiseOverflow(); };
			s = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_42);
		} LA2: ;
	}
}
static N_INLINE(void, nimSetMem__JE6t4x7Z3v2iVz27Nx0MRAmemory)(void* a, int v, NI size) {
	void* T1_;
	T1_ = (void*)0;
	T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
	nimSetMem__JE6t4x7Z3v2iVz27Nx0MRAmemory(p, ((int) 0), size);
}
N_LIB_PRIVATE N_NIMCALL(void, sort__QeVk9c1PKgtuLn69cFZt89cSg)(NimStringDesc** a, NI aLen_0, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	tyProc__kTj9c3SX9agxDQPZYwemi6ug T1_;
	nimZeroMem((void*)(&T1_), sizeof(tyProc__kTj9c3SX9agxDQPZYwemi6ug));
	T1_.ClP_0 = ((TM__JdC9c6SaUkvO1XjYuWP1JWQ_43) (cmp__NAicU5bAGXmkx2NJujGi7g_2)); T1_.ClE_0 = NIM_NIL;
	sort__BLQ2Oe9csF8Sez29axQeuW6w(a, aLen_0, T1_, order);
}
N_LIB_PRIVATE N_NIMCALL(void, reverse__3Dh4Hivf0WC8Qer2dt4qSw)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw** a, NI aLen_0, NI first, NI last) {
	NI x;
	NI y;
	x = first;
	y = last;
	{
		while (1) {
			tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* T3_;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_44;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_45;
			if (!(((NI) (x)) < ((NI) (y)))) goto LA2;
			T3_ = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
			if ((NU)(x) >= (NU)(aLen_0)){ raiseIndexError2(x,aLen_0-1); }
			if ((NU)(y) >= (NU)(aLen_0)){ raiseIndexError2(y,aLen_0-1); }
			T3_ = a[x];
			unsureAsgnRef((void**) (&a[x]), a[y]);
			unsureAsgnRef((void**) (&a[y]), T3_);
			if (nimSubInt(y, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_44)) { raiseOverflow(); };
			if (TM__JdC9c6SaUkvO1XjYuWP1JWQ_44 < 0 || TM__JdC9c6SaUkvO1XjYuWP1JWQ_44 > 2147483647){ raiseOverflow(); }
			y = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_44);
			if (nimAddInt(x, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_45)) { raiseOverflow(); };
			if (TM__JdC9c6SaUkvO1XjYuWP1JWQ_45 < 0 || TM__JdC9c6SaUkvO1XjYuWP1JWQ_45 > 2147483647){ raiseOverflow(); }
			x = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_45);
		} LA2: ;
	}
}
N_LIB_PRIVATE N_NIMCALL(void, reverse__qzRMbV4pBnGXO1GUX1t4VQ)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw** a, NI aLen_0) {
	if ((((((NI) 0) >= (aLen_0-1)) ? ((NI) 0) : (aLen_0-1))) < ((NI) 0) || (((((NI) 0) >= (aLen_0-1)) ? ((NI) 0) : (aLen_0-1))) > ((NI) 2147483647)){ raiseRangeErrorI(((((NI) 0) >= (aLen_0-1)) ? ((NI) 0) : (aLen_0-1)), ((NI) 0), ((NI) 2147483647)); }
	reverse__3Dh4Hivf0WC8Qer2dt4qSw(a, aLen_0, ((NI) 0), ((NI) (((((NI) 0) >= (aLen_0-1)) ? ((NI) 0) : (aLen_0-1)))));
}
static N_INLINE(NI, pluspercent___dgYAo7RfdUVVpvkfKDym8wsystem)(NI x, NI y) {
	NI result;
	result = (NI)0;
	result = ((NI) ((NU)((NU32)(((NU) (x))) + (NU32)(((NU) (y))))));
	return result;
}
static N_INLINE(void, incRef__AT1eRuflKWyTTBdLjEDZbg_3system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
	(*c).refcount = pluspercent___dgYAo7RfdUVVpvkfKDym8wsystem((*c).refcount, ((NI) 8));
}
static N_INLINE(NI, minuspercent___dgYAo7RfdUVVpvkfKDym8w_2system)(NI x, NI y) {
	NI result;
	result = (NI)0;
	result = ((NI) ((NU)((NU32)(((NU) (x))) - (NU32)(((NU) (y))))));
	return result;
}
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem)(void* usr) {
	tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* result;
	NI T1_;
	result = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
	T1_ = (NI)0;
	T1_ = minuspercent___dgYAo7RfdUVVpvkfKDym8w_2system(((NI) (ptrdiff_t) (usr)), ((NI) 8));
	result = ((tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*) (T1_));
	return result;
}
static N_INLINE(NIM_BOOL, ltpercent___hPljn3JCDQ00ua1R07X9bxQsystem)(NI x, NI y) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	result = ((NU32)(((NU) (x))) < (NU32)(((NU) (y))));
	return result;
}
static N_INLINE(void, rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_2system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
	addZCT__Y66tOYFjgwJ0k4aLz4bc0Q((&gch__IcYaEuuWivYAS86vFMTS3Q.zct), c);
}
static N_INLINE(void, decRef__AT1eRuflKWyTTBdLjEDZbgsystem)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
	(*c).refcount = minuspercent___dgYAo7RfdUVVpvkfKDym8w_2system((*c).refcount, ((NI) 8));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = ltpercent___hPljn3JCDQ00ua1R07X9bxQsystem((*c).refcount, ((NI) 8));
		if (!T3_) goto LA4_;
		rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_2system(c);
	}
	LA4_: ;
}
static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T5_;
		if (!!((src == NIM_NIL))) goto LA3_;
		T5_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
		T5_ = usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem(src);
		incRef__AT1eRuflKWyTTBdLjEDZbg_3system(T5_);
	}
	LA3_: ;
	{
		tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T10_;
		if (!!(((*dest) == NIM_NIL))) goto LA8_;
		T10_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
		T10_ = usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem((*dest));
		decRef__AT1eRuflKWyTTBdLjEDZbgsystem(T10_);
	}
	LA8_: ;
	(*dest) = src;
}
N_LIB_PRIVATE N_NIMCALL(void, merge__iemomhlJ9bCvkwJyjR9c2ZWg)(tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q** a, NI aLen_0, tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__BX9cYxd9cF2mTlqoQZOdSHDA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI j;
	NI bb;
	NI i;
	NI k;
{	{
		NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_50;
		NI T3_;
		NI T4_;
		if ((NU)(m) >= (NU)(aLen_0)){ raiseIndexError2(m,aLen_0-1); }
		if (nimAddInt(m, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_50)) { raiseOverflow(); };
		if ((NU)((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_50)) >= (NU)(aLen_0)){ raiseIndexError2((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_50),aLen_0-1); }
		T3_ = (NI)0;
		T3_ = cmp.ClE_0? cmp.ClP_0(a[m], a[(NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_50)], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_51)(cmp.ClP_0))(a[m], a[(NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_50)]);
		T4_ = (NI)0;
		T4_ = star___kgZDSIMT2vrZak9bMmeL40walgorithm(T3_, order);
		if (!(T4_ <= ((NI) 0))) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	j = lo;
	{
		if (!!((j <= m))) goto LA9_;
		failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__JdC9c6SaUkvO1XjYuWP1JWQ_9));
	}
	LA9_: ;
	bb = ((NI) 0);
	{
		while (1) {
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_52;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_53;
			if (!(j <= m)) goto LA12;
			if ((NU)(bb) >= (NU)(bLen_0)){ raiseIndexError2(bb,bLen_0-1); }
			if ((NU)(j) >= (NU)(aLen_0)){ raiseIndexError2(j,aLen_0-1); }
			unsureAsgnRef((void**) (&b[bb]), a[j]);
			if (nimAddInt(bb, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_52)) { raiseOverflow(); };
			bb = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_52);
			if (nimAddInt(j, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_53)) { raiseOverflow(); };
			j = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_53);
		} LA12: ;
	}
	i = ((NI) 0);
	k = lo;
	{
		while (1) {
			NIM_BOOL T15_;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_57;
			T15_ = (NIM_BOOL)0;
			T15_ = (k < j);
			if (!(T15_)) goto LA16_;
			T15_ = (j <= hi);
			LA16_: ;
			if (!T15_) goto LA14;
			{
				NI T19_;
				NI T20_;
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_55;
				if ((NU)(i) >= (NU)(bLen_0)){ raiseIndexError2(i,bLen_0-1); }
				if ((NU)(j) >= (NU)(aLen_0)){ raiseIndexError2(j,aLen_0-1); }
				T19_ = (NI)0;
				T19_ = cmp.ClE_0? cmp.ClP_0(b[i], a[j], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_54)(cmp.ClP_0))(b[i], a[j]);
				T20_ = (NI)0;
				T20_ = star___kgZDSIMT2vrZak9bMmeL40walgorithm(T19_, order);
				if (!(T20_ <= ((NI) 0))) goto LA21_;
				if ((NU)(k) >= (NU)(aLen_0)){ raiseIndexError2(k,aLen_0-1); }
				if ((NU)(i) >= (NU)(bLen_0)){ raiseIndexError2(i,bLen_0-1); }
				unsureAsgnRef((void**) (&a[k]), b[i]);
				if (nimAddInt(i, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_55)) { raiseOverflow(); };
				i = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_55);
			}
			goto LA17_;
			LA21_: ;
			{
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_56;
				if ((NU)(k) >= (NU)(aLen_0)){ raiseIndexError2(k,aLen_0-1); }
				if ((NU)(j) >= (NU)(aLen_0)){ raiseIndexError2(j,aLen_0-1); }
				unsureAsgnRef((void**) (&a[k]), a[j]);
				if (nimAddInt(j, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_56)) { raiseOverflow(); };
				j = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_56);
			}
			LA17_: ;
			if (nimAddInt(k, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_57)) { raiseOverflow(); };
			k = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_57);
		} LA14: ;
	}
	{
		while (1) {
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_58;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_59;
			if (!(k < j)) goto LA25;
			if ((NU)(k) >= (NU)(aLen_0)){ raiseIndexError2(k,aLen_0-1); }
			if ((NU)(i) >= (NU)(bLen_0)){ raiseIndexError2(i,bLen_0-1); }
			unsureAsgnRef((void**) (&a[k]), b[i]);
			if (nimAddInt(k, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_58)) { raiseOverflow(); };
			k = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_58);
			if (nimAddInt(i, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_59)) { raiseOverflow(); };
			i = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_59);
		} LA25: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__Vxb3by8QIdxiQga2mKXTcg)(tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q** a, NI aLen_0, tyProc__BX9cYxd9cF2mTlqoQZOdSHDA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI n;
	tySequence__76wc9cnTOK9c6epudv8uYE0w* b;
	NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_47;
	NI s;
	n = aLen_0;
	b = (tySequence__76wc9cnTOK9c6epudv8uYE0w*)0;
	if (((NI) 2) == 0){ raiseDivByZero(); }
	if (nimDivInt(n, ((NI) 2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_47)) { raiseOverflow(); };
	if (((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_47)) < ((NI) 0) || ((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_47)) > ((NI) 2147483647)){ raiseRangeErrorI((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_47), ((NI) 0), ((NI) 2147483647)); }
	b = (tySequence__76wc9cnTOK9c6epudv8uYE0w*) newSeq((&NTI__76wc9cnTOK9c6epudv8uYE0w_), ((NI) ((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_47))));
	s = ((NI) 1);
	{
		while (1) {
			NI m;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_48;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_49;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_65;
			if (!(s < n)) goto LA2;
			if (nimSubInt(n, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_48)) { raiseOverflow(); };
			if (nimSubInt((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_48), s, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_49)) { raiseOverflow(); };
			m = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_49);
			{
				while (1) {
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_60;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_61;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_62;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_63;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_64;
					if (!(((NI) 0) <= m)) goto LA4;
					if (nimSubInt(m, s, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_60)) { raiseOverflow(); };
					if (nimAddInt((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_60), ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_61)) { raiseOverflow(); };
					if (nimAddInt(m, s, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_62)) { raiseOverflow(); };
					merge__iemomhlJ9bCvkwJyjR9c2ZWg(a, aLen_0, b->data, (b ? b->Sup.len : 0), (((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_61) >= ((NI) 0)) ? (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_61) : ((NI) 0)), m, (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_62), cmp, order);
					if (nimMulInt(s, ((NI) 2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_63)) { raiseOverflow(); };
					if (nimSubInt(m, (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_63), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_64)) { raiseOverflow(); };
					m = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_64);
				} LA4: ;
			}
			if (nimMulInt(s, ((NI) 2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_65)) { raiseOverflow(); };
			s = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_65);
		} LA2: ;
	}
}
N_LIB_PRIVATE N_NIMCALL(tySequence__76wc9cnTOK9c6epudv8uYE0w*, sorted__1d6z7mFg8pfnJxr2lUHibg)(tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q** a, NI aLen_0, tyProc__BX9cYxd9cF2mTlqoQZOdSHDA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	tySequence__76wc9cnTOK9c6epudv8uYE0w* result;
	result = (tySequence__76wc9cnTOK9c6epudv8uYE0w*)0;
	if ((aLen_0) < ((NI) 0) || (aLen_0) > ((NI) 2147483647)){ raiseRangeErrorI(aLen_0, ((NI) 0), ((NI) 2147483647)); }
	result = newSeq__HX0fzMkXaVGbpAg39bd9bk9ag(((NI) (aLen_0)));
	{
		NI i;
		NI colontmp_;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (aLen_0-1);
		res = ((NI) 0);
		{
			while (1) {
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_46;
				if (!(res <= colontmp_)) goto LA3;
				i = res;
				if ((NU)(i) >= (NU)(result ? result->Sup.len : 0)){ raiseIndexError2(i,(result ? result->Sup.len : 0)-1); }
				if ((NU)(i) >= (NU)(aLen_0)){ raiseIndexError2(i,aLen_0-1); }
				asgnRef((void**) (&result->data[i]), a[i]);
				if (nimAddInt(res, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_46)) { raiseOverflow(); };
				res = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_46);
			} LA3: ;
		}
	}
	sort__Vxb3by8QIdxiQga2mKXTcg(result->data, (result ? result->Sup.len : 0), cmp, order);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, merge__kGoy8RwjZPqBk9cKDdoXodg)(tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA** a, NI aLen_0, tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__yOjWJshC9bsazMthdLnSwrA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI j;
	NI bb;
	NI i;
	NI k;
{	{
		NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_70;
		NI T3_;
		NI T4_;
		if ((NU)(m) >= (NU)(aLen_0)){ raiseIndexError2(m,aLen_0-1); }
		if (nimAddInt(m, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_70)) { raiseOverflow(); };
		if ((NU)((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_70)) >= (NU)(aLen_0)){ raiseIndexError2((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_70),aLen_0-1); }
		T3_ = (NI)0;
		T3_ = cmp.ClE_0? cmp.ClP_0(a[m], a[(NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_70)], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_71)(cmp.ClP_0))(a[m], a[(NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_70)]);
		T4_ = (NI)0;
		T4_ = star___kgZDSIMT2vrZak9bMmeL40walgorithm(T3_, order);
		if (!(T4_ <= ((NI) 0))) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	j = lo;
	{
		if (!!((j <= m))) goto LA9_;
		failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__JdC9c6SaUkvO1XjYuWP1JWQ_9));
	}
	LA9_: ;
	bb = ((NI) 0);
	{
		while (1) {
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_72;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_73;
			if (!(j <= m)) goto LA12;
			if ((NU)(bb) >= (NU)(bLen_0)){ raiseIndexError2(bb,bLen_0-1); }
			if ((NU)(j) >= (NU)(aLen_0)){ raiseIndexError2(j,aLen_0-1); }
			unsureAsgnRef((void**) (&b[bb]), a[j]);
			if (nimAddInt(bb, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_72)) { raiseOverflow(); };
			bb = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_72);
			if (nimAddInt(j, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_73)) { raiseOverflow(); };
			j = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_73);
		} LA12: ;
	}
	i = ((NI) 0);
	k = lo;
	{
		while (1) {
			NIM_BOOL T15_;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_77;
			T15_ = (NIM_BOOL)0;
			T15_ = (k < j);
			if (!(T15_)) goto LA16_;
			T15_ = (j <= hi);
			LA16_: ;
			if (!T15_) goto LA14;
			{
				NI T19_;
				NI T20_;
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_75;
				if ((NU)(i) >= (NU)(bLen_0)){ raiseIndexError2(i,bLen_0-1); }
				if ((NU)(j) >= (NU)(aLen_0)){ raiseIndexError2(j,aLen_0-1); }
				T19_ = (NI)0;
				T19_ = cmp.ClE_0? cmp.ClP_0(b[i], a[j], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_74)(cmp.ClP_0))(b[i], a[j]);
				T20_ = (NI)0;
				T20_ = star___kgZDSIMT2vrZak9bMmeL40walgorithm(T19_, order);
				if (!(T20_ <= ((NI) 0))) goto LA21_;
				if ((NU)(k) >= (NU)(aLen_0)){ raiseIndexError2(k,aLen_0-1); }
				if ((NU)(i) >= (NU)(bLen_0)){ raiseIndexError2(i,bLen_0-1); }
				unsureAsgnRef((void**) (&a[k]), b[i]);
				if (nimAddInt(i, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_75)) { raiseOverflow(); };
				i = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_75);
			}
			goto LA17_;
			LA21_: ;
			{
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_76;
				if ((NU)(k) >= (NU)(aLen_0)){ raiseIndexError2(k,aLen_0-1); }
				if ((NU)(j) >= (NU)(aLen_0)){ raiseIndexError2(j,aLen_0-1); }
				unsureAsgnRef((void**) (&a[k]), a[j]);
				if (nimAddInt(j, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_76)) { raiseOverflow(); };
				j = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_76);
			}
			LA17_: ;
			if (nimAddInt(k, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_77)) { raiseOverflow(); };
			k = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_77);
		} LA14: ;
	}
	{
		while (1) {
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_78;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_79;
			if (!(k < j)) goto LA25;
			if ((NU)(k) >= (NU)(aLen_0)){ raiseIndexError2(k,aLen_0-1); }
			if ((NU)(i) >= (NU)(bLen_0)){ raiseIndexError2(i,bLen_0-1); }
			unsureAsgnRef((void**) (&a[k]), b[i]);
			if (nimAddInt(k, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_78)) { raiseOverflow(); };
			k = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_78);
			if (nimAddInt(i, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_79)) { raiseOverflow(); };
			i = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_79);
		} LA25: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__eYq5LpHw9cmQINjRgOSMIBg)(tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA** a, NI aLen_0, tyProc__yOjWJshC9bsazMthdLnSwrA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI n;
	tySequence__9c1n3IOF5T6xvPNf6ipRnuQ* b;
	NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_67;
	NI s;
	n = aLen_0;
	b = (tySequence__9c1n3IOF5T6xvPNf6ipRnuQ*)0;
	if (((NI) 2) == 0){ raiseDivByZero(); }
	if (nimDivInt(n, ((NI) 2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_67)) { raiseOverflow(); };
	if (((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_67)) < ((NI) 0) || ((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_67)) > ((NI) 2147483647)){ raiseRangeErrorI((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_67), ((NI) 0), ((NI) 2147483647)); }
	b = (tySequence__9c1n3IOF5T6xvPNf6ipRnuQ*) newSeq((&NTI__9c1n3IOF5T6xvPNf6ipRnuQ_), ((NI) ((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_67))));
	s = ((NI) 1);
	{
		while (1) {
			NI m;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_68;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_69;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_85;
			if (!(s < n)) goto LA2;
			if (nimSubInt(n, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_68)) { raiseOverflow(); };
			if (nimSubInt((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_68), s, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_69)) { raiseOverflow(); };
			m = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_69);
			{
				while (1) {
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_80;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_81;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_82;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_83;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_84;
					if (!(((NI) 0) <= m)) goto LA4;
					if (nimSubInt(m, s, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_80)) { raiseOverflow(); };
					if (nimAddInt((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_80), ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_81)) { raiseOverflow(); };
					if (nimAddInt(m, s, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_82)) { raiseOverflow(); };
					merge__kGoy8RwjZPqBk9cKDdoXodg(a, aLen_0, b->data, (b ? b->Sup.len : 0), (((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_81) >= ((NI) 0)) ? (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_81) : ((NI) 0)), m, (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_82), cmp, order);
					if (nimMulInt(s, ((NI) 2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_83)) { raiseOverflow(); };
					if (nimSubInt(m, (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_83), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_84)) { raiseOverflow(); };
					m = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_84);
				} LA4: ;
			}
			if (nimMulInt(s, ((NI) 2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_85)) { raiseOverflow(); };
			s = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_85);
		} LA2: ;
	}
}
N_LIB_PRIVATE N_NIMCALL(tySequence__9c1n3IOF5T6xvPNf6ipRnuQ*, sorted__XOrJCjF0wesNx6edQohw2Q)(tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA** a, NI aLen_0, tyProc__yOjWJshC9bsazMthdLnSwrA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	tySequence__9c1n3IOF5T6xvPNf6ipRnuQ* result;
	result = (tySequence__9c1n3IOF5T6xvPNf6ipRnuQ*)0;
	if ((aLen_0) < ((NI) 0) || (aLen_0) > ((NI) 2147483647)){ raiseRangeErrorI(aLen_0, ((NI) 0), ((NI) 2147483647)); }
	result = newSeq__pV9cOe12RDY5XS9aptUz9bdpg(((NI) (aLen_0)));
	{
		NI i;
		NI colontmp_;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (aLen_0-1);
		res = ((NI) 0);
		{
			while (1) {
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_66;
				if (!(res <= colontmp_)) goto LA3;
				i = res;
				if ((NU)(i) >= (NU)(result ? result->Sup.len : 0)){ raiseIndexError2(i,(result ? result->Sup.len : 0)-1); }
				if ((NU)(i) >= (NU)(aLen_0)){ raiseIndexError2(i,aLen_0-1); }
				asgnRef((void**) (&result->data[i]), a[i]);
				if (nimAddInt(res, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_66)) { raiseOverflow(); };
				res = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_66);
			} LA3: ;
		}
	}
	sort__eYq5LpHw9cmQINjRgOSMIBg(result->data, (result ? result->Sup.len : 0), cmp, order);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, binarySearch__mXuSYz7TnkvkJ0CgoqjIDA)(NimStringDesc** a, NI aLen_0, NimStringDesc* key, tyProc__kTj9c3SX9agxDQPZYwemi6ug cmp) {
	NI result;
	NI len;
{	result = (NI)0;
	{
		if (!(aLen_0 == ((NI) 0))) goto LA3_;
		result = ((NI) -1);
		goto BeforeRet_;
	}
	LA3_: ;
	len = aLen_0;
	{
		if (!(len == ((NI) 1))) goto LA7_;
		{
			NI T11_;
			if ((NU)(((NI) 0)) >= (NU)(aLen_0)){ raiseIndexError2(((NI) 0),aLen_0-1); }
			T11_ = (NI)0;
			T11_ = cmp.ClE_0? cmp.ClP_0(a[((NI) 0)], key, cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_86)(cmp.ClP_0))(a[((NI) 0)], key);
			if (!(T11_ == ((NI) 0))) goto LA12_;
			result = ((NI) 0);
			goto BeforeRet_;
		}
		goto LA9_;
		LA12_: ;
		{
			result = ((NI) -1);
			goto BeforeRet_;
		}
		LA9_: ;
	}
	LA7_: ;
	{
		NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_87;
		NI step;
		NI cmpRes;
		if (nimSubInt(len, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_87)) { raiseOverflow(); };
		if (!((NI)(len & (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_87)) == ((NI) 0))) goto LA17_;
		step = (NI)((NI32)(len) >> (NU32)(((NI) 1)));
		cmpRes = (NI)0;
		{
			while (1) {
				NI i;
				if (!(((NI) 0) < step)) goto LA20;
				i = (NI)(result | step);
				if ((NU)(i) >= (NU)(aLen_0)){ raiseIndexError2(i,aLen_0-1); }
				cmpRes = cmp.ClE_0? cmp.ClP_0(a[i], key, cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_88)(cmp.ClP_0))(a[i], key);
				{
					if (!(cmpRes == ((NI) 0))) goto LA23_;
					result = i;
					goto BeforeRet_;
				}
				LA23_: ;
				{
					if (!(cmpRes < ((NI) 1))) goto LA27_;
					result = i;
				}
				LA27_: ;
				step = (NI)((NI32)(step) >> (NU32)(((NI) 1)));
			} LA20: ;
		}
		{
			NI T31_;
			if ((NU)(result) >= (NU)(aLen_0)){ raiseIndexError2(result,aLen_0-1); }
			T31_ = (NI)0;
			T31_ = cmp.ClE_0? cmp.ClP_0(a[result], key, cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_89)(cmp.ClP_0))(a[result], key);
			if (!!((T31_ == ((NI) 0)))) goto LA32_;
			result = ((NI) -1);
		}
		LA32_: ;
	}
	goto LA15_;
	LA17_: ;
	{
		NI b;
		NI cmpRes_2;
		b = len;
		cmpRes_2 = (NI)0;
		{
			while (1) {
				NI mid;
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_90;
				if (!(result < b)) goto LA36;
				if (nimAddInt(result, b, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_90)) { raiseOverflow(); };
				mid = (NI)((NI32)((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_90)) >> (NU32)(((NI) 1)));
				if ((NU)(mid) >= (NU)(aLen_0)){ raiseIndexError2(mid,aLen_0-1); }
				cmpRes_2 = cmp.ClE_0? cmp.ClP_0(a[mid], key, cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_91)(cmp.ClP_0))(a[mid], key);
				{
					if (!(cmpRes_2 == ((NI) 0))) goto LA39_;
					result = mid;
					goto BeforeRet_;
				}
				LA39_: ;
				{
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_92;
					if (!(cmpRes_2 < ((NI) 0))) goto LA43_;
					if (nimAddInt(mid, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_92)) { raiseOverflow(); };
					result = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_92);
				}
				goto LA41_;
				LA43_: ;
				{
					b = mid;
				}
				LA41_: ;
			} LA36: ;
		}
		{
			NIM_BOOL T48_;
			NI T50_;
			T48_ = (NIM_BOOL)0;
			T48_ = (len <= result);
			if (T48_) goto LA49_;
			if ((NU)(result) >= (NU)(aLen_0)){ raiseIndexError2(result,aLen_0-1); }
			T50_ = (NI)0;
			T50_ = cmp.ClE_0? cmp.ClP_0(a[result], key, cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_93)(cmp.ClP_0))(a[result], key);
			T48_ = !((T50_ == ((NI) 0)));
			LA49_: ;
			if (!T48_) goto LA51_;
			result = ((NI) -1);
		}
		LA51_: ;
	}
	LA15_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, binarySearch__wa1aY9bsuTdXtbdvM9apunWQ)(NimStringDesc** a, NI aLen_0, NimStringDesc* key) {
	NI result;
	tyProc__kTj9c3SX9agxDQPZYwemi6ug T1_;
	result = (NI)0;
	nimZeroMem((void*)(&T1_), sizeof(tyProc__kTj9c3SX9agxDQPZYwemi6ug));
	T1_.ClP_0 = ((TM__JdC9c6SaUkvO1XjYuWP1JWQ_94) (cmp__NAicU5bAGXmkx2NJujGi7g_2)); T1_.ClE_0 = NIM_NIL;
	result = binarySearch__mXuSYz7TnkvkJ0CgoqjIDA(a, aLen_0, key, T1_);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, merge__8uGPISzqbd9ax9aI8lxSAOQA)(tyObject_IndexEntry__G9ccBDFWfr9aYnLgXTNGDHDg* a, NI aLen_0, tyObject_IndexEntry__G9ccBDFWfr9aYnLgXTNGDHDg* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__zzrK9cTwi9admDvOCMDMSIXQ cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI j;
	NI bb;
	NI i;
	NI k;
{	{
		NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_98;
		NI T3_;
		NI T4_;
		if ((NU)(m) >= (NU)(aLen_0)){ raiseIndexError2(m,aLen_0-1); }
		if (nimAddInt(m, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_98)) { raiseOverflow(); };
		if ((NU)((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_98)) >= (NU)(aLen_0)){ raiseIndexError2((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_98),aLen_0-1); }
		T3_ = (NI)0;
		T3_ = cmp.ClE_0? cmp.ClP_0(a[m], a[(NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_98)], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_99)(cmp.ClP_0))(a[m], a[(NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_98)]);
		T4_ = (NI)0;
		T4_ = star___kgZDSIMT2vrZak9bMmeL40walgorithm(T3_, order);
		if (!(T4_ <= ((NI) 0))) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	j = lo;
	{
		if (!!((j <= m))) goto LA9_;
		failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__JdC9c6SaUkvO1XjYuWP1JWQ_9));
	}
	LA9_: ;
	bb = ((NI) 0);
	{
		while (1) {
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_100;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_101;
			if (!(j <= m)) goto LA12;
			if ((NU)(bb) >= (NU)(bLen_0)){ raiseIndexError2(bb,bLen_0-1); }
			if ((NU)(j) >= (NU)(aLen_0)){ raiseIndexError2(j,aLen_0-1); }
			unsureAsgnRef((void**) (&b[bb].keyword), a[j].keyword);
			unsureAsgnRef((void**) (&b[bb].link), a[j].link);
			unsureAsgnRef((void**) (&b[bb].linkTitle), a[j].linkTitle);
			unsureAsgnRef((void**) (&b[bb].linkDesc), a[j].linkDesc);
			if (nimAddInt(bb, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_100)) { raiseOverflow(); };
			bb = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_100);
			if (nimAddInt(j, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_101)) { raiseOverflow(); };
			j = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_101);
		} LA12: ;
	}
	i = ((NI) 0);
	k = lo;
	{
		while (1) {
			NIM_BOOL T15_;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_105;
			T15_ = (NIM_BOOL)0;
			T15_ = (k < j);
			if (!(T15_)) goto LA16_;
			T15_ = (j <= hi);
			LA16_: ;
			if (!T15_) goto LA14;
			{
				NI T19_;
				NI T20_;
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_103;
				if ((NU)(i) >= (NU)(bLen_0)){ raiseIndexError2(i,bLen_0-1); }
				if ((NU)(j) >= (NU)(aLen_0)){ raiseIndexError2(j,aLen_0-1); }
				T19_ = (NI)0;
				T19_ = cmp.ClE_0? cmp.ClP_0(b[i], a[j], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_102)(cmp.ClP_0))(b[i], a[j]);
				T20_ = (NI)0;
				T20_ = star___kgZDSIMT2vrZak9bMmeL40walgorithm(T19_, order);
				if (!(T20_ <= ((NI) 0))) goto LA21_;
				if ((NU)(k) >= (NU)(aLen_0)){ raiseIndexError2(k,aLen_0-1); }
				if ((NU)(i) >= (NU)(bLen_0)){ raiseIndexError2(i,bLen_0-1); }
				unsureAsgnRef((void**) (&a[k].keyword), b[i].keyword);
				unsureAsgnRef((void**) (&a[k].link), b[i].link);
				unsureAsgnRef((void**) (&a[k].linkTitle), b[i].linkTitle);
				unsureAsgnRef((void**) (&a[k].linkDesc), b[i].linkDesc);
				if (nimAddInt(i, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_103)) { raiseOverflow(); };
				i = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_103);
			}
			goto LA17_;
			LA21_: ;
			{
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_104;
				if ((NU)(k) >= (NU)(aLen_0)){ raiseIndexError2(k,aLen_0-1); }
				if ((NU)(j) >= (NU)(aLen_0)){ raiseIndexError2(j,aLen_0-1); }
				unsureAsgnRef((void**) (&a[k].keyword), a[j].keyword);
				unsureAsgnRef((void**) (&a[k].link), a[j].link);
				unsureAsgnRef((void**) (&a[k].linkTitle), a[j].linkTitle);
				unsureAsgnRef((void**) (&a[k].linkDesc), a[j].linkDesc);
				if (nimAddInt(j, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_104)) { raiseOverflow(); };
				j = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_104);
			}
			LA17_: ;
			if (nimAddInt(k, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_105)) { raiseOverflow(); };
			k = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_105);
		} LA14: ;
	}
	{
		while (1) {
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_106;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_107;
			if (!(k < j)) goto LA25;
			if ((NU)(k) >= (NU)(aLen_0)){ raiseIndexError2(k,aLen_0-1); }
			if ((NU)(i) >= (NU)(bLen_0)){ raiseIndexError2(i,bLen_0-1); }
			unsureAsgnRef((void**) (&a[k].keyword), b[i].keyword);
			unsureAsgnRef((void**) (&a[k].link), b[i].link);
			unsureAsgnRef((void**) (&a[k].linkTitle), b[i].linkTitle);
			unsureAsgnRef((void**) (&a[k].linkDesc), b[i].linkDesc);
			if (nimAddInt(k, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_106)) { raiseOverflow(); };
			k = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_106);
			if (nimAddInt(i, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_107)) { raiseOverflow(); };
			i = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_107);
		} LA25: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__7qlGu9cYbTdvZ8E8NMXzZyQ)(tyObject_IndexEntry__G9ccBDFWfr9aYnLgXTNGDHDg* a, NI aLen_0, tyProc__zzrK9cTwi9admDvOCMDMSIXQ cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI n;
	tySequence__5PunAJrNQYcB8dF0jau3pQ* b;
	NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_95;
	NI s;
	n = aLen_0;
	b = (tySequence__5PunAJrNQYcB8dF0jau3pQ*)0;
	if (((NI) 2) == 0){ raiseDivByZero(); }
	if (nimDivInt(n, ((NI) 2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_95)) { raiseOverflow(); };
	if (((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_95)) < ((NI) 0) || ((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_95)) > ((NI) 2147483647)){ raiseRangeErrorI((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_95), ((NI) 0), ((NI) 2147483647)); }
	b = (tySequence__5PunAJrNQYcB8dF0jau3pQ*) newSeq((&NTI__5PunAJrNQYcB8dF0jau3pQ_), ((NI) ((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_95))));
	s = ((NI) 1);
	{
		while (1) {
			NI m;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_96;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_97;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_113;
			if (!(s < n)) goto LA2;
			if (nimSubInt(n, ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_96)) { raiseOverflow(); };
			if (nimSubInt((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_96), s, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_97)) { raiseOverflow(); };
			m = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_97);
			{
				while (1) {
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_108;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_109;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_110;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_111;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_112;
					if (!(((NI) 0) <= m)) goto LA4;
					if (nimSubInt(m, s, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_108)) { raiseOverflow(); };
					if (nimAddInt((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_108), ((NI) 1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_109)) { raiseOverflow(); };
					if (nimAddInt(m, s, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_110)) { raiseOverflow(); };
					merge__8uGPISzqbd9ax9aI8lxSAOQA(a, aLen_0, b->data, (b ? b->Sup.len : 0), (((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_109) >= ((NI) 0)) ? (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_109) : ((NI) 0)), m, (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_110), cmp, order);
					if (nimMulInt(s, ((NI) 2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_111)) { raiseOverflow(); };
					if (nimSubInt(m, (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_111), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_112)) { raiseOverflow(); };
					m = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_112);
				} LA4: ;
			}
			if (nimMulInt(s, ((NI) 2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_113)) { raiseOverflow(); };
			s = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_113);
		} LA2: ;
	}
}
