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

#include "nimbase.h"
#include <string.h>
#include <stdio.h>
typedef struct Tsym215822 Tsym215822;
typedef struct Tnode215790 Tnode215790;
typedef struct Tpass262014 Tpass262014;
typedef struct Tpasscontext262002 Tpasscontext262002;
typedef struct Trodreader253021 Trodreader253021;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct TNimObject TNimObject;
typedef struct Tllstream203204 Tllstream203204;
typedef struct Tparsers239026 Tparsers239026;
typedef struct Tparser229202 Tparser229202;
typedef struct Tlexer206173 Tlexer206173;
typedef struct Tbaselexer204015 Tbaselexer204015;
typedef struct Tlineinfo183337 Tlineinfo183337;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Ttoken206169 Ttoken206169;
typedef struct Tident190012 Tident190012;
typedef struct Tidobj190006 Tidobj190006;
typedef struct Ttypeseq215824 Ttypeseq215824;
typedef struct Tscope215816 Tscope215816;
typedef struct TY215925 TY215925;
typedef struct Tstrtable215794 Tstrtable215794;
typedef struct Tsymseq215792 Tsymseq215792;
typedef struct Ttype215828 Ttype215828;
typedef struct Tloc215804 Tloc215804;
typedef struct Ropeobj170006 Ropeobj170006;
typedef struct Tlib215808 Tlib215808;
typedef struct TY125202 TY125202;
typedef struct Tnodeseq215784 Tnodeseq215784;
typedef struct TY338746 TY338746;
typedef struct TY215913 TY215913;
typedef struct Tindex253019 Tindex253019;
typedef struct Tiitable222163 Tiitable222163;
typedef struct Tiipairseq222161 Tiipairseq222161;
typedef struct Table253054 Table253054;
typedef struct Keyvaluepairseq253057 Keyvaluepairseq253057;
typedef struct Memfile251202 Memfile251202;
typedef struct Tinstantiation215812 Tinstantiation215812;
typedef struct Tlistentry135010 Tlistentry135010;
typedef struct Tiipair222159 Tiipair222159;
typedef struct Keyvaluepair253060 Keyvaluepair253060;
typedef N_NIMCALL_PTR(Tsym215822*, TY262049) (Tsym215822* m, NI32 fileidx);
typedef N_NIMCALL_PTR(Tnode215790*, TY262054) (Tsym215822* m, NI32 fileidx);
typedef N_NIMCALL_PTR(Tpasscontext262002*, Tpassopen262006) (Tsym215822* module);
typedef N_NIMCALL_PTR(Tpasscontext262002*, Tpassopencached262008) (Tsym215822* module, Trodreader253021* rd);
typedef N_NIMCALL_PTR(Tnode215790*, Tpassprocess262012) (Tpasscontext262002* p, Tnode215790* toplevelstmt);
typedef N_NIMCALL_PTR(Tnode215790*, Tpassclose262010) (Tpasscontext262002* p, Tnode215790* n);
struct Tpass262014 {
Tpassopen262006 Field0;
Tpassopencached262008 Field1;
Tpassprocess262012 Field2;
Tpassclose262010 Field3;
};
typedef Tpass262014 TY262138[10];
typedef N_NIMCALL_PTR(void, TY3489) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3494) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3489 marker;
TY3494 deepcopy;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Tpasscontext262002  {
  TNimObject Sup;
NIM_BOOL fromcache;
};
struct  Tbaselexer204015  {
  TNimObject Sup;
NI bufpos;
NCSTRING buf;
NI buflen;
Tllstream203204* stream;
NI linenumber;
NI sentinel;
NI linestart;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (Tlineinfo183337 info, NU16 msg, NimStringDesc* arg, void* ClEnv);
void* ClEnv;
} Terrorhandler206171;
struct  Tlexer206173  {
  Tbaselexer204015 Sup;
NI32 fileidx;
NI indentahead;
NI currlineindent;
NIM_BOOL strongspaces;
Terrorhandler206171 errorhandler;
};
struct  Ttoken206169  {
NU8 toktype;
NI indent;
Tident190012* ident;
NI64 inumber;
NF fnumber;
NU8 base;
NI8 strongspacea;
NI8 strongspaceb;
NimStringDesc* literal;
NI line;
NI col;
};
struct  Tparser229202  {
NI currind;
NIM_BOOL firsttok;
NIM_BOOL strongspaces;
Tlexer206173 lex;
Ttoken206169 tok;
NI inpragma;
NI insemistmtlist;
};
struct  Tparsers239026  {
NU8 skin;
Tparser229202 parser;
};
typedef Tpasscontext262002* Tpasscontextarray262135[10];
struct  Tidobj190006  {
  TNimObject Sup;
NI id;
};
struct  Tstrtable215794  {
NI counter;
Tsymseq215792* data;
};
struct  Tlineinfo183337  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tloc215804  {
NU8 k;
NU8 s;
NU16 flags;
Ttype215828* t;
Ropeobj170006* r;
Ropeobj170006* heaproot;
};
struct  Tsym215822  {
  Tidobj190006 Sup;
NU8 kind;
union{
struct {Ttypeseq215824* typeinstcache;
Tscope215816* typscope;
} S1;
struct {TY215925* procinstcache;
Tsym215822* gcunsafetyreason;
} S2;
struct {TY215925* usedgenerics;
Tstrtable215794 tab;
} S3;
struct {Tsym215822* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype215828* typ;
Tident190012* name;
Tlineinfo183337 info;
Tsym215822* owner;
NU32 flags;
Tnode215790* ast;
NU32 options;
NI position;
NI offset;
Tloc215804 loc;
Tlib215808* annex;
Tnode215790* constraint;
};
struct  Tnode215790  {
Ttype215828* typ;
Tlineinfo183337 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym215822* sym;
} S4;
struct {Tident190012* ident;
} S5;
struct {Tnodeseq215784* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Tllstream203204  {
  TNimObject Sup;
NU8 kind;
FILE* f;
NimStringDesc* s;
NI rd;
NI wr;
NI lineoffset;
};
struct  Ttype215828  {
  Tidobj190006 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq215824* sons;
Tnode215790* n;
Tsym215822* owner;
Tsym215822* sym;
Tsym215822* destructor;
Tsym215822* deepcopy;
Tsym215822* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc215804 loc;
};
struct TY338746 {
Tnode215790* Field0;
Tnode215790* Field1;
};
struct  Tiitable222163  {
NI counter;
Tiipairseq222161* data;
};
struct  Tindex253019  {
NI lastidxkey;
NI lastidxval;
Tiitable222163 tab;
NimStringDesc* r;
NI offset;
};
struct  Table253054  {
Keyvaluepairseq253057* data;
NI counter;
};
struct  Memfile251202  {
void* mem;
NI size;
int handle;
};
struct  Trodreader253021  {
  TNimObject Sup;
NI pos;
NCSTRING s;
NU32 options;
NU8 reason;
TY215913* moddeps;
TY215913* files;
NI dataidx;
NI convertersidx;
NI initidx;
NI interfidx;
NI compilerprocsidx;
NI methodsidx;
NimStringDesc* filename;
Tindex253019 index;
Tindex253019 imports;
NI readerindex;
NI line;
NI moduleid;
Table253054 syms;
Memfile251202 memfile;
Tsymseq215792* methods;
NimStringDesc* origfile;
NIM_BOOL inviewmode;
};
struct  Tident190012  {
  Tidobj190006 Sup;
NimStringDesc* s;
Tident190012* next;
NI h;
};
struct  Tscope215816  {
NI depthlevel;
Tstrtable215794 symbols;
Tnodeseq215784* usingsyms;
Tscope215816* parent;
};
struct  Ropeobj170006  {
  TNimObject Sup;
Ropeobj170006* left;
Ropeobj170006* right;
NI length;
NimStringDesc* data;
};
struct  Tlistentry135010  {
  TNimObject Sup;
Tlistentry135010* prev;
Tlistentry135010* next;
};
struct  Tlib215808  {
  Tlistentry135010 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj170006* name;
Tnode215790* path;
};
struct  Tiipair222159  {
NI key;
NI val;
};
struct Keyvaluepair253060 {
NI Field0;
NI Field1;
Tsym215822* Field2;
};
struct  Tinstantiation215812  {
Tsym215822* sym;
Ttypeseq215824* concretetypes;
TY215913* usedby;
NI compilesid;
};
struct TY125202 {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct Ttypeseq215824 {
  TGenericSeq Sup;
  Ttype215828* data[SEQ_DECL_SIZE];
};
struct TY215925 {
  TGenericSeq Sup;
  Tinstantiation215812* data[SEQ_DECL_SIZE];
};
struct Tsymseq215792 {
  TGenericSeq Sup;
  Tsym215822* data[SEQ_DECL_SIZE];
};
struct Tnodeseq215784 {
  TGenericSeq Sup;
  Tnode215790* data[SEQ_DECL_SIZE];
};
struct TY215913 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct Tiipairseq222161 {
  TGenericSeq Sup;
  Tiipair222159 data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq253057 {
  TGenericSeq Sup;
  Keyvaluepair253060 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, objectInit)(void* dest, TNimType* typ);
N_NIMCALL(void, openpasses_262211)(Tpasscontext262002** a, Tsym215822* module);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(NimStringDesc*, tofullpathconsiderdirty_184401)(NI32 fileidx);
N_NIMCALL(Tllstream203204*, llstreamopen_203241)(NimStringDesc* filename, NU8 mode);
N_NIMCALL(void, rawmessage_186612)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, openparsers_239032)(Tparsers239026* p, NI32 fileidx, Tllstream203204* inputstream);
N_NIMCALL(void, processimplicits_262443)(TY125202* implicits, NU8 nodekind, Tpasscontext262002** a);
N_NIMCALL(Tnode215790*, newnodei_217248)(NU8 kind, Tlineinfo183337 info);
N_NIMCALL(Tnode215790*, newstrnode_216678)(NU8 kind, NimStringDesc* strval);
N_NIMCALL(void, addson_217807)(Tnode215790* father, Tnode215790* son);
N_NIMCALL(NIM_BOOL, processtoplevelstmt_262324)(Tnode215790* n, Tpasscontext262002** a);
N_NIMCALL(Tnode215790*, parsetoplevelstmt_239046)(Tparsers239026* p);
N_NIMCALL(void, add_216114)(Tnode215790* father, Tnode215790* son);
N_NIMCALL(void, closeparsers_239038)(Tparsers239026* p);
N_NIMCALL(void, closepasses_262290)(Tpasscontext262002** a);
N_NIMCALL(void, idsynchronizationpoint_214432)(NI idrange);
N_NIMCALL(void, openpassescached_262244)(Tpasscontext262002** a, Tsym215822* module, Trodreader253021* rd);
N_NIMCALL(Tnode215790*, loadinitsection_253082)(Trodreader253021* r);
N_NIMCALL(NI, sonslen_218351)(Tnode215790* n);
N_NIMCALL(void, processtoplevelstmtcached_262367)(Tnode215790* n, Tpasscontext262002** a);
N_NIMCALL(void, closepassescached_262401)(Tpasscontext262002** a);
N_NIMCALL(void, carrypass_262157)(Tpass262014 p, Tsym215822* module, TY338746 m, TY338746* Result);
TY262049 gimportmodule_262053;
TY262054 gincludefile_262058;
TY262138 gpasses_262139;
NI gpasseslen_262140;
extern TNimType NTI3608; /* RootObj */
TNimType NTI262002; /* TPassContext */
extern TNimType NTI130; /* bool */
extern TNimType NTI239026; /* TParsers */
extern Tlineinfo183337 gcmdlineinfo_184046;
extern TY125202* implicitimports_161242;
extern TY125202* implicitincludes_161260;

N_NIMCALL(void, openpasses_262211)(Tpasscontext262002** a, Tsym215822* module) {
	{
		NI i_262227;
		NI HEX3Atmp_262236;
		NI res_262239;
		i_262227 = 0;
		HEX3Atmp_262236 = 0;
		HEX3Atmp_262236 = (NI)(gpasseslen_262140 - ((NI) 1));
		res_262239 = ((NI) 0);
		{
			while (1) {
				if (!(res_262239 <= HEX3Atmp_262236)) goto LA3;
				i_262227 = res_262239;
				{
					if (!!(gpasses_262139[(i_262227)- 0].Field0 == 0)) goto LA6;
					unsureAsgnRef((void**) (&a[(i_262227)- 0]), gpasses_262139[(i_262227)- 0].Field0(module));
				}
				goto LA4;
				LA6: ;
				{
					unsureAsgnRef((void**) (&a[(i_262227)- 0]), NIM_NIL);
				}
				LA4: ;
				res_262239 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(NIM_BOOL, processtoplevelstmt_262324)(Tnode215790* n, Tpasscontext262002** a) {
	NIM_BOOL result;
	Tnode215790* m;
{	result = 0;
	m = n;
	{
		NI i_262342;
		NI HEX3Atmp_262359;
		NI res_262362;
		i_262342 = 0;
		HEX3Atmp_262359 = 0;
		HEX3Atmp_262359 = (NI)(gpasseslen_262140 - ((NI) 1));
		res_262362 = ((NI) 0);
		{
			while (1) {
				if (!(res_262362 <= HEX3Atmp_262359)) goto LA3;
				i_262342 = res_262362;
				{
					if (!!(gpasses_262139[(i_262342)- 0].Field2 == 0)) goto LA6;
					m = gpasses_262139[(i_262342)- 0].Field2(a[(i_262342)- 0], m);
					{
						if (!m == 0) goto LA10;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA10: ;
				}
				LA6: ;
				res_262362 += ((NI) 1);
			} LA3: ;
		}
	}
	result = NIM_TRUE;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, processimplicits_262443)(TY125202* implicits, NU8 nodekind, Tpasscontext262002** a) {
	{
		NimStringDesc* module_262458;
		NI i_262465;
		NI L_262467;
		module_262458 = 0;
		i_262465 = ((NI) 0);
		L_262467 = (implicits ? implicits->Sup.len : 0);
		{
			while (1) {
				Tnode215790* importstmt;
				Tnode215790* str;
				if (!(i_262465 < L_262467)) goto LA3;
				module_262458 = implicits->data[i_262465];
				importstmt = newnodei_217248(nodekind, gcmdlineinfo_184046);
				str = newstrnode_216678(((NU8) 20), module_262458);
				(*str).info = gcmdlineinfo_184046;
				addson_217807(importstmt, str);
				{
					NIM_BOOL LOC6;
					LOC6 = 0;
					LOC6 = processtoplevelstmt_262324(importstmt, a);
					if (!!(LOC6)) goto LA7;
					goto LA1;
				}
				LA7: ;
				i_262465 += ((NI) 1);
			} LA3: ;
		}
	} LA1: ;
}

N_NIMCALL(void, closepasses_262290)(Tpasscontext262002** a) {
	Tnode215790* m;
	m = NIM_NIL;
	{
		NI i_262306;
		NI HEX3Atmp_262316;
		NI res_262319;
		i_262306 = 0;
		HEX3Atmp_262316 = 0;
		HEX3Atmp_262316 = (NI)(gpasseslen_262140 - ((NI) 1));
		res_262319 = ((NI) 0);
		{
			while (1) {
				if (!(res_262319 <= HEX3Atmp_262316)) goto LA3;
				i_262306 = res_262319;
				{
					if (!!(gpasses_262139[(i_262306)- 0].Field3 == 0)) goto LA6;
					m = gpasses_262139[(i_262306)- 0].Field3(a[(i_262306)- 0], m);
				}
				LA6: ;
				unsureAsgnRef((void**) (&a[(i_262306)- 0]), NIM_NIL);
				res_262319 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, openpassescached_262244)(Tpasscontext262002** a, Tsym215822* module, Trodreader253021* rd) {
	{
		NI i_262261;
		NI HEX3Atmp_262282;
		NI res_262285;
		i_262261 = 0;
		HEX3Atmp_262282 = 0;
		HEX3Atmp_262282 = (NI)(gpasseslen_262140 - ((NI) 1));
		res_262285 = ((NI) 0);
		{
			while (1) {
				if (!(res_262285 <= HEX3Atmp_262282)) goto LA3;
				i_262261 = res_262285;
				{
					if (!!(gpasses_262139[(i_262261)- 0].Field1 == 0)) goto LA6;
					unsureAsgnRef((void**) (&a[(i_262261)- 0]), gpasses_262139[(i_262261)- 0].Field1(module, rd));
					{
						if (!!((a[(i_262261)- 0] == NIM_NIL))) goto LA10;
						(*a[(i_262261)- 0]).fromcache = NIM_TRUE;
					}
					LA10: ;
				}
				goto LA4;
				LA6: ;
				{
					unsureAsgnRef((void**) (&a[(i_262261)- 0]), NIM_NIL);
				}
				LA4: ;
				res_262285 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, processtoplevelstmtcached_262367)(Tnode215790* n, Tpasscontext262002** a) {
	Tnode215790* m;
	m = n;
	{
		NI i_262384;
		NI HEX3Atmp_262393;
		NI res_262396;
		i_262384 = 0;
		HEX3Atmp_262393 = 0;
		HEX3Atmp_262393 = (NI)(gpasseslen_262140 - ((NI) 1));
		res_262396 = ((NI) 0);
		{
			while (1) {
				if (!(res_262396 <= HEX3Atmp_262393)) goto LA3;
				i_262384 = res_262396;
				{
					if (!!(gpasses_262139[(i_262384)- 0].Field1 == 0)) goto LA6;
					m = gpasses_262139[(i_262384)- 0].Field2(a[(i_262384)- 0], m);
				}
				LA6: ;
				res_262396 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, closepassescached_262401)(Tpasscontext262002** a) {
	Tnode215790* m;
	m = NIM_NIL;
	{
		NI i_262417;
		NI HEX3Atmp_262434;
		NI res_262437;
		i_262417 = 0;
		HEX3Atmp_262434 = 0;
		HEX3Atmp_262434 = (NI)(gpasseslen_262140 - ((NI) 1));
		res_262437 = ((NI) 0);
		{
			while (1) {
				if (!(res_262437 <= HEX3Atmp_262434)) goto LA3;
				i_262417 = res_262437;
				{
					NIM_BOOL LOC6;
					LOC6 = 0;
					LOC6 = !(gpasses_262139[(i_262417)- 0].Field1 == 0);
					if (!(LOC6)) goto LA7;
					LOC6 = !(gpasses_262139[(i_262417)- 0].Field3 == 0);
					LA7: ;
					if (!LOC6) goto LA8;
					m = gpasses_262139[(i_262417)- 0].Field3(a[(i_262417)- 0], m);
				}
				LA8: ;
				unsureAsgnRef((void**) (&a[(i_262417)- 0]), NIM_NIL);
				res_262437 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, processmodule_262044)(Tsym215822* module, Tllstream203204* stream, Trodreader253021* rd) {
	Tparsers239026 p;
	Tpasscontextarray262135 a;
	Tllstream203204* s;
	NI32 fileidx;
{	memset((void*)(&p), 0, sizeof(p));
	objectInit((&p), (&NTI239026));
	memset((void*)a, 0, sizeof(a));
	s = 0;
	fileidx = ((NI32) ((*module).position));
	{
		if (!(rd == NIM_NIL)) goto LA3;
		openpasses_262211(a, module);
		{
			NimStringDesc* filename;
			if (!(stream == NIM_NIL)) goto LA7;
			filename = tofullpathconsiderdirty_184401(fileidx);
			s = llstreamopen_203241(filename, ((NU8) 0));
			{
				if (!(s == NIM_NIL)) goto LA11;
				rawmessage_186612(((NU16) 3), filename);
				goto BeforeRet;
			}
			LA11: ;
		}
		goto LA5;
		LA7: ;
		{
			s = stream;
		}
		LA5: ;
		{
			while (1) {
				openparsers_239032((&p), fileidx, s);
				{
					if (!!((((*module).flags &(1U<<((NU)(((NU8) 13))&31U)))!=0))) goto LA18;
					processimplicits_262443(implicitimports_161242, ((NU8) 116), a);
					processimplicits_262443(implicitincludes_161260, ((NU8) 121), a);
				}
				LA18: ;
				{
					while (1) {
						Tnode215790* n_262533;
						n_262533 = parsetoplevelstmt_239046((&p));
						{
							if (!((*n_262533).kind == ((NU8) 1))) goto LA24;
							goto LA20;
						}
						LA24: ;
						{
							Tnode215790* sl;
							NIM_BOOL LOC36;
							if (!(((*module).flags &(1U<<((NU)(((NU8) 8))&31U)))!=0)) goto LA28;
							sl = newnodei_217248(((NU8) 115), (*n_262533).info);
							add_216114(sl, n_262533);
							{
								while (1) {
									Tnode215790* n;
									n = parsetoplevelstmt_239046((&p));
									{
										if (!((*n).kind == ((NU8) 1))) goto LA34;
										goto LA30;
									}
									LA34: ;
									add_216114(sl, n);
								}
							} LA30: ;
							LOC36 = 0;
							LOC36 = processtoplevelstmt_262324(sl, a);
							goto LA20;
						}
						goto LA26;
						LA28: ;
						{
							NIM_BOOL LOC38;
							LOC38 = 0;
							LOC38 = processtoplevelstmt_262324(n_262533, a);
							if (!!(LOC38)) goto LA39;
							goto LA20;
						}
						goto LA26;
						LA39: ;
						LA26: ;
					}
				} LA20: ;
				closeparsers_239038((&p));
				{
					if (!!(((*s).kind == ((NU8) 3)))) goto LA43;
					goto LA14;
				}
				LA43: ;
			}
		} LA14: ;
		closepasses_262290(a);
		idsynchronizationpoint_214432(((NI) 1000));
	}
	goto LA1;
	LA3: ;
	{
		Tnode215790* n;
		openpassescached_262244(a, module, rd);
		n = loadinitsection_253082(rd);
		{
			NI i_262595;
			NI HEX3Atmp_262607;
			NI LOC47;
			NI res_262610;
			i_262595 = 0;
			HEX3Atmp_262607 = 0;
			LOC47 = 0;
			LOC47 = sonslen_218351(n);
			HEX3Atmp_262607 = (NI)(LOC47 - ((NI) 1));
			res_262610 = ((NI) 0);
			{
				while (1) {
					if (!(res_262610 <= HEX3Atmp_262607)) goto LA49;
					i_262595 = res_262610;
					processtoplevelstmtcached_262367((*n).kindU.S6.sons->data[i_262595], a);
					res_262610 += ((NI) 1);
				} LA49: ;
			}
		}
		closepassescached_262401(a);
	}
	LA1: ;
	}BeforeRet: ;
}

N_NIMCALL(void, registerpass_262145)(Tpass262014 p) {
	gpasses_262139[(gpasseslen_262140)- 0] = p;
	gpasseslen_262140 += ((NI) 1);
}

N_NIMCALL(void, clearpasses_262143)(void) {
	gpasseslen_262140 = ((NI) 0);
}

N_NIMCALL(NIM_BOOL, astneeded_262069)(Tsym215822* s) {
	NIM_BOOL result;
	result = 0;
	{
		NIM_BOOL LOC3;
		NIM_BOOL LOC4;
		NIM_BOOL LOC5;
		LOC3 = 0;
		LOC4 = 0;
		LOC5 = 0;
		LOC5 = ((12288 &(1U<<((NU)((*s).kind)&31U)))!=0);
		if (!(LOC5)) goto LA6;
		LOC5 = ((8454144 & (*s).flags) == 0);
		LA6: ;
		LOC4 = LOC5;
		if (!(LOC4)) goto LA7;
		LOC4 = !(((*(*s).typ).callconv == ((NU8) 5)));
		LA7: ;
		LOC3 = LOC4;
		if (!(LOC3)) goto LA8;
		LOC3 = ((*(*(*s).ast).kindU.S6.sons->data[((NI) 2)]).kind == ((NU8) 1));
		LA8: ;
		if (!LOC3) goto LA9;
		result = NIM_FALSE;
	}
	goto LA1;
	LA9: ;
	{
		result = NIM_TRUE;
	}
	LA1: ;
	return result;
}

N_NIMCALL(void, carrypass_262157)(Tpass262014 p, Tsym215822* module, TY338746 m, TY338746* Result) {
	Tpasscontext262002* c;
	c = p.Field0(module);
	unsureAsgnRef((void**) (&(*Result).Field0), p.Field2(c, m.Field0));
	{
		if (!!((p.Field3 == NIM_NIL))) goto LA3;
		unsureAsgnRef((void**) (&(*Result).Field1), p.Field3(c, m.Field1));
	}
	goto LA1;
	LA3: ;
	{
		unsureAsgnRef((void**) (&(*Result).Field1), m.Field1);
	}
	LA1: ;
}

N_NIMCALL(void, carrypasses_262174)(Tnode215790* nodes, Tsym215822* module, Tpass262014* passes, NI passesLen0) {
	TY338746 passdata;
	memset((void*)(&passdata), 0, sizeof(passdata));
	passdata.Field0 = nodes;
	{
		Tpass262014 pass_262205;
		NI i_262210;
		memset((void*)(&pass_262205), 0, sizeof(pass_262205));
		i_262210 = ((NI) 0);
		{
			while (1) {
				TY338746 LOC4;
				if (!(i_262210 < passesLen0)) goto LA3;
				pass_262205 = passes[i_262210];
				memset((void*)(&LOC4), 0, sizeof(LOC4));
				carrypass_262157(pass_262205, module, passdata, (&LOC4));
				passdata.Field0 = LOC4.Field0;
				passdata.Field1 = LOC4.Field1;
				i_262210 += ((NI) 1);
			} LA3: ;
		}
	}
}
NIM_EXTERNC N_NOINLINE(void, compiler_passesInit000)(void) {
}

NIM_EXTERNC N_NOINLINE(void, compiler_passesDatInit000)(void) {
static TNimNode TMP923[1];
NTI262002.size = sizeof(Tpasscontext262002);
NTI262002.kind = 17;
NTI262002.base = (&NTI3608);
NTI262002.flags = 1;
TMP923[0].kind = 1;
TMP923[0].offset = offsetof(Tpasscontext262002, fromcache);
TMP923[0].typ = (&NTI130);
TMP923[0].name = "fromCache";
NTI262002.node = &TMP923[0];
}

