/* 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 <string.h>
#include <stdio.h>
typedef struct Tsym223841 Tsym223841;
typedef struct Tnode223809 Tnode223809;
typedef struct Tpass275017 Tpass275017;
typedef struct Tpasscontext275005 Tpasscontext275005;
typedef struct Trodreader266030 Trodreader266030;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct TNimObject TNimObject;
typedef struct Tllstream211204 Tllstream211204;
typedef struct Tparsers251035 Tparsers251035;
typedef struct Tparser239205 Tparser239205;
typedef struct Tlexer214185 Tlexer214185;
typedef struct Tbaselexer212024 Tbaselexer212024;
typedef struct Tlineinfo188352 Tlineinfo188352;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Ttoken214181 Ttoken214181;
typedef struct Tident196021 Tident196021;
typedef struct Tidobj196015 Tidobj196015;
typedef struct Ttypeseq223843 Ttypeseq223843;
typedef struct Tscope223835 Tscope223835;
typedef struct TY223944 TY223944;
typedef struct Tstrtable223813 Tstrtable223813;
typedef struct Tsymseq223811 Tsymseq223811;
typedef struct Ttype223847 Ttype223847;
typedef struct Tloc223823 Tloc223823;
typedef struct Ropeobj174009 Ropeobj174009;
typedef struct Tlib223827 Tlib223827;
typedef struct TY129408 TY129408;
typedef struct Tnodeseq223803 Tnodeseq223803;
typedef struct TY358220 TY358220;
typedef struct TY223932 TY223932;
typedef struct Tindex266028 Tindex266028;
typedef struct Tiitable231274 Tiitable231274;
typedef struct Tiipairseq231272 Tiipairseq231272;
typedef struct Table266063 Table266063;
typedef struct Keyvaluepairseq266066 Keyvaluepairseq266066;
typedef struct Memfile264208 Memfile264208;
typedef struct Tinstantiation223831 Tinstantiation223831;
typedef struct Tlistentry139022 Tlistentry139022;
typedef struct Tiipair231270 Tiipair231270;
typedef struct Keyvaluepair266069 Keyvaluepair266069;
typedef N_NIMCALL_PTR(Tsym223841*, TY275064) (Tsym223841* m, NI32 fileidx);
typedef N_NIMCALL_PTR(Tnode223809*, TY275069) (Tsym223841* m, NI32 fileidx);
typedef N_NIMCALL_PTR(Tpasscontext275005*, Tpassopen275009) (Tsym223841* module);
typedef N_NIMCALL_PTR(Tpasscontext275005*, Tpassopencached275011) (Tsym223841* module, Trodreader266030* rd);
typedef N_NIMCALL_PTR(Tnode223809*, Tpassprocess275015) (Tpasscontext275005* p, Tnode223809* toplevelstmt);
typedef N_NIMCALL_PTR(Tnode223809*, Tpassclose275013) (Tpasscontext275005* p, Tnode223809* n);
struct Tpass275017 {
Tpassopen275009 Field0;
Tpassopencached275011 Field1;
Tpassprocess275015 Field2;
Tpassclose275013 Field3;
};
typedef Tpass275017 TY275174[10];
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  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Tpasscontext275005  {
  TNimObject Sup;
NIM_BOOL fromcache;
};
struct  Tbaselexer212024  {
  TNimObject Sup;
NI bufpos;
NCSTRING buf;
NI buflen;
Tllstream211204* 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) (Tlineinfo188352 info, NU16 msg, NimStringDesc* arg, void* ClEnv);
void* ClEnv;
} Terrorhandler214183;
struct  Tlexer214185  {
  Tbaselexer212024 Sup;
NI32 fileidx;
NI indentahead;
NI currlineindent;
NIM_BOOL strongspaces;
Terrorhandler214183 errorhandler;
};
struct  Ttoken214181  {
NU8 toktype;
NI indent;
Tident196021* ident;
NI64 inumber;
NF fnumber;
NU8 base;
NI8 strongspacea;
NI8 strongspaceb;
NimStringDesc* literal;
NI line;
NI col;
};
struct  Tparser239205  {
NI currind;
NIM_BOOL firsttok;
NIM_BOOL strongspaces;
Tlexer214185 lex;
Ttoken214181 tok;
NI inpragma;
NI insemistmtlist;
};
struct  Tparsers251035  {
NU8 skin;
Tparser239205 parser;
};
typedef Tpasscontext275005* Tpasscontextarray275168[10];
struct  Tidobj196015  {
  TNimObject Sup;
NI id;
};
struct  Tstrtable223813  {
NI counter;
Tsymseq223811* data;
};
struct  Tlineinfo188352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tloc223823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype223847* t;
Ropeobj174009* r;
Ropeobj174009* heaproot;
};
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  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  Tllstream211204  {
  TNimObject Sup;
NU8 kind;
FILE* f;
NimStringDesc* s;
NI rd;
NI wr;
NI lineoffset;
};
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 TY358220 {
Tnode223809* Field0;
Tnode223809* Field1;
};
struct  Tiitable231274  {
NI counter;
Tiipairseq231272* data;
};
struct  Tindex266028  {
NI lastidxkey;
NI lastidxval;
Tiitable231274 tab;
NimStringDesc* r;
NI offset;
};
struct  Table266063  {
Keyvaluepairseq266066* data;
NI counter;
};
struct  Memfile264208  {
void* mem;
NI size;
int handle;
};
struct  Trodreader266030  {
  TNimObject Sup;
NI pos;
NCSTRING s;
NU32 options;
NU8 reason;
TY223932* moddeps;
TY223932* files;
NI dataidx;
NI convertersidx;
NI initidx;
NI interfidx;
NI compilerprocsidx;
NI methodsidx;
NimStringDesc* filename;
Tindex266028 index;
Tindex266028 imports;
NI readerindex;
NI line;
NI moduleid;
Table266063 syms;
Memfile264208 memfile;
Tsymseq223811* methods;
NimStringDesc* origfile;
NIM_BOOL inviewmode;
};
struct  Tident196021  {
  Tidobj196015 Sup;
NimStringDesc* s;
Tident196021* next;
NI h;
};
struct  Tscope223835  {
NI depthlevel;
Tstrtable223813 symbols;
Tnodeseq223803* usingsyms;
Tscope223835* parent;
};
struct  Ropeobj174009  {
  TNimObject Sup;
Ropeobj174009* left;
Ropeobj174009* right;
NI length;
NimStringDesc* data;
};
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  Tiipair231270  {
NI key;
NI val;
};
struct Keyvaluepair266069 {
NI Field0;
NI Field1;
Tsym223841* Field2;
};
struct  Tinstantiation223831  {
Tsym223841* sym;
Ttypeseq223843* concretetypes;
TY223932* usedby;
NI compilesid;
};
struct TY129408 {
  TGenericSeq Sup;
  NimStringDesc* 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 Tnodeseq223803 {
  TGenericSeq Sup;
  Tnode223809* data[SEQ_DECL_SIZE];
};
struct TY223932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct Tiipairseq231272 {
  TGenericSeq Sup;
  Tiipair231270 data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq266066 {
  TGenericSeq Sup;
  Keyvaluepair266069 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, objectInit)(void* dest, TNimType* typ);
N_NIMCALL(void, openpasses_275293)(Tpasscontext275005** a, Tsym223841* module);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(NimStringDesc*, tofullpathconsiderdirty_189807)(NI32 fileidx);
N_NIMCALL(Tllstream211204*, llstreamopen_211256)(NimStringDesc* filename, NU8 mode);
N_NIMCALL(void, rawmessage_192636)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, openparsers_251047)(Tparsers251035* p, NI32 fileidx, Tllstream211204* inputstream);
N_NIMCALL(void, processimplicits_275621)(TY129408* implicits, NU8 nodekind, Tpasscontext275005** a);
N_NIMCALL(Tnode223809*, newnodei_225351)(NU8 kind, Tlineinfo188352 info);
N_NIMCALL(Tnode223809*, newstrnode_224644)(NU8 kind, NimStringDesc* strval);
N_NIMCALL(void, addson_225819)(Tnode223809* father, Tnode223809* son);
N_NIMCALL(NIM_BOOL, processtoplevelstmt_275454)(Tnode223809* n, Tpasscontext275005** a);
N_NIMCALL(Tnode223809*, parsetoplevelstmt_251070)(Tparsers251035* p);
N_NIMCALL(void, add_224165)(Tnode223809* father, Tnode223809* son);
N_NIMCALL(void, closeparsers_251056)(Tparsers251035* p);
N_NIMCALL(void, closepasses_275404)(Tpasscontext275005** a);
N_NIMCALL(void, idsynchronizationpoint_222453)(NI idrange);
N_NIMCALL(void, openpassescached_275342)(Tpasscontext275005** a, Tsym223841* module, Trodreader266030* rd);
N_NIMCALL(Tnode223809*, loadinitsection_266100)(Trodreader266030* r);
N_NIMCALL(NI, sonslen_226387)(Tnode223809* n);
N_NIMCALL(void, processtoplevelstmtcached_275513)(Tnode223809* n, Tpasscontext275005** a);
N_NIMCALL(void, closepassescached_275563)(Tpasscontext275005** a);
N_NIMCALL(void, carrypass_275208)(Tpass275017 p, Tsym223841* module, TY358220 m, TY358220* Result);
TY275064 gimportmodule_275068;
TY275069 gincludefile_275073;
TY275174 gpasses_275175;
NI gpasseslen_275176;
extern TNimType NTI4011; /* RootObj */
TNimType NTI275005; /* TPassContext */
extern TNimType NTI138; /* bool */
extern TNimType NTI251035; /* TParsers */
extern Tlineinfo188352 gcmdlineinfo_189322;
extern TY129408* implicitimports_165277;
extern TY129408* implicitincludes_165295;

N_NIMCALL(void, openpasses_275293)(Tpasscontext275005** a, Tsym223841* module) {
	{
		NI i_275310;
		NI HEX3Atmp_275319;
		NI res_275322;
		i_275310 = 0;
		HEX3Atmp_275319 = 0;
		HEX3Atmp_275319 = (NI)(gpasseslen_275176 - ((NI) 1));
		res_275322 = ((NI) 0);
		{
			while (1) {
				if (!(res_275322 <= HEX3Atmp_275319)) goto LA3;
				i_275310 = res_275322;
				{
					if (!!(gpasses_275175[(i_275310)- 0].Field0 == 0)) goto LA6;
					unsureAsgnRef((void**) (&a[(i_275310)- 0]), gpasses_275175[(i_275310)- 0].Field0(module));
				}
				goto LA4;
				LA6: ;
				{
					unsureAsgnRef((void**) (&a[(i_275310)- 0]), NIM_NIL);
				}
				LA4: ;
				res_275322 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(NIM_BOOL, processtoplevelstmt_275454)(Tnode223809* n, Tpasscontext275005** a) {
	NIM_BOOL result;
	Tnode223809* m;
{	result = 0;
	m = n;
	{
		NI i_275473;
		NI HEX3Atmp_275490;
		NI res_275493;
		i_275473 = 0;
		HEX3Atmp_275490 = 0;
		HEX3Atmp_275490 = (NI)(gpasseslen_275176 - ((NI) 1));
		res_275493 = ((NI) 0);
		{
			while (1) {
				if (!(res_275493 <= HEX3Atmp_275490)) goto LA3;
				i_275473 = res_275493;
				{
					if (!!(gpasses_275175[(i_275473)- 0].Field2 == 0)) goto LA6;
					m = gpasses_275175[(i_275473)- 0].Field2(a[(i_275473)- 0], m);
					{
						if (!m == 0) goto LA10;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA10: ;
				}
				LA6: ;
				res_275493 += ((NI) 1);
			} LA3: ;
		}
	}
	result = NIM_TRUE;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, processimplicits_275621)(TY129408* implicits, NU8 nodekind, Tpasscontext275005** a) {
	{
		NimStringDesc* module_275637;
		NI i_275644;
		NI L_275646;
		module_275637 = 0;
		i_275644 = ((NI) 0);
		L_275646 = (implicits ? implicits->Sup.len : 0);
		{
			while (1) {
				Tnode223809* importstmt;
				Tnode223809* str;
				if (!(i_275644 < L_275646)) goto LA3;
				module_275637 = implicits->data[i_275644];
				importstmt = newnodei_225351(nodekind, gcmdlineinfo_189322);
				str = newstrnode_224644(((NU8) 20), module_275637);
				(*str).info = gcmdlineinfo_189322;
				addson_225819(importstmt, str);
				{
					NIM_BOOL LOC6;
					LOC6 = 0;
					LOC6 = processtoplevelstmt_275454(importstmt, a);
					if (!!(LOC6)) goto LA7;
					goto LA1;
				}
				LA7: ;
				i_275644 += ((NI) 1);
			} LA3: ;
		}
	} LA1: ;
}

N_NIMCALL(void, closepasses_275404)(Tpasscontext275005** a) {
	Tnode223809* m;
	m = NIM_NIL;
	{
		NI i_275421;
		NI HEX3Atmp_275431;
		NI res_275434;
		i_275421 = 0;
		HEX3Atmp_275431 = 0;
		HEX3Atmp_275431 = (NI)(gpasseslen_275176 - ((NI) 1));
		res_275434 = ((NI) 0);
		{
			while (1) {
				if (!(res_275434 <= HEX3Atmp_275431)) goto LA3;
				i_275421 = res_275434;
				{
					if (!!(gpasses_275175[(i_275421)- 0].Field3 == 0)) goto LA6;
					m = gpasses_275175[(i_275421)- 0].Field3(a[(i_275421)- 0], m);
				}
				LA6: ;
				unsureAsgnRef((void**) (&a[(i_275421)- 0]), NIM_NIL);
				res_275434 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, openpassescached_275342)(Tpasscontext275005** a, Tsym223841* module, Trodreader266030* rd) {
	{
		NI i_275360;
		NI HEX3Atmp_275381;
		NI res_275384;
		i_275360 = 0;
		HEX3Atmp_275381 = 0;
		HEX3Atmp_275381 = (NI)(gpasseslen_275176 - ((NI) 1));
		res_275384 = ((NI) 0);
		{
			while (1) {
				if (!(res_275384 <= HEX3Atmp_275381)) goto LA3;
				i_275360 = res_275384;
				{
					if (!!(gpasses_275175[(i_275360)- 0].Field1 == 0)) goto LA6;
					unsureAsgnRef((void**) (&a[(i_275360)- 0]), gpasses_275175[(i_275360)- 0].Field1(module, rd));
					{
						if (!!((a[(i_275360)- 0] == NIM_NIL))) goto LA10;
						(*a[(i_275360)- 0]).fromcache = NIM_TRUE;
					}
					LA10: ;
				}
				goto LA4;
				LA6: ;
				{
					unsureAsgnRef((void**) (&a[(i_275360)- 0]), NIM_NIL);
				}
				LA4: ;
				res_275384 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, processtoplevelstmtcached_275513)(Tnode223809* n, Tpasscontext275005** a) {
	Tnode223809* m;
	m = n;
	{
		NI i_275531;
		NI HEX3Atmp_275540;
		NI res_275543;
		i_275531 = 0;
		HEX3Atmp_275540 = 0;
		HEX3Atmp_275540 = (NI)(gpasseslen_275176 - ((NI) 1));
		res_275543 = ((NI) 0);
		{
			while (1) {
				if (!(res_275543 <= HEX3Atmp_275540)) goto LA3;
				i_275531 = res_275543;
				{
					if (!!(gpasses_275175[(i_275531)- 0].Field1 == 0)) goto LA6;
					m = gpasses_275175[(i_275531)- 0].Field2(a[(i_275531)- 0], m);
				}
				LA6: ;
				res_275543 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, closepassescached_275563)(Tpasscontext275005** a) {
	Tnode223809* m;
	m = NIM_NIL;
	{
		NI i_275580;
		NI HEX3Atmp_275597;
		NI res_275600;
		i_275580 = 0;
		HEX3Atmp_275597 = 0;
		HEX3Atmp_275597 = (NI)(gpasseslen_275176 - ((NI) 1));
		res_275600 = ((NI) 0);
		{
			while (1) {
				if (!(res_275600 <= HEX3Atmp_275597)) goto LA3;
				i_275580 = res_275600;
				{
					NIM_BOOL LOC6;
					LOC6 = 0;
					LOC6 = !(gpasses_275175[(i_275580)- 0].Field1 == 0);
					if (!(LOC6)) goto LA7;
					LOC6 = !(gpasses_275175[(i_275580)- 0].Field3 == 0);
					LA7: ;
					if (!LOC6) goto LA8;
					m = gpasses_275175[(i_275580)- 0].Field3(a[(i_275580)- 0], m);
				}
				LA8: ;
				unsureAsgnRef((void**) (&a[(i_275580)- 0]), NIM_NIL);
				res_275600 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, processmodule_275056)(Tsym223841* module, Tllstream211204* stream, Trodreader266030* rd) {
	Tparsers251035 p;
	Tpasscontextarray275168 a;
	Tllstream211204* s;
	NI32 fileidx;
{	memset((void*)(&p), 0, sizeof(p));
	objectInit((&p), (&NTI251035));
	memset((void*)a, 0, sizeof(a));
	s = 0;
	fileidx = ((NI32) ((*module).position));
	{
		if (!(rd == NIM_NIL)) goto LA3;
		openpasses_275293(a, module);
		{
			NimStringDesc* filename;
			if (!(stream == NIM_NIL)) goto LA7;
			filename = tofullpathconsiderdirty_189807(fileidx);
			s = llstreamopen_211256(filename, ((NU8) 0));
			{
				if (!(s == NIM_NIL)) goto LA11;
				rawmessage_192636(((NU16) 3), filename);
				goto BeforeRet;
			}
			LA11: ;
		}
		goto LA5;
		LA7: ;
		{
			s = stream;
		}
		LA5: ;
		{
			while (1) {
				openparsers_251047((&p), fileidx, s);
				{
					if (!!((((*module).flags &(1<<((((NU8) 13))&31)))!=0))) goto LA18;
					processimplicits_275621(implicitimports_165277, ((NU8) 116), a);
					processimplicits_275621(implicitincludes_165295, ((NU8) 121), a);
				}
				LA18: ;
				{
					while (1) {
						Tnode223809* n_275727;
						n_275727 = parsetoplevelstmt_251070((&p));
						{
							if (!((*n_275727).kind == ((NU8) 1))) goto LA24;
							goto LA20;
						}
						LA24: ;
						{
							Tnode223809* sl;
							NIM_BOOL LOC36;
							if (!(((*module).flags &(1<<((((NU8) 8))&31)))!=0)) goto LA28;
							sl = newnodei_225351(((NU8) 115), (*n_275727).info);
							add_224165(sl, n_275727);
							{
								while (1) {
									Tnode223809* n;
									n = parsetoplevelstmt_251070((&p));
									{
										if (!((*n).kind == ((NU8) 1))) goto LA34;
										goto LA30;
									}
									LA34: ;
									add_224165(sl, n);
								}
							} LA30: ;
							LOC36 = 0;
							LOC36 = processtoplevelstmt_275454(sl, a);
							goto LA20;
						}
						goto LA26;
						LA28: ;
						{
							NIM_BOOL LOC38;
							LOC38 = 0;
							LOC38 = processtoplevelstmt_275454(n_275727, a);
							if (!!(LOC38)) goto LA39;
							goto LA20;
						}
						goto LA26;
						LA39: ;
						LA26: ;
					}
				} LA20: ;
				closeparsers_251056((&p));
				{
					if (!!(((*s).kind == ((NU8) 3)))) goto LA43;
					goto LA14;
				}
				LA43: ;
			}
		} LA14: ;
		closepasses_275404(a);
		idsynchronizationpoint_222453(((NI) 1000));
	}
	goto LA1;
	LA3: ;
	{
		Tnode223809* n;
		openpassescached_275342(a, module, rd);
		n = loadinitsection_266100(rd);
		{
			NI i_275790;
			NI HEX3Atmp_275802;
			NI LOC47;
			NI res_275805;
			i_275790 = 0;
			HEX3Atmp_275802 = 0;
			LOC47 = 0;
			LOC47 = sonslen_226387(n);
			HEX3Atmp_275802 = (NI)(LOC47 - ((NI) 1));
			res_275805 = ((NI) 0);
			{
				while (1) {
					if (!(res_275805 <= HEX3Atmp_275802)) goto LA49;
					i_275790 = res_275805;
					processtoplevelstmtcached_275513((*n).kindU.S6.sons->data[i_275790], a);
					res_275805 += ((NI) 1);
				} LA49: ;
			}
		}
		closepassescached_275563(a);
	}
	LA1: ;
	}BeforeRet: ;
}

N_NIMCALL(void, registerpass_275190)(Tpass275017 p) {
	gpasses_275175[(gpasseslen_275176)- 0] = p;
	gpasseslen_275176 += ((NI) 1);
}

N_NIMCALL(void, clearpasses_275182)(void) {
	gpasseslen_275176 = ((NI) 0);
}

N_NIMCALL(NIM_BOOL, astneeded_275093)(Tsym223841* s) {
	NIM_BOOL result;
	result = 0;
	{
		NIM_BOOL LOC3;
		NIM_BOOL LOC4;
		NIM_BOOL LOC5;
		LOC3 = 0;
		LOC4 = 0;
		LOC5 = 0;
		LOC5 = ((12288 &(1<<(((*s).kind)&31)))!=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_275208)(Tpass275017 p, Tsym223841* module, TY358220 m, TY358220* Result) {
	Tpasscontext275005* 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_275231)(Tnode223809* nodes, Tsym223841* module, Tpass275017* passes, NI passesLen0) {
	TY358220 passdata;
	memset((void*)(&passdata), 0, sizeof(passdata));
	passdata.Field0 = nodes;
	{
		Tpass275017 pass_275272;
		NI i_275277;
		memset((void*)(&pass_275272), 0, sizeof(pass_275272));
		i_275277 = ((NI) 0);
		{
			while (1) {
				TY358220 LOC4;
				if (!(i_275277 < passesLen0)) goto LA3;
				pass_275272 = passes[i_275277];
				memset((void*)(&LOC4), 0, sizeof(LOC4));
				carrypass_275208(pass_275272, module, passdata, (&LOC4));
				passdata.Field0 = LOC4.Field0;
				passdata.Field1 = LOC4.Field1;
				i_275277 += ((NI) 1);
			} LA3: ;
		}
	}
}
NIM_EXTERNC N_NOINLINE(void, compiler_passesInit000)(void) {
}

NIM_EXTERNC N_NOINLINE(void, compiler_passesDatInit000)(void) {
static TNimNode TMP917[1];
NTI275005.size = sizeof(Tpasscontext275005);
NTI275005.kind = 17;
NTI275005.base = (&NTI4011);
NTI275005.flags = 1;
TMP917[0].kind = 1;
TMP917[0].offset = offsetof(Tpasscontext275005, fromcache);
TMP917[0].typ = (&NTI138);
TMP917[0].name = "fromCache";
NTI275005.node = &TMP917[0];
}

