text: /* Generated by Nim Compiler v0.15.0 */
  /*   (c) 2016 Andreas Rumpf */
  /* The generated code is subject to the original license. */
  #define NIM_INTBITS 32
  
  #include "nimbase.h"
  #include <setjmp.h>
  typedef struct Tpasscontext339002 Tpasscontext339002;
  typedef struct Tsym290834 Tsym290834;
  typedef struct Tgen574003 Tgen574003;
  typedef struct TNimObject TNimObject;
  typedef struct TNimType TNimType;
  typedef struct TNimNode TNimNode;
  typedef struct Tdocumentor413004 Tdocumentor413004;
  typedef struct Cell46904 Cell46904;
  typedef struct Cellseq46920 Cellseq46920;
  typedef struct Gcheap49418 Gcheap49418;
  typedef struct Gcstack49416 Gcstack49416;
  typedef struct Memregion29085 Memregion29085;
  typedef struct Smallchunk29039 Smallchunk29039;
  typedef struct Llchunk29079 Llchunk29079;
  typedef struct Bigchunk29041 Bigchunk29041;
  typedef struct Intset29014 Intset29014;
  typedef struct Trunk29010 Trunk29010;
  typedef struct Avlnode29083 Avlnode29083;
  typedef struct Gcstat49414 Gcstat49414;
  typedef struct Cellset46916 Cellset46916;
  typedef struct Pagedesc46912 Pagedesc46912;
  typedef struct NimStringDesc NimStringDesc;
  typedef struct TGenericSeq TGenericSeq;
  typedef struct Stringtableobj152608 Stringtableobj152608;
  typedef struct Tidobj197004 Tidobj197004;
  typedef struct Ttypeseq290836 Ttypeseq290836;
  typedef struct TY290929 TY290929;
  typedef struct Tstrtable290806 Tstrtable290806;
  typedef struct Tsymseq290804 Tsymseq290804;
  typedef struct Ttype290840 Ttype290840;
  typedef struct Tident197010 Tident197010;
  typedef struct Tlineinfo189336 Tlineinfo189336;
  typedef struct Tnode290802 Tnode290802;
  typedef struct Tloc290816 Tloc290816;
  typedef struct Ropeobj177006 Ropeobj177006;
  typedef struct Tlib290820 Tlib290820;
  typedef struct Rstgenerator381010 Rstgenerator381010;
  typedef struct TY381029 TY381029;
  typedef struct Table381047 Table381047;
  typedef struct Keyvaluepairseq381050 Keyvaluepairseq381050;
  typedef struct Jsonnodeobj259833 Jsonnodeobj259833;
  typedef struct Exception Exception;
  typedef struct TSafePoint TSafePoint;
  typedef struct Basechunk29037 Basechunk29037;
  typedef struct Freecell29029 Freecell29029;
  typedef struct Keyvaluepairseq152606 Keyvaluepairseq152606;
  typedef struct Tinstantiation290824 Tinstantiation290824;
  typedef struct TY290960 TY290960;
  typedef struct Tnodeseq290796 Tnodeseq290796;
  typedef struct Tlistentry147007 Tlistentry147007;
  typedef struct Tocentry381006 Tocentry381006;
  typedef struct Rstnode365011 Rstnode365011;
  typedef struct Keyvaluepair381053 Keyvaluepair381053;
  typedef struct Orderedtable259853 Orderedtable259853;
  typedef struct Orderedkeyvaluepairseq259856 Orderedkeyvaluepairseq259856;
  typedef struct TY259878 TY259878;
  typedef struct Keyvaluepair152604 Keyvaluepair152604;
  typedef struct TY290961 TY290961;
  typedef struct Rstnodeseq365009 Rstnodeseq365009;
  typedef struct Orderedkeyvaluepair259859 Orderedkeyvaluepair259859;
  typedef NU8 Tnimkind3403;
  typedef NU8 Tnimtypeflag3409Set;
  typedef N_NIMCALL_PTR(void, TY3489) (void* p0, NI op0);
  typedef N_NIMCALL_PTR(void*, TY3494) (void* p0);
  struct  TNimType  {
  NI size;
  Tnimkind3403 kind;
  Tnimtypeflag3409Set flags;
  TNimType* base;
  TNimNode* node;
  void* finalizer;
  TY3489 marker;
  TY3494 deepcopy;
  };
  struct  TNimObject  {
  TNimType* m_type;
  };
  struct  Tpasscontext339002  {
    TNimObject Sup;
  NIM_BOOL fromcache;
  };
  struct  Tgen574003  {
    Tpasscontext339002 Sup;
  Tdocumentor413004* doc;
  Tsym290834* module;
  };
  typedef NU8 Tnimnodekind3405;
  struct  TNimNode  {
  Tnimnodekind3405 kind;
  NI offset;
  TNimType* typ;
  NCSTRING name;
  NI len;
  TNimNode** sons;
  };
  struct  Cell46904  {
  NI refcount;
  TNimType* typ;
  };
  struct  Cellseq46920  {
  NI len;
  NI cap;
  Cell46904** d;
  };
  typedef Smallchunk29039* TY29100[512];
  typedef Trunk29010* Trunkbuckets29012[256];
  struct  Intset29014  {
  Trunkbuckets29012 data;
  };
  struct  Memregion29085  {
  NI minlargeobj;
  NI maxlargeobj;
  TY29100 freesmallchunks;
  Llchunk29079* llmem;
  NI currmem;
  NI maxmem;
  NI freemem;
  NI lastsize;
  Bigchunk29041* freechunkslist;
  Intset29014 chunkstarts;
  Avlnode29083* root;
  Avlnode29083* deleted;
  Avlnode29083* last;
  Avlnode29083* freeavlnodes;
  NIM_BOOL locked;
  };
  struct  Gcstat49414  {
  NI stackscans;
  NI cyclecollections;
  NI maxthreshold;
  NI maxstacksize;
  NI maxstackcells;
  NI cycletablesize;
  NI64 maxpause;
  };
  struct  Cellset46916  {
  NI counter;
  NI max;
  Pagedesc46912* head;
  Pagedesc46912** data;
  };
  struct  Gcheap49418  {
  Gcstack49416* stack;
  void* stackbottom;
  NI cyclethreshold;
  Cellseq46920 zct;
  Cellseq46920 decstack;
  Cellseq46920 tempstack;
  NI recgclock;
  Memregion29085 region;
  Gcstat49414 stat;
  Cellset46916 marked;
  Cellseq46920 additionalroots;
  };
  struct  TGenericSeq  {
  NI len;
  NI reserved;
  };
  struct  NimStringDesc  {
    TGenericSeq Sup;
  NIM_CHAR data[SEQ_DECL_SIZE];
  };
  struct  Tidobj197004  {
    TNimObject Sup;
  NI id;
  };
  typedef NU8 Tsymkind290435;
  struct  Tstrtable290806  {
  NI counter;
  Tsymseq290804* data;
  };
  typedef NU16 Tmagic290524;
  struct  Tlineinfo189336  {
  NI16 line;
  NI16 col;
  NI32 fileindex;
  };
  typedef NU32 Tsymflag290184Set;
  typedef NU32 Toption168009Set;
  typedef NU8 Tlockind290808;
  typedef NU8 Tstorageloc290812;
  typedef NU16 Tlocflag290810Set;
  struct  Tloc290816  {
  Tlockind290808 k;
  Tstorageloc290812 s;
  Tlocflag290810Set flags;
  Ttype290840* t;
  Ropeobj177006* r;
  };
  struct  Tsym290834  {
    Tidobj197004 Sup;
  Tsymkind290435 kind;
  union{
  struct {Ttypeseq290836* typeinstcache;
  } S1;
  struct {TY290929* procinstcache;
  Tsym290834* gcunsafetyreason;
  } S2;
  struct {TY290929* usedgenerics;
  Tstrtable290806 tab;
  } S3;
  struct {Tsym290834* guard;
  NI bitsize;
  } S4;
  } kindU;
  Tmagic290524 magic;
  Ttype290840* typ;
  Tident197010* name;
  Tlineinfo189336 info;
  Tsym290834* owner;
  Tsymflag290184Set flags;
  Tnode290802* ast;
  Toption168009Set options;
  NI position;
  NI offset;
  Tloc290816 loc;
  Tlib290820* annex;
  Tnode290802* constraint;
  };
  typedef NU8 Outputtarget381004;
  typedef NU8 Rstparseoption366003Set;
  typedef N_NIMCALL_PTR(NimStringDesc*, Findfilehandler366013) (NimStringDesc* filename0);
  typedef NU8 Msgkind366009;
  typedef N_NIMCALL_PTR(void, Msghandler366011) (NimStringDesc* filename0, NI line0, NI col0, Msgkind366009 msgkind0, NimStringDesc* arg0);
  typedef NimStringDesc* TY381039[5];
  struct  Table381047  {
  Keyvaluepairseq381050* data;
  NI counter;
  };
  struct  Rstgenerator381010  {
    TNimObject Sup;
  Outputtarget381004 target;
  Stringtableobj152608* config;
  NI splitafter;
  NI listingcounter;
  TY381029* tocpart;
  NIM_BOOL hastoc;
  NimStringDesc* theindex;
  Rstparseoption366003Set options;
  Findfilehandler366013 findfile;
  Msghandler366011 msghandler;
  NimStringDesc* filename;
  TY381039 meta;
  NimStringDesc* currentsection;
  Table381047 seenindexterms;
  };
  typedef Ropeobj177006* Tsections413002[25];
  struct  Tdocumentor413004  {
    Rstgenerator381010 Sup;
  Ropeobj177006* moddesc;
  NI id;
  Tsections413002 toc;
  Tsections413002 section;
  NimStringDesc* indexvalfilename;
  NimStringDesc* analytics;
  Stringtableobj152608* seensymbols;
  Jsonnodeobj259833* jarray;
  Tstrtable290806 types;
  NIM_BOOL ispurerst;
  };
  typedef NU8 Tsymflag290184;
  struct  Exception  {
    TNimObject Sup;
  Exception* parent;
  NCSTRING name;
  NimStringDesc* message;
  NimStringDesc* trace;
  };
  typedef struct {
  N_NIMCALL_PTR(NIM_BOOL, ClPrc) (Exception* e0, void* ClEnv);
  void* ClEnv;
  } TY17211;
  struct  TSafePoint  {
  TSafePoint* prev;
  NI status;
  jmp_buf context;
  NIM_BOOL hasRaiseAction;
  TY17211 raiseAction;
  };
  struct  Gcstack49416  {
  Gcstack49416* prev;
  Gcstack49416* next;
  void* starts;
  void* pos;
  NI maxstacksize;
  };
  struct  Basechunk29037  {
  NI prevsize;
  NI size;
  NIM_BOOL used;
  };
  struct  Smallchunk29039  {
    Basechunk29037 Sup;
  Smallchunk29039* next;
  Smallchunk29039* prev;
  Freecell29029* freelist;
  NI free;
  NI acc;
  NF data;
  };
  struct  Llchunk29079  {
  NI size;
  NI acc;
  Llchunk29079* next;
  };
  struct  Bigchunk29041  {
    Basechunk29037 Sup;
  Bigchunk29041* next;
  Bigchunk29041* prev;
  NI align;
  NF data;
  };
  typedef NI TY29018[16];
  struct  Trunk29010  {
  Trunk29010* next;
  NI key;
  TY29018 bits;
  };
  typedef Avlnode29083* TY29090[2];
  struct  Avlnode29083  {
  TY29090 link;
  NI key;
  NI upperbound;
  NI level;
  };
  struct  Pagedesc46912  {
  Pagedesc46912* next;
  NI key;
  TY29018 bits;
  };
  typedef NU8 Stringtablemode152602;
  struct  Stringtableobj152608  {
    TNimObject Sup;
  NI counter;
  Keyvaluepairseq152606* data;
  Stringtablemode152602 mode;
  };
  typedef NU8 Ttypekind290244;
  typedef NU8 Tcallingconvention290002;
  typedef NU32 Ttypeflag290431Set;
  struct  Ttype290840  {
    Tidobj197004 Sup;
  Ttypekind290244 kind;
  Tcallingconvention290002 callconv;
  Ttypeflag290431Set flags;
  Ttypeseq290836* sons;
  Tnode290802* n;
  Tsym290834* owner;
  Tsym290834* sym;
  Tsym290834* destructor;
  Tsym290834* deepcopy;
  Tsym290834* assignment;
  TY290960* methods;
  NI64 size;
  NI16 align;
  NI16 locklevel;
  Tloc290816 loc;
  };
  struct  Tident197010  {
    Tidobj197004 Sup;
  NimStringDesc* s;
  Tident197010* next;
  NI h;
  };
  typedef NU16 Tnodeflag290427Set;
  typedef NU8 Tnodekind290020;
  struct  Tnode290802  {
  Ttype290840* typ;
  Tlineinfo189336 info;
  Tnodeflag290427Set flags;
  Tnodekind290020 kind;
  union{
  struct {NI64 intval;
  } S1;
  struct {NF floatval;
  } S2;
  struct {NimStringDesc* strval;
  } S3;
  struct {Tsym290834* sym;
  } S4;
  struct {Tident197010* ident;
  } S5;
  struct {Tnodeseq290796* sons;
  } S6;
  } kindU;
  NimStringDesc* comment;
  };
  struct  Ropeobj177006  {
    TNimObject Sup;
  Ropeobj177006* left;
  Ropeobj177006* right;
  NI length;
  NimStringDesc* data;
  };
  struct  Tlistentry147007  {
    TNimObject Sup;
  Tlistentry147007* prev;
  Tlistentry147007* next;
  };
  typedef NU8 Tlibkind290818;
  struct  Tlib290820  {
    Tlistentry147007 Sup;
  Tlibkind290818 kind;
  NIM_BOOL generated;
  NIM_BOOL isoverriden;
  Ropeobj177006* name;
  Tnode290802* path;
  };
  struct  Tocentry381006  {
  Rstnode365011* n;
  NimStringDesc* refname;
  NimStringDesc* header;
  };
  struct Keyvaluepair381053 {
  NI Field0;
  NimStringDesc* Field1;
  NI Field2;
  };
  typedef NU8 Jsonnodekind259829;
  struct  Orderedtable259853  {
  Orderedkeyvaluepairseq259856* data;
  NI counter;
  NI first;
  NI last;
  };
  struct  Jsonnodeobj259833  {
  Jsonnodekind259829 kind;
  union{
  struct {NimStringDesc* str;
  } S1;
  struct {NI64 num;
  } S2;
  struct {NF fnum;
  } S3;
  struct {NIM_BOOL bval;
  } S4;
  struct {Orderedtable259853 fields;
  } S6;
  struct {TY259878* elems;
  } S7;
  } kindU;
  };
  struct  Freecell29029  {
  Freecell29029* next;
  NI zerofield;
  };
  struct Keyvaluepair152604 {
  NimStringDesc* Field0;
  NimStringDesc* Field1;
  };
  struct  Tinstantiation290824  {
  Tsym290834* sym;
  Ttypeseq290836* concretetypes;
  NI compilesid;
  };
  struct TY290961 {
  NI Field0;
  Tsym290834* Field1;
  };
  typedef NU8 Rstnodekind365005;
  struct  Rstnode365011  {
  Rstnodekind365005 kind;
  NimStringDesc* text;
  NI level;
  Rstnodeseq365009* sons;
  };
  struct Orderedkeyvaluepair259859 {
  NI Field0;
  NI Field1;
  NimStringDesc* Field2;
  Jsonnodeobj259833* Field3;
  };
  struct Ttypeseq290836 {
    TGenericSeq Sup;
    Ttype290840* data[SEQ_DECL_SIZE];
  };
  struct TY290929 {
    TGenericSeq Sup;
    Tinstantiation290824* data[SEQ_DECL_SIZE];
  };
  struct Tsymseq290804 {
    TGenericSeq Sup;
    Tsym290834* data[SEQ_DECL_SIZE];
  };
  struct TY381029 {
    TGenericSeq Sup;
    Tocentry381006 data[SEQ_DECL_SIZE];
  };
  struct Keyvaluepairseq381050 {
    TGenericSeq Sup;
    Keyvaluepair381053 data[SEQ_DECL_SIZE];
  };
  struct Keyvaluepairseq152606 {
    TGenericSeq Sup;
    Keyvaluepair152604 data[SEQ_DECL_SIZE];
  };
  struct TY290960 {
    TGenericSeq Sup;
    TY290961 data[SEQ_DECL_SIZE];
  };
  struct Tnodeseq290796 {
    TGenericSeq Sup;
    Tnode290802* data[SEQ_DECL_SIZE];
  };
  struct Orderedkeyvaluepairseq259856 {
    TGenericSeq Sup;
    Orderedkeyvaluepair259859 data[SEQ_DECL_SIZE];
  };
  struct TY259878 {
    TGenericSeq Sup;
    Jsonnodeobj259833* data[SEQ_DECL_SIZE];
  };
  struct Rstnodeseq365009 {
    TGenericSeq Sup;
    Rstnode365011* data[SEQ_DECL_SIZE];
  };
  N_NIMCALL(void, nimGCvisit)(void* d0, NI op0);
  N_NIMCALL(void, T1824627595_3)(void* p, NI op);
  N_NIMCALL(void*, newObj)(TNimType* typ0, NI size0);
  static N_INLINE(void, asgnRefNoCycle)(void** dest0, void* src0);
  static N_INLINE(Cell46904*, usrtocell_51040_1689653243)(void* usr0);
  static N_INLINE(void, rtladdzct_52201_1689653243)(Cell46904* c0);
  N_NOINLINE(void, addzct_51017_1689653243)(Cellseq46920* s0, Cell46904* c0);
  N_NIMCALL(Tdocumentor413004*, newdocumentor_413162_1256521319)(NimStringDesc* filename0, Stringtableobj152608* config0);
  N_NIMCALL(NimStringDesc*, tofilename_190260_155036129)(NI32 fileidx0);
  static N_INLINE(void, asgnRef)(void** dest0, void* src0);
  static N_INLINE(void, incref_53019_1689653243)(Cell46904* c0);
  static N_INLINE(void, decref_52601_1689653243)(Cell46904* c0);
  N_NIMCALL(void, generatejson_415113_1256521319)(Tdocumentor413004* d0, Tnode290802* n0);
  N_NIMCALL(void, writeoutputjson_416121_1256521319)(Tdocumentor413004* d0, NimStringDesc* filename0, NimStringDesc* outext0, NIM_BOOL usewarning0);
  static N_INLINE(void, pushSafePoint)(TSafePoint* s0);
  N_NIMCALL(void, generateindex_416084_1256521319)(Tdocumentor413004* d0);
  static N_INLINE(void, popSafePoint)(void);
  N_NIMCALL(NIM_BOOL, isObj)(TNimType* obj0, TNimType* subclass0);
  static N_INLINE(Exception*, getCurrentException)(void);
  static N_INLINE(void, popCurrentException)(void);
  N_NIMCALL(void, reraiseException)(void);
  N_NIMCALL(void, generatedoc_414253_1256521319)(Tdocumentor413004* d0, Tnode290802* n0);
  N_NIMCALL(void, writeoutput_416104_1256521319)(Tdocumentor413004* d0, NimStringDesc* filename0, NimStringDesc* outext0, NIM_BOOL usewarning0);
  STRING_LITERAL(T1824627595_4, ".json", 5);
  STRING_LITERAL(T1824627595_6, "html", 4);
  extern TNimType NTI339002; /* TPassContext */
  TNimType NTI574003; /* TGen */
  extern TNimType NTI413006; /* PDoc */
  extern TNimType NTI290800; /* PSym */
  TNimType NTI574005; /* PGen */
  extern Gcheap49418 gch_49458_1689653243;
  extern Stringtableobj152608* gconfigvars_168204_2607990831;
  extern NI gmainpackageid_291062_850551059;
  extern NIM_BOOL gwholeproject_168141_2607990831;
  extern TSafePoint* exchandler_18837_1689653243;
  extern TNimType NTI3628; /* IOError */
  extern Exception* currexception_18839_1689653243;
  N_NIMCALL(void, T1824627595_3)(void* p, NI op) {
  	Tgen574003* a;
  	a = (Tgen574003*)p;
  	nimGCvisit((void*)(*a).doc, op);
  	nimGCvisit((void*)(*a).module, op);
  }
  
  static N_INLINE(Cell46904*, usrtocell_51040_1689653243)(void* usr0) {
  	Cell46904* result0;
  	result0 = (Cell46904*)0;
  	result0 = ((Cell46904*) ((NI)((NU32)(((NI) (usr0))) - (NU32)(((NI)sizeof(Cell46904))))));
  	return result0;
  }
  
  static N_INLINE(void, rtladdzct_52201_1689653243)(Cell46904* c0) {
  	addzct_51017_1689653243((&gch_49458_1689653243.zct), c0);
  }
  
  static N_INLINE(void, asgnRefNoCycle)(void** dest0, void* src0) {
  	{
  		Cell46904* c0;
  		if (!!((src0 == NIM_NIL))) goto LA3;
  		c0 = usrtocell_51040_1689653243(src0);
  		(*c0).refcount += ((NI) 8);
  	}
  	LA3: ;
  	{
  		Cell46904* c0;
  		if (!!(((*dest0) == NIM_NIL))) goto LA7;
  		c0 = usrtocell_51040_1689653243((*dest0));
  		{
  			(*c0).refcount -= ((NI) 8);
  			if (!((NU32)((*c0).refcount) < (NU32)(((NI) 8)))) goto LA11;
  			rtladdzct_52201_1689653243(c0);
  		}
  		LA11: ;
  	}
  	LA7: ;
  	(*dest0) = src0;
  }
  
  static N_INLINE(void, incref_53019_1689653243)(Cell46904* c0) {
  	(*c0).refcount = (NI)((NU32)((*c0).refcount) + (NU32)(((NI) 8)));
  }
  
  static N_INLINE(void, decref_52601_1689653243)(Cell46904* c0) {
  	{
  		(*c0).refcount -= ((NI) 8);
  		if (!((NU32)((*c0).refcount) < (NU32)(((NI) 8)))) goto LA3;
  		rtladdzct_52201_1689653243(c0);
  	}
  	LA3: ;
  }
  
  static N_INLINE(void, asgnRef)(void** dest0, void* src0) {
  	{
  		Cell46904* LOC5;
  		if (!!((src0 == NIM_NIL))) goto LA3;
  		LOC5 = (Cell46904*)0;
  		LOC5 = usrtocell_51040_1689653243(src0);
  		incref_53019_1689653243(LOC5);
  	}
  	LA3: ;
  	{
  		Cell46904* LOC10;
  		if (!!(((*dest0) == NIM_NIL))) goto LA8;
  		LOC10 = (Cell46904*)0;
  		LOC10 = usrtocell_51040_1689653243((*dest0));
  		decref_52601_1689653243(LOC10);
  	}
  	LA8: ;
  	(*dest0) = src0;
  }
  
  N_NIMCALL(Tpasscontext339002*, myopen_574095_1824627595)(Tsym290834* module0) {
  	Tpasscontext339002* result0;
  	Tgen574003* g0;
  	Tdocumentor413004* d0;
  	NimStringDesc* LOC1;
  	result0 = (Tpasscontext339002*)0;
  	g0 = (Tgen574003*)0;
  	g0 = (Tgen574003*) newObj((&NTI574005), sizeof(Tgen574003));
  	(*g0).Sup.Sup.m_type = (&NTI574003);
  	asgnRefNoCycle((void**) (&(*g0).module), module0);
  	LOC1 = (NimStringDesc*)0;
  	LOC1 = tofilename_190260_155036129(((NI32) ((*module0).position)));
  	d0 = newdocumentor_413162_1256521319(LOC1, gconfigvars_168204_2607990831);
  	(*d0).Sup.hastoc = NIM_TRUE;
  	asgnRef((void**) (&(*g0).doc), d0);
  	result0 = &g0->Sup;
  	return result0;
  }
  
  N_NIMCALL(Tnode290802*, processnodejson_574089_1824627595)(Tpasscontext339002* c0, Tnode290802* n0) {
  	Tnode290802* result0;
  	Tgen574003* g0;
  	result0 = (Tnode290802*)0;
  	result0 = n0;
  	g0 = ((Tgen574003*) (c0));
  	generatejson_415113_1256521319((*g0).doc, n0);
  	return result0;
  }
  
  static N_INLINE(void, pushSafePoint)(TSafePoint* s0) {
  	(*s0).hasRaiseAction = NIM_FALSE;
  	(*s0).prev = exchandler_18837_1689653243;
  	exchandler_18837_1689653243 = s0;
  }
  
  static N_INLINE(void, popSafePoint)(void) {
  	exchandler_18837_1689653243 = (*exchandler_18837_1689653243).prev;
  }
  
  static N_INLINE(Exception*, getCurrentException)(void) {
  	Exception* result0;
  	result0 = (Exception*)0;
  	result0 = currexception_18839_1689653243;
  	return result0;
  }
  
  static N_INLINE(void, popCurrentException)(void) {
  	asgnRef((void**) (&currexception_18839_1689653243), NIM_NIL);
  }
  
  N_NIMCALL(Tnode290802*, closejson_574048_1824627595)(Tpasscontext339002* p0, Tnode290802* n0) {
  	Tnode290802* result0;
  	Tgen574003* g0;
  	NIM_BOOL usewarning0;
  	result0 = (Tnode290802*)0;
  	g0 = ((Tgen574003*) (p0));
  	usewarning0 = !((((*(*g0).module).flags &(1U<<((NU)(((Tsymflag290184) 12))&31U)))!=0));
  	{
  		NIM_BOOL LOC3;
  		NIM_BOOL LOC4;
  		NimStringDesc* LOC9;
  		TSafePoint T1824627595_5;
  		LOC3 = (NIM_BOOL)0;
  		LOC4 = (NIM_BOOL)0;
  		LOC4 = ((*(*(*g0).module).owner).Sup.id == gmainpackageid_291062_850551059);
  		if (!(LOC4)) goto LA5;
  		LOC4 = gwholeproject_168141_2607990831;
  		LA5: ;
  		LOC3 = LOC4;
  		if (LOC3) goto LA6;
  		LOC3 = (((*(*g0).module).flags &(1U<<((NU)(((Tsymflag290184) 12))&31U)))!=0);
  		LA6: ;
  		if (!LOC3) goto LA7;
  		LOC9 = (NimStringDesc*)0;
  		LOC9 = tofilename_190260_155036129(((NI32) ((*(*g0).module).position)));
  		writeoutputjson_416121_1256521319((*g0).doc, LOC9, ((NimStringDesc*) &T1824627595_4), usewarning0);
  		pushSafePoint(&T1824627595_5);
  		T1824627595_5.status = setjmp(T1824627595_5.context);
  		if (T1824627595_5.status == 0) {
  			generateindex_416084_1256521319((*g0).doc);
  			popSafePoint();
  		}
  		else {
  			popSafePoint();
  			if (isObj(getCurrentException()->Sup.m_type, (&NTI3628))) {
  				T1824627595_5.status = 0;
  				popCurrentException();
  			}
  		}
  		if (T1824627595_5.status != 0) reraiseException();
  	}
  	LA7: ;
  	return result0;
  }
  
  N_NIMCALL(Tnode290802*, processnode_574083_1824627595)(Tpasscontext339002* c0, Tnode290802* n0) {
  	Tnode290802* result0;
  	Tgen574003* g0;
  	result0 = (Tnode290802*)0;
  	result0 = n0;
  	g0 = ((Tgen574003*) (c0));
  	generatedoc_414253_1256521319((*g0).doc, n0);
  	return result0;
  }
  
  N_NIMCALL(Tnode290802*, close_574013_1824627595)(Tpasscontext339002* p0, Tnode290802* n0) {
  	Tnode290802* result0;
  	Tgen574003* g0;
  	NIM_BOOL usewarning0;
  	result0 = (Tnode290802*)0;
  	g0 = ((Tgen574003*) (p0));
  	usewarning0 = !((((*(*g0).module).flags &(1U<<((NU)(((Tsymflag290184) 12))&31U)))!=0));
  	{
  		NIM_BOOL LOC3;
  		NIM_BOOL LOC4;
  		NimStringDesc* LOC9;
  		TSafePoint T1824627595_7;
  		LOC3 = (NIM_BOOL)0;
  		LOC4 = (NIM_BOOL)0;
  		LOC4 = ((*(*(*g0).module).owner).Sup.id == gmainpackageid_291062_850551059);
  		if (!(LOC4)) goto LA5;
  		LOC4 = gwholeproject_168141_2607990831;
  		LA5: ;
  		LOC3 = LOC4;
  		if (LOC3) goto LA6;
  		LOC3 = (((*(*g0).module).flags &(1U<<((NU)(((Tsymflag290184) 12))&31U)))!=0);
  		LA6: ;
  		if (!LOC3) goto LA7;
  		LOC9 = (NimStringDesc*)0;
  		LOC9 = tofilename_190260_155036129(((NI32) ((*(*g0).module).position)));
  		writeoutput_416104_1256521319((*g0).doc, LOC9, ((NimStringDesc*) &T1824627595_6), usewarning0);
  		pushSafePoint(&T1824627595_7);
  		T1824627595_7.status = setjmp(T1824627595_7.context);
  		if (T1824627595_7.status == 0) {
  			generateindex_416084_1256521319((*g0).doc);
  			popSafePoint();
  		}
  		else {
  			popSafePoint();
  			if (isObj(getCurrentException()->Sup.m_type, (&NTI3628))) {
  				T1824627595_7.status = 0;
  				popCurrentException();
  			}
  		}
  		if (T1824627595_7.status != 0) reraiseException();
  	}
  	LA7: ;
  	return result0;
  }
  
  N_NIMCALL(void, finishdoc2pass_574117_1824627595)(NimStringDesc* project0) {
  }
  NIM_EXTERNC N_NOINLINE(void, compiler_docgen2Init000)(void) {
  }
  
  NIM_EXTERNC N_NOINLINE(void, compiler_docgen2DatInit000)(void) {
  static TNimNode* T1824627595_2[2];
  static TNimNode T1824627595_0[3];
  NTI574003.size = sizeof(Tgen574003);
  NTI574003.kind = 17;
  NTI574003.base = (&NTI339002);
  T1824627595_2[0] = &T1824627595_0[1];
  T1824627595_0[1].kind = 1;
  T1824627595_0[1].offset = offsetof(Tgen574003, doc);
  T1824627595_0[1].typ = (&NTI413006);
  T1824627595_0[1].name = "doc";
  T1824627595_2[1] = &T1824627595_0[2];
  T1824627595_0[2].kind = 1;
  T1824627595_0[2].offset = offsetof(Tgen574003, module);
  T1824627595_0[2].typ = (&NTI290800);
  T1824627595_0[2].name = "module";
  T1824627595_0[0].len = 2; T1824627595_0[0].kind = 2; T1824627595_0[0].sons = &T1824627595_2[0];
  NTI574003.node = &T1824627595_0[0];
  NTI574005.size = sizeof(Tgen574003*);
  NTI574005.kind = 22;
  NTI574005.base = (&NTI574003);
  NTI574005.marker = T1824627595_3;
  }
  
  