/* Generated by Nim Compiler v1.6.10 */
#define NIM_INTBITS 32

#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 tySequence__76wc9cnTOK9c6epudv8uYE0w tySequence__76wc9cnTOK9c6epudv8uYE0w;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q;
typedef struct tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw;
typedef struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g;
typedef struct TNimType TNimType;
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__iu9bmisU8aqiB4COOWxW7Nw tySequence__iu9bmisU8aqiB4COOWxW7Nw;
typedef struct tyTuple__up9aEgTtu1yE7i0mPj8LDkA tyTuple__up9aEgTtu1yE7i0mPj8LDkA;
typedef struct tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ;
typedef struct NimStringDesc NimStringDesc;
typedef struct tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ;
typedef struct tySequence__i7xpiUsxyv6cQ1xK3JbcGQ tySequence__i7xpiUsxyv6cQ1xK3JbcGQ;
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ tySequence__sM4lkSb7zS6F7OVMvW9cffQ;
typedef struct tySequence__48JTohSgTy339bRxHzUD8KA tySequence__48JTohSgTy339bRxHzUD8KA;
typedef struct tySequence__9c1n3IOF5T6xvPNf6ipRnuQ tySequence__9c1n3IOF5T6xvPNf6ipRnuQ;
typedef struct tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA;
typedef struct tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ;
typedef struct tyTuple__msoRFpgv3EcbLwCh9arSpYw tyTuple__msoRFpgv3EcbLwCh9arSpYw;
typedef struct tySequence__59axsmyJq9bYh2MONDvuwAkA tySequence__59axsmyJq9bYh2MONDvuwAkA;
typedef struct TNimNode TNimNode;
typedef struct tySequence__MnKKQ5PGyDp4x1lUEG41Ag tySequence__MnKKQ5PGyDp4x1lUEG41Ag;
typedef struct tyObject_Item__H9bFFvU3st4d7H9cwvzvRVyw tyObject_Item__H9bFFvU3st4d7H9cwvzvRVyw;
typedef struct tySequence__Wm9aGag2treFuYnXRdy8u9bA tySequence__Wm9aGag2treFuYnXRdy8u9bA;
typedef struct tyObject_TocItem__jc5WxywzGPY8oy0aHNYXIg tyObject_TocItem__jc5WxywzGPY8oy0aHNYXIg;
typedef struct tySequence__EhfJ5cVWpPFG1tw09ap9co5g tySequence__EhfJ5cVWpPFG1tw09ap9co5g;
typedef struct tyObject_IndexEntry__fxsh1PMzYjb64GNihAaS4A tyObject_IndexEntry__fxsh1PMzYjb64GNihAaS4A;
typedef struct tySequence__CJOrWaM0fWekVRTE2AotGw tySequence__CJOrWaM0fWekVRTE2AotGw;
typedef struct tyObject_ItemFragment__1E61TU9aUfqHCQZV7JEfWuA tyObject_ItemFragment__1E61TU9aUfqHCQZV7JEfWuA;
typedef struct tyObject_RstNode__22EYjMYlm9cWcheQxrewdHQ tyObject_RstNode__22EYjMYlm9cWcheQxrewdHQ;
struct TGenericSeq {
NI len;
NI reserved;
};
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q* x, tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q* y, void* ClE_0);
void* ClE_0;
} tyProc__WrsL3l9cLQ31FpOtAGcGovA;
typedef NU8 tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA;
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__SPr7N6UKfuF549bNPiUvSRw[256];
typedef NU32 tyArray__BHbOSqU1t9b3Gt7K2c6fQig[24];
typedef tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* tyArray__N1u1nqOgmuJN9cSZrnMHgOQ[32];
typedef tyArray__N1u1nqOgmuJN9cSZrnMHgOQ tyArray__B6durA4ZCi1xjJvRtyYxMg[24];
typedef tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw* tyArray__lh2A89ahMmYg9bCmpVaplLbA[256];
struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA {
tyArray__lh2A89ahMmYg9bCmpVaplLbA data;
};
typedef tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* tyArray__0aOLqZchNi8nWtMTi8ND8w[2];
struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw {
tyArray__0aOLqZchNi8nWtMTi8ND8w link;
NI key;
NI upperBound;
NI level;
};
struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg {
tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* Field0;
NI Field1;
};
typedef tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyArray__LzOv2eCDGiceMKQstCLmhw[30];
struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg {
NI len;
tyArray__LzOv2eCDGiceMKQstCLmhw chunks;
tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg* next;
};
struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg {
NI minLargeObj;
NI maxLargeObj;
tyArray__SPr7N6UKfuF549bNPiUvSRw freeSmallChunks;
NU32 flBitmap;
tyArray__BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
tyArray__B6durA4ZCi1xjJvRtyYxMg matrix;
tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw* llmem;
NI currMem;
NI maxMem;
NI freeMem;
NI occ;
NI lastSize;
tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA chunkStarts;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* root;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* deleted;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* last;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* freeAvlNodes;
NIM_BOOL locked;
NIM_BOOL blockChunkSizeIncrease;
NI nextChunkSize;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw bottomData;
tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg heapLinks;
};
struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg {
NI stackScans;
NI cycleCollections;
NI maxThreshold;
NI maxStackSize;
NI maxStackCells;
NI cycleTableSize;
NI64 maxPause;
};
struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ {
NI counter;
NI max;
tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg* head;
tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg** data;
};
struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ {
tyObject_GcStack__7fytPA5bBsob6See21YMRA stack;
NI cycleThreshold;
NI zctThreshold;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w zct;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w decStack;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tempStack;
NI recGcLock;
tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg region;
tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg stat;
tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ marked;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w additionalRoots;
NI gcThreadId;
};
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_2) (tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q* x, tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_3) (tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q* x, tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q* y);
struct NimStringDesc {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct tyTuple__up9aEgTtu1yE7i0mPj8LDkA {
tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ* Field0;
NimStringDesc* Field1;
};
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (tyTuple__up9aEgTtu1yE7i0mPj8LDkA x, tyTuple__up9aEgTtu1yE7i0mPj8LDkA y, void* ClE_0);
void* ClE_0;
} tyProc__BcLglwgGyTIZx3eI8zW3GQ;
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_4) (tyTuple__up9aEgTtu1yE7i0mPj8LDkA x, tyTuple__up9aEgTtu1yE7i0mPj8LDkA y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_5) (tyTuple__up9aEgTtu1yE7i0mPj8LDkA x, tyTuple__up9aEgTtu1yE7i0mPj8LDkA y);
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ* x, tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ* y, void* ClE_0);
void* ClE_0;
} tyProc__pNH4eLNN9aK2oskAhILvUcw;
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_6) (tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ* x, tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ* y);
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_7) (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__3pmh9bG9bLpdxUjFu9cDtbZaA;
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_8) (NimStringDesc* x, NimStringDesc* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_9) (NimStringDesc* x, NimStringDesc* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_10) (NimStringDesc* x, NimStringDesc* y, void* ClE_0);
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (NI32 x, NI32 y, void* ClE_0);
void* ClE_0;
} tyProc__CBoNLvw7Pjo72NRN8hQDEA;
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_11) (NI32 x, NI32 y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_12) (NI32 x, NI32 y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_13) (NI32 x, NI32 y, void* ClE_0);
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA* x, tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA* y, void* ClE_0);
void* ClE_0;
} tyProc__9apb8PBM2ucUBIVhn3CRrdg;
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_14) (tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA* x, tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_15) (tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA* x, tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_16) (NimStringDesc* x, NimStringDesc* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_17) (NimStringDesc* x, NimStringDesc* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_18) (NimStringDesc* x, NimStringDesc* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_19) (NimStringDesc* x, NimStringDesc* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_20) (NimStringDesc* x, NimStringDesc* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_21) (NimStringDesc* x, NimStringDesc* y, void* ClE_0);
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (tyTuple__msoRFpgv3EcbLwCh9arSpYw x, tyTuple__msoRFpgv3EcbLwCh9arSpYw y, void* ClE_0);
void* ClE_0;
} tyProc__gB5GcYGEl9c9bdmXRILxVndQ;
typedef NU8 tyEnum_FootnoteType__ZCau9bAoJ0KvZYqUKBf6DQA;
struct tyTuple__msoRFpgv3EcbLwCh9arSpYw {
tyEnum_FootnoteType__ZCau9bAoJ0KvZYqUKBf6DQA Field0;
NI Field1;
NI Field2;
NI Field3;
NimStringDesc* Field4;
};
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_22) (tyTuple__msoRFpgv3EcbLwCh9arSpYw x, tyTuple__msoRFpgv3EcbLwCh9arSpYw y);
typedef NU8 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A;
typedef NU8 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ;
typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
struct TNimType {
NI size;
NI align;
tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
TNimType* base;
TNimNode* node;
void* finalizer;
tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
struct TNimNode {
tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_23) (tyTuple__msoRFpgv3EcbLwCh9arSpYw x, tyTuple__msoRFpgv3EcbLwCh9arSpYw y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_24) (tyTuple__msoRFpgv3EcbLwCh9arSpYw x, tyTuple__msoRFpgv3EcbLwCh9arSpYw y, void* ClE_0);
struct tyObject_Item__H9bFFvU3st4d7H9cwvzvRVyw {
tySequence__Wm9aGag2treFuYnXRdy8u9bA* descRst;
tySequence__sM4lkSb7zS6F7OVMvW9cffQ* substitutions;
NimStringDesc* sortName;
};
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (tyObject_Item__H9bFFvU3st4d7H9cwvzvRVyw x, tyObject_Item__H9bFFvU3st4d7H9cwvzvRVyw y, void* ClE_0);
void* ClE_0;
} tyProc__2NUTrG5LP9b86R9b8Iu9a2aRQ;
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_25) (tyObject_Item__H9bFFvU3st4d7H9cwvzvRVyw x, tyObject_Item__H9bFFvU3st4d7H9cwvzvRVyw y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_26) (tyObject_Item__H9bFFvU3st4d7H9cwvzvRVyw x, tyObject_Item__H9bFFvU3st4d7H9cwvzvRVyw y);
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (tyObject_TocItem__jc5WxywzGPY8oy0aHNYXIg x, tyObject_TocItem__jc5WxywzGPY8oy0aHNYXIg y, void* ClE_0);
void* ClE_0;
} tyProc__2bxOhi2UzEVnSIccjRvxEA;
struct tyObject_TocItem__jc5WxywzGPY8oy0aHNYXIg {
NimStringDesc* content;
NimStringDesc* sortName;
};
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_27) (tyObject_TocItem__jc5WxywzGPY8oy0aHNYXIg x, tyObject_TocItem__jc5WxywzGPY8oy0aHNYXIg y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_28) (tyObject_TocItem__jc5WxywzGPY8oy0aHNYXIg x, tyObject_TocItem__jc5WxywzGPY8oy0aHNYXIg y);
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (tyObject_IndexEntry__fxsh1PMzYjb64GNihAaS4A x, tyObject_IndexEntry__fxsh1PMzYjb64GNihAaS4A y, void* ClE_0);
void* ClE_0;
} tyProc__dyWamSxQI9aSIOZWO07sqOA;
struct tyObject_IndexEntry__fxsh1PMzYjb64GNihAaS4A {
NimStringDesc* keyword;
NimStringDesc* link;
NimStringDesc* linkTitle;
NimStringDesc* linkDesc;
};
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_29) (tyObject_IndexEntry__fxsh1PMzYjb64GNihAaS4A x, tyObject_IndexEntry__fxsh1PMzYjb64GNihAaS4A y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_30) (tyObject_IndexEntry__fxsh1PMzYjb64GNihAaS4A x, tyObject_IndexEntry__fxsh1PMzYjb64GNihAaS4A y);
struct tyObject_ItemFragment__1E61TU9aUfqHCQZV7JEfWuA {
NIM_BOOL isRst;
union{
struct {tyObject_RstNode__22EYjMYlm9cWcheQxrewdHQ* rst;
} _isRst_1;
struct {NimStringDesc* str;
} _isRst_2;
};
};
struct tySequence__76wc9cnTOK9c6epudv8uYE0w {
  TGenericSeq Sup;
  tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q* data[SEQ_DECL_SIZE];
};
struct tySequence__iu9bmisU8aqiB4COOWxW7Nw {
  TGenericSeq Sup;
  tyTuple__up9aEgTtu1yE7i0mPj8LDkA data[SEQ_DECL_SIZE];
};
struct tySequence__i7xpiUsxyv6cQ1xK3JbcGQ {
  TGenericSeq Sup;
  tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ* data[SEQ_DECL_SIZE];
};
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct tySequence__48JTohSgTy339bRxHzUD8KA {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct tySequence__9c1n3IOF5T6xvPNf6ipRnuQ {
  TGenericSeq Sup;
  tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA* data[SEQ_DECL_SIZE];
};
struct tySequence__59axsmyJq9bYh2MONDvuwAkA {
  TGenericSeq Sup;
  tyTuple__msoRFpgv3EcbLwCh9arSpYw data[SEQ_DECL_SIZE];
};
struct tySequence__MnKKQ5PGyDp4x1lUEG41Ag {
  TGenericSeq Sup;
  tyObject_Item__H9bFFvU3st4d7H9cwvzvRVyw data[SEQ_DECL_SIZE];
};
struct tySequence__EhfJ5cVWpPFG1tw09ap9co5g {
  TGenericSeq Sup;
  tyObject_TocItem__jc5WxywzGPY8oy0aHNYXIg data[SEQ_DECL_SIZE];
};
struct tySequence__CJOrWaM0fWekVRTE2AotGw {
  TGenericSeq Sup;
  tyObject_IndexEntry__fxsh1PMzYjb64GNihAaS4A data[SEQ_DECL_SIZE];
};
struct tySequence__Wm9aGag2treFuYnXRdy8u9bA {
  TGenericSeq Sup;
  tyObject_ItemFragment__1E61TU9aUfqHCQZV7JEfWuA data[SEQ_DECL_SIZE];
};
N_LIB_PRIVATE N_NIMCALL(tySequence__76wc9cnTOK9c6epudv8uYE0w*, newSeq__reorder_469)(NI len);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incRef__system_5308)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(NI, pluspercent___system_696)(NI x, NI y);
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__system_5270)(void* usr);
static N_INLINE(NI, minuspercent___system_716)(NI x, NI y);
static N_INLINE(void, decRef__system_5315)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(NIM_BOOL, ltpercent___system_1005)(NI x, NI y);
static N_INLINE(void, rtlAddZCT__system_5313)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_PRIVATE N_NOINLINE(void, addZCT__system_5264)(tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w* s, tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_PRIVATE N_NIMCALL(void, sort__reorder_485)(tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q** a, NI aLen_0, tyProc__WrsL3l9cLQ31FpOtAGcGovA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__reorder_502)(tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q** a, NI aLen_0, tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__WrsL3l9cLQ31FpOtAGcGovA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
static N_INLINE(NI, star___pureZalgorithm_8)(NI x, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_LIB_PRIVATE N_NIMCALL(tySequence__iu9bmisU8aqiB4COOWxW7Nw*, newSeq__lookups_681)(NI len);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
N_LIB_PRIVATE N_NIMCALL(void, sort__lookups_706)(tyTuple__up9aEgTtu1yE7i0mPj8LDkA* a, NI aLen_0, tyProc__BcLglwgGyTIZx3eI8zW3GQ cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__lookups_723)(tyTuple__up9aEgTtu1yE7i0mPj8LDkA* a, NI aLen_0, tyTuple__up9aEgTtu1yE7i0mPj8LDkA* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__BcLglwgGyTIZx3eI8zW3GQ cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(tySequence__i7xpiUsxyv6cQ1xK3JbcGQ*, newSeq__sigmatch_4783)(NI len);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__sigmatch_4794)(tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ** a, NI aLen_0, tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__pNH4eLNN9aK2oskAhILvUcw cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(void, sort__sem_1803)(NimStringDesc** a, NI aLen_0, tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ*, newSeq__systemZio_503)(NI len);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__sem_1820)(NimStringDesc** a, NI aLen_0, NimStringDesc** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(NI, cmp__sem_1796)(NimStringDesc* x, NimStringDesc* y);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
N_LIB_PRIVATE N_NIMCALL(void, sort__icZcbackend_243)(NI32* a, NI aLen_0, tyProc__CBoNLvw7Pjo72NRN8hQDEA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(tySequence__48JTohSgTy339bRxHzUD8KA*, newSeq__icZic_3552)(NI len);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__icZcbackend_261)(NI32* a, NI aLen_0, NI32* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__CBoNLvw7Pjo72NRN8hQDEA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(NI, cmp__int495056_283)(NI32 x, NI32 y);
N_LIB_PRIVATE N_NIMCALL(tySequence__9c1n3IOF5T6xvPNf6ipRnuQ*, newSeq__sourcemap_618)(NI len);
N_LIB_PRIVATE N_NIMCALL(void, sort__sourcemap_634)(tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA** a, NI aLen_0, tyProc__9apb8PBM2ucUBIVhn3CRrdg cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__sourcemap_651)(tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA** a, NI aLen_0, tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__9apb8PBM2ucUBIVhn3CRrdg cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(NI, binarySearch__packagesZdocutilsZhighlite_324)(NimStringDesc** a, NI aLen_0, NimStringDesc* key, tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA cmp);
N_LIB_PRIVATE N_NIMCALL(void, sort__packagesZdocutilsZrst_2675)(tyTuple__msoRFpgv3EcbLwCh9arSpYw* a, NI aLen_0, tyProc__gB5GcYGEl9c9bdmXRILxVndQ cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(tySequence__59axsmyJq9bYh2MONDvuwAkA*, newSeq__packagesZdocutilsZrst_2687)(NI len);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__packagesZdocutilsZrst_2698)(tyTuple__msoRFpgv3EcbLwCh9arSpYw* a, NI aLen_0, tyTuple__msoRFpgv3EcbLwCh9arSpYw* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__gB5GcYGEl9c9bdmXRILxVndQ cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(void, genericShallowAssign)(void* dest, void* src, TNimType* mt);
N_LIB_PRIVATE N_NIMCALL(NI, cmp__packagesZdocutilsZrst_2614)(tyTuple__msoRFpgv3EcbLwCh9arSpYw x, tyTuple__msoRFpgv3EcbLwCh9arSpYw y);
N_LIB_PRIVATE N_NIMCALL(tySequence__MnKKQ5PGyDp4x1lUEG41Ag*, newSeq__docgen_5543)(NI len);
N_LIB_PRIVATE N_NIMCALL(void, genericSeqAssign)(void* dest, void* src, TNimType* mt);
N_LIB_PRIVATE N_NIMCALL(void, sort__docgen_5568)(tyObject_Item__H9bFFvU3st4d7H9cwvzvRVyw* a, NI aLen_0, tyProc__2NUTrG5LP9b86R9b8Iu9a2aRQ cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__docgen_5585)(tyObject_Item__H9bFFvU3st4d7H9cwvzvRVyw* a, NI aLen_0, tyObject_Item__H9bFFvU3st4d7H9cwvzvRVyw* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__2NUTrG5LP9b86R9b8Iu9a2aRQ cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(tySequence__EhfJ5cVWpPFG1tw09ap9co5g*, newSeq__docgen_3556)(NI len);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__docgen_6909)(tyObject_TocItem__jc5WxywzGPY8oy0aHNYXIg* a, NI aLen_0, tyObject_TocItem__jc5WxywzGPY8oy0aHNYXIg* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__2bxOhi2UzEVnSIccjRvxEA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(void, sort__docgen_6891)(tyObject_TocItem__jc5WxywzGPY8oy0aHNYXIg* a, NI aLen_0, tyProc__2bxOhi2UzEVnSIccjRvxEA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
N_LIB_PRIVATE N_NIMCALL(tySequence__CJOrWaM0fWekVRTE2AotGw*, newSeq__packagesZdocutilsZrstgen_6119)(NI len);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__packagesZdocutilsZrstgen_6130)(tyObject_IndexEntry__fxsh1PMzYjb64GNihAaS4A* a, NI aLen_0, tyObject_IndexEntry__fxsh1PMzYjb64GNihAaS4A* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__dyWamSxQI9aSIOZWO07sqOA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order);
extern TNimType NTIfootnotesubst__msoRFpgv3EcbLwCh9arSpYw_;
extern TNimType NTIitempre__Wm9aGag2treFuYnXRdy8u9bA_;
extern TNimType NTIseqLstringT__sM4lkSb7zS6F7OVMvW9cffQ_;
extern tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ gch__system_5217;
N_LIB_PRIVATE N_NIMCALL(void, fill__pureZstrutils_1405)(NI* a, NI aLen_0, NI value) {
	NI xX60gensym164_;
	xX60gensym164_ = ((NI) 0);
	{
		while (1) {
			if (!(xX60gensym164_ <= (aLen_0-1))) goto LA2;
			a[xX60gensym164_] = value;
			xX60gensym164_ += ((NI) 1);
		} LA2: ;
	}
}
static N_INLINE(NI, pluspercent___system_696)(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__system_5308)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
	(*c).refcount = pluspercent___system_696((*c).refcount, ((NI) 8));
}
static N_INLINE(NI, minuspercent___system_716)(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__system_5270)(void* usr) {
	tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* result;
	NI T1_;
	result = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
	T1_ = (NI)0;
	T1_ = minuspercent___system_716(((NI) (ptrdiff_t) (usr)), ((NI) 8));
	result = ((tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*) (T1_));
	return result;
}
static N_INLINE(NIM_BOOL, ltpercent___system_1005)(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__system_5313)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
	addZCT__system_5264((&gch__system_5217.zct), c);
}
static N_INLINE(void, decRef__system_5315)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
	(*c).refcount = minuspercent___system_716((*c).refcount, ((NI) 8));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = ltpercent___system_1005((*c).refcount, ((NI) 8));
		if (!T3_) goto LA4_;
		rtlAddZCT__system_5313(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__system_5270(src);
		incRef__system_5308(T5_);
	}
	LA3_: ;
	{
		tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T10_;
		if (!!(((*dest) == NIM_NIL))) goto LA8_;
		T10_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
		T10_ = usrToCell__system_5270((*dest));
		decRef__system_5315(T10_);
	}
	LA8_: ;
	(*dest) = src;
}
static N_INLINE(NI, star___pureZalgorithm_8)(NI x, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI result;
	NI y;
	result = (NI)0;
	y = (NI)(order - ((NI) 1));
	result = (NI)((NI)(x ^ y) - y);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__reorder_502)(tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q** a, NI aLen_0, tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__WrsL3l9cLQ31FpOtAGcGovA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI j;
	NI bb;
	NI i;
	NI k;
{	{
		NI T3_;
		NI T4_;
		T3_ = (NI)0;
		T3_ = cmp.ClE_0? cmp.ClP_0(a[m], a[(NI)(m + ((NI) 1))], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_2)(cmp.ClP_0))(a[m], a[(NI)(m + ((NI) 1))]);
		T4_ = (NI)0;
		T4_ = star___pureZalgorithm_8(T3_, order);
		if (!(T4_ <= ((NI) 0))) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	j = lo;
	bb = ((NI) 0);
	{
		while (1) {
			if (!(j <= m)) goto LA8;
			unsureAsgnRef((void**) (&b[bb]), a[j]);
			bb += ((NI) 1);
			j += ((NI) 1);
		} LA8: ;
	}
	i = ((NI) 0);
	k = lo;
	{
		while (1) {
			NIM_BOOL T11_;
			T11_ = (NIM_BOOL)0;
			T11_ = (k < j);
			if (!(T11_)) goto LA12_;
			T11_ = (j <= hi);
			LA12_: ;
			if (!T11_) goto LA10;
			{
				NI T15_;
				NI T16_;
				T15_ = (NI)0;
				T15_ = cmp.ClE_0? cmp.ClP_0(b[i], a[j], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_3)(cmp.ClP_0))(b[i], a[j]);
				T16_ = (NI)0;
				T16_ = star___pureZalgorithm_8(T15_, order);
				if (!(T16_ <= ((NI) 0))) goto LA17_;
				unsureAsgnRef((void**) (&a[k]), b[i]);
				i += ((NI) 1);
			}
			goto LA13_;
			LA17_: ;
			{
				unsureAsgnRef((void**) (&a[k]), a[j]);
				j += ((NI) 1);
			}
			LA13_: ;
			k += ((NI) 1);
		} LA10: ;
	}
	{
		while (1) {
			if (!(k < j)) goto LA21;
			unsureAsgnRef((void**) (&a[k]), b[i]);
			k += ((NI) 1);
			i += ((NI) 1);
		} LA21: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__reorder_485)(tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q** a, NI aLen_0, tyProc__WrsL3l9cLQ31FpOtAGcGovA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI n;
	tySequence__76wc9cnTOK9c6epudv8uYE0w* b;
	NI s;
	n = aLen_0;
	b = newSeq__reorder_469(((NI) ((NI)(n / ((NI) 2)))));
	s = ((NI) 1);
	{
		while (1) {
			NI m;
			if (!(s < n)) goto LA2;
			m = (NI)((NI)(n - ((NI) 1)) - s);
			{
				while (1) {
					if (!(((NI) 0) <= m)) goto LA4;
					mergeAlt__reorder_502(a, aLen_0, (b) ? (b->data) : NIM_NIL, (b ? b->Sup.len : 0), (((NI)((NI)(m - s) + ((NI) 1)) >= ((NI) 0)) ? (NI)((NI)(m - s) + ((NI) 1)) : ((NI) 0)), m, (NI)(m + s), cmp, order);
					m -= (NI)(s * ((NI) 2));
				} LA4: ;
			}
			s = (NI)(s * ((NI) 2));
		} LA2: ;
	}
}
N_LIB_PRIVATE N_NIMCALL(tySequence__76wc9cnTOK9c6epudv8uYE0w*, sorted__reorder_457)(tyObject_DepNcolonObjectType___eVONEEaK4II8kv8La51d2Q** a, NI aLen_0, tyProc__WrsL3l9cLQ31FpOtAGcGovA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	tySequence__76wc9cnTOK9c6epudv8uYE0w* result;
	result = NIM_NIL;
	result = newSeq__reorder_469(((NI) (aLen_0)));
	{
		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 LA3;
				i = res;
				asgnRef((void**) (&result->data[i]), a[i]);
				res += ((NI) 1);
			} LA3: ;
		}
	}
	sort__reorder_485((result) ? (result->data) : NIM_NIL, (result ? result->Sup.len : 0), cmp, order);
	return result;
}
static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
	tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T1_;
	T1_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
	T1_ = usrToCell__system_5270(p);
	decRef__system_5315(T1_);
}
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__lookups_723)(tyTuple__up9aEgTtu1yE7i0mPj8LDkA* a, NI aLen_0, tyTuple__up9aEgTtu1yE7i0mPj8LDkA* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__BcLglwgGyTIZx3eI8zW3GQ cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI j;
	NI bb;
	NI i;
	NI k;
{	{
		NI T3_;
		NI T4_;
		T3_ = (NI)0;
		T3_ = cmp.ClE_0? cmp.ClP_0(a[m], a[(NI)(m + ((NI) 1))], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_4)(cmp.ClP_0))(a[m], a[(NI)(m + ((NI) 1))]);
		T4_ = (NI)0;
		T4_ = star___pureZalgorithm_8(T3_, order);
		if (!(T4_ <= ((NI) 0))) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	j = lo;
	bb = ((NI) 0);
	{
		while (1) {
			if (!(j <= m)) goto LA8;
			unsureAsgnRef((void**) (&b[bb].Field0), a[j].Field0);
			unsureAsgnRef((void**) (&b[bb].Field1), a[j].Field1);
			bb += ((NI) 1);
			j += ((NI) 1);
		} LA8: ;
	}
	i = ((NI) 0);
	k = lo;
	{
		while (1) {
			NIM_BOOL T11_;
			T11_ = (NIM_BOOL)0;
			T11_ = (k < j);
			if (!(T11_)) goto LA12_;
			T11_ = (j <= hi);
			LA12_: ;
			if (!T11_) goto LA10;
			{
				NI T15_;
				NI T16_;
				T15_ = (NI)0;
				T15_ = cmp.ClE_0? cmp.ClP_0(b[i], a[j], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_5)(cmp.ClP_0))(b[i], a[j]);
				T16_ = (NI)0;
				T16_ = star___pureZalgorithm_8(T15_, order);
				if (!(T16_ <= ((NI) 0))) goto LA17_;
				unsureAsgnRef((void**) (&a[k].Field0), b[i].Field0);
				unsureAsgnRef((void**) (&a[k].Field1), b[i].Field1);
				i += ((NI) 1);
			}
			goto LA13_;
			LA17_: ;
			{
				unsureAsgnRef((void**) (&a[k].Field0), a[j].Field0);
				unsureAsgnRef((void**) (&a[k].Field1), a[j].Field1);
				j += ((NI) 1);
			}
			LA13_: ;
			k += ((NI) 1);
		} LA10: ;
	}
	{
		while (1) {
			if (!(k < j)) goto LA21;
			unsureAsgnRef((void**) (&a[k].Field0), b[i].Field0);
			unsureAsgnRef((void**) (&a[k].Field1), b[i].Field1);
			k += ((NI) 1);
			i += ((NI) 1);
		} LA21: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__lookups_706)(tyTuple__up9aEgTtu1yE7i0mPj8LDkA* a, NI aLen_0, tyProc__BcLglwgGyTIZx3eI8zW3GQ cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI n;
	tySequence__iu9bmisU8aqiB4COOWxW7Nw* b;
	NI s;
	n = aLen_0;
	b = newSeq__lookups_681(((NI) ((NI)(n / ((NI) 2)))));
	s = ((NI) 1);
	{
		while (1) {
			NI m;
			if (!(s < n)) goto LA2;
			m = (NI)((NI)(n - ((NI) 1)) - s);
			{
				while (1) {
					if (!(((NI) 0) <= m)) goto LA4;
					mergeAlt__lookups_723(a, aLen_0, (b) ? (b->data) : NIM_NIL, (b ? b->Sup.len : 0), (((NI)((NI)(m - s) + ((NI) 1)) >= ((NI) 0)) ? (NI)((NI)(m - s) + ((NI) 1)) : ((NI) 0)), m, (NI)(m + s), cmp, order);
					m -= (NI)(s * ((NI) 2));
				} LA4: ;
			}
			s = (NI)(s * ((NI) 2));
		} LA2: ;
	}
}
N_LIB_PRIVATE N_NIMCALL(tySequence__iu9bmisU8aqiB4COOWxW7Nw*, sorted__lookups_669)(tyTuple__up9aEgTtu1yE7i0mPj8LDkA* a, NI aLen_0, tyProc__BcLglwgGyTIZx3eI8zW3GQ cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	tySequence__iu9bmisU8aqiB4COOWxW7Nw* result;
	result = NIM_NIL;
	result = newSeq__lookups_681(((NI) (aLen_0)));
	{
		NI i;
		NI colontmp_;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (aLen_0-1);
		res = ((NI) 0);
		{
			while (1) {
				NimStringDesc* T4_;
				if (!(res <= colontmp_)) goto LA3;
				i = res;
				asgnRef((void**) (&result->data[i].Field0), a[i].Field0);
				T4_ = NIM_NIL;
				T4_ = result->data[i].Field1; result->data[i].Field1 = copyStringRC1(a[i].Field1);
				if (T4_) nimGCunrefNoCycle(T4_);
				res += ((NI) 1);
			} LA3: ;
		}
	}
	sort__lookups_706((result) ? (result->data) : NIM_NIL, (result ? result->Sup.len : 0), cmp, order);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__sigmatch_4794)(tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ** a, NI aLen_0, tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__pNH4eLNN9aK2oskAhILvUcw cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI j;
	NI bb;
	NI i;
	NI k;
{	{
		NI T3_;
		NI T4_;
		T3_ = (NI)0;
		T3_ = cmp.ClE_0? cmp.ClP_0(a[m], a[(NI)(m + ((NI) 1))], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_6)(cmp.ClP_0))(a[m], a[(NI)(m + ((NI) 1))]);
		T4_ = (NI)0;
		T4_ = star___pureZalgorithm_8(T3_, order);
		if (!(T4_ <= ((NI) 0))) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	j = lo;
	bb = ((NI) 0);
	{
		while (1) {
			if (!(j <= m)) goto LA8;
			unsureAsgnRef((void**) (&b[bb]), a[j]);
			bb += ((NI) 1);
			j += ((NI) 1);
		} LA8: ;
	}
	i = ((NI) 0);
	k = lo;
	{
		while (1) {
			NIM_BOOL T11_;
			T11_ = (NIM_BOOL)0;
			T11_ = (k < j);
			if (!(T11_)) goto LA12_;
			T11_ = (j <= hi);
			LA12_: ;
			if (!T11_) goto LA10;
			{
				NI T15_;
				NI T16_;
				T15_ = (NI)0;
				T15_ = cmp.ClE_0? cmp.ClP_0(b[i], a[j], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_7)(cmp.ClP_0))(b[i], a[j]);
				T16_ = (NI)0;
				T16_ = star___pureZalgorithm_8(T15_, order);
				if (!(T16_ <= ((NI) 0))) goto LA17_;
				unsureAsgnRef((void**) (&a[k]), b[i]);
				i += ((NI) 1);
			}
			goto LA13_;
			LA17_: ;
			{
				unsureAsgnRef((void**) (&a[k]), a[j]);
				j += ((NI) 1);
			}
			LA13_: ;
			k += ((NI) 1);
		} LA10: ;
	}
	{
		while (1) {
			if (!(k < j)) goto LA21;
			unsureAsgnRef((void**) (&a[k]), b[i]);
			k += ((NI) 1);
			i += ((NI) 1);
		} LA21: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__sigmatch_4771)(tyObject_SuggestcolonObjectType___bkMuTTb2G70XfpzAiyNrnQ** a, NI aLen_0, tyProc__pNH4eLNN9aK2oskAhILvUcw cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI n;
	tySequence__i7xpiUsxyv6cQ1xK3JbcGQ* b;
	NI s;
	n = aLen_0;
	b = newSeq__sigmatch_4783(((NI) ((NI)(n / ((NI) 2)))));
	s = ((NI) 1);
	{
		while (1) {
			NI m;
			if (!(s < n)) goto LA2;
			m = (NI)((NI)(n - ((NI) 1)) - s);
			{
				while (1) {
					if (!(((NI) 0) <= m)) goto LA4;
					mergeAlt__sigmatch_4794(a, aLen_0, (b) ? (b->data) : NIM_NIL, (b ? b->Sup.len : 0), (((NI)((NI)(m - s) + ((NI) 1)) >= ((NI) 0)) ? (NI)((NI)(m - s) + ((NI) 1)) : ((NI) 0)), m, (NI)(m + s), cmp, order);
					m -= (NI)(s * ((NI) 2));
				} LA4: ;
			}
			s = (NI)(s * ((NI) 2));
		} LA2: ;
	}
}
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__sem_1820)(NimStringDesc** a, NI aLen_0, NimStringDesc** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI j;
	NI bb;
	NI i;
	NI k;
{	{
		NI T3_;
		NI T4_;
		T3_ = (NI)0;
		T3_ = cmp.ClE_0? cmp.ClP_0(a[m], a[(NI)(m + ((NI) 1))], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_8)(cmp.ClP_0))(a[m], a[(NI)(m + ((NI) 1))]);
		T4_ = (NI)0;
		T4_ = star___pureZalgorithm_8(T3_, order);
		if (!(T4_ <= ((NI) 0))) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	j = lo;
	bb = ((NI) 0);
	{
		while (1) {
			if (!(j <= m)) goto LA8;
			unsureAsgnRef((void**) (&b[bb]), a[j]);
			bb += ((NI) 1);
			j += ((NI) 1);
		} LA8: ;
	}
	i = ((NI) 0);
	k = lo;
	{
		while (1) {
			NIM_BOOL T11_;
			T11_ = (NIM_BOOL)0;
			T11_ = (k < j);
			if (!(T11_)) goto LA12_;
			T11_ = (j <= hi);
			LA12_: ;
			if (!T11_) goto LA10;
			{
				NI T15_;
				NI T16_;
				T15_ = (NI)0;
				T15_ = cmp.ClE_0? cmp.ClP_0(b[i], a[j], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_9)(cmp.ClP_0))(b[i], a[j]);
				T16_ = (NI)0;
				T16_ = star___pureZalgorithm_8(T15_, order);
				if (!(T16_ <= ((NI) 0))) goto LA17_;
				unsureAsgnRef((void**) (&a[k]), b[i]);
				i += ((NI) 1);
			}
			goto LA13_;
			LA17_: ;
			{
				unsureAsgnRef((void**) (&a[k]), a[j]);
				j += ((NI) 1);
			}
			LA13_: ;
			k += ((NI) 1);
		} LA10: ;
	}
	{
		while (1) {
			if (!(k < j)) goto LA21;
			unsureAsgnRef((void**) (&a[k]), b[i]);
			k += ((NI) 1);
			i += ((NI) 1);
		} LA21: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__sem_1803)(NimStringDesc** a, NI aLen_0, tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI n;
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ* b;
	NI s;
	n = aLen_0;
	b = newSeq__systemZio_503(((NI) ((NI)(n / ((NI) 2)))));
	s = ((NI) 1);
	{
		while (1) {
			NI m;
			if (!(s < n)) goto LA2;
			m = (NI)((NI)(n - ((NI) 1)) - s);
			{
				while (1) {
					if (!(((NI) 0) <= m)) goto LA4;
					mergeAlt__sem_1820(a, aLen_0, (b) ? (b->data) : NIM_NIL, (b ? b->Sup.len : 0), (((NI)((NI)(m - s) + ((NI) 1)) >= ((NI) 0)) ? (NI)((NI)(m - s) + ((NI) 1)) : ((NI) 0)), m, (NI)(m + s), cmp, order);
					m -= (NI)(s * ((NI) 2));
				} LA4: ;
			}
			s = (NI)(s * ((NI) 2));
		} LA2: ;
	}
}
static N_INLINE(void, nimSetMem__systemZmemory_7)(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__systemZmemory_7(p, ((int) 0), size);
}
N_LIB_PRIVATE N_NIMCALL(void, sort__sem_1792)(NimStringDesc** a, NI aLen_0, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA T1_;
	nimZeroMem((void*)(&T1_), sizeof(tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA));
	T1_.ClP_0 = ((TM__JdC9c6SaUkvO1XjYuWP1JWQ_10) (cmp__sem_1796)); T1_.ClE_0 = NIM_NIL;
	sort__sem_1803(a, aLen_0, T1_, order);
}
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__icZcbackend_261)(NI32* a, NI aLen_0, NI32* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__CBoNLvw7Pjo72NRN8hQDEA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI j;
	NI bb;
	NI i;
	NI k;
{	{
		NI T3_;
		NI T4_;
		T3_ = (NI)0;
		T3_ = cmp.ClE_0? cmp.ClP_0(a[m], a[(NI)(m + ((NI) 1))], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_11)(cmp.ClP_0))(a[m], a[(NI)(m + ((NI) 1))]);
		T4_ = (NI)0;
		T4_ = star___pureZalgorithm_8(T3_, order);
		if (!(T4_ <= ((NI) 0))) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	j = lo;
	bb = ((NI) 0);
	{
		while (1) {
			if (!(j <= m)) goto LA8;
			b[bb] = a[j];
			bb += ((NI) 1);
			j += ((NI) 1);
		} LA8: ;
	}
	i = ((NI) 0);
	k = lo;
	{
		while (1) {
			NIM_BOOL T11_;
			T11_ = (NIM_BOOL)0;
			T11_ = (k < j);
			if (!(T11_)) goto LA12_;
			T11_ = (j <= hi);
			LA12_: ;
			if (!T11_) goto LA10;
			{
				NI T15_;
				NI T16_;
				T15_ = (NI)0;
				T15_ = cmp.ClE_0? cmp.ClP_0(b[i], a[j], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_12)(cmp.ClP_0))(b[i], a[j]);
				T16_ = (NI)0;
				T16_ = star___pureZalgorithm_8(T15_, order);
				if (!(T16_ <= ((NI) 0))) goto LA17_;
				a[k] = b[i];
				i += ((NI) 1);
			}
			goto LA13_;
			LA17_: ;
			{
				a[k] = a[j];
				j += ((NI) 1);
			}
			LA13_: ;
			k += ((NI) 1);
		} LA10: ;
	}
	{
		while (1) {
			if (!(k < j)) goto LA21;
			a[k] = b[i];
			k += ((NI) 1);
			i += ((NI) 1);
		} LA21: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__icZcbackend_243)(NI32* a, NI aLen_0, tyProc__CBoNLvw7Pjo72NRN8hQDEA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI n;
	tySequence__48JTohSgTy339bRxHzUD8KA* b;
	NI s;
	n = aLen_0;
	b = newSeq__icZic_3552(((NI) ((NI)(n / ((NI) 2)))));
	s = ((NI) 1);
	{
		while (1) {
			NI m;
			if (!(s < n)) goto LA2;
			m = (NI)((NI)(n - ((NI) 1)) - s);
			{
				while (1) {
					if (!(((NI) 0) <= m)) goto LA4;
					mergeAlt__icZcbackend_261(a, aLen_0, (b) ? (b->data) : NIM_NIL, (b ? b->Sup.len : 0), (((NI)((NI)(m - s) + ((NI) 1)) >= ((NI) 0)) ? (NI)((NI)(m - s) + ((NI) 1)) : ((NI) 0)), m, (NI)(m + s), cmp, order);
					m -= (NI)(s * ((NI) 2));
				} LA4: ;
			}
			s = (NI)(s * ((NI) 2));
		} LA2: ;
	}
}
N_LIB_PRIVATE N_NIMCALL(void, sort__icZcbackend_233)(NI32* a, NI aLen_0, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	tyProc__CBoNLvw7Pjo72NRN8hQDEA T1_;
	nimZeroMem((void*)(&T1_), sizeof(tyProc__CBoNLvw7Pjo72NRN8hQDEA));
	T1_.ClP_0 = ((TM__JdC9c6SaUkvO1XjYuWP1JWQ_13) (cmp__int495056_283)); T1_.ClE_0 = NIM_NIL;
	sort__icZcbackend_243(a, aLen_0, T1_, order);
}
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__sourcemap_651)(tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA** a, NI aLen_0, tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__9apb8PBM2ucUBIVhn3CRrdg cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI j;
	NI bb;
	NI i;
	NI k;
{	{
		NI T3_;
		NI T4_;
		T3_ = (NI)0;
		T3_ = cmp.ClE_0? cmp.ClP_0(a[m], a[(NI)(m + ((NI) 1))], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_14)(cmp.ClP_0))(a[m], a[(NI)(m + ((NI) 1))]);
		T4_ = (NI)0;
		T4_ = star___pureZalgorithm_8(T3_, order);
		if (!(T4_ <= ((NI) 0))) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	j = lo;
	bb = ((NI) 0);
	{
		while (1) {
			if (!(j <= m)) goto LA8;
			unsureAsgnRef((void**) (&b[bb]), a[j]);
			bb += ((NI) 1);
			j += ((NI) 1);
		} LA8: ;
	}
	i = ((NI) 0);
	k = lo;
	{
		while (1) {
			NIM_BOOL T11_;
			T11_ = (NIM_BOOL)0;
			T11_ = (k < j);
			if (!(T11_)) goto LA12_;
			T11_ = (j <= hi);
			LA12_: ;
			if (!T11_) goto LA10;
			{
				NI T15_;
				NI T16_;
				T15_ = (NI)0;
				T15_ = cmp.ClE_0? cmp.ClP_0(b[i], a[j], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_15)(cmp.ClP_0))(b[i], a[j]);
				T16_ = (NI)0;
				T16_ = star___pureZalgorithm_8(T15_, order);
				if (!(T16_ <= ((NI) 0))) goto LA17_;
				unsureAsgnRef((void**) (&a[k]), b[i]);
				i += ((NI) 1);
			}
			goto LA13_;
			LA17_: ;
			{
				unsureAsgnRef((void**) (&a[k]), a[j]);
				j += ((NI) 1);
			}
			LA13_: ;
			k += ((NI) 1);
		} LA10: ;
	}
	{
		while (1) {
			if (!(k < j)) goto LA21;
			unsureAsgnRef((void**) (&a[k]), b[i]);
			k += ((NI) 1);
			i += ((NI) 1);
		} LA21: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__sourcemap_634)(tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA** a, NI aLen_0, tyProc__9apb8PBM2ucUBIVhn3CRrdg cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI n;
	tySequence__9c1n3IOF5T6xvPNf6ipRnuQ* b;
	NI s;
	n = aLen_0;
	b = newSeq__sourcemap_618(((NI) ((NI)(n / ((NI) 2)))));
	s = ((NI) 1);
	{
		while (1) {
			NI m;
			if (!(s < n)) goto LA2;
			m = (NI)((NI)(n - ((NI) 1)) - s);
			{
				while (1) {
					if (!(((NI) 0) <= m)) goto LA4;
					mergeAlt__sourcemap_651(a, aLen_0, (b) ? (b->data) : NIM_NIL, (b ? b->Sup.len : 0), (((NI)((NI)(m - s) + ((NI) 1)) >= ((NI) 0)) ? (NI)((NI)(m - s) + ((NI) 1)) : ((NI) 0)), m, (NI)(m + s), cmp, order);
					m -= (NI)(s * ((NI) 2));
				} LA4: ;
			}
			s = (NI)(s * ((NI) 2));
		} LA2: ;
	}
}
N_LIB_PRIVATE N_NIMCALL(tySequence__9c1n3IOF5T6xvPNf6ipRnuQ*, sorted__sourcemap_606)(tyObject_MappingcolonObjectType___tyoFJJITyZcOtgC4HmERDA** a, NI aLen_0, tyProc__9apb8PBM2ucUBIVhn3CRrdg cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	tySequence__9c1n3IOF5T6xvPNf6ipRnuQ* result;
	result = NIM_NIL;
	result = newSeq__sourcemap_618(((NI) (aLen_0)));
	{
		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 LA3;
				i = res;
				asgnRef((void**) (&result->data[i]), a[i]);
				res += ((NI) 1);
			} LA3: ;
		}
	}
	sort__sourcemap_634((result) ? (result->data) : NIM_NIL, (result ? result->Sup.len : 0), cmp, order);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, binarySearch__packagesZdocutilsZhighlite_324)(NimStringDesc** a, NI aLen_0, NimStringDesc* key, tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA cmp) {
	NI result;
	NI len;
{	result = (NI)0;
	len = aLen_0;
	{
		if (!(len == ((NI) 0))) goto LA3_;
		result = ((NI) -1);
		goto BeforeRet_;
	}
	LA3_: ;
	{
		if (!(len == ((NI) 1))) goto LA7_;
		{
			NI T11_;
			T11_ = (NI)0;
			T11_ = cmp.ClE_0? cmp.ClP_0(a[((NI) 0)], key, cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_16)(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_: ;
	result = ((NI) 0);
	{
		NI step;
		NI cmpRes;
		if (!((NI)(len & (NI)(len - ((NI) 1))) == ((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);
				cmpRes = cmp.ClE_0? cmp.ClP_0(a[i], key, cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_17)(cmp.ClP_0))(a[i], key);
				{
					if (!(cmpRes == ((NI) 0))) goto LA23_;
					result = i;
					goto BeforeRet_;
				}
				LA23_: ;
				{
					if (!(cmpRes < ((NI) 0))) goto LA27_;
					result = i;
				}
				LA27_: ;
				step = (NI)((NI32)(step) >> (NU32)(((NI) 1)));
			} LA20: ;
		}
		{
			NI T31_;
			T31_ = (NI)0;
			T31_ = cmp.ClE_0? cmp.ClP_0(a[result], key, cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_18)(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;
				if (!(result < b)) goto LA36;
				mid = (NI)((NI32)((NI)(result + b)) >> (NU32)(((NI) 1)));
				cmpRes_2 = cmp.ClE_0? cmp.ClP_0(a[mid], key, cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_19)(cmp.ClP_0))(a[mid], key);
				{
					if (!(cmpRes_2 == ((NI) 0))) goto LA39_;
					result = mid;
					goto BeforeRet_;
				}
				LA39_: ;
				{
					if (!(cmpRes_2 < ((NI) 0))) goto LA43_;
					result = (NI)(mid + ((NI) 1));
				}
				goto LA41_;
				LA43_: ;
				{
					b = mid;
				}
				LA41_: ;
			} LA36: ;
		}
		{
			NIM_BOOL T48_;
			NI T50_;
			T48_ = (NIM_BOOL)0;
			T48_ = (len <= result);
			if (T48_) goto LA49_;
			T50_ = (NI)0;
			T50_ = cmp.ClE_0? cmp.ClP_0(a[result], key, cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_20)(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__packagesZdocutilsZhighlite_313)(NimStringDesc** a, NI aLen_0, NimStringDesc* key) {
	NI result;
	tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA T1_;
	result = (NI)0;
	nimZeroMem((void*)(&T1_), sizeof(tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA));
	T1_.ClP_0 = ((TM__JdC9c6SaUkvO1XjYuWP1JWQ_21) (cmp__sem_1796)); T1_.ClE_0 = NIM_NIL;
	result = binarySearch__packagesZdocutilsZhighlite_324(a, aLen_0, key, T1_);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__packagesZdocutilsZrst_2698)(tyTuple__msoRFpgv3EcbLwCh9arSpYw* a, NI aLen_0, tyTuple__msoRFpgv3EcbLwCh9arSpYw* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__gB5GcYGEl9c9bdmXRILxVndQ cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI j;
	NI bb;
	NI i;
	NI k;
{	{
		NI T3_;
		NI T4_;
		T3_ = (NI)0;
		T3_ = cmp.ClE_0? cmp.ClP_0(a[m], a[(NI)(m + ((NI) 1))], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_22)(cmp.ClP_0))(a[m], a[(NI)(m + ((NI) 1))]);
		T4_ = (NI)0;
		T4_ = star___pureZalgorithm_8(T3_, order);
		if (!(T4_ <= ((NI) 0))) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	j = lo;
	bb = ((NI) 0);
	{
		while (1) {
			if (!(j <= m)) goto LA8;
			genericShallowAssign((void*)(&b[bb]), (void*)(&a[j]), (&NTIfootnotesubst__msoRFpgv3EcbLwCh9arSpYw_));
			bb += ((NI) 1);
			j += ((NI) 1);
		} LA8: ;
	}
	i = ((NI) 0);
	k = lo;
	{
		while (1) {
			NIM_BOOL T11_;
			T11_ = (NIM_BOOL)0;
			T11_ = (k < j);
			if (!(T11_)) goto LA12_;
			T11_ = (j <= hi);
			LA12_: ;
			if (!T11_) goto LA10;
			{
				NI T15_;
				NI T16_;
				T15_ = (NI)0;
				T15_ = cmp.ClE_0? cmp.ClP_0(b[i], a[j], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_23)(cmp.ClP_0))(b[i], a[j]);
				T16_ = (NI)0;
				T16_ = star___pureZalgorithm_8(T15_, order);
				if (!(T16_ <= ((NI) 0))) goto LA17_;
				genericShallowAssign((void*)(&a[k]), (void*)(&b[i]), (&NTIfootnotesubst__msoRFpgv3EcbLwCh9arSpYw_));
				i += ((NI) 1);
			}
			goto LA13_;
			LA17_: ;
			{
				genericShallowAssign((void*)(&a[k]), (void*)(&a[j]), (&NTIfootnotesubst__msoRFpgv3EcbLwCh9arSpYw_));
				j += ((NI) 1);
			}
			LA13_: ;
			k += ((NI) 1);
		} LA10: ;
	}
	{
		while (1) {
			if (!(k < j)) goto LA21;
			genericShallowAssign((void*)(&a[k]), (void*)(&b[i]), (&NTIfootnotesubst__msoRFpgv3EcbLwCh9arSpYw_));
			k += ((NI) 1);
			i += ((NI) 1);
		} LA21: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__packagesZdocutilsZrst_2675)(tyTuple__msoRFpgv3EcbLwCh9arSpYw* a, NI aLen_0, tyProc__gB5GcYGEl9c9bdmXRILxVndQ cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI n;
	tySequence__59axsmyJq9bYh2MONDvuwAkA* b;
	NI s;
	n = aLen_0;
	b = newSeq__packagesZdocutilsZrst_2687(((NI) ((NI)(n / ((NI) 2)))));
	s = ((NI) 1);
	{
		while (1) {
			NI m;
			if (!(s < n)) goto LA2;
			m = (NI)((NI)(n - ((NI) 1)) - s);
			{
				while (1) {
					if (!(((NI) 0) <= m)) goto LA4;
					mergeAlt__packagesZdocutilsZrst_2698(a, aLen_0, (b) ? (b->data) : NIM_NIL, (b ? b->Sup.len : 0), (((NI)((NI)(m - s) + ((NI) 1)) >= ((NI) 0)) ? (NI)((NI)(m - s) + ((NI) 1)) : ((NI) 0)), m, (NI)(m + s), cmp, order);
					m -= (NI)(s * ((NI) 2));
				} LA4: ;
			}
			s = (NI)(s * ((NI) 2));
		} LA2: ;
	}
}
N_LIB_PRIVATE N_NIMCALL(void, sort__packagesZdocutilsZrst_2610)(tyTuple__msoRFpgv3EcbLwCh9arSpYw* a, NI aLen_0, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	tyProc__gB5GcYGEl9c9bdmXRILxVndQ T1_;
	nimZeroMem((void*)(&T1_), sizeof(tyProc__gB5GcYGEl9c9bdmXRILxVndQ));
	T1_.ClP_0 = ((TM__JdC9c6SaUkvO1XjYuWP1JWQ_24) (cmp__packagesZdocutilsZrst_2614)); T1_.ClE_0 = NIM_NIL;
	sort__packagesZdocutilsZrst_2675(a, aLen_0, T1_, order);
}
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__docgen_5585)(tyObject_Item__H9bFFvU3st4d7H9cwvzvRVyw* a, NI aLen_0, tyObject_Item__H9bFFvU3st4d7H9cwvzvRVyw* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__2NUTrG5LP9b86R9b8Iu9a2aRQ cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI j;
	NI bb;
	NI i;
	NI k;
{	{
		NI T3_;
		NI T4_;
		T3_ = (NI)0;
		T3_ = cmp.ClE_0? cmp.ClP_0(a[m], a[(NI)(m + ((NI) 1))], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_25)(cmp.ClP_0))(a[m], a[(NI)(m + ((NI) 1))]);
		T4_ = (NI)0;
		T4_ = star___pureZalgorithm_8(T3_, order);
		if (!(T4_ <= ((NI) 0))) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	j = lo;
	bb = ((NI) 0);
	{
		while (1) {
			if (!(j <= m)) goto LA8;
			unsureAsgnRef((void**) (&b[bb].descRst), a[j].descRst);
			unsureAsgnRef((void**) (&b[bb].substitutions), a[j].substitutions);
			unsureAsgnRef((void**) (&b[bb].sortName), a[j].sortName);
			bb += ((NI) 1);
			j += ((NI) 1);
		} LA8: ;
	}
	i = ((NI) 0);
	k = lo;
	{
		while (1) {
			NIM_BOOL T11_;
			T11_ = (NIM_BOOL)0;
			T11_ = (k < j);
			if (!(T11_)) goto LA12_;
			T11_ = (j <= hi);
			LA12_: ;
			if (!T11_) goto LA10;
			{
				NI T15_;
				NI T16_;
				T15_ = (NI)0;
				T15_ = cmp.ClE_0? cmp.ClP_0(b[i], a[j], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_26)(cmp.ClP_0))(b[i], a[j]);
				T16_ = (NI)0;
				T16_ = star___pureZalgorithm_8(T15_, order);
				if (!(T16_ <= ((NI) 0))) goto LA17_;
				unsureAsgnRef((void**) (&a[k].descRst), b[i].descRst);
				unsureAsgnRef((void**) (&a[k].substitutions), b[i].substitutions);
				unsureAsgnRef((void**) (&a[k].sortName), b[i].sortName);
				i += ((NI) 1);
			}
			goto LA13_;
			LA17_: ;
			{
				unsureAsgnRef((void**) (&a[k].descRst), a[j].descRst);
				unsureAsgnRef((void**) (&a[k].substitutions), a[j].substitutions);
				unsureAsgnRef((void**) (&a[k].sortName), a[j].sortName);
				j += ((NI) 1);
			}
			LA13_: ;
			k += ((NI) 1);
		} LA10: ;
	}
	{
		while (1) {
			if (!(k < j)) goto LA21;
			unsureAsgnRef((void**) (&a[k].descRst), b[i].descRst);
			unsureAsgnRef((void**) (&a[k].substitutions), b[i].substitutions);
			unsureAsgnRef((void**) (&a[k].sortName), b[i].sortName);
			k += ((NI) 1);
			i += ((NI) 1);
		} LA21: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__docgen_5568)(tyObject_Item__H9bFFvU3st4d7H9cwvzvRVyw* a, NI aLen_0, tyProc__2NUTrG5LP9b86R9b8Iu9a2aRQ cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI n;
	tySequence__MnKKQ5PGyDp4x1lUEG41Ag* b;
	NI s;
	n = aLen_0;
	b = newSeq__docgen_5543(((NI) ((NI)(n / ((NI) 2)))));
	s = ((NI) 1);
	{
		while (1) {
			NI m;
			if (!(s < n)) goto LA2;
			m = (NI)((NI)(n - ((NI) 1)) - s);
			{
				while (1) {
					if (!(((NI) 0) <= m)) goto LA4;
					mergeAlt__docgen_5585(a, aLen_0, (b) ? (b->data) : NIM_NIL, (b ? b->Sup.len : 0), (((NI)((NI)(m - s) + ((NI) 1)) >= ((NI) 0)) ? (NI)((NI)(m - s) + ((NI) 1)) : ((NI) 0)), m, (NI)(m + s), cmp, order);
					m -= (NI)(s * ((NI) 2));
				} LA4: ;
			}
			s = (NI)(s * ((NI) 2));
		} LA2: ;
	}
}
N_LIB_PRIVATE N_NIMCALL(tySequence__MnKKQ5PGyDp4x1lUEG41Ag*, sorted__docgen_5531)(tyObject_Item__H9bFFvU3st4d7H9cwvzvRVyw* a, NI aLen_0, tyProc__2NUTrG5LP9b86R9b8Iu9a2aRQ cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	tySequence__MnKKQ5PGyDp4x1lUEG41Ag* result;
	result = NIM_NIL;
	result = newSeq__docgen_5543(((NI) (aLen_0)));
	{
		NI i;
		NI colontmp_;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (aLen_0-1);
		res = ((NI) 0);
		{
			while (1) {
				NimStringDesc* T4_;
				if (!(res <= colontmp_)) goto LA3;
				i = res;
				genericSeqAssign((&result->data[i].descRst), a[i].descRst, (&NTIitempre__Wm9aGag2treFuYnXRdy8u9bA_));
				genericSeqAssign((&result->data[i].substitutions), a[i].substitutions, (&NTIseqLstringT__sM4lkSb7zS6F7OVMvW9cffQ_));
				T4_ = NIM_NIL;
				T4_ = result->data[i].sortName; result->data[i].sortName = copyStringRC1(a[i].sortName);
				if (T4_) nimGCunrefNoCycle(T4_);
				res += ((NI) 1);
			} LA3: ;
		}
	}
	sort__docgen_5568((result) ? (result->data) : NIM_NIL, (result ? result->Sup.len : 0), cmp, order);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ*, sorted__docgen_6732)(NimStringDesc** a, NI aLen_0, tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ* result;
	result = NIM_NIL;
	result = newSeq__systemZio_503(((NI) (aLen_0)));
	{
		NI i;
		NI colontmp_;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (aLen_0-1);
		res = ((NI) 0);
		{
			while (1) {
				NimStringDesc* T4_;
				if (!(res <= colontmp_)) goto LA3;
				i = res;
				T4_ = NIM_NIL;
				T4_ = result->data[i]; result->data[i] = copyStringRC1(a[i]);
				if (T4_) nimGCunrefNoCycle(T4_);
				res += ((NI) 1);
			} LA3: ;
		}
	}
	sort__sem_1803((result) ? (result->data) : NIM_NIL, (result ? result->Sup.len : 0), cmp, order);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__docgen_6909)(tyObject_TocItem__jc5WxywzGPY8oy0aHNYXIg* a, NI aLen_0, tyObject_TocItem__jc5WxywzGPY8oy0aHNYXIg* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__2bxOhi2UzEVnSIccjRvxEA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI j;
	NI bb;
	NI i;
	NI k;
{	{
		NI T3_;
		NI T4_;
		T3_ = (NI)0;
		T3_ = cmp.ClE_0? cmp.ClP_0(a[m], a[(NI)(m + ((NI) 1))], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_27)(cmp.ClP_0))(a[m], a[(NI)(m + ((NI) 1))]);
		T4_ = (NI)0;
		T4_ = star___pureZalgorithm_8(T3_, order);
		if (!(T4_ <= ((NI) 0))) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	j = lo;
	bb = ((NI) 0);
	{
		while (1) {
			if (!(j <= m)) goto LA8;
			unsureAsgnRef((void**) (&b[bb].content), a[j].content);
			unsureAsgnRef((void**) (&b[bb].sortName), a[j].sortName);
			bb += ((NI) 1);
			j += ((NI) 1);
		} LA8: ;
	}
	i = ((NI) 0);
	k = lo;
	{
		while (1) {
			NIM_BOOL T11_;
			T11_ = (NIM_BOOL)0;
			T11_ = (k < j);
			if (!(T11_)) goto LA12_;
			T11_ = (j <= hi);
			LA12_: ;
			if (!T11_) goto LA10;
			{
				NI T15_;
				NI T16_;
				T15_ = (NI)0;
				T15_ = cmp.ClE_0? cmp.ClP_0(b[i], a[j], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_28)(cmp.ClP_0))(b[i], a[j]);
				T16_ = (NI)0;
				T16_ = star___pureZalgorithm_8(T15_, order);
				if (!(T16_ <= ((NI) 0))) goto LA17_;
				unsureAsgnRef((void**) (&a[k].content), b[i].content);
				unsureAsgnRef((void**) (&a[k].sortName), b[i].sortName);
				i += ((NI) 1);
			}
			goto LA13_;
			LA17_: ;
			{
				unsureAsgnRef((void**) (&a[k].content), a[j].content);
				unsureAsgnRef((void**) (&a[k].sortName), a[j].sortName);
				j += ((NI) 1);
			}
			LA13_: ;
			k += ((NI) 1);
		} LA10: ;
	}
	{
		while (1) {
			if (!(k < j)) goto LA21;
			unsureAsgnRef((void**) (&a[k].content), b[i].content);
			unsureAsgnRef((void**) (&a[k].sortName), b[i].sortName);
			k += ((NI) 1);
			i += ((NI) 1);
		} LA21: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__docgen_6891)(tyObject_TocItem__jc5WxywzGPY8oy0aHNYXIg* a, NI aLen_0, tyProc__2bxOhi2UzEVnSIccjRvxEA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI n;
	tySequence__EhfJ5cVWpPFG1tw09ap9co5g* b;
	NI s;
	n = aLen_0;
	b = newSeq__docgen_3556(((NI) ((NI)(n / ((NI) 2)))));
	s = ((NI) 1);
	{
		while (1) {
			NI m;
			if (!(s < n)) goto LA2;
			m = (NI)((NI)(n - ((NI) 1)) - s);
			{
				while (1) {
					if (!(((NI) 0) <= m)) goto LA4;
					mergeAlt__docgen_6909(a, aLen_0, (b) ? (b->data) : NIM_NIL, (b ? b->Sup.len : 0), (((NI)((NI)(m - s) + ((NI) 1)) >= ((NI) 0)) ? (NI)((NI)(m - s) + ((NI) 1)) : ((NI) 0)), m, (NI)(m + s), cmp, order);
					m -= (NI)(s * ((NI) 2));
				} LA4: ;
			}
			s = (NI)(s * ((NI) 2));
		} LA2: ;
	}
}
N_LIB_PRIVATE N_NIMCALL(tySequence__EhfJ5cVWpPFG1tw09ap9co5g*, sorted__docgen_6997)(tyObject_TocItem__jc5WxywzGPY8oy0aHNYXIg* a, NI aLen_0, tyProc__2bxOhi2UzEVnSIccjRvxEA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	tySequence__EhfJ5cVWpPFG1tw09ap9co5g* result;
	result = NIM_NIL;
	result = newSeq__docgen_3556(((NI) (aLen_0)));
	{
		NI i;
		NI colontmp_;
		NI res;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = (aLen_0-1);
		res = ((NI) 0);
		{
			while (1) {
				NimStringDesc* T4_;
				NimStringDesc* T5_;
				if (!(res <= colontmp_)) goto LA3;
				i = res;
				T4_ = NIM_NIL;
				T4_ = result->data[i].content; result->data[i].content = copyStringRC1(a[i].content);
				if (T4_) nimGCunrefNoCycle(T4_);
				T5_ = NIM_NIL;
				T5_ = result->data[i].sortName; result->data[i].sortName = copyStringRC1(a[i].sortName);
				if (T5_) nimGCunrefNoCycle(T5_);
				res += ((NI) 1);
			} LA3: ;
		}
	}
	sort__docgen_6891((result) ? (result->data) : NIM_NIL, (result ? result->Sup.len : 0), cmp, order);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__packagesZdocutilsZrstgen_6130)(tyObject_IndexEntry__fxsh1PMzYjb64GNihAaS4A* a, NI aLen_0, tyObject_IndexEntry__fxsh1PMzYjb64GNihAaS4A* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__dyWamSxQI9aSIOZWO07sqOA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI j;
	NI bb;
	NI i;
	NI k;
{	{
		NI T3_;
		NI T4_;
		T3_ = (NI)0;
		T3_ = cmp.ClE_0? cmp.ClP_0(a[m], a[(NI)(m + ((NI) 1))], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_29)(cmp.ClP_0))(a[m], a[(NI)(m + ((NI) 1))]);
		T4_ = (NI)0;
		T4_ = star___pureZalgorithm_8(T3_, order);
		if (!(T4_ <= ((NI) 0))) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	j = lo;
	bb = ((NI) 0);
	{
		while (1) {
			if (!(j <= m)) goto LA8;
			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);
			bb += ((NI) 1);
			j += ((NI) 1);
		} LA8: ;
	}
	i = ((NI) 0);
	k = lo;
	{
		while (1) {
			NIM_BOOL T11_;
			T11_ = (NIM_BOOL)0;
			T11_ = (k < j);
			if (!(T11_)) goto LA12_;
			T11_ = (j <= hi);
			LA12_: ;
			if (!T11_) goto LA10;
			{
				NI T15_;
				NI T16_;
				T15_ = (NI)0;
				T15_ = cmp.ClE_0? cmp.ClP_0(b[i], a[j], cmp.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_30)(cmp.ClP_0))(b[i], a[j]);
				T16_ = (NI)0;
				T16_ = star___pureZalgorithm_8(T15_, order);
				if (!(T16_ <= ((NI) 0))) goto LA17_;
				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);
				i += ((NI) 1);
			}
			goto LA13_;
			LA17_: ;
			{
				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);
				j += ((NI) 1);
			}
			LA13_: ;
			k += ((NI) 1);
		} LA10: ;
	}
	{
		while (1) {
			if (!(k < j)) goto LA21;
			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);
			k += ((NI) 1);
			i += ((NI) 1);
		} LA21: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__packagesZdocutilsZrstgen_6108)(tyObject_IndexEntry__fxsh1PMzYjb64GNihAaS4A* a, NI aLen_0, tyProc__dyWamSxQI9aSIOZWO07sqOA cmp, tyEnum_SortOrder__8iBc6wlNqBa9cju9cUAhUAxA order) {
	NI n;
	tySequence__CJOrWaM0fWekVRTE2AotGw* b;
	NI s;
	n = aLen_0;
	b = newSeq__packagesZdocutilsZrstgen_6119(((NI) ((NI)(n / ((NI) 2)))));
	s = ((NI) 1);
	{
		while (1) {
			NI m;
			if (!(s < n)) goto LA2;
			m = (NI)((NI)(n - ((NI) 1)) - s);
			{
				while (1) {
					if (!(((NI) 0) <= m)) goto LA4;
					mergeAlt__packagesZdocutilsZrstgen_6130(a, aLen_0, (b) ? (b->data) : NIM_NIL, (b ? b->Sup.len : 0), (((NI)((NI)(m - s) + ((NI) 1)) >= ((NI) 0)) ? (NI)((NI)(m - s) + ((NI) 1)) : ((NI) 0)), m, (NI)(m + s), cmp, order);
					m -= (NI)(s * ((NI) 2));
				} LA4: ;
			}
			s = (NI)(s * ((NI) 2));
		} LA2: ;
	}
}
