// unzip_code_n.c
// Generated by decompiling unzip.exe
// using Reko decompiler version 0.11.6.0.

#include "unzip.h"

// 000117AA: void fn000117AA()
// Called from:
//      fn00010E6A
void fn000117AA()
{
	if (g_dw79EB <= 0x2000)
	{
		(*((word32) g_ptr1926C + 2))();
		struct Eq_n * sp_n;
		struct Eq_n * r2_n;
		sp_n->dwFFFFFFFC = r2_n->dwC61B;
		sp_n->dwFFFFFFF8 = r2_n->dwC5F3;
		sp_n->dwFFFFFFF4 = r2_n->dwC617;
		(*((word32) g_ptr19270 + 2))();
		struct Eq_n * r2_n;
		struct Eq_n * r0_n;
		r2_n->ptrC5FB = r0_n;
		word32 sp_n;
		word32 r4_n;
		if (r2_n->ptrC5FB == r2_n->ptrC61B)
		{
			r2_n->ptrC5F7 = r2_n->ptrC61B + r2_n->ptrC5F3 - 22;
			while (r2_n->ptrC5F7 >= r2_n->ptrC5F3)
			{
				byte * r3_n = r2_n->ptrC5F7;
				r0_n = (uint32) *r3_n;
				if (r0_n == (struct Eq_n *) 0x50)
				{
					struct Eq_n * sp_n = sp_n - 0x04;
					sp_n->dw0000 = 0x04;
					sp_n->ptrFFFFFFFC = (char *) &r2_n->dwC61F + 26;
					sp_n->ptrFFFFFFF8 = r3_n;
					(*((word32) g_ptr192D8 + 2))();
					if (r0_n == null)
					{
						r0_n = r2_n->ptrC5F7 - r2_n->ptrC5F3;
						r2_n->ptrC5FB -= r0_n;
						r4_n = 0x01;
						break;
					}
				}
				--r2_n->ptrC5F7;
			}
		}
		if (r4_n != 0x00)
		{
			r2_n->dw007C = r2_n->ptrC5F7 - r2_n->ptrC5F3 + r2_n->dwC61F;
			struct Eq_n * sp_n = sp_n - 0x04;
			sp_n->dw0000 = 22;
			struct Eq_n * fp_n;
			sp_n->dwFFFFFFFC = (char *) &fp_n->dwFFFFFFE4 + 2;
			struct Eq_n * ap_n;
			word32 r2_n;
			word32 r3_n;
			word32 r4_n;
			word32 ap_n;
			word32 fp_n;
			if (fn0000D5BE(r0_n, ap_n, fp_n, out r2_n, out r3_n, out r4_n, out ap_n, out fp_n) == 0x00)
				return;
			fn0000005A(fp_n + -22);
			struct Eq_n * r2_n;
			word32 r0_n;
			r2_n->wC682 = (word16) r0_n;
			word32 fp_n;
			fn0000005A(fp_n + -20);
			struct Eq_n * r2_n;
			word32 r0_n;
			r2_n->wC684 = (word16) r0_n;
			word32 fp_n;
			fn0000005A(fp_n + -18);
			struct Eq_n * r2_n;
			word32 r0_n;
			r2_n->wC686 = (word16) r0_n;
			word32 fp_n;
			fn0000005A(fp_n + -16);
			struct Eq_n * r2_n;
			word32 r0_n;
			r2_n->wC688 = (word16) r0_n;
			struct Eq_n * sp_n;
			struct Eq_n * fp_n;
			sp_n->dwFFFFFFFC = (char *) &fp_n->dwFFFFFFEC + 6;
			struct Eq_n * r2_n;
			struct Eq_n * ap_n;
			struct Eq_n * ap_n;
			struct Eq_n * fp_n;
			r2_n->dwC68A = fn0000E276(ap_n, fp_n, out r2_n, out ap_n, out fp_n);
			struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
			sp_n->dwFFFFFFFC = (char *) &fp_n->ptrFFFFFFF4 + 2;
			struct Eq_n * r2_n;
			word32 ap_n;
			word32 fp_n;
			r2_n->dwC68E = fn0000E276(ap_n, fp_n, out r2_n, out ap_n, out fp_n);
			fn0000005A(fp_n + -6);
			struct Eq_n * r2_n;
			word32 r0_n;
			r2_n->wC692 = (word16) r0_n;
			r2_n->dw0080 = r2_n->dwC68A + r2_n->dwC68E;
		}
		else
		{
			if (r2_n->dw0040 != 0x00 || r2_n->dw0000 != 0x00)
			{
				struct Eq_n * sp_n = sp_n - 0x04;
				sp_n->dw0000 = 0x0401;
				sp_n->dwFFFFFFFC = r2_n->dwC613;
				word32 r8_n;
				sp_n->dwFFFFFFF8 = r8_n + 0x0077;
				sp_n->ptrFFFFFFF4 = (char *) &r2_n->dw007C + 1391;
				(*((word32) g_ptr192D0 + 2))();
				struct Eq_n * sp_n;
				word32 r0_n;
				sp_n->dwFFFFFFFC = r0_n;
				struct Eq_n * r2_n;
				sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
				sp_n->ptrFFFFFFF4 = r2_n;
				ptr32 r3_n = r2_n->ptrC839;
				(*((word32) r3_n + 2))();
			}
			struct Eq_n * sp_n = sp_n - 0x04;
			sp_n->dw0000 = 0x0401;
			word32 r9_n;
			sp_n->dwFFFFFFFC = r9_n + 0x0648;
			sp_n->ptrFFFFFFF8 = (char *) &r2_n->dw007C + 1391;
			(*((word32) g_ptr192D0 + 2))();
			struct Eq_n * sp_n;
			word32 r0_n;
			sp_n->dwFFFFFFFC = r0_n;
			struct Eq_n * r2_n;
			sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
			sp_n->ptrFFFFFFF4 = r2_n;
			ptr32 r3_n = r2_n->ptrC839;
			(*((word32) r3_n + 2))();
		}
	}
}

// 00011C0A: Register (ptr32 Eq_n) fn00011C0A(Register (ptr32 Eq_n) r0, Register word32 r1, Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register out (ptr32 Eq_n) r2Out, Register out word32 r3Out, Register out (ptr32 Eq_n) fpOut)
// Called from:
//      fn0000E3DA
//      fn00012D86
//      fn000173CA
struct Eq_n * fn00011C0A(struct Eq_n * r0, word32 r1, struct Eq_n * ap, struct Eq_n * fp, struct Eq_n & r2Out, word32 & r3Out, struct Eq_n & fpOut)
{
	struct Eq_n * fp_n;
	word32 r3_n;
	struct Eq_n * r2_n;
	struct Eq_n * r0_n = fn00011CDA(r0, ap, fp, out r2_n, out r3_n, out fp_n);
	if (r0_n != null)
	{
		struct Eq_n * fp_n = fp_n->ptr000C;
		r2Out = r2_n;
		r3Out = r3_n;
		fpOut = fp_n;
		return r0_n;
	}
	struct Eq_n * r0_n = r2_n->ptr05E7;
	uip32 r1_n;
	if ((uint32) r2_n->bC659 < 0x12)
		r1_n = SEQ(SLICE(r1, word24, 8), r2_n->bC659);
	else
		r1_n = SEQ(SLICE(r1, word24, 8), 0x12);
	r0_n->t000C.u1 = (uint32) (byte) r1_n;
	struct Eq_n * ap_n = r2_n->ptr05E7;
	ap_n->t0014.u1 = (byte) (ap_n->t0014.u1 & ~0x10);
	if (r2_n->dw0028 != 0x00)
	{
		struct Eq_n * ap_n = r2_n->ptr05E7;
		Eq_n r0_n;
		r0_n.u0 = ap_n->t000C.u0;
		if (r0_n <= 0x11)
		{
			g_a11C5E[r0_n]();
			struct Eq_n * r2_n;
			r2Out = r2_n;
			word32 r3_n;
			r3Out = r3_n;
			struct Eq_n * fp_n;
			fpOut = fp_n;
			struct Eq_n * r0_n;
			return r0_n;
		}
	}
	if ((r2_n->dwC67A & 0x08) != 0x00)
	{
		Eq_n ap_n;
		ap_n.u0 = r2_n->ptr05E7->t000C.u0;
		if (ap_n == 0x00 || (ap_n == 0x06 || (ap_n == 11 || ap_n == 0x05)))
		{
			struct Eq_n * ap_n = r2_n->ptr05E7;
			ap_n->t0014.u1 = (byte) (ap_n->t0014.u1 | 0x20);
			struct Eq_n * ap_n = r2_n->ptr05E7;
			ap_n->t0014.u1 = (byte) (ap_n->t0014.u1 & ~0x10);
l00011CD5:
			struct Eq_n * fp_n = fp_n->ptr000C;
			r2Out = r2_n;
			r3Out = r3_n;
			fpOut = fp_n;
			return null;
		}
	}
	struct Eq_n * ap_n = r2_n->ptr05E7;
	ap_n->t0014.u1 = (byte) (ap_n->t0014.u1 & 223);
	goto l00011CD5;
}

Eq_n g_a11C5E[] = // 00011C5E
	{
	};
// 00011CDA: Register (ptr32 Eq_n) fn00011CDA(Register (ptr32 Eq_n) r0, Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register out (ptr32 Eq_n) r2Out, Register out word32 r3Out, Register out word32 fpOut)
// Called from:
//      fn00011C0A
struct Eq_n * fn00011CDA(struct Eq_n * r0, struct Eq_n * ap, struct Eq_n * fp, struct Eq_n & r2Out, word32 & r3Out, word32 & fpOut)
{
	struct Eq_n * fp_n;
	struct Eq_n * r2_n;
	word32 r3_n;
	word32 r4_n;
	word32 ap_n;
	struct Eq_n * fp_n;
	if (fn0000D5BE(r0, ap, fp, out r2_n, out r3_n, out r4_n, out ap_n, out fp_n) != 0x00)
	{
		r2_n->bC658 = fp_n->bFFFFFFD2;
		r2_n->bC659 = fp_n->bFFFFFFD3;
		r2_n->bC65A = fp_n->bFFFFFFD4;
		r2_n->bC65B = fp_n->bFFFFFFD5;
		fn0000005A(&fp_n->bFFFFFFD5 + 1);
		struct Eq_n * r2_n;
		word32 r0_n;
		r2_n->wC65C = (word16) r0_n;
		word32 fp_n;
		fn0000005A(fp_n + -40);
		struct Eq_n * r2_n;
		word32 r0_n;
		r2_n->wC65E = (word16) r0_n;
		word32 fp_n;
		fn0000005A(fp_n + -38);
		struct Eq_n * r2_n;
		word32 r0_n;
		r2_n->wC660 = (word16) r0_n;
		word32 fp_n;
		fn0000005A(fp_n + -36);
		struct Eq_n * r2_n;
		word32 r0_n;
		r2_n->wC662 = (word16) r0_n;
		word32 fp_n;
		fn00000076(fp_n + -0x0022);
		struct Eq_n * r2_n;
		word32 r0_n;
		r2_n->dwC664 = r0_n;
		word32 fp_n;
		fn00000076(fp_n + -30);
		struct Eq_n * r2_n;
		word32 r0_n;
		r2_n->dwC668 = r0_n;
		word32 fp_n;
		fn00000076(fp_n + -26);
		struct Eq_n * r2_n;
		word32 r0_n;
		r2_n->dwC66C = r0_n;
		word32 fp_n;
		fn0000005A(fp_n + -22);
		struct Eq_n * r2_n;
		word32 r0_n;
		r2_n->wC670 = (word16) r0_n;
		word32 fp_n;
		fn0000005A(fp_n + -20);
		struct Eq_n * r2_n;
		word32 r0_n;
		r2_n->wC672 = (word16) r0_n;
		word32 fp_n;
		fn0000005A(fp_n + -18);
		struct Eq_n * r2_n;
		word32 r0_n;
		r2_n->wC674 = (word16) r0_n;
		word32 fp_n;
		fn0000005A(fp_n + -16);
		struct Eq_n * r2_n;
		word32 r0_n;
		r2_n->wC676 = (word16) r0_n;
		word32 fp_n;
		fn0000005A(fp_n + -0x0E);
		struct Eq_n * r2_n;
		word32 r0_n;
		r2_n->wC678 = (word16) r0_n;
		word32 fp_n;
		fn00000076(fp_n + -0x0C);
		struct Eq_n * r2_n;
		word32 r0_n;
		r2_n->dwC67A = r0_n;
		word32 fp_n;
		fn00000076(fp_n + -8);
		struct Eq_n * r2_n;
		word32 r0_n;
		r2_n->dwC67E = r0_n;
		word32 fp_n = fp_n->dw000C;
		r2Out = r2_n;
		word32 r3_n;
		r3Out = r3_n;
		fpOut = fp_n;
		return null;
	}
	else
	{
		word32 fp_n = fp_n->dw000C;
		r2Out = r2_n;
		r3Out = r3_n;
		fpOut = fp_n;
		return (struct Eq_n *) 0x33;
	}
}

<unknown> g_t11DE0 = // 00011DE0;
// 00011ED6: void fn00011ED6()
// Called from:
//      fn0000D69A
void fn00011ED6()
{
}

// 00011F06: void fn00011F06()
// Called from:
//      fn0000D69A
void fn00011F06()
{
}

<unknown> g_t1205C = // 0001205C;
// 000121EA: void fn000121EA(Register (ptr32 Eq_n) ap, Register word32 fp)
void fn000121EA(struct Eq_n * ap, word32 fp)
{
	fn00012252(ap, fp);
}

// 00012252: void fn00012252(Register (ptr32 Eq_n) ap, Register word32 fp)
// Called from:
//      fn000121EA
void fn00012252(struct Eq_n * ap, word32 fp)
{
	byte * r4_n = ap->ptr0008;
	g_dw7BD9 = 305419896;
	g_dw7BDD = 591751049;
	g_dw7BE1 = 878082192;
	if (*r4_n == 0x00)
		(*((word32) g_ptr1929C + 2))();
}

// 000124FE: void fn000124FE(Register (ptr32 ptr32) pc)
// Called from:
//      fn0000D69A
//      fn000125CA
void fn000124FE(ptr32 * pc)
{
	ptr32 fp;
	struct Eq_n * sp_n = fp - 0x04;
	struct Eq_n * r2_n = (struct Eq_n *) 4294939996;
	real32 v16_n;
	struct Eq_n * r0_n;
	do
	{
		struct Eq_n * sp_n = sp_n - 0x08;
		sp_n->qw0000 = 0x00;
		sp_n->ptrFFFFFFFC = &r2_n->w0008;
		sp_n->ptrFFFFFFF8 = r2_n;
		(*((word32) *pc + 2))();
		v16_n = *sp_n->ptr7FFE;
		*r0_n->ptrFFFFA250 = v16_n;
	} while (v16_n > 0.0F);
	*r0_n->ptr14A2 = 0.8125F;
	struct Eq_n * ap_n;
	ap_n->rFFFFFFFC = 0.75F;
	sp_n->ptrFFFFFFFC = ap_n - 0x0C;
	sp_n->dwFFFFFFF8 = 0x08;
	sp_n->ptrFFFFFFF4 = &r2_n->w0008 + 8;
	sp_n->qwFFFFFFEC = 0x00;
	sp_n->ptrFFFFFFE8 = &r2_n->w0008 + 1;
	sp_n->dwFFFFFFE4 = 0x27;
	sp_n->dwFFFFFFE0 = (int32) r2_n->w0008;
	sp_n->dwFFFFFFDC = 0x00;
	(*((word32) *pc + 2))();
	__halt();
}

// 000125CA: void fn000125CA(Register (ptr32 ptr32) pc)
void fn000125CA(ptr32 * pc)
{
	fn000124FE(pc);
}

// 00012616: void fn00012616()
void fn00012616()
{
	word32 r1_n;
	int32 r0_n;
	ptr32 r5_n;
	word32 r6_n;
	struct Eq_n * sp_n;
	word32 r8_n;
	(*((word32) g_ptr19248 + 2))();
	struct Eq_n * sp_n;
	word32 r0_n;
	sp_n->dwFFFFFFFC = r0_n;
	(*((word32) g_ptr1924C + 2))();
	word32 r0_n;
	if (r0_n == 0x00)
		return;
	struct Eq_n * sp_n;
	sp_n->dwFFFFFFFC = *g_ptr19374;
	(*((word32) g_ptr19294 + 2))();
	struct Eq_n * sp_n;
	sp_n->dw0004 = g_dw19258;
	struct Eq_n * ap_n;
	sp_n->ptr0000 = ap_n->ptr0008;
	byte * r9_n = r8_n + 0x0E;
	int32 r2_n;
	do
	{
		word32 * r7_n;
		if (*r9_n != 0x00)
		{
			struct Eq_n * sp_n = sp_n - 0x04;
			sp_n->dw0000 = *r7_n;
			sp_n->ptrFFFFFFFC = r9_n;
			(*((word32) sp_n->ptr0008 + 2))();
		}
		struct Eq_n * sp_n = sp_n - 0x04;
		sp_n->dw0000 = *r7_n;
		sp_n->dwFFFFFFFC = ap_n->dw0004;
		(*((word32) sp_n->ptr0008 + 2))();
		struct Eq_n * sp_n;
		word32 * r7_n;
		sp_n->dwFFFFFFFC = *r7_n;
		ptr32 r11_n;
		(*((word32) r11_n + 2))();
		fn000000FE(0x00);
		struct Eq_n * sp_n = sp_n;
		word32 r6_n = r6_n;
		ptr32 r5_n = r5_n;
		uip32 r1_n;
		do
		{
			sp_n->dwFFFFFFFC = r6_n;
			(*((word32) r5_n + 2))();
			int8 v32_n = (int8) r0_n;
			word24 v33_n = SLICE(r1_n, word24, 8);
			r1_n = SEQ(v33_n, v32_n);
			if (v32_n == 0x0D)
				r1_n = SEQ(v33_n, 0x0A);
			int32 r2_n;
			int32 r4_n;
			if (r2_n < r4_n)
			{
				Eq_n (** r3_n)[];
				*((char *) *r3_n + r2_n) = (Eq_n (**)[]) (byte) r1_n;
			}
		} while ((byte) r1_n != 0x0A);
		fn000000FE(0x01);
		struct Eq_n * sp_n;
		word32 * r7_n;
		sp_n->dwFFFFFFFC = *r7_n;
		sp_n->dwFFFFFFF8 = 0x0A;
		(*((word32) g_ptr19268 + 2))();
		struct Eq_n * sp_n;
		word32 * r7_n;
		sp_n->dwFFFFFFFC = *r7_n;
		ptr32 r11_n;
		(*((word32) r11_n + 2))();
		word32 r8_n;
		r9_n = r8_n + 0x0F;
	} while ((&sp_n->ptr0000[0].u0)[r2_n - 0x01] != 0x0A);
	Eq_n r3_n[] = ap_n->ptr0008;
	*((char *) &r3_n[0].u1 + (r2_n - 0x01)) = (Eq_n (*)[]) 0<32>;
	word32 r6_n;
	sp_n->dwFFFFFFFC = r6_n;
	(*((word32) g_ptr19250 + 2))();
}

// 00012702: Register (ptr32 int8) fn00012702(Register (ptr32 int8) r0, Register (ptr32 Eq_n) ap, Register out word32 r2Out, Register out word32 r7Out, Register out word32 apOut, Register out word32 fpOut)
// Called from:
//      fn0000802E
int8 * fn00012702(int8 * r0, struct Eq_n * ap, word32 & r2Out, word32 & r7Out, word32 & apOut, word32 & fpOut)
{
	struct Eq_n * fp_n;
	word32 r7_n;
	word32 r2_n;
	ptr32 fp;
	*(word32 *) ~0x4BBB = 0x00;
	struct Eq_n * v23_n = (struct Eq_n *) *ap->t0008.u0;
	int32 r4_n = (int32) *ap->ptr0004;
	int32 * sp_n = fp - 0x10;
	struct Eq_n * r2_n = (struct Eq_n *) 4294947792;
	struct Eq_n * dwLoc0C_n = v23_n;
	int32 dwLoc10_n = r4_n - 0x01;
	if (r4_n > 0x01)
	{
		dwLoc0C_n = v23_n + 1;
		if (*v23_n[1].dw0000 == 0x2D)
		{
			struct Eq_n * v39_n;
			do
			{
				r0 = dwLoc0C_n->dw0000 + 0x01;
				int32 r4_n = (int32) *r0;
				if (r4_n != 0x00)
				{
					if (r4_n <= 122)
					{
						g_a12763[r4_n - 0x2D]();
						word32 r2_n;
						r2Out = r2_n;
						word32 r7_n;
						r7Out = r7_n;
						word32 ap_n;
						apOut = ap_n;
						word32 fp_n;
						fpOut = fp_n;
						int8 * r0_n;
						return r0_n;
					}
				}
				int32 v38_n = dwLoc10_n - 0x01;
				dwLoc10_n = v38_n;
				if (v38_n <= 0x00)
					break;
				v39_n = dwLoc0C_n + 1;
				dwLoc0C_n = v39_n;
			} while (*v39_n->dw0000 == 0x2D);
		}
	}
	int32 v28_n = dwLoc10_n - 0x01;
	if (dwLoc10_n == 0x00 || false)
	{
		*ap->ptr0004 = (byte) v28_n;
		*ap->t0008.u0 = (byte) dwLoc0C_n;
		int8 * r0_n = fn00008CCE(r0, ap, out r2_n, out r7_n, out fp_n);
		word32 fp_n = fp_n->dw000C;
		word32 ap_n = fp_n->dw0008;
		r2Out = r2_n;
		r7Out = r7_n;
		apOut = ap_n;
		fpOut = fp_n;
		return r0_n;
	}
	else
	{
		if (*(word32 *) ~0x4C03 != 0x00)
		{
			(*((word32) g_ptr192E4 + 2))();
			word32 r0_n;
			if (r0_n == 0x00)
				r2_n[11] = (struct Eq_n) 0x00;
		}
		if (r2_n[9] < 0x00 || *sp_n > 0x00 && r2_n[9] == 0x00)
			r2_n[9] = (struct Eq_n) 0x03;
		int32 r0_n = (int32) r2_n[9];
		if (r0_n <= 0x0A)
		{
			g_a129AE[r0_n]();
			word32 r2_n;
			r2Out = r2_n;
			word32 r7_n;
			r7Out = r7_n;
			word32 ap_n;
			apOut = ap_n;
			word32 fp_n;
			fpOut = fp_n;
			int8 * r0_n;
			return r0_n;
		}
	}
}

Eq_n g_a12763[] = // 00012763
	{
	};
Eq_n g_a129AE[] = // 000129AE
	{
	};
// 00012A2A: void fn00012A2A(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp)
// Called from:
//      fn00010E6A
void fn00012A2A(struct Eq_n * ap, struct Eq_n * fp)
{
	struct Eq_n * r2_n;
	ptr32 sp_n = fp - 0x04;
	struct Eq_n * r2_n = (struct Eq_n *) 4294947792;
	ptr32 r4_n = (<unknown>*) ~0x6A7B;
	if (*(word32 *) ~0x4C13 != 0x00)
	{
		uint32 r0_n = (uint32) g_w7A58;
		ptr32 r6_n;
		if (r0_n == 0x01)
			r6_n = (<unknown>*) ~0x6A7B;
		else
			r6_n = (<unknown>*) ~0x000197A7;
		(*((word32) g_ptr192C4 + 2))();
		int32 r0_n;
		word32 r3_n;
		word32 r4_n;
		if (r0_n < 0x27)
			r3_n = r4_n + 1;
		else
			r3_n = r4_n + 39;
		struct Eq_n * sp_n;
		sp_n->dwFFFFFFFC = r3_n;
		word32 r2_n;
		sp_n->dwFFFFFFF8 = r2_n + 1515;
		(*((word32) g_ptr192D0 + 2))();
		struct Eq_n * sp_n;
		word32 r0_n;
		sp_n->dwFFFFFFFC = r0_n;
		struct Eq_n * r2_n;
		sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
		sp_n->ptrFFFFFFF4 = r2_n;
		ptr32 ap_n = r2_n->ptrC839;
		(*((word32) ap_n + 2))();
	}
	if (r2_n[9] <= 0x09)
	{
		if (r2_n[23] != 0x00 && r2_n->wC692 != 0x00)
		{
			struct Eq_n * sp_n = sp_n - 0x04;
			sp_n->dw0000 = 0x01;
			sp_n->dwFFFFFFFC = (uint32) r2_n->wC692;
			struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
			word32 r5_n;
			word32 ap_n;
			word32 fp_n;
			if (fn0000DC76(ap, fp, out r5_n, out ap_n, out fp_n) != 0x00)
			{
				sp_n->dwFFFFFFFC = 0x0401;
				sp_n->dwFFFFFFF8 = r4_n + 1222;
				sp_n->dwFFFFFFF4 = (char *) &r2_n->ptr05E7 + 4;
				(*((word32) g_ptr192D0 + 2))();
				struct Eq_n * sp_n;
				word32 r0_n;
				sp_n->dwFFFFFFFC = r0_n;
				struct Eq_n * r2_n;
				sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
				sp_n->ptrFFFFFFF4 = r2_n;
				ptr32 ap_n = r2_n->ptrC839;
				(*((word32) ap_n + 2))();
			}
		}
	}
	else
	{
		struct Eq_n * sp_n = sp_n - 0x04;
		sp_n->dw0000 = 0x00;
		sp_n->ptrFFFFFFFC = r4_n + 64;
		sp_n->ptrFFFFFFF8 = (char *) &r2_n->ptr05E7 + 4;
		ptr32 r7_n = g_ptr192D0;
		(*((word32) r7_n + 2))();
		struct Eq_n * sp_n;
		word32 r0_n;
		sp_n->dwFFFFFFFC = r0_n;
		struct Eq_n * r2_n;
		sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
		sp_n->ptrFFFFFFF4 = r2_n;
		ptr32 ap_n = r2_n->ptrC839;
		(*((word32) ap_n + 2))();
		struct Eq_n * sp_n;
		sp_n->dwFFFFFFFC = 0x00;
		word32 r4_n;
		sp_n->dwFFFFFFF8 = r4_n + 99;
		word32 r2_n;
		sp_n->dwFFFFFFF4 = r2_n + 1515;
		ptr32 r7_n;
		(*((word32) r7_n + 2))();
		struct Eq_n * sp_n;
		word32 r0_n;
		sp_n->dwFFFFFFFC = r0_n;
		struct Eq_n * r2_n;
		sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
		sp_n->ptrFFFFFFF4 = r2_n;
		ptr32 ap_n = r2_n->ptrC839;
		(*((word32) ap_n + 2))();
		struct Eq_n * sp_n;
		sp_n->dwFFFFFFFC = 0x00;
		struct Eq_n * r2_n;
		sp_n->dwFFFFFFF8 = r2_n->dw0080;
		sp_n->dwFFFFFFF4 = r2_n->dw0080;
		sp_n->dwFFFFFFF0 = r2_n->dw007C;
		sp_n->dwFFFFFFEC = r2_n->dw007C;
		word32 r4_n;
		sp_n->dwFFFFFFE8 = r4_n + 133;
		sp_n->ptrFFFFFFE4 = (char *) &r2_n->dw0080 + 0x056B;
		ptr32 r7_n;
		(*((word32) r7_n + 2))();
		struct Eq_n * sp_n;
		word32 r0_n;
		sp_n->dwFFFFFFFC = r0_n;
		struct Eq_n * r2_n;
		sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
		sp_n->ptrFFFFFFF4 = r2_n;
		ptr32 ap_n = r2_n->ptrC839;
		(*((word32) ap_n + 2))();
		uint32 r6_n = (uint32) r2_n->wC682;
		struct Eq_n * sp_n;
		word32 r5_n;
		word32 r4_n;
		ptr32 r7_n;
		if (r6_n == 0x00)
		{
			sp_n->dwFFFFFFFC = 0x00;
			sp_n->dwFFFFFFF8 = r2_n->dwC68A;
			sp_n->dwFFFFFFF4 = r2_n->dwC68A;
			uint32 r0_n = (uint32) r2_n->wC688;
			uint32 r3_n;
			if (r0_n == 0x01)
				r3_n = r5_n + 0x0A;
			else
				r3_n = r5_n + 2;
			sp_n->dwFFFFFFF0 = r3_n;
			sp_n->dwFFFFFFEC = r0_n;
			sp_n->dwFFFFFFE8 = r4_n + 332;
			sp_n->ptrFFFFFFE4 = (char *) r2_n + 1515;
			(*((word32) r7_n + 2))();
			struct Eq_n * sp_n;
			word32 r0_n;
			sp_n->dwFFFFFFFC = r0_n;
			struct Eq_n * r2_n;
			sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
			sp_n->ptrFFFFFFF4 = r2_n;
			ptr32 ap_n = r2_n->ptrC839;
			(*((word32) ap_n + 2))();
			struct Eq_n * sp_n;
			sp_n->dwFFFFFFFC = 0x00;
			struct Eq_n * r2_n;
			sp_n->dwFFFFFFF8 = r2_n->dwC68E;
			sp_n->dwFFFFFFF4 = r2_n->dwC68E;
			word32 r4_n;
			sp_n->dwFFFFFFF0 = r4_n + 537;
			sp_n->ptrFFFFFFEC = (char *) r2_n + 1515;
			ptr32 r7_n;
			(*((word32) r7_n + 2))();
			struct Eq_n * sp_n;
			word32 r0_n;
			sp_n->dwFFFFFFFC = r0_n;
			struct Eq_n * r2_n;
			sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
			sp_n->ptrFFFFFFF4 = r2_n;
			ptr32 ap_n = r2_n->ptrC839;
			(*((word32) ap_n + 2))();
		}
		else
		{
			sp_n->dwFFFFFFFC = 0x00;
			uint32 r0_n = (uint32) r2_n->wC686;
			uint32 r3_n;
			if (r0_n == 0x01)
				r3_n = r5_n + 20;
			else
				r3_n = r5_n + 16;
			sp_n->dwFFFFFFF8 = r3_n;
			sp_n->dwFFFFFFF4 = r0_n;
			uint32 ap_n = (uint32) r2_n->wC684;
			sp_n->dwFFFFFFF0 = ap_n + 0x01;
			sp_n->dwFFFFFFEC = r6_n + 0x01;
			sp_n->dwFFFFFFE8 = r4_n + 583;
			sp_n->ptrFFFFFFE4 = (char *) r2_n + 1515;
			(*((word32) r7_n + 2))();
			struct Eq_n * sp_n;
			word32 r0_n;
			sp_n->dwFFFFFFFC = r0_n;
			struct Eq_n * r2_n;
			sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
			sp_n->ptrFFFFFFF4 = r2_n;
			ptr32 ap_n = r2_n->ptrC839;
			(*((word32) ap_n + 2))();
			struct Eq_n * sp_n;
			sp_n->dwFFFFFFFC = 0x00;
			struct Eq_n * r2_n;
			sp_n->dwFFFFFFF8 = r2_n->dwC68A;
			sp_n->dwFFFFFFF4 = r2_n->dwC68A;
			uint32 r0_n = (uint32) r2_n->wC688;
			word32 r3_n;
			word32 r5_n;
			if (r0_n == 0x01)
				r3_n = r5_n + 31;
			else
				r3_n = r5_n + 23;
			sp_n->dwFFFFFFF0 = r3_n;
			sp_n->dwFFFFFFEC = r0_n;
			word32 r4_n;
			sp_n->dwFFFFFFE8 = r4_n + 726;
			sp_n->ptrFFFFFFE4 = (char *) r2_n + 1515;
			ptr32 r7_n;
			(*((word32) r7_n + 2))();
			struct Eq_n * sp_n;
			word32 r0_n;
			sp_n->dwFFFFFFFC = r0_n;
			struct Eq_n * r2_n;
			sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
			sp_n->ptrFFFFFFF4 = r2_n;
			ptr32 ap_n = r2_n->ptrC839;
			(*((word32) ap_n + 2))();
			struct Eq_n * sp_n;
			sp_n->dwFFFFFFFC = 0x00;
			struct Eq_n * r2_n;
			sp_n->dwFFFFFFF8 = r2_n->dwC68E;
			sp_n->dwFFFFFFF4 = r2_n->dwC68E;
			word32 r4_n;
			sp_n->dwFFFFFFF0 = r4_n + 857;
			sp_n->ptrFFFFFFEC = (char *) r2_n + 1515;
			ptr32 r7_n;
			(*((word32) r7_n + 2))();
			struct Eq_n * sp_n;
			word32 r0_n;
			sp_n->dwFFFFFFFC = r0_n;
			struct Eq_n * r2_n;
			sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
			sp_n->ptrFFFFFFF4 = r2_n;
			ptr32 ap_n = r2_n->ptrC839;
			(*((word32) ap_n + 2))();
		}
		struct Eq_n * r2_n;
		word32 sp_n;
		word32 r4_n;
		if (r2_n->wC692 == 0x00)
		{
			struct Eq_n * sp_n = sp_n - 0x04;
			sp_n->dw0000 = 0x00;
			sp_n->dwFFFFFFFC = r4_n + 926;
			sp_n->ptrFFFFFFF8 = (char *) r2_n + 1515;
			(*((word32) g_ptr192D0 + 2))();
			struct Eq_n * sp_n;
			word32 r0_n;
			sp_n->dwFFFFFFFC = r0_n;
			struct Eq_n * r2_n;
			sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
			sp_n->ptrFFFFFFF4 = r2_n;
			ptr32 ap_n = r2_n->ptrC839;
			(*((word32) ap_n + 2))();
		}
		else
		{
			struct Eq_n * sp_n = sp_n - 0x04;
			sp_n->dw0000 = 0x00;
			sp_n->dwFFFFFFFC = (uint32) r2_n->wC692;
			sp_n->dwFFFFFFF8 = r4_n + 958;
			sp_n->ptrFFFFFFF4 = (char *) r2_n + 1515;
			ptr32 r3_n = g_ptr192D0;
			(*((word32) r3_n + 2))();
			struct Eq_n * sp_n;
			word32 r0_n;
			sp_n->dwFFFFFFFC = r0_n;
			struct Eq_n * r2_n;
			sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
			sp_n->ptrFFFFFFF4 = r2_n;
			ptr32 ap_n = r2_n->ptrC839;
			(*((word32) ap_n + 2))();
			struct Eq_n * sp_n;
			sp_n->dwFFFFFFFC = 0x00;
			word32 r4_n;
			sp_n->dwFFFFFFF8 = r4_n + 0x0408;
			word32 r2_n;
			sp_n->dwFFFFFFF4 = r2_n + 1515;
			ptr32 r3_n;
			(*((word32) r3_n + 2))();
			struct Eq_n * sp_n;
			word32 r0_n;
			sp_n->dwFFFFFFFC = r0_n;
			struct Eq_n * r2_n;
			sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
			sp_n->ptrFFFFFFF4 = r2_n;
			ptr32 ap_n = r2_n->ptrC839;
			(*((word32) ap_n + 2))();
			struct Eq_n * sp_n;
			sp_n->dwFFFFFFFC = 0x01;
			struct Eq_n * r2_n;
			sp_n->dwFFFFFFF8 = (uint32) r2_n->wC692;
			struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
			struct Eq_n * ap_n;
			struct Eq_n * fp_n;
			word32 r5_n;
			word32 ap_n;
			word32 fp_n;
			fn0000DC76(ap_n, fp_n, out r5_n, out ap_n, out fp_n) == 0x00;
			sp_n->dwFFFFFFFC = 0x00;
			word32 r4_n;
			sp_n->dwFFFFFFF8 = r4_n + 0x0454;
			sp_n->dwFFFFFFF4 = (char *) r2_n + 1515;
			ptr32 r3_n;
			(*((word32) r3_n + 2))();
			struct Eq_n * sp_n;
			word32 r0_n;
			sp_n->dwFFFFFFFC = r0_n;
			struct Eq_n * r2_n;
			sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
			sp_n->ptrFFFFFFF4 = r2_n;
			ptr32 ap_n = r2_n->ptrC839;
			(*((word32) ap_n + 2))();
			word32 r8_n;
			if (r8_n != 0x00)
			{
				struct Eq_n * sp_n;
				sp_n->dwFFFFFFFC = 0x00;
				word32 r4_n;
				sp_n->dwFFFFFFF8 = r4_n + 1184;
				word32 r2_n;
				sp_n->dwFFFFFFF4 = r2_n + 1515;
				ptr32 r3_n;
				(*((word32) r3_n + 2))();
				struct Eq_n * sp_n;
				word32 r0_n;
				sp_n->dwFFFFFFFC = r0_n;
				struct Eq_n * r2_n;
				sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
				sp_n->ptrFFFFFFF4 = r2_n;
				ptr32 ap_n = r2_n->ptrC839;
				(*((word32) ap_n + 2))();
			}
		}
	}
}

// 00012D86: void fn00012D86(Register (ptr32 Eq_n) r0, Register word32 r1, Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp)
void fn00012D86(struct Eq_n * r0, word32 r1, struct Eq_n * ap, struct Eq_n * fp)
{
	word32 fp_n;
	word32 ap_n;
	word32 r4_n;
	word32 r3_n;
	word32 r2_n;
	struct Eq_n * fp_n;
	word32 fp_n;
	word32 ap_n;
	word32 r4_n;
	word32 r3_n;
	word32 r2_n;
	struct Eq_n * sp_n = fp - 0x14;
	struct Eq_n * r3_n = (struct Eq_n *) 4294947792;
	if (*(int32 *) ~0x4BCB > 0x00)
	{
		(*((word32) g_ptr192B4 + 2))();
		if (r0 != null)
		{
			int32 r2_n = 0x00;
			if (r3_n[25] > 0x00)
			{
				do
				{
					r0->a0000[r2_n].u1 = 0x00;
					++r2_n;
				} while (r2_n < r3_n[25]);
			}
		}
	}
	if (r3_n[26] > 0x00)
	{
		sp_n->dwFFFFFFFC = r3_n[26] << 2;
		(*((word32) g_ptr192B4 + 2))();
		if (r0 != null)
		{
			int32 r2_n = 0x00;
			if (r3_n[26] > 0x00)
			{
				do
				{
					r0->a0000[r2_n].u1 = 0x00;
					++r2_n;
				} while (r2_n < r3_n[26]);
			}
		}
	}
	r3_n[0x0A] = (struct Eq_n) 0x00;
	r3_n->ptr05E7 = (struct Eq_n *) ((char *) &r3_n->ptr0094 + 19);
	struct Eq_n * r2_n = r3_n->ptr05E7;
	r2_n->t0014.u1 = (byte) (r2_n->t0014.u1 & ~0x08);
	uip32 r4_n;
	word32 r4;
	if (r3_n->dwC67E == 0x04)
		r4_n = SEQ(SLICE(r4, word24, 8), 0x04);
	else
		r4_n = SEQ(SLICE(r4, word24, 8), 0x00);
	fp->ptrFFFFFFF8 = (int32) (int8) r4_n;
	if ((uint32) r3_n[0x000031A2] > 0x00)
	{
		word32 r9_n;
		do
		{
			struct Eq_n * sp_n = sp_n - 0x04;
			sp_n->dw0000 = 0x04;
			sp_n->ptrFFFFFFFC = r3_n + 38;
			word32 r0_n = fn0000D5BE(r0, ap, fp, out r2_n, out r3_n, out r4_n, out ap_n, out fp_n);
			struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
			if (r0_n == 0x00)
				return;
			sp_n->dwFFFFFFFC = 0x04;
			sp_n->dwFFFFFFF8 = r3_n + 50740;
			sp_n->dwFFFFFFF4 = r3_n + 0x0098;
			(*((word32) g_ptr192D8 + 2))();
			struct Eq_n * r0_n;
			if (r0_n != null)
			{
				struct Eq_n * sp_n;
				sp_n->dwFFFFFFFC = 0x0401;
				word32 r9_n;
				sp_n->dwFFFFFFF8 = r9_n;
				sp_n->ptrFFFFFFF4 = (<unknown>*) ~0x4EA3;
				word32 r3_n;
				sp_n->dwFFFFFFF0 = r3_n + 1515;
				(*((word32) g_ptr192D0 + 2))();
				struct Eq_n * sp_n;
				word32 r0_n;
				sp_n->dwFFFFFFFC = r0_n;
				struct Eq_n * r3_n;
				sp_n->dwFFFFFFF8 = (char *) r3_n + 1515;
				sp_n->ptrFFFFFFF4 = r3_n;
				ptr32 r2_n = r3_n->ptrC839;
				(*((word32) r2_n + 2))();
				word32 ap_n = fp_n->dw0008;
				return;
			}
			struct Eq_n * ap_n;
			struct Eq_n * fp_n;
			word32 r2_n;
			struct Eq_n * r3_n;
			word32 fp_n;
			if (fn00011C0A(r0_n, r1, ap_n, fp_n, out r2_n, out r3_n, out fp_n) != 0x00)
				return;
			fn00000076((uint32) r3_n->wC670, 0x02);
			if (r0 != null && r0 > (struct Eq_n *) 0x01)
				return;
			word32 r5_n;
			if (r3_n[27] == 0x00)
			{
				ap = r3_n[36] - 0x04;
				r5_n = 0x00;
				word32 * r2_n = &ap->ptr0004;
				if (ap->ptr0004 != null)
				{
					struct Eq_n * r2_n;
					do
					{
						fn0000001A(&r3_n->dwC6E9 + 6, *r2_n, r3_n[4]);
						if (r0 != null)
						{
							r5_n = 0x01;
							word32 r6_n[];
							if (r6_n != null)
							{
								Eq_n ap_n = r2_n - r3_n[36];
								r6_n[ap_n / 0x04] = 0x01;
								ap = ap_n / 0x04;
							}
							break;
						}
						r2_n = &r2_n->dw0004;
					} while (r2_n->dw0004 != 0x00);
				}
				if (r5_n != 0x00)
				{
					struct Eq_n * r2_n = r3_n[37] - 0x04;
					word32 * r2_n = &r2_n->dw0004;
					if (r2_n->dw0004 != 0x00)
					{
						struct Eq_n * r2_n;
						do
						{
							fn0000001A(&r3_n->dwC6E9 + 6, *r2_n, r3_n[4]);
							if (r0 != null)
							{
								r5_n = 0x00;
								word32 r7_n[];
								if (r7_n != null)
								{
									Eq_n ap_n = r2_n - r3_n[37];
									r7_n[ap_n / 0x04] = 0x01;
									ap = ap_n / 0x04;
								}
								break;
							}
							r2_n = &r2_n->dw0004;
						} while (r2_n->dw0004 != 0x00);
					}
				}
			}
			if (r3_n[27] != 0x00 || r5_n != 0x00)
			{
				int32 r0_n = (int32) r3_n[9];
				if (r0_n <= 0x0A)
				{
					g_a12F53[r0_n - 0x01]();
					return;
				}
			}
			if (r3_n->wC672 != 0x00)
			{
				fn00000076((uint32) r3_n->wC672, 0x00);
				if (r0 != null && r0 > (struct Eq_n *) 0x01)
					return;
			}
			if (r3_n[12701] != 0x00)
			{
				fn00000076((uint32) r3_n[12701], 0x00);
				if (r0 != null && r0 > (struct Eq_n *) 0x01)
					return;
			}
		} while (r9_n + 0x01 < (uint32) r3_n[0x000031A2]);
	}
	struct Eq_n * sp_n = sp_n - 0x04;
	sp_n->dw0000 = 0x04;
	sp_n->ptrFFFFFFFC = r3_n + 38;
	word32 r0_n = fn0000D5BE(r0, ap, fp, out r2_n, out r3_n, out r4_n, out ap_n, out fp_n);
	struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
	if (r0_n == 0x00)
		return;
	sp_n->dwFFFFFFFC = 0x04;
	sp_n->dwFFFFFFF8 = r3_n + 50745;
	sp_n->dwFFFFFFF4 = r3_n + 0x0098;
	(*((word32) g_ptr192D8 + 2))();
	word32 r0_n;
	struct Eq_n * sp_n;
	struct Eq_n * r3_n;
	if (r0_n != 0x00)
	{
		sp_n->ptrFFFFFFFC = (word32 (*)[]) 0x0401;
		sp_n->ptrFFFFFFF8 = (<unknown>*) 4294947624;
		sp_n->ptrFFFFFFF4 = (char *) &r3_n->ptr0094 + 0x0557;
		(*((word32) g_ptr192D0 + 2))();
		struct Eq_n * sp_n;
		word32 r0_n;
		sp_n->dwFFFFFFFC = r0_n;
		struct Eq_n * r3_n;
		sp_n->dwFFFFFFF8 = (char *) r3_n + 1515;
		sp_n->ptrFFFFFFF4 = r3_n;
		ptr32 r2_n = r3_n->ptrC839;
		(*((word32) r2_n + 2))();
		int32 r10_n = 0x01;
	}
	if (r3_n->dw0044 == 0x00)
	{
		word32 r6_n[];
		if (r6_n != null)
		{
			int32 ap_n = 0x00;
			if (r3_n->dw0064 > 0x00)
			{
				do
				{
					if (r6_n[ap_n] == 0x00)
					{
						struct Eq_n * sp_n = sp_n - 0x04;
						sp_n->dw0000 = 0x0401;
						word32 r2_n[] = r3_n->ptr0090;
						sp_n->dwFFFFFFFC = r2_n[ap_n];
						sp_n->ptrFFFFFFF8 = (<unknown>*) 4294947748;
						sp_n->ptrFFFFFFF4 = (char *) &r3_n->ptr0094 + 0x0557;
						(*((word32) g_ptr192D0 + 2))();
						struct Eq_n * sp_n;
						word32 r0_n;
						sp_n->dwFFFFFFFC = r0_n;
						struct Eq_n * r3_n;
						sp_n->dwFFFFFFF8 = (char *) r3_n + 1515;
						sp_n->ptrFFFFFFF4 = r3_n;
						ptr32 r2_n = r3_n->ptrC839;
						(*((word32) r2_n + 2))();
					}
					++ap_n;
				} while (ap_n < r3_n->dw0064);
			}
			sp_n->ptrFFFFFFFC = r6_n;
			(*((word32) g_ptr192B0 + 2))();
		}
		word32 r7_n[];
		if (r7_n != null)
		{
			int32 ap_n = 0x00;
			if (r3_n->dw0068 > 0x00)
			{
				do
				{
					if (r7_n[ap_n] == 0x00)
					{
						struct Eq_n * sp_n = sp_n - 0x04;
						sp_n->dw0000 = 0x0401;
						word32 r2_n[] = r3_n->ptr0094;
						sp_n->dwFFFFFFFC = r2_n[ap_n];
						sp_n->ptrFFFFFFF8 = (<unknown>*) 4294947700;
						sp_n->ptrFFFFFFF4 = (char *) &r3_n->ptr0094 + 0x0557;
						(*((word32) g_ptr192D0 + 2))();
						struct Eq_n * sp_n;
						word32 r0_n;
						sp_n->dwFFFFFFFC = r0_n;
						struct Eq_n * r3_n;
						sp_n->dwFFFFFFF8 = (char *) r3_n + 1515;
						sp_n->ptrFFFFFFF4 = r3_n;
						ptr32 r2_n = r3_n->ptrC839;
						(*((word32) r2_n + 2))();
					}
					++ap_n;
				} while (ap_n < r3_n->dw0068);
			}
			sp_n->ptrFFFFFFFC = r7_n;
			(*((word32) g_ptr192B0 + 2))();
		}
		(uint32) sp_n->w0002 != 0x00;
	}
	else
	{
		struct Eq_n * sp_n = sp_n - 0x04;
		sp_n->dw0000 = sp_n->dw0008;
		sp_n->dwFFFFFFFC = sp_n->dw0004;
		struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
		struct Eq_n * ap_n;
		word32 fp_n;
		fn00017662(ap_n, fp_n) >= 0x00;
		sp_n->dwFFFFFFFC = 0x00;
	}
}

Eq_n g_a12F53[] = // 00012F53
	{
	};
ui32 * g_ptr13206 = &g_dw3C301267; // 00013206
// 0001325E: void fn0001325E(Register word32 r4, Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp)
void fn0001325E(word32 r4, struct Eq_n * ap, struct Eq_n * fp)
{
	int32 r0_n;
	int32 r0_n;
	word32 r11_n;
	struct Eq_n * r5_n;
	struct Eq_n * r5_n;
	word32 fp_n;
	word32 ap_n;
	word32 r6_n;
	word32 r5_n;
	struct Eq_n * ap_n;
	word32 r11_n;
	word32 r10_n;
	word32 r9_n;
	word32 r8_n;
	word32 r7_n;
	word32 r6_n;
	struct Eq_n * sp_n;
	struct Eq_n * sp_n;
	word32 r10_n;
	word32 r9_n;
	struct Eq_n * fp_n;
	struct Eq_n * sp_n;
	word32 fp_n;
	struct Eq_n * fp_n;
	struct Eq_n * ap_n;
	struct Eq_n * fp_n;
	word32 ap_n;
	struct Eq_n * r5_n;
	ptr32 sp_n = fp + -0x00EC;
	ptr32 r8_n = (<unknown>*) ~0x000197A7;
	struct Eq_n * r5_n = (struct Eq_n *) 4294947792;
	word32 r2_n = *ap->ptr0004;
	if (g_dw7A4E != r2_n && r2_n != 0x00)
	{
		(*((word32) g_ptr192D0 + 2))();
		struct Eq_n * sp_n;
		word32 r0_n;
		sp_n->dwFFFFFFFC = r0_n;
		struct Eq_n * r5_n;
		sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
		sp_n->ptrFFFFFFF4 = r5_n;
		ptr32 r2_n = r5_n->ptrC839;
		(*((word32) r2_n + 2))();
	}
	word32 r3_n = r5_n->dwC67E + 0x1E + (uint32) r5_n[12700] + (uint32) r5_n->wC672 + (uint32) r5_n[12701];
	*ap->ptr0004 = r5_n[0x0000319A].ptr0000 + r3_n;
	struct Eq_n * sp_n = sp_n - 0x04;
	sp_n->dw0000 = 0x03;
	sp_n->dwFFFFFFFC = (uint32) r5_n->wC672;
	word32 r0_n = fn0000DC76(ap, fp, out r5_n, out ap_n, out fp_n);
	struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
	sp_n[1] = (struct Eq_n) r0_n;
	if (r0_n != 0x00)
	{
		if (r5_n->dwC627 != 0x00)
		{
			sp_n->dwFFFFFFFC = r5_n->dwC627;
			(*((word32) g_ptr192B0 + 2))();
			r5_n->dwC627 = 0x00;
		}
		sp_n[2] = sp_n[1];
	}
	sp_n->w0002 = r5_n->ptr05E7->w000C;
	fp_n->wFFFFFFFA = (uint16) r5_n->bC658;
	uip32 r4_n;
	if ((uint32) r5_n->bC65B < 0x12)
		r4_n = SEQ(SLICE(r4, word24, 8), r5_n->bC65B);
	else
		r4_n = SEQ(SLICE(r4, word24, 8), 0x12);
	uipr32 r3_n;
	if ((uint32) r5_n->wC65E < 11)
		r3_n = SEQ(SLICE(r3_n, word16, 16), r5_n->wC65E);
	else
		r3_n = SEQ(SLICE(r3_n, word16, 16), 11);
	sp_n[4] = (struct Eq_n) (word16) r3_n;
	struct Eq_n * sp_n = sp_n - 0x04;
	sp_n->dw0000 = 0x00;
	sp_n->dwFFFFFFFC = 0x02;
	sp_n->ptrFFFFFFF8 = r8_n + 42;
	sp_n->ptrFFFFFFF4 = r5_n;
	ptr32 r2_n = r5_n->ptrC839;
	(*((word32) r2_n + 2))();
	word32 ap_n = fn00017772(ap_n, fp_n, out fp_n);
	struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
	sp_n->dwFFFFFFFC = 0x00;
	struct Eq_n * r5_n;
	sp_n->dwFFFFFFF8 = r5_n->dwC67E;
	sp_n->dwFFFFFFF4 = r5_n->dwC67E;
	word32 r6_n;
	sp_n->ptrFFFFFFF0 = r6_n + 1810;
	sp_n->ptrFFFFFFEC = (char *) r5_n + 1515;
	(*((word32) g_ptr192D0 + 2))();
	struct Eq_n * sp_n;
	word32 r0_n;
	sp_n->dwFFFFFFFC = r0_n;
	struct Eq_n * r5_n;
	sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
	sp_n->ptrFFFFFFF4 = r5_n;
	ptr32 r2_n = r5_n->ptrC839;
	(*((word32) r2_n + 2))();
	uint32 r3_n = (uint32) sp_n->w0002;
	struct Eq_n * r5_n;
	struct Eq_n * r6_n;
	word32 r4_n;
	if (r3_n >= 0x12)
	{
		sp_n->dwFFFFFFFC = (uint32) r5_n->bC659;
		sp_n->ptrFFFFFFF8 = (char *) r6_n + 1797;
		word32 fp_n;
		sp_n->dwFFFFFFF4 = fp_n + -58;
		(*((word32) g_ptr192D0 + 2))();
		r4_n = fp_n + -58;
	}
	else
		r4_n = r6_n->a1444[r3_n];
	struct Eq_n * sp_n = sp_n - 0x04;
	sp_n->dw0000 = 0x00;
	sp_n->dwFFFFFFFC = r4_n;
	sp_n->ptrFFFFFFF8 = (char *) r6_n + 1883;
	sp_n->ptrFFFFFFF4 = (char *) r5_n + 1515;
	ptr32 r7_n = g_ptr192D0;
	(*((word32) r7_n + 2))();
	struct Eq_n * sp_n;
	word32 r0_n;
	sp_n->dwFFFFFFFC = r0_n;
	struct Eq_n * r5_n;
	sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
	sp_n->ptrFFFFFFF4 = r5_n;
	ptr32 r2_n = r5_n->ptrC839;
	(*((word32) r2_n + 2))();
	struct Eq_n * sp_n;
	sp_n->dwFFFFFFFC = 0x00;
	word32 r1_n = 0x00;
	uint32 r0_n = (uint32) fp_n->wFFFFFFFA;
	if (true)
	{
		if (false)
		{
l00013435:
			sp_n->dwFFFFFFF8 = (uint32) (word16) r1_n;
			uint32 r2_n = (uint32) fp_n->wFFFFFFFA;
			word32 r1_n = 0x00;
			if (true)
				;
			if (r2_n >= 0x0A)
				r1_n = 0x01;
			sp_n->dwFFFFFFF4 = r1_n;
			word32 r6_n;
			sp_n->dwFFFFFFF0 = r6_n + 1939;
			word32 r5_n;
			sp_n->dwFFFFFFEC = r5_n + 1515;
			ptr32 r7_n;
			(*((word32) r7_n + 2))();
			struct Eq_n * sp_n;
			word32 r0_n;
			sp_n->dwFFFFFFFC = r0_n;
			struct Eq_n * r5_n;
			sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
			sp_n->ptrFFFFFFF4 = r5_n;
			ptr32 r2_n = r5_n->ptrC839;
			(*((word32) r2_n + 2))();
			uint32 r3_n = (uint32) (word16) r9_n;
			struct Eq_n * sp_n;
			struct Eq_n * r5_n;
			struct Eq_n * r6_n;
			word32 r4_n;
			if (r3_n >= 0x12)
			{
				sp_n->dwFFFFFFFC = (uint32) r5_n->bC65B;
				sp_n->ptrFFFFFFF8 = (char *) r6_n + 1797;
				word32 fp_n;
				sp_n->dwFFFFFFF4 = fp_n + -58;
				ptr32 r7_n;
				(*((word32) r7_n + 2))();
				r4_n = fp_n + -58;
			}
			else
				r4_n = r6_n->a1444[r3_n];
			struct Eq_n * sp_n = sp_n - 0x04;
			sp_n->dw0000 = 0x00;
			sp_n->dwFFFFFFFC = r4_n;
			sp_n->ptrFFFFFFF8 = (char *) r6_n + 1998;
			sp_n->ptrFFFFFFF4 = (char *) r5_n + 1515;
			ptr32 r7_n = g_ptr192D0;
			(*((word32) r7_n + 2))();
			struct Eq_n * sp_n;
			word32 r0_n;
			sp_n->dwFFFFFFFC = r0_n;
			struct Eq_n * r5_n;
			sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
			sp_n->ptrFFFFFFF4 = r5_n;
			ptr32 r2_n = r5_n->ptrC839;
			(*((word32) r2_n + 2))();
			struct Eq_n * sp_n;
			sp_n->dwFFFFFFFC = 0x00;
			word32 r1_n = 0x00;
			uint32 r0_n = (uint32) (word16) r10_n;
			if (true)
			{
				if (false)
				{
l000134E9:
					sp_n->dwFFFFFFF8 = (uint32) (word16) r1_n;
					uint32 r2_n = (uint32) (word16) r10_n;
					word32 r1_n = 0x00;
					if (true)
						;
					if (r2_n >= 0x0A)
						r1_n = 0x01;
					sp_n->dwFFFFFFF4 = r1_n;
					word32 r6_n;
					sp_n->dwFFFFFFF0 = r6_n + 0x0806;
					word32 r5_n;
					sp_n->dwFFFFFFEC = r5_n + 1515;
					ptr32 r7_n;
					(*((word32) r7_n + 2))();
					struct Eq_n * sp_n;
					word32 r0_n;
					sp_n->dwFFFFFFFC = r0_n;
					struct Eq_n * r5_n;
					sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
					sp_n->ptrFFFFFFF4 = r5_n;
					ptr32 r2_n = r5_n->ptrC839;
					(*((word32) r2_n + 2))();
					uint32 r3_n = (uint32) sp_n->w0010;
					struct Eq_n * r5_n;
					struct Eq_n * r6_n;
					word32 r4_n;
					if (r3_n >= 11)
					{
						sp_n->dwFFFFFFFC = (uint32) r5_n->wC65E;
						sp_n->ptrFFFFFFF8 = (char *) r6_n + 1797;
						word32 fp_n;
						sp_n->dwFFFFFFF4 = fp_n + -58;
						ptr32 r7_n;
						(*((word32) r7_n + 2))();
						r4_n = fp_n + -58;
					}
					else
						r4_n = r6_n->a148C[r3_n];
					struct Eq_n * sp_n = sp_n - 0x04;
					sp_n->dw0000 = 0x00;
					sp_n->dwFFFFFFFC = r4_n;
					sp_n->ptrFFFFFFF8 = (char *) r6_n + 2113;
					sp_n->ptrFFFFFFF4 = (char *) r5_n + 1515;
					ptr32 r7_n = g_ptr192D0;
					(*((word32) r7_n + 2))();
					struct Eq_n * sp_n;
					word32 r0_n;
					sp_n->dwFFFFFFFC = r0_n;
					struct Eq_n * r5_n;
					sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
					sp_n->ptrFFFFFFF4 = r5_n;
					ptr32 r2_n = r5_n->ptrC839;
					(*((word32) r2_n + 2))();
					uint32 r4_n = (uint32) sp_n->w0010;
					struct Eq_n * r5_n;
					struct Eq_n * r6_n;
					ptr32 r7_n;
					if (r4_n == 0x06)
					{
						sp_n->dwFFFFFFFC = 0x00;
						uip32 r3_n;
						word32 r3_n;
						if (((uint32) r5_n->wC65C & 0x02) != 0x00)
							r3_n = SEQ(SLICE(r3_n, word24, 8), 0x38);
						else
							r3_n = SEQ(SLICE(r3_n, word24, 8), 0x34);
						sp_n->dwFFFFFFF8 = (int32) (int8) r3_n;
						sp_n->ptrFFFFFFF4 = (char *) r6_n + 0x0879;
						sp_n->ptrFFFFFFF0 = (char *) r5_n + 1515;
						(*((word32) r7_n + 2))();
						struct Eq_n * sp_n;
						word32 r0_n;
						sp_n->dwFFFFFFFC = r0_n;
						struct Eq_n * r5_n;
						sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
						sp_n->ptrFFFFFFF4 = r5_n;
						ptr32 r2_n = r5_n->ptrC839;
						(*((word32) r2_n + 2))();
						struct Eq_n * sp_n;
						sp_n->dwFFFFFFFC = 0x00;
						struct Eq_n * r5_n;
						uip32 r3_n;
						word32 r3_n;
						if (((uint32) r5_n->wC65C & 0x04) != 0x00)
							r3_n = SEQ(SLICE(r3_n, word24, 8), 0x33);
						else
							r3_n = SEQ(SLICE(r3_n, word24, 8), 0x32);
						sp_n->dwFFFFFFF8 = (int32) (int8) r3_n;
						word32 r6_n;
						sp_n->dwFFFFFFF4 = r6_n + 2226;
						sp_n->ptrFFFFFFF0 = (char *) r5_n + 1515;
						ptr32 r7_n;
						(*((word32) r7_n + 2))();
						struct Eq_n * sp_n;
						word32 r0_n;
						sp_n->dwFFFFFFFC = r0_n;
						struct Eq_n * r5_n;
						sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
						sp_n->ptrFFFFFFF4 = r5_n;
						ptr32 r2_n = r5_n->ptrC839;
						(*((word32) r2_n + 2))();
					}
					else if (r4_n == 0x08)
					{
						struct Eq_n * fp_n;
						fp_n->wFFFFFFF8 = (int16) ((uint32) r5_n->wC65C >> 1 & 0x03);
						sp_n->dwFFFFFFFC = 0x00;
						uint32 r2_n = (uint32) fp_n->wFFFFFFF8;
						sp_n->dwFFFFFFF8 = r6_n->a14B8[r2_n];
						sp_n->ptrFFFFFFF4 = (char *) r6_n + 2282;
						sp_n->ptrFFFFFFF0 = (char *) r5_n + 1515;
						(*((word32) r7_n + 2))();
						struct Eq_n * sp_n;
						word32 r0_n;
						sp_n->dwFFFFFFFC = r0_n;
						struct Eq_n * r5_n;
						sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
						sp_n->ptrFFFFFFF4 = r5_n;
						ptr32 r2_n = r5_n->ptrC839;
						(*((word32) r2_n + 2))();
					}
					struct Eq_n * sp_n = sp_n - 0x04;
					sp_n->dw0000 = 0x00;
					struct Eq_n * r3_n;
					if (((uint32) r5_n->wC65C & 0x01) != 0x00)
						r3_n = r6_n;
					else
					{
						word32 r8_n;
						r3_n = r8_n + 45;
					}
					sp_n->ptrFFFFFFFC = r3_n;
					sp_n->ptrFFFFFFF8 = (char *) r6_n + 0x0922;
					sp_n->ptrFFFFFFF4 = (char *) r5_n + 1515;
					ptr32 r4_n = g_ptr192D0;
					(*((word32) r4_n + 2))();
					struct Eq_n * sp_n;
					word32 r0_n;
					sp_n->dwFFFFFFFC = r0_n;
					struct Eq_n * r5_n;
					sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
					sp_n->ptrFFFFFFF4 = r5_n;
					ptr32 r2_n = r5_n->ptrC839;
					(*((word32) r2_n + 2))();
					struct Eq_n * sp_n;
					sp_n->dwFFFFFFFC = 0x00;
					struct Eq_n * r5_n;
					word32 r3_n;
					word32 r8_n;
					if (((uint32) r5_n->wC65C & 0x08) != 0x00)
						r3_n = r8_n + 53;
					else
						r3_n = r8_n + 50;
					sp_n->dwFFFFFFF8 = r3_n;
					word32 r6_n;
					sp_n->dwFFFFFFF4 = r6_n + 0x0963;
					sp_n->ptrFFFFFFF0 = (char *) r5_n + 1515;
					ptr32 r4_n;
					(*((word32) r4_n + 2))();
					struct Eq_n * sp_n;
					word32 r0_n;
					sp_n->dwFFFFFFFC = r0_n;
					struct Eq_n * r5_n;
					sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
					sp_n->ptrFFFFFFF4 = r5_n;
					ptr32 r2_n = r5_n->ptrC839;
					(*((word32) r2_n + 2))();
					struct Eq_n * sp_n;
					word32 fp_n;
					sp_n->dwFFFFFFFC = fp_n + -42;
					sp_n->dwFFFFFFF8 = 0x00;
					word32 r5_n;
					sp_n->dwFFFFFFF4 = r5_n + 0xC660;
					sp_n->dwFFFFFFF0 = r5_n + 0xC662;
					ptr32 r4_n = fn00015106(r6_n, r7_n, r8_n, r9_n, r10_n, r11_n, ap_n, fp_n, out r5_n, out r6_n, out ap_n, out fp_n);
					struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
					sp_n->dwFFFFFFFC = 0x00;
					sp_n->dwFFFFFFF8 = fp_n + -42;
					sp_n->dwFFFFFFF4 = r6_n + 0x099B;
					sp_n->ptrFFFFFFF0 = r5_n + 1515;
					(*((word32) r4_n + 2))();
					struct Eq_n * sp_n;
					word32 r0_n;
					sp_n->dwFFFFFFFC = r0_n;
					struct Eq_n * r5_n;
					sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
					sp_n->ptrFFFFFFF4 = r5_n;
					ptr32 r2_n = r5_n->ptrC839;
					(*((word32) r2_n + 2))();
					struct Eq_n * sp_n;
					sp_n->dwFFFFFFFC = 0x00;
					struct Eq_n * r5_n;
					sp_n->dwFFFFFFF8 = r5_n->dwC664;
					word32 r6_n;
					sp_n->dwFFFFFFF4 = r6_n + 2515;
					sp_n->ptrFFFFFFF0 = (char *) r5_n + 1515;
					ptr32 r4_n;
					(*((word32) r4_n + 2))();
					struct Eq_n * sp_n;
					word32 r0_n;
					sp_n->dwFFFFFFFC = r0_n;
					struct Eq_n * r5_n;
					sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
					sp_n->ptrFFFFFFF4 = r5_n;
					ptr32 r2_n = r5_n->ptrC839;
					(*((word32) r2_n + 2))();
					struct Eq_n * sp_n;
					sp_n->dwFFFFFFFC = 0x00;
					struct Eq_n * r5_n;
					sp_n->dwFFFFFFF8 = r5_n->dwC668;
					word32 r6_n;
					sp_n->dwFFFFFFF4 = r6_n + 0x0A0E;
					sp_n->ptrFFFFFFF0 = (char *) r5_n + 1515;
					ptr32 r4_n;
					(*((word32) r4_n + 2))();
					struct Eq_n * sp_n;
					word32 r0_n;
					sp_n->dwFFFFFFFC = r0_n;
					struct Eq_n * r5_n;
					sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
					sp_n->ptrFFFFFFF4 = r5_n;
					ptr32 r2_n = r5_n->ptrC839;
					(*((word32) r2_n + 2))();
					struct Eq_n * sp_n;
					sp_n->dwFFFFFFFC = 0x00;
					struct Eq_n * r5_n;
					sp_n->dwFFFFFFF8 = r5_n->dwC66C;
					word32 r6_n;
					sp_n->dwFFFFFFF4 = r6_n + 0x0A4D;
					sp_n->ptrFFFFFFF0 = (char *) r5_n + 1515;
					ptr32 r4_n;
					(*((word32) r4_n + 2))();
					struct Eq_n * sp_n;
					word32 r0_n;
					sp_n->dwFFFFFFFC = r0_n;
					struct Eq_n * r5_n;
					sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
					sp_n->ptrFFFFFFF4 = r5_n;
					ptr32 r2_n = r5_n->ptrC839;
					(*((word32) r2_n + 2))();
					struct Eq_n * sp_n;
					sp_n->dwFFFFFFFC = 0x00;
					struct Eq_n * r5_n;
					sp_n->dwFFFFFFF8 = (uint32) r5_n->wC670;
					word32 r6_n;
					sp_n->dwFFFFFFF4 = r6_n + 2700;
					sp_n->ptrFFFFFFF0 = (char *) r5_n + 1515;
					ptr32 r4_n;
					(*((word32) r4_n + 2))();
					struct Eq_n * sp_n;
					word32 r0_n;
					sp_n->dwFFFFFFFC = r0_n;
					struct Eq_n * r5_n;
					sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
					sp_n->ptrFFFFFFF4 = r5_n;
					ptr32 r2_n = r5_n->ptrC839;
					(*((word32) r2_n + 2))();
					struct Eq_n * sp_n;
					sp_n->dwFFFFFFFC = 0x00;
					struct Eq_n * r5_n;
					sp_n->dwFFFFFFF8 = (uint32) r5_n->wC672;
					word32 r6_n;
					sp_n->dwFFFFFFF4 = r6_n + 2767;
					sp_n->ptrFFFFFFF0 = (char *) r5_n + 1515;
					ptr32 r4_n;
					(*((word32) r4_n + 2))();
					struct Eq_n * sp_n;
					word32 r0_n;
					sp_n->dwFFFFFFFC = r0_n;
					struct Eq_n * r5_n;
					sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
					sp_n->ptrFFFFFFF4 = r5_n;
					ptr32 r2_n = r5_n->ptrC839;
					(*((word32) r2_n + 2))();
					struct Eq_n * sp_n;
					sp_n->dwFFFFFFFC = 0x00;
					struct Eq_n * r5_n;
					sp_n->dwFFFFFFF8 = (uint32) r5_n->wC674;
					word32 r6_n;
					sp_n->dwFFFFFFF4 = r6_n + 2829;
					sp_n->ptrFFFFFFF0 = (char *) r5_n + 1515;
					ptr32 r4_n;
					(*((word32) r4_n + 2))();
					struct Eq_n * sp_n;
					word32 r0_n;
					sp_n->dwFFFFFFFC = r0_n;
					struct Eq_n * r5_n;
					sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
					sp_n->ptrFFFFFFF4 = r5_n;
					ptr32 r2_n = r5_n->ptrC839;
					(*((word32) r2_n + 2))();
					struct Eq_n * sp_n;
					sp_n->dwFFFFFFFC = 0x00;
					uint32 r2_n = (uint32) r5_n->wC676;
					sp_n->dwFFFFFFF8 = r2_n + 0x01;
					word32 r6_n;
					sp_n->dwFFFFFFF4 = r6_n + 0x0B50;
					sp_n->ptrFFFFFFF0 = (char *) r5_n + 1515;
					ptr32 r4_n;
					(*((word32) r4_n + 2))();
					struct Eq_n * sp_n;
					word32 r0_n;
					sp_n->dwFFFFFFFC = r0_n;
					struct Eq_n * r5_n;
					sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
					sp_n->ptrFFFFFFF4 = r5_n;
					ptr32 r2_n = r5_n->ptrC839;
					(*((word32) r2_n + 2))();
					struct Eq_n * sp_n;
					sp_n->dwFFFFFFFC = 0x00;
					uint32 r3_n = (uint32) r5_n->wC678;
					word32 r4_n;
					word32 r8_n;
					if ((r3_n & 0x01) != 0x00)
						r4_n = r8_n + 71;
					else
					{
						word32 r3_n;
						if ((r3_n & 0x02) != 0x00)
							r3_n = r8_n + 64;
						else
							r3_n = r8_n + 57;
						r4_n = r3_n;
					}
					sp_n->dwFFFFFFF8 = r4_n;
					word32 r6_n;
					sp_n->dwFFFFFFF4 = r6_n + 0x0B8D;
					sp_n->ptrFFFFFFF0 = (char *) r5_n + 1515;
					(*((word32) g_ptr192D0 + 2))();
					struct Eq_n * sp_n;
					word32 r0_n;
					sp_n->dwFFFFFFFC = r0_n;
					struct Eq_n * r5_n;
					sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
					sp_n->ptrFFFFFFF4 = r5_n;
					ptr32 r2_n = r5_n->ptrC839;
					(*((word32) r2_n + 2))();
					struct Eq_n * sp_n;
					struct Eq_n * r5_n;
					sp_n->w000E = r5_n->wC67C;
					uint32 r9_n = (uint32) sp_n->w0002;
					struct Eq_n * fp_n;
					word32 r6_n;
					if (r9_n == 0x02)
					{
						byte * r4_n = &fp_n->bFFFFFFD7;
						int32 r0_n;
						byte * r2_n = (byte *) fp_n->aFFFFFFEC;
						for (r0_n = 0x00; r0_n <= 11; ++r0_n)
						{
							*r2_n = 0x00;
							++r2_n;
						}
						uint32 r7_n = (uint32) sp_n->w000E;
						if ((r7_n & 0x0100) != 0x00)
							fp_n->aFFFFFFEC[0] = 0x52;
						if ((r7_n & 0x80) != 0x00)
						{
							fp_n->bFFFFFFED = 0x57;
							fp_n->bFFFFFFEF = 0x44;
						}
						if ((r7_n & 0x40) != 0x00)
							fp_n->bFFFFFFEE = 0x45;
						if ((r7_n & 0x20) != 0x00)
							fp_n->bFFFFFFF0 = 0x52;
						if ((r7_n & 0x10) != 0x00)
						{
							fp_n->bFFFFFFF1 = 0x57;
							fp_n->bFFFFFFF3 = 0x44;
						}
						if ((r7_n & 0x08) != 0x00)
							fp_n->bFFFFFFF2 = 0x45;
						if ((r7_n & 0x04) != 0x00)
							fp_n->bFFFFFFF4 = 0x52;
						if ((r7_n & 0x02) != 0x00)
						{
							fp_n->bFFFFFFF5 = 0x57;
							fp_n->bFFFFFFF7 = 0x44;
						}
						if ((r7_n & 0x01) != 0x00)
							fp_n->bFFFFFFF6 = 0x45;
						fp_n->bFFFFFFD6 = 0x28;
						byte * r3_n = &fp_n->bFFFFFFD7;
						int32 r7_n = 0x00;
						int32 r2_n = 0x00;
						if (true)
						{
							do
							{
								int32 r1_n;
								for (r1_n = 0x00; r1_n < 0x04; ++r1_n)
								{
									if (fp_n->aFFFFFFEC[r2_n] != 0x00)
									{
										*r3_n = fp_n->aFFFFFFEC[r2_n];
										++r3_n;
									}
									++r2_n;
								}
								*r3_n = 44;
								++r3_n;
								if (r7_n == 0x00)
								{
									*r3_n = *r4_n;
									++r3_n;
									++r4_n;
									if (*r3_n != 44)
									{
										byte * r3_n;
										do
										{
											*r3_n = *r4_n;
											r3_n = r3_n + 1;
											++r4_n;
											r3_n = r3_n;
										} while (*r3_n != 44);
									}
								}
								++r7_n;
							} while (r7_n < 0x03);
						}
						*r3_n = 0x00;
						byte * r3_n = r3_n - 0x01;
						*r3_n = 0x29;
						sp_n->dwFFFFFFFC = 0x00;
						sp_n->ptrFFFFFFF8 = &fp_n->bFFFFFFD6;
						sp_n->dwFFFFFFF4 = (uint32) sp_n->w000A;
						sp_n->dwFFFFFFF0 = r6_n + 3013;
						sp_n->ptrFFFFFFEC = (char *) r5_n + 1515;
						(*((word32) g_ptr192D0 + 2))();
						struct Eq_n * sp_n;
						word32 r0_n;
						sp_n->dwFFFFFFFC = r0_n;
						struct Eq_n * r5_n;
						sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
						sp_n->ptrFFFFFFF4 = r5_n;
						ptr32 r2_n = r5_n->ptrC839;
						(*((word32) r2_n + 2))();
l00013C9E:
						struct Eq_n * sp_n;
						struct Eq_n * r5_n;
						sp_n->w000E = r5_n->wC67A & 0xFF;
						uint32 r3_n = (uint32) sp_n->w000E;
						word32 r6_n;
						if (r3_n == 0x00)
						{
							struct Eq_n * sp_n = sp_n - 0x04;
							sp_n->dw0000 = 0x00;
							sp_n->dwFFFFFFFC = r3_n;
							sp_n->dwFFFFFFF8 = r6_n + 3238;
							sp_n->ptrFFFFFFF4 = (char *) r5_n + 1515;
							(*((word32) g_ptr192D0 + 2))();
							struct Eq_n * sp_n;
							word32 r0_n;
							sp_n->dwFFFFFFFC = r0_n;
							struct Eq_n * r5_n;
							sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
							sp_n->ptrFFFFFFF4 = r5_n;
							ptr32 r2_n = r5_n->ptrC839;
							(*((word32) r2_n + 2))();
						}
						else if (r3_n == 0x01)
						{
							struct Eq_n * sp_n = sp_n - 0x04;
							sp_n->dw0000 = 0x00;
							sp_n->dwFFFFFFFC = r3_n;
							sp_n->dwFFFFFFF8 = r6_n + 0x0CE2;
							sp_n->ptrFFFFFFF4 = (char *) r5_n + 1515;
							(*((word32) g_ptr192D0 + 2))();
							struct Eq_n * sp_n;
							word32 r0_n;
							sp_n->dwFFFFFFFC = r0_n;
							struct Eq_n * r5_n;
							sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
							sp_n->ptrFFFFFFF4 = r5_n;
							ptr32 r2_n = r5_n->ptrC839;
							(*((word32) r2_n + 2))();
						}
						else
						{
							struct Eq_n * sp_n = sp_n - 0x04;
							sp_n->dw0000 = 0x00;
							word32 r10_n;
							word32 r8_n;
							if ((r3_n & 0x20) != 0x00)
								r10_n = r8_n + 101;
							else
								r10_n = r6_n;
							sp_n->dwFFFFFFFC = r10_n;
							word32 r9_n;
							if ((r3_n & 0x10) != 0x00)
								r9_n = r8_n + 96;
							else
								r9_n = r6_n;
							sp_n->dwFFFFFFF8 = r9_n;
							word32 r7_n;
							if ((r3_n & 0x08) != 0x00)
								r7_n = r8_n + 91;
							else
								r7_n = r6_n;
							sp_n->dwFFFFFFF4 = r7_n;
							word32 r4_n;
							if ((r3_n & 0x04) != 0x00)
								r4_n = r8_n + 86;
							else
								r4_n = r6_n;
							sp_n->dwFFFFFFF0 = r4_n;
							struct Eq_n * fp_n;
							if ((r3_n & 0x02) != 0x00)
								fp_n->dwFFFFFFC2 = r8_n + 81;
							else
								fp_n->dwFFFFFFC2 = r6_n;
							sp_n->dwFFFFFFEC = fp_n->dwFFFFFFC2;
							if ((r3_n & 0x01) != 0x00)
								fp_n->dwFFFFFFBE = r8_n + 76;
							else
								fp_n->dwFFFFFFBE = r6_n;
							sp_n->dwFFFFFFE8 = fp_n->dwFFFFFFBE;
							sp_n->dwFFFFFFE4 = r3_n;
							sp_n->dwFFFFFFE0 = r6_n + 3363;
							sp_n->ptrFFFFFFDC = (char *) r5_n + 1515;
							(*((word32) g_ptr192D0 + 2))();
							struct Eq_n * sp_n;
							word32 r0_n;
							sp_n->dwFFFFFFFC = r0_n;
							struct Eq_n * r5_n;
							sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
							sp_n->ptrFFFFFFF4 = r5_n;
							ptr32 r2_n = r5_n->ptrC839;
							(*((word32) r2_n + 2))();
						}
						struct Eq_n * r5_n;
						if ((uint32) r5_n->wC672 != 0x00)
						{
							struct Eq_n * sp_n;
							sp_n->w002A = r5_n->wC672;
							if (sp_n->dw0008 > 0x01)
								return;
							if (r5_n->dwC627 == 0x00)
								return;
							struct Eq_n * sp_n = sp_n - 0x04;
							sp_n->dw0000 = 0x00;
							word32 r6_n;
							sp_n->dwFFFFFFFC = r6_n + 0x0DE8;
							sp_n->ptrFFFFFFF8 = (char *) r5_n + 1515;
							(*((word32) g_ptr192D0 + 2))();
							struct Eq_n * sp_n;
							word32 r0_n;
							sp_n->dwFFFFFFFC = r0_n;
							struct Eq_n * r5_n;
							sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
							sp_n->ptrFFFFFFF4 = r5_n;
							ptr32 r2_n = r5_n->ptrC839;
							(*((word32) r2_n + 2))();
							struct Eq_n * sp_n;
							if ((uint32) sp_n->w002A >= 0x04)
							{
								sp_n[8] = (struct Eq_n) &g_tE258;
								sp_n[7] = (struct Eq_n) &g_tE274;
								sp_n[11] = (struct Eq_n) g_ptr192D8;
								sp_n[6] = (struct Eq_n) g_ptr192BC;
								sp_n[5] = (struct Eq_n) g_ptr192C4;
								Eq_n r0_n;
								do
								{
									struct Eq_n * sp_n = sp_n - 0x04;
									word32 r7_n;
									sp_n->dw0000 = r7_n;
									(*((word32) sp_n->ptr0024 + 2))();
									struct Eq_n * sp_n;
									word32 r0_n;
									sp_n->w0012 = (word16) r0_n;
									word32 r7_n;
									sp_n->dwFFFFFFFC = r7_n + 2;
									(*((word32) sp_n->ptr0020 + 2))();
									struct Eq_n * sp_n;
									word32 r0_n;
									sp_n->t0028.u0 = (int16) (word16) r0_n;
									sp_n->t002A.u0 = (int16) ((uint32) sp_n->t002A.u0 - 0x04);
									word32 r6_n;
									word32 r5_n;
									ptr32 r9_n;
									if (sp_n->t0028.u0 > (sp_n->t002A).u0)
									{
										sp_n->dwFFFFFFFC = 0x0421;
										sp_n->dwFFFFFFF8 = (uint32) sp_n->w0026;
										sp_n->dwFFFFFFF4 = (uint32) sp_n->w0024;
										sp_n->dwFFFFFFF0 = (uint32) sp_n->w000E;
										sp_n->dwFFFFFFEC = r6_n + 3431;
										sp_n->dwFFFFFFE8 = r5_n + 1515;
										(*((word32) r9_n + 2))();
										struct Eq_n * sp_n;
										word32 r0_n;
										sp_n->dwFFFFFFFC = r0_n;
										struct Eq_n * r5_n;
										sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
										sp_n->ptrFFFFFFF4 = r5_n;
										ptr32 r2_n = r5_n->ptrC839;
										(*((word32) r2_n + 2))();
										sp_n->t0028.u0 = sp_n->t002A.u0;
									}
									Eq_n r2_n;
									r2_n.u1 = (uint32) sp_n->w0012;
									if (r2_n >= 0x07)
									{
										if (r2_n <= 0x0D)
										{
											g_a13E94[r2_n - 0x07]();
											return;
										}
									}
									struct Eq_n * sp_n = sp_n - 0x04;
									sp_n->dw0000 = 0x00;
									sp_n->dwFFFFFFFC = (uint32) sp_n->w0028;
									word32 r3_n = r6_n + 0x0F40;
									sp_n->dwFFFFFFF8 = r3_n;
									uint32 r4_n = (uint32) sp_n->w0016;
									sp_n->dwFFFFFFF4 = r4_n;
									sp_n->dwFFFFFFF0 = r6_n + 0x0E17;
									sp_n->dwFFFFFFEC = r5_n + 1515;
									(*((word32) r9_n + 2))();
									struct Eq_n * sp_n;
									word32 r0_n;
									sp_n->dwFFFFFFFC = r0_n;
									struct Eq_n * r5_n;
									sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
									sp_n->ptrFFFFFFF4 = r5_n;
									ptr32 r2_n = r5_n->ptrC839;
									(*((word32) r2_n + 2))();
									Eq_n r4_n;
									struct Eq_n * sp_n;
									word32 r6_n;
									struct Eq_n * r5_n;
									ptr32 r9_n;
									if (r4_n < 0x09)
									{
l000145DC:
										uint32 r2_n = (uint32) sp_n[0x0A];
										if (r2_n != 0x00)
										{
											if (r2_n <= 0x18)
											{
												sp_n->dwFFFFFFFC = 0x00;
												sp_n->dwFFFFFFF8 = r6_n + 4752;
												sp_n->dwFFFFFFF4 = (char *) r5_n + 1515;
												(*((word32) r9_n + 2))();
												struct Eq_n * sp_n;
												word32 r0_n;
												sp_n->dwFFFFFFFC = r0_n;
												struct Eq_n * r5_n;
												sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
												sp_n->ptrFFFFFFF4 = r5_n;
												ptr32 r2_n = r5_n->ptrC839;
												(*((word32) r2_n + 2))();
												sp_n->w0026 = (cup16) sp_n[0x0A];
											}
											else
											{
												sp_n->dwFFFFFFFC = 0x00;
												sp_n->dwFFFFFFF8 = r6_n + 4725;
												sp_n->dwFFFFFFF4 = (char *) r5_n + 1515;
												(*((word32) r9_n + 2))();
												struct Eq_n * sp_n;
												word32 r0_n;
												sp_n->dwFFFFFFFC = r0_n;
												struct Eq_n * r5_n;
												sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
												sp_n->ptrFFFFFFF4 = r5_n;
												ptr32 r2_n = r5_n->ptrC839;
												(*((word32) r2_n + 2))();
												sp_n->w0026 = 0x14;
											}
											uipr32 r11_n = SEQ(SLICE(r11_n, word16, 16), 0x00);
											if (sp_n->w0026 != 0x00)
											{
												cup16 v436_n;
												do
												{
													struct Eq_n * sp_n = sp_n - 0x04;
													sp_n->dw0000 = 0x00;
													Eq_n r0_n;
													r0_n.u1 = (uint32) (word16) r11_n;
													byte (* r7_n)[];
													sp_n->dwFFFFFFFC = (uint32) *(r7_n + r0_n);
													word32 r6_n;
													sp_n->dwFFFFFFF8 = r6_n + 4758;
													sp_n->ptrFFFFFFF4 = (char *) r5_n + 1515;
													ptr32 r9_n;
													(*((word32) r9_n + 2))();
													struct Eq_n * sp_n;
													word32 r0_n;
													sp_n->dwFFFFFFFC = r0_n;
													struct Eq_n * r5_n;
													sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
													sp_n->ptrFFFFFFF4 = r5_n;
													ptr32 r0_n = r5_n->ptrC839;
													(*((word32) r0_n + 2))();
													word32 r11_n;
													v436_n = (word16) r11_n + 0x01;
													r11_n = SEQ(SLICE(r11_n, word16, 16), v436_n);
												} while (v436_n < sp_n->w0026);
											}
										}
										goto l0001466A;
									}
									struct Eq_n * r7_n;
									struct Eq_n * ap_n;
									if (r4_n == 0x09)
									{
l00014154:
										if ((uint32) sp_n[0x0A] >= 0x04)
										{
											(uint32) sp_n->w0012 != 0x09;
											sp_n->dwFFFFFFFC = 0x00;
											sp_n->dwFFFFFFF8 = r7_n;
											(*((word32) sp_n[7].dwFFFFFFFC + 6))();
											struct Eq_n * sp_n;
											word32 r0_n;
											sp_n->dwFFFFFFFC = r0_n;
											word32 r3_n;
											sp_n->dwFFFFFFF8 = r3_n;
											word32 r5_n;
											sp_n->dwFFFFFFF4 = r5_n + 1515;
											ptr32 r9_n;
											(*((word32) r9_n + 2))();
											struct Eq_n * sp_n;
											word32 r0_n;
											sp_n->dwFFFFFFFC = r0_n;
											struct Eq_n * r5_n;
											sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
											sp_n->ptrFFFFFFF4 = r5_n;
											ptr32 r2_n = r5_n->ptrC839;
											(*((word32) r2_n + 2))();
											*ap_n->ptr0004 = null;
										}
										goto l0001466A;
									}
									if (r4_n < 9733)
										goto l000145DC;
									word32 r8_n;
									struct Eq_n * fp_n;
									if (r4_n == 9733)
									{
										if ((uint32) sp_n[0x0A] >= 0x05)
										{
											fn00000002(r7_n, r8_n + 0x00D1, 0x04);
											word32 r0_n;
											if (r0_n == 0x00)
											{
												struct Eq_n * r7_n;
												r4_n.u1 = (uint32) r7_n->b0004;
												Eq_n r3_n;
												if (r3_n >= (word32) r4_n + 0x0D)
												{
													Eq_n r0_n;
													r0_n.u1 = (uint32) *((char *) r7_n + ((word32) r4_n + 5));
													fp_n->tFFFFFF65.u0 = (int8) r0_n;
													*((char *) r7_n + ((word32) r4_n + 5)) = (struct Eq_n *) 0<32>;
													sp_n->dwFFFFFFFC = 0x00;
													sp_n->dwFFFFFFF8 = (uint32) *((char *) r7_n + ((word32) r4_n + 0x0C));
													sp_n->dwFFFFFFF4 = (uint32) *((char *) r7_n + ((word32) r4_n + 11));
													sp_n->dwFFFFFFF0 = (uint32) *((char *) r7_n + ((word32) r4_n + 0x0A));
													sp_n->dwFFFFFFEC = (uint32) *((char *) r7_n + ((word32) r4_n + 9));
													sp_n->dwFFFFFFE8 = (uint32) *((char *) r7_n + ((word32) r4_n + 8));
													sp_n->dwFFFFFFE4 = (uint32) *((char *) r7_n + ((word32) r4_n + 7));
													sp_n->dwFFFFFFE0 = (uint32) *((char *) r7_n + ((word32) r4_n + 6));
													sp_n->dwFFFFFFDC = (int32) fp_n->tFFFFFF65.u0;
													sp_n->dwFFFFFFD8 = &r7_n->b0004 + 1;
													word32 r6_n;
													sp_n->dwFFFFFFD4 = r6_n + 4409;
													sp_n->dwFFFFFFD0 = (char *) r5_n + 1515;
													ptr32 r9_n;
													(*((word32) r9_n + 2))();
													struct Eq_n * sp_n;
													word32 r0_n;
													sp_n->dwFFFFFFFC = r0_n;
													struct Eq_n * r5_n;
													sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
													sp_n->ptrFFFFFFF4 = r5_n;
													ptr32 r2_n = r5_n->ptrC839;
													(*((word32) r2_n + 2))();
													ptr32 r7_n;
													int32 r3_n;
													*((word32) r7_n + r3_n) = (ptr32) fp_n->tFFFFFF65.u0;
												}
											}
										}
										goto l0001466A;
									}
									if (r4_n < 0x4453)
										goto l000145DC;
									if (r4_n == 0x4453)
									{
										if ((uint32) sp_n[0x0A] >= 0x04)
										{
											sp_n->dwFFFFFFFC = 0x00;
											sp_n->dwFFFFFFF8 = r7_n;
											(*((word32) sp_n[7].dwFFFFFFFC + 6))();
											struct Eq_n * sp_n;
											word32 r0_n;
											sp_n->dwFFFFFFFC = r0_n;
											word32 r6_n;
											sp_n->dwFFFFFFF8 = r6_n + 0x000010A1;
											word32 r5_n;
											sp_n->dwFFFFFFF4 = r5_n + 1515;
											ptr32 r9_n;
											(*((word32) r9_n + 2))();
											struct Eq_n * sp_n;
											word32 r0_n;
											sp_n->dwFFFFFFFC = r0_n;
											struct Eq_n * r5_n;
											sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
											sp_n->ptrFFFFFFF4 = r5_n;
											ptr32 r2_n = r5_n->ptrC839;
											(*((word32) r2_n + 2))();
											*ap_n->ptr0004 = null;
										}
										goto l0001466A;
									}
									if (r4_n < 0x4B46)
										goto l000145DC;
									if (r4_n == 0x4B46)
									{
										if ((uint32) sp_n[0x0A] < 0x13)
											goto l000145DC;
										int32 r2_n = 0x00;
										int32 r2_n;
										do
										{
											struct Eq_n * sp_n = sp_n - 0x04;
											sp_n->dw0000 = (uint32) (&r7_n->b0000)[0x0F - r2_n];
											sp_n->dwFFFFFFFC = r8_n + 0x00D9;
											ui32 r0_n = r2_n << 1;
											sp_n->ptrFFFFFFF8 = (char *) fp_n - 188 + r0_n * 4;
											(*((word32) r9_n + 2))();
											r2_n = r2_n + 0x01;
										} while (r2_n <= 0x0E);
										fp_n->bFFFFFF64 = 0x00;
										sp_n->dwFFFFFFFC = 0x00;
										sp_n->dwFFFFFFF8 = (char *) fp_n - 188;
										word32 r6_n;
										sp_n->dwFFFFFFF4 = r6_n + 4687;
										word32 r5_n;
										sp_n->dwFFFFFFF0 = r5_n + 1515;
										(*((word32) r9_n + 2))();
										struct Eq_n * sp_n;
										word32 r0_n;
										sp_n->dwFFFFFFFC = r0_n;
										struct Eq_n * r5_n;
										sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
										sp_n->ptrFFFFFFF4 = r5_n;
										ptr32 r2_n = r5_n->ptrC839;
										(*((word32) r2_n + 2))();
										goto l0001466A;
									}
									if (r4_n < 0x4C41)
										goto l000145DC;
									if (r4_n == 0x4C41)
										goto l00014154;
									if (r4_n < 0x4D49)
										goto l000145DC;
									if (r4_n == 0x4D49)
									{
										if ((uint32) sp_n[0x0A] >= 0x08)
										{
											sp_n->dwFFFFFFFC = &r7_n->b0004;
											(*((word32) sp_n[8].dwFFFFFFFC + 6))();
											struct Eq_n * fp_n;
											fp_n->bFFFFFFB6 = 0x00;
											word32 r7_n;
											word32 r8_n;
											fn000000C6(r7_n, r8_n + 0x0069, 0x04);
											word32 r0_n;
											word32 r3_n;
											word32 r8_n;
											word32 r7_n;
											struct Eq_n * fp_n;
											if (r0_n == 0x00)
												r3_n = r8_n + 110;
											else
											{
												struct Eq_n * sp_n;
												sp_n->dwFFFFFFFC = 0x04;
												sp_n->dwFFFFFFF8 = r8_n + 114;
												sp_n->dwFFFFFFF4 = r7_n;
												(*((word32) sp_n->ptr002C + 2))();
												word32 r0_n;
												word32 r8_n;
												if (r0_n == 0x00)
													r3_n = r8_n + 0x0077;
												else
												{
													struct Eq_n * sp_n;
													sp_n->dwFFFFFFFC = 0x04;
													sp_n->dwFFFFFFF8 = r8_n + 0x007E;
													sp_n->dwFFFFFFF4 = r7_n;
													(*((word32) sp_n->ptr002C + 2))();
													word32 r0_n;
													word32 r8_n;
													if (r0_n == 0x00)
														r3_n = r8_n + 131;
													else
													{
														struct Eq_n * sp_n;
														sp_n->dwFFFFFFFC = 0x04;
														sp_n->dwFFFFFFF8 = r8_n + 0x008A;
														sp_n->dwFFFFFFF4 = r7_n;
														(*((word32) sp_n->ptr002C + 2))();
														word32 r0_n;
														word32 r8_n;
														if (r0_n == 0x00)
															r3_n = r8_n + 0x008F;
														else
														{
															struct Eq_n * sp_n;
															sp_n->dwFFFFFFFC = 0x04;
															sp_n->dwFFFFFFF8 = r8_n + 0x0096;
															sp_n->dwFFFFFFF4 = r7_n;
															(*((word32) sp_n->ptr002C + 2))();
															word32 r0_n;
															word32 r8_n;
															if (r0_n == 0x00)
																r3_n = r8_n + 155;
															else
															{
																struct Eq_n * sp_n;
																sp_n->dwFFFFFFFC = 0x04;
																sp_n->dwFFFFFFF8 = r8_n + 0x00A2;
																sp_n->dwFFFFFFF4 = r7_n;
																(*((word32) sp_n->ptr002C + 2))();
																word32 r0_n;
																word32 r8_n;
																if (r0_n == 0x00)
																	r3_n = r8_n + 0x00A7;
																else
																{
																	struct Eq_n * sp_n;
																	sp_n->dwFFFFFFFC = 0x04;
																	sp_n->dwFFFFFFF8 = r8_n + 0x00AE;
																	sp_n->dwFFFFFFF4 = r7_n;
																	(*((word32) sp_n->ptr002C + 2))();
																	word32 r0_n;
																	word32 r8_n;
																	if (r0_n == 0x00)
																		r3_n = r8_n + 0x00B3;
																	else
																	{
																		struct Eq_n * sp_n;
																		sp_n->dwFFFFFFFC = 0x04;
																		sp_n->dwFFFFFFF8 = r8_n + 0x00BA;
																		sp_n->dwFFFFFFF4 = r7_n;
																		(*((word32) sp_n->ptr002C + 2))();
																		word32 r0_n;
																		word32 r8_n;
																		if (r0_n == 0x00)
																		{
																			r3_n = r8_n + 191;
																			up32 r10_n;
																			if (r10_n >= 0x10)
																			{
																				fp_n->bFFFFFFB6 = 0x20;
																				fp_n->bFFFFFFB7 = 0x28;
																				struct Eq_n * sp_n;
																				sp_n->dwFFFFFFFC = 0x04;
																				sp_n->dwFFFFFFF8 = r7_n + 0x0C;
																				sp_n->ptrFFFFFFF4 = &fp_n->bFFFFFFB7 + 1;
																				(*((word32) g_ptr192C0 + 2))();
																				fp_n->bFFFFFFBC = 0x29;
																				fp_n->bFFFFFFBD = 0x00;
																			}
																		}
																		else
																			r3_n = r8_n + 199;
																	}
																}
															}
														}
													}
												}
											}
											fn000000D2(r7_n + 0x06, r3_n, &fp_n->bFFFFFFB6, 0x00);
											struct Eq_n * sp_n;
											word32 r0_n;
											sp_n->dwFFFFFFFC = (uint32) (word16) r0_n;
											struct Eq_n * r6_n;
											ui32 r4_n;
											sp_n->dwFFFFFFF8 = r6_n->a1044[r4_n];
											sp_n->ptrFFFFFFF4 = (char *) r6_n + 4043;
											word32 r5_n;
											sp_n->dwFFFFFFF0 = r5_n + 1515;
											ptr32 r9_n;
											(*((word32) r9_n + 2))();
											struct Eq_n * sp_n;
											word32 r0_n;
											sp_n->dwFFFFFFFC = r0_n;
											struct Eq_n * r5_n;
											sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
											sp_n->ptrFFFFFFF4 = r5_n;
											ptr32 r2_n = r5_n->ptrC839;
											(*((word32) r2_n + 2))();
										}
										goto l0001466A;
									}
									if (r4_n < 0x5356)
										goto l000145DC;
									if (r4_n == 0x5356)
									{
										if ((uint32) sp_n[0x0A] >= 0x05)
											sp_n->dwFFFFFFFC = 0x00;
										goto l0001466A;
									}
									if (r4_n < 0x5455)
										goto l000145DC;
									if (r4_n == 0x5455)
									{
										if ((uint32) sp_n[0x0A] >= 0x01)
										{
											fp_n->bFFFFFF66 = 0x00;
											r4_n.u0 = 0x00;
											if (((uint32) r7_n->b0000 & 0x01) != 0x00)
											{
												sp_n->dwFFFFFFFC = r6_n + 0x0000111C;
												sp_n->dwFFFFFFF8 = &fp_n->bFFFFFF66;
												(*((word32) sp_n[6].dwFFFFFFFC + 6))();
												word32 r4_n;
												r4_n = r4_n + 0x01;
											}
											if (((uint32) r7_n->b0000 & 0x02) != 0x00)
											{
												struct Eq_n * sp_n = sp_n - 0x04;
												sp_n->ptr0000 = &fp_n->bFFFFFF66;
												(*((word32) sp_n->ptr0018 + 2))();
												int32 r3_n = r0_n;
												word32 r4_n;
												ptr32 fp_n;
												if (r4_n != 0x00)
												{
													*((word32) (fp_n + -0x009A) + r0_n) = (ptr32) 0x2F<32>;
													r3_n = r0_n + 0x01;
												}
												struct Eq_n * sp_n;
												word32 r6_n;
												sp_n->dwFFFFFFFC = r6_n + 4393;
												sp_n->dwFFFFFFF8 = fp_n + -0x009A + r3_n;
												(*((word32) sp_n->ptr0018 + 2))();
												*ap_n->ptr0004 = ap_n->ptr0004 + 1;
												word32 r4_n;
												r4_n = r4_n + 0x01;
											}
											if (((uint32) r7_n->b0000 & 0x04) != 0x00)
											{
												struct Eq_n * sp_n = sp_n - 0x04;
												sp_n->ptr0000 = &fp_n->bFFFFFF66;
												(*((word32) sp_n->ptr0018 + 2))();
												int32 r3_n = r0_n;
												word32 r4_n;
												ptr32 fp_n;
												if (r4_n != 0x00)
												{
													*((word32) (fp_n + -0x009A) + r0_n) = (ptr32) 0x2F<32>;
													r3_n = r0_n + 0x01;
												}
												struct Eq_n * sp_n;
												word32 r6_n;
												sp_n->dwFFFFFFFC = r6_n + 4400;
												sp_n->dwFFFFFFF8 = fp_n + -0x009A + r3_n;
												(*((word32) sp_n->ptr0018 + 2))();
												*ap_n->ptr0004 = ap_n->ptr0004 + 1;
												word32 r4_n;
												r4_n = r4_n + 0x01;
											}
											if (r4_n > 0x00)
											{
												struct Eq_n * sp_n = sp_n - 0x04;
												sp_n->dw0000 = 0x00;
												word32 r3_n;
												if (r4_n == 0x01)
													r3_n = r6_n;
												else
													r3_n = r8_n + 0x00CF;
												sp_n->dwFFFFFFFC = r3_n;
												sp_n->ptrFFFFFFF8 = &fp_n->bFFFFFF66;
												sp_n->dwFFFFFFF4 = r6_n + 4330;
												sp_n->ptrFFFFFFF0 = (char *) r5_n + 1515;
												(*((word32) r9_n + 2))();
												struct Eq_n * sp_n;
												word32 r0_n;
												sp_n->dwFFFFFFFC = r0_n;
												struct Eq_n * r5_n;
												sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
												sp_n->ptrFFFFFFF4 = r5_n;
												ptr32 r2_n = r5_n->ptrC839;
												(*((word32) r2_n + 2))();
											}
										}
										goto l0001466A;
									}
									if (r4_n < 25922)
										goto l000145DC;
									if (r4_n == 25922)
									{
										if ((uint32) sp_n[0x0A] >= 0x05)
										{
											sp_n->dwFFFFFFFC = 0x00;
											word32 r3_n;
											if (((uint32) r7_n->b0004 & 0x01) != 0x00)
												r3_n = r8_n + 0x00D6;
											else
												r3_n = r6_n;
											sp_n->dwFFFFFFF8 = r3_n;
											sp_n->dwFFFFFFF4 = r7_n;
											(*((word32) sp_n[7].dwFFFFFFFC + 6))();
											struct Eq_n * sp_n;
											word32 r0_n;
											sp_n->dwFFFFFFFC = r0_n;
											word32 r6_n;
											sp_n->dwFFFFFFF8 = r6_n + 0x000011A0;
											word32 r5_n;
											sp_n->dwFFFFFFF4 = r5_n + 1515;
											ptr32 r9_n;
											(*((word32) r9_n + 2))();
											struct Eq_n * sp_n;
											word32 r0_n;
											sp_n->dwFFFFFFFC = r0_n;
											struct Eq_n * r5_n;
											sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
											sp_n->ptrFFFFFFF4 = r5_n;
											ptr32 r2_n = r5_n->ptrC839;
											(*((word32) r2_n + 2))();
											struct Eq_n * r7_n;
											if (((uint32) r7_n->b0004 & 0x01) == 0x00)
												*ap_n->ptr0004 = null;
										}
										goto l0001466A;
									}
									if (r4_n != 64330)
										goto l000145DC;
									if ((uint32) sp_n[0x0A] >= 0x04)
									{
										sp_n->dwFFFFFFFC = 0x00;
										sp_n->dwFFFFFFF8 = (uint32) r7_n->b0003;
										sp_n->dwFFFFFFF4 = (uint32) r7_n->b0002;
										sp_n->dwFFFFFFF0 = (uint32) r7_n->b0001;
										sp_n->dwFFFFFFEC = (uint32) r7_n->b0000;
										sp_n->dwFFFFFFE8 = r6_n + 0x000011EF;
										sp_n->dwFFFFFFE4 = (char *) r5_n + 1515;
										(*((word32) r9_n + 2))();
										struct Eq_n * sp_n;
										word32 r0_n;
										sp_n->dwFFFFFFFC = r0_n;
										struct Eq_n * r5_n;
										sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
										sp_n->ptrFFFFFFF4 = r5_n;
										ptr32 r2_n = r5_n->ptrC839;
										(*((word32) r2_n + 2))();
									}
l0001466A:
									struct Eq_n * sp_n = sp_n - 0x04;
									sp_n->dw0000 = 0x00;
									sp_n->dwFFFFFFFC = 0x01;
									sp_n->dwFFFFFFF8 = r8_n + 222;
									sp_n->ptrFFFFFFF4 = r5_n;
									ptr32 r2_n = r5_n->dwC839;
									(*((word32) r2_n + 2))();
									uint32 r0_n = (uint32) sp_n[0x0A];
									r0_n = (uint32) sp_n->w002A - r0_n;
									sp_n->w002A = (int16) r0_n;
									word32 r7_n;
									r7_n = r7_n + r0_n;
								} while ((uint32) (word16) r0_n >= 0x04);
							}
							struct Eq_n * sp_n = sp_n - 0x04;
							sp_n->dw0000 = 0x00;
							sp_n->dwFFFFFFFC = 0x01;
							word32 r8_n;
							sp_n->dwFFFFFFF8 = r8_n + 224;
							struct Eq_n * r5_n;
							sp_n->ptrFFFFFFF4 = r5_n;
							ptr32 r2_n = r5_n->ptrC839;
							(*((word32) r2_n + 2))();
						}
					}
					word32 r3_n;
					word32 r4_n;
					if (r9_n != 0x01)
					{
						if (r9_n == 0x00 || (r9_n == 0x06 || (r9_n == 11 || (r9_n == 0x0E || (r9_n == 0x0D || (r9_n == 0x04 || r9_n == 0x0F))))))
							sp_n->dwFFFFFFFC = 0x00;
						uint32 r2_n = (uint32) sp_n->w000E;
						if ((r2_n & 0xF000) < 0x1000)
						{
l00013B2C:
							fp_n->bFFFFFFD6 = 0x3F;
							goto l00013B30;
						}
						else
						{
							if ((r2_n & 0xF000) != 0x1000)
							{
								if ((r2_n & 0xF000) < 0x2000)
									goto l00013B2C;
								if ((r2_n & 0xF000) != 0x2000)
								{
									if ((r2_n & 0xF000) < 0x4000)
										goto l00013B2C;
									if ((r2_n & 0xF000) != 0x4000)
									{
										if ((r2_n & 0xF000) < 0x6000)
											goto l00013B2C;
										if ((r2_n & 0xF000) != 0x6000)
										{
											if ((r2_n & 0xF000) < 0x8000)
												goto l00013B2C;
											if ((r2_n & 0xF000) != 0x8000)
											{
												if ((r2_n & 0xF000) < 0xA000)
													goto l00013B2C;
												if ((r2_n & 0xF000) != 0xA000)
												{
													if ((r2_n & 0xF000) != 0xC000)
														goto l00013B2C;
													fp_n->bFFFFFFD6 = 115;
												}
												else
													fp_n->bFFFFFFD6 = 0x6C;
											}
											else
												fp_n->bFFFFFFD6 = 0x2D;
										}
										else
											fp_n->bFFFFFFD6 = 0x62;
									}
									else
										fp_n->bFFFFFFD6 = 100;
								}
								else
									fp_n->bFFFFFFD6 = 99;
							}
							else
								fp_n->bFFFFFFD6 = 0x70;
l00013B30:
							uint32 r7_n = (uint32) sp_n->w000E;
							uip32 r3_n;
							if ((r7_n & 0x0100) != 0x00)
								r3_n = SEQ(SLICE(r3_n, word24, 8), 114);
							else
								r3_n = SEQ(SLICE(r3_n, word24, 8), 0x2D);
							fp_n->bFFFFFFD7 = (byte) r3_n;
							uip32 r4_n;
							if ((r7_n & 0x20) != 0x00)
								r4_n = SEQ(SLICE(r4_n, word24, 8), 114);
							else
								r4_n = SEQ(SLICE(r4_n, word24, 8), 0x2D);
							fp_n->bFFFFFFDA = (byte) r4_n;
							uip32 r3_n;
							if ((r7_n & 0x04) != 0x00)
								r3_n = SEQ(SLICE(r3_n, word24, 8), 114);
							else
								r3_n = SEQ(SLICE(r3_n, word24, 8), 0x2D);
							fp_n->bFFFFFFDD = (byte) r3_n;
							uip32 r4_n;
							if ((r7_n & 0x80) != 0x00)
								r4_n = SEQ(SLICE(r4_n, word24, 8), 0x77);
							else
								r4_n = SEQ(SLICE(r4_n, word24, 8), 0x2D);
							fp_n->bFFFFFFD8 = (byte) r4_n;
							uip32 r3_n;
							if ((r7_n & 0x10) != 0x00)
								r3_n = SEQ(SLICE(r3_n, word24, 8), 0x77);
							else
								r3_n = SEQ(SLICE(r3_n, word24, 8), 0x2D);
							fp_n->bFFFFFFDB = (byte) r3_n;
							uip32 r4_n;
							if ((r7_n & 0x02) != 0x00)
								r4_n = SEQ(SLICE(r4_n, word24, 8), 0x77);
							else
								r4_n = SEQ(SLICE(r4_n, word24, 8), 0x2D);
							fp_n->bFFFFFFDE = (byte) r4_n;
							ui32 r2_n;
							if ((r7_n & 0x40) != 0x00)
							{
								if ((r7_n & 0x0800) != 0x00)
									r2_n = SEQ(SLICE(r2_n, word24, 8) & 0xF0, 115);
								else
									r2_n = SEQ(SLICE(r2_n, word24, 8) & 0xF0, 0x78);
								fp_n->bFFFFFFD9 = (byte) r2_n;
							}
							else
							{
								if ((r7_n & 0x0800) != 0x00)
									r2_n = SEQ(SLICE(r2_n, word24, 8) & 0xF0, 0x53);
								else
									r2_n = SEQ(SLICE(r2_n, word24, 8) & 0xF0, 0x2D);
								fp_n->bFFFFFFD9 = (byte) r2_n;
							}
							uint32 r3_n = (uint32) sp_n->w000E;
							uip32 r2_n;
							if ((r3_n & 0x08) != 0x00)
							{
								if ((r3_n & 0x0400) != 0x00)
									r2_n = SEQ(SLICE(r2_n, word24, 8), 115);
								else
									r2_n = SEQ(SLICE(r2_n, word24, 8), 0x78);
								fp_n->bFFFFFFDC = (byte) r2_n;
							}
							else
							{
								if ((r3_n & 0x0400) != 0x00)
									r2_n = SEQ(SLICE(r2_n, word24, 8), 0x6C);
								else
									r2_n = SEQ(SLICE(r2_n, word24, 8), 0x2D);
								fp_n->bFFFFFFDC = (byte) r2_n;
							}
							uint32 r3_n = (uint32) sp_n->w000E;
							if ((r3_n & 0x01) != 0x00)
							{
								uip32 r2_n;
								if ((r3_n & 0x0200) != 0x00)
									r2_n = SEQ(SLICE(r2_n, word24, 8), 116);
								else
									r2_n = SEQ(SLICE(r2_n, word24, 8), 0x78);
								fp_n->bFFFFFFDF = (byte) r2_n;
							}
							else
							{
								uip32 r2_n;
								if ((r3_n & 0x0200) != 0x00)
									r2_n = SEQ(SLICE(r2_n, word24, 8), 0x54);
								else
									r2_n = SEQ(SLICE(r2_n, word24, 8), 0x2D);
								fp_n->bFFFFFFDF = (byte) r2_n;
							}
							fp_n->bFFFFFFE0 = 0x00;
							sp_n->dwFFFFFFFC = 0x00;
							sp_n->ptrFFFFFFF8 = &fp_n->bFFFFFFD6;
							sp_n->dwFFFFFFF4 = (uint32) sp_n->w000A;
							sp_n->dwFFFFFFF0 = r6_n + 3121;
							sp_n->ptrFFFFFFEC = (char *) r5_n + 1515;
							(*((word32) g_ptr192D0 + 2))();
							struct Eq_n * sp_n;
							word32 r0_n;
							sp_n->dwFFFFFFFC = r0_n;
							struct Eq_n * r5_n;
							sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
							sp_n->ptrFFFFFFF4 = r5_n;
							ptr32 r2_n = r5_n->ptrC839;
							(*((word32) r2_n + 2))();
							goto l00013C9E;
						}
					}
					uint32 r2_n = (uint32) sp_n->w000E;
					if ((r2_n & 0x0C00) >= 0x0400)
					{
						if ((r2_n & 0x0C00) == 0x0400)
						{
							fp_n->bFFFFFFD6 = 0x2D;
							goto l00013994;
						}
						if ((r2_n & 0x0C00) == 0x0800)
						{
							fp_n->bFFFFFFD6 = 100;
l00013994:
							uint32 r7_n = (uint32) sp_n->w000E;
							uip32 r3_n;
							if ((r7_n & 0x80) != 0x00)
								r3_n = SEQ(SLICE(r3_n, word24, 8), 0x68);
							else
								r3_n = SEQ(SLICE(r3_n, word24, 8), 0x2D);
							fp_n->bFFFFFFD7 = (byte) r3_n;
							uip32 r4_n;
							if ((r7_n & 0x40) != 0x00)
								r4_n = SEQ(SLICE(r4_n, word24, 8), 115);
							else
								r4_n = SEQ(SLICE(r4_n, word24, 8), 0x2D);
							fp_n->bFFFFFFD8 = (byte) r4_n;
							uip32 r3_n;
							if ((r7_n & 0x20) != 0x00)
								r3_n = SEQ(SLICE(r3_n, word24, 8), 0x70);
							else
								r3_n = SEQ(SLICE(r3_n, word24, 8), 0x2D);
							fp_n->bFFFFFFD9 = (byte) r3_n;
							uip32 r4_n;
							if ((r7_n & 0x10) != 0x00)
								r4_n = SEQ(SLICE(r4_n, word24, 8), 0x61);
							else
								r4_n = SEQ(SLICE(r4_n, word24, 8), 0x2D);
							fp_n->bFFFFFFDA = (byte) r4_n;
							uip32 r3_n;
							if ((r7_n & 0x08) != 0x00)
								r3_n = SEQ(SLICE(r3_n, word24, 8), 114);
							else
								r3_n = SEQ(SLICE(r3_n, word24, 8), 0x2D);
							fp_n->bFFFFFFDB = (byte) r3_n;
							uip32 r4_n;
							if ((r7_n & 0x04) != 0x00)
								r4_n = SEQ(SLICE(r4_n, word24, 8), 0x77);
							else
								r4_n = SEQ(SLICE(r4_n, word24, 8), 0x2D);
							fp_n->bFFFFFFDC = (byte) r4_n;
							uip32 r3_n;
							if ((r7_n & 0x02) != 0x00)
								r3_n = SEQ(SLICE(r3_n, word24, 8), 101);
							else
								r3_n = SEQ(SLICE(r3_n, word24, 8), 0x2D);
							fp_n->bFFFFFFDD = (byte) r3_n;
							uip32 r4_n;
							if ((r7_n & 0x01) != 0x00)
								r4_n = SEQ(SLICE(r4_n, word24, 8), 100);
							else
								r4_n = SEQ(SLICE(r4_n, word24, 8), 0x2D);
							fp_n->bFFFFFFDE = (byte) r4_n;
							fp_n->bFFFFFFDF = 0x00;
							sp_n->dwFFFFFFFC = 0x00;
							sp_n->ptrFFFFFFF8 = &fp_n->bFFFFFFD6;
							sp_n->dwFFFFFFF4 = r7_n;
							sp_n->dwFFFFFFF0 = r6_n + 0x0BFB;
							sp_n->ptrFFFFFFEC = (char *) r5_n + 1515;
							(*((word32) g_ptr192D0 + 2))();
							struct Eq_n * sp_n;
							word32 r0_n;
							sp_n->dwFFFFFFFC = r0_n;
							struct Eq_n * r5_n;
							sp_n->dwFFFFFFF8 = (char *) r5_n + 1515;
							sp_n->ptrFFFFFFF4 = r5_n;
							ptr32 r2_n = r5_n->ptrC839;
							(*((word32) r2_n + 2))();
							goto l00013C9E;
						}
					}
					fp_n->bFFFFFFD6 = 0x3F;
					goto l00013994;
				}
				if (false)
				{
					if (r0_n != 0x0A)
					{
						if (r0_n >= 0x0A)
							r1_n = ~0x09;
						r1_n += r0_n;
					}
					goto l000134E9;
				}
			}
		}
		if (false)
		{
			if (r0_n != 0x0A)
			{
				if (r0_n >= 0x0A)
					r1_n = ~0x09;
				r1_n += r0_n;
			}
			goto l00013435;
		}
	}
}

Eq_n g_a13E94[] = // 00013E94
	{
	};
// 00014812: void fn00014812(Register word32 r3, Register word32 r6, Register word32 r9, Register word32 r10, Register word32 fp)
void fn00014812(word32 r3, word32 r6, word32 r9, word32 r10, word32 fp)
{
	uipr32 r3_n;
	if ((uint32) g_w7A2E < 11)
		r3_n = SEQ(SLICE(r3, word16, 16), g_w7A2E);
	else
		r3_n = SEQ(SLICE(r3, word16, 16), 11);
	word16 v22_n = (word16) r3_n;
	uint32 ap_n = (uint32) v22_n;
	(*((word32) g_ptr192BC + 2))();
	up32 ap_n;
	struct Eq_n * fp_n;
	switch (ap_n)
	{
	case 0x06:
		struct Eq_n * r4_n;
		uip32 r3_n;
		if (((uint32) r4_n->wC65C & 0x02) != 0x00)
			r3_n = SEQ(SLICE(r3_n, word24, 8), 0x38);
		else
			r3_n = SEQ(SLICE(r3_n, word24, 8), 0x34);
		fp_n->bFFFFFFDC = (byte) r3_n;
		uint32 r2_n = (uint32) r4_n->wC65C;
		uip32 r2_n;
		if ((r2_n & 0x04) != 0x00)
			r2_n = SEQ(SLICE(r2_n, word24, 8), 0x33);
		else
			r2_n = SEQ(SLICE(r2_n, word24, 8), 0x32);
		fp_n->bFFFFFFDE = (byte) r2_n;
		break;
	case 0x08:
		struct Eq_n * r8_n;
		fp_n->bFFFFFFDE = r8_n->a14C8[(uint32) ((word16) ((uint32) r4_n->wC65C >> 1) & 0x03)];
		break;
	default:
		if (ap_n >= 11)
		{
			struct Eq_n * sp_n;
			sp_n->dwFFFFFFFC = (uint32) r4_n->wC65E;
			word32 r5_n;
			sp_n->dwFFFFFFF8 = r5_n + 0x00EC;
			sp_n->ptrFFFFFFF4 = &fp_n->bFFFFFFDC;
			(*((word32) g_ptr192D0 + 2))();
		}
		break;
	}
	int32 ap_n;
	byte * r2_n = (byte *) (&fp_n->bFFFFFFDE + 2);
	for (ap_n = 0x00; ap_n <= 0x0E; ++ap_n)
	{
		*r2_n = 0x20;
		++r2_n;
	}
	fp_n->bFFFFFFEF = 0x00;
	Eq_n r0_n;
	word32 r10_n;
	r0_n.u1 = (uint32) (word16) r10_n;
	if (r0_n <= 0x0F)
		g_a14910[r0_n]();
}

Eq_n g_a14910[] = // 00014910
	{
	};
// 00015106: Register word32 fn00015106(Register word32 r6, Register word32 r7, Register word32 r8, Register word32 r9, Register word32 r10, Register word32 r11, Register (ptr32 Eq_n) ap, Register word32 fp, Register out word32 r5Out, Register out word32 r6Out, Register out word32 apOut, Register out word32 fpOut)
// Called from:
//      fn0001325E
word32 fn00015106(word32 r6, word32 r7, word32 r8, word32 r9, word32 r10, word32 r11, struct Eq_n * ap, word32 fp, word32 & r5Out, word32 & r6Out, word32 & apOut, word32 & fpOut)
{
	word32 fp_n;
	Eq_n r1_n;
	r1_n.u1 = (uint32) *ap->ptr0004;
	int16 v19_n = (int16) (r1_n >> 5 & 0x0F);
	Eq_n r2_n;
	r2_n.u1 = (uint32) *ap->ptr0008;
	ptr32 sp_n = fp - 0x08;
	struct Eq_n * r4_n = (struct Eq_n *) 4294947792;
	ptr32 r3_n = (<unknown>*) ~0x6A7B;
	uipr32 r11_n = SEQ(SLICE(r11, word16, 16), (int16) ((r1_n >> 9 & 0x7F) + 0x50));
	uipr32 r10_n = SEQ(SLICE(r10, word16, 16), v19_n);
	uipr32 r9_n = SEQ(SLICE(r9, word16, 16), (word16) r1_n & 0x1F);
	uipr32 r8_n = SEQ(SLICE(r8, word16, 16), (int16) (r2_n >> 11 & 0x1F));
	uipr32 r7_n = SEQ(SLICE(r7, word16, 16), (int16) (r2_n >> 5 & 0x3F));
	uipr32 r6_n = SEQ(SLICE(r6, word16, 16), ((word16) r2_n & 0x1F) + ((word16) r2_n & 0x1F));
	uint32 r2_n = (uint32) v19_n;
	ptr32 r5_n;
	if (r2_n != 0x00 && r2_n <= 0x0C)
		r5_n = (<unknown>*) 4294945497 + (r2_n - 0x01 << 2);
	else
	{
		(*((word32) g_ptr192D0 + 2))();
		r5_n = fp + -8;
	}
	if (r4_n[9] > 0x09)
	{
		struct Eq_n * sp_n = sp_n - 0x04;
		sp_n->dw0000 = (uint32) (word16) r6_n;
		sp_n->dwFFFFFFFC = (uint32) (word16) r7_n;
		sp_n->dwFFFFFFF8 = (uint32) (word16) r8_n;
		sp_n->dwFFFFFFF4 = (uint32) (word16) r9_n;
		sp_n->ptrFFFFFFF0 = r5_n;
		uint32 r0_n = (uint32) (word16) r11_n;
		sp_n->dwFFFFFFEC = r0_n + 1900;
		sp_n->ptrFFFFFFE8 = r3_n + 5135;
		sp_n->dwFFFFFFE4 = ap->dw0010;
		(*((word32) g_ptr192D0 + 2))();
		goto l0001524F;
	}
	if (r4_n[18] != 0x00)
	{
		struct Eq_n * sp_n = sp_n - 0x04;
		sp_n->dw0000 = (uint32) (word16) r6_n;
		sp_n->dwFFFFFFFC = (uint32) (word16) r7_n;
		sp_n->dwFFFFFFF8 = (uint32) (word16) r8_n;
		sp_n->dwFFFFFFF4 = (uint32) (word16) r9_n;
		sp_n->dwFFFFFFF0 = (uint32) (word16) r10_n;
		uint32 r0_n = (uint32) (word16) r11_n;
		sp_n->dwFFFFFFEC = r0_n + 1900;
		sp_n->ptrFFFFFFE8 = r3_n + 5159;
		sp_n->dwFFFFFFE4 = ap->dw0010;
		(*((word32) g_ptr192D0 + 2))();
		goto l0001524F;
	}
	struct Eq_n * sp_n = sp_n - 0x04;
	sp_n->dw0000 = (uint32) (word16) r7_n;
	sp_n->dwFFFFFFFC = (uint32) (word16) r8_n;
	word32 r1_n = 0x00;
	uint32 r0_n = (uint32) (word16) r11_n;
	if (true)
	{
		if (false)
		{
l00015239:
			sp_n->dwFFFFFFF8 = (uint32) (word16) r1_n;
			sp_n->ptrFFFFFFF4 = r5_n;
			sp_n->dwFFFFFFF0 = (uint32) (word16) r9_n;
			sp_n->ptrFFFFFFEC = r3_n + 5113;
			sp_n->dwFFFFFFE8 = ap->dw0010;
			(*((word32) g_ptr192D0 + 2))();
l0001524F:
			struct Eq_n * sp_n = fp_n - 0x04;
			word32 fp_n = sp_n->dw0010;
			word32 ap_n = sp_n->dw000C;
			word32 r5_n;
			r5Out = r5_n;
			word32 r6_n;
			r6Out = r6_n;
			apOut = ap_n;
			fpOut = fp_n;
			word32 r4_n;
			return r4_n;
		}
		if (false)
		{
			if (r0_n != 100)
			{
				if (r0_n >= 100)
					r1_n = ~0x63;
				r1_n += r0_n;
			}
			goto l00015239;
		}
	}
}

// 00015256: void fn00015256(Register (ptr32 Eq_n) fp, Register (ptr32 ptr32) pc)
// Called from:
//      fn000167AA
void fn00015256(struct Eq_n * fp, ptr32 * pc)
{
	int32 v9_n = g_dw79CB - 0x01;
	g_dw79CB = v9_n;
	struct Eq_n * r2_n = (struct Eq_n *) 4294947792;
	if (v9_n >= 0x00)
		++g_dw79C7;
	else
	{
		word32 r3_n;
		word32 r4_n;
		word32 r6_n;
		word32 ap_n;
		fn0000D69A(fp, pc, out r2_n, out r3_n, out r4_n, out r6_n, out ap_n, out fp, out pc);
	}
	struct Eq_n * v17_n = r2_n->ptrC5FB - 0x01;
	r2_n->ptrC5FB = v17_n;
	if (v17_n >= null)
		r2_n->ptrC5F7 = (union Eq_n *) ((char *) r2_n->ptrC5F7 + 1);
	else
	{
		word32 r2_n;
		word32 r3_n;
		word32 r4_n;
		word32 r6_n;
		word32 ap_n;
		word32 fp_n;
		word32 pc_n;
		fn0000D69A(fp, pc, out r2_n, out r3_n, out r4_n, out r6_n, out ap_n, out fp_n, out pc_n);
	}
}

// 0001530A: void fn0001530A(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp)
// Called from:
//      fn000167AA
void fn0001530A(struct Eq_n * ap, struct Eq_n * fp)
{
	struct Eq_n * r5_n = (struct Eq_n *) 4294947792;
	struct Eq_n * r3_n = null;
	ui32 r4_n = 0x00;
	if (*(int32 *) 4294947928 > 0x00)
	{
		if (true)
		{
			do
			{
				struct Eq_n * v31_n = r5_n->ptrC5FB - 0x01;
				r5_n->ptrC5FB = v31_n;
				uint32 r7_n;
				if (v31_n >= null)
				{
					union Eq_n * r6_n = r5_n->ptrC5F7;
					r5_n->ptrC5F7 = (union Eq_n *) ((char *) r5_n->ptrC5F7 + 1);
					r7_n = (uint32) r6_n->u0;
				}
				else
				{
					fn0000009A();
					uint32 r0_n;
					r7_n = r0_n;
					struct Eq_n * r3_n;
					r3_n = r3_n;
					ui32 r4_n;
					r4_n = r4_n;
					struct Eq_n * r5_n;
					r5_n = r5_n;
				}
				r4_n |= __ashift<word32,word32>(r7_n, r3_n);
				r3_n = (struct Eq_n *) ((char *) &r3_n->t0000 + 8);
			} while (r3_n < (struct Eq_n *) 0x01);
		}
		if ((r4_n & 0x01) != 0x00)
			;
	}
	else
		fn0000B072(ap, fp);
}

// 00015896: void fn00015896(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp)
// Called from:
//      fn000167AA
void fn00015896(struct Eq_n * ap, struct Eq_n * fp)
{
	struct Eq_n * r5_n = (struct Eq_n *) 4294947792;
	struct Eq_n * r3_n = null;
	ui32 r4_n = 0x00;
	if (*(int32 *) 4294947928 > 0x00)
	{
		if (true)
		{
			do
			{
				struct Eq_n * v31_n = r5_n->ptrC5FB - 0x01;
				r5_n->ptrC5FB = v31_n;
				uint32 r7_n;
				if (v31_n >= null)
				{
					union Eq_n * r6_n = r5_n->ptrC5F7;
					r5_n->ptrC5F7 = (union Eq_n *) ((char *) r5_n->ptrC5F7 + 1);
					r7_n = (uint32) r6_n->u0;
				}
				else
				{
					fn0000009A();
					uint32 r0_n;
					r7_n = r0_n;
					struct Eq_n * r3_n;
					r3_n = r3_n;
					ui32 r4_n;
					r4_n = r4_n;
					struct Eq_n * r5_n;
					r5_n = r5_n;
				}
				r4_n |= __ashift<word32,word32>(r7_n, r3_n);
				r3_n = (struct Eq_n *) ((char *) &r3_n->t0000 + 8);
			} while (r3_n < (struct Eq_n *) 0x01);
		}
		if ((r4_n & 0x01) != 0x00)
			;
	}
	else
		fn0000B072(ap, fp);
}

// 00015E22: void fn00015E22(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp)
// Called from:
//      fn000167AA
void fn00015E22(struct Eq_n * ap, struct Eq_n * fp)
{
	struct Eq_n * r6_n = (struct Eq_n *) 4294947792;
	struct Eq_n * r4_n = null;
	ui32 r3_n = 0x00;
	if (*(int32 *) 4294947928 > 0x00)
	{
		if (true)
		{
			do
			{
				struct Eq_n * v29_n = r6_n->ptrC5FB - 0x01;
				r6_n->ptrC5FB = v29_n;
				uint32 r7_n;
				if (v29_n >= null)
				{
					union Eq_n * r5_n = r6_n->ptrC5F7;
					r6_n->ptrC5F7 = (union Eq_n *) ((char *) r6_n->ptrC5F7 + 1);
					r7_n = (uint32) r5_n->u0;
				}
				else
				{
					fn0000009A();
					uint32 r0_n;
					r7_n = r0_n;
					struct Eq_n * r4_n;
					r4_n = r4_n;
					ui32 r3_n;
					r3_n = r3_n;
					struct Eq_n * r6_n;
					r6_n = r6_n;
				}
				r3_n |= __ashift<word32,word32>(r7_n, r4_n);
				r4_n = (struct Eq_n *) ((char *) &r4_n->t0000 + 8);
			} while (r4_n < (struct Eq_n *) 0x01);
		}
		if ((r3_n & 0x01) == 0x00)
			;
	}
	else
		fn0000B072(ap, fp);
}

// 000162E6: void fn000162E6(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp)
// Called from:
//      fn000167AA
void fn000162E6(struct Eq_n * ap, struct Eq_n * fp)
{
	struct Eq_n * r6_n = (struct Eq_n *) 4294947792;
	struct Eq_n * r4_n = null;
	ui32 r3_n = 0x00;
	if (*(int32 *) 4294947928 > 0x00)
	{
		if (true)
		{
			do
			{
				struct Eq_n * v29_n = r6_n->ptrC5FB - 0x01;
				r6_n->ptrC5FB = v29_n;
				uint32 r7_n;
				if (v29_n >= null)
				{
					union Eq_n * r5_n = r6_n->ptrC5F7;
					r6_n->ptrC5F7 = (union Eq_n *) ((char *) r6_n->ptrC5F7 + 1);
					r7_n = (uint32) r5_n->u0;
				}
				else
				{
					fn0000009A();
					uint32 r0_n;
					r7_n = r0_n;
					struct Eq_n * r4_n;
					r4_n = r4_n;
					ui32 r3_n;
					r3_n = r3_n;
					struct Eq_n * r6_n;
					r6_n = r6_n;
				}
				r3_n |= __ashift<word32,word32>(r7_n, r4_n);
				r4_n = (struct Eq_n *) ((char *) &r4_n->t0000 + 8);
			} while (r4_n < (struct Eq_n *) 0x01);
		}
		if ((r3_n & 0x01) == 0x00)
			;
	}
	else
		fn0000B072(ap, fp);
}

// 000167AA: void fn000167AA(Register (ptr32 Eq_n) fp, Register (ptr32 ptr32) pc)
void fn000167AA(struct Eq_n * fp, ptr32 * pc)
{
	fp->dwFFFFFFE8 = 0x07;
	uip32 r0_n;
	word32 r0;
	if (g_dw79CB + *((int32 *) 4294947924) > 200000)
		r0_n = SEQ(SLICE(r0, word24, 8), 0x08);
	else
		r0_n = SEQ(SLICE(r0, word24, 8), 0x07);
	fp->dwFFFFFFE4 = (int32) (int8) r0_n;
	g_dw7BE9 = 0x00;
	if (((uint32) g_w7A10 & 0x04) != 0x00)
	{
		fp->dwFFFFFFEC = 0x09;
		fn00015256(fp, pc);
	}
	else
		fn00015256(fp, pc);
}

// 000173CA: void fn000173CA(Register (ptr32 Eq_n) r0, Register word32 r1, Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp)
void fn000173CA(struct Eq_n * r0, word32 r1, struct Eq_n * ap, struct Eq_n * fp)
{
	word32 fp_n;
	word32 ap_n;
	word32 r4_n;
	word32 r3_n;
	word32 r2_n;
	word32 r4_n;
	word32 fp_n;
	word32 ap_n;
	word32 r4_n;
	word32 r3_n;
	word32 r2_n;
	*ap->ptr0004 = 0x00;
	ap->ptr0008->a0000[0].u1 = 0x00;
	*(struct Eq_n **) ~0x4648 = (struct Eq_n *) ((char *) &fp->dwFFFFFFE4 + 3);
	struct Eq_n * sp_n = fp - 0x1C;
	struct Eq_n * r3_n = (struct Eq_n *) 4294947792;
	if ((uint32) g_w7A58 > 0x00)
	{
		up32 r8_n;
		do
		{
			struct Eq_n * sp_n = sp_n - 0x04;
			sp_n->dw0000 = 0x04;
			sp_n->ptrFFFFFFFC = r3_n + (struct Eq_n *) 0x0098;
			word32 r0_n = fn0000D5BE(r0, ap, fp, out r2_n, out r3_n, out r4_n, out ap_n, out fp_n);
			struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
			if (r0_n == 0x00)
				return;
			sp_n->dwFFFFFFFC = 0x04;
			sp_n->dwFFFFFFF8 = r3_n + 50740;
			sp_n->dwFFFFFFF4 = r3_n + 0x0098;
			(*((word32) g_ptr192D8 + 2))();
			struct Eq_n * r0_n;
			if (r0_n != null)
			{
				struct Eq_n * sp_n;
				sp_n->dwFFFFFFFC = 0x0401;
				word32 r8_n;
				sp_n->dwFFFFFFF8 = r8_n;
				word32 r7_n;
				sp_n->dwFFFFFFF4 = r7_n;
				word32 r3_n;
				sp_n->dwFFFFFFF0 = r3_n + 1515;
				(*((word32) g_ptr192D0 + 2))();
				struct Eq_n * sp_n;
				word32 r0_n;
				sp_n->dwFFFFFFFC = r0_n;
				struct Eq_n * r3_n;
				sp_n->dwFFFFFFF8 = (char *) r3_n + 1515;
				sp_n->ptrFFFFFFF4 = r3_n;
				ptr32 r2_n = r3_n->ptrC839;
				(*((word32) r2_n + 2))();
				struct Eq_n * sp_n;
				sp_n->dwFFFFFFFC = 0x0401;
				word32 r10_n;
				sp_n->dwFFFFFFF8 = r10_n;
				word32 r3_n;
				sp_n->dwFFFFFFF4 = r3_n + 1515;
				(*((word32) g_ptr192D0 + 2))();
				struct Eq_n * sp_n;
				word32 r0_n;
				sp_n->dwFFFFFFFC = r0_n;
				struct Eq_n * r3_n;
				sp_n->dwFFFFFFF8 = (char *) r3_n + 1515;
				sp_n->ptrFFFFFFF4 = r3_n;
				ptr32 r2_n = r3_n->ptrC839;
				(*((word32) r2_n + 2))();
				return;
			}
			struct Eq_n * ap_n;
			struct Eq_n * fp_n;
			word32 r2_n;
			struct Eq_n * r3_n;
			word32 fp_n;
			if (fn00011C0A(r0_n, r1, ap_n, fp_n, out r2_n, out r3_n, out fp_n) != 0x00)
				return;
			fn00000076((uint32) r3_n->wC670, 0x02);
			int32 r0_n;
			if (r0_n != 0x00 && r0_n > 0x01)
				return;
			struct Eq_n * r3_n;
			if (r3_n->dwC627 != 0x00)
			{
				struct Eq_n * sp_n;
				sp_n->dwFFFFFFFC = r3_n->dwC627;
				(*((word32) g_ptr192B0 + 2))();
				r3_n->dwC627 = 0x00;
			}
			fn00000076((uint32) r3_n->wC672, 0x03);
			if (r0 != null && r0 > (struct Eq_n *) 0x01)
				return;
			word32 r6_n;
			if (r3_n[27] == 0x00)
			{
				r0 = r3_n[36] - 0x04;
				r6_n = 0x00;
				word32 * r2_n = &r0->dw0004;
				if (r0->dw0004 != 0x00)
				{
					struct Eq_n * r2_n;
					do
					{
						fn0000001A(&r3_n->dwC6E9 + 6, *r2_n, r3_n[4]);
						if (r0 != null)
						{
							r6_n = 0x01;
							break;
						}
						r2_n = &r2_n->dw0004;
					} while (r2_n->dw0004 != 0x00);
				}
				if (r6_n != 0x00)
				{
					struct Eq_n * r2_n = r3_n[37] - 0x04;
					word32 * r2_n = &r2_n->dw0004;
					if (r2_n->dw0004 != 0x00)
					{
						struct Eq_n * r2_n;
						do
						{
							fn0000001A(r3_n + &g_tC701, *r2_n, r3_n[4]);
							if (r0 != null)
							{
								r6_n = 0x00;
								break;
							}
							r2_n = &r2_n->dw0004;
						} while (r2_n->dw0004 != 0x00);
					}
				}
			}
			if (r3_n[27] != 0x00 || r6_n != 0x00)
			{
				sp_n->ptrFFFFFFFC = &r3_n->dwC6E9 + 6;
				(*((word32) g_ptr192C4 + 2))();
				uip32 r4_n = SEQ(SLICE(r4_n, word24, 8), 0x00);
				word32 r1_n;
				r1 = r1_n;
				if (r0 != null)
				{
					r0 -= (struct Eq_n *) 0x01;
					r1 = r1_n;
					if (*((word32) (r0 - (struct Eq_n *) 0x01) + (r3_n + &g_tC701)) != 0x2F)
					{
						r0 = r3_n->ptr05E7;
						r1 = r1_n;
						if (r0->t000C.u0 != 0x00)
							goto l0001759B;
						sp_n->ptrFFFFFFFC = (<unknown>*) 0x2F;
						sp_n->ptrFFFFFFF8 = r3_n + &g_tC701;
						(*((word32) g_ptr19260 + 2))();
						word32 r1_n;
						r1 = r1_n;
						if (r0 != null)
							goto l0001759B;
						r1 = r1_n;
						r1 = r1_n;
						word32 r2_n;
						if ((byte) r2_n == 0x5C)
							goto l00017599;
					}
					else
					{
l00017599:
						r4_n = SEQ(SLICE(r4_n, word24, 8), (byte) r4_n + 0x01);
					}
				}
l0001759B:
				if ((int32) (int8) r4_n == 0x00)
				{
					struct Eq_n * sp_n = sp_n - 0x04;
					sp_n->dw0000 = (uint32) r3_n[12696];
					sp_n->dwFFFFFFFC = (uint32) r3_n->wC662;
					fn0000BC8A();
				}
			}
			if (r3_n[12701] != 0x00)
			{
				fn00000076((uint32) r3_n[12701], 0x00);
				if (r0 != null && r0 > (struct Eq_n *) 0x01)
					return;
			}
		} while (r8_n + 0x01 < (uint32) r3_n[0x000031A2]);
	}
	struct Eq_n * sp_n = sp_n - 0x04;
	sp_n->dw0000 = 0x04;
	sp_n->ptrFFFFFFFC = r3_n + 38;
	word32 r0_n = fn0000D5BE(r0, ap, fp, out r2_n, out r3_n, out r4_n, out ap_n, out fp_n);
	struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
	if (r0_n == 0x00)
		return;
	sp_n->dwFFFFFFFC = 0x04;
	sp_n->dwFFFFFFF8 = r3_n + 50745;
	sp_n->dwFFFFFFF4 = r3_n + 0x0098;
	(*((word32) g_ptr192D8 + 2))();
	word32 r0_n;
	if (r0_n != 0x00)
	{
		struct Eq_n * sp_n;
		sp_n->dwFFFFFFFC = 0x0401;
		sp_n->ptrFFFFFFF8 = (<unknown>*) 4294947624;
		word32 r3_n;
		sp_n->dwFFFFFFF4 = r3_n + 1515;
		(*((word32) g_ptr192D0 + 2))();
		struct Eq_n * sp_n;
		word32 r0_n;
		sp_n->dwFFFFFFFC = r0_n;
		struct Eq_n * r3_n;
		sp_n->dwFFFFFFF8 = (char *) r3_n + 1515;
		sp_n->ptrFFFFFFF4 = r3_n;
		ptr32 r2_n = r3_n->ptrC839;
		(*((word32) r2_n + 2))();
		int32 r11_n = 0x01;
	}
	struct Eq_n * ap_n;
	*ap_n->ptr0008 != 0x00;
}

// 00017662: Register word32 fn00017662(Register (ptr32 Eq_n) ap, Register word32 fp)
// Called from:
//      fn00012D86
word32 fn00017662(struct Eq_n * ap, word32 fp)
{
	if (ap->dw0004 == 0x00)
		return 0x00;
	up32 r4_n = ap->dw0004;
	if (r4_n > 2000000)
	{
		if (false)
		{
			if (r4_n < ap->dw0008)
				;
		}
	}
	else if (r4_n < ap->dw0008)
		;
}

// 00017772: Register (ptr32 Eq_n) fn00017772(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register out word32 fpOut)
// Called from:
//      fn0001325E
struct Eq_n * fn00017772(struct Eq_n * ap, struct Eq_n * fp, word32 & fpOut)
{
	struct Eq_n * fp_n;
	word32 fp_n;
	word32 ap_n;
	word32 r3_n;
	word32 r2_n;
	word32 r0_n = fn00010892(ap, fp, out r2_n, out r3_n, out ap_n, out fp_n);
	struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
	sp_n->dwFFFFFFFC = 0x00;
	sp_n->dwFFFFFFF8 = r0_n;
	(*((word32) g_ptr192C4 + 2))();
	struct Eq_n * sp_n;
	word32 r0_n;
	sp_n->dwFFFFFFFC = r0_n;
	word32 ap_n;
	sp_n->dwFFFFFFF8 = ap_n;
	struct Eq_n * r2_n;
	sp_n->ptrFFFFFFF4 = r2_n;
	ptr32 ap_n = r2_n->ptrC839;
	(*((word32) ap_n + 2))();
	struct Eq_n * sp_n;
	sp_n->dwFFFFFFFC = 0x00;
	sp_n->dwFFFFFFF8 = 0x01;
	word32 r3_n;
	sp_n->dwFFFFFFF4 = r3_n + 18;
	struct Eq_n * r2_n;
	sp_n->ptrFFFFFFF0 = r2_n;
	ptr32 ap_n = r2_n->ptrC839;
	(*((word32) ap_n + 2))();
	struct Eq_n * ap_n = fp_n->ptr0008;
	fpOut = fp_n->dw000C;
	return ap_n;
}

// 000177CA: Register (ptr32 Eq_n) fn000177CA(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register (ptr32 ptr32) pc, Register out (ptr32 Eq_n) fpOut)
// Called from:
//      fn00017DEE
struct Eq_n * fn000177CA(struct Eq_n * ap, struct Eq_n * fp, ptr32 * pc, struct Eq_n & fpOut)
{
	struct Eq_n * sp_n = fp - 0x0C;
	struct Eq_n * r6_n = (struct Eq_n *) 4294947792;
	Eq_n r4_n;
	r4_n.u0 = g_t7C01.u0;
	struct Eq_n * r3_n = g_ptr7C05;
	while (r3_n < ap->ptr000C)
	{
		struct Eq_n * v18_n = r6_n->ptrC5FB - 0x01;
		r6_n->ptrC5FB = v18_n;
		uint32 r7_n;
		if (v18_n >= null)
		{
			union Eq_n * r5_n = r6_n->ptrC5F7;
			r6_n->ptrC5F7 = (union Eq_n *) ((char *) r6_n->ptrC5F7 + 1);
			r7_n = (uint32) r5_n->u0;
		}
		else
		{
			sp_n = (struct Eq_n *) <invalid>;
			word32 r2_n;
			r7_n = fn0000D69A(fp, pc, out r2_n, out r3_n, out r4_n, out r6_n, out ap, out fp, out pc);
		}
		if (r7_n == ~0x00)
		{
			fpOut = fp->ptr000C;
			return (struct Eq_n *) <invalid>;
		}
		r4_n |= __ashift<word32,word32>(r7_n, r3_n);
		r3_n = (struct Eq_n *) ((char *) &r3_n->t0000 + 8);
	}
	uint32 r2_n = (uint32) ap->ptr0004->a0000[sp_n->dw0000 & ~(~r4_n)].dw0000;
	if (r2_n > 0x10)
	{
		if (r2_n == 99)
		{
			fpOut = fp->ptr000C;
			return (struct Eq_n *) <invalid>;
		}
	}
}

// 00017DEE: void fn00017DEE(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register (ptr32 ptr32) pc)
void fn00017DEE(struct Eq_n * ap, struct Eq_n * fp, ptr32 * pc)
{
	struct Eq_n * sp_n = fp + -0x0488;
	struct Eq_n * r3_n = (struct Eq_n *) 4294947792;
	if (g_dw7BED == 0x00)
	{
		int32 r0_n;
		word32 * r2_n = (word32 *) fp->aFFFFFB7C;
		for (r0_n = 0x00; r0_n <= 0x8F; ++r0_n)
		{
			*r2_n = 0x08;
			++r2_n;
		}
		for (; r0_n < 0x0100; ++r0_n)
			fp->aFFFFFB7C[r0_n] = 0x09;
		for (; r0_n < 0x0118; ++r0_n)
			fp->aFFFFFB7C[r0_n] = 0x07;
		for (; r0_n < 288; ++r0_n)
			fp->aFFFFFB7C[r0_n] = 0x08;
		g_dw7BF5 = 0x07;
		struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
		struct Eq_n * r3_n;
		word32 r5_n;
		struct Eq_n * ap_n;
		struct Eq_n * fp_n;
		if (fn0001878E(ap, fp, out r3_n, out r5_n, out ap_n, out fp_n) != 0x00)
		{
			r3_n->dwC81D = 0x00;
			return;
		}
		int32 r0_n;
		word32 * r2_n = (word32 *) fp_n->aFFFFFB7C;
		for (r0_n = 0x00; r0_n <= 0x1D; ++r0_n)
		{
			*r2_n = 0x05;
			++r2_n;
		}
		r3_n->dwC829 = 0x05;
		sp_n->dwFFFFFFFC = &r3_n->dwC829;
		sp_n->dwFFFFFFF8 = &r3_n->dwC81D + 1;
		sp_n->dwFFFFFFF4 = r5_n + 260;
		sp_n->ptrFFFFFFF0 = r5_n + 200;
		sp_n->ptrFFFFFFEC = null;
		sp_n->dwFFFFFFE8 = 0x1E;
		sp_n->dwFFFFFFE4 = (word32) fp_n->aFFFFFB7C;
		sp_n = (struct Eq_n *) <invalid>;
		word32 r5_n;
		if (fn0001878E(ap_n, fp_n, out r3_n, out r5_n, out ap, out fp) > 0x01)
		{
			Eq_n r4_n;
			r4_n.u1 = r3_n->tC81D.u1;
			Eq_n ap_n = r4_n;
			if (r4_n != 0x00)
			{
				Eq_n r2_n;
				do
				{
					struct Eq_n * ap_n = ap_n - 0x06;
					word32 r2_n = ap_n->dw0002;
					sp_n->dwFFFFFFFC = ap_n;
					(*((word32) g_ptr192B0 + 2))();
					ap_n = r2_n;
				} while (r2_n != 0x00);
			}
			r3_n->tC81D.u1 = 0x00;
			return;
		}
	}
	struct Eq_n * sp_n = sp_n - 0x04;
	sp_n->dw0000 = r3_n->dwC829;
	sp_n->dwFFFFFFFC = r3_n->dwC825;
	sp_n->dwFFFFFFF8 = r3_n->dwC821;
	sp_n->tFFFFFFF4.u1 = r3_n->tC81D.u1;
	word32 fp_n;
	fn000177CA(ap, fp, pc, out fp_n) == 0x00;
}

// 000185AE: Register word32 fn000185AE(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register (ptr32 ptr32) pc, Register out (ptr32 Eq_n) r2Out, Register out Eq_n r3Out, Register out word32 apOut, Register out (ptr32 Eq_n) fpOut, Register out (ptr32 ptr32) pcOut)
// Called from:
//      fn000186B2
word32 fn000185AE(struct Eq_n * ap, struct Eq_n * fp, ptr32 * pc, struct Eq_n & r2Out, union Eq_n & r3Out, word32 & apOut, struct Eq_n & fpOut, ptr32 & pcOut)
{
	struct Eq_n * r4_n = (struct Eq_n *) 4294947792;
	Eq_n r3_n;
	r3_n.u0 = g_t7C01.u0;
	struct Eq_n * r2_n = g_ptr7C05;
	while (r2_n < (struct Eq_n *) 0x01)
	{
		struct Eq_n * v12_n = r4_n->ptrC5FB - 0x01;
		r4_n->ptrC5FB = v12_n;
		uint32 r5_n;
		if (v12_n >= null)
		{
			union Eq_n * r0_n = r4_n->ptrC5F7;
			r4_n->ptrC5F7 = (union Eq_n *) ((char *) r4_n->ptrC5F7 + 1);
			r5_n = (uint32) r0_n->u0;
		}
		else
		{
			word32 r6_n;
			r5_n = fn0000D69A(fp, pc, out r2_n, out r3_n, out r4_n, out r6_n, out ap, out fp, out pc);
		}
		if (r5_n == ~0x00)
		{
			struct Eq_n * sp_n = fp - 0x04;
			struct Eq_n * fp_n = sp_n->ptr0010;
			word32 ap_n = sp_n->dw000C;
			r2Out = r2_n;
			r3Out = r3_n;
			apOut = ap_n;
			fpOut = fp_n;
			pcOut = pc;
			return 0x01;
		}
		r3_n |= __ashift<word32,word32>(r5_n, r2_n);
		r2_n = (struct Eq_n *) ((char *) &r2_n->t0000 + 8);
	}
	ap->ptr0004->a0000[0].dw0000 = (ui32) (r3_n & 0x01);
}

// 000186B2: void fn000186B2(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register (ptr32 ptr32) pc)
void fn000186B2(struct Eq_n * ap, struct Eq_n * fp, ptr32 * pc)
{
	g_dw7BFD = 0x00;
	g_t7C01.u1 = 0x00;
	struct Eq_n * sp_n = fp - 0x08;
	struct Eq_n * r2_n = (struct Eq_n *) 4294947792;
	do
	{
		r2_n->dwC819 = 0x00;
		sp_n->dwFFFFFFFC = &fp->ptrFFFFFFF8;
		sp_n = (struct Eq_n *) <invalid>;
		up32 r3_n;
		if (fn000185AE(ap, fp, pc, out r2_n, out r3_n, out ap, out fp, out pc) != 0x00)
			return;
		r2_n->dwC819 <= r3_n;
	} while (fp->ptrFFFFFFF8 == null);
	if (r2_n->dwC6C5 != 0x00)
	{
		sp_n->dwFFFFFFFC = r2_n->ptrC82D;
		sp_n->dwFFFFFFF8 = (char *) &r2_n->ptr05E7 + 4;
		fn0001084A(ap, fp);
	}
	else
	{
		sp_n->dwFFFFFFFC = null;
		sp_n->dwFFFFFFF8 = r2_n->ptrC82D;
		sp_n->dwFFFFFFF4 = (char *) &r2_n->ptr05E7 + 4;
		fn0000B072(ap, fp);
	}
}

// 0001872A: void fn0001872A(Register word32 r0)
// Called from:
//      fn000108D2
void fn0001872A(word32 r0)
{
	ptr32 fp;
	struct Eq_n * sp_n = fp - 0x0C;
	struct Eq_n * r3_n = (struct Eq_n *) 4294947792;
	if (g_dw7BED != 0x00)
	{
		word32 r4_n = g_dw7BF1;
		word32 ap_n = r4_n;
		if (r4_n != 0x00)
		{
			word32 r2_n;
			do
			{
				struct Eq_n * ap_n = ap_n - 0x06;
				word32 r2_n = ap_n->dw0002;
				sp_n->ptrFFFFFFFC = ap_n;
				(*((word32) g_ptr192B0 + 2))();
				ap_n = r2_n;
			} while (r2_n != 0x00);
		}
		Eq_n r4_n;
		r4_n.u1 = r3_n->tC81D.u1;
		Eq_n ap_n = r4_n;
		if (r4_n != 0x00)
		{
			Eq_n r2_n;
			do
			{
				struct Eq_n * ap_n = ap_n - 0x06;
				word32 r2_n = ap_n->dw0002;
				sp_n->ptrFFFFFFFC = ap_n;
				(*((word32) g_ptr192B0 + 2))();
				ap_n = r2_n;
			} while (r2_n != 0x00);
		}
		r3_n->tC81D.u0 = 0x00;
	}
}

// 0001878E: Register int32 fn0001878E(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register out Eq_n r3Out, Register out word32 r5Out, Register out word32 apOut, Register out (ptr32 Eq_n) fpOut)
// Called from:
//      fn000167AA
//      fn00017DEE
int32 fn0001878E(struct Eq_n * ap, struct Eq_n * fp, union Eq_n & r3Out, word32 & r5Out, word32 & apOut, struct Eq_n & fpOut)
{
	struct Eq_n * ap_n;
	struct Eq_n * ap_n;
	word32 r3_n;
	if (ap->dw0008 > 0x0100)
		r3_n = ap->ptr0004->dw0400;
	else
		r3_n = 0x10;
	(*((word32) g_ptr1927C + 2))();
	word32 * r2_n = ap_n->ptr0004;
	Eq_n r11_n;
	r11_n.u0 = ap_n->t0008.u0;
	Eq_n r3_n;
	struct Eq_n * fp_n;
	do
	{
		r3_n.u0 = *r2_n;
		fp_n->aFFFFFFB8[r3_n] = fp_n->aFFFFFFB8[0] + 0x01;
		++r2_n;
		--r11_n;
	} while (r11_n != 0x00);
	word32 r5_n;
	if (fp_n->aFFFFFFB8[0] != (ap_n->t0008).u0)
	{
		struct Eq_n * r10_n = (struct Eq_n *) 1;
		while (fp_n->aFFFFFFB8[r10_n] == 0x00)
		{
			r10_n = (struct Eq_n *) ((char *) &r10_n->t0000 + 1);
			if (r10_n > (struct Eq_n *) 0x10)
				break;
		}
		struct Eq_n ** r2_n = ap_n->ptr001C;
		if (*r2_n < r10_n)
			*r2_n = (struct Eq_n **) r10_n;
		struct Eq_n * r11_n = (struct Eq_n *) 0x10;
		if (true)
		{
			while (fp_n->aFFFFFFB8[r11_n] == 0x00)
			{
				--r11_n;
				if (r11_n == null)
					break;
			}
		}
		struct Eq_n * sp_n;
		sp_n->ptr000C = r11_n;
		struct Eq_n ** r2_n = ap_n->ptr001C;
		if (*r2_n > r11_n)
			*r2_n = (struct Eq_n **) r11_n;
		sp_n->t0004.u0 = (int32) __ashift<word32,word32>(0x01, r10_n);
		while (r10_n < r11_n)
		{
			Eq_n v32_n = sp_n->t0004.u0 - (fp_n->aFFFFFFB8)[r10_n];
			sp_n->t0004.u0 = (int32) v32_n;
			if (v32_n < 0x00)
			{
				struct Eq_n * fp_n = fp_n->ptr000C;
				word32 ap_n = fp_n->dw0008;
				r3Out = r3_n;
				r5Out = r5_n;
				apOut = ap_n;
				fpOut = fp_n;
				return 0x02;
			}
			sp_n->t0004.u0 = (int32) (sp_n->t0004.u0 << 1);
			r10_n = (struct Eq_n *) ((char *) &r10_n->t0000 + 1);
		}
		Eq_n v33_n = sp_n->t0004.u0 - (fp_n->aFFFFFFB8)[r11_n];
		sp_n->t0004.u0 = (int32) v33_n;
		if (v33_n >= 0x00)
		{
			fp_n->aFFFFFFB8[r11_n] = (word32) (fp_n->aFFFFFFB8[0] + (sp_n->t0004).u0);
			fp_n->dwFFFFFA74 = 0x00;
			word32 r10_n = 0x00;
			word32 * r2_n = (word32 *) (fp_n->aFFFFFFB8 + 1);
			word32 * r5_n = (word32 *) (&fp_n->dwFFFFFA74 + 1);
			uint32 r11_n;
			for (r11_n = r11_n - 0x01; r11_n != 0x00; --r11_n)
			{
				r10_n += *r2_n;
				*r5_n = r10_n;
				++r2_n;
				++r5_n;
			}
			sp_n->dwFFFFFFFC = 0x0480;
			sp_n->dwFFFFFFF8 = 0x00;
			sp_n->ptrFFFFFFF4 = &fp_n->dwFFFFFA74 + 16;
			(*((word32) g_ptr1927C + 2))();
			word32 * r2_n = ap_n->ptr0004;
			up32 r11_n = 0x00;
			Eq_n r3_n;
			struct Eq_n * fp_n;
			do
			{
				++r2_n;
				ui32 r10_n = *r2_n;
				if (r10_n != 0x00)
				{
					r3_n.u0 = fp_n->aFFFFFA70[r10_n].t0000.u0;
					fp_n->aFFFFFA70[r10_n].t0000.u0 = (ui32) (fp_n->aFFFFFA70[0].t0000.u0 + 0x01);
					fp_n->aFFFFFAB4[r3_n].u0 = r11_n;
				}
				++r11_n;
			} while (r11_n < ap_n->dw0008);
			struct Eq_n * sp_n;
			sp_n[2] = (struct Eq_n) &ap_n->dw0008;
			*((word32) sp_n[2].dwFFFFFFFC + 4) = (struct Eq_n) fp_n->aFFFFFA70[sp_n[3]].t0000.u0;
			fp_n->aFFFFFA70[0].t0000.u0 = 0x00;
			sp_n[0x0C] = (struct Eq_n) -1;
			*sp_n[9].dwFFFFFFFC = (struct Eq_n) 0x00;
			fp_n->aFFFFFF34[0] = 0x00;
			sp_n[11] = (struct Eq_n) 0x00;
			Eq_n r8_n[] = (Eq_n (*)[]) fp_n->aFFFFFAB4;
			int32 r6_n = 0x00;
			int32 r9_n;
			word32 r5_n;
			if (r9_n <= sp_n[3])
			{
				sp_n[0x0A] = (struct Eq_n) &ap_n->ptr001C;
				sp_n[6] = (struct Eq_n) g_ptr192B4;
				do
				{
					sp_n[4] = (struct Eq_n) fp_n->aFFFFFFB8[r9_n];
					word32 r2_n = (word32) sp_n[4];
					sp_n[4] = (struct Eq_n) (sp_n[4] - 0x01);
					if (r2_n != 0x00)
					{
						if (r9_n > *((word32) (sp_n)[9].dwFFFFFFFC + (sp_n[0x0C] * 4 + 4)))
						{
							sp_n[8] = (struct Eq_n) ((word32) sp_n[4].dwFFFFFFFC + 5);
							do
							{
								ui32 r2_n = (ui32) sp_n[0x0C];
								sp_n[0x0C] = (struct Eq_n) ((word32) sp_n[0x0C].dwFFFFFFFC + 5);
								Eq_n r6_n = (word32) ((word32) sp_n[9].dwFFFFFFFC + (r2_n * 4 + 4))->dwFFFFFFFC + (r6_n + 4);
								sp_n[11] = (struct Eq_n) (sp_n[3] - r6_n);
								up32 ** r3_n = (up32 **) sp_n[0x0A];
								up32 r4_n;
								if (sp_n[11] > *(*r3_n))
									r4_n = **r3_n;
								else
									r4_n = (up32) sp_n[11];
								sp_n[11] = (struct Eq_n) r4_n;
								struct Eq_n * r10_n = r9_n - r6_n;
								sp_n[0x0D] = (struct Eq_n) __ashift<word32,word32>(0x01, r10_n);
								if (sp_n[0x0D] > sp_n[8])
								{
									sp_n[0x0D] = (struct Eq_n) (sp_n[0x0D] - ((word32) (sp_n)[4].dwFFFFFFFC + 5));
									up32 * r3_n = fp_n->aFFFFFFB8 + r9_n;
									r10_n = (struct Eq_n *) ((char *) &r10_n->t0000 + 1);
									if ((char *) &r10_n->t0000 + 1 < sp_n[11])
									{
										do
										{
											sp_n[0x0D] = (struct Eq_n) (sp_n[0x0D] << 1);
											++r3_n;
											if (sp_n[0x0D] <= *r3_n)
												break;
											sp_n[0x0D] = (struct Eq_n) (sp_n[0x0D] - *r3_n);
											r10_n = (struct Eq_n *) ((char *) &r10_n->t0000 + 1);
										} while (r10_n < sp_n[11]);
									}
								}
								if (r6_n + r10_n > sp_n[7] && r6_n < sp_n[7])
									r10_n = sp_n[7] - r6_n;
								sp_n[11] = (struct Eq_n) __ashift<word32,word32>(0x01, r10_n);
								*((word32) sp_n[9].dwFFFFFFFC + (sp_n[0x0C] * 4 + 4)) = (struct Eq_n) r10_n;
								uint32 r2_n = (word32) sp_n[11].dwFFFFFFFC + 5;
								struct Eq_n * sp_n = sp_n - 0x04;
								sp_n->dw0000 = r2_n * 0x06;
								(*((word32) sp_n->ptr001C + 2))();
								word32 r0_n;
								if (r0_n == 0x00)
								{
									Eq_n r3_n;
									if (sp_n[0x0C] != 0x00)
									{
										Eq_n r4_n;
										r4_n.u0 = fp_n->aFFFFFF34[0];
										Eq_n r2_n = r4_n;
										if (r4_n != 0x00)
										{
											do
											{
												Eq_n r2_n = r2_n - 0x06;
												word32 r3_n = r2_n.u0->dw0002;
												sp_n->dwFFFFFFFC = (word32) r2_n;
												(*((word32) g_ptr192B0 + 2))();
												r2_n = r3_n;
											} while (r3_n != 0x00);
										}
									}
									struct Eq_n * sp_n = fp_n - 0x04;
									struct Eq_n * fp_n = sp_n->ptr0010;
									word32 ap_n = sp_n->dw000C;
									r3Out = r3_n;
									r5Out = r5_n;
									apOut = ap_n;
									fpOut = fp_n;
									return 0x03;
								}
								g_dw7BE9 = (word32) sp_n[11].dwFFFFFFFC + 5 + g_dw7BE9;
								*ap_n->ptr0018 = r0_n + 0x06;
								ap_n->ptr0018 = r0_n + 2;
								*ap_n->ptr0018 = 0x00;
								ui32 r2_n = (ui32) sp_n[0x0C];
								fp_n->aFFFFFF34[r2_n] = r0_n + 0x06;
								if (r2_n != 0x00)
								{
									Eq_n r11_n;
									fp_n->aFFFFFA70[r2_n].t0000.u0 = (ui32) r11_n;
									fp_n->bFFFFFA6B = (int8) *((word32) sp_n[9].dwFFFFFFFC + ((sp_n[0x0C] - 0x01) * 4 + 4));
									word32 r10_n;
									fp_n->bFFFFFA6A = (int8) (r10_n + 0x10);
									fp_n->tFFFFFA6C.u0 = (uint32) (r0_n + 0x06);
								}
							} while (r9_n > (word32) ((word32) (sp_n)[9].dwFFFFFFFC + (sp_n[0x0C] * 4 + 4))->dwFFFFFFFC + (r6_n + 4));
						}
						fp_n->bFFFFFA6B = (int8) (r9_n - r6_n);
						if (r8_n >= fp_n->aFFFFFAB4 + *((word32) (sp_n)[2].dwFFFFFFFC + 4))
							fp_n->bFFFFFA6A = 99;
						else
						{
							Eq_n r4_n;
							r4_n.u0 = r8_n[0].u0;
							Eq_n r0_n;
							r0_n.u0 = ap_n->t000C.u0;
							if (r4_n < r0_n)
							{
								uip32 r5_n;
								if (r4_n < 0x0100)
									r5_n = SEQ(SLICE(r5_n, word24, 8), 0x10);
								else
									r5_n = SEQ(SLICE(r5_n, word24, 8), 0x0F);
								fp_n->bFFFFFA6A = (byte) r5_n;
								fp_n->tFFFFFA6C.u1 = r8_n[0].u1;
							}
							else
							{
								fp_n->bFFFFFA6A = ap_n->ptr0014[r4_n - r0_n].b0000;
								fp_n->tFFFFFA6C.u1 = ap_n->ptr0010[r8_n[0].u0 - r0_n].t0000.u1;
							}
						}
						sp_n[0x0D] = (struct Eq_n) __ashift<word32,word32>(0x01, r9_n - r6_n);
					}
					++r9_n;
				} while (r9_n <= sp_n[3]);
			}
			*ap_n->ptr001C = (word32) *((word32) sp_n[9].dwFFFFFFFC + 4);
			word24 v61_n = SLICE(r3_n, word24, 8);
			Eq_n r3_n = SEQ(v61_n, 0x00);
			if (sp_n[1] != 0x00 && sp_n[3] != 0x01)
				r3_n = SEQ(v61_n, 0x01);
			struct Eq_n * fp_n = fp_n->ptr000C;
			word32 ap_n = fp_n->dw0008;
			r3Out = r3_n;
			r5Out = r5_n;
			apOut = ap_n;
			fpOut = fp_n;
			return (int32) (int8) r3_n;
		}
		else
		{
			struct Eq_n * fp_n = fp_n->ptr000C;
			word32 ap_n = fp_n->dw0008;
			r3Out = r3_n;
			r5Out = r5_n;
			apOut = ap_n;
			fpOut = fp_n;
			return 0x02;
		}
	}
	else
	{
		*ap_n->ptr0018 = 0x00;
		*ap_n->ptr001C = (struct Eq_n **) null;
		struct Eq_n * fp_n = fp_n->ptr000C;
		word32 ap_n = fp_n->dw0008;
		r3Out = r3_n;
		r5Out = r5_n;
		apOut = ap_n;
		fpOut = fp_n;
		return 0x00;
	}
}

// 00018BF6: void fn00018BF6(Register (ptr32 Eq_n) ap)
// Called from:
//      fn000167AA
void fn00018BF6(struct Eq_n * ap)
{
	ptr32 fp;
	struct Eq_n * sp_n = fp - 0x04;
	word32 r2_n = ap->dw0004;
	if (r2_n != 0x00)
	{
		word32 r3_n;
		do
		{
			struct Eq_n * r2_n = r2_n - 0x06;
			word32 r3_n = r2_n->dw0002;
			sp_n->ptrFFFFFFFC = r2_n;
			(*((word32) g_ptr192B0 + 2))();
			r2_n = r3_n;
		} while (r3_n != 0x00);
	}
}

// 00018C3A: Register uip32 fn00018C3A(Register uip32 r3, Register (ptr32 Eq_n) r5, Register ptr32 r6, Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register out uip32 r3Out, Register out (ptr32 Eq_n) r5Out, Register out ptr32 r6Out, Register out (ptr32 Eq_n) apOut, Register out (ptr32 Eq_n) fpOut)
// Called from:
//      fn00018C3A
uip32 fn00018C3A(uip32 r3, struct Eq_n * r5, ptr32 r6, struct Eq_n * ap, struct Eq_n * fp, uip32 & r3Out, struct Eq_n & r5Out, ptr32 & r6Out, struct Eq_n & apOut, struct Eq_n & fpOut)
{
	int32 r0_n;
	word32 r1_n;
	ui32 r10_n[] = g_ptr1934C;
	struct Eq_n * r2_n = ap->ptr0004;
	++ap->ptr0004;
	struct Eq_n * sp_n = fp - 0x04;
	uint32 r4_n = (uint32) r2_n->b0000;
	switch (r4_n)
	{
	case 0x00:
		uip32 r3_n = 0x00;
		if ((uint32) *ap->ptr0008 == 0x00)
			r3_n = 0x01;
		struct Eq_n * fp_n = fp->ptr000C;
		struct Eq_n * ap_n = fp->ptr0008;
		r3Out = r3_n;
		r5Out = r5;
		r6Out = r6;
		apOut = ap_n;
		fpOut = fp_n;
		return r3_n;
	case 0x3F:
		uip32 r2_n;
		if (*ap->ptr0008 != 0x00)
		{
			word32 ap_n;
			r2_n = fn00018C3A(r3, r5, r6, ap, fp, out r3, out r5, out r6, out ap_n, out fp);
		}
		else
			r2_n = 0x00;
		struct Eq_n * sp_n = fp - 0x04;
		struct Eq_n * fp_n = sp_n->ptr0010;
		struct Eq_n * ap_n = sp_n->ptr000C;
		r3Out = r3;
		r5Out = r5;
		r6Out = r6;
		apOut = ap_n;
		fpOut = fp_n;
		return r2_n;
	case 0x2A:
		if ((uint32) ap->ptr0004->b0000 != 0x00)
		{
			while (*ap->ptr0008 != 0x00)
			{
				struct Eq_n * sp_n = sp_n - 0x04;
				sp_n->dw0000 = ap->dw000C;
				sp_n->ptrFFFFFFFC = ap->ptr0008;
				sp_n->ptrFFFFFFF8 = ap->ptr0004;
				uip32 r0_n = fn00018C3A(r3, r5, r6, ap, fp, out r3, out r5, out r6, out ap, out fp);
				sp_n = (struct Eq_n *) <invalid>;
				if (r0_n != 0x00)
				{
					struct Eq_n * fp_n = fp->ptr000C;
					struct Eq_n * ap_n = fp->ptr0008;
					r3Out = r3;
					r5Out = r5;
					r6Out = r6;
					apOut = ap_n;
					fpOut = fp_n;
					return r0_n;
				}
				++ap->ptr0008;
			}
			struct Eq_n * sp_n = fp - 0x04;
			struct Eq_n * fp_n = sp_n->ptr0010;
			struct Eq_n * ap_n = sp_n->ptr000C;
			r3Out = r3;
			r5Out = r5;
			r6Out = r6;
			apOut = ap_n;
			fpOut = fp_n;
			return 0x02;
		}
		else
		{
			struct Eq_n * fp_n = fp->ptr000C;
			struct Eq_n * ap_n = fp->ptr0008;
			r3Out = r3;
			r5Out = r5;
			r6Out = r6;
			apOut = ap_n;
			fpOut = fp_n;
			return 0x01;
		}
		break;
	case 0x5B:
		if ((uint32) *ap->ptr0008 != 0x00)
		{
			word24 v29_n = SLICE(r6, word24, 8);
			struct Eq_n * r5_n = ap->ptr0004;
			ptr32 r6_n = SEQ(v29_n, 0x01);
			uint32 r2_n = (uint32) r5_n->b0000;
			if (r2_n != 33 && r2_n != 0x5E)
				r6_n = SEQ(v29_n, 0x00);
			int32 r8_n = (int32) (int8) r6_n;
			ap->ptr0004 = r5_n + r8_n;
			struct Eq_n * r7_n = ap->ptr0004;
			uip32 r3_n = 0x00;
			while (r7_n->b0000 != 0x00)
			{
				if (r3_n != 0x00)
					r3_n = 0x00;
				else
				{
					uint32 r2_n = (uint32) r7_n->b0000;
					if (r2_n == 0x5C)
						r3_n = 0x01;
					else if (r2_n == 0x5D)
						break;
				}
				++r7_n;
			}
			if ((uint32) r7_n->b0000 == 0x5D)
			{
				struct Eq_n * r5_n = ap->ptr0004;
				struct Eq_n * r4_n = null;
				uip32 r3_n = 0x00;
				if ((uint32) r5_n->b0000 == 0x2D)
					r3_n = 0x01;
				uip32 r9_n = r3_n;
				if (r5_n < r7_n)
				{
					word32 * r11_n = &ap->dw000C;
					r6_n = g_ptr19298;
					do
					{
						if (r9_n == 0x00 && (uint32) (ap->ptr0004)->b0000 == 0x5C)
						{
							r9_n = 0x01;
							goto l00018E4F;
						}
						if (r9_n == 0x00)
						{
							struct Eq_n * r0_n = ap->ptr0004;
							if ((uint32) r0_n->b0000 != 0x2D)
								goto l00018D94;
							r4_n = (uint32) r0_n->bFFFFFFFF;
						}
						else
						{
l00018D94:
							struct Eq_n * r1;
							if (*r11_n != 0x00)
							{
								Eq_n r3_n;
								r3_n.u1 = (uint32) *ap->ptr0008;
								uip32 r1_n;
								if ((r10_n[r3_n & 0x7F] & 0x01) != 0x00)
								{
									sp_n->dwFFFFFFFC = (int32) (int8) r3_n;
									(*((word32) r6_n + 2))();
									uip32 r1_n = SEQ(SLICE(r1_n, word24, 8), (int8) r0_n);
									r1_n = r1_n;
									Eq_n r3_n;
									r3_n = r3_n;
									word32 * r11_n;
									r11_n = r11_n;
									int32 r8_n;
									r8_n = r8_n;
									struct Eq_n * r7_n;
									r7_n = r7_n;
									struct Eq_n * fp_n;
									fp = fp_n;
								}
								else
									r1_n = SEQ(SLICE(r1, word24, 8), (int8) r3_n);
								r3_n = SEQ(SLICE(r3_n, word24, 8), (byte) r1_n);
							}
							else
								r3_n = SEQ(SLICE(r3_n, word24, 8), *ap->ptr0008);
							r1 = ap->ptr0004;
							r5_n = (uint32) (byte) r3_n;
							if ((uint32) r1[1] != 0x2D)
							{
								struct Eq_n * r0_n;
								if (r4_n != null)
									r0_n = r4_n;
								else
									r0_n = (uint32) r1->b0000;
								struct Eq_n * r4_n = r0_n;
								struct Eq_n * r2_n = (uint32) r1->b0000;
								if (r0_n <= r2_n)
								{
									r3_n = *r11_n;
									do
									{
										if (r3_n != 0x00)
										{
											if ((r10_n[r4_n & 0x7F] & 0x01) != 0x00)
											{
												sp_n->dwFFFFFFFC = (int32) (int8) r4_n;
												(*((word32) r6_n + 2))();
												word32 r2_n;
												int32 r0_n;
												r2_n = SEQ(SLICE(r2_n, word24, 8), (int8) r0_n);
												struct Eq_n * r5_n;
												r5_n = r5_n;
												int32 r8_n;
												r8_n = r8_n;
												struct Eq_n * r7_n;
												r7_n = r7_n;
												struct Eq_n * fp_n;
												fp = fp_n;
												word32 * r11_n;
												r11_n = r11_n;
												uip32 r3_n;
												r3_n = r3_n;
											}
											else
												r2_n = SEQ(SLICE(r2_n, word24, 8), (int8) r4_n);
											r1 = (int32) (int8) r2_n;
										}
										else
											r1 = r4_n;
										if (r1 == r5_n)
										{
											uip32 r2_n;
											if (r8_n != 0x00)
												r2_n = 0x00;
											else
											{
												struct Eq_n * sp_n = sp_n - 0x04;
												sp_n->dw0000 = ap->dw000C;
												sp_n->ptrFFFFFFFC = ap->ptr0008 + 1;
												sp_n->ptrFFFFFFF8 = r7_n + 1;
												word32 ap_n;
												r2_n = fn00018C3A(r3_n, r5_n, r6_n, ap, fp, out r3_n, out r5_n, out r6_n, out ap_n, out fp);
											}
											struct Eq_n * sp_n = fp - 0x04;
											struct Eq_n * fp_n = sp_n->ptr0010;
											struct Eq_n * ap_n = sp_n->ptr000C;
											r3Out = r3_n;
											r5Out = r5_n;
											r6Out = r6_n;
											apOut = ap_n;
											fpOut = fp_n;
											return r2_n;
										}
										++r4_n;
									} while (r4_n <= (uint32) (ap->ptr0004)->b0000);
								}
							}
							r9_n = 0x00;
							r4_n = null;
						}
l00018E4F:
						++ap->ptr0004;
					} while (ap->ptr0004 < r7_n);
				}
				uip32 r2_n;
				if (r8_n != 0x00)
				{
					struct Eq_n * sp_n = sp_n - 0x04;
					sp_n->dw0000 = ap->dw000C;
					sp_n->ptrFFFFFFFC = ap->ptr0008 + 1;
					sp_n->ptrFFFFFFF8 = r7_n + 1;
					word32 ap_n;
					r2_n = fn00018C3A(r3_n, r5_n, r6_n, ap, fp, out r3_n, out r5_n, out r6_n, out ap_n, out fp);
				}
				else
					r2_n = 0x00;
				struct Eq_n * sp_n = fp - 0x04;
				struct Eq_n * fp_n = sp_n->ptr0010;
				struct Eq_n * ap_n = sp_n->ptr000C;
				r3Out = r3_n;
				r5Out = r5_n;
				r6Out = r6_n;
				apOut = ap_n;
				fpOut = fp_n;
				return r2_n;
			}
			else
			{
				struct Eq_n * fp_n = fp->ptr000C;
				struct Eq_n * ap_n = fp->ptr0008;
				r3Out = r3_n;
				r5Out = r5_n;
				r6Out = r6_n;
				apOut = ap_n;
				fpOut = fp_n;
				return 0x00;
			}
		}
		else
		{
			struct Eq_n * fp_n = fp->ptr000C;
			struct Eq_n * ap_n = fp->ptr0008;
			r3Out = r3;
			r5Out = r5;
			r6Out = r6;
			apOut = ap_n;
			fpOut = fp_n;
			return 0x00;
		}
		break;
	default:
		if (r4_n == 0x5C)
		{
			struct Eq_n * r2_n = ap->ptr0004;
			++ap->ptr0004;
			r4_n = (uint32) r2_n->b0000;
			if (r4_n == 0x00)
			{
				struct Eq_n * fp_n = fp->ptr000C;
				struct Eq_n * ap_n = fp->ptr0008;
				r3Out = r3;
				r5Out = r5;
				r6Out = r6;
				apOut = ap_n;
				fpOut = fp_n;
				return 0x00;
			}
		}
		struct Eq_n * r5_n;
		if (ap->dw000C != 0x00)
		{
			Eq_n r5_n;
			r5_n.u1 = (uint32) (byte) r4_n;
			if ((r10_n[r5_n & 0x7F] & 0x01) != 0x00)
			{
				(*((word32) g_ptr19298 + 2))();
				word32 r3_n;
				int32 r0_n;
				r3 = SEQ(SLICE(r3_n, word24, 8), (int8) r0_n);
			}
			else
				r3 = SEQ(SLICE(r3, word24, 8), (int8) r5_n);
			r5_n = SEQ(SLICE(r5_n, word24, 8), (byte) r3);
		}
		else
			r5_n = SEQ(SLICE(r5, word24, 8), (byte) r4_n);
		uip32 r4_n;
		if (ap->dw000C != 0x00)
		{
			Eq_n r4_n;
			r4_n.u1 = (uint32) *ap->ptr0008;
			if ((r10_n[r4_n & 0x7F] & 0x01) != 0x00)
			{
				sp_n->dwFFFFFFFC = (int32) (int8) r4_n;
				(*((word32) g_ptr19298 + 2))();
				word32 r3_n;
				int32 r0_n;
				r3 = SEQ(SLICE(r3_n, word24, 8), (int8) r0_n);
			}
			else
				r3 = SEQ(SLICE(r3, word24, 8), (int8) r4_n);
			r4_n = SEQ(SLICE(r4_n, word24, 8), (byte) r3);
		}
		else
			r4_n = SEQ(SLICE(r4_n, word24, 8), *ap->ptr0008);
		uip32 r2_n;
		if ((byte) r5_n == (byte) r4_n)
		{
			struct Eq_n * sp_n = sp_n - 0x04;
			sp_n->dw0000 = ap->dw000C;
			++ap->ptr0008;
			sp_n->ptrFFFFFFFC = ap->ptr0008;
			sp_n->ptrFFFFFFF8 = ap->ptr0004;
			word32 ap_n;
			r2_n = fn00018C3A(r3, r5_n, r6, ap, fp, out r3, out r5_n, out r6, out ap_n, out fp);
		}
		else
			r2_n = 0x00;
		struct Eq_n * sp_n = fp - 0x04;
		struct Eq_n * fp_n = sp_n->ptr0010;
		struct Eq_n * ap_n = sp_n->ptr000C;
		r3Out = r3;
		r5Out = r5_n;
		r6Out = r6;
		apOut = ap_n;
		fpOut = fp_n;
		return r2_n;
	}
}

// 00018F22: Register word32 fn00018F22(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register out word32 apOut, Register out word32 fpOut)
// Called from:
//      fn000108D2
//      fn00010E6A
word32 fn00018F22(struct Eq_n * ap, struct Eq_n * fp, word32 & apOut, word32 & fpOut)
{
	while (ap->ptr0004->b0000 != 0x00)
	{
		struct Eq_n * r0_n = ap->ptr0004;
		byte v12_n = r0_n->b0000;
		if (v12_n == 0x5C && r0_n->b0001 != 0x00)
			ap->ptr0004 = (struct Eq_n *) &r0_n->b0001;
		else if (v12_n == 0x25 || v12_n == 0x2A)
		{
			word32 fp_n = fp->dw000C;
			apOut = fp->dw0008;
			fpOut = fp_n;
			return 0x01;
		}
		ap->ptr0004 = (struct Eq_n *) &ap->ptr0004->b0001;
	}
	word32 fp_n = fp->dw000C;
	apOut = fp->dw0008;
	fpOut = fp_n;
	return 0x00;
}

// 00018F66: void fn00018F66()
// Called from:
//      fn00008EC2
//      fn00009746
//      fn000098B6
void fn00018F66()
{
}

// 00018FA9: void fn00018FA9()
// Called from:
//      fn00008EC2
//      fn00009746
void fn00018FA9()
{
}

// 0001902B: void fn0001902B()
// Called from:
//      fn00008EC2
void fn0001902B()
{
}

ptr32 g_ptr19248 = 0x040C; // 00019248
ptr32 g_ptr1924C = 0x6C; // 0001924C
ptr32 g_ptr19250 = 0x3C; // 00019250
word32 g_dw19258 = 0x84; // 00019258
ptr32 g_ptr19260 = 636; // 00019260
ptr32 g_ptr19268 = 116; // 00019268
ptr32 g_ptr1926C = 0xEC; // 0001926C
ptr32 g_ptr19270 = 292; // 00019270
ptr32 g_ptr19274 = 244; // 00019274
ptr32 g_ptr1927C = 0x06E4; // 0001927C
ptr32 g_ptr19280 = 0x0434; // 00019280
ptr32 g_ptr19284 = 0x062C; // 00019284
ptr32 g_ptr1928C = 0x01CC; // 0001928C
ptr32 g_ptr19290 = 100; // 00019290
ptr32 g_ptr19294 = 0x4C; // 00019294
ptr32 g_ptr19298 = 772; // 00019298
ptr32 g_ptr1929C = 0x06D4; // 0001929C
ptr32 g_ptr192A0 = 588; // 000192A0
ptr32 g_ptr192A4 = 0x021C; // 000192A4
ptr32 g_ptr192A8 = 0x0464; // 000192A8
ptr32 g_ptr192AC = 996; // 000192AC
ptr32 g_ptr192B0 = 1012; // 000192B0
ptr32 g_ptr192B4 = 1020; // 000192B4
ptr32 g_ptr192BC = 0x028C; // 000192BC
ptr32 g_ptr192C0 = 0x02B4; // 000192C0
ptr32 g_ptr192C4 = 668; // 000192C4
ptr32 g_ptr192CC = 484; // 000192CC
ptr32 g_ptr192D0 = 0x0144; // 000192D0
ptr32 g_ptr192D4 = 644; // 000192D4
ptr32 g_ptr192D8 = 0x02AC; // 000192D8
ptr32 g_ptr192DC = 0x02C4; // 000192DC
ptr32 g_ptr192E0 = 0x0444; // 000192E0
ptr32 g_ptr192E4 = 220; // 000192E4
word32 g_dw192F0 = 0x2000; // 000192F0
word32 g_dw192F4 = 0x1E00; // 000192F4
word32 g_dw192F8 = 0x1C00; // 000192F8
word32 g_dw192FC = 6656; // 000192FC
word32 g_dw19300 = 0x1800; // 00019300
word32 g_dw19304 = 0x1600; // 00019304
word32 g_dw1930C = 0x1000; // 0001930C
ptr32 g_ptr1932C = 0x0908; // 0001932C
ptr32 g_ptr19330 = 0x03C0; // 00019330
ui32 (* g_ptr1934C)[] = &g_a0974; // 0001934C
byte * g_ptr19354 = &g_b1001; // 00019354
byte * g_ptr19358 = &g_b1601; // 00019358
byte * g_ptr1935C = &g_b1C01; // 0001935C
byte * g_ptr19360 = &g_b1A01; // 00019360
byte * g_ptr19364 = &g_b1801; // 00019364
byte * g_ptr19368 = &g_b2001; // 00019368
byte * g_ptr1936C = &g_b1E01; // 0001936C
word32 g_dw19370 = 0x0A20; // 00019370
word32 * g_ptr19374 = &g_dw0A38; // 00019374
