/* Generated by Nimrod Compiler v0.9.4 */
/*   (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  -I/build/nimrod/src/nimrod/lib -o nimcache/koch.o nimcache/koch.c */
#define NIM_INTBITS 32
#include "nimbase.h"

#include <stdio.h>

#include <string.h>

#include <dirent.h>

#include <sys/types.h>

#include <sys/stat.h>

#include <sys/time.h>

#include <glob.h>
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct TY107700 TY107700;
typedef struct TY93105 TY93105;
typedef struct toptparser117807 toptparser117807;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef NimStringDesc* TY131441[4];
typedef NimStringDesc* TY127892[3];
struct TY107700 {
NimStringDesc* Field0;
NimStringDesc* Field1;
NimStringDesc* Field2;
};
typedef NimStringDesc* TY131483[2];
typedef NimStringDesc* TY131809[18];
typedef NimStringDesc* TY131812[6];
typedef NIM_CHAR TY96549[256];
struct TY93105 {
NimStringDesc* Field0;
NimStringDesc* Field1;
};
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  toptparser117807  {
  TNimObject Sup;
NimStringDesc* Cmd;
NI Pos;
NIM_BOOL Inshortstate;
NU8 Kind;
NimStringDesc* Key;
NimStringDesc* Val;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
N_NIMCALL(NimStringDesc*, exe_131403)(NimStringDesc* f);
N_NIMCALL(NimStringDesc*, nosaddFileExt)(NimStringDesc* filename, NimStringDesc* ext);
static N_INLINE(void, nimFrame)(TFrame* s);
static N_INLINE(void, popFrame)(void);
N_NIMCALL(NimStringDesc*, findnim_131409)(void);
N_NIMCALL(NimStringDesc*, HEX2F_107477)(NimStringDesc* head, NimStringDesc* tail);
N_NIMCALL(NIM_BOOL, nosexistsFile)(NimStringDesc* filename);
N_NIMCALL(NimStringDesc*, getenv_110426)(NimStringDesc* key);
N_NIMCALL(void, failedassertimpl_79821)(NimStringDesc* msg);
N_NOINLINE(void, raiseIndexError)(void);
static N_INLINE(NI, addInt)(NI a, NI b);
N_NOINLINE(void, raiseOverflow)(void);
N_NIMCALL(NimStringDesc*, copyStrLast)(NimStringDesc* s, NI start_70824, NI last);
N_NIMCALL(NimStringDesc*, copyStrLast)(NimStringDesc* s, NI first, NI last);
static N_INLINE(NI, subInt)(NI a, NI b);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(void, exec_131423)(NimStringDesc* cmd);
N_NIMCALL(NI, nosexecShellCmd)(NimStringDesc* command);
N_NIMCALL(void, quit_79030)(NimStringDesc* errormsg, NI errorcode);
N_NIMCALL(NIM_BOOL, tryexec_131428)(NimStringDesc* cmd);
N_NIMCALL(void, csource_131436)(NimStringDesc* args);
N_NIMCALL(NimStringDesc*, nsuFormatOpenArray)(NimStringDesc* formatstr, NimStringDesc** a, NI aLen0);
N_NIMCALL(void, zip_131445)(NimStringDesc* args);
N_NIMCALL(void, buildtool_131454)(NimStringDesc* toolname, NimStringDesc* args);
N_NIMCALL(void, noscopyFile)(NimStringDesc* source, NimStringDesc* dest);
N_NIMCALL(void, nossplitFile)(NimStringDesc* path, TY107700* Result);
N_NIMCALL(void, inno_131464)(NimStringDesc* args);
N_NIMCALL(NimStringDesc*, nsuFormatSingleElem)(NimStringDesc* formatstr, NimStringDesc* a);
N_NIMCALL(void, install_131469)(NimStringDesc* args);
N_NIMCALL(void, web_131478)(NimStringDesc* args);
N_NIMCALL(NimStringDesc*, findstartnimrod_131490)(void);
N_NIMCALL(void, saferemove_131611)(NimStringDesc* filename);
N_NIMCALL(void, nosremoveFile)(NimStringDesc* file);
N_NIMCALL(NimStringDesc*, thversion_131616)(NI i);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(void, copyexe_131622)(NimStringDesc* source, NimStringDesc* dest);
N_NIMCALL(void, nosinclFilePermissions)(NimStringDesc* filename, NU16 permissions);
N_NIMCALL(void, boot_131629)(NimStringDesc* args);
N_NIMCALL(NIM_BOOL, nossameFileContent)(NimStringDesc* path1, NimStringDesc* path2);
static N_INLINE(NIM_BOOL, contains_131825)(NimStringDesc** a_131831, NI a_131831Len0, NimStringDesc* item_131834);
static N_INLINE(NI, find_131837)(NimStringDesc** a_131842, NI a_131842Len0, NimStringDesc* item_131844);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(void, cleanaux_131815)(NimStringDesc* dir_131817);
N_NIMCALL(NimStringDesc*, cstrToNimstr)(NCSTRING str);
N_NIMCALL(void, nossplitPath)(NimStringDesc* path, TY93105* Result);
N_NIMCALL(void, nosremoveDir)(NimStringDesc* dir);
N_NIMCALL(void, removepattern_131905)(NimStringDesc* pattern);
N_NIMCALL(void, clean_131922)(NimStringDesc* args);
N_NIMCALL(NimStringDesc*, nosgetCurrentDir)(void);
N_NIMCALL(void, tests_132009)(NimStringDesc* args);
N_NIMCALL(NimStringDesc*, nospquoteShell)(NimStringDesc* s);
N_NIMCALL(void, temp_132016)(NimStringDesc* args);
N_NIMCALL(void, showhelp_132024)(void);
N_NIMCALL(NimStringDesc*, nsuRepeatChar)(NI count, NIM_CHAR c);
N_NIMCALL(void, initoptparser_117819)(NimStringDesc* cmdline, toptparser117807* Result);
N_NOINLINE(void, chckNil)(void* p);
N_NIMCALL(void, genericReset)(void* dest, TNimType* mt);
N_NIMCALL(void, nponext)(toptparser117807* p);
N_NIMCALL(NimStringDesc*, nsuNormalize)(NimStringDesc* s);
N_NIMCALL(NI, hashString)(NimStringDesc* s);
N_NIMCALL(NimStringDesc*, npocmdLineRest)(toptparser117807* p);
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, 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, stdlibparseoptInit)(void);
N_NOINLINE(void, stdlibparseoptDatInit)(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, kochInit)(void);
N_NOINLINE(void, kochDatInit)(void);
STRING_LITERAL(TMP390, "", 0);
STRING_LITERAL(TMP391, "nimrod", 6);
STRING_LITERAL(TMP393, "bin", 3);
STRING_LITERAL(TMP394, "PATH", 4);
STRING_LITERAL(TMP395, "\'\\0\' != sep ", 12);
STRING_LITERAL(TMP397, "FAILURE", 7);
STRING_LITERAL(TMP415, "$4 cc $1 -r $3 --var:version=$2 csource compiler/nimrod.ini $1", 62);
STRING_LITERAL(TMP416, "0.9.4", 5);
STRING_LITERAL(TMP417, "-d:useLibzipSrc tools/niminst/niminst", 37);
STRING_LITERAL(TMP418, "$3 cc -r $2 --var:version=$1 zip compiler/nimrod.ini", 52);
STRING_LITERAL(TMP419, "$# cc $# $#", 11);
STRING_LITERAL(TMP426, "tools/niminst/niminst", 21);
STRING_LITERAL(TMP427, "tools/nimgrep", 13);
STRING_LITERAL(TMP428, "compiler/c2nim/c2nim", 20);
STRING_LITERAL(TMP430, "tools", 5);
STRING_LITERAL(TMP431, "niminst", 7);
STRING_LITERAL(TMP432, "niminst --var:version=$# inno compiler/nimrod", 45);
STRING_LITERAL(TMP433, "$# cc -r $# --var:version=$# scripts compiler/nimrod.ini", 56);
STRING_LITERAL(TMP434, "sh ./install.sh $#", 18);
STRING_LITERAL(TMP435, "$# cc -r tools/nimweb.nim web/nimrod --putenv:nimrodversion=$#", 62);
STRING_LITERAL(TMP437, "build.sh", 8);
STRING_LITERAL(TMP438, "./build.sh", 10);
STRING_LITERAL(TMP439, "Found no nimrod compiler and every attempt to build one failed!", 63);
STRING_LITERAL(TMP440, "compiler", 8);
STRING_LITERAL(TMP441, "iteration: ", 11);
STRING_LITERAL(TMP443, " cc $# $# compiler", 18);
STRING_LITERAL(TMP444, "nimrod.nim", 10);
STRING_LITERAL(TMP445, "executables are equal: SUCCESS!", 31);
STRING_LITERAL(TMP447, "[Warning] executables are still not equal", 41);
STRING_LITERAL(TMP448, ".ppu", 4);
STRING_LITERAL(TMP449, ".o", 2);
STRING_LITERAL(TMP450, ".obj", 4);
STRING_LITERAL(TMP451, ".dcu", 4);
STRING_LITERAL(TMP452, ".~pas", 5);
STRING_LITERAL(TMP453, ".~inc", 5);
STRING_LITERAL(TMP454, ".~dsk", 5);
STRING_LITERAL(TMP455, ".~dpr", 5);
STRING_LITERAL(TMP456, ".map", 4);
STRING_LITERAL(TMP457, ".tds", 4);
STRING_LITERAL(TMP458, ".err", 4);
STRING_LITERAL(TMP459, ".bak", 4);
STRING_LITERAL(TMP460, ".pyc", 4);
STRING_LITERAL(TMP461, ".exe", 4);
STRING_LITERAL(TMP462, ".rod", 4);
STRING_LITERAL(TMP463, ".pdb", 4);
STRING_LITERAL(TMP464, ".idb", 4);
STRING_LITERAL(TMP465, ".idx", 4);
NIM_CONST TY131809 cleanext_131808 = {((NimStringDesc*) &TMP448),
((NimStringDesc*) &TMP449),
((NimStringDesc*) &TMP450),
((NimStringDesc*) &TMP451),
((NimStringDesc*) &TMP452),
((NimStringDesc*) &TMP453),
((NimStringDesc*) &TMP454),
((NimStringDesc*) &TMP455),
((NimStringDesc*) &TMP456),
((NimStringDesc*) &TMP457),
((NimStringDesc*) &TMP458),
((NimStringDesc*) &TMP459),
((NimStringDesc*) &TMP460),
((NimStringDesc*) &TMP461),
((NimStringDesc*) &TMP462),
((NimStringDesc*) &TMP463),
((NimStringDesc*) &TMP464),
((NimStringDesc*) &TMP465)}
;
STRING_LITERAL(TMP466, ".bzrignore", 10);
STRING_LITERAL(TMP467, "nimrod.exe", 10);
STRING_LITERAL(TMP468, "koch", 4);
STRING_LITERAL(TMP469, "koch.exe", 8);
STRING_LITERAL(TMP470, ".gitignore", 10);
NIM_CONST TY131812 ignore_131811 = {((NimStringDesc*) &TMP466),
((NimStringDesc*) &TMP391),
((NimStringDesc*) &TMP467),
((NimStringDesc*) &TMP468),
((NimStringDesc*) &TMP469),
((NimStringDesc*) &TMP470)}
;
STRING_LITERAL(TMP471, ".", 1);
STRING_LITERAL(TMP472, "..", 2);
NIM_CONST TY131809 TMP473 = {((NimStringDesc*) &TMP448),
((NimStringDesc*) &TMP449),
((NimStringDesc*) &TMP450),
((NimStringDesc*) &TMP451),
((NimStringDesc*) &TMP452),
((NimStringDesc*) &TMP453),
((NimStringDesc*) &TMP454),
((NimStringDesc*) &TMP455),
((NimStringDesc*) &TMP456),
((NimStringDesc*) &TMP457),
((NimStringDesc*) &TMP458),
((NimStringDesc*) &TMP459),
((NimStringDesc*) &TMP460),
((NimStringDesc*) &TMP461),
((NimStringDesc*) &TMP462),
((NimStringDesc*) &TMP463),
((NimStringDesc*) &TMP464),
((NimStringDesc*) &TMP465)}
;
NIM_CONST TY131812 TMP474 = {((NimStringDesc*) &TMP466),
((NimStringDesc*) &TMP391),
((NimStringDesc*) &TMP467),
((NimStringDesc*) &TMP468),
((NimStringDesc*) &TMP469),
((NimStringDesc*) &TMP470)}
;
STRING_LITERAL(TMP475, "removing: ", 10);
STRING_LITERAL(TMP479, "nimcache", 8);
STRING_LITERAL(TMP480, "dist", 4);
STRING_LITERAL(TMP481, ".git", 4);
STRING_LITERAL(TMP482, "icons", 5);
STRING_LITERAL(TMP483, "removing dir: ", 14);
STRING_LITERAL(TMP487, "f.gl_pathv[i] != nil ", 21);
STRING_LITERAL(TMP488, "koch.dat", 8);
STRING_LITERAL(TMP489, "web/*.html", 10);
STRING_LITERAL(TMP490, "doc/*.html", 10);
STRING_LITERAL(TMP491, "build", 5);
STRING_LITERAL(TMP492, "nimrod cc --taintMode:on tests/testament/tester", 47);
STRING_LITERAL(TMP493, "tests/testament/tester", 22);
STRING_LITERAL(TMP494, " ", 1);
STRING_LITERAL(TMP495, "all", 3);
STRING_LITERAL(TMP496, " html", 5);
STRING_LITERAL(TMP497, "nimrod_temp", 11);
STRING_LITERAL(TMP498, "nimrod c compiler", 17);
STRING_LITERAL(TMP499, "+--------------------------------------------------------------"
"---+\012|         Maintenance program for Nimrod                   "
"       |\012|             Version $1|\012|             (c) 2014 Andrea"
"s Rumpf                              |\012+------------------------"
"-----------------------------------------+\012Build time: $2, $3\012\012U"
"sage:\012  koch [options] command [options for command]\012Options:\012  "
"--help, -h               shows this help and quits\012Possible Comm"
"ands:\012  boot [options]           bootstraps with given command l"
"ine options\012  install [dir]            installs to given directo"
"ry\012  clean                    cleans Nimrod project; removes gen"
"erated files\012  web                      generates the website\012  "
"csource [options]        builds the C sources for installation\012 "
" zip                      builds the installation ZIP package\012  "
"inno [options]           builds the Inno Setup installer (for Wi"
"ndows)\012  tests [options]          run the testsuite\012  update    "
"               updates nimrod to the latest version from github\012"
"                           (compile koch with -d:withUpdate to e"
"nable)\012  temp options             creates a temporary compiler f"
"or testing\012Boot options:\012  -d:release               produce a re"
"lease version of the compiler\012  -d:tinyc                 include"
" the Tiny C backend (not supported on Windows)\012  -d:useGnuReadli"
"ne        use the GNU readline library for interactive mode\012    "
"                       (not needed on Windows)\012  -d:nativeStackt"
"race      use native stack traces (only for Mac OS X or Linux)\012 "
" -d:noCaas                build Nimrod without CAAS support\012  -d"
":avoidTimeMachine      only for Mac OS X, excludes nimcache dir "
"from backups\012", 1676);
STRING_LITERAL(TMP500, "2014-04-30", 10);
STRING_LITERAL(TMP501, "19:45:32", 8);
STRING_LITERAL(TMP508, "boot", 4);
STRING_LITERAL(TMP509, "clean", 5);
STRING_LITERAL(TMP510, "web", 3);
STRING_LITERAL(TMP511, "csource", 7);
STRING_LITERAL(TMP512, "csources", 8);
STRING_LITERAL(TMP513, "zip", 3);
STRING_LITERAL(TMP514, "inno", 4);
STRING_LITERAL(TMP515, "install", 7);
STRING_LITERAL(TMP516, "test", 4);
STRING_LITERAL(TMP517, "tests", 5);
STRING_LITERAL(TMP518, "update", 6);
STRING_LITERAL(TMP519, "temp", 4);
STRING_LITERAL(TMP520, "this Koch has not been compiled with -d:withUpdate", 50);
extern TFrame* frameptr_13038;
toptparser117807 op_132034;
extern TNimType NTI117807; /* TOptParser */

static N_INLINE(void, nimFrame)(TFrame* s) {
	(*s).prev = frameptr_13038;
	frameptr_13038 = s;
}

static N_INLINE(void, popFrame)(void) {
	frameptr_13038 = (*frameptr_13038).prev;
}

N_NIMCALL(NimStringDesc*, exe_131403)(NimStringDesc* f) {
	NimStringDesc* result;
	nimfr("exe", "koch.nim")
	result = 0;
	nimln(59, "koch.nim");
	nimln(59, "koch.nim");
	result = nosaddFileExt(f, ((NimStringDesc*) &TMP390));
	goto BeforeRet;
	BeforeRet: ;
	popFrame();
	return result;
}

static N_INLINE(NI, addInt)(NI a, NI b) {
	NI result;
	result = 0;
	result = (NI)((NU32)(a) + (NU32)(b));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = (0 <= (NI)(result ^ a));
		if (LOC3) goto LA4;
		LOC3 = (0 <= (NI)(result ^ b));
		LA4: ;
		if (!LOC3) goto LA5;
		goto BeforeRet;
	}
	LA5: ;
	raiseOverflow();
	BeforeRet: ;
	return result;
}

static N_INLINE(NI, subInt)(NI a, NI b) {
	NI result;
	result = 0;
	result = (NI)((NU32)(a) - (NU32)(b));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = (0 <= (NI)(result ^ a));
		if (LOC3) goto LA4;
		LOC3 = (0 <= (NI)(result ^ (NI)((NU32) ~(b))));
		LA4: ;
		if (!LOC3) goto LA5;
		goto BeforeRet;
	}
	LA5: ;
	raiseOverflow();
	BeforeRet: ;
	return result;
}

N_NIMCALL(NimStringDesc*, findnim_131409)(void) {
	NimStringDesc* result;
	NimStringDesc* nimrod;
	NimStringDesc* dir_131413;
	NimStringDesc* HEX3Atmp_131414;
	NI last_131416;
	nimfr("findNim", "koch.nim")
	result = 0;
	nimln(62, "koch.nim");
	nimrod = exe_131403(((NimStringDesc*) &TMP391));
	nimln(63, "koch.nim");
	result = HEX2F_107477(((NimStringDesc*) &TMP393), nimrod);
	nimln(64, "koch.nim");
	{
		NIM_BOOL LOC3;
		nimln(64, "koch.nim");
		LOC3 = 0;
		LOC3 = nosexistsFile(result);
		if (!LOC3) goto LA4;
		nimln(64, "koch.nim");
		goto BeforeRet;
	}
	LA4: ;
	dir_131413 = 0;
	HEX3Atmp_131414 = 0;
	nimln(65, "koch.nim");
	HEX3Atmp_131414 = getenv_110426(((NimStringDesc*) &TMP394));
	nimln(257, "strutils.nim");
	last_131416 = 0;
	nimln(258, "strutils.nim");
	{
		if (!NIM_FALSE) goto LA8;
		nimln(258, "strutils.nim");
		failedassertimpl_79821(((NimStringDesc*) &TMP395));
	}
	LA8: ;
	nimln(259, "strutils.nim");
	{
		nimln(259, "strutils.nim");
		nimln(259, "strutils.nim");
		if (!(0 < HEX3Atmp_131414->Sup.len)) goto LA12;
		nimln(261, "strutils.nim");
		while (1) {
			NI first_131418;
			NI TMP396;
			nimln(261, "strutils.nim");
			nimln(261, "strutils.nim");
			if (!(last_131416 <= HEX3Atmp_131414->Sup.len)) goto LA14;
			nimln(262, "strutils.nim");
			first_131418 = last_131416;
			nimln(263, "strutils.nim");
			while (1) {
				NIM_BOOL LOC16;
				nimln(263, "strutils.nim");
				LOC16 = 0;
				nimln(263, "strutils.nim");
				nimln(263, "strutils.nim");
				LOC16 = (last_131416 < HEX3Atmp_131414->Sup.len);
				if (!(LOC16)) goto LA17;
				nimln(263, "strutils.nim");
				nimln(263, "strutils.nim");
				if ((NU)(last_131416) > (NU)(HEX3Atmp_131414->Sup.len)) raiseIndexError();
				LOC16 = !(((NU8)(HEX3Atmp_131414->data[last_131416]) == (NU8)(58)));
				LA17: ;
				if (!LOC16) goto LA15;
				nimln(263, "strutils.nim");
				last_131416 = addInt(last_131416, 1);
			} LA15: ;
			nimln(264, "strutils.nim");
			nimln(264, "strutils.nim");
			nimln(264, "strutils.nim");
			TMP396 = subInt(last_131416, 1);
			dir_131413 = copyStrLast(HEX3Atmp_131414, first_131418, (NI32)(TMP396));
			nimln(66, "koch.nim");
			{
				NimStringDesc* LOC20;
				NIM_BOOL LOC21;
				nimln(66, "koch.nim");
				nimln(66, "koch.nim");
				LOC20 = 0;
				LOC20 = HEX2F_107477(dir_131413, nimrod);
				LOC21 = 0;
				LOC21 = nosexistsFile(LOC20);
				if (!LOC21) goto LA22;
				nimln(66, "koch.nim");
				nimln(66, "koch.nim");
				result = HEX2F_107477(dir_131413, nimrod);
				goto BeforeRet;
			}
			LA22: ;
			nimln(265, "strutils.nim");
			last_131416 = addInt(last_131416, 1);
		} LA14: ;
	}
	LA12: ;
	nimln(68, "koch.nim");
	nimln(68, "koch.nim");
	result = copyString(nimrod);
	goto BeforeRet;
	BeforeRet: ;
	popFrame();
	return result;
}

N_NIMCALL(void, exec_131423)(NimStringDesc* cmd) {
	nimfr("exec", "koch.nim")
	nimln(71, "koch.nim");
	printf("%s\012", (cmd)->data);
	nimln(72, "koch.nim");
	{
		NI LOC3;
		nimln(72, "koch.nim");
		nimln(72, "koch.nim");
		nimln(72, "koch.nim");
		LOC3 = 0;
		LOC3 = nosexecShellCmd(cmd);
		if (!!((LOC3 == 0))) goto LA4;
		nimln(72, "koch.nim");
		quit_79030(((NimStringDesc*) &TMP397), 1);
	}
	LA4: ;
	popFrame();
}

N_NIMCALL(NIM_BOOL, tryexec_131428)(NimStringDesc* cmd) {
	NIM_BOOL result;
	NI LOC1;
	nimfr("tryExec", "koch.nim")
	result = 0;
	nimln(75, "koch.nim");
	printf("%s\012", (cmd)->data);
	nimln(76, "koch.nim");
	nimln(76, "koch.nim");
	nimln(76, "koch.nim");
	LOC1 = 0;
	LOC1 = nosexecShellCmd(cmd);
	result = (LOC1 == 0);
	popFrame();
	return result;
}

N_NIMCALL(void, csource_131436)(NimStringDesc* args) {
	TY131441 LOC1;
	NimStringDesc* LOC2;
	nimfr("csource", "koch.nim")
	nimln(82, "koch.nim");
	nimln(82, "koch.nim");
	memset((void*)LOC1, 0, sizeof(LOC1));
	LOC1[0] = copyString(args);
	LOC1[1] = copyString(((NimStringDesc*) &TMP416));
	LOC1[2] = copyString(((NimStringDesc*) &TMP417));
	nimln(83, "koch.nim");
	LOC1[3] = findnim_131409();
	LOC2 = 0;
	LOC2 = nsuFormatOpenArray(((NimStringDesc*) &TMP415), LOC1, 4);
	exec_131423(LOC2);
	popFrame();
}

N_NIMCALL(void, zip_131445)(NimStringDesc* args) {
	TY127892 LOC1;
	NimStringDesc* LOC2;
	nimfr("zip", "koch.nim")
	nimln(86, "koch.nim");
	nimln(86, "koch.nim");
	memset((void*)LOC1, 0, sizeof(LOC1));
	LOC1[0] = copyString(((NimStringDesc*) &TMP416));
	LOC1[1] = copyString(((NimStringDesc*) &TMP417));
	nimln(87, "koch.nim");
	LOC1[2] = findnim_131409();
	LOC2 = 0;
	LOC2 = nsuFormatOpenArray(((NimStringDesc*) &TMP418), LOC1, 3);
	exec_131423(LOC2);
	popFrame();
}

N_NIMCALL(void, buildtool_131454)(NimStringDesc* toolname, NimStringDesc* args) {
	TY127892 LOC1;
	NimStringDesc* LOC2;
	NimStringDesc* LOC3;
	TY107700 LOC4;
	NimStringDesc* LOC5;
	NimStringDesc* LOC6;
	nimfr("buildTool", "koch.nim")
	nimln(90, "koch.nim");
	nimln(90, "koch.nim");
	memset((void*)LOC1, 0, sizeof(LOC1));
	nimln(90, "koch.nim");
	LOC1[0] = findnim_131409();
	LOC1[1] = copyString(args);
	LOC1[2] = copyString(toolname);
	LOC2 = 0;
	LOC2 = nsuFormatOpenArray(((NimStringDesc*) &TMP419), LOC1, 3);
	exec_131423(LOC2);
	nimln(91, "koch.nim");
	nimln(91, "koch.nim");
	LOC3 = 0;
	LOC3 = exe_131403(toolname);
	nimln(91, "koch.nim");
	nimln(91, "koch.nim");
	nimln(91, "koch.nim");
	memset((void*)&LOC4, 0, sizeof(LOC4));
	nossplitFile(toolname, &LOC4);
	LOC5 = 0;
	LOC5 = exe_131403(LOC4.Field1);
	LOC6 = 0;
	LOC6 = HEX2F_107477(((NimStringDesc*) &TMP393), LOC5);
	noscopyFile(LOC3, LOC6);
	popFrame();
}

N_NIMCALL(void, inno_131464)(NimStringDesc* args) {
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	NimStringDesc* LOC3;
	nimfr("inno", "koch.nim")
	nimln(95, "koch.nim");
	buildtool_131454(((NimStringDesc*) &TMP426), args);
	nimln(96, "koch.nim");
	buildtool_131454(((NimStringDesc*) &TMP427), args);
	nimln(97, "koch.nim");
	buildtool_131454(((NimStringDesc*) &TMP428), args);
	nimln(98, "koch.nim");
	nimln(98, "koch.nim");
	nimln(98, "koch.nim");
	nimln(98, "koch.nim");
	LOC1 = 0;
	LOC1 = HEX2F_107477(((NimStringDesc*) &TMP430), ((NimStringDesc*) &TMP431));
	LOC2 = 0;
	LOC2 = HEX2F_107477(LOC1, ((NimStringDesc*) &TMP432));
	LOC3 = 0;
	LOC3 = nsuFormatSingleElem(LOC2, ((NimStringDesc*) &TMP416));
	exec_131423(LOC3);
	popFrame();
}

N_NIMCALL(void, install_131469)(NimStringDesc* args) {
	TY127892 LOC1;
	NimStringDesc* LOC2;
	NimStringDesc* LOC3;
	nimfr("install", "koch.nim")
	nimln(102, "koch.nim");
	nimln(102, "koch.nim");
	memset((void*)LOC1, 0, sizeof(LOC1));
	nimln(103, "koch.nim");
	LOC1[0] = findnim_131409();
	LOC1[1] = copyString(((NimStringDesc*) &TMP417));
	LOC1[2] = copyString(((NimStringDesc*) &TMP416));
	LOC2 = 0;
	LOC2 = nsuFormatOpenArray(((NimStringDesc*) &TMP433), LOC1, 3);
	exec_131423(LOC2);
	nimln(104, "koch.nim");
	nimln(104, "koch.nim");
	LOC3 = 0;
	LOC3 = nsuFormatSingleElem(((NimStringDesc*) &TMP434), args);
	exec_131423(LOC3);
	popFrame();
}

N_NIMCALL(void, web_131478)(NimStringDesc* args) {
	TY131483 LOC1;
	NimStringDesc* LOC2;
	nimfr("web", "koch.nim")
	nimln(107, "koch.nim");
	nimln(107, "koch.nim");
	memset((void*)LOC1, 0, sizeof(LOC1));
	nimln(108, "koch.nim");
	LOC1[0] = findnim_131409();
	LOC1[1] = copyString(((NimStringDesc*) &TMP416));
	LOC2 = 0;
	LOC2 = nsuFormatOpenArray(((NimStringDesc*) &TMP435), LOC1, 2);
	exec_131423(LOC2);
	popFrame();
}

N_NIMCALL(NimStringDesc*, findstartnimrod_131490)(void) {
	NimStringDesc* result;
	NimStringDesc* nimrod;
	NimStringDesc* dir_131494;
	NimStringDesc* HEX3Atmp_131602;
	NI last_131604;
	nimfr("findStartNimrod", "koch.nim")
	result = 0;
	nimln(120, "koch.nim");
	nimrod = exe_131403(((NimStringDesc*) &TMP391));
	nimln(121, "koch.nim");
	result = HEX2F_107477(((NimStringDesc*) &TMP393), nimrod);
	nimln(122, "koch.nim");
	{
		NIM_BOOL LOC3;
		nimln(122, "koch.nim");
		LOC3 = 0;
		LOC3 = nosexistsFile(result);
		if (!LOC3) goto LA4;
		nimln(122, "koch.nim");
		goto BeforeRet;
	}
	LA4: ;
	dir_131494 = 0;
	HEX3Atmp_131602 = 0;
	nimln(123, "koch.nim");
	HEX3Atmp_131602 = getenv_110426(((NimStringDesc*) &TMP394));
	nimln(257, "strutils.nim");
	last_131604 = 0;
	nimln(258, "strutils.nim");
	{
		if (!NIM_FALSE) goto LA8;
		nimln(258, "strutils.nim");
		failedassertimpl_79821(((NimStringDesc*) &TMP395));
	}
	LA8: ;
	nimln(259, "strutils.nim");
	{
		nimln(259, "strutils.nim");
		nimln(259, "strutils.nim");
		if (!(0 < HEX3Atmp_131602->Sup.len)) goto LA12;
		nimln(261, "strutils.nim");
		while (1) {
			NI first_131606;
			NI TMP436;
			nimln(261, "strutils.nim");
			nimln(261, "strutils.nim");
			if (!(last_131604 <= HEX3Atmp_131602->Sup.len)) goto LA14;
			nimln(262, "strutils.nim");
			first_131606 = last_131604;
			nimln(263, "strutils.nim");
			while (1) {
				NIM_BOOL LOC16;
				nimln(263, "strutils.nim");
				LOC16 = 0;
				nimln(263, "strutils.nim");
				nimln(263, "strutils.nim");
				LOC16 = (last_131604 < HEX3Atmp_131602->Sup.len);
				if (!(LOC16)) goto LA17;
				nimln(263, "strutils.nim");
				nimln(263, "strutils.nim");
				if ((NU)(last_131604) > (NU)(HEX3Atmp_131602->Sup.len)) raiseIndexError();
				LOC16 = !(((NU8)(HEX3Atmp_131602->data[last_131604]) == (NU8)(58)));
				LA17: ;
				if (!LOC16) goto LA15;
				nimln(263, "strutils.nim");
				last_131604 = addInt(last_131604, 1);
			} LA15: ;
			nimln(264, "strutils.nim");
			nimln(264, "strutils.nim");
			nimln(264, "strutils.nim");
			TMP436 = subInt(last_131604, 1);
			dir_131494 = copyStrLast(HEX3Atmp_131602, first_131606, (NI32)(TMP436));
			nimln(124, "koch.nim");
			{
				NimStringDesc* LOC20;
				NIM_BOOL LOC21;
				nimln(124, "koch.nim");
				nimln(124, "koch.nim");
				LOC20 = 0;
				LOC20 = HEX2F_107477(dir_131494, nimrod);
				LOC21 = 0;
				LOC21 = nosexistsFile(LOC20);
				if (!LOC21) goto LA22;
				nimln(124, "koch.nim");
				nimln(124, "koch.nim");
				result = HEX2F_107477(dir_131494, nimrod);
				goto BeforeRet;
			}
			LA22: ;
			nimln(265, "strutils.nim");
			last_131604 = addInt(last_131604, 1);
		} LA14: ;
	}
	LA12: ;
	nimln(127, "koch.nim");
	{
		NIM_BOOL LOC26;
		nimln(127, "koch.nim");
		LOC26 = 0;
		LOC26 = nosexistsFile(((NimStringDesc*) &TMP437));
		if (!LOC26) goto LA27;
		nimln(128, "koch.nim");
		{
			NIM_BOOL LOC31;
			nimln(128, "koch.nim");
			LOC31 = 0;
			LOC31 = tryexec_131428(((NimStringDesc*) &TMP438));
			if (!LOC31) goto LA32;
			nimln(128, "koch.nim");
			nimln(128, "koch.nim");
			result = HEX2F_107477(((NimStringDesc*) &TMP393), nimrod);
			goto BeforeRet;
		}
		LA32: ;
	}
	LA27: ;
	nimln(134, "koch.nim");
	printf("%s\012", (((NimStringDesc*) &TMP439))->data);
	nimln(135, "koch.nim");
	quit_79030(((NimStringDesc*) &TMP397), 1);
	BeforeRet: ;
	popFrame();
	return result;
}

N_NIMCALL(void, saferemove_131611)(NimStringDesc* filename) {
	nimfr("safeRemove", "koch.nim")
	nimln(138, "koch.nim");
	{
		NIM_BOOL LOC3;
		nimln(138, "koch.nim");
		LOC3 = 0;
		LOC3 = nosexistsFile(filename);
		if (!LOC3) goto LA4;
		nimln(138, "koch.nim");
		nosremoveFile(filename);
	}
	LA4: ;
	popFrame();
}

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*, thversion_131616)(NI i) {
	NimStringDesc* result;
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	NimStringDesc* LOC3;
	nimfr("thVersion", "koch.nim")
	result = 0;
	nimln(141, "koch.nim");
	nimln(141, "koch.nim");
	LOC1 = 0;
	nimln(141, "koch.nim");
	LOC2 = 0;
	LOC2 = HEX2F_107477(((NimStringDesc*) &TMP440), ((NimStringDesc*) &TMP391));
	nimln(141, "koch.nim");
	LOC3 = 0;
	LOC3 = nimIntToStr(i);
	LOC1 = rawNewString(LOC2->Sup.len + LOC3->Sup.len + 0);
appendString(LOC1, LOC2);
appendString(LOC1, LOC3);
	result = exe_131403(LOC1);
	popFrame();
	return result;
}

N_NIMCALL(void, copyexe_131622)(NimStringDesc* source, NimStringDesc* dest) {
	nimfr("copyExe", "koch.nim")
	nimln(144, "koch.nim");
	saferemove_131611(dest);
	nimln(145, "koch.nim");
	noscopyFile(source, dest);
	nimln(146, "koch.nim");
	nosinclFilePermissions(dest, 1);
	popFrame();
}

N_NIMCALL(void, boot_131629)(NimStringDesc* args) {
	NimStringDesc* output;
	NimStringDesc* LOC1;
	NimStringDesc* finaldest;
	NimStringDesc* LOC2;
	NimStringDesc* LOC3;
	NimStringDesc* LOC4;
	NI i_131644;
	NI res_131802;
	nimfr("boot", "koch.nim")
	nimln(149, "koch.nim");
	nimln(149, "koch.nim");
	LOC1 = 0;
	LOC1 = exe_131403(((NimStringDesc*) &TMP391));
	output = HEX2F_107477(((NimStringDesc*) &TMP440), LOC1);
	nimln(150, "koch.nim");
	nimln(150, "koch.nim");
	LOC2 = 0;
	LOC2 = exe_131403(((NimStringDesc*) &TMP391));
	finaldest = HEX2F_107477(((NimStringDesc*) &TMP393), LOC2);
	nimln(152, "koch.nim");
	nimln(152, "koch.nim");
	LOC3 = 0;
	LOC3 = findstartnimrod_131490();
	nimln(152, "koch.nim");
	LOC4 = 0;
	LOC4 = thversion_131616(0);
	copyexe_131622(LOC3, LOC4);
	i_131644 = 0;
	nimln(1458, "system.nim");
	res_131802 = 0;
	nimln(1459, "system.nim");
	while (1) {
		NI TMP442;
		NimStringDesc* LOC6;
		NimStringDesc* LOC7;
		NimStringDesc* LOC8;
		NimStringDesc* LOC9;
		TY131483 LOC10;
		NimStringDesc* LOC11;
		NI TMP446;
		NimStringDesc* LOC18;
		nimln(1459, "system.nim");
		if (!(res_131802 <= 2)) goto LA5;
		nimln(1458, "system.nim");
		i_131644 = res_131802;
		nimln(154, "koch.nim");
		nimln(154, "koch.nim");
		nimln(154, "koch.nim");
		TMP442 = addInt(i_131644, 1);
		LOC6 = 0;
		LOC6 = nimIntToStr((NI32)(TMP442));
		printf("%s%s\012", (((NimStringDesc*) &TMP441))->data, (LOC6)->data);
		nimln(155, "koch.nim");
		nimln(155, "koch.nim");
		LOC7 = 0;
		nimln(155, "koch.nim");
		LOC8 = 0;
		LOC8 = thversion_131616(i_131644);
		nimln(155, "koch.nim");
		nimln(155, "koch.nim");
		LOC9 = 0;
		LOC9 = HEX2F_107477(((NimStringDesc*) &TMP443), ((NimStringDesc*) &TMP444));
		memset((void*)LOC10, 0, sizeof(LOC10));
		LOC10[0] = copyString(((NimStringDesc*) &TMP390));
		LOC10[1] = copyString(args);
		LOC11 = 0;
		LOC11 = nsuFormatOpenArray(LOC9, LOC10, 2);
		LOC7 = rawNewString(LOC8->Sup.len + LOC11->Sup.len + 0);
appendString(LOC7, LOC8);
appendString(LOC7, LOC11);
		exec_131423(LOC7);
		nimln(156, "koch.nim");
		{
			NimStringDesc* LOC14;
			NIM_BOOL LOC15;
			nimln(156, "koch.nim");
			nimln(156, "koch.nim");
			LOC14 = 0;
			LOC14 = thversion_131616(i_131644);
			LOC15 = 0;
			LOC15 = nossameFileContent(output, LOC14);
			if (!LOC15) goto LA16;
			nimln(157, "koch.nim");
			copyexe_131622(output, finaldest);
			nimln(158, "koch.nim");
			printf("%s\012", (((NimStringDesc*) &TMP445))->data);
			nimln(159, "koch.nim");
			goto BeforeRet;
		}
		LA16: ;
		nimln(160, "koch.nim");
		nimln(160, "koch.nim");
		nimln(160, "koch.nim");
		TMP446 = addInt(i_131644, 1);
		LOC18 = 0;
		LOC18 = thversion_131616((NI32)(TMP446));
		copyexe_131622(output, LOC18);
		nimln(1461, "system.nim");
		res_131802 = addInt(res_131802, 1);
	} LA5: ;
	nimln(161, "koch.nim");
	copyexe_131622(output, finaldest);
	nimln(162, "koch.nim");
	printf("%s\012", (((NimStringDesc*) &TMP447))->data);
	BeforeRet: ;
	popFrame();
}

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

static N_INLINE(NI, find_131837)(NimStringDesc** a_131842, NI a_131842Len0, NimStringDesc* item_131844) {
	NI result;
	NimStringDesc* i_131857;
	NI i_131875;
	nimfr("find", "system.nim")
	result = 0;
	i_131857 = 0;
	nimln(1531, "system.nim");
	i_131875 = 0;
	nimln(1532, "system.nim");
	while (1) {
		nimln(1532, "system.nim");
		nimln(1532, "system.nim");
		if (!(i_131875 < a_131842Len0)) goto LA1;
		nimln(1533, "system.nim");
		if ((NU)(i_131875) >= (NU)(a_131842Len0)) raiseIndexError();
		i_131857 = a_131842[i_131875];
		nimln(1680, "system.nim");
		{
			nimln(1680, "system.nim");
			if (!eqStrings(i_131857, item_131844)) goto LA4;
			nimln(1680, "system.nim");
			goto BeforeRet;
		}
		LA4: ;
		nimln(1681, "system.nim");
		result = addInt(result, 1);
		nimln(1534, "system.nim");
		i_131875 = addInt(i_131875, 1);
	} LA1: ;
	nimln(1682, "system.nim");
	result = -1;
	BeforeRet: ;
	popFrame();
	return result;
}

static N_INLINE(NIM_BOOL, contains_131825)(NimStringDesc** a_131831, NI a_131831Len0, NimStringDesc* item_131834) {
	NIM_BOOL result;
	NI LOC1;
	nimfr("contains", "system.nim")
	result = 0;
	nimln(1687, "system.nim");
	nimln(1687, "system.nim");
	nimln(1687, "system.nim");
	nimln(1687, "system.nim");
	LOC1 = 0;
	LOC1 = find_131837(a_131831, a_131831Len0, item_131834);
	result = (0 <= LOC1);
	goto BeforeRet;
	BeforeRet: ;
	popFrame();
	return result;
}

N_NIMCALL(void, cleanaux_131815)(NimStringDesc* dir_131817) {
	NU8 kind_131818;
	NimStringDesc* path_131819;
	DIR* d_131893;
	nimfr("cleanAux", "koch.nim")
	kind_131818 = 0;
	path_131819 = 0;
	nimln(1262, "os.nim");
	d_131893 = opendir(dir_131817->data);
	nimln(1263, "os.nim");
	{
		int LOC54;
		nimln(1263, "os.nim");
		nimln(1263, "os.nim");
		if (!!((d_131893 == NIM_NIL))) goto LA3;
		nimln(1264, "os.nim");
		while (1) {
			struct dirent* x_131895;
			NimStringDesc* y_131897;
			nimln(1265, "os.nim");
			x_131895 = readdir(d_131893);
			nimln(1266, "os.nim");
			{
				nimln(1266, "os.nim");
				if (!(x_131895 == NIM_NIL)) goto LA8;
				nimln(1266, "os.nim");
				goto LA5;
			}
			LA8: ;
			nimln(1267, "os.nim");
			nimln(1267, "os.nim");
			y_131897 = cstrToNimstr(((NCSTRING) ((*x_131895).d_name)));
			nimln(1268, "os.nim");
			{
				NIM_BOOL LOC12;
				struct stat s_131899;
				NU8 k_131901;
				nimln(1268, "os.nim");
				LOC12 = 0;
				nimln(1268, "os.nim");
				nimln(1268, "os.nim");
				LOC12 = !(eqStrings(y_131897, ((NimStringDesc*) &TMP471)));
				if (!(LOC12)) goto LA13;
				nimln(1268, "os.nim");
				nimln(1268, "os.nim");
				LOC12 = !(eqStrings(y_131897, ((NimStringDesc*) &TMP472)));
				LA13: ;
				if (!LOC12) goto LA14;
				memset((void*)&s_131899, 0, sizeof(s_131899));
				nimln(1270, "os.nim");
				y_131897 = HEX2F_107477(dir_131817, y_131897);
				nimln(1271, "os.nim");
				{
					int LOC18;
					nimln(1271, "os.nim");
					nimln(1271, "os.nim");
					LOC18 = 0;
					LOC18 = lstat(y_131897->data, &s_131899);
					if (!(LOC18 < ((NI32) 0))) goto LA19;
					nimln(1271, "os.nim");
					goto LA5;
				}
				LA19: ;
				nimln(1272, "os.nim");
				k_131901 = ((NU8) 0);
				nimln(1273, "os.nim");
				{
					NIM_BOOL LOC23;
					nimln(1273, "os.nim");
					LOC23 = 0;
					LOC23 = S_ISDIR(s_131899.st_mode);
					if (!LOC23) goto LA24;
					nimln(1273, "os.nim");
					k_131901 = ((NU8) 2);
				}
				LA24: ;
				nimln(1274, "os.nim");
				{
					NIM_BOOL LOC28;
					nimln(1274, "os.nim");
					LOC28 = 0;
					LOC28 = S_ISLNK(s_131899.st_mode);
					if (!LOC28) goto LA29;
					nimln(1274, "os.nim");
					nimln(1274, "os.nim");
					k_131901 = addInt(k_131901, 1);
				}
				LA29: ;
				nimln(1272, "os.nim");
				kind_131818 = k_131901;
				nimln(1267, "os.nim");
				path_131819 = y_131897;
				nimln(178, "koch.nim");
				switch (kind_131818) {
				case ((NU8) 0):
				{
					TY107700 LOC32;
					NimStringDesc* dir;
					NimStringDesc* name;
					NimStringDesc* ext;
					nimln(180, "koch.nim");
					nimln(180, "koch.nim");
					memset((void*)&LOC32, 0, sizeof(LOC32));
					nossplitFile(path_131819, &LOC32);
					dir = copyString(LOC32.Field0);
					name = copyString(LOC32.Field1);
					ext = copyString(LOC32.Field2);
					nimln(181, "koch.nim");
					{
						NIM_BOOL LOC35;
						nimln(181, "koch.nim");
						LOC35 = 0;
						nimln(181, "koch.nim");
						LOC35 = ((ext) && (ext)->Sup.len == 0);
						if (LOC35) goto LA36;
						nimln(181, "koch.nim");
						LOC35 = contains_131825(TMP473, 18, ext);
						LA36: ;
						if (!LOC35) goto LA37;
						nimln(182, "koch.nim");
						{
							NIM_BOOL LOC41;
							nimln(182, "koch.nim");
							nimln(182, "koch.nim");
							LOC41 = 0;
							LOC41 = contains_131825(TMP474, 6, name);
							if (!!(LOC41)) goto LA42;
							nimln(183, "koch.nim");
							printf("%s%s\012", (((NimStringDesc*) &TMP475))->data, (path_131819)->data);
							nimln(184, "koch.nim");
							nosremoveFile(path_131819);
						}
						LA42: ;
					}
					LA37: ;
				}
				break;
				case ((NU8) 2):
				{
					TY93105 LOC45;
					nimln(186, "koch.nim");
					nimln(186, "koch.nim");
					memset((void*)&LOC45, 0, sizeof(LOC45));
					nossplitPath(path_131819, &LOC45);
					if (eqStrings(LOC45.Field1, ((NimStringDesc*) &TMP479))) goto LA46;
					if (eqStrings(LOC45.Field1, ((NimStringDesc*) &TMP480))) goto LA47;
					if (eqStrings(LOC45.Field1, ((NimStringDesc*) &TMP481))) goto LA47;
					if (eqStrings(LOC45.Field1, ((NimStringDesc*) &TMP482))) goto LA47;
					goto LA48;
					LA46: ;
					{
						nimln(188, "koch.nim");
						printf("%s%s\012", (((NimStringDesc*) &TMP483))->data, (path_131819)->data);
						nimln(189, "koch.nim");
						nosremoveDir(path_131819);
					}
					goto LA49;
					LA47: ;
					{
					}
					goto LA49;
					LA48: ;
					{
						nimln(191, "koch.nim");
						cleanaux_131815(path_131819);
					}
					LA49: ;
				}
				break;
				default:
				{
				}
				break;
				}
			}
			LA14: ;
		} LA5: ;
		nimln(1276, "os.nim");
		nimln(1276, "os.nim");
		LOC54 = 0;
		LOC54 = closedir(d_131893);
	}
	LA3: ;
	popFrame();
}

N_NIMCALL(void, removepattern_131905)(NimStringDesc* pattern) {
	NimStringDesc* f_131908;
	glob_t f_131910;
	NI res_131912;
	int LOC1;
	nimfr("removePattern", "koch.nim")
	f_131908 = 0;
	memset((void*)&f_131910, 0, sizeof(f_131910));
	res_131912 = 0;
	nimln(1208, "os.nim");
	f_131910.gl_offs = 0;
	nimln(1209, "os.nim");
	f_131910.gl_pathc = 0;
	nimln(1210, "os.nim");
	f_131910.gl_pathv = NIM_NIL;
	nimln(1211, "os.nim");
	nimln(1211, "os.nim");
	LOC1 = 0;
	LOC1 = glob(pattern->data, ((int) 0), NIM_NIL, &f_131910);
	res_131912 = ((NI) (LOC1));
	nimln(1212, "os.nim");
	{
		NI i_131914;
		NI HEX3Atmp_131916;
		NI TMP486;
		NI res_131918;
		nimln(1212, "os.nim");
		if (!(res_131912 == 0)) goto LA4;
		i_131914 = 0;
		HEX3Atmp_131916 = 0;
		nimln(1213, "os.nim");
		nimln(1213, "os.nim");
		TMP486 = subInt(f_131910.gl_pathc, 1);
		HEX3Atmp_131916 = (NI32)(TMP486);
		nimln(1458, "system.nim");
		res_131918 = 0;
		nimln(1459, "system.nim");
		while (1) {
			nimln(1459, "system.nim");
			if (!(res_131918 <= HEX3Atmp_131916)) goto LA6;
			nimln(1458, "system.nim");
			i_131914 = res_131918;
			nimln(1214, "os.nim");
			{
				nimln(1214, "os.nim");
				nimln(1214, "os.nim");
				nimln(1214, "os.nim");
				if ((NU)(i_131914) > (NU)(50000)) raiseIndexError();
				if (!!(!((f_131910.gl_pathv[(i_131914)- 0] == NIM_NIL)))) goto LA9;
				nimln(1214, "os.nim");
				failedassertimpl_79821(((NimStringDesc*) &TMP487));
			}
			LA9: ;
			nimln(1215, "os.nim");
			nimln(1215, "os.nim");
			if ((NU)(i_131914) > (NU)(50000)) raiseIndexError();
			f_131908 = cstrToNimstr(f_131910.gl_pathv[(i_131914)- 0]);
			nimln(196, "koch.nim");
			printf("%s%s\012", (((NimStringDesc*) &TMP475))->data, (f_131908)->data);
			nimln(197, "koch.nim");
			nosremoveFile(f_131908);
			nimln(1461, "system.nim");
			res_131918 = addInt(res_131918, 1);
		} LA6: ;
	}
	LA4: ;
	nimln(1216, "os.nim");
	globfree(&f_131910);
	popFrame();
}

N_NIMCALL(void, clean_131922)(NimStringDesc* args) {
	NimStringDesc* LOC6;
	NU8 kind_131925;
	NimStringDesc* path_131926;
	NimStringDesc* HEX3Atmp_131936;
	NimStringDesc* LOC7;
	DIR* d_131938;
	nimfr("clean", "koch.nim")
	nimln(200, "koch.nim");
	{
		NIM_BOOL LOC3;
		nimln(200, "koch.nim");
		LOC3 = 0;
		LOC3 = nosexistsFile(((NimStringDesc*) &TMP488));
		if (!LOC3) goto LA4;
		nimln(200, "koch.nim");
		nosremoveFile(((NimStringDesc*) &TMP488));
	}
	LA4: ;
	nimln(201, "koch.nim");
	removepattern_131905(((NimStringDesc*) &TMP489));
	nimln(202, "koch.nim");
	removepattern_131905(((NimStringDesc*) &TMP490));
	nimln(203, "koch.nim");
	nimln(203, "koch.nim");
	LOC6 = 0;
	LOC6 = nosgetCurrentDir();
	cleanaux_131815(LOC6);
	kind_131925 = 0;
	path_131926 = 0;
	HEX3Atmp_131936 = 0;
	nimln(204, "koch.nim");
	nimln(204, "koch.nim");
	LOC7 = 0;
	LOC7 = nosgetCurrentDir();
	HEX3Atmp_131936 = HEX2F_107477(LOC7, ((NimStringDesc*) &TMP491));
	nimln(1262, "os.nim");
	d_131938 = opendir(HEX3Atmp_131936->data);
	nimln(1263, "os.nim");
	{
		int LOC42;
		nimln(1263, "os.nim");
		nimln(1263, "os.nim");
		if (!!((d_131938 == NIM_NIL))) goto LA10;
		nimln(1264, "os.nim");
		while (1) {
			struct dirent* x_131940;
			NimStringDesc* y_131942;
			nimln(1265, "os.nim");
			x_131940 = readdir(d_131938);
			nimln(1266, "os.nim");
			{
				nimln(1266, "os.nim");
				if (!(x_131940 == NIM_NIL)) goto LA15;
				nimln(1266, "os.nim");
				goto LA12;
			}
			LA15: ;
			nimln(1267, "os.nim");
			nimln(1267, "os.nim");
			y_131942 = cstrToNimstr(((NCSTRING) ((*x_131940).d_name)));
			nimln(1268, "os.nim");
			{
				NIM_BOOL LOC19;
				struct stat s_131944;
				NU8 k_131946;
				nimln(1268, "os.nim");
				LOC19 = 0;
				nimln(1268, "os.nim");
				nimln(1268, "os.nim");
				LOC19 = !(eqStrings(y_131942, ((NimStringDesc*) &TMP471)));
				if (!(LOC19)) goto LA20;
				nimln(1268, "os.nim");
				nimln(1268, "os.nim");
				LOC19 = !(eqStrings(y_131942, ((NimStringDesc*) &TMP472)));
				LA20: ;
				if (!LOC19) goto LA21;
				memset((void*)&s_131944, 0, sizeof(s_131944));
				nimln(1270, "os.nim");
				y_131942 = HEX2F_107477(HEX3Atmp_131936, y_131942);
				nimln(1271, "os.nim");
				{
					int LOC25;
					nimln(1271, "os.nim");
					nimln(1271, "os.nim");
					LOC25 = 0;
					LOC25 = lstat(y_131942->data, &s_131944);
					if (!(LOC25 < ((NI32) 0))) goto LA26;
					nimln(1271, "os.nim");
					goto LA12;
				}
				LA26: ;
				nimln(1272, "os.nim");
				k_131946 = ((NU8) 0);
				nimln(1273, "os.nim");
				{
					NIM_BOOL LOC30;
					nimln(1273, "os.nim");
					LOC30 = 0;
					LOC30 = S_ISDIR(s_131944.st_mode);
					if (!LOC30) goto LA31;
					nimln(1273, "os.nim");
					k_131946 = ((NU8) 2);
				}
				LA31: ;
				nimln(1274, "os.nim");
				{
					NIM_BOOL LOC35;
					nimln(1274, "os.nim");
					LOC35 = 0;
					LOC35 = S_ISLNK(s_131944.st_mode);
					if (!LOC35) goto LA36;
					nimln(1274, "os.nim");
					nimln(1274, "os.nim");
					k_131946 = addInt(k_131946, 1);
				}
				LA36: ;
				nimln(1272, "os.nim");
				kind_131925 = k_131946;
				nimln(1267, "os.nim");
				path_131926 = y_131942;
				nimln(205, "koch.nim");
				{
					nimln(205, "koch.nim");
					if (!(kind_131925 == ((NU8) 2))) goto LA40;
					nimln(206, "koch.nim");
					printf("%s%s\012", (((NimStringDesc*) &TMP483))->data, (path_131926)->data);
					nimln(207, "koch.nim");
					nosremoveDir(path_131926);
				}
				LA40: ;
			}
			LA21: ;
		} LA12: ;
		nimln(1276, "os.nim");
		nimln(1276, "os.nim");
		LOC42 = 0;
		LOC42 = closedir(d_131938);
	}
	LA10: ;
	popFrame();
}

N_NIMCALL(void, tests_132009)(NimStringDesc* args) {
	NimStringDesc* tester;
	NimStringDesc* LOC1;
	NimStringDesc* LOC2;
	NimStringDesc* LOC3;
	NimStringDesc* LOC4;
	NimStringDesc* LOC5;
	NimStringDesc* LOC11;
	nimfr("tests", "koch.nim")
	nimln(277, "koch.nim");
	exec_131423(((NimStringDesc*) &TMP492));
	nimln(278, "koch.nim");
	nimln(278, "koch.nim");
	nimln(278, "koch.nim");
	LOC1 = 0;
	LOC1 = nosgetCurrentDir();
	nimln(278, "koch.nim");
	LOC2 = 0;
	LOC2 = exe_131403(((NimStringDesc*) &TMP493));
	LOC3 = 0;
	LOC3 = HEX2F_107477(LOC1, LOC2);
	tester = nospquoteShell(LOC3);
	nimln(279, "koch.nim");
	nimln(279, "koch.nim");
	LOC4 = 0;
	LOC5 = 0;
	nimln(272, "koch.nim");
	{
		nimln(272, "koch.nim");
		nimln(272, "koch.nim");
		if (!(0 < args->Sup.len)) goto LA8;
		LOC5 = copyString(args);
	}
	goto LA6;
	LA8: ;
	{
		LOC5 = copyString(((NimStringDesc*) &TMP495));
	}
	LA6: ;
	LOC4 = rawNewString(tester->Sup.len + LOC5->Sup.len + 1);
appendString(LOC4, tester);
appendString(LOC4, ((NimStringDesc*) &TMP494));
appendString(LOC4, LOC5);
	exec_131423(LOC4);
	nimln(280, "koch.nim");
	nimln(280, "koch.nim");
	LOC11 = 0;
	LOC11 = rawNewString(tester->Sup.len + 5);
appendString(LOC11, tester);
appendString(LOC11, ((NimStringDesc*) &TMP496));
	exec_131423(LOC11);
	popFrame();
}

N_NIMCALL(void, temp_132016)(NimStringDesc* args) {
	NimStringDesc* output;
	NimStringDesc* LOC1;
	NimStringDesc* finaldest;
	NimStringDesc* LOC2;
	NimStringDesc* LOC3;
	nimfr("temp", "koch.nim")
	nimln(283, "koch.nim");
	nimln(283, "koch.nim");
	LOC1 = 0;
	LOC1 = exe_131403(((NimStringDesc*) &TMP391));
	output = HEX2F_107477(((NimStringDesc*) &TMP440), LOC1);
	nimln(284, "koch.nim");
	nimln(284, "koch.nim");
	LOC2 = 0;
	LOC2 = exe_131403(((NimStringDesc*) &TMP497));
	finaldest = HEX2F_107477(((NimStringDesc*) &TMP393), LOC2);
	nimln(285, "koch.nim");
	nimln(285, "koch.nim");
	LOC3 = 0;
	LOC3 = HEX2F_107477(((NimStringDesc*) &TMP498), ((NimStringDesc*) &TMP391));
	exec_131423(LOC3);
	nimln(286, "koch.nim");
	copyexe_131622(output, finaldest);
	nimln(287, "koch.nim");
	{
		NimStringDesc* LOC8;
		nimln(287, "koch.nim");
		nimln(287, "koch.nim");
		if (!(0 < args->Sup.len)) goto LA6;
		nimln(287, "koch.nim");
		nimln(287, "koch.nim");
		LOC8 = 0;
		LOC8 = rawNewString(finaldest->Sup.len + args->Sup.len + 1);
appendString(LOC8, finaldest);
appendString(LOC8, ((NimStringDesc*) &TMP494));
appendString(LOC8, args);
		exec_131423(LOC8);
	}
	LA6: ;
	popFrame();
}

N_NIMCALL(void, showhelp_132024)(void) {
	TY127892 LOC1;
	NimStringDesc* LOC2;
	NimStringDesc* LOC3;
	NimStringDesc* LOC4;
	nimfr("showHelp", "koch.nim")
	nimln(290, "koch.nim");
	nimln(290, "koch.nim");
	memset((void*)LOC1, 0, sizeof(LOC1));
	nimln(290, "koch.nim");
	LOC2 = 0;
	nimln(290, "koch.nim");
	LOC3 = 0;
	LOC3 = nsuRepeatChar(39, 32);
	LOC2 = rawNewString(LOC3->Sup.len + 5);
appendString(LOC2, ((NimStringDesc*) &TMP416));
appendString(LOC2, LOC3);
	LOC1[0] = LOC2;
	LOC1[1] = copyString(((NimStringDesc*) &TMP500));
	LOC1[2] = copyString(((NimStringDesc*) &TMP501));
	LOC4 = 0;
	LOC4 = nsuFormatOpenArray(((NimStringDesc*) &TMP499), LOC1, 3);
	quit_79030(LOC4, 1);
	popFrame();
}

static N_INLINE(void, initStackBottom)(void) {
	void* volatile locals;
	locals = 0;
	locals = ((void*) (&locals));
	setStackBottom(locals);
}
void PreMain() {
	systemDatInit();
	systemInit();
	stdlibparseutilsDatInit();
	stdlibstrutilsDatInit();
	stdlibtimesDatInit();
	stdlibposixDatInit();
	stdlibosDatInit();
	stdlibparseoptDatInit();
	stdlibhashesDatInit();
	stdlibstrtabsDatInit();
	stdlibstreamsDatInit();
	stdliblinuxDatInit();
	stdlibosprocDatInit();
	kochDatInit();
	initStackBottom();
	stdlibparseutilsInit();
	stdlibstrutilsInit();
	stdlibtimesInit();
	stdlibposixInit();
	stdlibosInit();
	stdlibparseoptInit();
	stdlibhashesInit();
	stdlibstrtabsInit();
	stdlibstreamsInit();
	stdliblinuxInit();
	stdlibosprocInit();
}

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

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

N_NOINLINE(void, kochInit)(void) {
	nimfr("koch", "koch.nim")
	op_132034.Sup.m_type = (&NTI117807);
	nimln(293, "koch.nim");
	chckNil((void*)&op_132034);
	genericReset((void*)&op_132034, (&NTI117807));
	op_132034.Sup.m_type = (&NTI117807);
	initoptparser_117819(((NimStringDesc*) &TMP390), &op_132034);
	nimln(294, "koch.nim");
	nponext(&op_132034);
	nimln(295, "koch.nim");
	switch (op_132034.Kind) {
	case ((NU8) 2):
	case ((NU8) 3):
	{
		nimln(296, "koch.nim");
		showhelp_132024();
	}
	break;
	case ((NU8) 1):
	{
		NimStringDesc* LOC3;
		nimln(298, "koch.nim");
		nimln(298, "koch.nim");
		LOC3 = 0;
		LOC3 = nsuNormalize(op_132034.Key);
		switch (hashString(LOC3) & 15) {
		case 0: 
if (eqStrings(LOC3, ((NimStringDesc*) &TMP512))) goto LA7;
break;
		case 1: 
if (eqStrings(LOC3, ((NimStringDesc*) &TMP516))) goto LA11;
break;
		case 3: 
if (eqStrings(LOC3, ((NimStringDesc*) &TMP515))) goto LA10;
break;
		case 5: 
if (eqStrings(LOC3, ((NimStringDesc*) &TMP514))) goto LA9;
break;
		case 6: 
if (eqStrings(LOC3, ((NimStringDesc*) &TMP509))) goto LA5;
if (eqStrings(LOC3, ((NimStringDesc*) &TMP511))) goto LA7;
break;
		case 8: 
if (eqStrings(LOC3, ((NimStringDesc*) &TMP510))) goto LA6;
break;
		case 9: 
if (eqStrings(LOC3, ((NimStringDesc*) &TMP508))) goto LA4;
if (eqStrings(LOC3, ((NimStringDesc*) &TMP513))) goto LA8;
break;
		case 10: 
if (eqStrings(LOC3, ((NimStringDesc*) &TMP519))) goto LA13;
break;
		case 11: 
if (eqStrings(LOC3, ((NimStringDesc*) &TMP517))) goto LA11;
break;
		case 14: 
if (eqStrings(LOC3, ((NimStringDesc*) &TMP518))) goto LA12;
break;
		}
		goto LA14;
		LA4: ;
		{
			NimStringDesc* LOC17;
			nimln(299, "koch.nim");
			nimln(299, "koch.nim");
			LOC17 = 0;
			LOC17 = npocmdLineRest(&op_132034);
			boot_131629(LOC17);
		}
		goto LA15;
		LA5: ;
		{
			NimStringDesc* LOC19;
			nimln(300, "koch.nim");
			nimln(300, "koch.nim");
			LOC19 = 0;
			LOC19 = npocmdLineRest(&op_132034);
			clean_131922(LOC19);
		}
		goto LA15;
		LA6: ;
		{
			NimStringDesc* LOC21;
			nimln(301, "koch.nim");
			nimln(301, "koch.nim");
			LOC21 = 0;
			LOC21 = npocmdLineRest(&op_132034);
			web_131478(LOC21);
		}
		goto LA15;
		LA7: ;
		{
			NimStringDesc* LOC23;
			nimln(302, "koch.nim");
			nimln(302, "koch.nim");
			LOC23 = 0;
			LOC23 = npocmdLineRest(&op_132034);
			csource_131436(LOC23);
		}
		goto LA15;
		LA8: ;
		{
			NimStringDesc* LOC25;
			nimln(303, "koch.nim");
			nimln(303, "koch.nim");
			LOC25 = 0;
			LOC25 = npocmdLineRest(&op_132034);
			zip_131445(LOC25);
		}
		goto LA15;
		LA9: ;
		{
			NimStringDesc* LOC27;
			nimln(304, "koch.nim");
			nimln(304, "koch.nim");
			LOC27 = 0;
			LOC27 = npocmdLineRest(&op_132034);
			inno_131464(LOC27);
		}
		goto LA15;
		LA10: ;
		{
			NimStringDesc* LOC29;
			nimln(305, "koch.nim");
			nimln(305, "koch.nim");
			LOC29 = 0;
			LOC29 = npocmdLineRest(&op_132034);
			install_131469(LOC29);
		}
		goto LA15;
		LA11: ;
		{
			NimStringDesc* LOC31;
			nimln(306, "koch.nim");
			nimln(306, "koch.nim");
			LOC31 = 0;
			LOC31 = npocmdLineRest(&op_132034);
			tests_132009(LOC31);
		}
		goto LA15;
		LA12: ;
		{
			nimln(311, "koch.nim");
			quit_79030(((NimStringDesc*) &TMP520), 1);
		}
		goto LA15;
		LA13: ;
		{
			NimStringDesc* LOC34;
			nimln(312, "koch.nim");
			nimln(312, "koch.nim");
			LOC34 = 0;
			LOC34 = npocmdLineRest(&op_132034);
			temp_132016(LOC34);
		}
		goto LA15;
		LA14: ;
		{
			nimln(313, "koch.nim");
			showhelp_132024();
		}
		LA15: ;
	}
	break;
	case ((NU8) 0):
	{
		nimln(314, "koch.nim");
		showhelp_132024();
	}
	break;
	}
	popFrame();
}

N_NOINLINE(void, kochDatInit)(void) {
}

