// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlbsp/solidbsp.cpp
// Function: BuildBspTree_r(node_s*)
static void     BuildBspTree_r(node_t* node)
{
    surface_t*      split;
    bool            midsplit;
    surface_t*      allsurfs;
#ifdef HLBSP_MAXNODESIZE_SKYBOX
	vec3_t			validmins, validmaxs;
#endif

    midsplit = CalcNodeBounds(node
#ifdef HLBSP_MAXNODESIZE_SKYBOX
		, validmins, validmaxs
#endif
		);
#ifdef HLBSP_DETAILBRUSH_CULL
	if (node->boundsbrush)
	{
		CalcBrushBounds (node->boundsbrush, node->loosemins, node->loosemaxs);
	}
	else
	{
		VectorFill (node->loosemins, BOGUS_RANGE);
		VectorFill (node->loosemaxs, -BOGUS_RANGE);
	}
#endif

#ifdef ZHLT_DETAILBRUSH
	int splitdetaillevel = CalcSplitDetaillevel (node);
#ifdef HLCSG_HLBSP_SOLIDHINT
	FixDetaillevelForDiscardable (node, splitdetaillevel);
#endif
#endif
    split = SelectPartition(node->surfaces, node, midsplit
#ifdef ZHLT_DETAILBRUSH
		, splitdetaillevel
#endif
#ifdef HLBSP_MAXNODESIZE_SKYBOX
		, validmins, validmaxs
#endif
		);
#ifdef ZHLT_DETAILBRUSH
	if (!node->isdetail && (!split || split->detaillevel > 0))
	{
		node->isportalleaf = true;
		LinkLeafFaces (node->surfaces, node); // set contents
		if (node->contents == CONTENTS_SOLID)
		{
			split = NULL;
		}
	}
	else
	{
		node->isportalleaf = false;
	}
#endif
    if (!split)
    {                                                      // this is a leaf node
#ifdef ZHLT_DETAILBRUSH
		MakeLeaf (node);
#else
        node->planenum = PLANENUM_LEAF;
        LinkLeafFaces(node->surfaces, node);
#endif
        return;
    }

    // these are final polygons
    split->onnode = node;                                  // can't use again
    allsurfs = node->surfaces;
    node->planenum = split->planenum;
    node->faces = NULL;
    CopyFacesToNode(node, split);

    node->children[0] = AllocNode();
    node->children[1] = AllocNode();
#ifdef ZHLT_DETAILBRUSH
	node->children[0]->isdetail = split->detaillevel > 0;
	node->children[1]->isdetail = split->detaillevel > 0;
#endif

    // split all the polysurfaces into front and back lists
    SplitNodeSurfaces(allsurfs, node);
#ifdef ZHLT_DETAILBRUSH
	SplitNodeBrushes (node->detailbrushes, node);
#ifdef HLBSP_DETAILBRUSH_CULL
	if (node->boundsbrush)
	{
		for (int k = 0; k < 2; k++)
		{
			dplane_t p;
			brush_t *copy, *front, *back;
			if (k == 0)
			{ // front child
				VectorCopy (g_dplanes[split->planenum].normal, p.normal);
				p.dist = g_dplanes[split->planenum].dist - BOUNDS_EXPANSION;
			}
			else
			{ // back child
				VecSubtractVector (0, g_dplanes[split->planenum].normal, p.normal);
				p.dist = -g_dplanes[split->planenum].dist - BOUNDS_EXPANSION;
			}
			copy = NewBrushFromBrush (node->boundsbrush);
			SplitBrush (copy, &p, &front, &back);
			if (back)
			{
				FreeBrush (back);
			}
			if (!front)
			{
				Warning ("BuildBspTree_r: bounds was clipped away at (%f,%f,%f)-(%f,%f,%f).", node->loosemins[0], node->loosemins[1], node->loosemins[2], node->loosemaxs[0], node->loosemaxs[1], node->loosemaxs[2]);
			}
			node->children[k]->boundsbrush = front;
		}
		FreeBrush (node->boundsbrush);
	}
	node->boundsbrush = NULL;
#endif
#endif

#ifdef ZHLT_DETAILBRUSH
	if (!split->detaillevel)
	{
		MakeNodePortal (node);
		SplitNodePortals (node);
	}
#else
    // create the portal that seperates the two children
    MakeNodePortal(node);

    // carve the portals on the boundaries of the node
    SplitNodePortals(node);
#endif

    // recursively do the children
    BuildBspTree_r(node->children[0]);
    BuildBspTree_r(node->children[1]);
	UpdateStatus();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdi, %rbx
xorl %r14d, %r14d
cmpb $0x0, 0x48(%rdi)
jne 0x163b7
pushq $0x1
popq %rbp
movaps 0x9156(%rip), %xmm0     # 0x1f3c0
movups %xmm0, 0x50(%rbx)
movaps 0x915b(%rip), %xmm0     # 0x1f3d0
movups %xmm0, 0x70(%rbx)
movapd 0xa40f(%rip), %xmm0     # 0x20690
movupd %xmm0, 0x60(%rbx)
movq 0xb0(%rbx), %r15
leaq 0xa5f9(%rip), %r14      # 0x2088d
xorl %r12d, %r12d
testq %r15, %r15
je 0x16328
cmpq %rbx, 0x48(%r15)
je 0x162bd
movl %ebp, %eax
cmpq %rbx, 0x50(%r15)
je 0x162bf
movq %r14, %rdi
xorl %eax, %eax
callq 0x8b1f
movl %r12d, %eax
jmp 0x162bf
xorl %eax, %eax
movl %eax, %ecx
movq 0x58(%r15,%rcx,8), %rcx
xorl %edx, %edx
xorl %esi, %esi
movq 0x68(%r15), %rdi
movl 0x8(%rdi), %edi
cmpq %rdi, %rsi
jae 0x1631d
xorl %edi, %edi
cmpq $0x3, %rdi
je 0x16314
movq 0x68(%r15), %r8
movq 0x10(%r8), %r8
addq %rdx, %r8
movsd (%r8,%rdi,8), %xmm0
movsd 0x50(%rbx,%rdi,8), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x16301
movsd %xmm0, 0x50(%rbx,%rdi,8)
ucomisd 0x68(%rbx,%rdi,8), %xmm0
jbe 0x1630f
movsd %xmm0, 0x68(%rbx,%rdi,8)
incq %rdi
jmp 0x162d8
incq %rsi
addq $0x18, %rdx
jmp 0x162ca
movq %rcx, %r15
movl %eax, %r12d
jmp 0x16297
cmpb $0x0, 0x49(%rbx)
jne 0x163b4
cvtsi2sdl 0x140d2(%rip), %xmm0 # 0x2a40c
movsd 0xa3a6(%rip), %xmm1     # 0x206e8
addsd %xmm0, %xmm1
movapd 0x7eb2(%rip), %xmm2     # 0x1e200
xorpd %xmm1, %xmm2
xorl %eax, %eax
cmpq $0x3, %rax
je 0x16385
movsd 0x50(%rbx,%rax,8), %xmm3
maxsd %xmm2, %xmm3
movsd %xmm3, 0x120(%rsp,%rax,8)
movsd 0x68(%rbx,%rax,8), %xmm3
minsd %xmm1, %xmm3
movsd %xmm3, 0x100(%rsp,%rax,8)
incq %rax
jmp 0x16354
xorl %eax, %eax
movsd 0x8051(%rip), %xmm1     # 0x1e3e0
cmpq $0x3, %rax
je 0x16b17
movsd 0x100(%rsp,%rax,8), %xmm2
subsd 0x120(%rsp,%rax,8), %xmm2
incq %rax
ucomisd %xmm2, %xmm1
jb 0x1638f
xorl %r14d, %r14d
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x163cf
leaq 0x18(%rbx), %rsi
leaq 0x30(%rbx), %rdx
callq 0x134c2
jmp 0x163f2
movaps 0x8fea(%rip), %xmm0     # 0x1f3c0
movups %xmm0, 0x18(%rbx)
movaps 0xa2af(%rip), %xmm0     # 0x20690
movups %xmm0, 0x28(%rbx)
movapd 0x8fe3(%rip), %xmm0     # 0x1f3d0
movupd %xmm0, 0x38(%rbx)
movq %rbx, %rdi
callq 0x15f34
movl %eax, %r12d
movq %rbx, %rdi
movl %eax, %esi
callq 0x15f6d
cmpl $-0x1, %r12d
je 0x16700
movq (%rbx), %r15
testb %r14b, %r14b
movl %r12d, 0x50(%rsp)
je 0x16725
movsd 0x7fb6(%rip), %xmm0     # 0x1e3e0
movq %r15, %rdi
callq 0x15c6c
movsd 0x7fa6(%rip), %xmm1     # 0x1e3e0
movq %rax, 0x78(%rsp)
movsd 0xa2a9(%rip), %xmm2     # 0x206f0
xorl %r14d, %r14d
leaq 0x20bc5cf(%rip), %rcx   # 0x20d2a20
movsd 0x7fa7(%rip), %xmm3     # 0x1e400
movq %r15, %rbp
testq %rbp, %rbp
je 0x16712
cmpq $0x0, 0x40(%rbp)
jne 0x164d5
cmpl %r12d, 0x50(%rbp)
jne 0x164d5
movslq 0x8(%rbp), %r13
shlq $0x6, %r13
movslq 0x38(%rcx,%r13), %rax
cmpq $0x2, %rax
jg 0x164d0
addq %rcx, %r13
movsd 0x30(%r13), %xmm0
mulsd (%r13,%rax,8), %xmm0
movsd 0x100(%rsp,%rax,8), %xmm4
movsd %xmm4, 0x60(%rsp)
subsd %xmm0, %xmm4
movsd %xmm4, 0x30(%rsp)
ucomisd %xmm4, %xmm1
ja 0x164d0
movsd 0x120(%rsp,%rax,8), %xmm4
movsd %xmm4, 0xe0(%rsp)
subsd %xmm4, %xmm0
ucomisd %xmm0, %xmm1
jbe 0x164db
movl 0x50(%rsp), %r12d
movq (%rbp), %rbp
jmp 0x1645c
movsd %xmm0, 0x58(%rsp)
cvtsi2sdl 0x13f23(%rip), %xmm0 # 0x2a40c
mulsd 0x7cbf(%rip), %xmm0     # 0x1e1b0
addsd %xmm3, %xmm0
ucomisd 0x30(%rsp), %xmm0
ja 0x164d0
ucomisd 0x58(%rsp), %xmm0
ja 0x164d0
movsd %xmm2, 0x90(%rsp)
movq %r15, 0x88(%rsp)
movq %r14, %r12
movq 0x78(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x15e77
cvtsi2sdl 0x18(%r14), %xmm0
movsd %xmm0, 0x20(%rsp)
cvtsi2sdl 0x1c(%r14), %xmm0
movsd %xmm0, 0x80(%rsp)
movq 0x20(%r14), %rax
movq (%rax), %r14
movq 0x8(%rax), %r15
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
xorpd %xmm2, %xmm2
cmpq %r15, %r14
je 0x16603
movq (%r14), %rdi
cmpl $0x4, 0x30(%rdi)
je 0x165fa
movl 0x8(%rdi), %ecx
movl 0x8(%rbp), %eax
cmpl %eax, %ecx
je 0x165ba
xorl %ecx, %eax
cmpl $0x1, %eax
je 0x165ba
movsd %xmm2, 0x10(%rsp)
movq %r13, %rsi
xorl %edx, %edx
callq 0x17847
cmpl $0x2, %eax
je 0x165c4
cmpl $0x1, %eax
jne 0x165e0
movsd 0x80(%rsp), %xmm0
addsd 0x7a79(%rip), %xmm0     # 0x1e028
movsd %xmm0, 0x80(%rsp)
jmp 0x165d8
addsd 0x7a66(%rip), %xmm2     # 0x1e028
jmp 0x165fa
movsd 0x8(%rsp), %xmm0
addsd 0x7a56(%rip), %xmm0     # 0x1e028
movsd %xmm0, 0x8(%rsp)
movsd 0x10(%rsp), %xmm2
jmp 0x165fa
movsd 0x10(%rsp), %xmm2
movsd 0x20(%rsp), %xmm0
addsd 0x7a34(%rip), %xmm0     # 0x1e028
movsd %xmm0, 0x20(%rsp)
addq $0x8, %r14
jmp 0x1655d
movsd 0x7ba5(%rip), %xmm1     # 0x1e1b0
mulsd %xmm1, %xmm2
movsd 0x20(%rsp), %xmm0
addsd %xmm2, %xmm0
movapd %xmm2, %xmm3
movsd 0x8(%rsp), %xmm2
mulsd %xmm1, %xmm2
addsd %xmm2, %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x60(%rsp), %xmm1
subsd 0xe0(%rsp), %xmm1
movsd 0x30(%rsp), %xmm0
divsd %xmm1, %xmm0
addsd 0x80(%rsp), %xmm3
addsd %xmm2, %xmm3
movsd %xmm3, 0x10(%rsp)
movsd 0x58(%rsp), %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, 0x58(%rsp)
callq 0x4250
movapd %xmm0, %xmm1
movsd 0xa07a(%rip), %xmm0     # 0x206f8
divsd %xmm0, %xmm1
mulsd 0x20(%rsp), %xmm1
movsd %xmm1, 0x30(%rsp)
movsd 0x58(%rsp), %xmm0
callq 0x4250
divsd 0xa057(%rip), %xmm0     # 0x206f8
mulsd 0x10(%rsp), %xmm0
addsd 0x30(%rsp), %xmm0
movsd 0xa04b(%rip), %xmm1     # 0x20700
mulsd %xmm1, %xmm0
addsd 0x8(%rsp), %xmm0
movsd 0x90(%rsp), %xmm2
ucomisd %xmm2, %xmm0
minsd %xmm0, %xmm2
movq %r12, %r14
cmovbeq %rbp, %r14
movl 0x50(%rsp), %r12d
movq 0x88(%rsp), %r15
movsd 0x7cf4(%rip), %xmm1     # 0x1e3e0
leaq 0x20bc32d(%rip), %rcx   # 0x20d2a20
movsd 0x7d05(%rip), %xmm3     # 0x1e400
jmp 0x164d5
xorl %r14d, %r14d
cmpb $0x0, 0x48(%rbx)
jne 0x16b00
jmp 0x16b52
movq 0x78(%rsp), %rdi
callq 0x15ef0
testq %r14, %r14
jne 0x16afa
leaq 0xafbc88(%rip), %rax    # 0xb123b4
movslq (%rax), %rdi
shlq $0x4, %rdi
callq 0x4410
movq %rax, %r13
movsd 0x7c9d(%rip), %xmm0     # 0x1e3e0
movq %r15, %rdi
callq 0x15c6c
movq %rax, 0x78(%rsp)
movsd 0x78d0(%rip), %xmm1     # 0x1e028
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
xorpd %xmm2, %xmm2
movq %r15, 0x88(%rsp)
movq %r13, 0x58(%rsp)
testq %r15, %r15
je 0x16a72
cmpq $0x0, 0x40(%r15)
jne 0x16a6a
cmpl %r12d, 0x50(%r15)
jne 0x16a6a
andq $0x0, 0xa0(%rsp)
movslq 0x8(%r15), %rbp
leaq 0x48(%r15), %rax
xorpd %xmm3, %xmm3
movq (%rax), %rax
testq %rax, %rax
je 0x167c2
cmpl $0x4, 0x30(%rax)
movapd %xmm3, %xmm0
addsd %xmm1, %xmm0
je 0x167a6
movapd %xmm0, %xmm3
jmp 0x167a6
addsd %xmm1, %xmm2
movsd %xmm2, 0x80(%rsp)
shlq $0x6, %rbp
addq 0x127ce(%rip), %rbp     # 0x28fa8
movq 0x78(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
movsd %xmm3, 0x10(%rsp)
callq 0x15e77
movsd 0x10(%rsp), %xmm3
cvtsi2sdl 0x18(%r14), %xmm0
movsd %xmm0, 0x60(%rsp)
cvtsi2sdl 0x1c(%r14), %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0x20(%r14), %r13
movq (%r13), %r14
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
cmpq 0x8(%r13), %r14
je 0x168cc
movq (%r14), %rdi
movl 0x8(%rdi), %ecx
movl 0x8(%r15), %eax
cmpl %eax, %ecx
je 0x168b1
xorl %ecx, %eax
cmpl $0x1, %eax
je 0x168b1
movl 0x30(%rdi), %r12d
movq %rbp, %rsi
leaq 0xa0(%rsp), %rdx
callq 0x17847
cmpl $0x4, %r12d
je 0x168ab
cmpl $0x2, %eax
je 0x16883
cmpl $0x1, %eax
movsd 0x77bf(%rip), %xmm0     # 0x1e028
movsd 0x10(%rsp), %xmm3
jne 0x168ba
movsd 0x20(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x20(%rsp)
jmp 0x168b1
movsd 0x8(%rsp), %xmm0
movsd 0x7797(%rip), %xmm1     # 0x1e028
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movapd 0x30(%rsp), %xmm0
addsd %xmm1, %xmm0
movapd %xmm0, 0x30(%rsp)
movsd 0x10(%rsp), %xmm3
addq $0x8, %r14
jmp 0x16820
movsd 0x60(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x60(%rsp)
jmp 0x168b1
ucomisd 0x7b24(%rip), %xmm3     # 0x1e3f8
jb 0x168dc
sqrtsd %xmm3, %xmm4
jmp 0x168ef
movapd %xmm3, %xmm0
callq 0x4240
movsd 0x10(%rsp), %xmm3
movapd %xmm0, %xmm4
movl 0x50(%rsp), %r12d
movq 0x58(%rsp), %r13
movsd 0x7727(%rip), %xmm1     # 0x1e028
movapd 0x30(%rsp), %xmm2
movapd %xmm2, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm6, %xmm6
movapd %xmm3, %xmm5
cmpeqsd %xmm6, %xmm5
andpd %xmm5, %xmm0
andnpd %xmm2, %xmm5
orpd %xmm0, %xmm5
movapd %xmm3, %xmm0
movsd 0x787c(%rip), %xmm2     # 0x1e1b0
mulsd %xmm2, %xmm0
movapd %xmm5, %xmm7
mulsd %xmm2, %xmm7
addsd %xmm0, %xmm7
movsd 0x60(%rsp), %xmm0
addsd %xmm0, %xmm7
addsd %xmm0, %xmm3
addsd 0x20(%rsp), %xmm3
addsd %xmm5, %xmm3
divsd %xmm3, %xmm7
ucomisd 0x9da0(%rip), %xmm7     # 0x20708
jbe 0x16a20
movsd 0x9d9a(%rip), %xmm0     # 0x20710
ucomisd %xmm7, %xmm0
jbe 0x16a20
movapd %xmm7, %xmm0
xorpd 0x7874(%rip), %xmm0     # 0x1e200
movapd %xmm0, 0x60(%rsp)
movapd %xmm7, %xmm0
movsd %xmm4, 0x10(%rsp)
movapd %xmm5, 0x20(%rsp)
movapd %xmm7, 0x90(%rsp)
callq 0x4250
movapd %xmm0, 0xe0(%rsp)
movsd 0x7667(%rip), %xmm0     # 0x1e028
subsd 0x90(%rsp), %xmm0
movapd %xmm0, 0x90(%rsp)
callq 0x4250
movapd 0x60(%rsp), %xmm6
movapd 0x20(%rsp), %xmm5
movsd 0x10(%rsp), %xmm4
movsd 0x7636(%rip), %xmm1     # 0x1e028
movapd 0xe0(%rsp), %xmm2
unpcklpd 0x90(%rsp), %xmm2       # xmm2 = xmm2[0],mem[0]
unpcklpd %xmm0, %xmm6            # xmm6 = xmm6[0],xmm0[0]
mulpd %xmm2, %xmm6
divpd 0x9cac(%rip), %xmm6     # 0x206c0
movapd %xmm6, %xmm0
unpckhpd %xmm6, %xmm0            # xmm0 = xmm0[1],xmm6[1]
subsd %xmm0, %xmm6
movapd 0x30(%rsp), %xmm2
subsd %xmm4, %xmm2
movapd %xmm1, %xmm0
subsd %xmm6, %xmm0
mulsd %xmm5, %xmm0
movslq 0x8(%r15), %rax
shlq $0x4, %rax
movsd %xmm0, 0x8(%r13,%rax)
movsd 0xa0(%rsp), %xmm0
mulsd 0x9cc2(%rip), %xmm0     # 0x20718
addsd %xmm2, %xmm0
movsd %xmm0, (%r13,%rax)
movsd 0x80(%rsp), %xmm2
movq (%r15), %r15
jmp 0x16773
movsd 0x8(%rsp), %xmm0
divsd %xmm2, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x9c66(%rip), %xmm0     # 0x206f0
xorl %r14d, %r14d
movq 0x88(%rsp), %rcx
testq %rcx, %rcx
je 0x16ad5
cmpq $0x0, 0x40(%rcx)
jne 0x16ad0
cmpl %r12d, 0x50(%rcx)
jne 0x16ad0
movslq 0x8(%rcx), %rax
shlq $0x4, %rax
movsd 0x8(%r13,%rax), %xmm1
mulsd 0x8(%rsp), %xmm1
addsd (%r13,%rax), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x16ad0
movapd %xmm1, %xmm0
movq %rcx, %r14
movq (%rcx), %rcx
jmp 0x16a95
testq %r14, %r14
jne 0x16ae8
leaq 0x9dcd(%rip), %rdi      # 0x208ae
xorl %eax, %eax
callq 0x8b1f
movq %r13, %rdi
callq 0x4390
movq 0x78(%rsp), %rdi
callq 0x15ef0
cmpb $0x0, 0x48(%rbx)
je 0x16b09
movb $0x0, 0x49(%rbx)
jmp 0x16e27
testq %r14, %r14
je 0x16b4f
cmpl $0x0, 0x50(%r14)
jg 0x16b52
jmp 0x16b00
addsd 0x78c1(%rip), %xmm0     # 0x1e3e0
xorl %eax, %eax
cmpq $0x3, %rax
setne %r14b
je 0x163b7
movsd 0x100(%rsp,%rax,8), %xmm1
subsd 0x120(%rsp,%rax,8), %xmm1
incq %rax
ucomisd %xmm0, %xmm1
jbe 0x16b21
jmp 0x163b7
xorl %r14d, %r14d
movq %r14, 0x60(%rsp)
movb $0x1, 0x49(%rbx)
movq (%rbx), %r13
pushq $-0x1
popq %r14
movq %r13, %r15
movl %r14d, %ebp
testq %r15, %r15
je 0x16bad
cmpq $0x0, 0x40(%r15)
je 0x16ba8
leaq 0x48(%r15), %r12
movq (%r12), %r12
testq %r12, %r12
je 0x16ba8
movl 0x10(%r12), %edi
cmpl $-0x10, %edi
jne 0x16b94
orl $-0x1, 0x10(%r12)
movl %r14d, %edi
cmpl $0x0, 0x14(%r12)
jne 0x16b78
callq 0x179a4
cmpl %ebp, %eax
cmovgl %eax, %ebp
jmp 0x16b78
movq (%r15), %r15
jmp 0x16b68
movl %ebp, 0x30(%rsp)
movq %r13, %r15
movl 0x30(%rsp), %ebp
testq %r15, %r15
je 0x16e0e
cmpq $0x0, 0x40(%r15)
je 0x16bed
leaq 0x48(%r15), %r12
movq (%r12), %r12
testq %r12, %r12
je 0x16bed
cmpl $0x0, 0x14(%r12)
jne 0x16bcc
movl 0x10(%r12), %edi
callq 0x179a4
cmpl %ebp, %eax
je 0x16bcc
jmp 0x16bf2
movq (%r15), %r15
jmp 0x16bb8
movl %eax, %r14d
movq %r13, 0x10(%rsp)
leaq 0x1382f(%rip), %r15     # 0x2a430
movl (%r15), %edi
decl %edi
callq 0x7277
movq %rax, %r12
cmpl $0x1, (%r15)
setne 0x8(%rsp)
cmpq 0x123ba(%rip), %rax     # 0x28fd8
movl %ebp, %r13d
sete %bpl
movl %r14d, %edi
callq 0x179dc
movl %eax, %edi
callq 0x160fa
movq %rax, 0x20(%rsp)
movl %r13d, %edi
callq 0x179dc
movl %eax, %edi
callq 0x160fa
movq %rax, %rdx
movsd 0x50(%rbx), %xmm0
movsd 0x58(%rbx), %xmm1
movsd 0x60(%rbx), %xmm2
movsd 0x68(%rbx), %xmm3
movsd 0x70(%rbx), %xmm4
movsd 0x78(%rbx), %xmm5
leaq 0x20b6d90(%rip), %rax   # 0x20cda00
movl (%rax), %ecx
movl (%r15), %r13d
decl %r13d
leaq 0x96ff(%rip), %r14      # 0x2037e
movq %r14, %r15
movq %r14, %r10
testq %r12, %r12
je 0x16d48
andb 0x8(%rsp), %bpl
movq 0x10(%rsp), %rbp
jne 0x16d4d
leaq 0x48b0(%rip), %rsi      # 0x1b555
movq %r12, %rdi
movq %rdx, 0x8(%rsp)
movsd %xmm0, 0x80(%rsp)
movsd %xmm1, 0x50(%rsp)
movsd %xmm2, 0x78(%rsp)
movsd %xmm3, 0x58(%rsp)
movsd %xmm4, 0xe0(%rsp)
movsd %xmm5, 0x90(%rsp)
movl %ecx, 0x88(%rsp)
callq 0x691b
movq %rax, %r15
leaq 0x4952(%rip), %rsi      # 0x1b642
movq %r12, %rdi
callq 0x691b
movq %rax, %r14
leaq 0x49ce(%rip), %rsi      # 0x1b6d0
movq %r12, %rdi
callq 0x691b
movl 0x88(%rsp), %ecx
movsd 0x90(%rsp), %xmm5
movsd 0xe0(%rsp), %xmm4
movsd 0x58(%rsp), %xmm3
movsd 0x78(%rsp), %xmm2
movsd 0x50(%rsp), %xmm1
movsd 0x80(%rsp), %xmm0
movq 0x8(%rsp), %rdx
movq %rax, %r10
jmp 0x16d4d
movq 0x10(%rsp), %rbp
leaq 0x9b7f(%rip), %rdi      # 0x208d3
movq 0x20(%rsp), %rsi
movl %r13d, %r8d
movq %r15, %r9
movb $0x6, %al
pushq %r10
pushq %r14
callq 0x8e95
popq %rax
popq %rcx
pushq $0x5
popq %r12
leaq 0x9c19(%rip), %r13      # 0x20990
testq %rbp, %rbp
je 0x16e0e
movq %rbp, 0x10(%rsp)
addq $0x48, %rbp
movq (%rbp), %rbp
testq %rbp, %rbp
je 0x16e00
movl 0x10(%rbp), %edx
movslq 0x8(%rbp), %rcx
movq %rcx, %rax
shlq $0x6, %rax
leaq 0x20bbc79(%rip), %rsi   # 0x20d2a20
movsd (%rsi,%rax), %xmm0
movsd 0x8(%rsi,%rax), %xmm1
movsd 0x10(%rsi,%rax), %xmm2
movl %r12d, %edi
leaq 0x9bad(%rip), %rsi      # 0x2096f
movb $0x3, %al
callq 0x9035
leaq 0x48(%rbp), %r15
xorl %r14d, %r14d
movslq 0x2c(%rbp), %rax
cmpq %rax, %r14
jge 0x16d89
movsd -0x10(%r15), %xmm0
movsd -0x8(%r15), %xmm1
movsd (%r15), %xmm2
movl %r12d, %edi
movq %r13, %rsi
movb $0x3, %al
callq 0x9035
incq %r14
addq $0x18, %r15
jmp 0x16dd0
movq 0x10(%rsp), %rbp
movq (%rbp), %rbp
jmp 0x16d77
movl 0x30(%rsp), %edi
callq 0x179dc
movl %eax, 0xa0(%rbx)
cmpl $-0x2, %eax
movq 0x60(%rsp), %r14
je 0x16e6e
testq %r14, %r14
je 0x16e6e
movq %rbx, 0x40(%r14)
movq (%rbx), %rbp
movl 0x8(%r14), %eax
movl %eax, 0x80(%rbx)
andq $0x0, 0x98(%rbx)
movq %r14, %rdi
callq 0x10b2c
movq %r14, 0x60(%rsp)
leaq 0x48(%r14), %r15
movq %r15, %r14
movq (%r14), %rdi
testq %rdi, %rdi
je 0x16e7b
movq %r14, %rsi
callq 0x17c9c
movq (%r14), %r14
jmp 0x16e59
movq %rbx, %rdi
callq 0x17729
jmp 0x17701
andq $0x0, (%rbx)
xorl %r14d, %r14d
movq %r14, 0x98(%rbx)
movq (%r15), %r15
testq %r15, %r15
je 0x16ec7
cmpl $0x4, 0x30(%r15)
je 0x16e89
cmpl $-0x2, 0x10(%r15)
je 0x16e89
callq 0x12917
movq %rax, %r14
movl $0x4b8, %edx            # imm = 0x4B8
movq %rax, %rdi
movq %r15, %rsi
callq 0x4260
movq %r14, 0x20(%r15)
movq 0x98(%rbx), %rax
movq %rax, (%r14)
jmp 0x16e82
callq 0x1357c
movq %rax, 0x88(%rbx)
callq 0x1357c
movq %rax, 0x90(%rbx)
movq 0x60(%rsp), %rcx
cmpl $0x0, 0x50(%rcx)
movq 0x88(%rbx), %rax
setg 0x48(%rax)
cmpl $0x0, 0x50(%rcx)
movq 0x90(%rbx), %rax
setg 0x48(%rax)
movslq 0x80(%rbx), %r15
shlq $0x6, %r15
addq 0x12094(%rip), %r15     # 0x28fa8
leaq 0x20bbb05(%rip), %rsi   # 0x20d2a20
leaq 0x48(%rsp), %r12
movq $0x0, 0x20(%rsp)
movq $0x0, 0x8(%rsp)
movq %rbp, %r14
testq %r14, %r14
je 0x17108
movq (%r14), %rbp
movslq 0x8(%r14), %rax
shlq $0x6, %rax
movsd (%rsi,%rax), %xmm0
ucomisd (%r15), %xmm0
jne 0x16fcd
jp 0x16fcd
addq %rsi, %rax
movsd 0x8(%rax), %xmm0
ucomisd 0x8(%r15), %xmm0
jne 0x16fcd
jp 0x16fcd
movsd 0x10(%rax), %xmm0
ucomisd 0x10(%r15), %xmm0
jne 0x16fcd
jp 0x16fcd
movsd 0x30(%rax), %xmm0
movsd 0x30(%r15), %xmm1
ucomisd %xmm1, %xmm0
ja 0x170a1
ucomisd %xmm0, %xmm1
ja 0x17090
movq %r14, 0x30(%rsp)
movq 0x48(%r14), %rax
xorl %r14d, %r14d
xorl %r13d, %r13d
testq %rax, %rax
je 0x1703a
movq (%rax), %rcx
testb $0x1, 0x8(%rax)
movq %r13, %rdx
cmoveq %r14, %rdx
cmoveq %rax, %r14
cmovneq %rax, %r13
movq %rdx, (%rax)
movq %rcx, %rax
jmp 0x16fa6
movq %rbp, 0x10(%rsp)
movq %r14, 0x30(%rsp)
movq 0x48(%r14), %rbp
xorl %r14d, %r14d
xorl %r13d, %r13d
movq %rbp, %rdi
testq %rdi, %rdi
je 0x1702e
movq (%rdi), %rbp
movq %r15, %rsi
leaq 0xa0(%rsp), %rdx
movq %r12, %rcx
callq 0x1292b
movq 0xa0(%rsp), %rax
testq %rax, %rax
je 0x17017
movq %r14, (%rax)
movq 0xa0(%rsp), %r14
movq 0x48(%rsp), %rax
movq %rbp, %rdi
testq %rax, %rax
je 0x16fe4
movq %r13, (%rax)
movq 0x48(%rsp), %r13
jmp 0x16fe1
leaq 0x20bb9eb(%rip), %rsi   # 0x20d2a20
movq 0x10(%rsp), %rbp
movq %r14, %rax
orq %r13, %rax
jne 0x17047
xorl %r14d, %r14d
jmp 0x17090
testq %r14, %r14
je 0x17087
testq %r13, %r13
je 0x17095
callq 0x12fa8
pushq $0xb
popq %rcx
movq %rax, %rdi
movq 0x30(%rsp), %rdx
movq %rdx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r13, 0x48(%rax)
movq %rax, %r13
movq %r14, 0x48(%rdx)
movq %rdx, %r14
movq %rax, %rdi
callq 0x16022
movq %r14, %rdi
callq 0x16022
jmp 0x170a4
movq 0x30(%rsp), %r14
movq %r13, 0x48(%r14)
movq %r14, %r13
jmp 0x170cd
movq 0x30(%rsp), %rax
movq %r14, 0x48(%rax)
movq %rax, %r14
xorl %r13d, %r13d
cmpq $0x0, 0x48(%r14)
jne 0x170b9
leaq 0x9928(%rip), %rdi      # 0x209da
xorl %eax, %eax
callq 0x8b1f
movq 0x20(%rsp), %rax
movq %rax, (%r14)
movq %r14, 0x20(%rsp)
leaq 0x20bb953(%rip), %rsi   # 0x20d2a20
movq %rbp, %r14
testq %r13, %r13
je 0x16f35
cmpq $0x0, 0x48(%r13)
jne 0x170f5
leaq 0x98f3(%rip), %rdi      # 0x209da
xorl %eax, %eax
callq 0x8b1f
leaq 0x20bb92b(%rip), %rsi   # 0x20d2a20
movq 0x8(%rsp), %rax
movq %rax, (%r13)
movq %r13, 0x8(%rsp)
jmp 0x16f32
movq 0x88(%rbx), %rax
movq 0x20(%rsp), %rcx
movq %rcx, (%rax)
movq 0x90(%rbx), %rax
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
movq 0x8(%rbx), %rbp
movslq 0x80(%rbx), %r14
shlq $0x6, %r14
addq 0x11e6c(%rip), %r14     # 0x28fa8
movq $0x0, 0x10(%rsp)
leaq 0xa0(%rsp), %r15
leaq 0x48(%rsp), %r12
xorl %r13d, %r13d
movq %rbp, %rdi
testq %rdi, %rdi
je 0x171a7
movq (%rdi), %rbp
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x131f3
movq 0xa0(%rsp), %rax
testq %rax, %rax
je 0x17186
movq %r13, (%rax)
movq 0xa0(%rsp), %r13
movq 0x48(%rsp), %rax
movq %rbp, %rdi
testq %rax, %rax
je 0x17158
movq 0x10(%rsp), %rcx
movq %rcx, (%rax)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x17155
movq 0x88(%rbx), %rax
movq %r13, 0x8(%rax)
movq 0x90(%rbx), %rax
movq 0x10(%rsp), %rcx
movq %rcx, 0x8(%rax)
cmpq $0x0, 0x10(%rbx)
je 0x1732c
xorl %r14d, %r14d
leaq 0xa0(%rsp), %r15
leaq 0x48(%rsp), %r12
leaq 0xf8(%rsp), %r13
leaq 0x965f(%rip), %rbp      # 0x2084b
cmpq $0x2, %r14
leaq 0x20bb829(%rip), %rdx   # 0x20d2a20
je 0x17323
movq 0x60(%rsp), %rcx
movslq 0x8(%rcx), %rax
shlq $0x6, %rax
movsd (%rdx,%rax), %xmm0
testq %r14, %r14
je 0x1725e
movhpd 0x8(%rdx,%rax), %xmm0   # xmm0 = xmm0[0],mem[0]
xorpd %xmm1, %xmm1
subpd %xmm0, %xmm1
movapd %xmm1, 0xa0(%rsp)
movslq 0x8(%rcx), %rax
shlq $0x6, %rax
xorpd %xmm0, %xmm0
subsd 0x10(%rdx,%rax), %xmm0
movsd %xmm0, 0xb0(%rsp)
movslq 0x8(%rcx), %rax
shlq $0x6, %rax
movsd 0x6f72(%rip), %xmm0     # 0x1e1c8
subsd 0x30(%rdx,%rax), %xmm0
jmp 0x172a3
movsd %xmm0, 0xa0(%rsp)
movsd 0x8(%rdx,%rax), %xmm0
movsd %xmm0, 0xa8(%rsp)
movslq 0x8(%rcx), %rax
shlq $0x6, %rax
movsd 0x10(%rdx,%rax), %xmm0
movsd %xmm0, 0xb0(%rsp)
movslq 0x8(%rcx), %rax
shlq $0x6, %rax
movsd 0x30(%rdx,%rax), %xmm0
addsd 0x6f25(%rip), %xmm0     # 0x1e1c8
movsd %xmm0, 0xd0(%rsp)
movq 0x10(%rbx), %rdi
callq 0x13099
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x131f3
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x172d8
callq 0x13068
movq 0x48(%rsp), %rax
testq %rax, %rax
jne 0x1730f
movsd 0x18(%rbx), %xmm0
movsd 0x20(%rbx), %xmm1
movsd 0x28(%rbx), %xmm2
movsd 0x30(%rbx), %xmm3
movsd 0x38(%rbx), %xmm4
movsd 0x40(%rbx), %xmm5
movq %rbp, %rdi
movb $0x6, %al
callq 0x8e95
movq 0x48(%rsp), %rax
movq 0x88(%rbx,%r14,8), %rcx
movq %rax, 0x10(%rcx)
incq %r14
jmp 0x171ec
movq 0x10(%rbx), %rdi
callq 0x13068
andq $0x0, 0x10(%rbx)
movq 0x60(%rsp), %rax
cmpl $0x0, 0x50(%rax)
jne 0x176ac
movslq 0x80(%rbx), %r12
shlq $0x6, %r12
addq 0x11c56(%rip), %r12     # 0x28fa8
pushq $0x20
popq %rdi
callq 0x42f0
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
callq 0xb018
callq 0x12fb8
movups (%r12), %xmm0
movupd 0x10(%r12), %xmm1
movupd 0x20(%r12), %xmm2
movupd 0x30(%r12), %xmm3
movups %xmm0, (%rax)
movupd %xmm1, 0x10(%rax)
movupd %xmm2, 0x20(%rax)
movupd %xmm3, 0x30(%rax)
movq %rax, 0x20(%rsp)
movq %rbx, 0x40(%rax)
leaq 0xb0(%rbx), %rcx
leaq 0x5980(%rip), %rax      # 0x1cd30
movaps (%rax), %xmm0
movaps %xmm0, 0x10(%rsp)
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
leaq 0xa0(%rsp), %r12
pushq $0x1
popq %r14
xorl %ebp, %ebp
movq %rcx, 0x60(%rsp)
movq %rcx, %rax
movq (%rax), %r13
testq %r13, %r13
je 0x174bb
movupd (%r13), %xmm0
movupd 0x10(%r13), %xmm1
movupd 0x20(%r13), %xmm2
movupd 0x30(%r13), %xmm3
movapd %xmm3, 0xd0(%rsp)
movapd %xmm2, 0xc0(%rsp)
movapd %xmm1, 0xb0(%rsp)
movapd %xmm0, 0xa0(%rsp)
cmpq %rbx, 0x48(%r13)
je 0x1743d
cmpq %rbx, 0x50(%r13)
je 0x17441
leaq 0x95bc(%rip), %rdi      # 0x209f0
xorl %eax, %eax
callq 0x8b1f
jmp 0x1748c
xorl %ebp, %ebp
jmp 0x1748c
movsd 0xd0(%rsp), %xmm0
xorps 0x6daf(%rip), %xmm0     # 0x1e200
movlps %xmm0, 0xd0(%rsp)
movapd 0x10(%rsp), %xmm0
subpd 0xa0(%rsp), %xmm0
movapd %xmm0, 0xa0(%rsp)
movsd 0x30(%rsp), %xmm0
subsd 0xb0(%rsp), %xmm0
movsd %xmm0, 0xb0(%rsp)
movl %r14d, %ebp
movq %r15, %rdi
movq %r12, %rsi
movl %r14d, %edx
movsd 0x6f43(%rip), %xmm0     # 0x1e3e0
callq 0xb666
cmpl $0x0, 0x8(%r15)
je 0x174d9
movl %ebp, %eax
leaq 0x58(,%rax,8), %rax
addq %r13, %rax
jmp 0x173d9
movq 0x20(%rsp), %rdi
movq %r15, 0x68(%rdi)
movq 0x88(%rbx), %rsi
movq 0x90(%rbx), %rdx
callq 0x11d8c
jmp 0x17512
movsd 0x50(%rbx), %xmm0
movsd 0x58(%rbx), %xmm1
movsd 0x60(%rbx), %xmm2
movsd 0x68(%rbx), %xmm3
movsd 0x70(%rbx), %xmm4
movsd 0x78(%rbx), %xmm5
leaq 0x9513(%rip), %rsi      # 0x20a11
pushq $0x2
popq %rdi
movb $0x6, %al
callq 0x9035
movq 0x20(%rsp), %rdi
callq 0x12fc3
movslq 0x80(%rbx), %rax
shlq $0x6, %rax
addq 0x11a84(%rip), %rax     # 0x28fa8
movq %rax, 0x10(%rsp)
movq 0x88(%rbx), %rax
movq %rax, 0x20(%rsp)
movq 0x90(%rbx), %rax
movq %rax, 0x30(%rsp)
movq 0xb0(%rbx), %rbp
xorl %r13d, %r13d
testq %rbp, %rbp
je 0x176a3
movq %rbp, %r15
movq 0x48(%rbp), %rsi
cmpq %rbx, %rsi
je 0x17581
pushq $0x1
popq %r14
cmpq %rbx, 0x50(%r15)
je 0x17584
leaq 0x94f7(%rip), %rdi      # 0x20a68
xorl %eax, %eax
callq 0x8b1f
movq 0x48(%r15), %rsi
movl %r13d, %r14d
jmp 0x17584
xorl %r14d, %r14d
movl %r14d, %eax
movq 0x58(%r15,%rax,8), %rbp
xorl %eax, %eax
testl %r14d, %r14d
sete %al
movq 0x48(%r15,%rax,8), %r12
movq %r15, %rdi
callq 0x11de8
movq 0x50(%r15), %rsi
movq %r15, %rdi
callq 0x11de8
movq 0x68(%r15), %rdi
movq 0x10(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
leaq 0x48(%rsp), %rcx
movsd 0x6e15(%rip), %xmm0     # 0x1e3e0
callq 0xb98c
movq 0xa0(%rsp), %rcx
movq 0x48(%rsp), %rax
movq %rcx, %rdx
orq %rax, %rdx
movl %r14d, %r13d
je 0x1754b
testq %rcx, %rcx
je 0x17648
testq %rax, %rax
je 0x1765a
callq 0x12fb8
movq %rax, %r13
pushq $0xd
popq %rcx
movq %rax, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq 0x48(%rsp), %rax
movq %rax, 0x68(%r13)
movq 0x68(%r15), %rdi
testq %rdi, %rdi
je 0x17622
movq (%rdi), %rax
callq *0x8(%rax)
movq 0xa0(%rsp), %rax
movq %rax, 0x68(%r15)
testl %r14d, %r14d
je 0x1766c
movq %r15, %rdi
movq %r12, %rsi
movq 0x20(%rsp), %rdx
callq 0x11d8c
movq %r13, %rdi
jmp 0x17650
testl %r14d, %r14d
je 0x17681
movq %r15, %rdi
movq %r12, %rsi
movq 0x30(%rsp), %rdx
jmp 0x17696
testl %r14d, %r14d
je 0x1768b
movq %r15, %rdi
movq %r12, %rsi
movq 0x20(%rsp), %rdx
jmp 0x17696
movq %r15, %rdi
movq 0x20(%rsp), %rsi
movq %r12, %rdx
callq 0x11d8c
movq %r13, %rdi
jmp 0x17684
movq %r15, %rdi
movq 0x30(%rsp), %rsi
jmp 0x17693
movq %r15, %rdi
movq 0x20(%rsp), %rsi
movq %r12, %rdx
callq 0x11d8c
movl %r14d, %r13d
jmp 0x1754b
movq 0x60(%rsp), %rax
andq $0x0, (%rax)
movq 0x88(%rbx), %rdi
callq 0x1623f
movq 0x90(%rbx), %rdi
callq 0x1623f
cmpb $0x1, 0x32bb399(%rip)   # 0x32d2a64
jne 0x17701
movl 0x32bb38d(%rip), %esi   # 0x32d2a60
incl %esi
movl %esi, 0x32bb385(%rip)   # 0x32d2a60
movl $0x1f4, %ecx            # imm = 0x1F4
movl %esi, %eax
cltd
idivl %ecx
cmpl 0x32bb37d(%rip), %eax   # 0x32d2a68
jle 0x17701
movl %eax, 0x32bb375(%rip)   # 0x32d2a68
leaq 0x9391(%rip), %rdi      # 0x20a8b
xorl %eax, %eax
callq 0x8780
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x20
popq %rsi
movq %r15, %rdi
callq 0x4300
movq %rbx, %rdi
callq 0x4550