LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/winding.cpp
// Function: Winding::Winding(unsigned int)
Winding::Winding(UINT32 numpoints)
{
    hlassert(numpoints >= 3);
    m_NumPoints = numpoints;
    m_MaxPoints = (m_NumPoints + 3) & ~3;   // groups of 4

    m_Points = new vec3_t[m_MaxPoints];
    memset(m_Points, 0, sizeof(vec3_t) * m_NumPoints);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leaq 0x1b942(%rip), %rax     # 0x27d60
movq %rax, (%rdi)
movl %esi, 0x8(%rdi)
leal 0x3(%rbx), %eax
andl $-0x4, %eax
movl %eax, 0x18(%rdi)
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdi
callq 0x4040
movq %rax, 0x10(%r14)
movl %ebx, %ecx
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rdx
movq %rax, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x41c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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:
movl 0x8(%rdi), %esi
testl %esi, %esi
je 0xc9f5
movapd 0x12a53(%rip), %xmm1    # 0x1f2e0
xorpd %xmm0, %xmm1
mulsd %xmm0, %xmm1
xorl %ecx, %ecx
mulsd %xmm0, %xmm0
xorl %r8d, %r8d
movq 0x10(%rdi), %r9
leal (%rsi,%r8), %eax
decl %eax
xorl %edx, %edx
divl %esi
leaq (%rdx,%rdx,2), %rdx
movl %r8d, %eax
leal 0x1(%r8), %r10d
cmpl %esi, %r10d
cmovel %ecx, %r10d
leaq (%rax,%rax,2), %r11
leaq (%r10,%r10,2), %r10
movsd (%r9,%r11,8), %xmm4
movsd 0x8(%r9,%r11,8), %xmm3
movsd 0x10(%r9,%r11,8), %xmm2
movsd (%r9,%rdx,8), %xmm5
unpcklpd %xmm4, %xmm5            # xmm5 = xmm5[0],xmm4[0]
movhpd (%r9,%r10,8), %xmm4     # xmm4 = xmm4[0],mem[0]
movsd 0x8(%r9,%rdx,8), %xmm6
movsd 0x10(%r9,%rdx,8), %xmm7
subpd %xmm5, %xmm4
unpcklpd %xmm3, %xmm6            # xmm6 = xmm6[0],xmm3[0]
movhpd 0x8(%r9,%r10,8), %xmm3  # xmm3 = xmm3[0],mem[0]
subpd %xmm6, %xmm3
unpcklpd %xmm2, %xmm7            # xmm7 = xmm7[0],xmm2[0]
movhpd 0x10(%r9,%r10,8), %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
jae 0xc989
movl %r8d, %edx
jmp 0xc9e8
decl %esi
movl %esi, 0x8(%rdi)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpl %esi, %r8d
jae 0xc9e8
leaq (,%rax,8), %rsi
leaq (%rsi,%rsi,2), %r8
movq 0x10(%rdi), %rsi
incq %rax
movsd 0x18(%rsi,%r8), %xmm2
movsd %xmm2, (%rsi,%r8)
movq 0x10(%rdi), %rsi
movsd 0x20(%rsi,%r8), %xmm2
movsd %xmm2, 0x8(%rsi,%r8)
movq 0x10(%rdi), %rsi
movsd 0x28(%rsi,%r8), %xmm2
movsd %xmm2, 0x10(%rsi,%r8)
movl 0x8(%rdi), %esi
addq $0x18, %r8
cmpq %rsi, %rax
jb 0xc9a4
incl %edx
movl %edx, %r8d
cmpl %esi, %edx
jb 0xc89e
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0xca62
movq (%r14), %rdi
testq %rdi, %rdi
je 0xd082
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x8(%rsp), %r14
testq %r14, %r14
je 0xd0bc
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0xd09a
callq 0x4410
movl 0x8(%r14), %eax
movl %eax, 0x8(%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
movq $0x0, 0x10(%r14)
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
jmp 0xd0d9
movl $0x0, 0x8(%rbx)
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0xd0d1
callq 0x4410
movq $0x0, 0x10(%rbx)
testq %r14, %r14
setne %al
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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), %ecx
testq %rcx, %rcx
je 0xd188
movq 0x10(%rdi), %rax
movsd (%rsi), %xmm2
movsd 0x8(%rsi), %xmm3
movsd 0x10(%rsi), %xmm4
movapd 0x121d2(%rip), %xmm5    # 0x1f2e0
xorpd %xmm1, %xmm5
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rdx
xorl %esi, %esi
xorl %ecx, %ecx
xorl %edi, %edi
movsd 0x8(%rax,%rsi), %xmm6
mulsd %xmm3, %xmm6
movsd (%rax,%rsi), %xmm7
mulsd %xmm2, %xmm7
addsd %xmm6, %xmm7
movsd 0x10(%rax,%rsi), %xmm6
mulsd %xmm4, %xmm6
addsd %xmm7, %xmm6
subsd %xmm0, %xmm6
ucomisd %xmm6, %xmm5
jbe 0xd159
movb $0x1, %cl
testb $0x1, %dil
je 0xd167
jmp 0xd18e
ucomisd %xmm1, %xmm6
jbe 0xd167
movb $0x1, %dil
testb $0x1, %cl
jne 0xd18e
addq $0x18, %rsi
cmpq %rsi, %rdx
jne 0xd120
notb %dil
movzbl %dil, %edx
andl $0x1, %edx
addl %edx, %edx
testb $0x1, %cl
movl $0x1, %eax
cmovel %edx, %eax
retq
movl $0x2, %eax
retq
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0xdaf9
incl %esi
movq %rbx, %rdi
callq 0xdb46
movl 0x8(%rbx), %esi
movsd (%r14), %xmm0
movq 0x10(%rbx), %rax
movl %esi, %ecx
leaq (%rcx,%rcx,2), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x8(%r14), %xmm0
movq 0x10(%rbx), %rax
movl 0x8(%rbx), %ecx
leaq (%rcx,%rcx,2), %rcx
movsd %xmm0, 0x8(%rax,%rcx,8)
movsd 0x10(%r14), %xmm0
movq 0x10(%rbx), %rax
movl 0x8(%rbx), %ecx
leaq (%rcx,%rcx,2), %rcx
movsd %xmm0, 0x10(%rax,%rcx,8)
incl 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
leaq (,%rbx,8), %rax
leaq (%rax,%rax,2), %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 0x4260
testq %r12, %r12
je 0xdb96
movq %r12, %rdi
callq 0x4410
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_O3/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 0xdc62
movl %edx, %ebp
cmpl 0x18(%rbx), %esi
jb 0xdbd3
incl %esi
movq %rbx, %rdi
callq 0xdb46
movl 0x8(%rbx), %esi
cmpl %ebp, %esi
jbe 0xdc22
movl %esi, %esi
movl %ebp, %eax
leaq (,%rsi,8), %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%rbx), %rdx
decq %rsi
movsd -0x18(%rdx,%rcx), %xmm0
movsd %xmm0, (%rdx,%rcx)
movq 0x10(%rbx), %rdx
movsd -0x10(%rdx,%rcx), %xmm0
movsd %xmm0, 0x8(%rdx,%rcx)
movq 0x10(%rbx), %rdx
movsd -0x8(%rdx,%rcx), %xmm0
movsd %xmm0, 0x10(%rdx,%rcx)
addq $-0x18, %rcx
cmpq %rax, %rsi
ja 0xdbe7
movsd (%r14), %xmm0
movq 0x10(%rbx), %rax
movl %esi, %ecx
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rcx
movsd %xmm0, (%rax,%rcx)
movsd 0x8(%r14), %xmm0
movq 0x10(%rbx), %rax
movsd %xmm0, 0x8(%rax,%rcx)
movsd 0x10(%r14), %xmm0
movq 0x10(%rbx), %rax
movsd %xmm0, 0x10(%rax,%rcx)
incl 0x8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0xdada
nop
// File: /workspace/github_cpp_makefile_star2_O3/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:
movsd (%rdi), %xmm0
movsd (%rsi), %xmm1
subsd %xmm1, %xmm0
movsd 0x8(%rdx), %xmm2
movupd 0x8(%rdi), %xmm3
movupd 0x8(%rsi), %xmm4
subpd %xmm4, %xmm3
movsd 0x10(%rdx), %xmm5
movhpd (%rdx), %xmm5           # xmm5 = xmm5[0],mem[0]
subsd %xmm4, %xmm2
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
unpckhpd %xmm5, %xmm5            # xmm5 = xmm5[1,1]
mulsd %xmm3, %xmm5
subsd %xmm5, %xmm0
movapd %xmm1, %xmm2
mulpd %xmm1, %xmm2
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
movapd %xmm1, %xmm3
mulsd %xmm1, %xmm3
addsd %xmm2, %xmm3
movapd %xmm0, %xmm2
mulsd %xmm0, %xmm2
addsd %xmm3, %xmm2
sqrtsd %xmm2, %xmm2
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movsd 0xdf4b(%rip), %xmm3     # 0x1c118
ucomisd %xmm2, %xmm3
ja 0xe1fe
subq $0x18, %rsp
movq %rdi, %rcx
divsd %xmm2, %xmm0
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
divpd %xmm2, %xmm1
movq %rsp, %rdi
movsd %xmm0, 0x10(%rdi)
movapd %xmm1, (%rdi)
movq %rcx, %rsi
callq 0xdd08
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0xdd08
movl %eax, %ebp
testl %r14d, %r14d
je 0xe243
leaq 0x30(%rbx), %rax
movq (%rax), %rax
testq %rax, %rax
je 0xe243
cmpl %ebp, 0x8(%rax)
jne 0xe234
jmp 0xe27b
movl $0x68, %edi
callq 0x4974
movl %ebp, 0x8(%rax)
movslq %ebp, %rcx
shlq $0x6, %rcx
leaq 0x20be6d2(%rip), %rdx   # 0x20cc930
addq %rcx, %rdx
movq %rdx, 0x10(%rax)
movq 0x30(%rbx), %rcx
movq %rcx, (%rax)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, 0x28(%rax)
movq %rax, 0x30(%rbx)
movl %ecx, 0x20(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
leaq (%rax,%rax,4), %r14
shlq $0x6, %r14
leaq 0x30bccc9(%rip), %r15   # 0x30cd5d0
movl 0x58(%r15,%r14), %ebp
cmpl $-0x13, %ebp
je 0x109a2
cmpl $-0x7, %ebp
je 0x109a2
leaq (%r15,%r14), %rbx
movq %rbx, %rdi
callq 0x10086
leaq 0x60(%rbx), %rsi
movq %rbx, %rdi
callq 0xfe77
orl $0x10, %ebp
cmpl $-0x10, %ebp
je 0x109a2
leaq 0x61bcce3(%rip), %rcx   # 0x61cd628
movl 0x1c(%rbx), %eax
cmpb $0x1, (%rcx)
jne 0x10953
testl %eax, %eax
jne 0x10997
jmp 0x109a2
testl %eax, %eax
je 0x109ad
addq %r15, %r14
addq $0x98, %r14
movq $-0x3, %r15
movl 0x1c(%rbx), %eax
leaq 0x4(%r15), %rsi
btl %esi, %eax
jae 0x10987
movq %rbx, %rdi
callq 0xef30
movq %rbx, %rdi
movq %r14, %rsi
callq 0xfe77
addq $0x38, %r14
incq %r15
jne 0x10968
movl $0xfffffffe, 0x58(%rbx) # imm = 0xFFFFFFFE
movq $0x0, 0x90(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x18(%rbx)
jne 0x109a2
addq %r15, %r14
addq $0x98, %r14
movq $-0x3, %r15
leal 0x4(%r15), %esi
movq %rbx, %rdi
callq 0xef30
movq %rbx, %rdi
movq %r14, %rsi
callq 0xfe77
addq $0x38, %r14
incq %r15
jne 0x109c4
jmp 0x109a2
// File: /workspace/github_cpp_makefile_star2_O3/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
movl $0x30, %edi
callq 0x4420
movq %rax, %r14
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa91d
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 0x4420
movq %rax, %r15
movq %rax, 0x8(%r14)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa91d
movq 0x8(%rbx), %rsi
movslq (%rbx), %rdx
shlq $0x6, %rdx
movq %r15, %rdi
callq 0x4260
movslq 0x10(%rbx), %rax
shlq $0x4, %rax
leaq (%rax,%rax,8), %rdi
callq 0x4420
movq %rax, %r12
movq %rax, 0x18(%r14)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa91d
movq 0x18(%rbx), %rsi
movslq 0x10(%rbx), %rax
shlq $0x4, %rax
leaq (%rax,%rax,8), %rdx
movq %r12, %rdi
callq 0x4260
movslq 0x20(%rbx), %rax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdi
callq 0x4420
movq %rax, %r12
movq %rax, 0x28(%r14)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa91d
movq 0x28(%rbx), %rsi
movslq 0x20(%rbx), %rax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdx
movq %r12, %rdi
callq 0x4260
cmpl $0x0, (%rbx)
jle 0x119c1
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x8(%rbx), %rbp
movslq 0x30(%rbp,%r12), %rax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdi
callq 0x4420
movq %rax, 0x38(%r15,%r12)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa91d
movq 0x38(%r15,%r12), %rdi
movq 0x38(%rbp,%r12), %rsi
movslq 0x30(%rbp,%r12), %rax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdx
callq 0x4260
incq %r13
movslq (%rbx), %rax
addq $0x40, %r12
cmpq %rax, %r13
jl 0x11968
movq %r14, %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/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
movl (%rbx), %ecx
testl %ecx, %ecx
jle 0x11a11
movq %rdi, %r14
movq 0x38(%r14), %rax
testq %rax, %rax
je 0x119fe
movq %rax, %rdi
callq 0x4390
movq 0x8(%rbx), %rdi
movl (%rbx), %ecx
addq $0x40, %r14
movslq %ecx, %rax
shlq $0x6, %rax
addq %rdi, %rax
cmpq %rax, %r14
jb 0x119e7
callq 0x4390
movq 0x18(%rbx), %rdi
callq 0x4390
movq 0x28(%rbx), %rdi
callq 0x4390
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4390
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
movl $0x10, %r14d
leaq 0x30baef7(%rip), %r15   # 0x30cc940
leaq 0xc259(%rip), %rbx      # 0x1dca9
movq %rbx, %rdi
callq 0x45a0
movq %rax, -0x10(%r14,%r15)
movb $0x1, -0x8(%r14,%r15)
movl $0x0, -0x4(%r14,%r15)
xorl %edi, %edi
callq 0x4420
movq %rax, (%r14,%r15)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa91d
addq $0x18, %r14
cmpq $0x70, %r14
jne 0x11a50
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
pushq %rax
movq 0x30(%rdi), %r15
testq %r15, %r15
je 0x12326
leaq 0xd9b5(%rip), %rbx      # 0x1fc9e
leaq 0xb9b8(%rip), %r14      # 0x1dca8
xorl %edx, %edx
leal 0x1(%rdx), %ebp
movl $0x6, %edi
movq %rbx, %rsi
xorl %eax, %eax
callq 0xa676
movq 0x18(%r15), %rdi
callq 0xb8dc
movl $0x6, %edi
movq %r14, %rsi
xorl %eax, %eax
callq 0xa676
movq (%r15), %r15
movl %ebp, %edx
testq %r15, %r15
jne 0x122f2
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x30baea1(%rip), %eax   # 0x30cd5c0
je 0x12735
leaq 0xd758(%rip), %rdi      # 0x1fe80
xorl %eax, %eax
callq 0xa164
movl 0x30bae8b(%rip), %eax   # 0x30cd5c0
cltq
leaq (%rax,%rax,4), %r12
shlq $0x6, %r12
leaq 0x30bae8a(%rip), %r13   # 0x30cd5d0
leaq (%r12,%r13), %r14
leal 0x1(%rax), %ecx
movl %ecx, 0x30bae6d(%rip)   # 0x30cd5c0
xorl %edi, %edi
cmpl $0x8000, %eax           # imm = 0x8000
setl %dil
movl $0x28, %esi
callq 0xa91d
movl $0x140, %edx            # imm = 0x140
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4260
movl 0x3abae52(%rip), %eax   # 0x3acd5d0
movl %eax, 0x10(%r12,%r13)
addl 0x14(%rbx), %eax
movl %eax, 0x3abae44(%rip)   # 0x3acd5d0
xorl %edi, %edi
cmpl $0x30001, %eax          # imm = 0x30001
setl %dil
movl $0x27, %esi
callq 0xa91d
movslq 0x10(%r12,%r13), %rax
imulq $0xd0, %rax, %rdi
leaq 0x3abae2c(%rip), %rax   # 0x3acd5e0
addq %rax, %rdi
movslq 0x10(%rbx), %rcx
imulq $0xd0, %rcx, %rsi
addq %rax, %rsi
movslq 0x14(%rbx), %rax
imulq $0xd0, %rax, %rdx
callq 0x4260
movq %r15, %rax
subq 0x157f9(%rip), %rax     # 0x27fd8
shrq $0x3, %rax
imull $0xcccccccd, %eax, %eax # imm = 0xCCCCCCCD
movl %eax, 0x8(%r12,%r13)
movl 0x1c(%r15), %eax
movl %eax, 0xc(%r12,%r13)
incl %eax
movl %eax, 0x1c(%r15)
xorl %r15d, %r15d
movq 0x38(%rbx,%r15,8), %rdi
testq %rdi, %rdi
je 0x12811
callq 0x45a0
jmp 0x12813
xorl %eax, %eax
movq %rax, 0x38(%r14,%r15,8)
incq %r15
cmpq $0x4, %r15
jne 0x12800
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
xorl %ecx, %ecx
xorpd %xmm3, %xmm3
leaq 0xda84(%rip), %rdi      # 0x20490
xorl %eax, %eax
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
cmpq $0x6, %rcx
jne 0x12a0e
leal (%rax,%rax,2), %ecx
incl %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq 0xda21(%rip), %rdi      # 0x20480
movups (%rdi,%rcx,8), %xmm0
movups %xmm0, (%rsi)
movsd 0x10(%rdi,%rcx,8), %xmm0
movsd %xmm0, 0x10(%rsi)
leal 0x2(%rax,%rax,2), %eax
cltq
leaq (%rax,%rax,2), %rax
movups (%rdi,%rax,8), %xmm0
movups %xmm0, (%rdx)
movsd 0x10(%rdi,%rax,8), %xmm0
movsd %xmm0, 0x10(%rdx)
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
leaq 0x200aa62(%rip), %r13   # 0x201f444
cmpl $0x0, (%r13)
je 0x14aa2
leaq 0x200aa5c(%rip), %rbx   # 0x201f450
xorl %r15d, %r15d
leaq 0x7c04(%rip), %r14      # 0x1c602
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7542
testq %rax, %rax
je 0x14a8d
movq %rax, %r12
movl $0x5, %edx
movq %rax, %rdi
leaq 0x7ca4(%rip), %rsi      # 0x1c6c6
callq 0x4400
testl %eax, %eax
je 0x14a5b
movl $0xa, %edx
movq %r12, %rdi
leaq 0x7d21(%rip), %rsi      # 0x1c75b
callq 0x4400
testl %eax, %eax
je 0x14a5b
movl $0x11, %edx
movq %r12, %rdi
leaq 0x7c5a(%rip), %rsi      # 0x1c6ac
callq 0x4400
testl %eax, %eax
jne 0x14a8d
movq %rbx, %rdi
leaq 0xc309(%rip), %rsi      # 0x20d6e
callq 0x7542
movq %rax, %r12
movq %rbx, %rdi
leaq 0x7cd9(%rip), %rsi      # 0x1c750
callq 0x7542
cmpb $0x0, (%rax)
jne 0x14a8d
movq %r12, %rdi
callq 0x44f0
testl %eax, %eax
je 0x14a8f
incl %ebp
incl %r15d
addq $0x28, %rbx
cmpl (%r13), %r15d
jb 0x14a00
jmp 0x14aa4
xorl %ebp, %ebp
movl %ebp, %eax
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/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
testq %rdi, %rdi
je 0x14e39
movq %rdi, %r14
callq 0x999b
testb %al, %al
je 0x14d27
leaq 0xb947(%rip), %rdi      # 0x20630
movq %r14, %rsi
xorl %eax, %eax
callq 0x9e76
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x45b0
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movl 0x40(%rsp,%rcx), %ecx
testb $0x5, %cl
je 0x14d49
leaq 0x20(%rsp), %rdi
callq 0x40d0
jmp 0x14e2f
leaq 0xb926(%rip), %rdi      # 0x20654
movq %r14, %rsi
xorl %eax, %eax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa164
testb $0x2, %cl
jne 0x14e25
addq $-0x18, %rax
leaq 0x10(%rsp), %rbp
movq %rsp, %r14
leaq 0x61b888b(%rip), %r15   # 0x61cd5f0
movq %rbp, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq (%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x45d0
movq (%rsp), %rdi
callq 0x45a0
movq %rax, %r12
movzbl (%rax), %ecx
cmpl $0xa, %ecx
je 0x14db4
cmpl $0xd, %ecx
je 0x14db4
testl %ecx, %ecx
jne 0x14db7
jmp 0x14dbc
movb $0x0, (%rax)
incq %rax
jmp 0x14da1
movq 0x8(%rsp), %r13
movq %r12, %rdi
callq 0x4180
movq %r14, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r12, %rcx
movq %rax, %r8
callq 0x44e0
movq %r12, %rdi
callq 0x4390
cmpq $0x0, 0x8(%rsp)
je 0x14df7
movq %r15, %rdi
movq %r14, %rsi
callq 0x14efe
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x14e0d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4310
movq 0x20(%rsp), %rax
movq -0x18(%rax), %rcx
addq $-0x18, %rax
testb $0x2, 0x40(%rsp,%rcx)
je 0x14d65
leaq 0x20(%rsp), %rdi
callq 0x40d0
leaq 0x20(%rsp), %rdi
callq 0x4100
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x14e4d
movq %rax, %rbx
jmp 0x14e6d
jmp 0x14e54
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x14e6d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4310
leaq 0x20(%rsp), %rdi
callq 0x4100
movq %rbx, %rdi
callq 0x4560
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
movl $0x68, %edi
callq 0x4974
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_O3/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 0xb551
movslq %ebp, %r12
leaq 0x61b7e48(%rip), %r13   # 0x61cd6b0
movq (%r13,%r12,8), %rcx
leaq 0xb0ab(%rip), %rdi      # 0x2091f
movl $0x2, %esi
movl $0x1, %edx
callq 0x4610
testq %rbx, %rbx
je 0x15900
leaq 0xb06a(%rip), %r15      # 0x208f9
movq 0x18(%rbx), %rbp
movq (%r13,%r12,8), %rdi
movq %rbx, (%rsp)
movl 0x8(%rbx), %edx
movl 0x8(%rbp), %ecx
leaq 0xb049(%rip), %rsi      # 0x208f2
xorl %eax, %eax
callq 0x4460
cmpl $0x0, 0x8(%rbp)
je 0x158f4
movl $0x10, %r14d
xorl %ebx, %ebx
movq (%r13,%r12,8), %rdi
movq 0x10(%rbp), %rax
movsd -0x10(%rax,%r14), %xmm0
movsd -0x8(%rax,%r14), %xmm1
movsd (%rax,%r14), %xmm2
movq %r15, %rsi
movb $0x3, %al
callq 0x4460
incq %rbx
movl 0x8(%rbp), %eax
addq $0x18, %r14
cmpq %rax, %rbx
jb 0x158be
movq (%rsp), %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x1588f
movq (%r13,%r12,8), %rcx
leaq 0xc238(%rip), %rdi      # 0x21b44
movl $0x6, %esi
movl $0x1, %edx
callq 0x4610
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb562
// File: /workspace/github_cpp_makefile_star2_O3/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
movl $0x68, %edi
callq 0x4974
movq %rax, %r14
movl 0x28(%rbx), %eax
movl %eax, 0x28(%r14)
movl 0x20(%rbx), %eax
movl %eax, 0x20(%r14)
movl 0x8(%rbx), %eax
movl %eax, 0x8(%r14)
movq 0x10(%rbx), %rax
movq %rax, 0x10(%r14)
movl 0x2c(%rbx), %eax
movl %eax, 0x2c(%r14)
movq 0x18(%rbx), %rdi
callq 0xbe46
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_O3/FreeSlave[P]vhlt/hlcsg/qcsg.cpp
// Function: CopyFaceList(bface_s*)
bface_t*        CopyFaceList(bface_t* f)
{
    bface_t*        head;
    bface_t*        n;

    if (f)
    {
        head = CopyFace(f);
        n = head;
        f = f->next;

        while (f)
        {
            n->next = CopyFace(f);

            n = n->next;
            f = f->next;
        }

        return head;
    }
    else
    {
        return NULL;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x159d1
movq %rdi, %r14
callq 0x1592e
movq %rax, %rbx
movq (%r14), %r14
testq %r14, %r14
je 0x159d3
movq %rbx, %r15
movq %r14, %rdi
callq 0x1592e
movq %rax, (%r15)
movq (%r14), %r14
movq %rax, %r15
testq %r14, %r14
jne 0x159b9
jmp 0x159d3
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x15a0a
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x159f2
callq 0x159dc
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x15a01
movq (%rdi), %rax
callq *0x8(%rax)
movq %rbx, %rdi
popq %rbx
jmp 0x4979
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
subq $0x30, %rsp
leaq 0x81b8c8(%rip), %rax    # 0x8314c4
movl (%rax), %esi
leaq 0x81b8cb(%rip), %rdi    # 0x8314d0
callq 0xae8b
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movq $0x0, 0x20(%rsp)
movl $0x1, %edi
callq 0xaf93
testb %al, %al
je 0x15c84
leaq 0x20ad86c(%rip), %r14   # 0x20c34a0
cmpw $0x7b, (%r14)
je 0x15c49
leaq 0x695e(%rip), %rdi      # 0x1c5a0
xorl %eax, %eax
callq 0xa164
leaq 0x698b(%rip), %rbx      # 0x1c5db
xorl %r15d, %r15d
movl $0x1, %edi
callq 0xaf93
testb %al, %al
jne 0x15c6b
movq %rbx, %rdi
xorl %eax, %eax
callq 0xa164
cmpw $0x7d, (%r14)
je 0x15c95
callq 0x7093
movq %r15, (%rax)
movq %rax, 0x20(%rsp)
movq %rax, %r15
jmp 0x15c53
leaq 0x801e(%rip), %rdi      # 0x1dca9
callq 0x45a0
movq %rax, %rbx
jmp 0x15ce0
leaq 0xacea(%rip), %rsi      # 0x20986
movq %rsp, %r14
movq %r14, %rdi
callq 0x7542
movq %rax, %rdi
callq 0x45a0
movq %rax, %rbx
movq 0x20(%r14), %r14
testq %r14, %r14
je 0x15ce0
movq (%r14), %r15
movq 0x8(%r14), %rdi
callq 0x4390
movq 0x10(%r14), %rdi
callq 0x4390
movq %r14, %rdi
callq 0x4390
movq %r15, %r14
testq %r15, %r15
jne 0x15cbb
cmpb $0x0, (%rbx)
je 0x15cf8
leaq 0x6744(%rip), %rdi      # 0x1c430
movq %rbx, %rsi
xorl %eax, %eax
callq 0x9e76
jmp 0x15d06
leaq 0x66b3(%rip), %rdi      # 0x1c3b2
xorl %eax, %eax
callq 0x9e76
leaq 0x2009743(%rip), %rdi   # 0x201f450
leaq 0xac72(%rip), %rsi      # 0x20986
movq %rbx, %rdx
callq 0x757d
movq %rbx, %rdi
callq 0x4390
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x668b(%rip), %xmm0     # 0x1f4f8
movsd (%rdi), %xmm1
movb $0x1, %al
ucomisd %xmm0, %xmm1
ja 0x18ee6
movsd 0x8(%rdi), %xmm0
movsd 0x20(%rsi), %xmm1
addsd 0x666d(%rip), %xmm1     # 0x1f4f8
ucomisd %xmm1, %xmm0
ja 0x18ee6
movsd 0x10(%rdi), %xmm0
movsd 0x28(%rsi), %xmm1
addsd 0x6655(%rip), %xmm1     # 0x1f4f8
ucomisd %xmm1, %xmm0
ja 0x18ee6
movsd (%rsi), %xmm0
addsd 0x784b(%rip), %xmm0     # 0x20700
ucomisd 0x18(%rdi), %xmm0
ja 0x18ee6
movsd 0x8(%rsi), %xmm0
addsd 0x7837(%rip), %xmm0     # 0x20700
ucomisd 0x20(%rdi), %xmm0
ja 0x18ee6
movsd 0x10(%rsi), %xmm0
addsd 0x7823(%rip), %xmm0     # 0x20700
ucomisd 0x28(%rdi), %xmm0
ja 0x18ee6
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x18, %rsp
movslq 0x61b4575(%rip), %r15   # 0x61cdf5c
testq %r15, %r15
jle 0x19aae
xorl %r12d, %r12d
movq %rsp, %rbx
leaq (%r12,%r12,8), %rax
leaq 0x61b455f(%rip), %rcx   # 0x61cdf60
movzbl 0x10(%rcx,%rax,4), %ecx
cmpl $0x2d, %ecx
je 0x19a10
cmpl $0x2b, %ecx
jne 0x19a86
leaq 0x61b4549(%rip), %rcx   # 0x61cdf60
leaq (%rcx,%rax,4), %rsi
addq $0x10, %rsi
movl $0x10, %edx
movq %rbx, %rdi
callq 0x8ae9
xorl %ebp, %ebp
leal 0x37(%rbp), %eax
movl %ebp, %ecx
orb $0x30, %cl
cmpl $0xa, %ebp
movzbl %cl, %ecx
movzbl %al, %eax
cmovbl %ecx, %eax
movb %al, 0x1(%rsp)
movslq 0x61b450b(%rip), %r13   # 0x61cdf58
testq %r13, %r13
jle 0x19a7f
movq 0x61b44f7(%rip), %r14   # 0x61cdf50
addq $0x10, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4440
testl %eax, %eax
je 0x19a77
addq $0x24, %r14
decq %r13
jne 0x19a5d
jmp 0x19a7f
movq %rbx, %rdi
callq 0x19abd
incl %ebp
cmpl $0x14, %ebp
jne 0x19a2e
incq %r12
cmpq %r15, %r12
jne 0x199f6
movl 0x61b44c4(%rip), %esi   # 0x61cdf5c
cmpl %r15d, %esi
je 0x19aae
subl %r15d, %esi
leaq 0x83af(%rip), %rdi      # 0x21e56
xorl %eax, %eax
callq 0x9e76
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/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x4180
cmpq $0x10, %rax
jb 0x19ae4
leaq 0x84fb(%rip), %rdi      # 0x21fd5
movq %rbx, %rsi
xorl %eax, %eax
callq 0xa164
callq 0xb551
movslq 0x61b446c(%rip), %r12   # 0x61cdf5c
testq %r12, %r12
jle 0x19b1f
leaq 0x61b4474(%rip), %r15   # 0x61cdf70
xorl %r14d, %r14d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4440
testl %eax, %eax
je 0x19b62
incq %r14
addq $0x24, %r15
cmpq %r14, %r12
jne 0x19aff
movl %r12d, %r14d
jmp 0x19b22
xorl %r14d, %r14d
xorl %edi, %edi
cmpl $0x1000, %r12d          # imm = 0x1000
setl %dil
movl $0x24, %esi
callq 0xa91d
movl %r14d, %eax
leaq (%rax,%rax,8), %rax
leaq 0x61b4419(%rip), %rcx   # 0x61cdf60
leaq (%rcx,%rax,4), %rdi
addq $0x10, %rdi
movl $0x10, %edx
movq %rbx, %rsi
callq 0x8ae9
incl 0x61b43fa(%rip)         # 0x61cdf5c
callq 0xb562
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlcsg/textures.cpp
// Function: GetTextureByNumber_CSG(int)
const char *GetTextureByNumber_CSG(int texturenumber)
{
	if (texturenumber == -1)
		return "";
#ifdef HLCSG_TEXMAP64_FIX
	return texmap_retrieve (g_texinfo[texturenumber].miptex);
#else
	return texmap64_retrieve (g_texinfo[texturenumber].miptex);
#endif
}

// Assembly:
cmpl $-0x1, %edi
je 0x1a900
pushq %rbx
movslq %edi, %rax
leaq (%rax,%rax,4), %rax
leaq 0x1176b3e(%rip), %rcx   # 0x1191410
movl 0x20(%rcx,%rax,8), %ebx
testl %ebx, %ebx
setns %al
cmpl %ebx, 0x61d767f(%rip)   # 0x61f1f60
setg %cl
andb %al, %cl
movzbl %cl, %edi
xorl %esi, %esi
callq 0xa91d
movslq %ebx, %rax
leaq 0x61d7676(%rip), %rcx   # 0x61f1f70
movq (%rcx,%rax,8), %rax
popq %rbx
retq
leaq 0x33a2(%rip), %rax      # 0x1dca9
retq