// File: FreeSlave[P]vhlt/hlrad/lerp.cpp
// Function: CalcInterpolation(localtriangulation_t const*, float const*, interpolation_t*)
static void CalcInterpolation (const localtriangulation_t *lt, const vec3_t spot, interpolation_t *interp)
	// The interpolation function is defined over the entire plane, so CalcInterpolation never fails.
{
	vec3_t direction;
	const localtriangulation_t::Wedge *w;
	const localtriangulation_t::Wedge *wnext;

	int i;
	int j;
	vec_t angle;
	std::vector< vec_t > angles;

	if (GetDirection (spot, lt->normal, direction) <= 2 * ON_EPSILON)
	{
		// spot happens to be at the center
		interp->isbiased = false;
		interp->totalweight = 1.0;
		interp->points.resize (1);
		interp->points[0].patchnum = lt->patchnum;
		interp->points[0].weight = 1.0;
		return;
	}

	if ((int)lt->sortedwedges.size () == 0) // this local triangulation only has center patch
	{
		interp->isbiased = true;
		interp->totalweight = 1.0;
		interp->points.resize (1);
		interp->points[0].patchnum = lt->patchnum;
		interp->points[0].weight = 1.0;
		return;
	}
	
	// Find the wedge with minimum non-negative angle (counterclockwise) pass the spot
	angles.resize ((int)lt->sortedwedges.size ());
	for (i = 0; i < (int)lt->sortedwedges.size (); i++)
	{
		angle = GetAngle (lt->sortedwedges[i].leftdirection, direction, lt->normal);
		angles[i] = GetAngleDiff (angle, 0);
	}
	j = 0;
	for (i = 1; i < (int)lt->sortedwedges.size (); i++)
	{
		if (angles[i] < angles[j])
		{
			j = i;
		}
	}
	w = &lt->sortedwedges[j];
	wnext = &lt->sortedwedges[(j + 1) % (int)lt->sortedwedges.size ()];

	// Different wedge types have different interpolation methods
	switch (w->shape)
	{
#ifdef HLRAD_BILINEARINTERPOLATION
	case localtriangulation_t::Wedge::eSquareLeft:
	case localtriangulation_t::Wedge::eSquareRight:
#endif
	case localtriangulation_t::Wedge::eTriangular:
		// w->wedgenormal is undefined
		{
			vec_t frac;
			vec_t len;
			vec_t dist;
			bool istoofar;
			vec_t ratio;

			frac = GetFrac (w->leftspot, wnext->leftspot, direction, lt->normal);
			
			len = (1 - frac) * DotProduct (w->leftspot, direction) + frac * DotProduct (wnext->leftspot, direction);
			dist = DotProduct (spot, direction);
			if (len <= ON_EPSILON / 4 || dist > len + 2 * ON_EPSILON)
			{
				istoofar = true;
				ratio = 1.0;
			}
			else if (dist >= len - ON_EPSILON)
			{
				istoofar = false;
				ratio = 1.0;
			}
			else
			{
				istoofar = false;
				ratio = dist / len;
				ratio = qmax (0, qmin (ratio, 1));
			}

			if (istoofar)
			{
				interp->isbiased = true;
				interp->totalweight = 1.0;
				interp->points.resize (2);
				interp->points[0].patchnum = w->leftpatchnum;
				interp->points[0].weight = 1 - frac;
				interp->points[1].patchnum = wnext->leftpatchnum;
				interp->points[1].weight = frac;
			}
#ifdef HLRAD_BILINEARINTERPOLATION
			else if (w->shape == localtriangulation_t::Wedge::eSquareLeft)
			{
				i = w - &lt->sortedwedges[0];
				CalcInterpolation_Square (lt, i, spot, interp);
			}
			else if (w->shape == localtriangulation_t::Wedge::eSquareRight)
			{
				i = w - &lt->sortedwedges[0];
				i = (i - 1 + (int)lt->sortedwedges.size ()) % (int)lt->sortedwedges.size ();
				CalcInterpolation_Square (lt, i, spot, interp);
			}
#endif
			else
			{
				interp->isbiased = false;
				interp->totalweight = 1.0;
				interp->points.resize (3);
				interp->points[0].patchnum = lt->patchnum;
				interp->points[0].weight = 1 - ratio;
				interp->points[1].patchnum = w->leftpatchnum;
				interp->points[1].weight = ratio * (1 - frac);
				interp->points[2].patchnum = wnext->leftpatchnum;
				interp->points[2].weight = ratio * frac;
			}
		}
		break;
	case localtriangulation_t::Wedge::eConvex:
		// w->wedgenormal is the unit vector pointing from w->leftspot to wnext->leftspot
		{
			vec_t dot;
			vec_t dot1;
			vec_t dot2;
			vec_t frac;

			dot1 = DotProduct (w->leftspot, w->wedgenormal) - DotProduct (spot, w->wedgenormal);
			dot2 = DotProduct (wnext->leftspot, w->wedgenormal) - DotProduct (spot, w->wedgenormal);
			dot = 0 - DotProduct (spot, w->wedgenormal);
			// for eConvex type: dot1 < dot < dot2

			if (g_drawlerp && (dot1 > dot || dot > dot2))
			{
				Developer (DEVELOPER_LEVEL_SPAM, "Debug: triangulation: internal error 3.\n");
			}
			if (dot1 >= -NORMAL_EPSILON) // 0 <= dot1 < dot < dot2
			{
				interp->isbiased = true;
				interp->totalweight = 1.0;
				interp->points.resize (1);
				interp->points[0].patchnum = w->leftpatchnum;
				interp->points[0].weight = 1.0;
			}
			else if (dot2 <= NORMAL_EPSILON) // dot1 < dot < dot2 <= 0
			{
				interp->isbiased = true;
				interp->totalweight = 1.0;
				interp->points.resize (1);
				interp->points[0].patchnum = wnext->leftpatchnum;
				interp->points[0].weight = 1.0;
			}
			else if (dot > 0) // dot1 < 0 < dot < dot2
			{
				frac = dot1 / (dot1 - dot);
				frac = qmax (0, qmin (frac, 1));

				interp->isbiased = true;
				interp->totalweight = 1.0;
				interp->points.resize (2);
				interp->points[0].patchnum = w->leftpatchnum;
				interp->points[0].weight = 1 - frac;
				interp->points[1].patchnum = lt->patchnum;
				interp->points[1].weight = frac;
			}
			else // dot1 < dot <= 0 < dot2
			{
				frac = dot / (dot - dot2);
				frac = qmax (0, qmin (frac, 1));
			
				interp->isbiased = true;
				interp->totalweight = 1.0;
				interp->points.resize (2);
				interp->points[0].patchnum = lt->patchnum;
				interp->points[0].weight = 1 - frac;
				interp->points[1].patchnum = wnext->leftpatchnum;
				interp->points[1].weight = frac;
			}
		}
		break;
	case localtriangulation_t::Wedge::eConcave:
		{
			vec_t len;
			vec_t dist;
			vec_t ratio;

			if (DotProduct (spot, w->wedgenormal) < 0) // the spot is closer to the left edge than the right edge
			{
				len = DotProduct (w->leftspot, w->leftdirection);
				dist = DotProduct (spot, w->leftdirection);
				if (g_drawlerp && len <= ON_EPSILON)
				{
					Developer (DEVELOPER_LEVEL_SPAM, "Debug: triangulation: internal error 4.\n");
				}
				if (dist <= NORMAL_EPSILON)
				{
					interp->isbiased = true;
					interp->totalweight = 1.0;
					interp->points.resize (1);
					interp->points[0].patchnum = lt->patchnum;
					interp->points[0].weight = 1.0;
				}
				else if (dist >= len)
				{
					interp->isbiased = true;
					interp->totalweight = 1.0;
					interp->points.resize (1);
					interp->points[0].patchnum = w->leftpatchnum;
					interp->points[0].weight = 1.0;
				}
				else
				{
					ratio = dist / len;
					ratio = qmax (0, qmin (ratio, 1));

					interp->isbiased = true;
					interp->totalweight = 1.0;
					interp->points.resize (2);
					interp->points[0].patchnum = lt->patchnum;
					interp->points[0].weight = 1 - ratio;
					interp->points[1].patchnum = w->leftpatchnum;
					interp->points[1].weight = ratio;
				}
			}
			else // the spot is closer to the right edge than the left edge
			{
				len = DotProduct (wnext->leftspot, wnext->leftdirection);
				dist = DotProduct (spot, wnext->leftdirection);
				if (g_drawlerp && len <= ON_EPSILON)
				{
					Developer (DEVELOPER_LEVEL_SPAM, "Debug: triangulation: internal error 5.\n");
				}
				if (dist <= NORMAL_EPSILON)
				{
					interp->isbiased = true;
					interp->totalweight = 1.0;
					interp->points.resize (1);
					interp->points[0].patchnum = lt->patchnum;
					interp->points[0].weight = 1.0;
				}
				else if (dist >= len)
				{
					interp->isbiased = true;
					interp->totalweight = 1.0;
					interp->points.resize (1);
					interp->points[0].patchnum = wnext->leftpatchnum;
					interp->points[0].weight = 1.0;
				}
				else
				{
					ratio = dist / len;
					ratio = qmax (0, qmin (ratio, 1));

					interp->isbiased = true;
					interp->totalweight = 1.0;
					interp->points.resize (2);
					interp->points[0].patchnum = lt->patchnum;
					interp->points[0].weight = 1 - ratio;
					interp->points[1].patchnum = wnext->leftpatchnum;
					interp->points[1].weight = ratio;
				}
			}
		}
		break;
	default:
		Error ("CalcInterpolation: internal error: invalid wedge type.");
		break;
	}

// Assembly:
subq $0x1b8, %rsp            # imm = 0x1B8
movq %rdi, 0x1b0(%rsp)
movq %rsi, 0x1a8(%rsp)
movq %rdx, 0x1a0(%rsp)
leaq 0x158(%rsp), %rdi
callq 0x1ec50
movq 0x1a8(%rsp), %rdi
movq 0x1b0(%rsp), %rsi
addq $0x44, %rsi
leaq 0x194(%rsp), %rdx
callq 0x18680
movss %xmm0, 0x114(%rsp)
jmp 0x150f8
movss 0x114(%rsp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x586db(%rip), %xmm0    # 0x6d7e8
ucomisd %xmm1, %xmm0
jb 0x151d1
movq 0x1a0(%rsp), %rax
movb $0x0, (%rax)
movq 0x1a0(%rsp), %rax
movl $0x3f800000, 0x4(%rax)  # imm = 0x3F800000
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f040
jmp 0x15149
movq 0x1b0(%rsp), %rax
movl 0x50(%rax), %eax
movl %eax, 0x110(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movl 0x110(%rsp), %ecx
movl %ecx, (%rax)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movss 0x54eb6(%rip), %xmm0    # 0x6a04c
movss %xmm0, 0x4(%rax)
movl $0x1, 0x148(%rsp)
jmp 0x16b76
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x150(%rsp)
movl %eax, 0x14c(%rsp)
leaq 0x158(%rsp), %rdi
callq 0x1f200
jmp 0x16b8b
movq 0x1b0(%rsp), %rdi
addq $0x70, %rdi
callq 0x1f6c0
cmpl $0x0, %eax
jne 0x1527f
movq 0x1a0(%rsp), %rax
movb $0x1, (%rax)
movq 0x1a0(%rsp), %rax
movl $0x3f800000, 0x4(%rax)  # imm = 0x3F800000
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f040
jmp 0x1521d
movq 0x1b0(%rsp), %rax
movl 0x50(%rax), %eax
movl %eax, 0x10c(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movl 0x10c(%rsp), %ecx
movl %ecx, (%rax)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movss 0x54de2(%rip), %xmm0    # 0x6a04c
movss %xmm0, 0x4(%rax)
movl $0x1, 0x148(%rsp)
jmp 0x16b76
movq 0x1b0(%rsp), %rdi
addq $0x70, %rdi
callq 0x1f6c0
movslq %eax, %rsi
leaq 0x158(%rsp), %rdi
callq 0x1eda0
jmp 0x152a2
movl $0x0, 0x17c(%rsp)
movl 0x17c(%rsp), %eax
movl %eax, 0x108(%rsp)
movq 0x1b0(%rsp), %rdi
addq $0x70, %rdi
callq 0x1f6c0
movq %rax, %rcx
movl 0x108(%rsp), %eax
cmpl %ecx, %eax
jge 0x15386
movq 0x1b0(%rsp), %rdi
addq $0x70, %rdi
movslq 0x17c(%rsp), %rsi
callq 0x1f6e0
movq %rax, %rdi
addq $0x14, %rdi
movq 0x1b0(%rsp), %rdx
addq $0x44, %rdx
leaq 0x194(%rsp), %rsi
callq 0x187a0
movss %xmm0, 0x104(%rsp)
jmp 0x15322
movss 0x104(%rsp), %xmm0
movss %xmm0, 0x174(%rsp)
movss 0x174(%rsp), %xmm0
xorps %xmm1, %xmm1
callq 0x18920
movss %xmm0, 0x100(%rsp)
movslq 0x17c(%rsp), %rsi
leaq 0x158(%rsp), %rdi
callq 0x1f160
movss 0x100(%rsp), %xmm0
movss %xmm0, (%rax)
movl 0x17c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x17c(%rsp)
jmp 0x152ad
movl $0x0, 0x178(%rsp)
movl $0x1, 0x17c(%rsp)
movl 0x17c(%rsp), %eax
movl %eax, 0xfc(%rsp)
movq 0x1b0(%rsp), %rdi
addq $0x70, %rdi
callq 0x1f6c0
movq %rax, %rcx
movl 0xfc(%rsp), %eax
cmpl %ecx, %eax
jge 0x15438
movslq 0x17c(%rsp), %rsi
leaq 0x158(%rsp), %rdi
callq 0x1f160
movss (%rax), %xmm0
movss %xmm0, 0xf8(%rsp)
movslq 0x178(%rsp), %rsi
leaq 0x158(%rsp), %rdi
callq 0x1f160
movss 0xf8(%rsp), %xmm1
movss (%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x15420
movl 0x17c(%rsp), %eax
movl %eax, 0x178(%rsp)
jmp 0x15422
movl 0x17c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x17c(%rsp)
jmp 0x1539c
movq 0x1b0(%rsp), %rdi
addq $0x70, %rdi
movslq 0x178(%rsp), %rsi
callq 0x1f6e0
movq %rax, 0x188(%rsp)
movq 0x1b0(%rsp), %rdi
addq $0x70, %rdi
movq %rdi, 0xe0(%rsp)
movl 0x178(%rsp), %eax
incl %eax
movl %eax, 0xec(%rsp)
callq 0x1f6c0
movq 0xe0(%rsp), %rdi
movq %rax, %rcx
movl 0xec(%rsp), %eax
cltd
idivl %ecx
movslq %edx, %rsi
callq 0x1f6e0
movq %rax, 0x180(%rsp)
movq 0x188(%rsp), %rax
movl (%rax), %eax
movq %rax, 0xf0(%rsp)
subq $0x4, %rax
ja 0x16b59
movq 0xf0(%rsp), %rax
leaq 0x58386(%rip), %rcx     # 0x6d858
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x188(%rsp), %rdi
addq $0x8, %rdi
movq 0x180(%rsp), %rsi
addq $0x8, %rsi
movq 0x1b0(%rsp), %rcx
addq $0x44, %rcx
leaq 0x194(%rsp), %rdx
callq 0x18970
movss %xmm0, 0xdc(%rsp)
jmp 0x15517
movss 0xdc(%rsp), %xmm0
movss %xmm0, 0x144(%rsp)
movss 0x54b1b(%rip), %xmm0    # 0x6a04c
subss 0x144(%rsp), %xmm0
movq 0x188(%rsp), %rax
movss 0x8(%rax), %xmm1
movss 0x194(%rsp), %xmm3
movq 0x188(%rsp), %rax
movss 0xc(%rax), %xmm2
mulss 0x198(%rsp), %xmm2
mulss %xmm3, %xmm1
addss %xmm2, %xmm1
movq 0x188(%rsp), %rax
movss 0x10(%rax), %xmm2
movss 0x19c(%rsp), %xmm3
mulss %xmm3, %xmm2
addss %xmm1, %xmm2
movss 0x144(%rsp), %xmm1
movq 0x180(%rsp), %rax
movss 0x8(%rax), %xmm4
movss 0x194(%rsp), %xmm5
movq 0x180(%rsp), %rax
movss 0xc(%rax), %xmm3
mulss 0x198(%rsp), %xmm3
mulss %xmm5, %xmm4
addss %xmm3, %xmm4
movq 0x180(%rsp), %rax
movss 0x10(%rax), %xmm3
movss 0x19c(%rsp), %xmm5
mulss %xmm5, %xmm3
addss %xmm4, %xmm3
mulss %xmm3, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x140(%rsp)
movq 0x1a8(%rsp), %rax
movss (%rax), %xmm1
movss 0x194(%rsp), %xmm2
movq 0x1a8(%rsp), %rax
movss 0x4(%rax), %xmm0
mulss 0x198(%rsp), %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movq 0x1a8(%rsp), %rax
movss 0x8(%rax), %xmm0
movss 0x19c(%rsp), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x13c(%rsp)
movss 0x140(%rsp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x5816d(%rip), %xmm0    # 0x6d7d8
ucomisd %xmm1, %xmm0
jae 0x1569d
movss 0x13c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movss 0x140(%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x58155(%rip), %xmm2    # 0x6d7e8
addsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x156bb
movb $0x1, 0x13b(%rsp)
movss 0x5499f(%rip), %xmm0    # 0x6a04c
movss %xmm0, 0x134(%rsp)
jmp 0x157df
movss 0x13c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movss 0x140(%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x58103(%rip), %xmm2    # 0x6d7e0
subsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x15705
movb $0x0, 0x13b(%rsp)
movss 0x54955(%rip), %xmm0    # 0x6a04c
movss %xmm0, 0x134(%rsp)
jmp 0x157dd
movb $0x0, 0x13b(%rsp)
movss 0x13c(%rsp), %xmm0
divss 0x140(%rsp), %xmm0
movss %xmm0, 0x134(%rsp)
movss 0x5491c(%rip), %xmm0    # 0x6a04c
ucomiss 0x134(%rsp), %xmm0
jbe 0x1574e
movss 0x134(%rsp), %xmm0
movss %xmm0, 0xd8(%rsp)
jmp 0x15761
movss 0x548f6(%rip), %xmm0    # 0x6a04c
movss %xmm0, 0xd8(%rsp)
jmp 0x15761
movss 0xd8(%rsp), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x15780
xorps %xmm0, %xmm0
movss %xmm0, 0xd4(%rsp)
jmp 0x157cb
movss 0x548c4(%rip), %xmm0    # 0x6a04c
ucomiss 0x134(%rsp), %xmm0
jbe 0x157a6
movss 0x134(%rsp), %xmm0
movss %xmm0, 0xd0(%rsp)
jmp 0x157b9
movss 0x5489e(%rip), %xmm0    # 0x6a04c
movss %xmm0, 0xd0(%rsp)
jmp 0x157b9
movss 0xd0(%rsp), %xmm0
movss %xmm0, 0xd4(%rsp)
movss 0xd4(%rsp), %xmm0
movss %xmm0, 0x134(%rsp)
jmp 0x157df
testb $0x1, 0x13b(%rsp)
je 0x158f8
movq 0x1a0(%rsp), %rax
movb $0x1, (%rax)
movq 0x1a0(%rsp), %rax
movl $0x3f800000, 0x4(%rax)  # imm = 0x3F800000
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x2, %esi
callq 0x1f040
jmp 0x1581f
movq 0x188(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0xc0(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movl 0xc0(%rsp), %ecx
movl %ecx, (%rax)
movss 0x547f5(%rip), %xmm0    # 0x6a04c
subss 0x144(%rsp), %xmm0
movss %xmm0, 0xc4(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movss 0xc4(%rsp), %xmm0
movss %xmm0, 0x4(%rax)
movq 0x180(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0xc8(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f140
movl 0xc8(%rsp), %ecx
movl %ecx, (%rax)
movss 0x144(%rsp), %xmm0
movss %xmm0, 0xcc(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f140
movss 0xcc(%rsp), %xmm0
movss %xmm0, 0x4(%rax)
jmp 0x15bdf
movq 0x188(%rsp), %rax
cmpl $0x3, (%rax)
jne 0x15974
movq 0x188(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x1b0(%rsp), %rdi
addq $0x70, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f6e0
movq %rax, %rcx
movq 0xb8(%rsp), %rax
subq %rcx, %rax
shrq $0x2, %rax
imull $0xba2e8ba3, %eax, %eax # imm = 0xBA2E8BA3
movl %eax, 0x17c(%rsp)
movq 0x1b0(%rsp), %rdi
movl 0x17c(%rsp), %esi
movq 0x1a8(%rsp), %rdx
movq 0x1a0(%rsp), %rcx
callq 0x18c50
jmp 0x1596f
jmp 0x15bdd
movq 0x188(%rsp), %rax
cmpl $0x4, (%rax)
jne 0x15a50
movq 0x188(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0x1b0(%rsp), %rdi
addq $0x70, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f6e0
movq %rax, %rcx
movq 0xa8(%rsp), %rax
subq %rcx, %rax
shrq $0x2, %rax
imull $0xba2e8ba3, %eax, %eax # imm = 0xBA2E8BA3
movl %eax, 0x17c(%rsp)
movl 0x17c(%rsp), %eax
movl %eax, 0xb0(%rsp)
movq 0x1b0(%rsp), %rdi
addq $0x70, %rdi
callq 0x1f6c0
movl 0xb0(%rsp), %ecx
movl %eax, %edx
movl %ecx, %eax
movl %edx, %ecx
leal -0x1(%rax,%rcx), %eax
movl %eax, 0xb4(%rsp)
movq 0x1b0(%rsp), %rdi
addq $0x70, %rdi
callq 0x1f6c0
movq %rax, %rcx
movl 0xb4(%rsp), %eax
cltd
idivl %ecx
movl %edx, 0x17c(%rsp)
movq 0x1b0(%rsp), %rdi
movl 0x17c(%rsp), %esi
movq 0x1a8(%rsp), %rdx
movq 0x1a0(%rsp), %rcx
callq 0x18c50
jmp 0x15a4b
jmp 0x15bdb
movq 0x1a0(%rsp), %rax
movb $0x0, (%rax)
movq 0x1a0(%rsp), %rax
movl $0x3f800000, 0x4(%rax)  # imm = 0x3F800000
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x3, %esi
callq 0x1f040
jmp 0x15a82
movq 0x1b0(%rsp), %rax
movl 0x50(%rax), %eax
movl %eax, 0x90(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movl 0x90(%rsp), %ecx
movl %ecx, (%rax)
movss 0x54592(%rip), %xmm0    # 0x6a04c
subss 0x134(%rsp), %xmm0
movss %xmm0, 0x94(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movss 0x94(%rsp), %xmm0
movss %xmm0, 0x4(%rax)
movq 0x188(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x98(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f140
movl 0x98(%rsp), %ecx
movl %ecx, (%rax)
movss 0x134(%rsp), %xmm0
movss 0x5451b(%rip), %xmm1    # 0x6a04c
subss 0x144(%rsp), %xmm1
mulss %xmm1, %xmm0
movss %xmm0, 0x9c(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f140
movss 0x9c(%rsp), %xmm0
movss %xmm0, 0x4(%rax)
movq 0x180(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0xa0(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x2, %esi
callq 0x1f140
movl 0xa0(%rsp), %ecx
movl %ecx, (%rax)
movss 0x134(%rsp), %xmm0
mulss 0x144(%rsp), %xmm0
movss %xmm0, 0xa4(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x2, %esi
callq 0x1f140
movss 0xa4(%rsp), %xmm0
movss %xmm0, 0x4(%rax)
jmp 0x15bdd
jmp 0x15bdf
jmp 0x16b6b
movq 0x188(%rsp), %rax
movss 0x8(%rax), %xmm1
movq 0x188(%rsp), %rax
movss 0x20(%rax), %xmm2
movq 0x188(%rsp), %rax
movss 0xc(%rax), %xmm0
movq 0x188(%rsp), %rax
mulss 0x24(%rax), %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movq 0x188(%rsp), %rax
movss 0x10(%rax), %xmm0
movq 0x188(%rsp), %rax
movss 0x28(%rax), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq 0x1a8(%rsp), %rax
movss (%rax), %xmm2
movq 0x188(%rsp), %rax
movss 0x20(%rax), %xmm3
movq 0x1a8(%rsp), %rax
movss 0x4(%rax), %xmm1
movq 0x188(%rsp), %rax
mulss 0x24(%rax), %xmm1
mulss %xmm3, %xmm2
addss %xmm1, %xmm2
movq 0x1a8(%rsp), %rax
movss 0x8(%rax), %xmm1
movq 0x188(%rsp), %rax
movss 0x28(%rax), %xmm3
mulss %xmm3, %xmm1
addss %xmm2, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x12c(%rsp)
movq 0x180(%rsp), %rax
movss 0x8(%rax), %xmm1
movq 0x188(%rsp), %rax
movss 0x20(%rax), %xmm2
movq 0x180(%rsp), %rax
movss 0xc(%rax), %xmm0
movq 0x188(%rsp), %rax
mulss 0x24(%rax), %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movq 0x180(%rsp), %rax
movss 0x10(%rax), %xmm0
movq 0x188(%rsp), %rax
movss 0x28(%rax), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq 0x1a8(%rsp), %rax
movss (%rax), %xmm2
movq 0x188(%rsp), %rax
movss 0x20(%rax), %xmm3
movq 0x1a8(%rsp), %rax
movss 0x4(%rax), %xmm1
movq 0x188(%rsp), %rax
mulss 0x24(%rax), %xmm1
mulss %xmm3, %xmm2
addss %xmm1, %xmm2
movq 0x1a8(%rsp), %rax
movss 0x8(%rax), %xmm1
movq 0x188(%rsp), %rax
movss 0x28(%rax), %xmm3
mulss %xmm3, %xmm1
addss %xmm2, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x128(%rsp)
movq 0x1a8(%rsp), %rax
movss (%rax), %xmm0
movq 0x188(%rsp), %rax
movss 0x20(%rax), %xmm2
movq 0x1a8(%rsp), %rax
movss 0x4(%rax), %xmm1
movq 0x188(%rsp), %rax
mulss 0x24(%rax), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq 0x1a8(%rsp), %rax
movss 0x8(%rax), %xmm1
movq 0x188(%rsp), %rax
movss 0x28(%rax), %xmm2
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
xorps %xmm0, %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0x130(%rsp)
leaq 0x5519c79(%rip), %rax   # 0x552fa61
testb $0x1, (%rax)
je 0x15e2a
movss 0x12c(%rsp), %xmm0
ucomiss 0x130(%rsp), %xmm0
ja 0x15e13
movss 0x130(%rsp), %xmm0
ucomiss 0x128(%rsp), %xmm0
jbe 0x15e2a
leaq 0x57b26(%rip), %rsi     # 0x6d940
xorl %eax, %eax
movl $0x5, %edi
callq 0xbbf0
jmp 0x15e28
jmp 0x15e2a
movss 0x12c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x579b1(%rip), %xmm1    # 0x6d7f0
ucomisd %xmm1, %xmm0
jb 0x15ed2
movq 0x1a0(%rsp), %rax
movb $0x1, (%rax)
movq 0x1a0(%rsp), %rax
movl $0x3f800000, 0x4(%rax)  # imm = 0x3F800000
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f040
jmp 0x15e7b
movq 0x188(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x8c(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movl 0x8c(%rsp), %ecx
movl %ecx, (%rax)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movss 0x54184(%rip), %xmm0    # 0x6a04c
movss %xmm0, 0x4(%rax)
jmp 0x1630a
movss 0x128(%rsp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x54181(%rip), %xmm0    # 0x6a068
ucomisd %xmm1, %xmm0
jb 0x15f7a
movq 0x1a0(%rsp), %rax
movb $0x1, (%rax)
movq 0x1a0(%rsp), %rax
movl $0x3f800000, 0x4(%rax)  # imm = 0x3F800000
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f040
jmp 0x15f23
movq 0x180(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x88(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movl 0x88(%rsp), %ecx
movl %ecx, (%rax)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movss 0x540dc(%rip), %xmm0    # 0x6a04c
movss %xmm0, 0x4(%rax)
jmp 0x16308
movss 0x130(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x16156
movss 0x12c(%rsp), %xmm0
movss 0x12c(%rsp), %xmm1
subss 0x130(%rsp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, 0x124(%rsp)
movss 0x5408d(%rip), %xmm0    # 0x6a04c
ucomiss 0x124(%rsp), %xmm0
jbe 0x15fdd
movss 0x124(%rsp), %xmm0
movss %xmm0, 0x84(%rsp)
jmp 0x15ff0
movss 0x54067(%rip), %xmm0    # 0x6a04c
movss %xmm0, 0x84(%rsp)
jmp 0x15ff0
movss 0x84(%rsp), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x1600f
xorps %xmm0, %xmm0
movss %xmm0, 0x80(%rsp)
jmp 0x16051
movss 0x54035(%rip), %xmm0    # 0x6a04c
ucomiss 0x124(%rsp), %xmm0
jbe 0x16032
movss 0x124(%rsp), %xmm0
movss %xmm0, 0x7c(%rsp)
jmp 0x16042
movss 0x54012(%rip), %xmm0    # 0x6a04c
movss %xmm0, 0x7c(%rsp)
jmp 0x16042
movss 0x7c(%rsp), %xmm0
movss %xmm0, 0x80(%rsp)
movss 0x80(%rsp), %xmm0
movss %xmm0, 0x124(%rsp)
movq 0x1a0(%rsp), %rax
movb $0x1, (%rax)
movq 0x1a0(%rsp), %rax
movl $0x3f800000, 0x4(%rax)  # imm = 0x3F800000
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x2, %esi
callq 0x1f040
jmp 0x16095
movq 0x188(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x6c(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movl 0x6c(%rsp), %ecx
movl %ecx, (%rax)
movss 0x53f85(%rip), %xmm0    # 0x6a04c
subss 0x124(%rsp), %xmm0
movss %xmm0, 0x70(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movss 0x70(%rsp), %xmm0
movss %xmm0, 0x4(%rax)
movq 0x1b0(%rsp), %rax
movl 0x50(%rax), %eax
movl %eax, 0x74(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f140
movl 0x74(%rsp), %ecx
movl %ecx, (%rax)
movss 0x124(%rsp), %xmm0
movss %xmm0, 0x78(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f140
movss 0x78(%rsp), %xmm0
movss %xmm0, 0x4(%rax)
jmp 0x16306
movss 0x130(%rsp), %xmm0
movss 0x130(%rsp), %xmm1
subss 0x128(%rsp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, 0x124(%rsp)
movss 0x53ec6(%rip), %xmm0    # 0x6a04c
ucomiss 0x124(%rsp), %xmm0
jbe 0x161a1
movss 0x124(%rsp), %xmm0
movss %xmm0, 0x68(%rsp)
jmp 0x161b1
movss 0x53ea3(%rip), %xmm0    # 0x6a04c
movss %xmm0, 0x68(%rsp)
jmp 0x161b1
movss 0x68(%rsp), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x161ca
xorps %xmm0, %xmm0
movss %xmm0, 0x64(%rsp)
jmp 0x16209
movss 0x53e7a(%rip), %xmm0    # 0x6a04c
ucomiss 0x124(%rsp), %xmm0
jbe 0x161ed
movss 0x124(%rsp), %xmm0
movss %xmm0, 0x60(%rsp)
jmp 0x161fd
movss 0x53e57(%rip), %xmm0    # 0x6a04c
movss %xmm0, 0x60(%rsp)
jmp 0x161fd
movss 0x60(%rsp), %xmm0
movss %xmm0, 0x64(%rsp)
movss 0x64(%rsp), %xmm0
movss %xmm0, 0x124(%rsp)
movq 0x1a0(%rsp), %rax
movb $0x1, (%rax)
movq 0x1a0(%rsp), %rax
movl $0x3f800000, 0x4(%rax)  # imm = 0x3F800000
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x2, %esi
callq 0x1f040
jmp 0x1624a
movq 0x1b0(%rsp), %rax
movl 0x50(%rax), %eax
movl %eax, 0x50(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movl 0x50(%rsp), %ecx
movl %ecx, (%rax)
movss 0x53dd0(%rip), %xmm0    # 0x6a04c
subss 0x124(%rsp), %xmm0
movss %xmm0, 0x54(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movss 0x54(%rsp), %xmm0
movss %xmm0, 0x4(%rax)
movq 0x180(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x58(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f140
movl 0x58(%rsp), %ecx
movl %ecx, (%rax)
movss 0x124(%rsp), %xmm0
movss %xmm0, 0x5c(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f140
movss 0x5c(%rsp), %xmm0
movss %xmm0, 0x4(%rax)
jmp 0x16308
jmp 0x1630a
jmp 0x16b6b
movq 0x1a8(%rsp), %rax
movss (%rax), %xmm0
movq 0x188(%rsp), %rax
movss 0x20(%rax), %xmm2
movq 0x1a8(%rsp), %rax
movss 0x4(%rax), %xmm1
movq 0x188(%rsp), %rax
mulss 0x24(%rax), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq 0x1a8(%rsp), %rax
movss 0x8(%rax), %xmm1
movq 0x188(%rsp), %rax
movss 0x28(%rax), %xmm2
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x16769
movq 0x188(%rsp), %rax
movss 0x8(%rax), %xmm1
movq 0x188(%rsp), %rax
movss 0x14(%rax), %xmm2
movq 0x188(%rsp), %rax
movss 0xc(%rax), %xmm0
movq 0x188(%rsp), %rax
mulss 0x18(%rax), %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movq 0x188(%rsp), %rax
movss 0x10(%rax), %xmm0
movq 0x188(%rsp), %rax
movss 0x1c(%rax), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x120(%rsp)
movq 0x1a8(%rsp), %rax
movss (%rax), %xmm1
movq 0x188(%rsp), %rax
movss 0x14(%rax), %xmm2
movq 0x1a8(%rsp), %rax
movss 0x4(%rax), %xmm0
movq 0x188(%rsp), %rax
mulss 0x18(%rax), %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movq 0x1a8(%rsp), %rax
movss 0x8(%rax), %xmm0
movq 0x188(%rsp), %rax
movss 0x1c(%rax), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x11c(%rsp)
leaq 0x5519615(%rip), %rax   # 0x552fa61
testb $0x1, (%rax)
je 0x16483
movss 0x120(%rsp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x5737a(%rip), %xmm0    # 0x6d7e0
ucomisd %xmm1, %xmm0
jb 0x16483
leaq 0x574f6(%rip), %rsi     # 0x6d969
xorl %eax, %eax
movl $0x5, %edi
callq 0xbbf0
jmp 0x16481
jmp 0x16483
movss 0x11c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x53bd0(%rip), %xmm0    # 0x6a068
ucomisd %xmm1, %xmm0
jb 0x16525
movq 0x1a0(%rsp), %rax
movb $0x1, (%rax)
movq 0x1a0(%rsp), %rax
movl $0x3f800000, 0x4(%rax)  # imm = 0x3F800000
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f040
jmp 0x164d4
movq 0x1b0(%rsp), %rax
movl 0x50(%rax), %eax
movl %eax, 0x4c(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movl 0x4c(%rsp), %ecx
movl %ecx, (%rax)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movss 0x53b31(%rip), %xmm0    # 0x6a04c
movss %xmm0, 0x4(%rax)
jmp 0x16764
movss 0x11c(%rsp), %xmm0
ucomiss 0x120(%rsp), %xmm0
jb 0x165bf
movq 0x1a0(%rsp), %rax
movb $0x1, (%rax)
movq 0x1a0(%rsp), %rax
movl $0x3f800000, 0x4(%rax)  # imm = 0x3F800000
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f040
jmp 0x1656e
movq 0x188(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x48(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movl 0x48(%rsp), %ecx
movl %ecx, (%rax)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movss 0x53a97(%rip), %xmm0    # 0x6a04c
movss %xmm0, 0x4(%rax)
jmp 0x16762
movss 0x11c(%rsp), %xmm0
divss 0x120(%rsp), %xmm0
movss %xmm0, 0x118(%rsp)
movss 0x53a6a(%rip), %xmm0    # 0x6a04c
ucomiss 0x118(%rsp), %xmm0
jbe 0x165fd
movss 0x118(%rsp), %xmm0
movss %xmm0, 0x44(%rsp)
jmp 0x1660d
movss 0x53a47(%rip), %xmm0    # 0x6a04c
movss %xmm0, 0x44(%rsp)
jmp 0x1660d
movss 0x44(%rsp), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x16626
xorps %xmm0, %xmm0
movss %xmm0, 0x40(%rsp)
jmp 0x16665
movss 0x53a1e(%rip), %xmm0    # 0x6a04c
ucomiss 0x118(%rsp), %xmm0
jbe 0x16649
movss 0x118(%rsp), %xmm0
movss %xmm0, 0x3c(%rsp)
jmp 0x16659
movss 0x539fb(%rip), %xmm0    # 0x6a04c
movss %xmm0, 0x3c(%rsp)
jmp 0x16659
movss 0x3c(%rsp), %xmm0
movss %xmm0, 0x40(%rsp)
movss 0x40(%rsp), %xmm0
movss %xmm0, 0x118(%rsp)
movq 0x1a0(%rsp), %rax
movb $0x1, (%rax)
movq 0x1a0(%rsp), %rax
movl $0x3f800000, 0x4(%rax)  # imm = 0x3F800000
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x2, %esi
callq 0x1f040
jmp 0x166a6
movq 0x1b0(%rsp), %rax
movl 0x50(%rax), %eax
movl %eax, 0x2c(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movl 0x2c(%rsp), %ecx
movl %ecx, (%rax)
movss 0x53974(%rip), %xmm0    # 0x6a04c
subss 0x118(%rsp), %xmm0
movss %xmm0, 0x30(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movss 0x30(%rsp), %xmm0
movss %xmm0, 0x4(%rax)
movq 0x188(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x34(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f140
movl 0x34(%rsp), %ecx
movl %ecx, (%rax)
movss 0x118(%rsp), %xmm0
movss %xmm0, 0x38(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f140
movss 0x38(%rsp), %xmm0
movss %xmm0, 0x4(%rax)
jmp 0x16764
jmp 0x16b57
movq 0x180(%rsp), %rax
movss 0x8(%rax), %xmm1
movq 0x180(%rsp), %rax
movss 0x14(%rax), %xmm2
movq 0x180(%rsp), %rax
movss 0xc(%rax), %xmm0
movq 0x180(%rsp), %rax
mulss 0x18(%rax), %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movq 0x180(%rsp), %rax
movss 0x10(%rax), %xmm0
movq 0x180(%rsp), %rax
movss 0x1c(%rax), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x120(%rsp)
movq 0x1a8(%rsp), %rax
movss (%rax), %xmm1
movq 0x180(%rsp), %rax
movss 0x14(%rax), %xmm2
movq 0x1a8(%rsp), %rax
movss 0x4(%rax), %xmm0
movq 0x180(%rsp), %rax
mulss 0x18(%rax), %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movq 0x1a8(%rsp), %rax
movss 0x8(%rax), %xmm0
movq 0x180(%rsp), %rax
movss 0x1c(%rax), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x11c(%rsp)
leaq 0x5519224(%rip), %rax   # 0x552fa61
testb $0x1, (%rax)
je 0x16874
movss 0x120(%rsp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x56f89(%rip), %xmm0    # 0x6d7e0
ucomisd %xmm1, %xmm0
jb 0x16874
leaq 0x5712e(%rip), %rsi     # 0x6d992
xorl %eax, %eax
movl $0x5, %edi
callq 0xbbf0
jmp 0x16872
jmp 0x16874
movss 0x11c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x537df(%rip), %xmm0    # 0x6a068
ucomisd %xmm1, %xmm0
jb 0x16916
movq 0x1a0(%rsp), %rax
movb $0x1, (%rax)
movq 0x1a0(%rsp), %rax
movl $0x3f800000, 0x4(%rax)  # imm = 0x3F800000
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f040
jmp 0x168c5
movq 0x1b0(%rsp), %rax
movl 0x50(%rax), %eax
movl %eax, 0x28(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movl 0x28(%rsp), %ecx
movl %ecx, (%rax)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movss 0x53740(%rip), %xmm0    # 0x6a04c
movss %xmm0, 0x4(%rax)
jmp 0x16b55
movss 0x11c(%rsp), %xmm0
ucomiss 0x120(%rsp), %xmm0
jb 0x169b0
movq 0x1a0(%rsp), %rax
movb $0x1, (%rax)
movq 0x1a0(%rsp), %rax
movl $0x3f800000, 0x4(%rax)  # imm = 0x3F800000
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f040
jmp 0x1695f
movq 0x180(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x24(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movl 0x24(%rsp), %ecx
movl %ecx, (%rax)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movss 0x536a6(%rip), %xmm0    # 0x6a04c
movss %xmm0, 0x4(%rax)
jmp 0x16b53
movss 0x11c(%rsp), %xmm0
divss 0x120(%rsp), %xmm0
movss %xmm0, 0x118(%rsp)
movss 0x53679(%rip), %xmm0    # 0x6a04c
ucomiss 0x118(%rsp), %xmm0
jbe 0x169ee
movss 0x118(%rsp), %xmm0
movss %xmm0, 0x20(%rsp)
jmp 0x169fe
movss 0x53656(%rip), %xmm0    # 0x6a04c
movss %xmm0, 0x20(%rsp)
jmp 0x169fe
movss 0x20(%rsp), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x16a17
xorps %xmm0, %xmm0
movss %xmm0, 0x1c(%rsp)
jmp 0x16a56
movss 0x5362d(%rip), %xmm0    # 0x6a04c
ucomiss 0x118(%rsp), %xmm0
jbe 0x16a3a
movss 0x118(%rsp), %xmm0
movss %xmm0, 0x18(%rsp)
jmp 0x16a4a
movss 0x5360a(%rip), %xmm0    # 0x6a04c
movss %xmm0, 0x18(%rsp)
jmp 0x16a4a
movss 0x18(%rsp), %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x1c(%rsp), %xmm0
movss %xmm0, 0x118(%rsp)
movq 0x1a0(%rsp), %rax
movb $0x1, (%rax)
movq 0x1a0(%rsp), %rax
movl $0x3f800000, 0x4(%rax)  # imm = 0x3F800000
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x2, %esi
callq 0x1f040
jmp 0x16a97
movq 0x1b0(%rsp), %rax
movl 0x50(%rax), %eax
movl %eax, 0x8(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movl 0x8(%rsp), %ecx
movl %ecx, (%rax)
movss 0x53583(%rip), %xmm0    # 0x6a04c
subss 0x118(%rsp), %xmm0
movss %xmm0, 0xc(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f140
movss 0xc(%rsp), %xmm0
movss %xmm0, 0x4(%rax)
movq 0x180(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x10(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f140
movl 0x10(%rsp), %ecx
movl %ecx, (%rax)
movss 0x118(%rsp), %xmm0
movss %xmm0, 0x14(%rsp)
movq 0x1a0(%rsp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x1f140
movss 0x14(%rsp), %xmm0
movss %xmm0, 0x4(%rax)
jmp 0x16b55
jmp 0x16b57
jmp 0x16b6b
leaq 0x56e5b(%rip), %rdi     # 0x6d9bb
xorl %eax, %eax
callq 0xb580
jmp 0x16b69
jmp 0x16b6b
movl $0x0, 0x148(%rsp)
leaq 0x158(%rsp), %rdi
callq 0x1f200
addq $0x1b8, %rsp            # imm = 0x1B8
retq
movq 0x150(%rsp), %rdi
callq 0x45c0
nopl (%rax,%rax)