// File: /workspace/github_cpp_makefile_star2_O3/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 $0xf8, %rsp
movq %rdi, %rbp
movq (%rdi), %rax
movslq 0x4(%rax), %rcx
testq %rcx, %rcx
jle 0xd3f8
movq 0x8(%rbp), %rdx
movl 0x4(%rdx), %esi
leaq 0x8(%rax), %rdi
movq %rsi, %r8
shlq $0x2, %r8
leaq (%r8,%r8,2), %r8
movss 0x811e(%rip), %xmm0     # 0x154a0
xorl %r9d, %r9d
testl %esi, %esi
jle 0xd3e8
leaq (%r9,%r9,2), %r10
movss (%rdi,%r10,4), %xmm1
movss 0x4(%rdi,%r10,4), %xmm2
movss 0x8(%rdi,%r10,4), %xmm3
xorl %r10d, %r10d
movaps %xmm1, %xmm4
subss 0x8(%rdx,%r10), %xmm4
movaps %xmm2, %xmm5
subss 0xc(%rdx,%r10), %xmm5
movaps %xmm3, %xmm6
subss 0x10(%rdx,%r10), %xmm6
mulss %xmm5, %xmm5
mulss %xmm4, %xmm4
addss %xmm5, %xmm4
mulss %xmm6, %xmm6
addss %xmm4, %xmm6
minss %xmm0, %xmm6
addq $0xc, %r10
movaps %xmm6, %xmm0
cmpq %r10, %r8
jne 0xd3a4
jmp 0xd3eb
movaps %xmm0, %xmm6
incq %r9
movaps %xmm6, %xmm0
cmpq %rcx, %r9
jne 0xd385
jmp 0xd400
movss 0x80a0(%rip), %xmm6     # 0x154a0
movss %xmm6, (%rsp)
movb $0x1, %dl
xorl %r8d, %r8d
movsd 0x4d05(%rip), %xmm11    # 0x12118
movsd 0x805c(%rip), %xmm15    # 0x15478
movq (%rbp,%r8,8), %rsi
movslq 0x4(%rsi), %rdi
testq %rdi, %rdi
jle 0xd66e
xorq $0x1, %r8
movq (%rbp,%r8,8), %r8
movl 0x4(%r8), %r9d
leaq 0x8(%r8), %r10
addq $0x8, %rsi
addq $0x10, %r8
movq %r9, %r11
negq %r11
xorl %r14d, %r14d
testl %r9d, %r9d
jle 0xd662
leaq (%r14,%r14,2), %rbx
leaq (%rsi,%rbx,4), %r15
movl $0x1, %r12d
movq %r8, %r13
movq %r11, %rbx
addq %r12, %rbx
movl $0x0, %ebx
cmovneq %r12, %rbx
leaq (%rbx,%rbx,2), %rbx
movss (%r10,%rbx,4), %xmm3
movss 0x4(%r10,%rbx,4), %xmm4
movss -0x8(%r13), %xmm2
movss -0x4(%r13), %xmm0
movaps %xmm3, %xmm8
subss %xmm2, %xmm8
movaps %xmm4, %xmm6
subss %xmm0, %xmm6
movss 0x8(%r10,%rbx,4), %xmm5
movss (%r13), %xmm1
movaps %xmm5, %xmm7
subss %xmm1, %xmm7
movaps %xmm6, %xmm9
mulss %xmm6, %xmm9
movaps %xmm8, %xmm10
mulss %xmm8, %xmm10
addss %xmm9, %xmm10
movaps %xmm7, %xmm9
mulss %xmm7, %xmm9
addss %xmm10, %xmm9
cvtss2sd %xmm9, %xmm9
sqrtsd %xmm9, %xmm9
ucomisd %xmm9, %xmm11
ja 0xd64a
xorps %xmm10, %xmm10
cvtsd2ss %xmm9, %xmm10
cvtss2sd %xmm10, %xmm10
ucomisd %xmm10, %xmm15
jae 0xd64a
cvtss2sd %xmm8, %xmm8
divsd %xmm9, %xmm8
cvtsd2ss %xmm8, %xmm8
cvtss2sd %xmm6, %xmm6
divsd %xmm9, %xmm6
xorps %xmm10, %xmm10
cvtsd2ss %xmm6, %xmm10
xorps %xmm6, %xmm6
cvtss2sd %xmm7, %xmm6
divsd %xmm9, %xmm6
xorps %xmm11, %xmm11
cvtsd2ss %xmm6, %xmm11
movss (%r15), %xmm7
movss 0x4(%r15), %xmm9
movss 0x8(%r15), %xmm6
movaps %xmm9, %xmm12
unpcklps %xmm0, %xmm12           # xmm12 = xmm12[0],xmm0[0],xmm12[1],xmm0[1]
movaps %xmm10, %xmm13
shufps $0x0, %xmm10, %xmm13    # xmm13 = xmm13[0,0],xmm10[0,0]
mulps %xmm12, %xmm13
movaps %xmm7, %xmm12
unpcklps %xmm2, %xmm12           # xmm12 = xmm12[0],xmm2[0],xmm12[1],xmm2[1]
movaps %xmm8, %xmm14
shufps $0x0, %xmm8, %xmm14     # xmm14 = xmm14[0,0],xmm8[0,0]
mulps %xmm12, %xmm14
addps %xmm13, %xmm14
movaps %xmm6, %xmm13
unpcklps %xmm1, %xmm13           # xmm13 = xmm13[0],xmm1[0],xmm13[1],xmm1[1]
movaps %xmm11, %xmm12
shufps $0x0, %xmm11, %xmm12    # xmm12 = xmm12[0,0],xmm11[0,0]
mulps %xmm13, %xmm12
addps %xmm14, %xmm12
movaps %xmm12, %xmm14
shufps $0x55, %xmm12, %xmm14   # xmm14 = xmm14[1,1],xmm12[1,1]
subss %xmm14, %xmm12
xorps %xmm13, %xmm13
cvtss2sd %xmm12, %xmm13
ucomisd %xmm13, %xmm15
jae 0xd638
mulss %xmm10, %xmm4
mulss %xmm8, %xmm3
addss %xmm4, %xmm3
mulss %xmm11, %xmm5
addss %xmm3, %xmm5
subss %xmm14, %xmm5
xorps %xmm3, %xmm3
cvtss2sd %xmm5, %xmm3
addsd 0x7e9c(%rip), %xmm3     # 0x15480
ucomisd %xmm3, %xmm13
jae 0xd638
mulss %xmm12, %xmm8
addss %xmm2, %xmm8
mulss %xmm12, %xmm10
addss %xmm0, %xmm10
mulss %xmm12, %xmm11
addss %xmm1, %xmm11
subss %xmm8, %xmm7
subss %xmm10, %xmm9
subss %xmm11, %xmm6
mulss %xmm9, %xmm9
mulss %xmm7, %xmm7
addss %xmm9, %xmm7
mulss %xmm6, %xmm6
addss %xmm7, %xmm6
minss (%rsp), %xmm6
movss %xmm6, (%rsp)
movsd 0x4ad7(%rip), %xmm11    # 0x12118
movsd 0x7e2e(%rip), %xmm15    # 0x15478
addq $0xc, %r13
leaq (%r11,%r12), %rbx
incq %rbx
incq %r12
cmpq $0x1, %rbx
jne 0xd46a
incq %r14
cmpq %rdi, %r14
jne 0xd450
movl $0x1, %r8d
testb $0x1, %dl
movl $0x0, %edx
jne 0xd41c
testl %ecx, %ecx
jle 0xdc37
movq 0x8(%rbp), %rdx
movl 0x4(%rdx), %esi
addq $0x8, %rax
leaq 0x8(%rdx), %rdi
addq $0x10, %rdx
movq %rsi, %r8
negq %r8
xorl %r9d, %r9d
movss (%rsp), %xmm5
testl %esi, %esi
jle 0xdc29
leaq (%r9,%r9,2), %r10
incq %r9
cmpq %rcx, %r9
movl %r9d, %r11d
movl $0x0, %ebx
cmovneq %r11, %rbx
leaq (%rbx,%rbx,2), %r11
movss (%rax,%r11,4), %xmm0
movss 0x4(%rax,%r11,4), %xmm1
movss (%rax,%r10,4), %xmm2
movss 0x4(%rax,%r10,4), %xmm3
movss %xmm0, 0xc(%rsp)
movaps %xmm0, %xmm4
movaps %xmm2, 0x70(%rsp)
subss %xmm2, %xmm4
movss %xmm1, 0x8(%rsp)
movaps %xmm3, 0x60(%rsp)
subss %xmm3, %xmm1
movss 0x8(%rax,%r11,4), %xmm0
movss 0x8(%rax,%r10,4), %xmm2
movss %xmm0, 0x4(%rsp)
movaps %xmm2, 0x50(%rsp)
subss %xmm2, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, %xmm2
movaps 0x494c(%rip), %xmm0     # 0x12080
xorps %xmm0, %xmm2
movaps %xmm2, 0xa0(%rsp)
movaps %xmm4, 0x40(%rsp)
xorps %xmm0, %xmm4
movaps %xmm4, 0x90(%rsp)
movaps %xmm1, 0x30(%rsp)
xorps %xmm0, %xmm1
movaps %xmm1, 0x80(%rsp)
movl $0x1, %r10d
movq %rdx, %r11
movss %xmm5, (%rsp)
movq %r8, %rbx
addq %r10, %rbx
movl $0x0, %ebx
cmovneq %r10, %rbx
leaq (%rbx,%rbx,2), %rbx
movss (%rdi,%rbx,4), %xmm9
movss 0x4(%rdi,%rbx,4), %xmm12
movss -0x8(%r11), %xmm14
movss -0x4(%r11), %xmm0
movaps %xmm9, %xmm4
subss %xmm14, %xmm4
movaps %xmm12, %xmm1
subss %xmm0, %xmm1
movss 0x8(%rdi,%rbx,4), %xmm11
movss (%r11), %xmm10
movaps %xmm11, %xmm5
subss %xmm10, %xmm5
movaps %xmm1, %xmm3
mulss 0xa0(%rsp), %xmm3
movaps 0x30(%rsp), %xmm2
mulss %xmm5, %xmm2
addss %xmm3, %xmm2
movaps %xmm5, %xmm6
mulss 0x90(%rsp), %xmm6
movaps 0x20(%rsp), %xmm3
mulss %xmm4, %xmm3
addss %xmm6, %xmm3
movaps %xmm4, %xmm8
mulss 0x80(%rsp), %xmm8
movaps 0x40(%rsp), %xmm6
mulss %xmm1, %xmm6
addss %xmm8, %xmm6
movaps %xmm3, %xmm8
mulss %xmm3, %xmm8
movaps %xmm2, %xmm13
mulss %xmm2, %xmm13
addss %xmm8, %xmm13
movaps %xmm6, %xmm8
mulss %xmm6, %xmm8
addss %xmm13, %xmm8
cvtss2sd %xmm8, %xmm8
sqrtsd %xmm8, %xmm8
movsd 0x48d4(%rip), %xmm7     # 0x12118
ucomisd %xmm8, %xmm7
ja 0xdc0a
xorps %xmm13, %xmm13
cvtsd2ss %xmm8, %xmm13
ucomiss 0x4850(%rip), %xmm13    # 0x120b0
jne 0xd868
jnp 0xdc0a
movaps %xmm14, 0xc0(%rsp)
movaps %xmm10, 0xd0(%rsp)
cvtss2sd %xmm2, %xmm2
divsd %xmm8, %xmm2
xorps %xmm10, %xmm10
cvtsd2ss %xmm2, %xmm10
xorps %xmm2, %xmm2
cvtss2sd %xmm3, %xmm2
divsd %xmm8, %xmm2
xorps %xmm13, %xmm13
cvtsd2ss %xmm2, %xmm13
xorps %xmm2, %xmm2
cvtss2sd %xmm6, %xmm2
divsd %xmm8, %xmm2
xorps %xmm6, %xmm6
cvtsd2ss %xmm2, %xmm6
movaps 0x30(%rsp), %xmm7
movaps %xmm7, %xmm2
mulss %xmm6, %xmm2
movaps %xmm13, %xmm14
movaps 0x20(%rsp), %xmm3
mulss %xmm3, %xmm14
subss %xmm2, %xmm14
mulss %xmm10, %xmm3
movaps %xmm6, 0x10(%rsp)
movaps %xmm6, %xmm2
movaps 0x40(%rsp), %xmm6
mulss %xmm6, %xmm2
subss %xmm3, %xmm2
mulss %xmm13, %xmm6
movaps %xmm10, 0xe0(%rsp)
movaps %xmm10, %xmm3
mulss %xmm7, %xmm3
subss %xmm6, %xmm3
movaps %xmm2, %xmm6
mulss %xmm2, %xmm6
movaps %xmm14, %xmm8
mulss %xmm14, %xmm8
addss %xmm6, %xmm8
movaps %xmm3, %xmm6
mulss %xmm3, %xmm6
addss %xmm8, %xmm6
cvtss2sd %xmm6, %xmm6
sqrtsd %xmm6, %xmm6
movsd 0x47df(%rip), %xmm8     # 0x12118
ucomisd %xmm6, %xmm8
ja 0xdc0a
xorps %xmm8, %xmm8
cvtsd2ss %xmm6, %xmm8
cvtss2sd %xmm8, %xmm8
movsd 0x7b1e(%rip), %xmm7     # 0x15478
ucomisd %xmm8, %xmm7
jae 0xdc0a
movaps %xmm13, %xmm15
movaps %xmm5, %xmm8
movaps %xmm13, %xmm10
mulss %xmm15, %xmm8
movaps %xmm1, %xmm15
movaps 0x10(%rsp), %xmm7
mulss %xmm7, %xmm15
subss %xmm8, %xmm15
movaps %xmm4, %xmm8
mulss %xmm7, %xmm8
movaps 0xe0(%rsp), %xmm7
mulss %xmm7, %xmm5
subss %xmm8, %xmm5
mulss %xmm7, %xmm1
mulss %xmm13, %xmm4
subss %xmm1, %xmm4
movaps %xmm5, %xmm1
mulss %xmm5, %xmm1
movaps %xmm15, %xmm8
mulss %xmm15, %xmm8
addss %xmm1, %xmm8
movaps %xmm4, %xmm1
mulss %xmm4, %xmm1
addss %xmm8, %xmm1
cvtss2sd %xmm1, %xmm1
sqrtsd %xmm1, %xmm1
movsd 0x4736(%rip), %xmm8     # 0x12118
ucomisd %xmm1, %xmm8
ja 0xdc0a
xorps %xmm8, %xmm8
cvtsd2ss %xmm1, %xmm8
cvtss2sd %xmm8, %xmm8
movsd 0x7a75(%rip), %xmm7     # 0x15478
ucomisd %xmm8, %xmm7
jae 0xdc0a
xorps %xmm8, %xmm8
cvtss2sd %xmm14, %xmm8
divsd %xmm6, %xmm8
xorps %xmm7, %xmm7
cvtsd2ss %xmm8, %xmm7
cvtss2sd %xmm2, %xmm2
divsd %xmm6, %xmm2
xorps %xmm8, %xmm8
cvtsd2ss %xmm2, %xmm8
xorps %xmm2, %xmm2
cvtss2sd %xmm3, %xmm2
divsd %xmm6, %xmm2
cvtsd2ss %xmm2, %xmm2
movaps %xmm0, %xmm3
mulss %xmm8, %xmm3
movaps 0xc0(%rsp), %xmm6
mulss %xmm7, %xmm6
addss %xmm3, %xmm6
movaps 0xd0(%rsp), %xmm3
mulss %xmm2, %xmm3
addss %xmm6, %xmm3
xorps %xmm6, %xmm6
cvtss2sd %xmm3, %xmm6
movaps 0x60(%rsp), %xmm3
mulss %xmm8, %xmm3
movaps 0x70(%rsp), %xmm13
mulss %xmm7, %xmm13
addss %xmm3, %xmm13
movaps 0x50(%rsp), %xmm3
mulss %xmm2, %xmm3
addss %xmm13, %xmm3
cvtss2sd %xmm3, %xmm3
movaps %xmm3, %xmm13
addsd 0x79d4(%rip), %xmm13    # 0x15480
ucomisd %xmm13, %xmm6
jae 0xdc0a
mulss %xmm8, %xmm12
mulss %xmm7, %xmm9
addss %xmm12, %xmm9
mulss %xmm2, %xmm11
addss %xmm9, %xmm11
xorps %xmm2, %xmm2
cvtss2sd %xmm11, %xmm2
movsd 0x7997(%rip), %xmm8     # 0x15478
addsd %xmm8, %xmm3
ucomisd %xmm2, %xmm3
jae 0xdc0a
xorps %xmm2, %xmm2
cvtss2sd %xmm15, %xmm2
divsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm2
xorps %xmm3, %xmm3
cvtss2sd %xmm5, %xmm3
divsd %xmm1, %xmm3
cvtsd2ss %xmm3, %xmm3
cvtss2sd %xmm4, %xmm4
divsd %xmm1, %xmm4
xorps %xmm1, %xmm1
cvtsd2ss %xmm4, %xmm1
movaps 0x60(%rsp), %xmm4
mulss %xmm3, %xmm4
movaps 0x70(%rsp), %xmm5
mulss %xmm2, %xmm5
addss %xmm4, %xmm5
movaps 0x50(%rsp), %xmm4
mulss %xmm1, %xmm4
addss %xmm5, %xmm4
xorps %xmm5, %xmm5
cvtss2sd %xmm4, %xmm5
movaps %xmm0, %xmm4
mulss %xmm3, %xmm4
movaps 0xc0(%rsp), %xmm9
movaps %xmm9, %xmm6
mulss %xmm2, %xmm6
addss %xmm4, %xmm6
movaps 0xd0(%rsp), %xmm7
movaps %xmm7, %xmm4
mulss %xmm1, %xmm4
addss %xmm6, %xmm4
cvtss2sd %xmm4, %xmm4
movaps %xmm4, %xmm6
addsd 0x78fa(%rip), %xmm6     # 0x15480
ucomisd %xmm6, %xmm5
jae 0xdc0a
mulss 0x8(%rsp), %xmm3
mulss 0xc(%rsp), %xmm2
addss %xmm3, %xmm2
mulss 0x4(%rsp), %xmm1
addss %xmm2, %xmm1
cvtss2sd %xmm1, %xmm1
addsd %xmm8, %xmm4
ucomisd %xmm1, %xmm4
jae 0xdc0a
unpcklps 0x60(%rsp), %xmm0       # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
shufps $0x0, %xmm10, %xmm10    # xmm10 = xmm10[0,0,0,0]
mulps %xmm0, %xmm10
unpcklps 0x70(%rsp), %xmm9       # xmm9 = xmm9[0],mem[0],xmm9[1],mem[1]
movaps 0xe0(%rsp), %xmm0
shufps $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
mulps %xmm9, %xmm0
addps %xmm10, %xmm0
unpcklps 0x50(%rsp), %xmm7       # xmm7 = xmm7[0],mem[0],xmm7[1],mem[1]
movaps 0x10(%rsp), %xmm1
shufps $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
mulps %xmm7, %xmm1
addps %xmm0, %xmm1
movaps %xmm1, %xmm0
shufps $0x55, %xmm1, %xmm0     # xmm0 = xmm0[1,1],xmm1[1,1]
subss %xmm0, %xmm1
mulss %xmm1, %xmm1
minss (%rsp), %xmm1
movaps %xmm1, %xmm5
jmp 0xdc0f
movss (%rsp), %xmm5
addq $0xc, %r11
leaq (%r8,%r10), %rbx
incq %rbx
incq %r10
cmpq $0x1, %rbx
jne 0xd768
jmp 0xdc2c
incq %r9
cmpq %rcx, %r9
jne 0xd6ab
jmp 0xdc3c
movss (%rsp), %xmm5
movss %xmm5, (%rsp)
movb $0x1, %r12b
xorl %ebx, %ebx
movq %rbx, %r14
xorq $0x1, %r14
movq (%rbp,%r14,8), %r15
leaq 0x8(%r15), %rdi
movq %rbp, %r13
movl 0x4(%r15), %ebp
movl %ebp, %esi
leaq 0xb4(%rsp), %rdx
callq 0xd045
testb %al, %al
je 0xe11a
movl %r12d, 0x40(%rsp)
movslq %ebp, %rax
movss 0xb4(%rsp), %xmm2
movaps %xmm2, 0x20(%rsp)
movsd 0xb8(%rsp), %xmm3
movaps %xmm3, 0x30(%rsp)
movaps %xmm3, %xmm0
shufps $0x55, %xmm3, %xmm0     # xmm0 = xmm0[1,1],xmm3[1,1]
movss 0xc(%r15), %xmm1
mulss %xmm3, %xmm1
movss %xmm1, 0x80(%rsp)
movss 0x8(%r15), %xmm1
mulss %xmm2, %xmm1
movss %xmm1, 0x10(%rsp)
movss 0x10(%r15), %xmm1
movaps %xmm0, 0xa0(%rsp)
mulss %xmm0, %xmm1
movss %xmm1, 0x90(%rsp)
shlq $0x2, %rax
leaq (%rax,%rax,2), %rdi
callq 0x3310
movq %rax, %r15
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0x946d
movq (%r13,%r14,8), %rax
movslq 0x4(%rax), %rdi
shlq $0x2, %rdi
callq 0x3310
movq %rax, %r12
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0x946d
movaps 0x30(%rsp), %xmm14
movaps 0x20(%rsp), %xmm13
movq (%r13,%r14,8), %rcx
movl 0x4(%rcx), %eax
testl %eax, %eax
movq %r13, %rbp
movss (%rsp), %xmm10
movsd 0x43c9(%rip), %xmm7     # 0x12118
movsd 0x7728(%rip), %xmm12    # 0x15480
movss 0x4343(%rip), %xmm8     # 0x120a4
xorps %xmm9, %xmm9
jle 0xdea5
leaq 0x8(%rcx), %rdx
movaps %xmm13, %xmm0
shufps $0xd4, %xmm14, %xmm0    # xmm0 = xmm0[0,1],xmm14[1,3]
shufps $0xe2, %xmm14, %xmm0    # xmm0 = xmm0[2,0],xmm14[2,3]
movq %rax, %rsi
negq %rsi
movl $0x1, %edi
xorl %r8d, %r8d
movq %rsi, %r9
addq %rdi, %r9
movl $0x0, %r9d
cmovneq %rdi, %r9
leaq (%r9,%r9,2), %r9
movss (%rdx,%r9,4), %xmm3
movss 0x8(%rcx,%r8), %xmm2
subss %xmm2, %xmm3
movsd 0x4(%rdx,%r9,4), %xmm4
movsd 0xc(%rcx,%r8), %xmm1
subps %xmm1, %xmm4
movaps %xmm3, %xmm5
shufps $0xd4, %xmm4, %xmm5     # xmm5 = xmm5[0,1],xmm4[1,3]
shufps $0x52, %xmm4, %xmm5     # xmm5 = xmm5[2,0],xmm4[1,1]
mulps %xmm14, %xmm5
movaps %xmm13, %xmm6
mulss %xmm4, %xmm6
mulps %xmm0, %xmm4
subps %xmm5, %xmm4
mulss %xmm14, %xmm3
subss %xmm6, %xmm3
movaps %xmm4, %xmm5
mulps %xmm4, %xmm5
shufps $0x55, %xmm5, %xmm5     # xmm5 = xmm5[1,1,1,1]
movaps %xmm4, %xmm6
mulss %xmm4, %xmm6
addss %xmm5, %xmm6
movaps %xmm3, %xmm5
mulss %xmm3, %xmm5
addss %xmm6, %xmm5
cvtss2sd %xmm5, %xmm5
sqrtsd %xmm5, %xmm5
ucomisd %xmm5, %xmm7
jbe 0xde2c
movl $0x0, 0x8(%r15,%r8)
movq $0x0, (%r15,%r8)
movaps %xmm8, %xmm5
jmp 0xde86
cvtps2pd %xmm4, %xmm4
cvtss2sd %xmm3, %xmm3
divsd %xmm5, %xmm3
cvtsd2ss %xmm3, %xmm3
xorps %xmm6, %xmm6
cvtsd2ss %xmm5, %xmm6
movss %xmm3, 0x8(%r15,%r8)
unpcklpd %xmm5, %xmm5            # xmm5 = xmm5[0,0]
divpd %xmm5, %xmm4
cvtpd2ps %xmm4, %xmm4
movlpd %xmm4, (%r15,%r8)
ucomiss %xmm9, %xmm6
movaps %xmm8, %xmm5
jne 0xde67
jnp 0xde86
mulss %xmm4, %xmm2
shufps $0x55, %xmm4, %xmm4     # xmm4 = xmm4[1,1,1,1]
mulss %xmm1, %xmm4
addss %xmm2, %xmm4
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
mulss %xmm3, %xmm1
addss %xmm4, %xmm1
movaps %xmm1, %xmm5
movss %xmm5, -0x4(%r12,%rdi,4)
addq $0xc, %r8
leaq (%rsi,%rdi), %r9
incq %r9
incq %rdi
cmpq $0x1, %r9
jne 0xdd8b
movq (%rbp,%rbx,8), %rcx
movslq 0x4(%rcx), %rdx
testq %rdx, %rdx
jle 0xe0fd
movss 0x10(%rsp), %xmm0
addss 0x80(%rsp), %xmm0
movss 0x90(%rsp), %xmm9
addss %xmm0, %xmm9
addq $0x8, %rcx
movq %r15, %rsi
addq $0x8, %rsi
xorl %edi, %edi
movaps 0xa0(%rsp), %xmm15
leaq (%rdi,%rdi,2), %r8
movss (%rcx,%r8,4), %xmm1
movss 0x4(%rcx,%r8,4), %xmm2
movss 0x8(%rcx,%r8,4), %xmm0
testl %eax, %eax
jle 0xdf4f
movq %rsi, %r8
xorl %r9d, %r9d
movss -0x4(%r8), %xmm3
mulss %xmm2, %xmm3
movss -0x8(%r8), %xmm4
mulss %xmm1, %xmm4
addss %xmm3, %xmm4
movss (%r8), %xmm3
mulss %xmm0, %xmm3
addss %xmm4, %xmm3
subss (%r12,%r9,4), %xmm3
cvtss2sd %xmm3, %xmm3
ucomisd %xmm12, %xmm3
jae 0xdf78
incq %r9
addq $0xc, %r8
cmpq %r9, %rax
jne 0xdf0d
mulss %xmm14, %xmm2
mulss %xmm13, %xmm1
addss %xmm2, %xmm1
mulss %xmm15, %xmm0
addss %xmm1, %xmm0
subss %xmm9, %xmm0
mulss %xmm0, %xmm0
minss %xmm10, %xmm0
movaps %xmm0, %xmm10
incq %rdi
cmpq %rdx, %rdi
jne 0xdeeb
testl %edx, %edx
jle 0xe0fd
xorl %edi, %edi
leaq (%rdi,%rdi,2), %r8
incq %rdi
cmpq %rdx, %rdi
movl %edi, %r9d
movl $0x0, %r10d
cmovneq %r9, %r10
leaq (%r10,%r10,2), %r9
movss (%rcx,%r8,4), %xmm4
movss 0x4(%rcx,%r8,4), %xmm3
movaps %xmm14, %xmm0
mulss %xmm3, %xmm0
movaps %xmm4, %xmm1
mulss %xmm13, %xmm1
addss %xmm0, %xmm1
movss 0x8(%rcx,%r8,4), %xmm5
movaps %xmm5, %xmm6
mulss %xmm15, %xmm6
addss %xmm1, %xmm6
subss %xmm9, %xmm6
movss (%rcx,%r9,4), %xmm0
movss 0x4(%rcx,%r9,4), %xmm1
movaps %xmm14, %xmm2
mulss %xmm1, %xmm2
movaps %xmm0, %xmm8
mulss %xmm13, %xmm8
addss %xmm2, %xmm8
movss 0x8(%rcx,%r9,4), %xmm2
movaps %xmm2, %xmm7
mulss %xmm15, %xmm7
addss %xmm8, %xmm7
movaps %xmm9, %xmm11
subss %xmm9, %xmm7
xorps %xmm9, %xmm9
cvtss2sd %xmm6, %xmm9
ucomisd 0x7444(%rip), %xmm9     # 0x15478
xorps %xmm8, %xmm8
cvtss2sd %xmm7, %xmm8
jbe 0xe046
ucomisd %xmm8, %xmm12
ja 0xe060
ucomisd %xmm9, %xmm12
jbe 0xe0f0
ucomisd 0x741e(%rip), %xmm8     # 0x15478
jbe 0xe0f0
testl %eax, %eax
jle 0xe0ec
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
movq %rsi, %r8
xorl %r9d, %r9d
movaps %xmm11, %xmm9
movss -0x4(%r8), %xmm3
mulss %xmm1, %xmm3
movss -0x8(%r8), %xmm4
mulss %xmm0, %xmm4
addss %xmm3, %xmm4
movss (%r8), %xmm3
mulss %xmm2, %xmm3
addss %xmm4, %xmm3
subss (%r12,%r9,4), %xmm3
cvtss2sd %xmm3, %xmm3
ucomisd %xmm12, %xmm3
jae 0xe0f4
incq %r9
addq $0xc, %r8
cmpq %r9, %rax
jne 0xe0a4
xorps %xmm10, %xmm10
jmp 0xe0f4
xorps %xmm10, %xmm10
movaps %xmm11, %xmm9
cmpq %rdx, %rdi
jne 0xdf8e
movss %xmm10, (%rsp)
movq %r15, %rdi
callq 0x32b0
movq %r12, %rdi
callq 0x32b0
movl 0x40(%rsp), %r12d
jmp 0xe11d
movq %r13, %rbp
movl $0x1, %ebx
testb $0x1, %r12b
movl $0x0, %r12d
jne 0xdc46
xorps %xmm1, %xmm1
movss (%rsp), %xmm0
ucomiss %xmm1, %xmm0
jb 0xe155
sqrtss %xmm0, %xmm0
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3430