// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlcsg/brush.cpp
// Function: ExpandBrushWithHullBrush(brush_s const*, brushhull_t const*, hullbrush_t const*, brushhull_t*)
void ExpandBrushWithHullBrush (const brush_t *brush, const brushhull_t *hull0, const hullbrush_t *hb, brushhull_t *hull)
{
	const hullbrushface_t *hbf;
	const hullbrushedge_t *hbe;
	const hullbrushvertex_t *hbv;
	bface_t *f;
	vec3_t normal;
	vec3_t origin;
	bool *axialbevel;
	bool warned;

	axialbevel = (bool *)malloc (hb->numfaces * sizeof (bool));
	memset (axialbevel, 0, hb->numfaces * sizeof (bool));
	warned = false;
	
	// check for collisions of face-vertex type. face-edge type is also permitted. face-face type is excluded.
	for (f = hull0->faces; f; f = f->next)
	{
		hullbrushface_t brushface;
		VectorCopy (f->plane->normal, brushface.normal);
		VectorCopy (f->plane->origin, brushface.point);

		// check for coplanar hull brush face
		for (hbf = hb->faces; hbf < hb->faces + hb->numfaces; hbf++)
		{
			if (-DotProduct (hbf->normal, brushface.normal) < 1 - ON_EPSILON)
			{
				continue;
			}
			// now test precisely
			vec_t dotmin;
			vec_t dotmax;
			dotmin = BOGUS_RANGE;
			dotmax = -BOGUS_RANGE;
			hlassume (hbf->numvertexes >= 1, assume_first);
			for (vec3_t *v = hbf->vertexes; v < hbf->vertexes + hbf->numvertexes; v++)
			{
				vec_t dot;
				dot = DotProduct (*v, brushface.normal);
				dotmin = qmin (dotmin, dot);
				dotmax = qmax (dotmax, dot);
			}
			if (dotmax - dotmin <= EQUAL_EPSILON)
			{
				break;
			}
		}
		if (hbf < hb->faces + hb->numfaces)
		{
			if (f->bevel)
			{
				axialbevel[hbf - hb->faces] = true;
			}
			continue; // the same plane will be added in the last stage
		}
		
		// find the impact point
		vec3_t bestvertex;
		vec_t bestdist;
		bestdist = BOGUS_RANGE;
		hlassume (hb->numvertexes >= 1, assume_first);
		for (hbv = hb->vertexes; hbv < hb->vertexes + hb->numvertexes; hbv++)
		{
			if (hbv == hb->vertexes || DotProduct (hbv->point, brushface.normal) < bestdist - NORMAL_EPSILON)
			{
				bestdist = DotProduct (hbv->point, brushface.normal);
				VectorCopy (hbv->point, bestvertex);
			}
		}

		// add hull plane for this face
		VectorCopy (brushface.normal, normal);
		if (f->bevel)
		{
			VectorCopy (brushface.point, origin);
		}
		else
		{
			VectorSubtract (brushface.point, bestvertex, origin);
		}
		AddHullPlane (hull, normal, origin, true);
	}

	// check for edge-edge type. edge-face type and face-edge type are excluded.
	for (f = hull0->faces; f; f = f->next)
	{
		for (int i = 0; i < f->w->m_NumPoints; i++) // for each edge in f
		{
			hullbrushedge_t brushedge;
			VectorCopy (f->plane->normal, brushedge.normals[0]);
			VectorCopy (f->w->m_Points[(i + 1) % f->w->m_NumPoints], brushedge.vertexes[0]);
			VectorCopy (f->w->m_Points[i], brushedge.vertexes[1]);
			VectorCopy (brushedge.vertexes[0], brushedge.point);
			VectorSubtract (brushedge.vertexes[1], brushedge.vertexes[0], brushedge.delta);

			// fill brushedge.normals[1]
			int found;
			found = 0;
			for (bface_t *f2 = hull0->faces; f2; f2 = f2->next)
			{
				for (int j = 0; j < f2->w->m_NumPoints; j++)
				{
					if (VectorCompare (f2->w->m_Points[(j + 1) % f2->w->m_NumPoints], brushedge.vertexes[1]) &&
						VectorCompare (f2->w->m_Points[j], brushedge.vertexes[0]))
					{
						VectorCopy (f2->plane->normal, brushedge.normals[1]);
						found++;
					}
				}
			}
			if (found != 1)
			{
				if (!warned)
				{
					Warning("Illegal Brush (edge without opposite face): Entity %i, Brush %i\n",
#ifdef HLCSG_COUNT_NEW
						brush->originalentitynum, brush->originalbrushnum
#else
						brush->entitynum, brush->brushnum
#endif
						);
					warned = true;
				}
				continue;
			}

			// make sure the math is accurate
			vec_t len;
			len = VectorLength (brushedge.delta);
			CrossProduct (brushedge.normals[0], brushedge.normals[1], brushedge.delta);
			if (!VectorNormalize (brushedge.delta))
			{
				continue;
			}
			VectorScale (brushedge.delta, len, brushedge.delta);

			// check for each edge in the hullbrush
			for (hbe = hb->edges; hbe < hb->edges + hb->numedges; hbe++)
			{
				vec_t dot[4];
				dot[0] = DotProduct (hbe->delta, brushedge.normals[0]);
				dot[1] = DotProduct (hbe->delta, brushedge.normals[1]);
				dot[2] = DotProduct (brushedge.delta, hbe->normals[0]);
				dot[3] = DotProduct (brushedge.delta, hbe->normals[1]);
				if (dot[0] <= ON_EPSILON || dot[1] >= -ON_EPSILON || dot[2] <= ON_EPSILON || dot[3] >= -ON_EPSILON)
				{
					continue;
				}

				// in the outer loop, each edge in the brush will be iterated twice (once from f and once from the corresponding f2)
				// but since brushedge.delta are exactly the opposite between the two iterations
				// only one of them can reach here
				vec3_t e1;
				vec3_t e2;
				VectorCopy (brushedge.delta, e1);
				VectorNormalize (e1);
				VectorCopy (hbe->delta, e2);
				VectorNormalize (e2);
				CrossProduct (e1, e2, normal);
				if (!VectorNormalize (normal))
				{
					continue;
				}
				VectorSubtract (brushedge.point, hbe->point, origin);
				AddHullPlane (hull, normal, origin, true);
			}
		}
	}

	// check for vertex-face type. edge-face type and face-face type are permitted.
	for (hbf = hb->faces; hbf < hb->faces + hb->numfaces; hbf++)
	{
		// find the impact point
		vec3_t bestvertex;
		vec_t bestdist;
		bestdist = BOGUS_RANGE;
		if (!hull0->faces)
		{
			continue;
		}
		for (f = hull0->faces; f; f = f->next)
		{
			for (vec3_t *v = f->w->m_Points; v < f->w->m_Points + f->w->m_NumPoints; v++)
			{
				if (DotProduct (*v, hbf->normal) < bestdist - NORMAL_EPSILON)
				{
					bestdist = DotProduct (*v, hbf->normal);
					VectorCopy (*v, bestvertex);
				}
			}
		}

		// add hull plane for this face
		VectorSubtract (vec3_origin, hbf->normal, normal);
		if (axialbevel[hbf - hb->faces])
		{
			VectorCopy (bestvertex, origin);
		}
		else
		{
			VectorSubtract (bestvertex, hbf->point, origin);
		}
		AddHullPlane (hull, normal, origin, true);
	}

	free (axialbevel);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rcx, 0x48(%rsp)
movq %rsi, %r12
movq %rdi, 0x148(%rsp)
movq %rdx, (%rsp)
movslq (%rdx), %rsi
pushq $0x1
popq %rdi
callq 0x4220
movq %rax, 0x40(%rsp)
addq $0x30, %r12
leaq 0x80(%rsp), %rbx
leaq 0x60(%rsp), %r15
pushq $0x1
popq %rbp
movq %r12, 0x58(%rsp)
movq (%rsp), %rdi
movq (%r12), %r12
testq %r12, %r12
je 0xcaec
movq 0x10(%r12), %rax
movupd (%rax), %xmm5
movsd 0x10(%rax), %xmm4
movupd 0x18(%rax), %xmm0
movapd %xmm0, 0xa0(%rsp)
movsd 0x28(%rax), %xmm2
movq 0x8(%rdi), %rax
movapd %xmm5, %xmm6
unpckhpd %xmm5, %xmm6            # xmm6 = xmm6[1],xmm5[1]
movq %rax, %r13
movsd %xmm2, 0x8(%rsp)
movsd %xmm4, 0x20(%rsp)
movapd %xmm5, 0x30(%rsp)
movapd %xmm6, 0x10(%rsp)
movslq (%rdi), %rcx
movq %rcx, %rdx
shlq $0x6, %rdx
addq %rax, %rdx
cmpq %rdx, %r13
jae 0xc954
movsd 0x8(%r13), %xmm0
mulsd %xmm6, %xmm0
movsd (%r13), %xmm1
mulsd %xmm5, %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%r13), %xmm0
mulsd %xmm4, %xmm0
addsd %xmm1, %xmm0
ucomisd 0xfbc8(%rip), %xmm0     # 0x1c478
ja 0xc948
xorl %edi, %edi
cmpl $0x0, 0x30(%r13)
setg %dil
xorl %esi, %esi
callq 0x9517
movapd 0x10(%rsp), %xmm6
movapd 0x30(%rsp), %xmm5
movsd 0x20(%rsp), %xmm4
movq (%rsp), %rdi
movq 0x38(%r13), %rax
movslq 0x30(%r13), %rcx
imulq $0x18, %rcx, %rcx
addq %rax, %rcx
movsd 0xfb93(%rip), %xmm0     # 0x1c488
movsd 0xfb83(%rip), %xmm1     # 0x1c480
cmpq %rcx, %rax
jae 0xc932
movsd 0x8(%rax), %xmm2
mulsd %xmm6, %xmm2
movsd (%rax), %xmm3
mulsd %xmm5, %xmm3
addsd %xmm2, %xmm3
movsd 0x10(%rax), %xmm2
mulsd %xmm4, %xmm2
addsd %xmm3, %xmm2
minsd %xmm2, %xmm1
maxsd %xmm2, %xmm0
addq $0x18, %rax
jmp 0xc8fd
subsd %xmm1, %xmm0
movsd 0xfb52(%rip), %xmm1     # 0x1c490
ucomisd %xmm0, %xmm1
movq 0x8(%rdi), %rax
jae 0xc951
addq $0x40, %r13
jmp 0xc86c
movslq (%rdi), %rcx
shlq $0x6, %rcx
addq %rax, %rcx
cmpq %rcx, %r13
jae 0xc982
cmpb $0x1, 0x30(%r12)
jne 0xc817
subq %rax, %r13
sarq $0x6, %r13
movq 0x40(%rsp), %rax
movb $0x1, (%rax,%r13)
jmp 0xc817
xorl %edi, %edi
movq (%rsp), %rax
cmpl $0x0, 0x20(%rax)
setg %dil
xorl %esi, %esi
callq 0x9517
movapd 0x10(%rsp), %xmm10
movapd 0x30(%rsp), %xmm9
movsd 0x20(%rsp), %xmm8
movq (%rsp), %rcx
movq 0x28(%rcx), %rax
movslq 0x20(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rax, %rcx
xorl %edx, %edx
movsd 0xfab7(%rip), %xmm0     # 0x1c480
movsd 0x50(%rsp), %xmm6
movapd 0x190(%rsp), %xmm7
leaq (%rax,%rdx), %rsi
cmpq %rcx, %rsi
jae 0xca72
movsd (%rsi), %xmm1
movapd %xmm1, %xmm2
mulsd %xmm9, %xmm2
testq %rdx, %rdx
je 0xca3d
movsd 0x8(%rax,%rdx), %xmm3
movsd 0x10(%rax,%rdx), %xmm4
movapd %xmm10, %xmm5
mulsd %xmm3, %xmm5
addsd %xmm5, %xmm2
movapd %xmm4, %xmm5
mulsd %xmm8, %xmm5
addsd %xmm2, %xmm5
movapd %xmm0, %xmm2
addsd 0xfa6f(%rip), %xmm2     # 0x1c498
ucomisd %xmm5, %xmm2
jbe 0xca69
unpcklpd %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0]
movapd %xmm4, %xmm6
movapd %xmm5, %xmm0
jmp 0xca65
movsd 0x8(%rax), %xmm3
movsd 0x10(%rax), %xmm6
movapd %xmm10, %xmm0
mulsd %xmm3, %xmm0
addsd %xmm0, %xmm2
movapd %xmm6, %xmm0
mulsd %xmm8, %xmm0
addsd %xmm2, %xmm0
unpcklpd %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0]
movapd %xmm1, %xmm7
addq $0x18, %rdx
jmp 0xc9d8
movapd %xmm9, 0x80(%rsp)
movsd %xmm8, 0x90(%rsp)
cmpb $0x1, 0x30(%r12)
movsd %xmm6, 0x50(%rsp)
movapd %xmm7, 0x190(%rsp)
jne 0xcab2
movaps 0xa0(%rsp), %xmm0
movaps %xmm0, 0x60(%rsp)
movsd 0x8(%rsp), %xmm0
jmp 0xcacf
movapd 0xa0(%rsp), %xmm0
subpd %xmm7, %xmm0
movapd %xmm0, 0x60(%rsp)
movsd 0x8(%rsp), %xmm0
subsd %xmm6, %xmm0
movsd %xmm0, 0x70(%rsp)
movq 0x48(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
movl %ebp, %ecx
callq 0xc75e
jmp 0xc813
leaq 0xf8(%rsp), %rbp
leaq 0x110(%rsp), %r12
xorl %r15d, %r15d
xorl %edx, %edx
movq 0x58(%rsp), %r8
movq (%r8), %r8
testq %r8, %r8
je 0xd0a3
xorl %ecx, %ecx
movq %r8, 0x8(%rsp)
movq 0x18(%r8), %rsi
movl 0x8(%rsi), %eax
cmpq %rax, %rcx
jae 0xcb06
movq %rdx, 0x30(%rsp)
movq 0x10(%r8), %rax
movups (%rax), %xmm0
movaps %xmm0, 0xb0(%rsp)
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0xc0(%rsp)
movq 0x10(%rsi), %rdi
leaq 0x1(%rcx), %r9
movl %r9d, %eax
xorl %edx, %edx
divl 0x8(%rsi)
imulq $0x18, %rdx, %rax
movsd (%rdi,%rax), %xmm0
movsd %xmm0, 0xf8(%rsp)
movq 0x18(%r8), %rsi
movq 0x10(%rsi), %rdi
movl %r9d, %eax
xorl %edx, %edx
divl 0x8(%rsi)
imulq $0x18, %rdx, %rax
movsd 0x8(%rdi,%rax), %xmm1
movsd %xmm1, 0x100(%rsp)
movq 0x18(%r8), %rsi
movq 0x10(%rsi), %rdi
movq %r9, 0x10(%rsp)
movl %r9d, %eax
xorl %edx, %edx
divl 0x8(%rsi)
movl $0x0, 0x20(%rsp)
imulq $0x18, %rdx, %rax
movsd 0x10(%rdi,%rax), %xmm2
movsd %xmm2, 0x108(%rsp)
movq 0x18(%r8), %rax
movq 0x10(%rax), %rax
imulq $0x18, %rcx, %rcx
movsd (%rax,%rcx), %xmm3
movsd %xmm3, 0x110(%rsp)
movq 0x18(%r8), %rax
movq 0x10(%rax), %rax
movsd 0x8(%rax,%rcx), %xmm4
movsd %xmm4, 0x118(%rsp)
movq 0x18(%r8), %rax
movq 0x10(%rax), %rax
movsd 0x10(%rax,%rcx), %xmm5
movsd %xmm5, 0x120(%rsp)
movsd %xmm0, 0xe0(%rsp)
movsd %xmm1, 0xe8(%rsp)
movsd %xmm2, 0xf0(%rsp)
unpcklpd %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0]
unpcklpd %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
subpd %xmm0, %xmm3
movupd %xmm3, 0x128(%rsp)
subsd %xmm2, %xmm5
movsd %xmm5, 0x138(%rsp)
movq 0x58(%rsp), %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0xccde
xorl %r13d, %r13d
movq 0x18(%rbx), %rax
movl 0x8(%rax), %ecx
cmpl %ecx, %r13d
jae 0xcc46
leal 0x1(%r13), %r14d
cmpl %ecx, %r14d
movl %r14d, %ecx
cmovel %r15d, %ecx
imulq $0x18, %rcx, %rdi
addq 0x10(%rax), %rdi
movq %r12, %rsi
callq 0xfae3
testb %al, %al
je 0xcc9e
movq 0x18(%rbx), %rax
movslq %r13d, %rcx
imulq $0x18, %rcx, %rdi
addq 0x10(%rax), %rdi
movq %rbp, %rsi
callq 0xfae3
testb %al, %al
jne 0xcca3
movl %r14d, %r13d
jmp 0xcc55
movq 0x10(%rbx), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0xc8(%rsp)
movq 0x10(%rbx), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0xd0(%rsp)
movq 0x10(%rbx), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0xd8(%rsp)
incl 0x20(%rsp)
jmp 0xcc9e
cmpl $0x1, 0x20(%rsp)
jne 0xd058
movsd 0x128(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x130(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x138(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
movsd 0xc8(%rsp), %xmm0
movsd 0xb0(%rsp), %xmm1
movupd 0xb8(%rsp), %xmm2
movapd 0xd0(%rsp), %xmm3
movapd %xmm2, %xmm4
shufpd $0x1, %xmm1, %xmm4      # xmm4 = xmm4[1],xmm1[0]
mulpd %xmm3, %xmm4
mulsd %xmm3, %xmm1
shufpd $0x1, %xmm0, %xmm3      # xmm3 = xmm3[1],xmm0[0]
mulpd %xmm2, %xmm3
subpd %xmm4, %xmm3
movupd %xmm3, 0x128(%rsp)
mulsd %xmm2, %xmm0
subsd %xmm0, %xmm1
movsd %xmm1, 0x138(%rsp)
leaq 0x128(%rsp), %rdi
callq 0xc2e9
ucomisd 0xf716(%rip), %xmm0     # 0x1c4a0
jne 0xcd92
jnp 0xd087
movsd 0x50(%rsp), %xmm1
mulsd %xmm1, %xmm1
movsd 0x20(%rsp), %xmm0
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
movsd 0xa0(%rsp), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm0, %xmm1
sqrtsd %xmm1, %xmm0
movupd 0x128(%rsp), %xmm1
movapd %xmm0, %xmm2
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
mulpd %xmm1, %xmm2
movupd %xmm2, 0x128(%rsp)
mulsd 0x138(%rsp), %xmm0
movsd %xmm0, 0x138(%rsp)
movq (%rsp), %rdi
movq 0x18(%rdi), %rax
movq %rax, %r13
movq 0x48(%rsp), %rbx
movslq 0x10(%rdi), %rcx
imulq $0x90, %rcx, %rcx
addq %rax, %rcx
cmpq %rcx, %r13
jae 0xd07e
movupd 0x128(%rsp), %xmm0
movsd 0x138(%rsp), %xmm1
movsd 0xb8(%rsp), %xmm2
movapd %xmm0, %xmm3
shufpd $0x1, %xmm2, %xmm3      # xmm3 = xmm3[1],xmm2[0]
movsd 0x80(%r13), %xmm2
movsd (%r13), %xmm5
movsd 0x8(%r13), %xmm6
movsd 0x10(%r13), %xmm7
unpcklpd %xmm2, %xmm6            # xmm6 = xmm6[0],xmm2[0]
mulpd %xmm3, %xmm6
movapd %xmm0, %xmm3
movhpd 0xb0(%rsp), %xmm3       # xmm3 = xmm3[0],mem[0]
movsd 0x78(%r13), %xmm4
unpcklpd %xmm4, %xmm5            # xmm5 = xmm5[0],xmm4[0]
mulpd %xmm3, %xmm5
addpd %xmm6, %xmm5
movsd 0x88(%r13), %xmm3
unpcklpd %xmm3, %xmm7            # xmm7 = xmm7[0],xmm3[0]
movapd %xmm1, %xmm6
movhpd 0xc0(%rsp), %xmm6       # xmm6 = xmm6[0],mem[0]
mulpd %xmm7, %xmm6
addpd %xmm5, %xmm6
cmplepd 0xf569(%rip), %xmm6     # 0x1c410
movmskpd %xmm6, %ecx
testb $0x2, %cl
jne 0xd04c
movsd 0xd0(%rsp), %xmm5
movsd 0x18(%r13), %xmm6
movapd %xmm0, %xmm7
shufpd $0x1, %xmm5, %xmm7      # xmm7 = xmm7[1],xmm5[0]
movsd 0x20(%r13), %xmm5
unpcklpd %xmm2, %xmm5            # xmm5 = xmm5[0],xmm2[0]
movapd %xmm0, %xmm2
movhpd 0xc8(%rsp), %xmm2       # xmm2 = xmm2[0],mem[0]
mulpd %xmm7, %xmm5
unpcklpd %xmm4, %xmm6            # xmm6 = xmm6[0],xmm4[0]
mulpd %xmm2, %xmm6
addpd %xmm5, %xmm6
movsd 0x28(%r13), %xmm2
movapd %xmm1, %xmm4
movhpd 0xd8(%rsp), %xmm4       # xmm4 = xmm4[0],mem[0]
unpcklpd %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0]
mulpd %xmm2, %xmm4
addpd %xmm6, %xmm4
movapd 0xf506(%rip), %xmm2     # 0x1c420
cmplepd %xmm4, %xmm2
movmskpd %xmm2, %edx
movl %edx, %esi
shrb %sil
jne 0xd04c
testb $0x1, %cl
jne 0xd04c
testb $0x1, %dl
jne 0xd04c
movapd %xmm0, 0x170(%rsp)
movsd %xmm1, 0x180(%rsp)
leaq 0x170(%rsp), %rdi
callq 0xc2e9
movups 0x78(%r13), %xmm0
movaps %xmm0, 0x150(%rsp)
movsd 0x88(%r13), %xmm0
movsd %xmm0, 0x160(%rsp)
leaq 0x150(%rsp), %rdi
callq 0xc2e9
movsd 0x150(%rsp), %xmm0
movsd 0x170(%rsp), %xmm1
movupd 0x178(%rsp), %xmm2
movupd 0x158(%rsp), %xmm3
movapd %xmm2, %xmm4
shufpd $0x1, %xmm1, %xmm4      # xmm4 = xmm4[1],xmm1[0]
mulpd %xmm3, %xmm4
mulsd %xmm3, %xmm1
shufpd $0x1, %xmm0, %xmm3      # xmm3 = xmm3[1],xmm0[0]
mulpd %xmm2, %xmm3
subpd %xmm4, %xmm3
movapd %xmm3, 0x80(%rsp)
mulsd %xmm2, %xmm0
subsd %xmm0, %xmm1
movsd %xmm1, 0x90(%rsp)
leaq 0x80(%rsp), %r14
movq %r14, %rdi
callq 0xc2e9
ucomisd 0xf4a1(%rip), %xmm0     # 0x1c4a0
jne 0xd003
jnp 0xd044
movapd 0xe0(%rsp), %xmm0
movupd 0x30(%r13), %xmm1
subpd %xmm1, %xmm0
movapd %xmm0, 0x60(%rsp)
movsd 0xf0(%rsp), %xmm0
subsd 0x40(%r13), %xmm0
movsd %xmm0, 0x70(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x60(%rsp), %rdx
pushq $0x1
popq %rcx
callq 0xc75e
movq (%rsp), %rdi
movq 0x18(%rdi), %rax
addq $0x90, %r13
jmp 0xcdff
movb $0x1, %bl
testb $0x1, 0x30(%rsp)
jne 0xd08e
movq 0x148(%rsp), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
leaq 0xf513(%rip), %rdi      # 0x1c588
xorl %eax, %eax
callq 0x90f1
jmp 0xd08e
movq 0x30(%rsp), %rax
movl %eax, %ebx
jmp 0xd092
movq 0x30(%rsp), %rax
movl %eax, %ebx
movq (%rsp), %rdi
movq 0x10(%rsp), %rcx
movl %ebx, %edx
movq 0x8(%rsp), %r8
jmp 0xcb19
movq 0x8(%rdi), %rax
leaq 0xdcc2(%rip), %rcx      # 0x1ad70
movaps (%rcx), %xmm0
movaps %xmm0, 0x10(%rsp)
movsd 0x10(%rcx), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x80(%rsp), %rbx
leaq 0x60(%rsp), %r15
pushq $0x1
popq %rbp
movq %rax, %r12
movslq (%rdi), %rcx
shlq $0x6, %rcx
addq %rax, %rcx
cmpq %rcx, %r12
jae 0xd251
movq 0x58(%rsp), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0xd248
movsd 0xf380(%rip), %xmm0     # 0x1c480
testq %rcx, %rcx
je 0xd1a0
movq 0x18(%rcx), %rsi
movq 0x10(%rsi), %rdx
movl 0x8(%rsi), %esi
imulq $0x18, %rsi, %rsi
addq %rdx, %rsi
cmpq %rsi, %rdx
jae 0xd198
movupd (%rdx), %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
mulsd 0x8(%r12), %xmm2
movsd (%r12), %xmm4
mulsd %xmm1, %xmm4
addsd %xmm2, %xmm4
movsd 0x10(%rdx), %xmm2
movsd 0x10(%r12), %xmm3
mulsd %xmm2, %xmm3
addsd %xmm4, %xmm3
movapd %xmm0, %xmm4
addsd 0xf337(%rip), %xmm4     # 0x1c498
ucomisd %xmm3, %xmm4
ja 0xd16b
movapd %xmm6, %xmm2
ja 0xd171
movapd %xmm5, %xmm1
movapd %xmm3, %xmm5
cmpltsd %xmm4, %xmm5
andpd %xmm5, %xmm3
andnpd %xmm0, %xmm5
orpd %xmm3, %xmm5
addq $0x18, %rdx
movapd %xmm2, %xmm6
movapd %xmm5, %xmm0
movapd %xmm1, %xmm5
jmp 0xd11b
movq (%rcx), %rcx
jmp 0xd100
movupd (%r12), %xmm0
movapd 0x10(%rsp), %xmm1
subpd %xmm0, %xmm1
movapd %xmm1, 0x80(%rsp)
movsd 0x8(%rsp), %xmm0
subsd 0x10(%r12), %xmm0
movsd %xmm0, 0x90(%rsp)
movq %r12, %rcx
subq %rax, %rcx
sarq $0x6, %rcx
movq 0x40(%rsp), %rax
cmpb $0x1, (%rax,%rcx)
movapd %xmm5, 0x20(%rsp)
movsd %xmm6, 0x30(%rsp)
jne 0xd1fc
movapd %xmm5, 0x60(%rsp)
movapd %xmm6, %xmm0
jmp 0xd21c
movupd 0x18(%r12), %xmm0
movapd %xmm5, %xmm1
subpd %xmm0, %xmm1
movapd %xmm1, 0x60(%rsp)
movapd %xmm6, %xmm0
subsd 0x28(%r12), %xmm0
movsd %xmm0, 0x70(%rsp)
movq 0x48(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
movl %ebp, %ecx
callq 0xc75e
movq (%rsp), %rdi
movq 0x8(%rdi), %rax
movapd 0x20(%rsp), %xmm5
movsd 0x30(%rsp), %xmm6
addq $0x40, %r12
jmp 0xd0d4
movq 0x40(%rsp), %rdi
callq 0x43b0
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq