// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: ChopFrag(samplefrag_s*)
void ChopFrag (samplefrag_t *frag)
	// fill winding, windingplane, mywinding, mywindingplane, numedges, edges
{
	// get the shape of the fragment by clipping the face using the boundaries
	dface_t *f;
	Winding *facewinding;
	matrix_t worldtotex;
	const vec3_t v_up = {0, 0, 1};

	f = &g_dfaces[frag->facenum];
	facewinding = new Winding (*f);

	TranslateWorldToTex (frag->facenum, worldtotex);
	frag->mywinding = new Winding (facewinding->m_NumPoints);
	for (int x = 0; x < facewinding->m_NumPoints; x++)
	{
		ApplyMatrix (worldtotex, facewinding->m_Points[x], frag->mywinding->m_Points[x]);
		frag->mywinding->m_Points[x][2] = 0.0;
	}
	frag->mywinding->RemoveColinearPoints ();
	VectorCopy (v_up, frag->mywindingplane.normal); // this is the same as applying the worldtotex matrix to the faceplane
	if (CalcMatrixSign (worldtotex) < 0.0)
	{
		frag->mywindingplane.normal[2] *= -1;
	}
	frag->mywindingplane.dist = 0.0;

	for (int x = 0; x < 4 && frag->mywinding->m_NumPoints > 0; x++)
	{
		frag->mywinding->Clip (frag->myrect.planes[x], false);
	}

	frag->winding = new Winding (frag->mywinding->m_NumPoints);
	for (int x = 0; x < frag->mywinding->m_NumPoints; x++)
	{
		ApplyMatrix (frag->mycoordtocoord, frag->mywinding->m_Points[x], frag->winding->m_Points[x]);
	}
	frag->winding->RemoveColinearPoints ();
	VectorCopy (frag->mywindingplane.normal, frag->windingplane.normal);
	if (CalcMatrixSign (frag->mycoordtocoord) < 0.0)
	{
		frag->windingplane.normal[2] *= -1;
	}
	frag->windingplane.dist = 0.0;

	delete facewinding;

	// find the edges where the fragment can grow in the future
	frag->numedges = 0;
	frag->edges = (samplefragedge_t *)malloc (f->numedges * sizeof (samplefragedge_t));
	hlassume (frag->edges != NULL, assume_NoMemory);
	for (int i = 0; i < f->numedges; i++)
	{
		samplefragedge_t *e;
		edgeshare_t *es;
		dedge_t *de;
		dvertex_t *dv1;
		dvertex_t *dv2;
		vec_t frac1, frac2;
		vec_t edgelen;
		vec_t dot, dot1, dot2;
		vec3_t tmp, v, normal;
		const matrix_t *m;
		const matrix_t *m_inverse;
		
		e = &frag->edges[frag->numedges];

		// some basic info
		e->edgenum = abs (g_dsurfedges[f->firstedge + i]);
		e->edgeside = (g_dsurfedges[f->firstedge + i] < 0? 1: 0);
		es = &g_edgeshare[e->edgenum];
		if (!es->smooth)
		{
			continue;
		}
		if (es->faces[e->edgeside] - g_dfaces != frag->facenum)
		{
			Error ("internal error 1 in GrowSingleSampleFrag");
		}
		m = &es->textotex[e->edgeside];
		m_inverse = &es->textotex[1-e->edgeside];
		e->nextfacenum = es->faces[1-e->edgeside] - g_dfaces;
		if (e->nextfacenum == frag->facenum)
		{
			continue; // an invalid edge (usually very short)
		}
		e->tried = false; // because the frag hasn't been linked into the list yet

		// translate the edge points from world to the texture plane of the original frag
		//   so the distances are able to be compared among edges from different frags
		de = &g_dedges[e->edgenum];
		dv1 = &g_dvertexes[de->v[e->edgeside]];
		dv2 = &g_dvertexes[de->v[1-e->edgeside]];
		ApplyMatrix (worldtotex, dv1->point, tmp);
		ApplyMatrix (frag->mycoordtocoord, tmp, e->point1);
		e->point1[2] = 0.0;
		ApplyMatrix (worldtotex, dv2->point, tmp);
		ApplyMatrix (frag->mycoordtocoord, tmp, e->point2);
		e->point2[2] = 0.0;
		VectorSubtract (e->point2, e->point1, e->direction);
		edgelen = VectorNormalize (e->direction);
		if (edgelen <= ON_EPSILON)
		{
			continue;
		}

		// clip the edge
		frac1 = 0;
		frac2 = 1;
		for (int x = 0; x < 4; x++)
		{
			vec_t dot1;
			vec_t dot2;

			dot1 = DotProduct (e->point1, frag->rect.planes[x].normal) - frag->rect.planes[x].dist;
			dot2 = DotProduct (e->point2, frag->rect.planes[x].normal) - frag->rect.planes[x].dist;
			if (dot1 <= ON_EPSILON && dot2 <= ON_EPSILON)
			{
				frac1 = 1;
				frac2 = 0;
			}
			else if (dot1 < 0)
			{
				frac1 = qmax (frac1, dot1 / (dot1 - dot2));
			}
			else if (dot2 < 0)
			{
				frac2 = qmin (frac2, dot1 / (dot1 - dot2));
			}
		}
		if (edgelen * (frac2 - frac1) <= ON_EPSILON)
		{
			continue;
		}
		VectorMA (e->point1, edgelen * frac2, e->direction, e->point2);
		VectorMA (e->point1, edgelen * frac1, e->direction, e->point1);

		// calculate the distance, etc., which are used to determine its priority
		e->noseam = frag->noseam;
		dot = DotProduct (frag->origin, e->direction);
		dot1 = DotProduct (e->point1, e->direction);
		dot2 = DotProduct (e->point2, e->direction);
		dot = qmax (dot1, qmin (dot, dot2));
		VectorMA (e->point1, dot - dot1, e->direction, v);
		VectorSubtract (v, frag->origin, v);
		e->distance = VectorLength (v);
		CrossProduct (e->direction, frag->windingplane.normal, normal);
		VectorNormalize (normal); // points inward
		e->distancereduction = DotProduct (v, normal);
		e->flippedangle = frag->flippedangle + acos (qmin (es->cos_normals_angle, 1.0));

		// calculate the matrix
		e->ratio = (*m_inverse).v[2][2];
		if (e->ratio <= NORMAL_EPSILON || (1 / e->ratio) <= NORMAL_EPSILON)
		{
			Developer (DEVELOPER_LEVEL_SPAM, "TranslateTexToTex failed on face %d and %d @(%f,%f,%f)", frag->facenum, e->nextfacenum, dv1->point[0], dv1->point[1], dv1->point[2]);
			continue;
		}

		if (fabs (e->ratio - 1) < 0.005)
		{
			e->prevtonext = *m;
			e->nexttoprev = *m_inverse;
		}
		else
		{
			e->noseam = false;
			e->prevtonext = *m;
			e->nexttoprev = *m_inverse;
		}

		frag->numedges++;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %rbx
movslq 0x18(%rdi), %rax
imulq $0x14, %rax, %r14
addq 0x2efd9(%rip), %r14     # 0x43fe8
pushq $0x20
popq %rdi
callq 0x42e0
movq %rax, %r12
movss 0x209a2(%rip), %xmm0    # 0x359c4
movq %rax, %rdi
movq %r14, 0x8(%rsp)
movq %r14, %rsi
callq 0xadb6
movl 0x18(%rbx), %edi
leaq 0x88(%rsp), %rsi
callq 0x2be6e
pushq $0x20
popq %rdi
callq 0x42e0
movq %rax, %r15
movl 0x8(%r12), %esi
movq %rax, %rdi
callq 0xaa74
movq %r15, 0x160(%rbx)
xorl %r14d, %r14d
leaq 0x88(%rsp), %r15
xorl %r13d, %r13d
movl 0x8(%r12), %eax
cmpq %rax, %r13
jae 0x150b1
movq 0x10(%r12), %rsi
addq %r14, %rsi
movq 0x160(%rbx), %rax
movq 0x10(%rax), %rdx
addq %r14, %rdx
movq %r15, %rdi
callq 0x2bb9d
movq 0x160(%rbx), %rax
movq 0x10(%rax), %rax
andl $0x0, 0x8(%rax,%r14)
incq %r13
addq $0xc, %r14
jmp 0x1506f
movq 0x160(%rbx), %rdi
movss 0x20904(%rip), %xmm0    # 0x359c4
callq 0xae86
andq $0x0, 0x168(%rbx)
movl $0x3f800000, 0x170(%rbx) # imm = 0x3F800000
leaq 0x88(%rsp), %rdi
callq 0x2be12
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
jbe 0x15103
movss 0x170(%rbx), %xmm0
xorps 0x20195(%rip), %xmm0    # 0x35290
movss %xmm0, 0x170(%rbx)
andl $0x0, 0x174(%rbx)
leaq 0xec(%rbx), %r14
xorl %r15d, %r15d
cmpq $0x50, %r15
je 0x15140
movq 0x160(%rbx), %rdi
cmpl $0x0, 0x8(%rdi)
je 0x15140
leaq (%r14,%r15), %rsi
xorl %edx, %edx
movss 0x2088f(%rip), %xmm0    # 0x359c4
callq 0xb632
addq $0x14, %r15
jmp 0x15114
pushq $0x20
popq %rdi
callq 0x42e0
movq %rax, %r15
movq 0x160(%rbx), %rax
movl 0x8(%rax), %esi
movq %r15, %rdi
callq 0xaa74
movq %r15, 0x140(%rbx)
leaq 0x54(%rbx), %r13
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x160(%rbx), %rax
movl 0x8(%rax), %ecx
cmpq %rcx, %r15
jae 0x151a3
movq 0x10(%rax), %rsi
addq %r14, %rsi
movq 0x140(%rbx), %rax
movq 0x10(%rax), %rdx
addq %r14, %rdx
movq %r13, %rdi
callq 0x2bb9d
incq %r15
addq $0xc, %r14
jmp 0x1516e
movq 0x140(%rbx), %rdi
movss 0x20812(%rip), %xmm0    # 0x359c4
callq 0xae86
movsd 0x168(%rbx), %xmm0
movsd %xmm0, 0x148(%rbx)
movss 0x170(%rbx), %xmm0
movss %xmm0, 0x150(%rbx)
movq %r13, 0x48(%rsp)
movq %r13, %rdi
callq 0x2be12
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
jbe 0x15203
movss 0x150(%rbx), %xmm0
xorps 0x20095(%rip), %xmm0    # 0x35290
movss %xmm0, 0x150(%rbx)
andl $0x0, 0x154(%rbx)
movq (%r12), %rax
movq %r12, %rdi
callq *0x8(%rax)
andl $0x0, 0x17c(%rbx)
movq 0x8(%rsp), %r14
movswq 0x8(%r14), %rax
imulq $0xa8, %rax, %rdi
callq 0x4420
movq %rax, 0x180(%rbx)
xorl %edi, %edi
testq %rax, %rax
setne %dil
pushq $0x1
popq %rsi
callq 0x92cb
movq %r14, %rdi
leaq 0x1e321dd(%rip), %r12   # 0x1e47430
leaq 0x21336c6(%rip), %r8    # 0x2148920
xorl %r14d, %r14d
movswl 0x8(%rdi), %eax
cmpl %eax, %r14d
jge 0x158c9
movq 0x180(%rbx), %r15
movslq 0x17c(%rbx), %rax
imulq $0xa8, %rax, %rax
movslq 0x4(%rdi), %rcx
movslq %r14d, %rdx
addq %rdx, %rcx
movl (%r12,%rcx,4), %ecx
movl %ecx, %esi
negl %esi
cmovsl %ecx, %esi
movl %esi, (%r15,%rax)
movslq 0x4(%rdi), %rcx
addq %rdx, %rcx
movl (%r12,%rcx,4), %ecx
shrl $0x1f, %ecx
movl %ecx, 0x4(%r15,%rax)
imulq $0xb0, %rsi, %r9
cmpb $0x1, 0x39(%r9,%r8)
jne 0x158c1
addq %rax, %r15
addq %r8, %r9
movq (%r9,%rcx,8), %rax
subq 0x2ed19(%rip), %rax     # 0x43fe8
cqto
pushq $0x14
popq %rsi
idivq %rsi
movslq 0x18(%rbx), %rdx
cmpq %rdx, %rax
je 0x15304
leaq 0x20bb8(%rip), %rdi     # 0x35e9f
xorl %eax, %eax
movq %r9, %rbp
callq 0x8b2f
movq %rbp, %r9
leaq 0x2133625(%rip), %r8    # 0x2148920
movq 0x8(%rsp), %rdi
movl 0x4(%r15), %ecx
pushq $0x1
popq %rax
subl %ecx, %eax
movslq %eax, %r10
movq (%r9,%r10,8), %rax
subq 0x2ecd1(%rip), %rax     # 0x43fe8
cqto
pushq $0x14
popq %rsi
idivq %rsi
movl %eax, 0x8(%r15)
cmpl %eax, 0x18(%rbx)
je 0x158c1
movslq %ecx, %rcx
movb $0x0, 0xc(%r15)
movslq (%r15), %rax
shlq $0x2, %rax
addq 0x2ec7e(%rip), %rax     # 0x43fc0
movq %rcx, 0x30(%rsp)
movzwl (%rax,%rcx,2), %ecx
imulq $0xc, %rcx, %rsi
leaq 0x10180ba(%rip), %rcx   # 0x102d410
addq %rcx, %rsi
movzwl (%rax,%r10,2), %eax
imulq $0xc, %rax, %rbp
addq %rcx, %rbp
leaq 0x88(%rsp), %r12
movq %r12, %rdi
movq %rsi, 0x50(%rsp)
movl %r14d, 0x1c(%rsp)
leaq 0x7c(%rsp), %r14
movq %r14, %rdx
movq %r9, 0x58(%rsp)
movq %r10, 0x20(%rsp)
callq 0x2bb9d
leaq 0x10(%r15), %rdx
movq 0x48(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x2bb9d
andl $0x0, 0x18(%r15)
movq %r12, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x2bb9d
leaq 0x1c(%r15), %rdx
movq %r13, %rdi
leaq 0x1e3206a(%rip), %r12   # 0x1e47430
movq %r14, %rsi
movl 0x1c(%rsp), %r14d
callq 0x2bb9d
andl $0x0, 0x24(%r15)
leaq 0x28(%r15), %rdi
movsd 0x10(%r15), %xmm0
movsd 0x1c(%r15), %xmm1
subps %xmm0, %xmm1
movlps %xmm1, 0x28(%r15)
xorps %xmm0, %xmm0
subss 0x18(%r15), %xmm0
movss %xmm0, 0x30(%r15)
callq 0xc021
movq 0x20(%rsp), %rcx
movq 0x58(%rsp), %rbp
movss 0x1cc4d(%rip), %xmm14   # 0x32064
movapd 0x20670(%rip), %xmm13   # 0x35a90
leaq 0x21334f9(%rip), %r8    # 0x2148920
xorps %xmm12, %xmm12
movq 0x8(%rsp), %rdi
cvtss2sd %xmm0, %xmm1
movsd 0x2016c(%rip), %xmm2    # 0x355a8
ucomisd %xmm1, %xmm2
jae 0x158c1
imulq $0x30, 0x30(%rsp), %rax
leaq (%rax,%rbp), %r9
addq $0x50, %r9
imulq $0x30, %rcx, %rax
leaq (%rax,%rbp), %r13
addq $0x50, %r13
movss 0x10(%r15), %xmm1
movsd 0x14(%r15), %xmm2
movss 0x24(%r15), %xmm4
movaps %xmm2, %xmm3
movss %xmm4, %xmm3            # xmm3 = xmm4[0],xmm3[1,2,3]
movss 0x1c(%r15), %xmm4
unpcklps %xmm1, %xmm4            # xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1]
movss 0x20(%r15), %xmm6
movaps %xmm2, %xmm5
shufps $0x0, %xmm2, %xmm5      # xmm5 = xmm5[0,0],xmm2[0,0]
movss %xmm6, %xmm5            # xmm5 = xmm6[0],xmm5[1,2,3]
xorl %eax, %eax
movsd 0x205e3(%rip), %xmm6    # 0x35a80
movaps %xmm6, %xmm7
shufps $0x55, %xmm6, %xmm7     # xmm7 = xmm7[1,1],xmm6[1,1]
cmpq $0x50, %rax
je 0x1557b
movss 0x9c(%rbx,%rax), %xmm9
movss 0xa0(%rbx,%rax), %xmm10
movss 0xa4(%rbx,%rax), %xmm8
movss 0xa8(%rbx,%rax), %xmm11
shufps $0x0, %xmm10, %xmm10    # xmm10 = xmm10[0,0,0,0]
mulps %xmm5, %xmm10
shufps $0x0, %xmm9, %xmm9      # xmm9 = xmm9[0,0,0,0]
mulps %xmm4, %xmm9
addps %xmm10, %xmm9
shufps $0x0, %xmm8, %xmm8      # xmm8 = xmm8[0,0,0,0]
mulps %xmm3, %xmm8
addps %xmm9, %xmm8
shufps $0x0, %xmm11, %xmm11    # xmm11 = xmm11[0,0,0,0]
subps %xmm11, %xmm8
cvtps2pd %xmm8, %xmm9
cmpnlepd %xmm13, %xmm9
movmskpd %xmm9, %ecx
movaps %xmm14, %xmm9
testl %ecx, %ecx
je 0x1556e
movaps %xmm8, %xmm9
shufps $0x55, %xmm8, %xmm9     # xmm9 = xmm9[1,1],xmm8[1,1]
ucomiss %xmm9, %xmm12
jbe 0x15544
movaps %xmm9, %xmm7
subss %xmm8, %xmm7
divss %xmm7, %xmm9
movaps %xmm6, %xmm7
maxss %xmm9, %xmm7
movss %xmm7, %xmm6            # xmm6 = xmm7[0],xmm6[1,2,3]
jmp 0x1556a
ucomiss %xmm8, %xmm12
jbe 0x1556a
movaps %xmm9, %xmm10
subss %xmm8, %xmm10
divss %xmm10, %xmm9
minss %xmm9, %xmm7
movlhps %xmm6, %xmm7            # xmm7 = xmm7[0],xmm6[0]
shufps $0xe2, %xmm6, %xmm7     # xmm7 = xmm7[2,0],xmm6[2,3]
movaps %xmm7, %xmm9
jmp 0x1556e
movaps %xmm6, %xmm9
addq $0x14, %rax
movaps %xmm9, %xmm6
jmp 0x1549d
subss %xmm6, %xmm7
movaps %xmm0, %xmm3
mulss %xmm7, %xmm3
cvtss2sd %xmm3, %xmm3
movsd 0x20016(%rip), %xmm4    # 0x355a8
ucomisd %xmm3, %xmm4
jae 0x158c1
movq %r9, 0x40(%rsp)
shufps $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
mulps %xmm6, %xmm0
movaps %xmm0, %xmm4
shufps $0x40, %xmm0, %xmm4     # xmm4 = xmm4[0,0],xmm0[0,1]
movss 0x28(%r15), %xmm13
movsd 0x2c(%r15), %xmm3
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
mulps %xmm3, %xmm0
addps %xmm2, %xmm0
movlps %xmm0, 0x20(%r15)
movaps %xmm13, %xmm5
shufps $0x40, %xmm3, %xmm5     # xmm5 = xmm5[0,0],xmm3[0,1]
shufps $0x78, %xmm5, %xmm5     # xmm5 = xmm5[0,2,3,1]
mulps %xmm4, %xmm5
shufps $0x40, %xmm2, %xmm1     # xmm1 = xmm1[0,0],xmm2[0,1]
shufps $0x78, %xmm1, %xmm1     # xmm1 = xmm1[0,2,3,1]
addps %xmm5, %xmm1
movups %xmm1, 0x10(%r15)
movb 0x20(%rbx), %al
movb %al, 0x34(%r15)
movss 0x84(%rbx), %xmm5
movss 0x88(%rbx), %xmm4
movaps %xmm3, %xmm2
mulss %xmm4, %xmm2
movaps %xmm5, %xmm7
mulss %xmm13, %xmm7
addss %xmm2, %xmm7
movss 0x8c(%rbx), %xmm6
movaps %xmm3, %xmm2
shufps $0x55, %xmm3, %xmm2     # xmm2 = xmm2[1,1],xmm3[1,1]
movaps %xmm6, %xmm9
mulss %xmm2, %xmm9
addss %xmm7, %xmm9
movaps %xmm1, %xmm7
shufps $0x55, %xmm1, %xmm7     # xmm7 = xmm7[1,1],xmm1[1,1]
movaps %xmm3, %xmm8
mulss %xmm7, %xmm8
movaps %xmm1, %xmm10
mulss %xmm13, %xmm10
addss %xmm8, %xmm10
movaps %xmm1, %xmm8
unpckhpd %xmm1, %xmm8            # xmm8 = xmm8[1],xmm1[1]
movaps %xmm8, %xmm11
mulss %xmm2, %xmm11
addss %xmm10, %xmm11
movaps %xmm3, %xmm10
mulss %xmm0, %xmm10
movaps %xmm1, %xmm12
shufps $0xff, %xmm1, %xmm12    # xmm12 = xmm12[3,3],xmm1[3,3]
mulss %xmm13, %xmm12
addss %xmm10, %xmm12
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
mulss %xmm2, %xmm0
addss %xmm12, %xmm0
minss %xmm0, %xmm9
movaps %xmm11, %xmm0
maxss %xmm9, %xmm0
subss %xmm11, %xmm0
mulss %xmm0, %xmm13
addss %xmm1, %xmm13
movaps %xmm0, %xmm1
mulss %xmm3, %xmm1
addss %xmm7, %xmm1
mulss %xmm2, %xmm0
addss %xmm8, %xmm0
subss %xmm5, %xmm13
movaps %xmm13, 0x20(%rsp)
subss %xmm4, %xmm1
movaps %xmm1, 0x60(%rsp)
subss %xmm6, %xmm0
movaps %xmm0, %xmm4
movaps %xmm0, 0x30(%rsp)
movaps %xmm13, %xmm0
mulss %xmm13, %xmm0
cvtss2sd %xmm0, %xmm0
mulss %xmm1, %xmm1
cvtss2sd %xmm1, %xmm1
addsd %xmm0, %xmm1
movaps %xmm4, %xmm0
mulss %xmm4, %xmm0
cvtss2sd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x38(%r15)
movss 0x14c(%rbx), %xmm0
movss 0x150(%rbx), %xmm1
mulss %xmm0, %xmm2
mulss %xmm1, %xmm3
subss %xmm2, %xmm3
movss %xmm3, 0x10(%rsp)
movss 0x148(%rbx), %xmm2
mulss 0x28(%r15), %xmm1
movss 0x30(%r15), %xmm3
mulss %xmm2, %xmm3
subss %xmm1, %xmm3
movss %xmm3, 0x14(%rsp)
mulss 0x2c(%r15), %xmm2
mulss 0x28(%r15), %xmm0
subss %xmm2, %xmm0
movss %xmm0, 0x18(%rsp)
leaq 0x10(%rsp), %rdi
callq 0xc021
movaps 0x60(%rsp), %xmm1
mulss 0x14(%rsp), %xmm1
movaps 0x20(%rsp), %xmm0
mulss 0x10(%rsp), %xmm0
addss %xmm1, %xmm0
movaps 0x30(%rsp), %xmm1
mulss 0x18(%rsp), %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x3c(%r15)
cvtss2sd 0x1c(%rbx), %xmm0
movsd %xmm0, 0x20(%rsp)
movss 0x34(%rbp), %xmm0
minss 0x1c8a4(%rip), %xmm0    # 0x32064
cvtss2sd %xmm0, %xmm0
callq 0x42b0
addsd 0x20(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x40(%r15)
movss 0x20(%r13), %xmm0
movss %xmm0, 0x44(%r15)
cvtss2sd %xmm0, %xmm1
movsd 0x1c88f(%rip), %xmm2    # 0x32080
ucomisd %xmm1, %xmm2
jae 0x1588a
movss 0x1c861(%rip), %xmm1    # 0x32064
divss %xmm0, %xmm1
cvtss2sd %xmm1, %xmm1
movsd 0x1c86d(%rip), %xmm2    # 0x32080
ucomisd %xmm1, %xmm2
jae 0x1588a
addss 0x1faa7(%rip), %xmm0    # 0x352c8
andps 0x1fa78(%rip), %xmm0    # 0x352a0
cvtss2sd %xmm0, %xmm0
movsd 0x2020c(%rip), %xmm1    # 0x35a40
ucomisd %xmm0, %xmm1
ja 0x1583f
movb $0x0, 0x34(%r15)
movq 0x40(%rsp), %rcx
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups %xmm2, 0x68(%r15)
movups %xmm1, 0x58(%r15)
movups %xmm0, 0x48(%r15)
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movups 0x20(%r13), %xmm2
movups %xmm0, 0x78(%r15)
movups %xmm1, 0x88(%r15)
movups %xmm2, 0x98(%r15)
incl 0x17c(%rbx)
jmp 0x158b5
movl 0x18(%rbx), %edx
movl 0x8(%r15), %ecx
movq 0x50(%rsp), %rax
cvtss2sd (%rax), %xmm0
cvtss2sd 0x4(%rax), %xmm1
cvtss2sd 0x8(%rax), %xmm2
pushq $0x5
popq %rdi
leaq 0x204ed(%rip), %rsi     # 0x35d9b
movb $0x3, %al
callq 0x9045
movq 0x8(%rsp), %rdi
leaq 0x213305f(%rip), %r8    # 0x2148920
incl %r14d
jmp 0x1525d
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x158dd
movq %rax, %rbx
pushq $0x20
popq %rsi
movq %r15, %rdi
jmp 0x158f1
movq %rax, %rbx
pushq $0x20
popq %rsi
movq %r12, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x45a0