/* Generated by Nimrod Compiler v0.9.5 */
/*   (c) 2014 Andreas Rumpf */
/* The generated code is subject to the original license. */
/* Compiled for: Linux, i386, gcc */
/* Command for C compiler:
   gcc -c  -w -O3 -fno-strict-aliasing  -I/build/nimrod/src/nimrod/lib -o compiler/nimcache/nimrod.o compiler/nimcache/nimrod.c */
#define NIM_INTBITS 32
#include "nimbase.h"

#include <setjmp.h>

#include <string.h>

#include <stdio.h>

#include <stdlib.h>
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct E_Base E_Base;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct TSafePoint TSafePoint;
typedef struct tcell41090 tcell41090;
typedef struct tcellseq41106 tcellseq41106;
typedef struct tgcheap43016 tgcheap43016;
typedef struct tcellset41102 tcellset41102;
typedef struct tpagedesc41098 tpagedesc41098;
typedef struct tmemregion23410 tmemregion23410;
typedef struct tsmallchunk22638 tsmallchunk22638;
typedef struct tllchunk23404 tllchunk23404;
typedef struct tbigchunk22640 tbigchunk22640;
typedef struct tintset22615 tintset22615;
typedef struct ttrunk22611 ttrunk22611;
typedef struct tavlnode23408 tavlnode23408;
typedef struct tgcstat43014 tgcstat43014;
typedef struct TY108700 TY108700;
typedef struct tbasechunk22636 tbasechunk22636;
typedef struct tfreecell22628 tfreecell22628;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef N_NIMCALL_PTR(void, TY2289) (void* p, NI op);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY2289 marker;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  E_Base  {
  TNimObject Sup;
E_Base* parent;
NCSTRING name;
NimStringDesc* message;
NimStringDesc* trace;
};
typedef struct {
N_NIMCALL_PTR(NIM_BOOL, ClPrc) (E_Base* e, void* ClEnv);
void* ClEnv;
} TY11626;
struct  TSafePoint  {
TSafePoint* prev;
NI status;
jmp_buf context;
NIM_BOOL hasRaiseAction;
TY11626 raiseAction;
};
struct  tcell41090  {
NI Refcount;
TNimType* Typ;
};
struct  tcellseq41106  {
NI Len;
NI Cap;
tcell41090** D;
};
struct  tcellset41102  {
NI Counter;
NI Max;
tpagedesc41098* Head;
tpagedesc41098** Data;
};
typedef tsmallchunk22638* TY23422[512];
typedef ttrunk22611* ttrunkbuckets22613[256];
struct  tintset22615  {
ttrunkbuckets22613 Data;
};
struct  tmemregion23410  {
NI Minlargeobj;
NI Maxlargeobj;
TY23422 Freesmallchunks;
tllchunk23404* Llmem;
NI Currmem;
NI Maxmem;
NI Freemem;
NI Lastsize;
tbigchunk22640* Freechunkslist;
tintset22615 Chunkstarts;
tavlnode23408* Root;
tavlnode23408* Deleted;
tavlnode23408* Last;
tavlnode23408* Freeavlnodes;
};
struct  tgcstat43014  {
NI Stackscans;
NI Cyclecollections;
NI Maxthreshold;
NI Maxstacksize;
NI Maxstackcells;
NI Cycletablesize;
NI64 Maxpause;
};
struct  tgcheap43016  {
void* Stackbottom;
NI Cyclethreshold;
tcellseq41106 Zct;
tcellseq41106 Decstack;
tcellset41102 Cycleroots;
tcellseq41106 Tempstack;
NI Recgclock;
tmemregion23410 Region;
tgcstat43014 Stat;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct TY108700 {
NimStringDesc* Field0;
NimStringDesc* Field1;
NimStringDesc* Field2;
};
typedef NI TY22618[16];
struct  tpagedesc41098  {
tpagedesc41098* Next;
NI Key;
TY22618 Bits;
};
struct  tbasechunk22636  {
NI Prevsize;
NI Size;
NIM_BOOL Used;
};
struct  tsmallchunk22638  {
  tbasechunk22636 Sup;
tsmallchunk22638* Next;
tsmallchunk22638* Prev;
tfreecell22628* Freelist;
NI Free;
NI Acc;
NF Data;
};
struct  tllchunk23404  {
NI Size;
NI Acc;
tllchunk23404* Next;
};
struct  tbigchunk22640  {
  tbasechunk22636 Sup;
tbigchunk22640* Next;
tbigchunk22640* Prev;
NI Align;
NF Data;
};
struct  ttrunk22611  {
ttrunk22611* Next;
NI Key;
TY22618 Bits;
};
typedef tavlnode23408* TY23414[2];
struct  tavlnode23408  {
TY23414 Link;
NI Key;
NI Upperbound;
NI Level;
};
struct  tfreecell22628  {
tfreecell22628* Next;
NI Zerofield;
};
N_NIMCALL(void, gcdisablemarkandsweep_6619)(void);
N_NIMCALL(void, initdefines_168072)(void);
N_NIMCALL(void, handlecmdline_529603)(void);
N_NIMCALL(NI, paramcount_114233)(void);
N_NIMCALL(void, writecommandlineusage_173002)(void);
N_NIMCALL(void, processcmdline_523207)(NU8 pass, NimStringDesc* cmd);
static N_INLINE(void, pushSafePoint)(TSafePoint* s);
N_NIMCALL(NimStringDesc*, canonicalizepath_137335)(NimStringDesc* path);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
static N_INLINE(tcell41090*, usrtocell_44443)(void* usr);
static N_INLINE(void, rtladdzct_46002)(tcell41090* c);
N_NOINLINE(void, addzct_44418)(tcellseq41106* s, tcell41090* c);
static N_INLINE(void, popSafePoint)(void);
N_NIMCALL(NIM_BOOL, isObj)(TNimType* obj, TNimType* subclass);
static N_INLINE(E_Base*, getCurrentException)(void);
N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(void, popCurrentException)(void);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incref_46827)(tcell41090* c);
static N_INLINE(NIM_BOOL, canbecycleroot_44462)(tcell41090* c);
static N_INLINE(void, rtladdcycleroot_45235)(tcell41090* c);
N_NOINLINE(void, incl_41855)(tcellset41102* s, tcell41090* cell);
static N_INLINE(void, decref_46402)(tcell41090* c);
N_NIMCALL(void, reraiseException)(void);
N_NIMCALL(void, nossplitFile)(NimStringDesc* path, TY108700* Result);
N_NOINLINE(void, chckNil)(void* p);
N_NIMCALL(NimStringDesc*, nosgetCurrentDir)(void);
N_NIMCALL(void, loadconfigs_184607)(NimStringDesc* cfg);
N_NIMCALL(void, initvars_169714)(void);
N_NIMCALL(void, maincommand_527011)(void);
N_NIMCALL(NimStringDesc*, gcgetstatistics_6621)(void);
N_NIMCALL(NimStringDesc*, nospquoteShell)(NimStringDesc* s);
N_NIMCALL(NimStringDesc*, prependcurdir_529401)(NimStringDesc* f);
N_NIMCALL(NIM_BOOL, nosisAbsolute)(NimStringDesc* path);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(NimStringDesc*, completecfilepath_169753)(NimStringDesc* cfile, NIM_BOOL createsubdir);
N_NIMCALL(NimStringDesc*, noschangeFileExt)(NimStringDesc* filename, NimStringDesc* ext);
N_NIMCALL(void, execexternalprogram_169785)(NimStringDesc* cmd);
static N_INLINE(void, appendChar)(NimStringDesc* dest, NIM_CHAR c);
static N_INLINE(void, initStackBottom)(void);
N_NOINLINE(void, setStackBottom)(void* thestackbottom);
N_NOINLINE(void, systemInit)(void);
N_NOINLINE(void, systemDatInit)(void);
N_NOINLINE(void, testabilityInit)(void);
N_NOINLINE(void, testabilityDatInit)(void);
N_NOINLINE(void, stdlibparseutilsInit)(void);
N_NOINLINE(void, stdlibparseutilsDatInit)(void);
N_NOINLINE(void, stdlibstrutilsInit)(void);
N_NOINLINE(void, stdlibstrutilsDatInit)(void);
N_NOINLINE(void, stdlibtimesInit)(void);
N_NOINLINE(void, stdlibtimesDatInit)(void);
N_NOINLINE(void, stdlibposixInit)(void);
N_NOINLINE(void, stdlibposixDatInit)(void);
N_NOINLINE(void, stdlibosInit)(void);
N_NOINLINE(void, stdlibosDatInit)(void);
N_NOINLINE(void, listsInit)(void);
N_NOINLINE(void, listsDatInit)(void);
N_NOINLINE(void, stdlibhashesInit)(void);
N_NOINLINE(void, stdlibhashesDatInit)(void);
N_NOINLINE(void, stdlibstrtabsInit)(void);
N_NOINLINE(void, stdlibstrtabsDatInit)(void);
N_NOINLINE(void, stdlibstreamsInit)(void);
N_NOINLINE(void, stdlibstreamsDatInit)(void);
N_NOINLINE(void, stdliblinuxInit)(void);
N_NOINLINE(void, stdliblinuxDatInit)(void);
N_NOINLINE(void, stdlibosprocInit)(void);
N_NOINLINE(void, stdlibosprocDatInit)(void);
N_NOINLINE(void, stdlibmathInit)(void);
N_NOINLINE(void, stdlibmathDatInit)(void);
N_NOINLINE(void, stdlibsetsInit)(void);
N_NOINLINE(void, stdlibsetsDatInit)(void);
N_NOINLINE(void, optionsInit)(void);
N_NOINLINE(void, optionsDatInit)(void);
N_NOINLINE(void, stdlibtablesInit)(void);
N_NOINLINE(void, stdlibtablesDatInit)(void);
N_NOINLINE(void, platformInit)(void);
N_NOINLINE(void, platformDatInit)(void);
N_NOINLINE(void, crcInit)(void);
N_NOINLINE(void, crcDatInit)(void);
N_NOINLINE(void, ropesInit)(void);
N_NOINLINE(void, ropesDatInit)(void);
N_NOINLINE(void, stdlibunsignedInit)(void);
N_NOINLINE(void, stdlibunsignedDatInit)(void);
N_NOINLINE(void, stdlibsocketsInit)(void);
N_NOINLINE(void, stdlibsocketsDatInit)(void);
N_NOINLINE(void, msgsInit)(void);
N_NOINLINE(void, msgsDatInit)(void);
N_NOINLINE(void, nversionInit)(void);
N_NOINLINE(void, nversionDatInit)(void);
N_NOINLINE(void, identsInit)(void);
N_NOINLINE(void, identsDatInit)(void);
N_NOINLINE(void, condsymsInit)(void);
N_NOINLINE(void, condsymsDatInit)(void);
N_NOINLINE(void, extccompInit)(void);
N_NOINLINE(void, extccompDatInit)(void);
N_NOINLINE(void, wordrecgInit)(void);
N_NOINLINE(void, wordrecgDatInit)(void);
N_NOINLINE(void, babelcmdInit)(void);
N_NOINLINE(void, babelcmdDatInit)(void);
N_NOINLINE(void, commandsInit)(void);
N_NOINLINE(void, commandsDatInit)(void);
N_NOINLINE(void, llstreamInit)(void);
N_NOINLINE(void, llstreamDatInit)(void);
N_NOINLINE(void, nimlexbaseInit)(void);
N_NOINLINE(void, nimlexbaseDatInit)(void);
N_NOINLINE(void, lexerInit)(void);
N_NOINLINE(void, lexerDatInit)(void);
N_NOINLINE(void, nimconfInit)(void);
N_NOINLINE(void, nimconfDatInit)(void);
N_NOINLINE(void, stdlibintsetsInit)(void);
N_NOINLINE(void, stdlibintsetsDatInit)(void);
N_NOINLINE(void, idgenInit)(void);
N_NOINLINE(void, idgenDatInit)(void);
N_NOINLINE(void, astInit)(void);
N_NOINLINE(void, astDatInit)(void);
N_NOINLINE(void, rodutilsInit)(void);
N_NOINLINE(void, rodutilsDatInit)(void);
N_NOINLINE(void, astalgoInit)(void);
N_NOINLINE(void, astalgoDatInit)(void);
N_NOINLINE(void, parserInit)(void);
N_NOINLINE(void, parserDatInit)(void);
N_NOINLINE(void, pbracesInit)(void);
N_NOINLINE(void, pbracesDatInit)(void);
N_NOINLINE(void, rendererInit)(void);
N_NOINLINE(void, rendererDatInit)(void);
N_NOINLINE(void, filtersInit)(void);
N_NOINLINE(void, filtersDatInit)(void);
N_NOINLINE(void, filter_tmplInit)(void);
N_NOINLINE(void, filter_tmplDatInit)(void);
N_NOINLINE(void, syntaxesInit)(void);
N_NOINLINE(void, syntaxesDatInit)(void);
N_NOINLINE(void, treesInit)(void);
N_NOINLINE(void, treesDatInit)(void);
N_NOINLINE(void, typesInit)(void);
N_NOINLINE(void, typesDatInit)(void);
N_NOINLINE(void, stdlibmemfilesInit)(void);
N_NOINLINE(void, stdlibmemfilesDatInit)(void);
N_NOINLINE(void, rodreadInit)(void);
N_NOINLINE(void, rodreadDatInit)(void);
N_NOINLINE(void, magicsysInit)(void);
N_NOINLINE(void, magicsysDatInit)(void);
N_NOINLINE(void, bitsetsInit)(void);
N_NOINLINE(void, bitsetsDatInit)(void);
N_NOINLINE(void, nimsetsInit)(void);
N_NOINLINE(void, nimsetsDatInit)(void);
N_NOINLINE(void, passesInit)(void);
N_NOINLINE(void, passesDatInit)(void);
N_NOINLINE(void, treetabInit)(void);
N_NOINLINE(void, treetabDatInit)(void);
N_NOINLINE(void, vmdefInit)(void);
N_NOINLINE(void, vmdefDatInit)(void);
N_NOINLINE(void, semdataInit)(void);
N_NOINLINE(void, semdataDatInit)(void);
N_NOINLINE(void, lookupsInit)(void);
N_NOINLINE(void, lookupsDatInit)(void);
N_NOINLINE(void, importerInit)(void);
N_NOINLINE(void, importerDatInit)(void);
N_NOINLINE(void, rodwriteInit)(void);
N_NOINLINE(void, rodwriteDatInit)(void);
N_NOINLINE(void, saturateInit)(void);
N_NOINLINE(void, saturateDatInit)(void);
N_NOINLINE(void, semfoldInit)(void);
N_NOINLINE(void, semfoldDatInit)(void);
N_NOINLINE(void, procfindInit)(void);
N_NOINLINE(void, procfindDatInit)(void);
N_NOINLINE(void, pragmasInit)(void);
N_NOINLINE(void, pragmasDatInit)(void);
N_NOINLINE(void, semtypinstInit)(void);
N_NOINLINE(void, semtypinstDatInit)(void);
N_NOINLINE(void, parampatternsInit)(void);
N_NOINLINE(void, parampatternsDatInit)(void);
N_NOINLINE(void, stdliblexbaseInit)(void);
N_NOINLINE(void, stdliblexbaseDatInit)(void);
N_NOINLINE(void, stdlibunicodeInit)(void);
N_NOINLINE(void, stdlibunicodeDatInit)(void);
N_NOINLINE(void, stdlibjsonInit)(void);
N_NOINLINE(void, stdlibjsonDatInit)(void);
N_NOINLINE(void, docutilsrstastInit)(void);
N_NOINLINE(void, docutilsrstastDatInit)(void);
N_NOINLINE(void, docutilsrstInit)(void);
N_NOINLINE(void, docutilsrstDatInit)(void);
N_NOINLINE(void, docutilshighliteInit)(void);
N_NOINLINE(void, docutilshighliteDatInit)(void);
N_NOINLINE(void, docutilsrstgenInit)(void);
N_NOINLINE(void, docutilsrstgenDatInit)(void);
N_NOINLINE(void, guardsInit)(void);
N_NOINLINE(void, guardsDatInit)(void);
N_NOINLINE(void, sempass2Init)(void);
N_NOINLINE(void, sempass2DatInit)(void);
N_NOINLINE(void, stdlibmacrosInit)(void);
N_NOINLINE(void, stdlibmacrosDatInit)(void);
N_NOINLINE(void, stdlibxmltreeInit)(void);
N_NOINLINE(void, stdlibxmltreeDatInit)(void);
N_NOINLINE(void, stdlibcookiesInit)(void);
N_NOINLINE(void, stdlibcookiesDatInit)(void);
N_NOINLINE(void, stdlibcgiInit)(void);
N_NOINLINE(void, stdlibcgiDatInit)(void);
N_NOINLINE(void, typesrendererInit)(void);
N_NOINLINE(void, typesrendererDatInit)(void);
N_NOINLINE(void, docgenInit)(void);
N_NOINLINE(void, docgenDatInit)(void);
N_NOINLINE(void, stdlibalgorithmInit)(void);
N_NOINLINE(void, stdlibalgorithmDatInit)(void);
N_NOINLINE(void, stdlibsequtilsInit)(void);
N_NOINLINE(void, stdlibsequtilsDatInit)(void);
N_NOINLINE(void, prettyInit)(void);
N_NOINLINE(void, prettyDatInit)(void);
N_NOINLINE(void, sigmatchInit)(void);
N_NOINLINE(void, sigmatchDatInit)(void);
N_NOINLINE(void, cgmethInit)(void);
N_NOINLINE(void, cgmethDatInit)(void);
N_NOINLINE(void, loweringsInit)(void);
N_NOINLINE(void, loweringsDatInit)(void);
N_NOINLINE(void, lambdaliftingInit)(void);
N_NOINLINE(void, lambdaliftingDatInit)(void);
N_NOINLINE(void, transfInit)(void);
N_NOINLINE(void, transfDatInit)(void);
N_NOINLINE(void, vmgenInit)(void);
N_NOINLINE(void, vmgenDatInit)(void);
N_NOINLINE(void, vmdepsInit)(void);
N_NOINLINE(void, vmdepsDatInit)(void);
N_NOINLINE(void, evaltemplInit)(void);
N_NOINLINE(void, evaltemplDatInit)(void);
N_NOINLINE(void, vmInit)(void);
N_NOINLINE(void, vmDatInit)(void);
N_NOINLINE(void, aliasesInit)(void);
N_NOINLINE(void, aliasesDatInit)(void);
N_NOINLINE(void, patternsInit)(void);
N_NOINLINE(void, patternsDatInit)(void);
N_NOINLINE(void, semmacrosanityInit)(void);
N_NOINLINE(void, semmacrosanityDatInit)(void);
N_NOINLINE(void, semInit)(void);
N_NOINLINE(void, semDatInit)(void);
N_NOINLINE(void, ccgutilsInit)(void);
N_NOINLINE(void, ccgutilsDatInit)(void);
N_NOINLINE(void, cgendataInit)(void);
N_NOINLINE(void, cgendataDatInit)(void);
N_NOINLINE(void, ccgmergeInit)(void);
N_NOINLINE(void, ccgmergeDatInit)(void);
N_NOINLINE(void, cgenInit)(void);
N_NOINLINE(void, cgenDatInit)(void);
N_NOINLINE(void, jsgenInit)(void);
N_NOINLINE(void, jsgenDatInit)(void);
N_NOINLINE(void, passauxInit)(void);
N_NOINLINE(void, passauxDatInit)(void);
N_NOINLINE(void, dependsInit)(void);
N_NOINLINE(void, dependsDatInit)(void);
N_NOINLINE(void, docgen2Init)(void);
N_NOINLINE(void, docgen2DatInit)(void);
N_NOINLINE(void, stdlibparseoptInit)(void);
N_NOINLINE(void, stdlibparseoptDatInit)(void);
N_NOINLINE(void, serviceInit)(void);
N_NOINLINE(void, serviceDatInit)(void);
N_NOINLINE(void, modulesInit)(void);
N_NOINLINE(void, modulesDatInit)(void);
N_NOINLINE(void, mainInit)(void);
N_NOINLINE(void, mainDatInit)(void);
N_NOINLINE(void, nimrodInit)(void);
N_NOINLINE(void, nimrodDatInit)(void);
STRING_LITERAL(TMP1375, "", 0);
STRING_LITERAL(TMP1543, "nimrod.cfg", 10);
STRING_LITERAL(TMP4562, "./", 2);
STRING_LITERAL(TMP4563, "js", 2);
STRING_LITERAL(TMP4564, "node ", 5);
extern NimStringDesc* gprojectname_137206;
extern TSafePoint* exchandler_13039;
extern NimStringDesc* gprojectfull_137208;
extern tgcheap43016 gch_43044;
extern TNimType NTI2435; /* EOS */
extern E_Base* currexception_13041;
extern NimStringDesc* gprojectpath_137207;
extern NI gverbosity_137120;
extern NI gerrorcounter_164182;
extern NU32 gglobaloptions_137111;
extern NU8 gcmd_137113;
extern NimStringDesc* outfile_137117;
extern NimStringDesc* arguments_523205;

static N_INLINE(void, pushSafePoint)(TSafePoint* s) {
	(*s).hasRaiseAction = NIM_FALSE;
	(*s).prev = exchandler_13039;
	exchandler_13039 = s;
}

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

static N_INLINE(void, rtladdzct_46002)(tcell41090* c) {
	addzct_44418(&gch_43044.Zct, c);
}

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

static N_INLINE(void, popSafePoint)(void) {
	exchandler_13039 = (*exchandler_13039).prev;
}

static N_INLINE(E_Base*, getCurrentException)(void) {
	E_Base* result;
	result = 0;
	result = currexception_13041;
	return result;
}

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

static N_INLINE(NIM_BOOL, canbecycleroot_44462)(tcell41090* c) {
	NIM_BOOL result;
	result = 0;
	result = !((((*(*c).Typ).flags &(1<<((((NU8) 1))&7)))!=0));
	return result;
}

static N_INLINE(void, rtladdcycleroot_45235)(tcell41090* c) {
	{
		if (!!((((NI) ((NI)((*c).Refcount & 3))) == 3))) goto LA3;
		(*c).Refcount = (NI)((NI)((*c).Refcount & -4) | 3);
		incl_41855(&gch_43044.Cycleroots, c);
	}
	LA3: ;
}

static N_INLINE(void, incref_46827)(tcell41090* c) {
	(*c).Refcount = (NI)((NU32)((*c).Refcount) + (NU32)(8));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = canbecycleroot_44462(c);
		if (!LOC3) goto LA4;
		rtladdcycleroot_45235(c);
	}
	LA4: ;
}

static N_INLINE(void, decref_46402)(tcell41090* c) {
	{
		(*c).Refcount -= 8;
		if (!((NU32)((*c).Refcount) < (NU32)(8))) goto LA3;
		rtladdzct_46002(c);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = canbecycleroot_44462(c);
		if (!LOC6) goto LA7;
		rtladdcycleroot_45235(c);
	}
	goto LA1;
	LA7: ;
	LA1: ;
}

static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		tcell41090* LOC5;
		if (!!((src == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = usrtocell_44443(src);
		incref_46827(LOC5);
	}
	LA3: ;
	{
		tcell41090* LOC10;
		if (!!(((*dest) == NIM_NIL))) goto LA8;
		LOC10 = 0;
		LOC10 = usrtocell_44443((*dest));
		decref_46402(LOC10);
	}
	LA8: ;
	(*dest) = src;
}

static N_INLINE(void, popCurrentException)(void) {
	asgnRef((void**) &currexception_13041, (*currexception_13041).parent);
}

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;
}

N_NIMCALL(NimStringDesc*, prependcurdir_529401)(NimStringDesc* f) {
	NimStringDesc* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = nosisAbsolute(f);
		if (!LOC3) goto LA4;
		result = copyString(f);
	}
	goto LA1;
	LA4: ;
	{
		NimStringDesc* LOC7;
		LOC7 = 0;
		LOC7 = rawNewString(f->Sup.len + 2);
appendString(LOC7, ((NimStringDesc*) &TMP4562));
appendString(LOC7, f);
		result = LOC7;
	}
	LA1: ;
	return result;
}

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(void, handlecmdline_529603)(void) {
	{
		NI LOC3;
		LOC3 = 0;
		LOC3 = paramcount_114233();
		if (!(LOC3 == 0)) goto LA4;
		writecommandlineusage_173002();
	}
	goto LA1;
	LA4: ;
	{
		processcmdline_523207(((NU8) 0), ((NimStringDesc*) &TMP1375));
		{
			TSafePoint TMP1376;
			TY108700 p;
			NimStringDesc* LOC15;
			NimStringDesc* LOC16;
			if (!!(((gprojectname_137206) && (gprojectname_137206)->Sup.len == 0))) goto LA9;
			pushSafePoint(&TMP1376);
			TMP1376.status = setjmp(TMP1376.context);
			if (TMP1376.status == 0) {
				asgnRefNoCycle((void**) &gprojectfull_137208, canonicalizepath_137335(gprojectname_137206));
				popSafePoint();
			}
			else {
				popSafePoint();
				if (isObj(getCurrentException()->Sup.m_type, (&NTI2435))) {
					NimStringDesc* LOC14;
					TMP1376.status = 0;
					LOC14 = 0;
					LOC14 = gprojectfull_137208; gprojectfull_137208 = copyStringRC1(gprojectname_137206);
					if (LOC14) nimGCunrefNoCycle(LOC14);
					popCurrentException();
				}
			}
			if (TMP1376.status != 0) reraiseException();
			chckNil((void*)&p);
			memset((void*)&p, 0, sizeof(p));
			nossplitFile(gprojectfull_137208, &p);
			LOC15 = 0;
			LOC15 = gprojectpath_137207; gprojectpath_137207 = copyStringRC1(p.Field0);
			if (LOC15) nimGCunrefNoCycle(LOC15);
			LOC16 = 0;
			LOC16 = gprojectname_137206; gprojectname_137206 = copyStringRC1(p.Field1);
			if (LOC16) nimGCunrefNoCycle(LOC16);
		}
		goto LA7;
		LA9: ;
		{
			asgnRefNoCycle((void**) &gprojectpath_137207, nosgetCurrentDir());
		}
		LA7: ;
		loadconfigs_184607(((NimStringDesc*) &TMP1543));
		initvars_169714();
		processcmdline_523207(((NU8) 1), ((NimStringDesc*) &TMP1375));
		maincommand_527011();
		{
			NimStringDesc* LOC22;
			if (!(2 <= gverbosity_137120)) goto LA20;
			LOC22 = 0;
			LOC22 = gcgetstatistics_6621();
			printf("%s\012", (LOC22)->data);
		}
		LA20: ;
		{
			if (!(gerrorcounter_164182 == 0)) goto LA25;
			{
				if (!((gglobaloptions_137111 &(1<<((((NU8) 13))&31)))!=0)) goto LA29;
				{
					NimStringDesc* ex;
					NimStringDesc* LOC44;
					if (!(gcmd_137113 == ((NU8) 4))) goto LA33;
					ex = 0;
					{
						NimStringDesc* LOC39;
						if (!(0 < outfile_137117->Sup.len)) goto LA37;
						LOC39 = 0;
						LOC39 = prependcurdir_529401(outfile_137117);
						ex = nospquoteShell(LOC39);
					}
					goto LA35;
					LA37: ;
					{
						NimStringDesc* LOC41;
						NimStringDesc* LOC42;
						NimStringDesc* LOC43;
						LOC41 = 0;
						LOC41 = noschangeFileExt(gprojectfull_137208, ((NimStringDesc*) &TMP4563));
						LOC42 = 0;
						LOC42 = prependcurdir_529401(LOC41);
						LOC43 = 0;
						LOC43 = completecfilepath_169753(LOC42, NIM_TRUE);
						ex = nospquoteShell(LOC43);
					}
					LA35: ;
					LOC44 = 0;
					LOC44 = rawNewString(ex->Sup.len + arguments_523205->Sup.len + 6);
appendString(LOC44, ((NimStringDesc*) &TMP4564));
appendString(LOC44, ex);
appendChar(LOC44, 32);
appendString(LOC44, arguments_523205);
					execexternalprogram_169785(LOC44);
				}
				goto LA31;
				LA33: ;
				{
					NimStringDesc* binpath;
					NimStringDesc* ex;
					NimStringDesc* LOC52;
					binpath = 0;
					{
						if (!(0 < outfile_137117->Sup.len)) goto LA48;
						binpath = prependcurdir_529401(outfile_137117);
					}
					goto LA46;
					LA48: ;
					{
						NimStringDesc* LOC51;
						LOC51 = 0;
						LOC51 = noschangeFileExt(gprojectfull_137208, ((NimStringDesc*) &TMP1375));
						binpath = prependcurdir_529401(LOC51);
					}
					LA46: ;
					ex = nospquoteShell(binpath);
					LOC52 = 0;
					LOC52 = rawNewString(ex->Sup.len + arguments_523205->Sup.len + 1);
appendString(LOC52, ex);
appendChar(LOC52, 32);
appendString(LOC52, arguments_523205);
					execexternalprogram_169785(LOC52);
				}
				LA31: ;
			}
			LA29: ;
		}
		LA25: ;
	}
	LA1: ;
}

static N_INLINE(void, initStackBottom)(void) {
	void* volatile locals;
	locals = 0;
	locals = ((void*) (&locals));
	setStackBottom(locals);
}
void PreMain() {
	systemDatInit();
	systemInit();
	testabilityDatInit();
	stdlibparseutilsDatInit();
	stdlibstrutilsDatInit();
	stdlibtimesDatInit();
	stdlibposixDatInit();
	stdlibosDatInit();
	listsDatInit();
	stdlibhashesDatInit();
	stdlibstrtabsDatInit();
	stdlibstreamsDatInit();
	stdliblinuxDatInit();
	stdlibosprocDatInit();
	stdlibmathDatInit();
	stdlibsetsDatInit();
	optionsDatInit();
	stdlibtablesDatInit();
	platformDatInit();
	crcDatInit();
	ropesDatInit();
	stdlibunsignedDatInit();
	stdlibsocketsDatInit();
	msgsDatInit();
	nversionDatInit();
	identsDatInit();
	condsymsDatInit();
	extccompDatInit();
	wordrecgDatInit();
	babelcmdDatInit();
	commandsDatInit();
	llstreamDatInit();
	nimlexbaseDatInit();
	lexerDatInit();
	nimconfDatInit();
	stdlibintsetsDatInit();
	idgenDatInit();
	astDatInit();
	rodutilsDatInit();
	astalgoDatInit();
	parserDatInit();
	pbracesDatInit();
	rendererDatInit();
	filtersDatInit();
	filter_tmplDatInit();
	syntaxesDatInit();
	treesDatInit();
	typesDatInit();
	stdlibmemfilesDatInit();
	rodreadDatInit();
	magicsysDatInit();
	bitsetsDatInit();
	nimsetsDatInit();
	passesDatInit();
	treetabDatInit();
	vmdefDatInit();
	semdataDatInit();
	lookupsDatInit();
	importerDatInit();
	rodwriteDatInit();
	saturateDatInit();
	semfoldDatInit();
	procfindDatInit();
	pragmasDatInit();
	semtypinstDatInit();
	parampatternsDatInit();
	stdliblexbaseDatInit();
	stdlibunicodeDatInit();
	stdlibjsonDatInit();
	docutilsrstastDatInit();
	docutilsrstDatInit();
	docutilshighliteDatInit();
	docutilsrstgenDatInit();
	guardsDatInit();
	sempass2DatInit();
	stdlibmacrosDatInit();
	stdlibxmltreeDatInit();
	stdlibcookiesDatInit();
	stdlibcgiDatInit();
	typesrendererDatInit();
	docgenDatInit();
	stdlibalgorithmDatInit();
	stdlibsequtilsDatInit();
	prettyDatInit();
	sigmatchDatInit();
	cgmethDatInit();
	loweringsDatInit();
	lambdaliftingDatInit();
	transfDatInit();
	vmgenDatInit();
	vmdepsDatInit();
	evaltemplDatInit();
	vmDatInit();
	aliasesDatInit();
	patternsDatInit();
	semmacrosanityDatInit();
	semDatInit();
	ccgutilsDatInit();
	cgendataDatInit();
	ccgmergeDatInit();
	cgenDatInit();
	jsgenDatInit();
	passauxDatInit();
	dependsDatInit();
	docgen2DatInit();
	stdlibparseoptDatInit();
	serviceDatInit();
	modulesDatInit();
	mainDatInit();
	nimrodDatInit();
	initStackBottom();
	testabilityInit();
	stdlibparseutilsInit();
	stdlibstrutilsInit();
	stdlibtimesInit();
	stdlibposixInit();
	stdlibosInit();
	listsInit();
	stdlibhashesInit();
	stdlibstrtabsInit();
	stdlibstreamsInit();
	stdliblinuxInit();
	stdlibosprocInit();
	stdlibmathInit();
	stdlibsetsInit();
	optionsInit();
	stdlibtablesInit();
	platformInit();
	crcInit();
	ropesInit();
	stdlibunsignedInit();
	stdlibsocketsInit();
	msgsInit();
	nversionInit();
	identsInit();
	condsymsInit();
	extccompInit();
	wordrecgInit();
	babelcmdInit();
	commandsInit();
	llstreamInit();
	nimlexbaseInit();
	lexerInit();
	nimconfInit();
	stdlibintsetsInit();
	idgenInit();
	astInit();
	rodutilsInit();
	astalgoInit();
	parserInit();
	pbracesInit();
	rendererInit();
	filtersInit();
	filter_tmplInit();
	syntaxesInit();
	treesInit();
	typesInit();
	stdlibmemfilesInit();
	rodreadInit();
	magicsysInit();
	bitsetsInit();
	nimsetsInit();
	passesInit();
	treetabInit();
	vmdefInit();
	semdataInit();
	lookupsInit();
	importerInit();
	rodwriteInit();
	saturateInit();
	semfoldInit();
	procfindInit();
	pragmasInit();
	semtypinstInit();
	parampatternsInit();
	stdliblexbaseInit();
	stdlibunicodeInit();
	stdlibjsonInit();
	docutilsrstastInit();
	docutilsrstInit();
	docutilshighliteInit();
	docutilsrstgenInit();
	guardsInit();
	sempass2Init();
	stdlibmacrosInit();
	stdlibxmltreeInit();
	stdlibcookiesInit();
	stdlibcgiInit();
	typesrendererInit();
	docgenInit();
	stdlibalgorithmInit();
	stdlibsequtilsInit();
	prettyInit();
	sigmatchInit();
	cgmethInit();
	loweringsInit();
	lambdaliftingInit();
	transfInit();
	vmgenInit();
	vmdepsInit();
	evaltemplInit();
	vmInit();
	aliasesInit();
	patternsInit();
	semmacrosanityInit();
	semInit();
	ccgutilsInit();
	cgendataInit();
	ccgmergeInit();
	cgenInit();
	jsgenInit();
	passauxInit();
	dependsInit();
	docgen2Init();
	stdlibparseoptInit();
	serviceInit();
	modulesInit();
	mainInit();
}

int cmdCount;
char** cmdLine;
char** gEnv;
N_CDECL(void, NimMain)(void) {
	PreMain();
	nimrodInit();
}

int main(int argc, char** args, char** env) {
	cmdLine = args;
	cmdCount = argc;
	gEnv = env;
	NimMain();
	return nim_program_result;
}

N_NOINLINE(void, nimrodInit)(void) {
	gcdisablemarkandsweep_6619();
	initdefines_168072();
	handlecmdline_529603();
	exit(((NI) (((NI8) ((0 < gerrorcounter_164182))))));
}

N_NOINLINE(void, nimrodDatInit)(void) {
}

