// File: /workspace/github_cpp_makefile_star2_O1/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 $0x128, %rsp            # imm = 0x128
movq %rdi, %rbx
cmpb $0x0, 0x48(%rdi)
jne 0x188d4
movaps 0x9c71(%rip), %xmm0     # 0x22470
movups %xmm0, 0x50(%rbx)
movaps 0x9c76(%rip), %xmm0     # 0x22480
movups %xmm0, 0x70(%rbx)
movapd 0xaf4a(%rip), %xmm0     # 0x23760
movupd %xmm0, 0x60(%rbx)
movq 0xb0(%rbx), %rcx
testq %rcx, %rcx
je 0x188ca
leaq 0xb133(%rip), %r14      # 0x23965
xorl %eax, %eax
movq %rcx, %r15
movl %eax, %ebp
movl $0x0, %eax
cmpq %rbx, 0x48(%rcx)
je 0x1885d
cmpq %rbx, 0x50(%r15)
je 0x18858
movq %r14, %rdi
xorl %eax, %eax
callq 0x9f84
movl %ebp, %eax
jmp 0x1885d
movl $0x1, %eax
movl %eax, %ecx
movq 0x58(%r15,%rcx,8), %rcx
movq 0x68(%r15), %rdx
cmpl $0x0, 0x8(%rdx)
je 0x188c1
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 0x18897
movsd %xmm0, 0x50(%rbx,%rdi,8)
ucomisd 0x68(%rbx,%rdi,8), %xmm0
jbe 0x188a5
movsd %xmm0, 0x68(%rbx,%rdi,8)
incq %rdi
cmpq $0x3, %rdi
jne 0x18874
incq %rsi
movq 0x68(%r15), %rdi
movl 0x8(%rdi), %edi
addq $0x18, %rdx
cmpq %rdi, %rsi
jb 0x18872
testq %rcx, %rcx
jne 0x18834
cmpb $0x0, 0x49(%rbx)
je 0x18c50
xorl %ebp, %ebp
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x188ee
leaq 0x18(%rbx), %rsi
leaq 0x30(%rbx), %rdx
callq 0x156fa
jmp 0x18911
movaps 0x9b7b(%rip), %xmm0     # 0x22470
movups %xmm0, 0x18(%rbx)
movaps 0xae60(%rip), %xmm0     # 0x23760
movups %xmm0, 0x28(%rbx)
movapd 0x9b74(%rip), %xmm0     # 0x22480
movupd %xmm0, 0x38(%rbx)
movq %rbx, %rdi
callq 0x184af
movl %eax, %r14d
movq %rbx, %rdi
movl %eax, %esi
callq 0x184ea
cmpl $-0x1, %r14d
je 0x18c48
movl %r14d, 0x58(%rsp)
movq (%rbx), %r12
testb %bpl, %bpl
je 0x18d23
movsd 0x8b47(%rip), %xmm0     # 0x21490
movq %r12, %rdi
callq 0x18176
movq %rax, %r15
testq %r12, %r12
je 0x18d0f
movsd 0xae5b(%rip), %xmm2     # 0x237c0
xorl %r14d, %r14d
leaq 0x20bc0b1(%rip), %rdx   # 0x20d4a20
movsd 0x8b31(%rip), %xmm3     # 0x214a8
movq %r12, %rbp
movl 0x58(%rsp), %ecx
movsd 0x8b0a(%rip), %xmm1     # 0x21490
cmpq $0x0, 0x40(%rbp)
jne 0x18c36
cmpl %ecx, 0x50(%rbp)
jne 0x18c36
movslq 0x8(%rbp), %r13
shlq $0x6, %r13
movslq 0x38(%rdx,%r13), %rax
cmpq $0x2, %rax
jg 0x18c36
addq %rdx, %r13
movsd 0x30(%r13), %xmm0
mulsd (%r13,%rax,8), %xmm0
movsd 0xf0(%rsp,%rax,8), %xmm4
movsd %xmm4, 0x30(%rsp)
subsd %xmm0, %xmm4
movsd %xmm4, (%rsp)
ucomisd %xmm4, %xmm1
ja 0x18c36
movsd 0x110(%rsp,%rax,8), %xmm4
movsd %xmm4, 0xd0(%rsp)
subsd %xmm4, %xmm0
ucomisd %xmm0, %xmm1
ja 0x18c36
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x139f8(%rip), %xmm0 # 0x2c40c
mulsd 0x8844(%rip), %xmm0     # 0x21260
addsd %xmm3, %xmm0
ucomisd (%rsp), %xmm0
ja 0x18c36
ucomisd 0x8(%rsp), %xmm0
ja 0x18c36
movsd %xmm2, 0xe0(%rsp)
movq %r14, 0x70(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x183d1
xorps %xmm0, %xmm0
cvtsi2sdl 0x18(%r15), %xmm0
movsd %xmm0, 0x60(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x1c(%r15), %xmm0
movsd %xmm0, 0x50(%rsp)
movq %r15, 0x80(%rsp)
movq 0x20(%r15), %rax
movq (%rax), %r14
movq 0x8(%rax), %r15
cmpq %r15, %r14
je 0x18b35
xorpd %xmm2, %xmm2
xorpd %xmm0, %xmm0
movsd %xmm0, 0x48(%rsp)
movq (%r14), %rdi
cmpl $0x4, 0x30(%rdi)
je 0x18b26
movl 0x8(%rdi), %ecx
movl 0x8(%rbp), %eax
cmpl %eax, %ecx
je 0x18ae6
xorl %ecx, %eax
cmpl $0x1, %eax
je 0x18ae6
movsd %xmm2, 0x10(%rsp)
movq %r13, %rsi
xorl %edx, %edx
callq 0x19ebe
cmpl $0x2, %eax
je 0x18af0
cmpl $0x1, %eax
jne 0x18b0c
movsd 0x50(%rsp), %xmm0
addsd 0x85fa(%rip), %xmm0     # 0x210d8
movsd %xmm0, 0x50(%rsp)
jmp 0x18b04
addsd 0x85ea(%rip), %xmm2     # 0x210d8
jmp 0x18b26
movsd 0x48(%rsp), %xmm0
addsd 0x85da(%rip), %xmm0     # 0x210d8
movsd %xmm0, 0x48(%rsp)
movsd 0x10(%rsp), %xmm2
jmp 0x18b26
movsd 0x10(%rsp), %xmm2
movsd 0x60(%rsp), %xmm0
addsd 0x85b8(%rip), %xmm0     # 0x210d8
movsd %xmm0, 0x60(%rsp)
addq $0x8, %r14
cmpq %r15, %r14
jne 0x18a98
jmp 0x18b43
xorpd %xmm0, %xmm0
movsd %xmm0, 0x48(%rsp)
xorpd %xmm2, %xmm2
movsd 0x8715(%rip), %xmm1     # 0x21260
mulsd %xmm1, %xmm2
movsd 0x60(%rsp), %xmm0
addsd %xmm2, %xmm0
movapd %xmm2, %xmm3
movsd 0x48(%rsp), %xmm2
mulsd %xmm1, %xmm2
addsd %xmm2, %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x30(%rsp), %xmm1
subsd 0xd0(%rsp), %xmm1
movsd (%rsp), %xmm0
divsd %xmm1, %xmm0
addsd 0x50(%rsp), %xmm3
addsd %xmm2, %xmm3
movsd %xmm3, 0x10(%rsp)
movsd 0x8(%rsp), %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, 0x8(%rsp)
callq 0x4250
movapd %xmm0, %xmm1
movsd 0xac0e(%rip), %xmm0     # 0x237c8
divsd %xmm0, %xmm1
mulsd 0x60(%rsp), %xmm1
movsd %xmm1, (%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x4250
divsd 0xabec(%rip), %xmm0     # 0x237c8
mulsd 0x10(%rsp), %xmm0
addsd (%rsp), %xmm0
movsd 0xabe1(%rip), %xmm1     # 0x237d0
mulsd %xmm1, %xmm0
addsd 0x48(%rsp), %xmm0
movsd 0xe0(%rsp), %xmm2
ucomisd %xmm2, %xmm0
minsd %xmm0, %xmm2
movq 0x70(%rsp), %r14
cmovbeq %rbp, %r14
movl 0x58(%rsp), %ecx
movq 0x80(%rsp), %r15
movsd 0x8869(%rip), %xmm1     # 0x21490
leaq 0x20bbdf2(%rip), %rdx   # 0x20d4a20
movsd 0x8872(%rip), %xmm3     # 0x214a8
movq (%rbp), %rbp
testq %rbp, %rbp
jne 0x18986
jmp 0x18d12
xorl %r14d, %r14d
jmp 0x19149
xorps %xmm0, %xmm0
cvtsi2sdl 0x137b1(%rip), %xmm0 # 0x2c40c
movsd 0xab55(%rip), %xmm1     # 0x237b8
addsd %xmm0, %xmm1
movapd 0x8661(%rip), %xmm2     # 0x212d0
xorpd %xmm1, %xmm2
xorl %eax, %eax
movsd 0x50(%rbx,%rax,8), %xmm3
maxsd %xmm2, %xmm3
movsd %xmm3, 0x110(%rsp,%rax,8)
movsd 0x68(%rbx,%rax,8), %xmm3
minsd %xmm1, %xmm3
movsd %xmm3, 0xf0(%rsp,%rax,8)
incq %rax
cmpq $0x3, %rax
jne 0x18c75
xorl %eax, %eax
movsd 0x87e2(%rip), %xmm1     # 0x21490
movsd 0xf0(%rsp,%rax,8), %xmm2
subsd 0x110(%rsp,%rax,8), %xmm2
ucomisd %xmm2, %xmm1
jae 0x188d4
incq %rax
cmpq $0x3, %rax
jne 0x18cae
addsd 0x87b5(%rip), %xmm0     # 0x21490
xorl %eax, %eax
movsd 0xf0(%rsp,%rax,8), %xmm1
subsd 0x110(%rsp,%rax,8), %xmm1
ucomisd %xmm0, %xmm1
seta %bpl
ja 0x188d6
leaq 0x1(%rax), %rcx
cmpq $0x2, %rax
movq %rcx, %rax
jne 0x18cdd
jmp 0x188d6
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x1845d
testq %r14, %r14
jne 0x19149
leaq 0xafb68a(%rip), %rax    # 0xb143b4
movslq (%rax), %rdi
shlq $0x4, %rdi
callq 0x4400
movq %rax, %r13
movsd 0x874f(%rip), %xmm0     # 0x21490
movq %r12, %rdi
callq 0x18176
movq %rax, 0x10(%rsp)
testq %r12, %r12
je 0x190bb
movsd 0x8379(%rip), %xmm1     # 0x210d8
movq %r12, %r15
xorpd %xmm2, %xmm2
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movl 0x58(%rsp), %ecx
movq %r13, 0x50(%rsp)
cmpq $0x0, 0x40(%r15)
jne 0x1909d
cmpl %ecx, 0x50(%r15)
jne 0x1909d
addsd %xmm1, %xmm2
movq $0x0, 0x90(%rsp)
movq 0x48(%r15), %rax
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
xorpd %xmm3, %xmm3
testq %rax, %rax
je 0x18dcc
cmpl $0x4, 0x30(%rax)
movapd %xmm3, %xmm0
addsd %xmm1, %xmm0
je 0x18dc7
movapd %xmm0, %xmm3
movq (%rax), %rax
jmp 0x18db0
movsd %xmm3, (%rsp)
movsd %xmm2, 0x48(%rsp)
movslq 0x8(%r15), %rbp
shlq $0x6, %rbp
addq 0x121c2(%rip), %rbp     # 0x2afa8
movq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
callq 0x183d1
xorps %xmm0, %xmm0
cvtsi2sdl 0x18(%r14), %xmm0
movsd %xmm0, 0x60(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x1c(%r14), %xmm0
movsd %xmm0, 0x70(%rsp)
movq 0x20(%r14), %rax
movq (%rax), %r14
cmpq 0x8(%rax), %r14
je 0x18ef6
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movsd 0x82a1(%rip), %xmm1     # 0x210d8
movsd (%rsp), %xmm3
movq (%r14), %rdi
movl 0x8(%rdi), %ecx
movl 0x8(%r15), %eax
cmpl %eax, %ecx
je 0x18edd
xorl %ecx, %eax
cmpl $0x1, %eax
je 0x18edd
movl 0x30(%rdi), %r13d
movq %rbp, %rsi
leaq 0x90(%rsp), %rdx
callq 0x19ebe
cmpl $0x4, %r13d
jne 0x18e82
movsd 0x825d(%rip), %xmm1     # 0x210d8
movsd (%rsp), %xmm3
jmp 0x18edd
cmpl $0x2, %eax
movsd 0x824b(%rip), %xmm1     # 0x210d8
movsd (%rsp), %xmm3
je 0x18eab
cmpl $0x1, %eax
jne 0x18ecd
movsd 0x70(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x70(%rsp)
jmp 0x18edd
movsd 0x8(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movapd 0x30(%rsp), %xmm0
addsd %xmm1, %xmm0
movapd %xmm0, 0x30(%rsp)
jmp 0x18edd
movsd 0x60(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x60(%rsp)
addq $0x8, %r14
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rax
cmpq 0x8(%rax), %r14
jne 0x18e3c
jmp 0x18f03
movsd 0x81da(%rip), %xmm1     # 0x210d8
movsd (%rsp), %xmm3
ucomisd 0x8375(%rip), %xmm3     # 0x21280
jb 0x18f16
xorps %xmm4, %xmm4
sqrtsd %xmm3, %xmm4
jmp 0x18f30
movapd %xmm3, %xmm0
callq 0x4240
movsd (%rsp), %xmm3
movsd 0x81ac(%rip), %xmm1     # 0x210d8
movapd %xmm0, %xmm4
movq 0x50(%rsp), %r13
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 0x82f8(%rip), %xmm2     # 0x21260
mulsd %xmm2, %xmm0
movapd %xmm5, %xmm7
mulsd %xmm2, %xmm7
addsd %xmm0, %xmm7
movsd 0x60(%rsp), %xmm0
addsd %xmm0, %xmm7
addsd %xmm0, %xmm3
addsd 0x70(%rsp), %xmm3
addsd %xmm5, %xmm3
divsd %xmm3, %xmm7
ucomisd 0xa844(%rip), %xmm7     # 0x237e0
jbe 0x19052
movsd 0xa83e(%rip), %xmm0     # 0x237e8
ucomisd %xmm7, %xmm0
jbe 0x19052
movapd %xmm7, %xmm0
xorpd 0x8310(%rip), %xmm0     # 0x212d0
movapd %xmm0, 0x60(%rsp)
movapd %xmm7, %xmm0
movsd %xmm4, (%rsp)
movapd %xmm5, 0x70(%rsp)
movapd %xmm7, 0x80(%rsp)
callq 0x4250
movapd %xmm0, 0xd0(%rsp)
movsd 0x80e4(%rip), %xmm0     # 0x210d8
subsd 0x80(%rsp), %xmm0
movapd %xmm0, 0x80(%rsp)
callq 0x4250
movapd 0x60(%rsp), %xmm6
movapd 0x70(%rsp), %xmm5
movsd (%rsp), %xmm4
movsd 0x80b4(%rip), %xmm1     # 0x210d8
movapd 0xd0(%rsp), %xmm2
unpcklpd 0x80(%rsp), %xmm2       # xmm2 = xmm2[0],mem[0]
unpcklpd %xmm0, %xmm6            # xmm6 = xmm6[0],xmm0[0]
mulpd %xmm2, %xmm6
divpd 0xa74a(%rip), %xmm6     # 0x23790
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 0x90(%rsp), %xmm0
mulsd 0xa768(%rip), %xmm0     # 0x237f0
addsd %xmm2, %xmm0
movsd %xmm0, (%r13,%rax)
movl 0x58(%rsp), %ecx
movsd 0x48(%rsp), %xmm2
movq (%r15), %r15
testq %r15, %r15
jne 0x18d79
movsd 0x8(%rsp), %xmm0
divsd %xmm2, %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x190cd
movsd 0xa715(%rip), %xmm0     # 0x237d8
movsd %xmm0, 0x8(%rsp)
movl 0x58(%rsp), %ecx
testq %r12, %r12
je 0x19121
movsd 0xa6e6(%rip), %xmm0     # 0x237c0
xorl %r14d, %r14d
cmpq $0x0, 0x40(%r12)
jne 0x19116
cmpl %ecx, 0x50(%r12)
jne 0x19116
movslq 0x8(%r12), %rax
shlq $0x4, %rax
movsd 0x8(%r13,%rax), %xmm1
mulsd 0x8(%rsp), %xmm1
addsd (%r13,%rax), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x19116
movapd %xmm1, %xmm0
movq %r12, %r14
movq (%r12), %r12
testq %r12, %r12
jne 0x190dd
jmp 0x19124
xorl %r14d, %r14d
testq %r14, %r14
jne 0x19137
leaq 0xa856(%rip), %rdi      # 0x23986
xorl %eax, %eax
callq 0x9f84
movq %r13, %rdi
callq 0x4380
movq 0x10(%rsp), %rdi
callq 0x1845d
cmpb $0x0, 0x48(%rbx)
je 0x19158
movb $0x0, 0x49(%rbx)
jmp 0x19447
testq %r14, %r14
je 0x19164
cmpl $0x0, 0x50(%r14)
jle 0x1914f
movq %r14, 0x70(%rsp)
movb $0x1, 0x49(%rbx)
movq (%rbx), %rbp
testq %rbp, %rbp
sete (%rsp)
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
je 0x191c9
movq %rbp, %r13
cmpq $0x0, 0x40(%r13)
je 0x191c0
movq 0x48(%r13), %r14
testq %r14, %r14
je 0x191c0
cmpl $-0x10, 0x10(%r14)
jne 0x191a1
movl $0xffffffff, 0x10(%r14) # imm = 0xFFFFFFFF
cmpl $0x0, 0x14(%r14)
jne 0x191bb
movl 0x10(%r14), %edi
callq 0x1a030
movl %eax, %r15d
cmpl %r12d, %eax
cmovgl %eax, %r12d
movq (%r14), %r14
jmp 0x1918d
movq (%r13), %r13
testq %r13, %r13
jne 0x19182
movl %r12d, 0x10(%rsp)
testq %rbp, %rbp
je 0x1921e
movq %rbp, %r13
cmpq $0x0, 0x40(%r13)
je 0x19211
movq 0x48(%r13), %r12
testq %r12, %r12
sete %r14b
je 0x1920b
cmpl $0x0, 0x14(%r12)
jne 0x19205
movl 0x10(%r12), %edi
callq 0x1a030
movl %eax, %r15d
cmpl 0x10(%rsp), %eax
jne 0x1920b
movq (%r12), %r12
jmp 0x191e1
testb $0x1, %r14b
je 0x1921e
movq (%r13), %r13
testq %r13, %r13
sete (%rsp)
jne 0x191d6
testb $0x1, (%rsp)
jne 0x1942a
leaq 0x13201(%rip), %r14     # 0x2c430
movl (%r14), %edi
decl %edi
callq 0x81c6
xorl %r12d, %r12d
cmpl $0x1, (%r14)
cmoveq %rax, %r12
cmpq 0x11d8d(%rip), %rax     # 0x2afd8
cmovneq %rax, %r12
movl %r15d, %edi
callq 0x1a06a
movl %eax, %edi
callq 0x18695
movq %rax, (%rsp)
movl 0x10(%rsp), %edi
callq 0x1a06a
movl %eax, %edi
callq 0x18695
movq %rax, 0x30(%rsp)
movsd 0x50(%rbx), %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x58(%rbx), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x60(%rbx), %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x68(%rbx), %xmm0
movsd %xmm0, 0x58(%rsp)
movsd 0x70(%rbx), %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x78(%rbx), %xmm0
movsd %xmm0, 0xd0(%rsp)
leaq 0x20b673d(%rip), %rax   # 0x20cfa00
movl (%rax), %eax
movl %eax, 0x80(%rsp)
movl (%r14), %r13d
leaq 0xa16b(%rip), %r15      # 0x23441
movq %r15, %r14
testq %r12, %r12
je 0x192f0
leaq 0x5314(%rip), %rsi      # 0x1e5f9
movq %r12, %rdi
callq 0x74c9
movq %rax, %r14
movq %r15, %r10
testq %r12, %r12
je 0x1930a
leaq 0x53e7(%rip), %rsi      # 0x1e6e6
movq %r12, %rdi
callq 0x74c9
movq %rax, %r10
decl %r13d
testq %r12, %r12
je 0x1932a
leaq 0x545b(%rip), %rsi      # 0x1e774
movq %r12, %rdi
movq %r10, %r15
callq 0x74c9
movq %r15, %r10
movq %rax, %r15
leaq 0xa67a(%rip), %rdi      # 0x239ab
movq (%rsp), %rsi
movq 0x30(%rsp), %rdx
movsd 0x60(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movsd 0x48(%rsp), %xmm2
movsd 0x58(%rsp), %xmm3
movsd 0x50(%rsp), %xmm4
movsd 0xd0(%rsp), %xmm5
movl 0x80(%rsp), %ecx
movl %r13d, %r8d
movq %r14, %r9
movb $0x6, %al
pushq %r15
pushq %r10
callq 0xa2f6
addq $0x10, %rsp
testq %rbp, %rbp
je 0x1942a
leaq 0x20bb693(%rip), %r13   # 0x20d4a20
leaq 0xa6d4(%rip), %r12      # 0x23a68
movq %rbp, (%rsp)
movq 0x48(%rbp), %r14
testq %r14, %r14
je 0x19419
movl 0x10(%r14), %edx
movslq 0x8(%r14), %rcx
movq %rcx, %rax
shlq $0x6, %rax
movsd (%r13,%rax), %xmm0
movsd 0x8(%r13,%rax), %xmm1
movsd 0x10(%r13,%rax), %xmm2
movl $0x5, %edi
leaq 0xa676(%rip), %rsi      # 0x23a47
movb $0x3, %al
callq 0xa496
cmpl $0x0, 0x2c(%r14)
jle 0x19414
leaq 0x48(%r14), %rbp
xorl %r15d, %r15d
movsd -0x10(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
movsd (%rbp), %xmm2
movl $0x5, %edi
movq %r12, %rsi
movb $0x3, %al
callq 0xa496
incq %r15
movslq 0x2c(%r14), %rax
addq $0x18, %rbp
cmpq %rax, %r15
jl 0x193e6
movq (%r14), %r14
jmp 0x1939c
movq (%rsp), %rbp
movq (%rbp), %rbp
testq %rbp, %rbp
jne 0x19394
movl 0x10(%rsp), %edi
callq 0x1a06a
movl %eax, 0xa0(%rbx)
xorl %ecx, %ecx
cmpl $-0x2, %eax
movq 0x70(%rsp), %r14
cmoveq %rcx, %r14
testq %r14, %r14
je 0x19742
movq %rbx, 0x40(%r14)
movq %r14, %r12
movq (%rbx), %r15
movl 0x8(%r14), %eax
movl %eax, 0x80(%rbx)
movq $0x0, 0x98(%rbx)
movq %r14, %rdi
callq 0x127fc
addq $0x48, %r14
movq %r12, 0x70(%rsp)
movq 0x48(%r12), %rdi
testq %rdi, %rdi
je 0x194a2
movq %r14, %r12
movq %r12, %rsi
callq 0x1a2ac
movq (%r12), %r12
movq (%r12), %rdi
testq %rdi, %rdi
jne 0x1948d
xorl %eax, %eax
movq %rax, (%rbx)
movq %rax, 0x98(%rbx)
movq (%r14), %r12
testq %r12, %r12
je 0x194fb
cmpl $0x4, 0x30(%r12)
je 0x194f5
cmpl $-0x2, 0x10(%r12)
je 0x194f5
callq 0x1498d
movq %rax, %r13
movl $0x4b8, %edx            # imm = 0x4B8
movq %rax, %rdi
movq %r12, %rsi
callq 0x4260
movq %r13, 0x20(%r12)
movq 0x98(%rbx), %rax
movq %rax, (%r13)
movq %r13, 0x98(%rbx)
movq (%r12), %r12
jmp 0x194b1
callq 0x157b5
movq %rax, 0x88(%rbx)
callq 0x157b5
movq %rax, 0x90(%rbx)
movq 0x70(%rsp), %rcx
cmpl $0x0, 0x50(%rcx)
movq 0x88(%rbx), %rax
setg 0x48(%rax)
cmpl $0x0, 0x50(%rcx)
movq 0x90(%rbx), %rax
setg 0x48(%rax)
testq %r15, %r15
je 0x1974f
movslq 0x80(%rbx), %r12
shlq $0x6, %r12
addq 0x11a57(%rip), %r12     # 0x2afa8
leaq 0x20bb4c8(%rip), %r13   # 0x20d4a20
movq $0x0, (%rsp)
movq $0x0, 0x30(%rsp)
movq (%r15), %rbp
movslq 0x8(%r15), %rax
shlq $0x6, %rax
movsd (%r13,%rax), %xmm0
ucomisd (%r12), %xmm0
jne 0x195c5
jp 0x195c5
addq %r13, %rax
movsd 0x8(%rax), %xmm0
ucomisd 0x8(%r12), %xmm0
jne 0x195c5
jp 0x195c5
movsd 0x10(%rax), %xmm0
ucomisd 0x10(%r12), %xmm0
jne 0x195c5
jp 0x195c5
movsd 0x30(%rax), %xmm0
movsd 0x30(%r12), %xmm1
ucomisd %xmm1, %xmm0
jbe 0x19629
movq %r15, %r14
xorl %r15d, %r15d
jmp 0x196e8
movq %rbp, 0x10(%rsp)
movq 0x48(%r15), %r13
testq %r13, %r13
je 0x1966d
xorl %ebp, %ebp
xorl %r14d, %r14d
movq %r13, %rdi
movq (%r13), %r13
movq %r12, %rsi
leaq 0x90(%rsp), %rdx
leaq 0x28(%rsp), %rcx
callq 0x149b6
movq 0x90(%rsp), %rax
testq %rax, %rax
je 0x19610
movq %r14, (%rax)
movq 0x90(%rsp), %r14
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0x19622
movq %rbp, (%rax)
movq 0x28(%rsp), %rbp
testq %r13, %r13
jne 0x195dc
jmp 0x19672
ucomisd %xmm0, %xmm1
jbe 0x19637
xorl %r14d, %r14d
jmp 0x196e8
movq %rbp, 0x10(%rsp)
movq 0x48(%r15), %rax
testq %rax, %rax
je 0x1966d
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 0x1964a
jmp 0x19672
xorl %r14d, %r14d
xorl %ebp, %ebp
movq %r14, %rax
orq %rbp, %rax
jne 0x19689
xorl %r14d, %r14d
xorl %r15d, %r15d
leaq 0x20bb399(%rip), %r13   # 0x20d4a20
jmp 0x196e3
testq %r14, %r14
leaq 0x20bb38d(%rip), %r13   # 0x20d4a20
je 0x196d0
testq %rbp, %rbp
je 0x196d9
callq 0x150c5
movl $0xb, %ecx
movq %rax, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rbp, 0x48(%rax)
movq %r14, 0x48(%r15)
movq %rax, %rdi
movq %rax, %rbp
callq 0x185ad
movq %r15, %rdi
callq 0x185ad
movq %r15, %r14
movq %rbp, %r15
jmp 0x196e3
movq %rbp, 0x48(%r15)
xorl %r14d, %r14d
jmp 0x196e3
movq %r14, 0x48(%r15)
movq %r15, %r14
xorl %r15d, %r15d
movq 0x10(%rsp), %rbp
testq %r14, %r14
je 0x1970f
cmpq $0x0, 0x48(%r14)
jne 0x19702
leaq 0xa3b7(%rip), %rdi      # 0x23ab2
xorl %eax, %eax
callq 0x9f84
movq 0x30(%rsp), %rax
movq %rax, (%r14)
movq %r14, 0x30(%rsp)
testq %r15, %r15
je 0x19734
cmpq $0x0, 0x48(%r15)
jne 0x19729
leaq 0xa390(%rip), %rdi      # 0x23ab2
xorl %eax, %eax
callq 0x9f84
movq (%rsp), %rax
movq %rax, (%r15)
movq %r15, (%rsp)
movq %rbp, %r15
testq %rbp, %rbp
jne 0x19569
jmp 0x19760
movq %rbx, %rdi
callq 0x19d8f
jmp 0x19d65
movq $0x0, 0x30(%rsp)
movq $0x0, (%rsp)
movq 0x88(%rbx), %rax
movq 0x30(%rsp), %rcx
movq %rcx, (%rax)
movq 0x90(%rbx), %rax
movq (%rsp), %rcx
movq %rcx, (%rax)
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x197ec
movslq 0x80(%rbx), %r15
shlq $0x6, %r15
addq 0x11810(%rip), %r15     # 0x2afa8
xorl %ebp, %ebp
leaq 0x28(%rsp), %r13
xorl %r12d, %r12d
movq %r14, %rdi
movq (%r14), %r14
movq %r15, %rsi
leaq 0x90(%rsp), %rdx
movq %r13, %rcx
callq 0x153e5
movq 0x90(%rsp), %rax
testq %rax, %rax
je 0x197d3
movq %rbp, (%rax)
movq 0x90(%rsp), %rbp
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0x197e5
movq %r12, (%rax)
movq 0x28(%rsp), %r12
testq %r14, %r14
jne 0x197a2
jmp 0x197f1
xorl %r12d, %r12d
xorl %ebp, %ebp
movq 0x88(%rbx), %rax
movq %rbp, 0x8(%rax)
movq 0x90(%rbx), %rax
movq %r12, 0x8(%rax)
cmpq $0x0, 0x10(%rbx)
je 0x19968
xorl %r14d, %r14d
leaq 0x20bb204(%rip), %rbp   # 0x20d4a20
leaq 0x90(%rsp), %r15
leaq 0x28(%rsp), %r12
leaq 0xe8(%rsp), %r13
movq 0x70(%rsp), %rcx
movslq 0x8(%rcx), %rax
shlq $0x6, %rax
movsd (%rbp,%rax), %xmm0
testq %r14, %r14
je 0x19893
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 0x7a05(%rip), %xmm0     # 0x21290
subsd 0x30(%rbp,%rax), %xmm0
jmp 0x198d8
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 0x79b8(%rip), %xmm0     # 0x21290
movsd %xmm0, 0xc0(%rsp)
movq 0x10(%rbx), %rdi
callq 0x15244
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x153e5
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x1990d
callq 0x15204
cmpq $0x0, 0x28(%rsp)
jne 0x19941
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 0x9fe9(%rip), %rdi      # 0x23923
movb $0x6, %al
callq 0xa2f6
movq 0x28(%rsp), %rax
movq 0x88(%rbx,%r14,8), %rcx
movq %rax, 0x10(%rcx)
incq %r14
cmpq $0x1, %r14
je 0x19831
movq 0x10(%rbx), %rdi
callq 0x15204
movq $0x0, 0x10(%rbx)
movq 0x70(%rsp), %rax
cmpl $0x0, 0x50(%rax)
jne 0x19d03
movslq 0x80(%rbx), %r12
shlq $0x6, %r12
addq 0x11617(%rip), %r12     # 0x2afa8
movl $0x20, %edi
callq 0x42f0
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
callq 0xc8e2
callq 0x150f5
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, 0x30(%rsp)
movq %rbx, 0x40(%rax)
movq 0xb0(%rbx), %rbp
testq %rbp, %rbp
je 0x19af6
leaq 0x63e4(%rip), %rax      # 0x1fde0
movaps (%rax), %xmm0
movaps %xmm0, 0x10(%rsp)
movsd 0x10(%rax), %xmm0
movsd %xmm0, (%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 0x19ac3
cmpq %rbx, 0x50(%rbp)
je 0x19a76
leaq 0xa05e(%rip), %rdi      # 0x23ac8
xorl %eax, %eax
callq 0x9f84
movl %r14d, %r13d
jmp 0x19ac3
movsd 0xc0(%rsp), %xmm0
xorps 0x784a(%rip), %xmm0     # 0x212d0
movlps %xmm0, 0xc0(%rsp)
movapd 0x10(%rsp), %xmm0
subpd 0x90(%rsp), %xmm0
movapd %xmm0, 0x90(%rsp)
movsd (%rsp), %xmm0
subsd 0xa0(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
movl $0x1, %r13d
movq %r15, %rdi
movq %r12, %rsi
movl $0x1, %edx
movsd 0x79ba(%rip), %xmm0     # 0x21490
callq 0xd070
cmpl $0x0, 0x8(%r15)
je 0x19b14
movl %r13d, %eax
movq 0x58(%rbp,%rax,8), %rbp
movl %r13d, %r14d
testq %rbp, %rbp
jne 0x19a19
movq 0x30(%rsp), %rdi
movq %r15, 0x68(%rdi)
movq 0x88(%rbx), %rsi
movq 0x90(%rbx), %rdx
callq 0x13d28
jmp 0x19b4f
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 0x9fb0(%rip), %rsi      # 0x23ae9
movl $0x2, %edi
movb $0x6, %al
callq 0xa496
movq 0x30(%rsp), %rdi
callq 0x15120
movq 0xb0(%rbx), %rbp
testq %rbp, %rbp
je 0x19cf8
movslq 0x80(%rbx), %r13
shlq $0x6, %r13
addq 0x11437(%rip), %r13     # 0x2afa8
movq 0x88(%rbx), %rax
movq %rax, (%rsp)
movq 0x90(%rbx), %rax
movq %rax, 0x10(%rsp)
xorl %r14d, %r14d
movq %r13, 0x30(%rsp)
movl %r14d, %r12d
movq %rbp, %r15
movl $0x0, %r14d
cmpq %rbx, 0x48(%rbp)
je 0x19bc1
cmpq %rbx, 0x50(%r15)
je 0x19bbb
leaq 0x9f91(%rip), %rdi      # 0x23b40
xorl %eax, %eax
callq 0x9f84
movl %r12d, %r14d
jmp 0x19bc1
movl $0x1, %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 0x48(%r15), %rsi
movq %r15, %rdi
callq 0x13d84
movq 0x50(%r15), %rsi
movq %r15, %rdi
callq 0x13d84
movq 0x68(%r15), %rdi
movq %r13, %rsi
leaq 0x90(%rsp), %rdx
leaq 0x28(%rsp), %rcx
movsd 0x7886(%rip), %xmm0     # 0x21490
callq 0xd3aa
movq 0x90(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, %rdx
orq %rax, %rdx
je 0x19cef
testq %rcx, %rcx
je 0x19c8d
testq %rax, %rax
je 0x19c9f
callq 0x150f5
movq %rax, %r13
movl $0xe, %ecx
movq %rax, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq 0x28(%rsp), %rax
movq %rax, 0x68(%r13)
movq 0x68(%r15), %rdi
testq %rdi, %rdi
je 0x19c60
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x90(%rsp), %rax
movq %rax, 0x68(%r15)
testl %r14d, %r14d
je 0x19cb0
movq %r15, %rdi
movq %r12, %rsi
movq (%rsp), %rdx
callq 0x13d28
movq %r13, %rdi
movq %r12, %rsi
movq 0x10(%rsp), %rdx
jmp 0x19cca
testl %r14d, %r14d
je 0x19cd6
movq %r15, %rdi
movq %r12, %rsi
movq 0x10(%rsp), %rdx
jmp 0x19cea
testl %r14d, %r14d
je 0x19ce0
movq %r15, %rdi
movq %r12, %rsi
movq (%rsp), %rdx
jmp 0x19cea
movq %r15, %rdi
movq (%rsp), %rsi
movq %r12, %rdx
callq 0x13d28
movq %r13, %rdi
movq 0x10(%rsp), %rsi
movq %r12, %rdx
callq 0x13d28
movq 0x30(%rsp), %r13
jmp 0x19cef
movq %r15, %rdi
movq 0x10(%rsp), %rsi
jmp 0x19ce7
movq %r15, %rdi
movq (%rsp), %rsi
movq %r12, %rdx
callq 0x13d28
testq %rbp, %rbp
jne 0x19b90
movq $0x0, 0xb0(%rbx)
movq 0x88(%rbx), %rdi
callq 0x187da
movq 0x90(%rbx), %rdi
callq 0x187da
cmpb $0x1, 0x32bad42(%rip)   # 0x32d4a64
jne 0x19d65
movl 0x32bad36(%rip), %esi   # 0x32d4a60
incl %esi
movl %esi, 0x32bad2e(%rip)   # 0x32d4a60
movslq %esi, %rax
imulq $0x10624dd3, %rax, %rax # imm = 0x10624DD3
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x25, %rax
addl %ecx, %eax
cmpl 0x32bad19(%rip), %eax   # 0x32d4a68
jle 0x19d65
movl %eax, 0x32bad11(%rip)   # 0x32d4a68
leaq 0x9e05(%rip), %rdi      # 0x23b63
xorl %eax, %eax
callq 0x9c96
addq $0x128, %rsp            # imm = 0x128
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