/* Generated by Nim Compiler v0.10.2 */
/*   (c) 2014 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_INTBITS 32
#include "nimbase.h"

#include <string.h>

#include <stdio.h>
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tcell44733 tcell44733;
typedef struct TNimType TNimType;
typedef struct tcellseq44749 tcellseq44749;
typedef struct tgcheap46816 tgcheap46816;
typedef struct tcellset44745 tcellset44745;
typedef struct tpagedesc44741 tpagedesc44741;
typedef struct tmemregion27010 tmemregion27010;
typedef struct tsmallchunk26240 tsmallchunk26240;
typedef struct tllchunk27004 tllchunk27004;
typedef struct tbigchunk26242 tbigchunk26242;
typedef struct tintset26217 tintset26217;
typedef struct ttrunk26213 ttrunk26213;
typedef struct tavlnode27008 tavlnode27008;
typedef struct tgcstat46814 tgcstat46814;
typedef struct trstgenerator359016 trstgenerator359016;
typedef struct trstnode343011 trstnode343011;
typedef struct trstnodeseq343009 trstnodeseq343009;
typedef struct TNimObject TNimObject;
typedef struct TNimNode TNimNode;
typedef struct stringtableobj133012 stringtableobj133012;
typedef struct TY359034 TY359034;
typedef struct ttocentry359012 ttocentry359012;
typedef struct table359052 table359052;
typedef struct keyvaluepairseq359055 keyvaluepairseq359055;
typedef struct keyvaluepair359058 keyvaluepair359058;
typedef struct codeblockparams359020 codeblockparams359020;
typedef struct keyvaluepair133008 keyvaluepair133008;
typedef struct tgeneraltokenizer353023 tgeneraltokenizer353023;
typedef struct TY116804 TY116804;
typedef struct TY362801 TY362801;
typedef struct TY120608 TY120608;
typedef struct TY362804 TY362804;
typedef struct tindexentry360264 tindexentry360264;
typedef struct table360277 table360277;
typedef struct keyvaluepairseq360280 keyvaluepairseq360280;
typedef struct keyvaluepair360283 keyvaluepair360283;
typedef struct twin32finddata104019 twin32finddata104019;
typedef struct tfiletime103079 tfiletime103079;
typedef struct TY360879 TY360879;
typedef struct TY360880 TY360880;
typedef struct slice85779 slice85779;
typedef struct tbasechunk26238 tbasechunk26238;
typedef struct tfreecell26230 tfreecell26230;
typedef struct keyvaluepairseq133010 keyvaluepairseq133010;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  tcell44733  {
NI Refcount;
TNimType* Typ;
};
struct  tcellseq44749  {
NI Len;
NI Cap;
tcell44733** D;
};
struct  tcellset44745  {
NI Counter;
NI Max;
tpagedesc44741* Head;
tpagedesc44741** Data;
};
typedef tsmallchunk26240* TY27022[512];
typedef ttrunk26213* ttrunkbuckets26215[256];
struct  tintset26217  {
ttrunkbuckets26215 Data;
};
struct  tmemregion27010  {
NI Minlargeobj;
NI Maxlargeobj;
TY27022 Freesmallchunks;
tllchunk27004* Llmem;
NI Currmem;
NI Maxmem;
NI Freemem;
NI Lastsize;
tbigchunk26242* Freechunkslist;
tintset26217 Chunkstarts;
tavlnode27008* Root;
tavlnode27008* Deleted;
tavlnode27008* Last;
tavlnode27008* Freeavlnodes;
};
struct  tgcstat46814  {
NI Stackscans;
NI Cyclecollections;
NI Maxthreshold;
NI Maxstacksize;
NI Maxstackcells;
NI Cycletablesize;
NI64 Maxpause;
};
struct  tgcheap46816  {
void* Stackbottom;
NI Cyclethreshold;
tcellseq44749 Zct;
tcellseq44749 Decstack;
tcellset44745 Cycleroots;
tcellseq44749 Tempstack;
NI Recgclock;
tmemregion27010 Region;
tgcstat46814 Stat;
};
struct  trstnode343011  {
NU8 Kind;
NimStringDesc* Text;
NI Level;
trstnodeseq343009* Sons;
};
typedef N_NIMCALL_PTR(void, TY3089) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3094) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3089 marker;
TY3094 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  ttocentry359012  {
trstnode343011* N;
NimStringDesc* Refname;
NimStringDesc* Header;
};
typedef N_NIMCALL_PTR(NimStringDesc*, tfindfilehandler344023) (NimStringDesc* filename);
typedef N_NIMCALL_PTR(void, tmsghandler344021) (NimStringDesc* filename, NI line, NI col, NU8 msgkind, NimStringDesc* arg);
typedef NimStringDesc* TY359042[5];
struct keyvaluepair359058 {
NU8 Field0;
NimStringDesc* Field1;
NI Field2;
};
struct  table359052  {
keyvaluepairseq359055* Data;
NI Counter;
};
struct  trstgenerator359016  {
  TNimObject Sup;
NU8 Target;
stringtableobj133012* Config;
NI Splitafter;
TY359034* Tocpart;
NIM_BOOL Hastoc;
NimStringDesc* Theindex;
NU8 Options;
tfindfilehandler344023 Findfile;
tmsghandler344021 Msghandler;
NimStringDesc* Filename;
TY359042 Meta;
NimStringDesc* Currentsection;
table359052 Seenindexterms;
};
typedef NimStringDesc* TY198620[4];
typedef NimStringDesc* TY198301[1];
typedef NimStringDesc* TY170951[2];
typedef NU8 TY212607[32];
struct  codeblockparams359020  {
NIM_BOOL Numberlines;
NI Startline;
NimStringDesc* Langstr;
NU8 Lang;
};
struct keyvaluepair133008 {
NimStringDesc* Field0;
NimStringDesc* Field1;
};
typedef NimStringDesc* TY261532[1];
struct  tgeneraltokenizer353023  {
  TNimObject Sup;
NU8 Kind;
NI Start;
NI Length;
NCSTRING Buf;
NI Pos;
NU8 State;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
typedef NimStringDesc* TY353082[33];
struct TY116804 {
NimStringDesc* Field0;
NimStringDesc* Field1;
NimStringDesc* Field2;
};
struct  tindexentry360264  {
NimStringDesc* Keyword;
NimStringDesc* Link;
NimStringDesc* Linktitle;
NimStringDesc* Linkdesc;
};
struct keyvaluepair360283 {
NU8 Field0;
tindexentry360264 Field1;
TY362804* Field2;
};
struct  table360277  {
keyvaluepairseq360280* Data;
NI Counter;
};
struct TY362801 {
TY120608* Field0;
TY362804* Field1;
table360277 Field2;
};
struct  tfiletime103079  {
NI32 Dwlowdatetime;
NI32 Dwhighdatetime;
};
typedef NI16 TY104028[260];
typedef NI16 TY104032[14];
struct  twin32finddata104019  {
NI32 Dwfileattributes;
tfiletime103079 Ftcreationtime;
tfiletime103079 Ftlastaccesstime;
tfiletime103079 Ftlastwritetime;
NI32 Nfilesizehigh;
NI32 Nfilesizelow;
NI32 Dwreserved0;
NI32 Dwreserved1;
TY104028 Cfilename;
TY104032 Calternatefilename;
};
typedef N_STDCALL_PTR(NI32, TY104045) (NI hfindfile, twin32finddata104019* lpfindfiledata);
typedef N_STDCALL_PTR(void, TY104205) (NI hfindfile);
typedef struct {
N_NIMCALL_PTR(NI, ClPrc) (NimStringDesc* x_363565, NimStringDesc* y_363567, void* ClEnv);
void* ClEnv;
} TY363571;
typedef N_CLOSURE_PTR(NI, TMP4792) (NimStringDesc* x_363548, NimStringDesc* y_363550, void* ClEnv);
typedef struct {
N_NIMCALL_PTR(NI, ClPrc) (tindexentry360264 x_361566, tindexentry360264 y_361568, void* ClEnv);
void* ClEnv;
} TY361572;
typedef N_CLOSURE_PTR(NI, TMP4796) (tindexentry360264 x_362592, tindexentry360264 y_362594, void* ClEnv);
typedef N_CLOSURE_PTR(NI, TMP4806) (tindexentry360264 x_361549, tindexentry360264 y_361551, void* ClEnv);
struct TY360880 {
NI Field0;
NimStringDesc* Field1;
};
struct  slice85779  {
NI A;
NI B;
};
typedef NimStringDesc* TY209063[3];
typedef NI TY26220[16];
struct  tpagedesc44741  {
tpagedesc44741* Next;
NI Key;
TY26220 Bits;
};
struct  tbasechunk26238  {
NI Prevsize;
NI Size;
NIM_BOOL Used;
};
struct  tsmallchunk26240  {
  tbasechunk26238 Sup;
tsmallchunk26240* Next;
tsmallchunk26240* Prev;
tfreecell26230* Freelist;
NI Free;
NI Acc;
NF Data;
};
struct  tllchunk27004  {
NI Size;
NI Acc;
tllchunk27004* Next;
};
struct  tbigchunk26242  {
  tbasechunk26238 Sup;
tbigchunk26242* Next;
tbigchunk26242* Prev;
NI Align;
NF Data;
};
struct  ttrunk26213  {
ttrunk26213* Next;
NI Key;
TY26220 Bits;
};
typedef tavlnode27008* TY27014[2];
struct  tavlnode27008  {
TY27014 Link;
NI Key;
NI Upperbound;
NI Level;
};
struct  stringtableobj133012  {
  TNimObject Sup;
NI Counter;
keyvaluepairseq133010* Data;
NU8 Mode;
};
struct  tfreecell26230  {
tfreecell26230* Next;
NI Zerofield;
};
struct trstnodeseq343009 {
  TGenericSeq Sup;
  trstnode343011* data[SEQ_DECL_SIZE];
};
struct TY359034 {
  TGenericSeq Sup;
  ttocentry359012 data[SEQ_DECL_SIZE];
};
struct keyvaluepairseq359055 {
  TGenericSeq Sup;
  keyvaluepair359058 data[SEQ_DECL_SIZE];
};
struct TY120608 {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct TY362804 {
  TGenericSeq Sup;
  tindexentry360264 data[SEQ_DECL_SIZE];
};
struct keyvaluepairseq360280 {
  TGenericSeq Sup;
  keyvaluepair360283 data[SEQ_DECL_SIZE];
};
struct TY360879 {
  TGenericSeq Sup;
  TY360880 data[SEQ_DECL_SIZE];
};
struct keyvaluepairseq133010 {
  TGenericSeq Sup;
  keyvaluepair133008 data[SEQ_DECL_SIZE];
};
N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(tcell44733*, usrtocell_48446)(void* usr);
static N_INLINE(void, rtladdzct_50004)(tcell44733* c);
N_NOINLINE(void, addzct_48417)(tcellseq44749* s, tcell44733* c);
N_NIMCALL(void, renderaux_359589)(trstgenerator359016* d, trstnode343011* n, NimStringDesc** result);
N_NIMCALL(NI, len_343084)(trstnode343011* n);
N_NIMCALL(void, renderrsttoout_359579)(trstgenerator359016* d, trstnode343011* n, NimStringDesc** result);
N_NIMCALL(void, renderheadline_365281)(trstgenerator359016* d, trstnode343011* n, NimStringDesc** result);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(NimStringDesc*, rstnodetorefname_344061)(trstnode343011* n);
N_NIMCALL(TGenericSeq*, setLengthSeq)(TGenericSeq* seq, NI elemsize, NI newlen);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(void, dispa_359544)(NU8 target, NimStringDesc** dest, NimStringDesc* xml, NimStringDesc* tex, NimStringDesc** args, NI argsLen0);
N_NIMCALL(void, nsuAddf)(NimStringDesc** s, NimStringDesc* formatstr, NimStringDesc** a, NI aLen0);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
N_NIMCALL(NimStringDesc*, nimCharToStr)(NIM_CHAR x);
N_NIMCALL(void, setindexterm_359710)(trstgenerator359016* d, NimStringDesc* id, NimStringDesc* term, NimStringDesc* linktitle, NimStringDesc* linkdesc);
N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s, NIM_CHAR c);
N_NIMCALL(NimStringDesc*, noschangeFileExt)(NimStringDesc* filename, NimStringDesc* ext);
N_NIMCALL(NimStringDesc*, nosextractFilename)(NimStringDesc* path);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
static N_INLINE(void, appendChar)(NimStringDesc* dest, NIM_CHAR c);
N_NIMCALL(NimStringDesc*, quoteindexcolumn_359690)(NimStringDesc* text);
N_NIMCALL(NimStringDesc*, nsuReplaceStr)(NimStringDesc* s, NimStringDesc* sub, NimStringDesc* by);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(void, insert_87401)(NimStringDesc** x, NimStringDesc* item, NI i);
N_NIMCALL(NimStringDesc*, striptochtml_365260)(NimStringDesc* s);
N_NIMCALL(NI, nsuFindChar)(NimStringDesc* s, NIM_CHAR sub, NI start);
N_NIMCALL(void, nsuDelete)(NimStringDesc** s, NI first, NI last);
N_NIMCALL(NimStringDesc*, nsuRepeatChar)(NI count, NIM_CHAR c);
N_NIMCALL(void, renderoverline_365425)(trstgenerator359016* d, trstnode343011* n, NimStringDesc** result);
N_NIMCALL(void, renderaux_359629)(trstgenerator359016* d, trstnode343011* n, NimStringDesc* frmta, NimStringDesc* frmtb, NimStringDesc** result);
N_NIMCALL(void, renderfield_367327)(trstgenerator359016* d, trstnode343011* n, NimStringDesc** result);
N_NIMCALL(NimStringDesc*, addnodes_344067)(trstnode343011* n);
N_NIMCALL(NimStringDesc*, esc_359407)(NU8 target, NimStringDesc* s, NI splitafter);
N_NIMCALL(NI, nextsplitpoint_359349)(NimStringDesc* s, NI start);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
static N_INLINE(void, escchar_359337)(NU8 target, NimStringDesc** dest, NIM_CHAR c);
N_NIMCALL(void, addxmlchar_359299)(NimStringDesc** dest, NIM_CHAR c);
N_NIMCALL(void, addtexchar_359321)(NimStringDesc** dest, NIM_CHAR c);
N_NIMCALL(NimStringDesc*, nsuStrip)(NimStringDesc* s, NIM_BOOL leading, NIM_BOOL trailing);
N_NIMCALL(NI, nsuCmpIgnoreStyle)(NimStringDesc* a, NimStringDesc* b);
N_NOINLINE(void, raiseassert_86357)(NimStringDesc* msg);
N_NIMCALL(NimStringDesc*, texcolumns_367289)(trstnode343011* n);
N_NIMCALL(trstnode343011*, lastson_343162)(trstnode343011* n);
N_NIMCALL(void, renderimage_365598)(trstgenerator359016* d, trstnode343011* n, NimStringDesc** result);
N_NIMCALL(NimStringDesc*, getfieldvalue_344073)(trstnode343011* n, NimStringDesc* fieldname);
N_NIMCALL(NIM_BOOL, allcharsinset_98479)(NimStringDesc* s, TY212607 theset);
N_NIMCALL(NimStringDesc*, dispf_359521)(NU8 target, NimStringDesc* xml, NimStringDesc* tex, NimStringDesc** args, NI argsLen0);
N_NIMCALL(NimStringDesc*, nsuFormatOpenArray)(NimStringDesc* formatstr, NimStringDesc** a, NI aLen0);
N_NIMCALL(NimStringDesc*, getargument_344080)(trstnode343011* n);
N_NIMCALL(void, rendercodeblock_366840)(trstgenerator359016* d, trstnode343011* n, NimStringDesc** result);
N_NIMCALL(void, parsecodeblockparams_366007)(trstgenerator359016* d, trstnode343011* n, codeblockparams359020* Result);
N_NIMCALL(void, init_359078)(codeblockparams359020* p);
N_NIMCALL(void, parsecodeblockfield_365991)(trstgenerator359016* d, trstnode343011* n, codeblockparams359020* params);
N_NIMCALL(NimStringDesc*, nsuToLowerStr)(NimStringDesc* s);
N_NIMCALL(NI, npuParseInt)(NimStringDesc* s, NI* number, NI start);
N_NIMCALL(NimStringDesc*, getfieldvalue_347823)(trstnode343011* n);
N_NIMCALL(NU8, getsourcelanguage_353093)(NimStringDesc* name);
N_NOINLINE(void, chckNil)(void* p);
N_NIMCALL(void, buildlineshtmltable_366635)(codeblockparams359020 params, NimStringDesc* code, keyvaluepair133008* Result);
N_NIMCALL(NI, nsuCountLines)(NimStringDesc* s);
N_NIMCALL(void, initgeneraltokenizer_353229)(tgeneraltokenizer353023* g, NimStringDesc* buf);
N_NIMCALL(void, getnexttoken_356166)(tgeneraltokenizer353023* g, NU8 lang);
N_NIMCALL(NimStringDesc*, copyStrLast)(NimStringDesc* s, NI start_74628, NI last);
N_NIMCALL(NimStringDesc*, copyStrLast)(NimStringDesc* s, NI first, NI last);
N_NIMCALL(void, deinitgeneraltokenizer_353240)(tgeneraltokenizer353023* g);
N_NIMCALL(void, rendercontainer_367266)(trstgenerator359016* d, trstnode343011* n, NimStringDesc** result);
N_NIMCALL(void, renderindexterm_359871)(trstgenerator359016* d, trstnode343011* n_359874, NimStringDesc** result);
N_NIMCALL(NIM_BOOL, haskey_359880)(table359052 t_359887, NimStringDesc* key_359890);
N_NIMCALL(void, HEX5BHEX5DHEX3D_359974)(table359052* t_359983, NimStringDesc* key_359987, NI val_359989);
N_NIMCALL(NI, HEX5BHEX5D_359943)(table359052 t_359950, NimStringDesc* key_359953);
N_NIMCALL(void, rendersmiley_365975)(trstgenerator359016* d, trstnode343011* n, NimStringDesc** result);
N_NIMCALL(NimStringDesc*, nsuFormatSingleElem)(NimStringDesc* formatstr, NimStringDesc* a);
N_NIMCALL(NimStringDesc*, nstGet)(stringtableobj133012* t, NimStringDesc* key);
N_NIMCALL(void, nimGCvisit)(void* d, NI op);
N_NIMCALL(void, TMP4627)(void* p, NI op);
N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
N_NIMCALL(void, nossplitFile)(NimStringDesc* path, TY116804* Result);
N_NIMCALL(void, inittable_359120)(NI initialsize_359125, table359052* Result);
N_NIMCALL(NI, nsuParseInt)(NimStringDesc* s);
N_NIMCALL(void, rendertocentry_365538)(trstgenerator359016* d, ttocentry359012 e, NimStringDesc** result);
N_NIMCALL(void, rendertocentries_365554)(trstgenerator359016* d, NI* j, NI lvl, NimStringDesc** result);
N_NIMCALL(void, writefile_12845)(NimStringDesc* filename, NimStringDesc* content);
N_NIMCALL(void, readindexdir_362798)(NimStringDesc* dir, TY362801* Result);
N_NIMCALL(void, inittable_362830)(NI initialsize_362835, table360277* Result);
N_NIMCALL(void, TMP4785)(void* p, NI op);
N_NIMCALL(NI, findfirstfile_113416)(NimStringDesc* a, twin32finddata104019* b);
N_NIMCALL(NimStringDesc*, HEX2F_116499)(NimStringDesc* head, NimStringDesc* tail);
static N_INLINE(NIM_BOOL, skipfinddata_113436)(twin32finddata104019* f);
N_NIMCALL(NimStringDesc*, HEX24_79195)(NI16* s);
N_NIMCALL(NIM_BOOL, nsuEndsWith)(NimStringDesc* s, NimStringDesc* suffix);
N_NIMCALL(FILE*, open_12617)(NimStringDesc* filename, NU8 mode, NI bufsize);
N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
N_NIMCALL(NIM_BOOL, readline_12889)(FILE* f, NimStringDesc** line);
N_NIMCALL(NimStringDesc*, copyStr)(NimStringDesc* s, NI start);
N_NIMCALL(NimStringDesc*, copyStr)(NimStringDesc* s, NI first);
N_NIMCALL(NIM_BOOL, isdocumentationtitle_360777)(NimStringDesc* hyperlink);
N_NIMCALL(TY120608*, nsuSplitChar)(NimStringDesc* s, NIM_CHAR sep);
N_NIMCALL(NimStringDesc*, unquoteindexcolumn_359700)(NimStringDesc* text);
N_NIMCALL(TGenericSeq*, incrSeq)(TGenericSeq* seq, NI elemsize);
N_NIMCALL(NI, len_363285)(table360277 t_363292);
N_NIMCALL(void, HEX5BHEX5DHEX3D_363301)(table360277* t_363310, tindexentry360264 key_363314, TY362804* val_363316);
static N_INLINE(NI, HEX21HEX26_130025)(NI h, NI val);
N_NIMCALL(NI, hash_130839)(NimStringDesc* x);
static N_INLINE(NimStringDesc*, or_359568)(NimStringDesc* x, NimStringDesc* y);
static N_INLINE(NI, HEX21HEX24_130054)(NI h);
N_NIMCALL(void, sort_363552)(NimStringDesc** a_363560, NI a_363560Len0, TY363571 cmp_363570, NU8 order_363573);
N_NIMCALL(NI, cmp_4517)(NimStringDesc* x, NimStringDesc* y);
N_NIMCALL(void, genericSeqAssign)(void* dest, void* src_81204, TNimType* mt);
N_NIMCALL(NimStringDesc*, generatedocumentationjumps_362423)(table360277 docs);
N_NIMCALL(void, sort_361553)(tindexentry360264* a_361561, NI a_361561Len0, TY361572 cmp_361571, NU8 order_361574);
N_NIMCALL(NI, cmp_360298)(tindexentry360264 a, tindexentry360264 b);
N_NIMCALL(NimStringDesc*, nsuJoinSep)(NimStringDesc** a, NI aLen0, NimStringDesc* sep);
N_NIMCALL(NimStringDesc*, generatemodulejumps_362718)(TY120608* modules);
N_NIMCALL(NimStringDesc*, generatedocumentationindex_361231)(table360277 docs);
N_NIMCALL(NimStringDesc*, generatedocumentationtoc_360873)(TY362804* entries);
N_NIMCALL(void, TMP4808)(void* p, NI op);
N_NIMCALL(void, striptoclevel_360788)(NimStringDesc* s, TY360880* Result);
static N_INLINE(NimStringDesc*, HEX5BHEX5D_85772)(NimStringDesc* s, slice85779 x);
static N_INLINE(slice85779, HEX2EHEX2E_94498)(NI a_94502, NI b_94504);
N_NIMCALL(NimStringDesc*, indenttolevel_360860)(NI* level, NI newlevel);
N_NIMCALL(NimStringDesc*, nsuRepeatStr)(NI count, NimStringDesc* s);
N_NIMCALL(TY362804*, HEX5BHEX5D_362298)(table360277 t_362305, tindexentry360264 key_362308);
N_NIMCALL(void, sortindex_360618)(tindexentry360264* a, NI aLen0);
N_NIMCALL(void, HEX3CHEX2D_360607)(tindexentry360264* a, tindexentry360264 b);
N_NIMCALL(NimStringDesc*, generatesymbolindex_360695)(TY362804* symbols);
STRING_LITERAL(TMP907, "<wbr />", 7);
STRING_LITERAL(TMP2114, "", 0);
STRING_LITERAL(TMP2116, "\015\012<h$1><a class=\"toc-backref\" id=\"$2\" href=\"#$2\">$3</a></h$1>", 61);
STRING_LITERAL(TMP2117, "\\rsth$4{$3}\\label{$2}\015\012", 23);
STRING_LITERAL(TMP2118, "\015\012<h$1 id=\"$2\">$3</h$1>", 23);
STRING_LITERAL(TMP2119, "html", 4);
STRING_LITERAL(TMP2120, "\\", 1);
STRING_LITERAL(TMP2121, "\\\\", 2);
STRING_LITERAL(TMP2122, "\015\012", 2);
STRING_LITERAL(TMP2123, "\\n", 2);
STRING_LITERAL(TMP2124, "\011", 1);
STRING_LITERAL(TMP2125, "\\t", 2);
STRING_LITERAL(TMP2126, "<h$1 id=\"$2\"><center>$3</center></h$1>", 38);
STRING_LITERAL(TMP2127, "\\rstov$4{$3}\\label{$2}\015\012", 24);
STRING_LITERAL(TMP2128, "<hr />\015\012", 8);
STRING_LITERAL(TMP2129, "\\hrule\015\012", 8);
STRING_LITERAL(TMP2130, "<p>$1</p>\015\012", 11);
STRING_LITERAL(TMP2131, "$1\015\012\015\012", 6);
STRING_LITERAL(TMP2132, "<ul class=\"simple\">$1</ul>\015\012", 28);
STRING_LITERAL(TMP2133, "\\begin{itemize}$1\\end{itemize}\015\012", 32);
STRING_LITERAL(TMP2134, "<li>$1</li>\015\012", 13);
STRING_LITERAL(TMP2135, "\\item $1\015\012", 10);
STRING_LITERAL(TMP2136, "<ol class=\"simple\">$1</ol>\015\012", 28);
STRING_LITERAL(TMP2137, "\\begin{enumerate}$1\\end{enumerate}\015\012", 36);
STRING_LITERAL(TMP2138, "<dl class=\"docutils\">$1</dl>\015\012", 30);
STRING_LITERAL(TMP2139, "\\begin{description}$1\\end{description}\015\012", 40);
STRING_LITERAL(TMP2140, "<dt>$1</dt>\015\012", 13);
STRING_LITERAL(TMP2141, "\\item[$1] ", 10);
STRING_LITERAL(TMP2142, "<dd>$1</dd>\015\012", 13);
STRING_LITERAL(TMP2143, "$1\015\012", 4);
STRING_LITERAL(TMP2144, "<table class=\"docinfo\" frame=\"void\" rules=\"none\"><col class=\"do"
"cinfo-name\" /><col class=\"docinfo-content\" /><tbody valign=\"top\""
">$1</tbody></table>", 146);
STRING_LITERAL(TMP2145, " ", 1);
STRING_LITERAL(TMP2146, "&amp;", 5);
STRING_LITERAL(TMP2147, "&lt;", 4);
STRING_LITERAL(TMP2148, "&gt;", 4);
STRING_LITERAL(TMP2149, "&quot;", 6);
STRING_LITERAL(TMP2150, "\\_", 2);
STRING_LITERAL(TMP2151, "\\symbol{123}", 12);
STRING_LITERAL(TMP2152, "\\symbol{125}", 12);
STRING_LITERAL(TMP2153, "\\symbol{91}", 11);
STRING_LITERAL(TMP2154, "\\symbol{93}", 11);
STRING_LITERAL(TMP2155, "\\symbol{92}", 11);
STRING_LITERAL(TMP2156, "\\$", 2);
STRING_LITERAL(TMP2157, "\\&", 2);
STRING_LITERAL(TMP2158, "\\#", 2);
STRING_LITERAL(TMP2159, "\\%", 2);
STRING_LITERAL(TMP2160, "\\symbol{126}", 12);
STRING_LITERAL(TMP2161, "\\symbol{64}", 11);
STRING_LITERAL(TMP2162, "\\symbol{94}", 11);
STRING_LITERAL(TMP2163, "\\symbol{96}", 11);
STRING_LITERAL(TMP2164, "author", 6);
STRING_LITERAL(TMP2165, "authors", 7);
STRING_LITERAL(TMP2166, "version", 7);
STRING_LITERAL(TMP2167, "<tr>$1</tr>\015\012", 13);
STRING_LITERAL(TMP2168, "$1", 2);
STRING_LITERAL(TMP2169, "<th class=\"docinfo-name\">$1:</th>", 33);
STRING_LITERAL(TMP2170, "\\item[$1:]", 10);
STRING_LITERAL(TMP2171, "<td>$1</td>", 11);
STRING_LITERAL(TMP2172, " $1\015\012", 5);
STRING_LITERAL(TMP2173, "<table frame=\"void\">$1</table>", 30);
STRING_LITERAL(TMP2174, "\\begin{description}\015\012$1\\end{description}\015\012", 42);
STRING_LITERAL(TMP2175, "<th align=\"left\">$1</th>", 24);
STRING_LITERAL(TMP2176, "\\item[$1]", 9);
STRING_LITERAL(TMP2177, "<td align=\"left\">$1</td>\015\012", 26);
STRING_LITERAL(TMP2179, "false renderRstToOut", 20);
STRING_LITERAL(TMP2180, "<pre>$1</pre>\015\012", 15);
STRING_LITERAL(TMP2181, "\\begin{rstpre}\015\012$1\015\012\\end{rstpre}\015\012", 34);
STRING_LITERAL(TMP2182, "<p>$1</p>", 9);
STRING_LITERAL(TMP2183, "$1<br />", 8);
STRING_LITERAL(TMP2184, "$1\\\\\015\012", 6);
STRING_LITERAL(TMP2185, "<blockquote><p>$1</p></blockquote>\015\012", 36);
STRING_LITERAL(TMP2186, "\\begin{quote}$1\\end{quote}\015\012", 28);
STRING_LITERAL(TMP2187, "<table border=\"1\" class=\"docutils\">$1</table>", 45);
STRING_LITERAL(TMP2188, "\\begin{table}\\begin{rsttab}{", 28);
STRING_LITERAL(TMP2189, "|X", 2);
STRING_LITERAL(TMP2190, "|}\015\012\\hline\015\012$1\\end{rsttab}\\end{table}", 37);
STRING_LITERAL(TMP2191, " & ", 3);
STRING_LITERAL(TMP2192, "\\\\\015\012\\hline\015\012", 12);
STRING_LITERAL(TMP2193, "<tr>", 4);
STRING_LITERAL(TMP2194, "</tr>\015\012", 7);
STRING_LITERAL(TMP2195, "<th>$1</th>", 11);
STRING_LITERAL(TMP2196, "\\textbf{$1}", 11);
STRING_LITERAL(TMP2197, "<a class=\"reference external\" href=\"#$2\">$1</a>", 47);
STRING_LITERAL(TMP2198, "$1\\ref{$2}", 10);
STRING_LITERAL(TMP2199, "<a class=\"reference external\" href=\"$1\">$1</a>", 46);
STRING_LITERAL(TMP2200, "\\href{$1}{$1}", 13);
STRING_LITERAL(TMP2201, "<a class=\"reference external\" href=\"$2\">$1</a>", 46);
STRING_LITERAL(TMP2202, "\\href{$2}{$1}", 13);
STRING_LITERAL(TMP2204, "scale", 5);
static NIM_CONST TY212607 TMP2205 = {
0x00, 0x3E, 0x00, 0x00, 0x21, 0x80, 0xFF, 0x07,
0xFE, 0xFF, 0xFF, 0x97, 0xFE, 0xFF, 0xFF, 0x07,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}
;
STRING_LITERAL(TMP2206, " scale=\"$1\"", 11);
STRING_LITERAL(TMP2207, " scale=$1", 9);
STRING_LITERAL(TMP2208, "height", 6);
STRING_LITERAL(TMP2209, " height=\"$1\"", 12);
STRING_LITERAL(TMP2210, " height=$1", 10);
STRING_LITERAL(TMP2211, "width", 5);
STRING_LITERAL(TMP2212, " width=\"$1\"", 11);
STRING_LITERAL(TMP2213, " width=$1", 9);
STRING_LITERAL(TMP2214, "alt", 3);
STRING_LITERAL(TMP2215, " alt=\"$1\"", 9);
STRING_LITERAL(TMP2216, "align", 5);
STRING_LITERAL(TMP2217, " align=\"$1\"", 11);
STRING_LITERAL(TMP2218, "[$1]", 4);
STRING_LITERAL(TMP2219, "<img src=\"$1\"$2 />", 18);
STRING_LITERAL(TMP2220, "\\includegraphics$2{$1}", 22);
STRING_LITERAL(TMP2221, "number-lines", 12);
STRING_LITERAL(TMP2222, "file", 4);
STRING_LITERAL(TMP2223, "default-language", 16);
STRING_LITERAL(TMP2232, "<pre>", 5);
STRING_LITERAL(TMP2233, "</pre>", 6);
NIM_CONST keyvaluepair133008 TMP2231 = {((NimStringDesc*) &TMP2232),
((NimStringDesc*) &TMP2233)}
;
STRING_LITERAL(TMP2234, "<table class=\"line-nums-table\"><tbody><tr><td class=\"blob-line-"
"nums\"><pre>", 74);
STRING_LITERAL(TMP2235, "</pre></td><td><pre>", 20);
STRING_LITERAL(TMP2236, "</pre></td></tr></tbody></table>", 32);
STRING_LITERAL(TMP2237, "\\begin{rstpre}\015\012", 16);
STRING_LITERAL(TMP2398, "<span class=\"$2\">$1</span>", 26);
STRING_LITERAL(TMP2399, "\\span$2{$1}", 11);
extern NIM_CONST TY353082 tokenclasstostr_353081;
STRING_LITERAL(TMP2433, "\015\012\\end{rstpre}\015\012", 16);
STRING_LITERAL(TMP2434, "<div>$1</div>", 13);
STRING_LITERAL(TMP2435, "<div class=\"$1\">$2</div>", 24);
STRING_LITERAL(TMP2436, "$2", 2);
STRING_LITERAL(TMP2437, "|$1|", 4);
STRING_LITERAL(TMP2438, "<sub>$1</sub>", 13);
STRING_LITERAL(TMP2439, "\\rstsub{$1}", 11);
STRING_LITERAL(TMP2440, "<sup>$1</sup>", 13);
STRING_LITERAL(TMP2441, "\\rstsup{$1}", 11);
STRING_LITERAL(TMP2442, "<em>$1</em>", 11);
STRING_LITERAL(TMP2443, "\\emph{$1}", 9);
STRING_LITERAL(TMP2444, "<strong>$1</strong>", 19);
STRING_LITERAL(TMP2445, "<strong><em>$1</em></strong>", 28);
STRING_LITERAL(TMP2446, "\\textbf{emph{$1}}", 17);
STRING_LITERAL(TMP2447, "<cite>$1</cite>", 15);
STRING_LITERAL(TMP2450, "<span id=\"$1\">$2</span>", 23);
STRING_LITERAL(TMP2451, "$2\\label{$1}", 12);
STRING_LITERAL(TMP2452, "<tt class=\"docutils literal\"><span class=\"pre\">$1</span></tt>", 61);
STRING_LITERAL(TMP2453, "\\texttt{$1}", 11);
STRING_LITERAL(TMP2454, "<img src=\"$1\" width=\"15\" \015\012        height=\"17\" hspace=\"2\" vspac"
"e=\"2\" class=\"smiley\" />", 86);
STRING_LITERAL(TMP2455, "\\includegraphics{$1}", 20);
STRING_LITERAL(TMP2456, "doc.smiley_format", 17);
STRING_LITERAL(TMP4631, ".nim", 4);
STRING_LITERAL(TMP4632, "Module ", 7);
STRING_LITERAL(TMP4633, "split.item.toc", 14);
STRING_LITERAL(TMP4706, "<li><a class=\"reference\" id=\"$1_toc\" href=\"#$1\">$2</a></li>\015\012", 61);
STRING_LITERAL(TMP4707, "\\item\\label{$1_toc} $2\\ref{$1}\015\012", 32);
STRING_LITERAL(TMP4708, "<ul class=\"simple\">$1</ul>", 26);
STRING_LITERAL(TMP4709, "\\begin{enumerate}$1\\end{enumerate}", 34);
STRING_LITERAL(TMP4787, "*", 1);
STRING_LITERAL(TMP4788, ".idx", 4);
STRING_LITERAL(TMP4789, "doc_toc_", 8);
STRING_LITERAL(TMP4793, "Documents: ", 11);
STRING_LITERAL(TMP4797, "<a href=\"", 9);
STRING_LITERAL(TMP4798, "\">", 2);
STRING_LITERAL(TMP4799, "</a>", 4);
STRING_LITERAL(TMP4800, ", ", 2);
STRING_LITERAL(TMP4801, ".<br>", 5);
STRING_LITERAL(TMP4802, "<p />", 5);
STRING_LITERAL(TMP4803, "Modules: ", 9);
STRING_LITERAL(TMP4804, ".html\">", 7);
STRING_LITERAL(TMP4805, "<h2>Documentation files</h2>\015\012", 30);
STRING_LITERAL(TMP4809, "<ul>\015\012", 6);
STRING_LITERAL(TMP4810, "<ul>", 4);
STRING_LITERAL(TMP4811, "</ul>", 5);
STRING_LITERAL(TMP4812, "<li><a href=\"", 13);
STRING_LITERAL(TMP4813, "</a>\015\012", 6);
STRING_LITERAL(TMP4814, "</ul>\015\012", 7);
STRING_LITERAL(TMP4815, "<ul><li><a href=\"", 17);
STRING_LITERAL(TMP4816, "<h2>API symbols</h2>\015\012", 22);
STRING_LITERAL(TMP4817, "<dt><span>$1:</span></dt><ul class=\"simple\"><dd>\015\012", 50);
STRING_LITERAL(TMP4818, "<li><a class=\"reference external\"\015\012          title=\"$3\" href=\"$"
"1\">$2</a></li>\015\012          ", 89);
STRING_LITERAL(TMP4819, "<li><a class=\"reference external\" href=\"$1\">$2</a></li>\015\012      "
"    ", 67);
STRING_LITERAL(TMP4820, "</ul></dd>\015\012", 12);
NimStringDesc* splitter_359332;
extern tgcheap46816 gch_46844;
extern TNimType NTI353023; /* TGeneralTokenizer */
extern TNimType NTI3211; /* RootObj */
TNimType NTI359016; /* TRstGenerator */
TNimType NTI359010; /* TOutputTarget */
extern TNimType NTI133014; /* StringTableRef */
extern TNimType NTI108; /* int */
TNimType NTI359012; /* TTocEntry */
extern TNimType NTI343007; /* PRstNode */
extern TNimType NTI149; /* string */
TNimType NTI359034; /* seq[TTocEntry] */
extern TNimType NTI138; /* bool */
extern TNimType NTI344015; /* TRstParseOptions */
extern TNimType NTI344023; /* TFindFileHandler */
extern TNimType NTI344021; /* TMsgHandler */
TNimType NTI359042; /* array[TMetaEnum, string] */
extern TNimType NTI359052; /* Table */
extern TNimType NTI120608; /* seq[string] */
TNimType NTI360264; /* TIndexEntry */
TNimType NTI362804; /* seq[TIndexEntry] */
extern TY104045 Dl_104044;
extern TY104205 Dl_104204;
extern TNimType NTI360280; /* KeyValuePairSeq */
TNimType NTI360880; /* tuple[level: int, text: string] */
TNimType NTI360879; /* seq[tuple[level: int, text: string]] */

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

static N_INLINE(void, rtladdzct_50004)(tcell44733* c) {
	addzct_48417((&gch_46844.Zct), c);
}

static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
	tcell44733* c;
	c = usrtocell_48446(p);
	{
		(*c).Refcount -= 8;
		if (!((NU32)((*c).Refcount) < (NU32)(8))) goto LA3;
		rtladdzct_50004(c);
	}
	LA3: ;
}

N_NIMCALL(void, renderaux_359589)(trstgenerator359016* d, trstnode343011* n, NimStringDesc** result) {
	{
		NI i_359607;
		NI HEX3Atmp_359609;
		NI LOC2;
		NI res_359612;
		i_359607 = 0;
		HEX3Atmp_359609 = 0;
		LOC2 = 0;
		LOC2 = len_343084(n);
		HEX3Atmp_359609 = (NI32)(LOC2 - 1);
		res_359612 = 0;
		{
			while (1) {
				if (!(res_359612 <= HEX3Atmp_359609)) goto LA4;
				i_359607 = res_359612;
				renderrsttoout_359579(d, (*n).Sons->data[i_359607], result);
				res_359612 += 1;
			} LA4: ;
		}
	}
}

static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) {
	{
		tcell44733* c;
		if (!!((src == NIM_NIL))) goto LA3;
		c = usrtocell_48446(src);
		(*c).Refcount += 8;
	}
	LA3: ;
	{
		tcell44733* c;
		if (!!(((*dest) == NIM_NIL))) goto LA7;
		c = usrtocell_48446((*dest));
		{
			(*c).Refcount -= 8;
			if (!((NU32)((*c).Refcount) < (NU32)(8))) goto LA11;
			rtladdzct_50004(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

N_NIMCALL(void, dispa_359544)(NU8 target, NimStringDesc** dest, NimStringDesc* xml, NimStringDesc* tex, NimStringDesc** args, NI argsLen0) {
	{
		if (!!((target == ((NU8) 1)))) goto LA3;
		nsuAddf(dest, xml, args, argsLen0);
	}
	goto LA1;
	LA3: ;
	{
		nsuAddf(dest, tex, args, argsLen0);
	}
	LA1: ;
}

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

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

N_NIMCALL(NimStringDesc*, quoteindexcolumn_359690)(NimStringDesc* text) {
	NimStringDesc* result;
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	result = 0;
	LOC1 = 0;
	LOC1 = nsuReplaceStr(text, ((NimStringDesc*) &TMP2120), ((NimStringDesc*) &TMP2121));
	LOC2 = 0;
	LOC2 = nsuReplaceStr(LOC1, ((NimStringDesc*) &TMP2122), ((NimStringDesc*) &TMP2123));
	result = nsuReplaceStr(LOC2, ((NimStringDesc*) &TMP2124), ((NimStringDesc*) &TMP2125));
	return result;
}

N_NIMCALL(void, setindexterm_359710)(trstgenerator359016* d, NimStringDesc* id, NimStringDesc* term, NimStringDesc* linktitle, NimStringDesc* linkdesc) {
	NimStringDesc* entry;
	NIM_BOOL istitle;
	NimStringDesc* htmlfile;
	NimStringDesc* LOC1;
	entry = copyString(term);
	istitle = NIM_FALSE;
	entry = addChar(entry, 9);
	LOC1 = 0;
	LOC1 = nosextractFilename((*d).Filename);
	htmlfile = noschangeFileExt(LOC1, ((NimStringDesc*) &TMP2119));
	entry = resizeString(entry, htmlfile->Sup.len + 0);
appendString(entry, htmlfile);
	{
		if (!(0 < id->Sup.len)) goto LA4;
		entry = addChar(entry, 35);
		entry = resizeString(entry, id->Sup.len + 0);
appendString(entry, id);
	}
	goto LA2;
	LA4: ;
	{
		istitle = NIM_TRUE;
	}
	LA2: ;
	{
		NIM_BOOL LOC9;
		NimStringDesc* LOC13;
		NimStringDesc* LOC14;
		NimStringDesc* LOC15;
		NimStringDesc* LOC16;
		LOC9 = 0;
		LOC9 = (0 < linktitle->Sup.len);
		if (LOC9) goto LA10;
		LOC9 = (0 < linkdesc->Sup.len);
		LA10: ;
		if (!LOC9) goto LA11;
		LOC13 = 0;
		LOC14 = 0;
		LOC14 = quoteindexcolumn_359690(linktitle);
		LOC13 = rawNewString(LOC14->Sup.len + 1);
appendChar(LOC13, 9);
appendString(LOC13, LOC14);
		entry = resizeString(entry, LOC13->Sup.len + 0);
appendString(entry, LOC13);
		LOC15 = 0;
		LOC16 = 0;
		LOC16 = quoteindexcolumn_359690(linkdesc);
		LOC15 = rawNewString(LOC16->Sup.len + 1);
appendChar(LOC15, 9);
appendString(LOC15, LOC16);
		entry = resizeString(entry, LOC15->Sup.len + 0);
appendString(entry, LOC15);
	}
	LA11: ;
	entry = resizeString(entry, 2);
appendString(entry, ((NimStringDesc*) &TMP2122));
	{
		if (!istitle) goto LA19;
		insert_87401((&(*d).Theindex), entry, 0);
	}
	goto LA17;
	LA19: ;
	{
		(*d).Theindex = resizeString((*d).Theindex, entry->Sup.len + 0);
appendString((*d).Theindex, entry);
	}
	LA17: ;
}

N_NIMCALL(NimStringDesc*, striptochtml_365260)(NimStringDesc* s) {
	NimStringDesc* result;
	NI first;
	result = 0;
	result = copyString(s);
	first = nsuFindChar(result, 60, 0);
	{
		while (1) {
			NI last;
			if (!(0 <= first)) goto LA2;
			last = nsuFindChar(result, 62, first);
			{
				if (!(last < 0)) goto LA5;
				goto BeforeRet;
			}
			LA5: ;
			nsuDelete((&result), first, last);
			first = nsuFindChar(result, 60, first);
		} LA2: ;
	}
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, renderheadline_365281)(trstgenerator359016* d, trstnode343011* n, NimStringDesc** result) {
	NimStringDesc* tmp;
	NimStringDesc* refname;
	NimStringDesc* LOC14;
	NimStringDesc* LOC15;
	NimStringDesc* LOC16;
	tmp = copyString(((NimStringDesc*) &TMP2114));
	{
		NI i_365300;
		NI HEX3Atmp_365405;
		NI LOC2;
		NI res_365408;
		i_365300 = 0;
		HEX3Atmp_365405 = 0;
		LOC2 = 0;
		LOC2 = len_343084(n);
		HEX3Atmp_365405 = (NI32)(LOC2 - 1);
		res_365408 = 0;
		{
			while (1) {
				if (!(res_365408 <= HEX3Atmp_365405)) goto LA4;
				i_365300 = res_365408;
				renderrsttoout_359579(d, (*n).Sons->data[i_365300], (&tmp));
				res_365408 += 1;
			} LA4: ;
		}
	}
	unsureAsgnRef((void**) (&(*d).Currentsection), copyString(tmp));
	refname = rstnodetorefname_344061(n);
	{
		NI length;
		NimStringDesc* LOC9;
		NimStringDesc* LOC10;
		TY198620 LOC11;
		if (!(*d).Hastoc) goto LA7;
		length = (*d).Tocpart->Sup.len;
		(*d).Tocpart = (TY359034*) setLengthSeq(&((*d).Tocpart)->Sup, sizeof(ttocentry359012), (NI32)(length + 1));
		LOC9 = 0;
		LOC9 = (*d).Tocpart->data[length].Refname; (*d).Tocpart->data[length].Refname = copyStringRC1(refname);
		if (LOC9) nimGCunrefNoCycle(LOC9);
		asgnRefNoCycle((void**) (&(*d).Tocpart->data[length].N), n);
		LOC10 = 0;
		LOC10 = (*d).Tocpart->data[length].Header; (*d).Tocpart->data[length].Header = copyStringRC1(tmp);
		if (LOC10) nimGCunrefNoCycle(LOC10);
		memset((void*)LOC11, 0, sizeof(LOC11));
		LOC11[0] = nimIntToStr((*n).Level);
		LOC11[1] = copyString((*d).Tocpart->data[length].Refname);
		LOC11[2] = copyString(tmp);
		LOC11[3] = nimCharToStr(((NIM_CHAR) (((NI) ((NI32)((NI32)((*n).Level - 1) + 65))))));
		dispa_359544((*d).Target, result, ((NimStringDesc*) &TMP2116), ((NimStringDesc*) &TMP2117), LOC11, 4);
	}
	goto LA5;
	LA7: ;
	{
		TY198620 LOC13;
		memset((void*)LOC13, 0, sizeof(LOC13));
		LOC13[0] = nimIntToStr((*n).Level);
		LOC13[1] = copyString(refname);
		LOC13[2] = copyString(tmp);
		LOC13[3] = nimCharToStr(((NIM_CHAR) (((NI) ((NI32)((NI32)((*n).Level - 1) + 65))))));
		dispa_359544((*d).Target, result, ((NimStringDesc*) &TMP2118), ((NimStringDesc*) &TMP2117), LOC13, 4);
	}
	LA5: ;
	LOC14 = 0;
	LOC14 = striptochtml_365260(tmp);
	LOC15 = 0;
	LOC16 = 0;
	LOC16 = nsuRepeatChar(((0 >= (*n).Level) ? 0 : (*n).Level), 32);
	LOC15 = rawNewString(LOC16->Sup.len + tmp->Sup.len + 0);
appendString(LOC15, LOC16);
appendString(LOC15, tmp);
	setindexterm_359710(d, refname, LOC14, LOC15, ((NimStringDesc*) &TMP2114));
}

N_NIMCALL(void, renderoverline_365425)(trstgenerator359016* d, trstnode343011* n, NimStringDesc** result) {
	{
		if (!((*d).Meta[(((NU8) 1))- 0]->Sup.len == 0)) goto LA3;
		{
			NI i_365443;
			NI HEX3Atmp_365488;
			NI LOC6;
			NI res_365491;
			i_365443 = 0;
			HEX3Atmp_365488 = 0;
			LOC6 = 0;
			LOC6 = len_343084(n);
			HEX3Atmp_365488 = (NI32)(LOC6 - 1);
			res_365491 = 0;
			{
				while (1) {
					if (!(res_365491 <= HEX3Atmp_365488)) goto LA8;
					i_365443 = res_365491;
					renderrsttoout_359579(d, (*n).Sons->data[i_365443], (&(*d).Meta[(((NU8) 1))- 0]));
					res_365491 += 1;
				} LA8: ;
			}
		}
		unsureAsgnRef((void**) (&(*d).Currentsection), copyString((*d).Meta[(((NU8) 1))- 0]));
	}
	goto LA1;
	LA3: ;
	{
		if (!((*d).Meta[(((NU8) 2))- 0]->Sup.len == 0)) goto LA10;
		{
			NI i_365457;
			NI HEX3Atmp_365494;
			NI LOC13;
			NI res_365497;
			i_365457 = 0;
			HEX3Atmp_365494 = 0;
			LOC13 = 0;
			LOC13 = len_343084(n);
			HEX3Atmp_365494 = (NI32)(LOC13 - 1);
			res_365497 = 0;
			{
				while (1) {
					if (!(res_365497 <= HEX3Atmp_365494)) goto LA15;
					i_365457 = res_365497;
					renderrsttoout_359579(d, (*n).Sons->data[i_365457], (&(*d).Meta[(((NU8) 2))- 0]));
					res_365497 += 1;
				} LA15: ;
			}
		}
		unsureAsgnRef((void**) (&(*d).Currentsection), copyString((*d).Meta[(((NU8) 2))- 0]));
	}
	goto LA1;
	LA10: ;
	{
		NimStringDesc* tmp;
		TY198620 LOC21;
		tmp = copyString(((NimStringDesc*) &TMP2114));
		{
			NI i_365472;
			NI HEX3Atmp_365500;
			NI LOC18;
			NI res_365503;
			i_365472 = 0;
			HEX3Atmp_365500 = 0;
			LOC18 = 0;
			LOC18 = len_343084(n);
			HEX3Atmp_365500 = (NI32)(LOC18 - 1);
			res_365503 = 0;
			{
				while (1) {
					if (!(res_365503 <= HEX3Atmp_365500)) goto LA20;
					i_365472 = res_365503;
					renderrsttoout_359579(d, (*n).Sons->data[i_365472], (&tmp));
					res_365503 += 1;
				} LA20: ;
			}
		}
		unsureAsgnRef((void**) (&(*d).Currentsection), copyString(tmp));
		memset((void*)LOC21, 0, sizeof(LOC21));
		LOC21[0] = nimIntToStr((*n).Level);
		LOC21[1] = rstnodetorefname_344061(n);
		LOC21[2] = copyString(tmp);
		LOC21[3] = nimCharToStr(((NIM_CHAR) (((NI) ((NI32)((NI32)((*n).Level - 1) + 65))))));
		dispa_359544((*d).Target, result, ((NimStringDesc*) &TMP2126), ((NimStringDesc*) &TMP2127), LOC21, 4);
	}
	LA1: ;
}

N_NIMCALL(void, renderaux_359629)(trstgenerator359016* d, trstnode343011* n, NimStringDesc* frmta, NimStringDesc* frmtb, NimStringDesc** result) {
	NimStringDesc* tmp;
	tmp = copyString(((NimStringDesc*) &TMP2114));
	{
		NI i_359650;
		NI HEX3Atmp_359670;
		NI LOC2;
		NI res_359673;
		i_359650 = 0;
		HEX3Atmp_359670 = 0;
		LOC2 = 0;
		LOC2 = len_343084(n);
		HEX3Atmp_359670 = (NI32)(LOC2 - 1);
		res_359673 = 0;
		{
			while (1) {
				if (!(res_359673 <= HEX3Atmp_359670)) goto LA4;
				i_359650 = res_359673;
				renderrsttoout_359579(d, (*n).Sons->data[i_359650], (&tmp));
				res_359673 += 1;
			} LA4: ;
		}
	}
	{
		TY198301 LOC9;
		if (!!(((*d).Target == ((NU8) 1)))) goto LA7;
		memset((void*)LOC9, 0, sizeof(LOC9));
		LOC9[0] = copyString(tmp);
		nsuAddf(result, frmta, LOC9, 1);
	}
	goto LA5;
	LA7: ;
	{
		TY198301 LOC11;
		memset((void*)LOC11, 0, sizeof(LOC11));
		LOC11[0] = copyString(tmp);
		nsuAddf(result, frmtb, LOC11, 1);
	}
	LA5: ;
}

N_NIMCALL(NI, nextsplitpoint_359349)(NimStringDesc* s, NI start) {
	NI result;
	result = 0;
	result = start;
	{
		while (1) {
			if (!(result < (NI32)(s->Sup.len + 0))) goto LA2;
			switch (((NU8)(s->data[result]))) {
			case 95:
			{
				goto BeforeRet;
			}
			break;
			case 97 ... 122:
			{
				{
					if (!((NI32)(result + 1) < (NI32)(s->Sup.len + 0))) goto LA7;
					{
						if (!(((NU8)(s->data[(NI32)(result + 1)])) >= ((NU8)(65)) && ((NU8)(s->data[(NI32)(result + 1)])) <= ((NU8)(90)))) goto LA11;
						goto BeforeRet;
					}
					LA11: ;
				}
				LA7: ;
			}
			break;
			default:
			{
			}
			break;
			}
			result += 1;
		} LA2: ;
	}
	result -= 1;
	BeforeRet: ;
	return result;
}

static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b) {
	NIM_BOOL result;
	NIM_BOOL LOC11;
	int LOC13;
	result = 0;
	{
		if (!(a == b)) goto LA3;
		result = NIM_TRUE;
		goto BeforeRet;
	}
	LA3: ;
	{
		NIM_BOOL LOC7;
		LOC7 = 0;
		LOC7 = (a == NIM_NIL);
		if (LOC7) goto LA8;
		LOC7 = (b == NIM_NIL);
		LA8: ;
		if (!LOC7) goto LA9;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA9: ;
	LOC11 = 0;
	LOC11 = ((*a).Sup.len == (*b).Sup.len);
	if (!(LOC11)) goto LA12;
	LOC13 = 0;
	LOC13 = memcmp(((NCSTRING) ((*a).data)), ((NCSTRING) ((*b).data)), (NI32)((*a).Sup.len * 1));
	LOC11 = (LOC13 == ((NI32) 0));
	LA12: ;
	result = LOC11;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, addxmlchar_359299)(NimStringDesc** dest, NIM_CHAR c) {
	switch (((NU8)(c))) {
	case 38:
	{
		(*dest) = resizeString((*dest), 5);
appendString((*dest), ((NimStringDesc*) &TMP2146));
	}
	break;
	case 60:
	{
		(*dest) = resizeString((*dest), 4);
appendString((*dest), ((NimStringDesc*) &TMP2147));
	}
	break;
	case 62:
	{
		(*dest) = resizeString((*dest), 4);
appendString((*dest), ((NimStringDesc*) &TMP2148));
	}
	break;
	case 34:
	{
		(*dest) = resizeString((*dest), 6);
appendString((*dest), ((NimStringDesc*) &TMP2149));
	}
	break;
	default:
	{
		(*dest) = addChar((*dest), c);
	}
	break;
	}
}

N_NIMCALL(void, addtexchar_359321)(NimStringDesc** dest, NIM_CHAR c) {
	switch (((NU8)(c))) {
	case 95:
	{
		(*dest) = resizeString((*dest), 2);
appendString((*dest), ((NimStringDesc*) &TMP2150));
	}
	break;
	case 123:
	{
		(*dest) = resizeString((*dest), 12);
appendString((*dest), ((NimStringDesc*) &TMP2151));
	}
	break;
	case 125:
	{
		(*dest) = resizeString((*dest), 12);
appendString((*dest), ((NimStringDesc*) &TMP2152));
	}
	break;
	case 91:
	{
		(*dest) = resizeString((*dest), 11);
appendString((*dest), ((NimStringDesc*) &TMP2153));
	}
	break;
	case 93:
	{
		(*dest) = resizeString((*dest), 11);
appendString((*dest), ((NimStringDesc*) &TMP2154));
	}
	break;
	case 92:
	{
		(*dest) = resizeString((*dest), 11);
appendString((*dest), ((NimStringDesc*) &TMP2155));
	}
	break;
	case 36:
	{
		(*dest) = resizeString((*dest), 2);
appendString((*dest), ((NimStringDesc*) &TMP2156));
	}
	break;
	case 38:
	{
		(*dest) = resizeString((*dest), 2);
appendString((*dest), ((NimStringDesc*) &TMP2157));
	}
	break;
	case 35:
	{
		(*dest) = resizeString((*dest), 2);
appendString((*dest), ((NimStringDesc*) &TMP2158));
	}
	break;
	case 37:
	{
		(*dest) = resizeString((*dest), 2);
appendString((*dest), ((NimStringDesc*) &TMP2159));
	}
	break;
	case 126:
	{
		(*dest) = resizeString((*dest), 12);
appendString((*dest), ((NimStringDesc*) &TMP2160));
	}
	break;
	case 64:
	{
		(*dest) = resizeString((*dest), 11);
appendString((*dest), ((NimStringDesc*) &TMP2161));
	}
	break;
	case 94:
	{
		(*dest) = resizeString((*dest), 11);
appendString((*dest), ((NimStringDesc*) &TMP2162));
	}
	break;
	case 96:
	{
		(*dest) = resizeString((*dest), 11);
appendString((*dest), ((NimStringDesc*) &TMP2163));
	}
	break;
	default:
	{
		(*dest) = addChar((*dest), c);
	}
	break;
	}
}

static N_INLINE(void, escchar_359337)(NU8 target, NimStringDesc** dest, NIM_CHAR c) {
	switch (target) {
	case ((NU8) 0):
	{
		addxmlchar_359299(dest, c);
	}
	break;
	case ((NU8) 1):
	{
		addtexchar_359321(dest, c);
	}
	break;
	}
}

N_NIMCALL(NimStringDesc*, esc_359407)(NU8 target, NimStringDesc* s, NI splitafter) {
	NimStringDesc* result;
	result = 0;
	result = copyString(((NimStringDesc*) &TMP2114));
	{
		NI partlen;
		NI j;
		if (!(0 <= splitafter)) goto LA3;
		partlen = 0;
		j = 0;
		{
			while (1) {
				NI k;
				if (!(j < s->Sup.len)) goto LA6;
				k = nextsplitpoint_359349(s, j);
				{
					NIM_BOOL LOC9;
					LOC9 = 0;
					LOC9 = !(eqStrings(splitter_359332, ((NimStringDesc*) &TMP2145)));
					if (LOC9) goto LA10;
					LOC9 = (splitafter < (NI32)((NI32)((NI32)(partlen + k) - j) + 1));
					LA10: ;
					if (!LOC9) goto LA11;
					partlen = 0;
					result = resizeString(result, splitter_359332->Sup.len + 0);
appendString(result, splitter_359332);
				}
				LA11: ;
				{
					NI i_359430;
					NI res_359462;
					i_359430 = 0;
					res_359462 = j;
					{
						while (1) {
							if (!(res_359462 <= k)) goto LA15;
							i_359430 = res_359462;
							escchar_359337(target, (&result), s->data[i_359430]);
							res_359462 += 1;
						} LA15: ;
					}
				}
				partlen += (NI32)((NI32)(k - j) + 1);
				j = (NI32)(k + 1);
			} LA6: ;
		}
	}
	goto LA1;
	LA3: ;
	{
		{
			NI i_359456;
			NI HEX3Atmp_359465;
			NI res_359468;
			i_359456 = 0;
			HEX3Atmp_359465 = 0;
			HEX3Atmp_359465 = (NI32)(s->Sup.len - 1);
			res_359468 = 0;
			{
				while (1) {
					if (!(res_359468 <= HEX3Atmp_359465)) goto LA19;
					i_359456 = res_359468;
					escchar_359337(target, (&result), s->data[i_359456]);
					res_359468 += 1;
				} LA19: ;
			}
		}
	}
	LA1: ;
	return result;
}

N_NIMCALL(void, renderfield_367327)(trstgenerator359016* d, trstnode343011* n, NimStringDesc** result) {
	NIM_BOOL b;
	b = NIM_FALSE;
	{
		NimStringDesc* fieldname;
		NimStringDesc* fieldval;
		NimStringDesc* LOC5;
		NimStringDesc* LOC6;
		if (!((*d).Target == ((NU8) 1))) goto LA3;
		fieldname = addnodes_344067((*n).Sons->data[0]);
		LOC5 = 0;
		LOC5 = addnodes_344067((*n).Sons->data[1]);
		LOC6 = 0;
		LOC6 = nsuStrip(LOC5, NIM_TRUE, NIM_TRUE);
		fieldval = esc_359407((*d).Target, LOC6, -1);
		{
			NIM_BOOL LOC9;
			NI LOC10;
			NI LOC12;
			LOC9 = 0;
			LOC10 = 0;
			LOC10 = nsuCmpIgnoreStyle(fieldname, ((NimStringDesc*) &TMP2164));
			LOC9 = (LOC10 == 0);
			if (LOC9) goto LA11;
			LOC12 = 0;
			LOC12 = nsuCmpIgnoreStyle(fieldname, ((NimStringDesc*) &TMP2165));
			LOC9 = (LOC12 == 0);
			LA11: ;
			if (!LOC9) goto LA13;
			{
				if (!((*d).Meta[(((NU8) 3))- 0]->Sup.len == 0)) goto LA17;
				unsureAsgnRef((void**) (&(*d).Meta[(((NU8) 3))- 0]), copyString(fieldval));
				b = NIM_TRUE;
			}
			LA17: ;
		}
		goto LA7;
		LA13: ;
		{
			NI LOC20;
			LOC20 = 0;
			LOC20 = nsuCmpIgnoreStyle(fieldname, ((NimStringDesc*) &TMP2166));
			if (!(LOC20 == 0)) goto LA21;
			{
				if (!((*d).Meta[(((NU8) 4))- 0]->Sup.len == 0)) goto LA25;
				unsureAsgnRef((void**) (&(*d).Meta[(((NU8) 4))- 0]), copyString(fieldval));
				b = NIM_TRUE;
			}
			LA25: ;
		}
		goto LA7;
		LA21: ;
		LA7: ;
	}
	LA3: ;
	{
		if (!!(b)) goto LA29;
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2167), ((NimStringDesc*) &TMP2168), result);
	}
	LA29: ;
}

N_NIMCALL(NimStringDesc*, texcolumns_367289)(trstnode343011* n) {
	NimStringDesc* result;
	result = 0;
	result = copyString(((NimStringDesc*) &TMP2114));
	{
		NI i_367305;
		NI HEX3Atmp_367307;
		NI res_367310;
		i_367305 = 0;
		HEX3Atmp_367307 = 0;
		HEX3Atmp_367307 = len_343084(n);
		res_367310 = 1;
		{
			while (1) {
				if (!(res_367310 <= HEX3Atmp_367307)) goto LA3;
				i_367305 = res_367310;
				result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TMP2189));
				res_367310 += 1;
			} LA3: ;
		}
	}
	return result;
}

N_NIMCALL(NimStringDesc*, dispf_359521)(NU8 target, NimStringDesc* xml, NimStringDesc* tex, NimStringDesc** args, NI argsLen0) {
	NimStringDesc* result;
	result = 0;
	{
		if (!!((target == ((NU8) 1)))) goto LA3;
		result = nsuFormatOpenArray(xml, args, argsLen0);
	}
	goto LA1;
	LA3: ;
	{
		result = nsuFormatOpenArray(tex, args, argsLen0);
	}
	LA1: ;
	return result;
}

N_NIMCALL(void, renderimage_365598)(trstgenerator359016* d, trstnode343011* n, NimStringDesc** result) {
	NimStringDesc* options;
	NimStringDesc* s;
	NimStringDesc* arg;
	options = copyString(((NimStringDesc*) &TMP2114));
	s = getfieldvalue_344073(n, ((NimStringDesc*) &TMP2204));
	{
		NIM_BOOL LOC3;
		TY198301 LOC7;
		LOC3 = 0;
		LOC3 = (0 < s->Sup.len);
		if (!(LOC3)) goto LA4;
		LOC3 = allcharsinset_98479(s, TMP2205);
		LA4: ;
		if (!LOC3) goto LA5;
		memset((void*)LOC7, 0, sizeof(LOC7));
		LOC7[0] = nsuStrip(s, NIM_TRUE, NIM_TRUE);
		dispa_359544((*d).Target, (&options), ((NimStringDesc*) &TMP2206), ((NimStringDesc*) &TMP2207), LOC7, 1);
	}
	LA5: ;
	s = getfieldvalue_344073(n, ((NimStringDesc*) &TMP2208));
	{
		NIM_BOOL LOC10;
		TY198301 LOC14;
		LOC10 = 0;
		LOC10 = (0 < s->Sup.len);
		if (!(LOC10)) goto LA11;
		LOC10 = allcharsinset_98479(s, TMP2205);
		LA11: ;
		if (!LOC10) goto LA12;
		memset((void*)LOC14, 0, sizeof(LOC14));
		LOC14[0] = nsuStrip(s, NIM_TRUE, NIM_TRUE);
		dispa_359544((*d).Target, (&options), ((NimStringDesc*) &TMP2209), ((NimStringDesc*) &TMP2210), LOC14, 1);
	}
	LA12: ;
	s = getfieldvalue_344073(n, ((NimStringDesc*) &TMP2211));
	{
		NIM_BOOL LOC17;
		TY198301 LOC21;
		LOC17 = 0;
		LOC17 = (0 < s->Sup.len);
		if (!(LOC17)) goto LA18;
		LOC17 = allcharsinset_98479(s, TMP2205);
		LA18: ;
		if (!LOC17) goto LA19;
		memset((void*)LOC21, 0, sizeof(LOC21));
		LOC21[0] = nsuStrip(s, NIM_TRUE, NIM_TRUE);
		dispa_359544((*d).Target, (&options), ((NimStringDesc*) &TMP2212), ((NimStringDesc*) &TMP2213), LOC21, 1);
	}
	LA19: ;
	s = getfieldvalue_344073(n, ((NimStringDesc*) &TMP2214));
	{
		NIM_BOOL LOC24;
		TY198301 LOC28;
		LOC24 = 0;
		LOC24 = (0 < s->Sup.len);
		if (!(LOC24)) goto LA25;
		LOC24 = allcharsinset_98479(s, TMP2205);
		LA25: ;
		if (!LOC24) goto LA26;
		memset((void*)LOC28, 0, sizeof(LOC28));
		LOC28[0] = nsuStrip(s, NIM_TRUE, NIM_TRUE);
		dispa_359544((*d).Target, (&options), ((NimStringDesc*) &TMP2215), ((NimStringDesc*) &TMP2114), LOC28, 1);
	}
	LA26: ;
	s = getfieldvalue_344073(n, ((NimStringDesc*) &TMP2216));
	{
		NIM_BOOL LOC31;
		TY198301 LOC35;
		LOC31 = 0;
		LOC31 = (0 < s->Sup.len);
		if (!(LOC31)) goto LA32;
		LOC31 = allcharsinset_98479(s, TMP2205);
		LA32: ;
		if (!LOC31) goto LA33;
		memset((void*)LOC35, 0, sizeof(LOC35));
		LOC35[0] = nsuStrip(s, NIM_TRUE, NIM_TRUE);
		dispa_359544((*d).Target, (&options), ((NimStringDesc*) &TMP2217), ((NimStringDesc*) &TMP2114), LOC35, 1);
	}
	LA33: ;
	{
		TY198301 LOC40;
		if (!(0 < options->Sup.len)) goto LA38;
		memset((void*)LOC40, 0, sizeof(LOC40));
		LOC40[0] = copyString(options);
		options = dispf_359521((*d).Target, ((NimStringDesc*) &TMP2168), ((NimStringDesc*) &TMP2218), LOC40, 1);
	}
	LA38: ;
	arg = getargument_344080(n);
	{
		NIM_BOOL LOC43;
		TY170951 LOC47;
		LOC43 = 0;
		LOC43 = (0 < arg->Sup.len);
		if (!(LOC43)) goto LA44;
		LOC43 = allcharsinset_98479(arg, TMP2205);
		LA44: ;
		if (!LOC43) goto LA45;
		memset((void*)LOC47, 0, sizeof(LOC47));
		LOC47[0] = copyString(arg);
		LOC47[1] = copyString(options);
		dispa_359544((*d).Target, result, ((NimStringDesc*) &TMP2219), ((NimStringDesc*) &TMP2220), LOC47, 2);
	}
	LA45: ;
	{
		NI LOC50;
		LOC50 = 0;
		LOC50 = len_343084(n);
		if (!(3 <= LOC50)) goto LA51;
		renderrsttoout_359579(d, (*n).Sons->data[2], result);
	}
	LA51: ;
}

N_NIMCALL(void, init_359078)(codeblockparams359020* p) {
	(*p).Startline = 1;
	(*p).Lang = ((NU8) 0);
	unsureAsgnRef((void**) (&(*p).Langstr), copyString(((NimStringDesc*) &TMP2114)));
}

N_NIMCALL(void, parsecodeblockfield_365991)(trstgenerator359016* d, trstnode343011* n, codeblockparams359020* params) {
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	LOC1 = 0;
	LOC1 = getargument_344080(n);
	LOC2 = 0;
	LOC2 = nsuToLowerStr(LOC1);
	if (eqStrings(LOC2, ((NimStringDesc*) &TMP2221))) goto LA3;
	if (eqStrings(LOC2, ((NimStringDesc*) &TMP2222))) goto LA4;
	if (eqStrings(LOC2, ((NimStringDesc*) &TMP2223))) goto LA5;
	goto LA6;
	LA3: ;
	{
		NI number;
		(*params).Numberlines = NIM_TRUE;
		number = 0;
		{
			NimStringDesc* LOC11;
			NI LOC12;
			LOC11 = 0;
			LOC11 = getfieldvalue_347823(n);
			LOC12 = 0;
			LOC12 = npuParseInt(LOC11, (&number), 0);
			if (!(0 < LOC12)) goto LA13;
			(*params).Startline = number;
		}
		LA13: ;
	}
	goto LA7;
	LA4: ;
	{
	}
	goto LA7;
	LA5: ;
	{
		NimStringDesc* LOC17;
		LOC17 = 0;
		LOC17 = getfieldvalue_347823(n);
		unsureAsgnRef((void**) (&(*params).Langstr), nsuStrip(LOC17, NIM_TRUE, NIM_TRUE));
		(*params).Lang = getsourcelanguage_353093((*params).Langstr);
	}
	goto LA7;
	LA6: ;
	{
		NimStringDesc* LOC19;
		LOC19 = 0;
		LOC19 = getargument_344080(n);
		(*d).Msghandler((*d).Filename, 1, 0, ((NU8) 9), LOC19);
	}
	LA7: ;
}

N_NIMCALL(void, parsecodeblockparams_366007)(trstgenerator359016* d, trstnode343011* n, codeblockparams359020* Result) {
	NimStringDesc* LOC12;
	init_359078(Result);
	{
		if (!n == 0) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	{
		if (!!((*n).Sons->data[1] == 0)) goto LA7;
		{
			trstnode343011* son_366611;
			trstnodeseq343009* HEX3Atmp_366614;
			NI i_366617;
			NI l_366619;
			son_366611 = 0;
			HEX3Atmp_366614 = 0;
			HEX3Atmp_366614 = (*(*n).Sons->data[1]).Sons;
			i_366617 = 0;
			l_366619 = HEX3Atmp_366614->Sup.len;
			{
				while (1) {
					if (!(i_366617 < l_366619)) goto LA11;
					son_366611 = HEX3Atmp_366614->data[i_366617];
					parsecodeblockfield_365991(d, son_366611, Result);
					i_366617 += 1;
				} LA11: ;
			}
		}
	}
	LA7: ;
	LOC12 = 0;
	LOC12 = getargument_344080(n);
	unsureAsgnRef((void**) (&(*Result).Langstr), nsuStrip(LOC12, NIM_TRUE, NIM_TRUE));
	{
		if (!!((((*Result).Langstr) && ((*Result).Langstr)->Sup.len == 0))) goto LA15;
		(*Result).Lang = getsourcelanguage_353093((*Result).Langstr);
	}
	LA15: ;
	BeforeRet: ;
}

N_NIMCALL(void, buildlineshtmltable_366635)(codeblockparams359020 params, NimStringDesc* code, keyvaluepair133008* Result) {
	NI codelines;
	NimStringDesc* LOC5;
	NI LOC6;
	NI line;
	{
		if (!!(params.Numberlines)) goto LA3;
		unsureAsgnRef((void**) (&(*Result).Field0), copyString(TMP2231.Field0));
		unsureAsgnRef((void**) (&(*Result).Field1), copyString(TMP2231.Field1));
		goto BeforeRet;
	}
	LA3: ;
	LOC5 = 0;
	LOC5 = nsuStrip(code, NIM_TRUE, NIM_TRUE);
	LOC6 = 0;
	LOC6 = nsuCountLines(LOC5);
	codelines = (NI32)(1 + LOC6);
	unsureAsgnRef((void**) (&(*Result).Field0), copyString(((NimStringDesc*) &TMP2234)));
	line = params.Startline;
	{
		while (1) {
			NimStringDesc* LOC9;
			NimStringDesc* LOC10;
			if (!(0 < codelines)) goto LA8;
			LOC9 = 0;
			LOC10 = 0;
			LOC10 = nimIntToStr(line);
			LOC9 = rawNewString(LOC10->Sup.len + 2);
appendString(LOC9, LOC10);
appendString(LOC9, ((NimStringDesc*) &TMP2122));
			(*Result).Field0 = resizeString((*Result).Field0, LOC9->Sup.len + 0);
appendString((*Result).Field0, LOC9);
			line += 1;
			codelines -= 1;
		} LA8: ;
	}
	(*Result).Field0 = resizeString((*Result).Field0, 20);
appendString((*Result).Field0, ((NimStringDesc*) &TMP2235));
	unsureAsgnRef((void**) (&(*Result).Field1), copyString(((NimStringDesc*) &TMP2236)));
	BeforeRet: ;
}

N_NIMCALL(void, rendercodeblock_366840)(trstgenerator359016* d, trstnode343011* n, NimStringDesc** result) {
	codeblockparams359020 params;
	trstnode343011* m;
	keyvaluepair133008 LOC5;
	NimStringDesc* blockstart;
	NimStringDesc* blockend;
	TY261532 LOC6;
	TY261532 LOC27;
	{
		if (!((*n).Sons->data[2] == NIM_NIL)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	memset((void*)(&params), 0, sizeof(params));
	chckNil((void*)(&params));
	memset((void*)(&params), 0, sizeof(params));
	parsecodeblockparams_366007(d, n, (&params));
	m = (*(*n).Sons->data[2]).Sons->data[0];
	memset((void*)(&LOC5), 0, sizeof(LOC5));
	buildlineshtmltable_366635(params, (*m).Text, (&LOC5));
	blockstart = 0;
	blockstart = LOC5.Field0;
	blockend = 0;
	blockend = LOC5.Field1;
	memset((void*)LOC6, 0, sizeof(LOC6));
	dispa_359544((*d).Target, result, blockstart, ((NimStringDesc*) &TMP2237), LOC6, 0);
	{
		if (!(params.Lang == ((NU8) 0))) goto LA9;
		{
			if (!(0 < params.Langstr->Sup.len)) goto LA13;
			(*d).Msghandler((*d).Filename, 1, 0, ((NU8) 8), params.Langstr);
		}
		LA13: ;
		{
			NIM_CHAR letter_367220;
			NimStringDesc* HEX3Atmp_367237;
			NI i_367240;
			NI l_367242;
			letter_367220 = 0;
			HEX3Atmp_367237 = 0;
			HEX3Atmp_367237 = (*m).Text;
			i_367240 = 0;
			l_367242 = HEX3Atmp_367237->Sup.len;
			{
				while (1) {
					if (!(i_367240 < l_367242)) goto LA17;
					letter_367220 = HEX3Atmp_367237->data[i_367240];
					escchar_359337((*d).Target, result, letter_367220);
					i_367240 += 1;
				} LA17: ;
			}
		}
	}
	goto LA7;
	LA9: ;
	{
		tgeneraltokenizer353023 g;
		memset((void*)(&g), 0, sizeof(g));
		g.Sup.m_type = (&NTI353023);
		initgeneraltokenizer_353229((&g), (*m).Text);
		{
			while (1) {
				getnexttoken_356166((&g), params.Lang);
				switch (g.Kind) {
				case ((NU8) 0):
				{
					goto LA19;
				}
				break;
				case ((NU8) 1):
				case ((NU8) 2):
				{
					NimStringDesc* LOC23;
					LOC23 = 0;
					LOC23 = copyStrLast((*m).Text, g.Start, (NI32)((NI32)(g.Length + g.Start) - 1));
					(*result) = resizeString((*result), LOC23->Sup.len + 0);
appendString((*result), LOC23);
				}
				break;
				default:
				{
					TY170951 LOC25;
					NimStringDesc* LOC26;
					memset((void*)LOC25, 0, sizeof(LOC25));
					LOC26 = 0;
					LOC26 = copyStrLast((*m).Text, g.Start, (NI32)((NI32)(g.Length + g.Start) - 1));
					LOC25[0] = esc_359407((*d).Target, LOC26, -1);
					LOC25[1] = copyString(tokenclasstostr_353081[(g.Kind)- 0]);
					dispa_359544((*d).Target, result, ((NimStringDesc*) &TMP2398), ((NimStringDesc*) &TMP2399), LOC25, 2);
				}
				break;
				}
			}
		} LA19: ;
		deinitgeneraltokenizer_353240((&g));
	}
	LA7: ;
	memset((void*)LOC27, 0, sizeof(LOC27));
	dispa_359544((*d).Target, result, blockend, ((NimStringDesc*) &TMP2433), LOC27, 0);
	BeforeRet: ;
}

N_NIMCALL(void, rendercontainer_367266)(trstgenerator359016* d, trstnode343011* n, NimStringDesc** result) {
	NimStringDesc* tmp;
	NimStringDesc* arg;
	NimStringDesc* LOC1;
	tmp = copyString(((NimStringDesc*) &TMP2114));
	renderrsttoout_359579(d, (*n).Sons->data[2], (&tmp));
	LOC1 = 0;
	LOC1 = getargument_344080(n);
	arg = nsuStrip(LOC1, NIM_TRUE, NIM_TRUE);
	{
		TY198301 LOC6;
		if (!((arg) && (arg)->Sup.len == 0)) goto LA4;
		memset((void*)LOC6, 0, sizeof(LOC6));
		LOC6[0] = copyString(tmp);
		dispa_359544((*d).Target, result, ((NimStringDesc*) &TMP2434), ((NimStringDesc*) &TMP2168), LOC6, 1);
	}
	goto LA2;
	LA4: ;
	{
		TY170951 LOC8;
		memset((void*)LOC8, 0, sizeof(LOC8));
		LOC8[0] = copyString(arg);
		LOC8[1] = copyString(tmp);
		dispa_359544((*d).Target, result, ((NimStringDesc*) &TMP2435), ((NimStringDesc*) &TMP2436), LOC8, 2);
	}
	LA2: ;
}

N_NIMCALL(void, renderindexterm_359871)(trstgenerator359016* d, trstnode343011* n_359874, NimStringDesc** result) {
	NimStringDesc* refname;
	NimStringDesc* id;
	NimStringDesc* LOC8;
	NI LOC9;
	NimStringDesc* LOC10;
	NimStringDesc* term;
	TY170951 LOC11;
	refname = rstnodetorefname_344061(n_359874);
	{
		NIM_BOOL LOC3;
		NI LOC6;
		LOC3 = 0;
		LOC3 = haskey_359880((*d).Seenindexterms, refname);
		if (!LOC3) goto LA4;
		LOC6 = 0;
		LOC6 = HEX5BHEX5D_359943((*d).Seenindexterms, refname);
		HEX5BHEX5DHEX3D_359974((&(*d).Seenindexterms), refname, (NI32)(LOC6 + 1));
	}
	goto LA1;
	LA4: ;
	{
		HEX5BHEX5DHEX3D_359974((&(*d).Seenindexterms), refname, 1);
	}
	LA1: ;
	LOC8 = 0;
	LOC9 = 0;
	LOC9 = HEX5BHEX5D_359943((*d).Seenindexterms, refname);
	LOC10 = 0;
	LOC10 = nimIntToStr(LOC9);
	LOC8 = rawNewString(refname->Sup.len + LOC10->Sup.len + 1);
appendString(LOC8, refname);
appendChar(LOC8, 95);
appendString(LOC8, LOC10);
	id = LOC8;
	term = copyString(((NimStringDesc*) &TMP2114));
	renderaux_359589(d, n_359874, (&term));
	setindexterm_359710(d, id, term, (*d).Currentsection, ((NimStringDesc*) &TMP2114));
	memset((void*)LOC11, 0, sizeof(LOC11));
	LOC11[0] = copyString(id);
	LOC11[1] = copyString(term);
	dispa_359544((*d).Target, result, ((NimStringDesc*) &TMP2450), ((NimStringDesc*) &TMP2451), LOC11, 2);
}

N_NIMCALL(void, rendersmiley_365975)(trstgenerator359016* d, trstnode343011* n, NimStringDesc** result) {
	TY198301 LOC1;
	NimStringDesc* LOC2;
	memset((void*)LOC1, 0, sizeof(LOC1));
	LOC2 = 0;
	LOC2 = nstGet((*d).Config, ((NimStringDesc*) &TMP2456));
	LOC1[0] = nsuFormatSingleElem(LOC2, (*n).Text);
	dispa_359544((*d).Target, result, ((NimStringDesc*) &TMP2454), ((NimStringDesc*) &TMP2455), LOC1, 1);
}

N_NIMCALL(void, renderrsttoout_359579)(trstgenerator359016* d, trstnode343011* n, NimStringDesc** result) {
	{
		if (!(n == NIM_NIL)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	switch ((*n).Kind) {
	case ((NU8) 0):
	{
		renderaux_359589(d, n, result);
	}
	break;
	case ((NU8) 1):
	{
		renderheadline_365281(d, n, result);
	}
	break;
	case ((NU8) 2):
	{
		renderoverline_365425(d, n, result);
	}
	break;
	case ((NU8) 3):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2128), ((NimStringDesc*) &TMP2129), result);
	}
	break;
	case ((NU8) 4):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2130), ((NimStringDesc*) &TMP2131), result);
	}
	break;
	case ((NU8) 5):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2132), ((NimStringDesc*) &TMP2133), result);
	}
	break;
	case ((NU8) 6):
	case ((NU8) 8):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2134), ((NimStringDesc*) &TMP2135), result);
	}
	break;
	case ((NU8) 7):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2136), ((NimStringDesc*) &TMP2137), result);
	}
	break;
	case ((NU8) 9):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2138), ((NimStringDesc*) &TMP2139), result);
	}
	break;
	case ((NU8) 10):
	{
		renderaux_359589(d, n, result);
	}
	break;
	case ((NU8) 11):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2140), ((NimStringDesc*) &TMP2141), result);
	}
	break;
	case ((NU8) 12):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2142), ((NimStringDesc*) &TMP2143), result);
	}
	break;
	case ((NU8) 13):
	{
		NimStringDesc* tmp;
		tmp = copyString(((NimStringDesc*) &TMP2114));
		{
			NI i_367387;
			NI HEX3Atmp_367457;
			NI LOC19;
			NI res_367460;
			i_367387 = 0;
			HEX3Atmp_367457 = 0;
			LOC19 = 0;
			LOC19 = len_343084(n);
			HEX3Atmp_367457 = (NI32)(LOC19 - 1);
			res_367460 = 0;
			{
				while (1) {
					if (!(res_367460 <= HEX3Atmp_367457)) goto LA21;
					i_367387 = res_367460;
					renderrsttoout_359579(d, (*n).Sons->data[i_367387], (&tmp));
					res_367460 += 1;
				} LA21: ;
			}
		}
		{
			TY198301 LOC26;
			if (!!((tmp->Sup.len == 0))) goto LA24;
			memset((void*)LOC26, 0, sizeof(LOC26));
			LOC26[0] = copyString(tmp);
			dispa_359544((*d).Target, result, ((NimStringDesc*) &TMP2144), ((NimStringDesc*) &TMP2139), LOC26, 1);
		}
		LA24: ;
	}
	break;
	case ((NU8) 14):
	{
		renderfield_367327(d, n, result);
	}
	break;
	case ((NU8) 15):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2169), ((NimStringDesc*) &TMP2170), result);
	}
	break;
	case ((NU8) 16):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2171), ((NimStringDesc*) &TMP2172), result);
	}
	break;
	case ((NU8) 51):
	{
		renderrsttoout_359579(d, (*n).Sons->data[2], result);
	}
	break;
	case ((NU8) 17):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2173), ((NimStringDesc*) &TMP2174), result);
	}
	break;
	case ((NU8) 18):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2167), ((NimStringDesc*) &TMP2168), result);
	}
	break;
	case ((NU8) 19):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2175), ((NimStringDesc*) &TMP2176), result);
	}
	break;
	case ((NU8) 23):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2177), ((NimStringDesc*) &TMP2172), result);
	}
	break;
	case ((NU8) 20):
	case ((NU8) 21):
	case ((NU8) 22):
	{
		{
			if (!NIM_TRUE) goto LA38;
			raiseassert_86357(((NimStringDesc*) &TMP2179));
		}
		LA38: ;
	}
	break;
	case ((NU8) 24):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2180), ((NimStringDesc*) &TMP2181), result);
	}
	break;
	case ((NU8) 25):
	{
		{
			if (!NIM_TRUE) goto LA44;
			raiseassert_86357(((NimStringDesc*) &TMP2179));
		}
		LA44: ;
	}
	break;
	case ((NU8) 26):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2182), ((NimStringDesc*) &TMP2131), result);
	}
	break;
	case ((NU8) 27):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2183), ((NimStringDesc*) &TMP2184), result);
	}
	break;
	case ((NU8) 28):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2185), ((NimStringDesc*) &TMP2186), result);
	}
	break;
	case ((NU8) 29):
	case ((NU8) 30):
	{
		NimStringDesc* LOC50;
		NimStringDesc* LOC51;
		LOC50 = 0;
		LOC51 = 0;
		LOC51 = texcolumns_367289(n);
		LOC50 = rawNewString(LOC51->Sup.len + 65);
appendString(LOC50, ((NimStringDesc*) &TMP2188));
appendString(LOC50, LOC51);
appendString(LOC50, ((NimStringDesc*) &TMP2190));
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2187), LOC50, result);
	}
	break;
	case ((NU8) 31):
	{
		{
			NI LOC55;
			LOC55 = 0;
			LOC55 = len_343084(n);
			if (!(1 <= LOC55)) goto LA56;
			{
				if (!((*d).Target == ((NU8) 1))) goto LA60;
				renderrsttoout_359579(d, (*n).Sons->data[0], result);
				{
					NI i_367414;
					NI HEX3Atmp_367463;
					NI LOC63;
					NI res_367466;
					i_367414 = 0;
					HEX3Atmp_367463 = 0;
					LOC63 = 0;
					LOC63 = len_343084(n);
					HEX3Atmp_367463 = (NI32)(LOC63 - 1);
					res_367466 = 1;
					{
						while (1) {
							if (!(res_367466 <= HEX3Atmp_367463)) goto LA65;
							i_367414 = res_367466;
							(*result) = resizeString((*result), 3);
appendString((*result), ((NimStringDesc*) &TMP2191));
							renderrsttoout_359579(d, (*n).Sons->data[i_367414], result);
							res_367466 += 1;
						} LA65: ;
					}
				}
				(*result) = resizeString((*result), 12);
appendString((*result), ((NimStringDesc*) &TMP2192));
			}
			goto LA58;
			LA60: ;
			{
				(*result) = resizeString((*result), 4);
appendString((*result), ((NimStringDesc*) &TMP2193));
				renderaux_359589(d, n, result);
				(*result) = resizeString((*result), 7);
appendString((*result), ((NimStringDesc*) &TMP2194));
			}
			LA58: ;
		}
		LA56: ;
	}
	break;
	case ((NU8) 33):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2171), ((NimStringDesc*) &TMP2168), result);
	}
	break;
	case ((NU8) 32):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2195), ((NimStringDesc*) &TMP2196), result);
	}
	break;
	case ((NU8) 34):
	{
		{
			if (!NIM_TRUE) goto LA72;
			raiseassert_86357(((NimStringDesc*) &TMP2179));
		}
		LA72: ;
	}
	break;
	case ((NU8) 35):
	{
		{
			if (!NIM_TRUE) goto LA77;
			raiseassert_86357(((NimStringDesc*) &TMP2179));
		}
		LA77: ;
	}
	break;
	case ((NU8) 36):
	{
		{
			if (!NIM_TRUE) goto LA82;
			raiseassert_86357(((NimStringDesc*) &TMP2179));
		}
		LA82: ;
	}
	break;
	case ((NU8) 39):
	{
		NimStringDesc* tmp;
		TY170951 LOC85;
		tmp = copyString(((NimStringDesc*) &TMP2114));
		renderaux_359589(d, n, (&tmp));
		memset((void*)LOC85, 0, sizeof(LOC85));
		LOC85[0] = copyString(tmp);
		LOC85[1] = rstnodetorefname_344061(n);
		dispa_359544((*d).Target, result, ((NimStringDesc*) &TMP2197), ((NimStringDesc*) &TMP2198), LOC85, 2);
	}
	break;
	case ((NU8) 37):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2199), ((NimStringDesc*) &TMP2200), result);
	}
	break;
	case ((NU8) 38):
	{
		NimStringDesc* tmp0;
		NimStringDesc* tmp1;
		TY170951 LOC88;
		tmp0 = copyString(((NimStringDesc*) &TMP2114));
		tmp1 = copyString(((NimStringDesc*) &TMP2114));
		renderrsttoout_359579(d, (*n).Sons->data[0], (&tmp0));
		renderrsttoout_359579(d, (*n).Sons->data[1], (&tmp1));
		memset((void*)LOC88, 0, sizeof(LOC88));
		LOC88[0] = copyString(tmp0);
		LOC88[1] = copyString(tmp1);
		dispa_359544((*d).Target, result, ((NimStringDesc*) &TMP2201), ((NimStringDesc*) &TMP2202), LOC88, 2);
	}
	break;
	case ((NU8) 41):
	case ((NU8) 42):
	{
		renderaux_359589(d, n, result);
	}
	break;
	case ((NU8) 48):
	{
		{
			trstnode343011* LOC95;
			NimStringDesc* LOC96;
			if (!!(((*d).Target == ((NU8) 1)))) goto LA93;
			LOC95 = 0;
			LOC95 = lastson_343162(n);
			LOC96 = 0;
			LOC96 = addnodes_344067(LOC95);
			(*result) = resizeString((*result), LOC96->Sup.len + 0);
appendString((*result), LOC96);
		}
		LA93: ;
	}
	break;
	case ((NU8) 49):
	{
		{
			trstnode343011* LOC102;
			NimStringDesc* LOC103;
			if (!((*d).Target == ((NU8) 1))) goto LA100;
			LOC102 = 0;
			LOC102 = lastson_343162(n);
			LOC103 = 0;
			LOC103 = addnodes_344067(LOC102);
			(*result) = resizeString((*result), LOC103->Sup.len + 0);
appendString((*result), LOC103);
		}
		LA100: ;
	}
	break;
	case ((NU8) 45):
	case ((NU8) 46):
	{
		renderimage_365598(d, n, result);
	}
	break;
	case ((NU8) 47):
	{
		rendercodeblock_366840(d, n, result);
	}
	break;
	case ((NU8) 50):
	{
		rendercontainer_367266(d, n, result);
	}
	break;
	case ((NU8) 62):
	case ((NU8) 52):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2437), ((NimStringDesc*) &TMP2437), result);
	}
	break;
	case ((NU8) 40):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2114), ((NimStringDesc*) &TMP2114), result);
	}
	break;
	case ((NU8) 53):
	{
		NimStringDesc* tmp0;
		NimStringDesc* tmp1;
		TY170951 LOC110;
		tmp0 = copyString(((NimStringDesc*) &TMP2114));
		tmp1 = copyString(((NimStringDesc*) &TMP2114));
		renderrsttoout_359579(d, (*n).Sons->data[0], (&tmp0));
		renderrsttoout_359579(d, (*n).Sons->data[1], (&tmp1));
		memset((void*)LOC110, 0, sizeof(LOC110));
		LOC110[0] = copyString(tmp0);
		LOC110[1] = copyString(tmp1);
		dispa_359544((*d).Target, result, ((NimStringDesc*) &TMP2398), ((NimStringDesc*) &TMP2399), LOC110, 2);
	}
	break;
	case ((NU8) 54):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2438), ((NimStringDesc*) &TMP2439), result);
	}
	break;
	case ((NU8) 55):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2440), ((NimStringDesc*) &TMP2441), result);
	}
	break;
	case ((NU8) 57):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2442), ((NimStringDesc*) &TMP2443), result);
	}
	break;
	case ((NU8) 58):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2444), ((NimStringDesc*) &TMP2196), result);
	}
	break;
	case ((NU8) 59):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2445), ((NimStringDesc*) &TMP2446), result);
	}
	break;
	case ((NU8) 60):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2447), ((NimStringDesc*) &TMP2443), result);
	}
	break;
	case ((NU8) 56):
	{
		renderindexterm_359871(d, n, result);
	}
	break;
	case ((NU8) 61):
	{
		renderaux_359629(d, n, ((NimStringDesc*) &TMP2452), ((NimStringDesc*) &TMP2453), result);
	}
	break;
	case ((NU8) 63):
	{
		rendersmiley_365975(d, n, result);
	}
	break;
	case ((NU8) 64):
	{
		NimStringDesc* LOC121;
		LOC121 = 0;
		LOC121 = esc_359407((*d).Target, (*n).Text, -1);
		(*result) = resizeString((*result), LOC121->Sup.len + 0);
appendString((*result), LOC121);
	}
	break;
	case ((NU8) 44):
	{
		(*d).Hastoc = NIM_TRUE;
	}
	break;
	case ((NU8) 43):
	{
		unsureAsgnRef((void**) (&(*d).Meta[(((NU8) 1))- 0]), copyString(((NimStringDesc*) &TMP2114)));
		renderrsttoout_359579(d, (*n).Sons->data[0], (&(*d).Meta[(((NU8) 1))- 0]));
	}
	break;
	}
	BeforeRet: ;
}
N_NIMCALL(void, TMP4627)(void* p, NI op) {
	TY359034* a;
	NI LOC1;
	a = (TY359034*)p;
	LOC1 = 0;
	for (LOC1 = 0; LOC1 < a->Sup.len; LOC1++) {
	nimGCvisit((void*)a->data[LOC1].N, op);
	nimGCvisit((void*)a->data[LOC1].Refname, op);
	nimGCvisit((void*)a->data[LOC1].Header, op);
	}
}

N_NIMCALL(void, initrstgenerator_359088)(trstgenerator359016* g, NU8 target, stringtableobj133012* config, NimStringDesc* filename, NU8 options, tfindfilehandler344023 findfile, tmsghandler344021 msghandler) {
	TY116804 fileparts;
	NimStringDesc* s;
	unsureAsgnRef((void**) (&(*g).Config), config);
	(*g).Target = target;
	unsureAsgnRef((void**) (&(*g).Tocpart), (TY359034*) newSeq((&NTI359034), 0));
	unsureAsgnRef((void**) (&(*g).Filename), copyString(filename));
	(*g).Splitafter = 20;
	unsureAsgnRef((void**) (&(*g).Theindex), copyString(((NimStringDesc*) &TMP2114)));
	(*g).Options = options;
	(*g).Findfile = findfile;
	unsureAsgnRef((void**) (&(*g).Currentsection), copyString(((NimStringDesc*) &TMP2114)));
	memset((void*)(&fileparts), 0, sizeof(fileparts));
	chckNil((void*)(&fileparts));
	memset((void*)(&fileparts), 0, sizeof(fileparts));
	nossplitFile(filename, (&fileparts));
	{
		NimStringDesc* LOC5;
		if (!eqStrings(fileparts.Field2, ((NimStringDesc*) &TMP4631))) goto LA3;
		LOC5 = 0;
		LOC5 = rawNewString(fileparts.Field1->Sup.len + 7);
appendString(LOC5, ((NimStringDesc*) &TMP4632));
appendString(LOC5, fileparts.Field1);
		unsureAsgnRef((void**) (&(*g).Currentsection), LOC5);
	}
	LA3: ;
	inittable_359120(64, (&(*g).Seenindexterms));
	(*g).Msghandler = msghandler;
	s = nstGet(config, ((NimStringDesc*) &TMP4633));
	{
		if (!!(((s) && (s)->Sup.len == 0))) goto LA8;
		(*g).Splitafter = nsuParseInt(s);
	}
	LA8: ;
	{
		NU8 i_359266;
		NU8 res_359270;
		i_359266 = 0;
		res_359270 = ((NU8) 0);
		{
			while (1) {
				if (!(res_359270 <= ((NU8) 4))) goto LA12;
				i_359266 = res_359270;
				unsureAsgnRef((void**) (&(*g).Meta[(i_359266)- 0]), copyString(((NimStringDesc*) &TMP2114)));
				res_359270 += 1;
			} LA12: ;
		}
	}
}

N_NIMCALL(void, rendertocentry_365538)(trstgenerator359016* d, ttocentry359012 e, NimStringDesc** result) {
	TY170951 LOC1;
	memset((void*)LOC1, 0, sizeof(LOC1));
	LOC1[0] = copyString(e.Refname);
	LOC1[1] = copyString(e.Header);
	dispa_359544((*d).Target, result, ((NimStringDesc*) &TMP4706), ((NimStringDesc*) &TMP4707), LOC1, 2);
}

N_NIMCALL(void, rendertocentries_365554)(trstgenerator359016* d, NI* j, NI lvl, NimStringDesc** result) {
	NimStringDesc* tmp;
	tmp = copyString(((NimStringDesc*) &TMP2114));
	{
		while (1) {
			NI a;
			if (!((*j) <= ((*d).Tocpart->Sup.len-1))) goto LA2;
			a = ((*(*d).Tocpart->data[(*j)].N).Level > 0? ((*(*d).Tocpart->data[(*j)].N).Level) : -((*(*d).Tocpart->data[(*j)].N).Level));
			{
				if (!(a == lvl)) goto LA5;
				rendertocentry_365538(d, (*d).Tocpart->data[(*j)], (&tmp));
				(*j) += 1;
			}
			goto LA3;
			LA5: ;
			{
				if (!(lvl < a)) goto LA8;
				rendertocentries_365554(d, j, a, (&tmp));
			}
			goto LA3;
			LA8: ;
			{
				goto LA1;
			}
			LA3: ;
		} LA2: ;
	} LA1: ;
	{
		TY198301 LOC15;
		if (!(1 < lvl)) goto LA13;
		memset((void*)LOC15, 0, sizeof(LOC15));
		LOC15[0] = copyString(tmp);
		dispa_359544((*d).Target, result, ((NimStringDesc*) &TMP4708), ((NimStringDesc*) &TMP4709), LOC15, 1);
	}
	goto LA11;
	LA13: ;
	{
		(*result) = resizeString((*result), tmp->Sup.len + 0);
appendString((*result), tmp);
	}
	LA11: ;
}

N_NIMCALL(void, writeindexfile_359287)(trstgenerator359016* g, NimStringDesc* outfile) {
	{
		if (!(0 < (*g).Theindex->Sup.len)) goto LA3;
		writefile_12845(outfile, (*g).Theindex);
	}
	LA3: ;
}
N_NIMCALL(void, TMP4785)(void* p, NI op) {
	TY362804* a;
	NI LOC1;
	a = (TY362804*)p;
	LOC1 = 0;
	for (LOC1 = 0; LOC1 < a->Sup.len; LOC1++) {
	nimGCvisit((void*)a->data[LOC1].Keyword, op);
	nimGCvisit((void*)a->data[LOC1].Link, op);
	nimGCvisit((void*)a->data[LOC1].Linktitle, op);
	nimGCvisit((void*)a->data[LOC1].Linkdesc, op);
	}
}

static N_INLINE(NIM_BOOL, skipfinddata_113436)(twin32finddata104019* f) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	NIM_BOOL LOC3;
	NIM_BOOL LOC5;
	result = 0;
	LOC1 = 0;
	LOC1 = (((NI) ((*f).Cfilename[(0)- 0])) == 46);
	if (!(LOC1)) goto LA2;
	LOC3 = 0;
	LOC3 = (((NI) ((*f).Cfilename[(1)- 0])) == 0);
	if (LOC3) goto LA4;
	LOC5 = 0;
	LOC5 = (((NI) ((*f).Cfilename[(1)- 0])) == 46);
	if (!(LOC5)) goto LA6;
	LOC5 = (((NI) ((*f).Cfilename[(2)- 0])) == 0);
	LA6: ;
	LOC3 = LOC5;
	LA4: ;
	LOC1 = LOC3;
	LA2: ;
	result = LOC1;
	return result;
}

N_NIMCALL(NIM_BOOL, isdocumentationtitle_360777)(NimStringDesc* hyperlink) {
	NIM_BOOL result;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = nsuFindChar(hyperlink, 35, 0);
	result = (LOC1 < 0);
	return result;
}

N_NIMCALL(NimStringDesc*, unquoteindexcolumn_359700)(NimStringDesc* text) {
	NimStringDesc* result;
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	result = 0;
	LOC1 = 0;
	LOC1 = nsuReplaceStr(text, ((NimStringDesc*) &TMP2125), ((NimStringDesc*) &TMP2124));
	LOC2 = 0;
	LOC2 = nsuReplaceStr(LOC1, ((NimStringDesc*) &TMP2123), ((NimStringDesc*) &TMP2122));
	result = nsuReplaceStr(LOC2, ((NimStringDesc*) &TMP2121), ((NimStringDesc*) &TMP2120));
	return result;
}

static N_INLINE(NI, HEX21HEX26_130025)(NI h, NI val) {
	NI result;
	result = 0;
	result = (NI)((NU32)(h) + (NU32)(val));
	result = (NI)((NU32)(result) + (NU32)((NI)((NU32)(result) << (NU32)(10))));
	result = (NI)(result ^ (NI)((NU32)(result) >> (NU32)(6)));
	return result;
}

static N_INLINE(NimStringDesc*, or_359568)(NimStringDesc* x, NimStringDesc* y) {
	NimStringDesc* result;
	result = 0;
	{
		if (!x == 0) goto LA3;
		result = copyString(y);
	}
	goto LA1;
	LA3: ;
	{
		result = copyString(x);
	}
	LA1: ;
	return result;
}

static N_INLINE(NI, HEX21HEX24_130054)(NI h) {
	NI result;
	result = 0;
	result = (NI)((NU32)(h) + (NU32)((NI)((NU32)(h) << (NU32)(3))));
	result = (NI)(result ^ (NI)((NU32)(result) >> (NU32)(11)));
	result = (NI)((NU32)(result) + (NU32)((NI)((NU32)(result) << (NU32)(15))));
	return result;
}

N_NIMCALL(NI, hash_360309)(tindexentry360264 x) {
	NI result;
	NI LOC1;
	NI LOC2;
	NimStringDesc* LOC3;
	NI LOC4;
	NimStringDesc* LOC5;
	NI LOC6;
	result = 0;
	LOC1 = 0;
	LOC1 = hash_130839(x.Keyword);
	LOC2 = 0;
	LOC2 = hash_130839(x.Link);
	result = HEX21HEX26_130025(LOC1, LOC2);
	LOC3 = 0;
	LOC3 = or_359568(x.Linktitle, ((NimStringDesc*) &TMP2114));
	LOC4 = 0;
	LOC4 = hash_130839(LOC3);
	result = HEX21HEX26_130025(result, LOC4);
	LOC5 = 0;
	LOC5 = or_359568(x.Linkdesc, ((NimStringDesc*) &TMP2114));
	LOC6 = 0;
	LOC6 = hash_130839(LOC5);
	result = HEX21HEX26_130025(result, LOC6);
	result = HEX21HEX24_130054(result);
	return result;
}

N_NIMCALL(void, readindexdir_362798)(NimStringDesc* dir, TY362801* Result) {
	NI l;
	TY363571 LOC85;
	unsureAsgnRef((void**) (&(*Result).Field0), (TY120608*) newSeq((&NTI120608), 0));
	inittable_362830(32, (&(*Result).Field2));
	unsureAsgnRef((void**) (&(*Result).Field1), (TY362804*) newSeq((&NTI362804), 15000));
	(*Result).Field1 = (TY362804*) setLengthSeq(&((*Result).Field1)->Sup, sizeof(tindexentry360264), 0);
	l = 0;
	{
		NU8 kind_363055;
		NimStringDesc* path_363056;
		twin32finddata104019 f_365101;
		NI h_365103;
		NimStringDesc* LOC2;
		kind_363055 = 0;
		path_363056 = 0;
		memset((void*)(&f_365101), 0, sizeof(f_365101));
		LOC2 = 0;
		LOC2 = HEX2F_116499(dir, ((NimStringDesc*) &TMP4787));
		h_365103 = findfirstfile_113416(LOC2, (&f_365101));
		{
			if (!!((h_365103 == -1))) goto LA5;
			{
				while (1) {
					NU8 k_365105;
					k_365105 = ((NU8) 0);
					{
						NIM_BOOL LOC11;
						NimStringDesc* LOC22;
						NimStringDesc* LOC23;
						LOC11 = 0;
						LOC11 = skipfinddata_113436((&f_365101));
						if (!!(LOC11)) goto LA12;
						{
							if (!!(((NI32)(f_365101.Dwfileattributes & ((NI32) 16)) == ((NI32) 0)))) goto LA16;
							k_365105 = ((NU8) 2);
						}
						LA16: ;
						{
							if (!!(((NI32)(f_365101.Dwfileattributes & ((NI32) 1024)) == ((NI32) 0)))) goto LA20;
							k_365105 = (k_365105 + 1);
						}
						LA20: ;
						kind_363055 = k_365105;
						LOC22 = 0;
						LOC22 = HEX24_79195(((NI16*) ((&f_365101.Cfilename[(0)- 0]))));
						LOC23 = 0;
						LOC23 = nosextractFilename(LOC22);
						path_363056 = HEX2F_116499(dir, LOC23);
						{
							NIM_BOOL LOC26;
							TY362804* fileentries;
							tindexentry360264 title;
							NI f;
							LOC26 = 0;
							LOC26 = (kind_363055 == ((NU8) 0));
							if (!(LOC26)) goto LA27;
							LOC26 = nsuEndsWith(path_363056, ((NimStringDesc*) &TMP4788));
							LA27: ;
							if (!LOC26) goto LA28;
							fileentries = 0;
							memset((void*)(&title), 0, sizeof(title));
							f = 0;
							fileentries = (TY362804*) newSeq((&NTI362804), 500);
							fileentries = (TY362804*) setLengthSeq(&(fileentries)->Sup, sizeof(tindexentry360264), 0);
							{
								NimStringDesc* line_363103;
								FILE* f_365088;
								NimStringDesc* res_365090;
								line_363103 = 0;
								f_365088 = open_12617(path_363056, ((NU8) 0), 8000);
								res_365090 = rawNewString(80);
								{
									while (1) {
										NIM_BOOL LOC33;
										LOC33 = 0;
										LOC33 = readline_12889(f_365088, (&res_365090));
										if (!LOC33) goto LA32;
										line_363103 = res_365090;
										{
											NI s;
											s = nsuFindChar(line_363103, 9, 0);
											{
												if (!(s < 0)) goto LA37;
												goto LA34;
											}
											LA37: ;
											fileentries = (TY362804*) setLengthSeq(&(fileentries)->Sup, sizeof(tindexentry360264), (NI32)(f + 1));
											asgnRefNoCycle((void**) (&fileentries->data[f].Keyword), copyStrLast(line_363103, 0, (NI32)(s - 1)));
											asgnRefNoCycle((void**) (&fileentries->data[f].Link), copyStr(line_363103, (NI32)(s + 1)));
											{
												NIM_BOOL LOC41;
												LOC41 = 0;
												LOC41 = title.Keyword == 0;
												if (!(LOC41)) goto LA42;
												LOC41 = isdocumentationtitle_360777(fileentries->data[f].Link);
												LA42: ;
												if (!LOC41) goto LA43;
												title.Keyword = copyString(fileentries->data[f].Keyword);
												title.Link = copyString(fileentries->data[f].Link);
											}
											LA43: ;
											{
												NI LOC47;
												TY120608* extracols;
												NimStringDesc* LOC50;
												LOC47 = 0;
												LOC47 = nsuFindChar(fileentries->data[f].Link, 9, 0);
												if (!(0 < LOC47)) goto LA48;
												extracols = nsuSplitChar(fileentries->data[f].Link, 9);
												LOC50 = 0;
												LOC50 = fileentries->data[f].Link; fileentries->data[f].Link = copyStringRC1(extracols->data[0]);
												if (LOC50) nimGCunrefNoCycle(LOC50);
												asgnRefNoCycle((void**) (&fileentries->data[f].Linktitle), unquoteindexcolumn_359700(extracols->data[1]));
												asgnRefNoCycle((void**) (&fileentries->data[f].Linkdesc), unquoteindexcolumn_359700(extracols->data[2]));
											}
											goto LA45;
											LA48: ;
											{
												NimStringDesc* LOC52;
												NimStringDesc* LOC53;
												LOC52 = 0;
												LOC52 = fileentries->data[f].Linktitle; fileentries->data[f].Linktitle = copyStringRC1(NIM_NIL);
												if (LOC52) nimGCunrefNoCycle(LOC52);
												LOC53 = 0;
												LOC53 = fileentries->data[f].Linkdesc; fileentries->data[f].Linkdesc = copyStringRC1(NIM_NIL);
												if (LOC53) nimGCunrefNoCycle(LOC53);
											}
											LA45: ;
											f += 1;
										} LA34: ;
									} LA32: ;
								}
								fclose(f_365088);
							}
							{
								TY116804 LOC74;
								NimStringDesc* LOC75;
								if (!title.Keyword == 0) goto LA56;
								{
									NI i_363234;
									NI HEX3Atmp_365094;
									NI res_365097;
									i_363234 = 0;
									HEX3Atmp_365094 = 0;
									HEX3Atmp_365094 = (f - 1);
									res_365097 = 0;
									{
										while (1) {
											if (!(res_365097 <= HEX3Atmp_365094)) goto LA60;
											i_363234 = res_365097;
											{
												NimStringDesc* toc;
												NimStringDesc* LOC70;
												NimStringDesc* LOC71;
												NimStringDesc* LOC72;
												NimStringDesc* LOC73;
												toc = fileentries->data[i_363234].Linktitle;
												{
													NIM_BOOL LOC64;
													NIM_BOOL LOC65;
													LOC64 = 0;
													LOC65 = 0;
													LOC65 = !(toc == 0);
													if (!(LOC65)) goto LA66;
													LOC65 = (0 < toc->Sup.len);
													LA66: ;
													LOC64 = LOC65;
													if (!(LOC64)) goto LA67;
													LOC64 = ((NU8)(toc->data[0]) == (NU8)(32));
													LA67: ;
													if (!LOC64) goto LA68;
													goto LA61;
												}
												LA68: ;
												(*Result).Field1 = (TY362804*) setLengthSeq(&((*Result).Field1)->Sup, sizeof(tindexentry360264), (NI32)(l + 1));
												LOC70 = 0;
												LOC70 = (*Result).Field1->data[l].Keyword; (*Result).Field1->data[l].Keyword = copyStringRC1(fileentries->data[i_363234].Keyword);
												if (LOC70) nimGCunrefNoCycle(LOC70);
												LOC71 = 0;
												LOC71 = (*Result).Field1->data[l].Link; (*Result).Field1->data[l].Link = copyStringRC1(fileentries->data[i_363234].Link);
												if (LOC71) nimGCunrefNoCycle(LOC71);
												LOC72 = 0;
												LOC72 = (*Result).Field1->data[l].Linktitle; (*Result).Field1->data[l].Linktitle = copyStringRC1(fileentries->data[i_363234].Linktitle);
												if (LOC72) nimGCunrefNoCycle(LOC72);
												LOC73 = 0;
												LOC73 = (*Result).Field1->data[l].Linkdesc; (*Result).Field1->data[l].Linkdesc = copyStringRC1(fileentries->data[i_363234].Linkdesc);
												if (LOC73) nimGCunrefNoCycle(LOC73);
												l += 1;
											} LA61: ;
											res_365097 += 1;
										} LA60: ;
									}
								}
								memset((void*)(&LOC74), 0, sizeof(LOC74));
								nossplitFile(path_363056, (&LOC74));
								(*Result).Field0 = (TY120608*) incrSeq(&((*Result).Field0)->Sup, sizeof(NimStringDesc*));
								LOC75 = 0;
								LOC75 = (*Result).Field0->data[(*Result).Field0->Sup.len-1]; (*Result).Field0->data[(*Result).Field0->Sup.len-1] = copyStringRC1(LOC74.Field1);
								if (LOC75) nimGCunrefNoCycle(LOC75);
							}
							goto LA54;
							LA56: ;
							{
								NimStringDesc* LOC77;
								NI LOC78;
								NimStringDesc* LOC79;
								LOC77 = 0;
								LOC78 = 0;
								LOC78 = len_363285((*Result).Field2);
								LOC79 = 0;
								LOC79 = nimIntToStr(LOC78);
								LOC77 = rawNewString(LOC79->Sup.len + 8);
appendString(LOC77, ((NimStringDesc*) &TMP4789));
appendString(LOC77, LOC79);
								title.Linktitle = LOC77;
								HEX5BHEX5DHEX3D_363301((&(*Result).Field2), title, fileentries);
							}
							LA54: ;
						}
						LA28: ;
					}
					LA12: ;
					{
						NI32 LOC82;
						LOC82 = 0;
						LOC82 = Dl_104044(h_365103, (&f_365101));
						if (!(LOC82 == ((NI32) 0))) goto LA83;
						goto LA7;
					}
					LA83: ;
				}
			} LA7: ;
			Dl_104204(h_365103);
		}
		LA5: ;
	}
	memset((void*)(&LOC85), 0, sizeof(LOC85));
	LOC85.ClPrc = ((TMP4792) (cmp_4517)); LOC85.ClEnv = NIM_NIL;
	sort_363552((*Result).Field0->data, (*Result).Field0->Sup.len, LOC85, ((NU8) 1));
}

N_NIMCALL(void, HEX3CHEX2D_360607)(tindexentry360264* a, tindexentry360264 b) {
	unsureAsgnRef((void**) (&(*a).Keyword), b.Keyword);
	unsureAsgnRef((void**) (&(*a).Link), b.Link);
	{
		if (!b.Linktitle == 0) goto LA3;
		unsureAsgnRef((void**) (&(*a).Linktitle), copyString(NIM_NIL));
	}
	goto LA1;
	LA3: ;
	{
		unsureAsgnRef((void**) (&(*a).Linktitle), b.Linktitle);
	}
	LA1: ;
	{
		if (!b.Linkdesc == 0) goto LA8;
		unsureAsgnRef((void**) (&(*a).Linkdesc), copyString(NIM_NIL));
	}
	goto LA6;
	LA8: ;
	{
		unsureAsgnRef((void**) (&(*a).Linkdesc), b.Linkdesc);
	}
	LA6: ;
}

N_NIMCALL(NI, cmp_360298)(tindexentry360264 a, tindexentry360264 b) {
	NI result;
	result = 0;
	result = nsuCmpIgnoreStyle(a.Keyword, b.Keyword);
	{
		if (!(result == 0)) goto LA3;
		result = nsuCmpIgnoreStyle(a.Link, b.Link);
	}
	LA3: ;
	return result;
}

N_NIMCALL(NimStringDesc*, generatedocumentationjumps_362423)(table360277 docs) {
	NimStringDesc* result_362426;
	TY362804* titles;
	TY362804* result_362428;
	TY361572 LOC13;
	TY120608* chunks;
	NimStringDesc* LOC19;
	NimStringDesc* LOC20;
	result_362426 = 0;
	result_362426 = copyString(((NimStringDesc*) &TMP4793));
	result_362428 = (TY362804*) newSeq((&NTI362804), 0);
	{
		tindexentry360264 x_362430;
		memset((void*)(&x_362430), 0, sizeof(x_362430));
		{
			NI h_362679;
			NI HEX3Atmp_362681;
			NI res_362683;
			h_362679 = 0;
			HEX3Atmp_362681 = 0;
			HEX3Atmp_362681 = (docs.Data->Sup.len-1);
			res_362683 = 0;
			{
				while (1) {
					if (!(res_362683 <= HEX3Atmp_362681)) goto LA4;
					h_362679 = res_362683;
					{
						NimStringDesc* LOC9;
						NimStringDesc* LOC10;
						NimStringDesc* LOC11;
						NimStringDesc* LOC12;
						if (!(docs.Data->data[h_362679].Field0 == ((NU8) 1))) goto LA7;
						x_362430.Keyword = docs.Data->data[h_362679].Field1.Keyword;
						x_362430.Link = docs.Data->data[h_362679].Field1.Link;
						x_362430.Linktitle = docs.Data->data[h_362679].Field1.Linktitle;
						x_362430.Linkdesc = docs.Data->data[h_362679].Field1.Linkdesc;
						result_362428 = (TY362804*) incrSeq(&(result_362428)->Sup, sizeof(tindexentry360264));
						LOC9 = 0;
						LOC9 = result_362428->data[result_362428->Sup.len-1].Keyword; result_362428->data[result_362428->Sup.len-1].Keyword = copyStringRC1(x_362430.Keyword);
						if (LOC9) nimGCunrefNoCycle(LOC9);
						LOC10 = 0;
						LOC10 = result_362428->data[result_362428->Sup.len-1].Link; result_362428->data[result_362428->Sup.len-1].Link = copyStringRC1(x_362430.Link);
						if (LOC10) nimGCunrefNoCycle(LOC10);
						LOC11 = 0;
						LOC11 = result_362428->data[result_362428->Sup.len-1].Linktitle; result_362428->data[result_362428->Sup.len-1].Linktitle = copyStringRC1(x_362430.Linktitle);
						if (LOC11) nimGCunrefNoCycle(LOC11);
						LOC12 = 0;
						LOC12 = result_362428->data[result_362428->Sup.len-1].Linkdesc; result_362428->data[result_362428->Sup.len-1].Linkdesc = copyStringRC1(x_362430.Linkdesc);
						if (LOC12) nimGCunrefNoCycle(LOC12);
					}
					LA7: ;
					res_362683 += 1;
				} LA4: ;
			}
		}
	}
	genericSeqAssign((&titles), result_362428, (&NTI362804));
	memset((void*)(&LOC13), 0, sizeof(LOC13));
	LOC13.ClPrc = ((TMP4796) (cmp_360298)); LOC13.ClEnv = NIM_NIL;
	sort_361553(titles->data, titles->Sup.len, LOC13, ((NU8) 1));
	chunks = (TY120608*) newSeq((&NTI120608), 0);
	{
		tindexentry360264 title_362655;
		NI i_362688;
		NI l_362690;
		memset((void*)(&title_362655), 0, sizeof(title_362655));
		i_362688 = 0;
		l_362690 = titles->Sup.len;
		{
			while (1) {
				NimStringDesc* LOC17;
				NimStringDesc* LOC18;
				if (!(i_362688 < l_362690)) goto LA16;
				title_362655.Keyword = titles->data[i_362688].Keyword;
				title_362655.Link = titles->data[i_362688].Link;
				title_362655.Linktitle = titles->data[i_362688].Linktitle;
				title_362655.Linkdesc = titles->data[i_362688].Linkdesc;
				LOC17 = 0;
				LOC17 = rawNewString(title_362655.Link->Sup.len + title_362655.Keyword->Sup.len + 15);
appendString(LOC17, ((NimStringDesc*) &TMP4797));
appendString(LOC17, title_362655.Link);
appendString(LOC17, ((NimStringDesc*) &TMP4798));
appendString(LOC17, title_362655.Keyword);
appendString(LOC17, ((NimStringDesc*) &TMP4799));
				chunks = (TY120608*) incrSeq(&(chunks)->Sup, sizeof(NimStringDesc*));
				LOC18 = 0;
				LOC18 = chunks->data[chunks->Sup.len-1]; chunks->data[chunks->Sup.len-1] = copyStringRC1(LOC17);
				if (LOC18) nimGCunrefNoCycle(LOC18);
				i_362688 += 1;
			} LA16: ;
		}
	}
	LOC19 = 0;
	LOC20 = 0;
	LOC20 = nsuJoinSep(chunks->data, chunks->Sup.len, ((NimStringDesc*) &TMP4800));
	LOC19 = rawNewString(LOC20->Sup.len + 5);
appendString(LOC19, LOC20);
appendString(LOC19, ((NimStringDesc*) &TMP4801));
	result_362426 = resizeString(result_362426, LOC19->Sup.len + 0);
appendString(result_362426, LOC19);
	return result_362426;
}

N_NIMCALL(NimStringDesc*, generatemodulejumps_362718)(TY120608* modules) {
	NimStringDesc* result;
	TY120608* chunks;
	NimStringDesc* LOC6;
	NimStringDesc* LOC7;
	result = 0;
	result = copyString(((NimStringDesc*) &TMP4803));
	chunks = (TY120608*) newSeq((&NTI120608), 0);
	{
		NimStringDesc* name_362757;
		NI i_362780;
		NI l_362782;
		name_362757 = 0;
		i_362780 = 0;
		l_362782 = modules->Sup.len;
		{
			while (1) {
				NimStringDesc* LOC4;
				NimStringDesc* LOC5;
				if (!(i_362780 < l_362782)) goto LA3;
				name_362757 = modules->data[i_362780];
				LOC4 = 0;
				LOC4 = rawNewString(name_362757->Sup.len + name_362757->Sup.len + 20);
appendString(LOC4, ((NimStringDesc*) &TMP4797));
appendString(LOC4, name_362757);
appendString(LOC4, ((NimStringDesc*) &TMP4804));
appendString(LOC4, name_362757);
appendString(LOC4, ((NimStringDesc*) &TMP4799));
				chunks = (TY120608*) incrSeq(&(chunks)->Sup, sizeof(NimStringDesc*));
				LOC5 = 0;
				LOC5 = chunks->data[chunks->Sup.len-1]; chunks->data[chunks->Sup.len-1] = copyStringRC1(LOC4);
				if (LOC5) nimGCunrefNoCycle(LOC5);
				i_362780 += 1;
			} LA3: ;
		}
	}
	LOC6 = 0;
	LOC7 = 0;
	LOC7 = nsuJoinSep(chunks->data, chunks->Sup.len, ((NimStringDesc*) &TMP4800));
	LOC6 = rawNewString(LOC7->Sup.len + 5);
appendString(LOC6, LOC7);
appendString(LOC6, ((NimStringDesc*) &TMP4801));
	result = resizeString(result, LOC6->Sup.len + 0);
appendString(result, LOC6);
	return result;
}
N_NIMCALL(void, TMP4808)(void* p, NI op) {
	TY360879* a;
	NI LOC1;
	a = (TY360879*)p;
	LOC1 = 0;
	for (LOC1 = 0; LOC1 < a->Sup.len; LOC1++) {
	nimGCvisit((void*)a->data[LOC1].Field1, op);
	}
}

static N_INLINE(NimStringDesc*, HEX5BHEX5D_85772)(NimStringDesc* s, slice85779 x) {
	NimStringDesc* result;
	NI LOC1;
	NI LOC7;
	result = 0;
	LOC1 = 0;
	{
		if (!(0 <= x.A)) goto LA4;
		LOC1 = x.A;
	}
	goto LA2;
	LA4: ;
	{
		LOC1 = (NI32)(s->Sup.len + x.A);
	}
	LA2: ;
	LOC7 = 0;
	{
		if (!(0 <= x.B)) goto LA10;
		LOC7 = x.B;
	}
	goto LA8;
	LA10: ;
	{
		LOC7 = (NI32)(s->Sup.len + x.B);
	}
	LA8: ;
	result = copyStrLast(s, LOC1, LOC7);
	return result;
}

static N_INLINE(slice85779, HEX2EHEX2E_94498)(NI a_94502, NI b_94504) {
	slice85779 result;
	memset((void*)(&result), 0, sizeof(result));
	result.A = a_94502;
	result.B = b_94504;
	return result;
}

N_NIMCALL(void, striptoclevel_360788)(NimStringDesc* s, TY360880* Result) {
	slice85779 LOC8;
	{
		NI c_360816;
		NI HEX3Atmp_360840;
		NI res_360843;
		c_360816 = 0;
		HEX3Atmp_360840 = 0;
		HEX3Atmp_360840 = (s->Sup.len - 1);
		res_360843 = 0;
		{
			while (1) {
				if (!(res_360843 <= HEX3Atmp_360840)) goto LA3;
				c_360816 = res_360843;
				(*Result).Field0 = c_360816;
				{
					if (!!(((NU8)(s->data[c_360816]) == (NU8)(32)))) goto LA6;
					goto LA1;
				}
				LA6: ;
				res_360843 += 1;
			} LA3: ;
		}
	} LA1: ;
	LOC8 = HEX2EHEX2E_94498((*Result).Field0, (s->Sup.len - 1));
	unsureAsgnRef((void**) (&(*Result).Field1), HEX5BHEX5D_85772(s, LOC8));
}

N_NIMCALL(NimStringDesc*, indenttolevel_360860)(NI* level, NI newlevel) {
	NimStringDesc* result;
	result = 0;
	result = copyString(((NimStringDesc*) &TMP2114));
	{
		if (!((*level) == newlevel)) goto LA3;
		goto BeforeRet;
	}
	LA3: ;
	{
		if (!((*level) < newlevel)) goto LA7;
		result = nsuRepeatStr((NI32)(newlevel - (*level)), ((NimStringDesc*) &TMP4810));
	}
	goto LA5;
	LA7: ;
	{
		result = nsuRepeatStr((NI32)((*level) - newlevel), ((NimStringDesc*) &TMP4811));
	}
	LA5: ;
	(*level) = newlevel;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NimStringDesc*, generatedocumentationtoc_360873)(TY362804* entries) {
	NimStringDesc* result;
	NimStringDesc* titleref;
	TY360879* levels;
	NI l_360884;
	NI level;
	NimStringDesc* LOC23;
	NimStringDesc* LOC24;
	result = 0;
	result = copyString(((NimStringDesc*) &TMP2114));
	titleref = 0;
	levels = 0;
	l_360884 = 0;
	level = 1;
	levels = (TY360879*) newSeq((&NTI360879), entries->Sup.len);
	{
		tindexentry360264 entry_361011;
		NI i_361206;
		NI l_361208;
		memset((void*)(&entry_361011), 0, sizeof(entry_361011));
		i_361206 = 0;
		l_361208 = entries->Sup.len;
		{
			while (1) {
				NimStringDesc* LOC4;
				TY360880 LOC5;
				NI rawlevel;
				NimStringDesc* rawtext;
				if (!(i_361206 < l_361208)) goto LA3;
				entry_361011.Keyword = entries->data[i_361206].Keyword;
				entry_361011.Link = entries->data[i_361206].Link;
				entry_361011.Linktitle = entries->data[i_361206].Linktitle;
				entry_361011.Linkdesc = entries->data[i_361206].Linkdesc;
				LOC4 = 0;
				LOC4 = or_359568(entry_361011.Linktitle, entry_361011.Keyword);
				memset((void*)(&LOC5), 0, sizeof(LOC5));
				striptoclevel_360788(LOC4, (&LOC5));
				rawlevel = 0;
				rawlevel = LOC5.Field0;
				rawtext = 0;
				rawtext = LOC5.Field1;
				{
					NimStringDesc* LOC10;
					if (!(rawlevel < 1)) goto LA8;
					levels->data[l_360884].Field0 = (NI32)(level + 1);
					LOC10 = 0;
					LOC10 = levels->data[l_360884].Field1; levels->data[l_360884].Field1 = copyStringRC1(entry_361011.Keyword);
					if (LOC10) nimGCunrefNoCycle(LOC10);
				}
				goto LA6;
				LA8: ;
				{
					NimStringDesc* LOC12;
					level = rawlevel;
					levels->data[l_360884].Field0 = rawlevel;
					LOC12 = 0;
					LOC12 = levels->data[l_360884].Field1; levels->data[l_360884].Field1 = copyStringRC1(rawtext);
					if (LOC12) nimGCunrefNoCycle(LOC12);
				}
				LA6: ;
				l_360884 += 1;
				i_361206 += 1;
			} LA3: ;
		}
	}
	result = copyString(((NimStringDesc*) &TMP4809));
	level = 1;
	l_360884 = 0;
	{
		while (1) {
			NimStringDesc* link;
			if (!(l_360884 < entries->Sup.len)) goto LA14;
			link = entries->data[l_360884].Link;
			{
				NIM_BOOL LOC17;
				LOC17 = 0;
				LOC17 = isdocumentationtitle_360777(link);
				if (!LOC17) goto LA18;
				titleref = copyString(link);
			}
			goto LA15;
			LA18: ;
			{
				NimStringDesc* LOC21;
				NimStringDesc* LOC22;
				LOC21 = 0;
				LOC21 = indenttolevel_360860((&level), levels->data[l_360884].Field0);
				result = resizeString(result, LOC21->Sup.len + 0);
appendString(result, LOC21);
				LOC22 = 0;
				LOC22 = rawNewString(link->Sup.len + levels->data[l_360884].Field1->Sup.len + 21);
appendString(LOC22, ((NimStringDesc*) &TMP4812));
appendString(LOC22, link);
appendString(LOC22, ((NimStringDesc*) &TMP4798));
appendString(LOC22, levels->data[l_360884].Field1);
appendString(LOC22, ((NimStringDesc*) &TMP4813));
				result = resizeString(result, LOC22->Sup.len + 0);
appendString(result, LOC22);
			}
			LA15: ;
			l_360884 += 1;
		} LA14: ;
	}
	LOC23 = 0;
	LOC24 = 0;
	LOC24 = indenttolevel_360860((&level), 1);
	LOC23 = rawNewString(LOC24->Sup.len + 7);
appendString(LOC23, LOC24);
appendString(LOC23, ((NimStringDesc*) &TMP4814));
	result = resizeString(result, LOC23->Sup.len + 0);
appendString(result, LOC23);
	return result;
}

N_NIMCALL(NimStringDesc*, generatedocumentationindex_361231)(table360277 docs) {
	NimStringDesc* result_361234;
	TY362804* titles;
	TY362804* result_361236;
	TY361572 LOC13;
	result_361234 = 0;
	result_361234 = copyString(((NimStringDesc*) &TMP2114));
	result_361236 = (TY362804*) newSeq((&NTI362804), 0);
	{
		tindexentry360264 x_361238;
		memset((void*)(&x_361238), 0, sizeof(x_361238));
		{
			NI h_362385;
			NI HEX3Atmp_362387;
			NI res_362389;
			h_362385 = 0;
			HEX3Atmp_362387 = 0;
			HEX3Atmp_362387 = (docs.Data->Sup.len-1);
			res_362389 = 0;
			{
				while (1) {
					if (!(res_362389 <= HEX3Atmp_362387)) goto LA4;
					h_362385 = res_362389;
					{
						NimStringDesc* LOC9;
						NimStringDesc* LOC10;
						NimStringDesc* LOC11;
						NimStringDesc* LOC12;
						if (!(docs.Data->data[h_362385].Field0 == ((NU8) 1))) goto LA7;
						x_361238.Keyword = docs.Data->data[h_362385].Field1.Keyword;
						x_361238.Link = docs.Data->data[h_362385].Field1.Link;
						x_361238.Linktitle = docs.Data->data[h_362385].Field1.Linktitle;
						x_361238.Linkdesc = docs.Data->data[h_362385].Field1.Linkdesc;
						result_361236 = (TY362804*) incrSeq(&(result_361236)->Sup, sizeof(tindexentry360264));
						LOC9 = 0;
						LOC9 = result_361236->data[result_361236->Sup.len-1].Keyword; result_361236->data[result_361236->Sup.len-1].Keyword = copyStringRC1(x_361238.Keyword);
						if (LOC9) nimGCunrefNoCycle(LOC9);
						LOC10 = 0;
						LOC10 = result_361236->data[result_361236->Sup.len-1].Link; result_361236->data[result_361236->Sup.len-1].Link = copyStringRC1(x_361238.Link);
						if (LOC10) nimGCunrefNoCycle(LOC10);
						LOC11 = 0;
						LOC11 = result_361236->data[result_361236->Sup.len-1].Linktitle; result_361236->data[result_361236->Sup.len-1].Linktitle = copyStringRC1(x_361238.Linktitle);
						if (LOC11) nimGCunrefNoCycle(LOC11);
						LOC12 = 0;
						LOC12 = result_361236->data[result_361236->Sup.len-1].Linkdesc; result_361236->data[result_361236->Sup.len-1].Linkdesc = copyStringRC1(x_361238.Linkdesc);
						if (LOC12) nimGCunrefNoCycle(LOC12);
					}
					LA7: ;
					res_362389 += 1;
				} LA4: ;
			}
		}
	}
	genericSeqAssign((&titles), result_361236, (&NTI362804));
	memset((void*)(&LOC13), 0, sizeof(LOC13));
	LOC13.ClPrc = ((TMP4806) (cmp_360298)); LOC13.ClEnv = NIM_NIL;
	sort_361553(titles->data, titles->Sup.len, LOC13, ((NU8) 1));
	{
		tindexentry360264 title_362295;
		NI i_362393;
		NI l_362395;
		memset((void*)(&title_362295), 0, sizeof(title_362295));
		i_362393 = 0;
		l_362395 = titles->Sup.len;
		{
			while (1) {
				NimStringDesc* toclist;
				TY362804* LOC17;
				NimStringDesc* LOC18;
				if (!(i_362393 < l_362395)) goto LA16;
				title_362295.Keyword = titles->data[i_362393].Keyword;
				title_362295.Link = titles->data[i_362393].Link;
				title_362295.Linktitle = titles->data[i_362393].Linktitle;
				title_362295.Linkdesc = titles->data[i_362393].Linkdesc;
				LOC17 = 0;
				LOC17 = HEX5BHEX5D_362298(docs, title_362295);
				toclist = generatedocumentationtoc_360873(LOC17);
				LOC18 = 0;
				LOC18 = rawNewString(title_362295.Link->Sup.len + title_362295.Keyword->Sup.len + toclist->Sup.len + 32);
appendString(LOC18, ((NimStringDesc*) &TMP4815));
appendString(LOC18, title_362295.Link);
appendString(LOC18, ((NimStringDesc*) &TMP4798));
appendString(LOC18, title_362295.Keyword);
appendString(LOC18, ((NimStringDesc*) &TMP4813));
appendString(LOC18, toclist);
appendString(LOC18, ((NimStringDesc*) &TMP4814));
				result_361234 = resizeString(result_361234, LOC18->Sup.len + 0);
appendString(result_361234, LOC18);
				i_362393 += 1;
			} LA16: ;
		}
	}
	return result_361234;
}

N_NIMCALL(void, sortindex_360618)(tindexentry360264* a, NI aLen0) {
	NI n;
	NI h;
	n = aLen0;
	h = 1;
	{
		while (1) {
			h = (NI32)((NI32)(3 * h) + 1);
			{
				if (!(n < h)) goto LA5;
				goto LA1;
			}
			LA5: ;
		}
	} LA1: ;
	{
		while (1) {
			h = (NI32)(h / 3);
			{
				NI i_360645;
				NI HEX3Atmp_360657;
				NI res_360660;
				i_360645 = 0;
				HEX3Atmp_360657 = 0;
				HEX3Atmp_360657 = (NI32)(n - 1);
				res_360660 = h;
				{
					while (1) {
						tindexentry360264 v;
						NI j;
						if (!(res_360660 <= HEX3Atmp_360657)) goto LA11;
						i_360645 = res_360660;
						memset((void*)(&v), 0, sizeof(v));
						HEX3CHEX2D_360607((&v), a[i_360645]);
						j = i_360645;
						{
							while (1) {
								NI LOC14;
								LOC14 = 0;
								LOC14 = cmp_360298(a[(NI32)(j - h)], v);
								if (!(0 <= LOC14)) goto LA13;
								HEX3CHEX2D_360607((&a[j]), a[(NI32)(j - h)]);
								j = (NI32)(j - h);
								{
									if (!(j < h)) goto LA17;
									goto LA12;
								}
								LA17: ;
							} LA13: ;
						} LA12: ;
						HEX3CHEX2D_360607((&a[j]), v);
						res_360660 += 1;
					} LA11: ;
				}
			}
			{
				if (!(h == 1)) goto LA21;
				goto LA7;
			}
			LA21: ;
		}
	} LA7: ;
}

N_NIMCALL(NimStringDesc*, generatesymbolindex_360695)(TY362804* symbols) {
	NimStringDesc* result;
	NI i;
	result = 0;
	result = copyString(((NimStringDesc*) &TMP2114));
	i = 0;
	{
		while (1) {
			TY198301 LOC3;
			NI j;
			if (!(i < symbols->Sup.len)) goto LA2;
			memset((void*)LOC3, 0, sizeof(LOC3));
			LOC3[0] = copyString(symbols->data[i].Keyword);
			nsuAddf((&result), ((NimStringDesc*) &TMP4817), LOC3, 1);
			j = i;
			{
				while (1) {
					NIM_BOOL LOC6;
					NimStringDesc* url;
					NimStringDesc* text;
					NimStringDesc* desc;
					LOC6 = 0;
					LOC6 = (j < symbols->Sup.len);
					if (!(LOC6)) goto LA7;
					LOC6 = eqStrings(symbols->data[i].Keyword, symbols->data[j].Keyword);
					LA7: ;
					if (!LOC6) goto LA5;
					url = symbols->data[j].Link;
					{
						if (!!(symbols->data[j].Linktitle == 0)) goto LA10;
						text = symbols->data[j].Linktitle;
					}
					goto LA8;
					LA10: ;
					{
						text = url;
					}
					LA8: ;
					{
						if (!!(symbols->data[j].Linkdesc == 0)) goto LA15;
						desc = symbols->data[j].Linkdesc;
					}
					goto LA13;
					LA15: ;
					{
						desc = copyString(((NimStringDesc*) &TMP2114));
					}
					LA13: ;
					{
						TY209063 LOC22;
						if (!(0 < desc->Sup.len)) goto LA20;
						memset((void*)LOC22, 0, sizeof(LOC22));
						LOC22[0] = copyString(url);
						LOC22[1] = copyString(text);
						LOC22[2] = copyString(desc);
						nsuAddf((&result), ((NimStringDesc*) &TMP4818), LOC22, 3);
					}
					goto LA18;
					LA20: ;
					{
						TY170951 LOC24;
						memset((void*)LOC24, 0, sizeof(LOC24));
						LOC24[0] = copyString(url);
						LOC24[1] = copyString(text);
						nsuAddf((&result), ((NimStringDesc*) &TMP4819), LOC24, 2);
					}
					LA18: ;
					j += 1;
				} LA5: ;
			}
			result = resizeString(result, 12);
appendString(result, ((NimStringDesc*) &TMP4820));
			i = j;
		} LA2: ;
	}
	return result;
}

N_NIMCALL(NimStringDesc*, mergeindexes_365146)(NimStringDesc* dir) {
	NimStringDesc* result;
	TY362801 LOC1;
	TY120608* modules;
	TY362804* symbols;
	table360277 docs;
	result = 0;
	memset((void*)(&LOC1), 0, sizeof(LOC1));
	readindexdir_362798(dir, (&LOC1));
	modules = 0;
	genericSeqAssign((&modules), LOC1.Field0, (&NTI120608));
	symbols = 0;
	genericSeqAssign((&symbols), LOC1.Field1, (&NTI362804));
	memset((void*)(&docs), 0, sizeof(docs));
	genericSeqAssign((&docs.Data), LOC1.Field2.Data, (&NTI360280));
	docs.Counter = LOC1.Field2.Counter;
	result = copyString(((NimStringDesc*) &TMP2114));
	{
		NI LOC4;
		NimStringDesc* LOC7;
		LOC4 = 0;
		LOC4 = len_363285(docs);
		if (!(0 < LOC4)) goto LA5;
		LOC7 = 0;
		LOC7 = generatedocumentationjumps_362423(docs);
		result = resizeString(result, LOC7->Sup.len + 0);
appendString(result, LOC7);
		result = resizeString(result, 5);
appendString(result, ((NimStringDesc*) &TMP4802));
	}
	LA5: ;
	{
		NimStringDesc* LOC12;
		if (!(0 < modules->Sup.len)) goto LA10;
		LOC12 = 0;
		LOC12 = generatemodulejumps_362718(modules);
		result = resizeString(result, LOC12->Sup.len + 0);
appendString(result, LOC12);
		result = resizeString(result, 5);
appendString(result, ((NimStringDesc*) &TMP4802));
	}
	LA10: ;
	{
		NI LOC15;
		NimStringDesc* LOC18;
		LOC15 = 0;
		LOC15 = len_363285(docs);
		if (!(0 < LOC15)) goto LA16;
		result = resizeString(result, 30);
appendString(result, ((NimStringDesc*) &TMP4805));
		LOC18 = 0;
		LOC18 = generatedocumentationindex_361231(docs);
		result = resizeString(result, LOC18->Sup.len + 0);
appendString(result, LOC18);
	}
	LA16: ;
	{
		NimStringDesc* LOC23;
		if (!(0 < symbols->Sup.len)) goto LA21;
		sortindex_360618(symbols->data, symbols->Sup.len);
		result = resizeString(result, 22);
appendString(result, ((NimStringDesc*) &TMP4816));
		LOC23 = 0;
		LOC23 = generatesymbolindex_360695(symbols);
		result = resizeString(result, LOC23->Sup.len + 0);
appendString(result, LOC23);
	}
	LA21: ;
	return result;
}
NIM_EXTERNC N_NOINLINE(void, docutils_rstgenInit)(void) {
	NimStringDesc* LOC1;
	LOC1 = 0;
	LOC1 = splitter_359332; splitter_359332 = copyStringRC1(((NimStringDesc*) &TMP907));
	if (LOC1) nimGCunrefNoCycle(LOC1);
}

NIM_EXTERNC N_NOINLINE(void, docutils_rstgenDatInit)(void) {
static TNimNode* TMP4622[13];
static TNimNode* TMP4623[2];
NI TMP4625;
static char* NIM_CONST TMP4624[2] = {
"outHtml", 
"outLatex"};
static TNimNode* TMP4626[3];
static TNimNode* TMP4784[4];
static TNimNode* TMP4807[2];
static TNimNode TMP899[29];
NTI359016.size = sizeof(trstgenerator359016);
NTI359016.kind = 17;
NTI359016.base = (&NTI3211);
TMP4622[0] = &TMP899[1];
NTI359010.size = sizeof(NU8);
NTI359010.kind = 14;
NTI359010.base = 0;
NTI359010.flags = 3;
for (TMP4625 = 0; TMP4625 < 2; TMP4625++) {
TMP899[TMP4625+2].kind = 1;
TMP899[TMP4625+2].offset = TMP4625;
TMP899[TMP4625+2].name = TMP4624[TMP4625];
TMP4623[TMP4625] = &TMP899[TMP4625+2];
}
TMP899[4].len = 2; TMP899[4].kind = 2; TMP899[4].sons = &TMP4623[0];
NTI359010.node = &TMP899[4];
TMP899[1].kind = 1;
TMP899[1].offset = offsetof(trstgenerator359016, Target);
TMP899[1].typ = (&NTI359010);
TMP899[1].name = "target";
TMP4622[1] = &TMP899[5];
TMP899[5].kind = 1;
TMP899[5].offset = offsetof(trstgenerator359016, Config);
TMP899[5].typ = (&NTI133014);
TMP899[5].name = "config";
TMP4622[2] = &TMP899[6];
TMP899[6].kind = 1;
TMP899[6].offset = offsetof(trstgenerator359016, Splitafter);
TMP899[6].typ = (&NTI108);
TMP899[6].name = "splitAfter";
TMP4622[3] = &TMP899[7];
NTI359012.size = sizeof(ttocentry359012);
NTI359012.kind = 18;
NTI359012.base = 0;
NTI359012.flags = 2;
TMP4626[0] = &TMP899[9];
TMP899[9].kind = 1;
TMP899[9].offset = offsetof(ttocentry359012, N);
TMP899[9].typ = (&NTI343007);
TMP899[9].name = "n";
TMP4626[1] = &TMP899[10];
TMP899[10].kind = 1;
TMP899[10].offset = offsetof(ttocentry359012, Refname);
TMP899[10].typ = (&NTI149);
TMP899[10].name = "refname";
TMP4626[2] = &TMP899[11];
TMP899[11].kind = 1;
TMP899[11].offset = offsetof(ttocentry359012, Header);
TMP899[11].typ = (&NTI149);
TMP899[11].name = "header";
TMP899[8].len = 3; TMP899[8].kind = 2; TMP899[8].sons = &TMP4626[0];
NTI359012.node = &TMP899[8];
NTI359034.size = sizeof(TY359034*);
NTI359034.kind = 24;
NTI359034.base = (&NTI359012);
NTI359034.flags = 2;
NTI359034.marker = TMP4627;
TMP899[7].kind = 1;
TMP899[7].offset = offsetof(trstgenerator359016, Tocpart);
TMP899[7].typ = (&NTI359034);
TMP899[7].name = "tocPart";
TMP4622[4] = &TMP899[12];
TMP899[12].kind = 1;
TMP899[12].offset = offsetof(trstgenerator359016, Hastoc);
TMP899[12].typ = (&NTI138);
TMP899[12].name = "hasToc";
TMP4622[5] = &TMP899[13];
TMP899[13].kind = 1;
TMP899[13].offset = offsetof(trstgenerator359016, Theindex);
TMP899[13].typ = (&NTI149);
TMP899[13].name = "theIndex";
TMP4622[6] = &TMP899[14];
TMP899[14].kind = 1;
TMP899[14].offset = offsetof(trstgenerator359016, Options);
TMP899[14].typ = (&NTI344015);
TMP899[14].name = "options";
TMP4622[7] = &TMP899[15];
TMP899[15].kind = 1;
TMP899[15].offset = offsetof(trstgenerator359016, Findfile);
TMP899[15].typ = (&NTI344023);
TMP899[15].name = "findFile";
TMP4622[8] = &TMP899[16];
TMP899[16].kind = 1;
TMP899[16].offset = offsetof(trstgenerator359016, Msghandler);
TMP899[16].typ = (&NTI344021);
TMP899[16].name = "msgHandler";
TMP4622[9] = &TMP899[17];
TMP899[17].kind = 1;
TMP899[17].offset = offsetof(trstgenerator359016, Filename);
TMP899[17].typ = (&NTI149);
TMP899[17].name = "filename";
TMP4622[10] = &TMP899[18];
NTI359042.size = sizeof(TY359042);
NTI359042.kind = 16;
NTI359042.base = (&NTI149);
NTI359042.flags = 2;
TMP899[18].kind = 1;
TMP899[18].offset = offsetof(trstgenerator359016, Meta);
TMP899[18].typ = (&NTI359042);
TMP899[18].name = "meta";
TMP4622[11] = &TMP899[19];
TMP899[19].kind = 1;
TMP899[19].offset = offsetof(trstgenerator359016, Currentsection);
TMP899[19].typ = (&NTI149);
TMP899[19].name = "currentSection";
TMP4622[12] = &TMP899[20];
TMP899[20].kind = 1;
TMP899[20].offset = offsetof(trstgenerator359016, Seenindexterms);
TMP899[20].typ = (&NTI359052);
TMP899[20].name = "seenIndexTerms";
TMP899[0].len = 13; TMP899[0].kind = 2; TMP899[0].sons = &TMP4622[0];
NTI359016.node = &TMP899[0];
NTI360264.size = sizeof(tindexentry360264);
NTI360264.kind = 18;
NTI360264.base = 0;
NTI360264.flags = 2;
TMP4784[0] = &TMP899[22];
TMP899[22].kind = 1;
TMP899[22].offset = offsetof(tindexentry360264, Keyword);
TMP899[22].typ = (&NTI149);
TMP899[22].name = "keyword";
TMP4784[1] = &TMP899[23];
TMP899[23].kind = 1;
TMP899[23].offset = offsetof(tindexentry360264, Link);
TMP899[23].typ = (&NTI149);
TMP899[23].name = "link";
TMP4784[2] = &TMP899[24];
TMP899[24].kind = 1;
TMP899[24].offset = offsetof(tindexentry360264, Linktitle);
TMP899[24].typ = (&NTI149);
TMP899[24].name = "linkTitle";
TMP4784[3] = &TMP899[25];
TMP899[25].kind = 1;
TMP899[25].offset = offsetof(tindexentry360264, Linkdesc);
TMP899[25].typ = (&NTI149);
TMP899[25].name = "linkDesc";
TMP899[21].len = 4; TMP899[21].kind = 2; TMP899[21].sons = &TMP4784[0];
NTI360264.node = &TMP899[21];
NTI362804.size = sizeof(TY362804*);
NTI362804.kind = 24;
NTI362804.base = (&NTI360264);
NTI362804.flags = 2;
NTI362804.marker = TMP4785;
NTI360880.size = sizeof(TY360880);
NTI360880.kind = 18;
NTI360880.base = 0;
NTI360880.flags = 2;
TMP4807[0] = &TMP899[27];
TMP899[27].kind = 1;
TMP899[27].offset = offsetof(TY360880, Field0);
TMP899[27].typ = (&NTI108);
TMP899[27].name = "Field0";
TMP4807[1] = &TMP899[28];
TMP899[28].kind = 1;
TMP899[28].offset = offsetof(TY360880, Field1);
TMP899[28].typ = (&NTI149);
TMP899[28].name = "Field1";
TMP899[26].len = 2; TMP899[26].kind = 2; TMP899[26].sons = &TMP4807[0];
NTI360880.node = &TMP899[26];
NTI360879.size = sizeof(TY360879*);
NTI360879.kind = 24;
NTI360879.base = (&NTI360880);
NTI360879.flags = 2;
NTI360879.marker = TMP4808;
}

