// File: FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: BuildDiffuseNormals()
void BuildDiffuseNormals ()
{
	int i, j, k;
	g_numskynormals[0] = 0;
	g_skynormals[0] = NULL; //don't use this
	g_skynormalsizes[0] = NULL;
	int numpoints = 6;
	point_t *points = (point_t *)malloc (((1 << (2 * SKYLEVELMAX)) + 2) * sizeof (point_t));
	hlassume (points != NULL, assume_NoMemory);
	points[0][0] = 1, points[0][1] = 0, points[0][2] = 0;
	points[1][0] = -1,points[1][1] = 0, points[1][2] = 0;
	points[2][0] = 0, points[2][1] = 1, points[2][2] = 0;
	points[3][0] = 0, points[3][1] = -1,points[3][2] = 0;
	points[4][0] = 0, points[4][1] = 0, points[4][2] = 1;
	points[5][0] = 0, points[5][1] = 0, points[5][2] = -1;
	int numedges = 12;
	edge_t *edges = (edge_t *)malloc (((1 << (2 * SKYLEVELMAX)) * 4 - 4) * sizeof (edge_t));
	hlassume (edges != NULL, assume_NoMemory);
	edges[0].point[0] = 0, edges[0].point[1] = 2, edges[0].divided = false;
	edges[1].point[0] = 2, edges[1].point[1] = 1, edges[1].divided = false;
	edges[2].point[0] = 1, edges[2].point[1] = 3, edges[2].divided = false;
	edges[3].point[0] = 3, edges[3].point[1] = 0, edges[3].divided = false;
	edges[4].point[0] = 2, edges[4].point[1] = 4, edges[4].divided = false;
	edges[5].point[0] = 4, edges[5].point[1] = 3, edges[5].divided = false;
	edges[6].point[0] = 3, edges[6].point[1] = 5, edges[6].divided = false;
	edges[7].point[0] = 5, edges[7].point[1] = 2, edges[7].divided = false;
	edges[8].point[0] = 4, edges[8].point[1] = 0, edges[8].divided = false;
	edges[9].point[0] = 0, edges[9].point[1] = 5, edges[9].divided = false;
	edges[10].point[0] = 5, edges[10].point[1] = 1, edges[10].divided = false;
	edges[11].point[0] = 1, edges[11].point[1] = 4, edges[11].divided = false;
	int numtriangles = 8;
	triangle_t *triangles = (triangle_t *)malloc (((1 << (2 * SKYLEVELMAX)) * 2) * sizeof (triangle_t));
	hlassume (triangles != NULL, assume_NoMemory);
	triangles[0].edge[0] = 0, triangles[0].dir[0] = 0, triangles[0].edge[1] = 4, triangles[0].dir[1] = 0, triangles[0].edge[2] = 8, triangles[0].dir[2] = 0;
	triangles[1].edge[0] = 1, triangles[1].dir[0] = 0, triangles[1].edge[1] = 11, triangles[1].dir[1] = 0, triangles[1].edge[2] = 4, triangles[1].dir[2] = 1;
	triangles[2].edge[0] = 2, triangles[2].dir[0] = 0, triangles[2].edge[1] = 5, triangles[2].dir[1] = 1, triangles[2].edge[2] = 11, triangles[2].dir[2] = 1;
	triangles[3].edge[0] = 3, triangles[3].dir[0] = 0, triangles[3].edge[1] = 8, triangles[3].dir[1] = 1, triangles[3].edge[2] = 5, triangles[3].dir[2] = 0;
	triangles[4].edge[0] = 0, triangles[4].dir[0] = 1, triangles[4].edge[1] = 9, triangles[4].dir[1] = 0, triangles[4].edge[2] = 7, triangles[4].dir[2] = 0;
	triangles[5].edge[0] = 1, triangles[5].dir[0] = 1, triangles[5].edge[1] = 7, triangles[5].dir[1] = 1, triangles[5].edge[2] = 10, triangles[5].dir[2] = 0;
	triangles[6].edge[0] = 2, triangles[6].dir[0] = 1, triangles[6].edge[1] = 10, triangles[6].dir[1] = 1, triangles[6].edge[2] = 6, triangles[6].dir[2] = 1;
	triangles[7].edge[0] = 3, triangles[7].dir[0] = 1, triangles[7].edge[1] = 6, triangles[7].dir[1] = 0, triangles[7].edge[2] = 9, triangles[7].dir[2] = 1;
	CopyToSkynormals (1, numpoints, points, numedges, edges, numtriangles, triangles);
	for (i = 1; i < SKYLEVELMAX; i++)
	{
		int oldnumedges = numedges;
		for (j = 0; j < oldnumedges; j++)
		{
			if (!edges[j].divided)
			{
				hlassume (numpoints < (1 << (2 * SKYLEVELMAX)) + 2, assume_first);
				point_t mid;
				double len;
				VectorAdd (points[edges[j].point[0]], points[edges[j].point[1]], mid);
				len = sqrt (DotProduct (mid, mid));
				hlassume (len > 0.2, assume_first);
				VectorScale (mid, 1 / len, mid);
				int p2 = numpoints;
				VectorCopy (mid, points[numpoints]);
				numpoints++;
				hlassume (numedges < (1 << (2 * SKYLEVELMAX)) * 4 - 4, assume_first);
				edges[j].child[0] = numedges;
				edges[numedges].divided = false;
				edges[numedges].point[0] = edges[j].point[0];
				edges[numedges].point[1] = p2;
				numedges++;
				hlassume (numedges < (1 << (2 * SKYLEVELMAX)) * 4 - 4, assume_first);
				edges[j].child[1] = numedges;
				edges[numedges].divided = false;
				edges[numedges].point[0] = p2;
				edges[numedges].point[1] = edges[j].point[1];
				numedges++;
				edges[j].divided = true;
			}
		}
		int oldnumtriangles = numtriangles;
		for (j = 0; j < oldnumtriangles; j++)
		{
			int mid[3];
			for (k = 0; k < 3; k++)
			{
				hlassume (numtriangles < (1 << (2 * SKYLEVELMAX)) * 2, assume_first);
				mid[k] = edges[edges[triangles[j].edge[k]].child[0]].point[1];
				triangles[numtriangles].edge[0] = edges[triangles[j].edge[k]].child[1 - triangles[j].dir[k]];
				triangles[numtriangles].dir[0] = triangles[j].dir[k];
				triangles[numtriangles].edge[1] = edges[triangles[j].edge[(k+1)%3]].child[triangles[j].dir[(k+1)%3]];
				triangles[numtriangles].dir[1] = triangles[j].dir[(k+1)%3];
				triangles[numtriangles].edge[2] = numedges + k;
				triangles[numtriangles].dir[2] = 1;
				numtriangles++;
			}
			for (k = 0; k < 3; k++)
			{
				hlassume (numedges < (1 << (2 * SKYLEVELMAX)) * 4 - 4, assume_first);
				triangles[j].edge[k] = numedges;
				triangles[j].dir[k] = 0;
				edges[numedges].divided = false;
				edges[numedges].point[0] = mid[k];
				edges[numedges].point[1] = mid[(k+1)%3];
				numedges++;
			}
		}
		CopyToSkynormals (i + 1, numpoints, points, numedges, edges, numtriangles, triangles);
	}
	free (points);
	free (edges);
	free (triangles);
}

// Assembly:
subq $0x98, %rsp
movl $0x0, 0x4f75dbf(%rip)   # 0x4fa7900
movq $0x0, 0x4f75de4(%rip) # 0x4fa7930
movq $0x0, 0x4f75e29(%rip) # 0x4fa7980
movl $0x6, 0x88(%rsp)
movl $0x180030, %edi         # imm = 0x180030
callq 0x4430
movq %rax, 0x80(%rsp)
cmpq $0x0, 0x80(%rsp)
setne %al
movzbl %al, %edi
andl $0x1, %edi
movl $0x1, %esi
callq 0xbf00
movq 0x80(%rsp), %rax
movsd 0x3b648(%rip), %xmm0    # 0x6d1e8
movsd %xmm0, (%rax)
movq 0x80(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x8(%rax)
movq 0x80(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rax)
movq 0x80(%rsp), %rax
movsd 0x3c01c(%rip), %xmm0    # 0x6dbf0
movsd %xmm0, 0x18(%rax)
movq 0x80(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x20(%rax)
movq 0x80(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x28(%rax)
movq 0x80(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x30(%rax)
movq 0x80(%rsp), %rax
movsd 0x3b5cf(%rip), %xmm0    # 0x6d1e8
movsd %xmm0, 0x38(%rax)
movq 0x80(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x40(%rax)
movq 0x80(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x48(%rax)
movq 0x80(%rsp), %rax
movsd 0x3bfa2(%rip), %xmm0    # 0x6dbf0
movsd %xmm0, 0x50(%rax)
movq 0x80(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x58(%rax)
movq 0x80(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x60(%rax)
movq 0x80(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x68(%rax)
movq 0x80(%rsp), %rax
movsd 0x3b555(%rip), %xmm0    # 0x6d1e8
movsd %xmm0, 0x70(%rax)
movq 0x80(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x78(%rax)
movq 0x80(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x80(%rax)
movq 0x80(%rsp), %rax
movsd 0x3bf25(%rip), %xmm0    # 0x6dbf0
movsd %xmm0, 0x88(%rax)
movl $0xc, 0x7c(%rsp)
movl $0x4fffb0, %edi         # imm = 0x4FFFB0
callq 0x4430
movq %rax, 0x70(%rsp)
cmpq $0x0, 0x70(%rsp)
setne %al
movzbl %al, %edi
andl $0x1, %edi
movl $0x1, %esi
callq 0xbf00
movq 0x70(%rsp), %rax
movl $0x0, (%rax)
movq 0x70(%rsp), %rax
movl $0x2, 0x4(%rax)
movq 0x70(%rsp), %rax
movb $0x0, 0x8(%rax)
movq 0x70(%rsp), %rax
movl $0x2, 0x14(%rax)
movq 0x70(%rsp), %rax
movl $0x1, 0x18(%rax)
movq 0x70(%rsp), %rax
movb $0x0, 0x1c(%rax)
movq 0x70(%rsp), %rax
movl $0x1, 0x28(%rax)
movq 0x70(%rsp), %rax
movl $0x3, 0x2c(%rax)
movq 0x70(%rsp), %rax
movb $0x0, 0x30(%rax)
movq 0x70(%rsp), %rax
movl $0x3, 0x3c(%rax)
movq 0x70(%rsp), %rax
movl $0x0, 0x40(%rax)
movq 0x70(%rsp), %rax
movb $0x0, 0x44(%rax)
movq 0x70(%rsp), %rax
movl $0x2, 0x50(%rax)
movq 0x70(%rsp), %rax
movl $0x4, 0x54(%rax)
movq 0x70(%rsp), %rax
movb $0x0, 0x58(%rax)
movq 0x70(%rsp), %rax
movl $0x4, 0x64(%rax)
movq 0x70(%rsp), %rax
movl $0x3, 0x68(%rax)
movq 0x70(%rsp), %rax
movb $0x0, 0x6c(%rax)
movq 0x70(%rsp), %rax
movl $0x3, 0x78(%rax)
movq 0x70(%rsp), %rax
movl $0x5, 0x7c(%rax)
movq 0x70(%rsp), %rax
movb $0x0, 0x80(%rax)
movq 0x70(%rsp), %rax
movl $0x5, 0x8c(%rax)
movq 0x70(%rsp), %rax
movl $0x2, 0x90(%rax)
movq 0x70(%rsp), %rax
movb $0x0, 0x94(%rax)
movq 0x70(%rsp), %rax
movl $0x4, 0xa0(%rax)
movq 0x70(%rsp), %rax
movl $0x0, 0xa4(%rax)
movq 0x70(%rsp), %rax
movb $0x0, 0xa8(%rax)
movq 0x70(%rsp), %rax
movl $0x0, 0xb4(%rax)
movq 0x70(%rsp), %rax
movl $0x5, 0xb8(%rax)
movq 0x70(%rsp), %rax
movb $0x0, 0xbc(%rax)
movq 0x70(%rsp), %rax
movl $0x5, 0xc8(%rax)
movq 0x70(%rsp), %rax
movl $0x1, 0xcc(%rax)
movq 0x70(%rsp), %rax
movb $0x0, 0xd0(%rax)
movq 0x70(%rsp), %rax
movl $0x1, 0xdc(%rax)
movq 0x70(%rsp), %rax
movl $0x4, 0xe0(%rax)
movq 0x70(%rsp), %rax
movb $0x0, 0xe4(%rax)
movl $0x8, 0x6c(%rsp)
movl $0x300000, %edi         # imm = 0x300000
callq 0x4430
movq %rax, 0x60(%rsp)
cmpq $0x0, 0x60(%rsp)
setne %al
movzbl %al, %edi
andl $0x1, %edi
movl $0x1, %esi
callq 0xbf00
movq 0x60(%rsp), %rax
movl $0x0, (%rax)
movq 0x60(%rsp), %rax
movl $0x0, 0xc(%rax)
movq 0x60(%rsp), %rax
movl $0x4, 0x4(%rax)
movq 0x60(%rsp), %rax
movl $0x0, 0x10(%rax)
movq 0x60(%rsp), %rax
movl $0x8, 0x8(%rax)
movq 0x60(%rsp), %rax
movl $0x0, 0x14(%rax)
movq 0x60(%rsp), %rax
movl $0x1, 0x18(%rax)
movq 0x60(%rsp), %rax
movl $0x0, 0x24(%rax)
movq 0x60(%rsp), %rax
movl $0xb, 0x1c(%rax)
movq 0x60(%rsp), %rax
movl $0x0, 0x28(%rax)
movq 0x60(%rsp), %rax
movl $0x4, 0x20(%rax)
movq 0x60(%rsp), %rax
movl $0x1, 0x2c(%rax)
movq 0x60(%rsp), %rax
movl $0x2, 0x30(%rax)
movq 0x60(%rsp), %rax
movl $0x0, 0x3c(%rax)
movq 0x60(%rsp), %rax
movl $0x5, 0x34(%rax)
movq 0x60(%rsp), %rax
movl $0x1, 0x40(%rax)
movq 0x60(%rsp), %rax
movl $0xb, 0x38(%rax)
movq 0x60(%rsp), %rax
movl $0x1, 0x44(%rax)
movq 0x60(%rsp), %rax
movl $0x3, 0x48(%rax)
movq 0x60(%rsp), %rax
movl $0x0, 0x54(%rax)
movq 0x60(%rsp), %rax
movl $0x8, 0x4c(%rax)
movq 0x60(%rsp), %rax
movl $0x1, 0x58(%rax)
movq 0x60(%rsp), %rax
movl $0x5, 0x50(%rax)
movq 0x60(%rsp), %rax
movl $0x0, 0x5c(%rax)
movq 0x60(%rsp), %rax
movl $0x0, 0x60(%rax)
movq 0x60(%rsp), %rax
movl $0x1, 0x6c(%rax)
movq 0x60(%rsp), %rax
movl $0x9, 0x64(%rax)
movq 0x60(%rsp), %rax
movl $0x0, 0x70(%rax)
movq 0x60(%rsp), %rax
movl $0x7, 0x68(%rax)
movq 0x60(%rsp), %rax
movl $0x0, 0x74(%rax)
movq 0x60(%rsp), %rax
movl $0x1, 0x78(%rax)
movq 0x60(%rsp), %rax
movl $0x1, 0x84(%rax)
movq 0x60(%rsp), %rax
movl $0x7, 0x7c(%rax)
movq 0x60(%rsp), %rax
movl $0x1, 0x88(%rax)
movq 0x60(%rsp), %rax
movl $0xa, 0x80(%rax)
movq 0x60(%rsp), %rax
movl $0x0, 0x8c(%rax)
movq 0x60(%rsp), %rax
movl $0x2, 0x90(%rax)
movq 0x60(%rsp), %rax
movl $0x1, 0x9c(%rax)
movq 0x60(%rsp), %rax
movl $0xa, 0x94(%rax)
movq 0x60(%rsp), %rax
movl $0x1, 0xa0(%rax)
movq 0x60(%rsp), %rax
movl $0x6, 0x98(%rax)
movq 0x60(%rsp), %rax
movl $0x1, 0xa4(%rax)
movq 0x60(%rsp), %rax
movl $0x3, 0xa8(%rax)
movq 0x60(%rsp), %rax
movl $0x1, 0xb4(%rax)
movq 0x60(%rsp), %rax
movl $0x6, 0xac(%rax)
movq 0x60(%rsp), %rax
movl $0x0, 0xb8(%rax)
movq 0x60(%rsp), %rax
movl $0x9, 0xb0(%rax)
movq 0x60(%rsp), %rax
movl $0x1, 0xbc(%rax)
movl 0x88(%rsp), %esi
movq 0x80(%rsp), %rdx
movl 0x7c(%rsp), %ecx
movq 0x70(%rsp), %r8
movl 0x6c(%rsp), %r9d
movq 0x60(%rsp), %rax
movl $0x1, %edi
movq %rax, (%rsp)
callq 0x31550
movl $0x1, 0x94(%rsp)
cmpl $0x8, 0x94(%rsp)
jge 0x3297f
movl 0x7c(%rsp), %eax
movl %eax, 0x5c(%rsp)
movl $0x0, 0x90(%rsp)
movl 0x90(%rsp), %eax
cmpl 0x5c(%rsp), %eax
jge 0x325ad
movq 0x70(%rsp), %rax
movslq 0x90(%rsp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
testb $0x1, 0x8(%rax)
jne 0x32595
cmpl $0x10002, 0x88(%rsp) # imm = 0x10002
setl %al
movzbl %al, %edi
andl $0x1, %edi
xorl %esi, %esi
callq 0xbf00
movq 0x80(%rsp), %rax
movq 0x70(%rsp), %rcx
movslq 0x90(%rsp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
movq 0x80(%rsp), %rax
movq 0x70(%rsp), %rcx
movslq 0x90(%rsp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rcx
movslq 0x4(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
addsd (%rax), %xmm0
movsd %xmm0, 0x40(%rsp)
movq 0x80(%rsp), %rax
movq 0x70(%rsp), %rcx
movslq 0x90(%rsp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movq 0x80(%rsp), %rax
movq 0x70(%rsp), %rcx
movslq 0x90(%rsp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rcx
movslq 0x4(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
addsd 0x8(%rax), %xmm0
movsd %xmm0, 0x48(%rsp)
movq 0x80(%rsp), %rax
movq 0x70(%rsp), %rcx
movslq 0x90(%rsp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rcx
movslq (%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x10(%rax), %xmm0
movq 0x80(%rsp), %rax
movq 0x70(%rsp), %rcx
movslq 0x90(%rsp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rcx
movslq 0x4(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
addsd 0x10(%rax), %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x40(%rsp), %xmm1
movsd 0x40(%rsp), %xmm2
movsd 0x48(%rsp), %xmm0
mulsd 0x48(%rsp), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x50(%rsp), %xmm0
movsd 0x50(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x4270
movsd %xmm0, 0x38(%rsp)
movsd 0x38(%rsp), %xmm0
movsd 0x3b8b3(%rip), %xmm1    # 0x6dc18
ucomisd %xmm1, %xmm0
seta %al
movzbl %al, %edi
andl $0x1, %edi
xorl %esi, %esi
callq 0xbf00
movsd 0x40(%rsp), %xmm0
movsd 0x3ae61(%rip), %xmm1    # 0x6d1e8
divsd 0x38(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x48(%rsp), %xmm0
movsd 0x3ae43(%rip), %xmm1    # 0x6d1e8
divsd 0x38(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x50(%rsp), %xmm0
movsd 0x3ae25(%rip), %xmm1    # 0x6d1e8
divsd 0x38(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rsp)
movl 0x88(%rsp), %eax
movl %eax, 0x34(%rsp)
movsd 0x40(%rsp), %xmm0
movq 0x80(%rsp), %rax
movslq 0x88(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, (%rax)
movsd 0x48(%rsp), %xmm0
movq 0x80(%rsp), %rax
movslq 0x88(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
movsd 0x50(%rsp), %xmm0
movq 0x80(%rsp), %rax
movslq 0x88(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x10(%rax)
movl 0x88(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x88(%rsp)
cmpl $0x3fffc, 0x7c(%rsp)    # imm = 0x3FFFC
setl %al
movzbl %al, %edi
andl $0x1, %edi
xorl %esi, %esi
callq 0xbf00
movl 0x7c(%rsp), %ecx
movq 0x70(%rsp), %rax
movslq 0x90(%rsp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq 0x70(%rsp), %rax
movslq 0x7c(%rsp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x8(%rax)
movq 0x70(%rsp), %rax
movslq 0x90(%rsp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq 0x70(%rsp), %rax
movslq 0x7c(%rsp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movl 0x34(%rsp), %ecx
movq 0x70(%rsp), %rax
movslq 0x7c(%rsp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl 0x7c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7c(%rsp)
cmpl $0x3fffc, 0x7c(%rsp)    # imm = 0x3FFFC
setl %al
movzbl %al, %edi
andl $0x1, %edi
xorl %esi, %esi
callq 0xbf00
movl 0x7c(%rsp), %ecx
movq 0x70(%rsp), %rax
movslq 0x90(%rsp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movq 0x70(%rsp), %rax
movslq 0x7c(%rsp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x8(%rax)
movl 0x34(%rsp), %ecx
movq 0x70(%rsp), %rax
movslq 0x7c(%rsp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq 0x70(%rsp), %rax
movslq 0x90(%rsp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
movq 0x70(%rsp), %rax
movslq 0x7c(%rsp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl 0x7c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7c(%rsp)
movq 0x70(%rsp), %rax
movslq 0x90(%rsp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movb $0x1, 0x8(%rax)
jmp 0x32597
movl 0x90(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x90(%rsp)
jmp 0x321b9
movl 0x6c(%rsp), %eax
movl %eax, 0x30(%rsp)
movl $0x0, 0x90(%rsp)
movl 0x90(%rsp), %eax
cmpl 0x30(%rsp), %eax
jge 0x32934
movl $0x0, 0x8c(%rsp)
cmpl $0x3, 0x8c(%rsp)
jge 0x32822
cmpl $0x20000, 0x6c(%rsp)    # imm = 0x20000
setl %al
movzbl %al, %edi
andl $0x1, %edi
xorl %esi, %esi
callq 0xbf00
movq 0x70(%rsp), %rax
movq 0x70(%rsp), %rcx
movq 0x60(%rsp), %rdx
movslq 0x90(%rsp), %rsi
imulq $0x18, %rsi, %rsi
addq %rsi, %rdx
movslq 0x8c(%rsp), %rsi
movslq (%rdx,%rsi,4), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rcx
movslq 0xc(%rcx), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
movslq 0x8c(%rsp), %rax
movl %ecx, 0x24(%rsp,%rax,4)
movq 0x70(%rsp), %rax
movq 0x60(%rsp), %rcx
movslq 0x90(%rsp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movslq 0x8c(%rsp), %rdx
movslq (%rcx,%rdx,4), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq 0x60(%rsp), %rdx
movslq 0x90(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rdx
movslq 0x8c(%rsp), %rsi
movl $0x1, %ecx
subl 0xc(%rdx,%rsi,4), %ecx
movslq %ecx, %rcx
movl 0xc(%rax,%rcx,4), %ecx
movq 0x60(%rsp), %rax
movslq 0x6c(%rsp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq 0x60(%rsp), %rax
movslq 0x90(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0x8c(%rsp), %rcx
movl 0xc(%rax,%rcx,4), %ecx
movq 0x60(%rsp), %rax
movslq 0x6c(%rsp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq 0x70(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %rcx
movslq 0x90(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl $0x3, %esi
cltd
idivl %esi
movq 0x8(%rsp), %rax
movslq %edx, %rdx
movslq (%rcx,%rdx,4), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x60(%rsp), %rcx
movslq 0x90(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl $0x3, %esi
cltd
idivl %esi
movq 0x10(%rsp), %rax
movslq %edx, %rdx
movslq 0xc(%rcx,%rdx,4), %rcx
movl 0xc(%rax,%rcx,4), %ecx
movq 0x60(%rsp), %rax
movslq 0x6c(%rsp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq 0x60(%rsp), %rax
movslq 0x90(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movq 0x18(%rsp), %rax
movslq %edx, %rcx
movl 0xc(%rax,%rcx,4), %ecx
movq 0x60(%rsp), %rax
movslq 0x6c(%rsp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movl 0x7c(%rsp), %ecx
addl 0x8c(%rsp), %ecx
movq 0x60(%rsp), %rax
movslq 0x6c(%rsp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq 0x60(%rsp), %rax
movslq 0x6c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x1, 0x14(%rax)
movl 0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8c(%rsp)
jmp 0x325dc
movl $0x0, 0x8c(%rsp)
cmpl $0x3, 0x8c(%rsp)
jge 0x3291c
cmpl $0x3fffc, 0x7c(%rsp)    # imm = 0x3FFFC
setl %al
movzbl %al, %edi
andl $0x1, %edi
xorl %esi, %esi
callq 0xbf00
movl 0x7c(%rsp), %edx
movq 0x60(%rsp), %rax
movslq 0x90(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0x8c(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x60(%rsp), %rax
movslq 0x90(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0x8c(%rsp), %rcx
movl $0x0, 0xc(%rax,%rcx,4)
movq 0x70(%rsp), %rax
movslq 0x7c(%rsp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x8(%rax)
movslq 0x8c(%rsp), %rax
movl 0x24(%rsp,%rax,4), %ecx
movq 0x70(%rsp), %rax
movslq 0x7c(%rsp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movslq %edx, %rax
movl 0x24(%rsp,%rax,4), %ecx
movq 0x70(%rsp), %rax
movslq 0x7c(%rsp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl 0x7c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7c(%rsp)
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8c(%rsp)
jmp 0x3282d
jmp 0x3291e
movl 0x90(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x90(%rsp)
jmp 0x325c0
movl 0x94(%rsp), %edi
addl $0x1, %edi
movl 0x88(%rsp), %esi
movq 0x80(%rsp), %rdx
movl 0x7c(%rsp), %ecx
movq 0x70(%rsp), %r8
movl 0x6c(%rsp), %r9d
movq 0x60(%rsp), %rax
movq %rax, (%rsp)
callq 0x31550
movl 0x94(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x94(%rsp)
jmp 0x32198
movq 0x80(%rsp), %rdi
callq 0x43a0
movq 0x70(%rsp), %rdi
callq 0x43a0
movq 0x60(%rsp), %rdi
callq 0x43a0
addq $0x98, %rsp
retq
nopl (%rax,%rax)