// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlvis/flow.cpp
// Function: WindingDist(winding_t const**)
vec_t WindingDist (const winding_t *w[2])
{
	vec_t minsqrdist = 99999999.0 * 99999999.0;
	vec_t sqrdist;
	int a, b;
	// point to point
	for (a = 0; a < w[0]->numpoints; a++)
	{
		for (b = 0; b < w[1]->numpoints; b++)
		{
			vec3_t v;
			VectorSubtract (w[0]->points[a], w[1]->points[b], v);
			sqrdist = DotProduct (v, v);
			if (sqrdist < minsqrdist)
			{
				minsqrdist = sqrdist;
			}
		}
	}
	// point to edge
	for (int side = 0; side < 2; side++)
	{
		for (a = 0; a < w[side]->numpoints; a++)
		{
			for (b = 0; b < w[!side]->numpoints; b++)
			{
				const vec3_t &p = w[side]->points[a];
				const vec3_t &p1 = w[!side]->points[b];
				const vec3_t &p2 = w[!side]->points[(b + 1) % w[!side]->numpoints];
				vec3_t delta;
				vec_t frac;
				vec3_t v;
				VectorSubtract (p2, p1, delta);
				if (VectorNormalize (delta) <= ON_EPSILON)
				{
					continue;
				}
				frac = DotProduct (p, delta) - DotProduct (p1, delta);
				if (frac <= ON_EPSILON || frac >= (DotProduct (p2, delta) - DotProduct (p1, delta)) - ON_EPSILON)
				{
					// p1 or p2 is closest to p
					continue;
				}
				VectorMA (p1, frac, delta, v);
				VectorSubtract (p, v, v);
				sqrdist = DotProduct (v, v);
				if (sqrdist < minsqrdist)
				{
					minsqrdist = sqrdist;
				}
			}
		}
	}
	// edge to edge
	for (a = 0; a < w[0]->numpoints; a++)
	{
		for (b = 0; b < w[1]->numpoints; b++)
		{
			const vec3_t &p1 = w[0]->points[a];
			const vec3_t &p2 = w[0]->points[(a + 1) % w[0]->numpoints];
			const vec3_t &p3 = w[1]->points[b];
			const vec3_t &p4 = w[1]->points[(b + 1) % w[1]->numpoints];
			vec3_t delta1;
			vec3_t delta2;
			vec3_t normal;
			vec3_t normal1;
			vec3_t normal2;
			VectorSubtract (p2, p1, delta1);
			VectorSubtract (p4, p3, delta2);
			CrossProduct (delta1, delta2, normal);
			if (!VectorNormalize (normal))
			{
				continue;
			}
			CrossProduct (normal, delta1, normal1); // same direction as delta2
			CrossProduct (delta2, normal, normal2); // same direction as delta1
			if (VectorNormalize (normal1) <= ON_EPSILON || VectorNormalize (normal2) <= ON_EPSILON)
			{
				continue;
			}
			if (DotProduct (p3, normal1) >= DotProduct (p1, normal1) - ON_EPSILON ||
				DotProduct (p4, normal1) <= DotProduct (p1, normal1) + ON_EPSILON ||
				DotProduct (p1, normal2) >= DotProduct (p3, normal2) - ON_EPSILON ||
				DotProduct (p2, normal2) <= DotProduct (p3, normal2) + ON_EPSILON )
			{
				// the edges are not crossing when viewed along normal
				continue;
			}
			sqrdist = DotProduct (p3, normal) - DotProduct (p1, normal);
			sqrdist = sqrdist * sqrdist;
			if (sqrdist < minsqrdist)
			{
				minsqrdist = sqrdist;
			}
		}
	}
	// point to face and edge to face
	for (int side = 0; side < 2; side++)
	{
		vec3_t planenormal;
		vec_t planedist;
		vec3_t *boundnormals;
		vec_t *bounddists;
		if (!BestNormalFromWinding (w[!side]->points, w[!side]->numpoints, planenormal))
		{
			continue;
		}
		planedist = DotProduct (planenormal, w[!side]->points[0]);
		hlassume (boundnormals = (vec3_t *)malloc (w[!side]->numpoints * sizeof (vec3_t)), assume_NoMemory);
		hlassume (bounddists = (vec_t *)malloc (w[!side]->numpoints * sizeof (vec_t)), assume_NoMemory);
		// build boundaries
		for (b = 0; b < w[!side]->numpoints; b++)
		{
			vec3_t v;
			const vec3_t &p1 = w[!side]->points[b];
			const vec3_t &p2 = w[!side]->points[(b + 1) % w[!side]->numpoints];
			VectorSubtract (p2, p1, v);
			CrossProduct (v, planenormal, boundnormals[b]);
			if (!VectorNormalize (boundnormals[b]))
			{
				bounddists[b] = 1.0;
			}
			else
			{
				bounddists[b] = DotProduct (p1, boundnormals[b]);
			}
		}
		for (a = 0; a < w[side]->numpoints; a++)
		{
			const vec3_t &p = w[side]->points[a];
			for (b = 0; b < w[!side]->numpoints; b++)
			{
				if (DotProduct (p, boundnormals[b]) - bounddists[b] >= -ON_EPSILON)
				{
					break;
				}
			}
			if (b < w[!side]->numpoints)
			{
				continue;
			}
			sqrdist = DotProduct (p, planenormal) - planedist;
			sqrdist = sqrdist * sqrdist;
			if (sqrdist < minsqrdist)
			{
				minsqrdist = sqrdist;
			}
		}
		for (a = 0; a < w[side]->numpoints; a++)
		{
			const vec3_t &p1 = w[side]->points[a];
			const vec3_t &p2 = w[side]->points[(a + 1) % w[side]->numpoints];
			vec_t dist1 = DotProduct (p1, planenormal) - planedist;
			vec_t dist2 = DotProduct (p2, planenormal) - planedist;
			vec3_t delta;
			vec_t frac;
			vec3_t v;
			if (dist1 > ON_EPSILON && dist2 < -ON_EPSILON || dist1 < -ON_EPSILON && dist2 > ON_EPSILON)
			{
				frac = dist1 / (dist1 - dist2);
				VectorSubtract (p2, p1, delta);
				VectorMA (p1, frac, delta, v);
				for (b = 0; b < w[!side]->numpoints; b++)
				{
					if (DotProduct (v, boundnormals[b]) - bounddists[b] >= -ON_EPSILON)
					{
						break;
					}
				}
				if (b < w[!side]->numpoints)
				{
					continue;
				}
				minsqrdist = 0;
			}
		}
		free (boundnormals);
		free (bounddists);
	}
	return (sqrt (minsqrdist));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %r10
movq (%rdi), %rax
movslq 0x4(%rax), %rcx
testq %rcx, %rcx
jle 0xd576
movq 0x8(%r10), %rdx
movl 0x4(%rdx), %esi
addq $0x8, %rax
movq %rsi, %rdi
shlq $0x2, %rdi
leaq (%rdi,%rdi,2), %rdi
movss 0x7fb7(%rip), %xmm0     # 0x154b0
xorl %r8d, %r8d
testl %esi, %esi
jle 0xd564
leaq (%r8,%r8,2), %r9
movss (%rax,%r9,4), %xmm1
movss 0x4(%rax,%r9,4), %xmm2
movss 0x8(%rax,%r9,4), %xmm3
xorl %r9d, %r9d
movaps %xmm1, %xmm4
subss 0x8(%rdx,%r9), %xmm4
movaps %xmm2, %xmm5
subss 0xc(%rdx,%r9), %xmm5
movaps %xmm3, %xmm14
subss 0x10(%rdx,%r9), %xmm14
mulss %xmm5, %xmm5
mulss %xmm4, %xmm4
addss %xmm5, %xmm4
mulss %xmm14, %xmm14
addss %xmm4, %xmm14
minss %xmm0, %xmm14
addq $0xc, %r9
movaps %xmm14, %xmm0
cmpq %r9, %rdi
jne 0xd51b
jmp 0xd568
movaps %xmm0, %xmm14
incq %r8
movaps %xmm14, %xmm0
cmpq %rcx, %r8
jne 0xd4fc
jmp 0xd57f
movss 0x7f31(%rip), %xmm14    # 0x154b0
xorl %r13d, %r13d
xorpd %xmm15, %xmm15
movq %r10, 0x18(%rsp)
movq (%r10,%r13,8), %rax
cmpl $0x0, 0x4(%rax)
jle 0xd833
movl %r13d, %edi
xorq $0x1, %rdi
movq $0x0, 0x30(%rsp)
movq %rdi, 0x50(%rsp)
movq (%r10,%rdi,8), %rbx
movl 0x4(%rbx), %ecx
testl %ecx, %ecx
jle 0xd815
movl $0x10, %ebp
movq 0x30(%rsp), %rax
leaq (%rax,%rax,2), %rax
movq %rax, 0xa0(%rsp)
xorl %r12d, %r12d
movq (%r10,%r13,8), %r15
incq %r12
movl %r12d, %eax
cltd
idivl %ecx
leaq (%rdx,%rdx,2), %r14
movsd 0x8(%rbx,%r14,4), %xmm2
movsd -0x8(%rbx,%rbp), %xmm0
subps %xmm0, %xmm2
movss 0x10(%rbx,%r14,4), %xmm3
subss (%rbx,%rbp), %xmm3
movaps %xmm2, %xmm0
mulps %xmm2, %xmm0
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movaps %xmm2, %xmm1
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movaps %xmm3, %xmm0
mulss %xmm3, %xmm0
addss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
ucomisd %xmm15, %xmm0
jb 0xd635
sqrtsd %xmm0, %xmm0
jmp 0xd671
movss %xmm14, (%rsp)
movss %xmm3, 0x40(%rsp)
movaps %xmm2, 0xb0(%rsp)
callq 0x31a0
movaps 0xb0(%rsp), %xmm2
movss 0x40(%rsp), %xmm3
movq 0x50(%rsp), %rdi
xorpd %xmm15, %xmm15
movss (%rsp), %xmm14
movq 0x18(%rsp), %r10
movsd 0x4a97(%rip), %xmm1     # 0x12110
ucomisd %xmm0, %xmm1
jbe 0xd68a
xorpd %xmm1, %xmm1
xorps %xmm2, %xmm2
xorl %eax, %eax
jmp 0xd6c3
cvtps2pd %xmm2, %xmm1
movapd %xmm0, %xmm2
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
divpd %xmm2, %xmm1
cvtpd2ps %xmm1, %xmm1
xorps %xmm2, %xmm2
cvtss2sd %xmm3, %xmm2
divsd %xmm0, %xmm2
cvtsd2ss %xmm2, %xmm2
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x7dcc(%rip), %xmm3     # 0x15488
ucomisd %xmm0, %xmm3
setb %al
testb %al, %al
je 0xd800
movq 0xa0(%rsp), %rax
movss 0x8(%r15,%rax,4), %xmm3
movss 0xc(%r15,%rax,4), %xmm4
movss 0x10(%r15,%rax,4), %xmm0
movss -0x8(%rbx,%rbp), %xmm8
movss -0x4(%rbx,%rbp), %xmm7
movss (%rbx,%rbp), %xmm6
movapd %xmm1, %xmm5
shufps $0x55, %xmm1, %xmm5     # xmm5 = xmm5[1,1],xmm1[1,1]
movaps %xmm4, %xmm9
unpcklps %xmm7, %xmm9            # xmm9 = xmm9[0],xmm7[0],xmm9[1],xmm7[1]
mulps %xmm5, %xmm9
movaps %xmm3, %xmm10
unpcklps %xmm8, %xmm10           # xmm10 = xmm10[0],xmm8[0],xmm10[1],xmm8[1]
movaps %xmm1, %xmm11
shufps $0x0, %xmm1, %xmm11     # xmm11 = xmm11[0,0],xmm1[0,0]
mulps %xmm10, %xmm11
addps %xmm9, %xmm11
movaps %xmm0, %xmm10
unpcklps %xmm6, %xmm10           # xmm10 = xmm10[0],xmm6[0],xmm10[1],xmm6[1]
movaps %xmm2, %xmm9
shufps $0x0, %xmm2, %xmm9      # xmm9 = xmm9[0,0],xmm2[0,0]
mulps %xmm10, %xmm9
addps %xmm11, %xmm9
movaps %xmm9, %xmm11
shufps $0x55, %xmm9, %xmm11    # xmm11 = xmm11[1,1],xmm9[1,1]
subss %xmm11, %xmm9
xorps %xmm10, %xmm10
cvtss2sd %xmm9, %xmm10
movsd 0x7d28(%rip), %xmm12    # 0x15488
ucomisd %xmm10, %xmm12
jae 0xd800
leaq (%rbx,%r14,4), %rax
addq $0x8, %rax
movss 0x4(%rax), %xmm12
mulss %xmm5, %xmm12
movss (%rax), %xmm13
mulss %xmm1, %xmm13
addss %xmm12, %xmm13
movss 0x8(%rax), %xmm12
mulss %xmm2, %xmm12
addss %xmm13, %xmm12
subss %xmm11, %xmm12
xorps %xmm11, %xmm11
cvtss2sd %xmm12, %xmm11
addsd 0x7cdc(%rip), %xmm11    # 0x15490
ucomisd %xmm11, %xmm10
jae 0xd800
mulss %xmm9, %xmm1
addss %xmm8, %xmm1
mulss %xmm9, %xmm5
addss %xmm7, %xmm5
mulss %xmm9, %xmm2
addss %xmm6, %xmm2
subss %xmm1, %xmm3
subss %xmm5, %xmm4
subss %xmm2, %xmm0
mulss %xmm4, %xmm4
mulss %xmm3, %xmm3
addss %xmm4, %xmm3
mulss %xmm0, %xmm0
addss %xmm3, %xmm0
minss %xmm14, %xmm0
movaps %xmm0, %xmm14
movq (%r10,%rdi,8), %rbx
movslq 0x4(%rbx), %rcx
addq $0xc, %rbp
cmpq %rcx, %r12
jl 0xd5d7
movq 0x30(%rsp), %rdx
incq %rdx
movq (%r10,%r13,8), %rax
movslq 0x4(%rax), %rax
movq %rdx, 0x30(%rsp)
cmpq %rax, %rdx
jl 0xd5af
leaq 0x1(%r13), %rax
testq %r13, %r13
movq %rax, %r13
je 0xd58c
movq (%r10), %rax
cmpl $0x0, 0x4(%rax)
jle 0xdea2
xorl %edx, %edx
xorps %xmm12, %xmm12
movq 0x8(%r10), %r13
movl 0x4(%r13), %ecx
testl %ecx, %ecx
movq %rdx, 0xe8(%rsp)
jle 0xde87
leal 0x1(%rdx), %eax
movl %eax, 0x30(%rsp)
movl $0x8, %r12d
leaq (%rdx,%rdx,2), %rax
movq %rax, 0x50(%rsp)
xorl %r14d, %r14d
movq (%r10), %r15
movl 0x30(%rsp), %eax
cltd
idivl 0x4(%r15)
leaq (%rdx,%rdx,2), %rsi
incq %r14
movl %r14d, %eax
cltd
idivl %ecx
movss 0x10(%r15,%rsi,4), %xmm5
movq 0x50(%rsp), %rax
subss 0x10(%r15,%rax,4), %xmm5
leaq (%rdx,%rdx,2), %rbp
movss 0x8(%r13,%rbp,4), %xmm1
subss (%r13,%r12), %xmm1
movq %rsi, %rbx
movsd 0x8(%r15,%rsi,4), %xmm4
movsd 0x8(%r15,%rax,4), %xmm0
subps %xmm0, %xmm4
movsd 0xc(%r13,%rbp,4), %xmm2
movsd 0x4(%r13,%r12), %xmm0
subps %xmm0, %xmm2
movaps %xmm2, %xmm0
shufps $0x55, %xmm2, %xmm0     # xmm0 = xmm0[1,1],xmm2[1,1]
mulss %xmm4, %xmm0
movaps %xmm5, %xmm7
mulss %xmm1, %xmm7
subss %xmm0, %xmm7
movaps %xmm5, %xmm6
shufps $0xd4, %xmm4, %xmm6     # xmm6 = xmm6[0,1],xmm4[1,3]
movaps %xmm6, %xmm0
shufps $0xe2, %xmm4, %xmm0     # xmm0 = xmm0[2,0],xmm4[2,3]
movaps %xmm2, %xmm3
shufps $0x0, %xmm2, %xmm3      # xmm3 = xmm3[0,0],xmm2[0,0]
movaps %xmm1, 0x40(%rsp)
movss %xmm1, %xmm3            # xmm3 = xmm1[0],xmm3[1,2,3]
movaps %xmm3, 0xa0(%rsp)
mulps %xmm3, %xmm0
movaps %xmm4, %xmm3
movaps %xmm2, 0xb0(%rsp)
mulps %xmm2, %xmm3
subps %xmm0, %xmm3
movaps %xmm3, %xmm0
shufps $0x55, %xmm3, %xmm0     # xmm0 = xmm0[1,1],xmm3[1,1]
movaps %xmm7, %xmm1
mulss %xmm7, %xmm1
mulss %xmm0, %xmm0
addss %xmm1, %xmm0
movaps %xmm3, %xmm1
mulss %xmm3, %xmm1
addss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
ucomisd %xmm12, %xmm0
jb 0xd96f
sqrtsd %xmm0, %xmm0
jmp 0xd9c7
movss %xmm14, (%rsp)
movaps %xmm4, 0x20(%rsp)
movaps %xmm5, 0x90(%rsp)
movaps %xmm6, 0x80(%rsp)
movaps %xmm7, 0x70(%rsp)
movaps %xmm3, 0x60(%rsp)
callq 0x31a0
movaps 0x60(%rsp), %xmm3
movaps 0x70(%rsp), %xmm7
movaps 0x80(%rsp), %xmm6
movaps 0x90(%rsp), %xmm5
movaps 0x20(%rsp), %xmm4
xorps %xmm12, %xmm12
movss (%rsp), %xmm14
movq 0x18(%rsp), %r10
movsd 0x4741(%rip), %xmm1     # 0x12110
ucomisd %xmm0, %xmm1
jbe 0xd9e0
xorps %xmm3, %xmm3
xorps %xmm13, %xmm13
xorl %eax, %eax
jmp 0xda16
cvtps2pd %xmm3, %xmm1
xorps %xmm2, %xmm2
cvtss2sd %xmm7, %xmm2
divsd %xmm0, %xmm2
cvtsd2ss %xmm2, %xmm13
xorps %xmm2, %xmm2
cvtsd2ss %xmm0, %xmm2
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
divpd %xmm0, %xmm1
cvtpd2ps %xmm1, %xmm3
cmpneqss 0x4735(%rip), %xmm2     # 0x12144
movd %xmm2, %eax
andl $0x1, %eax
testb %al, %al
je 0xde72
movaps %xmm4, %xmm2
shufps $0xe1, %xmm4, %xmm2     # xmm2 = xmm2[1,0],xmm4[2,3]
shufps $0x52, %xmm4, %xmm6     # xmm6 = xmm6[2,0],xmm4[1,1]
movaps %xmm4, %xmm8
shufps $0x55, %xmm4, %xmm8     # xmm8 = xmm8[1,1],xmm4[1,1]
mulps %xmm3, %xmm6
movaps %xmm3, %xmm0
shufps $0x0, %xmm3, %xmm0      # xmm0 = xmm0[0,0],xmm3[0,0]
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, %xmm7
movss %xmm13, %xmm7           # xmm7 = xmm13[0],xmm7[1,2,3]
movss %xmm5, %xmm2            # xmm2 = xmm5[0],xmm2[1,2,3]
mulps %xmm7, %xmm2
subps %xmm6, %xmm2
mulss %xmm13, %xmm4
movaps %xmm3, %xmm15
shufps $0x55, %xmm3, %xmm15    # xmm15 = xmm15[1,1],xmm3[1,1]
mulss %xmm15, %xmm8
subss %xmm4, %xmm8
movaps %xmm2, %xmm0
mulps %xmm2, %xmm0
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movaps %xmm2, %xmm1
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movaps %xmm8, %xmm0
mulss %xmm8, %xmm0
addss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
ucomisd %xmm12, %xmm0
jb 0xda9e
sqrtsd %xmm0, %xmm0
jmp 0xdb12
movss %xmm14, (%rsp)
movaps %xmm13, 0x20(%rsp)
movaps %xmm15, 0x90(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm7, 0x60(%rsp)
movaps %xmm8, 0xd0(%rsp)
movaps %xmm2, 0xf0(%rsp)
callq 0x31a0
movaps 0xf0(%rsp), %xmm2
movaps 0xd0(%rsp), %xmm8
movaps 0x60(%rsp), %xmm7
movaps 0x80(%rsp), %xmm3
movaps 0x90(%rsp), %xmm15
movaps 0x20(%rsp), %xmm13
xorps %xmm12, %xmm12
movss (%rsp), %xmm14
movq 0x18(%rsp), %r10
movsd 0x45f6(%rip), %xmm1     # 0x12110
ucomisd %xmm0, %xmm1
jbe 0xdb2a
xorps %xmm4, %xmm4
xorps %xmm2, %xmm2
xorl %eax, %eax
jmp 0xdb67
cvtps2pd %xmm2, %xmm1
movapd %xmm0, %xmm2
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
divpd %xmm2, %xmm1
cvtpd2ps %xmm1, %xmm4
xorps %xmm1, %xmm1
cvtss2sd %xmm8, %xmm1
divsd %xmm0, %xmm1
xorps %xmm2, %xmm2
cvtsd2ss %xmm1, %xmm2
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x7928(%rip), %xmm1     # 0x15488
ucomisd %xmm0, %xmm1
setb %al
testb %al, %al
je 0xde72
movss %xmm2, 0x60(%rsp)
movaps 0xb0(%rsp), %xmm0
movaps 0xa0(%rsp), %xmm1
shufps $0x10, %xmm0, %xmm1     # xmm1 = xmm1[0,0],xmm0[1,0]
shufps $0xe2, %xmm0, %xmm1     # xmm1 = xmm1[2,0],xmm0[2,3]
mulps %xmm1, %xmm7
mulps %xmm0, %xmm3
subps %xmm7, %xmm3
mulss %xmm15, %xmm0
movaps 0x40(%rsp), %xmm2
mulss %xmm13, %xmm2
subss %xmm0, %xmm2
movaps %xmm3, %xmm0
mulps %xmm3, %xmm0
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movaps %xmm3, %xmm1
mulss %xmm3, %xmm1
addss %xmm0, %xmm1
movaps %xmm2, 0x40(%rsp)
movaps %xmm2, %xmm0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
ucomisd %xmm12, %xmm0
jb 0xdbdf
sqrtsd %xmm0, %xmm0
jmp 0xdc39
movss %xmm14, (%rsp)
movaps %xmm13, 0x20(%rsp)
movaps %xmm15, 0x90(%rsp)
movaps %xmm3, 0x80(%rsp)
movapd %xmm4, 0xb0(%rsp)
callq 0x31a0
movapd 0xb0(%rsp), %xmm4
movaps 0x80(%rsp), %xmm3
movaps 0x90(%rsp), %xmm15
movaps 0x20(%rsp), %xmm13
xorps %xmm12, %xmm12
movss (%rsp), %xmm14
movq 0x18(%rsp), %r10
movsd 0x44cf(%rip), %xmm1     # 0x12110
ucomisd %xmm0, %xmm1
jbe 0xdc52
xorpd %xmm1, %xmm1
xorps %xmm2, %xmm2
xorl %eax, %eax
jmp 0xdc8d
cvtps2pd %xmm3, %xmm1
movapd %xmm0, %xmm2
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
divpd %xmm2, %xmm1
cvtpd2ps %xmm1, %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x40(%rsp), %xmm2
divsd %xmm0, %xmm2
cvtsd2ss %xmm2, %xmm2
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x7802(%rip), %xmm3     # 0x15488
ucomisd %xmm0, %xmm3
setb %al
testb %al, %al
je 0xde72
movq 0x50(%rsp), %rax
leaq (%r15,%rax,4), %rax
addq $0x8, %rax
movss (%r13,%r12), %xmm5
movss 0x4(%r13,%r12), %xmm0
movapd %xmm4, %xmm8
shufps $0x55, %xmm4, %xmm8     # xmm8 = xmm8[1,1],xmm4[1,1]
movaps %xmm8, %xmm3
movaps %xmm0, 0x40(%rsp)
mulss %xmm0, %xmm3
movaps %xmm5, (%rsp)
mulss %xmm4, %xmm5
addss %xmm3, %xmm5
movss 0x8(%r13,%r12), %xmm3
movaps %xmm3, %xmm6
movss 0x60(%rsp), %xmm0
mulss %xmm0, %xmm6
addss %xmm5, %xmm6
cvtss2sd %xmm6, %xmm10
movss (%rax), %xmm5
movss 0x4(%rax), %xmm7
movaps %xmm8, %xmm6
mulss %xmm7, %xmm6
movaps %xmm5, %xmm9
mulss %xmm4, %xmm9
addss %xmm6, %xmm9
movss 0x8(%rax), %xmm6
movaps %xmm6, %xmm11
mulss %xmm0, %xmm11
addss %xmm9, %xmm11
xorps %xmm9, %xmm9
cvtss2sd %xmm11, %xmm9
movaps %xmm9, %xmm11
addsd 0x7758(%rip), %xmm11    # 0x15490
ucomisd %xmm11, %xmm10
jae 0xde72
leaq 0x8(,%rbp,4), %rax
addq %r13, %rax
mulss 0x4(%rax), %xmm8
mulss (%rax), %xmm4
addss %xmm8, %xmm4
mulss 0x8(%rax), %xmm0
addss %xmm4, %xmm0
xorps %xmm8, %xmm8
cvtss2sd %xmm0, %xmm8
addsd 0x7710(%rip), %xmm9     # 0x15488
ucomisd %xmm8, %xmm9
jae 0xde72
movapd %xmm1, %xmm8
shufps $0x55, %xmm1, %xmm8     # xmm8 = xmm8[1,1],xmm1[1,1]
movaps %xmm8, %xmm9
mulss %xmm7, %xmm9
movaps %xmm5, %xmm10
mulss %xmm1, %xmm10
addss %xmm9, %xmm10
movaps %xmm6, %xmm9
mulss %xmm2, %xmm9
addss %xmm10, %xmm9
xorps %xmm10, %xmm10
cvtss2sd %xmm9, %xmm10
movaps %xmm8, %xmm9
movaps 0x40(%rsp), %xmm4
mulss %xmm4, %xmm9
movaps (%rsp), %xmm0
movaps %xmm0, %xmm11
mulss %xmm1, %xmm11
addss %xmm9, %xmm11
movaps %xmm3, %xmm9
mulss %xmm2, %xmm9
addss %xmm11, %xmm9
cvtss2sd %xmm9, %xmm9
movaps %xmm9, %xmm11
addsd 0x7695(%rip), %xmm11    # 0x15490
ucomisd %xmm11, %xmm10
jae 0xde72
leaq (%r15,%rbx,4), %rax
addq $0x8, %rax
mulss 0x4(%rax), %xmm8
mulss (%rax), %xmm1
addss %xmm8, %xmm1
mulss 0x8(%rax), %xmm2
addss %xmm1, %xmm2
xorps %xmm1, %xmm1
cvtss2sd %xmm2, %xmm1
addsd 0x7656(%rip), %xmm9     # 0x15488
ucomisd %xmm1, %xmm9
jae 0xde72
shufps $0x0, %xmm13, %xmm13    # xmm13 = xmm13[0,0,0,0]
unpcklps %xmm7, %xmm4            # xmm4 = xmm4[0],xmm7[0],xmm4[1],xmm7[1]
mulps %xmm13, %xmm4
unpcklps %xmm5, %xmm0            # xmm0 = xmm0[0],xmm5[0],xmm0[1],xmm5[1]
mulps %xmm15, %xmm0
addps %xmm4, %xmm0
unpcklps %xmm6, %xmm3            # xmm3 = xmm3[0],xmm6[0],xmm3[1],xmm6[1]
mulps 0x70(%rsp), %xmm3
addps %xmm0, %xmm3
movaps %xmm3, %xmm0
shufps $0x55, %xmm3, %xmm0     # xmm0 = xmm0[1,1],xmm3[1,1]
subss %xmm0, %xmm3
mulss %xmm3, %xmm3
minss %xmm14, %xmm3
movaps %xmm3, %xmm14
movq 0x8(%r10), %r13
movslq 0x4(%r13), %rcx
addq $0xc, %r12
cmpq %rcx, %r14
jl 0xd887
movq 0xe8(%rsp), %rdx
incq %rdx
movq (%r10), %rax
movslq 0x4(%rax), %rax
cmpq %rax, %rdx
jl 0xd856
movss %xmm14, (%rsp)
xorl %r13d, %r13d
leaq 0xc4(%rsp), %rbp
movl %r13d, %r14d
xorq $0x1, %r14
movq (%r10,%r14,8), %rdi
movl 0x4(%rdi), %esi
addq $0x8, %rdi
movq %rbp, %rdx
movq %r10, %rbx
callq 0xd133
testb %al, %al
je 0xe4f8
movq %r13, 0x70(%rsp)
movss 0xc4(%rsp), %xmm2
movq (%rbx,%r14,8), %rax
movsd 0xc8(%rsp), %xmm3
movaps %xmm3, %xmm0
shufps $0x55, %xmm3, %xmm0     # xmm0 = xmm0[1,1],xmm3[1,1]
movss 0xc(%rax), %xmm1
movaps %xmm3, 0x50(%rsp)
mulss %xmm3, %xmm1
movss %xmm1, 0x60(%rsp)
movss 0x8(%rax), %xmm1
movaps %xmm2, 0xa0(%rsp)
mulss %xmm2, %xmm1
movss %xmm1, 0xd0(%rsp)
movss 0x10(%rax), %xmm1
movaps %xmm0, 0x30(%rsp)
mulss %xmm0, %xmm1
movss %xmm1, 0x20(%rsp)
movslq 0x4(%rax), %rax
shlq $0x2, %rax
leaq (%rax,%rax,2), %rdi
callq 0x3320
movq %rax, %r15
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0x9549
movq (%rbx,%r14,8), %rax
movslq 0x4(%rax), %rdi
shlq $0x2, %rdi
callq 0x3320
movq %rax, %r12
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0x9549
movq (%rbx,%r14,8), %rbp
movl 0x4(%rbp), %ecx
testl %ecx, %ecx
movq %rbx, %rsi
jle 0xe194
movq %r14, %rdi
movaps 0xa0(%rsp), %xmm12
movaps %xmm12, %xmm3
movaps 0x50(%rsp), %xmm13
shufps $0xd4, %xmm13, %xmm3    # xmm3 = xmm3[0,1],xmm13[1,3]
shufps $0xe2, %xmm13, %xmm3    # xmm3 = xmm3[2,0],xmm13[2,3]
movl $0x2, %ebx
xorl %r14d, %r14d
movss (%rsp), %xmm10
movaps 0x30(%rsp), %xmm14
movss 0x20(%rsp), %xmm15
movaps %xmm3, 0x90(%rsp)
movq %r12, 0x80(%rsp)
movq %r14, %r13
incq %r14
movl %r14d, %eax
cltd
idivl %ecx
leaq (%rdx,%rdx,2), %rax
movss 0x8(%rbp,%rax,4), %xmm4
subss (%rbp,%rbx,4), %xmm4
movsd 0xc(%rbp,%rax,4), %xmm2
movsd 0x4(%rbp,%rbx,4), %xmm0
subps %xmm0, %xmm2
movaps %xmm4, %xmm0
shufps $0xd4, %xmm2, %xmm0     # xmm0 = xmm0[0,1],xmm2[1,3]
shufps $0x52, %xmm2, %xmm0     # xmm0 = xmm0[2,0],xmm2[1,1]
mulps %xmm13, %xmm0
movaps %xmm12, %xmm1
mulss %xmm2, %xmm1
mulps %xmm3, %xmm2
subps %xmm0, %xmm2
movlps %xmm2, -0x8(%r15,%rbx,4)
mulss %xmm13, %xmm4
subss %xmm1, %xmm4
movss %xmm4, (%r15,%rbx,4)
movaps %xmm2, %xmm0
mulps %xmm2, %xmm0
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movaps %xmm2, %xmm1
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movaps %xmm4, %xmm0
mulss %xmm4, %xmm0
addss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
ucomisd 0x7220(%rip), %xmm0     # 0x15290
jb 0xe078
sqrtsd %xmm0, %xmm0
jmp 0xe0da
movq %r15, %r12
movq %rdi, %r15
movaps %xmm4, 0x40(%rsp)
movaps %xmm2, 0xb0(%rsp)
callq 0x31a0
movaps 0xb0(%rsp), %xmm2
movaps 0x40(%rsp), %xmm4
movaps 0x90(%rsp), %xmm3
movq %r15, %rdi
movq %r12, %r15
movq 0x80(%rsp), %r12
movss 0x20(%rsp), %xmm15
movaps 0x30(%rsp), %xmm14
movaps 0x50(%rsp), %xmm13
movaps 0xa0(%rsp), %xmm12
movss (%rsp), %xmm10
movq 0x18(%rsp), %rsi
movsd 0x402e(%rip), %xmm1     # 0x12110
ucomisd %xmm0, %xmm1
jbe 0xe103
movl $0x0, (%r15,%rbx,4)
movq $0x0, -0x8(%r15,%rbx,4)
movss 0x4037(%rip), %xmm0     # 0x12138
jmp 0xe177
cvtps2pd %xmm2, %xmm1
movapd %xmm0, %xmm2
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
divpd %xmm2, %xmm1
cvtpd2ps %xmm1, %xmm1
movlpd %xmm1, -0x8(%r15,%rbx,4)
xorps %xmm1, %xmm1
cvtss2sd %xmm4, %xmm1
divsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm1
cvtsd2ss %xmm0, %xmm0
movss %xmm1, (%r15,%rbx,4)
ucomiss 0x4007(%rip), %xmm0     # 0x12144
movss 0x3ff3(%rip), %xmm0     # 0x12138
jne 0xe149
jnp 0xe177
movss 0x4(%rbp,%rbx,4), %xmm0
mulss -0x4(%r15,%rbx,4), %xmm0
movss (%rbp,%rbx,4), %xmm1
mulss -0x8(%r15,%rbx,4), %xmm1
addss %xmm0, %xmm1
movss 0x8(%rbp,%rbx,4), %xmm0
mulss (%r15,%rbx,4), %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%r12,%r13,4)
movq (%rsi,%rdi,8), %rbp
movslq 0x4(%rbp), %rcx
addq $0x3, %rbx
cmpq %rcx, %r14
jl 0xdfe7
jmp 0xe1b6
movss (%rsp), %xmm10
movaps 0xa0(%rsp), %xmm12
movaps 0x50(%rsp), %xmm13
movaps 0x30(%rsp), %xmm14
movss 0x20(%rsp), %xmm15
movss 0xd0(%rsp), %xmm0
addss 0x60(%rsp), %xmm0
addss %xmm0, %xmm15
movq 0x70(%rsp), %rax
movq (%rsi,%rax,8), %rax
movslq 0x4(%rax), %rdx
movslq %ecx, %rsi
movl %ecx, %edi
testq %rdx, %rdx
jle 0xe2f2
leaq 0x8(%rax), %r8
testl %ecx, %ecx
setg %r9b
leaq 0x14(%r15), %r10
leaq -0x1(%rdi), %r11
xorl %ebx, %ebx
leaq (%rbx,%rbx,2), %r14
leaq (%r8,%r14,4), %r14
testl %ecx, %ecx
jle 0xe2ac
movss (%r14), %xmm0
movss 0x4(%r14), %xmm1
movss 0x8(%r14), %xmm2
movss 0x4(%r15), %xmm3
mulss %xmm1, %xmm3
movss (%r15), %xmm4
mulss %xmm0, %xmm4
addss %xmm3, %xmm4
movss 0x8(%r15), %xmm3
mulss %xmm2, %xmm3
addss %xmm4, %xmm3
subss (%r12), %xmm3
cvtss2sd %xmm3, %xmm3
ucomisd 0x723f(%rip), %xmm3     # 0x15490
movl %r9d, %ebp
jae 0xe2a7
movq %r10, %rbp
xorl %r13d, %r13d
cmpq %r13, %r11
je 0xe2ac
movss -0x4(%rbp), %xmm3
mulss %xmm1, %xmm3
movss -0x8(%rbp), %xmm4
mulss %xmm0, %xmm4
addss %xmm3, %xmm4
movss (%rbp), %xmm3
mulss %xmm2, %xmm3
addss %xmm4, %xmm3
subss 0x4(%r12,%r13,4), %xmm3
cvtss2sd %xmm3, %xmm3
addq $0xc, %rbp
incq %r13
ucomisd 0x71f2(%rip), %xmm3     # 0x15490
jb 0xe25c
cmpq %rsi, %r13
setl %bpl
testb %bpl, %bpl
jne 0xe2e6
movss 0x4(%r14), %xmm0
mulss %xmm13, %xmm0
movss (%r14), %xmm1
mulss %xmm12, %xmm1
addss %xmm0, %xmm1
movss 0x8(%r14), %xmm0
mulss %xmm14, %xmm0
addss %xmm1, %xmm0
subss %xmm15, %xmm0
mulss %xmm0, %xmm0
minss %xmm10, %xmm0
movaps %xmm0, %xmm10
incq %rbx
cmpq %rdx, %rbx
jne 0xe1f9
testl %edx, %edx
jle 0xe4d5
addq $0x8, %rax
testl %ecx, %ecx
setg %r8b
movq %r15, %r9
addq $0x14, %r9
decq %rdi
xorl %r10d, %r10d
movq 0x70(%rsp), %r13
leaq 0xc4(%rsp), %rbp
leaq (%r10,%r10,2), %r11
incq %r10
cmpq %rdx, %r10
movl %r10d, %ebx
movl $0x0, %r14d
cmovneq %rbx, %r14
leaq (%r14,%r14,2), %rbx
movss (%rax,%r11,4), %xmm4
movss 0x4(%rax,%r11,4), %xmm3
movaps %xmm13, %xmm0
mulss %xmm3, %xmm0
movaps %xmm4, %xmm1
mulss %xmm12, %xmm1
addss %xmm0, %xmm1
movss 0x8(%rax,%r11,4), %xmm5
movaps %xmm5, %xmm6
mulss %xmm14, %xmm6
addss %xmm1, %xmm6
subss %xmm15, %xmm6
movss (%rax,%rbx,4), %xmm0
movss 0x4(%rax,%rbx,4), %xmm1
movaps %xmm13, %xmm2
mulss %xmm1, %xmm2
movaps %xmm0, %xmm8
mulss %xmm12, %xmm8
addss %xmm2, %xmm8
movss 0x8(%rax,%rbx,4), %xmm2
movaps %xmm2, %xmm7
mulss %xmm14, %xmm7
addss %xmm8, %xmm7
subss %xmm15, %xmm7
xorps %xmm9, %xmm9
cvtss2sd %xmm6, %xmm9
ucomisd 0x70cb(%rip), %xmm9     # 0x15488
xorps %xmm8, %xmm8
cvtss2sd %xmm7, %xmm8
jbe 0xe3d8
movsd 0x70bf(%rip), %xmm11    # 0x15490
ucomisd %xmm8, %xmm11
ja 0xe3fb
movsd 0x70af(%rip), %xmm11    # 0x15490
ucomisd %xmm9, %xmm11
jbe 0xe4ca
ucomisd 0x7093(%rip), %xmm8     # 0x15488
jbe 0xe4ca
testl %ecx, %ecx
jle 0xe4c6
movaps %xmm6, %xmm8
subss %xmm7, %xmm8
divss %xmm8, %xmm6
subss %xmm4, %xmm0
subss %xmm3, %xmm1
subss %xmm5, %xmm2
mulss %xmm6, %xmm0
addss %xmm4, %xmm0
mulss %xmm6, %xmm1
addss %xmm3, %xmm1
mulss %xmm6, %xmm2
addss %xmm5, %xmm2
movss 0x4(%r15), %xmm3
mulss %xmm1, %xmm3
movss (%r15), %xmm4
mulss %xmm0, %xmm4
addss %xmm3, %xmm4
movss 0x8(%r15), %xmm3
mulss %xmm2, %xmm3
addss %xmm4, %xmm3
subss (%r12), %xmm3
cvtss2sd %xmm3, %xmm3
ucomisd 0x7024(%rip), %xmm3     # 0x15490
movl %r8d, %r11d
jae 0xe4c1
movq %r9, %rbx
xorl %r11d, %r11d
cmpq %r11, %rdi
je 0xe4c6
movss -0x4(%rbx), %xmm3
mulss %xmm1, %xmm3
movss -0x8(%rbx), %xmm4
mulss %xmm0, %xmm4
addss %xmm3, %xmm4
movss (%rbx), %xmm3
mulss %xmm2, %xmm3
addss %xmm4, %xmm3
subss 0x4(%r12,%r11,4), %xmm3
cvtss2sd %xmm3, %xmm3
addq $0xc, %rbx
incq %r11
ucomisd 0x6fd8(%rip), %xmm3     # 0x15490
jb 0xe477
cmpq %rsi, %r11
setl %r11b
testb %r11b, %r11b
jne 0xe4ca
xorps %xmm10, %xmm10
cmpq %rdx, %r10
jne 0xe31e
jmp 0xe4e2
movq 0x70(%rsp), %r13
leaq 0xc4(%rsp), %rbp
movss %xmm10, (%rsp)
movq %r15, %rdi
callq 0x32c0
movq %r12, %rdi
callq 0x32c0
leaq 0x1(%r13), %rax
testq %r13, %r13
movq %rax, %r13
movq 0x18(%rsp), %r10
je 0xdeb3
xorps %xmm1, %xmm1
movss (%rsp), %xmm0
ucomiss %xmm1, %xmm0
jb 0xe530
sqrtss %xmm0, %xmm0
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3440