// File: FreeSlave[P]vhlt/hlbsp/qbsp.cpp
// Function: SplitFaceTmp(face_s*, plane_t const*, face_s**, face_s**)
static void     SplitFaceTmp(face_t* in, const dplane_t* const split, face_t** front, face_t** back)
{
    vec_t           dists[MAXEDGES + 1];
    int             sides[MAXEDGES + 1];
    int             counts[3];
    vec_t           dot;
    int             i;
    int             j;
    face_t*         newf;
    face_t*         new2;
    vec_t*          p1;
    vec_t*          p2;
    vec3_t          mid;

    if (in->numpoints < 0)
    {
        Error("SplitFace: freed face");
    }
    counts[0] = counts[1] = counts[2] = 0;


    // determine sides for each point
    for (i = 0; i < in->numpoints; i++)
    {
        dot = DotProduct(in->pts[i], split->normal);
        dot -= split->dist;
        dists[i] = dot;
        if (dot > ON_EPSILON)
        {
            sides[i] = SIDE_FRONT;
        }
        else if (dot < -ON_EPSILON)
        {
            sides[i] = SIDE_BACK;
        }
        else
        {
            sides[i] = SIDE_ON;
        }
        counts[sides[i]]++;
    }
    sides[i] = sides[0];
    dists[i] = dists[0];

#ifdef HLBSP_SPLITFACE_FIX
	if (!counts[0] && !counts[1])
	{
		if (in->detaillevel)
		{
			// put front face in front node, and back face in back node.
			const dplane_t *faceplane = &g_dplanes[in->planenum];
			if (DotProduct (faceplane->normal, split->normal) > NORMAL_EPSILON) // usually near 1.0 or -1.0
			{
				*front = in;
				*back = NULL;
			}
			else
			{
				*front = NULL;
				*back = in;
			}
		}
		else
		{
			// not func_detail. front face and back face need to pair.
			vec_t sum = 0.0;
			for (i = 0; i < in->numpoints; i++)
			{
				dot = DotProduct(in->pts[i], split->normal);
				dot -= split->dist;
				sum += dot;
			}
			if (sum > NORMAL_EPSILON)
			{
				*front = in;
				*back = NULL;
			}
			else
			{
				*front = NULL;
				*back = in;
			}
		}
		return;
	}
#endif
    if (!counts[0])
    {
        *front = NULL;
        *back = in;
        return;
    }
    if (!counts[1])
    {
        *front = in;
        *back = NULL;
        return;
    }

    *back = newf = NewFaceFromFace(in);
    *front = new2 = NewFaceFromFace(in);

    // distribute the points and generate splits

    for (i = 0; i < in->numpoints; i++)
    {
        if (newf->numpoints > MAXEDGES || new2->numpoints > MAXEDGES)
        {
            Error("SplitFace: numpoints > MAXEDGES");
        }

        p1 = in->pts[i];

        if (sides[i] == SIDE_ON)
        {
            VectorCopy(p1, newf->pts[newf->numpoints]);
            newf->numpoints++;
            VectorCopy(p1, new2->pts[new2->numpoints]);
            new2->numpoints++;
            continue;
        }

        if (sides[i] == SIDE_FRONT)
        {
            VectorCopy(p1, new2->pts[new2->numpoints]);
            new2->numpoints++;
        }
        else
        {
            VectorCopy(p1, newf->pts[newf->numpoints]);
            newf->numpoints++;
        }

        if (sides[i + 1] == SIDE_ON || sides[i + 1] == sides[i])
        {
            continue;
        }

        // generate a split point
        p2 = in->pts[(i + 1) % in->numpoints];

        dot = dists[i] / (dists[i] - dists[i + 1]);
        for (j = 0; j < 3; j++)
        {                                                  // avoid round off error when possible
            if (split->normal[j] == 1)
            {
                mid[j] = split->dist;
            }
            else if (split->normal[j] == -1)
            {
                mid[j] = -split->dist;
            }
            else
            {
                mid[j] = p1[j] + dot * (p2[j] - p1[j]);
            }
        }

        VectorCopy(mid, newf->pts[newf->numpoints]);
        newf->numpoints++;
        VectorCopy(mid, new2->pts[new2->numpoints]);
        new2->numpoints++;
    }

    if (newf->numpoints > MAXEDGES || new2->numpoints > MAXEDGES)
    {
        Error("SplitFace: numpoints > MAXEDGES");
    }
#ifdef HLBSP_REMOVECOLINEARPOINTS
	{
		Winding *wd = new Winding (newf->numpoints);
		int x;
		for (x = 0; x < newf->numpoints; x++)
		{
			VectorCopy (newf->pts[x], wd->m_Points[x]);
		}
		wd->RemoveColinearPoints ();
		newf->numpoints = wd->m_NumPoints;
		for (x = 0; x < newf->numpoints; x++)
		{
			VectorCopy (wd->m_Points[x], newf->pts[x]);
		}
		delete wd;
		if (newf->numpoints == 0)
		{
			*back = NULL;
		}
	}
	{
		Winding *wd = new Winding (new2->numpoints);
		int x;
		for (x = 0; x < new2->numpoints; x++)
		{
			VectorCopy (new2->pts[x], wd->m_Points[x]);
		}
		wd->RemoveColinearPoints ();
		new2->numpoints = wd->m_NumPoints;
		for (x = 0; x < new2->numpoints; x++)
		{
			VectorCopy (wd->m_Points[x], new2->pts[x]);
		}
		delete wd;
		if (new2->numpoints == 0)
		{
			*front = NULL;
		}
	}
#endif
}

// Assembly:
subq $0x338, %rsp            # imm = 0x338
movq %rdi, 0x330(%rsp)
movq %rsi, 0x328(%rsp)
movq %rdx, 0x320(%rsp)
movq %rcx, 0x318(%rsp)
movq 0x330(%rsp), %rax
cmpl $0x0, 0x2c(%rax)
jge 0x23ec3
leaq 0x16b82(%rip), %rdi     # 0x3aa3e
movb $0x0, %al
callq 0xb510
movl $0x0, 0xbc(%rsp)
movl $0x0, 0xb8(%rsp)
movl $0x0, 0xb4(%rsp)
movl $0x0, 0xa4(%rsp)
movl 0xa4(%rsp), %eax
movq 0x330(%rsp), %rcx
cmpl 0x2c(%rcx), %eax
jge 0x24082
movq 0x330(%rsp), %rax
addq $0x38, %rax
movslq 0xa4(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd (%rax), %xmm1
movq 0x328(%rsp), %rax
movsd (%rax), %xmm2
movq 0x330(%rsp), %rax
addq $0x38, %rax
movslq 0xa4(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movq 0x328(%rsp), %rax
mulsd 0x8(%rax), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movq 0x330(%rsp), %rax
addq $0x38, %rax
movslq 0xa4(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x10(%rax), %xmm0
movq 0x328(%rsp), %rax
movsd 0x10(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xa8(%rsp)
movq 0x328(%rsp), %rax
movsd 0x30(%rax), %xmm1
movsd 0xa8(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0xa8(%rsp)
movsd 0xa8(%rsp), %xmm0
movslq 0xa4(%rsp), %rax
movsd %xmm0, 0x190(%rsp,%rax,8)
movsd 0xa8(%rsp), %xmm0
movsd 0x1560d(%rip), %xmm1    # 0x39600
ucomisd %xmm1, %xmm0
jbe 0x2400e
movslq 0xa4(%rsp), %rax
movl $0x0, 0xc0(%rsp,%rax,4)
jmp 0x2404b
movsd 0x15602(%rip), %xmm0    # 0x39618
ucomisd 0xa8(%rsp), %xmm0
jbe 0x24036
movslq 0xa4(%rsp), %rax
movl $0x1, 0xc0(%rsp,%rax,4)
jmp 0x24049
movslq 0xa4(%rsp), %rax
movl $0x2, 0xc0(%rsp,%rax,4)
jmp 0x2404b
movslq 0xa4(%rsp), %rax
movslq 0xc0(%rsp,%rax,4), %rax
movl 0xb4(%rsp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, 0xb4(%rsp,%rax,4)
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
jmp 0x23eef
movl 0xc0(%rsp), %ecx
movslq 0xa4(%rsp), %rax
movl %ecx, 0xc0(%rsp,%rax,4)
movsd 0x190(%rsp), %xmm0
movslq 0xa4(%rsp), %rax
movsd %xmm0, 0x190(%rsp,%rax,8)
cmpl $0x0, 0xb4(%rsp)
jne 0x24324
cmpl $0x0, 0xb8(%rsp)
jne 0x24324
movq 0x330(%rsp), %rax
cmpl $0x0, 0x14(%rax)
je 0x241ab
movq 0x330(%rsp), %rax
movslq 0x8(%rax), %rcx
leaq 0x20cb93d(%rip), %rax   # 0x20efa30
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rax
movsd (%rax), %xmm1
movq 0x328(%rsp), %rax
movsd (%rax), %xmm2
movq 0x58(%rsp), %rax
movsd 0x8(%rax), %xmm0
movq 0x328(%rsp), %rax
mulsd 0x8(%rax), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movq 0x58(%rsp), %rax
movsd 0x10(%rax), %xmm0
movq 0x328(%rsp), %rax
movsd 0x10(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x11f0e(%rip), %xmm1    # 0x36068
ucomisd %xmm1, %xmm0
jbe 0x24184
movq 0x330(%rsp), %rcx
movq 0x320(%rsp), %rax
movq %rcx, (%rax)
movq 0x318(%rsp), %rax
movq $0x0, (%rax)
jmp 0x241a6
movq 0x320(%rsp), %rax
movq $0x0, (%rax)
movq 0x330(%rsp), %rcx
movq 0x318(%rsp), %rax
movq %rcx, (%rax)
jmp 0x2431f
xorps %xmm0, %xmm0
movsd %xmm0, 0x50(%rsp)
movl $0x0, 0xa4(%rsp)
movl 0xa4(%rsp), %eax
movq 0x330(%rsp), %rcx
cmpl 0x2c(%rcx), %eax
jge 0x242c3
movq 0x330(%rsp), %rax
addq $0x38, %rax
movslq 0xa4(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd (%rax), %xmm1
movq 0x328(%rsp), %rax
movsd (%rax), %xmm2
movq 0x330(%rsp), %rax
addq $0x38, %rax
movslq 0xa4(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movq 0x328(%rsp), %rax
mulsd 0x8(%rax), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movq 0x330(%rsp), %rax
addq $0x38, %rax
movslq 0xa4(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x10(%rax), %xmm0
movq 0x328(%rsp), %rax
movsd 0x10(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xa8(%rsp)
movq 0x328(%rsp), %rax
movsd 0x30(%rax), %xmm1
movsd 0xa8(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0xa8(%rsp)
movsd 0xa8(%rsp), %xmm0
addsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
jmp 0x241bf
movsd 0x50(%rsp), %xmm0
movsd 0x11d97(%rip), %xmm1    # 0x36068
ucomisd %xmm1, %xmm0
jbe 0x242fb
movq 0x330(%rsp), %rcx
movq 0x320(%rsp), %rax
movq %rcx, (%rax)
movq 0x318(%rsp), %rax
movq $0x0, (%rax)
jmp 0x2431d
movq 0x320(%rsp), %rax
movq $0x0, (%rax)
movq 0x330(%rsp), %rcx
movq 0x318(%rsp), %rax
movq %rcx, (%rax)
jmp 0x2431f
jmp 0x24ee4
cmpl $0x0, 0xb4(%rsp)
jne 0x24355
movq 0x320(%rsp), %rax
movq $0x0, (%rax)
movq 0x330(%rsp), %rcx
movq 0x318(%rsp), %rax
movq %rcx, (%rax)
jmp 0x24ee4
cmpl $0x0, 0xb8(%rsp)
jne 0x24386
movq 0x330(%rsp), %rcx
movq 0x320(%rsp), %rax
movq %rcx, (%rax)
movq 0x318(%rsp), %rax
movq $0x0, (%rax)
jmp 0x24ee4
movq 0x330(%rsp), %rdi
callq 0x23d70
movq %rax, %rcx
movq %rcx, 0x98(%rsp)
movq 0x318(%rsp), %rax
movq %rcx, (%rax)
movq 0x330(%rsp), %rdi
callq 0x23d70
movq %rax, %rcx
movq %rcx, 0x90(%rsp)
movq 0x320(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0xa4(%rsp)
movl 0xa4(%rsp), %eax
movq 0x330(%rsp), %rcx
cmpl 0x2c(%rcx), %eax
jge 0x24a1c
movq 0x98(%rsp), %rax
cmpl $0x30, 0x2c(%rax)
jg 0x2440b
movq 0x90(%rsp), %rax
cmpl $0x30, 0x2c(%rax)
jle 0x24419
leaq 0x16642(%rip), %rdi     # 0x3aa54
movb $0x0, %al
callq 0xb510
movq 0x330(%rsp), %rax
addq $0x38, %rax
movslq 0xa4(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x88(%rsp)
movslq 0xa4(%rsp), %rax
cmpl $0x2, 0xc0(%rsp,%rax,4)
jne 0x2459b
movq 0x88(%rsp), %rax
movsd (%rax), %xmm0
movq 0x98(%rsp), %rax
addq $0x38, %rax
movq 0x98(%rsp), %rcx
movslq 0x2c(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, (%rax)
movq 0x88(%rsp), %rax
movsd 0x8(%rax), %xmm0
movq 0x98(%rsp), %rax
addq $0x38, %rax
movq 0x98(%rsp), %rcx
movslq 0x2c(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
movq 0x88(%rsp), %rax
movsd 0x10(%rax), %xmm0
movq 0x98(%rsp), %rax
addq $0x38, %rax
movq 0x98(%rsp), %rcx
movslq 0x2c(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x10(%rax)
movq 0x98(%rsp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
movq 0x88(%rsp), %rax
movsd (%rax), %xmm0
movq 0x90(%rsp), %rax
addq $0x38, %rax
movq 0x90(%rsp), %rcx
movslq 0x2c(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, (%rax)
movq 0x88(%rsp), %rax
movsd 0x8(%rax), %xmm0
movq 0x90(%rsp), %rax
addq $0x38, %rax
movq 0x90(%rsp), %rcx
movslq 0x2c(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
movq 0x88(%rsp), %rax
movsd 0x10(%rax), %xmm0
movq 0x90(%rsp), %rax
addq $0x38, %rax
movq 0x90(%rsp), %rcx
movslq 0x2c(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x10(%rax)
movq 0x90(%rsp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
jmp 0x24a06
movslq 0xa4(%rsp), %rax
cmpl $0x0, 0xc0(%rsp,%rax,4)
jne 0x24658
movq 0x88(%rsp), %rax
movsd (%rax), %xmm0
movq 0x90(%rsp), %rax
addq $0x38, %rax
movq 0x90(%rsp), %rcx
movslq 0x2c(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, (%rax)
movq 0x88(%rsp), %rax
movsd 0x8(%rax), %xmm0
movq 0x90(%rsp), %rax
addq $0x38, %rax
movq 0x90(%rsp), %rcx
movslq 0x2c(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
movq 0x88(%rsp), %rax
movsd 0x10(%rax), %xmm0
movq 0x90(%rsp), %rax
addq $0x38, %rax
movq 0x90(%rsp), %rcx
movslq 0x2c(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x10(%rax)
movq 0x90(%rsp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
jmp 0x246fa
movq 0x88(%rsp), %rax
movsd (%rax), %xmm0
movq 0x98(%rsp), %rax
addq $0x38, %rax
movq 0x98(%rsp), %rcx
movslq 0x2c(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, (%rax)
movq 0x88(%rsp), %rax
movsd 0x8(%rax), %xmm0
movq 0x98(%rsp), %rax
addq $0x38, %rax
movq 0x98(%rsp), %rcx
movslq 0x2c(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
movq 0x88(%rsp), %rax
movsd 0x10(%rax), %xmm0
movq 0x98(%rsp), %rax
addq $0x38, %rax
movq 0x98(%rsp), %rcx
movslq 0x2c(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x10(%rax)
movq 0x98(%rsp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
movl 0xa4(%rsp), %eax
addl $0x1, %eax
cltq
cmpl $0x2, 0xc0(%rsp,%rax,4)
je 0x24734
movl 0xa4(%rsp), %eax
addl $0x1, %eax
cltq
movl 0xc0(%rsp,%rax,4), %eax
movslq 0xa4(%rsp), %rcx
cmpl 0xc0(%rsp,%rcx,4), %eax
jne 0x24739
jmp 0x24a06
movq 0x330(%rsp), %rax
addq $0x38, %rax
movq %rax, 0x20(%rsp)
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movq 0x330(%rsp), %rcx
cltd
idivl 0x2c(%rcx)
movq 0x20(%rsp), %rax
movslq %edx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x80(%rsp)
movslq 0xa4(%rsp), %rax
movsd 0x190(%rsp,%rax,8), %xmm0
movslq 0xa4(%rsp), %rax
movsd 0x190(%rsp,%rax,8), %xmm1
movl 0xa4(%rsp), %eax
addl $0x1, %eax
cltq
subsd 0x190(%rsp,%rax,8), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0xa8(%rsp)
movl $0x0, 0xa0(%rsp)
cmpl $0x3, 0xa0(%rsp)
jge 0x248ea
movq 0x328(%rsp), %rax
movslq 0xa0(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x14957(%rip), %xmm1    # 0x39148
ucomisd %xmm1, %xmm0
jne 0x24819
jp 0x24819
movq 0x328(%rsp), %rax
movsd 0x30(%rax), %xmm0
movslq 0xa0(%rsp), %rax
movsd %xmm0, 0x60(%rsp,%rax,8)
jmp 0x248d2
movq 0x328(%rsp), %rax
movslq 0xa0(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x14c2a(%rip), %xmm1    # 0x39460
ucomisd %xmm1, %xmm0
jne 0x24872
jp 0x24872
movq 0x328(%rsp), %rax
movsd 0x30(%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movslq 0xa0(%rsp), %rax
movsd %xmm0, 0x60(%rsp,%rax,8)
jmp 0x248d0
movq 0x88(%rsp), %rax
movslq 0xa0(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd 0xa8(%rsp), %xmm0
movq 0x80(%rsp), %rax
movslq 0xa0(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm2
movq 0x88(%rsp), %rax
movslq 0xa0(%rsp), %rcx
subsd (%rax,%rcx,8), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movslq 0xa0(%rsp), %rax
movsd %xmm0, 0x60(%rsp,%rax,8)
jmp 0x248d2
jmp 0x248d4
movl 0xa0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa0(%rsp)
jmp 0x247c6
movsd 0x60(%rsp), %xmm0
movq 0x98(%rsp), %rax
addq $0x38, %rax
movq 0x98(%rsp), %rcx
movslq 0x2c(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, (%rax)
movsd 0x68(%rsp), %xmm0
movq 0x98(%rsp), %rax
addq $0x38, %rax
movq 0x98(%rsp), %rcx
movslq 0x2c(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
movsd 0x70(%rsp), %xmm0
movq 0x98(%rsp), %rax
addq $0x38, %rax
movq 0x98(%rsp), %rcx
movslq 0x2c(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x10(%rax)
movq 0x98(%rsp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
movsd 0x60(%rsp), %xmm0
movq 0x90(%rsp), %rax
addq $0x38, %rax
movq 0x90(%rsp), %rcx
movslq 0x2c(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, (%rax)
movsd 0x68(%rsp), %xmm0
movq 0x90(%rsp), %rax
addq $0x38, %rax
movq 0x90(%rsp), %rcx
movslq 0x2c(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
movsd 0x70(%rsp), %xmm0
movq 0x90(%rsp), %rax
addq $0x38, %rax
movq 0x90(%rsp), %rcx
movslq 0x2c(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x10(%rax)
movq 0x90(%rsp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
jmp 0x243d7
movq 0x98(%rsp), %rax
cmpl $0x30, 0x2c(%rax)
jg 0x24a38
movq 0x90(%rsp), %rax
cmpl $0x30, 0x2c(%rax)
jle 0x24a46
leaq 0x16015(%rip), %rdi     # 0x3aa54
movb $0x0, %al
callq 0xb510
movl $0x20, %edi
callq 0x42f0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x18(%rsp)
movq 0x98(%rsp), %rax
movl 0x2c(%rax), %esi
callq 0xea10
jmp 0x24a6d
movq 0x18(%rsp), %rax
movq %rax, 0x48(%rsp)
movl $0x0, 0x38(%rsp)
movl 0x38(%rsp), %eax
movq 0x98(%rsp), %rcx
cmpl 0x2c(%rcx), %eax
jge 0x24b69
movq 0x98(%rsp), %rax
addq $0x38, %rax
movslq 0x38(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x38(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, (%rax)
movq 0x98(%rsp), %rax
addq $0x38, %rax
movslq 0x38(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x38(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
movq 0x98(%rsp), %rax
addq $0x38, %rax
movslq 0x38(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x10(%rax), %xmm0
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x38(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x10(%rax)
movl 0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x38(%rsp)
jmp 0x24a7f
movq 0x18(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
movl $0x20, %esi
callq 0x4300
jmp 0x24eec
movq 0x48(%rsp), %rdi
movsd 0x14a8a(%rip), %xmm0    # 0x39600
callq 0xf3a0
movq 0x48(%rsp), %rax
movl 0x8(%rax), %ecx
movq 0x98(%rsp), %rax
movl %ecx, 0x2c(%rax)
movl $0x0, 0x38(%rsp)
movl 0x38(%rsp), %eax
movq 0x98(%rsp), %rcx
cmpl 0x2c(%rcx), %eax
jge 0x24c5e
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x38(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
movq 0x98(%rsp), %rax
addq $0x38, %rax
movslq 0x38(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, (%rax)
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x38(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movq 0x98(%rsp), %rax
addq $0x38, %rax
movslq 0x38(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x38(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x10(%rax), %xmm0
movq 0x98(%rsp), %rax
addq $0x38, %rax
movslq 0x38(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x10(%rax)
movl 0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x38(%rsp)
jmp 0x24b96
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x24c79
movq 0x10(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x98(%rsp), %rax
cmpl $0x0, 0x2c(%rax)
jne 0x24c96
movq 0x318(%rsp), %rax
movq $0x0, (%rax)
movl $0x20, %edi
callq 0x42f0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x8(%rsp)
movq 0x90(%rsp), %rax
movl 0x2c(%rax), %esi
callq 0xea10
jmp 0x24cbd
movq 0x8(%rsp), %rax
movq %rax, 0x30(%rsp)
movl $0x0, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
movq 0x90(%rsp), %rcx
cmpl 0x2c(%rcx), %eax
jge 0x24db9
movq 0x90(%rsp), %rax
addq $0x38, %rax
movslq 0x2c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x2c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, (%rax)
movq 0x90(%rsp), %rax
addq $0x38, %rax
movslq 0x2c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x2c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
movq 0x90(%rsp), %rax
addq $0x38, %rax
movslq 0x2c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x10(%rax), %xmm0
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x2c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x10(%rax)
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x24ccf
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
movl $0x20, %esi
callq 0x4300
jmp 0x24eec
movq 0x30(%rsp), %rdi
movsd 0x1483a(%rip), %xmm0    # 0x39600
callq 0xf3a0
movq 0x30(%rsp), %rax
movl 0x8(%rax), %ecx
movq 0x90(%rsp), %rax
movl %ecx, 0x2c(%rax)
movl $0x0, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
movq 0x90(%rsp), %rcx
cmpl 0x2c(%rcx), %eax
jge 0x24eae
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x2c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
movq 0x90(%rsp), %rax
addq $0x38, %rax
movslq 0x2c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, (%rax)
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x2c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movq 0x90(%rsp), %rax
addq $0x38, %rax
movslq 0x2c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x2c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x10(%rax), %xmm0
movq 0x90(%rsp), %rax
addq $0x38, %rax
movslq 0x2c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x10(%rax)
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x24de6
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x24ec7
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x90(%rsp), %rax
cmpl $0x0, 0x2c(%rax)
jne 0x24ee4
movq 0x320(%rsp), %rax
movq $0x0, (%rax)
addq $0x338, %rsp            # imm = 0x338
retq
movq 0x40(%rsp), %rdi
callq 0x4520
nopw %cs:(%rax,%rax)