/* Generated by Nimrod Compiler v0.9.5 */
/*   (c) 2014 Andreas Rumpf */
/* The generated code is subject to the original license. */
/* Compiled for: Linux, i386, gcc */
/* Command for C compiler:
   gcc -c  -w -O3 -fno-strict-aliasing  -I/build/nimrod/src/nimrod/lib -o compiler/nimcache/procfind.o compiler/nimcache/procfind.c */
#define NIM_INTBITS 32
#include "nimbase.h"

#include <string.h>
typedef struct tsym188833 tsym188833;
typedef struct tcontext250019 tcontext250019;
typedef struct tscope188827 tscope188827;
typedef struct tidentiter197106 tidentiter197106;
typedef struct tident167019 tident167019;
typedef struct tstrtable188807 tstrtable188807;
typedef struct tsymseq188805 tsymseq188805;
typedef struct TGenericSeq TGenericSeq;
typedef struct tnodeseq188797 tnodeseq188797;
typedef struct tnode188803 tnode188803;
typedef struct tidobj167013 tidobj167013;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct ttypeseq188835 ttypeseq188835;
typedef struct ttype188837 ttype188837;
typedef struct TY188933 TY188933;
typedef struct tinstantiation188823 tinstantiation188823;
typedef struct tlineinfo163527 tlineinfo163527;
typedef struct tloc188817 tloc188817;
typedef struct trope145007 trope145007;
typedef struct tlib188821 tlib188821;
typedef struct tpasscontext246003 tpasscontext246003;
typedef struct tproccon250009 tproccon250009;
typedef struct tintset185047 tintset185047;
typedef struct ttrunk185043 ttrunk185043;
typedef struct ttrunkseq185045 ttrunkseq185045;
typedef struct tlinkedlist118023 tlinkedlist118023;
typedef struct tlistentry118017 tlistentry118017;
typedef struct tidtable188849 tidtable188849;
typedef struct tidpairseq188847 tidpairseq188847;
typedef struct tidpair188845 tidpair188845;
typedef struct tctx249037 tctx249037;
typedef struct TY250131 TY250131;
typedef struct tinstantiationpair250011 tinstantiationpair250011;
typedef struct NimStringDesc NimStringDesc;
typedef struct TY188922 TY188922;
typedef struct TY249229 TY249229;
typedef struct TY164208 TY164208;
typedef struct pprocHEX3Aobjecttype249216 pprocHEX3Aobjecttype249216;
typedef struct TY249217 TY249217;
typedef struct tblock249023 tblock249023;
typedef struct TY249198 TY249198;
typedef struct TY249223 TY249223;
struct  tidentiter197106  {
NI H;
tident167019* Name;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  tstrtable188807  {
NI Counter;
tsymseq188805* Data;
};
struct  tscope188827  {
NI Depthlevel;
tstrtable188807 Symbols;
tnodeseq188797* Usingsyms;
tscope188827* Parent;
};
typedef N_NIMCALL_PTR(void, TY2289) (void* p, NI op);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY2289 marker;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  tidobj167013  {
  TNimObject Sup;
NI Id;
};
struct  tlineinfo163527  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
struct  tloc188817  {
NU8 K;
NU8 S;
NU8 Flags;
ttype188837* T;
trope145007* R;
trope145007* Heaproot;
NI A;
};
struct  tsym188833  {
  tidobj167013 Sup;
NU8 Kind;
union {
struct {ttypeseq188835* Typeinstcache;
tscope188827* Typscope;
} S1;
struct {TY188933* Procinstcache;
tscope188827* Scope;
} S2;
struct {TY188933* Usedgenerics;
tstrtable188807 Tab;
} S3;
} kindU;
NU16 Magic;
ttype188837* Typ;
tident167019* Name;
tlineinfo163527 Info;
tsym188833* Owner;
NU32 Flags;
tnode188803* Ast;
NU32 Options;
NI Position;
NI Offset;
tloc188817 Loc;
tlib188821* Annex;
tnode188803* Constraint;
};
struct  tpasscontext246003  {
  TNimObject Sup;
NIM_BOOL Fromcache;
};
struct  tintset185047  {
NI Counter;
NI Max;
ttrunk185043* Head;
ttrunkseq185045* Data;
};
struct  tlinkedlist118023  {
tlistentry118017* Head;
tlistentry118017* Tail;
NI Counter;
};
struct  tidpair188845  {
tidobj167013* Key;
TNimObject* Val;
};
struct  tidtable188849  {
NI Counter;
tidpairseq188847* Data;
};
typedef N_NIMCALL_PTR(tnode188803*, TY250061) (tcontext250019* c, tnode188803* n);
typedef N_NIMCALL_PTR(tnode188803*, TY250066) (tcontext250019* c, tnode188803* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode188803*, TY250074) (tcontext250019* c, tnode188803* n, NU16 flags, NIM_BOOL buffererrors);
typedef N_NIMCALL_PTR(tnode188803*, TY250083) (tcontext250019* c, tnode188803* n);
typedef N_NIMCALL_PTR(tnode188803*, TY250088) (tcontext250019* c, tnode188803* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode188803*, TY250096) (tcontext250019* c, tnode188803* n);
typedef N_NIMCALL_PTR(tnode188803*, TY250101) (tcontext250019* c, tnode188803* n, tnode188803* norig, NU32 filter);
typedef N_NIMCALL_PTR(ttype188837*, TY250108) (tcontext250019* c, tnode188803* n, ttype188837* prev);
typedef struct {
N_NIMCALL_PTR(tnode188803*, ClPrc) (tcontext250019* c, tidtable188849 pt, tnode188803* n, void* ClEnv);
void* ClEnv;
} TY250114;
typedef struct {
N_NIMCALL_PTR(tsym188833*, ClPrc) (tcontext250019* c, tsym188833* fn, tidtable188849 pt, tlineinfo163527 info, void* ClEnv);
void* ClEnv;
} TY250120;
struct  tinstantiationpair250011  {
tsym188833* Genericsym;
tinstantiation188823* Inst;
};
struct  tcontext250019  {
  tpasscontext246003 Sup;
tsym188833* Module;
tscope188827* Currentscope;
tscope188827* Importtable;
tscope188827* Toplevelscope;
tproccon250009* P;
tsym188833* Friendmodule;
NI Instcounter;
tintset185047 Ambiguoussymbols;
NI Intypeclass;
NI Ingenericcontext;
NI Inunrolledcontext;
NI Incompilescontext;
NI Ingenericinst;
tsymseq188805* Converters;
tsymseq188805* Patterns;
tlinkedlist118023 Optionstack;
tidtable188849 Symmapping;
tlinkedlist118023 Libs;
TY250061 Semconstexpr;
TY250066 Semexpr;
TY250074 Semtryexpr;
TY250083 Semtryconstexpr;
TY250088 Semoperand;
TY250096 Semconstboolexpr;
TY250101 Semoverloadedcall;
TY250108 Semtypenode;
TY250114 Seminferredlambda;
TY250120 Semgenerateinstance;
tintset185047 Includedfiles;
tstrtable188807 Userpragmas;
tctx249037* Evalcontext;
tintset185047 Unknownidents;
TY250131* Generics;
NI Lastgenericidx;
NI Hloloopdetector;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  tident167019  {
  tidobj167013 Sup;
NimStringDesc* S;
tident167019* Next;
NI H;
};
struct  tnode188803  {
ttype188837* Typ;
tlineinfo163527 Info;
NU16 Flags;
NU8 Kind;
union {
struct {NI64 Intval;
} S1;
struct {NF Floatval;
} S2;
struct {NimStringDesc* Strval;
} S3;
struct {tsym188833* Sym;
} S4;
struct {tident167019* Ident;
} S5;
struct {tnodeseq188797* Sons;
} S6;
} kindU;
NimStringDesc* Comment;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  ttype188837  {
  tidobj167013 Sup;
NU8 Kind;
NU8 Callconv;
NU32 Flags;
ttypeseq188835* Sons;
tnode188803* N;
tsym188833* Destructor;
tsym188833* Owner;
tsym188833* Sym;
NI64 Size;
NI Align;
tloc188817 Loc;
};
struct  tinstantiation188823  {
tsym188833* Sym;
ttypeseq188835* Concretetypes;
TY188922* Usedby;
};
struct  trope145007  {
  TNimObject Sup;
trope145007* Left;
trope145007* Right;
NI Length;
NimStringDesc* Data;
};
struct  tlistentry118017  {
  TNimObject Sup;
tlistentry118017* Prev;
tlistentry118017* Next;
};
struct  tlib188821  {
  tlistentry118017 Sup;
NU8 Kind;
NIM_BOOL Generated;
NIM_BOOL Isoverriden;
trope145007* Name;
tnode188803* Path;
};
struct  tproccon250009  {
tsym188833* Owner;
tsym188833* Resultsym;
NI Nestedloopcounter;
NI Nestedblockcounter;
NI Intrystmt;
tproccon250009* Next;
};
typedef NI TY22618[16];
struct  ttrunk185043  {
ttrunk185043* Next;
NI Key;
TY22618 Bits;
};
struct  tctx249037  {
  tpasscontext246003 Sup;
TY249229* Code;
TY164208* Debug;
tnode188803* Globals;
tnode188803* Constants;
ttypeseq188835* Types;
tnode188803* Currentexceptiona;
tnode188803* Currentexceptionb;
NI Exceptioninstr;
pprocHEX3Aobjecttype249216* Prc;
tsym188833* Module;
tnode188803* Callsite;
NU8 Mode;
NU8 Features;
NIM_BOOL Traceactive;
NI Loopiterations;
};
struct  tblock249023  {
tsym188833* Label;
TY249198* Fixups;
};
struct TY249223 {
NIM_BOOL Field0;
NU8 Field1;
};
typedef TY249223 TY249220[256];
struct  pprocHEX3Aobjecttype249216  {
TY249217* Blocks;
tsym188833* Sym;
TY249220 Slots;
NI Maxslots;
};
struct tsymseq188805 {
  TGenericSeq Sup;
  tsym188833* data[SEQ_DECL_SIZE];
};
struct tnodeseq188797 {
  TGenericSeq Sup;
  tnode188803* data[SEQ_DECL_SIZE];
};
struct ttypeseq188835 {
  TGenericSeq Sup;
  ttype188837* data[SEQ_DECL_SIZE];
};
struct TY188933 {
  TGenericSeq Sup;
  tinstantiation188823* data[SEQ_DECL_SIZE];
};
struct ttrunkseq185045 {
  TGenericSeq Sup;
  ttrunk185043* data[SEQ_DECL_SIZE];
};
struct tidpairseq188847 {
  TGenericSeq Sup;
  tidpair188845 data[SEQ_DECL_SIZE];
};
struct TY250131 {
  TGenericSeq Sup;
  tinstantiationpair250011 data[SEQ_DECL_SIZE];
};
struct TY188922 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct TY249229 {
  TGenericSeq Sup;
  NU32 data[SEQ_DECL_SIZE];
};
struct TY164208 {
  TGenericSeq Sup;
  tlineinfo163527 data[SEQ_DECL_SIZE];
};
struct TY249198 {
  TGenericSeq Sup;
  NI data[SEQ_DECL_SIZE];
};
struct TY249217 {
  TGenericSeq Sup;
  tblock249023 data[SEQ_DECL_SIZE];
};
N_NIMCALL(tsym188833*, searchforprocnew_266296)(tcontext250019* c, tscope188827* scope, tsym188833* fn);
N_NIMCALL(tsym188833*, initidentiter_197110)(tidentiter197106* ti, tstrtable188807 tab, tident167019* s);
N_NIMCALL(NIM_BOOL, sametype_228116)(ttype188837* a, ttype188837* b, NU8 flags);
N_NIMCALL(tsym188833*, nextidentiter_197117)(tidentiter197106* ti, tstrtable188807 tab);

N_NIMCALL(tsym188833*, searchforprocnew_266296)(tcontext250019* c, tscope188827* scope, tsym188833* fn) {
	tsym188833* result;
	tidentiter197106 it;
	result = 0;
	memset((void*)&it, 0, sizeof(it));
	result = initidentiter_197110(&it, (*scope).Symbols, (*fn).Name);
	while (1) {
		if (!!((result == NIM_NIL))) goto LA1;
		{
			NIM_BOOL LOC4;
			LOC4 = 0;
			LOC4 = ((520192 &(1<<(((*result).Kind)&31)))!=0);
			if (!(LOC4)) goto LA5;
			LOC4 = sametype_228116((*result).Typ, (*fn).Typ, 30);
			LA5: ;
			if (!LOC4) goto LA6;
			goto BeforeRet;
		}
		LA6: ;
		result = nextidentiter_197117(&it, (*scope).Symbols);
	} LA1: ;
	result = NIM_NIL;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(tsym188833*, searchforproc_266341)(tcontext250019* c, tscope188827* scope, tsym188833* fn) {
	tsym188833* result;
	result = 0;
	result = searchforprocnew_266296(c, scope, fn);
	return result;
}
N_NOINLINE(void, procfindInit)(void) {
}

N_NOINLINE(void, procfindDatInit)(void) {
}

