/* Generated by Nim Compiler v1.6.14 */
#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__vAEg9bb6P9cAvzrQae7aeKyA tySequence__vAEg9bb6P9cAvzrQae7aeKyA;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyObject_DepNcolonObjectType___T7a6etQXL0CBg8BjsbsXpA tyObject_DepNcolonObjectType___T7a6etQXL0CBg8BjsbsXpA;
typedef struct tyObject_TNode__uh9cWvEa5Ty85PXOtuP5emw tyObject_TNode__uh9cWvEa5Ty85PXOtuP5emw;
typedef struct tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g;
typedef struct TNimType TNimType;
typedef struct tyObject_CellSeq__nav876ELHgxScHhs30CKiA tyObject_CellSeq__nav876ELHgxScHhs30CKiA;
typedef struct tyObject_GcHeap__ZRn9bWCksoiGwT2drZZzyWQ tyObject_GcHeap__ZRn9bWCksoiGwT2drZZzyWQ;
typedef struct tyObject_GcStack__qFeGMKlnq6c9cTM2vPWycQQ tyObject_GcStack__qFeGMKlnq6c9cTM2vPWycQQ;
typedef struct tyObject_MemRegion__6QRscFDo4mEwbg9aL76vDGQ tyObject_MemRegion__6QRscFDo4mEwbg9aL76vDGQ;
typedef struct tyObject_SmallChunk__eUrTKmsk1Dqt5tm2WUT2Lw tyObject_SmallChunk__eUrTKmsk1Dqt5tm2WUT2Lw;
typedef struct tyObject_BigChunk__39bC3HTk2w4NGDjG74oNjmA tyObject_BigChunk__39bC3HTk2w4NGDjG74oNjmA;
typedef struct tyObject_LLChunk__Fjkr5Ya6Zl0UoUGxG047hA tyObject_LLChunk__Fjkr5Ya6Zl0UoUGxG047hA;
typedef struct tyObject_IntSet__WrQriiGmHk59cB1lNPtGo6A tyObject_IntSet__WrQriiGmHk59cB1lNPtGo6A;
typedef struct tyObject_Trunk__Ju1AURWHenTn3cJwAjbUhg tyObject_Trunk__Ju1AURWHenTn3cJwAjbUhg;
typedef struct tyObject_AvlNode__aGkK1t9a0WoXjpugXR6FWpw tyObject_AvlNode__aGkK1t9a0WoXjpugXR6FWpw;
typedef struct tyObject_HeapLinks__5IkCDh5QlsYpsfEMJf6zNw tyObject_HeapLinks__5IkCDh5QlsYpsfEMJf6zNw;
typedef struct tyTuple__p2vAp9cQ6YrpDq9cI3XzEDWA tyTuple__p2vAp9cQ6YrpDq9cI3XzEDWA;
typedef struct tyObject_GcStat__OG9ams3mtFJyICkjTOHbc9bg tyObject_GcStat__OG9ams3mtFJyICkjTOHbc9bg;
typedef struct tyObject_CellSet__A0mJvGLunfUxGkLUtesjdA tyObject_CellSet__A0mJvGLunfUxGkLUtesjdA;
typedef struct tyObject_PageDesc__N7tjEodqPVJaQ6oKQW8YfQ tyObject_PageDesc__N7tjEodqPVJaQ6oKQW8YfQ;
typedef struct tySequence__EK3kb9a029axOL6ZINxWj1hw tySequence__EK3kb9a029axOL6ZINxWj1hw;
typedef struct tyTuple__Ztb9b8BdGY9bQ5Qd69ajoC2fQ tyTuple__Ztb9b8BdGY9bQ5Qd69ajoC2fQ;
typedef struct tyObject_TSym__3r34mwqcVmg5JFNmiaVncw tyObject_TSym__3r34mwqcVmg5JFNmiaVncw;
typedef struct NimStringDesc NimStringDesc;
typedef struct tyObject_SuggestcolonObjectType___VUPO9alfTq2Ar9a7ZtY9cSPDg tyObject_SuggestcolonObjectType___VUPO9alfTq2Ar9a7ZtY9cSPDg;
typedef struct tySequence__GR8qmV1kNRcoQ2g76VFy3A tySequence__GR8qmV1kNRcoQ2g76VFy3A;
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ tySequence__sM4lkSb7zS6F7OVMvW9cffQ;
typedef struct tySequence__48JTohSgTy339bRxHzUD8KA tySequence__48JTohSgTy339bRxHzUD8KA;
typedef struct tySequence__hIN6NiV2heFnG19c6HdDacw tySequence__hIN6NiV2heFnG19c6HdDacw;
typedef struct tyObject_MappingcolonObjectType___DlP7ZB0VJF31Xvkyqvp6Qw tyObject_MappingcolonObjectType___DlP7ZB0VJF31Xvkyqvp6Qw;
typedef struct tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ;
typedef struct tyTuple__KPVKrfx82Va9azSnb0dl1RQ tyTuple__KPVKrfx82Va9azSnb0dl1RQ;
typedef struct tySequence__YYKlUlCjbni3i58WM0kegw tySequence__YYKlUlCjbni3i58WM0kegw;
typedef struct TNimNode TNimNode;
typedef struct tySequence__bLuZlbeJhlfg9axVlmjdJXw tySequence__bLuZlbeJhlfg9axVlmjdJXw;
typedef struct tyObject_Item__T7UjOImKJxoSfGY6SB3KMg tyObject_Item__T7UjOImKJxoSfGY6SB3KMg;
typedef struct tySequence__JSDKkkE7gMRTYRB9bRZ9bH7Q tySequence__JSDKkkE7gMRTYRB9bRZ9bH7Q;
typedef struct tyObject_TocItem__f5Z7HAch49an2qSNSGguP7Q tyObject_TocItem__f5Z7HAch49an2qSNSGguP7Q;
typedef struct tySequence__spLz9azjOgbpYKrtmm9aMHEw tySequence__spLz9azjOgbpYKrtmm9aMHEw;
typedef struct tyObject_IndexEntry__1q6h3V1uWiazOcEBnOLqyA tyObject_IndexEntry__1q6h3V1uWiazOcEBnOLqyA;
typedef struct tySequence__hf5PiuqqytWiEcddgIR5sQ tySequence__hf5PiuqqytWiEcddgIR5sQ;
typedef struct tyObject_ItemFragment__s61pcFD9bQO8uWIzfNjndzg tyObject_ItemFragment__s61pcFD9bQO8uWIzfNjndzg;
typedef struct tyObject_RstNode__o7Mf73b09cQpxU9cdK19aKkqQ tyObject_RstNode__o7Mf73b09cQpxU9cdK19aKkqQ;
struct TGenericSeq {
NI len;
NI reserved;
};
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (tyObject_DepNcolonObjectType___T7a6etQXL0CBg8BjsbsXpA* x, tyObject_DepNcolonObjectType___T7a6etQXL0CBg8BjsbsXpA* y, void* ClE_0);
void* ClE_0;
} tyProc__YRIBfnKx4fhbilJmrYB0MA;
typedef NU8 tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg;
struct tyObject_DepNcolonObjectType___T7a6etQXL0CBg8BjsbsXpA {
tyObject_TNode__uh9cWvEa5Ty85PXOtuP5emw* pnode;
NI id;
NI idx;
NI lowLink;
NIM_BOOL onStack;
tySequence__vAEg9bb6P9cAvzrQae7aeKyA* kids;
NI hAQ;
NI hIS;
NI hB;
NI hCmd;
};
struct tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g {
NI refcount;
TNimType* typ;
};
struct tyObject_GcStack__qFeGMKlnq6c9cTM2vPWycQQ {
void* bottom;
};
struct tyObject_CellSeq__nav876ELHgxScHhs30CKiA {
NI len;
NI cap;
tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g** d;
};
typedef tyObject_SmallChunk__eUrTKmsk1Dqt5tm2WUT2Lw* tyArray__1eFxjkcKGHnofywkmCV8oQ[256];
typedef NU32 tyArray__BHbOSqU1t9b3Gt7K2c6fQig[24];
typedef tyObject_BigChunk__39bC3HTk2w4NGDjG74oNjmA* tyArray__KxTmKT9a3kTkdwYfqXhEYSw[32];
typedef tyArray__KxTmKT9a3kTkdwYfqXhEYSw tyArray__ATT5LBefmjy9bg8ApRmg3rw[24];
typedef tyObject_Trunk__Ju1AURWHenTn3cJwAjbUhg* tyArray__RxhBwkGQwTHLKhoK685Xfg[256];
struct tyObject_IntSet__WrQriiGmHk59cB1lNPtGo6A {
tyArray__RxhBwkGQwTHLKhoK685Xfg data;
};
typedef tyObject_AvlNode__aGkK1t9a0WoXjpugXR6FWpw* tyArray__DrxDrI9bg9apB70ydOoNZrWw[2];
struct tyObject_AvlNode__aGkK1t9a0WoXjpugXR6FWpw {
tyArray__DrxDrI9bg9apB70ydOoNZrWw link;
NI key;
NI upperBound;
NI level;
};
struct tyTuple__p2vAp9cQ6YrpDq9cI3XzEDWA {
tyObject_BigChunk__39bC3HTk2w4NGDjG74oNjmA* Field0;
NI Field1;
};
typedef tyTuple__p2vAp9cQ6YrpDq9cI3XzEDWA tyArray__wsokuoa9bVBSU4gPLKbFaaw[30];
struct tyObject_HeapLinks__5IkCDh5QlsYpsfEMJf6zNw {
NI len;
tyArray__wsokuoa9bVBSU4gPLKbFaaw chunks;
tyObject_HeapLinks__5IkCDh5QlsYpsfEMJf6zNw* next;
};
struct tyObject_MemRegion__6QRscFDo4mEwbg9aL76vDGQ {
NI minLargeObj;
NI maxLargeObj;
tyArray__1eFxjkcKGHnofywkmCV8oQ freeSmallChunks;
NU32 flBitmap;
tyArray__BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
tyArray__ATT5LBefmjy9bg8ApRmg3rw matrix;
tyObject_LLChunk__Fjkr5Ya6Zl0UoUGxG047hA* llmem;
NI currMem;
NI maxMem;
NI freeMem;
NI occ;
NI lastSize;
tyObject_IntSet__WrQriiGmHk59cB1lNPtGo6A chunkStarts;
tyObject_AvlNode__aGkK1t9a0WoXjpugXR6FWpw* root;
tyObject_AvlNode__aGkK1t9a0WoXjpugXR6FWpw* deleted;
tyObject_AvlNode__aGkK1t9a0WoXjpugXR6FWpw* last;
tyObject_AvlNode__aGkK1t9a0WoXjpugXR6FWpw* freeAvlNodes;
NIM_BOOL locked;
NIM_BOOL blockChunkSizeIncrease;
NI nextChunkSize;
tyObject_AvlNode__aGkK1t9a0WoXjpugXR6FWpw bottomData;
tyObject_HeapLinks__5IkCDh5QlsYpsfEMJf6zNw heapLinks;
};
struct tyObject_GcStat__OG9ams3mtFJyICkjTOHbc9bg {
NI stackScans;
NI cycleCollections;
NI maxThreshold;
NI maxStackSize;
NI maxStackCells;
NI cycleTableSize;
NI64 maxPause;
};
struct tyObject_CellSet__A0mJvGLunfUxGkLUtesjdA {
NI counter;
NI max;
tyObject_PageDesc__N7tjEodqPVJaQ6oKQW8YfQ* head;
tyObject_PageDesc__N7tjEodqPVJaQ6oKQW8YfQ** data;
};
struct tyObject_GcHeap__ZRn9bWCksoiGwT2drZZzyWQ {
tyObject_GcStack__qFeGMKlnq6c9cTM2vPWycQQ stack;
NI cycleThreshold;
NI zctThreshold;
tyObject_CellSeq__nav876ELHgxScHhs30CKiA zct;
tyObject_CellSeq__nav876ELHgxScHhs30CKiA decStack;
tyObject_CellSeq__nav876ELHgxScHhs30CKiA tempStack;
NI recGcLock;
tyObject_MemRegion__6QRscFDo4mEwbg9aL76vDGQ region;
tyObject_GcStat__OG9ams3mtFJyICkjTOHbc9bg stat;
tyObject_CellSet__A0mJvGLunfUxGkLUtesjdA marked;
tyObject_CellSeq__nav876ELHgxScHhs30CKiA additionalRoots;
NI gcThreadId;
};
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_2) (tyObject_DepNcolonObjectType___T7a6etQXL0CBg8BjsbsXpA* x, tyObject_DepNcolonObjectType___T7a6etQXL0CBg8BjsbsXpA* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_3) (tyObject_DepNcolonObjectType___T7a6etQXL0CBg8BjsbsXpA* x, tyObject_DepNcolonObjectType___T7a6etQXL0CBg8BjsbsXpA* y);
struct NimStringDesc {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct tyTuple__Ztb9b8BdGY9bQ5Qd69ajoC2fQ {
tyObject_TSym__3r34mwqcVmg5JFNmiaVncw* Field0;
NimStringDesc* Field1;
};
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (tyTuple__Ztb9b8BdGY9bQ5Qd69ajoC2fQ x, tyTuple__Ztb9b8BdGY9bQ5Qd69ajoC2fQ y, void* ClE_0);
void* ClE_0;
} tyProc__u9cu9aE0U3KrPDmkcU8DWlOw;
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_4) (tyTuple__Ztb9b8BdGY9bQ5Qd69ajoC2fQ x, tyTuple__Ztb9b8BdGY9bQ5Qd69ajoC2fQ y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_5) (tyTuple__Ztb9b8BdGY9bQ5Qd69ajoC2fQ x, tyTuple__Ztb9b8BdGY9bQ5Qd69ajoC2fQ y);
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (tyObject_SuggestcolonObjectType___VUPO9alfTq2Ar9a7ZtY9cSPDg* x, tyObject_SuggestcolonObjectType___VUPO9alfTq2Ar9a7ZtY9cSPDg* y, void* ClE_0);
void* ClE_0;
} tyProc__5ZzDzBBqlwfychCMx6jbDw;
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_6) (tyObject_SuggestcolonObjectType___VUPO9alfTq2Ar9a7ZtY9cSPDg* x, tyObject_SuggestcolonObjectType___VUPO9alfTq2Ar9a7ZtY9cSPDg* y);
typedef NU8 tyEnum_IdeCmd__p9ct5yRAwVUwh1wTpKTgABg;
typedef NU8 tyEnum_PrefixMatch__Y9cGLq2K6rNefjjqfIC9bauQ;
struct tyObject_SuggestcolonObjectType___VUPO9alfTq2Ar9a7ZtY9cSPDg {
tyEnum_IdeCmd__p9ct5yRAwVUwh1wTpKTgABg 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__Y9cGLq2K6rNefjjqfIC9bauQ prefix;
NU8 symkind;
NI scope;
NI localUsages;
NI globalUsages;
NI tokenLen;
NI version;
NU16 endLine;
NI endCol;
};
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_7) (tyObject_SuggestcolonObjectType___VUPO9alfTq2Ar9a7ZtY9cSPDg* x, tyObject_SuggestcolonObjectType___VUPO9alfTq2Ar9a7ZtY9cSPDg* 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___DlP7ZB0VJF31Xvkyqvp6Qw* x, tyObject_MappingcolonObjectType___DlP7ZB0VJF31Xvkyqvp6Qw* y, void* ClE_0);
void* ClE_0;
} tyProc__URHz9ciNjmRB4de9b6WS4iXw;
struct tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ {
NI Field0;
NI Field1;
};
struct tyObject_MappingcolonObjectType___DlP7ZB0VJF31Xvkyqvp6Qw {
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___DlP7ZB0VJF31Xvkyqvp6Qw* x, tyObject_MappingcolonObjectType___DlP7ZB0VJF31Xvkyqvp6Qw* y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_15) (tyObject_MappingcolonObjectType___DlP7ZB0VJF31Xvkyqvp6Qw* x, tyObject_MappingcolonObjectType___DlP7ZB0VJF31Xvkyqvp6Qw* 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__KPVKrfx82Va9azSnb0dl1RQ x, tyTuple__KPVKrfx82Va9azSnb0dl1RQ y, void* ClE_0);
void* ClE_0;
} tyProc__VxI0DUo0Ae9azGYnd0RjonQ;
typedef NU8 tyEnum_FootnoteType__jXnI8xEO3SXxVR9afYCJnyQ;
struct tyTuple__KPVKrfx82Va9azSnb0dl1RQ {
tyEnum_FootnoteType__jXnI8xEO3SXxVR9afYCJnyQ Field0;
NI Field1;
NI Field2;
NI Field3;
NimStringDesc* Field4;
};
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_22) (tyTuple__KPVKrfx82Va9azSnb0dl1RQ x, tyTuple__KPVKrfx82Va9azSnb0dl1RQ y);
typedef NU8 tyEnum_TNimKind__pspQAsqJLrw3jEKBD9bxmyQ;
typedef NU8 tySet_tyEnum_TNimTypeFlag__Yt5hq6z2IoHhKZrzIVrc1w;
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__pspQAsqJLrw3jEKBD9bxmyQ kind;
tySet_tyEnum_TNimTypeFlag__Yt5hq6z2IoHhKZrzIVrc1w flags;
TNimType* base;
TNimNode* node;
void* finalizer;
tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
typedef NU8 tyEnum_TNimNodeKind__rrp49bl1h9aEkXfXp9bNg0yZw;
struct TNimNode {
tyEnum_TNimNodeKind__rrp49bl1h9aEkXfXp9bNg0yZw kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_23) (tyTuple__KPVKrfx82Va9azSnb0dl1RQ x, tyTuple__KPVKrfx82Va9azSnb0dl1RQ y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_24) (tyTuple__KPVKrfx82Va9azSnb0dl1RQ x, tyTuple__KPVKrfx82Va9azSnb0dl1RQ y, void* ClE_0);
struct tyObject_Item__T7UjOImKJxoSfGY6SB3KMg {
tySequence__JSDKkkE7gMRTYRB9bRZ9bH7Q* descRst;
tySequence__sM4lkSb7zS6F7OVMvW9cffQ* substitutions;
NimStringDesc* sortName;
};
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (tyObject_Item__T7UjOImKJxoSfGY6SB3KMg x, tyObject_Item__T7UjOImKJxoSfGY6SB3KMg y, void* ClE_0);
void* ClE_0;
} tyProc__89bMNSqI54vbXxP9bMMNLCIg;
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_25) (tyObject_Item__T7UjOImKJxoSfGY6SB3KMg x, tyObject_Item__T7UjOImKJxoSfGY6SB3KMg y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_26) (tyObject_Item__T7UjOImKJxoSfGY6SB3KMg x, tyObject_Item__T7UjOImKJxoSfGY6SB3KMg y);
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (tyObject_TocItem__f5Z7HAch49an2qSNSGguP7Q x, tyObject_TocItem__f5Z7HAch49an2qSNSGguP7Q y, void* ClE_0);
void* ClE_0;
} tyProc__WEtPC7U0dE9c3UXfKGHiYrg;
struct tyObject_TocItem__f5Z7HAch49an2qSNSGguP7Q {
NimStringDesc* content;
NimStringDesc* sortName;
};
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_27) (tyObject_TocItem__f5Z7HAch49an2qSNSGguP7Q x, tyObject_TocItem__f5Z7HAch49an2qSNSGguP7Q y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_28) (tyObject_TocItem__f5Z7HAch49an2qSNSGguP7Q x, tyObject_TocItem__f5Z7HAch49an2qSNSGguP7Q y);
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (tyObject_IndexEntry__1q6h3V1uWiazOcEBnOLqyA x, tyObject_IndexEntry__1q6h3V1uWiazOcEBnOLqyA y, void* ClE_0);
void* ClE_0;
} tyProc__5YgYRgMJZsuh62P0m8Lehw;
struct tyObject_IndexEntry__1q6h3V1uWiazOcEBnOLqyA {
NimStringDesc* keyword;
NimStringDesc* link;
NimStringDesc* linkTitle;
NimStringDesc* linkDesc;
};
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_29) (tyObject_IndexEntry__1q6h3V1uWiazOcEBnOLqyA x, tyObject_IndexEntry__1q6h3V1uWiazOcEBnOLqyA y);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_30) (tyObject_IndexEntry__1q6h3V1uWiazOcEBnOLqyA x, tyObject_IndexEntry__1q6h3V1uWiazOcEBnOLqyA y);
struct tyObject_ItemFragment__s61pcFD9bQO8uWIzfNjndzg {
NIM_BOOL isRst;
union{
struct {tyObject_RstNode__o7Mf73b09cQpxU9cdK19aKkqQ* rst;
} _isRst_1;
struct {NimStringDesc* str;
} _isRst_2;
};
};
struct tySequence__vAEg9bb6P9cAvzrQae7aeKyA {
  TGenericSeq Sup;
  tyObject_DepNcolonObjectType___T7a6etQXL0CBg8BjsbsXpA* data[SEQ_DECL_SIZE];
};
struct tySequence__EK3kb9a029axOL6ZINxWj1hw {
  TGenericSeq Sup;
  tyTuple__Ztb9b8BdGY9bQ5Qd69ajoC2fQ data[SEQ_DECL_SIZE];
};
struct tySequence__GR8qmV1kNRcoQ2g76VFy3A {
  TGenericSeq Sup;
  tyObject_SuggestcolonObjectType___VUPO9alfTq2Ar9a7ZtY9cSPDg* 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__hIN6NiV2heFnG19c6HdDacw {
  TGenericSeq Sup;
  tyObject_MappingcolonObjectType___DlP7ZB0VJF31Xvkyqvp6Qw* data[SEQ_DECL_SIZE];
};
struct tySequence__YYKlUlCjbni3i58WM0kegw {
  TGenericSeq Sup;
  tyTuple__KPVKrfx82Va9azSnb0dl1RQ data[SEQ_DECL_SIZE];
};
struct tySequence__bLuZlbeJhlfg9axVlmjdJXw {
  TGenericSeq Sup;
  tyObject_Item__T7UjOImKJxoSfGY6SB3KMg data[SEQ_DECL_SIZE];
};
struct tySequence__spLz9azjOgbpYKrtmm9aMHEw {
  TGenericSeq Sup;
  tyObject_TocItem__f5Z7HAch49an2qSNSGguP7Q data[SEQ_DECL_SIZE];
};
struct tySequence__hf5PiuqqytWiEcddgIR5sQ {
  TGenericSeq Sup;
  tyObject_IndexEntry__1q6h3V1uWiazOcEBnOLqyA data[SEQ_DECL_SIZE];
};
struct tySequence__JSDKkkE7gMRTYRB9bRZ9bH7Q {
  TGenericSeq Sup;
  tyObject_ItemFragment__s61pcFD9bQO8uWIzfNjndzg data[SEQ_DECL_SIZE];
};
N_LIB_PRIVATE N_NIMCALL(tySequence__vAEg9bb6P9cAvzrQae7aeKyA*, newSeq__reorder_478)(NI len);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incRef__system_5302)(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* c);
static N_INLINE(NI, pluspercent___system_696)(NI x, NI y);
static N_INLINE(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g*, usrToCell__system_5264)(void* usr);
static N_INLINE(NI, minuspercent___system_716)(NI x, NI y);
static N_INLINE(void, decRef__system_5309)(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* c);
static N_INLINE(NIM_BOOL, ltpercent___system_1005)(NI x, NI y);
static N_INLINE(void, rtlAddZCT__system_5307)(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* c);
N_LIB_PRIVATE N_NOINLINE(void, addZCT__system_5258)(tyObject_CellSeq__nav876ELHgxScHhs30CKiA* s, tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* c);
N_LIB_PRIVATE N_NIMCALL(void, sort__reorder_494)(tyObject_DepNcolonObjectType___T7a6etQXL0CBg8BjsbsXpA** a, NI aLen_0, tyProc__YRIBfnKx4fhbilJmrYB0MA cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__reorder_511)(tyObject_DepNcolonObjectType___T7a6etQXL0CBg8BjsbsXpA** a, NI aLen_0, tyObject_DepNcolonObjectType___T7a6etQXL0CBg8BjsbsXpA** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__YRIBfnKx4fhbilJmrYB0MA cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order);
static N_INLINE(NI, star___pureZalgorithm_8)(NI x, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order);
N_LIB_PRIVATE N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_LIB_PRIVATE N_NIMCALL(tySequence__EK3kb9a029axOL6ZINxWj1hw*, newSeq__lookups_842)(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_867)(tyTuple__Ztb9b8BdGY9bQ5Qd69ajoC2fQ* a, NI aLen_0, tyProc__u9cu9aE0U3KrPDmkcU8DWlOw cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__lookups_884)(tyTuple__Ztb9b8BdGY9bQ5Qd69ajoC2fQ* a, NI aLen_0, tyTuple__Ztb9b8BdGY9bQ5Qd69ajoC2fQ* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__u9cu9aE0U3KrPDmkcU8DWlOw cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order);
N_LIB_PRIVATE N_NIMCALL(tySequence__GR8qmV1kNRcoQ2g76VFy3A*, newSeq__sigmatch_4830)(NI len);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__sigmatch_4841)(tyObject_SuggestcolonObjectType___VUPO9alfTq2Ar9a7ZtY9cSPDg** a, NI aLen_0, tyObject_SuggestcolonObjectType___VUPO9alfTq2Ar9a7ZtY9cSPDg** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__5ZzDzBBqlwfychCMx6jbDw cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order);
N_LIB_PRIVATE N_NIMCALL(void, sort__sem_1836)(NimStringDesc** a, NI aLen_0, tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order);
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ*, newSeq__systemZio_503)(NI len);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__sem_1853)(NimStringDesc** a, NI aLen_0, NimStringDesc** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order);
N_LIB_PRIVATE N_NIMCALL(NI, cmp__sem_1829)(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__TcYjciSJ3jKUT4ygglumjg 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__TcYjciSJ3jKUT4ygglumjg order);
N_LIB_PRIVATE N_NIMCALL(NI, cmp__int495056_395)(NI32 x, NI32 y);
N_LIB_PRIVATE N_NIMCALL(tySequence__hIN6NiV2heFnG19c6HdDacw*, newSeq__sourcemap_618)(NI len);
N_LIB_PRIVATE N_NIMCALL(void, sort__sourcemap_634)(tyObject_MappingcolonObjectType___DlP7ZB0VJF31Xvkyqvp6Qw** a, NI aLen_0, tyProc__URHz9ciNjmRB4de9b6WS4iXw cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__sourcemap_651)(tyObject_MappingcolonObjectType___DlP7ZB0VJF31Xvkyqvp6Qw** a, NI aLen_0, tyObject_MappingcolonObjectType___DlP7ZB0VJF31Xvkyqvp6Qw** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__URHz9ciNjmRB4de9b6WS4iXw cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg 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_2684)(tyTuple__KPVKrfx82Va9azSnb0dl1RQ* a, NI aLen_0, tyProc__VxI0DUo0Ae9azGYnd0RjonQ cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order);
N_LIB_PRIVATE N_NIMCALL(tySequence__YYKlUlCjbni3i58WM0kegw*, newSeq__packagesZdocutilsZrst_2696)(NI len);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__packagesZdocutilsZrst_2707)(tyTuple__KPVKrfx82Va9azSnb0dl1RQ* a, NI aLen_0, tyTuple__KPVKrfx82Va9azSnb0dl1RQ* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__VxI0DUo0Ae9azGYnd0RjonQ cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order);
N_LIB_PRIVATE N_NIMCALL(void, genericShallowAssign)(void* dest, void* src, TNimType* mt);
N_LIB_PRIVATE N_NIMCALL(NI, cmp__packagesZdocutilsZrst_2623)(tyTuple__KPVKrfx82Va9azSnb0dl1RQ x, tyTuple__KPVKrfx82Va9azSnb0dl1RQ y);
N_LIB_PRIVATE N_NIMCALL(tySequence__bLuZlbeJhlfg9axVlmjdJXw*, newSeq__docgen_5534)(NI len);
N_LIB_PRIVATE N_NIMCALL(void, genericSeqAssign)(void* dest, void* src, TNimType* mt);
N_LIB_PRIVATE N_NIMCALL(void, sort__docgen_5559)(tyObject_Item__T7UjOImKJxoSfGY6SB3KMg* a, NI aLen_0, tyProc__89bMNSqI54vbXxP9bMMNLCIg cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__docgen_5576)(tyObject_Item__T7UjOImKJxoSfGY6SB3KMg* a, NI aLen_0, tyObject_Item__T7UjOImKJxoSfGY6SB3KMg* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__89bMNSqI54vbXxP9bMMNLCIg cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order);
N_LIB_PRIVATE N_NIMCALL(tySequence__spLz9azjOgbpYKrtmm9aMHEw*, newSeq__docgen_3547)(NI len);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__docgen_6896)(tyObject_TocItem__f5Z7HAch49an2qSNSGguP7Q* a, NI aLen_0, tyObject_TocItem__f5Z7HAch49an2qSNSGguP7Q* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__WEtPC7U0dE9c3UXfKGHiYrg cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order);
N_LIB_PRIVATE N_NIMCALL(void, sort__docgen_6878)(tyObject_TocItem__f5Z7HAch49an2qSNSGguP7Q* a, NI aLen_0, tyProc__WEtPC7U0dE9c3UXfKGHiYrg cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order);
N_LIB_PRIVATE N_NIMCALL(tySequence__hf5PiuqqytWiEcddgIR5sQ*, newSeq__packagesZdocutilsZrstgen_6124)(NI len);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__packagesZdocutilsZrstgen_6135)(tyObject_IndexEntry__1q6h3V1uWiazOcEBnOLqyA* a, NI aLen_0, tyObject_IndexEntry__1q6h3V1uWiazOcEBnOLqyA* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__5YgYRgMJZsuh62P0m8Lehw cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order);
extern TNimType NTIfootnotesubst__KPVKrfx82Va9azSnb0dl1RQ_;
extern TNimType NTIitempre__JSDKkkE7gMRTYRB9bRZ9bH7Q_;
extern TNimType NTIseqLstringT__sM4lkSb7zS6F7OVMvW9cffQ_;
extern tyObject_GcHeap__ZRn9bWCksoiGwT2drZZzyWQ gch__system_5211;
N_LIB_PRIVATE N_NIMCALL(void, fill__pureZstrutils_1405)(NI* a, NI aLen_0, NI value) {
	NI xX60gensym163_;
	xX60gensym163_ = ((NI) 0);
	{
		while (1) {
			if (!(xX60gensym163_ <= (aLen_0-1))) goto LA2;
			a[xX60gensym163_] = value;
			xX60gensym163_ += ((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_5302)(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* 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__nhn83Yf9cX7rcmG5W9b4oa6g*, usrToCell__system_5264)(void* usr) {
	tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* result;
	NI T1_;
	result = (tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g*)0;
	T1_ = (NI)0;
	T1_ = minuspercent___system_716(((NI) (ptrdiff_t) (usr)), ((NI) 8));
	result = ((tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g*) (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_5307)(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* c) {
	addZCT__system_5258((&gch__system_5211.zct), c);
}
static N_INLINE(void, decRef__system_5309)(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* 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_5307(c);
	}
	LA4_: ;
}
static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* T5_;
		if (!!((src == NIM_NIL))) goto LA3_;
		T5_ = (tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g*)0;
		T5_ = usrToCell__system_5264(src);
		incRef__system_5302(T5_);
	}
	LA3_: ;
	{
		tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* T10_;
		if (!!(((*dest) == NIM_NIL))) goto LA8_;
		T10_ = (tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g*)0;
		T10_ = usrToCell__system_5264((*dest));
		decRef__system_5309(T10_);
	}
	LA8_: ;
	(*dest) = src;
}
static N_INLINE(NI, star___pureZalgorithm_8)(NI x, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg 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_511)(tyObject_DepNcolonObjectType___T7a6etQXL0CBg8BjsbsXpA** a, NI aLen_0, tyObject_DepNcolonObjectType___T7a6etQXL0CBg8BjsbsXpA** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__YRIBfnKx4fhbilJmrYB0MA cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg 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_494)(tyObject_DepNcolonObjectType___T7a6etQXL0CBg8BjsbsXpA** a, NI aLen_0, tyProc__YRIBfnKx4fhbilJmrYB0MA cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order) {
	NI n;
	tySequence__vAEg9bb6P9cAvzrQae7aeKyA* b;
	NI s;
	n = aLen_0;
	b = newSeq__reorder_478(((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_511(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__vAEg9bb6P9cAvzrQae7aeKyA*, sorted__reorder_466)(tyObject_DepNcolonObjectType___T7a6etQXL0CBg8BjsbsXpA** a, NI aLen_0, tyProc__YRIBfnKx4fhbilJmrYB0MA cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order) {
	tySequence__vAEg9bb6P9cAvzrQae7aeKyA* result;
	result = NIM_NIL;
	result = newSeq__reorder_478(((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_494((result) ? (result->data) : NIM_NIL, (result ? result->Sup.len : 0), cmp, order);
	return result;
}
static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
	tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* T1_;
	T1_ = (tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g*)0;
	T1_ = usrToCell__system_5264(p);
	decRef__system_5309(T1_);
}
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__lookups_884)(tyTuple__Ztb9b8BdGY9bQ5Qd69ajoC2fQ* a, NI aLen_0, tyTuple__Ztb9b8BdGY9bQ5Qd69ajoC2fQ* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__u9cu9aE0U3KrPDmkcU8DWlOw cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg 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_867)(tyTuple__Ztb9b8BdGY9bQ5Qd69ajoC2fQ* a, NI aLen_0, tyProc__u9cu9aE0U3KrPDmkcU8DWlOw cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order) {
	NI n;
	tySequence__EK3kb9a029axOL6ZINxWj1hw* b;
	NI s;
	n = aLen_0;
	b = newSeq__lookups_842(((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_884(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__EK3kb9a029axOL6ZINxWj1hw*, sorted__lookups_830)(tyTuple__Ztb9b8BdGY9bQ5Qd69ajoC2fQ* a, NI aLen_0, tyProc__u9cu9aE0U3KrPDmkcU8DWlOw cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order) {
	tySequence__EK3kb9a029axOL6ZINxWj1hw* result;
	result = NIM_NIL;
	result = newSeq__lookups_842(((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_867((result) ? (result->data) : NIM_NIL, (result ? result->Sup.len : 0), cmp, order);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__sigmatch_4841)(tyObject_SuggestcolonObjectType___VUPO9alfTq2Ar9a7ZtY9cSPDg** a, NI aLen_0, tyObject_SuggestcolonObjectType___VUPO9alfTq2Ar9a7ZtY9cSPDg** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__5ZzDzBBqlwfychCMx6jbDw cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg 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_4818)(tyObject_SuggestcolonObjectType___VUPO9alfTq2Ar9a7ZtY9cSPDg** a, NI aLen_0, tyProc__5ZzDzBBqlwfychCMx6jbDw cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order) {
	NI n;
	tySequence__GR8qmV1kNRcoQ2g76VFy3A* b;
	NI s;
	n = aLen_0;
	b = newSeq__sigmatch_4830(((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_4841(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_1853)(NimStringDesc** a, NI aLen_0, NimStringDesc** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg 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_1836)(NimStringDesc** a, NI aLen_0, tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg 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_1853(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_1825)(NimStringDesc** a, NI aLen_0, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order) {
	tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA T1_;
	nimZeroMem((void*)(&T1_), sizeof(tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA));
	T1_.ClP_0 = ((TM__JdC9c6SaUkvO1XjYuWP1JWQ_10) (cmp__sem_1829)); T1_.ClE_0 = NIM_NIL;
	sort__sem_1836(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__TcYjciSJ3jKUT4ygglumjg 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__TcYjciSJ3jKUT4ygglumjg 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__TcYjciSJ3jKUT4ygglumjg order) {
	tyProc__CBoNLvw7Pjo72NRN8hQDEA T1_;
	nimZeroMem((void*)(&T1_), sizeof(tyProc__CBoNLvw7Pjo72NRN8hQDEA));
	T1_.ClP_0 = ((TM__JdC9c6SaUkvO1XjYuWP1JWQ_13) (cmp__int495056_395)); T1_.ClE_0 = NIM_NIL;
	sort__icZcbackend_243(a, aLen_0, T1_, order);
}
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__sourcemap_651)(tyObject_MappingcolonObjectType___DlP7ZB0VJF31Xvkyqvp6Qw** a, NI aLen_0, tyObject_MappingcolonObjectType___DlP7ZB0VJF31Xvkyqvp6Qw** b, NI bLen_0, NI lo, NI m, NI hi, tyProc__URHz9ciNjmRB4de9b6WS4iXw cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg 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___DlP7ZB0VJF31Xvkyqvp6Qw** a, NI aLen_0, tyProc__URHz9ciNjmRB4de9b6WS4iXw cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order) {
	NI n;
	tySequence__hIN6NiV2heFnG19c6HdDacw* 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__hIN6NiV2heFnG19c6HdDacw*, sorted__sourcemap_606)(tyObject_MappingcolonObjectType___DlP7ZB0VJF31Xvkyqvp6Qw** a, NI aLen_0, tyProc__URHz9ciNjmRB4de9b6WS4iXw cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order) {
	tySequence__hIN6NiV2heFnG19c6HdDacw* 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_1829)); T1_.ClE_0 = NIM_NIL;
	result = binarySearch__packagesZdocutilsZhighlite_324(a, aLen_0, key, T1_);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__packagesZdocutilsZrst_2707)(tyTuple__KPVKrfx82Va9azSnb0dl1RQ* a, NI aLen_0, tyTuple__KPVKrfx82Va9azSnb0dl1RQ* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__VxI0DUo0Ae9azGYnd0RjonQ cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg 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__KPVKrfx82Va9azSnb0dl1RQ_));
			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__KPVKrfx82Va9azSnb0dl1RQ_));
				i += ((NI) 1);
			}
			goto LA13_;
			LA17_: ;
			{
				genericShallowAssign((void*)(&a[k]), (void*)(&a[j]), (&NTIfootnotesubst__KPVKrfx82Va9azSnb0dl1RQ_));
				j += ((NI) 1);
			}
			LA13_: ;
			k += ((NI) 1);
		} LA10: ;
	}
	{
		while (1) {
			if (!(k < j)) goto LA21;
			genericShallowAssign((void*)(&a[k]), (void*)(&b[i]), (&NTIfootnotesubst__KPVKrfx82Va9azSnb0dl1RQ_));
			k += ((NI) 1);
			i += ((NI) 1);
		} LA21: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__packagesZdocutilsZrst_2684)(tyTuple__KPVKrfx82Va9azSnb0dl1RQ* a, NI aLen_0, tyProc__VxI0DUo0Ae9azGYnd0RjonQ cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order) {
	NI n;
	tySequence__YYKlUlCjbni3i58WM0kegw* b;
	NI s;
	n = aLen_0;
	b = newSeq__packagesZdocutilsZrst_2696(((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_2707(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_2619)(tyTuple__KPVKrfx82Va9azSnb0dl1RQ* a, NI aLen_0, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order) {
	tyProc__VxI0DUo0Ae9azGYnd0RjonQ T1_;
	nimZeroMem((void*)(&T1_), sizeof(tyProc__VxI0DUo0Ae9azGYnd0RjonQ));
	T1_.ClP_0 = ((TM__JdC9c6SaUkvO1XjYuWP1JWQ_24) (cmp__packagesZdocutilsZrst_2623)); T1_.ClE_0 = NIM_NIL;
	sort__packagesZdocutilsZrst_2684(a, aLen_0, T1_, order);
}
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__docgen_5576)(tyObject_Item__T7UjOImKJxoSfGY6SB3KMg* a, NI aLen_0, tyObject_Item__T7UjOImKJxoSfGY6SB3KMg* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__89bMNSqI54vbXxP9bMMNLCIg cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg 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_5559)(tyObject_Item__T7UjOImKJxoSfGY6SB3KMg* a, NI aLen_0, tyProc__89bMNSqI54vbXxP9bMMNLCIg cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order) {
	NI n;
	tySequence__bLuZlbeJhlfg9axVlmjdJXw* b;
	NI s;
	n = aLen_0;
	b = newSeq__docgen_5534(((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_5576(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__bLuZlbeJhlfg9axVlmjdJXw*, sorted__docgen_5522)(tyObject_Item__T7UjOImKJxoSfGY6SB3KMg* a, NI aLen_0, tyProc__89bMNSqI54vbXxP9bMMNLCIg cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order) {
	tySequence__bLuZlbeJhlfg9axVlmjdJXw* result;
	result = NIM_NIL;
	result = newSeq__docgen_5534(((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__JSDKkkE7gMRTYRB9bRZ9bH7Q_));
				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_5559((result) ? (result->data) : NIM_NIL, (result ? result->Sup.len : 0), cmp, order);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ*, sorted__docgen_6719)(NimStringDesc** a, NI aLen_0, tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg 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_1836((result) ? (result->data) : NIM_NIL, (result ? result->Sup.len : 0), cmp, order);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__docgen_6896)(tyObject_TocItem__f5Z7HAch49an2qSNSGguP7Q* a, NI aLen_0, tyObject_TocItem__f5Z7HAch49an2qSNSGguP7Q* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__WEtPC7U0dE9c3UXfKGHiYrg cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg 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_6878)(tyObject_TocItem__f5Z7HAch49an2qSNSGguP7Q* a, NI aLen_0, tyProc__WEtPC7U0dE9c3UXfKGHiYrg cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order) {
	NI n;
	tySequence__spLz9azjOgbpYKrtmm9aMHEw* b;
	NI s;
	n = aLen_0;
	b = newSeq__docgen_3547(((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_6896(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__spLz9azjOgbpYKrtmm9aMHEw*, sorted__docgen_6984)(tyObject_TocItem__f5Z7HAch49an2qSNSGguP7Q* a, NI aLen_0, tyProc__WEtPC7U0dE9c3UXfKGHiYrg cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order) {
	tySequence__spLz9azjOgbpYKrtmm9aMHEw* result;
	result = NIM_NIL;
	result = newSeq__docgen_3547(((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_6878((result) ? (result->data) : NIM_NIL, (result ? result->Sup.len : 0), cmp, order);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__packagesZdocutilsZrstgen_6135)(tyObject_IndexEntry__1q6h3V1uWiazOcEBnOLqyA* a, NI aLen_0, tyObject_IndexEntry__1q6h3V1uWiazOcEBnOLqyA* b, NI bLen_0, NI lo, NI m, NI hi, tyProc__5YgYRgMJZsuh62P0m8Lehw cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg 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_6113)(tyObject_IndexEntry__1q6h3V1uWiazOcEBnOLqyA* a, NI aLen_0, tyProc__5YgYRgMJZsuh62P0m8Lehw cmp, tyEnum_SortOrder__TcYjciSJ3jKUT4ygglumjg order) {
	NI n;
	tySequence__hf5PiuqqytWiEcddgIR5sQ* b;
	NI s;
	n = aLen_0;
	b = newSeq__packagesZdocutilsZrstgen_6124(((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_6135(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: ;
	}
}
