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

#include "unzip.h"

byte g_b1001 = 0x00; // 00001001
byte g_b1601 = 77; // 00001601
byte g_b1801 = 0x00; // 00001801
byte g_b1A01 = 0x00; // 00001A01
byte g_b1C01 = 0x69; // 00001C01
byte g_b1E01 = 114; // 00001E01
byte g_b2001 = 116; // 00002001
word32 g_dw79BF = 0x000CB001; // 000079BF
word32 g_dw79C7 = 0x000CFF01; // 000079C7
int32 g_dw79CB = 0x0E001000; // 000079CB
word64 g_qw79CF = 0xE000700000CBC01; // 000079CF
word32 g_dw79D7 = 0x000D5F01; // 000079D7
word32 g_dw79E3 = 0x0E000700; // 000079E3
int32 g_dw79EB = 0x0E000700; // 000079EB
word32 g_dw79F7 = 0x000D0501; // 000079F7
word16 g_w7A10 = 3525; // 00007A10
word16 g_w7A26 = 0x010E; // 00007A26
word16 g_w7A2E = 0x010E; // 00007A2E
word32 g_dw7A4E = 0x0D0A010E; // 00007A4E
word16 g_w7A58 = 0x0DAE; // 00007A58
<unknown> g_t7A64 = // 00007A64;
word32 g_dw7A95 = 0x26010E00; // 00007A95
up32 g_dw7A9D = 0x70010E00; // 00007A9D
word32 g_dw7AA1 = 0x0800000C; // 00007AA1
word32 g_dw7AA9 = 0x0900000C; // 00007AA9
word32 g_dw7ABD = 2667646464; // 00007ABD
word32 g_dw7BD9 = 0x00; // 00007BD9
word32 g_dw7BDD = 0x00; // 00007BDD
word32 g_dw7BE1 = 0x00; // 00007BE1
up32 g_dw7BE9 = 0x00; // 00007BE9
word32 g_dw7BED = 0x00; // 00007BED
word32 g_dw7BF1 = 0x00; // 00007BF1
word32 g_dw7BF5 = 0x00; // 00007BF5
word32 g_dw7BFD = 0x00; // 00007BFD
Eq_n g_t7C01 = // 00007C01
	{
		0x00
	};
struct Eq_n * g_ptr7C05 = null; // 00007C05
ptr32 g_ptr7C09 = 0x00; // 00007C09
int32 g_dw7C19 = 0; // 00007C19
int32 g_dw7C1D = 0; // 00007C1D
byte g_a7C24[] = // 00007C24
	{
	};
<unknown> g_t7D48 = // 00007D48;
<unknown> g_t7ED0 = // 00007ED0;
<unknown> g_t7EE0 = // 00007EE0;
// 0000802E: void fn0000802E()
void fn0000802E()
{
	struct Eq_n * fp_n;
	struct Eq_n * ap_n;
	word32 fp_n;
	struct Eq_n * ap_n;
	ptr32 r3_n = g_ptr192E0;
	(*((word32) r3_n + 2))();
	struct Eq_n * sp_n;
	word32 r4_n;
	sp_n->dwFFFFFFFC = r4_n;
	sp_n->dwFFFFFFF8 = 0x0F;
	ptr32 r3_n;
	(*((word32) r3_n + 2))();
	struct Eq_n * sp_n;
	word32 r4_n;
	sp_n->dwFFFFFFFC = r4_n;
	sp_n->dwFFFFFFF8 = 0x0A;
	ptr32 r3_n;
	(*((word32) r3_n + 2))();
	struct Eq_n * sp_n;
	word32 r4_n;
	sp_n->dwFFFFFFFC = r4_n;
	sp_n->dwFFFFFFF8 = 11;
	ptr32 r3_n;
	(*((word32) r3_n + 2))();
	word32 r3_n = 0x00;
	struct Eq_n * ap_n;
	if (ap_n->dw0004 == 0x01)
		r3_n = 0x01;
	struct Eq_n * r2_n;
	r2_n->dw0060 = r3_n;
	struct Eq_n * sp_n;
	sp_n->ptrFFFFFFFC = &ap_n->ptr0008;
	sp_n->ptrFFFFFFF8 = &ap_n->dw0004;
	struct Eq_n * fp_n;
	fn00008EC2(fp_n);
	ui32 r0_n;
	if ((r0_n & 0x01) == 0x00)
		return;
	sp_n->dwFFFFFFF4 = 0x5D;
	sp_n->dwFFFFFFF0 = *ap_n->ptr0008;
	(*((word32) g_ptr192DC + 2))();
	word32 r0_n;
	word32 r4_n;
	struct Eq_n * ap_n;
	if (r0_n == 0x00)
		r4_n = (word32) *ap_n->t0008.u0;
	else
		r4_n = r0_n + 0x01;
	struct Eq_n * sp_n;
	sp_n->dwFFFFFFFC = 0x07;
	sp_n->ptrFFFFFFF8 = &g_t7EE0;
	sp_n->dwFFFFFFF4 = r4_n;
	struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
	struct Eq_n * fp_n;
	int32 * r2_n;
	ptr32 r4_n;
	word32 r5_n;
	word32 r6_n;
	byte * r7_n;
	struct Eq_n * ap_n;
	struct Eq_n * fp_n;
	struct Eq_n * sp_n;
	word32 r3_n;
	struct Eq_n * r2_n;
	word32 r7_n;
	struct Eq_n * ap_n;
	if (fn0000E2EA(ap_n, fp_n, out r2_n, out r4_n, out r5_n, out r6_n, out r7_n, out ap_n, out fp_n) == 0x00)
	{
l000080FD:
		*r2_n = 0x01;
		struct Eq_n * sp_n = sp_n - 0x04;
		sp_n->dw0000 = r5_n + 33;
		sp_n->dwFFFFFFFC = r5_n + 20;
		sp_n->dwFFFFFFF8 = &ap_n->t0008.u0;
		sp_n->dwFFFFFFF4 = &ap_n->ptr0004;
		int8 * r0_n = fn0000D0D6(ap_n, out ap_n, out fp_n);
		struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
		sp_n->dwFFFFFFFC = &ap_n->t0008.u0;
		sp_n->dwFFFFFFF8 = &ap_n->ptr0004;
		sp_n = (struct Eq_n *) <invalid>;
		word32 fp_n;
		r3_n = fn00012702(r0_n, ap_n, out r2_n, out r7_n, out ap_n, out fp_n);
		goto l0000814C;
	}
	else
	{
		sp_n->dwFFFFFFFC = (struct Eq_n *) 0x02;
		sp_n->dwFFFFFFF8 = r7_n;
		sp_n->dwFFFFFFF4 = r4_n;
		sp_n = (struct Eq_n *) <invalid>;
		word32 r4_n;
		word32 r6_n;
		word32 r7_n;
		word32 fp_n;
		if (fn0000E2EA(ap_n, fp_n, out r2_n, out r4_n, out r5_n, out r6_n, out r7_n, out ap_n, out fp_n) == 0x00)
			goto l000080FD;
		if (ap_n->ptr0004 > (byte *) 0x01)
		{
			sp_n->dwFFFFFFFC = (struct Eq_n *) 0x02;
			sp_n->dwFFFFFFF8 = r7_n + 3;
			Eq_n r3_n;
			r3_n.u0 = ap_n->t0008.u0;
			sp_n->dwFFFFFFF4 = (word32) r3_n.u1[1];
			(*((word32) g_ptr192D8 + 2))();
			word32 r0_n;
			if (r0_n == 0x00)
				goto l000080FD;
		}
		*r2_n = 0x00;
		struct Eq_n * sp_n = sp_n - 0x04;
		sp_n->dw0000 = r5_n + 11;
		sp_n->dwFFFFFFFC = r5_n;
		sp_n->ptrFFFFFFF8 = &ap_n->t0008.u0;
		sp_n->ptrFFFFFFF4 = &ap_n->ptr0004;
		int8 * r0_n = fn0000D0D6(ap_n, out ap_n, out fp_n);
		struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
		sp_n->dwFFFFFFFC = &ap_n->t0008.u0;
		sp_n->dwFFFFFFF8 = &ap_n->ptr0004;
		sp_n = (struct Eq_n *) <invalid>;
		word32 fp_n;
		r3_n = fn00008322(r0_n, ap_n, fp_n, out r2_n, out r7_n, out ap_n, out fp_n);
l0000814C:
		if (ap_n->dw0004 < 0x00 || r3_n != 0x00)
			return;
		Eq_n r3_n;
		r3_n.u0 = ap_n->t0008.u0;
		ap_n->t0008.u0 += 4;
		r2_n->dwC60F = r3_n.u1->dw0000;
		r2_n->dw0064 = ap_n->dw0004;
		r2_n->dw0068 = 0x00;
		if (ap_n->dw0004 <= 0x00)
			r2_n->dw006C = 0x01;
		else
		{
			struct Eq_n * r4_n = ap_n->t0008.u0 - 0x04;
			r2_n->dw006C = 0x00;
			r2_n->t0090.u0 = ap_n->t0008.u0;
			word32 r9_n = 0x00;
			Eq_n r3_n;
			r3_n.u0 = &r4_n->dw0004;
			if (r4_n->dw0004 != 0x00)
			{
				do
				{
					if (r2_n->dw0014 != 0x00)
					{
l000082B0:
						if (r9_n == 0x00)
						{
							struct Eq_n * sp_n = sp_n - 0x04;
							sp_n->dw0000 = r7_n + 9;
							sp_n->dwFFFFFFFC = r3_n.u1->dw0000;
							(*((word32) g_ptr192D4 + 2))();
							word32 r0_n;
							if (r0_n == 0x00)
							{
								r9_n = 0x01;
								if (r3_n == (r2_n->t0090).u0)
								{
									Eq_n r10_n;
									r2_n->t0090.u0 = (byte *) r10_n;
									r2_n->dw0064 = 0x00;
								}
								else
								{
									word32 r6_n;
									if (r6_n != 0x00)
									{
										r3_n.u1->dw0000 = 0x00;
										r2_n->dw0064 = (r3_n - (r2_n->t0090).u0) / 0x04;
									}
								}
								r2_n->ptr0094 = (struct Eq_n *) (r3_n.u1 + 1);
								struct Eq_n * ap_n;
								r2_n->dw0068 = ap_n->dw0004 - (r2_n->ptr0094 - ap_n->dw0008) / 0x04;
							}
						}
						goto l00008307;
					}
					struct Eq_n * sp_n = sp_n - 0x04;
					sp_n->dw0000 = 0x02;
					sp_n->dwFFFFFFFC = r7_n + 6;
					sp_n->dwFFFFFFF8 = r3_n.u1->dw0000;
					(*((word32) g_ptr192D8 + 2))();
					word32 r0_n;
					if (r0_n != 0x00)
						goto l000082B0;
					struct Eq_n * r4_n = r3_n.u1->dw0000;
					struct Eq_n * ap_n;
					r3_n != (ap_n->t0008).u0;
					r2_n->dw0014 = 0x01;
					word32 r6_n;
					if (r6_n != 0x00)
					{
						r3_n.u1->dw0000 = 0x00;
						r2_n->dw0064 = (r3_n - (r2_n->t0090).u0) / 0x04;
					}
					else if (r9_n != 0x00)
					{
						r3_n.u1->dw0000 = 0x00;
						r2_n->dw0068 = (r3_n - r2_n->ptr0094) / 0x04;
					}
					byte * r4_n;
					word32 r5_n;
					if (r4_n->b0002 != 0x00)
						r4_n = &r4_n->b0002;
					else
					{
						if (r3_n.u1[1] == 0x00)
						{
							sp_n->dwFFFFFFFC = (struct Eq_n *) 0x0401;
							sp_n->dwFFFFFFF8 = r5_n + 82;
							sp_n->dwFFFFFFF4 = (char *) &r2_n->ptr0094 + 0x0557;
							(*((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 r0_n = r2_n->ptrC839;
							(*((word32) r0_n + 2))();
							return;
						}
						r4_n = (byte *) r3_n.u1[1];
					}
					word32 r8_n;
					Eq_n r10_n;
					struct Eq_n * ap_n;
					if (r2_n->dw0074 != 0x00)
					{
						word32 r0_n = 0x00;
						if (r2_n->dw0018 == 0x00)
							r0_n = 0x01;
						r2_n->dw0070 = r0_n;
						sp_n->dwFFFFFFFC = null;
						sp_n->dwFFFFFFF8 = r4_n;
						sp_n = (struct Eq_n *) <invalid>;
						struct Eq_n * fp_n;
						word32 fp_n;
						if (fn0000C6FA(ap_n, fp_n, out r2_n, out r3_n, out r7_n, out r8_n, out r9_n, out r10_n, out ap_n, out fp_n) > (int8 *) 0x02)
							return;
					}
					else
					{
						sp_n->dwFFFFFFFC = (struct Eq_n *) 0x0401;
						sp_n->dwFFFFFFF8 = r5_n + 44;
						sp_n->dwFFFFFFF4 = (char *) &r2_n->ptr0094 + 0x0557;
						(*((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 r0_n = r2_n->ptrC839;
						(*((word32) r0_n + 2))();
					}
					if (r8_n != 0x00)
					{
						if (r3_n.u1[1] == 0x00)
						{
							r2_n->dw006C = 0x01;
							r2_n->t0090.u0 = (byte *) r10_n;
							r2_n->dw0064 = 0x00;
							break;
						}
						r2_n->t0090.u0 = r3_n + (struct Eq_n *) 0x04;
						r2_n->dw0064 = ap_n->dw0004 - ((r2_n->t0090).u0 - ap_n->dw0008) / 0x04;
					}
l00008307:
					++r3_n.u1;
				} while (r3_n.u1->dw0000 != 0x00);
			}
		}
		fn000108D2();
	}
}

// 00008322: Register (ptr32 int8) fn00008322(Register (ptr32 int8) r0, Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register out (ptr32 Eq_n) r2Out, Register out (ptr32 Eq_n) r7Out, Register out (ptr32 Eq_n) apOut, Register out word32 fpOut)
// Called from:
//      fn0000802E
int8 * fn00008322(int8 * r0, struct Eq_n * ap, struct Eq_n * fp, struct Eq_n & r2Out, struct Eq_n & r7Out, struct Eq_n & apOut, word32 & fpOut)
{
	word32 r10_n;
	word32 r9_n;
	word32 r3_n;
	struct Eq_n * fp_n;
	struct Eq_n * r7_n;
	struct Eq_n * r2_n;
	word32 fp_n;
	word32 ap_n;
	word32 fp_n;
	int32 r6_n = (int32) *ap->ptr0004;
	struct Eq_n * sp_n = fp - 0x04;
	struct Eq_n * r2_n = (struct Eq_n *) 4294947792;
	ptr32 r5_n = (<unknown>*) ~0x00019617;
	word32 r10_n = 0x00;
	word32 r9_n = 0x00;
	struct Eq_n * r7_n = (struct Eq_n *) *ap->t0008.u0;
	int32 r8_n = r6_n - 0x01;
	if (r6_n > 0x01)
	{
		++r7_n;
		if (*r7_n[1].ptr0000 == 0x2D)
		{
			do
			{
				r0 = r7_n->ptr0000 + 1;
				int8 * r3_n = r0 + 1;
				int32 r6_n = (int32) *r0;
				while (r6_n != 0x00)
				{
					if (r6_n < 0x2D)
					{
l00008878:
						r10_n = 0x01;
						goto l0000887B;
					}
					if (r6_n != 0x2D)
					{
						if (r6_n >= 0x43)
						{
							int32 v38_n = r6_n - 0x43;
							if (v38_n <= 55)
							{
								g_a8394[v38_n]();
								struct Eq_n * r2_n;
								r2Out = r2_n;
								struct Eq_n * r7_n;
								r7Out = r7_n;
								struct Eq_n * ap_n;
								apOut = ap_n;
								word32 fp_n;
								fpOut = fp_n;
								int8 * r0_n;
								return r0_n;
							}
						}
						goto l00008878;
					}
l0000887B:
					++r3_n;
					r6_n = (int32) *r3_n;
				}
				--r8_n;
				if (r8_n <= 0x00)
					break;
				++r7_n;
			} while (*r7_n->ptr0000 == 0x2D);
		}
	}
	if (*(int32 *) ~0x4C23 != 0x00 && *((word32 *) ~0x4BEB) != 0x00 || (*((int32 *) ~0x4C23) != 0x00 && *((word32 *) ~0x4BE3) != 0x00 || (*((word32 *) ~0x4BEB) != 0x00 && *((word32 *) ~0x4BE3) != 0x00 || *((word32 *) ~0x4C17) != 0x00 && *((word32 *) ~0x4BFB) != 0x00)))
	{
		(*((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))();
		r10_n = 0x01;
	}
	if (r2_n[1] > 0x02)
		r2_n[1] = (struct Eq_n) 0x02;
	if (r2_n[2] > 0x02)
		r2_n[2] = (struct Eq_n) 0x02;
	if (r2_n[0x0E] != 0x00 && r2_n[0x0D] != 0x00)
	{
		struct Eq_n * sp_n = sp_n - 0x04;
		sp_n->dw0000 = 0x0401;
		sp_n->ptrFFFFFFFC = r5_n + 418;
		sp_n->ptrFFFFFFF8 = (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 r3_n = r2_n->ptrC839;
		(*((word32) r3_n + 2))();
		r2_n[0x0E] = (struct Eq_n) 0x00;
	}
	if (r2_n[11] != 0x00)
	{
		sp_n->dwFFFFFFFC = 0x01;
		(*((word32) g_ptr192E4 + 2))();
		if (r0 == null)
			r2_n[11] = (struct Eq_n) 0x00;
	}
	int32 r8_n = r8_n - 0x01;
	if (r8_n == 0x00 || r10_n != 0x00)
	{
		*ap->ptr0004 = (byte) r8_n;
		*ap->t0008.u0 = (byte) r7_n;
		if (r2_n[20] >= 0x02 && r8_n == ~0x00)
		{
			if (r2_n[16] > 0x03)
			{
				struct Eq_n * sp_n = sp_n - 0x04;
				sp_n->dw0000 = 0x00;
				sp_n->dwFFFFFFFC = 0x0214;
				sp_n->ptrFFFFFFF8 = (<unknown>*) ~0x0001ABF3;
				sp_n->ptrFFFFFFF4 = (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 r3_n = r2_n->ptrC839;
				(*((word32) r3_n + 2))();
			}
			else
			{
				struct Eq_n * sp_n = sp_n - 0x04;
				sp_n->dw0000 = 0x00;
				sp_n->ptrFFFFFFFC = &g_t7ED0;
				sp_n->ptrFFFFFFF8 = (<unknown>*) 4294857744;
				sp_n->dwFFFFFFF4 = 0x02;
				sp_n->dwFFFFFFF0 = 0x03;
				sp_n->dwFFFFFFEC = 0x05;
				sp_n->ptrFFFFFFE8 = r5_n + 2005;
				sp_n->ptrFFFFFFE4 = (char *) &r2_n->ptr05E7 + 4;
				ptr32 r6_n = g_ptr192D0;
				(*((word32) r6_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 r3_n = r2_n->ptrC839;
				(*((word32) r3_n + 2))();
				struct Eq_n * sp_n;
				sp_n->dwFFFFFFFC = 0x00;
				word32 r5_n;
				sp_n->dwFFFFFFF8 = r5_n + 0x086C;
				word32 r2_n;
				sp_n->dwFFFFFFF4 = r2_n + 1515;
				ptr32 r6_n;
				(*((word32) r6_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 r3_n = r2_n->ptrC839;
				(*((word32) r3_n + 2))();
				word32 r2_n = fn0000CF42(fp_n, out ap_n);
				struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
				sp_n->dwFFFFFFFC = null;
				word32 r5_n;
				sp_n->dwFFFFFFF8 = r5_n + 1716;
				sp_n->dwFFFFFFF4 = r2_n + 1515;
				ptr32 r6_n;
				(*((word32) r6_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 r3_n = r2_n->ptrC839;
				(*((word32) r3_n + 2))();
				struct Eq_n * sp_n;
				sp_n->dwFFFFFFFC = 0x00;
				word32 r5_n;
				sp_n->dwFFFFFFF8 = r5_n + 1816;
				sp_n->dwFFFFFFF4 = r5_n + 0x06D8;
				word32 r2_n;
				sp_n->dwFFFFFFF0 = r2_n + 1515;
				ptr32 r6_n;
				(*((word32) r6_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 r3_n = r2_n->ptrC839;
				(*((word32) r3_n + 2))();
				struct Eq_n * sp_n;
				sp_n->dwFFFFFFFC = 0x00;
				word32 r5_n;
				sp_n->dwFFFFFFF8 = r5_n + 0x0755;
				sp_n->dwFFFFFFF4 = r5_n + 0x06D8;
				word32 r2_n;
				sp_n->dwFFFFFFF0 = r2_n + 1515;
				ptr32 r6_n;
				(*((word32) r6_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 r3_n = r2_n->ptrC839;
				(*((word32) r3_n + 2))();
				struct Eq_n * sp_n;
				sp_n->dwFFFFFFFC = 0x00;
				word32 r5_n;
				sp_n->dwFFFFFFF8 = r5_n + 0x0790;
				sp_n->dwFFFFFFF4 = r5_n + 0x06D8;
				word32 r2_n;
				sp_n->dwFFFFFFF0 = r2_n + 1515;
				ptr32 r6_n;
				(*((word32) r6_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 r3_n = r2_n->ptrC839;
				(*((word32) r3_n + 2))();
				struct Eq_n * sp_n;
				sp_n->dwFFFFFFFC = 0x00;
				word32 r5_n;
				sp_n->dwFFFFFFF8 = r5_n + 0x079A;
				sp_n->dwFFFFFFF4 = r5_n + 0x06D8;
				word32 r2_n;
				sp_n->dwFFFFFFF0 = r2_n + 1515;
				ptr32 r6_n;
				(*((word32) r6_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 r3_n = r2_n->ptrC839;
				(*((word32) r3_n + 2))();
				struct Eq_n * sp_n;
				sp_n->dwFFFFFFFC = 0x00;
				word32 r5_n;
				sp_n->dwFFFFFFF8 = r5_n + 0x07C7;
				sp_n->ptrFFFFFFF4 = (<unknown>*) ~0x0001ABEE;
				sp_n->dwFFFFFFF0 = 0x07;
				sp_n->dwFFFFFFEC = 0x02;
				sp_n->dwFFFFFFE8 = r5_n + 0x07A1;
				word32 r2_n;
				sp_n->dwFFFFFFE4 = r2_n + 1515;
				ptr32 r6_n;
				(*((word32) r6_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 r3_n = r2_n->ptrC839;
				(*((word32) r3_n + 2))();
				word32 r4_n;
				struct Eq_n * sp_n;
				word32 r5_n;
				word32 r2_n;
				if (r4_n == ~0x00)
				{
					sp_n->dwFFFFFFFC = 0x00;
					sp_n->dwFFFFFFF8 = r5_n + 0x0711;
					sp_n->dwFFFFFFF4 = r5_n + 0x06D8;
					sp_n->dwFFFFFFF0 = r2_n + 1515;
					ptr32 r6_n;
					(*((word32) r6_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 r3_n = r2_n->ptrC839;
					(*((word32) r3_n + 2))();
				}
				struct Eq_n * sp_n = sp_n - 0x04;
				sp_n->dw0000 = 0x00;
				sp_n->dwFFFFFFFC = r5_n + 0x06DD;
				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 r3_n = r2_n->ptrC839;
				(*((word32) r3_n + 2))();
				struct Eq_n * sp_n;
				word32 r5_n;
				sp_n->dwFFFFFFFC = r5_n;
				(*((word32) g_ptr192CC + 2))();
				struct Eq_n * sp_n;
				sp_n->dwFFFFFFFC = 0x00;
				byte * r0_n;
				byte * r4_n;
				word32 r5_n;
				if (r0_n != null && *r0_n != 0x00)
					r4_n = r0_n;
				else
					r4_n = r5_n + 0x0711;
				sp_n->ptrFFFFFFF8 = r4_n;
				sp_n->dwFFFFFFF4 = r5_n;
				sp_n->dwFFFFFFF0 = r5_n + 0x0706;
				word32 r2_n;
				sp_n->dwFFFFFFEC = 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 r3_n = r2_n->ptrC839;
				(*((word32) r3_n + 2))();
				struct Eq_n * sp_n;
				word32 r5_n;
				sp_n->dwFFFFFFFC = r5_n + 11;
				(*((word32) g_ptr192CC + 2))();
				struct Eq_n * sp_n;
				sp_n->dwFFFFFFFC = 0x00;
				byte * r0_n;
				byte * r4_n;
				word32 r5_n;
				if (r0_n != null && *r0_n != 0x00)
					r4_n = r0_n;
				else
					r4_n = r5_n + 0x0711;
				sp_n->ptrFFFFFFF8 = r4_n;
				sp_n->dwFFFFFFF4 = r5_n + 11;
				sp_n->dwFFFFFFF0 = r5_n + 0x0706;
				word32 r2_n;
				sp_n->dwFFFFFFEC = 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 r3_n = r2_n->ptrC839;
				(*((word32) r3_n + 2))();
				struct Eq_n * sp_n;
				word32 r5_n;
				sp_n->dwFFFFFFFC = r5_n + 20;
				(*((word32) g_ptr192CC + 2))();
				struct Eq_n * sp_n;
				sp_n->dwFFFFFFFC = 0x00;
				byte * r0_n;
				byte * r4_n;
				word32 r5_n;
				if (r0_n != null && *r0_n != 0x00)
					r4_n = r0_n;
				else
					r4_n = r5_n + 0x0711;
				sp_n->ptrFFFFFFF8 = r4_n;
				sp_n->dwFFFFFFF4 = r5_n + 20;
				sp_n->dwFFFFFFF0 = r5_n + 0x0706;
				word32 r2_n;
				sp_n->dwFFFFFFEC = 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 r3_n = r2_n->ptrC839;
				(*((word32) r3_n + 2))();
				struct Eq_n * sp_n;
				word32 r5_n;
				sp_n->dwFFFFFFFC = r5_n + 33;
				(*((word32) g_ptr192CC + 2))();
				struct Eq_n * sp_n;
				sp_n->dwFFFFFFFC = 0x00;
				byte * r0_n;
				byte * r4_n;
				word32 r5_n;
				if (r0_n != null && *r0_n != 0x00)
					r4_n = r0_n;
				else
					r4_n = r5_n + 0x0711;
				sp_n->ptrFFFFFFF8 = r4_n;
				sp_n->dwFFFFFFF4 = r5_n + 33;
				sp_n->dwFFFFFFF0 = r5_n + 0x0706;
				word32 r2_n;
				sp_n->dwFFFFFFEC = 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 r3_n = r2_n->ptrC839;
				(*((word32) r3_n + 2))();
			}
			struct Eq_n * sp_n = fp_n - 0x04;
			word32 fp_n = sp_n->dw0010;
			struct Eq_n * ap_n = sp_n->ptr000C;
			struct Eq_n * r2_n;
			r2Out = r2_n;
			struct Eq_n * r7_n;
			r7Out = r7_n;
			apOut = ap_n;
			fpOut = fp_n;
			return null;
		}
		else
		{
			if (r2_n[24] == 0x00 && r10_n == 0x00)
				r10_n = 0x0A;
			sp_n->dwFFFFFFFC = r10_n;
			int8 * r0_n = fn000098D6(r0, ap, out r2_n, out r7_n, out fp_n);
			word32 fp_n = fp_n->dw000C;
			struct Eq_n * ap_n = fp_n->ptr0008;
			r2Out = r2_n;
			r7Out = r7_n;
			apOut = ap_n;
			fpOut = fp_n;
			return r0_n;
		}
	}
	else
	{
		if (r2_n[3] == 0x00 && (r2_n[0x0011] == 0x00 && (r2_n[20] == 0x00 && (r2_n[23] == 0x00 && r2_n[18] == 0x00))))
			r2_n[29] = (struct Eq_n) 0x01;
		else
			r2_n[29] = (struct Eq_n) 0x00;
		if (r2_n[5] != 0x00)
		{
			if (r2_n[29] != 0x00)
			{
				word32 r3_n = 0x00;
				if (r2_n[6] == 0x00)
					r3_n = 0x01;
				r2_n[28] = (struct Eq_n) r3_n;
				struct Eq_n * sp_n = sp_n - 0x04;
				sp_n->dw0000 = 0x00;
				sp_n->dwFFFFFFFC = r9_n;
				int8 * r0_n = fn0000C6FA(ap, fp, out r2_n, out r3_n, out r7_n, out r8_n, out r9_n, out r10_n, out ap, out fp);
				if (r0_n > (int8 *) 0x02)
				{
					word32 fp_n = fp->dw000C;
					struct Eq_n * ap_n = fp->ptr0008;
					r2Out = r2_n;
					r7Out = r7_n;
					apOut = ap_n;
					fpOut = fp_n;
					return r0_n;
				}
			}
			else
			{
				struct Eq_n * sp_n = sp_n - 0x04;
				sp_n->dw0000 = 0x0401;
				sp_n->ptrFFFFFFFC = r5_n + 44;
				sp_n->ptrFFFFFFF8 = (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 r3_n = r2_n->ptrC839;
				(*((word32) r3_n + 2))();
			}
		}
		*ap->ptr0004 = (byte) r8_n;
		*ap->t0008.u0 = (byte) r7_n;
		struct Eq_n * sp_n = fp - 0x04;
		word32 fp_n = sp_n->dw0010;
		struct Eq_n * ap_n = sp_n->ptr000C;
		r2Out = r2_n;
		r7Out = r7_n;
		apOut = ap_n;
		fpOut = fp_n;
		return null;
	}
}

Eq_n g_a8394[] = // 00008394
	{
	};
// 00008CCE: Register (ptr32 int8) fn00008CCE(Register (ptr32 int8) r0, Register (ptr32 Eq_n) ap, Register out (ptr32 Eq_n) r2Out, Register out (ptr32 Eq_n) r7Out, Register out word32 fpOut)
// Called from:
//      fn000098D6
//      fn00012702
int8 * fn00008CCE(int8 * r0, struct Eq_n * ap, struct Eq_n & r2Out, struct Eq_n & r7Out, word32 & fpOut)
{
	uip32 r0_n;
	if (ap->ptr0004 != null)
		r0_n = SEQ(SLICE(r0, word24, 8), 0x01);
	else
		r0_n = SEQ(SLICE(r0, word24, 8), 0x00);
	int32 r6_n = (int32) (int8) r0_n;
	if (*(struct Eq_n *) 4294947792 == 0x00)
	{
		ptr32 r5_n = g_ptr192D0;
		(*((word32) r5_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 r0_n = r2_n->ptrC839;
		(*((word32) r0_n + 2))();
		struct Eq_n * sp_n;
		word32 r6_n;
		sp_n->dwFFFFFFFC = r6_n;
		word32 r3_n;
		sp_n->dwFFFFFFF8 = r3_n + 0x09C8;
		word32 r4_n;
		sp_n->dwFFFFFFF4 = r4_n + 0x006A;
		sp_n->dwFFFFFFF0 = r3_n + 0x090A;
		word32 r2_n;
		sp_n->dwFFFFFFEC = r2_n + 1515;
		ptr32 r5_n;
		(*((word32) r5_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 r0_n = r2_n->ptrC839;
		(*((word32) r0_n + 2))();
		word32 r7_n;
		struct Eq_n * sp_n;
		word32 r6_n;
		word32 r3_n;
		word32 r2_n;
		if (r7_n == 0x00)
		{
			sp_n->dwFFFFFFFC = r6_n;
			sp_n->dwFFFFFFF8 = r3_n + 2551;
			sp_n->dwFFFFFFF4 = r2_n + 1515;
			ptr32 r5_n;
			(*((word32) r5_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 r0_n = r2_n->ptrC839;
			(*((word32) r0_n + 2))();
		}
		struct Eq_n * sp_n = sp_n - 0x04;
		sp_n->dw0000 = r6_n;
		sp_n->dwFFFFFFFC = r3_n + 550;
		sp_n->dwFFFFFFF8 = r3_n + 2632;
		sp_n->dwFFFFFFF4 = r2_n + 1515;
		ptr32 r5_n = g_ptr192D0;
		(*((word32) r5_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 r0_n = r2_n->ptrC839;
		(*((word32) r0_n + 2))();
		struct Eq_n * sp_n;
		word32 r6_n;
		sp_n->dwFFFFFFFC = r6_n;
		word32 r3_n;
		sp_n->dwFFFFFFF8 = r3_n + 586;
		sp_n->dwFFFFFFF4 = 0x22;
		sp_n->dwFFFFFFF0 = 0x22;
		sp_n->dwFFFFFFEC = r3_n + 551;
		sp_n->dwFFFFFFE8 = 0x22;
		sp_n->dwFFFFFFE4 = 0x22;
		sp_n->dwFFFFFFE0 = 0x22;
		sp_n->dwFFFFFFDC = 0x22;
		sp_n->dwFFFFFFD8 = r3_n + 0x0B79;
		word32 r2_n;
		sp_n->dwFFFFFFD4 = r2_n + 1515;
		ptr32 r5_n;
		(*((word32) r5_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 r0_n = r2_n->ptrC839;
		(*((word32) r0_n + 2))();
		struct Eq_n * sp_n;
		word32 r6_n;
		sp_n->dwFFFFFFFC = r6_n;
		word32 r3_n;
		sp_n->dwFFFFFFF8 = r3_n + 467;
		sp_n->dwFFFFFFF4 = r3_n + 467;
		sp_n->dwFFFFFFF0 = r3_n + 473;
		sp_n->dwFFFFFFEC = r3_n + 3368;
		word32 r2_n;
		sp_n->dwFFFFFFE8 = r2_n + 1515;
		ptr32 r5_n;
		(*((word32) r5_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 r0_n = r2_n->ptrC839;
		(*((word32) r0_n + 2))();
	}
	else
	{
		ptr32 r5_n = g_ptr192D0;
		(*((word32) r5_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 r0_n = r2_n->ptrC839;
		(*((word32) r0_n + 2))();
		struct Eq_n * sp_n;
		word32 r6_n;
		sp_n->dwFFFFFFFC = r6_n;
		word32 r3_n;
		sp_n->dwFFFFFFF8 = r3_n + 1119;
		word32 r2_n;
		sp_n->dwFFFFFFF4 = r2_n + 1515;
		ptr32 r5_n;
		(*((word32) r5_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 r0_n = r2_n->ptrC839;
		(*((word32) r0_n + 2))();
		struct Eq_n * sp_n;
		word32 r6_n;
		sp_n->dwFFFFFFFC = r6_n;
		word32 r3_n;
		sp_n->dwFFFFFFF8 = r3_n + 0x0689;
		sp_n->dwFFFFFFF4 = 0x22;
		sp_n->dwFFFFFFF0 = 0x22;
		sp_n->dwFFFFFFEC = 0x22;
		sp_n->dwFFFFFFE8 = 0x22;
		sp_n->dwFFFFFFE4 = r3_n + 0x0585;
		word32 r2_n;
		sp_n->dwFFFFFFE0 = r2_n + 1515;
		ptr32 r5_n;
		(*((word32) r5_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 r0_n = r2_n->ptrC839;
		(*((word32) r0_n + 2))();
		struct Eq_n * sp_n;
		word32 r6_n;
		sp_n->dwFFFFFFFC = r6_n;
		word32 r4_n;
		sp_n->dwFFFFFFF8 = r4_n + 23;
		word32 r2_n;
		sp_n->dwFFFFFFF4 = r2_n + 1515;
		ptr32 r5_n;
		(*((word32) r5_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 r0_n = r2_n->ptrC839;
		(*((word32) r0_n + 2))();
	}
	struct Eq_n * ap_n;
	struct Eq_n * fp_n;
	if (ap_n->dw0004 == 0x00)
	{
		word32 fp_n = fp_n->dw000C;
		r2Out = (struct Eq_n *) <invalid>;
		r7Out = (struct Eq_n *) <invalid>;
		fpOut = fp_n;
		return null;
	}
	else
	{
		word32 fp_n = fp_n->dw000C;
		r2Out = (struct Eq_n *) <invalid>;
		r7Out = (struct Eq_n *) <invalid>;
		fpOut = fp_n;
		return (int8 *) 0x0A;
	}
}

// 00008EC2: void fn00008EC2(Register (ptr32 Eq_n) fp)
// Called from:
//      fn0000802E
void fn00008EC2(struct Eq_n * fp)
{
}

// 00009746: void fn00009746(Register (ptr32 Eq_n) fp)
// Called from:
//      fn00008EC2
void fn00009746(struct Eq_n * fp)
{
}

// 000098B6: void fn000098B6()
// Called from:
//      fn00008EC2
void fn000098B6()
{
	(*((word32) g_ptr19330 + 2))();
	struct Eq_n * sp_n;
	struct Eq_n * ap_n;
	sp_n->dwFFFFFFFC = ap_n->dw0004;
	fn00018F66();
}

// 000098D6: Register (ptr32 int8) fn000098D6(Register (ptr32 int8) r0, Register (ptr32 Eq_n) ap, Register out word32 r2Out, Register out word32 r7Out, Register out word32 fpOut)
// Called from:
//      fn00008322
int8 * fn000098D6(int8 * r0, struct Eq_n * ap, word32 & r2Out, word32 & r7Out, word32 & fpOut)
{
	struct Eq_n * fp_n;
	word32 r7_n;
	word32 r2_n;
	if (*(word32 *) ~0x0001882B != 0x00)
	{
		uip32 r0_n;
		if (ap->ptr0004 != null)
			r0_n = SEQ(SLICE(r0, word24, 8), 0x01);
		else
			r0_n = SEQ(SLICE(r0, word24, 8), 0x00);
		int32 r5_n = (int32) (int8) r0_n;
		if (*(struct Eq_n *) 4294947792 == 0x00)
		{
			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 * r2_n;
			sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
			sp_n->ptrFFFFFFF4 = r2_n;
			ptr32 r0_n = r2_n->ptrC839;
			(*((word32) r0_n + 2))();
			struct Eq_n * sp_n;
			word32 r5_n;
			sp_n->dwFFFFFFFC = r5_n;
			word32 r3_n;
			sp_n->dwFFFFFFF8 = r3_n + 0x06E2;
			sp_n->dwFFFFFFF4 = r3_n + 1565;
			word32 r2_n;
			sp_n->dwFFFFFFF0 = r2_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 * r2_n;
			sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
			sp_n->ptrFFFFFFF4 = r2_n;
			ptr32 r0_n = r2_n->ptrC839;
			(*((word32) r0_n + 2))();
			struct Eq_n * sp_n;
			word32 r5_n;
			sp_n->dwFFFFFFFC = r5_n;
			word32 r3_n;
			sp_n->dwFFFFFFF8 = r3_n + 1808;
			word32 r2_n;
			sp_n->dwFFFFFFF4 = r2_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 * r2_n;
			sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
			sp_n->ptrFFFFFFF4 = r2_n;
			ptr32 r0_n = r2_n->ptrC839;
			(*((word32) r0_n + 2))();
			struct Eq_n * sp_n;
			word32 r5_n;
			sp_n->dwFFFFFFFC = r5_n;
			word32 r3_n;
			sp_n->dwFFFFFFF8 = r3_n + 2237;
			word32 r2_n;
			sp_n->dwFFFFFFF4 = r2_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 * r2_n;
			sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
			sp_n->ptrFFFFFFF4 = r2_n;
			ptr32 r0_n = r2_n->ptrC839;
			(*((word32) r0_n + 2))();
		}
		else
		{
			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 * r2_n;
			sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
			sp_n->ptrFFFFFFF4 = r2_n;
			ptr32 r0_n = r2_n->ptrC839;
			(*((word32) r0_n + 2))();
			struct Eq_n * sp_n;
			word32 r5_n;
			sp_n->dwFFFFFFFC = r5_n;
			word32 r3_n;
			sp_n->dwFFFFFFF8 = r3_n + 688;
			word32 r2_n;
			sp_n->dwFFFFFFF4 = r2_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 * r2_n;
			sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
			sp_n->ptrFFFFFFF4 = r2_n;
			ptr32 r0_n = r2_n->ptrC839;
			(*((word32) r0_n + 2))();
			struct Eq_n * sp_n;
			word32 r5_n;
			sp_n->dwFFFFFFFC = r5_n;
			word32 r3_n;
			sp_n->dwFFFFFFF8 = r3_n + 1077;
			word32 r2_n;
			sp_n->dwFFFFFFF4 = r2_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 * r2_n;
			sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
			sp_n->ptrFFFFFFF4 = r2_n;
			ptr32 r0_n = r2_n->ptrC839;
			(*((word32) r0_n + 2))();
			struct Eq_n * sp_n;
			word32 r5_n;
			sp_n->dwFFFFFFFC = r5_n;
			word32 r3_n;
			sp_n->dwFFFFFFF8 = r3_n + 0x0595;
			word32 r2_n;
			sp_n->dwFFFFFFF4 = r2_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 * r2_n;
			sp_n->dwFFFFFFF8 = (char *) r2_n + 1515;
			sp_n->ptrFFFFFFF4 = r2_n;
			ptr32 r0_n = r2_n->ptrC839;
			(*((word32) r0_n + 2))();
		}
		struct Eq_n * ap_n;
		struct Eq_n * fp_n;
		word32 r2_n;
		word32 r7_n;
		if (ap_n->dw0004 == 0x00)
		{
			word32 fp_n = fp_n->dw000C;
			r2Out = r2_n;
			r7Out = r7_n;
			fpOut = fp_n;
			return null;
		}
		else
		{
			word32 fp_n = fp_n->dw000C;
			r2Out = r2_n;
			r7Out = r7_n;
			fpOut = fp_n;
			return (int8 *) 0x0A;
		}
	}
	else
	{
		int8 * r0_n = fn00008CCE(r0, ap, out r2_n, out r7_n, out fp_n);
		word32 fp_n = fp_n->dw000C;
		r2Out = r2_n;
		r7Out = r7_n;
		fpOut = fp_n;
		return r0_n;
	}
}

// 00009A52: void fn00009A52()
// Called from:
//      fn00010E6A
void fn00009A52()
{
}

// 00009B0A: Register word32 fn00009B0A(Register (ptr32 Eq_n) fp, Register out (ptr32 Eq_n) r3Out, Register out word32 fpOut)
// Called from:
//      fn0000F816
word32 fn00009B0A(struct Eq_n * fp, struct Eq_n & r3Out, word32 & fpOut)
{
	struct Eq_n * fp_n;
	struct Eq_n * r3_n;
	struct Eq_n * fp_n;
	struct Eq_n * ap_n;
	int32 r0_n = fn0000AA6A((struct Eq_n *) ~0x00018827, fp, out ap_n, out fp_n);
	ap_n->dw1019C = r0_n;
	if (r0_n > 0x02)
	{
		word32 r0_n = fn00009C8A(fp_n, out r3_n, out fp_n);
		word32 fp_n = fp_n->dw000C;
		r3Out = r3_n;
		fpOut = fp_n;
		return r0_n;
	}
	else
	{
		g_a9B26[r0_n]();
		struct Eq_n * r3_n;
		r3Out = r3_n;
		word32 fp_n;
		fpOut = fp_n;
		word32 r0_n;
		return r0_n;
	}
}

Eq_n g_a9B26[] = // 00009B26
	{
	};
// 00009BAE: void fn00009BAE()
void fn00009BAE()
{
}

// 00009C8A: Register word32 fn00009C8A(Register (ptr32 Eq_n) fp, Register out ptr32 r3Out, Register out word32 fpOut)
// Called from:
//      fn00009B0A
word32 fn00009C8A(struct Eq_n * fp, ptr32 & r3Out, word32 & fpOut)
{
	word32 r3;
	word24 v12_n = SLICE(r3, word24, 8);
	uip32 r3_n = SEQ(v12_n, 0x01);
	if (((*(struct Eq_n **) ~0x4648)->dw0014 & 0x08) == 0x00 && *((int32 *) ~0x4C23) == 0x00)
		r3_n = SEQ(v12_n, 0x00);
	int32 v18_n = (int32) (int8) r3_n;
	*(int32 *) ~0x000186C7 = v18_n;
	word32 r5_n;
	if (v18_n == 0x00 && *((word32 *) ~0x4C27) != 0x00)
	{
		word32 r4_n;
		if (*(word32 *) ~0x4C27 != 0x01)
			r4_n = 0x01;
		else
		{
			word32 r3_n = 0x00;
			if ((uint32) SLICE((*(struct Eq_n **) ~0x4648)->dw0014, ui1, 2) == 0x00)
				r3_n = 0x01;
			r4_n = r3_n;
		}
		r5_n = r4_n;
	}
	else
		r5_n = 0x00;
	*(word32 *) ~0x000186C3 = r5_n;
	*(byte *) ~0x000186BF = 0x05;
	if (*(int32 *) ~0x4C23 != 0x00)
	{
		*(ptr32 *) ~0x86B7 = (<unknown>*) ~0x000186BE;
		*(word32 *) ~0x86BB = 0x00;
		*(ptr32 *) ~0x86AE = (<unknown>*) ~0x000186BE;
		*(word32 *) ~0x86AA = 0x00;
		*(struct Eq_n *) ~0x86B2 = (Eq_n) (struct Eq_n *) ~0x86A6;
		*(ptr32 *) 4294932829 = (<unknown>*) 4294900033;
		*(word32 *) 4294932833 = 0x00;
		*(struct Eq_n *) ~0x86A6 = (Eq_n) (struct Eq_n *) ~0x86B2;
		*(struct Eq_n **) ~0x8697 = (struct Eq_n *) ~0x86B2;
		ptr32 r3_n;
		if (*(int32 *) ~0x000186C7 != 0x00)
		{
			*(byte *) ~0x86B3 = 0x00;
			r3_n = &g_tB518;
		}
		else
			r3_n = &g_tB0B8;
		*(ptr32 *) 4294932844 = r3_n;
		*(ptr32 *) ~0x868F = &g_tB9EC;
		word32 fp_n = fp->dw000C;
		r3Out = r3_n;
		fpOut = fp_n;
		return 0x00;
	}
}

// 0000A07A: void fn0000A07A(Register word32 fp)
void fn0000A07A(word32 fp)
{
	*(int32 *) ~0x000186C7 = *(int32 *) ~0x4C23;
	*(byte *) ~0x000186BF = (*(struct Eq_n **) ~0x000186F3)->b001F;
	if (*(int32 *) ~0x4C23 != 0x00)
	{
		uint32 r2_n = (uint32) *(byte *) ~0x000186BF;
		if (r2_n != 0x02 && (r2_n != 0x05 && (r2_n != 0x06 && r2_n != 0x04)))
		{
			(*((word32) g_ptr192D0 + 2))();
			struct Eq_n * sp_n;
			word32 r0_n;
			sp_n->dwFFFFFFFC = r0_n;
			struct Eq_n * r7_n;
			sp_n->dwFFFFFFF8 = (char *) r7_n + 1515;
			sp_n->ptrFFFFFFF4 = r7_n;
			ptr32 r2_n = r7_n->ptrC839;
			(*((word32) r2_n + 2))();
			struct Eq_n * r6_n;
			struct Eq_n * sp_n;
			if (r6_n->ptr0140 != null)
			{
				sp_n->ptrFFFFFFFC = r6_n->ptr0140;
				(*((word32) g_ptr192B0 + 2))();
			}
			if (r6_n->ptr0148 != null)
			{
				sp_n->ptrFFFFFFFC = r6_n->ptr0148;
				(*((word32) g_ptr192B0 + 2))();
			}
			if (r6_n->ptr0144 != null)
			{
				sp_n->ptrFFFFFFFC = r6_n->ptr0144;
				(*((word32) g_ptr192B0 + 2))();
			}
			if (r6_n->ptr013C != null)
			{
				sp_n->ptrFFFFFFFC = r6_n->ptr013C;
				(*((word32) g_ptr192B0 + 2))();
			}
			if (r6_n->ptr0154 != null)
			{
				struct Eq_n * r3_n;
				do
				{
					struct Eq_n * r2_n = r6_n->ptr0154;
					word32 r3_n = r2_n->dw0004;
					sp_n->ptrFFFFFFFC = r2_n;
					(*((word32) g_ptr192B0 + 2))();
					r6_n->ptr0154 = r3_n;
				} while (r3_n != null);
			}
			struct Eq_n * r3_n = r6_n->ptr0134;
			if (r3_n != null && r3_n != r6_n)
			{
				sp_n->ptrFFFFFFFC = r3_n;
				(*((word32) g_ptr192B0 + 2))();
			}
		}
		else
		{
			*(ptr32 *) ~0x86B7 = (<unknown>*) ~0x000186BE;
			*(word32 *) ~0x86BB = 0x00;
			*(ptr32 *) ~0x86AE = (<unknown>*) ~0x000186BE;
			*(word32 *) ~0x86AA = 0x00;
			*(struct Eq_n *) ~0x86B2 = (Eq_n) (struct Eq_n *) ~0x86A6;
			*(ptr32 *) 4294932829 = (<unknown>*) 4294900033;
			*(word32 *) 4294932833 = 0x00;
			*(struct Eq_n *) ~0x86A6 = (Eq_n) (struct Eq_n *) ~0x86B2;
			*(struct Eq_n **) ~0x8697 = (struct Eq_n *) ~0x86B2;
			if (*(int32 *) ~0x000186C7 == 0x00)
			{
				*(ptr32 *) 4294932844 = &g_tB0B8;
				*(ptr32 *) ~0x868F = &g_tB9EC;
			}
			else
			{
				Eq_n r0_n;
				r0_n.u1 = (uint32) *(byte *) ~0x000186BF;
				if (r0_n > 0x06)
					vax_addp4(0x00, 0x11, 0x28, 0x17);
				else
					g_aA558[r0_n - 0x02]();
			}
		}
	}
}

Eq_n g_aA558[] = // 0000A558
	{
	};
// 0000A5B2: void fn0000A5B2(Register word32 r2, Register (ptr32 Eq_n) r5)
void fn0000A5B2(word32 r2, struct Eq_n * r5)
{
	if (*(int32 *) ~0x4C23 != 0x00)
	{
		byte v13_n = *(byte *) ~0x8533 & 0x0F;
		uip32 r2_n = SEQ(SLICE(r2, word24, 8), v13_n);
		Eq_n r3_n;
		r3_n.u1 = (uint32) v13_n;
		if (r3_n == 0x02 || (r3_n == 0x05 || (r3_n == 0x06 || r3_n == 0x04)))
		{
			*(ptr32 *) ~0x86B7 = (<unknown>*) ~0x000186BE;
			*(word32 *) ~0x86BB = 0x00;
			*(ptr32 *) ~0x86AE = (<unknown>*) ~0x000186BE;
			*(word32 *) ~0x86AA = 0x00;
			*(struct Eq_n *) ~0x86B2 = (Eq_n) (struct Eq_n *) ~0x86A6;
			*(ptr32 *) 4294932829 = (<unknown>*) 4294900033;
			*(word32 *) 4294932833 = 0x00;
			*(struct Eq_n *) ~0x86A6 = (Eq_n) (struct Eq_n *) ~0x86B2;
			*(struct Eq_n **) ~0x8697 = (struct Eq_n *) ~0x86B2;
			if (r3_n > 0x06)
				vax_subp4(0x00, 0x11, 0x2A, r5->ptr1750->u1);
			else
				g_aA676[r3_n - 0x02]();
		}
		else
		{
			(*((word32) g_ptr192D0 + 2))();
			struct Eq_n * sp_n;
			word32 r0_n;
			sp_n->dwFFFFFFFC = r0_n;
			struct Eq_n * r7_n;
			sp_n->dwFFFFFFF8 = (char *) r7_n + 1515;
			sp_n->ptrFFFFFFF4 = r7_n;
			ptr32 r2_n = r7_n->ptrC839;
			(*((word32) r2_n + 2))();
		}
	}
}

Eq_n g_aA676[] = // 0000A676
	{
	};
// 0000A8D6: void fn0000A8D6(Register word32 r0, Register (ptr32 Eq_n) fp)
void fn0000A8D6(word32 r0, struct Eq_n * fp)
{
	struct Eq_n * sp_n = fp + -112;
	struct Eq_n * r6_n = (struct Eq_n *) ~0x0001A0C7;
	struct Eq_n * r7_n = (struct Eq_n *) 4294947792;
	if (*(int8 *) ~0x000186CB != 0x00)
		fp->bFFFFFFF2 = *(int8 *) ~0x000186CB;
	else
	{
		Eq_n r10_n[];
		do
		{
			struct Eq_n * sp_n = sp_n - 0x04;
			sp_n->dw0000 = 0x01;
			sp_n->ptrFFFFFFFC = &r7_n->dwC6E9 + 6;
			sp_n->ptrFFFFFFF8 = (char *) r6_n + 718;
			sp_n->ptrFFFFFFF4 = (char *) &r7_n->ptr05E7 + 4;
			(*((word32) g_ptr192D0 + 2))();
			struct Eq_n * sp_n;
			word32 r0_n;
			sp_n->dwFFFFFFFC = r0_n;
			struct Eq_n * r7_n;
			sp_n->dwFFFFFFF8 = (char *) r7_n + 1515;
			sp_n->ptrFFFFFFF4 = r7_n;
			ptr32 r2_n = r7_n->ptrC839;
			(*((word32) r2_n + 2))();
			struct Eq_n * sp_n;
			word32 * r8_n;
			sp_n->dwFFFFFFFC = *r8_n;
			(*((word32) g_ptr19294 + 2))();
			struct Eq_n * sp_n;
			word32 * r8_n;
			sp_n->dwFFFFFFFC = *r8_n;
			sp_n->dwFFFFFFF8 = 0x09;
			word32 fp_n;
			sp_n->dwFFFFFFF4 = fp_n + -0x0E;
			(*((word32) g_ptr19290 + 2))();
			if (r0 != 0x00 || ((&(r10_n)[0].u1)[(int32) (fp->bFFFFFFF2 & 0x7F)] & 0x03) != 0x00)
				break;
			sp_n->dwFFFFFFFC = (int32) fp->bFFFFFFF2;
			ptr32 r3_n;
			(*((word32) r3_n + 2))();
			if (r0 == 111)
				break;
			sp_n->dwFFFFFFFC = (int32) fp->bFFFFFFF2;
			ptr32 r3_n;
			(*((word32) r3_n + 2))();
			if (r0 == 118)
				break;
			sp_n->dwFFFFFFFC = (int32) fp->bFFFFFFF2;
			ptr32 r3_n;
			(*((word32) r3_n + 2))();
		} while (r0 != 110);
		if ((r10_n[(int32) (fp->bFFFFFFF2 & 0x7F)].u0 & 0x01) != 0x00)
		{
			sp_n->dwFFFFFFFC = (int32) fp->bFFFFFFF2;
			(*((word32) g_ptr19298 + 2))();
			int32 r0_n;
			fp->bFFFFFFF2 = (int8) r0_n;
			struct Eq_n * r9_n;
			r9_n->b015C = (byte) r0_n;
		}
	}
	word16 * r0_n = (int32) fp->bFFFFFFF2;
	if (r0_n > (word16 *) 118)
	{
		vax_subp4(0x00, 0x31, *r0_n, 0x00);
		fn40009A48();
	}
	else
		g_aA9CE[r0_n - (word16 *) 110]();
}

Eq_n g_aA9CE[] = // 0000A9CE
	{
	};
// 0000AA6A: Register word32 fn0000AA6A(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register out (ptr32 Eq_n) apOut, Register out (ptr32 Eq_n) fpOut)
// Called from:
//      fn00009B0A
word32 fn0000AA6A(struct Eq_n * ap, struct Eq_n * fp, struct Eq_n & apOut, struct Eq_n & fpOut)
{
	word32 v11_n = g_dw79F7;
	*(struct Eq_n **) ~0x000186F3 = null;
	*(word64 *) ~0x000186EB = 0x00;
	*(word64 *) 4294867228 = 0x00;
	*(word64 *) 4294867244 = 0x00;
	struct Eq_n * sp_n = fp - 0x18;
	struct Eq_n * r11_n = (struct Eq_n *) ~0x0001A0C7;
	struct Eq_n * r10_n = (struct Eq_n *) 4294947792;
	struct Eq_n * r8_n = (struct Eq_n *) ~0x00018827;
	if (v11_n != 0x00)
	{
		if ((uint32) g_w7A26 > 0x00)
		{
			do
			{
				sp_n[4] = sp_n[2];
				if (*sp_n[4].dw0000 != r11_n->w033F)
				{
					if ((uint32) *sp_n[4].dw0000 == 0x0C)
					{
						sp_n[1] = (struct Eq_n) 0x02;
						struct Eq_n * r3_n = (struct Eq_n *) sp_n[4];
						uint32 r2_n = (uint32) r3_n->w0002;
						r8_n->dw102EC = 0x00;
						struct Eq_n * sp_n = sp_n - 0x04;
						sp_n->dw0000 = r2_n - 0x04;
						sp_n->ptrFFFFFFFC = &r3_n->dw0004 + 1;
						sp_n->dwFFFFFFF8 = 0x00;
						sp_n = (struct Eq_n *) <invalid>;
						struct Eq_n * r3_n;
						word32 r2_n;
						word16 * r6_n;
						if (r3_n->dw0004 != fn0000CFBA(r2_n - 0x04, fp, out r2_n, out r3_n, out r6_n, out ap, out fp))
						{
							fn00000003((char *) &r10_n->ptr05E7 + 4, (char *) &r11_n->dw0365 + 46, 0x01);
							struct Eq_n * sp_n;
							word32 r0_n;
							sp_n->dwFFFFFFFC = r0_n;
							struct Eq_n * r10_n;
							sp_n->dwFFFFFFF8 = (char *) r10_n + 1515;
							sp_n->ptrFFFFFFF4 = r10_n;
							ptr32 r2_n = r10_n->ptrC839;
							(*((word32) r2_n + 2))();
							sp_n[1] = (struct Eq_n) 0x00;
							ap = null;
							word16 * r6_n;
							r6_n = r6_n;
							struct Eq_n * fp_n;
							fp = fp_n;
						}
						if (ap > (struct Eq_n *) 0x04)
						{
							Eq_n r0_n;
							r0_n.u1 = (uint32) *r6_n;
							if (r0_n <= 0x1F)
							{
								g_aACDC[r0_n - 0x03]();
								struct Eq_n * ap_n;
								apOut = ap_n;
								struct Eq_n * fp_n;
								fpOut = fp_n;
								word32 r0_n;
								return r0_n;
							}
						}
						r8_n->a1024C[r8_n->dw102EC].w0000 = 0x00;
						r8_n->a1024C[r8_n->dw102EC].w0002 = 0x00;
						r8_n->a1024C[r8_n->dw102EC].dw0004 = 0x00;
					}
				}
				else
				{
					sp_n[1] = (struct Eq_n) 0x01;
					struct Eq_n * r3_n = (struct Eq_n *) sp_n[4];
					word32 r4_n = r3_n->dw0004;
					if (r4_n == r11_n->dw0342)
					{
						struct Eq_n * sp_n = sp_n - 0x04;
						sp_n->dw0000 = (uint32) *g_ptr19354;
						sp_n->dwFFFFFFFC = g_dw1930C;
						sp_n->dwFFFFFFF8 = 0x00;
						sp_n->ptrFFFFFFF4 = r3_n;
						r8_n->ptr0134 = fn0000AEF2(ap, out ap, out fp);
						sp_n = (struct Eq_n *) <invalid>;
					}
					else if (r4_n == r11_n->dw0347)
					{
						struct Eq_n * sp_n = sp_n - 0x04;
						sp_n->dw0000 = (uint32) *g_ptr19358;
						sp_n->dwFFFFFFFC = g_dw19304;
						sp_n->dwFFFFFFF8 = 0x00;
						sp_n->ptrFFFFFFF4 = r3_n;
						r8_n->ptr0150 = fn0000AEF2(ap, out ap, out fp);
						sp_n = (struct Eq_n *) <invalid>;
						if (r8_n->ptr0154 == null)
							r8_n->ptr0154 = r8_n->ptr0150;
						struct Eq_n * r2_n = r8_n->ptr0158;
						if (r2_n != null)
							r2_n->ptr0004 = r8_n->ptr0150;
						struct Eq_n * r2_n = r8_n->ptr0150;
						r8_n->ptr0158 = r2_n;
						r2_n->ptr0004 = null;
					}
					else if (r4_n == r11_n->dw034C)
					{
						struct Eq_n * sp_n = sp_n - 0x04;
						sp_n->dw0000 = (uint32) *g_ptr1935C;
						sp_n->dwFFFFFFFC = g_dw192F8;
						sp_n->dwFFFFFFF8 = 0x00;
						sp_n->ptrFFFFFFF4 = r3_n;
						r8_n->ptr014C = fn0000AEF2(ap, out ap, out fp);
						sp_n = (struct Eq_n *) <invalid>;
						if (r8_n->ptr0154 == null)
							r8_n->ptr0154 = r8_n->ptr014C;
						struct Eq_n * r2_n = r8_n->ptr0158;
						if (r2_n != null)
							r2_n->ptr0004 = r8_n->ptr014C;
						struct Eq_n * r2_n = r8_n->ptr014C;
						r8_n->ptr0158 = r2_n;
						r2_n->ptr0004 = null;
					}
					else if (r4_n == r11_n->dw0351)
					{
						struct Eq_n * sp_n = sp_n - 0x04;
						sp_n->dw0000 = (uint32) *g_ptr19360;
						sp_n->dwFFFFFFFC = g_dw192FC;
						sp_n->dwFFFFFFF8 = 0x00;
						sp_n->ptrFFFFFFF4 = r3_n;
						r8_n->ptr013C = fn0000AEF2(ap, out ap, out fp);
						sp_n = (struct Eq_n *) <invalid>;
					}
					else if (r4_n == r11_n->dw0356)
					{
						struct Eq_n * sp_n = sp_n - 0x04;
						sp_n->dw0000 = (uint32) *g_ptr19364;
						sp_n->dwFFFFFFFC = g_dw19300;
						sp_n->dwFFFFFFF8 = 0x00;
						sp_n->ptrFFFFFFF4 = r3_n;
						r8_n->ptr0140 = fn0000AEF2(ap, out ap, out fp);
						sp_n = (struct Eq_n *) <invalid>;
					}
					else if (r4_n == r11_n->dw035B)
					{
						struct Eq_n * sp_n = sp_n - 0x04;
						sp_n->dw0000 = (uint32) *g_ptr19368;
						sp_n->dwFFFFFFFC = g_dw192F0;
						sp_n->dwFFFFFFF8 = 0x00;
						sp_n->ptrFFFFFFF4 = r3_n;
						r8_n->ptr0144 = fn0000AEF2(ap, out ap, out fp);
						sp_n = (struct Eq_n *) <invalid>;
					}
					else if (r4_n == r11_n->dw0360)
					{
						struct Eq_n * sp_n = sp_n - 0x04;
						sp_n->dw0000 = (uint32) *g_ptr1936C;
						sp_n->dwFFFFFFFC = g_dw192F4;
						sp_n->dwFFFFFFF8 = 0x00;
						sp_n->ptrFFFFFFF4 = r3_n;
						r8_n->ptr0148 = fn0000AEF2(ap, out ap, out fp);
						sp_n = (struct Eq_n *) <invalid>;
					}
					else if (r4_n != r11_n->dw0365)
					{
						fn00000003((char *) &r10_n->ptr05E7 + 4, (char *) &r11_n->dw0365 + 5, &r3_n->dw0004, 0x01);
						struct Eq_n * sp_n;
						word32 r0_n;
						sp_n->dwFFFFFFFC = r0_n;
						struct Eq_n * r10_n;
						sp_n->dwFFFFFFF8 = (char *) r10_n + 1515;
						sp_n->ptrFFFFFFF4 = r10_n;
						ptr32 r2_n = r10_n->ptrC839;
						(*((word32) r2_n + 2))();
						struct Eq_n * fp_n;
						fp = fp_n;
						struct Eq_n * ap_n;
						ap = ap_n;
					}
				}
				uint32 r2_n = (uint32) *sp_n[4].w0002;
				sp_n[3] = (struct Eq_n) (sp_n[3] - (r2_n + 0x04));
				sp_n[2] = (struct Eq_n) ((word32) sp_n[2].dw0000 + (r2_n + 0x04));
			} while (sp_n[3] > 0x00);
		}
		if (sp_n[1] == 0x01)
		{
			struct Eq_n * r2_n = r8_n->ptr0134;
			if (r2_n != null)
			{
				r2_n->ptr0024 = null;
				struct Eq_n * r3_n = r8_n->ptr013C;
				if (r3_n != null)
				{
					r3_n->ptr0004 = r8_n->ptr0134->ptr0024;
					r8_n->ptr0134->ptr0024 = r8_n->ptr013C;
				}
				struct Eq_n * r3_n = r8_n->ptr0140;
				if (r3_n != null)
				{
					r3_n->ptr0004 = r8_n->ptr0134->ptr0024;
					r8_n->ptr0134->ptr0024 = r8_n->ptr0140;
				}
				if (r8_n->ptr0154 != null)
				{
					r8_n->ptr0158->ptr0004 = r8_n->ptr0134->ptr0024;
					r8_n->ptr0134->ptr0024 = r8_n->ptr0154;
				}
			}
			else
				sp_n[1] = (struct Eq_n) 0x00;
		}
		struct Eq_n * sp_n = fp - 0x04;
		word32 r0_n = (word32) sp_n[1];
		struct Eq_n * fp_n = sp_n->ptr0010;
		apOut = sp_n->ptr000C;
		fpOut = fp_n;
		return r0_n;
	}
	else
	{
		struct Eq_n * fp_n = fp->ptr000C;
		apOut = fp->ptr0008;
		fpOut = fp_n;
		return 0x00;
	}
}

Eq_n g_aACDC[] = // 0000ACDC
	{
	};
// 0000AEF2: Register word32 fn0000AEF2(Register (ptr32 Eq_n) ap, Register out int32 apOut, Register out (ptr32 Eq_n) fpOut)
// Called from:
//      fn0000AA6A
word32 fn0000AEF2(struct Eq_n * ap, int32 & apOut, struct Eq_n & fpOut)
{
	struct Eq_n * fp_n;
	struct Eq_n * r1_n = ap->ptr0004;
	uint32 r5_n = (uint32) r1_n->w0002;
	Eq_n r2_n;
	if (((uint32) r1_n->w0008 & 0x07) == 0x00)
		r2_n = r5_n - 0x0C;
	else
		r2_n.u1 = (uint32) r1_n->w000A;
	if (ap->t0010.u0 == 0x00)
		ap->t0010.u0 = (int32) r2_n;
	union Eq_n * r0_n = ap->ptr0008;
	if (r0_n != null)
		r0_n->u0 = (int32) r2_n;
	Eq_n r0_n;
	r0_n.u0 = ap->t0010.u0;
	Eq_n r2_n;
	if (r0_n > r2_n)
		r2_n = r0_n;
	else
		r2_n = r2_n;
	(*((word32) g_ptr192B4 + 2))();
	word32 r0_n;
	if (r0_n != 0x00)
	{
		struct Eq_n * ap_n;
		int32 r4_n;
		if (ap_n->dw000C != 0x00 && r4_n < ap_n->dw0010)
		{
			struct Eq_n * sp_n;
			sp_n->dwFFFFFFFC = ap_n->dw0010;
			sp_n->dwFFFFFFF8 = ap_n->dw000C;
			sp_n->dwFFFFFFF4 = r0_n;
			(*((word32) g_ptr1929C + 2))();
		}
		int32 r6_n;
		if (r6_n <= 0x02)
		{
			g_aAF75[r6_n]();
			int32 ap_n;
			apOut = ap_n;
			struct Eq_n * fp_n;
			fpOut = fp_n;
			word32 r0_n;
			return r0_n;
		}
	}
	else
	{
		struct Eq_n * fp_n = fp_n->ptr000C;
		apOut = fp_n->dw0008;
		fpOut = fp_n;
		return 0x00;
	}
}

Eq_n g_aAF75[] = // 0000AF75
	{
	};
// 0000B072: Register (ptr32 Eq_n) fn0000B072(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp)
// Called from:
//      fn0001530A
//      fn00015896
//      fn00015E22
//      fn000162E6
//      fn000186B2
struct Eq_n * fn0000B072(struct Eq_n * ap, struct Eq_n * fp)
{
	struct Eq_n * r2_n;
	struct Eq_n * r3_n;
	word32 r6_n;
	struct Eq_n * ap_n;
	struct Eq_n * fp_n;
	r2_n->dwC5EF = fn0000CFBA(ap, fp, out r2_n, out r3_n, out r6_n, out ap_n, out fp_n);
	struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
	if (r2_n->dw0044 != 0x00)
		return fp_n->ptr000C;
	sp_n->dwFFFFFFFC = null;
	sp_n->dwFFFFFFF8 = ap_n->ptr0008;
	sp_n->dwFFFFFFF4 = ap_n->ptr0004;
	(*((word32) r3_n->ptr10194 + 2))();
	struct Eq_n * fp_n;
	return fp_n->ptr000C;
}

<unknown> g_tB0B8 = // 0000B0B8;
// 0000B192: void fn0000B192(Register (ptr32 Eq_n) ap, Register (ptr32 ptr32) pc)
void fn0000B192(struct Eq_n * ap, ptr32 * pc)
{
	struct Eq_n * r4_n;
	real32 r3_n;
	ptr32 fp;
	struct Eq_n * sp_n = fp - 0x04;
	struct Eq_n * r2_n = (struct Eq_n *) ~0x00018827;
	if (*(word32 *) ~0x8633 != 0x00)
	{
		(*((word32) *pc + 2))();
		Eq_n r3_n = r3_n + r4_n->r50D07FFE;
		ui32 r0_n;
		if ((r0_n & 0x01) != 0x00)
			r3_n.u0 = (int32) r2_n->w101FC;
		if ((r3_n & 0x01) == 0x00)
		{
			sp_n->tFFFFFFFC.u0 = (int32) r3_n;
			sp_n->ptrFFFFFFF8 = (char *) r4_n + 968;
			struct Eq_n * fp_n;
			word32 r3_n;
			word32 r4_n;
			word32 ap_n;
			word32 fp_n;
			fn0000C022(ap, fp_n, out r3_n, out r4_n, out ap_n, out fp_n);
			return;
		}
		r2_n->dw101F4 = 0x00;
	}
	struct Eq_n * sp_n = sp_n - 0x08;
	sp_n->qw0000 = 0x00;
	sp_n->dwFFFFFFFC = 0x00;
	sp_n->dwFFFFFFF8 = r2_n->dw101F8;
	sp_n->tFFFFFFF4.u1 = ap->t0008.u1;
	sp_n->dwFFFFFFF0 = ap->dw0004;
	sp_n->qwFFFFFFE8 = 0x00;
	sp_n->ptrFFFFFFE4 = &r2_n->w101FC;
	sp_n->dwFFFFFFE0 = 0x30;
	sp_n->dwFFFFFFDC = r2_n->dw101F0;
	sp_n->dwFFFFFFD8 = 0x00;
	(*((word32) *pc + 2))();
	struct Eq_n * r0_n;
	*r0_n->ptr5150 = r0_n->ptr5150 | *g_ptr13206;
	if ((r0_n & 0x01) != 0x00)
	{
		struct Eq_n * r2_n;
		r2_n->dw101F4 = 0x01;
	}
	else
	{
		struct Eq_n * sp_n;
		word32 r1_n;
		sp_n->dwFFFFFFFC = r1_n;
		word32 r4_n;
		sp_n->dwFFFFFFF8 = r4_n + 1011;
		struct Eq_n * ap_n;
		struct Eq_n * fp_n;
		word32 r3_n;
		word32 r4_n;
		word32 ap_n;
		word32 fp_n;
		fn0000C022(ap_n, fp_n, out r3_n, out r4_n, out ap_n, out fp_n);
	}
}

<unknown> g_tB518 = // 0000B518;
// 0000B86E: void fn0000B86E(Register (ptr32 ptr32) pc)
void fn0000B86E(ptr32 * pc)
{
	struct Eq_n * r1_n;
	struct Eq_n * r1_n;
	(*((word32) *pc + 2))();
	struct Eq_n * r1_n = SEQ(SLICE(r1_n, word16, 16), (word16) r1_n | r1_n->w50D07FFE);
	ui32 r0_n;
	struct Eq_n * sp_n;
	struct Eq_n * ap_n;
	struct Eq_n * r2_n;
	if ((r0_n & 0x01) == 0x00)
	{
		sp_n->dwFFFFFFFC = r1_n;
		word32 r3_n;
		sp_n->dwFFFFFFF8 = r3_n + 0x04A4;
		struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
		struct Eq_n * fp_n;
		word32 r3_n;
		word32 r4_n;
		struct Eq_n * ap_n;
		struct Eq_n * fp_n;
		sp_n->dwFFFFFFFC = fn0000C022(ap_n, fp_n, out r3_n, out r4_n, out ap_n, out fp_n)->ptr0138->ptr000C;
		sp_n->dwFFFFFFF8 = r3_n + 1222;
		word32 r3_n;
		word32 r4_n;
		word32 fp_n;
		r2_n = fn0000C022(ap_n, fp_n, out r3_n, out r4_n, out ap_n, out fp_n);
		sp_n = (struct Eq_n *) <invalid>;
	}
	r2_n->ptr0138->t0022.u0 = ap_n->t0008.u0;
	struct Eq_n * r0_n = r2_n->ptr0138;
	r0_n->dw0028 = ap_n->dw0004;
	sp_n->dwFFFFFFFC = r2_n->ptr0138;
	ptr32 * pc_n;
	(*((word32) *pc_n + 2))();
	uipr32 r1_n = SEQ(SLICE(r1_n, word16, 16), r1_n->w50D07FFE);
	ui32 r0_n;
	if ((r0_n & 0x01) != 0x00)
		return;
	struct Eq_n * sp_n;
	sp_n->dwFFFFFFFC = r1_n;
	word32 r3_n;
	sp_n->dwFFFFFFF8 = r3_n + 1223;
	struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
	struct Eq_n * ap_n;
	struct Eq_n * fp_n;
	word32 r3_n;
	word32 r4_n;
	struct Eq_n * ap_n;
	struct Eq_n * fp_n;
	sp_n->dwFFFFFFFC = fn0000C022(ap_n, fp_n, out r3_n, out r4_n, out ap_n, out fp_n)->ptr0138->ptr000C;
	sp_n->dwFFFFFFF8 = r3_n + 0x04EA;
	word32 r3_n;
	word32 r4_n;
	word32 ap_n;
	word32 fp_n;
	fn0000C022(ap_n, fp_n, out r3_n, out r4_n, out ap_n, out fp_n);
}

// 0000B8F6: void fn0000B8F6(Register word32 ap, Register (ptr32 ptr32) pc)
void fn0000B8F6(word32 ap, ptr32 * pc)
{
	struct Eq_n * r1_n;
	struct Eq_n * r1_n;
	if (*(int32 *) ~0x4C23 == 0x00)
	{
		(*((word32) *pc + 2))();
		struct Eq_n * r1_n = SEQ(SLICE(r1_n, word16, 16), (word16) r1_n | r1_n->w50D07FFE);
		ui32 r0_n;
		struct Eq_n * sp_n;
		struct Eq_n * ap_n;
		struct Eq_n * r3_n;
		if ((r0_n & 0x01) == 0x00)
		{
			sp_n->dwFFFFFFFC = r1_n;
			word32 r4_n;
			sp_n->dwFFFFFFF8 = r4_n + 1261;
			struct Eq_n * fp_n;
			struct Eq_n * r3_n;
			word32 r4_n;
			struct Eq_n * ap_n;
			struct Eq_n * fp_n;
			fn0000C022(ap_n, fp_n, out r3_n, out r4_n, out ap_n, out fp_n);
			struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
			sp_n->dwFFFFFFFC = r3_n->ptr0138->ptr000C;
			sp_n->dwFFFFFFF8 = r4_n + 0x050F;
			word32 r4_n;
			word32 fp_n;
			fn0000C022(ap_n, fp_n, out r3_n, out r4_n, out ap_n, out fp_n);
			sp_n = (struct Eq_n *) <invalid>;
		}
		r3_n->ptr0138->t0022.u0 = ap_n->t0008.u0;
		struct Eq_n * r0_n = r3_n->ptr0138;
		r0_n->dw0028 = ap_n->dw0004;
		sp_n->dwFFFFFFFC = r3_n->ptr0138;
		ptr32 * pc_n;
		(*((word32) *pc_n + 2))();
		uip32 r1_n = SEQ(SLICE(r1_n, word24, 8), (byte) r1_n | r1_n->b50D07FFE);
		ui32 r0_n;
		if ((r0_n & 0x01) != 0x00)
			return;
		struct Eq_n * sp_n;
		sp_n->dwFFFFFFFC = r1_n;
		word32 r4_n;
		sp_n->dwFFFFFFF8 = r4_n + 0x0510;
		struct Eq_n * ap_n;
		struct Eq_n * fp_n;
		struct Eq_n * r3_n;
		word32 r4_n;
		struct Eq_n * ap_n;
		struct Eq_n * fp_n;
		fn0000C022(ap_n, fp_n, out r3_n, out r4_n, out ap_n, out fp_n);
		struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
		sp_n->dwFFFFFFFC = r3_n->ptr0138->ptr000C;
		sp_n->dwFFFFFFF8 = r4_n + 0x0531;
		word32 r3_n;
		word32 r4_n;
		word32 ap_n;
		word32 fp_n;
		fn0000C022(ap_n, fp_n, out r3_n, out r4_n, out ap_n, out fp_n);
	}
	else
	{
		ptr32 r0_n = g_ptr7C09;
		(*((word32) r0_n + 2))();
		struct Eq_n * sp_n;
		sp_n->dwFFFFFFFC = 0x00;
		sp_n->dwFFFFFFF8 = 0x01;
		word32 r4_n;
		sp_n->dwFFFFFFF4 = r4_n + 0x04EB;
		struct Eq_n * r2_n;
		sp_n->ptrFFFFFFF0 = r2_n;
		ptr32 r0_n = r2_n->ptrC839;
		(*((word32) r0_n + 2))();
	}
}

// 0000B9BA: void fn0000B9BA()
void fn0000B9BA()
{
	(*((word32) *(ptr32 *) 4294932844 + 2))();
	word32 r0_n;
	if (r0_n != 0x00)
		return;
	struct Eq_n * r2_n;
	if (r2_n->dw000C != 0x00)
		return;
	struct Eq_n * ap_n;
	(*((word32) ap_n->ptr10198 + 2))();
}

<unknown> g_tB9EC = // 0000B9EC;
// 0000BBB2: void fn0000BBB2(Register (ptr32 Eq_n) ap)
void fn0000BBB2(struct Eq_n * ap)
{
	if (ap->ptr0004->dw0010 <= 0x01)
		;
}

// 0000BC8A: void fn0000BC8A()
// Called from:
//      fn000173CA
void fn0000BC8A()
{
	(*((word32) g_ptr192A0 + 2))();
	struct Eq_n * fp_n;
	word32 r0_n;
	fp_n->dwFFFFFFF8 = r0_n;
	struct Eq_n * sp_n;
	sp_n->ptrFFFFFFFC = &fp_n->dwFFFFFFF8;
	(*((word32) g_ptr192A4 + 2))();
}

// 0000BDC2: void fn0000BDC2()
// Called from:
//      fn00010E6A
void fn0000BDC2()
{
}

// 0000C022: Register word32 fn0000C022(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register out (ptr32 Eq_n) r3Out, Register out word32 r4Out, Register out (ptr32 Eq_n) apOut, Register out word32 fpOut)
// Called from:
//      fn0000B192
//      fn0000B86E
//      fn0000B8F6
word32 fn0000C022(struct Eq_n * ap, struct Eq_n * fp, struct Eq_n & r3Out, word32 & r4Out, struct Eq_n & apOut, word32 & fpOut)
{
	struct Eq_n * fp_n;
	struct Eq_n * fp_n;
	struct Eq_n * fp_n;
	fp->wFFFFFFF0 = 0xFF;
	fp->bFFFFFFF2 = 0x0E;
	fp->bFFFFFFF3 = 0x01;
	fp->ptrFFFFFFF4 = (<unknown>*) ~0x8262;
	fp->dwFFFFFFF8 = 0x00;
	(*((word32) g_ptr1932C + 2))();
	ui32 r0_n;
	struct Eq_n * sp_n;
	struct Eq_n * ap_n;
	word32 r4_n;
	word32 r2_n;
	if ((r0_n & 0x01) != 0x00)
	{
		int32 r0_n = fp_n->dwFFFFFFF8;
		ptr32 r3_n;
		*((word32) (r3_n + 0x000105C5) + r0_n) = (ptr32) 0<32>;
		sp_n->dwFFFFFFFC = 0x01;
		sp_n->ptrFFFFFFF8 = r3_n + 0x000105C5;
		sp_n->dwFFFFFFF4 = ap_n->dw0004;
		sp_n->dwFFFFFFF0 = r4_n + 0x066A;
		sp_n->dwFFFFFFEC = 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 r0_n = r2_n->ptrC839;
		(*((word32) r0_n + 2))();
		word32 fp_n = fp_n->dw000C;
		struct Eq_n * ap_n = fp_n->ptr0008;
		struct Eq_n * r3_n;
		r3Out = r3_n;
		word32 r4_n;
		r4Out = r4_n;
		apOut = ap_n;
		fpOut = fp_n;
		word32 r2_n;
		return r2_n;
	}
	else
	{
		sp_n->dwFFFFFFFC = 0x01;
		sp_n->ptrFFFFFFF8 = ap_n->ptr0008;
		sp_n->dwFFFFFFF4 = ap_n->dw0004;
		sp_n->dwFFFFFFF0 = r4_n + 1619;
		sp_n->dwFFFFFFEC = 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 r0_n = r2_n->ptrC839;
		(*((word32) r0_n + 2))();
		word32 fp_n = fp_n->dw000C;
		struct Eq_n * ap_n = fp_n->ptr0008;
		struct Eq_n * r3_n;
		r3Out = r3_n;
		word32 r4_n;
		r4Out = r4_n;
		apOut = ap_n;
		fpOut = fp_n;
		word32 r2_n;
		return r2_n;
	}
}

// 0000C0CE: void fn0000C0CE(Register (ptr32 Eq_n) ap)
// Called from:
//      fn000108D2
void fn0000C0CE(struct Eq_n * ap)
{
	ptr32 fp;
	struct Eq_n * sp_n = fp - 0x04;
	struct Eq_n * r6_n = (struct Eq_n *) ~0x00018827;
	if (*(word32 *) ~0x7DAF == 0x00)
	{
		(*((word32) g_ptr192D4 + 2))();
		word32 r0_n;
		if (r0_n == 0x00)
		{
			sp_n->ptrFFFFFFFC = (char *) &r6_n->dw102EC + 0x06D9;
			ptr32 * pc_n;
			(*((word32) *pc_n + 2))();
		}
	}
	struct Eq_n * sp_n = sp_n - 0x04;
	sp_n->dw0000 = ap->dw0004;
	sp_n->ptrFFFFFFFC = (char *) &r6_n->dw102EC + 0x05D9;
	(*((word32) g_ptr192BC + 2))();
	struct Eq_n * r6_n;
	r6_n->dw10A78 = 0x01;
}

// 0000C1FE: void fn0000C1FE(Register (ptr32 ptr32) pc)
void fn0000C1FE(ptr32 * pc)
{
	if (*(word32 *) ~0x7D83 == ~0x00)
	{
		*(word32 *) ~0x7D83 = 0x00;
		(*((word32) *pc + 2))();
		struct Eq_n * r11_n;
		ui32 r6_n;
		struct Eq_n * r2_n;
		*((char *) &r11_n->aFFFFF08F[0].u0 + r6_n * 2) = atomic_fetch_add<word32>(r11_n->aFFFFF08F[0].u0, r2_n->t50E97FFE.u0);
	}
	else
	{
		int32 r0_n = (*(struct Eq_n **) ~0x4648)->dw000C;
		if (r0_n > 0x10)
			fn0000F457();
		else
			g_aC334[r0_n]();
	}
}

Eq_n g_aC334[] = // 0000C334
	{
	};
<unknown> g_tC428 = // 0000C428;
// 0000C6FA: Register (ptr32 Eq_n) fn0000C6FA(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register out (ptr32 Eq_n) r2Out, Register out Eq_n r3Out, Register out (ptr32 Eq_n) r7Out, Register out (ptr32 Eq_n) r8Out, Register out ui32 r9Out, Register out word32 r10Out, Register out (ptr32 Eq_n) apOut, Register out word32 fpOut)
// Called from:
//      fn0000802E
//      fn00008322
//      fn000108D2
struct Eq_n * fn0000C6FA(struct Eq_n * ap, struct Eq_n * fp, struct Eq_n & r2Out, union Eq_n & r3Out, struct Eq_n & r7Out, struct Eq_n & r8Out, ui32 & r9Out, word32 & r10Out, struct Eq_n & apOut, word32 & fpOut)
{
	Eq_n r0_n;
	struct Eq_n * fp_n;
	struct Eq_n * fp_n;
	struct Eq_n * fp_n;
	struct Eq_n * r6_n;
	struct Eq_n * fp_n;
	word32 r10_n = g_dw19370;
	ui32 r9_n = ap->t0008.u0 & 0x07;
	if (r9_n == 0x00)
	{
		fp->wFFFFFFD8 = 0x00;
		fp->wFFFFFFDA = 0x03;
		fp->dwFFFFFFDC = 0x00;
		fp->wFFFFFFE0 = 0x00;
		fp->wFFFFFFE2 = 0x04;
		fp->dwFFFFFFE4 = 0x00;
		fp->wFFFFFFE8 = 0x00;
		fp->wFFFFFFEA = 0x05;
		fp->qwFFFFFFEC = 0x00;
		fp->qwFFFFFFF4 = 0x00;
		*(byte **) ~0x7B3B = (byte *) ~0x7D6B;
		*(byte **) ~0x7B63 = *(byte **) ~0x7B3B;
		*(byte **) ~0x7B67 = *(byte **) ~0x7B63;
		*(byte **) ~0x7B4B = *(byte **) ~0x7B67;
		*(word32 *) ~0x7B3F = 0x00;
		*(word64 *) ~0x7B5B = 0x00;
		fp->ptrFFFFFFD4 = ap->ptr0004;
		(*((word32) g_ptr192C4 + 2))();
		struct Eq_n * fp_n;
		word32 r0_n;
		fp_n->wFFFFFFD0 = (word16) r0_n;
		struct Eq_n * r2_n = (uint32) (word16) r0_n;
		if (r2_n <= (struct Eq_n *) 0xFF)
		{
			struct Eq_n * sp_n;
			sp_n->ptrFFFFFFFC = &fp_n->wFFFFFFD0 + 20;
			sp_n->ptrFFFFFFF8 = &fp_n->wFFFFFFD0 + 4;
			sp_n->ptrFFFFFFF4 = &fp_n->wFFFFFFD0;
			ptr32 * pc_n;
			(*((word32) *pc_n + 2))();
			struct Eq_n * r0_n;
			struct Eq_n * r2_n;
			r0_n->ptr5003->u0 = (int32) __ashift<word32,word32>(0x04, r2_n->ptr50E87FFE);
			word32 fp_n = fp_n->dw000C;
			struct Eq_n * ap_n = fp_n->ptr0008;
			r2Out = r2_n;
			Eq_n r3_n;
			r3Out = r3_n;
			struct Eq_n * r7_n;
			r7Out = r7_n;
			struct Eq_n * r8_n;
			r8Out = r8_n;
			ui32 r9_n;
			r9Out = r9_n;
			word32 r10_n;
			r10Out = r10_n;
			apOut = ap_n;
			fpOut = fp_n;
			return r0_n;
		}
		else
		{
			word32 fp_n = fp_n->dw000C;
			struct Eq_n * ap_n = fp_n->ptr0008;
			r2Out = r2_n;
			Eq_n r3_n;
			r3Out = r3_n;
			struct Eq_n * r7_n;
			r7Out = r7_n;
			struct Eq_n * r8_n;
			r8Out = r8_n;
			ui32 r9_n;
			r9Out = r9_n;
			word32 r10_n;
			r10Out = r10_n;
			apOut = ap_n;
			fpOut = fp_n;
			return (struct Eq_n *) 0x04;
		}
	}
	if (r9_n == 0x01)
	{
		(*((word32) g_ptr192C4 + 2))();
		up32 r0_n;
		struct Eq_n * r6_n;
		struct Eq_n * fp_n;
		Eq_n r3_n;
		struct Eq_n * r7_n;
		struct Eq_n * r8_n;
		ui32 r9_n;
		word32 r10_n;
		if (r0_n + r6_n->dw10CE8 <= 242)
		{
			if (r6_n->dw10CE8 == 0x00)
			{
				r6_n->ptr10CEC = (struct Eq_n *) ((char *) r6_n + 68284);
				r6_n->ptr10CC4 = r6_n->ptr10CEC;
				r6_n->ptr10CC0 = r6_n->ptr10CC4;
				r6_n->qw10CCC = 0x00;
			}
			r6_n->ptr10CDC = r6_n->ptr10CEC;
			struct Eq_n * r2_n = null;
			if (r6_n->dw10CE4 == 0x00)
				r2_n = (struct Eq_n *) 0x01;
			r6_n->ptr10CE0 = r2_n;
			word32 v67_n = r6_n->dw10CD8;
			r6_n->dw10CD0 = v67_n;
			if (v67_n != 0x00)
			{
				r2_n = r6_n->ptr10CDC;
				r2_n->bFFFFFFFF = 0x2E;
			}
			r6_n->ptr10CDC->b0000 = 0x00;
			word32 fp_n = fp_n->dw000C;
			struct Eq_n * ap_n = fp_n->ptr0008;
			r2Out = r2_n;
			r3Out = r3_n;
			r7Out = r7_n;
			r8Out = r8_n;
			r9Out = r9_n;
			r10Out = r10_n;
			apOut = ap_n;
			fpOut = fp_n;
			return null;
		}
		else
		{
			word32 fp_n = fp_n->dw000C;
			struct Eq_n * ap_n = fp_n->ptr0008;
			struct Eq_n * r2_n;
			r2Out = r2_n;
			r3Out = r3_n;
			r7Out = r7_n;
			r8Out = r8_n;
			r9Out = r9_n;
			r10Out = r10_n;
			apOut = ap_n;
			fpOut = fp_n;
			return (struct Eq_n *) 0x04;
		}
	}
	switch (r9_n)
	{
	case 0x02:
	case 0x03:
		if ((ap->t0008.u0 & 0x08) == 0x00)
		{
			**(byte **) ~0x7B4B = 0x00;
			struct Eq_n * sp_n;
			struct Eq_n * ap_n;
			if (*(int32 *) ~0x7B57 != 0x00)
			{
				(*(byte **) ~0x7B63)[*(int32 *) ~0x7B57 - 0x01] = 0x5D<32>;
				sp_n = (struct Eq_n *) <invalid>;
				word32 r2_n;
				word32 r4_n;
				word32 r5_n;
				struct Eq_n * r6_n;
				word32 r7_n;
				word32 fp_n;
				if (fn0000E2EA(ap, fp, out r2_n, out r4_n, out r5_n, out r6_n, out r7_n, out ap_n, out fp_n) != 0x00)
				{
					r6_n->dw10CF0 = 0x00;
					sp_n->dwFFFFFFFC = null;
					sp_n->dwFFFFFFF8 = (char *) r6_n + 68284;
					(*((word32) g_ptr19284 + 2))();
					word32 r0_n;
					struct Eq_n * r6_n;
					if (r0_n != 0x00)
					{
						word32 * r10_n;
						if (*r10_n != 0x11)
							r6_n->dw10CF0 = 0x01;
					}
					else
						r6_n->dw10AB8 = 0x01;
					struct Eq_n * sp_n;
					sp_n->ptrFFFFFFFC = &r6_n->dw10AB8 + 1;
					sp_n->ptrFFFFFFF8 = &r6_n->dw10AB8 + 65;
					(*((word32) g_ptr192BC + 2))();
				}
			}
			else
			{
				(*((word32) g_ptr192D4 + 2))();
				word32 r0_n;
				if (r0_n != 0x00)
				{
					word32 r8_n;
					sp_n->dwFFFFFFFC = r8_n + 1717;
					word32 r6_n;
					sp_n->dwFFFFFFF8 = r6_n + 0x00010BBC;
					(*((word32) g_ptr192BC + 2))();
					struct Eq_n * r6_n;
					r6_n->dw10CF0 = 0x00;
					struct Eq_n * sp_n;
					sp_n->dwFFFFFFFC = 0x00;
					sp_n->ptrFFFFFFF8 = (char *) r6_n + 0x00010BBC;
					(*((word32) g_ptr19284 + 2))();
					word32 r0_n;
					word32 * r10_n;
					if (r0_n != 0x00 && *r10_n != 0x11)
					{
						struct Eq_n * r6_n;
						r6_n->dw10CF0 = 0x01;
					}
				}
			}
			sp_n->dwFFFFFFFC = ap_n->ptr0004;
			(*((word32) g_ptr192C4 + 2))();
			struct Eq_n * r2_n = r6_n->dw10CDC - ((char *) r6_n + 68284);
			up32 r0_n;
			if (&r2_n->b0000 + r0_n <= 0xFF)
			{
				struct Eq_n * sp_n;
				struct Eq_n * ap_n;
				sp_n->dwFFFFFFFC = ap_n->dw0004;
				sp_n->dwFFFFFFF8 = r6_n->dw10CDC;
				(*((word32) g_ptr192BC + 2))();
				struct Eq_n * sp_n;
				struct Eq_n * ap_n;
				sp_n->dwFFFFFFFC = ap_n->dw0004;
				(*((word32) g_ptr192C4 + 2))();
				struct Eq_n * r6_n;
				word32 r0_n;
				r6_n->dw10CDC += r0_n;
				word32 fp_n = fp_n->dw000C;
				struct Eq_n * ap_n = fp_n->ptr0008;
				struct Eq_n * r2_n;
				r2Out = r2_n;
				Eq_n r3_n;
				r3Out = r3_n;
				struct Eq_n * r7_n;
				r7Out = r7_n;
				struct Eq_n * r8_n;
				r8Out = r8_n;
				ui32 r9_n;
				r9Out = r9_n;
				word32 r10_n;
				r10Out = r10_n;
				apOut = ap_n;
				fpOut = fp_n;
				return null;
			}
			else
			{
				word32 fp_n = fp_n->dw000C;
				struct Eq_n * ap_n = fp_n->ptr0008;
				r2Out = r2_n;
				Eq_n r3_n;
				r3Out = r3_n;
				struct Eq_n * r7_n;
				r7Out = r7_n;
				struct Eq_n * r8_n;
				r8Out = r8_n;
				ui32 r9_n;
				r9Out = r9_n;
				word32 r10_n;
				r10Out = r10_n;
				apOut = ap_n;
				fpOut = fp_n;
				return (struct Eq_n *) 0x01;
			}
		}
		break;
	case 0x04:
		struct Eq_n * r2;
		Eq_n r3;
		if (*(word32 *) ~0x7B37 == 0x00)
		{
			**(byte **) ~0x7B4B = 0x00;
			(*((word32) g_ptr192BC + 2))();
			word32 fp_n = fp_n->dw000C;
			struct Eq_n * ap_n = fp_n->ptr0008;
			struct Eq_n * r2_n;
			r2Out = r2_n;
			Eq_n r3_n;
			r3Out = r3_n;
			struct Eq_n * r7_n;
			r7Out = r7_n;
			struct Eq_n * r8_n;
			r8Out = r8_n;
			ui32 r9_n;
			r9Out = r9_n;
			word32 r10_n;
			r10Out = r10_n;
			apOut = ap_n;
			fpOut = fp_n;
			return null;
		}
		else
		{
			word32 fp_n = fp->dw000C;
			struct Eq_n * ap_n = fp->ptr0008;
			r2Out = r2;
			r3Out = r3;
			r7Out = (struct Eq_n *) 4294947792;
			r8Out = (struct Eq_n *) ~0x0001A0C7;
			r9Out = r9_n;
			r10Out = r10_n;
			apOut = ap_n;
			fpOut = fp_n;
			return (struct Eq_n *) 0x03;
		}
		break;
	case 0x05:
		word32 fp_n = fp->dw000C;
		struct Eq_n * ap_n = fp->ptr0008;
		r2Out = r2;
		r3Out = r3;
		r7Out = (struct Eq_n *) 4294947792;
		r8Out = (struct Eq_n *) ~0x0001A0C7;
		r9Out = r9_n;
		r10Out = r10_n;
		apOut = ap_n;
		fpOut = fp_n;
		return null;
	default:
		word32 fp_n = fp->dw000C;
		struct Eq_n * ap_n = fp->ptr0008;
		r2Out = r2;
		r3Out = r3;
		r7Out = (struct Eq_n *) 4294947792;
		r8Out = (struct Eq_n *) ~0x0001A0C7;
		r9Out = r9_n;
		r10Out = r10_n;
		apOut = ap_n;
		fpOut = fp_n;
		return (struct Eq_n *) 99;
	}
	(*((word32) g_ptr192C4 + 2))();
	Eq_n r3_n = r0_n;
	struct Eq_n * r6_n;
	if (r6_n->dw10CE0 != 0x00)
	{
		struct Eq_n * r2_n = r6_n->ptr10CDC;
		r6_n->ptr10CDC = &r6_n->ptr10CDC->b0000 + 1;
		r2_n->b0000 = 0x5B;
		if (r0_n != 0x00)
		{
			struct Eq_n * r2_n = r6_n->ptr10CDC;
			r6_n->ptr10CDC = &r6_n->ptr10CDC->b0000 + 1;
			r2_n->b0000 = 0x2E;
		}
		r6_n->dw10CE0 = 0x00;
	}
	struct Eq_n * ap_n;
	struct Eq_n * fp_n;
	struct Eq_n * r7_n;
	struct Eq_n * r8_n;
	ui32 r9_n;
	word32 r10_n;
	if (r0_n != 0x01 || (ap_n->ptr0004)->b0000 != 0x2E)
	{
		if (r0_n == 0x02)
		{
			struct Eq_n * r2_n = ap_n->ptr0004;
			if (r2_n->b0000 == 0x2E && r2_n->b0001 == 0x2E)
			{
				struct Eq_n * r2_n = r6_n->ptr10CDC;
				r6_n->ptr10CDC = &r6_n->ptr10CDC->b0000 + 1;
				r2_n->b0000 = 0x2D;
				struct Eq_n * r2_n = r6_n->ptr10CDC;
				r6_n->ptr10CDC = &r6_n->ptr10CDC->b0000 + 1;
				r2_n->b0000 = 0x2E;
				goto l0000CA7C;
			}
		}
		struct Eq_n * r2_n = (struct Eq_n *) (r0_n.u0 + (r6_n->ptr10CDC - r6_n->dw10CBC));
		if (r2_n > (struct Eq_n *) 0xFF)
		{
			word32 fp_n = fp_n->dw000C;
			struct Eq_n * ap_n = fp_n->ptr0008;
			r2Out = r2_n;
			r3Out = r0_n;
			r7Out = r7_n;
			r8Out = r8_n;
			r9Out = r9_n;
			r10Out = r10_n;
			apOut = ap_n;
			fpOut = fp_n;
			return (struct Eq_n *) 0x04;
		}
		struct Eq_n * sp_n;
		sp_n->ptrFFFFFFFC = ap_n->ptr0004;
		sp_n->ptrFFFFFFF8 = r6_n->ptr10CDC;
		(*((word32) g_ptr192BC + 2))();
		r6_n->ptr10CDC += r3_n;
		r6_n->ptr10CDC->b0000 = 0x2E;
		r6_n->ptr10CDC = &r6_n->ptr10CDC->b0000 + 1;
	}
l0000CA7C:
	struct Eq_n * r2_n = r6_n->ptr10CDC;
	r6_n->dw10CD0 = r2_n - r6_n->dw10CC4;
	r2_n->b0000 = 0x00;
	struct Eq_n * sp_n = fp_n - 0x04;
	word32 fp_n = sp_n->dw0010;
	struct Eq_n * ap_n = sp_n->ptr000C;
	r2Out = r2_n;
	r3Out = r3_n;
	r7Out = r7_n;
	r8Out = r8_n;
	r9Out = r9_n;
	r10Out = r10_n;
	apOut = ap_n;
	fpOut = fp_n;
	return null;
}

struct Eq_n g_tC701 = // 0000C701
	{
		&g_bFFFD9833,
		&g_bC4EF9E58,
		0x57FFFEEC,
		~0x33A20061,
		0x9E5A0000,
		~0x024F4110,
		2412467967,
		0x01F03103,
		2966990260,
		0xD4DAAD03,
		0xAD04B0E0,
		~0x1B522B1D,
		2095754501,
		~0x52831352,
		3169246964,
		68844,
		0xD000010C,
		0x010CC4E6,
		0x0CC0E600,
		-0x192FFFFF,
		0x00010CC0,
		0x010CDCE6,
		0xE8E6D400,
		&g_ptrACDDD4AD,
		&g_ptrD0AD50B0,
		&g_ptrD152503C,
		&g_ptr9EFF72CD,
		&g_ptr4ACD004,
		&g_ptr9553D457,
		&g_ptr12C1367,
		0x08120000,
		0x115301D0,
		0x0150D50C,
		1569673937,
		0x13000000,
		0x53D4,
		0x5600,
		0xD501,
		3511813308,
		0x00,
		1810,
		464,
		78434324,
		0x122D,
		0xD550,
		36811,
		~0x0999FE04,
		1562006100,
		0x91051325,
		0x04122A51,
	};
<unknown> g_tCCB0 = // 0000CCB0;
// 0000CE52: Register word32 fn0000CE52(Register word32 r3, Register (ptr32 Eq_n) ap, Register out (ptr32 Eq_n) apOut, Register out word32 fpOut)
// Called from:
//      fn0000D0D6
//      fn0000D69A
word32 fn0000CE52(word32 r3, struct Eq_n * ap, struct Eq_n & apOut, word32 & fpOut)
{
	struct Eq_n * fp_n;
	int32 r0_n = ap->dw0004;
	uip32 r3_n;
	if (r0_n == 0x01)
		r3_n = SEQ(SLICE(r3, word24, 8), 0x01);
	else
	{
		uip32 r0_n;
		if (r0_n != 0x02 && (r0_n < 0x09 || r0_n > 11) && (r0_n < 0x50 || r0_n > 0x52))
			r0_n = SEQ(SLICE(r0_n, word24, 8), 0x04);
		else
			r0_n = SEQ(SLICE(r0_n, word24, 8), 0x02);
		r3_n = SEQ(SLICE(r3, word24, 8), (byte) r0_n);
	}
	int32 r1_n = (int32) (int8) r3_n;
	ui32 r2_n;
	if (ap->dw0004 == 0x00)
		r2_n = 0x01;
	else
		r2_n = ap->dw0004 << 4 | 0x7FFF0000 | r1_n;
	(*((word32) g_ptr1928C + 2))();
	word32 fp_n = fp_n->dw000C;
	apOut = fp_n->ptr0008;
	fpOut = fp_n;
	word32 r3_n;
	return r3_n;
}

// 0000CEBE: void fn0000CEBE(Register word32 fp, Register (ptr32 ptr32) pc)
void fn0000CEBE(word32 fp, ptr32 * pc)
{
	if (*(int32 *) ~0x7B33 >= 0x00)
		return;
	(*((word32) *pc + 2))();
	struct Eq_n * r0_n;
	struct Eq_n * sp_n;
	*r0_n->ptr5350 = *sp_n->ptr7FFE;
	struct Eq_n * fp_n;
	if ((r0_n & 0x01) != 0x00)
	{
		sp_n->qwFFFFFFF8 = 0x00;
		sp_n->qwFFFFFFF0 = 0x00;
		sp_n->dwFFFFFFEC = 0x08;
		sp_n->dwFFFFFFE8 = (char *) fp_n - 22;
		sp_n->qwFFFFFFE0 = 0x00;
		sp_n->dwFFFFFFDC = &fp_n->wFFFFFFF2;
		sp_n->dwFFFFFFD8 = 0x27;
		sp_n->dwFFFFFFD4 = (int32) fp_n->wFFFFFFFA;
		sp_n->dwFFFFFFD0 = 0x00;
		ptr32 * pc_n;
		(*((word32) *pc_n + 2))();
		__halt();
	}
	ui32 r3_n;
	uint32 r1_n;
	if ((r3_n & 0x01) != 0x00 && ((int32) fp_n->wFFFFFFF2 & 0x01) != 0x00)
	{
		uint32 r0_n = (uint32) fp_n->bFFFFFFF1;
		if (r0_n >= 0x05)
		{
			r1_n = r0_n;
l0000CF2F:
			struct Eq_n * r2_n;
			r2_n->dw10CF4 = r1_n;
			return;
		}
	}
	r1_n = 0x18;
	goto l0000CF2F;
}

// 0000CF42: Register word32 fn0000CF42(Register word32 fp, Register out word32 apOut)
// Called from:
//      fn00008322
word32 fn0000CF42(word32 fp, word32 & apOut)
{
	(*((word32) g_ptr192D0 + 2))();
	struct Eq_n * sp_n;
	word32 fp_n;
	sp_n->dwFFFFFFFC = fp_n + -44;
	struct Eq_n * r2_n;
	ptr32 r4_n;
	if (r2_n->b06D4 >= 0x36)
		r4_n = &r2_n->b06D4 + 11;
	else
		r4_n = &r2_n->b06D4 + 7;
	sp_n->ptrFFFFFFF8 = r4_n;
	sp_n->ptrFFFFFFF4 = (char *) r2_n + 0x06D2;
	sp_n->ptrFFFFFFF0 = (char *) r2_n + 0x06CC;
	sp_n->ptrFFFFFFEC = (<unknown>*) ~0x4CFB;
	word32 r3_n;
	sp_n->dwFFFFFFE8 = r3_n + 1515;
	(*((word32) g_ptr192D0 + 2))();
	struct Eq_n * sp_n;
	sp_n->dwFFFFFFFC = 0x00;
	word32 r0_n;
	sp_n->dwFFFFFFF8 = r0_n;
	struct Eq_n * r3_n;
	sp_n->dwFFFFFFF4 = (char *) r3_n + 1515;
	sp_n->ptrFFFFFFF0 = r3_n;
	ptr32 ap_n = r3_n->ptrC839;
	(*((word32) ap_n + 2))();
	struct Eq_n * fp_n;
	apOut = fp_n->dw0008;
	word32 r2_n;
	return r2_n;
}

// 0000CFBA: Register word32 fn0000CFBA(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register out up32 r2Out, Register out (ptr32 Eq_n) r3Out, Register out word32 r6Out, Register out (ptr32 Eq_n) apOut, Register out (ptr32 Eq_n) fpOut)
// Called from:
//      fn0000AA6A
//      fn0000B072
word32 fn0000CFBA(struct Eq_n * ap, struct Eq_n * fp, up32 & r2Out, struct Eq_n & r3Out, word32 & r6Out, struct Eq_n & apOut, struct Eq_n & fpOut)
{
	struct Eq_n * fp_n;
	struct Eq_n * ap_n;
	word32 r6_n;
	word32 r3_n;
	struct Eq_n * r3_n = ap->ptr0004;
	up32 r2_n = ap->dw0008;
	if (r2_n != 0x00)
	{
		up32 r2_n = fn0000D39E(fp, out r3_n, out r6_n, out ap_n, out fp_n);
		struct Eq_n * r3_n = ~r3_n;
		if (ap_n->dw000C < 0x08)
		{
			if (ap_n->dw000C == 0x00)
			{
				struct Eq_n * fp_n = fp_n->ptr000C;
				struct Eq_n * ap_n = fp_n->ptr0008;
				r2Out = r2_n;
				r3Out = r3_n;
				r6Out = r6_n;
				apOut = ap_n;
				fpOut = fp_n;
				return ~r3_n;
			}
		}
	}
	else
	{
		struct Eq_n * fp_n = fp->ptr000C;
		struct Eq_n * ap_n = fp->ptr0008;
		r2Out = r2_n;
		r3Out = r3_n;
		word32 r6;
		r6Out = r6;
		apOut = ap_n;
		fpOut = fp_n;
		return 0x00;
	}
}

// 0000D0D6: Register (ptr32 byte) fn0000D0D6(Register (ptr32 Eq_n) ap, Register out word32 apOut, Register out word32 fpOut)
// Called from:
//      fn0000802E
byte * fn0000D0D6(struct Eq_n * ap, word32 & apOut, word32 & fpOut)
{
	word32 r7_n;
	word32 * r0_n;
	struct Eq_n * ap_n;
	byte * r3_n;
	int8 * r0_n;
	word32 fp_n;
	byte * r0_n;
	(*((word32) g_ptr192CC + 2))();
	byte * r5_n = r0_n;
	ui32 r4_n[];
	if (r0_n != null && (r4_n[(int32) (*r0_n & 0x7F)] & 0x08) != 0x00)
	{
		do
		{
			++r5_n;
			r0_n = (int32) (*r5_n & 0x7F);
		} while ((r4_n[r0_n] & 0x08) != 0x00);
	}
	struct Eq_n * sp_n;
	if (r5_n == null || *r5_n == 0x00)
	{
		struct Eq_n * ap_n;
		sp_n->ptrFFFFFFFC = ap_n->ptr0010;
		(*((word32) g_ptr192CC + 2))();
		r5_n = r0_n;
		ui32 r4_n[];
		if (r0_n != null && (r4_n[(int32) (*r0_n & 0x7F)] & 0x08) != 0x00)
		{
			do
			{
				++r5_n;
				r0_n = (int32) (*r5_n & 0x7F);
			} while ((r4_n[r0_n] & 0x08) != 0x00);
		}
	}
	if (r5_n == null || *r5_n == 0x00)
	{
		struct Eq_n * sp_n = fp_n - 0x04;
		word32 fp_n = sp_n->dw0010;
		apOut = sp_n->dw000C;
		fpOut = fp_n;
		return r0_n;
	}
	else
	{
		sp_n->ptrFFFFFFFC = r5_n;
		(*((word32) g_ptr192C4 + 2))();
		struct Eq_n * sp_n;
		word32 r0_n;
		sp_n->dwFFFFFFFC = r0_n + 0x01;
		(*((word32) g_ptr192B4 + 2))();
		int8 * r3_n = r0_n;
		struct Eq_n * sp_n;
		if (r0_n == null)
		{
			sp_n->dwFFFFFFFC = (struct Eq_n *) ~0x7B27;
			(*((word32) g_ptr19280 + 2))();
			struct Eq_n * sp_n;
			sp_n->dwFFFFFFFC = 0x04;
			word32 r3_n;
			struct Eq_n * ap_n;
			word32 ap_n;
			word32 fp_n;
			r3_n = fn0000CE52(r3_n, ap_n, out ap_n, out fp_n);
			sp_n = (struct Eq_n *) <invalid>;
		}
		struct Eq_n * sp_n = sp_n - 0x04;
		word32 r5_n;
		sp_n->dw0000 = r5_n;
		sp_n->ptrFFFFFFFC = r3_n;
		(*((word32) g_ptr192BC + 2))();
		byte * r2_n = r3_n;
		word32 r6_n = 0x00;
		uip32 r1_n;
		do
		{
			++r6_n;
			byte v30_n = *r2_n;
			ui32 r4_n[];
			if (v30_n != 0x00 && (r4_n[(int32) (v30_n & 0x7F)] & 0x08) == 0x00)
			{
				byte v34_n;
				do
				{
					++r2_n;
					v34_n = *r2_n;
				} while (v34_n != 0x00 && (r4_n[(int32) (v34_n & 0x7F)] & 0x08) == 0x00);
			}
			byte v39_n = *r2_n;
			r1_n = SEQ(SLICE(r1_n, word24, 8), v39_n);
			if (v39_n != 0x00 && (r4_n[(int32) (v39_n & 0x7F)] & 0x08) != 0x00)
			{
				byte v43_n;
				do
				{
					++r2_n;
					v43_n = *r2_n;
					r1_n = SEQ(SLICE(r1_n, word24, 8), v43_n);
				} while (v43_n != 0x00 && (r4_n[(int32) (v43_n & 0x7F)] & 0x08) != 0x00);
			}
		} while ((byte) r1_n != 0x00);
		word32 r2_n = r6_n + *ap_n->ptr0004;
		struct Eq_n * sp_n;
		sp_n->dwFFFFFFFC = r2_n + 0x01 << 2;
		(*((word32) g_ptr192B4 + 2))();
		word32 * r6_n = r0_n;
		int8 * r3_n;
		struct Eq_n * ap_n;
		word32 fp_n;
		if (r0_n == null)
		{
			struct Eq_n * sp_n;
			sp_n->ptrFFFFFFFC = r3_n;
			(*((word32) g_ptr192B0 + 2))();
			struct Eq_n * sp_n;
			sp_n->ptrFFFFFFFC = (struct Eq_n *) ~0x7B27;
			(*((word32) g_ptr19280 + 2))();
			struct Eq_n * sp_n;
			sp_n->dwFFFFFFFC = 0x04;
			word32 r3_n;
			struct Eq_n * ap_n;
			r3_n = fn0000CE52(r3_n, ap_n, out ap_n, out fp_n);
		}
		word32 ** r5_n = ap_n->ptr0008;
		word32 * r2_n = *r5_n;
		*r5_n = (word32 **) ((char *) *r5_n + 4);
		*r6_n = *r2_n;
		word32 * r6_n = r6_n + 1;
		int32 r0_n;
		do
		{
			*r6_n = r3_n;
			++r6_n;
			int32 r0_n = (int32) *r3_n;
			ui32 r4_n[];
			while (r0_n != 0x00 && (r4_n[r0_n & 0x7F] & 0x08) == 0x00)
			{
				++r3_n;
				r0_n = (int32) *r3_n;
			}
			if (r0_n != 0x00)
			{
				*r3_n = 0x00;
				++r3_n;
			}
			r0_n = (int32) *r3_n;
			while (r0_n != 0x00 && (r4_n[r0_n & 0x7F] & 0x08) != 0x00)
			{
				++r3_n;
				r0_n = (int32) *r3_n;
			}
		} while (r0_n != 0x00);
		byte * r0_n = (byte *) &ap_n->ptr0004;
		word32 r7_n = r7_n + *(*r0_n);
		ptr32 v55_n = *r0_n - 0x01;
		**r0_n = (byte) v55_n;
		if (v55_n != null)
		{
			word32 ** r3_n = ap_n->ptr0008;
			ptr32 v58_n;
			do
			{
				word32 * r2_n = *r3_n;
				*r3_n = (word32 **) ((char *) *r3_n + 4);
				*r6_n = *r2_n;
				v58_n = *r0_n - 0x01;
				**r0_n = (byte) v58_n;
				++r6_n;
			} while (v58_n != null);
		}
		*r6_n = 0x00;
		*ap_n->ptr0008 = r6_n;
		*ap_n->ptr0004 = r7_n;
		struct Eq_n * sp_n = fp_n - 0x04;
		word32 fp_n = sp_n->dw0010;
		apOut = sp_n->dw000C;
		fpOut = fp_n;
		return r0_n;
	}
}

// 0000D39E: Register int32 fn0000D39E(Register (ptr32 Eq_n) fp, Register out (ptr32 word32) r3Out, Register out (ptr32 (ptr32 word32)) r6Out, Register out word32 apOut, Register out word32 fpOut)
// Called from:
//      fn0000CFBA
//      fn00010E6A
int32 fn0000D39E(struct Eq_n * fp, word32 & r3Out, word32 & r6Out, word32 & apOut, word32 & fpOut)
{
	word32 ** r6_n = (word32 **) ~0x7AFB;
	word32 * r3;
	int32 r2;
	if (*(word32 **) ~0x7AFB == null)
	{
		(*((word32) g_ptr192B4 + 2))();
		word32 * r0_n;
		if (r0_n != null)
		{
			int32 r4_n;
			r3 = r0_n;
			for (r4_n = 0x00; r4_n <= 0xFF; ++r4_n)
			{
				r2 = r4_n;
				if (true)
				{
					if ((r4_n & 0x01) == 0x00)
						;
				}
				*r3 = r4_n;
				++r3;
			}
			*r6_n = r0_n;
		}
	}
	struct Eq_n * sp_n = fp - 0x04;
	word32 fp_n = sp_n->dw0010;
	word32 ap_n = sp_n->dw000C;
	r3Out = r3;
	r6Out = r6_n;
	apOut = ap_n;
	fpOut = fp_n;
	return r2;
}

// 0000D406: void fn0000D406()
// Called from:
//      fn000108D2
void fn0000D406()
{
	if (*(word32 **) ~0x7AFB != null)
	{
		(*((word32) g_ptr192B0 + 2))();
		word32 * ap_n;
		*ap_n = 0x00;
	}
}

// 0000D422: void fn0000D422()
void fn0000D422()
{
	(*((word32) g_ptr1927C + 2))();
	struct Eq_n * r2_n;
	r2_n->dw0024 = -1;
	word32 r4_n;
	r2_n->dwC60F = r4_n + 2;
	word32 r3_n;
	r2_n->dw0090 = r3_n;
	r2_n->dw0094 = r3_n + 4;
	r2_n->ptr05E7 = (char *) &r2_n->dw0094 + 19;
	r2_n->dwC6E5 = 0x01;
	r2_n->ptrC839 = &g_tD804;
	r2_n->ptrC83D = &g_tDA4C;
	r2_n->ptrC841 = &g_tDA58;
	r2_n->ptrC845 = &g_tDB4C;
}

// 0000D4A2: void fn0000D4A2()
// Called from:
//      fn00010E6A
void fn0000D4A2()
{
	(*((word32) g_ptr19274 + 2))();
	struct Eq_n * r2_n;
	word32 r0_n;
	r2_n->dwC617 = r0_n;
	if (r2_n->dwC617 != ~0x00)
		return;
	struct Eq_n * sp_n;
	sp_n->dwFFFFFFFC = 0x0401;
	sp_n->dwFFFFFFF8 = r2_n->dwC613;
	sp_n->ptrFFFFFFF4 = (union Eq_n *) ~0x7AF7;
	sp_n->ptrFFFFFFF0 = (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))();
}

// 0000D50E: void fn0000D50E()
void fn0000D50E()
{
	if (g_dw79CB > 0x00)
		*(int32 *) 4294947924 += g_dw79CB;
	if (g_dw7C19 <= 0x00)
	{
		if (g_dw79CB < 0x00)
			g_dw79CB = 0x00;
	}
	else
	{
		g_dw79CB = *(int32 *) 4294947924 + g_dw7C19;
		g_dw79C7 = g_dw7C1D - *((int32 *) 4294947924);
		g_dw7C19 = 0x00;
	}
}

// 0000D566: Register (ptr32 Eq_n) fn0000D566(Register (ptr32 Eq_n) fp, Register out (ptr32 Eq_n) fpOut)
// Called from:
//      fn0000F816
struct Eq_n * fn0000D566(struct Eq_n * fp, struct Eq_n & fpOut)
{
	if (g_dw79CB > *((int32 *) 4294947924))
	{
		if (*(int32 *) 4294947924 < 0x00)
			*(int32 *) 4294947924 = 0x00;
		g_dw7C1D = *(int32 *) 4294947924 + g_dw79C7;
		g_dw7C19 = g_dw79CB - *((int32 *) 4294947924);
		g_dw79CB = *(int32 *) 4294947924;
	}
	else
		g_dw7C19 = 0x00;
	*(int32 *) 4294947924 -= g_dw79CB;
	struct Eq_n * ap_n = fp->ptr0008;
	fpOut = fp->ptr000C;
	return ap_n;
}

<unknown> g_tD5BC = // 0000D5BC;
// 0000D5BE: Register (ptr32 Eq_n) fn0000D5BE(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 (ptr32 Eq_n) r4Out, Register out word32 apOut, Register out (ptr32 Eq_n) fpOut)
// Called from:
//      fn0000E3DA
//      fn000117AA
//      fn00011CDA
//      fn00012D86
//      fn000173CA
struct Eq_n * fn0000D5BE(struct Eq_n * r0, struct Eq_n * ap, struct Eq_n * fp, struct Eq_n & r2Out, word32 & r3Out, struct Eq_n & r4Out, word32 & apOut, struct Eq_n & fpOut)
{
	struct Eq_n * fp_n;
	struct Eq_n * fp_n;
	struct Eq_n * r2_n = ap->ptr0008;
	struct Eq_n * sp_n = fp - 0x04;
	struct Eq_n * r4_n = (struct Eq_n *) 4294947792;
	struct Eq_n * r7_n = r2_n;
	word32 r3;
	while (r2_n != null)
	{
		if (r4_n->ptrC5FB <= null)
		{
			struct Eq_n * sp_n = sp_n - 0x04;
			sp_n->dw0000 = 0x2000;
			sp_n->ptrFFFFFFFC = r4_n->ptrC5F3;
			sp_n->dwFFFFFFF8 = r4_n->dwC617;
			(*((word32) g_ptr19270 + 2))();
			struct Eq_n * r0_n;
			r4_n->ptrC5FB = r0_n;
			if (r0_n == null)
			{
				struct Eq_n * fp_n = fp_n->ptr000C;
				word32 ap_n = fp_n->dw0008;
				r2Out = r2_n;
				word32 r3_n;
				r3Out = r3_n;
				r4Out = r4_n;
				apOut = ap_n;
				fpOut = fp_n;
				word32 r7_n;
				return r7_n - r2_n;
			}
			if (r4_n->ptrC5FB < null)
			{
				sp_n->dwFFFFFFFC = 0x0401;
				word32 r6_n;
				sp_n->dwFFFFFFF8 = r6_n + 36;
				(*((word32) g_ptr192C4 + 2))();
				struct Eq_n * sp_n;
				word32 r0_n;
				sp_n->dwFFFFFFFC = r0_n;
				word32 r6_n;
				sp_n->dwFFFFFFF8 = r6_n + 36;
				struct Eq_n * r4_n;
				sp_n->ptrFFFFFFF4 = r4_n;
				ptr32 r0_n = r4_n->ptrC839;
				(*((word32) r0_n + 2))();
				struct Eq_n * fp_n = fp_n->ptr000C;
				word32 ap_n = fp_n->dw0008;
				struct Eq_n * r2_n;
				r2Out = r2_n;
				word32 r3_n;
				r3Out = r3_n;
				struct Eq_n * r4_n;
				r4Out = r4_n;
				apOut = ap_n;
				fpOut = fp_n;
				return null;
			}
			r4_n->dwC61F += 0x2000;
			r4_n->ptrC5F7 = r4_n->ptrC5F3;
		}
		struct Eq_n * r0_n = r4_n->ptrC5FB;
		struct Eq_n * r5_n;
		if (r2_n < r0_n)
			r5_n = r2_n;
		else
			r5_n = r0_n;
		struct Eq_n * sp_n = sp_n - 0x04;
		sp_n->ptr0000 = r5_n;
		sp_n->ptrFFFFFFFC = r4_n->ptrC5F7;
		sp_n->ptrFFFFFFF8 = ap->ptr0004;
		(*((word32) g_ptr1929C + 2))();
		ap->ptr0004 = (word32 *) ((char *) ap->ptr0004 + r3);
		r4_n->ptrC5F7 = &r4_n->ptrC5F7->u0 + r3;
		r4_n->ptrC5FB -= r3;
		word32 r2_n;
		r2_n = r2_n - r3;
	}
	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;
	r4Out = r4_n;
	apOut = ap_n;
	fpOut = fp_n;
	return r7_n;
}

// 0000D69A: Register Eq_n fn0000D69A(Register (ptr32 Eq_n) fp, Register (ptr32 ptr32) pc, Register out (ptr32 Eq_n) r2Out, Register out (ptr32 Eq_n) r3Out, Register out (ptr32 Eq_n) r4Out, Register out (ptr32 Eq_n) r6Out, Register out (ptr32 Eq_n) apOut, Register out (ptr32 Eq_n) fpOut, Register out (ptr32 ptr32) pcOut)
// Called from:
//      fn00015256
//      fn000177CA
//      fn000185AE
Eq_n fn0000D69A(struct Eq_n * fp, ptr32 * pc, union Eq_n & r2Out, union Eq_n & r3Out, struct Eq_n & r4Out, union Eq_n & r6Out, struct Eq_n & apOut, struct Eq_n & fpOut, ptr32 & pcOut)
{
	struct Eq_n * r4_n = (struct Eq_n *) 4294947792;
	union Eq_n * r6_n = (union Eq_n *) ~0x7AF7;
	union Eq_n * r3;
	union Eq_n * r2;
	if (g_dw7A95 == 0x00)
	{
		if (*(int32 *) 4294947924 > 0x00)
		{
			if (g_dw79CB <= 0x00)
			{
				(*((word32) g_ptr19270 + 2))();
				struct Eq_n * r0_n;
				r4_n->ptrC5FB = r0_n;
				if (r0_n == null)
				{
					r4_n->ptrC5FB = null;
					struct Eq_n * fp_n = fp->ptr000C;
					struct Eq_n * ap_n = fp->ptr0008;
					union Eq_n * r2_n;
					r2Out = r2_n;
					r3Out = r3;
					r4Out = r4_n;
					r6Out = r6_n;
					apOut = ap_n;
					fpOut = fp_n;
					ptr32 * pc_n;
					pcOut = pc_n;
					return -1;
				}
				if (r4_n->ptrC5FB < null)
				{
					struct Eq_n * sp_n;
					sp_n->dwFFFFFFFC = 0x0401;
					sp_n->ptrFFFFFFF8 = (char *) r6_n + 36;
					(*((word32) g_ptr192C4 + 2))();
					struct Eq_n * sp_n;
					word32 r0_n;
					sp_n->dwFFFFFFFC = r0_n;
					word32 r6_n;
					sp_n->dwFFFFFFF8 = r6_n + 36;
					struct Eq_n * r4_n;
					sp_n->ptrFFFFFFF4 = r4_n;
					ptr32 r2_n = r4_n->ptrC839;
					(*((word32) r2_n + 2))();
					struct Eq_n * sp_n;
					sp_n->dwFFFFFFFC = 0x01;
					fn000124FE(pc);
				}
				r4_n->dwC61F += 0x2000;
				r4_n->ptrC5F7 = r4_n->ptrC5F3;
				if (r4_n->ptrC5FB > r4_n[33])
				{
					if (r4_n[33] < null)
						r4_n[33] = (struct Eq_n) null;
					r4_n->dwC84D = r4_n[33] + r4_n->ptrC5F7;
					r4_n->dwC849 = r4_n->ptrC5FB - r4_n[33];
					r4_n->ptrC5FB = (struct Eq_n *) r4_n[33];
				}
				else
					r4_n->dwC849 = 0x00;
				r4_n[33] = (struct Eq_n) (r4_n[33] - r4_n->ptrC5FB);
			}
			if ((r4_n->ptr05E7->t0014.u0 & 0x01) != 0x00)
			{
				r3 = r4_n->ptrC5F7;
				if (r4_n->ptrC5FB != null)
					fn00011ED6();
			}
			--r4_n->ptrC5FB;
			union Eq_n * r2_n = r4_n->ptrC5F7;
			r4_n->ptrC5F7 = (union Eq_n *) ((char *) r4_n->ptrC5F7 + 1);
			struct Eq_n * sp_n = fp - 0x04;
			Eq_n r0_n;
			r0_n.u1 = (uint32) r2_n->u0;
			struct Eq_n * fp_n = sp_n->ptr0010;
			struct Eq_n * ap_n = sp_n->ptr000C;
			r2Out = r2_n;
			r3Out = r3;
			r4Out = r4_n;
			r6Out = r6_n;
			apOut = ap_n;
			fpOut = fp_n;
			pcOut = pc;
			return r0_n;
		}
		else
		{
			--*(int32 *) 4294947924;
			g_dw79CB = 0x00;
			struct Eq_n * fp_n = fp->ptr000C;
			struct Eq_n * ap_n = fp->ptr0008;
			r2Out = r2;
			r3Out = r3;
			r4Out = (struct Eq_n *) 4294947792;
			r6Out = (union Eq_n *) ~0x7AF7;
			apOut = ap_n;
			fpOut = fp_n;
			pcOut = pc;
			return -1;
		}
	}
	else
	{
		struct Eq_n * fp_n = fp->ptr000C;
		struct Eq_n * ap_n = fp->ptr0008;
		r2Out = r2;
		r3Out = r3;
		r4Out = (struct Eq_n *) 4294947792;
		r6Out = (union Eq_n *) ~0x7AF7;
		apOut = ap_n;
		fpOut = fp_n;
		pcOut = pc;
		return -1;
	}
}

<unknown> g_tD804 = // 0000D804;
<unknown> g_tDA4C = // 0000DA4C;
<unknown> g_tDA58 = // 0000DA58;
<unknown> g_tDB4C = // 0000DB4C;
<unknown> g_tDC74 = // 0000DC74;
// 0000DC76: Register word32 fn0000DC76(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register out (ptr32 Eq_n) r5Out, Register out word32 apOut, Register out word32 fpOut)
// Called from:
//      fn00010E6A
//      fn00012A2A
//      fn0001325E
word32 fn0000DC76(struct Eq_n * ap, struct Eq_n * fp, struct Eq_n & r5Out, word32 & apOut, word32 & fpOut)
{
	if (ap->ptr0004 != null)
	{
		int32 r0_n = ap->dw0008;
		if (r0_n > 0x05)
		{
			word32 fp_n = fp->dw000C;
			word32 ap_n = fp->dw0008;
			r5Out = (struct Eq_n *) 4294947792;
			apOut = ap_n;
			fpOut = fp_n;
			return 0x00;
		}
		else
		{
			g_aDCA7[r0_n]();
			struct Eq_n * r5_n;
			r5Out = r5_n;
			word32 ap_n;
			apOut = ap_n;
			word32 fp_n;
			fpOut = fp_n;
			word32 r0_n;
			return r0_n;
		}
	}
	else
	{
		word32 fp_n = fp->dw000C;
		word32 ap_n = fp->dw0008;
		r5Out = (struct Eq_n *) 4294947792;
		apOut = ap_n;
		fpOut = fp_n;
		return 0x00;
	}
}

Eq_n g_aDCA7[] = // 0000DCA7
	{
	};
<unknown> g_tE258 = // 0000E258;
// 0000E25A: Register uint32 fn0000E25A(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register out (ptr32 Eq_n) apOut, Register out word32 fpOut)
// Called from:
//      fn00010676
uint32 fn0000E25A(struct Eq_n * ap, struct Eq_n * fp, struct Eq_n & apOut, word32 & fpOut)
{
	struct Eq_n * r2_n = ap->ptr0004;
	uint32 r0_n = (uint32) ((word16) r2_n->b0001 << 0x08 | (word16) r2_n->b0000);
	word32 fp_n = fp->dw000C;
	apOut = fp->ptr0008;
	fpOut = fp_n;
	return r0_n;
}

<unknown> g_tE274 = // 0000E274;
// 0000E276: Register uint32 fn0000E276(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register out ui32 r2Out, Register out (ptr32 Eq_n) apOut, Register out (ptr32 Eq_n) fpOut)
// Called from:
//      fn000105F2
//      fn00010676
//      fn000117AA
uint32 fn0000E276(struct Eq_n * ap, struct Eq_n * fp, ui32 & r2Out, struct Eq_n & apOut, struct Eq_n & fpOut)
{
	struct Eq_n * r1_n = ap->ptr0004;
	ui32 r2_n = ((uint32) r1_n[3] << 24) + ((uint32) r1_n[2] << 16) + ((uint32) r1_n[1] << 8);
	uint32 r0_n = (uint32) r1_n->b0000 + r2_n;
	struct Eq_n * fp_n = fp->ptr000C;
	struct Eq_n * ap_n = fp->ptr0008;
	r2Out = r2_n;
	apOut = ap_n;
	fpOut = fp_n;
	return r0_n;
}

// 0000E2A6: void fn0000E2A6(Register (ptr32 Eq_n) ap)
// Called from:
//      fn000121EA
void fn0000E2A6(struct Eq_n * ap)
{
	byte * r0_n = ap->ptr0008;
	byte * r1_n = ap->ptr0004;
	uint32 r4_n;
	do
	{
		byte v14_n = *r0_n;
		++r0_n;
		++r1_n;
		r4_n = (uint32) v14_n;
		uip32 r5;
		if ((r4_n & 0x80) != 0x00)
			r5 = SEQ(SLICE(r5, word24, 8), g_a7C24[r4_n & 0x7F]);
		else
			r5 = SEQ(SLICE(r5, word24, 8), v14_n);
		*r1_n = (byte) r5;
	} while (r4_n != 0x00);
}

// 0000E2EA: Register int32 fn0000E2EA(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register out (ptr32 byte) r2Out, Register out word32 r4Out, Register out int32 r5Out, Register out int32 r6Out, Register out uip32 r7Out, Register out word32 apOut, Register out word32 fpOut)
// Called from:
//      fn0000802E
//      fn0000C6FA
int32 fn0000E2EA(struct Eq_n * ap, struct Eq_n * fp, byte & r2Out, word32 & r4Out, int32 & r5Out, int32 & r6Out, uip32 & r7Out, word32 & apOut, word32 & fpOut)
{
	struct Eq_n * sp_n = fp - 0x04;
	ui32 r8_n[] = g_ptr1934C;
	byte * r2_n = ap->ptr0004;
	Eq_n r3_n;
	r3_n.u0 = ap->t0008.u0;
	word32 r4_n = ap->dw000C;
	int32 r5;
	uip32 r7;
	int32 r6;
	if (r4_n != 0x00)
	{
		ptr32 r9_n = g_ptr19298;
		do
		{
			int8 v16_n = *r2_n;
			uip32 r5_n = SEQ(SLICE(r5, word24, 8), v16_n);
			int32 r6_n = (int32) v16_n;
			int32 r1_n;
			if ((r8_n[r6_n & 0x7F] & 0x01) != 0x00)
			{
				sp_n->dwFFFFFFFC = (int32) v16_n;
				(*((word32) r9_n + 2))();
				int32 r0_n;
				r1_n = r0_n;
				uip32 r7_n;
				r7 = r7_n;
				uip32 r5_n;
				r5_n = r5_n;
				ptr32 r9_n;
				r9_n = r9_n;
				struct Eq_n * fp_n;
				fp = fp_n;
			}
			else
				r1_n = r6_n;
			int8 v28_n = *r3_n.u0;
			r7 = SEQ(SLICE(r7, word24, 8), (int8) r1_n);
			r5 = SEQ(SLICE(r5_n, word24, 8), v28_n);
			r6 = (int32) v28_n;
			int32 r1_n;
			if ((r8_n[r6 & 0x7F] & 0x01) != 0x00)
			{
				sp_n->dwFFFFFFFC = (int32) v28_n;
				(*((word32) r9_n + 2))();
				int32 r0_n;
				r1_n = r0_n;
				uip32 r7_n;
				r7 = r7_n;
				struct Eq_n * fp_n;
				fp = fp_n;
				int32 r5_n;
				r5 = r5_n;
				ptr32 r9_n;
				r9_n = r9_n;
				int32 r6_n;
				r6 = r6_n;
			}
			else
				r1_n = r6;
			if ((byte) r7 != (int8) r1_n)
			{
				int8 v34_n = *r2_n;
				int32 r6_n = (int32) v34_n;
				int32 r1_n;
				if ((r8_n[r6_n & 0x7F] & 0x01) != 0x00)
				{
					sp_n->dwFFFFFFFC = (int32) v34_n;
					(*((word32) g_ptr19298 + 2))();
					int32 r0_n;
					r1_n = r0_n;
				}
				else
					r1_n = r6_n;
				int8 v39_n = *r3_n.u0;
				uip32 r7_n = SEQ(SLICE(r7, word24, 8), (int8) r1_n);
				int32 r6_n = (int32) v39_n;
				int32 r5_n;
				if ((r8_n[r6_n & 0x7F] & 0x01) != 0x00)
				{
					sp_n->dwFFFFFFFC = (int32) v39_n;
					(*((word32) g_ptr19298 + 2))();
					int32 r0_n;
					r5_n = r0_n;
				}
				else
					r5_n = r6_n;
				uip32 r1_n;
				if ((byte) r7_n < (int8) r5_n)
					r1_n = SEQ(SLICE(r1_n, word24, 8), -1);
				else
					r1_n = SEQ(SLICE(r1_n, word24, 8), 0x01);
				struct Eq_n * sp_n = fp - 0x04;
				word32 fp_n = sp_n->dw0010;
				word32 ap_n = sp_n->dw000C;
				r2Out = r2_n;
				r4Out = r4_n;
				r5Out = r5_n;
				r6Out = r6_n;
				r7Out = r7_n;
				apOut = ap_n;
				fpOut = fp_n;
				return (int32) (int8) r1_n;
			}
			if (*r2_n == 0x00)
			{
				struct Eq_n * sp_n = fp - 0x04;
				word32 fp_n = sp_n->dw0010;
				word32 ap_n = sp_n->dw000C;
				r2Out = r2_n;
				r4Out = r4_n;
				r5Out = r5;
				r6Out = r6;
				r7Out = r7;
				apOut = ap_n;
				fpOut = fp_n;
				return 0x00;
			}
			--r4_n;
			++r2_n;
			r3_n.u0 = (word32) r3_n + 1;
		} while (r4_n != 0x00);
	}
	struct Eq_n * sp_n = fp - 0x04;
	word32 fp_n = sp_n->dw0010;
	word32 ap_n = sp_n->dw000C;
	r2Out = r2_n;
	r4Out = r4_n;
	r5Out = r5;
	r6Out = r6;
	r7Out = r7;
	apOut = ap_n;
	fpOut = fp_n;
	return 0x00;
}

// 0000E3DA: void fn0000E3DA(Register (ptr32 Eq_n) r0, Register word32 r1, Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp)
void fn0000E3DA(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;
	fp->dwFFFFFFE8 = 0x00;
	*(struct Eq_n **) ~0x4648 = (struct Eq_n *) 4294947959;
	*(word32 *) ~0x4BB7 = 0x01;
	g_dw7AA1 = 0x00;
	struct Eq_n * sp_n = fp + -144;
	struct Eq_n * r2_n = (struct Eq_n *) 4294947792;
	struct Eq_n * r10_n = null;
	struct Eq_n * r11_n = null;
	if (*(int32 *) ~0x4BCB > 0x00)
	{
		(*((word32) g_ptr192B4 + 2))();
		r10_n = r0;
		if (r0 != null)
		{
			int32 r3_n = 0x00;
			if (r2_n[25] > 0x00)
			{
				do
				{
					r0->a0000[r3_n].u1 = 0x00;
					++r3_n;
				} while (r3_n < r2_n[25]);
			}
		}
	}
	if (r2_n[26] > 0x00)
	{
		sp_n->dwFFFFFFFC = r2_n[26] << 2;
		(*((word32) g_ptr192B4 + 2))();
		r11_n = r0;
		if (r0 != null)
		{
			int32 r3_n = 0x00;
			if (r2_n[26] > 0x00)
			{
				do
				{
					r0->a0000[r3_n].u1 = 0x00;
					++r3_n;
				} while (r3_n < r2_n[26]);
			}
		}
	}
	if (sp_n->w0046 != 0x00)
	{
		sp_n[11] = (struct Eq_n) g_ptr1926C;
		sp_n[0x0A] = (struct Eq_n) g_ptr19270;
		sp_n[9] = (struct Eq_n) &g_tD5BC;
		sp_n[8] = (struct Eq_n) g_ptr192D8;
		sp_n[5] = (struct Eq_n) &g_t11DE0;
		sp_n[7] = (struct Eq_n) &g_tDC74;
		sp_n[0x0E] = (struct Eq_n) &g_t10890;
		sp_n[4] = (struct Eq_n) g_ptr192B0;
		sp_n[3] = (struct Eq_n) g_ptr19260;
		sp_n[2] = (struct Eq_n) &g_tC428;
		sp_n[1] = (struct Eq_n) &g_tCCB0;
		sp_n[20] = (struct Eq_n) g_ptr19290;
		sp_n[19] = (struct Eq_n) g_ptr192C4;
		sp_n->dw0000 = &g_t1205C;
		while (true)
		{
			sp_n[18] = (struct Eq_n) 0x00;
			if (sp_n->w0046 != 0x00 && sp_n[18] < 0x40)
			{
				struct Eq_n * sp_n;
				do
				{
					--sp_n->w0046;
					struct Eq_n * ap_n = sp_n[18] * 0x15;
					r2_n->ptr05E7 = (char *) &r2_n->ptr0094 + 19 + ap_n;
					struct Eq_n * sp_n = sp_n - 0x04;
					sp_n->dw0000 = 0x04;
					sp_n->ptrFFFFFFFC = r2_n + 38;
					sp_n = (struct Eq_n *) <invalid>;
					word32 r3_n;
					word32 r4_n;
					word32 ap_n;
					if (fn0000D5BE(r0, ap_n, fp, out r2_n, out r3_n, out r4_n, out ap_n, out fp) == 0x00)
					{
						sp_n->w0046 = 0x00;
						break;
					}
					sp_n->dwFFFFFFFC = 0x04;
					sp_n->dwFFFFFFF8 = r2_n + 0x0000318D;
					sp_n->dwFFFFFFF4 = r2_n + 38;
					(*((word32) g_ptr192D8 + 2))();
					struct Eq_n * r0_n;
					if (r0_n != null)
					{
						struct Eq_n * sp_n;
						sp_n->dwFFFFFFFC = 0x0401;
						sp_n->dwFFFFFFF8 = sp_n->dw0044;
						sp_n->ptrFFFFFFF4 = (<unknown>*) ~0x4EA3;
						word32 r2_n;
						sp_n->dwFFFFFFF0 = 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))();
						struct Eq_n * sp_n;
						sp_n->dwFFFFFFFC = 0x0401;
						sp_n->ptrFFFFFFF8 = &g_t7D48;
						word32 r2_n;
						sp_n->dwFFFFFFF4 = 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))();
						sp_n->w0046 = 0x00;
						break;
					}
					sp_n = (struct Eq_n *) <invalid>;
					struct Eq_n * ap_n;
					struct Eq_n * fp_n;
					word32 r3_n;
					if (fn00011C0A(r0_n, r1, ap_n, fp_n, out r2_n, out r3_n, out fp) != 0x00)
					{
						sp_n->w0046 = 0x00;
						break;
					}
					fn00000076((uint32) r2_n[12700], 0x02);
					int32 r0_n;
					struct Eq_n * r2_n;
					if (r0_n != 0x00 && r0_n > 0x01)
					{
						struct Eq_n * sp_n;
						sp_n->dwFFFFFFFC = 0x0401;
						word32 r9_n;
						sp_n->dwFFFFFFF8 = r9_n;
						sp_n->ptrFFFFFFF4 = (char *) r2_n + 17899;
						sp_n->ptrFFFFFFF0 = (char *) &r2_n->wC672 + 0x008F;
						struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
						struct Eq_n * fp_n;
						word32 r2_n;
						word32 r3_n;
						word32 ap_n;
						word32 fp_n;
						sp_n->dwFFFFFFFC = fn00010892((char *) r2_n + 1515, fp_n, out r2_n, out r3_n, out ap_n, out fp_n);
						word32 r4_n;
						sp_n->dwFFFFFFF8 = r4_n + 0x0118;
						sp_n->dwFFFFFFF4 = 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))();
						sp_n->w0046 = 0x00;
						break;
					}
					fn00000076((uint32) r2_n->wC672, 0x03);
					int32 r0_n;
					struct Eq_n * r2_n;
					if (r0_n != 0x00 && r0_n > 0x01)
					{
						struct Eq_n * sp_n;
						sp_n->dwFFFFFFFC = 0x0401;
						word32 r9_n;
						sp_n->dwFFFFFFF8 = r9_n + 8;
						sp_n->ptrFFFFFFF4 = (char *) r2_n + 17899;
						sp_n->ptrFFFFFFF0 = (char *) &r2_n->wC674 + 141;
						struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
						struct Eq_n * fp_n;
						word32 r2_n;
						word32 r3_n;
						word32 ap_n;
						word32 fp_n;
						sp_n->dwFFFFFFFC = fn00010892((char *) r2_n + 1515, fp_n, out r2_n, out r3_n, out ap_n, out fp_n);
						word32 r4_n;
						sp_n->dwFFFFFFF8 = r4_n + 311;
						sp_n->dwFFFFFFF4 = 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))();
						sp_n->w0046 = 0x00;
						break;
					}
					fn00000076((uint32) r2_n->wC674, 0x00);
					struct Eq_n * r0_n;
					struct Eq_n * r2_n;
					struct Eq_n * fp_n;
					if (r0_n != null && r0_n > (struct Eq_n *) 0x01)
					{
						sp_n->dwFFFFFFFC = 0x0421;
						sp_n->dwFFFFFFF8 = (char *) &r2_n->ptr05E7 + 0x00004004;
						sp_n->dwFFFFFFF4 = &r2_n->dwC6E9 + 6;
						struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
						word32 r2_n;
						word32 r3_n;
						word32 ap_n;
						word32 fp_n;
						sp_n->dwFFFFFFFC = fn00010892((char *) &r2_n->ptr05E7 + 4, fp_n, out r2_n, out r3_n, out ap_n, out fp_n);
						word32 r4_n;
						sp_n->dwFFFFFFF8 = r4_n + 0x0200;
						sp_n->dwFFFFFFF4 = 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))();
						sp_n->w0046 = 0x00;
						break;
					}
					if (r2_n[27] != 0x00)
						fn0000F4E2();
					fp_n->dwFFFFFFDC = 0x00;
					fp_n->ptrFFFFFFD8 = r2_n[36] - 0x04;
					++fp_n->ptrFFFFFFD8;
					while (*fp_n->ptrFFFFFFD8 != 0x00)
					{
						fn0000001A(&r2_n->dwC6E9 + 6, *fp_n->ptrFFFFFFD8, r2_n[4]);
						if (r0_n != null)
						{
							fp_n->dwFFFFFFDC = 0x01;
							word32 r10_n[];
							if (r10_n != null)
							{
								int32 ap_n;
								r10_n[(ap_n - r2_n[36]) / 0x04] = 0x01;
							}
							break;
						}
						++fp_n->ptrFFFFFFD8;
					}
					if (fp_n->dwFFFFFFDC != 0x00)
					{
						fp_n->ptrFFFFFFD4 = r2_n[37] - 0x04;
						++fp_n->ptrFFFFFFD4;
						while (*fp_n->ptrFFFFFFD4 != 0x00)
						{
							fn0000001A(&r2_n->dwC6E9 + 6, *fp_n->ptrFFFFFFD4, r2_n[4]);
							if (r0_n != null)
							{
								fp_n->dwFFFFFFDC = 0x00;
								word32 r11_n[];
								if (r11_n != null)
								{
									int32 ap_n;
									r11_n[(ap_n - r2_n[37]) / 0x04] = 0x01;
								}
								break;
							}
							++fp_n->ptrFFFFFFD4;
						}
					}
					if (fp_n->dwFFFFFFDC != 0x00)
						fn0000F4E2();
					word32 r1_n;
					r1 = r1_n;
					r0 = r0_n;
					fp = fp_n;
					r2_n = r2_n;
					Mem548 = Mem542;
					sp_n = sp_n;
				} while (sp_n->w0046 != 0x00 && sp_n[18] < 0x40);
			}
			fp->dwFFFFFFE0 = r2_n->dwC61F;
			fp->ptrFFFFFFF8 = r2_n->ptrC5F7;
			fp->ptrFFFFFFF4 = r2_n->ptrC5FB;
			sp_n[16] = (struct Eq_n) 0x00;
			if (sp_n[18] > 0x00)
				break;
			struct Eq_n * sp_n = sp_n - 0x04;
			sp_n->dw0000 = 0x00;
			sp_n->dwFFFFFFFC = fp->dwFFFFFFE0;
			sp_n->dwFFFFFFF8 = r2_n->dwC617;
			(*((word32) sp_n->ptr0030 + 2))();
			struct Eq_n * r2_n;
			word32 r0_n;
			r2_n->dwC61F = r0_n;
			struct Eq_n * sp_n;
			sp_n->dwFFFFFFFC = 0x2000;
			sp_n->dwFFFFFFF8 = r2_n->dwC5F3;
			sp_n->dwFFFFFFF4 = r2_n->dwC617;
			(*((word32) sp_n->ptr0028 + 2))();
			r2_n->ptrC5F7 = fp->ptrFFFFFFF8;
			r2_n->ptrC5FB = fp->ptrFFFFFFF4;
			++fp->dwFFFFFFE8;
			if (sp_n->w0046 == 0x00)
				goto l0000F191;
			word32 r1_n;
			r1 = r1_n;
		}
		sp_n[0x0F] = (struct Eq_n) ((word32) sp_n[16].dw0000 + (fp->dwFFFFFFE8 << 6));
		r2_n->ptr05E7 = (struct Eq_n *) ((char *) &r2_n->ptr0094 + 19 + sp_n[16] * 0x15);
	}
	else
	{
l0000F191:
		if (r10_n != null)
		{
			int32 r5_n = 0x00;
			if (r2_n[25] > 0x00)
			{
				do
				{
					if (r10_n->a0000[r5_n].u1 == 0x00)
					{
						struct Eq_n * sp_n = sp_n - 0x04;
						sp_n->dw0000 = 0x01;
						word32 r3_n[] = (word32 (*)[]) r2_n[36];
						sp_n->dwFFFFFFFC = r3_n[r5_n];
						sp_n->ptrFFFFFFF8 = (<unknown>*) 4294947748;
						sp_n->ptrFFFFFFF4 = (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))();
					}
					++r5_n;
				} while (r5_n < r2_n[25]);
			}
			sp_n->dwFFFFFFFC = r10_n;
			(*((word32) g_ptr192B0 + 2))();
		}
		if (r11_n != null)
		{
			int32 r5_n = 0x00;
			if (r2_n[26] > 0x00)
			{
				do
				{
					if (r11_n->a0000[r5_n].u1 == 0x00)
					{
						struct Eq_n * sp_n = sp_n - 0x04;
						sp_n->dw0000 = 0x0401;
						word32 r3_n[] = (word32 (*)[]) r2_n[37];
						sp_n->dwFFFFFFFC = r3_n[r5_n];
						sp_n->ptrFFFFFFF8 = (<unknown>*) 4294947700;
						sp_n->ptrFFFFFFF4 = (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))();
					}
					++r5_n;
				} while (r5_n < r2_n[26]);
			}
			sp_n->dwFFFFFFFC = r11_n;
			(*((word32) g_ptr192B0 + 2))();
		}
		struct Eq_n * sp_n = sp_n - 0x04;
		sp_n->dw0000 = 0x04;
		sp_n->ptrFFFFFFFC = r2_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>;
		sp_n->dwFFFFFFFC = 0x04;
		sp_n->dwFFFFFFF8 = r2_n + 50745;
		sp_n->dwFFFFFFF4 = r2_n + 0x0098;
		(*((word32) g_ptr192D8 + 2))();
		word32 r0_n;
		struct Eq_n * sp_n;
		struct Eq_n * r2_n;
		int32 r7_n;
		if (r0_n != 0x00)
		{
			sp_n->dwFFFFFFFC = 0x0401;
			sp_n->ptrFFFFFFF8 = (<unknown>*) 4294947624;
			sp_n->ptrFFFFFFF4 = (char *) &r2_n->dw006C + 0x057F;
			(*((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->dwFFFFFFFC = 0x0401;
			sp_n->ptrFFFFFFF8 = &g_t7D48;
			word32 r2_n;
			sp_n->dwFFFFFFF4 = 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 r3_n = r2_n->ptrC839;
			(*((word32) r3_n + 2))();
			if (r7_n == 0x00)
				r7_n = 0x01;
		}
		++sp_n->dw003C;
		if (r2_n->dw0044 != 0x00)
		{
			uint32 r8_n = (uint32) sp_n->w001A;
			struct Eq_n * fp_n;
			fp_n->dwFFFFFFC4 = sp_n->dw003C - r8_n;
			word32 r4_n;
			if (r2_n->dw0040 >= 0x02)
			{
				if (r2_n->dw0040 == 0x00 && (r7_n == 0x00 && fp_n->dwFFFFFFC4 == 0x00))
				{
					struct Eq_n * sp_n = sp_n - 0x04;
					sp_n->dw0000 = 0x00;
					sp_n->dwFFFFFFFC = r2_n->dwC613;
					sp_n->dwFFFFFFF8 = r4_n + 877;
					sp_n->ptrFFFFFFF4 = (char *) &r2_n->dw006C + 0x057F;
					(*((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))();
				}
			}
			else
			{
				word32 r9_n;
				if (r7_n != 0x00)
				{
					struct Eq_n * sp_n = sp_n - 0x04;
					sp_n->dw0000 = 0x00;
					sp_n->dwFFFFFFFC = r2_n->dwC613;
					word32 r5_n;
					if (r7_n == 0x01)
						r5_n = r9_n + 44;
					else
						r5_n = r9_n + 43;
					sp_n->dwFFFFFFF8 = r5_n;
					sp_n->dwFFFFFFF4 = r4_n + 0x0343;
					sp_n->ptrFFFFFFF0 = (char *) &r2_n->dw006C + 0x057F;
					(*((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))();
				}
				else
				{
					word32 r6_n = fp_n->dwFFFFFFC4;
					if (r6_n == 0x00)
					{
						struct Eq_n * sp_n = sp_n - 0x04;
						sp_n->dw0000 = 0x00;
						sp_n->dwFFFFFFFC = r2_n->dwC613;
						sp_n->dwFFFFFFF8 = r4_n + 877;
						sp_n->ptrFFFFFFF4 = (char *) &r2_n->dw006C + 0x057F;
						(*((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))();
					}
					else if (r2_n->dw006C != 0x00 && (uint32) sp_n->w0032 + r8_n == 0x00)
					{
						struct Eq_n * sp_n = sp_n - 0x04;
						sp_n->dw0000 = 0x00;
						sp_n->dwFFFFFFFC = r2_n->dwC613;
						sp_n->dwFFFFFFF8 = r4_n + 0x0440;
						sp_n->ptrFFFFFFF4 = (char *) &r2_n->dw006C + 0x057F;
						(*((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))();
					}
					else
					{
						struct Eq_n * sp_n = sp_n - 0x04;
						sp_n->dw0000 = 0x00;
						word32 r5_n;
						if (r6_n == 0x01)
							r5_n = r9_n + 55;
						else
							r5_n = r9_n + 53;
						sp_n->dwFFFFFFFC = r5_n;
						sp_n->dwFFFFFFF8 = r6_n;
						sp_n->dwFFFFFFF4 = r2_n->dwC613;
						sp_n->dwFFFFFFF0 = r4_n + 1134;
						sp_n->ptrFFFFFFEC = (char *) &r2_n->dw006C + 0x057F;
						(*((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))();
					}
				}
				uint32 r5_n = (uint32) sp_n->w0032;
				word32 r9_n;
				word32 r4_n;
				word32 r2_n;
				if (r5_n != 0x00)
				{
					struct Eq_n * sp_n = sp_n - 0x04;
					sp_n->dw0000 = 0x00;
					word32 r6_n;
					if (r5_n == 0x01)
						r6_n = r9_n + 58;
					else
						r6_n = r9_n + 56;
					sp_n->dwFFFFFFFC = r6_n;
					sp_n->dwFFFFFFF8 = r5_n;
					sp_n->dwFFFFFFF4 = r4_n + 1186;
					sp_n->dwFFFFFFF0 = 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 r3_n = r2_n->ptrC839;
					(*((word32) r3_n + 2))();
				}
				uint32 r5_n = (uint32) sp_n->w001A;
				if (r5_n != 0x00)
				{
					struct Eq_n * sp_n = sp_n - 0x04;
					sp_n->dw0000 = 0x00;
					word32 r6_n;
					if (r5_n == 0x01)
						r6_n = r9_n + 61;
					else
						r6_n = r9_n + 59;
					sp_n->dwFFFFFFFC = r6_n;
					sp_n->dwFFFFFFF8 = r5_n;
					sp_n->dwFFFFFFF4 = r4_n + 997;
					sp_n->dwFFFFFFF0 = 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 r3_n = r2_n->ptrC839;
					(*((word32) r3_n + 2))();
				}
			}
		}
		if (sp_n->dw003C == 0x00 && r7_n <= 0x01)
			(uint32) sp_n->w0032 == 0x00;
		else
		{
			uint32 r5_n = (uint32) sp_n->w001A;
			if ((sp_n->dw003C != r5_n || r7_n > 0x01) && ((uint32) sp_n->w0032 == 0x00 || r7_n > 0x01))
				;
		}
	}
}

// 0000F457: void fn0000F457()
// Called from:
//      fn0000C1FE
void fn0000F457()
{
}

// 0000F4E2: void fn0000F4E2()
// Called from:
//      fn0000E3DA
void fn0000F4E2()
{
}

// 0000F816: void fn0000F816(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp)
void fn0000F816(struct Eq_n * ap, struct Eq_n * fp)
{
	word32 fp_n;
	g_qw79CF = 0x00;
	g_dw79D7 = 0x00;
	g_dw7AA9 = 0x01;
	g_dw79BF = 0x00;
	struct Eq_n * r3_n = (struct Eq_n *) 4294947792;
	if (*(word32 *) ~0x4BEB != 0x00)
	{
		if (*(word32 *) ~0x4BEF == 0x00)
		{
			struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
			word32 r2_n;
			word32 r3_n;
			word32 ap_n;
			word32 fp_n;
			sp_n->dwFFFFFFFC = fn00010892(ap, fp, out r2_n, out r3_n, out ap_n, out fp_n);
			sp_n->dwFFFFFFF8 = (<unknown>*) 4294862628;
			sp_n->dwFFFFFFF4 = (<unknown>*) ~0x77F8;
			sp_n->ptrFFFFFFF0 = 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 ap_n = r3_n->ptrC839;
			(*((word32) ap_n + 2))();
		}
	}
	else if (*(int32 *) ~0x4C23 != 0x00)
	{
		g_dw7ABD = *g_ptr19374;
		if (fn00009B0A(fp, out r3_n, out fp) != 0x00)
			return;
	}
	else if (fn00009B0A(fp, out r3_n, out fp) != 0x00)
		return;
	word32 ap_n = fn0000D566(fp, out fp_n);
	Eq_n r0_n;
	r0_n.u1 = (uint32) r3_n->wC642;
	if (r0_n <= 0x08)
		g_aF8EC[r0_n]();
}

Eq_n g_aF8EC[] = // 0000F8EC
	{
	};
// 000100C2: void fn000100C2(Register (ptr32 Eq_n) ap)
void fn000100C2(struct Eq_n * ap)
{
	struct Eq_n * fp_n;
	ptr32 fp;
	struct Eq_n * sp_n = fp - 0x08;
	ptr32 r7_n = (<unknown>*) ~0x0001993B;
	struct Eq_n * r2_n = (struct Eq_n *) 4294947792;
	if (ap->ptr0008 >= (byte *) 0x04)
	{
		up32 * r9_n;
		do
		{
			fn0000005A(ap->ptr0004);
			struct Eq_n * ap_n;
			word32 r0_n;
			fn0000005A(ap_n->dw0004 + 0x02, (word16) r0_n);
			Eq_n r8_n;
			word32 r0_n;
			r8_n.u0 = (uint32) (word16) r0_n;
			struct Eq_n * fp_n;
			word32 r5_n;
			if (r8_n > *r9_n - 0x04)
			{
				if (r2_n[16] != 0x00)
				{
					sp_n->dwFFFFFFFC = 0x01;
					sp_n->dwFFFFFFF8 = (char *) &r2_n->ptr05E7 + 0x00004004;
					sp_n->dwFFFFFFF4 = &r2_n->dwC6E9 + 6;
					struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
					word32 r2_n;
					word32 r3_n;
					word32 ap_n;
					word32 fp_n;
					sp_n->dwFFFFFFFC = fn00010892(ap, fp_n, out r2_n, out r3_n, out ap_n, out fp_n);
					sp_n->dwFFFFFFF8 = r7_n + 199;
					sp_n->dwFFFFFFF4 = 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 r0_n = r2_n->ptrC839;
					(*((word32) r0_n + 2))();
				}
				struct Eq_n * sp_n = sp_n - 0x04;
				sp_n->dw0000 = 0x01;
				sp_n->dwFFFFFFFC = ap->ptr0008 - 0x04;
				sp_n->tFFFFFFF8.u0 = (uint32) r8_n;
				sp_n->dwFFFFFFF4 = r5_n + 0x05B3;
				sp_n->ptrFFFFFFF0 = (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 r0_n = r2_n->ptrC839;
				(*((word32) r0_n + 2))();
				word32 fp_n = fp_n->dw000C;
				return;
			}
			Eq_n r1_n;
			r1_n.u1 = (uint32) sp_n->w0002;
			if (r1_n >= 0x07)
			{
				if (r1_n <= 0x0C)
				{
					g_a10197[r1_n - 0x07]();
					return;
				}
				if (r1_n > 0x00)
				{
					fn4000E3D8();
					return;
				}
				if (r1_n > 17217 && r1_n >= 0x4453)
				{
					if (r1_n == 0x4453)
					{
						Eq_n r4_n;
						if (r8_n < 0x05)
							r4_n.u1 = 0x4F;
						else
						{
							struct Eq_n * r1_n = ap->ptr0004;
							Eq_n r3_n;
							if ((uint32) r1_n[8] != 0x00)
								r3_n.u1 = 0x4001;
							else
							{
								sp_n->dwFFFFFFFC = 0x00;
								sp_n->dwFFFFFFF8 = (<unknown>*) 0x05;
								sp_n->dwFFFFFFF4 = (word32) r8_n;
								sp_n->ptrFFFFFFF0 = r1_n;
								sp_n = (struct Eq_n *) <invalid>;
								r3_n = fn000105F2(r7_n, ap, fp_n, out r2_n, out r5_n, out r7_n, out r8_n, out r9_n, out ap, out fp_n);
							}
							r4_n = r3_n;
						}
						Eq_n r6_n = r4_n;
						if (r4_n != 0x00)
						{
							if (r2_n[16] != 0x00)
							{
								struct Eq_n * sp_n = sp_n - 0x04;
								sp_n->dw0000 = 0x01;
								sp_n->ptrFFFFFFFC = (char *) &r2_n->ptr05E7 + 0x00004004;
								sp_n->ptrFFFFFFF8 = &r2_n->dwC6E9 + 6;
								struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
								word32 r2_n;
								word32 r3_n;
								word32 ap_n;
								word32 fp_n;
								sp_n->dwFFFFFFFC = fn00010892(ap, fp_n, out r2_n, out r3_n, out ap_n, out fp_n);
								sp_n->dwFFFFFFF8 = r7_n + 0x00D7;
								sp_n->dwFFFFFFF4 = 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 r0_n = r2_n->ptrC839;
								(*((word32) r0_n + 2))();
							}
							if (r6_n < 0x02)
							{
								if ((r6_n & 0xFF) != 0x02)
								{
									struct Eq_n * sp_n = sp_n - 0x04;
									sp_n->dw0000 = 0x01;
									sp_n->dwFFFFFFFC = r5_n + 1733;
									sp_n->ptrFFFFFFF8 = (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 r0_n = r2_n->ptrC839;
									(*((word32) r0_n + 2))();
								}
								else
								{
									uint32 r3_n = (uint32) (word16) (r6_n >> 8);
									if (r3_n == 0x08)
									{
										struct Eq_n * sp_n = sp_n - 0x04;
										sp_n->dw0000 = 0x01;
										sp_n->dwFFFFFFFC = r5_n + 0x0655;
										sp_n->ptrFFFFFFF8 = (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 r0_n = r2_n->ptrC839;
										(*((word32) r0_n + 2))();
									}
									else
									{
										struct Eq_n * sp_n = sp_n - 0x04;
										sp_n->dw0000 = 0x01;
										sp_n->dwFFFFFFFC = r3_n;
										sp_n->dwFFFFFFF8 = r5_n + 0x0677;
										sp_n->ptrFFFFFFF4 = (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 r0_n = r2_n->ptrC839;
										(*((word32) r0_n + 2))();
									}
								}
								return;
							}
							Eq_n v50_n = r6_n - 0x02;
							if (v50_n <= 0x05)
							{
								g_a10436[v50_n]();
								return;
							}
						}
					}
					else if (r1_n >= 0x4704)
					{
						if (r1_n <= 18191)
						{
							g_a101E1[r1_n - 0x4704]();
							return;
						}
					}
				}
			}
			word32 r1_n = (word32) r8_n.u0 + 4;
			*r9_n -= r1_n;
			ap->ptr0004 += r1_n;
		} while (*r9_n >= 0x04);
	}
	if (r2_n[16] == 0x00)
	{
		struct Eq_n * sp_n = sp_n - 0x04;
		sp_n->dw0000 = 0x00;
		sp_n->ptrFFFFFFFC = r7_n + 224;
		sp_n->ptrFFFFFFF8 = (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 r3_n = r2_n->ptrC839;
		(*((word32) r3_n + 2))();
	}
}

Eq_n g_a10197[] = // 00010197
	{
	};
Eq_n g_a101E1[] = // 000101E1
	{
	};
Eq_n g_a10436[] = // 00010436
	{
	};
// 000105F2: Register (ptr32 Eq_n) fn000105F2(Register ptr32 r7, Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register out (ptr32 Eq_n) r2Out, Register out word32 r5Out, Register out ptr32 r7Out, Register out uint32 r8Out, Register out (ptr32 up32) r9Out, Register out (ptr32 Eq_n) apOut, Register out word32 fpOut)
// Called from:
//      fn000100C2
struct Eq_n * fn000105F2(ptr32 r7, struct Eq_n * ap, struct Eq_n * fp, struct Eq_n & r2Out, word32 & r5Out, ptr32 & r7Out, uint32 & r8Out, up32 & r9Out, struct Eq_n & apOut, word32 & fpOut)
{
	struct Eq_n * fp_n;
	struct Eq_n * ap_n;
	struct Eq_n * r2;
	if (ap->ptr0008 >= (byte *) 0x04)
	{
		word32 r0_n = fn0000E276(ap, fp, out r2, out ap_n, out fp);
		struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
		if (r0_n == 0x00 || ap_n->dw0008 > ap_n->dw000C + 0x06)
		{
			sp_n->dwFFFFFFFC = r0_n;
			(*((word32) g_ptr192B4 + 2))();
			word32 r0_n;
			struct Eq_n * fp_n;
			if (r0_n != 0x00)
			{
				struct Eq_n * sp_n;
				struct Eq_n * ap_n;
				sp_n->dwFFFFFFFC = ap_n->dw0008 - ap_n->dw000C;
				sp_n->dwFFFFFFF8 = &ap_n->ptr0004->b0000 + (ap_n->dw000C + 0x04);
				real32 ** r4_n;
				sp_n->ptrFFFFFFF4 = r4_n;
				sp_n->dwFFFFFFF0 = r0_n;
				struct Eq_n * sp_n = sp_n - 0x10;
				word32 r3_n;
				word32 r4_n;
				word32 r7_n;
				struct Eq_n * ap_n;
				word32 fp_n;
				if (fn00010676(r4_n, r7, ap_n, fp_n, out r3_n, out r4_n, out r7_n, out ap_n, out fp_n) == 0x00)
				{
					ptr32 r0_n = ap_n->ptr0010;
					if (r0_n != null)
					{
						sp_n->dwFFFFFFEC = r4_n;
						sp_n->dwFFFFFFE8 = r3_n;
						sp_n->dwFFFFFFE4 = ap_n->dw0008;
						sp_n->dwFFFFFFE0 = ap_n->dw0004;
						(*((word32) r0_n + 2))();
					}
				}
				sp_n->dwFFFFFFFC = r3_n;
				(*((word32) g_ptr192B0 + 2))();
				word32 fp_n = fp_n->dw000C;
				struct Eq_n * ap_n = fp_n->ptr0008;
				struct Eq_n * r2_n;
				r2Out = r2_n;
				word32 r5_n;
				r5Out = r5_n;
				ptr32 r7_n;
				r7Out = r7_n;
				uint32 r8_n;
				r8Out = r8_n;
				up32 * r9_n;
				r9Out = r9_n;
				apOut = ap_n;
				fpOut = fp_n;
				return r2_n;
			}
			else
			{
				word32 fp_n = fp_n->dw000C;
				struct Eq_n * ap_n = fp_n->ptr0008;
				struct Eq_n * r2_n;
				r2Out = r2_n;
				word32 r5_n;
				r5Out = r5_n;
				ptr32 r7_n;
				r7Out = r7_n;
				uint32 r8_n;
				r8Out = r8_n;
				up32 * r9_n;
				r9Out = r9_n;
				apOut = ap_n;
				fpOut = fp_n;
				return (struct Eq_n *) 0x07;
			}
		}
	}
	struct Eq_n * sp_n = fp - 0x04;
	word32 fp_n = sp_n->dw0010;
	struct Eq_n * ap_n = sp_n->ptr000C;
	r2Out = r2;
	word32 r5;
	r5Out = r5;
	r7Out = r7;
	uint32 r8;
	r8Out = r8;
	up32 * r9;
	r9Out = r9;
	apOut = ap_n;
	fpOut = fp_n;
	return (struct Eq_n *) 0x4F;
}

// 00010676: Register word32 fn00010676(Register (ptr32 (ptr32 real32)) r4, Register ptr32 r7, Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register out word32 r3Out, Register out word32 r4Out, Register out word32 r7Out, Register out word32 apOut, Register out word32 fpOut)
// Called from:
//      fn000105F2
word32 fn00010676(real32 ** r4, ptr32 r7, struct Eq_n * ap, struct Eq_n * fp, word32 & r3Out, word32 & r4Out, word32 & r7Out, word32 & apOut, word32 & fpOut)
{
	struct Eq_n * fp_n;
	struct Eq_n * ap_n;
	word32 r3_n = ap->dw000C;
	word16 v19_n = (word16) fn0000E25A(ap, fp, out ap_n, out fp_n);
	struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
	sp_n->dwFFFFFFFC = r3_n + 0x02;
	struct Eq_n * r2_n;
	struct Eq_n * ap_n;
	word32 fp_n;
	fn0000E276(ap_n, fp_n, out r2_n, out ap_n, out fp_n);
	r2_n->dwC5F7 = r3_n + 0x06;
	r2_n->dw0084 = ap_n->dw0010 - 0x06;
	r2_n->dwC5FB = r2_n->dw0084;
	r2_n->dwC6C5 = 0x01;
	r2_n->dwC6C9 = ap_n->dw0004;
	r2_n->dwC6CD = ap_n->dw0008;
	uipr32 r7_n = SEQ(SLICE(r7, word16, 16), v19_n);
	Eq_n r0_n;
	r0_n.u1 = (uint32) v19_n;
	if (r0_n > 0x08)
	{
		**r4 = 36.0F + 0.5F;
		__halt();
	}
	else
	{
		g_a106EB[r0_n]();
		word32 r3_n;
		r3Out = r3_n;
		word32 r4_n;
		r4Out = r4_n;
		word32 r7_n;
		r7Out = r7_n;
		word32 ap_n;
		apOut = ap_n;
		word32 fp_n;
		fpOut = fp_n;
		word32 r0_n;
		return r0_n;
	}
}

Eq_n g_a106EB[] = // 000106EB
	{
	};
// 0001084A: Register (ptr32 Eq_n) fn0001084A(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp)
// Called from:
//      fn000186B2
struct Eq_n * fn0001084A(struct Eq_n * ap, struct Eq_n * fp)
{
	struct Eq_n * fp_n;
	if (ap->dw0008 > g_dw7A9D)
		return fp->ptr000C;
	up32 r3_n = ap->dw0008;
	(*((word32) g_ptr1929C + 2))();
	struct Eq_n * r2_n;
	word32 r3_n;
	r2_n->dwC6C9 += r3_n;
	r2_n->dwC6CD -= r3_n;
	r2_n->dwC6FD += r3_n;
	struct Eq_n * fp_n = fp_n->ptr000C;
	return fp_n;
}

<unknown> g_t10890 = // 00010890;
// 00010892: Register (ptr32 byte) fn00010892(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp, Register out (ptr32 byte) r2Out, Register out (ptr32 Eq_n) r3Out, Register out (ptr32 Eq_n) apOut, Register out (ptr32 Eq_n) fpOut)
// Called from:
//      fn0000E3DA
//      fn0000F816
//      fn000100C2
//      fn00017772
byte * fn00010892(struct Eq_n * ap, struct Eq_n * fp, byte & r2Out, struct Eq_n & r3Out, struct Eq_n & apOut, struct Eq_n & fpOut)
{
	struct Eq_n * r3_n = ap->ptr0004;
	byte * r2_n = ap->ptr0008;
	while (r3_n->b0000 != 0x00)
	{
		if ((uint32) r3_n->b0000 < 0x20)
		{
			*r2_n = 0x5E;
			int8 * r2_n = r2_n + 1;
			*r2_n = (int8) ((uint32) r3_n->b0000 + 0x40);
			++r3_n;
			r2_n = r2_n + 1;
		}
		else
		{
			*r2_n = r3_n->b0000;
			++r3_n;
			++r2_n;
		}
	}
	*r2_n = 0x00;
	byte * r0_n = ap->ptr0008;
	struct Eq_n * fp_n = fp->ptr000C;
	struct Eq_n * ap_n = fp->ptr0008;
	r2Out = r2_n;
	r3Out = r3_n;
	apOut = ap_n;
	fpOut = fp_n;
	return r0_n;
}

// 000108D2: Register word32 fn000108D2()
// Called from:
//      fn0000802E
word32 fn000108D2()
{
	(*((word32) g_ptr192B4 + 2))();
	struct Eq_n * r2_n;
	word32 r0_n;
	r2_n->dwC5F3 = r0_n;
	struct Eq_n * sp_n;
	sp_n->dwFFFFFFFC = 0x8001;
	(*((word32) g_ptr192B4 + 2))();
	struct Eq_n * r2_n;
	word32 r0_n;
	r2_n->dwC6F1 = r0_n;
	r2_n->dwC6F5 = r0_n;
	struct Eq_n * sp_n;
	if (r2_n->dwC5F3 == 0x00 || r2_n->dwC6F1 == 0x00)
	{
		sp_n->dwFFFFFFFC = 0x0401;
		ptr32 r10_n;
		sp_n->ptrFFFFFFF8 = r10_n;
		sp_n->ptrFFFFFFF4 = (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))();
		struct Eq_n * fp_n;
		return fp_n->dw000C;
	}
	else
	{
		r2_n->dwC62B = r2_n->dwC5F3 + 0x2000;
		r2_n->bC62F = 0x50;
		r2_n->bC639 = 0x50;
		r2_n->bC634 = 0x50;
		r2_n->bC630 = 0x4B;
		r2_n->bC63A = 0x4B;
		r2_n->bC635 = 0x4B;
		uint32 r5_n;
		sp_n->dwFFFFFFFC = r5_n;
		sp_n->ptrFFFFFFF8 = &r2_n->bC630 + 1;
		ptr32 r4_n = g_ptr192BC;
		(*((word32) r4_n + 2))();
		struct Eq_n * sp_n;
		word32 r5_n;
		sp_n->dwFFFFFFFC = r5_n + 3;
		word32 r2_n;
		sp_n->dwFFFFFFF8 = r2_n + 0xC636;
		ptr32 r4_n;
		(*((word32) r4_n + 2))();
		struct Eq_n * sp_n;
		word32 r5_n;
		sp_n->dwFFFFFFFC = r5_n + 6;
		word32 r2_n;
		sp_n->dwFFFFFFF8 = r2_n + 50747;
		ptr32 r4_n;
		(*((word32) r4_n + 2))();
		struct Eq_n * sp_n;
		struct Eq_n * r2_n;
		sp_n->dwFFFFFFFC = r2_n->dwC60F;
		struct Eq_n * ap_n;
		fn0000C0CE(ap_n);
	}
}

// 00010E6A: void fn00010E6A(Register (ptr32 Eq_n) ap, Register (ptr32 Eq_n) fp)
// Called from:
//      fn000108D2
void fn00010E6A(struct Eq_n * ap, struct Eq_n * fp)
{
	ptr32 r7_n = (<unknown>*) 4294862764;
	struct Eq_n * r2_n = (struct Eq_n *) 4294947792;
	ptr32 r6_n = (<unknown>*) ~0x7213;
	word32 r5_n = 0x00;
	struct Eq_n * sp_n = (struct Eq_n *) <invalid>;
	struct Eq_n * ap_n;
	word32 fp_n;
	if (fn00018F22(ap, fp, out ap_n, out fp_n) == 0x00)
	{
		sp_n->dwFFFFFFFC = &g_t7A64;
		sp_n->dwFFFFFFF8 = g_dw79E3;
		(*((word32) g_ptr192A8 + 2))();
		word32 r0_n;
		if (r0_n == 0x00)
		{
			word32 r1_n = 0x00;
			if (((uint32) r2_n->wC69E & 0xF000) == 0x4000)
				r1_n = 0x01;
			r5_n = r1_n;
			if (r1_n == 0x00)
			{
				r2_n->dwC61B = r2_n->dwC6AE;
				fn00009A52();
			}
		}
	}
	if (ap_n->dw0004 != 0x00)
	{
		if (r2_n->dwC6E9 != 0x00)
		{
			struct Eq_n * sp_n = sp_n - 0x04;
			sp_n->dw0000 = 0x0401;
			sp_n->dwFFFFFFFC = r2_n->dwC613;
			Eq_n r3_n = r2_n->ptr0000;
			ptr32 r4_n;
			if (r3_n != 0x00)
				r4_n = r7_n + 40;
			else
				r4_n = r7_n + 39;
			sp_n->ptrFFFFFFF8 = r4_n;
			sp_n->dwFFFFFFF4 = r2_n->dwC60F;
			ptr32 r3_n;
			if (r3_n != 0x00)
				r3_n = &g_t7EE0;
			else
				r3_n = r6_n + 456;
			sp_n->ptrFFFFFFF0 = r3_n;
			sp_n->ptrFFFFFFEC = r6_n + 340;
			sp_n->ptrFFFFFFE8 = (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 r0_n = r2_n->ptrC839;
			(*((word32) r0_n + 2))();
		}
		else
		{
			struct Eq_n * sp_n = sp_n - 0x04;
			sp_n->dw0000 = 0x0401;
			sp_n->dwFFFFFFFC = r2_n->dwC613;
			sp_n->dwFFFFFFF8 = r2_n->dwC60F;
			ptr32 r3_n;
			if (r2_n->ptr0000 != 0x00)
				r3_n = &g_t7EE0;
			else
				r3_n = r6_n + 456;
			sp_n->ptrFFFFFFF4 = r3_n;
			sp_n->ptrFFFFFFF0 = r6_n + 421;
			sp_n->ptrFFFFFFEC = (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 r0_n = r2_n->ptrC839;
			(*((word32) r0_n + 2))();
		}
	}
}

