// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/lerp.cpp
// Function: CalcInterpolation_Square(localtriangulation_t const*, int, float const*, interpolation_t*)
static void CalcInterpolation_Square (const localtriangulation_t *lt, int i, const vec3_t spot, interpolation_t *interp)
{
	const localtriangulation_t::Wedge *w1;
	const localtriangulation_t::Wedge *w2;
	const localtriangulation_t::Wedge *w3;
	vec_t weights[4];
	vec_t dot1;
	vec_t dot2;
	vec_t dot;
	vec3_t normal1;
	vec3_t normal2;
	vec3_t normal;
	vec_t frac;
	vec_t frac_near;
	vec_t frac_far;
	vec_t ratio;
	vec3_t mid_far;
	vec3_t mid_near;
	vec3_t test;
	
	w1 = &lt->sortedwedges[i];
	w2 = &lt->sortedwedges[(i + 1) % (int)lt->sortedwedges.size ()];
	w3 = &lt->sortedwedges[(i + 2) % (int)lt->sortedwedges.size ()];
	if (w1->shape != localtriangulation_t::Wedge::eSquareLeft || w2->shape != localtriangulation_t::Wedge::eSquareRight)
	{
		Error ("CalcInterpolation_Square: internal error: not square.");
	}

	weights[0] = 0.0;
	weights[1] = 0.0;
	weights[2] = 0.0;
	weights[3] = 0.0;

	// find mid_near on (o,p3), mid_far on (p1,p2), spot on (mid_near,mid_far)
	CrossProduct (w1->leftdirection, lt->normal, normal1);
	VectorNormalize (normal1);
	CrossProduct (w2->wedgenormal, lt->normal, normal2);
	VectorNormalize (normal2);
	dot1 = DotProduct (spot, normal1) - 0;
	dot2 = DotProduct (spot, normal2) - DotProduct (w3->leftspot, normal2);
	if (dot1 <= NORMAL_EPSILON)
	{
		frac = 0.0;
	}
	else if (dot2 <= NORMAL_EPSILON)
	{
		frac = 1.0;
	}
	else
	{
		frac = dot1 / (dot1 + dot2);
		frac = qmax (0, qmin (frac, 1));
	}

	dot1 = DotProduct (w3->leftspot, normal1) - 0;
	dot2 = 0 - DotProduct (w3->leftspot, normal2);
	if (dot1 <= NORMAL_EPSILON)
	{
		frac_near = 1.0;
	}
	else if (dot2 <= NORMAL_EPSILON)
	{
		frac_near = 0.0;
	}
	else
	{
		frac_near = (frac * dot2) / ((1 - frac) * dot1 + frac * dot2);
	}
	VectorScale (w3->leftspot, frac_near, mid_near);

	dot1 = DotProduct (w2->leftspot, normal1) - 0;
	dot2 = DotProduct (w1->leftspot, normal2) - DotProduct (w3->leftspot, normal2);
	if (dot1 <= NORMAL_EPSILON)
	{
		frac_far = 1.0;
	}
	else if (dot2 <= NORMAL_EPSILON)
	{
		frac_far = 0.0;
	}
	else
	{
		frac_far = (frac * dot2) / ((1 - frac) * dot1 + frac * dot2);
	}
	VectorScale (w1->leftspot, 1 - frac_far, mid_far);
	VectorMA (mid_far, frac_far, w2->leftspot, mid_far);

	CrossProduct (lt->normal, w3->leftdirection, normal);
	VectorNormalize (normal);
	dot = DotProduct (spot, normal) - 0;
	dot1 = (1 - frac_far) * DotProduct (w1->leftspot, normal) + frac_far * DotProduct (w2->leftspot, normal) - 0;
	if (dot <= NORMAL_EPSILON)
	{
		ratio = 0.0;
	}
	else if (dot >= dot1)
	{
		ratio = 1.0;
	}
	else
	{
		ratio = dot / dot1;
		ratio = qmax (0, qmin (ratio, 1));
	}

	VectorScale (mid_near, 1 - ratio, test);
	VectorMA (test, ratio, mid_far, test);
	VectorSubtract (test, spot, test);
	if (g_drawlerp && VectorLength (test) > 4 * ON_EPSILON)
	{
		Developer (DEVELOPER_LEVEL_SPAM, "Debug: triangulation: internal error 12.\n");
	}

	weights[0] += 0.5 * (1 - ratio) * (1 - frac_near);
	weights[3] += 0.5 * (1 - ratio) * frac_near;
	weights[1] += 0.5 * ratio * (1 - frac_far);
	weights[2] += 0.5 * ratio * frac_far;
	
	// find mid_near on (o,p1), mid_far on (p2,p3), spot on (mid_near,mid_far)
	CrossProduct (lt->normal, w3->leftdirection, normal1);
	VectorNormalize (normal1);
	CrossProduct (w1->wedgenormal, lt->normal, normal2);
	VectorNormalize (normal2);
	dot1 = DotProduct (spot, normal1) - 0;
	dot2 = DotProduct (spot, normal2) - DotProduct (w1->leftspot, normal2);
	if (dot1 <= NORMAL_EPSILON)
	{
		frac = 0.0;
	}
	else if (dot2 <= NORMAL_EPSILON)
	{
		frac = 1.0;
	}
	else
	{
		frac = dot1 / (dot1 + dot2);
		frac = qmax (0, qmin (frac, 1));
	}

	dot1 = DotProduct (w1->leftspot, normal1) - 0;
	dot2 = 0 - DotProduct (w1->leftspot, normal2);
	if (dot1 <= NORMAL_EPSILON)
	{
		frac_near = 1.0;
	}
	else if (dot2 <= NORMAL_EPSILON)
	{
		frac_near = 0.0;
	}
	else
	{
		frac_near = (frac * dot2) / ((1 - frac) * dot1 + frac * dot2);
	}
	VectorScale (w1->leftspot, frac_near, mid_near);

	dot1 = DotProduct (w2->leftspot, normal1) - 0;
	dot2 = DotProduct (w3->leftspot, normal2) - DotProduct (w1->leftspot, normal2);
	if (dot1 <= NORMAL_EPSILON)
	{
		frac_far = 1.0;
	}
	else if (dot2 <= NORMAL_EPSILON)
	{
		frac_far = 0.0;
	}
	else
	{
		frac_far = (frac * dot2) / ((1 - frac) * dot1 + frac * dot2);
	}
	VectorScale (w3->leftspot, 1 - frac_far, mid_far);
	VectorMA (mid_far, frac_far, w2->leftspot, mid_far);

	CrossProduct (w1->leftdirection, lt->normal, normal);
	VectorNormalize (normal);
	dot = DotProduct (spot, normal) - 0;
	dot1 = (1 - frac_far) * DotProduct (w3->leftspot, normal) + frac_far * DotProduct (w2->leftspot, normal) - 0;
	if (dot <= NORMAL_EPSILON)
	{
		ratio = 0.0;
	}
	else if (dot >= dot1)
	{
		ratio = 1.0;
	}
	else
	{
		ratio = dot / dot1;
		ratio = qmax (0, qmin (ratio, 1));
	}

	VectorScale (mid_near, 1 - ratio, test);
	VectorMA (test, ratio, mid_far, test);
	VectorSubtract (test, spot, test);
	if (g_drawlerp && VectorLength (test) > 4 * ON_EPSILON)
	{
		Developer (DEVELOPER_LEVEL_SPAM, "Debug: triangulation: internal error 13.\n");
	}

	weights[0] += 0.5 * (1 - ratio) * (1 - frac_near);
	weights[1] += 0.5 * (1 - ratio) * frac_near;
	weights[3] += 0.5 * ratio * (1 - frac_far);
	weights[2] += 0.5 * ratio * frac_far;

	interp->isbiased = false;
	interp->totalweight = 1.0;
	interp->points.resize (4);
	interp->points[0].patchnum = lt->patchnum;
	interp->points[0].weight = weights[0];
	interp->points[1].patchnum = w1->leftpatchnum;
	interp->points[1].weight = weights[1];
	interp->points[2].patchnum = w2->leftpatchnum;
	interp->points[2].weight = weights[2];
	interp->points[3].patchnum = w3->leftpatchnum;
	interp->points[3].weight = weights[3];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rcx, 0xc0(%rsp)
movq %rdx, %r15
movq %rdi, %r14
movslq %esi, %rcx
imulq $0x2c, %rcx, %r9
movq 0x70(%rdi), %r8
movq 0x78(%rdi), %rax
leaq (%r8,%r9), %rbp
leal 0x1(%rcx), %esi
subq %r8, %rax
pushq $0x2c
popq %rdi
cqto
idivq %rdi
movq %rax, %rdi
movl %esi, %eax
cltd
idivl %edi
movslq %edx, %rax
imulq $0x2c, %rax, %rsi
leaq (%r8,%rsi), %r13
addl $0x2, %ecx
movl %ecx, %eax
cltd
idivl %edi
movslq %edx, %rax
imulq $0x2c, %rax, %rbx
addq %r8, %rbx
cmpl $0x3, (%r8,%r9)
jne 0x106d3
cmpl $0x4, (%r8,%rsi)
je 0x106e1
leaq 0x2514c(%rip), %rdi     # 0x35826
xorl %eax, %eax
callq 0x8b2f
movss 0x4c(%r14), %xmm0
movss 0x18(%rbp), %xmm1
movss 0x1c(%rbp), %xmm2
movsd 0x44(%r14), %xmm3
movaps %xmm3, %xmm4
shufps $0x55, %xmm3, %xmm4     # xmm4 = xmm4[1,1],xmm3[1,1]
mulss %xmm2, %xmm4
movaps %xmm1, %xmm5
mulss %xmm0, %xmm5
subss %xmm4, %xmm5
leaq 0xe4(%rsp), %r12
movss %xmm5, (%r12)
movss 0x14(%rbp), %xmm4
unpcklps %xmm4, %xmm2            # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
unpcklps %xmm1, %xmm4            # xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1]
unpcklps %xmm3, %xmm0            # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
mulps %xmm4, %xmm0
mulps %xmm3, %xmm2
subps %xmm0, %xmm2
movlps %xmm2, 0x4(%r12)
movq %r12, %rdi
callq 0xc021
movss 0x4c(%r14), %xmm0
movss 0x24(%r13), %xmm1
movss 0x28(%r13), %xmm2
movsd 0x44(%r14), %xmm3
movaps %xmm3, %xmm4
shufps $0x55, %xmm3, %xmm4     # xmm4 = xmm4[1,1],xmm3[1,1]
mulss %xmm2, %xmm4
movaps %xmm1, %xmm5
mulss %xmm0, %xmm5
subss %xmm4, %xmm5
movq %r13, %rax
leaq 0xd8(%rsp), %r13
movss %xmm5, (%r13)
movq %rax, 0x78(%rsp)
movss 0x20(%rax), %xmm4
unpcklps %xmm4, %xmm2            # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
unpcklps %xmm1, %xmm4            # xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1]
unpcklps %xmm3, %xmm0            # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
mulps %xmm4, %xmm0
mulps %xmm3, %xmm2
subps %xmm0, %xmm2
movlps %xmm2, 0x4(%r13)
movq %r13, %rdi
callq 0xc021
movss (%r12), %xmm3
movss 0x4(%r12), %xmm5
movss (%r15), %xmm12
movss 0x4(%r15), %xmm13
movaps %xmm13, %xmm0
mulss %xmm5, %xmm0
movaps %xmm12, %xmm1
mulss %xmm3, %xmm1
addss %xmm0, %xmm1
movss 0x8(%r15), %xmm11
movss 0x8(%r12), %xmm0
movaps %xmm11, %xmm9
mulss %xmm0, %xmm9
addss %xmm1, %xmm9
movss (%r13), %xmm2
movss 0x4(%r13), %xmm4
movss 0x8(%r13), %xmm1
movsd 0x8(%rbx), %xmm15
movaps %xmm15, %xmm10
shufps $0x55, %xmm15, %xmm10   # xmm10 = xmm10[1,1],xmm15[1,1]
movaps %xmm10, %xmm6
mulss %xmm4, %xmm6
movaps %xmm15, %xmm7
mulss %xmm2, %xmm7
addss %xmm6, %xmm7
movss 0x10(%rbx), %xmm6
movss %xmm6, 0x10(%rsp)
mulss %xmm1, %xmm6
addss %xmm7, %xmm6
cvtss2sd %xmm9, %xmm7
movsd 0x2183b(%rip), %xmm14   # 0x32080
ucomisd %xmm7, %xmm14
xorps %xmm8, %xmm8
xorps %xmm7, %xmm7
jae 0x108a2
mulss %xmm4, %xmm13
mulss %xmm2, %xmm12
addss %xmm13, %xmm12
mulss %xmm1, %xmm11
addss %xmm12, %xmm11
subss %xmm6, %xmm11
cvtss2sd %xmm11, %xmm7
ucomisd %xmm7, %xmm14
jae 0x1089a
addss %xmm9, %xmm11
divss %xmm11, %xmm9
minss 0x217d4(%rip), %xmm9    # 0x32064
xorps %xmm7, %xmm7
maxss %xmm9, %xmm7
jmp 0x108a2
movss 0x217c2(%rip), %xmm7    # 0x32064
movaps %xmm5, %xmm9
mulss %xmm10, %xmm9
movaps %xmm15, %xmm10
mulss %xmm3, %xmm10
addss %xmm9, %xmm10
movss 0x10(%rsp), %xmm9
mulss %xmm0, %xmm9
addss %xmm10, %xmm9
cvtss2sd %xmm9, %xmm10
movss 0x2178c(%rip), %xmm11   # 0x32064
ucomisd %xmm10, %xmm14
movaps %xmm11, 0x30(%rsp)
jae 0x10928
subss %xmm6, %xmm8
cvtss2sd %xmm8, %xmm10
xorps %xmm12, %xmm12
movaps %xmm12, 0x30(%rsp)
ucomisd %xmm10, %xmm14
jae 0x10928
mulss %xmm7, %xmm8
movss 0x21756(%rip), %xmm10   # 0x32064
subss %xmm7, %xmm10
mulss %xmm9, %xmm10
addss %xmm8, %xmm10
divss %xmm10, %xmm8
movaps %xmm8, 0x30(%rsp)
movaps %xmm15, 0xa0(%rsp)
movq 0x78(%rsp), %r13
movss 0x10(%r13), %xmm9
movsd 0x8(%r13), %xmm10
movaps %xmm10, %xmm8
shufps $0x55, %xmm10, %xmm8    # xmm8 = xmm8[1,1],xmm10[1,1]
mulss %xmm8, %xmm5
movaps %xmm10, 0x80(%rsp)
mulss %xmm10, %xmm3
addss %xmm5, %xmm3
movss %xmm9, 0x90(%rsp)
mulss %xmm9, %xmm0
addss %xmm3, %xmm0
movsd 0x8(%rbp), %xmm5
movss 0x10(%rbp), %xmm8
cvtss2sd %xmm0, %xmm3
ucomisd %xmm3, %xmm14
movaps %xmm11, %xmm3
jae 0x109dc
movaps %xmm5, %xmm3
shufps $0x55, %xmm5, %xmm3     # xmm3 = xmm3[1,1],xmm5[1,1]
mulss %xmm3, %xmm4
mulss %xmm5, %xmm2
addss %xmm4, %xmm2
mulss %xmm8, %xmm1
addss %xmm2, %xmm1
subss %xmm6, %xmm1
cvtss2sd %xmm1, %xmm2
xorps %xmm3, %xmm3
ucomisd %xmm2, %xmm14
jae 0x109dc
mulss %xmm7, %xmm1
movss 0x2169b(%rip), %xmm2    # 0x32064
subss %xmm7, %xmm2
mulss %xmm0, %xmm2
addss %xmm1, %xmm2
divss %xmm2, %xmm1
movaps %xmm1, %xmm3
movss %xmm8, 0xc(%rsp)
movaps %xmm5, 0x50(%rsp)
movaps %xmm3, 0x60(%rsp)
subss %xmm3, %xmm11
movaps %xmm11, 0x40(%rsp)
movss 0x18(%rbx), %xmm0
movss 0x1c(%rbx), %xmm1
movss 0x4c(%r14), %xmm2
movaps %xmm0, %xmm3
mulss %xmm2, %xmm3
movsd 0x44(%r14), %xmm4
movaps %xmm4, %xmm5
shufps $0x55, %xmm4, %xmm5     # xmm5 = xmm5[1,1],xmm4[1,1]
mulss %xmm1, %xmm5
subss %xmm3, %xmm5
leaq 0xcc(%rsp), %r12
movss %xmm5, (%r12)
movss 0x14(%rbx), %xmm3
unpcklps %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
mulps %xmm4, %xmm1
unpcklps %xmm4, %xmm2            # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
unpcklps %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
mulps %xmm2, %xmm3
subps %xmm1, %xmm3
movlps %xmm3, 0x4(%r12)
movq %r12, %rdi
callq 0xc021
movsd (%r15), %xmm0
movaps %xmm0, %xmm1
shufps $0x55, %xmm0, %xmm1     # xmm1 = xmm1[1,1],xmm0[1,1]
movss (%r12), %xmm3
movss 0x4(%r12), %xmm5
mulss %xmm5, %xmm1
movaps %xmm0, %xmm6
mulss %xmm3, %xmm6
addss %xmm1, %xmm6
movss 0x8(%r15), %xmm1
movss 0x8(%r12), %xmm4
movaps %xmm1, %xmm2
mulss %xmm4, %xmm2
addss %xmm6, %xmm2
cvtss2sd %xmm2, %xmm6
xorps %xmm8, %xmm8
movsd 0x215d9(%rip), %xmm7    # 0x32080
ucomisd %xmm6, %xmm7
movaps 0xa0(%rsp), %xmm9
jae 0x10b24
movss 0xc(%rbp), %xmm6
mulss %xmm5, %xmm6
movss 0x8(%rbp), %xmm7
mulss %xmm3, %xmm7
addss %xmm6, %xmm7
movss 0x10(%rbp), %xmm6
mulss %xmm4, %xmm6
mulss 0xc(%r13), %xmm5
addss %xmm7, %xmm6
mulss 0x8(%r13), %xmm3
addss %xmm5, %xmm3
mulss 0x10(%r13), %xmm4
addss %xmm3, %xmm4
mulss 0x60(%rsp), %xmm4
mulss 0x40(%rsp), %xmm6
addss %xmm4, %xmm6
ucomiss %xmm6, %xmm2
jae 0x10b1b
divss %xmm6, %xmm2
minss 0x21550(%rip), %xmm2    # 0x32064
maxss %xmm2, %xmm8
jmp 0x10b24
movss 0x21540(%rip), %xmm8    # 0x32064
movss 0x21538(%rip), %xmm2    # 0x32064
subss %xmm8, %xmm2
movaps %xmm2, 0xb0(%rsp)
leaq 0x54e5f11(%rip), %rax   # 0x54f6a51
cmpb $0x1, (%rax)
movaps %xmm8, 0x110(%rsp)
jne 0x10c28
movaps 0x40(%rsp), %xmm5
movaps %xmm5, %xmm3
shufps $0x0, %xmm5, %xmm3      # xmm3 = xmm3[0,0],xmm5[0,0]
movaps 0x60(%rsp), %xmm7
movaps %xmm7, %xmm2
shufps $0x0, %xmm7, %xmm2      # xmm2 = xmm2[0,0],xmm7[0,0]
movaps 0x30(%rsp), %xmm6
movaps %xmm6, %xmm4
shufps $0x0, %xmm6, %xmm4      # xmm4 = xmm4[0,0],xmm6[0,0]
movss 0xc(%rsp), %xmm10
mulss %xmm5, %xmm10
movss 0x90(%rsp), %xmm5
mulss %xmm7, %xmm5
addss %xmm10, %xmm5
movaps 0x50(%rsp), %xmm7
mulps %xmm3, %xmm7
mulps 0x80(%rsp), %xmm2
addps %xmm7, %xmm2
mulps %xmm4, %xmm9
movss 0x10(%rsp), %xmm4
mulss %xmm6, %xmm4
movaps 0xb0(%rsp), %xmm3
mulss %xmm3, %xmm4
mulss %xmm8, %xmm5
addss %xmm4, %xmm5
subss %xmm1, %xmm5
movaps %xmm3, %xmm1
shufps $0x0, %xmm3, %xmm1      # xmm1 = xmm1[0,0],xmm3[0,0]
mulps %xmm9, %xmm1
movaps %xmm8, %xmm3
shufps $0x0, %xmm8, %xmm3      # xmm3 = xmm3[0,0],xmm8[0,0]
mulps %xmm2, %xmm3
addps %xmm1, %xmm3
subps %xmm0, %xmm3
mulps %xmm3, %xmm3
cvtps2pd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulss %xmm5, %xmm5
cvtss2sd %xmm5, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
ucomisd 0x24a0b(%rip), %xmm0    # 0x35620
jbe 0x10c28
leaq 0x24c3e(%rip), %rsi     # 0x3585c
pushq $0x5
popq %rdi
xorl %eax, %eax
callq 0x9045
movss 0x18(%rbx), %xmm0
movss 0x1c(%rbx), %xmm1
movss 0x4c(%r14), %xmm2
movaps %xmm0, %xmm3
mulss %xmm2, %xmm3
movsd 0x44(%r14), %xmm4
movaps %xmm4, %xmm5
shufps $0x55, %xmm4, %xmm5     # xmm5 = xmm5[1,1],xmm4[1,1]
mulss %xmm1, %xmm5
subss %xmm3, %xmm5
leaq 0xe4(%rsp), %r12
movss %xmm5, (%r12)
movss 0x14(%rbx), %xmm3
unpcklps %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
mulps %xmm4, %xmm1
unpcklps %xmm4, %xmm2            # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
unpcklps %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
mulps %xmm2, %xmm3
subps %xmm1, %xmm3
movlps %xmm3, 0x4(%r12)
movq %r12, %rdi
callq 0xc021
movss 0x4c(%r14), %xmm0
movss 0x24(%rbp), %xmm1
movss 0x28(%rbp), %xmm2
movsd 0x44(%r14), %xmm3
movaps %xmm3, %xmm4
shufps $0x55, %xmm3, %xmm4     # xmm4 = xmm4[1,1],xmm3[1,1]
mulss %xmm2, %xmm4
movaps %xmm1, %xmm5
mulss %xmm0, %xmm5
subss %xmm4, %xmm5
leaq 0xd8(%rsp), %r13
movss %xmm5, (%r13)
movss 0x20(%rbp), %xmm4
unpcklps %xmm4, %xmm2            # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
unpcklps %xmm1, %xmm4            # xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1]
unpcklps %xmm3, %xmm0            # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
mulps %xmm4, %xmm0
mulps %xmm3, %xmm2
subps %xmm0, %xmm2
movlps %xmm2, 0x4(%r13)
movq %r13, %rdi
callq 0xc021
movss (%r12), %xmm3
movss 0x4(%r12), %xmm5
movss (%r15), %xmm12
movss 0x4(%r15), %xmm13
movaps %xmm13, %xmm0
mulss %xmm5, %xmm0
movaps %xmm12, %xmm1
mulss %xmm3, %xmm1
addss %xmm0, %xmm1
movss 0x8(%r15), %xmm11
movss 0x8(%r12), %xmm0
movaps %xmm11, %xmm9
mulss %xmm0, %xmm9
addss %xmm1, %xmm9
movss (%r13), %xmm2
movss 0x4(%r13), %xmm4
movss 0x8(%r13), %xmm1
movsd 0x8(%rbp), %xmm15
movaps %xmm15, %xmm10
shufps $0x55, %xmm15, %xmm10   # xmm10 = xmm10[1,1],xmm15[1,1]
movaps %xmm10, %xmm6
mulss %xmm4, %xmm6
movaps %xmm15, %xmm7
mulss %xmm2, %xmm7
addss %xmm6, %xmm7
movss 0x10(%rbp), %xmm6
movss %xmm6, 0x10(%rsp)
mulss %xmm1, %xmm6
addss %xmm7, %xmm6
cvtss2sd %xmm9, %xmm7
xorps %xmm8, %xmm8
movsd 0x212fa(%rip), %xmm14   # 0x32080
ucomisd %xmm7, %xmm14
xorps %xmm7, %xmm7
movq 0x78(%rsp), %r13
jae 0x10de4
mulss %xmm4, %xmm13
mulss %xmm2, %xmm12
addss %xmm13, %xmm12
mulss %xmm1, %xmm11
addss %xmm12, %xmm11
subss %xmm6, %xmm11
cvtss2sd %xmm11, %xmm7
ucomisd %xmm7, %xmm14
jae 0x10ddc
addss %xmm9, %xmm11
divss %xmm11, %xmm9
minss 0x21292(%rip), %xmm9    # 0x32064
xorps %xmm7, %xmm7
maxss %xmm9, %xmm7
jmp 0x10de4
movss 0x21280(%rip), %xmm7    # 0x32064
movaps %xmm5, %xmm9
mulss %xmm10, %xmm9
movaps %xmm15, %xmm10
mulss %xmm3, %xmm10
addss %xmm9, %xmm10
movss 0x10(%rsp), %xmm9
mulss %xmm0, %xmm9
addss %xmm10, %xmm9
cvtss2sd %xmm9, %xmm10
ucomisd %xmm10, %xmm14
movss 0x21245(%rip), %xmm11   # 0x32064
movaps %xmm11, %xmm12
jae 0x10e60
subss %xmm6, %xmm8
cvtss2sd %xmm8, %xmm10
xorps %xmm12, %xmm12
ucomisd %xmm10, %xmm14
jae 0x10e60
mulss %xmm7, %xmm8
movss 0x2121c(%rip), %xmm10   # 0x32064
subss %xmm7, %xmm10
mulss %xmm9, %xmm10
addss %xmm8, %xmm10
divss %xmm10, %xmm8
movaps %xmm8, %xmm12
movaps %xmm12, 0x90(%rsp)
movaps %xmm15, 0x50(%rsp)
movss 0x10(%r13), %xmm9
movsd 0x8(%r13), %xmm10
movaps %xmm10, %xmm8
shufps $0x55, %xmm10, %xmm8    # xmm8 = xmm8[1,1],xmm10[1,1]
mulss %xmm8, %xmm5
movaps %xmm10, 0x100(%rsp)
mulss %xmm10, %xmm3
addss %xmm5, %xmm3
movss %xmm9, 0xc(%rsp)
mulss %xmm9, %xmm0
addss %xmm3, %xmm0
movsd 0x8(%rbx), %xmm5
movss 0x10(%rbx), %xmm8
cvtss2sd %xmm0, %xmm3
ucomisd %xmm3, %xmm14
movaps %xmm11, %xmm3
jae 0x10f12
movaps %xmm5, %xmm3
shufps $0x55, %xmm5, %xmm3     # xmm3 = xmm3[1,1],xmm5[1,1]
mulss %xmm3, %xmm4
mulss %xmm5, %xmm2
addss %xmm4, %xmm2
mulss %xmm8, %xmm1
addss %xmm2, %xmm1
subss %xmm6, %xmm1
cvtss2sd %xmm1, %xmm2
xorps %xmm3, %xmm3
ucomisd %xmm2, %xmm14
jae 0x10f12
mulss %xmm7, %xmm1
movss 0x21165(%rip), %xmm2    # 0x32064
subss %xmm7, %xmm2
mulss %xmm0, %xmm2
addss %xmm1, %xmm2
divss %xmm2, %xmm1
movaps %xmm1, %xmm3
movss %xmm8, 0x2c(%rsp)
movaps %xmm5, 0xf0(%rsp)
movaps %xmm3, 0x80(%rsp)
subss %xmm3, %xmm11
movaps %xmm11, 0xa0(%rsp)
movss 0x4c(%r14), %xmm0
movss 0x18(%rbp), %xmm1
movss 0x1c(%rbp), %xmm2
movsd 0x44(%r14), %xmm3
movaps %xmm3, %xmm4
shufps $0x55, %xmm3, %xmm4     # xmm4 = xmm4[1,1],xmm3[1,1]
mulss %xmm2, %xmm4
movaps %xmm1, %xmm5
mulss %xmm0, %xmm5
subss %xmm4, %xmm5
leaq 0xcc(%rsp), %r12
movss %xmm5, (%r12)
movss 0x14(%rbp), %xmm4
unpcklps %xmm4, %xmm2            # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
unpcklps %xmm1, %xmm4            # xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1]
unpcklps %xmm3, %xmm0            # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
mulps %xmm4, %xmm0
mulps %xmm3, %xmm2
subps %xmm0, %xmm2
movlps %xmm2, 0x4(%r12)
movq %r12, %rdi
callq 0xc021
movaps 0x80(%rsp), %xmm12
movaps 0xa0(%rsp), %xmm9
movsd (%r15), %xmm0
movaps %xmm0, %xmm1
shufps $0x55, %xmm0, %xmm1     # xmm1 = xmm1[1,1],xmm0[1,1]
movss (%r12), %xmm3
movss 0x4(%r12), %xmm5
mulss %xmm5, %xmm1
movaps %xmm0, %xmm6
mulss %xmm3, %xmm6
addss %xmm1, %xmm6
movss 0x8(%r15), %xmm1
movss 0x8(%r12), %xmm4
movaps %xmm1, %xmm2
mulss %xmm4, %xmm2
addss %xmm6, %xmm2
cvtss2sd %xmm2, %xmm6
xorps %xmm13, %xmm13
movsd 0x21088(%rip), %xmm7    # 0x32080
ucomisd %xmm6, %xmm7
movaps 0x40(%rsp), %xmm8
movaps 0x50(%rsp), %xmm10
movaps 0x90(%rsp), %xmm11
jae 0x1107f
movss 0xc(%rbx), %xmm6
mulss %xmm5, %xmm6
movss 0x8(%rbx), %xmm7
mulss %xmm3, %xmm7
addss %xmm6, %xmm7
movss 0x10(%rbx), %xmm6
mulss %xmm4, %xmm6
mulss 0xc(%r13), %xmm5
addss %xmm7, %xmm6
mulss 0x8(%r13), %xmm3
addss %xmm5, %xmm3
mulss 0x10(%r13), %xmm4
addss %xmm3, %xmm4
mulss %xmm12, %xmm4
mulss %xmm9, %xmm6
addss %xmm4, %xmm6
ucomiss %xmm6, %xmm2
jae 0x11076
divss %xmm6, %xmm2
minss 0x20ff5(%rip), %xmm2    # 0x32064
maxss %xmm2, %xmm13
jmp 0x1107f
movss 0x20fe5(%rip), %xmm13   # 0x32064
movss 0x20fdc(%rip), %xmm14   # 0x32064
movaps %xmm14, %xmm15
subss %xmm13, %xmm15
leaq 0x54e59b9(%rip), %rax   # 0x54f6a51
cmpb $0x1, (%rax)
jne 0x111ab
movaps %xmm9, %xmm3
shufps $0x0, %xmm9, %xmm3      # xmm3 = xmm3[0,0],xmm9[0,0]
movaps %xmm12, %xmm2
shufps $0x0, %xmm12, %xmm2     # xmm2 = xmm2[0,0],xmm12[0,0]
movaps %xmm11, %xmm4
shufps $0x0, %xmm11, %xmm4     # xmm4 = xmm4[0,0],xmm11[0,0]
movss 0x2c(%rsp), %xmm6
mulss %xmm9, %xmm6
movss 0xc(%rsp), %xmm5
mulss %xmm12, %xmm5
addss %xmm6, %xmm5
movaps 0xf0(%rsp), %xmm6
mulps %xmm3, %xmm6
mulps 0x100(%rsp), %xmm2
addps %xmm6, %xmm2
mulps %xmm4, %xmm10
movss 0x10(%rsp), %xmm3
mulss %xmm11, %xmm3
mulss %xmm15, %xmm3
mulss %xmm13, %xmm5
addss %xmm3, %xmm5
subss %xmm1, %xmm5
movaps %xmm15, %xmm1
shufps $0x0, %xmm15, %xmm1     # xmm1 = xmm1[0,0],xmm15[0,0]
mulps %xmm10, %xmm1
movaps %xmm13, %xmm3
shufps $0x0, %xmm13, %xmm3     # xmm3 = xmm3[0,0],xmm13[0,0]
mulps %xmm2, %xmm3
addps %xmm1, %xmm3
subps %xmm0, %xmm3
mulps %xmm3, %xmm3
cvtps2pd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulss %xmm5, %xmm5
cvtss2sd %xmm5, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
ucomisd 0x244ca(%rip), %xmm0    # 0x35620
jbe 0x111ab
leaq 0x24727(%rip), %rsi     # 0x35886
pushq $0x5
popq %rdi
xorl %eax, %eax
movaps %xmm13, 0x10(%rsp)
movaps %xmm15, 0x50(%rsp)
callq 0x9045
movaps 0x50(%rsp), %xmm15
movss 0x20ee0(%rip), %xmm14   # 0x32064
movaps 0x10(%rsp), %xmm13
movaps 0x80(%rsp), %xmm12
movaps 0x90(%rsp), %xmm11
movaps 0xa0(%rsp), %xmm9
movaps 0x40(%rsp), %xmm8
cvtss2sd 0x110(%rsp), %xmm2
movsd 0x240a4(%rip), %xmm0    # 0x35260
mulsd %xmm0, %xmm2
cvtss2sd 0x60(%rsp), %xmm1
mulsd %xmm2, %xmm1
xorps %xmm3, %xmm3
addsd %xmm3, %xmm1
cvtsd2ss %xmm1, %xmm1
cvtss2sd %xmm8, %xmm4
mulsd %xmm2, %xmm4
addsd %xmm3, %xmm4
cvtsd2ss %xmm4, %xmm2
cvtss2sd 0xb0(%rsp), %xmm4
mulsd %xmm0, %xmm4
movaps 0x30(%rsp), %xmm7
cvtss2sd %xmm7, %xmm5
mulsd %xmm4, %xmm5
addsd %xmm3, %xmm5
cvtsd2ss %xmm5, %xmm5
movaps %xmm14, %xmm6
subss %xmm7, %xmm6
cvtss2sd %xmm6, %xmm6
mulsd %xmm4, %xmm6
addsd %xmm3, %xmm6
cvtsd2ss %xmm6, %xmm3
cvtss2sd %xmm15, %xmm4
mulsd %xmm0, %xmm4
subss %xmm11, %xmm14
cvtss2sd %xmm14, %xmm6
cvtss2sd %xmm3, %xmm3
mulsd %xmm4, %xmm6
addsd %xmm3, %xmm6
cvtsd2ss %xmm6, %xmm3
movss %xmm3, 0x40(%rsp)
cvtss2sd %xmm11, %xmm3
cvtss2sd %xmm2, %xmm2
mulsd %xmm4, %xmm3
addsd %xmm2, %xmm3
cvtsd2ss %xmm3, %xmm2
movss %xmm2, 0x30(%rsp)
cvtss2sd %xmm13, %xmm2
mulsd %xmm0, %xmm2
cvtss2sd %xmm9, %xmm0
cvtss2sd %xmm5, %xmm3
mulsd %xmm2, %xmm0
addsd %xmm3, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x60(%rsp)
cvtss2sd %xmm12, %xmm0
cvtss2sd %xmm1, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xb0(%rsp)
movq 0xc0(%rsp), %r15
movb $0x0, (%r15)
movl $0x3f800000, 0x4(%r15)  # imm = 0x3F800000
leaq 0x8(%r15), %rdi
pushq $0x4
popq %rsi
callq 0x11672
movl 0x50(%r14), %eax
movq 0x8(%r15), %rcx
movl %eax, (%rcx)
movq 0x8(%r15), %rax
movss 0x40(%rsp), %xmm0
movss %xmm0, 0x4(%rax)
movl 0x4(%rbp), %eax
movq 0x8(%r15), %rcx
movl %eax, 0x8(%rcx)
movq 0x8(%r15), %rax
movss 0x30(%rsp), %xmm0
movss %xmm0, 0xc(%rax)
movl 0x4(%r13), %eax
movq 0x8(%r15), %rcx
movl %eax, 0x10(%rcx)
movq 0x8(%r15), %rax
movss 0xb0(%rsp), %xmm0
movss %xmm0, 0x14(%rax)
movl 0x4(%rbx), %eax
movq 0x8(%r15), %rcx
movl %eax, 0x18(%rcx)
movq 0x8(%r15), %rax
movss 0x60(%rsp), %xmm0
movss %xmm0, 0x1c(%rax)
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq