// File: FreeSlave[P]vhlt/hlrad/lerp.cpp
// Function: PlaceHullPoints(localtriangulation_t*)
static void PlaceHullPoints (localtriangulation_t *lt)
{
	int i;
	int j;
	int n;
	vec3_t v;
	vec_t dot;
	vec_t angle;
	localtriangulation_t::HullPoint hp;
	std::vector< localtriangulation_t::HullPoint > spots;
	std::vector< std::pair< vec_t, int > > angles;
	const localtriangulation_t::Wedge *w;
	const localtriangulation_t::Wedge *wnext;
	std::vector< localtriangulation_t::HullPoint > arc_spots;
	std::vector< vec_t > arc_angles;
	std::vector< int > next;
	std::vector< int > prev;
	vec_t frac;
	vec_t len;
	vec_t dist;

	spots.reserve (lt->winding.m_NumPoints);
	spots.resize (0);
	for (i = 0; i < (int)lt->winding.m_NumPoints; i++)
	{
		VectorSubtract (lt->winding.m_Points[i], lt->center, v);
		dot = DotProduct (v, lt->normal);
		VectorMA (v, -dot, lt->normal, hp.spot);
		if (!GetDirection (hp.spot, lt->normal, hp.direction))
		{
			continue;
		}
		spots.push_back (hp);
	}

	if ((int)lt->sortedwedges.size () == 0)
	{
		angles.resize ((int)spots.size ());
		for (i = 0; i < (int)spots.size (); i++)
		{
			angle = GetAngle (spots[0].direction, spots[i].direction, lt->normal);
			if (i == 0)
			{
				angle = 0.0;
			}
			angles[i].first = GetAngleDiff (angle, 0);
			angles[i].second = i;
		}
		std::sort (angles.begin (), angles.end ());
		lt->sortedhullpoints.resize (0);
		for (i = 0; i < (int)spots.size (); i++)
		{
			if (g_drawlerp && angles[i].second != i)
			{
				Developer (DEVELOPER_LEVEL_SPAM, "Debug: triangulation: internal error 8.\n");
			}
			lt->sortedhullpoints.push_back (spots[angles[i].second]);
		}
		return;
	}

	lt->sortedhullpoints.resize (0);
	for (i = 0; i < (int)lt->sortedwedges.size (); i++)
	{
		w = &lt->sortedwedges[i];
		wnext = &lt->sortedwedges[(i + 1) % (int)lt->sortedwedges.size ()];

		angles.resize ((int)spots.size ());
		for (j = 0; j < (int)spots.size (); j++)
		{
			angle = GetAngle (w->leftdirection, spots[j].direction, lt->normal);
			angles[j].first = GetAngleDiff (angle, 0);
			angles[j].second = j;
		}
		std::sort (angles.begin (), angles.end ());
		angle = GetAngle (w->leftdirection, wnext->leftdirection, lt->normal);
		if ((int)lt->sortedwedges.size () == 1)
		{
			angle = 2 * Q_PI;
		}
		else
		{
			angle = GetAngleDiff (angle, 0);
		}

		arc_spots.resize ((int)spots.size () + 2);
		arc_angles.resize ((int)spots.size () + 2);
		next.resize ((int)spots.size () + 2);
		prev.resize ((int)spots.size () + 2);

		VectorCopy (w->leftspot, arc_spots[0].spot);
		VectorCopy (w->leftdirection, arc_spots[0].direction);
		arc_angles[0] = 0;
		next[0] = 1;
		prev[0] = -1;
		n = 1;
		for (j = 0; j < (int)spots.size (); j++)
		{
			if (NORMAL_EPSILON <= angles[j].first && angles[j].first <= angle - NORMAL_EPSILON)
			{
				arc_spots[n] = spots[angles[j].second];
				arc_angles[n] = angles[j].first;
				next[n] = n + 1;
				prev[n] = n - 1;
				n++;
			}
		}
		VectorCopy (wnext->leftspot, arc_spots[n].spot);
		VectorCopy (wnext->leftdirection, arc_spots[n].direction);
		arc_angles[n] = angle;
		next[n] = -1;
		prev[n] = n - 1;
		n++;

		for (j = 1; next[j] != -1; j = next[j])
		{
			while (prev[j] != -1)
			{
				if (arc_angles[next[j]] - arc_angles[prev[j]] <= Q_PI + NORMAL_EPSILON)
				{
					frac = GetFrac (arc_spots[prev[j]].spot, arc_spots[next[j]].spot, arc_spots[j].direction, lt->normal);
					len = (1 - frac) * DotProduct (arc_spots[prev[j]].spot, arc_spots[j].direction)
						+ frac * DotProduct (arc_spots[next[j]].spot, arc_spots[j].direction);
					dist = DotProduct (arc_spots[j].spot, arc_spots[j].direction);
					if (dist <= len + NORMAL_EPSILON)
					{
						j = prev[j];
						next[j] = next[next[j]];
						prev[next[j]] = j;
						continue;
					}
				}
				break;
			}
		}

		for (j = 0; next[j] != -1; j = next[j])
		{
			lt->sortedhullpoints.push_back (arc_spots[j]);
		}
	}
}

// Assembly:
subq $0x278, %rsp            # imm = 0x278
movq %rdi, 0x270(%rsp)
leaq 0x220(%rsp), %rdi
movq %rdi, 0x148(%rsp)
callq 0x21bb0
leaq 0x208(%rsp), %rdi
callq 0x22530
leaq 0x1e0(%rsp), %rdi
callq 0x21bb0
leaq 0x1c8(%rsp), %rdi
callq 0x1ec50
leaq 0x1b0(%rsp), %rdi
callq 0x1f930
leaq 0x198(%rsp), %rdi
callq 0x1f930
movq 0x148(%rsp), %rdi
movq 0x270(%rsp), %rax
movl 0x20(%rax), %eax
movl %eax, %esi
callq 0x25a60
jmp 0x1cb31
xorl %eax, %eax
movl %eax, %esi
leaq 0x220(%rsp), %rdi
callq 0x25b70
jmp 0x1cb44
movl $0x0, 0x26c(%rsp)
movl 0x26c(%rsp), %eax
movq 0x270(%rsp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x1cdaf
movq 0x270(%rsp), %rax
movq 0x28(%rax), %rcx
movslq 0x26c(%rsp), %rdx
leaq (%rdx,%rdx,2), %rdx
movss (%rcx,%rdx,4), %xmm0
movss 0x38(%rax), %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x258(%rsp)
movq 0x270(%rsp), %rax
movq 0x28(%rax), %rcx
movslq 0x26c(%rsp), %rdx
leaq (%rdx,%rdx,2), %rdx
movss 0x4(%rcx,%rdx,4), %xmm0
movss 0x3c(%rax), %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x25c(%rsp)
movq 0x270(%rsp), %rax
movq 0x28(%rax), %rcx
movslq 0x26c(%rsp), %rdx
leaq (%rdx,%rdx,2), %rdx
movss 0x8(%rcx,%rdx,4), %xmm0
movss 0x40(%rax), %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x260(%rsp)
movq 0x270(%rsp), %rax
movss 0x258(%rsp), %xmm1
movss 0x25c(%rsp), %xmm0
movss 0x44(%rax), %xmm2
movss 0x48(%rax), %xmm3
mulss %xmm3, %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movss 0x260(%rsp), %xmm0
movss 0x4c(%rax), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x254(%rsp)
movss 0x258(%rsp), %xmm0
movss 0x254(%rsp), %xmm1
movq 0x270(%rsp), %rax
movss 0x44(%rax), %xmm2
mulss %xmm2, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x238(%rsp)
movss 0x25c(%rsp), %xmm0
movss 0x254(%rsp), %xmm1
movq 0x270(%rsp), %rax
movss 0x48(%rax), %xmm2
mulss %xmm2, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x23c(%rsp)
movss 0x260(%rsp), %xmm0
movss 0x254(%rsp), %xmm1
movq 0x270(%rsp), %rax
movss 0x4c(%rax), %xmm2
mulss %xmm2, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x240(%rsp)
movq 0x270(%rsp), %rsi
addq $0x44, %rsi
leaq 0x244(%rsp), %rdx
leaq 0x238(%rsp), %rdi
callq 0x18680
movss %xmm0, 0x144(%rsp)
jmp 0x1cd01
movss 0x144(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x1cd80
jp 0x1cd80
jmp 0x1cd99
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x180(%rsp)
movl %eax, 0x17c(%rsp)
leaq 0x198(%rsp), %rdi
callq 0x25880
leaq 0x1b0(%rsp), %rdi
callq 0x25880
leaq 0x1c8(%rsp), %rdi
callq 0x1f200
leaq 0x1e0(%rsp), %rdi
callq 0x25ca0
leaq 0x208(%rsp), %rdi
callq 0x227b0
leaq 0x220(%rsp), %rdi
callq 0x25ca0
jmp 0x1dfdf
leaq 0x220(%rsp), %rdi
leaq 0x238(%rsp), %rsi
callq 0x25c10
jmp 0x1cd97
jmp 0x1cd99
movl 0x26c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x26c(%rsp)
jmp 0x1cb4f
movq 0x270(%rsp), %rdi
addq $0x70, %rdi
callq 0x1f6c0
cmpl $0x0, %eax
jne 0x1d081
leaq 0x220(%rsp), %rdi
callq 0x1f660
movslq %eax, %rsi
leaq 0x208(%rsp), %rdi
callq 0x22650
jmp 0x1cde8
movl $0x0, 0x26c(%rsp)
movl 0x26c(%rsp), %eax
movl %eax, 0x140(%rsp)
leaq 0x220(%rsp), %rdi
callq 0x1f660
movq %rax, %rcx
movl 0x140(%rsp), %eax
cmpl %ecx, %eax
jge 0x1cf2c
xorl %eax, %eax
movl %eax, %esi
leaq 0x220(%rsp), %rdi
movq %rdi, 0x128(%rsp)
callq 0x25c80
movq 0x128(%rsp), %rdi
addq $0xc, %rax
movq %rax, 0x130(%rsp)
movslq 0x26c(%rsp), %rsi
callq 0x25c80
movq 0x130(%rsp), %rdi
movq %rax, %rsi
addq $0xc, %rsi
movq 0x270(%rsp), %rdx
addq $0x44, %rdx
callq 0x187a0
movss %xmm0, 0x13c(%rsp)
jmp 0x1ce85
movss 0x13c(%rsp), %xmm0
movss %xmm0, 0x250(%rsp)
cmpl $0x0, 0x26c(%rsp)
jne 0x1cead
xorps %xmm0, %xmm0
movss %xmm0, 0x250(%rsp)
movss 0x250(%rsp), %xmm0
xorps %xmm1, %xmm1
callq 0x18920
movss %xmm0, 0x120(%rsp)
movslq 0x26c(%rsp), %rsi
leaq 0x208(%rsp), %rdi
callq 0x226f0
movss 0x120(%rsp), %xmm0
movss %xmm0, (%rax)
movl 0x26c(%rsp), %eax
movl %eax, 0x124(%rsp)
movslq 0x26c(%rsp), %rsi
leaq 0x208(%rsp), %rdi
callq 0x226f0
movl 0x124(%rsp), %ecx
movl %ecx, 0x4(%rax)
movl 0x26c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x26c(%rsp)
jmp 0x1cdf3
leaq 0x208(%rsp), %rdi
movq %rdi, 0x118(%rsp)
callq 0x22750
movq 0x118(%rsp), %rdi
movq %rax, 0x170(%rsp)
callq 0x22780
movq %rax, 0x168(%rsp)
movq 0x170(%rsp), %rdi
movq 0x168(%rsp), %rsi
callq 0x22710
jmp 0x1cf75
movq 0x270(%rsp), %rdi
addq $0x88, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x25b70
jmp 0x1cf8f
movl $0x0, 0x26c(%rsp)
movl 0x26c(%rsp), %eax
movl %eax, 0x114(%rsp)
leaq 0x220(%rsp), %rdi
callq 0x1f660
movq %rax, %rcx
movl 0x114(%rsp), %eax
cmpl %ecx, %eax
jge 0x1d071
leaq 0x5512a93(%rip), %rax   # 0x552fa61
testb $0x1, (%rax)
je 0x1d00b
movslq 0x26c(%rsp), %rsi
leaq 0x208(%rsp), %rdi
callq 0x226f0
movl 0x4(%rax), %eax
cmpl 0x26c(%rsp), %eax
je 0x1d00b
leaq 0x50b5b(%rip), %rsi     # 0x6db56
xorl %eax, %eax
movl $0x5, %edi
callq 0xbbf0
jmp 0x1d009
jmp 0x1d00b
movq 0x270(%rsp), %rax
addq $0x88, %rax
movq %rax, 0x108(%rsp)
movslq 0x26c(%rsp), %rsi
leaq 0x208(%rsp), %rdi
callq 0x226f0
movslq 0x4(%rax), %rsi
leaq 0x220(%rsp), %rdi
callq 0x25c80
movq 0x108(%rsp), %rdi
movq %rax, %rsi
callq 0x25c10
jmp 0x1d059
jmp 0x1d05b
movl 0x26c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x26c(%rsp)
jmp 0x1cf9a
movl $0x1, 0x164(%rsp)
jmp 0x1df89
movq 0x270(%rsp), %rdi
addq $0x88, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x25b70
jmp 0x1d09b
movl $0x0, 0x26c(%rsp)
movl 0x26c(%rsp), %eax
movl %eax, 0x104(%rsp)
movq 0x270(%rsp), %rdi
addq $0x70, %rdi
callq 0x1f6c0
movq %rax, %rcx
movl 0x104(%rsp), %eax
cmpl %ecx, %eax
jge 0x1df7e
movq 0x270(%rsp), %rdi
addq $0x70, %rdi
movslq 0x26c(%rsp), %rsi
callq 0x21b80
movq %rax, 0x200(%rsp)
movq 0x270(%rsp), %rdi
addq $0x70, %rdi
movq %rdi, 0xf8(%rsp)
movl 0x26c(%rsp), %eax
incl %eax
movl %eax, 0x100(%rsp)
callq 0x1f6c0
movq 0xf8(%rsp), %rdi
movq %rax, %rcx
movl 0x100(%rsp), %eax
cltd
idivl %ecx
movslq %edx, %rsi
callq 0x21b80
movq %rax, 0x1f8(%rsp)
leaq 0x220(%rsp), %rdi
callq 0x1f660
movslq %eax, %rsi
leaq 0x208(%rsp), %rdi
callq 0x22650
jmp 0x1d165
movl $0x0, 0x268(%rsp)
movl 0x268(%rsp), %eax
movl %eax, 0xf4(%rsp)
leaq 0x220(%rsp), %rdi
callq 0x1f660
movq %rax, %rcx
movl 0xf4(%rsp), %eax
cmpl %ecx, %eax
jge 0x1d282
movq 0x200(%rsp), %rax
addq $0x14, %rax
movq %rax, 0xe8(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x220(%rsp), %rdi
callq 0x25c80
movq 0xe8(%rsp), %rdi
movq %rax, %rsi
addq $0xc, %rsi
movq 0x270(%rsp), %rdx
addq $0x44, %rdx
callq 0x187a0
movss %xmm0, 0xf0(%rsp)
jmp 0x1d1f1
movss 0xf0(%rsp), %xmm0
movss %xmm0, 0x250(%rsp)
movss 0x250(%rsp), %xmm0
xorps %xmm1, %xmm1
callq 0x18920
movss %xmm0, 0xe0(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x208(%rsp), %rdi
callq 0x226f0
movss 0xe0(%rsp), %xmm0
movss %xmm0, (%rax)
movl 0x268(%rsp), %eax
movl %eax, 0xe4(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x208(%rsp), %rdi
callq 0x226f0
movl 0xe4(%rsp), %ecx
movl %ecx, 0x4(%rax)
movl 0x268(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x268(%rsp)
jmp 0x1d170
leaq 0x208(%rsp), %rdi
movq %rdi, 0xd8(%rsp)
callq 0x22750
movq 0xd8(%rsp), %rdi
movq %rax, 0x158(%rsp)
callq 0x22780
movq %rax, 0x150(%rsp)
movq 0x158(%rsp), %rdi
movq 0x150(%rsp), %rsi
callq 0x22710
jmp 0x1d2cb
movq 0x200(%rsp), %rdi
addq $0x14, %rdi
movq 0x1f8(%rsp), %rsi
addq $0x14, %rsi
movq 0x270(%rsp), %rdx
addq $0x44, %rdx
callq 0x187a0
movss %xmm0, 0xd4(%rsp)
jmp 0x1d2ff
movss 0xd4(%rsp), %xmm0
movss %xmm0, 0x250(%rsp)
movq 0x270(%rsp), %rdi
addq $0x70, %rdi
callq 0x1f6c0
cmpl $0x1, %eax
jne 0x1d33a
movss 0x504a1(%rip), %xmm0    # 0x6d7d0
movss %xmm0, 0x250(%rsp)
jmp 0x1d354
movss 0x250(%rsp), %xmm0
xorps %xmm1, %xmm1
callq 0x18920
movss %xmm0, 0x250(%rsp)
leaq 0x220(%rsp), %rdi
callq 0x1f660
addl $0x2, %eax
movslq %eax, %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25b70
jmp 0x1d376
leaq 0x220(%rsp), %rdi
callq 0x1f660
addl $0x2, %eax
movslq %eax, %rsi
leaq 0x1c8(%rsp), %rdi
callq 0x1eda0
jmp 0x1d398
leaq 0x220(%rsp), %rdi
callq 0x1f660
addl $0x2, %eax
movslq %eax, %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x1fb10
jmp 0x1d3ba
leaq 0x220(%rsp), %rdi
callq 0x1f660
addl $0x2, %eax
movslq %eax, %rsi
leaq 0x198(%rsp), %rdi
callq 0x1fb10
jmp 0x1d3dc
movq 0x200(%rsp), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, 0xbc(%rsp)
leaq 0x1e0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x25c80
movss 0xbc(%rsp), %xmm0
movss %xmm0, (%rax)
movq 0x200(%rsp), %rax
movss 0xc(%rax), %xmm0
movss %xmm0, 0xc0(%rsp)
leaq 0x1e0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x25c80
movss 0xc0(%rsp), %xmm0
movss %xmm0, 0x4(%rax)
movq 0x200(%rsp), %rax
movss 0x10(%rax), %xmm0
movss %xmm0, 0xc4(%rsp)
leaq 0x1e0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x25c80
movss 0xc4(%rsp), %xmm0
movss %xmm0, 0x8(%rax)
movq 0x200(%rsp), %rax
movss 0x14(%rax), %xmm0
movss %xmm0, 0xc8(%rsp)
leaq 0x1e0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x25c80
movss 0xc8(%rsp), %xmm0
movss %xmm0, 0xc(%rax)
movq 0x200(%rsp), %rax
movss 0x18(%rax), %xmm0
movss %xmm0, 0xcc(%rsp)
leaq 0x1e0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x25c80
movss 0xcc(%rsp), %xmm0
movss %xmm0, 0x10(%rax)
movq 0x200(%rsp), %rax
movss 0x1c(%rax), %xmm0
movss %xmm0, 0xd0(%rsp)
leaq 0x1e0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x25c80
movss 0xd0(%rsp), %xmm0
movss %xmm0, 0x14(%rax)
leaq 0x1c8(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f160
xorps %xmm0, %xmm0
movss %xmm0, (%rax)
leaq 0x1b0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1fc20
movl $0x1, (%rax)
leaq 0x198(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1fc20
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl $0x1, 0x264(%rsp)
movl $0x0, 0x268(%rsp)
movl 0x268(%rsp), %eax
movl %eax, 0xb8(%rsp)
leaq 0x220(%rsp), %rdi
callq 0x1f660
movq %rax, %rcx
movl 0xb8(%rsp), %eax
cmpl %ecx, %eax
jge 0x1d73d
movslq 0x268(%rsp), %rsi
leaq 0x208(%rsp), %rdi
callq 0x226f0
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x4caa1(%rip), %xmm1    # 0x6a068
ucomisd %xmm1, %xmm0
jb 0x1d725
movslq 0x268(%rsp), %rsi
leaq 0x208(%rsp), %rdi
callq 0x226f0
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm1
movss 0x250(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x4ca65(%rip), %xmm2    # 0x6a068
subsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0x1d725
movslq 0x268(%rsp), %rsi
leaq 0x208(%rsp), %rdi
callq 0x226f0
movslq 0x4(%rax), %rsi
leaq 0x220(%rsp), %rdi
callq 0x25c80
movq %rax, 0xa0(%rsp)
movslq 0x264(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movq 0xa0(%rsp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
movslq 0x268(%rsp), %rsi
leaq 0x208(%rsp), %rdi
callq 0x226f0
movss (%rax), %xmm0
movss %xmm0, 0xac(%rsp)
movslq 0x264(%rsp), %rsi
leaq 0x1c8(%rsp), %rdi
callq 0x1f160
movss 0xac(%rsp), %xmm0
movss %xmm0, (%rax)
movl 0x264(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb0(%rsp)
movslq 0x264(%rsp), %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x1fc20
movl 0xb0(%rsp), %ecx
movl %ecx, (%rax)
movl 0x264(%rsp), %eax
subl $0x1, %eax
movl %eax, 0xb4(%rsp)
movslq 0x264(%rsp), %rsi
leaq 0x198(%rsp), %rdi
callq 0x1fc20
movl 0xb4(%rsp), %ecx
movl %ecx, (%rax)
movl 0x264(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x264(%rsp)
jmp 0x1d727
movl 0x268(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x268(%rsp)
jmp 0x1d575
movq 0x1f8(%rsp), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, 0x80(%rsp)
movslq 0x264(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0x80(%rsp), %xmm0
movss %xmm0, (%rax)
movq 0x1f8(%rsp), %rax
movss 0xc(%rax), %xmm0
movss %xmm0, 0x84(%rsp)
movslq 0x264(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0x84(%rsp), %xmm0
movss %xmm0, 0x4(%rax)
movq 0x1f8(%rsp), %rax
movss 0x10(%rax), %xmm0
movss %xmm0, 0x88(%rsp)
movslq 0x264(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0x88(%rsp), %xmm0
movss %xmm0, 0x8(%rax)
movq 0x1f8(%rsp), %rax
movss 0x14(%rax), %xmm0
movss %xmm0, 0x8c(%rsp)
movslq 0x264(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0x8c(%rsp), %xmm0
movss %xmm0, 0xc(%rax)
movq 0x1f8(%rsp), %rax
movss 0x18(%rax), %xmm0
movss %xmm0, 0x90(%rsp)
movslq 0x264(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0x90(%rsp), %xmm0
movss %xmm0, 0x10(%rax)
movq 0x1f8(%rsp), %rax
movss 0x1c(%rax), %xmm0
movss %xmm0, 0x94(%rsp)
movslq 0x264(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0x94(%rsp), %xmm0
movss %xmm0, 0x14(%rax)
movss 0x250(%rsp), %xmm0
movss %xmm0, 0x98(%rsp)
movslq 0x264(%rsp), %rsi
leaq 0x1c8(%rsp), %rdi
callq 0x1f160
movss 0x98(%rsp), %xmm0
movss %xmm0, (%rax)
movslq 0x264(%rsp), %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x1fc20
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl 0x264(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x9c(%rsp)
movslq 0x264(%rsp), %rsi
leaq 0x198(%rsp), %rdi
callq 0x1fc20
movl 0x9c(%rsp), %ecx
movl %ecx, (%rax)
movl 0x264(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x264(%rsp)
movl $0x1, 0x268(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x1fc20
cmpl $-0x1, (%rax)
je 0x1dee8
jmp 0x1d94c
movslq 0x268(%rsp), %rsi
leaq 0x198(%rsp), %rdi
callq 0x1fc20
cmpl $-0x1, (%rax)
je 0x1dec3
movslq 0x268(%rsp), %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x1c8(%rsp), %rdi
callq 0x1f160
movss (%rax), %xmm0
movss %xmm0, 0x7c(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x198(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x1c8(%rsp), %rdi
callq 0x1f160
movss 0x7c(%rsp), %xmm0
subss (%rax), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x4fe4c(%rip), %xmm0    # 0x6d820
ucomisd %xmm1, %xmm0
jb 0x1dec1
movslq 0x268(%rsp), %rsi
leaq 0x198(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x1e0(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0x25c80
movq %rax, 0x68(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x1fc20
movq 0x60(%rsp), %rdi
movslq (%rax), %rsi
callq 0x25c80
movq 0x60(%rsp), %rdi
movq %rax, 0x70(%rsp)
movslq 0x268(%rsp), %rsi
callq 0x25c80
movq 0x68(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq %rax, %rdx
addq $0xc, %rdx
movq 0x270(%rsp), %rcx
addq $0x44, %rcx
callq 0x18970
movss %xmm0, 0x78(%rsp)
jmp 0x1da70
movss 0x78(%rsp), %xmm0
movss %xmm0, 0x194(%rsp)
movss 0x4c5c5(%rip), %xmm0    # 0x6a04c
subss 0x194(%rsp), %xmm0
movss %xmm0, 0x44(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x198(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss (%rax), %xmm0
movss %xmm0, 0x1c(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0xc(%rax), %xmm0
movss %xmm0, 0x20(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x198(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0x4(%rax), %xmm0
movss %xmm0, 0x18(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0x18(%rsp), %xmm1
movss 0x1c(%rsp), %xmm0
movss 0x20(%rsp), %xmm2
mulss 0x10(%rax), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x28(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x198(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0x8(%rax), %xmm0
movss %xmm0, 0x24(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0x24(%rsp), %xmm0
movss 0x28(%rsp), %xmm1
movss 0x14(%rax), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x48(%rsp)
movss 0x194(%rsp), %xmm0
movss %xmm0, 0x40(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss (%rax), %xmm0
movss %xmm0, 0x30(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0xc(%rax), %xmm0
movss %xmm0, 0x34(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0x4(%rax), %xmm0
movss %xmm0, 0x2c(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0x2c(%rsp), %xmm1
movss 0x30(%rsp), %xmm0
movss 0x34(%rsp), %xmm2
mulss 0x10(%rax), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x3c(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0x8(%rax), %xmm0
movss %xmm0, 0x38(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0x38(%rsp), %xmm3
movss 0x3c(%rsp), %xmm4
movss 0x40(%rsp), %xmm1
movss 0x44(%rsp), %xmm0
movss 0x48(%rsp), %xmm2
movss 0x14(%rax), %xmm5
mulss %xmm5, %xmm3
addss %xmm4, %xmm3
mulss %xmm3, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x190(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss (%rax), %xmm0
movss %xmm0, 0x50(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0xc(%rax), %xmm0
movss %xmm0, 0x54(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0x4(%rax), %xmm0
movss %xmm0, 0x4c(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0x4c(%rsp), %xmm1
movss 0x50(%rsp), %xmm0
movss 0x54(%rsp), %xmm2
mulss 0x10(%rax), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x5c(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0x8(%rax), %xmm0
movss %xmm0, 0x58(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movss 0x58(%rsp), %xmm0
movss 0x5c(%rsp), %xmm1
movss 0x14(%rax), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x18c(%rsp)
movss 0x18c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm1
movss 0x190(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x4c256(%rip), %xmm2    # 0x6a068
addsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0x1debf
movslq 0x268(%rsp), %rsi
leaq 0x198(%rsp), %rdi
callq 0x1fc20
movl (%rax), %eax
movl %eax, 0x268(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x1fc20
movl (%rax), %eax
movl %eax, 0x10(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x1fc20
movl 0x10(%rsp), %ecx
movl %ecx, (%rax)
movl 0x268(%rsp), %eax
movl %eax, 0x14(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x1fc20
movslq (%rax), %rsi
leaq 0x198(%rsp), %rdi
callq 0x1fc20
movl 0x14(%rsp), %ecx
movl %ecx, (%rax)
jmp 0x1d94c
jmp 0x1dec1
jmp 0x1dec3
jmp 0x1dec5
movslq 0x268(%rsp), %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x1fc20
movl (%rax), %eax
movl %eax, 0x268(%rsp)
jmp 0x1d92c
movl $0x0, 0x268(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x1fc20
cmpl $-0x1, (%rax)
je 0x1df66
movq 0x270(%rsp), %rax
addq $0x88, %rax
movq %rax, 0x8(%rsp)
movslq 0x268(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x25c80
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x25c10
jmp 0x1df44
jmp 0x1df46
movslq 0x268(%rsp), %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x1fc20
movl (%rax), %eax
movl %eax, 0x268(%rsp)
jmp 0x1def3
jmp 0x1df68
movl 0x26c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x26c(%rsp)
jmp 0x1d0a6
movl $0x0, 0x164(%rsp)
leaq 0x198(%rsp), %rdi
callq 0x25880
leaq 0x1b0(%rsp), %rdi
callq 0x25880
leaq 0x1c8(%rsp), %rdi
callq 0x1f200
leaq 0x1e0(%rsp), %rdi
callq 0x25ca0
leaq 0x208(%rsp), %rdi
callq 0x227b0
leaq 0x220(%rsp), %rdi
callq 0x25ca0
addq $0x278, %rsp            # imm = 0x278
retq
movq 0x180(%rsp), %rdi
callq 0x45c0
nopl (%rax)