// File: /workspace/github_cpp_makefile_star2_O3/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
cmpb $0x0, 0x48(%rdi)
jne 0x1857d
movaps 0x8fb8(%rip), %xmm0     # 0x21460
movups %xmm0, 0x50(%rbx)
movaps 0x8fbd(%rip), %xmm0     # 0x21470
movups %xmm0, 0x70(%rbx)
movapd 0xa271(%rip), %xmm0     # 0x22730
movupd %xmm0, 0x60(%rbx)
movq 0xb0(%rbx), %rcx
testq %rcx, %rcx
je 0x18573
leaq 0xa452(%rip), %r14      # 0x2292d
xorl %eax, %eax
movq %rcx, %r15
movl %eax, %ebp
movl $0x0, %eax
cmpq %rbx, 0x48(%rcx)
je 0x18506
cmpq %rbx, 0x50(%r15)
je 0x18501
movq %r14, %rdi
xorl %eax, %eax
callq 0x9e9c
movl %ebp, %eax
jmp 0x18506
movl $0x1, %eax
movl %eax, %ecx
movq 0x58(%r15,%rcx,8), %rcx
movq 0x68(%r15), %rdx
cmpl $0x0, 0x8(%rdx)
je 0x1856a
xorl %edx, %edx
xorl %esi, %esi
xorl %edi, %edi
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 0x18540
movsd %xmm0, 0x50(%rbx,%rdi,8)
ucomisd 0x68(%rbx,%rdi,8), %xmm0
jbe 0x1854e
movsd %xmm0, 0x68(%rbx,%rdi,8)
incq %rdi
cmpq $0x3, %rdi
jne 0x1851d
incq %rsi
movq 0x68(%r15), %rdi
movl 0x8(%rdi), %edi
addq $0x18, %rdx
cmpq %rdi, %rsi
jb 0x1851b
testq %rcx, %rcx
jne 0x184dd
cmpb $0x0, 0x49(%rbx)
je 0x18921
xorl %ebp, %ebp
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x18597
leaq 0x18(%rbx), %rsi
leaq 0x30(%rbx), %rdx
callq 0x153fc
jmp 0x185ba
movaps 0x8ec2(%rip), %xmm0     # 0x21460
movups %xmm0, 0x18(%rbx)
movaps 0xa187(%rip), %xmm0     # 0x22730
movups %xmm0, 0x28(%rbx)
movapd 0x8ebb(%rip), %xmm0     # 0x21470
movupd %xmm0, 0x38(%rbx)
movq %rbx, %rdi
callq 0x18156
movl %eax, %r12d
movq %rbx, %rdi
movl %eax, %esi
callq 0x18195
movq (%rbx), %rax
movq %rax, 0x8(%rsp)
cmpl $-0x1, %r12d
je 0x1890a
testb %bpl, %bpl
movq 0x8(%rsp), %r14
je 0x189e8
movsd 0x7e89(%rip), %xmm0     # 0x20480
movq %r14, %rdi
callq 0x17e02
movq %rax, %r15
testq %r14, %r14
je 0x189e0
movsd 0xa17d(%rip), %xmm2     # 0x22790
xorl %r13d, %r13d
leaq 0x20bb3f3(%rip), %rcx   # 0x20d3a10
movsd 0x7e7b(%rip), %xmm3     # 0x204a0
movq %r14, %rbp
movsd 0x7e50(%rip), %xmm1     # 0x20480
cmpq $0x0, 0x40(%rbp)
jne 0x188e2
cmpl %r12d, 0x50(%rbp)
jne 0x188e2
movslq 0x8(%rbp), %r14
shlq $0x6, %r14
movslq 0x38(%rcx,%r14), %rax
cmpq $0x2, %rax
jg 0x188e2
addq %rcx, %r14
movsd 0x30(%r14), %xmm0
mulsd (%r14,%rax,8), %xmm0
movsd 0x100(%rsp,%rax,8), %xmm4
movsd %xmm4, 0x80(%rsp)
subsd %xmm0, %xmm4
movsd %xmm4, 0x20(%rsp)
ucomisd %xmm4, %xmm1
ja 0x188e2
movsd 0x120(%rsp,%rax,8), %xmm4
movsd %xmm4, 0x70(%rsp)
subsd %xmm4, %xmm0
ucomisd %xmm0, %xmm1
ja 0x188e2
movsd %xmm0, 0x38(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x12d3d(%rip), %xmm0 # 0x2b3fc
mulsd 0x7b89(%rip), %xmm0     # 0x20250
addsd %xmm3, %xmm0
ucomisd 0x20(%rsp), %xmm0
ja 0x188e2
ucomisd 0x38(%rsp), %xmm0
ja 0x188e2
movsd %xmm2, 0xd0(%rsp)
movl %r12d, 0x78(%rsp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x1807a
xorps %xmm0, %xmm0
cvtsi2sdl 0x18(%r15), %xmm0
movsd %xmm0, 0x50(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x1c(%r15), %xmm0
movsd %xmm0, 0x68(%rsp)
movq %r15, 0xe0(%rsp)
movq 0x20(%r15), %rax
movq (%rax), %r12
movq 0x8(%rax), %r15
cmpq %r15, %r12
je 0x187e2
xorpd %xmm2, %xmm2
xorpd %xmm0, %xmm0
movsd %xmm0, 0x48(%rsp)
movq (%r12), %rdi
cmpl $0x4, 0x30(%rdi)
je 0x187d3
movl 0x8(%rdi), %ecx
movl 0x8(%rbp), %eax
cmpl %eax, %ecx
je 0x18793
xorl %ecx, %eax
cmpl $0x1, %eax
je 0x18793
movsd %xmm2, 0x10(%rsp)
movq %r14, %rsi
xorl %edx, %edx
callq 0x19b6f
cmpl $0x2, %eax
je 0x1879d
cmpl $0x1, %eax
jne 0x187b9
movsd 0x68(%rsp), %xmm0
addsd 0x793d(%rip), %xmm0     # 0x200c8
movsd %xmm0, 0x68(%rsp)
jmp 0x187b1
addsd 0x792d(%rip), %xmm2     # 0x200c8
jmp 0x187d3
movsd 0x48(%rsp), %xmm0
addsd 0x791d(%rip), %xmm0     # 0x200c8
movsd %xmm0, 0x48(%rsp)
movsd 0x10(%rsp), %xmm2
jmp 0x187d3
movsd 0x10(%rsp), %xmm2
movsd 0x50(%rsp), %xmm0
addsd 0x78fb(%rip), %xmm0     # 0x200c8
movsd %xmm0, 0x50(%rsp)
addq $0x8, %r12
cmpq %r15, %r12
jne 0x18744
jmp 0x187f0
xorpd %xmm0, %xmm0
movsd %xmm0, 0x48(%rsp)
xorpd %xmm2, %xmm2
movsd 0x7a58(%rip), %xmm1     # 0x20250
mulsd %xmm1, %xmm2
movsd 0x50(%rsp), %xmm0
addsd %xmm2, %xmm0
movapd %xmm2, %xmm3
movsd 0x48(%rsp), %xmm2
mulsd %xmm1, %xmm2
addsd %xmm2, %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x80(%rsp), %xmm1
subsd 0x70(%rsp), %xmm1
movsd 0x20(%rsp), %xmm0
divsd %xmm1, %xmm0
addsd 0x68(%rsp), %xmm3
addsd %xmm2, %xmm3
movsd %xmm3, 0x10(%rsp)
movsd 0x38(%rsp), %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, 0x38(%rsp)
callq 0x4250
movapd %xmm0, %xmm1
movsd 0x9f30(%rip), %xmm0     # 0x22798
divsd %xmm0, %xmm1
mulsd 0x50(%rsp), %xmm1
movsd %xmm1, 0x20(%rsp)
movsd 0x38(%rsp), %xmm0
callq 0x4250
divsd 0x9f0d(%rip), %xmm0     # 0x22798
mulsd 0x10(%rsp), %xmm0
addsd 0x20(%rsp), %xmm0
movsd 0x9f01(%rip), %xmm1     # 0x227a0
mulsd %xmm1, %xmm0
addsd 0x48(%rsp), %xmm0
movsd 0xd0(%rsp), %xmm2
ucomisd %xmm2, %xmm0
minsd %xmm0, %xmm2
cmovbeq %rbp, %r13
movl 0x78(%rsp), %r12d
movsd 0x7bb5(%rip), %xmm1     # 0x20480
movq 0xe0(%rsp), %r15
leaq 0x20bb136(%rip), %rcx   # 0x20d3a10
movsd 0x7bbe(%rip), %xmm3     # 0x204a0
movq (%rbp), %rbp
testq %rbp, %rbp
jne 0x18630
movq %r15, %rdi
callq 0x18104
testq %r13, %r13
movq 0x8(%rsp), %r14
jne 0x18e06
jmp 0x189e8
xorl %r13d, %r13d
cmpb $0x0, 0x48(%rbx)
movq 0x8(%rsp), %rbp
jne 0x18e0c
jmp 0x18e24
xorps %xmm0, %xmm0
cvtsi2sdl 0x12ad0(%rip), %xmm0 # 0x2b3fc
movsd 0x9e54(%rip), %xmm1     # 0x22788
addsd %xmm0, %xmm1
movapd 0x7970(%rip), %xmm2     # 0x202b0
xorpd %xmm1, %xmm2
xorl %eax, %eax
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
cmpq $0x3, %rax
jne 0x18946
xorl %eax, %eax
movsd 0x7b01(%rip), %xmm1     # 0x20480
movsd 0x100(%rsp,%rax,8), %xmm2
subsd 0x120(%rsp,%rax,8), %xmm2
ucomisd %xmm2, %xmm1
jae 0x1857d
incq %rax
cmpq $0x3, %rax
jne 0x1897f
addsd 0x7ad4(%rip), %xmm0     # 0x20480
xorl %eax, %eax
movsd 0x100(%rsp,%rax,8), %xmm1
subsd 0x120(%rsp,%rax,8), %xmm1
ucomisd %xmm0, %xmm1
seta %bpl
ja 0x1857f
leaq 0x1(%rax), %rcx
cmpq $0x2, %rax
movq %rcx, %rax
jne 0x189ae
jmp 0x1857f
movq %r15, %rdi
callq 0x18104
leaq 0xafa9b5(%rip), %rax    # 0xb133a4
movslq (%rax), %rdi
shlq $0x4, %rdi
callq 0x4400
movq %rax, %rbp
movsd 0x7a7a(%rip), %xmm0     # 0x20480
movq %r14, %rdi
callq 0x17e02
movq %rax, 0x68(%rsp)
testq %r14, %r14
je 0x18de3
movsd 0x76a4(%rip), %xmm1     # 0x200c8
movq %r14, %r15
xorpd %xmm2, %xmm2
xorpd %xmm0, %xmm0
movsd %xmm0, 0x38(%rsp)
movl %r12d, 0x78(%rsp)
movq %rbp, 0x70(%rsp)
cmpq $0x0, 0x40(%r15)
jne 0x18d7b
cmpl %r12d, 0x50(%r15)
jne 0x18d7b
addsd %xmm1, %xmm2
movq $0x0, 0x90(%rsp)
movq 0x48(%r15), %rax
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
xorpd %xmm3, %xmm3
testq %rax, %rax
je 0x18a92
cmpl $0x4, 0x30(%rax)
movapd %xmm3, %xmm0
addsd %xmm1, %xmm0
je 0x18a8d
movapd %xmm0, %xmm3
movq (%rax), %rax
jmp 0x18a76
movsd %xmm3, 0x10(%rsp)
movsd %xmm2, 0x48(%rsp)
movslq 0x8(%r15), %rbp
shlq $0x6, %rbp
addq 0x114fb(%rip), %rbp     # 0x29fa8
movq 0x68(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
callq 0x1807a
xorps %xmm0, %xmm0
cvtsi2sdl 0x18(%r14), %xmm0
movsd %xmm0, 0x50(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x1c(%r14), %xmm0
movsd %xmm0, 0x80(%rsp)
movq 0x20(%r14), %r12
movq (%r12), %r14
cmpq 0x8(%r12), %r14
je 0x18bc3
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movsd 0x75c5(%rip), %xmm1     # 0x200c8
movsd 0x10(%rsp), %xmm3
movq (%r14), %rdi
movl 0x8(%rdi), %ecx
movl 0x8(%r15), %eax
cmpl %eax, %ecx
je 0x18bb2
xorl %ecx, %eax
cmpl $0x1, %eax
je 0x18bb2
movl 0x30(%rdi), %r13d
movq %rbp, %rsi
leaq 0x90(%rsp), %rdx
callq 0x19b6f
cmpl $0x4, %r13d
jne 0x18b50
movsd 0x7580(%rip), %xmm1     # 0x200c8
movsd 0x10(%rsp), %xmm3
jmp 0x18bb2
cmpl $0x2, %eax
movsd 0x756d(%rip), %xmm1     # 0x200c8
movsd 0x10(%rsp), %xmm3
je 0x18b80
cmpl $0x1, %eax
jne 0x18ba2
movsd 0x80(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x80(%rsp)
jmp 0x18bb2
movsd 0x38(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x38(%rsp)
movapd 0x20(%rsp), %xmm0
addsd %xmm1, %xmm0
movapd %xmm0, 0x20(%rsp)
jmp 0x18bb2
movsd 0x50(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rsp)
addq $0x8, %r14
cmpq 0x8(%r12), %r14
jne 0x18b09
jmp 0x18bd1
movsd 0x74fd(%rip), %xmm1     # 0x200c8
movsd 0x10(%rsp), %xmm3
ucomisd 0x78bf(%rip), %xmm3     # 0x20498
jb 0x18be4
xorps %xmm4, %xmm4
sqrtsd %xmm3, %xmm4
jmp 0x18bff
movapd %xmm3, %xmm0
callq 0x4240
movsd 0x10(%rsp), %xmm3
movsd 0x74cd(%rip), %xmm1     # 0x200c8
movapd %xmm0, %xmm4
movq 0x8(%rsp), %r14
movl 0x78(%rsp), %r12d
movq 0x70(%rsp), %rbp
movapd 0x20(%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 0x760f(%rip), %xmm2     # 0x20250
mulsd %xmm2, %xmm0
movapd %xmm5, %xmm7
mulsd %xmm2, %xmm7
addsd %xmm0, %xmm7
movsd 0x50(%rsp), %xmm0
addsd %xmm0, %xmm7
addsd %xmm0, %xmm3
addsd 0x80(%rsp), %xmm3
addsd %xmm5, %xmm3
divsd %xmm3, %xmm7
ucomisd 0x9b30(%rip), %xmm7     # 0x227a8
jbe 0x18d36
movsd 0x9b2a(%rip), %xmm0     # 0x227b0
ucomisd %xmm7, %xmm0
jbe 0x18d36
movapd %xmm7, %xmm0
xorpd 0x7614(%rip), %xmm0     # 0x202b0
movapd %xmm0, 0x50(%rsp)
movapd %xmm7, %xmm0
movsd %xmm4, 0x10(%rsp)
movapd %xmm5, 0x80(%rsp)
movapd %xmm7, 0xd0(%rsp)
callq 0x4250
movapd %xmm0, 0xe0(%rsp)
movsd 0x73f4(%rip), %xmm0     # 0x200c8
subsd 0xd0(%rsp), %xmm0
movapd %xmm0, 0xd0(%rsp)
callq 0x4250
movapd 0x50(%rsp), %xmm6
movapd 0x80(%rsp), %xmm5
movsd 0x10(%rsp), %xmm4
movsd 0x73c0(%rip), %xmm1     # 0x200c8
movapd 0xe0(%rsp), %xmm2
unpcklpd 0xd0(%rsp), %xmm2       # xmm2 = xmm2[0],mem[0]
unpcklpd %xmm0, %xmm6            # xmm6 = xmm6[0],xmm0[0]
mulpd %xmm2, %xmm6
divpd 0x9a36(%rip), %xmm6     # 0x22760
movapd %xmm6, %xmm0
unpckhpd %xmm6, %xmm0            # xmm0 = xmm0[1],xmm6[1]
subsd %xmm0, %xmm6
movapd 0x20(%rsp), %xmm2
subsd %xmm4, %xmm2
movapd %xmm1, %xmm0
subsd %xmm6, %xmm0
mulsd %xmm5, %xmm0
movslq 0x8(%r15), %rax
shlq $0x4, %rax
movsd %xmm0, 0x8(%rbp,%rax)
movsd 0x90(%rsp), %xmm0
mulsd 0x9a4d(%rip), %xmm0     # 0x227b8
addsd %xmm2, %xmm0
movsd %xmm0, (%rbp,%rax)
movsd 0x48(%rsp), %xmm2
movq (%r15), %r15
testq %r15, %r15
jne 0x18a3f
movsd 0x38(%rsp), %xmm0
divsd %xmm2, %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x99f1(%rip), %xmm0     # 0x22790
xorl %r13d, %r13d
cmpq $0x0, 0x40(%r14)
jne 0x18dd6
cmpl %r12d, 0x50(%r14)
jne 0x18dd6
movslq 0x8(%r14), %rax
shlq $0x4, %rax
movsd 0x8(%rbp,%rax), %xmm1
mulsd 0x38(%rsp), %xmm1
addsd (%rbp,%rax), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x18dd6
movapd %xmm1, %xmm0
movq %r14, %r13
movq (%r14), %r14
testq %r14, %r14
jne 0x18da2
testq %r13, %r13
jne 0x18df4
leaq 0x9b64(%rip), %rdi      # 0x2294e
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x9e9c
movq %rbp, %rdi
callq 0x4380
movq 0x68(%rsp), %rdi
callq 0x18104
cmpb $0x0, 0x48(%rbx)
je 0x18e15
movb $0x0, 0x49(%rbx)
jmp 0x190ef
testq %r13, %r13
je 0x18e21
cmpl $0x0, 0x50(%r13)
jle 0x18e0c
movq (%rbx), %rbp
movb $0x1, 0x49(%rbx)
testq %rbp, %rbp
je 0x190d6
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq %rbp, %r14
cmpq $0x0, 0x40(%r14)
je 0x18e78
movq 0x48(%r14), %r15
testq %r15, %r15
je 0x18e78
movl 0x10(%r15), %edi
cmpl $-0x10, %edi
jne 0x18e60
movl $0xffffffff, 0x10(%r15) # imm = 0xFFFFFFFF
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
cmpl $0x0, 0x14(%r15)
jne 0x18e73
callq 0x19ce3
cmpl %r12d, %eax
cmovgl %eax, %r12d
movq (%r15), %r15
jmp 0x18e45
movq (%r14), %r14
testq %r14, %r14
jne 0x18e3a
movl %r12d, 0x10(%rsp)
movq %rbp, %r15
cmpq $0x0, 0x40(%r15)
je 0x18eb6
movq 0x48(%r15), %r12
testq %r12, %r12
je 0x18eb6
cmpl $0x0, 0x14(%r12)
jne 0x18eb0
movl 0x10(%r12), %edi
callq 0x19ce3
cmpl 0x10(%rsp), %eax
jne 0x18ec3
movq (%r12), %r12
jmp 0x18e93
movq (%r15), %r15
testq %r15, %r15
jne 0x18e88
jmp 0x190d0
movl %eax, %r14d
movq %r13, 0x80(%rsp)
leaq 0x1254b(%rip), %r15     # 0x2b420
movl (%r15), %edi
decl %edi
callq 0x80f9
movq %rax, %r12
cmpl $0x1, (%r15)
setne 0x20(%rsp)
cmpq 0x110e6(%rip), %rax     # 0x29fd8
sete %r13b
movl %r14d, %edi
callq 0x19d1d
movl %eax, %edi
callq 0x1833e
movq %rax, 0x8(%rsp)
movl 0x10(%rsp), %edi
callq 0x19d1d
movl %eax, %edi
callq 0x1833e
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 0x20b5aae(%rip), %rax   # 0x20ce9f0
movl (%rax), %ecx
movl (%r15), %r15d
decl %r15d
leaq 0x94cd(%rip), %r14      # 0x2241e
movq %r14, %r9
movq %r14, %r10
testq %r12, %r12
je 0x19004
andb 0x20(%rsp), %r13b
jne 0x19004
leaq 0x467b(%rip), %rsi      # 0x1d5ed
movq %r12, %rdi
movq %rdx, 0x70(%rsp)
movsd %xmm0, 0x20(%rsp)
movsd %xmm1, 0x50(%rsp)
movsd %xmm2, 0x38(%rsp)
movsd %xmm3, 0x48(%rsp)
movsd %xmm4, 0x68(%rsp)
movsd %xmm5, 0x78(%rsp)
movl %ecx, 0xe0(%rsp)
callq 0x7482
movq %rax, %r13
leaq 0x4726(%rip), %rsi      # 0x1d6da
movq %r12, %rdi
callq 0x7482
movq %rax, %r14
leaq 0x47a2(%rip), %rsi      # 0x1d768
movq %r12, %rdi
callq 0x7482
movq %r13, %r9
movl 0xe0(%rsp), %ecx
movsd 0x78(%rsp), %xmm5
movsd 0x68(%rsp), %xmm4
movsd 0x48(%rsp), %xmm3
movsd 0x38(%rsp), %xmm2
movsd 0x50(%rsp), %xmm1
movsd 0x20(%rsp), %xmm0
movq 0x70(%rsp), %rdx
movq %rax, %r10
leaq 0x9968(%rip), %rdi      # 0x22973
movq 0x8(%rsp), %rsi
movl %r15d, %r8d
movb $0x6, %al
pushq %r10
pushq %r14
callq 0xa20e
addq $0x10, %rsp
leaq 0x20ba9e7(%rip), %r15   # 0x20d3a10
leaq 0x9a00(%rip), %r12      # 0x22a30
movq %rbp, 0x8(%rsp)
movq 0x48(%rbp), %r13
testq %r13, %r13
je 0x190b6
movl 0x10(%r13), %edx
movslq 0x8(%r13), %rcx
movq %rcx, %rax
shlq $0x6, %rax
movsd (%r15,%rax), %xmm0
movsd 0x8(%r15,%rax), %xmm1
movsd 0x10(%r15,%rax), %xmm2
movl $0x5, %edi
leaq 0x99a2(%rip), %rsi      # 0x22a0f
movb $0x3, %al
callq 0xa3ae
cmpl $0x0, 0x2c(%r13)
jle 0x190b0
leaq 0x48(%r13), %rbp
xorl %r14d, %r14d
movsd -0x10(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
movsd (%rbp), %xmm2
movl $0x5, %edi
movq %r12, %rsi
movb $0x3, %al
callq 0xa3ae
incq %r14
movslq 0x2c(%r13), %rax
addq $0x18, %rbp
cmpq %rax, %r14
jl 0x19082
movq (%r13), %r13
jmp 0x19039
movq 0x8(%rsp), %rbp
movq (%rbp), %rbp
testq %rbp, %rbp
jne 0x19030
movq 0x80(%rsp), %r13
movl 0x10(%rsp), %edi
jmp 0x190db
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x19d1d
movl %eax, 0xa0(%rbx)
cmpl $-0x2, %eax
je 0x19194
testq %r13, %r13
je 0x19194
movq %rbx, 0x40(%r13)
movq (%rbx), %rbp
movl 0x8(%r13), %eax
movl %eax, 0x80(%rbx)
movq $0x0, 0x98(%rbx)
movq %r13, %rdi
callq 0x125dc
leaq 0x48(%r13), %r14
movq 0x48(%r13), %rdi
testq %rdi, %rdi
je 0x1913f
movq %r14, %r15
movq %r15, %rsi
callq 0x19f70
movq (%r15), %r15
movq (%r15), %rdi
testq %rdi, %rdi
jne 0x1912c
xorl %eax, %eax
movq %rax, (%rbx)
movq %rax, 0x98(%rbx)
movq (%r14), %r15
testq %r15, %r15
je 0x191a1
cmpl $0x4, 0x30(%r15)
je 0x1918f
cmpl $-0x2, 0x10(%r15)
je 0x1918f
callq 0x14720
movq %rax, %r12
movl $0x4b8, %edx            # imm = 0x4B8
movq %rax, %rdi
movq %r15, %rsi
callq 0x4260
movq %r12, 0x20(%r15)
movq 0x98(%rbx), %rax
movq %rax, (%r12)
movq %r12, 0x98(%rbx)
movq (%r15), %r15
jmp 0x1914e
movq %rbx, %rdi
callq 0x19a40
jmp 0x19a16
callq 0x154b7
movq %rax, 0x88(%rbx)
callq 0x154b7
movq %rax, 0x90(%rbx)
cmpl $0x0, 0x50(%r13)
movq 0x88(%rbx), %rax
setg 0x48(%rax)
movq %r13, 0x80(%rsp)
cmpl $0x0, 0x50(%r13)
movq 0x90(%rbx), %rax
setg 0x48(%rax)
testq %rbp, %rbp
je 0x193fb
movslq 0x80(%rbx), %r12
shlq $0x6, %r12
addq 0x10dac(%rip), %r12     # 0x29fa8
leaq 0x20ba80d(%rip), %r14   # 0x20d3a10
leaq 0x40(%rsp), %r13
movq $0x0, 0x8(%rsp)
movq $0x0, 0x50(%rsp)
movq (%rbp), %rax
movq %rax, 0x10(%rsp)
movslq 0x8(%rbp), %rax
shlq $0x6, %rax
movsd (%r14,%rax), %xmm0
ucomisd (%r12), %xmm0
jne 0x19278
jp 0x19278
addq %r14, %rax
movsd 0x8(%rax), %xmm0
ucomisd 0x8(%r12), %xmm0
jne 0x19278
jp 0x19278
movsd 0x10(%rax), %xmm0
ucomisd 0x10(%r12), %xmm0
jne 0x19278
jp 0x19278
movsd 0x30(%rax), %xmm0
movsd 0x30(%r12), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x192d9
xorl %r15d, %r15d
jmp 0x19397
movq %rbp, 0x20(%rsp)
movq 0x48(%rbp), %r15
testq %r15, %r15
je 0x19319
xorl %ebp, %ebp
xorl %r14d, %r14d
movq %r15, %rdi
movq (%r15), %r15
movq %r12, %rsi
leaq 0x90(%rsp), %rdx
movq %r13, %rcx
callq 0x14739
movq 0x90(%rsp), %rax
testq %rax, %rax
je 0x192c0
movq %r14, (%rax)
movq 0x90(%rsp), %r14
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0x192d2
movq %rbp, (%rax)
movq 0x40(%rsp), %rbp
testq %r15, %r15
jne 0x1928f
jmp 0x1931e
ucomisd %xmm0, %xmm1
ja 0x1937f
movq %rbp, 0x20(%rsp)
movq 0x48(%rbp), %rax
testq %rax, %rax
je 0x19319
xorl %ebp, %ebp
xorl %r14d, %r14d
testb $0x1, 0x8(%rax)
movq %rbp, %rcx
cmoveq %r14, %rcx
cmoveq %rax, %r14
cmovneq %rax, %rbp
movq (%rax), %rdx
movq %rcx, (%rax)
movq %rdx, %rax
testq %rdx, %rdx
jne 0x192f6
jmp 0x1931e
xorl %r14d, %r14d
xorl %ebp, %ebp
movq %r14, %rax
orq %rbp, %rax
jne 0x1932a
xorl %ebp, %ebp
jmp 0x19378
testq %r14, %r14
je 0x1936c
testq %rbp, %rbp
je 0x19384
callq 0x14e4e
movq %rax, %r15
movl $0xb, %ecx
movq %rax, %rdi
movq 0x20(%rsp), %rax
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rbp, 0x48(%r15)
movq %rax, %rbp
movq %r14, 0x48(%rax)
movq %r15, %rdi
callq 0x18258
movq %rbp, %rdi
callq 0x18258
jmp 0x19390
movq 0x20(%rsp), %rax
movq %rbp, 0x48(%rax)
movq %rax, %rbp
leaq 0x20ba691(%rip), %r14   # 0x20d3a10
movq %rbp, %r15
jmp 0x193ba
movq 0x20(%rsp), %rbp
movq %r14, 0x48(%rbp)
xorl %r15d, %r15d
leaq 0x20ba679(%rip), %r14   # 0x20d3a10
cmpq $0x0, 0x48(%rbp)
jne 0x193ac
leaq 0x96d5(%rip), %rdi      # 0x22a7a
xorl %eax, %eax
callq 0x9e9c
movq 0x50(%rsp), %rax
movq %rax, (%rbp)
movq %rbp, 0x50(%rsp)
testq %r15, %r15
je 0x193e3
cmpq $0x0, 0x48(%r15)
jne 0x193d4
leaq 0x96ad(%rip), %rdi      # 0x22a7a
xorl %eax, %eax
callq 0x9e9c
movq 0x8(%rsp), %rax
movq %rax, (%r15)
movq %r15, 0x8(%rsp)
jmp 0x193e8
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %rax
movq %rax, %rbp
testq %rax, %rax
jne 0x1921a
jmp 0x19407
movq $0x0, 0x50(%rsp)
xorl %r15d, %r15d
movq 0x88(%rbx), %rax
movq 0x50(%rsp), %rcx
movq %rcx, (%rax)
movq 0x90(%rbx), %rax
movq %r15, (%rax)
movq 0x8(%rbx), %r13
testq %r13, %r13
je 0x19490
movslq 0x80(%rbx), %r14
shlq $0x6, %r14
addq 0x10b6d(%rip), %r14     # 0x29fa8
xorl %ebp, %ebp
leaq 0x40(%rsp), %r12
xorl %r15d, %r15d
movq %r13, %rdi
movq (%r13), %r13
movq %r14, %rsi
leaq 0x90(%rsp), %rdx
movq %r12, %rcx
callq 0x15102
movq 0x90(%rsp), %rax
testq %rax, %rax
je 0x19477
movq %rbp, (%rax)
movq 0x90(%rsp), %rbp
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0x19489
movq %r15, (%rax)
movq 0x40(%rsp), %r15
testq %r13, %r13
jne 0x19445
jmp 0x19495
xorl %r15d, %r15d
xorl %ebp, %ebp
movq 0x88(%rbx), %rax
movq %rbp, 0x8(%rax)
movq 0x90(%rbx), %rax
movq %r15, 0x8(%rax)
cmpq $0x0, 0x10(%rbx)
je 0x1961b
movb $0x1, %r14b
xorl %r15d, %r15d
leaq 0x20ba54d(%rip), %rbp   # 0x20d3a10
leaq 0x40(%rsp), %r12
leaq 0xf8(%rsp), %r13
movq 0x80(%rsp), %rcx
movslq 0x8(%rcx), %rax
shlq $0x6, %rax
movsd (%rbp,%rax), %xmm0
testb $0x1, %r14b
je 0x19533
movsd %xmm0, 0x90(%rsp)
movsd 0x8(%rbp,%rax), %xmm0
movsd %xmm0, 0x98(%rsp)
movslq 0x8(%rcx), %rax
shlq $0x6, %rax
movsd 0x10(%rbp,%rax), %xmm0
movsd %xmm0, 0xa0(%rsp)
movslq 0x8(%rcx), %rax
shlq $0x6, %rax
movsd 0x30(%rbp,%rax), %xmm0
addsd 0x6d47(%rip), %xmm0     # 0x20278
jmp 0x1957b
movhpd 0x8(%rbp,%rax), %xmm0   # xmm0 = xmm0[0],mem[0]
xorpd %xmm1, %xmm1
subpd %xmm0, %xmm1
movapd %xmm1, 0x90(%rsp)
movslq 0x8(%rcx), %rax
shlq $0x6, %rax
xorpd %xmm0, %xmm0
subsd 0x10(%rbp,%rax), %xmm0
movsd %xmm0, 0xa0(%rsp)
movslq 0x8(%rcx), %rax
shlq $0x6, %rax
movsd 0x6d03(%rip), %xmm0     # 0x20278
subsd 0x30(%rbp,%rax), %xmm0
movsd %xmm0, 0xc0(%rsp)
movq 0x10(%rbx), %rdi
callq 0x14f6c
movq %rax, %rdi
leaq 0x90(%rsp), %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x15102
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x195b5
callq 0x14f2c
movq 0x40(%rsp), %rax
testq %rax, %rax
jne 0x195f0
movsd 0x18(%rbx), %xmm0
movsd 0x20(%rbx), %xmm1
movsd 0x28(%rbx), %xmm2
movsd 0x30(%rbx), %xmm3
movsd 0x38(%rbx), %xmm4
movsd 0x40(%rbx), %xmm5
leaq 0x9307(%rip), %rdi      # 0x228eb
movb $0x6, %al
callq 0xa20e
movq 0x40(%rsp), %rax
movq 0x88(%rbx,%r15,8), %rcx
movq %rax, 0x10(%rcx)
movl $0x1, %r15d
testb $0x1, %r14b
movl $0x0, %r14d
jne 0x194d0
movq 0x10(%rbx), %rdi
callq 0x14f2c
movq $0x0, 0x10(%rbx)
movq 0x80(%rsp), %rax
cmpl $0x0, 0x50(%rax)
jne 0x199b4
movslq 0x80(%rbx), %r12
shlq $0x6, %r12
addq 0x10961(%rip), %r12     # 0x29fa8
movl $0x20, %edi
callq 0x42f0
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
callq 0xc710
callq 0x14e62
movupd (%r12), %xmm0
movupd 0x10(%r12), %xmm1
movupd 0x20(%r12), %xmm2
movupd 0x30(%r12), %xmm3
movupd %xmm0, (%rax)
movupd %xmm1, 0x10(%rax)
movupd %xmm2, 0x20(%rax)
movupd %xmm3, 0x30(%rax)
movq %rax, 0x20(%rsp)
movq %rbx, 0x40(%rax)
movq 0xb0(%rbx), %rbp
testq %rbp, %rbp
je 0x197ae
leaq 0x571e(%rip), %rax      # 0x1edd0
movaps (%rax), %xmm0
movaps %xmm0, 0x10(%rsp)
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x90(%rsp), %r12
xorl %r14d, %r14d
movupd (%rbp), %xmm0
movupd 0x10(%rbp), %xmm1
movupd 0x20(%rbp), %xmm2
movupd 0x30(%rbp), %xmm3
movapd %xmm3, 0xc0(%rsp)
movapd %xmm2, 0xb0(%rsp)
movapd %xmm1, 0xa0(%rsp)
movapd %xmm0, 0x90(%rsp)
movl $0x0, %r13d
cmpq %rbx, 0x48(%rbp)
je 0x1977b
cmpq %rbx, 0x50(%rbp)
je 0x1972d
leaq 0x936f(%rip), %rdi      # 0x22a90
xorl %eax, %eax
callq 0x9e9c
movl %r14d, %r13d
jmp 0x1977b
movsd 0xc0(%rsp), %xmm0
xorps 0x6b73(%rip), %xmm0     # 0x202b0
movlps %xmm0, 0xc0(%rsp)
movapd 0x10(%rsp), %xmm0
subpd 0x90(%rsp), %xmm0
movapd %xmm0, 0x90(%rsp)
movsd 0x8(%rsp), %xmm0
subsd 0xa0(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
movl $0x1, %r13d
movq %r15, %rdi
movq %r12, %rsi
movl $0x1, %edx
movsd 0x6cf2(%rip), %xmm0     # 0x20480
callq 0xcea2
cmpl $0x0, 0x8(%r15)
je 0x197cc
movl %r13d, %eax
movq 0x58(%rbp,%rax,8), %rbp
movl %r13d, %r14d
testq %rbp, %rbp
jne 0x196d0
movq 0x20(%rsp), %rdi
movq %r15, 0x68(%rdi)
movq 0x88(%rbx), %rsi
movq 0x90(%rbx), %rdx
callq 0x13b0c
jmp 0x19807
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 0x92c0(%rip), %rsi      # 0x22ab1
movl $0x2, %edi
movb $0x6, %al
callq 0xa3ae
movq 0x20(%rsp), %rdi
callq 0x14e71
movq 0xb0(%rbx), %r14
testq %r14, %r14
je 0x199a9
movslq 0x80(%rbx), %r13
shlq $0x6, %r13
addq 0x1077f(%rip), %r13     # 0x29fa8
movq 0x88(%rbx), %rax
movq %rax, 0x8(%rsp)
movq 0x90(%rbx), %rax
movq %rax, 0x10(%rsp)
xorl %ebp, %ebp
movq %r13, 0x20(%rsp)
movq %r14, %r15
movq 0x48(%r14), %rsi
cmpq %rbx, %rsi
je 0x1986e
cmpq %rbx, 0x50(%r15)
je 0x19872
leaq 0x92a7(%rip), %rdi      # 0x22b08
xorl %eax, %eax
callq 0x9e9c
movq 0x48(%r15), %rsi
jmp 0x19877
xorl %ebp, %ebp
jmp 0x19877
movl $0x1, %ebp
movl %ebp, %eax
movq 0x58(%r15,%rax,8), %r14
xorl %eax, %eax
testl %ebp, %ebp
sete %al
movq 0x48(%r15,%rax,8), %r12
movq %r15, %rdi
callq 0x13b68
movq 0x50(%r15), %rsi
movq %r15, %rdi
callq 0x13b68
movq 0x68(%r15), %rdi
movq %r13, %rsi
leaq 0x90(%rsp), %rdx
leaq 0x40(%rsp), %rcx
movsd 0x6bc6(%rip), %xmm0     # 0x20480
callq 0xd1f2
movq 0x90(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, %rdx
orq %rax, %rdx
je 0x199a0
testq %rcx, %rcx
je 0x1993d
testq %rax, %rax
je 0x1994e
callq 0x14e62
movq %rax, %r13
movl $0xd, %ecx
movq %rax, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq 0x40(%rsp), %rax
movq %rax, 0x68(%r13)
movq 0x68(%r15), %rdi
testq %rdi, %rdi
je 0x19910
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x90(%rsp), %rax
movq %rax, 0x68(%r15)
testl %ebp, %ebp
je 0x1995f
movq %r15, %rdi
movq %r12, %rsi
movq 0x8(%rsp), %rdx
callq 0x13b0c
movq %r13, %rdi
movq %r12, %rsi
movq 0x10(%rsp), %rdx
jmp 0x1997a
testl %ebp, %ebp
je 0x19986
movq %r15, %rdi
movq %r12, %rsi
movq 0x10(%rsp), %rdx
jmp 0x1999b
testl %ebp, %ebp
je 0x19990
movq %r15, %rdi
movq %r12, %rsi
movq 0x8(%rsp), %rdx
jmp 0x1999b
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movq %r12, %rdx
callq 0x13b0c
movq %r13, %rdi
movq 0x10(%rsp), %rsi
movq %r12, %rdx
callq 0x13b0c
movq 0x20(%rsp), %r13
jmp 0x199a0
movq %r15, %rdi
movq 0x10(%rsp), %rsi
jmp 0x19998
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movq %r12, %rdx
callq 0x13b0c
testq %r14, %r14
jne 0x19848
movq $0x0, 0xb0(%rbx)
movq 0x88(%rbx), %rdi
callq 0x18483
movq 0x90(%rbx), %rdi
callq 0x18483
cmpb $0x1, 0x32ba081(%rip)   # 0x32d3a54
jne 0x19a16
movl 0x32ba075(%rip), %esi   # 0x32d3a50
incl %esi
movl %esi, 0x32ba06d(%rip)   # 0x32d3a50
movslq %esi, %rax
imulq $0x10624dd3, %rax, %rax # imm = 0x10624DD3
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x25, %rax
addl %ecx, %eax
cmpl 0x32ba058(%rip), %eax   # 0x32d3a58
jle 0x19a16
movl %eax, 0x32ba050(%rip)   # 0x32d3a58
leaq 0x911c(%rip), %rdi      # 0x22b2b
xorl %eax, %eax
callq 0x9bae
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x20, %esi
movq %r15, %rdi
callq 0x4300
movq %rbx, %rdi
callq 0x4540