/* 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 Tsym214822 Tsym214822;
typedef struct Tnode214790 Tnode214790;
typedef struct Tpass261014 Tpass261014;
typedef struct Tpasscontext261002 Tpasscontext261002;
typedef struct Trodreader252021 Trodreader252021;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct TNimObject TNimObject;
typedef struct Tllstream202204 Tllstream202204;
typedef struct Tparsers238026 Tparsers238026;
typedef struct Tparser228202 Tparser228202;
typedef struct Tlexer205173 Tlexer205173;
typedef struct Tbaselexer203015 Tbaselexer203015;
typedef struct Tlineinfo182337 Tlineinfo182337;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Ttoken205169 Ttoken205169;
typedef struct Tident189012 Tident189012;
typedef struct Tidobj189006 Tidobj189006;
typedef struct Ttypeseq214824 Ttypeseq214824;
typedef struct Tscope214816 Tscope214816;
typedef struct TY214925 TY214925;
typedef struct Tstrtable214794 Tstrtable214794;
typedef struct Tsymseq214792 Tsymseq214792;
typedef struct Ttype214828 Ttype214828;
typedef struct Tloc214804 Tloc214804;
typedef struct Ropeobj169006 Ropeobj169006;
typedef struct Tlib214808 Tlib214808;
typedef struct TY125202 TY125202;
typedef struct Tnodeseq214784 Tnodeseq214784;
typedef struct TY337746 TY337746;
typedef struct TY214913 TY214913;
typedef struct Tindex252019 Tindex252019;
typedef struct Tiitable221163 Tiitable221163;
typedef struct Tiipairseq221161 Tiipairseq221161;
typedef struct Table252054 Table252054;
typedef struct Keyvaluepairseq252057 Keyvaluepairseq252057;
typedef struct Memfile250202 Memfile250202;
typedef struct Tinstantiation214812 Tinstantiation214812;
typedef struct Tlistentry135010 Tlistentry135010;
typedef struct Tiipair221159 Tiipair221159;
typedef struct Keyvaluepair252060 Keyvaluepair252060;
typedef N_NIMCALL_PTR(Tsym214822*, TY261049) (Tsym214822* m, NI32 fileidx);
typedef N_NIMCALL_PTR(Tnode214790*, TY261054) (Tsym214822* m, NI32 fileidx);
typedef N_NIMCALL_PTR(Tpasscontext261002*, Tpassopen261006) (Tsym214822* module);
typedef N_NIMCALL_PTR(Tpasscontext261002*, Tpassopencached261008) (Tsym214822* module, Trodreader252021* rd);
typedef N_NIMCALL_PTR(Tnode214790*, Tpassprocess261012) (Tpasscontext261002* p, Tnode214790* toplevelstmt);
typedef N_NIMCALL_PTR(Tnode214790*, Tpassclose261010) (Tpasscontext261002* p, Tnode214790* n);
struct Tpass261014 {
Tpassopen261006 Field0;
Tpassopencached261008 Field1;
Tpassprocess261012 Field2;
Tpassclose261010 Field3;
};
typedef Tpass261014 TY261138[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  Tpasscontext261002  {
  TNimObject Sup;
NIM_BOOL fromcache;
};
struct  Tbaselexer203015  {
  TNimObject Sup;
NI bufpos;
NCSTRING buf;
NI buflen;
Tllstream202204* 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) (Tlineinfo182337 info, NU16 msg, NimStringDesc* arg, void* ClEnv);
void* ClEnv;
} Terrorhandler205171;
struct  Tlexer205173  {
  Tbaselexer203015 Sup;
NI32 fileidx;
NI indentahead;
NI currlineindent;
NIM_BOOL strongspaces;
Terrorhandler205171 errorhandler;
};
struct  Ttoken205169  {
NU8 toktype;
NI indent;
Tident189012* ident;
NI64 inumber;
NF fnumber;
NU8 base;
NI8 strongspacea;
NI8 strongspaceb;
NimStringDesc* literal;
NI line;
NI col;
};
struct  Tparser228202  {
NI currind;
NIM_BOOL firsttok;
NIM_BOOL strongspaces;
Tlexer205173 lex;
Ttoken205169 tok;
NI inpragma;
NI insemistmtlist;
};
struct  Tparsers238026  {
NU8 skin;
Tparser228202 parser;
};
typedef Tpasscontext261002* Tpasscontextarray261135[10];
struct  Tidobj189006  {
  TNimObject Sup;
NI id;
};
struct  Tstrtable214794  {
NI counter;
Tsymseq214792* data;
};
struct  Tlineinfo182337  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tloc214804  {
NU8 k;
NU8 s;
NU16 flags;
Ttype214828* t;
Ropeobj169006* r;
Ropeobj169006* heaproot;
};
struct  Tsym214822  {
  Tidobj189006 Sup;
NU8 kind;
union{
struct {Ttypeseq214824* typeinstcache;
Tscope214816* typscope;
} S1;
struct {TY214925* procinstcache;
Tsym214822* gcunsafetyreason;
} S2;
struct {TY214925* usedgenerics;
Tstrtable214794 tab;
} S3;
struct {Tsym214822* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype214828* typ;
Tident189012* name;
Tlineinfo182337 info;
Tsym214822* owner;
NU32 flags;
Tnode214790* ast;
NU32 options;
NI position;
NI offset;
Tloc214804 loc;
Tlib214808* annex;
Tnode214790* constraint;
};
struct  Tnode214790  {
Ttype214828* typ;
Tlineinfo182337 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym214822* sym;
} S4;
struct {Tident189012* ident;
} S5;
struct {Tnodeseq214784* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Tllstream202204  {
  TNimObject Sup;
NU8 kind;
FILE* f;
NimStringDesc* s;
NI rd;
NI wr;
NI lineoffset;
};
struct  Ttype214828  {
  Tidobj189006 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq214824* sons;
Tnode214790* n;
Tsym214822* owner;
Tsym214822* sym;
Tsym214822* destructor;
Tsym214822* deepcopy;
Tsym214822* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc214804 loc;
};
struct TY337746 {
Tnode214790* Field0;
Tnode214790* Field1;
};
struct  Tiitable221163  {
NI counter;
Tiipairseq221161* data;
};
struct  Tindex252019  {
NI lastidxkey;
NI lastidxval;
Tiitable221163 tab;
NimStringDesc* r;
NI offset;
};
struct  Table252054  {
Keyvaluepairseq252057* data;
NI counter;
};
struct  Memfile250202  {
void* mem;
NI size;
int handle;
};
struct  Trodreader252021  {
  TNimObject Sup;
NI pos;
NCSTRING s;
NU32 options;
NU8 reason;
TY214913* moddeps;
TY214913* files;
NI dataidx;
NI convertersidx;
NI initidx;
NI interfidx;
NI compilerprocsidx;
NI methodsidx;
NimStringDesc* filename;
Tindex252019 index;
Tindex252019 imports;
NI readerindex;
NI line;
NI moduleid;
Table252054 syms;
Memfile250202 memfile;
Tsymseq214792* methods;
NimStringDesc* origfile;
NIM_BOOL inviewmode;
};
struct  Tident189012  {
  Tidobj189006 Sup;
NimStringDesc* s;
Tident189012* next;
NI h;
};
struct  Tscope214816  {
NI depthlevel;
Tstrtable214794 symbols;
Tnodeseq214784* usingsyms;
Tscope214816* parent;
};
struct  Ropeobj169006  {
  TNimObject Sup;
Ropeobj169006* left;
Ropeobj169006* right;
NI length;
NimStringDesc* data;
};
struct  Tlistentry135010  {
  TNimObject Sup;
Tlistentry135010* prev;
Tlistentry135010* next;
};
struct  Tlib214808  {
  Tlistentry135010 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj169006* name;
Tnode214790* path;
};
struct  Tiipair221159  {
NI key;
NI val;
};
struct Keyvaluepair252060 {
NI Field0;
NI Field1;
Tsym214822* Field2;
};
struct  Tinstantiation214812  {
Tsym214822* sym;
Ttypeseq214824* concretetypes;
TY214913* usedby;
NI compilesid;
};
struct TY125202 {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct Ttypeseq214824 {
  TGenericSeq Sup;
  Ttype214828* data[SEQ_DECL_SIZE];
};
struct TY214925 {
  TGenericSeq Sup;
  Tinstantiation214812* data[SEQ_DECL_SIZE];
};
struct Tsymseq214792 {
  TGenericSeq Sup;
  Tsym214822* data[SEQ_DECL_SIZE];
};
struct Tnodeseq214784 {
  TGenericSeq Sup;
  Tnode214790* data[SEQ_DECL_SIZE];
};
struct TY214913 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct Tiipairseq221161 {
  TGenericSeq Sup;
  Tiipair221159 data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq252057 {
  TGenericSeq Sup;
  Keyvaluepair252060 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, objectInit)(void* dest, TNimType* typ);
N_NIMCALL(void, openpasses_261211)(Tpasscontext261002** a, Tsym214822* module);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(NimStringDesc*, tofullpathconsiderdirty_183401)(NI32 fileidx);
N_NIMCALL(Tllstream202204*, llstreamopen_202241)(NimStringDesc* filename, NU8 mode);
N_NIMCALL(void, rawmessage_185612)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, openparsers_238032)(Tparsers238026* p, NI32 fileidx, Tllstream202204* inputstream);
N_NIMCALL(void, processimplicits_261443)(TY125202* implicits, NU8 nodekind, Tpasscontext261002** a);
N_NIMCALL(Tnode214790*, newnodei_216248)(NU8 kind, Tlineinfo182337 info);
N_NIMCALL(Tnode214790*, newstrnode_215678)(NU8 kind, NimStringDesc* strval);
N_NIMCALL(void, addson_216807)(Tnode214790* father, Tnode214790* son);
N_NIMCALL(NIM_BOOL, processtoplevelstmt_261324)(Tnode214790* n, Tpasscontext261002** a);
N_NIMCALL(Tnode214790*, parsetoplevelstmt_238046)(Tparsers238026* p);
N_NIMCALL(void, add_215114)(Tnode214790* father, Tnode214790* son);
N_NIMCALL(void, closeparsers_238038)(Tparsers238026* p);
N_NIMCALL(void, closepasses_261290)(Tpasscontext261002** a);
N_NIMCALL(void, idsynchronizationpoint_213432)(NI idrange);
N_NIMCALL(void, openpassescached_261244)(Tpasscontext261002** a, Tsym214822* module, Trodreader252021* rd);
N_NIMCALL(Tnode214790*, loadinitsection_252082)(Trodreader252021* r);
N_NIMCALL(NI, sonslen_217351)(Tnode214790* n);
N_NIMCALL(void, processtoplevelstmtcached_261367)(Tnode214790* n, Tpasscontext261002** a);
N_NIMCALL(void, closepassescached_261401)(Tpasscontext261002** a);
N_NIMCALL(void, carrypass_261157)(Tpass261014 p, Tsym214822* module, TY337746 m, TY337746* Result);
TY261049 gimportmodule_261053;
TY261054 gincludefile_261058;
TY261138 gpasses_261139;
NI gpasseslen_261140;
extern TNimType NTI3608; /* RootObj */
TNimType NTI261002; /* TPassContext */
extern TNimType NTI130; /* bool */
extern TNimType NTI238026; /* TParsers */
extern Tlineinfo182337 gcmdlineinfo_183046;
extern TY125202* implicitimports_160242;
extern TY125202* implicitincludes_160260;

N_NIMCALL(void, openpasses_261211)(Tpasscontext261002** a, Tsym214822* module) {
	{
		NI i_261227;
		NI HEX3Atmp_261236;
		NI res_261239;
		i_261227 = 0;
		HEX3Atmp_261236 = 0;
		HEX3Atmp_261236 = (NI)(gpasseslen_261140 - ((NI) 1));
		res_261239 = ((NI) 0);
		{
			while (1) {
				if (!(res_261239 <= HEX3Atmp_261236)) goto LA3;
				i_261227 = res_261239;
				{
					if (!!(gpasses_261139[(i_261227)- 0].Field0 == 0)) goto LA6;
					unsureAsgnRef((void**) (&a[(i_261227)- 0]), gpasses_261139[(i_261227)- 0].Field0(module));
				}
				goto LA4;
				LA6: ;
				{
					unsureAsgnRef((void**) (&a[(i_261227)- 0]), NIM_NIL);
				}
				LA4: ;
				res_261239 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(NIM_BOOL, processtoplevelstmt_261324)(Tnode214790* n, Tpasscontext261002** a) {
	NIM_BOOL result;
	Tnode214790* m;
{	result = 0;
	m = n;
	{
		NI i_261342;
		NI HEX3Atmp_261359;
		NI res_261362;
		i_261342 = 0;
		HEX3Atmp_261359 = 0;
		HEX3Atmp_261359 = (NI)(gpasseslen_261140 - ((NI) 1));
		res_261362 = ((NI) 0);
		{
			while (1) {
				if (!(res_261362 <= HEX3Atmp_261359)) goto LA3;
				i_261342 = res_261362;
				{
					if (!!(gpasses_261139[(i_261342)- 0].Field2 == 0)) goto LA6;
					m = gpasses_261139[(i_261342)- 0].Field2(a[(i_261342)- 0], m);
					{
						if (!m == 0) goto LA10;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA10: ;
				}
				LA6: ;
				res_261362 += ((NI) 1);
			} LA3: ;
		}
	}
	result = NIM_TRUE;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, processimplicits_261443)(TY125202* implicits, NU8 nodekind, Tpasscontext261002** a) {
	{
		NimStringDesc* module_261458;
		NI i_261465;
		NI L_261467;
		module_261458 = 0;
		i_261465 = ((NI) 0);
		L_261467 = (implicits ? implicits->Sup.len : 0);
		{
			while (1) {
				Tnode214790* importstmt;
				Tnode214790* str;
				if (!(i_261465 < L_261467)) goto LA3;
				module_261458 = implicits->data[i_261465];
				importstmt = newnodei_216248(nodekind, gcmdlineinfo_183046);
				str = newstrnode_215678(((NU8) 20), module_261458);
				(*str).info = gcmdlineinfo_183046;
				addson_216807(importstmt, str);
				{
					NIM_BOOL LOC6;
					LOC6 = 0;
					LOC6 = processtoplevelstmt_261324(importstmt, a);
					if (!!(LOC6)) goto LA7;
					goto LA1;
				}
				LA7: ;
				i_261465 += ((NI) 1);
			} LA3: ;
		}
	} LA1: ;
}

N_NIMCALL(void, closepasses_261290)(Tpasscontext261002** a) {
	Tnode214790* m;
	m = NIM_NIL;
	{
		NI i_261306;
		NI HEX3Atmp_261316;
		NI res_261319;
		i_261306 = 0;
		HEX3Atmp_261316 = 0;
		HEX3Atmp_261316 = (NI)(gpasseslen_261140 - ((NI) 1));
		res_261319 = ((NI) 0);
		{
			while (1) {
				if (!(res_261319 <= HEX3Atmp_261316)) goto LA3;
				i_261306 = res_261319;
				{
					if (!!(gpasses_261139[(i_261306)- 0].Field3 == 0)) goto LA6;
					m = gpasses_261139[(i_261306)- 0].Field3(a[(i_261306)- 0], m);
				}
				LA6: ;
				unsureAsgnRef((void**) (&a[(i_261306)- 0]), NIM_NIL);
				res_261319 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, openpassescached_261244)(Tpasscontext261002** a, Tsym214822* module, Trodreader252021* rd) {
	{
		NI i_261261;
		NI HEX3Atmp_261282;
		NI res_261285;
		i_261261 = 0;
		HEX3Atmp_261282 = 0;
		HEX3Atmp_261282 = (NI)(gpasseslen_261140 - ((NI) 1));
		res_261285 = ((NI) 0);
		{
			while (1) {
				if (!(res_261285 <= HEX3Atmp_261282)) goto LA3;
				i_261261 = res_261285;
				{
					if (!!(gpasses_261139[(i_261261)- 0].Field1 == 0)) goto LA6;
					unsureAsgnRef((void**) (&a[(i_261261)- 0]), gpasses_261139[(i_261261)- 0].Field1(module, rd));
					{
						if (!!((a[(i_261261)- 0] == NIM_NIL))) goto LA10;
						(*a[(i_261261)- 0]).fromcache = NIM_TRUE;
					}
					LA10: ;
				}
				goto LA4;
				LA6: ;
				{
					unsureAsgnRef((void**) (&a[(i_261261)- 0]), NIM_NIL);
				}
				LA4: ;
				res_261285 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, processtoplevelstmtcached_261367)(Tnode214790* n, Tpasscontext261002** a) {
	Tnode214790* m;
	m = n;
	{
		NI i_261384;
		NI HEX3Atmp_261393;
		NI res_261396;
		i_261384 = 0;
		HEX3Atmp_261393 = 0;
		HEX3Atmp_261393 = (NI)(gpasseslen_261140 - ((NI) 1));
		res_261396 = ((NI) 0);
		{
			while (1) {
				if (!(res_261396 <= HEX3Atmp_261393)) goto LA3;
				i_261384 = res_261396;
				{
					if (!!(gpasses_261139[(i_261384)- 0].Field1 == 0)) goto LA6;
					m = gpasses_261139[(i_261384)- 0].Field2(a[(i_261384)- 0], m);
				}
				LA6: ;
				res_261396 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, closepassescached_261401)(Tpasscontext261002** a) {
	Tnode214790* m;
	m = NIM_NIL;
	{
		NI i_261417;
		NI HEX3Atmp_261434;
		NI res_261437;
		i_261417 = 0;
		HEX3Atmp_261434 = 0;
		HEX3Atmp_261434 = (NI)(gpasseslen_261140 - ((NI) 1));
		res_261437 = ((NI) 0);
		{
			while (1) {
				if (!(res_261437 <= HEX3Atmp_261434)) goto LA3;
				i_261417 = res_261437;
				{
					NIM_BOOL LOC6;
					LOC6 = 0;
					LOC6 = !(gpasses_261139[(i_261417)- 0].Field1 == 0);
					if (!(LOC6)) goto LA7;
					LOC6 = !(gpasses_261139[(i_261417)- 0].Field3 == 0);
					LA7: ;
					if (!LOC6) goto LA8;
					m = gpasses_261139[(i_261417)- 0].Field3(a[(i_261417)- 0], m);
				}
				LA8: ;
				unsureAsgnRef((void**) (&a[(i_261417)- 0]), NIM_NIL);
				res_261437 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, processmodule_261044)(Tsym214822* module, Tllstream202204* stream, Trodreader252021* rd) {
	Tparsers238026 p;
	Tpasscontextarray261135 a;
	Tllstream202204* s;
	NI32 fileidx;
{	memset((void*)(&p), 0, sizeof(p));
	objectInit((&p), (&NTI238026));
	memset((void*)a, 0, sizeof(a));
	s = 0;
	fileidx = ((NI32) ((*module).position));
	{
		if (!(rd == NIM_NIL)) goto LA3;
		openpasses_261211(a, module);
		{
			NimStringDesc* filename;
			if (!(stream == NIM_NIL)) goto LA7;
			filename = tofullpathconsiderdirty_183401(fileidx);
			s = llstreamopen_202241(filename, ((NU8) 0));
			{
				if (!(s == NIM_NIL)) goto LA11;
				rawmessage_185612(((NU16) 3), filename);
				goto BeforeRet;
			}
			LA11: ;
		}
		goto LA5;
		LA7: ;
		{
			s = stream;
		}
		LA5: ;
		{
			while (1) {
				openparsers_238032((&p), fileidx, s);
				{
					if (!!((((*module).flags &(1U<<((NU)(((NU8) 13))&31U)))!=0))) goto LA18;
					processimplicits_261443(implicitimports_160242, ((NU8) 116), a);
					processimplicits_261443(implicitincludes_160260, ((NU8) 121), a);
				}
				LA18: ;
				{
					while (1) {
						Tnode214790* n_261533;
						n_261533 = parsetoplevelstmt_238046((&p));
						{
							if (!((*n_261533).kind == ((NU8) 1))) goto LA24;
							goto LA20;
						}
						LA24: ;
						{
							Tnode214790* sl;
							NIM_BOOL LOC36;
							if (!(((*module).flags &(1U<<((NU)(((NU8) 8))&31U)))!=0)) goto LA28;
							sl = newnodei_216248(((NU8) 115), (*n_261533).info);
							add_215114(sl, n_261533);
							{
								while (1) {
									Tnode214790* n;
									n = parsetoplevelstmt_238046((&p));
									{
										if (!((*n).kind == ((NU8) 1))) goto LA34;
										goto LA30;
									}
									LA34: ;
									add_215114(sl, n);
								}
							} LA30: ;
							LOC36 = 0;
							LOC36 = processtoplevelstmt_261324(sl, a);
							goto LA20;
						}
						goto LA26;
						LA28: ;
						{
							NIM_BOOL LOC38;
							LOC38 = 0;
							LOC38 = processtoplevelstmt_261324(n_261533, a);
							if (!!(LOC38)) goto LA39;
							goto LA20;
						}
						goto LA26;
						LA39: ;
						LA26: ;
					}
				} LA20: ;
				closeparsers_238038((&p));
				{
					if (!!(((*s).kind == ((NU8) 3)))) goto LA43;
					goto LA14;
				}
				LA43: ;
			}
		} LA14: ;
		closepasses_261290(a);
		idsynchronizationpoint_213432(((NI) 1000));
	}
	goto LA1;
	LA3: ;
	{
		Tnode214790* n;
		openpassescached_261244(a, module, rd);
		n = loadinitsection_252082(rd);
		{
			NI i_261595;
			NI HEX3Atmp_261607;
			NI LOC47;
			NI res_261610;
			i_261595 = 0;
			HEX3Atmp_261607 = 0;
			LOC47 = 0;
			LOC47 = sonslen_217351(n);
			HEX3Atmp_261607 = (NI)(LOC47 - ((NI) 1));
			res_261610 = ((NI) 0);
			{
				while (1) {
					if (!(res_261610 <= HEX3Atmp_261607)) goto LA49;
					i_261595 = res_261610;
					processtoplevelstmtcached_261367((*n).kindU.S6.sons->data[i_261595], a);
					res_261610 += ((NI) 1);
				} LA49: ;
			}
		}
		closepassescached_261401(a);
	}
	LA1: ;
	}BeforeRet: ;
}

N_NIMCALL(void, registerpass_261145)(Tpass261014 p) {
	gpasses_261139[(gpasseslen_261140)- 0] = p;
	gpasseslen_261140 += ((NI) 1);
}

N_NIMCALL(void, clearpasses_261143)(void) {
	gpasseslen_261140 = ((NI) 0);
}

N_NIMCALL(NIM_BOOL, astneeded_261069)(Tsym214822* 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_261157)(Tpass261014 p, Tsym214822* module, TY337746 m, TY337746* Result) {
	Tpasscontext261002* 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_261174)(Tnode214790* nodes, Tsym214822* module, Tpass261014* passes, NI passesLen0) {
	TY337746 passdata;
	memset((void*)(&passdata), 0, sizeof(passdata));
	passdata.Field0 = nodes;
	{
		Tpass261014 pass_261205;
		NI i_261210;
		memset((void*)(&pass_261205), 0, sizeof(pass_261205));
		i_261210 = ((NI) 0);
		{
			while (1) {
				TY337746 LOC4;
				if (!(i_261210 < passesLen0)) goto LA3;
				pass_261205 = passes[i_261210];
				memset((void*)(&LOC4), 0, sizeof(LOC4));
				carrypass_261157(pass_261205, module, passdata, (&LOC4));
				passdata.Field0 = LOC4.Field0;
				passdata.Field1 = LOC4.Field1;
				i_261210 += ((NI) 1);
			} LA3: ;
		}
	}
}
NIM_EXTERNC N_NOINLINE(void, compiler_passesInit000)(void) {
}

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

