LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/common/winding.cpp
// Function: Winding::RemoveColinearPoints(double)
vec_t epsilon
#endif
											  )
{
	unsigned int	i;
	vec3_t			v1, v2;
	vec_t			*p1, *p2, *p3;
	for (i = 0; i < m_NumPoints; i++)
	{
		p1 = m_Points[(i+m_NumPoints-1)%m_NumPoints];
		p2 = m_Points[i];
		p3 = m_Points[(i+1)%m_NumPoints];
		VectorSubtract (p2, p1, v1);
		VectorSubtract (p3, p2, v2);
		// v1 or v2 might be close to 0
		if (DotProduct (v1, v2) * DotProduct (v1, v2) >= DotProduct (v1, v1) * DotProduct (v2, v2) 
			- ON_EPSILON * ON_EPSILON * (DotProduct (v1, v1) + DotProduct (v2, v2) + ON_EPSILON * ON_EPSILON))
			// v2 == k * v1 + v3 && abs (v3) < ON_EPSILON || v1 == k * v2 + v3 && abs (v3) < ON_EPSILON
		{
			m_NumPoints--;
			for (; i < m_NumPoints; i++)
			{
				VectorCopy (m_Points[i+1], m_Points[i]);
			}
			i = -1;
			continue;
		}
	}
}

// Assembly:
pushq %rbx
movapd 0x1112d(%rip), %xmm1    # 0x1c240
xorpd %xmm0, %xmm1
mulsd %xmm0, %xmm1
movl 0x8(%rdi), %r8d
xorl %ecx, %ecx
mulsd %xmm0, %xmm0
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
cmpl %r8d, %r9d
jae 0xb278
movq 0x10(%rdi), %r10
leal (%r8,%r9), %eax
decl %eax
xorl %edx, %edx
divl %r8d
imulq $0x18, %rdx, %r11
movl %r9d, %eax
imulq $0x18, %rax, %rdx
leal 0x1(%r9), %ebx
cmpl %r8d, %ebx
cmovel %ecx, %ebx
imulq $0x18, %rbx, %rbx
movsd (%r10,%rdx), %xmm4
movsd 0x8(%r10,%rdx), %xmm3
movsd 0x10(%r10,%rdx), %xmm2
movsd (%r10,%r11), %xmm5
unpcklpd %xmm4, %xmm5            # xmm5 = xmm5[0],xmm4[0]
movhpd (%r10,%rbx), %xmm4      # xmm4 = xmm4[0],mem[0]
movsd 0x8(%r10,%r11), %xmm6
movsd 0x10(%r10,%r11), %xmm7
subpd %xmm5, %xmm4
unpcklpd %xmm3, %xmm6            # xmm6 = xmm6[0],xmm3[0]
movhpd 0x8(%r10,%rbx), %xmm3   # xmm3 = xmm3[0],mem[0]
subpd %xmm6, %xmm3
unpcklpd %xmm2, %xmm7            # xmm7 = xmm7[0],xmm2[0]
movhpd 0x10(%r10,%rbx), %xmm2  # xmm2 = xmm2[0],mem[0]
subpd %xmm7, %xmm2
movapd %xmm3, %xmm5
unpckhpd %xmm3, %xmm5            # xmm5 = xmm5[1],xmm3[1]
mulsd %xmm3, %xmm5
movapd %xmm4, %xmm6
unpckhpd %xmm4, %xmm6            # xmm6 = xmm6[1],xmm4[1]
mulsd %xmm4, %xmm6
addsd %xmm5, %xmm6
movapd %xmm2, %xmm5
unpckhpd %xmm2, %xmm5            # xmm5 = xmm5[1],xmm2[1]
mulsd %xmm2, %xmm5
addsd %xmm6, %xmm5
mulsd %xmm5, %xmm5
mulpd %xmm3, %xmm3
mulpd %xmm4, %xmm4
addpd %xmm3, %xmm4
mulpd %xmm2, %xmm2
addpd %xmm4, %xmm2
movapd %xmm2, %xmm3
unpckhpd %xmm2, %xmm3            # xmm3 = xmm3[1],xmm2[1]
movapd %xmm2, %xmm4
addsd %xmm3, %xmm4
addsd %xmm0, %xmm4
mulsd %xmm1, %xmm4
mulsd %xmm2, %xmm3
addsd %xmm4, %xmm3
ucomisd %xmm3, %xmm5
jb 0xb270
decl %r8d
movl %r8d, 0x8(%rdi)
movl %r8d, %r9d
cmpq %r9, %rax
jae 0xb26d
movq 0x10(%rdi), %r8
incq %rax
movsd 0x18(%r8,%rdx), %xmm2
movsd %xmm2, (%r8,%rdx)
movq 0x10(%rdi), %r8
movsd 0x20(%r8,%rdx), %xmm2
movsd %xmm2, 0x8(%r8,%rdx)
movq 0x10(%rdi), %r8
movsd 0x28(%r8,%rdx), %xmm2
movsd %xmm2, 0x10(%r8,%rdx)
movl 0x8(%rdi), %r8d
addq $0x18, %rdx
jmp 0xb223
movl %esi, %r9d
incl %r9d
jmp 0xb12d
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/common/winding.cpp
// Function: Winding::Chop(double const*, double, double)
bool          Winding::Chop(const vec3_t normal, const vec_t dist
#ifdef ZHLT_WINDING_EPSILON
							, vec_t epsilon
#endif
							)
{
    Winding*      f;
    Winding*      b;

    Clip(normal, dist, &f, &b
#ifdef ZHLT_WINDING_EPSILON
		, epsilon
#endif
		);
    if (b)
    {
        delete b;
    }

    if (f)
    {
        delete[] m_Points;
        m_NumPoints = f->m_NumPoints;
        m_Points = f->m_Points;
        f->m_Points = NULL;
        delete f;
        return true;
    }
    else
    {
        m_NumPoints = 0;
        delete[] m_Points;
        m_Points = NULL;
        return false;
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdx
leaq 0x10(%rsp), %r14
movq %r14, %rcx
callq 0xb2da
movq (%r14), %rdi
testq %rdi, %rdi
je 0xb7dc
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x8(%rsp), %r14
testq %r14, %r14
je 0xb813
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0xb7f4
callq 0x4430
movl 0x8(%r14), %eax
movl %eax, 0x8(%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
andq $0x0, 0x10(%r14)
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
jmp 0xb82a
andl $0x0, 0x8(%rbx)
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0xb825
callq 0x4430
andq $0x0, 0x10(%rbx)
testq %r14, %r14
setne %al
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/common/winding.cpp
// Function: Winding::WindingOnPlaneSide(double const*, double, double)
int             Winding::WindingOnPlaneSide(const vec3_t normal, const vec_t dist
#ifdef ZHLT_WINDING_EPSILON
											, vec_t epsilon
#endif
											)
{
    bool            front, back;
    unsigned int    i;
    vec_t           d;

    front = false;
    back = false;
    for (i = 0; i < m_NumPoints; i++)
    {
        d = DotProduct(m_Points[i], normal) - dist;
        if (d < -ON_EPSILON)
        {
            if (front)
            {
                return SIDE_CROSS;
            }
            back = true;
            continue;
        }
        if (d > ON_EPSILON)
        {
            if (back)
            {
                return SIDE_CROSS;
            }
            front = true;
            continue;
        }
    }

    if (back)
    {
        return SIDE_BACK;
    }
    if (front)
    {
        return SIDE_FRONT;
    }
    return SIDE_ON;
}

// Assembly:
movl 0x8(%rdi), %eax
movq 0x10(%rdi), %rcx
movapd 0x109f9(%rip), %xmm2    # 0x1c240
xorpd %xmm1, %xmm2
imulq $0x18, %rax, %rdx
xorl %edi, %edi
pushq $-0x2
popq %rax
xorl %r8d, %r8d
xorl %r9d, %r9d
cmpq %rdi, %rdx
je 0xb8b0
movsd (%rcx,%rdi), %xmm4
movsd 0x8(%rcx,%rdi), %xmm3
mulsd 0x8(%rsi), %xmm3
mulsd (%rsi), %xmm4
addsd %xmm3, %xmm4
movsd 0x10(%rcx,%rdi), %xmm3
mulsd 0x10(%rsi), %xmm3
addsd %xmm4, %xmm3
subsd %xmm0, %xmm3
ucomisd %xmm3, %xmm2
jbe 0xb89b
movb $0x1, %r9b
testb $0x1, %r8b
je 0xb8aa
jmp 0xb8c6
ucomisd %xmm1, %xmm3
jbe 0xb8aa
movb $0x1, %r8b
testb $0x1, %r9b
jne 0xb8c6
addq $0x18, %rdi
jmp 0xb85a
testb $0x1, %r9b
je 0xb8ba
pushq $0x1
popq %rax
retq
notb %r8b
movzbl %r8b, %eax
andl $0x1, %eax
addl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/common/winding.cpp
// Function: Winding::addPoint(double const*)
void            Winding::addPoint(const vec3_t newpoint)
{
    if (m_NumPoints >= m_MaxPoints)
    {
        resize(m_NumPoints + 1);
    }
    VectorCopy(newpoint, m_Points[m_NumPoints]);
    m_NumPoints++;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x8(%rdi), %esi
cmpl 0x18(%rdi), %esi
jb 0xc14b
incl %esi
movq %rbx, %rdi
callq 0xc198
movl 0x8(%rbx), %esi
movsd (%r14), %xmm0
movq 0x10(%rbx), %rax
movl %esi, %ecx
imulq $0x18, %rcx, %rcx
movsd %xmm0, (%rax,%rcx)
movsd 0x8(%r14), %xmm0
movq 0x10(%rbx), %rax
movl 0x8(%rbx), %ecx
imulq $0x18, %rcx, %rcx
movsd %xmm0, 0x8(%rax,%rcx)
movsd 0x10(%r14), %xmm0
movq 0x10(%rbx), %rax
movl 0x8(%rbx), %ecx
imulq $0x18, %rcx, %rcx
movsd %xmm0, 0x10(%rax,%rcx)
incl 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/common/winding.cpp
// Function: Winding::resize(unsigned int)
void            Winding::resize(UINT32 newsize)
{
    newsize = (newsize + 3) & ~3;   // groups of 4

    vec3_t* newpoints = new vec3_t[newsize];
    m_NumPoints = qmin(newsize, m_NumPoints);
    memcpy(newpoints, m_Points, m_NumPoints);
    delete[] m_Points;
    m_Points = newpoints;
    m_MaxPoints = newsize;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
addl $0x3, %ebx
andl $-0x4, %ebx
imulq $0x18, %rbx, %rdi
callq 0x4040
movq %rax, %r15
movl 0x8(%r14), %edx
cmpl %edx, %ebx
cmovbl %ebx, %edx
movl %edx, 0x8(%r14)
movq 0x10(%r14), %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x4280
testq %r12, %r12
je 0xc1e0
movq %r12, %rdi
callq 0x4430
movq %r15, 0x10(%r14)
movl %ebx, 0x18(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/common/winding.cpp
// Function: Winding::insertPoint(double const*, unsigned int)
void            Winding::insertPoint(const vec3_t newpoint, const unsigned int offset)
{
    if (offset >= m_NumPoints)
    {
        addPoint(newpoint);
    }
    else
    {
        if (m_NumPoints >= m_MaxPoints)
        {
            resize(m_NumPoints + 1);
        }

        unsigned x;
        for (x = m_NumPoints; x>offset; x--)
        {
            VectorCopy(m_Points[x-1], m_Points[x]);
        }
        VectorCopy(newpoint, m_Points[x]);

        m_NumPoints++;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl 0x8(%rdi), %esi
cmpl %edx, %esi
jbe 0xc2a3
movl %edx, %ebp
cmpl 0x18(%rbx), %esi
jb 0xc21d
incl %esi
movq %rbx, %rdi
callq 0xc198
movl 0x8(%rbx), %esi
movl %esi, %eax
movl %ebp, %ecx
imulq $0x18, %rax, %rdx
cmpq %rcx, %rax
jbe 0xc267
movq 0x10(%rbx), %rsi
decq %rax
movl %eax, %edi
imulq $0x18, %rdi, %rdi
movsd (%rsi,%rdi), %xmm0
movsd %xmm0, (%rsi,%rdx)
movq 0x10(%rbx), %rsi
movsd 0x8(%rsi,%rdi), %xmm0
movsd %xmm0, 0x8(%rsi,%rdx)
movq 0x10(%rbx), %rsi
movsd 0x10(%rsi,%rdi), %xmm0
movsd %xmm0, 0x10(%rsi,%rdx)
addq $-0x18, %rdx
jmp 0xc225
movsd (%r14), %xmm0
movq 0x10(%rbx), %rcx
movl %eax, %eax
imulq $0x18, %rax, %rax
movsd %xmm0, (%rcx,%rax)
movsd 0x8(%r14), %xmm0
movq 0x10(%rbx), %rcx
movsd %xmm0, 0x8(%rcx,%rax)
movsd 0x10(%r14), %xmm0
movq 0x10(%rbx), %rcx
movsd %xmm0, 0x10(%rcx,%rax)
incl 0x8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0xc12c
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/common/mathlib.h
// Function: VectorNormalize(double*)
inline vec_t   VectorNormalize(vec3_t v)
{
    double          length;

    length = DotProduct(v, v);
    length = sqrt(length);
    if (length < NORMAL_EPSILON)
    {
        VectorClear(v);
        return 0.0;
    }

    v[0] /= length;
    v[1] /= length;
    v[2] /= length;

    return length;
}

// Assembly:
movupd (%rdi), %xmm1
movapd %xmm1, %xmm0
mulpd %xmm1, %xmm0
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
movapd %xmm1, %xmm2
mulsd %xmm1, %xmm2
addsd %xmm0, %xmm2
movsd 0x10(%rdi), %xmm0
movapd %xmm0, %xmm3
mulsd %xmm0, %xmm3
addsd %xmm2, %xmm3
sqrtsd %xmm3, %xmm2
movsd 0xcd5e(%rip), %xmm4     # 0x19080
ucomisd %xmm2, %xmm4
xorpd %xmm3, %xmm3
ja 0xc334
divsd %xmm2, %xmm0
movapd %xmm0, %xmm3
movapd %xmm2, %xmm0
cmpltsd %xmm4, %xmm0
andnpd %xmm2, %xmm0
xorpd %xmm4, %xmm4
ja 0xc353
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
divpd %xmm2, %xmm1
movapd %xmm1, %xmm4
movsd %xmm3, 0x10(%rdi)
movupd %xmm4, (%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlcsg/brush.cpp
// Function: PlaneFromPoints(double const*, double const*, double const*)
int PlaneFromPoints(const vec_t* const p0, const vec_t* const p1, const vec_t* const p2)
{
    vec3_t          v1, v2;
    vec3_t          normal;

    VectorSubtract(p0, p1, v1);
    VectorSubtract(p2, p1, v2);
    CrossProduct(v1, v2, normal);
    if (VectorNormalize(normal))
    {
        return FindIntPlane(normal, p0);
    }
    return -1;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movsd (%rdi), %xmm0
movsd (%rsi), %xmm1
subsd %xmm1, %xmm0
movsd 0x8(%rdx), %xmm2
movupd 0x8(%rdi), %xmm3
movupd 0x8(%rsi), %xmm4
subpd %xmm4, %xmm3
subsd %xmm4, %xmm2
movsd 0x10(%rdx), %xmm5
movhpd (%rdx), %xmm5           # xmm5 = xmm5[0],mem[0]
shufpd $0x1, %xmm1, %xmm4      # xmm4 = xmm4[1],xmm1[0]
subpd %xmm4, %xmm5
movapd %xmm3, %xmm1
shufpd $0x1, %xmm0, %xmm1      # xmm1 = xmm1[1],xmm0[0]
mulsd %xmm2, %xmm0
unpcklpd %xmm5, %xmm2            # xmm2 = xmm2[0],xmm5[0]
mulpd %xmm1, %xmm2
movapd %xmm3, %xmm1
mulpd %xmm5, %xmm1
subpd %xmm2, %xmm1
movq %rsp, %rdi
movapd %xmm1, (%rdi)
unpckhpd %xmm5, %xmm5            # xmm5 = xmm5[1,1]
mulsd %xmm3, %xmm5
subsd %xmm5, %xmm0
movsd %xmm0, 0x10(%rdi)
callq 0xc2e9
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xc737
jnp 0xc744
movq %rsp, %rdi
movq %rbx, %rsi
callq 0xc3b8
jmp 0xc747
pushq $-0x1
popq %rax
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlcsg/brush.cpp
// Function: AddHullPlane(brushhull_t*, double const*, double const*, bool)
void AddHullPlane(brushhull_t* hull, const vec_t* const normal, const vec_t* const origin, const bool check_planenum)
{
	int planenum = FindIntPlane(normal,origin);
	//check to see if this plane is already in the brush (optional to speed
	//up cases where we know the plane hasn't been added yet, like axial case)
	if(check_planenum)
	{
#ifndef HLCSG_HULLBRUSH
		if(g_mapplanes[planenum].type <= last_axial) //we know axial planes are added in last step
		{ return; }
#endif

		bface_t* current_face;
		for(current_face = hull->faces; current_face; current_face = current_face->next)
		{
			if(current_face->planenum == planenum)
			{ return; } //don't add a plane twice
		}
	}
	bface_t* new_face = (bface_t*)Alloc(sizeof(bface_t)); // TODO: This leaks
	new_face->planenum = planenum;
	new_face->plane = &g_mapplanes[new_face->planenum];
	new_face->next = hull->faces;
	new_face->contents = CONTENTS_EMPTY;
	hull->faces = new_face;
#ifdef HLCSG_HLBSP_VOIDTEXINFO
	new_face->texinfo = -1;
#else
	new_face->texinfo = 0;
#endif
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %ecx, %r14d
movq %rdi, %rbx
movq %rsi, %rdi
movq %rdx, %rsi
callq 0xc3b8
movl %eax, %ebp
testl %r14d, %r14d
je 0xc78d
leaq 0x30(%rbx), %rax
movq (%rax), %rax
testq %rax, %rax
je 0xc78d
cmpl %ebp, 0x8(%rax)
jne 0xc77e
jmp 0xc7c0
pushq $0x68
popq %rdi
callq 0x4842
movl %ebp, 0x8(%rax)
movslq %ebp, %rcx
shlq $0x6, %rcx
leaq 0x20be19a(%rip), %rdx   # 0x20ca940
addq %rcx, %rdx
movq %rdx, 0x10(%rax)
movq 0x30(%rbx), %rcx
movq %rcx, (%rax)
orl $-0x1, 0x28(%rax)
movq %rax, 0x30(%rbx)
orl $-0x1, 0x20(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlcsg/brush.cpp
// Function: CreateBrush(int)
void CreateBrush(const int brushnum) //--vluzacn
{
	brush_t*        b;
	int             contents;
	int             h;

	b = &g_mapbrushes[brushnum];

	contents = b->contents;

	if (contents == CONTENTS_ORIGIN)
		return;
#ifdef HLCSG_HLBSP_CUSTOMBOUNDINGBOX
	if (contents == CONTENTS_BOUNDINGBOX)
		return;
#endif

	//  HULL 0
	MakeBrushPlanes(b);
	MakeHullFaces(b, &b->hulls[0]);

	if (contents == CONTENTS_HINT)
		return;
#ifdef HLCSG_EMPTYBRUSH
	if (contents == CONTENTS_TOEMPTY)
		return;
#endif

	if (g_noclip)
	{
		if (b->cliphull)
		{
			b->hulls[0].faces = NULL;
		}
		return;
	}

	if (b->cliphull)
	{
		for (h = 1; h < NUM_HULLS; h++)
		{
			if (b->cliphull & (1 << h))
			{
				ExpandBrush(b, h);
				MakeHullFaces(b, &b->hulls[h]);
			}
		}
        b->contents = CONTENTS_SOLID;
		b->hulls[0].faces = NULL;
	}
	else
	{
		if (b->noclip)
			return;
		for (h = 1; h < NUM_HULLS; h++)
		{
			ExpandBrush(b, h);
			MakeHullFaces(b, &b->hulls[h]);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movslq %edi, %rax
imulq $0x140, %rax, %r14      # imm = 0x140
leaq 0x30bcd1b(%rip), %r15   # 0x30cb5e0
movl 0x58(%r15,%r14), %ebp
cmpl $-0x13, %ebp
je 0xe95f
cmpl $-0x7, %ebp
je 0xe95f
leaq (%r15,%r14), %rbx
movq %rbx, %rdi
callq 0xe0f3
leaq 0x60(%rbx), %rsi
movq %rbx, %rdi
callq 0xdef2
orl $0x10, %ebp
cmpl $-0x10, %ebp
je 0xe95f
leaq 0x61bcd35(%rip), %rcx   # 0x61cb638
movl 0x1c(%rbx), %eax
cmpb $0x1, (%rcx)
jne 0xe911
testl %eax, %eax
jne 0xe957
jmp 0xe95f
testl %eax, %eax
je 0xe96a
addq %r15, %r14
addq $0x98, %r14
pushq $-0x3
popq %r15
testq %r15, %r15
je 0xe950
movl 0x1c(%rbx), %eax
leaq 0x4(%r15), %rsi
btl %esi, %eax
jae 0xe947
movq %rbx, %rdi
callq 0xd26d
movq %rbx, %rdi
movq %r14, %rsi
callq 0xdef2
incq %r15
addq $0x38, %r14
jmp 0xe923
movl $0xfffffffe, 0x58(%rbx) # imm = 0xFFFFFFFE
andq $0x0, 0x90(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x18(%rbx)
jne 0xe95f
addq %r15, %r14
addq $0x98, %r14
pushq $-0x3
popq %r15
testq %r15, %r15
je 0xe95f
leal 0x4(%r15), %esi
movq %rbx, %rdi
callq 0xd26d
movq %rbx, %rdi
movq %r14, %rsi
callq 0xdef2
incq %r15
addq $0x38, %r14
jmp 0xe97e
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlcsg/brush.cpp
// Function: CopyHullBrush(hullbrush_t const*)
hullbrush_t *CopyHullBrush (const hullbrush_t *hb)
{
	hullbrush_t *hb2;
	hb2 = (hullbrush_t *)malloc (sizeof (hullbrush_t));
	hlassume (hb2 != NULL, assume_NoMemory);
	memcpy (hb2, hb, sizeof (hullbrush_t));
	hb2->faces = (hullbrushface_t *)malloc (hb->numfaces * sizeof (hullbrushface_t));
	hlassume (hb2->faces != NULL, assume_NoMemory);
	memcpy (hb2->faces, hb->faces, hb->numfaces * sizeof (hullbrushface_t));
	hb2->edges = (hullbrushedge_t *)malloc (hb->numedges * sizeof (hullbrushedge_t));
	hlassume (hb2->edges != NULL, assume_NoMemory);
	memcpy (hb2->edges, hb->edges, hb->numedges * sizeof (hullbrushedge_t));
	hb2->vertexes = (hullbrushvertex_t *)malloc (hb->numvertexes * sizeof (hullbrushvertex_t));
	hlassume (hb2->vertexes != NULL, assume_NoMemory);
	memcpy (hb2->vertexes, hb->vertexes, hb->numvertexes * sizeof (hullbrushvertex_t));
	for (int i = 0; i < hb->numfaces; i++)
	{
		hullbrushface_t *f2 = &hb2->faces[i];
		const hullbrushface_t *f = &hb->faces[i];
		f2->vertexes = (vec3_t *)malloc (f->numvertexes * sizeof (vec3_t));
		hlassume (f2->vertexes != NULL, assume_NoMemory);
		memcpy (f2->vertexes, f->vertexes, f->numvertexes * sizeof (vec3_t));
	}
	return hb2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x30
popq %rdi
callq 0x4450
movq %rax, %r14
xorl %edi, %edi
testq %rax, %rax
setne %dil
pushq $0x1
popq %rbp
movl %ebp, %esi
callq 0x9517
movq 0x20(%rbx), %rax
movq %rax, 0x20(%r14)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups %xmm1, 0x10(%r14)
movups %xmm0, (%r14)
movslq (%rbx), %rdi
shlq $0x6, %rdi
callq 0x4450
movq %rax, %r15
movq %rax, 0x8(%r14)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl %ebp, %esi
callq 0x9517
movq 0x8(%rbx), %rsi
movslq (%rbx), %rdx
shlq $0x6, %rdx
movq %r15, %rdi
callq 0x4280
movslq 0x10(%rbx), %rax
imulq $0x90, %rax, %rdi
callq 0x4450
movq %rax, %r12
movq %rax, 0x18(%r14)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl %ebp, %esi
callq 0x9517
movq 0x18(%rbx), %rsi
movslq 0x10(%rbx), %rax
imulq $0x90, %rax, %rdx
movq %r12, %rdi
callq 0x4280
movslq 0x20(%rbx), %rax
imulq $0x18, %rax, %rdi
callq 0x4450
movq %rax, %r12
movq %r14, (%rsp)
movq %rax, 0x28(%r14)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl %ebp, %esi
callq 0x9517
movq 0x28(%rbx), %rsi
movslq 0x20(%rbx), %rax
imulq $0x18, %rax, %rdx
movq %r12, %rdi
callq 0x4280
xorl %r12d, %r12d
xorl %r13d, %r13d
movslq (%rbx), %rax
cmpq %rax, %r13
jge 0xf770
movq 0x8(%rbx), %r14
movslq 0x30(%r14,%r12), %rax
imulq $0x18, %rax, %rdi
callq 0x4450
movq %rax, 0x38(%r15,%r12)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl %ebp, %esi
callq 0x9517
movq 0x38(%r15,%r12), %rdi
movq 0x38(%r14,%r12), %rsi
movslq 0x30(%r14,%r12), %rax
imulq $0x18, %rax, %rdx
callq 0x4280
incq %r13
addq $0x40, %r12
jmp 0xf720
movq (%rsp), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlcsg/brush.cpp
// Function: DeleteHullBrush(hullbrush_t*)
void DeleteHullBrush (hullbrush_t *hb)
{
	for (hullbrushface_t *hbf = hb->faces; hbf < hb->faces + hb->numfaces; hbf++)
	{
		if (hbf->vertexes)
		{
			free (hbf->vertexes);
		}
	}
	free (hb->faces);
	free (hb->edges);
	free (hb->vertexes);
	free (hb);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
movq %rdi, %r14
movslq (%rbx), %rax
shlq $0x6, %rax
addq %rdi, %rax
cmpq %rax, %r14
jae 0xf7b3
movq 0x38(%r14), %rdi
callq 0x43b0
addq $0x40, %r14
movq 0x8(%rbx), %rdi
jmp 0xf791
callq 0x43b0
movq 0x18(%rbx), %rdi
callq 0x43b0
movq 0x28(%rbx), %rdi
callq 0x43b0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x43b0
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlcsg/brush.cpp
// Function: InitDefaultHulls()
void InitDefaultHulls ()
{
	for (int h = 0; h < NUM_HULLS; h++)
	{
		hullshape_t *hs = &g_defaulthulls[h];
		hs->id = _strdup ("");
		hs->disabled = true;
		hs->numbrushes = 0;
		hs->brushes = (hullbrush_t **)malloc (0 * sizeof (hullbrush_t *));
		hlassume (hs->brushes != NULL, assume_NoMemory);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
pushq $0x10
popq %r14
leaq 0x30bb165(%rip), %r15   # 0x30ca950
leaq 0xb427(%rip), %rbx      # 0x1ac19
pushq $0x1
popq %rbp
cmpq $0x70, %r14
je 0xf835
movq %rbx, %rdi
callq 0x45d0
movq %rax, -0x10(%r14,%r15)
movb $0x1, -0x8(%r14,%r15)
andl $0x0, -0x4(%r14,%r15)
xorl %edi, %edi
callq 0x4450
movq %rax, (%r14,%r15)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl %ebp, %esi
callq 0x9517
addq $0x18, %r14
jmp 0xf7f5
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/common/mathlib.h
// Function: PlaneTypeForNormal(double*)
inline planetypes PlaneTypeForNormal(vec3_t normal)
{
    vec_t           ax, ay, az;

    ax = fabs(normal[0]);
    ay = fabs(normal[1]);
    az = fabs(normal[2]);
#ifdef HLCSG_FACENORMALEPSILON
    if (ax > 1.0 - DIR_EPSILON && ay < DIR_EPSILON && az < DIR_EPSILON)
    {
        return plane_x;
    }

    if (ay > 1.0 - DIR_EPSILON && az < DIR_EPSILON && ax < DIR_EPSILON)
    {
        return plane_y;
    }

    if (az > 1.0 - DIR_EPSILON && ax < DIR_EPSILON && ay < DIR_EPSILON)
    {
        return plane_z;
    }
#else
    if (ax > 1.0 - NORMAL_EPSILON && ay < NORMAL_EPSILON && az < NORMAL_EPSILON)
    {
        return plane_x;
    }

    if (ay > 1.0 - NORMAL_EPSILON && az < NORMAL_EPSILON && ax < NORMAL_EPSILON)
    {
        return plane_y;
    }

    if (az > 1.0 - NORMAL_EPSILON && ax < NORMAL_EPSILON && ay < NORMAL_EPSILON)
    {
        return plane_z;
    }
#endif

    if ((ax >= ay) && (ax >= az))
    {
        return plane_anyx;
    }
    if ((ay >= ax) && (ay >= az))
    {
        return plane_anyy;
    }
    return plane_anyz;
}

// Assembly:
movapd 0xc80c(%rip), %xmm3     # 0x1c250
movsd (%rdi), %xmm0
movsd 0x8(%rdi), %xmm2
movsd 0x10(%rdi), %xmm1
andpd %xmm3, %xmm0
andpd %xmm3, %xmm2
andpd %xmm3, %xmm1
ucomisd 0xca0a(%rip), %xmm0     # 0x1c470
jbe 0xfa7f
movsd 0xc9f0(%rip), %xmm3     # 0x1c460
ucomisd %xmm2, %xmm3
jbe 0xfa7f
xorl %eax, %eax
ucomisd %xmm1, %xmm3
jbe 0xfa7f
retq
movsd 0xc9d9(%rip), %xmm3     # 0x1c460
ucomisd %xmm0, %xmm3
jbe 0xfaa1
ucomisd 0xc9db(%rip), %xmm2     # 0x1c470
jbe 0xfaa1
ucomisd %xmm1, %xmm3
jbe 0xfaa1
pushq $0x1
jmp 0xfac9
ucomisd %xmm0, %xmm3
jbe 0xfabb
ucomisd 0xc9c1(%rip), %xmm1     # 0x1c470
jbe 0xfabb
ucomisd %xmm2, %xmm3
jbe 0xfabb
pushq $0x2
jmp 0xfac9
ucomisd %xmm2, %xmm0
jb 0xfacb
ucomisd %xmm1, %xmm0
jb 0xfacb
pushq $0x3
popq %rax
retq
cmpnlepd %xmm2, %xmm1
cmpnlepd %xmm2, %xmm0
orpd %xmm1, %xmm0
movd %xmm0, %ecx
pushq $0x4
popq %rax
subl %ecx, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/common/mathlib.h
// Function: VectorCompare(double const*, double const*)
inline bool     VectorCompare(const vec3_t v1, const vec3_t v2)
{
    int             i;

    for (i = 0; i < 3; i++)
    {
        if (fabs(v1[i] - v2[i]) > EQUAL_EPSILON)
        {
            return false;
        }
    }
    return true;
}

// Assembly:
xorl %ecx, %ecx
movapd 0xc763(%rip), %xmm0     # 0x1c250
movsd 0xc99b(%rip), %xmm1     # 0x1c490
movq %rcx, %rax
cmpq $0x3, %rcx
je 0xfb16
movsd (%rdi,%rax,8), %xmm2
subsd (%rsi,%rax,8), %xmm2
andpd %xmm0, %xmm2
leaq 0x1(%rax), %rcx
ucomisd %xmm1, %xmm2
jbe 0xfaf5
cmpq $0x3, %rax
setae %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlcsg/brushunion.cpp
// Function: DumpHullWindings(brushhull_t const*)
static void     DumpHullWindings(const brushhull_t* const hull)
{
    int             x = 0;
    bface_t*        face;

    for (face = hull->faces; face; face = face->next)
    {
        Developer(DEVELOPER_LEVEL_MEGASPAM, "Winding %d\n", x++);
        face->w->Print();
        Developer(DEVELOPER_LEVEL_MEGASPAM, "\n");
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
addq $0x30, %rbx
leaq 0xcb62(%rip), %r14      # 0x1cc0e
pushq $0x6
popq %rbp
leaq 0xab62(%rip), %r15      # 0x1ac18
xorl %edx, %edx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x100ea
leal 0x1(%rdx), %r12d
movl %ebp, %edi
movq %r14, %rsi
xorl %eax, %eax
callq 0x9291
movq 0x18(%rbx), %rdi
callq 0xa3ac
movl %ebp, %edi
movq %r15, %rsi
xorl %eax, %eax
callq 0x9291
movl %r12d, %edx
jmp 0x100b8
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlcsg/map.cpp
// Function: CopyCurrentBrush(entity_t*, brush_s const*)
brush_t *CopyCurrentBrush (entity_t *entity, const brush_t *brush)
{
	if (entity->firstbrush + entity->numbrushes != g_nummapbrushes)
	{
		Error ("CopyCurrentBrush: internal error.");
	}
	brush_t *newb = &g_mapbrushes[g_nummapbrushes];
	g_nummapbrushes++;
	hlassume (g_nummapbrushes <= MAX_MAP_BRUSHES, assume_MAX_MAP_BRUSHES);
	memcpy (newb, brush, sizeof (brush_t));
	newb->firstside = g_numbrushsides;
	g_numbrushsides += brush->numsides;
	hlassume (g_numbrushsides <= MAX_MAP_SIDES, assume_MAX_MAP_SIDES);
	memcpy (&g_brushsides[newb->firstside], &g_brushsides[brush->firstside], brush->numsides * sizeof (side_t));
	newb->entitynum = entity - g_entities;
	newb->brushnum = entity->numbrushes;
	entity->numbrushes++;
#ifdef HLCSG_HULLBRUSH
	for (int h = 0; h < NUM_HULLS; h++)
	{
		if (brush->hullshapes[h] != NULL)
		{
			newb->hullshapes[h] = _strdup (brush->hullshapes[h]);
		}
		else
		{
			newb->hullshapes[h] = NULL;
		}
	}
#endif
	return newb;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movl 0x1c(%rdi), %eax
addl 0x18(%rdi), %eax
cmpl 0x30bb105(%rip), %eax   # 0x30cb5d0
je 0x104e1
leaq 0xc8dc(%rip), %rdi      # 0x1cdb0
xorl %eax, %eax
callq 0x8d7b
movl 0x30bb0ef(%rip), %eax   # 0x30cb5d0
cltq
imulq $0x140, %rax, %r12      # imm = 0x140
leaq 0x30bb0ef(%rip), %r13   # 0x30cb5e0
leaq (%r12,%r13), %r14
leal 0x1(%rax), %ecx
movl %ecx, 0x30bb0d2(%rip)   # 0x30cb5d0
xorl %edi, %edi
cmpl $0x8000, %eax           # imm = 0x8000
setl %dil
pushq $0x28
popq %rsi
callq 0x9517
movl $0x140, %edx            # imm = 0x140
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4280
movl 0x3abb0b9(%rip), %eax   # 0x3acb5e0
movl %eax, 0x10(%r12,%r13)
addl 0x14(%rbx), %eax
movl %eax, 0x3abb0ab(%rip)   # 0x3acb5e0
xorl %edi, %edi
cmpl $0x30001, %eax          # imm = 0x30001
setl %dil
pushq $0x27
popq %rsi
callq 0x9517
movslq 0x10(%r12,%r13), %rax
imulq $0xd0, %rax, %rdi
leaq 0x3abb095(%rip), %rax   # 0x3acb5f0
addq %rax, %rdi
movslq 0x10(%rbx), %rcx
imulq $0xd0, %rcx, %rsi
addq %rax, %rsi
movslq 0x14(%rbx), %rax
imulq $0xd0, %rax, %rdx
callq 0x4280
movq %r15, %rax
subq 0x15a52(%rip), %rax     # 0x25fd8
pushq $0x28
popq %rcx
cqto
idivq %rcx
movl %eax, 0x8(%r12,%r13)
movl 0x1c(%r15), %eax
movl %eax, 0xc(%r12,%r13)
incl %eax
movl %eax, 0x1c(%r15)
xorl %r15d, %r15d
cmpq $0x4, %r15
je 0x105c8
movq 0x38(%rbx,%r15,8), %rdi
testq %rdi, %rdi
je 0x105bc
callq 0x45d0
jmp 0x105be
xorl %eax, %eax
movq %rax, 0x38(%r14,%r15,8)
incq %r15
jmp 0x105a5
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlcsg/map.cpp
// Function: TextureAxisFromPlane(plane_t const*, double*, double*)
void            TextureAxisFromPlane(const plane_t* const pln, vec3_t xv, vec3_t yv)
{
    int             bestaxis;
    vec_t           dot, best;
    int             i;

    best = 0;
    bestaxis = 0;

    for (i = 0; i < 6; i++)
    {
        dot = DotProduct(pln->normal, s_baseaxis[i * 3]);
        if (dot > best)
        {
            best = dot;
            bestaxis = i;
        }
    }

    VectorCopy(s_baseaxis[bestaxis * 3 + 1], xv);
    VectorCopy(s_baseaxis[bestaxis * 3 + 2], yv);
}

// Assembly:
movsd (%rdi), %xmm0
movsd 0x8(%rdi), %xmm1
movsd 0x10(%rdi), %xmm2
xorpd %xmm3, %xmm3
xorl %ecx, %ecx
leaq 0xcc3c(%rip), %rdi      # 0x1d3c0
xorl %eax, %eax
cmpq $0x6, %rcx
je 0x107c6
movsd -0x8(%rdi), %xmm4
mulsd %xmm1, %xmm4
movsd -0x10(%rdi), %xmm5
mulsd %xmm0, %xmm5
addsd %xmm4, %xmm5
movsd (%rdi), %xmm4
mulsd %xmm2, %xmm4
addsd %xmm5, %xmm4
ucomisd %xmm3, %xmm4
cmoval %ecx, %eax
maxsd %xmm3, %xmm4
incq %rcx
addq $0x48, %rdi
movapd %xmm4, %xmm3
jmp 0x10786
leal (%rax,%rax,2), %ecx
incl %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
leaq 0xcbd7(%rip), %rdi      # 0x1d3b0
movups (%rcx,%rdi), %xmm0
movups %xmm0, (%rsi)
movsd 0x10(%rcx,%rdi), %xmm0
movsd %xmm0, 0x10(%rsi)
leal (%rax,%rax,2), %eax
addl $0x2, %eax
cltq
imulq $0x18, %rax, %rax
movups (%rax,%rdi), %xmm0
movups %xmm0, (%rdx)
movsd 0x10(%rax,%rdi), %xmm0
movsd %xmm0, 0x10(%rdx)
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlcsg/map.cpp
// Function: CountEngineEntities()
unsigned int    CountEngineEntities()
{
    unsigned int x;
    unsigned num_engine_entities = 0;
    entity_t*       mapent = g_entities;

    // for each entity in the map
    for (x=0; x<g_numentities; x++, mapent++)
    {
        const char* classname = ValueForKey(mapent, "classname");

        // if its a light_spot or light_env, dont include it as an engine entity!
        if (classname)
        {
            if (   !strncasecmp(classname, "light", 5) 
                || !strncasecmp(classname, "light_spot", 10) 
                || !strncasecmp(classname, "light_environment", 17)
               )
            {
                const char* style = ValueForKey(mapent, "style");
                const char* targetname = ValueForKey(mapent, "targetname");

                // lightspots and lightenviroments dont have a targetname or style
                if (!strlen(targetname) && !atoi(style))
                {
                    continue;
                }
            }
        }

        num_engine_entities++;
    }

    return num_engine_entities;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %ebx, %ebx
leaq 0x200ae58(%rip), %r14   # 0x201d460
leaq 0x200ae45(%rip), %r12   # 0x201d454
leaq 0x6f54(%rip), %r15      # 0x1956a
xorl %r13d, %r13d
cmpl (%r12), %r13d
jae 0x126b8
movq %r14, %rdi
movq %r15, %rsi
callq 0x69ab
testq %rax, %rax
je 0x126aa
movq %rax, %rbp
movq %rax, %rdi
leaq 0x6fee(%rip), %rsi      # 0x1962e
pushq $0x5
popq %rdx
callq 0x4420
testl %eax, %eax
je 0x12678
movq %rbp, %rdi
leaq 0x706d(%rip), %rsi      # 0x196c3
pushq $0xa
popq %rdx
callq 0x4420
testl %eax, %eax
je 0x12678
movq %rbp, %rdi
leaq 0x6fa8(%rip), %rsi      # 0x19614
pushq $0x11
popq %rdx
callq 0x4420
testl %eax, %eax
jne 0x126aa
movq %r14, %rdi
leaq 0xb5dc(%rip), %rsi      # 0x1dc5e
callq 0x69ab
movq %rax, %rbp
movq %r14, %rdi
leaq 0x7024(%rip), %rsi      # 0x196b8
callq 0x69ab
cmpb $0x0, (%rax)
jne 0x126aa
movq %rbp, %rdi
callq 0x4520
testl %eax, %eax
je 0x126ac
incl %ebx
incl %r13d
addq $0x28, %r14
jmp 0x12619
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlcsg/properties.cpp
// Function: properties_initialize(char const*)
void properties_initialize(const char* filename)
{
    if (filename == NULL)
    { return; }

    if (q_exists(filename))
    { Log("Loading null entity list from '%s'\n", filename); }
    else
    {
		Error("Could not find null entity list file '%s'\n", filename);
        return;
    }

	ifstream file(filename,ios::in);
	if(!file)
	{ 
		file.close();
		return; 
	}


	//begin reading list of items
	char line[MAX_VAL]; //MAX_VALUE //vluzacn
	memset(line,0,sizeof(char)*4096);
	while(!file.eof())
	{
		string str;
		getline(file,str);
		{ //--vluzacn
			char *s = strdup (str.c_str ());
			int i;
			for (i = 0; s[i] != '\0'; i++)
			{
				if (s[i] == '\n' || s[i] == '\r')
				{
					s[i] = '\0';
				}
			}
			str.assign (s);
			free (s);
		}
		if(str.size() < 1)
		{ continue; }
		g_invisible_items.insert(str);
	}
	file.close();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x230, %rsp            # imm = 0x230
testq %rdi, %rdi
je 0x12a53
movq %rdi, %rbx
callq 0x850a
testb %al, %al
je 0x12982
leaq 0xac18(%rip), %rdi      # 0x1d560
movq %rbx, %rsi
xorl %eax, %eax
callq 0x89dc
leaq 0x28(%rsp), %r14
pushq $0x8
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x45e0
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x48(%rsp,%rax)
je 0x129a3
leaq 0x28(%rsp), %rdi
callq 0x40e0
jmp 0x12a49
leaq 0xabfb(%rip), %rdi      # 0x1d584
movq %rbx, %rsi
xorl %eax, %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x8d7b
leaq 0x18(%rsp), %r13
leaq 0x28(%rsp), %rbx
leaq 0x8(%rsp), %r14
leaq 0x61b8c47(%rip), %r15   # 0x61cb600
testb $0x2, 0x48(%rsp,%rax)
jne 0x12a3f
movq %r13, 0x8(%rsp)
andq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x40d0
movq 0x8(%rsp), %rdi
callq 0x45d0
movq %rax, %r12
movzbl (%rax), %ecx
cmpl $0xa, %ecx
je 0x129fb
cmpl $0xd, %ecx
je 0x129fb
testl %ecx, %ecx
jne 0x129fe
jmp 0x12a03
movb $0x0, (%rax)
incq %rax
jmp 0x129e8
movq %r14, %rdi
movq %r12, %rsi
callq 0x4630
movq %r12, %rdi
callq 0x43b0
cmpq $0x0, 0x10(%rsp)
je 0x12a29
movq %r15, %rdi
movq %r14, %rsi
callq 0x12af6
movq %r14, %rdi
callq 0x41a0
movq 0x28(%rsp), %rax
movq -0x18(%rax), %rax
jmp 0x129b9
leaq 0x28(%rsp), %rdi
callq 0x40e0
leaq 0x28(%rsp), %rdi
callq 0x4110
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x12a66
movq %rax, %rbx
jmp 0x12a7a
jmp 0x12a6d
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x41a0
leaq 0x28(%rsp), %rdi
callq 0x4110
movq %rbx, %rdi
callq 0x4590
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlcsg/qcsg.cpp
// Function: NewFaceFromFace(bface_s const*)
bface_t*        NewFaceFromFace(const bface_t* const in)
{
    bface_t*        newf;

    newf = (bface_t*)Alloc(sizeof(bface_t));

    newf->contents = in->contents;
    newf->texinfo = in->texinfo;
    newf->planenum = in->planenum;
    newf->plane = in->plane;
#ifdef HLCSG_EMPTYBRUSH
	newf->backcontents = in->backcontents;
#endif

    return newf;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x68
popq %rdi
callq 0x4842
movl 0x28(%rbx), %ecx
movl %ecx, 0x28(%rax)
movl 0x20(%rbx), %ecx
movl %ecx, 0x20(%rax)
movl 0x8(%rbx), %ecx
movl %ecx, 0x8(%rax)
movq 0x10(%rbx), %rcx
movq %rcx, 0x10(%rax)
movl 0x2c(%rbx), %ecx
movl %ecx, 0x2c(%rax)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlcsg/qcsg.cpp
// Function: WriteDetailBrush(int, bface_s const*)
void WriteDetailBrush (int hull, const bface_t *faces)
{
	ThreadLock ();
	fprintf (out_detailbrush[hull], "0\n");
	for (const bface_t *f = faces; f; f = f->next)
	{
		Winding *w = f->w;
		fprintf (out_detailbrush[hull], "%i %u\n", f->planenum, w->m_NumPoints);
		for (int i = 0; i < w->m_NumPoints; i++)
		{
			fprintf (out_detailbrush[hull], "%5.8f %5.8f %5.8f\n", w->m_Points[i][0], w->m_Points[i][1], w->m_Points[i][2]);
		}
	}
	fprintf (out_detailbrush[hull], "-1 -1\n");
	ThreadUnlock ();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
callq 0xa058
movslq %ebp, %r12
leaq 0x61b82e2(%rip), %r13   # 0x61cb6c0
movq (%r13,%r12,8), %rcx
leaq 0xa425(%rip), %rdi      # 0x1d80f
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
callq 0x4640
leaq 0xa3ed(%rip), %r15      # 0x1d7e9
testq %rbx, %rbx
je 0x13467
movq 0x18(%rbx), %r14
movq (%r13,%r12,8), %rdi
movq %rbx, (%rsp)
movl 0x8(%rbx), %edx
movl 0x8(%r14), %ecx
leaq 0xa3c6(%rip), %rsi      # 0x1d7e2
xorl %eax, %eax
callq 0x44a0
pushq $0x10
popq %rbp
xorl %ebx, %ebx
movl 0x8(%r14), %eax
cmpq %rax, %rbx
jae 0x1345e
movq (%r13,%r12,8), %rdi
movq 0x10(%r14), %rax
movsd -0x10(%rax,%rbp), %xmm0
movsd -0x8(%rax,%rbp), %xmm1
movsd (%rax,%rbp), %xmm2
movq %r15, %rsi
movb $0x3, %al
callq 0x44a0
incq %rbx
addq $0x18, %rbp
jmp 0x13428
movq (%rsp), %rbx
movq (%rbx), %rbx
jmp 0x133fc
movq (%r13,%r12,8), %rcx
leaq 0xb5c1(%rip), %rdi      # 0x1ea34
pushq $0x6
popq %rsi
pushq $0x1
popq %rdx
callq 0x4640
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa069
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlcsg/qcsg.cpp
// Function: CopyFace(bface_s const*)
bface_t*        CopyFace(const bface_t* const f)
{
    bface_t*        n;

    n = NewFaceFromFace(f);
    n->w = f->w->Copy();
    n->bounds = f->bounds;
    return n;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x1311f
movq %rax, %r14
movq 0x18(%rbx), %rdi
callq 0xa846
movq %rax, 0x18(%r14)
movups 0x38(%rbx), %xmm0
movups 0x48(%rbx), %xmm1
movups 0x58(%rbx), %xmm2
movups %xmm0, 0x38(%r14)
movups %xmm1, 0x48(%r14)
movups %xmm2, 0x58(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlcsg/qcsg.cpp
// Function: FreeFaceList(bface_s*)
void            FreeFaceList(bface_t* f)
{
    if (f)
    {
        if (f->next)
        {
            FreeFaceList(f->next);
        }
        FreeFace(f);
    }
}

// Assembly:
testq %rdi, %rdi
je 0x1352a
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x13521
callq 0x1350b
movq %rbx, %rdi
popq %rbx
jmp 0x1314d
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlcsg/qcsg.cpp
// Function: LoadWadValue()
void LoadWadValue ()
{
	char *wadvalue;
	ParseFromMemory (g_dentdata, g_entdatasize);
	epair_t *e;
	entity_t ent0;
	entity_t *mapent = &ent0;
	memset (mapent, 0, sizeof (entity_t));
	if (!GetToken (true))
	{
		wadvalue = strdup ("");
	}
	else
	{
		if (strcmp (g_token, "{"))
		{
			Error ("ParseEntity: { not found");
		}
		while (1)
		{
			if (!GetToken (true))
			{
				Error ("ParseEntity: EOF without closing brace");
			}
			if (!strcmp (g_token, "}"))
			{
				break;
			}
			e = ParseEpair ();
			e->next = mapent->epairs;
			mapent->epairs = e;
		}
		wadvalue = strdup (ValueForKey (mapent, "wad"));
		epair_t *next;
		for (e = mapent->epairs; e; e = next)
		{
			next = e->next;
			free (e->key);
			free (e->value);
			free (e);
		}
	}
	if (*wadvalue)
	{
		Log ("Wad files required to run the map: \"%s\"\n", wadvalue);
	}
	else
	{
		Log ("Wad files required to run the map: (None)\n");
	}
	SetKeyValue (&g_entities[0], "wad", wadvalue);
	free (wadvalue);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x81bdbc(%rip), %rax    # 0x82f4d4
movl (%rax), %esi
leaq 0x81bdbf(%rip), %rdi    # 0x82f4e0
callq 0x9a3f
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
andq $0x0, 0x20(%rsp)
pushq $0x1
popq %rdi
callq 0x9b47
testb %al, %al
je 0x1379b
leaq 0x20add65(%rip), %r15   # 0x20c14b0
cmpw $0x7b, (%r15)
je 0x13760
leaq 0x5daf(%rip), %rdi      # 0x19508
xorl %eax, %eax
callq 0x8d7b
pushq $0x1
popq %rbx
leaq 0x5dd9(%rip), %r14      # 0x19543
xorl %r12d, %r12d
movl %ebx, %edi
callq 0x9b47
testb %al, %al
jne 0x13782
movq %r14, %rdi
xorl %eax, %eax
callq 0x8d7b
cmpw $0x7d, (%r15)
je 0x137c2
callq 0x66a7
movq %r12, (%rax)
movq %rax, 0x20(%rsp)
movq %rax, %r12
jmp 0x1376d
leaq 0x7477(%rip), %rdi      # 0x1ac19
callq 0x45d0
movq %rax, %rbx
cmpb $0x0, (%rbx)
je 0x1380a
leaq 0x5be2(%rip), %rdi      # 0x19398
movq %rbx, %rsi
xorl %eax, %eax
callq 0x89dc
jmp 0x13818
leaq 0xa0ad(%rip), %rsi      # 0x1d876
movq %rsp, %r14
movq %r14, %rdi
callq 0x69ab
movq %rax, %rdi
callq 0x45d0
movq %rax, %rbx
movq 0x20(%r14), %r14
testq %r14, %r14
je 0x137aa
movq (%r14), %r15
movq 0x8(%r14), %rdi
callq 0x43b0
movq 0x10(%r14), %rdi
callq 0x43b0
movq %r14, %rdi
callq 0x43b0
movq %r15, %r14
jmp 0x137e3
leaq 0x5b09(%rip), %rdi      # 0x1931a
xorl %eax, %eax
callq 0x89dc
leaq 0x2009c41(%rip), %rdi   # 0x201d460
leaq 0xa050(%rip), %rsi      # 0x1d876
movq %rbx, %rdx
callq 0x69e6
movq %rbx, %rdi
callq 0x43b0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/common/boundingbox.h
// Function: BoundingBox::testDisjoint(BoundingBox const&) const
bool testDisjoint(const BoundingBox& other) const
    {
#ifdef ZHLT_BOUNDINGBOX_PRECISION_FIX
        if ((m_Mins[0] > other.m_Maxs[0] + ON_EPSILON) ||
            (m_Mins[1] > other.m_Maxs[1] + ON_EPSILON) ||
            (m_Mins[2] > other.m_Maxs[2] + ON_EPSILON) ||
            (m_Maxs[0] < other.m_Mins[0] - ON_EPSILON) ||
            (m_Maxs[1] < other.m_Mins[1] - ON_EPSILON) ||
            (m_Maxs[2] < other.m_Mins[2] - ON_EPSILON))
#else
        if ((m_Mins[0] > other.m_Maxs[0]) ||
            (m_Mins[1] > other.m_Maxs[1]) ||
            (m_Mins[2] > other.m_Maxs[2]) ||
            (m_Maxs[0] < other.m_Mins[0]) ||
            (m_Maxs[1] < other.m_Mins[1]) ||
            (m_Maxs[2] < other.m_Mins[2]))
#endif
        {
            return true;
        }
        return false;
    }

// Assembly:
movsd 0x18(%rsi), %xmm0
addsd 0x5cc9(%rip), %xmm0     # 0x1c468
movsd (%rdi), %xmm1
movb $0x1, %al
ucomisd %xmm0, %xmm1
ja 0x16818
movsd 0x8(%rdi), %xmm0
movsd 0x20(%rsi), %xmm1
addsd 0x5cab(%rip), %xmm1     # 0x1c468
ucomisd %xmm1, %xmm0
ja 0x16818
movsd 0x10(%rdi), %xmm0
movsd 0x28(%rsi), %xmm1
addsd 0x5c93(%rip), %xmm1     # 0x1c468
ucomisd %xmm1, %xmm0
ja 0x16818
movsd (%rsi), %xmm0
addsd 0x6e09(%rip), %xmm0     # 0x1d5f0
ucomisd 0x18(%rdi), %xmm0
ja 0x16818
movsd 0x8(%rsi), %xmm0
addsd 0x6df5(%rip), %xmm0     # 0x1d5f0
ucomisd 0x20(%rdi), %xmm0
ja 0x16818
movsd 0x10(%rsi), %xmm0
addsd 0x6de1(%rip), %xmm0     # 0x1d5f0
ucomisd 0x28(%rdi), %xmm0
ja 0x16818
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlcsg/textures.cpp
// Function: AddAnimatingTextures()
void            AddAnimatingTextures()
{
    int             base;
    int             i, j, k;
    char            name[MAXWADNAME];

    base = nummiptex;

    for (i = 0; i < base; i++)
    {
        if ((miptex[i].name[0] != '+') && (miptex[i].name[0] != '-'))
        {
            continue;
        }

        safe_strncpy(name, miptex[i].name, MAXWADNAME);

        for (j = 0; j < 20; j++)
        {
            if (j < 10)
            {
                name[1] = '0' + j;
            }
            else
            {
                name[1] = 'A' + j - 10;                    // alternate animation
            }

            // see if this name exists in the wadfile
            for (k = 0; k < nTexLumps; k++)
            {
                if (!strcmp(name, lumpinfo[k].name))
                {
                    FindMiptex(name);                      // add to the miptex list
                    break;
                }
            }
        }
    }

    if (nummiptex - base)
    {
        Log("added %i additional animating textures.\n", nummiptex - base);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl 0x61b4cc2(%rip), %eax   # 0x61cbf6c
xorl %r15d, %r15d
testl %eax, %eax
movl $0x0, %ecx
movl %eax, 0x4(%rsp)
cmovgl %eax, %ecx
movq %rcx, 0x8(%rsp)
leaq 0x10(%rsp), %rbx
xorl %ebp, %ebp
cmpq 0x8(%rsp), %rbp
je 0x17373
imulq $0x24, %rbp, %rax
leaq 0x61b4c93(%rip), %rcx   # 0x61cbf70
movzbl 0x10(%rax,%rcx), %ecx
cmpl $0x2d, %ecx
je 0x172ec
cmpl $0x2b, %ecx
jne 0x1736b
leaq 0x61b4c7d(%rip), %rcx   # 0x61cbf70
leaq (%rax,%rcx), %rsi
addq $0x10, %rsi
movq %rbx, %rdi
pushq $0x10
popq %rdx
callq 0x796d
xorl %r14d, %r14d
cmpl $0x14, %r14d
je 0x1736b
leal 0x37(%r14), %eax
movl %r14d, %ecx
orb $0x30, %cl
cmpl $0xa, %r14d
movzbl %cl, %ecx
movzbl %al, %eax
cmovbl %ecx, %eax
movb %al, 0x11(%rsp)
movl 0x61b4c37(%rip), %r13d  # 0x61cbf68
movq 0x61b4c28(%rip), %rsi   # 0x61cbf60
testl %r13d, %r13d
cmovlel %r15d, %r13d
incq %r13
addq $0x10, %rsi
decq %r13
je 0x17366
leaq 0x24(%rsi), %r12
movq %rbx, %rdi
callq 0x4480
movq %r12, %rsi
testl %eax, %eax
jne 0x17346
movq %rbx, %rdi
callq 0x1739c
incl %r14d
jmp 0x17309
incq %rbp
jmp 0x172c7
movl 0x61b4bf3(%rip), %esi   # 0x61cbf6c
subl 0x4(%rsp), %esi
je 0x1738d
leaq 0x79c0(%rip), %rdi      # 0x1ed46
xorl %eax, %eax
callq 0x89dc
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlcsg/textures.cpp
// Function: FindMiptex(char const*)
static int      FindMiptex(const char* const name)
{
    int             i;
#ifdef HLCSG_TEXMAP64_FIX
	if (strlen (name) >= MAXWADNAME)
	{
		Error ("Texture name is too long (%s)\n", name);
	}
#endif

    ThreadLock();
    for (i = 0; i < nummiptex; i++)
    {
        if (!strcmp(name, miptex[i].name))
        {
            ThreadUnlock();
            return i;
        }
    }

    hlassume(nummiptex < MAX_MAP_TEXTURES, assume_MAX_MAP_TEXTURES);
    safe_strncpy(miptex[i].name, name, MAXWADNAME);
    nummiptex++;
    ThreadUnlock();
    return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x4190
cmpq $0x10, %rax
jb 0x173c3
leaq 0x7b0c(%rip), %rdi      # 0x1eec5
movq %rbx, %rsi
xorl %eax, %eax
callq 0x8d7b
callq 0xa058
movl 0x61b4b9e(%rip), %ebp   # 0x61cbf6c
xorl %r12d, %r12d
testl %ebp, %ebp
movl $0x0, %r14d
cmovgl %ebp, %r14d
leaq 0x61b4b9c(%rip), %r15   # 0x61cbf80
cmpq %r12, %r14
je 0x17401
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4480
testl %eax, %eax
je 0x1743b
incq %r12
addq $0x24, %r15
jmp 0x173e4
xorl %edi, %edi
cmpl $0x1000, %ebp           # imm = 0x1000
setl %dil
pushq $0x24
popq %rsi
callq 0x9517
imulq $0x24, %r14, %rax
leaq 0x61b4b50(%rip), %rcx   # 0x61cbf70
leaq (%rax,%rcx), %rdi
addq $0x10, %rdi
pushq $0x10
popq %rdx
movq %rbx, %rsi
callq 0x796d
incl 0x61b4b33(%rip)         # 0x61cbf6c
jmp 0x1743e
movl %r12d, %r14d
callq 0xa069
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq