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

#include "nimbase.h"
#include <string.h>
#include <stdio.h>
typedef struct Tsym213822 Tsym213822;
typedef struct Tnode213790 Tnode213790;
typedef struct Tpass260014 Tpass260014;
typedef struct Tpasscontext260002 Tpasscontext260002;
typedef struct Trodreader251021 Trodreader251021;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct TNimObject TNimObject;
typedef struct Tllstream201204 Tllstream201204;
typedef struct Tparsers237026 Tparsers237026;
typedef struct Tparser227202 Tparser227202;
typedef struct Tlexer204173 Tlexer204173;
typedef struct Tbaselexer202015 Tbaselexer202015;
typedef struct Tlineinfo181337 Tlineinfo181337;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Ttoken204169 Ttoken204169;
typedef struct Tident188012 Tident188012;
typedef struct Tidobj188006 Tidobj188006;
typedef struct Ttypeseq213824 Ttypeseq213824;
typedef struct Tscope213816 Tscope213816;
typedef struct TY213925 TY213925;
typedef struct Tstrtable213794 Tstrtable213794;
typedef struct Tsymseq213792 Tsymseq213792;
typedef struct Ttype213828 Ttype213828;
typedef struct Tloc213804 Tloc213804;
typedef struct Ropeobj168006 Ropeobj168006;
typedef struct Tlib213808 Tlib213808;
typedef struct TY125402 TY125402;
typedef struct Tnodeseq213784 Tnodeseq213784;
typedef struct TY336746 TY336746;
typedef struct TY213913 TY213913;
typedef struct Tindex251019 Tindex251019;
typedef struct Tiitable220163 Tiitable220163;
typedef struct Tiipairseq220161 Tiipairseq220161;
typedef struct Table251054 Table251054;
typedef struct Keyvaluepairseq251057 Keyvaluepairseq251057;
typedef struct Memfile249202 Memfile249202;
typedef struct Tinstantiation213812 Tinstantiation213812;
typedef struct Tlistentry135010 Tlistentry135010;
typedef struct Tiipair220159 Tiipair220159;
typedef struct Keyvaluepair251060 Keyvaluepair251060;
typedef N_NIMCALL_PTR(Tsym213822*, TY260049) (Tsym213822* m, NI32 fileidx);
typedef N_NIMCALL_PTR(Tnode213790*, TY260054) (Tsym213822* m, NI32 fileidx);
typedef N_NIMCALL_PTR(Tpasscontext260002*, Tpassopen260006) (Tsym213822* module);
typedef N_NIMCALL_PTR(Tpasscontext260002*, Tpassopencached260008) (Tsym213822* module, Trodreader251021* rd);
typedef N_NIMCALL_PTR(Tnode213790*, Tpassprocess260012) (Tpasscontext260002* p, Tnode213790* toplevelstmt);
typedef N_NIMCALL_PTR(Tnode213790*, Tpassclose260010) (Tpasscontext260002* p, Tnode213790* n);
struct Tpass260014 {
Tpassopen260006 Field0;
Tpassopencached260008 Field1;
Tpassprocess260012 Field2;
Tpassclose260010 Field3;
};
typedef Tpass260014 TY260138[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  Tpasscontext260002  {
  TNimObject Sup;
NIM_BOOL fromcache;
};
struct  Tbaselexer202015  {
  TNimObject Sup;
NI bufpos;
NCSTRING buf;
NI buflen;
Tllstream201204* 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) (Tlineinfo181337 info, NU16 msg, NimStringDesc* arg, void* ClEnv);
void* ClEnv;
} Terrorhandler204171;
struct  Tlexer204173  {
  Tbaselexer202015 Sup;
NI32 fileidx;
NI indentahead;
NI currlineindent;
NIM_BOOL strongspaces;
Terrorhandler204171 errorhandler;
};
struct  Ttoken204169  {
NU8 toktype;
NI indent;
Tident188012* ident;
NI64 inumber;
NF fnumber;
NU8 base;
NI8 strongspacea;
NI8 strongspaceb;
NimStringDesc* literal;
NI line;
NI col;
};
struct  Tparser227202  {
NI currind;
NIM_BOOL firsttok;
NIM_BOOL strongspaces;
Tlexer204173 lex;
Ttoken204169 tok;
NI inpragma;
NI insemistmtlist;
};
struct  Tparsers237026  {
NU8 skin;
Tparser227202 parser;
};
typedef Tpasscontext260002* Tpasscontextarray260135[10];
struct  Tidobj188006  {
  TNimObject Sup;
NI id;
};
struct  Tstrtable213794  {
NI counter;
Tsymseq213792* data;
};
struct  Tlineinfo181337  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tloc213804  {
NU8 k;
NU8 s;
NU16 flags;
Ttype213828* t;
Ropeobj168006* r;
Ropeobj168006* heaproot;
};
struct  Tsym213822  {
  Tidobj188006 Sup;
NU8 kind;
union{
struct {Ttypeseq213824* typeinstcache;
Tscope213816* typscope;
} S1;
struct {TY213925* procinstcache;
Tsym213822* gcunsafetyreason;
} S2;
struct {TY213925* usedgenerics;
Tstrtable213794 tab;
} S3;
struct {Tsym213822* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype213828* typ;
Tident188012* name;
Tlineinfo181337 info;
Tsym213822* owner;
NU32 flags;
Tnode213790* ast;
NU32 options;
NI position;
NI offset;
Tloc213804 loc;
Tlib213808* annex;
Tnode213790* constraint;
};
struct  Tnode213790  {
Ttype213828* typ;
Tlineinfo181337 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym213822* sym;
} S4;
struct {Tident188012* ident;
} S5;
struct {Tnodeseq213784* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Tllstream201204  {
  TNimObject Sup;
NU8 kind;
FILE* f;
NimStringDesc* s;
NI rd;
NI wr;
NI lineoffset;
};
struct  Ttype213828  {
  Tidobj188006 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq213824* sons;
Tnode213790* n;
Tsym213822* owner;
Tsym213822* sym;
Tsym213822* destructor;
Tsym213822* deepcopy;
Tsym213822* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc213804 loc;
};
struct TY336746 {
Tnode213790* Field0;
Tnode213790* Field1;
};
struct  Tiitable220163  {
NI counter;
Tiipairseq220161* data;
};
struct  Tindex251019  {
NI lastidxkey;
NI lastidxval;
Tiitable220163 tab;
NimStringDesc* r;
NI offset;
};
struct  Table251054  {
Keyvaluepairseq251057* data;
NI counter;
};
struct  Memfile249202  {
void* mem;
NI size;
int handle;
};
struct  Trodreader251021  {
  TNimObject Sup;
NI pos;
NCSTRING s;
NU32 options;
NU8 reason;
TY213913* moddeps;
TY213913* files;
NI dataidx;
NI convertersidx;
NI initidx;
NI interfidx;
NI compilerprocsidx;
NI methodsidx;
NimStringDesc* filename;
Tindex251019 index;
Tindex251019 imports;
NI readerindex;
NI line;
NI moduleid;
Table251054 syms;
Memfile249202 memfile;
Tsymseq213792* methods;
NimStringDesc* origfile;
NIM_BOOL inviewmode;
};
struct  Tident188012  {
  Tidobj188006 Sup;
NimStringDesc* s;
Tident188012* next;
NI h;
};
struct  Tscope213816  {
NI depthlevel;
Tstrtable213794 symbols;
Tnodeseq213784* usingsyms;
Tscope213816* parent;
};
struct  Ropeobj168006  {
  TNimObject Sup;
Ropeobj168006* left;
Ropeobj168006* right;
NI length;
NimStringDesc* data;
};
struct  Tlistentry135010  {
  TNimObject Sup;
Tlistentry135010* prev;
Tlistentry135010* next;
};
struct  Tlib213808  {
  Tlistentry135010 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj168006* name;
Tnode213790* path;
};
struct  Tiipair220159  {
NI key;
NI val;
};
struct Keyvaluepair251060 {
NI Field0;
NI Field1;
Tsym213822* Field2;
};
struct  Tinstantiation213812  {
Tsym213822* sym;
Ttypeseq213824* concretetypes;
TY213913* usedby;
NI compilesid;
};
struct TY125402 {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
struct Ttypeseq213824 {
  TGenericSeq Sup;
  Ttype213828* data[SEQ_DECL_SIZE];
};
struct TY213925 {
  TGenericSeq Sup;
  Tinstantiation213812* data[SEQ_DECL_SIZE];
};
struct Tsymseq213792 {
  TGenericSeq Sup;
  Tsym213822* data[SEQ_DECL_SIZE];
};
struct Tnodeseq213784 {
  TGenericSeq Sup;
  Tnode213790* data[SEQ_DECL_SIZE];
};
struct TY213913 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct Tiipairseq220161 {
  TGenericSeq Sup;
  Tiipair220159 data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq251057 {
  TGenericSeq Sup;
  Keyvaluepair251060 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, objectInit)(void* dest, TNimType* typ);
N_NIMCALL(void, openpasses_260211)(Tpasscontext260002** a, Tsym213822* module);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(NimStringDesc*, tofullpathconsiderdirty_182401)(NI32 fileidx);
N_NIMCALL(Tllstream201204*, llstreamopen_201241)(NimStringDesc* filename, NU8 mode);
N_NIMCALL(void, rawmessage_184612)(NU16 msg, NimStringDesc* arg);
N_NIMCALL(void, openparsers_237032)(Tparsers237026* p, NI32 fileidx, Tllstream201204* inputstream);
N_NIMCALL(void, processimplicits_260443)(TY125402* implicits, NU8 nodekind, Tpasscontext260002** a);
N_NIMCALL(Tnode213790*, newnodei_215248)(NU8 kind, Tlineinfo181337 info);
N_NIMCALL(Tnode213790*, newstrnode_214677)(NU8 kind, NimStringDesc* strval);
N_NIMCALL(void, addson_215807)(Tnode213790* father, Tnode213790* son);
N_NIMCALL(NIM_BOOL, processtoplevelstmt_260324)(Tnode213790* n, Tpasscontext260002** a);
N_NIMCALL(Tnode213790*, parsetoplevelstmt_237046)(Tparsers237026* p);
N_NIMCALL(void, add_214114)(Tnode213790* father, Tnode213790* son);
N_NIMCALL(void, closeparsers_237038)(Tparsers237026* p);
N_NIMCALL(void, closepasses_260290)(Tpasscontext260002** a);
N_NIMCALL(void, idsynchronizationpoint_212432)(NI idrange);
N_NIMCALL(void, openpassescached_260244)(Tpasscontext260002** a, Tsym213822* module, Trodreader251021* rd);
N_NIMCALL(Tnode213790*, loadinitsection_251082)(Trodreader251021* r);
N_NIMCALL(NI, sonslen_216351)(Tnode213790* n);
N_NIMCALL(void, processtoplevelstmtcached_260367)(Tnode213790* n, Tpasscontext260002** a);
N_NIMCALL(void, closepassescached_260401)(Tpasscontext260002** a);
N_NIMCALL(void, carrypass_260157)(Tpass260014* p, Tsym213822* module, TY336746 m, TY336746* Result);
TY260049 gimportmodule_260053;
TY260054 gincludefile_260058;
TY260138 gpasses_260139;
NI gpasseslen_260140;
extern TNimType NTI3608; /* RootObj */
TNimType NTI260002; /* TPassContext */
extern TNimType NTI130; /* bool */
extern TNimType NTI237026; /* TParsers */
extern Tlineinfo181337 gcmdlineinfo_182045;
extern TY125402* implicitimports_159242;
extern TY125402* implicitincludes_159260;

N_NIMCALL(void, openpasses_260211)(Tpasscontext260002** a, Tsym213822* module) {
	{
		NI i_260227;
		NI HEX3Atmp_260236;
		NI res_260239;
		i_260227 = 0;
		HEX3Atmp_260236 = 0;
		HEX3Atmp_260236 = (NI)(gpasseslen_260140 - ((NI) 1));
		res_260239 = ((NI) 0);
		{
			while (1) {
				if (!(res_260239 <= HEX3Atmp_260236)) goto LA3;
				i_260227 = res_260239;
				{
					if (!!(gpasses_260139[(i_260227)- 0].Field0 == 0)) goto LA6;
					unsureAsgnRef((void**) (&a[(i_260227)- 0]), gpasses_260139[(i_260227)- 0].Field0(module));
				}
				goto LA4;
				LA6: ;
				{
					unsureAsgnRef((void**) (&a[(i_260227)- 0]), NIM_NIL);
				}
				LA4: ;
				res_260239 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(NIM_BOOL, processtoplevelstmt_260324)(Tnode213790* n, Tpasscontext260002** a) {
	NIM_BOOL result;
	Tnode213790* m;
{	result = 0;
	m = n;
	{
		NI i_260342;
		NI HEX3Atmp_260359;
		NI res_260362;
		i_260342 = 0;
		HEX3Atmp_260359 = 0;
		HEX3Atmp_260359 = (NI)(gpasseslen_260140 - ((NI) 1));
		res_260362 = ((NI) 0);
		{
			while (1) {
				if (!(res_260362 <= HEX3Atmp_260359)) goto LA3;
				i_260342 = res_260362;
				{
					if (!!(gpasses_260139[(i_260342)- 0].Field2 == 0)) goto LA6;
					m = gpasses_260139[(i_260342)- 0].Field2(a[(i_260342)- 0], m);
					{
						if (!m == 0) goto LA10;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA10: ;
				}
				LA6: ;
				res_260362 += ((NI) 1);
			} LA3: ;
		}
	}
	result = NIM_TRUE;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, processimplicits_260443)(TY125402* implicits, NU8 nodekind, Tpasscontext260002** a) {
	{
		NimStringDesc* module_260458;
		NI i_260465;
		NI L_260467;
		module_260458 = 0;
		i_260465 = ((NI) 0);
		L_260467 = (implicits ? implicits->Sup.len : 0);
		{
			while (1) {
				Tnode213790* importstmt;
				Tnode213790* str;
				if (!(i_260465 < L_260467)) goto LA3;
				module_260458 = implicits->data[i_260465];
				importstmt = newnodei_215248(nodekind, gcmdlineinfo_182045);
				str = newstrnode_214677(((NU8) 20), module_260458);
				(*str).info = gcmdlineinfo_182045;
				addson_215807(importstmt, str);
				{
					NIM_BOOL LOC6;
					LOC6 = 0;
					LOC6 = processtoplevelstmt_260324(importstmt, a);
					if (!!(LOC6)) goto LA7;
					goto LA1;
				}
				LA7: ;
				i_260465 += ((NI) 1);
			} LA3: ;
		}
	} LA1: ;
}

N_NIMCALL(void, closepasses_260290)(Tpasscontext260002** a) {
	Tnode213790* m;
	m = NIM_NIL;
	{
		NI i_260306;
		NI HEX3Atmp_260316;
		NI res_260319;
		i_260306 = 0;
		HEX3Atmp_260316 = 0;
		HEX3Atmp_260316 = (NI)(gpasseslen_260140 - ((NI) 1));
		res_260319 = ((NI) 0);
		{
			while (1) {
				if (!(res_260319 <= HEX3Atmp_260316)) goto LA3;
				i_260306 = res_260319;
				{
					if (!!(gpasses_260139[(i_260306)- 0].Field3 == 0)) goto LA6;
					m = gpasses_260139[(i_260306)- 0].Field3(a[(i_260306)- 0], m);
				}
				LA6: ;
				unsureAsgnRef((void**) (&a[(i_260306)- 0]), NIM_NIL);
				res_260319 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, openpassescached_260244)(Tpasscontext260002** a, Tsym213822* module, Trodreader251021* rd) {
	{
		NI i_260261;
		NI HEX3Atmp_260282;
		NI res_260285;
		i_260261 = 0;
		HEX3Atmp_260282 = 0;
		HEX3Atmp_260282 = (NI)(gpasseslen_260140 - ((NI) 1));
		res_260285 = ((NI) 0);
		{
			while (1) {
				if (!(res_260285 <= HEX3Atmp_260282)) goto LA3;
				i_260261 = res_260285;
				{
					if (!!(gpasses_260139[(i_260261)- 0].Field1 == 0)) goto LA6;
					unsureAsgnRef((void**) (&a[(i_260261)- 0]), gpasses_260139[(i_260261)- 0].Field1(module, rd));
					{
						if (!!((a[(i_260261)- 0] == NIM_NIL))) goto LA10;
						(*a[(i_260261)- 0]).fromcache = NIM_TRUE;
					}
					LA10: ;
				}
				goto LA4;
				LA6: ;
				{
					unsureAsgnRef((void**) (&a[(i_260261)- 0]), NIM_NIL);
				}
				LA4: ;
				res_260285 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, processtoplevelstmtcached_260367)(Tnode213790* n, Tpasscontext260002** a) {
	Tnode213790* m;
	m = n;
	{
		NI i_260384;
		NI HEX3Atmp_260393;
		NI res_260396;
		i_260384 = 0;
		HEX3Atmp_260393 = 0;
		HEX3Atmp_260393 = (NI)(gpasseslen_260140 - ((NI) 1));
		res_260396 = ((NI) 0);
		{
			while (1) {
				if (!(res_260396 <= HEX3Atmp_260393)) goto LA3;
				i_260384 = res_260396;
				{
					if (!!(gpasses_260139[(i_260384)- 0].Field1 == 0)) goto LA6;
					m = gpasses_260139[(i_260384)- 0].Field2(a[(i_260384)- 0], m);
				}
				LA6: ;
				res_260396 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, closepassescached_260401)(Tpasscontext260002** a) {
	Tnode213790* m;
	m = NIM_NIL;
	{
		NI i_260417;
		NI HEX3Atmp_260434;
		NI res_260437;
		i_260417 = 0;
		HEX3Atmp_260434 = 0;
		HEX3Atmp_260434 = (NI)(gpasseslen_260140 - ((NI) 1));
		res_260437 = ((NI) 0);
		{
			while (1) {
				if (!(res_260437 <= HEX3Atmp_260434)) goto LA3;
				i_260417 = res_260437;
				{
					NIM_BOOL LOC6;
					LOC6 = 0;
					LOC6 = !(gpasses_260139[(i_260417)- 0].Field1 == 0);
					if (!(LOC6)) goto LA7;
					LOC6 = !(gpasses_260139[(i_260417)- 0].Field3 == 0);
					LA7: ;
					if (!LOC6) goto LA8;
					m = gpasses_260139[(i_260417)- 0].Field3(a[(i_260417)- 0], m);
				}
				LA8: ;
				unsureAsgnRef((void**) (&a[(i_260417)- 0]), NIM_NIL);
				res_260437 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, processmodule_260044)(Tsym213822* module, Tllstream201204* stream, Trodreader251021* rd) {
	Tparsers237026 p;
	Tpasscontextarray260135 a;
	Tllstream201204* s;
	NI32 fileidx;
{	memset((void*)(&p), 0, sizeof(p));
	objectInit((&p), (&NTI237026));
	memset((void*)a, 0, sizeof(a));
	s = 0;
	fileidx = ((NI32) ((*module).position));
	{
		if (!(rd == NIM_NIL)) goto LA3;
		openpasses_260211(a, module);
		{
			NimStringDesc* filename;
			if (!(stream == NIM_NIL)) goto LA7;
			filename = tofullpathconsiderdirty_182401(fileidx);
			s = llstreamopen_201241(filename, ((NU8) 0));
			{
				if (!(s == NIM_NIL)) goto LA11;
				rawmessage_184612(((NU16) 3), filename);
				goto BeforeRet;
			}
			LA11: ;
		}
		goto LA5;
		LA7: ;
		{
			s = stream;
		}
		LA5: ;
		{
			while (1) {
				openparsers_237032((&p), fileidx, s);
				{
					if (!!((((*module).flags &(1U<<((NU)(((NU8) 13))&31U)))!=0))) goto LA18;
					processimplicits_260443(implicitimports_159242, ((NU8) 116), a);
					processimplicits_260443(implicitincludes_159260, ((NU8) 121), a);
				}
				LA18: ;
				{
					while (1) {
						Tnode213790* n_260533;
						n_260533 = parsetoplevelstmt_237046((&p));
						{
							if (!((*n_260533).kind == ((NU8) 1))) goto LA24;
							goto LA20;
						}
						LA24: ;
						{
							Tnode213790* sl;
							NIM_BOOL LOC36;
							if (!(((*module).flags &(1U<<((NU)(((NU8) 8))&31U)))!=0)) goto LA28;
							sl = newnodei_215248(((NU8) 115), (*n_260533).info);
							add_214114(sl, n_260533);
							{
								while (1) {
									Tnode213790* n;
									n = parsetoplevelstmt_237046((&p));
									{
										if (!((*n).kind == ((NU8) 1))) goto LA34;
										goto LA30;
									}
									LA34: ;
									add_214114(sl, n);
								}
							} LA30: ;
							LOC36 = 0;
							LOC36 = processtoplevelstmt_260324(sl, a);
							goto LA20;
						}
						goto LA26;
						LA28: ;
						{
							NIM_BOOL LOC38;
							LOC38 = 0;
							LOC38 = processtoplevelstmt_260324(n_260533, a);
							if (!!(LOC38)) goto LA39;
							goto LA20;
						}
						goto LA26;
						LA39: ;
						LA26: ;
					}
				} LA20: ;
				closeparsers_237038((&p));
				{
					if (!!(((*s).kind == ((NU8) 3)))) goto LA43;
					goto LA14;
				}
				LA43: ;
			}
		} LA14: ;
		closepasses_260290(a);
		idsynchronizationpoint_212432(((NI) 1000));
	}
	goto LA1;
	LA3: ;
	{
		Tnode213790* n;
		openpassescached_260244(a, module, rd);
		n = loadinitsection_251082(rd);
		{
			NI i_260595;
			NI HEX3Atmp_260606;
			NI LOC47;
			NI res_260609;
			i_260595 = 0;
			HEX3Atmp_260606 = 0;
			LOC47 = 0;
			LOC47 = sonslen_216351(n);
			HEX3Atmp_260606 = (NI)(LOC47 - ((NI) 1));
			res_260609 = ((NI) 0);
			{
				while (1) {
					if (!(res_260609 <= HEX3Atmp_260606)) goto LA49;
					i_260595 = res_260609;
					processtoplevelstmtcached_260367((*n).kindU.S6.sons->data[i_260595], a);
					res_260609 += ((NI) 1);
				} LA49: ;
			}
		}
		closepassescached_260401(a);
	}
	LA1: ;
	}BeforeRet: ;
}

N_NIMCALL(void, registerpass_260145)(Tpass260014* p) {
	gpasses_260139[(gpasseslen_260140)- 0] = (*p);
	gpasseslen_260140 += ((NI) 1);
}

N_NIMCALL(void, clearpasses_260143)(void) {
	gpasseslen_260140 = ((NI) 0);
}

N_NIMCALL(NIM_BOOL, astneeded_260069)(Tsym213822* 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_260157)(Tpass260014* p, Tsym213822* module, TY336746 m, TY336746* Result) {
	Tpasscontext260002* 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_260174)(Tnode213790* nodes, Tsym213822* module, Tpass260014* passes, NI passesLen0) {
	TY336746 passdata;
	memset((void*)(&passdata), 0, sizeof(passdata));
	passdata.Field0 = nodes;
	{
		Tpass260014 pass_260205;
		NI i_260210;
		memset((void*)(&pass_260205), 0, sizeof(pass_260205));
		i_260210 = ((NI) 0);
		{
			while (1) {
				TY336746 LOC4;
				if (!(i_260210 < passesLen0)) goto LA3;
				pass_260205 = passes[i_260210];
				memset((void*)(&LOC4), 0, sizeof(LOC4));
				carrypass_260157((&pass_260205), module, passdata, (&LOC4));
				passdata.Field0 = LOC4.Field0;
				passdata.Field1 = LOC4.Field1;
				i_260210 += ((NI) 1);
			} LA3: ;
		}
	}
}
NIM_EXTERNC N_NOINLINE(void, compiler_passesInit000)(void) {
}

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

