/* Generated by Nim Compiler v0.12.0 */
/*   (c) 2015 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_INTBITS 32

#include "nimbase.h"
#include <setjmp.h>
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
typedef struct Tnode223809 Tnode223809;
typedef struct Ttype223847 Ttype223847;
typedef struct Tlineinfo188352 Tlineinfo188352;
typedef struct Tidobj196015 Tidobj196015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttypeseq223843 Ttypeseq223843;
typedef struct Tsym223841 Tsym223841;
typedef struct Tloc223823 Tloc223823;
typedef struct Ropeobj174009 Ropeobj174009;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tident196021 Tident196021;
typedef struct Tscope223835 Tscope223835;
typedef struct TY223944 TY223944;
typedef struct Tstrtable223813 Tstrtable223813;
typedef struct Tsymseq223811 Tsymseq223811;
typedef struct Tlib223827 Tlib223827;
typedef struct Cell48947 Cell48947;
typedef struct Cellseq48963 Cellseq48963;
typedef struct Gcheap51018 Gcheap51018;
typedef struct Gcstack51016 Gcstack51016;
typedef struct Cellset48959 Cellset48959;
typedef struct Pagedesc48955 Pagedesc48955;
typedef struct Memregion30890 Memregion30890;
typedef struct Smallchunk30842 Smallchunk30842;
typedef struct Llchunk30884 Llchunk30884;
typedef struct Bigchunk30844 Bigchunk30844;
typedef struct Intset30817 Intset30817;
typedef struct Trunk30813 Trunk30813;
typedef struct Avlnode30888 Avlnode30888;
typedef struct Gcstat51014 Gcstat51014;
typedef struct Tnodeseq223803 Tnodeseq223803;
typedef struct Exception Exception;
typedef struct TSafePoint TSafePoint;
typedef struct Processobj154404 Processobj154404;
typedef struct Stringtableobj144212 Stringtableobj144212;
typedef struct Streamobj148427 Streamobj148427;
typedef struct Tinstantiation223831 Tinstantiation223831;
typedef struct Tlistentry139022 Tlistentry139022;
typedef struct Basechunk30840 Basechunk30840;
typedef struct Freecell30832 Freecell30832;
typedef struct Keyvaluepairseq144210 Keyvaluepairseq144210;
typedef struct TY223932 TY223932;
typedef struct Keyvaluepair144208 Keyvaluepair144208;
struct  Tlineinfo188352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
typedef N_NIMCALL_PTR(void, TY3889) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3894) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3889 marker;
TY3894 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Tidobj196015  {
  TNimObject Sup;
NI id;
};
struct  Tloc223823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype223847* t;
Ropeobj174009* r;
Ropeobj174009* heaproot;
};
struct  Ttype223847  {
  Tidobj196015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq223843* sons;
Tnode223809* n;
Tsym223841* owner;
Tsym223841* sym;
Tsym223841* destructor;
Tsym223841* deepcopy;
Tsym223841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc223823 loc;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tstrtable223813  {
NI counter;
Tsymseq223811* data;
};
struct  Tsym223841  {
  Tidobj196015 Sup;
NU8 kind;
union{
struct {Ttypeseq223843* typeinstcache;
Tscope223835* typscope;
} S1;
struct {TY223944* procinstcache;
Tsym223841* gcunsafetyreason;
} S2;
struct {TY223944* usedgenerics;
Tstrtable223813 tab;
} S3;
struct {Tsym223841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype223847* typ;
Tident196021* name;
Tlineinfo188352 info;
Tsym223841* owner;
NU32 flags;
Tnode223809* ast;
NU32 options;
NI position;
NI offset;
Tloc223823 loc;
Tlib223827* annex;
Tnode223809* constraint;
};
struct  Cell48947  {
NI refcount;
TNimType* typ;
};
struct  Cellseq48963  {
NI len;
NI cap;
Cell48947** d;
};
struct  Cellset48959  {
NI counter;
NI max;
Pagedesc48955* head;
Pagedesc48955** data;
};
typedef Smallchunk30842* TY30905[512];
typedef Trunk30813* Trunkbuckets30815[256];
struct  Intset30817  {
Trunkbuckets30815 data;
};
struct  Memregion30890  {
NI minlargeobj;
NI maxlargeobj;
TY30905 freesmallchunks;
Llchunk30884* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk30844* freechunkslist;
Intset30817 chunkstarts;
Avlnode30888* root;
Avlnode30888* deleted;
Avlnode30888* last;
Avlnode30888* freeavlnodes;
};
struct  Gcstat51014  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap51018  {
Gcstack51016* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq48963 zct;
Cellseq48963 decstack;
Cellset48959 cycleroots;
Cellseq48963 tempstack;
NI recgclock;
Memregion30890 region;
Gcstat51014 stat;
};
struct  Tnode223809  {
Ttype223847* typ;
Tlineinfo188352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym223841* sym;
} S4;
struct {Tident196021* ident;
} S5;
struct {Tnodeseq223803* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Tident196021  {
  Tidobj196015 Sup;
NimStringDesc* s;
Tident196021* next;
NI h;
};
struct  Exception  {
  TNimObject Sup;
Exception* parent;
NCSTRING name;
NimStringDesc* message;
NimStringDesc* trace;
};
typedef struct {
N_NIMCALL_PTR(NIM_BOOL, ClPrc) (Exception* e, void* ClEnv);
void* ClEnv;
} TY19211;
struct  TSafePoint  {
TSafePoint* prev;
NI status;
jmp_buf context;
NIM_BOOL hasRaiseAction;
TY19211 raiseAction;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
typedef Tnode223809* TY241880[1];
typedef NU8 Sha1digest199009[20];
typedef NimStringDesc* TY251724[1];
struct  Ropeobj174009  {
  TNimObject Sup;
Ropeobj174009* left;
Ropeobj174009* right;
NI length;
NimStringDesc* data;
};
struct  Tscope223835  {
NI depthlevel;
Tstrtable223813 symbols;
Tnodeseq223803* usingsyms;
Tscope223835* parent;
};
struct  Tlistentry139022  {
  TNimObject Sup;
Tlistentry139022* prev;
Tlistentry139022* next;
};
struct  Tlib223827  {
  Tlistentry139022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj174009* name;
Tnode223809* path;
};
struct  Gcstack51016  {
Gcstack51016* prev;
Gcstack51016* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY30821[16];
struct  Pagedesc48955  {
Pagedesc48955* next;
NI key;
TY30821 bits;
};
struct  Basechunk30840  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk30842  {
  Basechunk30840 Sup;
Smallchunk30842* next;
Smallchunk30842* prev;
Freecell30832* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk30884  {
NI size;
NI acc;
Llchunk30884* next;
};
struct  Bigchunk30844  {
  Basechunk30840 Sup;
Bigchunk30844* next;
Bigchunk30844* prev;
NI align;
NF data;
};
struct  Trunk30813  {
Trunk30813* next;
NI key;
TY30821 bits;
};
typedef Avlnode30888* TY30895[2];
struct  Avlnode30888  {
TY30895 link;
NI key;
NI upperbound;
NI level;
};
struct  Processobj154404  {
  TNimObject Sup;
int inhandle;
int outhandle;
int errhandle;
Streamobj148427* instream;
Streamobj148427* outstream;
Streamobj148427* errstream;
pid_t id;
int exitcode;
NU8 options;
};
struct  Stringtableobj144212  {
  TNimObject Sup;
NI counter;
Keyvaluepairseq144210* data;
NU8 mode;
};
typedef N_NIMCALL_PTR(void, TY148428) (Streamobj148427* s);
typedef N_NIMCALL_PTR(NIM_BOOL, TY148432) (Streamobj148427* s);
typedef N_NIMCALL_PTR(void, TY148436) (Streamobj148427* s, NI pos);
typedef N_NIMCALL_PTR(NI, TY148441) (Streamobj148427* s);
typedef N_NIMCALL_PTR(NI, TY148445) (Streamobj148427* s, void* buffer, NI buflen);
typedef N_NIMCALL_PTR(NI, TY148451) (Streamobj148427* s, void* buffer, NI buflen);
typedef N_NIMCALL_PTR(void, TY148457) (Streamobj148427* s, void* buffer, NI buflen);
typedef N_NIMCALL_PTR(void, TY148463) (Streamobj148427* s);
struct  Streamobj148427  {
  TNimObject Sup;
TY148428 closeimpl;
TY148432 atendimpl;
TY148436 setpositionimpl;
TY148441 getpositionimpl;
TY148445 readdataimpl;
TY148451 peekdataimpl;
TY148457 writedataimpl;
TY148463 flushimpl;
};
struct  Tinstantiation223831  {
Tsym223841* sym;
Ttypeseq223843* concretetypes;
TY223932* usedby;
NI compilesid;
};
struct  Freecell30832  {
Freecell30832* next;
NI zerofield;
};
struct Keyvaluepair144208 {
NimStringDesc* Field0;
NimStringDesc* Field1;
};
struct Tnodeseq223803 {
  TGenericSeq Sup;
  Tnode223809* data[SEQ_DECL_SIZE];
};
struct Ttypeseq223843 {
  TGenericSeq Sup;
  Ttype223847* data[SEQ_DECL_SIZE];
};
struct TY223944 {
  TGenericSeq Sup;
  Tinstantiation223831* data[SEQ_DECL_SIZE];
};
struct Tsymseq223811 {
  TGenericSeq Sup;
  Tsym223841* data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq144210 {
  TGenericSeq Sup;
  Keyvaluepair144208 data[SEQ_DECL_SIZE];
};
struct TY223932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(Tnode223809*, maptypetoast_426089)(Ttype223847* t, Tlineinfo188352 info, NIM_BOOL allowrecursion);
N_NIMCALL(Tnode223809*, atomictypex_426075)(NimStringDesc* name, Ttype223847* t, Tlineinfo188352 info);
N_NIMCALL(Tsym223841*, newsym_224656)(NU8 symkind, Tident196021* name, Tsym223841* owner, Tlineinfo188352 info);
N_NIMCALL(Tident196021*, getident_196463)(NimStringDesc* identifier);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
static N_INLINE(Cell48947*, usrtocell_52646)(void* usr);
static N_INLINE(void, rtladdzct_54204)(Cell48947* c);
N_NOINLINE(void, addzct_52617)(Cellseq48963* s, Cell48947* c);
N_NIMCALL(Tnode223809*, newsymnode_225325)(Tsym223841* sym);
N_NIMCALL(Tnode223809*, newnodeit_225807)(NU8 kind, Tlineinfo188352 info, Ttype223847* typ);
N_NIMCALL(void, add_224165)(Tnode223809* father, Tnode223809* son);
N_NIMCALL(Ttype223847*, base_253039)(Ttype223847* t);
N_NIMCALL(NI, len_226369)(Ttype223847* n);
N_NIMCALL(Ttype223847*, lastson_226426)(Ttype223847* n);
N_NIMCALL(Tnode223809*, maptypetobracket_426097)(NimStringDesc* name, Ttype223847* t, Tlineinfo188352 info);
N_NIMCALL(Ttype223847*, newtype_226140)(NU8 kind, Tsym223841* owner);
N_NIMCALL(Tnode223809*, copytree_228028)(Tnode223809* src);
static N_INLINE(void, pushSafePoint)(TSafePoint* s);
N_NIMCALL(NimStringDesc*, findfile_166539)(NimStringDesc* f);
N_NIMCALL(NimStringDesc*, readfile_16872)(NimStringDesc* filename);
N_NIMCALL(void, appendtomodule_224911)(Tsym223841* m, Tnode223809* n);
N_NIMCALL(Tnode223809*, newnode_225607)(NU8 kind, Tlineinfo188352 info, Tnodeseq223803* sons, Ttype223847* typ);
N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
N_NIMCALL(Tnode223809*, newstrnode_224644)(NU8 kind, NimStringDesc* strval);
static N_INLINE(void, popSafePoint)(void);
N_NIMCALL(NIM_BOOL, isObj)(TNimType* obj, TNimType* subclass);
static N_INLINE(Exception*, getCurrentException)(void);
N_NIMCALL(void, localerror_194128)(Tlineinfo188352 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
static N_INLINE(void, popCurrentException)(void);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incref_55022)(Cell48947* c);
static N_INLINE(NIM_BOOL, canbecycleroot_52667)(Cell48947* c);
static N_INLINE(void, rtladdcycleroot_53423)(Cell48947* c);
N_NOINLINE(void, incl_49665)(Cellset48959* s, Cell48947* cell);
static N_INLINE(void, decref_54604)(Cell48947* c);
N_NIMCALL(void, reraiseException)(void);
N_NIMCALL(void, securehash_199023)(NimStringDesc* str, Sha1digest199009* Result);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NOINLINE(void, chckNil)(void* p);
N_NIMCALL(NimStringDesc*, togeneratedfile_166158)(NimStringDesc* path, NimStringDesc* ext);
N_NIMCALL(NimStringDesc*, HEX24_199044)(Sha1digest199009 self);
N_NIMCALL(NIM_BOOL, open_16803)(FILE** f, NimStringDesc* filename, NU8 mode, NI bufsize);
N_NIMCALL(NimStringDesc*, readall_16869)(FILE* file);
N_NIMCALL(Processobj154404*, nospstartProcess)(NimStringDesc* command, NimStringDesc* workingdir, NimStringDesc** args, NI argsLen0, Stringtableobj144212* env, NU8 options);
N_NIMCALL(void, write_148683)(Streamobj148427* s, NimStringDesc* x);
N_NIMCALL(Streamobj148427*, nospinputStream)(Processobj154404* p);
N_NIMCALL(void, close_148491)(Streamobj148427* s);
N_NIMCALL(NimStringDesc*, readoutput_426009)(Processobj154404* p);
N_NIMCALL(Streamobj148427*, nospoutputStream)(Processobj154404* p);
N_NIMCALL(NIM_BOOL, atend_148517)(Streamobj148427* s);
N_NIMCALL(NimStringDesc*, readline_149477)(Streamobj148427* s);
N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
N_NIMCALL(NimStringDesc*, setLengthStr)(NimStringDesc* s, NI newlen);
N_NIMCALL(NI, nospwaitForExit)(Processobj154404* p, NI timeout);
N_NIMCALL(void, writefile_16875)(NimStringDesc* filename, NimStringDesc* content);
STRING_LITERAL(TMP2944, "none", 4);
STRING_LITERAL(TMP2945, "bool", 4);
STRING_LITERAL(TMP2946, "char", 4);
STRING_LITERAL(TMP2947, "nil", 3);
STRING_LITERAL(TMP2948, "expr", 4);
STRING_LITERAL(TMP2949, "stmt", 4);
STRING_LITERAL(TMP2950, "void", 4);
STRING_LITERAL(TMP2951, "array", 5);
STRING_LITERAL(TMP2952, "typeDesc", 8);
STRING_LITERAL(TMP2953, "typeDesc", 8);
STRING_LITERAL(TMP2954, "void", 4);
STRING_LITERAL(TMP2955, "distinct", 8);
STRING_LITERAL(TMP2956, "tuple", 5);
STRING_LITERAL(TMP2957, "set", 3);
STRING_LITERAL(TMP2958, "ptr", 3);
STRING_LITERAL(TMP2959, "ref", 3);
STRING_LITERAL(TMP2960, "var", 3);
STRING_LITERAL(TMP2961, "seq", 3);
STRING_LITERAL(TMP2962, "proc", 4);
STRING_LITERAL(TMP2963, "openArray", 9);
STRING_LITERAL(TMP2964, "range", 5);
STRING_LITERAL(TMP2965, "pointer", 7);
STRING_LITERAL(TMP2966, "string", 6);
STRING_LITERAL(TMP2967, "cstring", 7);
STRING_LITERAL(TMP2968, "int", 3);
STRING_LITERAL(TMP2969, "int8", 4);
STRING_LITERAL(TMP2970, "int16", 5);
STRING_LITERAL(TMP2971, "int32", 5);
STRING_LITERAL(TMP2972, "int64", 5);
STRING_LITERAL(TMP2973, "float", 5);
STRING_LITERAL(TMP2974, "float32", 7);
STRING_LITERAL(TMP2975, "float64", 7);
STRING_LITERAL(TMP2976, "float128", 8);
STRING_LITERAL(TMP2977, "uint", 4);
STRING_LITERAL(TMP2978, "uint8", 5);
STRING_LITERAL(TMP2979, "uint16", 6);
STRING_LITERAL(TMP2980, "uint32", 6);
STRING_LITERAL(TMP2981, "uint64", 6);
STRING_LITERAL(TMP2982, "bignum", 6);
STRING_LITERAL(TMP2983, "const", 5);
STRING_LITERAL(TMP2984, "mutable", 7);
STRING_LITERAL(TMP2985, "varargs", 7);
STRING_LITERAL(TMP2986, "iter", 4);
STRING_LITERAL(TMP2987, "error", 5);
STRING_LITERAL(TMP2988, "builtinTypeClass", 16);
STRING_LITERAL(TMP2989, "concept", 7);
STRING_LITERAL(TMP2990, "compositeTypeClass", 18);
STRING_LITERAL(TMP2991, "and", 3);
STRING_LITERAL(TMP2992, "or", 2);
STRING_LITERAL(TMP2993, "not", 3);
STRING_LITERAL(TMP2994, "anything", 8);
STRING_LITERAL(TMP2995, "static", 6);
STRING_LITERAL(TMP2999, "", 0);
STRING_LITERAL(TMP3000, "\011", 1);
STRING_LITERAL(TMP3001, "gorge_", 6);
STRING_LITERAL(TMP3002, "txt", 3);
STRING_LITERAL(TMP3019, "\012", 1);
extern Gcheap51018 gch_51059;
extern Tnode223809* emptynode_224807;
extern TSafePoint* exchandler_20843;
extern TNimType NTI223803; /* TNodeSeq */
extern TNimType NTI4031; /* IOError */
extern Exception* currexception_20845;
extern TNimType NTI4033; /* OSError */

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

static N_INLINE(void, rtladdzct_54204)(Cell48947* c) {
	addzct_52617((&gch_51059.zct), c);
}

static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) {
	{
		Cell48947* c;
		if (!!((src == NIM_NIL))) goto LA3;
		c = usrtocell_52646(src);
		(*c).refcount += ((NI) 8);
	}
	LA3: ;
	{
		Cell48947* c;
		if (!!(((*dest) == NIM_NIL))) goto LA7;
		c = usrtocell_52646((*dest));
		{
			(*c).refcount -= ((NI) 8);
			if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA11;
			rtladdzct_54204(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

N_NIMCALL(Tnode223809*, atomictypex_426075)(NimStringDesc* name, Ttype223847* t, Tlineinfo188352 info) {
	Tnode223809* result;
	Tsym223841* sym;
	Tident196021* LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = getident_196463(name);
	sym = newsym_224656(((NU8) 7), LOC1, (*t).owner, info);
	asgnRefNoCycle((void**) (&(*sym).typ), t);
	result = newsymnode_225325(sym);
	asgnRefNoCycle((void**) (&(*result).typ), t);
	return result;
}

N_NIMCALL(Tnode223809*, maptypetobracket_426097)(NimStringDesc* name, Ttype223847* t, Tlineinfo188352 info) {
	Tnode223809* result;
	Tnode223809* LOC1;
	result = 0;
	result = newnodeit_225807(((NU8) 42), info, t);
	LOC1 = 0;
	LOC1 = atomictypex_426075(name, t, info);
	add_224165(result, LOC1);
	{
		NI i_426122;
		NI HEX3Atmp_426139;
		NI LOC3;
		NI res_426142;
		i_426122 = 0;
		HEX3Atmp_426139 = 0;
		LOC3 = 0;
		LOC3 = len_226369(t);
		HEX3Atmp_426139 = (LOC3 - 1);
		res_426142 = ((NI) 0);
		{
			while (1) {
				if (!(res_426142 <= HEX3Atmp_426139)) goto LA5;
				i_426122 = res_426142;
				{
					Tnode223809* void_426135;
					if (!((*t).sons->data[i_426122] == NIM_NIL)) goto LA8;
					void_426135 = atomictypex_426075(((NimStringDesc*) &TMP2954), t, info);
					asgnRefNoCycle((void**) (&(*void_426135).typ), newtype_226140(((NU8) 3), (*t).owner));
					add_224165(result, void_426135);
				}
				goto LA6;
				LA8: ;
				{
					Tnode223809* LOC11;
					LOC11 = 0;
					LOC11 = maptypetoast_426089((*t).sons->data[i_426122], info, NIM_FALSE);
					add_224165(result, LOC11);
				}
				LA6: ;
				res_426142 += ((NI) 1);
			} LA5: ;
		}
	}
	return result;
}

N_NIMCALL(Tnode223809*, maptypetoast_426089)(Ttype223847* t, Tlineinfo188352 info, NIM_BOOL allowrecursion) {
	Tnode223809* result;
	result = 0;
	switch ((*t).kind) {
	case ((NU8) 0):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2944), t, info);
	}
	break;
	case ((NU8) 1):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2945), t, info);
	}
	break;
	case ((NU8) 2):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2946), t, info);
	}
	break;
	case ((NU8) 5):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2947), t, info);
	}
	break;
	case ((NU8) 6):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2948), t, info);
	}
	break;
	case ((NU8) 7):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2949), t, info);
	}
	break;
	case ((NU8) 3):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2950), t, info);
	}
	break;
	case ((NU8) 4):
	case ((NU8) 16):
	{
		Tnode223809* LOC9;
		Tnode223809* LOC10;
		Tnode223809* LOC11;
		result = newnodeit_225807(((NU8) 42), info, t);
		LOC9 = 0;
		LOC9 = atomictypex_426075(((NimStringDesc*) &TMP2951), t, info);
		add_224165(result, LOC9);
		LOC10 = 0;
		LOC10 = maptypetoast_426089((*t).sons->data[((NI) 0)], info, NIM_FALSE);
		add_224165(result, LOC10);
		LOC11 = 0;
		LOC11 = maptypetoast_426089((*t).sons->data[((NI) 1)], info, NIM_FALSE);
		add_224165(result, LOC11);
	}
	break;
	case ((NU8) 8):
	{
		{
			Ttype223847* LOC15;
			Tnode223809* LOC18;
			Ttype223847* LOC19;
			Tnode223809* LOC20;
			LOC15 = 0;
			LOC15 = base_253039(t);
			if (!!((LOC15 == NIM_NIL))) goto LA16;
			result = newnodeit_225807(((NU8) 42), info, t);
			LOC18 = 0;
			LOC18 = atomictypex_426075(((NimStringDesc*) &TMP2952), t, info);
			add_224165(result, LOC18);
			LOC19 = 0;
			LOC19 = base_253039(t);
			LOC20 = 0;
			LOC20 = maptypetoast_426089(LOC19, info, NIM_FALSE);
			add_224165(result, LOC20);
		}
		goto LA13;
		LA16: ;
		{
			result = atomictypex_426075(((NimStringDesc*) &TMP2953), t, info);
		}
		LA13: ;
	}
	break;
	case ((NU8) 9):
	{
		result = newnodeit_225807(((NU8) 42), info, t);
		{
			NI i_426206;
			NI HEX3Atmp_426252;
			NI LOC24;
			NI res_426255;
			i_426206 = 0;
			HEX3Atmp_426252 = 0;
			LOC24 = 0;
			LOC24 = len_226369(t);
			HEX3Atmp_426252 = (LOC24 - 1);
			res_426255 = ((NI) 0);
			{
				while (1) {
					Tnode223809* LOC27;
					if (!(res_426255 <= HEX3Atmp_426252)) goto LA26;
					i_426206 = res_426255;
					LOC27 = 0;
					LOC27 = maptypetoast_426089((*t).sons->data[i_426206], info, NIM_FALSE);
					add_224165(result, LOC27);
					res_426255 += ((NI) 1);
				} LA26: ;
			}
		}
	}
	break;
	case ((NU8) 11):
	case ((NU8) 10):
	case ((NU8) 15):
	case ((NU8) 53):
	{
		Ttype223847* LOC29;
		LOC29 = 0;
		LOC29 = lastson_226426(t);
		result = maptypetoast_426089(LOC29, info, NIM_FALSE);
	}
	break;
	case ((NU8) 13):
	{
		{
			if (!allowrecursion) goto LA33;
			result = maptypetobracket_426097(((NimStringDesc*) &TMP2955), t, info);
		}
		goto LA31;
		LA33: ;
		{
			result = atomictypex_426075((*(*(*t).sym).name).s, t, info);
		}
		LA31: ;
	}
	break;
	case ((NU8) 12):
	case ((NU8) 30):
	{
		result = atomictypex_426075((*(*(*t).sym).name).s, t, info);
	}
	break;
	case ((NU8) 17):
	{
		{
			Tnode223809* LOC48;
			if (!allowrecursion) goto LA40;
			result = newnodeit_225807(((NU8) 133), info, t);
			{
				if (!((*t).sons->data[((NI) 0)] == NIM_NIL)) goto LA44;
				add_224165(result, emptynode_224807);
			}
			goto LA42;
			LA44: ;
			{
				Tnode223809* LOC47;
				LOC47 = 0;
				LOC47 = maptypetoast_426089((*t).sons->data[((NI) 0)], info, NIM_FALSE);
				add_224165(result, LOC47);
			}
			LA42: ;
			LOC48 = 0;
			LOC48 = copytree_228028((*t).n);
			add_224165(result, LOC48);
		}
		goto LA38;
		LA40: ;
		{
			result = atomictypex_426075((*(*(*t).sym).name).s, t, info);
		}
		LA38: ;
	}
	break;
	case ((NU8) 14):
	{
		Tnode223809* LOC51;
		result = newnodeit_225807(((NU8) 150), info, t);
		LOC51 = 0;
		LOC51 = copytree_228028((*t).n);
		add_224165(result, LOC51);
	}
	break;
	case ((NU8) 18):
	{
		result = maptypetobracket_426097(((NimStringDesc*) &TMP2956), t, info);
	}
	break;
	case ((NU8) 19):
	{
		result = maptypetobracket_426097(((NimStringDesc*) &TMP2957), t, info);
	}
	break;
	case ((NU8) 21):
	{
		result = maptypetobracket_426097(((NimStringDesc*) &TMP2958), t, info);
	}
	break;
	case ((NU8) 22):
	{
		result = maptypetobracket_426097(((NimStringDesc*) &TMP2959), t, info);
	}
	break;
	case ((NU8) 23):
	{
		result = maptypetobracket_426097(((NimStringDesc*) &TMP2960), t, info);
	}
	break;
	case ((NU8) 24):
	{
		result = maptypetobracket_426097(((NimStringDesc*) &TMP2961), t, info);
	}
	break;
	case ((NU8) 25):
	{
		result = maptypetobracket_426097(((NimStringDesc*) &TMP2962), t, info);
	}
	break;
	case ((NU8) 27):
	{
		result = maptypetobracket_426097(((NimStringDesc*) &TMP2963), t, info);
	}
	break;
	case ((NU8) 20):
	{
		Tnode223809* LOC61;
		Tnode223809* LOC62;
		Tnode223809* LOC63;
		result = newnodeit_225807(((NU8) 42), info, t);
		LOC61 = 0;
		LOC61 = atomictypex_426075(((NimStringDesc*) &TMP2964), t, info);
		add_224165(result, LOC61);
		LOC62 = 0;
		LOC62 = copytree_228028((*(*t).n).kindU.S6.sons->data[((NI) 0)]);
		add_224165(result, LOC62);
		LOC63 = 0;
		LOC63 = copytree_228028((*(*t).n).kindU.S6.sons->data[((NI) 1)]);
		add_224165(result, LOC63);
	}
	break;
	case ((NU8) 26):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2965), t, info);
	}
	break;
	case ((NU8) 28):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2966), t, info);
	}
	break;
	case ((NU8) 29):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2967), t, info);
	}
	break;
	case ((NU8) 31):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2968), t, info);
	}
	break;
	case ((NU8) 32):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2969), t, info);
	}
	break;
	case ((NU8) 33):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2970), t, info);
	}
	break;
	case ((NU8) 34):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2971), t, info);
	}
	break;
	case ((NU8) 35):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2972), t, info);
	}
	break;
	case ((NU8) 36):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2973), t, info);
	}
	break;
	case ((NU8) 37):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2974), t, info);
	}
	break;
	case ((NU8) 38):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2975), t, info);
	}
	break;
	case ((NU8) 39):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2976), t, info);
	}
	break;
	case ((NU8) 40):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2977), t, info);
	}
	break;
	case ((NU8) 41):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2978), t, info);
	}
	break;
	case ((NU8) 42):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2979), t, info);
	}
	break;
	case ((NU8) 43):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2980), t, info);
	}
	break;
	case ((NU8) 44):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2981), t, info);
	}
	break;
	case ((NU8) 45):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2982), t, info);
	}
	break;
	case ((NU8) 46):
	{
		result = maptypetobracket_426097(((NimStringDesc*) &TMP2983), t, info);
	}
	break;
	case ((NU8) 47):
	{
		result = maptypetobracket_426097(((NimStringDesc*) &TMP2984), t, info);
	}
	break;
	case ((NU8) 48):
	{
		result = maptypetobracket_426097(((NimStringDesc*) &TMP2985), t, info);
	}
	break;
	case ((NU8) 49):
	{
		result = maptypetobracket_426097(((NimStringDesc*) &TMP2986), t, info);
	}
	break;
	case ((NU8) 50):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2987), t, info);
	}
	break;
	case ((NU8) 51):
	{
		result = maptypetobracket_426097(((NimStringDesc*) &TMP2988), t, info);
	}
	break;
	case ((NU8) 52):
	{
		Tnode223809* LOC89;
		result = maptypetobracket_426097(((NimStringDesc*) &TMP2989), t, info);
		LOC89 = 0;
		LOC89 = copytree_228028((*t).n);
		add_224165(result, LOC89);
	}
	break;
	case ((NU8) 54):
	{
		result = maptypetobracket_426097(((NimStringDesc*) &TMP2990), t, info);
	}
	break;
	case ((NU8) 55):
	{
		result = maptypetobracket_426097(((NimStringDesc*) &TMP2991), t, info);
	}
	break;
	case ((NU8) 56):
	{
		result = maptypetobracket_426097(((NimStringDesc*) &TMP2992), t, info);
	}
	break;
	case ((NU8) 57):
	{
		result = maptypetobracket_426097(((NimStringDesc*) &TMP2993), t, info);
	}
	break;
	case ((NU8) 58):
	{
		result = atomictypex_426075(((NimStringDesc*) &TMP2994), t, info);
	}
	break;
	case ((NU8) 59):
	case ((NU8) 60):
	case ((NU8) 61):
	{
		Tnode223809* LOC96;
		result = newnodeit_225807(((NU8) 42), info, t);
		LOC96 = 0;
		LOC96 = atomictypex_426075(((NimStringDesc*) &TMP2995), t, info);
		add_224165(result, LOC96);
		{
			Tnode223809* LOC101;
			if (!!(((*t).n == NIM_NIL))) goto LA99;
			LOC101 = 0;
			LOC101 = copytree_228028((*t).n);
			add_224165(result, LOC101);
		}
		LA99: ;
	}
	break;
	}
	return result;
}

N_NIMCALL(Tnode223809*, opmaptypetoast_426274)(Ttype223847* t, Tlineinfo188352 info) {
	Tnode223809* result;
	result = 0;
	result = maptypetoast_426089(t, info, NIM_TRUE);
	return result;
}

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

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

static N_INLINE(Exception*, getCurrentException)(void) {
	Exception* result;
	result = 0;
	result = currexception_20845;
	return result;
}

static N_INLINE(NIM_BOOL, canbecycleroot_52667)(Cell48947* c) {
	NIM_BOOL result;
	result = 0;
	result = !((((*(*c).typ).flags &(1<<((((NU8) 1))&7)))!=0));
	return result;
}

static N_INLINE(void, rtladdcycleroot_53423)(Cell48947* c) {
	{
		if (!!((((NI) ((NI)((*c).refcount & ((NI) 3)))) == ((NI) 3)))) goto LA3;
		(*c).refcount = (NI)((NI)((*c).refcount & ((NI) -4)) | ((NI) 3));
		incl_49665((&gch_51059.cycleroots), c);
	}
	LA3: ;
}

static N_INLINE(void, incref_55022)(Cell48947* c) {
	(*c).refcount = (NI)((NU32)((*c).refcount) + (NU32)(((NI) 8)));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = canbecycleroot_52667(c);
		if (!LOC3) goto LA4;
		rtladdcycleroot_53423(c);
	}
	LA4: ;
}

static N_INLINE(void, decref_54604)(Cell48947* c) {
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA3;
		rtladdzct_54204(c);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = canbecycleroot_52667(c);
		if (!LOC6) goto LA7;
		rtladdcycleroot_53423(c);
	}
	goto LA1;
	LA7: ;
	LA1: ;
}

static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		Cell48947* LOC5;
		if (!!((src == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = usrtocell_52646(src);
		incref_55022(LOC5);
	}
	LA3: ;
	{
		Cell48947* LOC10;
		if (!!(((*dest) == NIM_NIL))) goto LA8;
		LOC10 = 0;
		LOC10 = usrtocell_52646((*dest));
		decref_54604(LOC10);
	}
	LA8: ;
	(*dest) = src;
}

static N_INLINE(void, popCurrentException)(void) {
	asgnRef((void**) (&currexception_20845), NIM_NIL);
}

N_NIMCALL(NimStringDesc*, opslurp_426049)(NimStringDesc* file, Tlineinfo188352 info, Tsym223841* module) {
	NimStringDesc* volatile result;
	TSafePoint TMP2998;
	result = 0;
	pushSafePoint(&TMP2998);
	TMP2998.status = setjmp(TMP2998.context);
	if (TMP2998.status == 0) {
		NimStringDesc* filename;
		Tnodeseq223803* LOC2;
		TY241880 LOC3;
		Tnode223809* LOC4;
		filename = findfile_166539(file);
		result = readfile_16872(filename);
		LOC2 = 0;
		LOC2 = (Tnodeseq223803*) newSeq((&NTI223803), 1);
		memset((void*)LOC3, 0, sizeof(LOC3));
		LOC3[0] = newstrnode_224644(((NU8) 20), filename);
		asgnRefNoCycle((void**) (&LOC2->data[0]), LOC3[0]);
		LOC4 = 0;
		LOC4 = newnode_225607(((NU8) 121), info, LOC2, NIM_NIL);
		appendtomodule_224911(module, LOC4);
		popSafePoint();
	}
	else {
		popSafePoint();
		if (isObj(getCurrentException()->Sup.m_type, (&NTI4031))) {
			TMP2998.status = 0;
			localerror_194128(info, ((NU16) 3), file);
			result = copyString(((NimStringDesc*) &TMP2999));
			popCurrentException();
		}
	}
	if (TMP2998.status != 0) reraiseException();
	return result;
}

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

N_NIMCALL(NimStringDesc*, readoutput_426009)(Processobj154404* p) {
	NimStringDesc* result;
	Streamobj148427* output;
	NI LOC9;
	result = 0;
	result = copyString(((NimStringDesc*) &TMP2999));
	output = nospoutputStream(p);
	{
		while (1) {
			NIM_BOOL LOC3;
			NimStringDesc* LOC4;
			LOC3 = 0;
			LOC3 = atend_148517(output);
			if (!!(LOC3)) goto LA2;
			LOC4 = 0;
			LOC4 = readline_149477(output);
			result = resizeString(result, LOC4->Sup.len + 0);
appendString(result, LOC4);
			result = resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TMP3019));
		} LA2: ;
	}
	{
		if (!(((NI) 0) < (result ? result->Sup.len : 0))) goto LA7;
		result = setLengthStr(result, ((NI) ((NI)((result ? result->Sup.len : 0) - ((NI) 1)))));
	}
	LA7: ;
	LOC9 = 0;
	LOC9 = nospwaitForExit(p, ((NI) -1));
	return result;
}

N_NIMCALL(NimStringDesc*, opgorge_426027)(NimStringDesc* cmd, NimStringDesc* input, NimStringDesc* cache) {
	NimStringDesc* volatile result;
{	result = 0;
	{
		Sha1digest199009 h;
		NimStringDesc* LOC5;
		NimStringDesc* filename;
		NimStringDesc* LOC6;
		NimStringDesc* LOC7;
		FILE* f;
		NIM_BOOL volatile readsuccessful;
		TSafePoint TMP3003;
		if (!(((NI) 0) < (cache ? cache->Sup.len : 0))) goto LA3;
		memset((void*)h, 0, sizeof(h));
		LOC5 = 0;
		LOC5 = rawNewString(cmd->Sup.len + input->Sup.len + cache->Sup.len + 2);
appendString(LOC5, cmd);
appendString(LOC5, ((NimStringDesc*) &TMP3000));
appendString(LOC5, input);
appendString(LOC5, ((NimStringDesc*) &TMP3000));
appendString(LOC5, cache);
		chckNil((void*)h);
		memset((void*)h, 0, sizeof(h));
		securehash_199023(LOC5, h);
		LOC6 = 0;
		LOC7 = 0;
		LOC7 = HEX24_199044(h);
		LOC6 = rawNewString(LOC7->Sup.len + 6);
appendString(LOC6, ((NimStringDesc*) &TMP3001));
appendString(LOC6, LOC7);
		filename = togeneratedfile_166158(LOC6, ((NimStringDesc*) &TMP3002));
		f = 0;
		{
			NIM_BOOL LOC10;
			LOC10 = 0;
			LOC10 = open_16803(&f, filename, ((NU8) 0), ((NI) -1));
			if (!LOC10) goto LA11;
			result = readall_16869(f);
			fclose(f);
			goto BeforeRet;
		}
		LA11: ;
		readsuccessful = NIM_FALSE;
		pushSafePoint(&TMP3003);
		TMP3003.status = setjmp(TMP3003.context);
		if (TMP3003.status == 0) {
			Processobj154404* p;
			TY251724 LOC14;
			memset((void*)LOC14, 0, sizeof(LOC14));
			p = nospstartProcess(cmd, ((NimStringDesc*) &TMP2999), LOC14, 0, NIM_NIL, 12);
			{
				Streamobj148427* LOC19;
				Streamobj148427* LOC20;
				if (!!(((input ? input->Sup.len : 0) == ((NI) 0)))) goto LA17;
				LOC19 = 0;
				LOC19 = nospinputStream(p);
				write_148683(LOC19, input);
				LOC20 = 0;
				LOC20 = nospinputStream(p);
				close_148491(LOC20);
			}
			LA17: ;
			result = readoutput_426009(p);
			readsuccessful = NIM_TRUE;
			writefile_16875(filename, result);
			popSafePoint();
		}
		else {
			popSafePoint();
			if (isObj(getCurrentException()->Sup.m_type, (&NTI4031))||isObj(getCurrentException()->Sup.m_type, (&NTI4033))) {
				TMP3003.status = 0;
				{
					if (!!(readsuccessful)) goto LA25;
					result = copyString(((NimStringDesc*) &TMP2999));
				}
				LA25: ;
				popCurrentException();
			}
		}
		if (TMP3003.status != 0) reraiseException();
	}
	goto LA1;
	LA3: ;
	{
		TSafePoint TMP3020;
		pushSafePoint(&TMP3020);
		TMP3020.status = setjmp(TMP3020.context);
		if (TMP3020.status == 0) {
			Processobj154404* p;
			TY251724 LOC29;
			memset((void*)LOC29, 0, sizeof(LOC29));
			p = nospstartProcess(cmd, ((NimStringDesc*) &TMP2999), LOC29, 0, NIM_NIL, 12);
			{
				Streamobj148427* LOC34;
				Streamobj148427* LOC35;
				if (!!(((input ? input->Sup.len : 0) == ((NI) 0)))) goto LA32;
				LOC34 = 0;
				LOC34 = nospinputStream(p);
				write_148683(LOC34, input);
				LOC35 = 0;
				LOC35 = nospinputStream(p);
				close_148491(LOC35);
			}
			LA32: ;
			result = readoutput_426009(p);
			popSafePoint();
		}
		else {
			popSafePoint();
			if (isObj(getCurrentException()->Sup.m_type, (&NTI4031))||isObj(getCurrentException()->Sup.m_type, (&NTI4033))) {
				TMP3020.status = 0;
				result = copyString(((NimStringDesc*) &TMP2999));
				popCurrentException();
			}
		}
		if (TMP3020.status != 0) reraiseException();
	}
	LA1: ;
	}BeforeRet: ;
	return result;
}
NIM_EXTERNC N_NOINLINE(void, compiler_vmdepsInit000)(void) {
}

NIM_EXTERNC N_NOINLINE(void, compiler_vmdepsDatInit000)(void) {
}

