/* 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/condsyms.o compiler/nimcache/condsyms.c */
#define NIM_INTBITS 32
#include "nimbase.h"

#include <string.h>
typedef struct tstringtable121810 tstringtable121810;
typedef struct tcell41090 tcell41090;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct tcellset41102 tcellset41102;
typedef struct tgcheap43016 tgcheap43016;
typedef struct tcellseq41106 tcellseq41106;
typedef struct tpagedesc41098 tpagedesc41098;
typedef struct tmemregion23410 tmemregion23410;
typedef struct tsmallchunk22638 tsmallchunk22638;
typedef struct tllchunk23404 tllchunk23404;
typedef struct tbigchunk22640 tbigchunk22640;
typedef struct tintset22615 tintset22615;
typedef struct ttrunk22611 ttrunk22611;
typedef struct tavlnode23408 tavlnode23408;
typedef struct tgcstat43014 tgcstat43014;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tinfocpu142453 tinfocpu142453;
typedef struct tinfoos142044 tinfoos142044;
typedef struct tident167019 tident167019;
typedef struct tidobj167013 tidobj167013;
typedef struct TNimObject TNimObject;
typedef struct tkeyvaluepairseq121808 tkeyvaluepairseq121808;
typedef struct tkeyvaluepair121806 tkeyvaluepair121806;
typedef struct tbasechunk22636 tbasechunk22636;
typedef struct tfreecell22628 tfreecell22628;
struct  tcell41090  {
NI Refcount;
TNimType* Typ;
};
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  tcellseq41106  {
NI Len;
NI Cap;
tcell41090** D;
};
struct  tcellset41102  {
NI Counter;
NI Max;
tpagedesc41098* Head;
tpagedesc41098** Data;
};
typedef tsmallchunk22638* TY23422[512];
typedef ttrunk22611* ttrunkbuckets22613[256];
struct  tintset22615  {
ttrunkbuckets22613 Data;
};
struct  tmemregion23410  {
NI Minlargeobj;
NI Maxlargeobj;
TY23422 Freesmallchunks;
tllchunk23404* Llmem;
NI Currmem;
NI Maxmem;
NI Freemem;
NI Lastsize;
tbigchunk22640* Freechunkslist;
tintset22615 Chunkstarts;
tavlnode23408* Root;
tavlnode23408* Deleted;
tavlnode23408* Last;
tavlnode23408* Freeavlnodes;
};
struct  tgcstat43014  {
NI Stackscans;
NI Cyclecollections;
NI Maxthreshold;
NI Maxstacksize;
NI Maxstackcells;
NI Cycletablesize;
NI64 Maxpause;
};
struct  tgcheap43016  {
void* Stackbottom;
NI Cyclethreshold;
tcellseq41106 Zct;
tcellseq41106 Decstack;
tcellset41102 Cycleroots;
tcellseq41106 Tempstack;
NI Recgclock;
tmemregion23410 Region;
tgcstat43014 Stat;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct tinfocpu142453 {
NimStringDesc* Field0;
NI Field1;
NU8 Field2;
NI Field3;
NI Field4;
};
typedef tinfocpu142453 TY142469[14];
typedef NimStringDesc* TY142463[2];
struct tinfoos142044 {
NimStringDesc* Field0;
NimStringDesc* Field1;
NimStringDesc* Field2;
NimStringDesc* Field3;
NimStringDesc* Field4;
NimStringDesc* Field5;
NimStringDesc* Field6;
NimStringDesc* Field7;
NimStringDesc* Field8;
NimStringDesc* Field9;
NimStringDesc* Field10;
NimStringDesc* Field11;
NU8 Field12;
};
typedef tinfoos142044 TY142064[23];
struct  TNimObject  {
TNimType* m_type;
};
struct  tidobj167013  {
  TNimObject Sup;
NI Id;
};
struct  tident167019  {
  tidobj167013 Sup;
NimStringDesc* S;
tident167019* Next;
NI H;
};
struct tkeyvaluepair121806 {
NimStringDesc* Field0;
NimStringDesc* Field1;
};
struct  tstringtable121810  {
  TNimObject Sup;
NI Counter;
tkeyvaluepairseq121808* Data;
NU8 Mode;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
typedef NI TY22618[16];
struct  tpagedesc41098  {
tpagedesc41098* Next;
NI Key;
TY22618 Bits;
};
struct  tbasechunk22636  {
NI Prevsize;
NI Size;
NIM_BOOL Used;
};
struct  tsmallchunk22638  {
  tbasechunk22636 Sup;
tsmallchunk22638* Next;
tsmallchunk22638* Prev;
tfreecell22628* Freelist;
NI Free;
NI Acc;
NF Data;
};
struct  tllchunk23404  {
NI Size;
NI Acc;
tllchunk23404* Next;
};
struct  tbigchunk22640  {
  tbasechunk22636 Sup;
tbigchunk22640* Next;
tbigchunk22640* Prev;
NI Align;
NF Data;
};
struct  ttrunk22611  {
ttrunk22611* Next;
NI Key;
TY22618 Bits;
};
typedef tavlnode23408* TY23414[2];
struct  tavlnode23408  {
TY23414 Link;
NI Key;
NI Upperbound;
NI Level;
};
struct  tfreecell22628  {
tfreecell22628* Next;
NI Zerofield;
};
struct tkeyvaluepairseq121808 {
  TGenericSeq Sup;
  tkeyvaluepair121806 data[SEQ_DECL_SIZE];
};
N_NIMCALL(tstringtable121810*, nstnewStringTable)(NU8 mode);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incref_46827)(tcell41090* c);
static N_INLINE(NIM_BOOL, canbecycleroot_44462)(tcell41090* c);
static N_INLINE(void, rtladdcycleroot_45235)(tcell41090* c);
N_NOINLINE(void, incl_41855)(tcellset41102* s, tcell41090* cell);
static N_INLINE(tcell41090*, usrtocell_44443)(void* usr);
static N_INLINE(void, decref_46402)(tcell41090* c);
static N_INLINE(void, rtladdzct_46002)(tcell41090* c);
N_NOINLINE(void, addzct_44418)(tcellseq41106* s, tcell41090* c);
N_NIMCALL(void, definesymbol_168006)(NimStringDesc* symbol);
N_NIMCALL(void, nstPut)(tstringtable121810* t, NimStringDesc* key, NimStringDesc* val);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(NimStringDesc*, nsuNormalize)(NimStringDesc* s);
N_NIMCALL(NIM_BOOL, isdefined_168016)(NimStringDesc* symbol);
N_NIMCALL(NIM_BOOL, nsthasKey)(tstringtable121810* t, NimStringDesc* key);
N_NIMCALL(NimStringDesc*, nstGet)(tstringtable121810* t, NimStringDesc* key);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
STRING_LITERAL(TMP985, "true", 4);
STRING_LITERAL(TMP986, "nimrod", 6);
STRING_LITERAL(TMP987, "nimhygiene", 10);
STRING_LITERAL(TMP988, "niminheritable", 14);
STRING_LITERAL(TMP989, "nimmixin", 8);
STRING_LITERAL(TMP990, "nimeffects", 10);
STRING_LITERAL(TMP991, "nimbabel", 8);
STRING_LITERAL(TMP992, "nimcomputedgoto", 15);
STRING_LITERAL(TMP993, "nimunion", 8);
STRING_LITERAL(TMP994, "nimnewshared", 12);
STRING_LITERAL(TMP995, "nimrequiresnimframe", 19);
STRING_LITERAL(TMP996, "x86", 3);
STRING_LITERAL(TMP997, "itanium", 7);
STRING_LITERAL(TMP998, "x8664", 5);
STRING_LITERAL(TMP999, "msdos", 5);
STRING_LITERAL(TMP1000, "mswindows", 9);
STRING_LITERAL(TMP1001, "win32", 5);
STRING_LITERAL(TMP1002, "unix", 4);
STRING_LITERAL(TMP1003, "posix", 5);
STRING_LITERAL(TMP1004, "sunos", 5);
STRING_LITERAL(TMP1005, "bsd", 3);
STRING_LITERAL(TMP1006, "macintosh", 9);
STRING_LITERAL(TMP1007, "cpu", 3);
extern NIM_CONST TY142469 cpu_142468;
extern NIM_CONST TY142463 endiantostr_142462;
extern NIM_CONST TY142064 os_142063;
STRING_LITERAL(TMP1010, "emulatedthreadvars", 18);
STRING_LITERAL(TMP1172, "false", 5);
tstringtable121810* gsymbols_168003;
extern tgcheap43016 gch_43044;
extern NU8 targetcpu_142573;
extern NU8 targetos_142575;

static N_INLINE(NIM_BOOL, canbecycleroot_44462)(tcell41090* c) {
	NIM_BOOL result;
	result = 0;
	result = !((((*(*c).Typ).flags &(1<<((((NU8) 1))&7)))!=0));
	return result;
}

static N_INLINE(void, rtladdcycleroot_45235)(tcell41090* c) {
	{
		if (!!((((NI) ((NI)((*c).Refcount & 3))) == 3))) goto LA3;
		(*c).Refcount = (NI)((NI)((*c).Refcount & -4) | 3);
		incl_41855(&gch_43044.Cycleroots, c);
	}
	LA3: ;
}

static N_INLINE(void, incref_46827)(tcell41090* c) {
	(*c).Refcount = (NI)((NU32)((*c).Refcount) + (NU32)(8));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = canbecycleroot_44462(c);
		if (!LOC3) goto LA4;
		rtladdcycleroot_45235(c);
	}
	LA4: ;
}

static N_INLINE(tcell41090*, usrtocell_44443)(void* usr) {
	tcell41090* result;
	result = 0;
	result = ((tcell41090*) ((NI)((NU32)(((NI) (usr))) - (NU32)(((NI)sizeof(tcell41090))))));
	return result;
}

static N_INLINE(void, rtladdzct_46002)(tcell41090* c) {
	addzct_44418(&gch_43044.Zct, c);
}

static N_INLINE(void, decref_46402)(tcell41090* c) {
	{
		(*c).Refcount -= 8;
		if (!((NU32)((*c).Refcount) < (NU32)(8))) goto LA3;
		rtladdzct_46002(c);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = canbecycleroot_44462(c);
		if (!LOC6) goto LA7;
		rtladdcycleroot_45235(c);
	}
	goto LA1;
	LA7: ;
	LA1: ;
}

static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		tcell41090* LOC5;
		if (!!((src == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = usrtocell_44443(src);
		incref_46827(LOC5);
	}
	LA3: ;
	{
		tcell41090* LOC10;
		if (!!(((*dest) == NIM_NIL))) goto LA8;
		LOC10 = 0;
		LOC10 = usrtocell_44443((*dest));
		decref_46402(LOC10);
	}
	LA8: ;
	(*dest) = src;
}

N_NIMCALL(void, definesymbol_168006)(NimStringDesc* symbol) {
	nstPut(gsymbols_168003, symbol, ((NimStringDesc*) &TMP985));
}

static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
	memcpy(((NCSTRING) (&(*dest).data[((*dest).Sup.len)- 0])), ((NCSTRING) ((*src).data)), (NI32)((*src).Sup.len + 1));
	(*dest).Sup.len += (*src).Sup.len;
}

N_NIMCALL(void, initdefines_168072)(void) {
	NimStringDesc* LOC13;
	NimStringDesc* LOC14;
	NimStringDesc* LOC15;
	asgnRef((void**) &gsymbols_168003, nstnewStringTable(((NU8) 2)));
	definesymbol_168006(((NimStringDesc*) &TMP986));
	definesymbol_168006(((NimStringDesc*) &TMP987));
	definesymbol_168006(((NimStringDesc*) &TMP988));
	definesymbol_168006(((NimStringDesc*) &TMP989));
	definesymbol_168006(((NimStringDesc*) &TMP990));
	definesymbol_168006(((NimStringDesc*) &TMP991));
	definesymbol_168006(((NimStringDesc*) &TMP992));
	definesymbol_168006(((NimStringDesc*) &TMP993));
	definesymbol_168006(((NimStringDesc*) &TMP994));
	definesymbol_168006(((NimStringDesc*) &TMP995));
	switch (targetcpu_142573) {
	case ((NU8) 1):
	{
		definesymbol_168006(((NimStringDesc*) &TMP996));
	}
	break;
	case ((NU8) 8):
	{
		definesymbol_168006(((NimStringDesc*) &TMP997));
	}
	break;
	case ((NU8) 9):
	{
		definesymbol_168006(((NimStringDesc*) &TMP998));
	}
	break;
	default:
	{
	}
	break;
	}
	switch (targetos_142575) {
	case ((NU8) 1):
	{
		definesymbol_168006(((NimStringDesc*) &TMP999));
	}
	break;
	case ((NU8) 2):
	{
		definesymbol_168006(((NimStringDesc*) &TMP1000));
		definesymbol_168006(((NimStringDesc*) &TMP1001));
	}
	break;
	case ((NU8) 4):
	case ((NU8) 5):
	case ((NU8) 6):
	case ((NU8) 8):
	case ((NU8) 13):
	case ((NU8) 14):
	case ((NU8) 16):
	case ((NU8) 12):
	case ((NU8) 20):
	{
		definesymbol_168006(((NimStringDesc*) &TMP1002));
		definesymbol_168006(((NimStringDesc*) &TMP1003));
	}
	break;
	case ((NU8) 7):
	{
		definesymbol_168006(((NimStringDesc*) &TMP1004));
		definesymbol_168006(((NimStringDesc*) &TMP1002));
		definesymbol_168006(((NimStringDesc*) &TMP1003));
	}
	break;
	case ((NU8) 9):
	case ((NU8) 10):
	case ((NU8) 11):
	{
		definesymbol_168006(((NimStringDesc*) &TMP1002));
		definesymbol_168006(((NimStringDesc*) &TMP1005));
		definesymbol_168006(((NimStringDesc*) &TMP1003));
	}
	break;
	case ((NU8) 18):
	{
		definesymbol_168006(((NimStringDesc*) &TMP1006));
	}
	break;
	case ((NU8) 19):
	{
		definesymbol_168006(((NimStringDesc*) &TMP1006));
		definesymbol_168006(((NimStringDesc*) &TMP1002));
		definesymbol_168006(((NimStringDesc*) &TMP1003));
	}
	break;
	default:
	{
	}
	break;
	}
	LOC13 = 0;
	LOC14 = 0;
	LOC14 = nimIntToStr(cpu_142468[(targetcpu_142573)- 1].Field4);
	LOC13 = rawNewString(LOC14->Sup.len + 3);
appendString(LOC13, ((NimStringDesc*) &TMP1007));
appendString(LOC13, LOC14);
	definesymbol_168006(LOC13);
	LOC15 = 0;
	LOC15 = nsuNormalize(endiantostr_142462[(cpu_142468[(targetcpu_142573)- 1].Field2)- 0]);
	definesymbol_168006(LOC15);
	definesymbol_168006(cpu_142468[(targetcpu_142573)- 1].Field0);
	definesymbol_168006(os_142063[(targetos_142575)- 1].Field0);
	{
		if (!((os_142063[(targetos_142575)- 1].Field12 &(1<<((((NU8) 3))&7)))!=0)) goto LA18;
		definesymbol_168006(((NimStringDesc*) &TMP1010));
	}
	LA18: ;
}

N_NIMCALL(void, undefsymbol_168011)(NimStringDesc* symbol) {
	nstPut(gsymbols_168003, symbol, ((NimStringDesc*) &TMP1172));
}

static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b) {
	NIM_BOOL result;
	NIM_BOOL LOC11;
	int LOC13;
	result = 0;
	{
		if (!(a == b)) goto LA3;
		result = NIM_TRUE;
		goto BeforeRet;
	}
	LA3: ;
	{
		NIM_BOOL LOC7;
		LOC7 = 0;
		LOC7 = (a == NIM_NIL);
		if (LOC7) goto LA8;
		LOC7 = (b == NIM_NIL);
		LA8: ;
		if (!LOC7) goto LA9;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA9: ;
	LOC11 = 0;
	LOC11 = ((*a).Sup.len == (*b).Sup.len);
	if (!(LOC11)) goto LA12;
	LOC13 = 0;
	LOC13 = memcmp(((NCSTRING) ((*a).data)), ((NCSTRING) ((*b).data)), (NI32)((*a).Sup.len * 1));
	LOC11 = (LOC13 == ((NI32) 0));
	LA12: ;
	result = LOC11;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, isdefined_168016)(NimStringDesc* symbol) {
	NIM_BOOL result;
	result = 0;
	{
		NIM_BOOL LOC3;
		NimStringDesc* LOC6;
		LOC3 = 0;
		LOC3 = nsthasKey(gsymbols_168003, symbol);
		if (!LOC3) goto LA4;
		LOC6 = 0;
		LOC6 = nstGet(gsymbols_168003, symbol);
		result = eqStrings(LOC6, ((NimStringDesc*) &TMP985));
	}
	LA4: ;
	return result;
}

N_NIMCALL(NIM_BOOL, isdefined_168022)(tident167019* symbol) {
	NIM_BOOL result;
	result = 0;
	result = isdefined_168016((*symbol).S);
	return result;
}

N_NIMCALL(NI, countdefinedsymbols_168042)(void) {
	NI result;
	NimStringDesc* key_168045;
	NimStringDesc* val_168046;
	NI h_168064;
	NI HEX3Atmp_168066;
	NI res_168068;
	result = 0;
	result = 0;
	key_168045 = 0;
	val_168046 = 0;
	h_168064 = 0;
	HEX3Atmp_168066 = 0;
	HEX3Atmp_168066 = ((*gsymbols_168003).Data->Sup.len-1);
	res_168068 = 0;
	while (1) {
		if (!(res_168068 <= HEX3Atmp_168066)) goto LA1;
		h_168064 = res_168068;
		{
			if (!!((*gsymbols_168003).Data->data[h_168064].Field0 == 0)) goto LA4;
			key_168045 = (*gsymbols_168003).Data->data[h_168064].Field0;
			val_168046 = (*gsymbols_168003).Data->data[h_168064].Field1;
			{
				if (!eqStrings(val_168046, ((NimStringDesc*) &TMP985))) goto LA8;
				result += 1;
			}
			LA8: ;
		}
		LA4: ;
		res_168068 += 1;
	} LA1: ;
	return result;
}
N_NOINLINE(void, condsymsInit)(void) {
}

N_NOINLINE(void, condsymsDatInit)(void) {
}

