// File: FreeSlave[P]vhlt/hlrad/lerp.cpp
// Function: PurgePatches(localtriangulation_t*)
static void PurgePatches (localtriangulation_t *lt)
{
	std::vector< localtriangulation_t::Wedge > points;
	int i;
	int cur;
	std::vector< int > next;
	std::vector< int > prev;
	std::vector< int > valid;
	std::vector< std::pair< vec_t, int > > dists;
	vec_t angle;
	vec3_t normal;
	vec3_t v;

	points.swap (lt->sortedwedges);
	lt->sortedwedges.resize (0);

	next.resize ((int)points.size ());
	prev.resize ((int)points.size ());
	valid.resize ((int)points.size ());
	dists.resize ((int)points.size ());
	for (i = 0; i < (int)points.size (); i++)
	{
		next[i] = (i + 1) % (int)points.size ();
		prev[i] = (i - 1 + (int)points.size ()) % (int)points.size ();
		valid[i] = 1;
		dists[i].first = DotProduct (points[i].leftspot, points[i].leftdirection);
		dists[i].second = i;
	}
	std::sort (dists.begin (), dists.end ());

	for (i = 0; i < (int)points.size (); i++)
	{
		cur = dists[i].second;
		if (valid[cur] == 0)
		{
			continue;
		}
		valid[cur] = 2; // mark current patch as final
		
		CrossProduct (points[cur].leftdirection, lt->normal, normal);
		VectorNormalize (normal);
		VectorScale (normal, cos (TRIANGLE_SHAPE_THRESHOLD), v);
		VectorMA (v, sin (TRIANGLE_SHAPE_THRESHOLD), points[cur].leftdirection, v);
		while (next[cur] != cur && valid[next[cur]] != 2)
		{
			angle = GetAngle (points[cur].leftdirection, points[next[cur]].leftdirection, lt->normal);
			if (fabs (angle) <= (1.0*Q_PI/180) ||
				GetAngleDiff (angle, 0) <= Q_PI + NORMAL_EPSILON
				&& DotProduct (points[next[cur]].leftspot, v) >= DotProduct (points[cur].leftspot, v) - ON_EPSILON / 2)
			{
				// remove next patch
				valid[next[cur]] = 0;
				next[cur] = next[next[cur]];
				prev[next[cur]] = cur;
				continue;
			}
			// the triangle is good
			break;
		}
		
		CrossProduct (lt->normal, points[cur].leftdirection, normal);
		VectorNormalize (normal);
		VectorScale (normal, cos (TRIANGLE_SHAPE_THRESHOLD), v);
		VectorMA (v, sin (TRIANGLE_SHAPE_THRESHOLD), points[cur].leftdirection, v);
		while (prev[cur] != cur && valid[prev[cur]] != 2)
		{
			angle = GetAngle (points[prev[cur]].leftdirection, points[cur].leftdirection, lt->normal);
			if (fabs (angle) <= (1.0*Q_PI/180) ||
				GetAngleDiff (angle, 0) <= Q_PI + NORMAL_EPSILON
				&& DotProduct (points[prev[cur]].leftspot, v) >= DotProduct (points[cur].leftspot, v) - ON_EPSILON / 2)
			{
				// remove previous patch
				valid[prev[cur]] = 0;
				prev[cur] = prev[prev[cur]];
				next[prev[cur]] = cur;
				continue;
			}
			// the triangle is good
			break;
		}
	}

	for (i = 0; i < (int)points.size (); i++)
	{
		if (valid[i] == 2)
		{
			lt->sortedwedges.push_back (points[i]);
		}
	}
}

// Assembly:
subq $0x278, %rsp            # imm = 0x278
movq %rdi, 0x270(%rsp)
leaq 0x258(%rsp), %rdi
movq %rdi, 0x1a8(%rsp)
callq 0x21ba0
leaq 0x238(%rsp), %rdi
callq 0x1f930
leaq 0x220(%rsp), %rdi
callq 0x1f930
leaq 0x208(%rsp), %rdi
callq 0x1f930
leaq 0x1f0(%rsp), %rdi
callq 0x22530
movq 0x1a8(%rsp), %rdi
movq 0x270(%rsp), %rsi
addq $0x70, %rsi
callq 0x25820
movq 0x270(%rsp), %rdi
addq $0x70, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x22540
jmp 0x1b3e8
leaq 0x258(%rsp), %rdi
callq 0x1f6c0
movslq %eax, %rsi
leaq 0x238(%rsp), %rdi
callq 0x1fb10
jmp 0x1b407
leaq 0x258(%rsp), %rdi
callq 0x1f6c0
movslq %eax, %rsi
leaq 0x220(%rsp), %rdi
callq 0x1fb10
jmp 0x1b426
leaq 0x258(%rsp), %rdi
callq 0x1f6c0
movslq %eax, %rsi
leaq 0x208(%rsp), %rdi
callq 0x1fb10
jmp 0x1b445
leaq 0x258(%rsp), %rdi
callq 0x1f6c0
movslq %eax, %rsi
leaq 0x1f0(%rsp), %rdi
callq 0x22650
jmp 0x1b464
movl $0x0, 0x254(%rsp)
movl 0x254(%rsp), %eax
movl %eax, 0x1a4(%rsp)
leaq 0x258(%rsp), %rdi
callq 0x1f6c0
movq %rax, %rcx
movl 0x1a4(%rsp), %eax
cmpl %ecx, %eax
jge 0x1b745
movl 0x254(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x174(%rsp)
leaq 0x258(%rsp), %rdi
callq 0x1f6c0
movq %rax, %rcx
movl 0x174(%rsp), %eax
cltd
idivl %ecx
movl %edx, 0x178(%rsp)
movslq 0x254(%rsp), %rsi
leaq 0x238(%rsp), %rdi
callq 0x1fc20
movl 0x178(%rsp), %edx
movl %edx, (%rax)
movl 0x254(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x17c(%rsp)
leaq 0x258(%rsp), %rdi
callq 0x1f6c0
movq %rax, %rcx
movl 0x17c(%rsp), %eax
addl %ecx, %eax
movl %eax, 0x180(%rsp)
leaq 0x258(%rsp), %rdi
callq 0x1f6c0
movq %rax, %rcx
movl 0x180(%rsp), %eax
cltd
idivl %ecx
movl %edx, 0x184(%rsp)
movslq 0x254(%rsp), %rsi
leaq 0x220(%rsp), %rdi
callq 0x1fc20
movl 0x184(%rsp), %edx
movl %edx, (%rax)
movslq 0x254(%rsp), %rsi
leaq 0x208(%rsp), %rdi
callq 0x1fc20
movl $0x1, (%rax)
movslq 0x254(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x8(%rax), %xmm0
movss %xmm0, 0x18c(%rsp)
movslq 0x254(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x14(%rax), %xmm0
movss %xmm0, 0x190(%rsp)
movslq 0x254(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0xc(%rax), %xmm0
movss %xmm0, 0x188(%rsp)
movslq 0x254(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x188(%rsp), %xmm1
movss 0x18c(%rsp), %xmm0
movss 0x190(%rsp), %xmm2
mulss 0x18(%rax), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x198(%rsp)
movslq 0x254(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x10(%rax), %xmm0
movss %xmm0, 0x194(%rsp)
movslq 0x254(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x194(%rsp), %xmm0
movss 0x198(%rsp), %xmm1
movss 0x1c(%rax), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x19c(%rsp)
movslq 0x254(%rsp), %rsi
leaq 0x1f0(%rsp), %rdi
callq 0x226f0
movss 0x19c(%rsp), %xmm0
movss %xmm0, (%rax)
movl 0x254(%rsp), %eax
movl %eax, 0x1a0(%rsp)
movslq 0x254(%rsp), %rsi
leaq 0x1f0(%rsp), %rdi
callq 0x226f0
movl 0x1a0(%rsp), %ecx
movl %ecx, 0x4(%rax)
movl 0x254(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x254(%rsp)
jmp 0x1b46f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
leaq 0x1f0(%rsp), %rdi
callq 0x227b0
leaq 0x208(%rsp), %rdi
callq 0x25880
leaq 0x220(%rsp), %rdi
callq 0x25880
leaq 0x238(%rsp), %rdi
callq 0x25880
leaq 0x258(%rsp), %rdi
callq 0x22810
jmp 0x1c7d0
leaq 0x1f0(%rsp), %rdi
movq %rdi, 0x168(%rsp)
callq 0x22750
movq 0x168(%rsp), %rdi
movq %rax, 0x1b8(%rsp)
callq 0x22780
movq %rax, 0x1b0(%rsp)
movq 0x1b8(%rsp), %rdi
movq 0x1b0(%rsp), %rsi
callq 0x22710
jmp 0x1b78e
movl $0x0, 0x254(%rsp)
movl 0x254(%rsp), %eax
movl %eax, 0x164(%rsp)
leaq 0x258(%rsp), %rdi
callq 0x1f6c0
movq %rax, %rcx
movl 0x164(%rsp), %eax
cmpl %ecx, %eax
jge 0x1c6f2
movslq 0x254(%rsp), %rsi
leaq 0x1f0(%rsp), %rdi
callq 0x226f0
movl 0x4(%rax), %eax
movl %eax, 0x250(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x208(%rsp), %rdi
callq 0x1fc20
cmpl $0x0, (%rax)
jne 0x1b804
jmp 0x1c6dc
movslq 0x250(%rsp), %rsi
leaq 0x208(%rsp), %rdi
callq 0x1fc20
movl $0x2, (%rax)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x18(%rax), %xmm0
movss %xmm0, 0x100(%rsp)
movq 0x270(%rsp), %rax
movss 0x4c(%rax), %xmm0
movss %xmm0, 0x104(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x100(%rsp), %xmm0
movss 0x104(%rsp), %xmm2
movss 0x1c(%rax), %xmm1
movq 0x270(%rsp), %rax
mulss 0x48(%rax), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x1e0(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x1c(%rax), %xmm0
movss %xmm0, 0x108(%rsp)
movq 0x270(%rsp), %rax
movss 0x44(%rax), %xmm0
movss %xmm0, 0x10c(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x108(%rsp), %xmm0
movss 0x10c(%rsp), %xmm2
movss 0x14(%rax), %xmm1
movq 0x270(%rsp), %rax
mulss 0x4c(%rax), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x1e4(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x14(%rax), %xmm0
movss %xmm0, 0x110(%rsp)
movq 0x270(%rsp), %rax
movss 0x48(%rax), %xmm0
movss %xmm0, 0x114(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x110(%rsp), %xmm0
movss 0x114(%rsp), %xmm2
movss 0x18(%rax), %xmm1
movq 0x270(%rsp), %rax
mulss 0x44(%rax), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x1e8(%rsp)
leaq 0x1e0(%rsp), %rdi
callq 0x11980
movss 0x1e0(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x118(%rsp)
movsd 0x51e2e(%rip), %xmm0    # 0x6d828
callq 0x4620
movaps %xmm0, %xmm1
movsd 0x118(%rsp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1d4(%rsp)
movss 0x1e4(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x120(%rsp)
movsd 0x51dee(%rip), %xmm0    # 0x6d828
callq 0x4620
movaps %xmm0, %xmm1
movsd 0x120(%rsp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1d8(%rsp)
movss 0x1e8(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x128(%rsp)
movsd 0x51dae(%rip), %xmm0    # 0x6d828
callq 0x4620
movaps %xmm0, %xmm1
movsd 0x128(%rsp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1dc(%rsp)
movss 0x1d4(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x138(%rsp)
movsd 0x51d6e(%rip), %xmm0    # 0x6d828
callq 0x40b0
movsd %xmm0, 0x130(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movsd 0x130(%rsp), %xmm0
movsd 0x138(%rsp), %xmm1
movss 0x14(%rax), %xmm2
cvtss2sd %xmm2, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1d4(%rsp)
movss 0x1d8(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x148(%rsp)
movsd 0x51cfd(%rip), %xmm0    # 0x6d828
callq 0x40b0
movsd %xmm0, 0x140(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movsd 0x140(%rsp), %xmm0
movsd 0x148(%rsp), %xmm1
movss 0x18(%rax), %xmm2
cvtss2sd %xmm2, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1d8(%rsp)
movss 0x1dc(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x158(%rsp)
movsd 0x51c8c(%rip), %xmm0    # 0x6d828
callq 0x40b0
movsd %xmm0, 0x150(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movsd 0x150(%rsp), %xmm0
movsd 0x158(%rsp), %xmm1
movss 0x1c(%rax), %xmm2
cvtss2sd %xmm2, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1dc(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x238(%rsp), %rdi
callq 0x1fc20
movl (%rax), %ecx
xorl %eax, %eax
cmpl 0x250(%rsp), %ecx
movb %al, 0xff(%rsp)
je 0x1bc4a
movslq 0x250(%rsp), %rsi
leaq 0x238(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x208(%rsp), %rdi
callq 0x1fc20
cmpl $0x2, (%rax)
setne %al
movb %al, 0xff(%rsp)
movb 0xff(%rsp), %al
testb $0x1, %al
jne 0x1bc5a
jmp 0x1bfa8
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
movq %rdi, 0xe8(%rsp)
callq 0x21b80
addq $0x14, %rax
movq %rax, 0xf0(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x238(%rsp), %rdi
callq 0x1fc20
movq 0xe8(%rsp), %rdi
movslq (%rax), %rsi
callq 0x21b80
movq 0xf0(%rsp), %rdi
movq %rax, %rsi
addq $0x14, %rsi
movq 0x270(%rsp), %rdx
addq $0x44, %rdx
callq 0x187a0
movss %xmm0, 0xf8(%rsp)
jmp 0x1bcd3
movss 0xf8(%rsp), %xmm0
movss %xmm0, 0x1ec(%rsp)
movss 0x1ec(%rsp), %xmm0
callq 0x11ce0
cvtss2sd %xmm0, %xmm1
movsd 0x51b41(%rip), %xmm0    # 0x6d840
ucomisd %xmm1, %xmm0
jae 0x1beee
movss 0x1ec(%rsp), %xmm0
xorps %xmm1, %xmm1
callq 0x18920
cvtss2sd %xmm0, %xmm1
movsd 0x51afa(%rip), %xmm0    # 0x6d820
ucomisd %xmm1, %xmm0
jb 0x1bfa6
movslq 0x250(%rsp), %rsi
leaq 0x238(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x8(%rax), %xmm0
movss %xmm0, 0xc8(%rsp)
movss 0x1d4(%rsp), %xmm0
movss %xmm0, 0xcc(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x238(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0xc8(%rsp), %xmm0
movss 0xcc(%rsp), %xmm2
movss 0xc(%rax), %xmm1
mulss 0x1d8(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0xd0(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x238(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0xd0(%rsp), %xmm1
movss 0x10(%rax), %xmm0
movss 0x1dc(%rsp), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0xe0(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x8(%rax), %xmm0
movss %xmm0, 0xd4(%rsp)
movss 0x1d4(%rsp), %xmm0
movss %xmm0, 0xd8(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0xd4(%rsp), %xmm0
movss 0xd8(%rsp), %xmm2
movss 0xc(%rax), %xmm1
mulss 0x1d8(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0xdc(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0xdc(%rsp), %xmm2
movsd 0xe0(%rsp), %xmm0
movss 0x10(%rax), %xmm1
movss 0x1dc(%rsp), %xmm3
mulss %xmm3, %xmm1
addss %xmm2, %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x51968(%rip), %xmm2    # 0x6d848
subsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1bfa6
movslq 0x250(%rsp), %rsi
leaq 0x238(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x208(%rsp), %rdi
callq 0x1fc20
movl $0x0, (%rax)
movslq 0x250(%rsp), %rsi
leaq 0x238(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x238(%rsp), %rdi
callq 0x1fc20
movl (%rax), %eax
movl %eax, 0xc0(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x238(%rsp), %rdi
callq 0x1fc20
movl 0xc0(%rsp), %ecx
movl %ecx, (%rax)
movl 0x250(%rsp), %eax
movl %eax, 0xc4(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x238(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x220(%rsp), %rdi
callq 0x1fc20
movl 0xc4(%rsp), %ecx
movl %ecx, (%rax)
jmp 0x1bbef
jmp 0x1bfa8
movq 0x270(%rsp), %rax
movss 0x48(%rax), %xmm0
movss %xmm0, 0x58(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x1c(%rax), %xmm0
movss %xmm0, 0x5c(%rsp)
movq 0x270(%rsp), %rax
movss 0x4c(%rax), %xmm0
movss %xmm0, 0x54(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x54(%rsp), %xmm1
movss 0x58(%rsp), %xmm0
movss 0x5c(%rsp), %xmm2
mulss 0x18(%rax), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x1e0(%rsp)
movq 0x270(%rsp), %rax
movss 0x4c(%rax), %xmm0
movss %xmm0, 0x64(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x14(%rax), %xmm0
movss %xmm0, 0x68(%rsp)
movq 0x270(%rsp), %rax
movss 0x44(%rax), %xmm0
movss %xmm0, 0x60(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x60(%rsp), %xmm1
movss 0x64(%rsp), %xmm0
movss 0x68(%rsp), %xmm2
mulss 0x1c(%rax), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x1e4(%rsp)
movq 0x270(%rsp), %rax
movss 0x44(%rax), %xmm0
movss %xmm0, 0x70(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x18(%rax), %xmm0
movss %xmm0, 0x74(%rsp)
movq 0x270(%rsp), %rax
movss 0x48(%rax), %xmm0
movss %xmm0, 0x6c(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x6c(%rsp), %xmm1
movss 0x70(%rsp), %xmm0
movss 0x74(%rsp), %xmm2
mulss 0x14(%rax), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x1e8(%rsp)
leaq 0x1e0(%rsp), %rdi
callq 0x11980
movss 0x1e0(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x78(%rsp)
movsd 0x516a8(%rip), %xmm0    # 0x6d828
callq 0x4620
movaps %xmm0, %xmm1
movsd 0x78(%rsp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1d4(%rsp)
movss 0x1e4(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0x5166b(%rip), %xmm0    # 0x6d828
callq 0x4620
movaps %xmm0, %xmm1
movsd 0x80(%rsp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1d8(%rsp)
movss 0x1e8(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x88(%rsp)
movsd 0x5162b(%rip), %xmm0    # 0x6d828
callq 0x4620
movaps %xmm0, %xmm1
movsd 0x88(%rsp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1dc(%rsp)
movss 0x1d4(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x98(%rsp)
movsd 0x515eb(%rip), %xmm0    # 0x6d828
callq 0x40b0
movsd %xmm0, 0x90(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movsd 0x90(%rsp), %xmm0
movsd 0x98(%rsp), %xmm1
movss 0x14(%rax), %xmm2
cvtss2sd %xmm2, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1d4(%rsp)
movss 0x1d8(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0xa8(%rsp)
movsd 0x5157a(%rip), %xmm0    # 0x6d828
callq 0x40b0
movsd %xmm0, 0xa0(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movsd 0xa0(%rsp), %xmm0
movsd 0xa8(%rsp), %xmm1
movss 0x18(%rax), %xmm2
cvtss2sd %xmm2, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1d8(%rsp)
movss 0x1dc(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0xb8(%rsp)
movsd 0x51509(%rip), %xmm0    # 0x6d828
callq 0x40b0
movsd %xmm0, 0xb0(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movsd 0xb0(%rsp), %xmm0
movsd 0xb8(%rsp), %xmm1
movss 0x1c(%rax), %xmm2
cvtss2sd %xmm2, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1dc(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x220(%rsp), %rdi
callq 0x1fc20
movl (%rax), %ecx
xorl %eax, %eax
cmpl 0x250(%rsp), %ecx
movb %al, 0x53(%rsp)
je 0x1c3c7
movslq 0x250(%rsp), %rsi
leaq 0x220(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x208(%rsp), %rdi
callq 0x1fc20
cmpl $0x2, (%rax)
setne %al
movb %al, 0x53(%rsp)
movb 0x53(%rsp), %al
testb $0x1, %al
jne 0x1c3d4
jmp 0x1c6da
movslq 0x250(%rsp), %rsi
leaq 0x220(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x258(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x21b80
movq 0x38(%rsp), %rdi
addq $0x14, %rax
movq %rax, 0x40(%rsp)
movslq 0x250(%rsp), %rsi
callq 0x21b80
movq 0x40(%rsp), %rdi
movq %rax, %rsi
addq $0x14, %rsi
movq 0x270(%rsp), %rdx
addq $0x44, %rdx
callq 0x187a0
movss %xmm0, 0x4c(%rsp)
jmp 0x1c43e
movss 0x4c(%rsp), %xmm0
movss %xmm0, 0x1ec(%rsp)
movss 0x1ec(%rsp), %xmm0
callq 0x11ce0
cvtss2sd %xmm0, %xmm1
movsd 0x513d9(%rip), %xmm0    # 0x6d840
ucomisd %xmm1, %xmm0
jae 0x1c62c
movss 0x1ec(%rsp), %xmm0
xorps %xmm1, %xmm1
callq 0x18920
cvtss2sd %xmm0, %xmm1
movsd 0x51392(%rip), %xmm0    # 0x6d820
ucomisd %xmm1, %xmm0
jb 0x1c6d8
movslq 0x250(%rsp), %rsi
leaq 0x220(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x8(%rax), %xmm0
movss %xmm0, 0x18(%rsp)
movss 0x1d4(%rsp), %xmm0
movss %xmm0, 0x1c(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x220(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x18(%rsp), %xmm0
movss 0x1c(%rsp), %xmm2
movss 0xc(%rax), %xmm1
mulss 0x1d8(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x20(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x220(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x20(%rsp), %xmm1
movss 0x10(%rax), %xmm0
movss 0x1dc(%rsp), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x30(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x8(%rax), %xmm0
movss %xmm0, 0x24(%rsp)
movss 0x1d4(%rsp), %xmm0
movss %xmm0, 0x28(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x24(%rsp), %xmm0
movss 0x28(%rsp), %xmm2
movss 0xc(%rax), %xmm1
mulss 0x1d8(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x2c(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movss 0x2c(%rsp), %xmm2
movsd 0x30(%rsp), %xmm0
movss 0x10(%rax), %xmm1
movss 0x1dc(%rsp), %xmm3
mulss %xmm3, %xmm1
addss %xmm2, %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x5122a(%rip), %xmm2    # 0x6d848
subsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1c6d8
movslq 0x250(%rsp), %rsi
leaq 0x220(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x208(%rsp), %rdi
callq 0x1fc20
movl $0x0, (%rax)
movslq 0x250(%rsp), %rsi
leaq 0x220(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x220(%rsp), %rdi
callq 0x1fc20
movl (%rax), %eax
movl %eax, 0x10(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x220(%rsp), %rdi
callq 0x1fc20
movl 0x10(%rsp), %ecx
movl %ecx, (%rax)
movl 0x250(%rsp), %eax
movl %eax, 0x14(%rsp)
movslq 0x250(%rsp), %rsi
leaq 0x220(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x238(%rsp), %rdi
callq 0x1fc20
movl 0x14(%rsp), %ecx
movl %ecx, (%rax)
jmp 0x1c372
jmp 0x1c6da
jmp 0x1c6dc
movl 0x254(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x254(%rsp)
jmp 0x1b799
movl $0x0, 0x254(%rsp)
movl 0x254(%rsp), %eax
movl %eax, 0xc(%rsp)
leaq 0x258(%rsp), %rdi
callq 0x1f6c0
movq %rax, %rcx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x1c787
movslq 0x254(%rsp), %rsi
leaq 0x208(%rsp), %rdi
callq 0x1fc20
cmpl $0x2, (%rax)
jne 0x1c76f
movq 0x270(%rsp), %rax
addq $0x70, %rax
movq %rax, (%rsp)
movslq 0x254(%rsp), %rsi
leaq 0x258(%rsp), %rdi
callq 0x21b80
movq (%rsp), %rdi
movq %rax, %rsi
callq 0x225e0
jmp 0x1c76d
jmp 0x1c76f
jmp 0x1c771
movl 0x254(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x254(%rsp)
jmp 0x1c6fd
leaq 0x1f0(%rsp), %rdi
callq 0x227b0
leaq 0x208(%rsp), %rdi
callq 0x25880
leaq 0x220(%rsp), %rdi
callq 0x25880
leaq 0x238(%rsp), %rdi
callq 0x25880
leaq 0x258(%rsp), %rdi
callq 0x22810
addq $0x278, %rsp            # imm = 0x278
retq
movq 0x1c8(%rsp), %rdi
callq 0x45c0
nopl (%rax)