LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: AttachEdgeToFace(btreeface_s*, btreeedge_s*, int)
void AttachEdgeToFace (btreeface_t *tf, btreeedge_t *te, int side)
{
	if (tf->infinite && !te->infinite)
	{
		PrintOnce ("AttachEdgeToFace: internal error: attaching a finite object to an infinite object.");
		hlassume (false, assume_first);
	}
	btreeedge_r er;
	er.e = te;
	er.side = side;
	tf->edges->push_back (er);

	btreeface_r fr;
	fr.f = tf;
	fr.side = side;
	te->faces->push_back (fr);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
cmpb $0x1, 0x8(%rdi)
jne 0xe03f
cmpb $0x0, 0x20(%r15)
jne 0xe03f
leaq 0x1264c(%rip), %rdi     # 0x2067b
xorl %eax, %eax
callq 0xa10c
xorl %edi, %edi
xorl %esi, %esi
callq 0xa655
movq (%r14), %r12
movl $0x20, %edi
callq 0x42f0
testl %ebx, %ebx
movq %r15, 0x10(%rax)
setne 0x18(%rax)
movq %rax, %rdi
movq %r12, %rsi
callq 0x4070
incq 0x10(%r12)
movq 0x28(%r15), %r15
movl $0x20, %edi
callq 0x42f0
testl %ebx, %ebx
movq %r14, 0x10(%rax)
setne 0x18(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x4070
incq 0x10(%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: AttachFaceToLeaf(btreeleaf_s*, btreeface_s*, int)
void AttachFaceToLeaf (btreeleaf_t *tl, btreeface_t *tf, int side)
{
	if (tl->infinite && !tf->infinite)
	{
		PrintOnce ("AttachFaceToLeaf: internal error: attaching a finite object to an infinite object.");
		hlassume (false, assume_first);
	}
	btreeface_r fr;
	fr.f = tf;
	fr.side = side;
	tl->faces->push_back (fr);

	if (tf->leafs[side].l)
	{
		PrintOnce ("AttachFaceToLeaf: internal error: leaf occupied.");
		hlassume (false, assume_first);
	}
	tf->leafs[side].l = tl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x1, 0x8(%rdi)
jne 0xe0cc
cmpb $0x0, 0x8(%r14)
jne 0xe0cc
leaq 0x12612(%rip), %rdi     # 0x206ce
xorl %eax, %eax
callq 0xa10c
xorl %edi, %edi
xorl %esi, %esi
callq 0xa655
movq (%rbx), %r15
movl $0x20, %edi
callq 0x42f0
testl %ebp, %ebp
movq %r14, 0x10(%rax)
setne 0x18(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x4070
incq 0x10(%r15)
movslq %ebp, %rax
shlq $0x4, %rax
addq %rax, %r14
addq $0x10, %r14
cmpq $0x0, (%r14)
je 0xe11d
leaq 0x12614(%rip), %rdi     # 0x20721
xorl %eax, %eax
callq 0xa10c
xorl %edi, %edi
xorl %esi, %esi
callq 0xa655
movq %rbx, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: AllocTreeleaf(int&, bool)
btreeleaf_t *AllocTreeleaf (int &numobjects, bool infinite)
{
	numobjects++;
	btreeleaf_t *tl = (btreeleaf_t *)malloc (sizeof (btreeleaf_t));
	hlassume (tl != NULL, assume_NoMemory);
	tl->faces = new btreeface_l ();
	tl->infinite = infinite;
	return tl;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
incl (%rdi)
movl $0x18, %edi
callq 0x4400
movq %rax, %r14
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa655
movl $0x18, %edi
callq 0x42f0
movq %rax, 0x8(%rax)
movq %rax, (%rax)
movq $0x0, 0x10(%rax)
movq %rax, (%r14)
movb %bl, 0x8(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: GetPointFromEdge(btreeedge_s*, bool)
btreepoint_t *GetPointFromEdge (btreeedge_t *te, bool side)
{
	if (!te->points[side].p)
	{
		PrintOnce ("GetPointFromEdge: internal error: point not set.");
		hlassume (false, assume_first);
	}
	return te->points[side].p;
}

// Assembly:
shll $0x4, %esi
movq (%rdi,%rsi), %rax
testq %rax, %rax
je 0xe76a
retq
pushq %rbx
movq %rdi, %rbx
addq %rsi, %rbx
leaq 0x11fda(%rip), %rdi     # 0x20752
xorl %eax, %eax
callq 0xa10c
xorl %edi, %edi
xorl %esi, %esi
callq 0xa655
movq (%rbx), %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: RemoveEdgeFromList(std::__cxx11::list<btreeedge_r, std::allocator<btreeedge_r>>*, btreeedge_s*, bool)
void RemoveEdgeFromList (btreeedge_l *el, btreeedge_t *te, bool side)
{
	btreeedge_l::iterator ei;
	for (ei = el->begin (); ei != el->end (); ei++)
	{
		if (ei->e == te && ei->side == side)
		{
			el->erase (ei);
			return; // only remove one copy if there are many (in order to preserve topological correctness)
		}
	}
	PrintOnce ("RemoveEdgeFromList: internal error: edge not found.");
	hlassume (false, assume_first);
}

// Assembly:
pushq %rbx
movq (%rdi), %rbx
cmpq %rdi, %rbx
je 0xe7a6
cmpq %rsi, 0x10(%rbx)
jne 0xe7a1
cmpb %dl, 0x18(%rbx)
je 0xe7be
movq (%rbx), %rbx
jmp 0xe791
leaq 0x11fd6(%rip), %rdi     # 0x20783
xorl %eax, %eax
callq 0xa10c
xorl %edi, %edi
xorl %esi, %esi
popq %rbx
jmp 0xa655
decq 0x10(%rdi)
movq %rbx, %rdi
callq 0x4500
movl $0x20, %esi
movq %rbx, %rdi
popq %rbx
jmp 0x4300
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: RemovePointFromEdge(btreeedge_s*, btreepoint_s*, bool)
void RemovePointFromEdge (btreeedge_t *te, btreepoint_t *tp, bool side) // warning: the point will not be freed
{
	if (te->points[side].p != tp)
	{
		PrintOnce ("RemovePointFromEdge: internal error: point not found.");
		hlassume (false, assume_first);
	}
	te->points[side].p = NULL;

	RemoveEdgeFromList (tp->edges, te, side);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl %edx, %eax
shll $0x4, %eax
leaq (%rdi,%rax), %r15
cmpq %rsi, (%rdi,%rax)
je 0xe80d
leaq 0x11fba(%rip), %rdi     # 0x207b7
xorl %eax, %eax
callq 0xa10c
xorl %edi, %edi
xorl %esi, %esi
callq 0xa655
movq $0x0, (%r15)
movq 0x20(%r14), %rdi
movzbl %bpl, %edx
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xe78d
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: DeletePoint(int&, btreepoint_s*)
void DeletePoint (int &numobjects, btreepoint_t *tp)
{
	if (!tp->edges->empty ())
	{
		PrintOnce ("DeletePoint: internal error: point used by edge.");
		hlassume (false, assume_first);
	}
	delete tp->edges;
	free (tp);
	numobjects--;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x20(%rsi), %r15
movq (%r15), %rdi
cmpq %r15, %rdi
je 0xe86b
leaq 0x11f9e(%rip), %rdi     # 0x207ed
xorl %eax, %eax
callq 0xa10c
xorl %edi, %edi
xorl %esi, %esi
callq 0xa655
movq 0x20(%r14), %r15
testq %r15, %r15
je 0xe887
movq (%r15), %rdi
cmpq %r15, %rdi
je 0xe88a
movq (%rdi), %r12
movl $0x20, %esi
callq 0x4300
movq %r12, %rdi
cmpq %r15, %r12
jne 0xe870
jmp 0xe88a
xorl %r15d, %r15d
movl $0x18, %esi
movq %r15, %rdi
callq 0x4300
movq %r14, %rdi
callq 0x4380
decl (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: RemoveFaceFromList(std::__cxx11::list<btreeface_r, std::allocator<btreeface_r>>*, btreeface_s*, bool)
void RemoveFaceFromList (btreeface_l *fl, btreeface_t *tf, bool side)
{
	btreeface_l::iterator fi;
	for (fi = fl->begin (); fi != fl->end (); fi++)
	{
		if (fi->f == tf && fi->side == side)
		{
			fl->erase (fi);
			return;
		}
	}
	PrintOnce ("RemoveFaceFromList: internal error: face not found.");
	hlassume (false, assume_first);
}

// Assembly:
pushq %rbx
movq (%rdi), %rbx
cmpq %rdi, %rbx
je 0xe8c6
cmpq %rsi, 0x10(%rbx)
jne 0xe8c1
cmpb %dl, 0x18(%rbx)
je 0xe8de
movq (%rbx), %rbx
jmp 0xe8b1
leaq 0x11f51(%rip), %rdi     # 0x2081e
xorl %eax, %eax
callq 0xa10c
xorl %edi, %edi
xorl %esi, %esi
popq %rbx
jmp 0xa655
decq 0x10(%rdi)
movq %rbx, %rdi
callq 0x4500
movl $0x20, %esi
movq %rbx, %rdi
popq %rbx
jmp 0x4300
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: DeleteEdge(int&, btreeedge_s*)
void DeleteEdge (int &numobjects, btreeedge_t *te) // warning: points in this edge could be freed if not reference by any other edges
{
	if (!te->faces->empty ())
	{
		PrintOnce ("DeleteEdge: internal error: edge used by face.");
		hlassume (false, assume_first);
	}
	if (!te->infinite)
	{
		DeleteBrink (te->brink);
	}
	for (int side = 0; side < 2; side++)
	{
		btreepoint_t *tp;
		tp = GetPointFromEdge (te, side);
		RemovePointFromEdge (te, tp, side);
		if (tp->edges->empty ())
		{
			DeletePoint (numobjects, tp);
		}
	}
	delete te->faces;
	free (te);
	numobjects--;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x28(%rsi), %rax
cmpq %rax, (%rax)
je 0xe94e
leaq 0x11f14(%rip), %rdi     # 0x20852
xorl %eax, %eax
callq 0xa10c
xorl %edi, %edi
xorl %esi, %esi
callq 0xa655
cmpb $0x1, 0x20(%r14)
je 0xe95e
movq 0x30(%r14), %rdi
callq 0xda9e
movb $0x1, %r12b
xorl %eax, %eax
movzbl %al, %ebp
andl $0x1, %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0xe75d
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0xe7d8
movq 0x20(%r15), %rax
cmpq %rax, (%rax)
jne 0xe997
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe82e
movb $0x1, %al
testb $0x1, %r12b
movl $0x0, %r12d
jne 0xe963
movq 0x28(%r14), %r15
testq %r15, %r15
je 0xe9cb
movq (%r15), %rdi
cmpq %r15, %rdi
je 0xe9cb
movq (%rdi), %r12
movl $0x20, %esi
callq 0x4300
movq %r12, %rdi
cmpq %r15, %r12
jne 0xe9b6
movl $0x18, %esi
movq %r15, %rdi
callq 0x4300
movq %r14, %rdi
callq 0x4380
decl (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: GetLeafFromFace(btreeface_s*, bool)
btreeleaf_t *GetLeafFromFace (btreeface_t *tf, bool side)
{
	if (!tf->leafs[side].l)
	{
		PrintOnce ("GetLeafFromFace: internal error: Leaf not set.");
		hlassume (false, assume_first);
	}
	return tf->leafs[side].l;
}

// Assembly:
shll $0x4, %esi
movq 0x10(%rdi,%rsi), %rax
testq %rax, %rax
je 0xe9f9
retq
pushq %rbx
leaq (%rdi,%rsi), %rbx
addq $0x10, %rbx
leaq 0x11e78(%rip), %rdi     # 0x20881
xorl %eax, %eax
callq 0xa10c
xorl %edi, %edi
xorl %esi, %esi
callq 0xa655
movq (%rbx), %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: RemoveFaceFromLeaf(btreeleaf_s*, btreeface_s*, bool)
void RemoveFaceFromLeaf (btreeleaf_t *tl, btreeface_t *tf, bool side)
{
	if (tf->leafs[side].l != tl)
	{
		PrintOnce ("RemoveFaceFromLeaf: internal error: leaf not found.");
		hlassume (false, assume_first);
	}
	tf->leafs[side].l = NULL;

	RemoveFaceFromList (tl->faces, tf, side);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movl %edx, %eax
shll $0x4, %eax
leaq (%rsi,%rax), %r15
addq $0x10, %r15
cmpq %rdi, (%r15)
je 0xea56
leaq 0x11e6a(%rip), %rdi     # 0x208b0
xorl %eax, %eax
callq 0xa10c
xorl %edi, %edi
xorl %esi, %esi
callq 0xa655
movq $0x0, (%r15)
movq (%r14), %rdi
movzbl %bpl, %edx
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xe8ad
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: DeleteFace(int&, btreeface_s*)
void DeleteFace (int &numobjects, btreeface_t *tf) // warning: edges in this face could be freed if not reference by any other faces
{
	btreeedge_l::iterator ei;
	while ((ei = tf->edges->begin ()) != tf->edges->end ())
	{
		btreeedge_t *te = ei->e;
		RemoveFaceFromList (te->faces, tf, ei->side);
		tf->edges->erase (ei);
		if (te->faces->empty ())
		{
			DeleteEdge (numobjects, te);
		}
	}
	for (int side = 0; side < 2; side++)
	{
		if (tf->leafs[side].l)
		{
			PrintOnce ("DeleteFace: internal error: face used by leaf.");
			hlassume (false, assume_first);
		}
	}
	delete tf->edges;
	free (tf);
	numobjects--;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
movq (%rax), %r15
cmpq %rax, %r15
je 0xeadb
movq 0x10(%r15), %r12
movq 0x28(%r12), %rdi
movzbl 0x18(%r15), %edx
movq %r14, %rsi
callq 0xe8ad
movq (%r14), %rax
decq 0x10(%rax)
movq %r15, %rdi
callq 0x4500
movl $0x20, %esi
movq %r15, %rdi
callq 0x4300
movq 0x28(%r12), %rax
cmpq %rax, (%rax)
jne 0xead6
movq %rbx, %rdi
movq %r12, %rsi
callq 0xe920
movq (%r14), %rax
jmp 0xea87
leaq 0x10(%r14), %r12
movb $0x1, %bpl
leaq 0x11dfb(%rip), %r15     # 0x208e4
xorl %eax, %eax
shlq $0x4, %rax
cmpq $0x0, (%r12,%rax)
je 0xeb09
movq %r15, %rdi
xorl %eax, %eax
callq 0xa10c
xorl %edi, %edi
xorl %esi, %esi
callq 0xa655
movl $0x1, %eax
testb $0x1, %bpl
movl $0x0, %ebp
jne 0xeaeb
movq (%r14), %r15
testq %r15, %r15
je 0xeb3e
movq (%r15), %rdi
cmpq %r15, %rdi
je 0xeb3e
movq (%rdi), %r12
movl $0x20, %esi
callq 0x4300
movq %r12, %rdi
cmpq %r15, %r12
jne 0xeb29
movl $0x18, %esi
movq %r15, %rdi
callq 0x4300
movq %r14, %rdi
callq 0x4380
decl (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: DeleteLeaf(int&, btreeleaf_s*)
void DeleteLeaf (int &numobjects, btreeleaf_t *tl)
{
	btreeface_l::iterator fi;
	while ((fi = tl->faces->begin ()) != tl->faces->end ())
	{
		btreeface_t *tf = fi->f;
		RemoveFaceFromLeaf (tl, tf, fi->side);
		if (!tf->leafs[false].l && !tf->leafs[true].l)
		{
			DeleteFace (numobjects, tf);
		}
	}
	delete tl->faces;
	free (tl);
	numobjects--;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rdi
movq (%rdi), %rax
cmpq %rdi, %rax
je 0xeba5
movq 0x10(%rax), %r15
movzbl 0x18(%rax), %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0xea1e
cmpq $0x0, 0x10(%r15)
jne 0xeba0
cmpq $0x0, 0x20(%r15)
jne 0xeba0
movq %rbx, %rdi
movq %r15, %rsi
callq 0xea76
movq (%r14), %rdi
jmp 0xeb6c
movl $0x18, %esi
callq 0x4300
movq %r14, %rdi
callq 0x4380
decl (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: BuildTreeCells_r(int&, bclipnode_s*)
void BuildTreeCells_r (int &numobjects, bclipnode_t *c)
{
	if (c->isleaf)
	{
		return;
	}
	btreeleaf_t *tl, *front, *back;
	tl = c->treeleaf;
	SplitTreeLeaf (numobjects, tl, c->plane, c->planenum, ON_EPSILON, front, back, c->children[0], c->children[1]);
	c->treeleaf = NULL;
	c->children[0]->treeleaf = front;
	c->children[1]->treeleaf = back;
	BuildTreeCells_r (numobjects, c->children[0]);
	BuildTreeCells_r (numobjects, c->children[1]);
}

// Assembly:
cmpb $0x0, (%rsi)
jne 0xfb4e
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rsp), %r15
leaq 0x18(%rsp), %r12
movq 0x30(%rbx), %rsi
movq 0x8(%rbx), %rdx
movl 0x4(%rbx), %ecx
movups 0x10(%rbx), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movsd 0x1097f(%rip), %xmm0    # 0x20480
movq %r15, %r8
movq %r12, %r9
callq 0xebbf
movq $0x0, 0x30(%rbx)
movq 0x20(%rsp), %rax
movq 0x10(%rbx), %rcx
movq %rax, 0x30(%rcx)
movq 0x18(%rsp), %rax
movq 0x18(%rbx), %rcx
movq %rax, 0x30(%rcx)
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0xfabf
movq 0x18(%rbx), %rbx
cmpb $0x1, (%rbx)
jne 0xfae3
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: ExpandClipnodes_r(bclipnode_s*, int&, dclipnode_t const*, int)
bclipnode_t *ExpandClipnodes_r (bclipnode_t *bclipnodes, int &numbclipnodes, const dclipnode_t *clipnodes, int headnode)
{
	if (numbclipnodes >= MAXCLIPNODES)
	{
		Error ("ExpandClipnodes_r: exceeded MAXCLIPNODES");
	}
	bclipnode_t *c = &bclipnodes[numbclipnodes];
	numbclipnodes++;
	if (headnode < 0)
	{
		c->isleaf = true;
		c->content = headnode;
		c->partitions = NULL;
	}
	else
	{
		c->isleaf = false;
		c->planenum = clipnodes[headnode].planenum;
		c->plane = &g_dplanes[c->planenum];
		for (int k = 0; k < 2; k++)
		{
			c->children[k] = ExpandClipnodes_r (bclipnodes, numbclipnodes, clipnodes, clipnodes[headnode].children[k]);
		}
	}
	return c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl (%rsi), %eax
cmpl $0x3fff8, %eax          # imm = 0x3FFF8
jl 0xfb7f
leaq 0x10f01(%rip), %rdi     # 0x20a76
xorl %eax, %eax
callq 0x9e9c
movl (%r14), %eax
cltq
imulq $0x38, %rax, %r12
addq %r15, %r12
incl %eax
movl %eax, (%r14)
testl %ebp, %ebp
js 0xfbe6
movb $0x0, (%r12)
movl %ebp, %r13d
movslq (%rbx,%r13,8), %rax
movl %eax, 0x4(%r12)
shlq $0x6, %rax
addq 0x1a3fb(%rip), %rax     # 0x29fa8
movq %rax, 0x8(%r12)
movswl 0x4(%rbx,%r13,8), %ecx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xfb4f
movq %rax, 0x10(%r12)
movswl 0x6(%rbx,%r13,8), %ecx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xfb4f
movq %rax, 0x18(%r12)
jmp 0xfbf9
movb $0x1, (%r12)
movl %ebp, 0x20(%r12)
movq $0x0, 0x28(%r12)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: ExpandClipnodes(bbrinkinfo_s*, dclipnode_t const*, int)
void ExpandClipnodes (bbrinkinfo_t *info, const dclipnode_t *clipnodes, int headnode)
{
	bclipnode_t *bclipnodes = (bclipnode_t *)malloc (MAXCLIPNODES * sizeof (bclipnode_t)); // 262144 * 30byte = 7.5MB
	hlassume (bclipnodes != NULL, assume_NoMemory);
	info->numclipnodes = 0;
	ExpandClipnodes_r (bclipnodes, info->numclipnodes, clipnodes, headnode);
	info->clipnodes = (bclipnode_t *)malloc (info->numclipnodes * sizeof (bclipnode_t));
	hlassume (info->clipnodes != NULL, assume_NoMemory);
	memcpy (info->clipnodes, bclipnodes, info->numclipnodes * sizeof (bclipnode_t));
	for (int i = 0; i < info->numclipnodes; i++)
	{
		for (int k = 0; k < 2; k++)
		{
			info->clipnodes[i].children[k] = info->clipnodes + (bclipnodes[i].children[k] - bclipnodes);
		}
	}
	free (bclipnodes);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movl $0xdffe40, %edi         # imm = 0xDFFE40
callq 0x4400
movq %rax, %r14
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa655
movl $0x0, (%rbx)
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movl %ebp, %ecx
callq 0xfb4f
movslq (%rbx), %rax
imulq $0x38, %rax, %rdi
callq 0x4400
movq %rax, 0x8(%rbx)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa655
movq 0x8(%rbx), %rdi
movslq (%rbx), %rax
imulq $0x38, %rax, %rdx
movq %r14, %rsi
callq 0x4260
cmpl $0x0, (%rbx)
jle 0xfcc6
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x8(%rbx), %rdx
movq 0x10(%r14,%rax), %rsi
subq %r14, %rsi
addq %rdx, %rsi
movq %rsi, 0x10(%rdx,%rax)
movq 0x8(%rbx), %rdx
movq 0x18(%r14,%rax), %rsi
subq %r14, %rsi
addq %rdx, %rsi
movq %rsi, 0x18(%rdx,%rax)
incq %rcx
movslq (%rbx), %rdx
addq $0x38, %rax
cmpq %rdx, %rcx
jl 0xfc8f
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4380
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: BuildTreeCells(bbrinkinfo_s*)
void BuildTreeCells (bbrinkinfo_t *info)
{
	info->numobjects = 0;
	info->leaf_outside = BuildOutside (info->numobjects);
	info->clipnodes[0].treeleaf = BuildBaseCell (info->numobjects, &info->clipnodes[0], BOGUS_RANGE, info->leaf_outside);
	BuildTreeCells_r (info->numobjects, &info->clipnodes[0]);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %r14
movl $0x0, 0x10(%rdi)
movq %r14, %rdi
movl $0x1, %esi
callq 0xe159
movq $0x0, 0x10(%rax)
movq %rax, 0x18(%rbx)
movq 0x8(%rbx), %rsi
movsd 0x10779(%rip), %xmm0    # 0x20488
movq %r14, %rdi
movq %rax, %rdx
callq 0xe1c1
movq 0x8(%rbx), %rcx
movq %rax, 0x30(%rcx)
movq 0x8(%rbx), %rsi
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xfabf
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: DeleteTreeCells_r(int&, bclipnode_s*)
void DeleteTreeCells_r (int &numobjects, bclipnode_t *node)
{
	if (node->treeleaf)
	{
		DeleteLeaf (numobjects, node->treeleaf);
		node->treeleaf = NULL;
	}
	if (!node->isleaf)
	{
		DeleteTreeCells_r (numobjects, node->children[0]);
		DeleteTreeCells_r (numobjects, node->children[1]);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x30(%rbx), %rsi
testq %rsi, %rsi
je 0xfd58
movq %r14, %rdi
callq 0xeb5e
movq $0x0, 0x30(%rbx)
cmpb $0x0, (%rbx)
jne 0xfd6f
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0xfd35
movq 0x18(%rbx), %rbx
jmp 0xfd3f
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: DeleteTreeCells(bbrinkinfo_s*)
void DeleteTreeCells (bbrinkinfo_t *info)
{
	DeleteLeaf (info->numobjects, info->leaf_outside);
	info->leaf_outside = NULL;
	DeleteTreeCells_r (info->numobjects, &info->clipnodes[0]);
	if (info->numobjects != 0)
	{
		PrintOnce ("DeleteTreeCells: internal error: numobjects != 0");
		hlassume (false, assume_first);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %r14
movq 0x18(%rdi), %rsi
movq %r14, %rdi
callq 0xeb5e
movq $0x0, 0x18(%rbx)
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0xfd35
cmpl $0x0, 0x10(%rbx)
je 0xfdc6
leaq 0x10cf0(%rip), %rdi     # 0x20a9f
xorl %eax, %eax
callq 0xa10c
xorl %edi, %edi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xa655
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: ClearMarks_r(bclipnode_s*)
void ClearMarks_r (bclipnode_t *node)
{
	if (node->isleaf)
	{
		btreeface_l::iterator fi;
		btreeedge_l::iterator ei;
		for (fi = node->treeleaf->faces->begin (); fi != node->treeleaf->faces->end (); fi++)
		{
			for (ei = fi->f->edges->begin (); ei != fi->f->edges->end (); ei++)
			{
				ei->e->tmp_tested = false;
			}
		}
	}
	else
	{
		ClearMarks_r (node->children[0]);
		ClearMarks_r (node->children[1]);
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpb $0x0, (%rdi)
jne 0xfde9
movq 0x10(%rbx), %rdi
callq 0xfdce
movq 0x18(%rbx), %rbx
cmpb $0x0, (%rbx)
je 0xfdd7
movq 0x30(%rbx), %rax
movq (%rax), %rcx
movq (%rcx), %rax
cmpq %rcx, %rax
je 0xfe27
movq 0x10(%rax), %rdx
movq (%rdx), %rsi
movq (%rsi), %rdx
cmpq %rsi, %rdx
je 0xfe22
movq 0x10(%rdx), %rcx
movb $0x0, 0x38(%rcx)
movq (%rdx), %rdx
movq 0x10(%rax), %rcx
cmpq (%rcx), %rdx
jne 0xfe07
movq 0x30(%rbx), %rcx
movq (%rcx), %rcx
movq (%rax), %rax
jmp 0xfdf3
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: CollectBrinks_r(bclipnode_s*, int&, bbrink_t**)
void CollectBrinks_r (bclipnode_t *node, int &numbrinks, bbrink_t **brinks)
{
	if (node->isleaf)
	{
		btreeface_l::iterator fi;
		btreeedge_l::iterator ei;
		for (fi = node->treeleaf->faces->begin (); fi != node->treeleaf->faces->end (); fi++)
		{
			for (ei = fi->f->edges->begin (); ei != fi->f->edges->end (); ei++)
			{
				if (ei->e->tmp_tested)
				{
					continue;
				}
				ei->e->tmp_tested = true;
				if (!ei->e->infinite)
				{
					if (brinks != NULL)
					{
						brinks[numbrinks] = ei->e->brink;
						brinks[numbrinks]->edge = ei->e;
						for (int i = 0; i < brinks[numbrinks]->numnodes; i++)
						{
							bbrinknode_t *node = &(*brinks[numbrinks]->nodes)[i];
							if (node->isleaf && !node->clipnode->isleaf)
							{
								PrintOnce ("CollectBrinks_r: internal error: not leaf");
								hlassume (false, assume_first);
							}
						}
					}
					numbrinks++;
				}
			}
		}
	}
	else
	{
		CollectBrinks_r (node->children[0], numbrinks, brinks);
		CollectBrinks_r (node->children[1], numbrinks, brinks);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpb $0x0, (%rdi)
jne 0xfe5b
movq 0x10(%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xfe29
movq 0x18(%r15), %r15
cmpb $0x0, (%r15)
je 0xfe42
movq %r15, (%rsp)
movq 0x30(%r15), %rax
movq (%rax), %rax
movq (%rax), %r13
cmpq %rax, %r13
je 0xff4f
movq 0x10(%r13), %rcx
movq (%rcx), %rcx
movq (%rcx), %rbp
cmpq %rcx, %rbp
je 0xff46
movq 0x10(%rbp), %rax
cmpb $0x0, 0x38(%rax)
jne 0xff2a
movb $0x1, 0x38(%rax)
movq 0x10(%rbp), %rcx
cmpb $0x0, 0x20(%rcx)
jne 0xff2a
movl (%r14), %eax
testq %rbx, %rbx
je 0xff25
cltq
movq 0x30(%rcx), %rcx
movq %rcx, (%rbx,%rax,8)
movq 0x10(%rbp), %rax
movslq (%r14), %rcx
movq (%rbx,%rcx,8), %rcx
movq %rax, 0x58(%rcx)
movslq (%r14), %rax
movq (%rbx,%rax,8), %rcx
cmpl $0x0, 0x48(%rcx)
jle 0xff25
movl $0x20, %r15d
xorl %r12d, %r12d
movq 0x50(%rcx), %rcx
movq (%rcx), %rcx
cmpb $0x1, -0x20(%rcx,%r15)
jne 0xff0e
movq (%rcx,%r15), %rcx
cmpb $0x0, (%rcx)
jne 0xff0e
leaq 0x10bd5(%rip), %rdi     # 0x20ad0
xorl %eax, %eax
callq 0xa10c
xorl %edi, %edi
xorl %esi, %esi
callq 0xa655
movl (%r14), %eax
incq %r12
movslq %eax, %rcx
movq (%rbx,%rcx,8), %rcx
movslq 0x48(%rcx), %rdx
addq $0x28, %r15
cmpq %rdx, %r12
jl 0xfedc
incl %eax
movl %eax, (%r14)
movq (%rbp), %rbp
movq 0x10(%r13), %rax
cmpq (%rax), %rbp
jne 0xfe85
movq (%rsp), %rax
movq 0x30(%rax), %rax
movq (%rax), %rax
movq (%r13), %r13
jmp 0xfe69
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: CollectBrinks(bbrinkinfo_s*)
void CollectBrinks (bbrinkinfo_t *info)
{
	info->numbrinks = 0;
	ClearMarks_r (&info->clipnodes[0]);
	CollectBrinks_r (&info->clipnodes[0], info->numbrinks, NULL);
	hlassume (info->brinks = (bbrink_t **)malloc (info->numbrinks * sizeof (bbrink_t *)), assume_NoMemory);
	info->numbrinks = 0;
	ClearMarks_r (&info->clipnodes[0]);
	CollectBrinks_r (&info->clipnodes[0], info->numbrinks, info->brinks);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0x20(%rdi), %rbx
xorl %r15d, %r15d
movl %r15d, 0x20(%rdi)
movq 0x8(%rdi), %rdi
callq 0xfdce
movq 0x8(%r14), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0xfe29
movslq 0x20(%r14), %rdi
shlq $0x3, %rdi
callq 0x4400
movq %rax, 0x28(%r14)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa655
movl %r15d, 0x20(%r14)
movq 0x8(%r14), %rdi
callq 0xfdce
movq 0x8(%r14), %rdi
movq 0x28(%r14), %rdx
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xfe29
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: PrintCircle(bcircle_t const*)
void PrintCircle (const bcircle_t *c)
{
	Log ("axis %f %f %f\n", c->axis[0], c->axis[1], c->axis[2]);
	Log ("basenormal %f %f %f\n", c->basenormal[0], c->basenormal[1], c->basenormal[2]);
	Log ("numwedges %d %d\n", c->numwedges[0], c->numwedges[1]);
	for (int side = 0; side < 2; side++)
	{
		for (int i = 0; i < c->numwedges[side]; i++)
		{
			const bwedge_t *w = &c->wedges[side][i];
			const bsurface_t *s = &c->surfaces[side][i];
			Log ("surface[%d][%d] nodenum %d nodeside %d normal %f %f %f\n", side, i, s->nodenum, s->nodeside, s->normal[0], s->normal[1], s->normal[2]);
			Log ("wedge[%d][%d] nodenum %d content %d\n", side, i, w->nodenum, w->content);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movsd (%rdi), %xmm0
movsd 0x8(%rdi), %xmm1
movsd 0x10(%rdi), %xmm2
leaq 0x104dd(%rip), %rdi     # 0x20b46
movb $0x3, %al
callq 0x9bae
movsd 0x18(%rbx), %xmm0
movsd 0x20(%rbx), %xmm1
movsd 0x28(%rbx), %xmm2
leaq 0x104cf(%rip), %rdi     # 0x20b55
movb $0x3, %al
callq 0x9bae
movl 0x30(%rbx), %esi
movl 0x34(%rbx), %edx
leaq 0x104d0(%rip), %rdi     # 0x20b6a
xorl %eax, %eax
callq 0x9bae
movb $0x1, %al
leaq 0x104d1(%rip), %r14     # 0x20b7b
leaq 0x10502(%rip), %r15     # 0x20bb3
xorl %r12d, %r12d
movl %eax, 0x4(%rsp)
cmpl $0x0, 0x30(%rbx,%r12,4)
jle 0x10733
movq %r12, %rax
shlq $0x9, %rax
leaq (%rax,%rax,2), %rbp
xorl %r13d, %r13d
movl 0xc50(%rbx,%rbp,2), %ecx
movzbl 0xc54(%rbx,%rbp,2), %r8d
movsd 0xc38(%rbx,%rbp,2), %xmm0
movsd 0xc40(%rbx,%rbp,2), %xmm1
movsd 0xc48(%rbx,%rbp,2), %xmm2
movq %r14, %rdi
movl %r12d, %esi
movl %r13d, %edx
movb $0x3, %al
callq 0x9bae
movl 0x38(%rbx,%rbp), %r8d
movl 0x3c(%rbx,%rbp), %ecx
movq %r15, %rdi
movl %r12d, %esi
movl %r13d, %edx
xorl %eax, %eax
callq 0x9bae
incq %r13
movslq 0x30(%rbx,%r12,4), %rax
addq $0x18, %rbp
cmpq %rax, %r13
jl 0x106ce
movl $0x1, %r12d
testb $0x1, 0x4(%rsp)
movl $0x0, %eax
jne 0x106b4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: DeleteClipnodes(bbrinkinfo_s*)
void DeleteClipnodes (bbrinkinfo_t *info)
{
	for (int i = 0; i < info->numclipnodes; i++)
	{
#ifdef HLBSP_BRINKHACK_BUGFIX
		if (!info->clipnodes[i].isleaf)
		{
			continue;
		}
#endif
		bpartition_t *p;
		while ((p = info->clipnodes[i].partitions) != NULL)
		{
			info->clipnodes[i].partitions = p->next;
			free (p);
		}
	}
	free (info->clipnodes);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %ecx
movq 0x8(%rdi), %rdi
testl %ecx, %ecx
jle 0x1109e
xorl %r14d, %r14d
imulq $0x38, %r14, %r15
cmpb $0x1, (%rdi,%r15)
jne 0x11093
movq 0x28(%rdi,%r15), %rax
testq %rax, %rax
je 0x11093
leaq (%rdi,%r15), %rcx
addq $0x28, %rcx
movq 0x10(%rax), %rdx
movq %rdx, (%rcx)
movq %rax, %rdi
callq 0x4380
movq 0x8(%rbx), %rdi
leaq (%rdi,%r15), %rcx
addq $0x28, %rcx
movq (%rcx), %rax
testq %rax, %rax
jne 0x1106e
movl (%rbx), %ecx
incq %r14
movslq %ecx, %rax
cmpq %rax, %r14
jl 0x11051
popq %rbx
popq %r14
popq %r15
jmp 0x4380
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: CreateBrinkinfo(dclipnode_t const*, int)
void *CreateBrinkinfo (const dclipnode_t *clipnodes, int headnode)
{
	bbrinkinfo_t *info;
	try
	{
		hlassume (info = (bbrinkinfo_t *)malloc (sizeof (bbrinkinfo_t)), assume_NoMemory);
		ExpandClipnodes (info, clipnodes, headnode);
		BuildTreeCells (info);
		CollectBrinks (info);
		AnalyzeBrinks (info);
		FreeBrinks (info);
		DeleteTreeCells (info);
		SortPartitions (info);
	}
	catch (std::bad_alloc)
	{
		hlassume (false, assume_NoMemory);
	}
	return info;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebp
movq %rdi, %r14
movl $0x30, %edi
callq 0x4400
movq %rax, %rbx
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa655
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0xfc0b
movq %rbx, %rdi
callq 0xfcd8
movq %rbx, %rdi
callq 0xff5e
movq %rbx, %rdi
callq 0x108e1
movq 0x28(%rbx), %rdi
callq 0x4380
movq %rbx, %rdi
callq 0xfd77
movq %rbx, %rdi
callq 0x110a8
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
cmpl $0x1, %edx
jne 0x1136b
movq %r14, %rdi
callq 0x43c0
movq 0x18c95(%rip), %rax     # 0x29fc0
addq $0x10, %rax
movq %rax, 0x8(%rsp)
movq %r14, %rdi
callq 0x4130
xorl %edi, %edi
movl $0x1, %esi
callq 0xa655
leaq 0x8(%rsp), %rdi
callq 0x41c0
callq 0x4510
jmp 0x11308
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x41c0
callq 0x4510
movq %r14, %rdi
callq 0x4540
movq %rax, %rdi
callq 0x118ef
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/brink.cpp
// Function: FixBrinks(void const*, bbrinklevel_e, int&, dclipnode_t*, int, int, int&)
bool FixBrinks (const void *brinkinfo, bbrinklevel_e level, int &headnode_out, dclipnode_t *clipnodes_out, int maxsize, int size, int &size_out)
{
	const bbrinkinfo_t *info = (const bbrinkinfo_t *)brinkinfo;
	dclipnode_t *begin = clipnodes_out;
	dclipnode_t *end = &clipnodes_out[maxsize];
	dclipnode_t *current = &clipnodes_out[size];
#ifdef HLBSP_MERGECLIPNODE
	clipnodemap_t outputmap;
#endif
	int r;
	if (!FixBrinks_r (&info->clipnodes[0], level, r, begin, end, current
#ifdef HLBSP_MERGECLIPNODE
		, &outputmap
#endif
		))
	{
		return false;
	}
	headnode_out = r;
	size_out = current - begin;
	return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movslq %r8d, %rax
leaq (%rcx,%rax,8), %r8
movslq %r9d, %rax
leaq (%rcx,%rax,8), %rax
leaq 0x18(%rsp), %r9
movq %rax, (%r9)
leaq 0x28(%rsp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq 0x8(%rdi), %rdi
leaq 0x20(%rsp), %rax
movq %rax, (%rsp)
leaq 0x14(%rsp), %rdx
movq %rbx, %rcx
callq 0x114e4
movl %eax, %ebp
testb %al, %al
je 0x11711
movq 0x70(%rsp), %rax
movl 0x14(%rsp), %ecx
movl %ecx, (%r14)
movq 0x18(%rsp), %rcx
subq %rbx, %rcx
shrq $0x3, %rcx
movl %ecx, (%rax)
leaq 0x20(%rsp), %rdi
callq 0x11a12
movl %ebp, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x11a12
movq %rbx, %rdi
callq 0x4540
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/merge.cpp
// Function: MergeAll(surface_s*)
void            MergeAll(surface_t* surfhead)
{
    surface_t*      surf;
    int             mergefaces;
    face_t*         f;

    Verbose("---- MergeAll ----\n");

    mergefaces = 0;
    for (surf = surfhead; surf; surf = surf->next)
    {
        MergePlaneFaces(surf);
        for (f = surf->faces; f; f = f->next)
        {
            mergefaces++;
        }
    }

    Verbose("%i mergefaces\n", mergefaces);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0xe1e0(%rip), %rdi      # 0x20e3b
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xa2ef
testq %r14, %r14
je 0x12c8b
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x125dc
leaq 0x48(%r14), %rax
decl %ebx
movq (%rax), %rax
incl %ebx
testq %rax, %rax
jne 0x12c79
movq (%r14), %r14
testq %r14, %r14
jne 0x12c6b
leaq 0xe1bd(%rip), %rdi      # 0x20e4f
movl %ebx, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xa2ef
nop
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/outside.cpp
// Function: isClassnameAllowableOutside(char const*)
bool            isClassnameAllowableOutside(const char* const classname)
{
    if (g_strAllowableOutsideList)
    {
        unsigned        x;
        char**          list = g_strAllowableOutsideList;

        for (x = 0; x < g_nAllowableOutside; x++, list++)
        {
            if (list)
            {
                if (!strcasecmp(classname, *list))
                {
                    return true;
                }
            }
        }
    }

    return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x20bbc1d(%rip), %r14   # 0x20ce8d0
testq %r14, %r14
je 0x12cef
movl 0x20bbc09(%rip), %r15d  # 0x20ce8c8
testl %r15d, %r15d
je 0x12cef
movq %rdi, %rbx
decl %r15d
xorl %r12d, %r12d
movq (%r14,%r12,8), %rsi
movq %rbx, %rdi
callq 0x4320
testl %eax, %eax
sete %al
je 0x12cf1
leaq 0x1(%r12), %rcx
cmpl %r12d, %r15d
movq %rcx, %r12
jne 0x12ccd
jmp 0x12cf1
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/outside.cpp
// Function: RecursiveFillOutside(node_s*, bool)
static bool     RecursiveFillOutside(node_t* l, const bool fill)
{
    portal_t*       p;
    int             s;

    if ((l->contents == CONTENTS_SOLID) || (l->contents == CONTENTS_SKY) 
#ifdef ZHLT_DETAIL
        || (l->contents == CONTENTS_DETAIL)
#endif
        )
	{
        /*if (l->contents != CONTENTS_SOLID)
            Log("RecursiveFillOutside::l->contents == %i \n", l->contents);*/

        return false;
    }

    if (l->valid == valid)
    {
        return false;
    }

    if (l->occupied)
    {
        hit_occupied = l->occupied;
        backdraw = 1000;
        return true;
    }

    l->valid = valid;

    // fill it and it's neighbors
    if (fill)
    {
#ifdef ZHLT_DETAILBRUSH
		FillLeaf (l);
#else
        l->contents = CONTENTS_SOLID;
        l->planenum = -1;
#endif
    }
    outleafs++;

    for (p = l->portals; p;)
    {
        s = (p->nodes[0] == l);

        if (RecursiveFillOutside(p->nodes[s], fill))
        {                                                  // leaked, so stop filling
            if (backdraw-- > 0)
            {
                MarkLeakTrail(p);
            }
            return true;
        }
        p = p->next[!s];
    }

    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0xa0(%rdi), %eax
orl $0x4, %eax
cmpl $-0x2, %eax
jne 0x133ba
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %rbx
movl 0x20bb519(%rip), %eax   # 0x20ce8dc
cmpl %eax, 0xbc(%rdi)
je 0x133ad
movl 0xc0(%rbx), %ecx
testl %ecx, %ecx
je 0x133ea
movl %ecx, 0x20bb51d(%rip)   # 0x20ce8f8
movl $0x3e8, 0x20bb523(%rip) # imm = 0x3E8
movb $0x1, %bpl
jmp 0x133af
movl %esi, %ebp
movl %eax, 0xbc(%rbx)
testb %bpl, %bpl
je 0x133ff
movq %rbx, %rdi
callq 0x1367b
incl 0x20bb4d3(%rip)         # 0x20ce8d8
movq 0xb0(%rbx), %r14
testq %r14, %r14
je 0x133ad
movzbl %bpl, %r15d
xorl %ebp, %ebp
movq 0x48(%r14), %r12
xorl %eax, %eax
cmpq %rbx, %r12
sete %al
movq 0x48(%r14,%rax,8), %rdi
movl %r15d, %esi
callq 0x13397
testb %al, %al
jne 0x1344b
xorl %eax, %eax
cmpq %rbx, %r12
setne %al
movq 0x58(%r14,%rax,8), %r14
testq %r14, %r14
jne 0x13417
jmp 0x133af
movl 0x20bb4b7(%rip), %eax   # 0x20ce908
leal -0x1(%rax), %ecx
movl %ecx, 0x20bb4ae(%rip)   # 0x20ce908
movb $0x1, %bpl
testl %eax, %eax
jle 0x133af
movq %r14, %rdi
callq 0x13869
jmp 0x133af
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/outside.cpp
// Function: MarkOccupied_r(node_s*)
void			MarkOccupied_r (node_t* node)
{
	if (node->empty == 1)
	{
		node->empty = 0;
		portal_t*       p;
		int             s;
		for (p = node->portals; p; p = p->next[!s])
		{
			s = (p->nodes[0] == node);
			MarkOccupied_r (p->nodes[s]);
		}
	}
}

// Assembly:
cmpl $0x1, 0xc4(%rdi)
jne 0x13646
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x0, 0xc4(%rdi)
movq 0xb0(%rdi), %r14
testq %r14, %r14
je 0x13641
xorl %r15d, %r15d
xorl %eax, %eax
cmpq %rbx, 0x48(%r14)
setne %r15b
sete %al
movq 0x48(%r14,%rax,8), %rdi
callq 0x135f9
movq 0x58(%r14,%r15,8), %r14
jmp 0x1361b
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/outside.cpp
// Function: FillLeaf(node_s*)
static void FillLeaf (node_t *l)
{
	if (!l->isportalleaf)
	{
		Warning ("FillLeaf: not leaf");
		return;
	}
	if (l->contents == CONTENTS_SOLID)
	{
		Warning ("FillLeaf: fill solid");
		return;
	}
	FreeDetailNode_r (l);
	l->contents = CONTENTS_SOLID;
	l->planenum = -1;
}

// Assembly:
pushq %rbx
cmpb $0x0, 0x49(%rdi)
je 0x13697
movq %rdi, %rbx
cmpl $-0x2, 0xa0(%rdi)
jne 0x136a6
leaq 0xdc28(%rip), %rdi      # 0x212bd
jmp 0x1369e
leaq 0xdc0c(%rip), %rdi      # 0x212aa
xorl %eax, %eax
popq %rbx
jmp 0xa20e
movq %rbx, %rdi
callq 0x13a63
movl $0xfffffffe, 0xa0(%rbx) # imm = 0xFFFFFFFE
movl $0xffffffff, 0x80(%rbx) # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/outside.cpp
// Function: FillInside(node_s*)
void			FillInside (node_t* node)
{
	int i;
	g_outside_node.empty = 0;
	ResetMark_r (node);
    for (i = 1; i < g_numentities; i++)
    {
		if (*ValueForKey(&g_entities[i], "origin"))
		{
			vec3_t origin;
			node_t* innode;
			GetVectorForKey(&g_entities[i], "origin", origin);
			origin[2] += 1;
			innode = PointInLeaf (node, origin);
			MarkOccupied_r (innode);
			origin[2] -= 2;
			innode = PointInLeaf (node, origin);
			MarkOccupied_r (innode);
		}
	}
	RemoveUnused_r (node);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x20bb234(%rip), %rax   # 0x20ce910
movl $0x0, 0xc4(%rax)
callq 0x135bb
leaq 0x200dcf2(%rip), %r13   # 0x20213e4
cmpl $0x2, (%r13)
jl 0x13852
movl $0x1, %ebp
leaq 0x9fd1(%rip), %r14      # 0x1d6da
leaq 0x20c0300(%rip), %r15   # 0x20d3a10
leaq (,%rbp,4), %r12
addq %rbp, %r12
shlq $0x3, %r12
addq 0x168b2(%rip), %r12     # 0x29fd8
movq %r12, %rdi
movq %r14, %rsi
callq 0x7482
cmpb $0x0, (%rax)
je 0x13842
movq %r12, %rdi
movq %r14, %rsi
movq %rsp, %rdx
callq 0x7fe0
movsd 0x10(%rsp), %xmm0
addsd 0xc972(%rip), %xmm0     # 0x200c8
movsd %xmm0, 0x10(%rsp)
cmpb $0x0, 0x49(%rbx)
movq %rbx, %rdi
jne 0x137c0
movsd (%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
movq %rbx, %rdi
movslq 0x80(%rdi), %rax
shlq $0x6, %rax
movsd 0x8(%r15,%rax), %xmm3
mulsd %xmm2, %xmm3
movsd (%r15,%rax), %xmm4
mulsd %xmm1, %xmm4
addsd %xmm3, %xmm4
movsd 0x10(%r15,%rax), %xmm3
mulsd %xmm0, %xmm3
addsd %xmm4, %xmm3
xorl %ecx, %ecx
ucomisd 0x30(%r15,%rax), %xmm3
setbe %cl
movq 0x88(%rdi,%rcx,8), %rdi
cmpb $0x1, 0x49(%rdi)
jne 0x13773
callq 0x135f9
movsd 0x10(%rsp), %xmm0
addsd 0xd68d(%rip), %xmm0     # 0x20e60
movsd %xmm0, 0x10(%rsp)
cmpb $0x0, 0x49(%rbx)
movq %rbx, %rdi
jne 0x1383d
movsd (%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
movq %rbx, %rdi
movslq 0x80(%rdi), %rax
shlq $0x6, %rax
movsd 0x8(%r15,%rax), %xmm3
mulsd %xmm2, %xmm3
movsd (%r15,%rax), %xmm4
mulsd %xmm1, %xmm4
addsd %xmm3, %xmm4
movsd 0x10(%r15,%rax), %xmm3
mulsd %xmm0, %xmm3
addsd %xmm4, %xmm3
xorl %ecx, %ecx
ucomisd 0x30(%r15,%rax), %xmm3
setbe %cl
movq 0x88(%rdi,%rcx,8), %rdi
cmpb $0x1, 0x49(%rdi)
jne 0x137f0
callq 0x135f9
incq %rbp
movslq (%r13), %rax
cmpq %rax, %rbp
jl 0x13710
movq %rbx, %rdi
callq 0x13647
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/outside.cpp
// Function: MarkLeakTrail(portal_s*)
static void     MarkLeakTrail(portal_t* n2)
{
    int             i;
    vec3_t          p1, p2, dir;
    float           len;
    portal_t*       n1;

    n1 = prevleaknode;
    prevleaknode = n2;

    if (!n1)
    {
        return;
    }

#ifdef HLBSP_MarkLeakTrail_FIX
    n1->winding->getCenter(p1);
    n2->winding->getCenter(p2);
#else
    n2->winding->getCenter(p1);
    n1->winding->getCenter(p2);
#endif

    // Linefile
    fprintf(linefile, "%f %f %f - %f %f %f\n", p1[0], p1[1], p1[2], p2[0], p2[1], p2[2]);

    // Pointfile
    fprintf(pointfile, "%f %f %f\n", p1[0], p1[1], p1[2]);

    VectorSubtract(p2, p1, dir);
    len = VectorLength(dir);
    VectorNormalize(dir);

    while (len > 2)
    {
        fprintf(pointfile, "%f %f %f\n", p1[0], p1[1], p1[2]);
        for (i = 0; i < 3; i++)
            p1[i] += dir[i] * 2;
        len -= 2;
    }
}

// Assembly:
movq 0x20bb070(%rip), %rax   # 0x20ce8e0
movq %rdi, 0x20bb069(%rip)   # 0x20ce8e0
testq %rax, %rax
je 0x13a11
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r14
movq 0x68(%rax), %rdi
leaq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq 0xbab0
movq 0x68(%r14), %rdi
leaq 0x50(%rsp), %r14
movq %r14, %rsi
callq 0xbab0
movq 0x20bb03d(%rip), %rdi   # 0x20ce8f0
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movsd 0x10(%rbx), %xmm2
movsd (%r14), %xmm3
movsd 0x8(%r14), %xmm4
movsd 0x10(%r14), %xmm5
leaq 0xd9bc(%rip), %rsi      # 0x21295
movb $0x6, %al
callq 0x4440
movq 0x20bb001(%rip), %rdi   # 0x20ce8e8
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movsd 0x10(%rbx), %xmm2
leaq 0xd9a4(%rip), %rsi      # 0x212a0
movb $0x3, %al
callq 0x4440
movsd 0x10(%r14), %xmm1
subsd 0x10(%rbx), %xmm1
movapd (%r14), %xmm0
subpd (%rbx), %xmm0
movapd %xmm0, %xmm2
mulpd %xmm0, %xmm2
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
movapd %xmm0, %xmm3
mulsd %xmm0, %xmm3
addsd %xmm2, %xmm3
movapd %xmm1, %xmm2
mulsd %xmm1, %xmm2
addsd %xmm3, %xmm2
xorps %xmm3, %xmm3
sqrtsd %xmm2, %xmm3
xorps %xmm4, %xmm4
cvtsd2ss %xmm3, %xmm4
movsd 0x97c7(%rip), %xmm2     # 0x1d118
xorl %eax, %eax
ucomisd %xmm3, %xmm2
seta %cl
movapd %xmm3, %xmm2
unpcklpd %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0]
divpd %xmm2, %xmm0
xorpd %xmm2, %xmm2
ja 0x13974
divsd %xmm3, %xmm1
movapd %xmm1, %xmm2
movb %cl, %al
movd %eax, %xmm1
pshufd $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
pslld $0x1f, %xmm1
psrad $0x1f, %xmm1
pandn %xmm0, %xmm1
movsd %xmm2, 0x40(%rsp)
movdqa %xmm1, 0x30(%rsp)
ucomiss 0xd4c8(%rip), %xmm4     # 0x20e68
jbe 0x13a0a
leaq 0xd8f7(%rip), %rbx      # 0x212a0
movss %xmm4, 0xc(%rsp)
movq 0x20baf32(%rip), %rdi   # 0x20ce8e8
movsd 0x10(%rsp), %xmm0
movq 0x18(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
movq %rbx, %rsi
movb $0x3, %al
callq 0x4440
xorl %eax, %eax
movsd 0x30(%rsp,%rax,8), %xmm0
addsd %xmm0, %xmm0
addsd 0x10(%rsp,%rax,8), %xmm0
movsd %xmm0, 0x10(%rsp,%rax,8)
incq %rax
cmpq $0x3, %rax
jne 0x139d4
movss 0xc(%rsp), %xmm4
addss 0xd46b(%rip), %xmm4     # 0x20e6c
ucomiss 0xd460(%rip), %xmm4     # 0x20e68
ja 0x139a9
addq $0x68, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/outside.cpp
// Function: MarkFacesInside_r(node_s*)
static void MarkFacesInside_r (node_t *node)
{
	if (node->planenum == -1)
	{
		face_t **fp;
		for (fp = node->markfaces; *fp; fp++)
		{
	        (*fp)->outputnumber = 0;
		}
	}
	else
	{
		MarkFacesInside_r (node->children[0]);
		MarkFacesInside_r (node->children[1]);
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $-0x1, 0x80(%rdi)
je 0x13a3b
movq 0x88(%rbx), %rdi
callq 0x13a12
movq 0x90(%rbx), %rbx
cmpl $-0x1, 0x80(%rbx)
jne 0x13a1f
movq 0xa8(%rbx), %rax
movq (%rax), %rcx
testq %rcx, %rcx
je 0x13a61
addq $0x8, %rax
movl $0x0, 0x28(%rcx)
movq (%rax), %rcx
addq $0x8, %rax
testq %rcx, %rcx
jne 0x13a4e
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/outside.cpp
// Function: FreeDetailNode_r(node_s*)
static void FreeDetailNode_r (node_t *n)
{
	int i;
	if (n->planenum == -1)
	{
		if (!(n->isportalleaf && n->contents == CONTENTS_SOLID))
		{
			free (n->markfaces);
			n->markfaces = NULL;
		}
		return;
	}
	for (i = 0; i < 2; i++)
	{
		FreeDetailNode_r (n->children[i]);
		free (n->children[i]);
		n->children[i] = NULL;
	}
	face_t *f, *next;
	for (f = n->faces; f; f = next)
	{
		next = f->next;
		FreeFace (f);
	}
	n->faces = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $-0x1, 0x80(%rdi)
je 0x13ad9
movq 0x88(%rbx), %rdi
callq 0x13a63
movq 0x88(%rbx), %rdi
callq 0x4380
xorl %r14d, %r14d
movq %r14, 0x88(%rbx)
movq 0x90(%rbx), %rdi
callq 0x13a63
movq 0x90(%rbx), %rdi
callq 0x4380
movq %r14, 0x90(%rbx)
movq 0x98(%rbx), %rdi
addq $0x98, %rbx
testq %rdi, %rdi
je 0x13afb
movq (%rdi), %r14
callq 0x14e49
movq %r14, %rdi
testq %r14, %r14
jne 0x13ac7
jmp 0x13afb
cmpb $0x1, 0x49(%rbx)
jne 0x13ae8
cmpl $-0x2, 0xa0(%rbx)
je 0x13b02
movq 0xa8(%rbx), %rdi
addq $0xa8, %rbx
callq 0x4380
movq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/portals.cpp
// Function: AddPortalToNodes(portal_s*, node_s*, node_s*)
void            AddPortalToNodes(portal_t* p, node_t* front, node_t* back)
{
    if (p->nodes[0] || p->nodes[1])
    {
        Error("AddPortalToNode: allready included");
    }

    p->nodes[0] = front;
    p->next[0] = front->portals;
    front->portals = p;

    p->nodes[1] = back;
    p->next[1] = back->portals;
    back->portals = p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
cmpq $0x0, 0x48(%rdi)
jne 0x13b28
cmpq $0x0, 0x50(%r14)
je 0x13b36
leaq 0xd7d9(%rip), %rdi      # 0x21308
xorl %eax, %eax
callq 0x9e9c
movq %r15, 0x48(%r14)
movq 0xb0(%r15), %rax
movq %rax, 0x58(%r14)
movq %r14, 0xb0(%r15)
movq %rbx, 0x50(%r14)
movq 0xb0(%rbx), %rax
movq %rax, 0x60(%r14)
movq %r14, 0xb0(%rbx)
popq %rbx
popq %r14
popq %r15
retq