// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlcsg/brush.cpp
// Function: CreateHullBrush(brush_s const*)
hullbrush_t *CreateHullBrush (const brush_t *b)
{
	const int MAXSIZE = 256;

	hullbrush_t *hb;
	int numplanes;
	plane_t planes[MAXSIZE];
	Winding *w[MAXSIZE];
	int numedges;
	hullbrushedge_t edges[MAXSIZE];
	int numvertexes;
	hullbrushvertex_t vertexes[MAXSIZE];
	int i;
	int j;
	int k;
	int e;
	int e2;
	vec3_t origin;
	bool failed = false;

	// planes

	numplanes = 0;
	GetVectorForKey (&g_entities[b->entitynum], "origin", origin);

	for (i = 0; i < b->numsides; i++)
	{
		side_t *s;
		vec3_t p[3];
		vec3_t v1;
		vec3_t v2;
		vec3_t normal;
		planetypes axial;

		s = &g_brushsides[b->firstside + i];
		for (j = 0; j < 3; j++)
		{
			VectorSubtract (s->planepts[j], origin, p[j]);
			for (k = 0; k < 3; k++)
			{
				if (fabs (p[j][k] - floor (p[j][k] + 0.5)) <= ON_EPSILON && p[j][k] != floor (p[j][k] + 0.5))
				{
					Warning ("Entity %i, Brush %i: vertex (%4.8f %4.8f %4.8f) of an info_hullshape entity is slightly off-grid.",
#ifdef HLCSG_COUNT_NEW
							b->originalentitynum, b->originalbrushnum,
#else
							b->entitynum, b->brushnum,
#endif
							p[j][0], p[j][1], p[j][2]);
				}
			}
		}
		VectorSubtract (p[0], p[1], v1);
		VectorSubtract (p[2], p[1], v2);
		CrossProduct (v1, v2, normal);
		if (!VectorNormalize (normal))
		{
			failed = true;
			continue;
		}
		for (k = 0; k < 3; k++)
		{
			if (fabs (normal[k]) < NORMAL_EPSILON)
			{
				normal[k] = 0.0;
				VectorNormalize (normal);
			}
		}
		axial = PlaneTypeForNormal (normal);
		if (axial <= last_axial)
		{
			int sign = normal[axial] > 0? 1: -1;
			VectorClear (normal);
			normal[axial] = sign;
		}

		if (numplanes >= MAXSIZE)
		{
			failed = true;
			continue;
		}
		VectorCopy (normal, planes[numplanes].normal);
		planes[numplanes].dist = DotProduct (p[1], normal);
		numplanes++;
	}

	// windings

	for (i = 0; i < numplanes; i++)
	{
		w[i] = new Winding (planes[i].normal, planes[i].dist);
		for (j = 0; j < numplanes; j++)
		{
			if (j == i)
			{
				continue;
			}
			vec3_t normal;
			vec_t dist;
			VectorSubtract (vec3_origin, planes[j].normal, normal);
			dist = -planes[j].dist;
			if (!w[i]->Chop (normal, dist))
			{
				failed = true;
				break;
			}
		}
	}

	// edges
	numedges = 0;
	for (i = 0; i < numplanes; i++)
	{
		for (e = 0; e < w[i]->m_NumPoints; e++)
		{
			hullbrushedge_t *edge;
			int found;
			if (numedges >= MAXSIZE)
			{
				failed = true;
				continue;
			}
			edge = &edges[numedges];
			VectorCopy (w[i]->m_Points[(e + 1) % w[i]->m_NumPoints], edge->vertexes[0]);
			VectorCopy (w[i]->m_Points[e], edge->vertexes[1]);
			VectorCopy (edge->vertexes[0], edge->point);
			VectorSubtract (edge->vertexes[1], edge->vertexes[0], edge->delta);
			if (VectorLength (edge->delta) < 1 - ON_EPSILON)
			{
				failed = true;
				continue;
			}
			VectorCopy (planes[i].normal, edge->normals[0]);
			found = 0;
			for (k = 0; k < numplanes; k++)
			{
				for (e2 = 0; e2 < w[k]->m_NumPoints; e2++)
				{
					if (VectorCompare (w[k]->m_Points[(e2 + 1) % w[k]->m_NumPoints], edge->vertexes[1]) &&
						VectorCompare (w[k]->m_Points[e2], edge->vertexes[0]))
					{
						found++;
						VectorCopy (planes[k].normal, edge->normals[1]);
						j = k;
					}
				}
			}
			if (found != 1)
			{
				failed = true;
				continue;
			}
			if (fabs (DotProduct (edge->vertexes[0], edge->normals[0]) - planes[i].dist) > NORMAL_EPSILON
				|| fabs (DotProduct (edge->vertexes[1], edge->normals[0]) - planes[i].dist) > NORMAL_EPSILON
				|| fabs (DotProduct (edge->vertexes[0], edge->normals[1]) - planes[j].dist) > NORMAL_EPSILON
				|| fabs (DotProduct (edge->vertexes[1], edge->normals[1]) - planes[j].dist) > NORMAL_EPSILON)
			{
				failed = true;
				continue;
			}
			if (j > i)
			{
				numedges++;
			}
		}
	}

	// vertexes
	numvertexes = 0;
	for (i = 0; i < numplanes; i++)
	{
		for (e = 0; e < w[i]->m_NumPoints; e++)
		{
			vec3_t v;
			VectorCopy (w[i]->m_Points[e], v);
			for (j = 0; j < numvertexes; j++)
			{
				if (VectorCompare (vertexes[j].point, v))
				{
					break;
				}
			}
			if (j < numvertexes)
			{
				continue;
			}
			if (numvertexes > MAXSIZE)
			{
				failed = true;
				continue;
			}

			VectorCopy (v, vertexes[numvertexes].point);
			numvertexes++;

			for (k = 0; k < numplanes; k++)
			{
				if (fabs (DotProduct (v, planes[k].normal) - planes[k].dist) < ON_EPSILON)
				{
					if (fabs (DotProduct (v, planes[k].normal) - planes[k].dist) > NORMAL_EPSILON)
					{
						failed = true;
					}
				}
			}
		}
	}

	// copy to hull brush

	if (!failed)
	{
		hb = (hullbrush_t *)malloc (sizeof (hullbrush_t));
		hlassume (hb != NULL, assume_NoMemory);

		hb->numfaces = numplanes;
		hb->faces = (hullbrushface_t *)malloc (hb->numfaces * sizeof (hullbrushface_t));
		hlassume (hb->faces != NULL, assume_NoMemory);
		for (i = 0; i < numplanes; i++)
		{
			hullbrushface_t *f = &hb->faces[i];
			VectorCopy (planes[i].normal, f->normal);
			VectorCopy (w[i]->m_Points[0], f->point);
			f->numvertexes = w[i]->m_NumPoints;
			f->vertexes = (vec3_t *)malloc (f->numvertexes * sizeof (vec3_t));
			hlassume (f->vertexes != NULL, assume_NoMemory);
			for (k = 0; k < w[i]->m_NumPoints; k++)
			{
				VectorCopy (w[i]->m_Points[k], f->vertexes[k]);
			}
		}

		hb->numedges = numedges;
		hb->edges = (hullbrushedge_t *)malloc (hb->numedges * sizeof (hullbrushedge_t));
		hlassume (hb->edges != NULL, assume_NoMemory);
		memcpy (hb->edges, edges, hb->numedges * sizeof (hullbrushedge_t));

		hb->numvertexes = numvertexes;
		hb->vertexes = (hullbrushvertex_t *)malloc (hb->numvertexes * sizeof (hullbrushvertex_t));
		hlassume (hb->vertexes != NULL, assume_NoMemory);
		memcpy (hb->vertexes, vertexes, hb->numvertexes * sizeof (hullbrushvertex_t));

		Developer (DEVELOPER_LEVEL_MESSAGE, "info_hullshape @ (%.0f,%.0f,%.0f): %d faces, %d edges, %d vertexes.\n", origin[0], origin[1], origin[2], hb->numfaces, hb->numedges, hb->numvertexes);
	}
	else
	{
		hb = NULL;
		Error ("Entity %i, Brush %i: invalid brush. This brush cannot be used for info_hullshape.",
#ifdef HLCSG_COUNT_NEW
				b->originalentitynum, b->originalbrushnum
#else
				b->entitynum, b->brushnum
#endif
				);
	}

	for (i = 0; i < numplanes; i++)
	{
		delete w[i];
	}

	return hb;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf148, %rsp           # imm = 0xF148
movq %rdi, %rbx
movslq 0x8(%rdi), %rax
imulq $0x28, %rax, %rdi
addq 0x17612(%rip), %rdi     # 0x25fd8
leaq 0x10040(%rip), %rsi     # 0x1ea0d
leaq 0x110(%rsp), %rdx
callq 0x73ec
movq $0x0, 0x10(%rsp)
leaq 0x3abcc06(%rip), %rbp   # 0x3acb5f0
leaq 0xdefa(%rip), %r13      # 0x1c8eb
xorl %ecx, %ecx
movl $0x0, 0xc(%rsp)
movq %rbx, 0x68(%rsp)
movslq 0xc(%rsp), %rax
movq %rax, 0xa8(%rsp)
cmpl 0x14(%rbx), %ecx
jge 0xeceb
movslq 0x10(%rbx), %rax
movl %ecx, 0x20(%rsp)
movslq %ecx, %rcx
addq %rax, %rcx
imulq $0xd0, %rcx, %r14
leaq 0xc0(%rsp), %r15
xorl %ebx, %ebx
cmpq $0x3, %rbx
je 0xeb1e
imulq $0x18, %rbx, %rax
leaq (%r14,%rbp), %rcx
movupd 0x88(%rax,%rcx), %xmm0
subpd 0x110(%rsp), %xmm0
movupd %xmm0, 0xc0(%rsp,%rax)
movsd 0x98(%rax,%rcx), %xmm1
subsd 0x120(%rsp), %xmm1
movsd %xmm1, 0x28(%rsp)
movsd %xmm1, 0xd0(%rsp,%rax)
movapd %xmm0, 0x50(%rsp)
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
movapd %xmm0, 0x90(%rsp)
xorl %r12d, %r12d
cmpq $0x3, %r12
je 0xeb12
movsd (%r15,%r12,8), %xmm0
movsd %xmm0, 0x30(%rsp)
addsd 0xd73d(%rip), %xmm0     # 0x1c1f0
callq 0x4580
movsd 0x30(%rsp), %xmm3
movapd %xmm3, %xmm1
subsd %xmm0, %xmm1
andpd 0xd782(%rip), %xmm1     # 0x1c250
movsd 0xd992(%rip), %xmm2     # 0x1c468
ucomisd %xmm1, %xmm2
jb 0xeb0d
ucomisd %xmm0, %xmm3
jne 0xeae4
jnp 0xeb0d
movq 0x68(%rsp), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
movq %r13, %rdi
movapd 0x50(%rsp), %xmm0
movapd 0x90(%rsp), %xmm1
movsd 0x28(%rsp), %xmm2
movb $0x3, %al
callq 0x90f1
incq %r12
jmp 0xea99
incq %rbx
addq $0x18, %r15
jmp 0xea35
movsd 0xc0(%rsp), %xmm0
movsd 0xd8(%rsp), %xmm5
subsd %xmm5, %xmm0
movsd 0xf8(%rsp), %xmm1
movupd 0xc8(%rsp), %xmm2
movapd 0xe0(%rsp), %xmm4
subpd %xmm4, %xmm2
subsd %xmm4, %xmm1
movsd 0x100(%rsp), %xmm3
movhpd 0xf0(%rsp), %xmm3       # xmm3 = xmm3[0],mem[0]
movapd %xmm4, 0x30(%rsp)
movapd %xmm5, 0x50(%rsp)
shufpd $0x1, %xmm5, %xmm4      # xmm4 = xmm4[1],xmm5[0]
subpd %xmm4, %xmm3
movapd %xmm2, %xmm4
shufpd $0x1, %xmm0, %xmm4      # xmm4 = xmm4[1],xmm0[0]
mulsd %xmm1, %xmm0
unpcklpd %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0]
mulpd %xmm4, %xmm1
movapd %xmm2, %xmm4
mulpd %xmm3, %xmm4
subpd %xmm1, %xmm4
movapd %xmm4, 0x70(%rsp)
unpckhpd %xmm3, %xmm3            # xmm3 = xmm3[1,1]
mulsd %xmm2, %xmm3
subsd %xmm3, %xmm0
movsd %xmm0, 0x80(%rsp)
leaq 0x70(%rsp), %r14
movq %r14, %rdi
callq 0xc2e9
ucomisd 0xd8d1(%rip), %xmm0     # 0x1c4a0
jne 0xebd7
jnp 0xec6e
xorl %ebx, %ebx
cmpq $0x3, %rbx
je 0xec0e
movsd 0x70(%rsp,%rbx,8), %xmm0
andpd 0xd663(%rip), %xmm0     # 0x1c250
movsd 0xa48b(%rip), %xmm1     # 0x19080
ucomisd %xmm0, %xmm1
jbe 0xec09
andq $0x0, 0x70(%rsp,%rbx,8)
movq %r14, %rdi
callq 0xc2e9
incq %rbx
jmp 0xebd9
movq %r14, %rdi
callq 0xfa3c
cmpl $0x2, %eax
jg 0xec55
movl %eax, %eax
movsd 0x70(%rsp,%rax,8), %xmm0
xorl %ecx, %ecx
ucomisd 0xd873(%rip), %xmm0     # 0x1c4a0
seta %cl
leaq 0xd7c9(%rip), %rdx      # 0x1c400
movsd (%rdx,%rcx,8), %xmm0
xorpd %xmm1, %xmm1
movapd %xmm1, 0x70(%rsp)
andq $0x0, 0x80(%rsp)
movsd %xmm0, 0x70(%rsp,%rax,8)
movl 0xc(%rsp), %eax
cmpl $0xff, %eax
movq 0x68(%rsp), %rbx
jle 0xec7c
movb $0x1, %al
movq %rax, 0x10(%rsp)
jmp 0xece0
movb $0x1, %al
movq %rax, 0x10(%rsp)
movq 0x68(%rsp), %rbx
jmp 0xece0
movq 0xa8(%rsp), %rcx
shlq $0x6, %rcx
movapd 0x70(%rsp), %xmm0
movapd %xmm0, 0x940(%rsp,%rcx)
movsd 0x80(%rsp), %xmm1
movsd %xmm1, 0x950(%rsp,%rcx)
movapd 0x50(%rsp), %xmm3
mulsd %xmm0, %xmm3
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
movapd 0x30(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm3, %xmm0
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
mulsd %xmm1, %xmm2
addsd %xmm0, %xmm2
movsd %xmm2, 0x970(%rsp,%rcx)
incl %eax
movl %eax, 0xc(%rsp)
movl 0x20(%rsp), %ecx
incl %ecx
jmp 0xea00
leaq 0xc07e(%rip), %rax      # 0x1ad70
movaps (%rax), %xmm0
movaps %xmm0, 0x50(%rsp)
xorl %r15d, %r15d
movl 0xc(%rsp), %ebx
testl %ebx, %ebx
movl $0x0, %ecx
cmovgl %ebx, %ecx
movq %rcx, 0x48(%rsp)
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
movl %ebx, %eax
movq %rax, 0x30(%rsp)
pushq $0x3
popq %rcx
leaq 0x940(%rsp), %r12
leaq 0xc0(%rsp), %r13
cmpq 0x48(%rsp), %r15
je 0xedf9
pushq $0x20
popq %rdi
callq 0x4310
movq %rax, %rbp
movq %r15, %rax
shlq $0x6, %rax
leaq (%rsp,%rax), %rsi
addq $0x940, %rsi            # imm = 0x940
movsd 0x30(%rsi), %xmm0
movq %rbp, %rdi
callq 0xb02c
movq %rbp, 0x140(%rsp,%r15,8)
movq %r12, %rbx
xorl %ecx, %ecx
cmpq %rcx, 0x30(%rsp)
je 0xeddd
cmpq %rcx, %r15
je 0xedd4
movapd 0x50(%rsp), %xmm0
subpd (%rbx), %xmm0
movsd 0x28(%rsp), %xmm1
subsd 0x10(%rbx), %xmm1
movapd %xmm0, 0xc0(%rsp)
movsd %xmm1, 0xd0(%rsp)
movsd 0x30(%rbx), %xmm0
xorpd 0xd489(%rip), %xmm0     # 0x1c240
movq %rbp, %rdi
movq %rcx, %r14
movq %r13, %rsi
movsd 0xd6a0(%rip), %xmm1     # 0x1c468
callq 0xb7b2
movq %r14, %rcx
testb %al, %al
je 0xede6
incq %rcx
addq $0x40, %rbx
jmp 0xed77
movq 0x30(%rsp), %rax
movl %eax, %ecx
jmp 0xeded
movb $0x1, %al
movq %rax, 0x10(%rsp)
incq %r15
movl 0xc(%rsp), %ebx
jmp 0xed35
movq %rcx, 0x20(%rsp)
xorl %ecx, %ecx
xorl %r9d, %r9d
cmpq 0x48(%rsp), %rcx
je 0xf229
movq 0x140(%rsp,%rcx,8), %r10
movq %rcx, 0xb0(%rsp)
movq %rcx, %rax
shlq $0x6, %rax
addq %rsp, %rax
addq $0x940, %rax            # imm = 0x940
movq %rax, 0xb8(%rsp)
xorl %ecx, %ecx
movq 0x10(%rsp), %rdx
movq %r10, 0x130(%rsp)
movl %edx, %r11d
movl 0x8(%r10), %edi
cmpq %rdi, %rcx
jae 0xf211
cmpl $0x100, %r9d            # imm = 0x100
jl 0xee65
incq %rcx
movb $0x1, %dl
jmp 0xee45
movslq %r9d, %rax
imulq $0x90, %rax, %rsi
movq 0x10(%r10), %r8
leaq 0x1(%rcx), %r14
movl %r14d, %eax
xorl %edx, %edx
divl %edi
imulq $0x18, %rdx, %rax
movsd (%r8,%rax), %xmm0
movsd %xmm0, 0x6188(%rsp,%rsi)
movq 0x10(%r10), %rdi
movl %r14d, %eax
xorl %edx, %edx
divl 0x8(%r10)
imulq $0x18, %rdx, %rax
movsd 0x8(%rdi,%rax), %xmm1
movsd %xmm1, 0x6190(%rsp,%rsi)
movq 0x10(%r10), %rdi
movl %r14d, %eax
xorl %edx, %edx
divl 0x8(%r10)
imulq $0x18, %rdx, %rax
movsd 0x10(%rdi,%rax), %xmm2
movsd %xmm2, 0x6198(%rsp,%rsi)
movq 0x10(%r10), %rax
imulq $0x18, %rcx, %rcx
movsd (%rax,%rcx), %xmm3
movsd %xmm3, 0x61a0(%rsp,%rsi)
movq 0x10(%r10), %rax
movsd 0x8(%rax,%rcx), %xmm4
movsd %xmm4, 0x61a8(%rsp,%rsi)
movq 0x10(%r10), %rax
movsd 0x10(%rax,%rcx), %xmm5
movsd %xmm5, 0x61b0(%rsp,%rsi)
movsd %xmm0, 0x6170(%rsp,%rsi)
movsd %xmm1, 0x6178(%rsp,%rsi)
movsd %xmm2, 0x6180(%rsp,%rsi)
subsd %xmm0, %xmm3
movsd %xmm3, 0x61b8(%rsp,%rsi)
subsd %xmm1, %xmm4
movsd %xmm4, 0x61c0(%rsp,%rsi)
subsd %xmm2, %xmm5
movsd %xmm5, 0x61c8(%rsp,%rsi)
mulsd %xmm4, %xmm4
mulsd %xmm3, %xmm3
addsd %xmm4, %xmm3
mulsd %xmm5, %xmm5
addsd %xmm3, %xmm5
sqrtsd %xmm5, %xmm0
movb $0x1, %dl
movsd 0xd557(%rip), %xmm1     # 0x1c4c8
ucomisd %xmm0, %xmm1
movq %r14, %rcx
ja 0xee45
movq %r14, 0x138(%rsp)
movb %r11b, 0x10(%rsp)
movl %r9d, 0x1c(%rsp)
leaq (%rsp,%rsi), %rcx
addq $0x6140, %rcx           # imm = 0x6140
leaq 0x6188(%rsp,%rsi), %r13
leaq 0x61a0(%rsp,%rsi), %rbp
movq 0xb8(%rsp), %rax
movaps (%rax), %xmm0
movaps %xmm0, (%rcx)
movsd 0x10(%rax), %xmm0
movq %rcx, 0x90(%rsp)
movsd %xmm0, 0x10(%rcx)
xorl %ebx, %ebx
movl $0x0, 0x28(%rsp)
cmpq 0x30(%rsp), %rbx
je 0xf081
movq 0x140(%rsp,%rbx,8), %r15
movq %rbx, %rax
shlq $0x6, %rax
addq %rsp, %rax
addq $0x940, %rax            # imm = 0x940
movq %rax, 0x50(%rsp)
xorl %r14d, %r14d
movl 0x8(%r15), %eax
cmpl %eax, %r14d
jae 0xf079
leal 0x1(%r14), %r12d
cmpl %eax, %r12d
movl %r12d, %eax
movl $0x0, %ecx
cmovel %ecx, %eax
imulq $0x18, %rax, %rdi
addq 0x10(%r15), %rdi
movq %rbp, %rsi
callq 0xfae3
testb %al, %al
je 0xf046
movslq %r14d, %rax
imulq $0x18, %rax, %rdi
addq 0x10(%r15), %rdi
movq %r13, %rsi
callq 0xfae3
testb %al, %al
jne 0xf04b
movl %r12d, %r14d
jmp 0xf000
incl 0x28(%rsp)
movq 0x50(%rsp), %rcx
movaps (%rcx), %xmm0
movq 0x90(%rsp), %rax
movups %xmm0, 0x18(%rax)
movsd 0x10(%rcx), %xmm0
movsd %xmm0, 0x28(%rax)
incl %r14d
movl %ebx, %eax
movq %rax, 0x20(%rsp)
jmp 0xf000
incq %rbx
jmp 0xefd5
movq 0x138(%rsp), %rdi
movq %rdi, %rcx
cmpl $0x1, 0x28(%rsp)
movl 0xc(%rsp), %ebx
movb $0x1, %dl
movl 0x1c(%rsp), %r9d
movq 0x130(%rsp), %r10
movb 0x10(%rsp), %sil
jne 0xee45
movq 0x90(%rsp), %rax
movsd 0x48(%rax), %xmm0
movsd (%rax), %xmm6
movsd 0x8(%rax), %xmm3
movsd 0x50(%rax), %xmm4
movapd %xmm4, %xmm1
mulsd %xmm3, %xmm1
movapd %xmm0, %xmm2
mulsd %xmm6, %xmm2
addsd %xmm1, %xmm2
movsd 0x58(%rax), %xmm1
movsd 0x10(%rax), %xmm7
movapd %xmm1, %xmm5
mulsd %xmm7, %xmm5
addsd %xmm2, %xmm5
movq 0xb8(%rsp), %rax
movsd 0x30(%rax), %xmm8
subsd %xmm8, %xmm5
andpd 0xd141(%rip), %xmm5     # 0x1c250
ucomisd 0x9f69(%rip), %xmm5     # 0x19080
movq %rdi, %rcx
ja 0xee45
movq 0x90(%rsp), %rax
movsd 0x60(%rax), %xmm2
movsd 0x68(%rax), %xmm5
mulsd %xmm5, %xmm3
mulsd %xmm2, %xmm6
addsd %xmm3, %xmm6
movsd 0x70(%rax), %xmm3
mulsd %xmm3, %xmm7
addsd %xmm6, %xmm7
subsd %xmm8, %xmm7
andpd 0xd0f8(%rip), %xmm7     # 0x1c250
ucomisd 0x9f20(%rip), %xmm7     # 0x19080
movq %rdi, %rcx
ja 0xee45
movq 0x90(%rsp), %rax
movsd 0x18(%rax), %xmm6
movsd 0x20(%rax), %xmm7
mulsd %xmm7, %xmm4
mulsd %xmm6, %xmm0
addsd %xmm4, %xmm0
movsd 0x28(%rax), %xmm4
mulsd %xmm4, %xmm1
addsd %xmm0, %xmm1
movslq 0x20(%rsp), %rax
movq %rax, %rcx
shlq $0x6, %rcx
movsd 0x970(%rsp,%rcx), %xmm0
subsd %xmm0, %xmm1
andpd 0xd09b(%rip), %xmm1     # 0x1c250
ucomisd 0x9ec3(%rip), %xmm1     # 0x19080
movq %rdi, %rcx
ja 0xee45
mulsd %xmm7, %xmm5
mulsd %xmm6, %xmm2
addsd %xmm5, %xmm2
mulsd %xmm4, %xmm3
addsd %xmm2, %xmm3
subsd %xmm0, %xmm3
andpd 0xd06a(%rip), %xmm3     # 0x1c250
ucomisd 0x9e92(%rip), %xmm3     # 0x19080
movq %rdi, %rcx
ja 0xee45
xorl %ecx, %ecx
cmpq %rax, 0xb0(%rsp)
setl %cl
addl %ecx, %r9d
movq %rdi, %rcx
movl %esi, %edx
jmp 0xee45
movq 0xb0(%rsp), %rcx
incq %rcx
movl %r11d, %eax
movq %rax, 0x10(%rsp)
jmp 0xee03
movl %r9d, 0x1c(%rsp)
shlq $0x6, 0x30(%rsp)
xorl %eax, %eax
leaq 0xc0(%rsp), %r12
xorl %r13d, %r13d
cmpq 0x48(%rsp), %rax
je 0xf3b8
movq %rax, 0x50(%rsp)
movq 0x140(%rsp,%rax,8), %r15
xorl %ebp, %ebp
movq 0x10(%rsp), %rdx
movq %rdx, 0x10(%rsp)
movl 0x8(%r15), %eax
cmpq %rax, %rbp
jae 0xf3a7
movq 0x10(%r15), %rax
imulq $0x18, %rbp, %rcx
movsd (%rax,%rcx), %xmm0
movsd %xmm0, 0xc0(%rsp)
movsd 0x8(%rax,%rcx), %xmm0
movsd %xmm0, 0xc8(%rsp)
movsd 0x10(%rax,%rcx), %xmm0
movsd %xmm0, 0xd0(%rsp)
testl %r13d, %r13d
movl $0x0, %ebx
cmovgl %r13d, %ebx
incq %rbx
leaq 0x4940(%rsp), %rdi
decq %rbx
je 0xf2df
leaq 0x18(%rdi), %r14
movq %r12, %rsi
callq 0xfae3
movq %r14, %rdi
testb %al, %al
je 0xf2bd
movq 0x10(%rsp), %rdx
jmp 0xf39f
cmpl $0x100, %r13d           # imm = 0x100
movq 0x10(%rsp), %rdx
jle 0xf2f4
movb $0x1, %dl
jmp 0xf39f
movslq %r13d, %rax
imulq $0x18, %rax, %rax
movapd 0xc0(%rsp), %xmm0
movupd %xmm0, 0x4940(%rsp,%rax)
movsd 0xd0(%rsp), %xmm1
movsd %xmm1, 0x4950(%rsp,%rax)
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
xorl %eax, %eax
cmpq %rax, 0x30(%rsp)
je 0xf39c
movsd 0x948(%rsp,%rax), %xmm3
mulsd %xmm2, %xmm3
movsd 0x940(%rsp,%rax), %xmm4
mulsd %xmm0, %xmm4
addsd %xmm3, %xmm4
movsd 0x950(%rsp,%rax), %xmm3
mulsd %xmm1, %xmm3
addsd %xmm4, %xmm3
subsd 0x970(%rsp,%rax), %xmm3
andpd 0xcee0(%rip), %xmm3     # 0x1c250
movsd 0x9d08(%rip), %xmm4     # 0x19080
cmpltpd %xmm3, %xmm4
movsd 0xd0e3(%rip), %xmm5     # 0x1c468
cmpltpd %xmm5, %xmm3
andpd %xmm4, %xmm3
movd %xmm3, %ecx
orb %dl, %cl
addq $0x40, %rax
movl %ecx, %edx
jmp 0xf329
incl %r13d
incq %rbp
jmp 0xf260
movq 0x50(%rsp), %rax
incq %rax
movl 0xc(%rsp), %ebx
jmp 0xf241
testb $0x1, 0x10(%rsp)
je 0xf3df
movq 0x68(%rsp), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
leaq 0xd5c2(%rip), %rdi      # 0x1c992
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x8d7b
jmp 0xf5da
pushq $0x30
popq %rdi
callq 0x4450
movq %rax, %r14
xorl %edi, %edi
testq %rax, %rax
setne %dil
pushq $0x1
popq %rbp
movl %ebp, %esi
callq 0x9517
movl %ebx, (%r14)
movq 0xa8(%rsp), %rdi
shlq $0x6, %rdi
callq 0x4450
movq %rax, %r15
movq %r14, 0x30(%rsp)
movq %rax, 0x8(%r14)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl %ebp, %esi
callq 0x9517
xorl %ebp, %ebp
cmpq 0x48(%rsp), %rbp
je 0xf51c
movq %rbp, %rbx
shlq $0x6, %rbx
leaq (%r15,%rbx), %r12
movaps 0x940(%rsp,%rbx), %xmm0
movups %xmm0, (%r15,%rbx)
movsd 0x950(%rsp,%rbx), %xmm0
movsd %xmm0, 0x10(%r15,%rbx)
movq 0x140(%rsp,%rbp,8), %r14
movq 0x10(%r14), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x18(%r15,%rbx)
movq 0x10(%r14), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x20(%r15,%rbx)
movq 0x10(%r14), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x28(%r15,%rbx)
movslq 0x8(%r14), %rax
movl %eax, 0x30(%r15,%rbx)
imulq $0x18, %rax, %rdi
callq 0x4450
movq %rax, 0x38(%r15,%rbx)
xorl %edi, %edi
testq %rax, %rax
setne %dil
pushq $0x1
popq %rsi
callq 0x9517
xorl %eax, %eax
xorl %ecx, %ecx
movl 0x8(%r14), %edx
cmpq %rdx, %rcx
jae 0xf514
movq 0x10(%r14), %rdx
movsd (%rdx,%rax), %xmm0
movq 0x38(%r12), %rdx
movsd %xmm0, (%rdx,%rax)
movq 0x10(%r14), %rdx
movsd 0x8(%rdx,%rax), %xmm0
movq 0x38(%r12), %rdx
movsd %xmm0, 0x8(%rdx,%rax)
movq 0x10(%r14), %rdx
movsd 0x10(%rdx,%rax), %xmm0
movq 0x38(%r12), %rdx
movsd %xmm0, 0x10(%rdx,%rax)
incq %rcx
addq $0x18, %rax
jmp 0xf4c5
incq %rbp
jmp 0xf42f
movl 0x1c(%rsp), %eax
movq 0x30(%rsp), %r14
movl %eax, 0x10(%r14)
movslq %eax, %r15
imulq $0x90, %r15, %r12
movq %r12, %rdi
callq 0x4450
movq %rax, %rbx
movq %rax, 0x18(%r14)
xorl %edi, %edi
testq %rax, %rax
setne %dil
pushq $0x1
popq %rsi
callq 0x9517
leaq 0x6140(%rsp), %rsi
movq %rbx, %rdi
movq %r12, %rdx
callq 0x4280
movl %r13d, 0x20(%r14)
movslq %r13d, %r12
imulq $0x18, %r12, %r13
movq %r13, %rdi
callq 0x4450
movq %rax, %rbp
movq %rax, 0x28(%r14)
xorl %edi, %edi
testq %rax, %rax
setne %dil
pushq $0x1
popq %rsi
callq 0x9517
leaq 0x4940(%rsp), %rsi
movq %rbp, %rdi
movq %r13, %rdx
callq 0x4280
movsd 0x110(%rsp), %xmm0
movsd 0x118(%rsp), %xmm1
movsd 0x120(%rsp), %xmm2
leaq 0xd387(%rip), %rsi      # 0x1c94d
pushq $0x3
popq %rdi
movl 0xc(%rsp), %edx
movl %r15d, %ecx
movl %r12d, %r8d
movb $0x3, %al
callq 0x9291
xorl %ebx, %ebx
cmpq %rbx, 0x48(%rsp)
je 0xf5fb
movq 0x140(%rsp,%rbx,8), %rdi
testq %rdi, %rdi
je 0xf5f6
movq (%rdi), %rax
callq *0x8(%rax)
incq %rbx
jmp 0xf5dc
movq %r14, %rax
addq $0xf148, %rsp           # imm = 0xF148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x20
popq %rsi
movq %rbp, %rdi
callq 0x4320
movq %rbx, %rdi
callq 0x4590