LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/qrad.cpp
// Function: ReadCustomSmoothValue()
void ReadCustomSmoothValue()
{
	int num;
	int i, k;
	entity_t *mapent;
	epair_t *ep;

	num = ((dmiptexlump_t *)g_dtexdata)->nummiptex;
	g_smoothvalues = (vec_t *)malloc (num * sizeof(vec_t));
	for (i = 0; i < num; i++)
	{
		g_smoothvalues[i] = g_smoothing_threshold;
	}
	for (k = 0; k < g_numentities; k++)
	{
		mapent = &g_entities[k];
		if (strcmp(ValueForKey(mapent, "classname"), "info_smoothvalue"))
			continue;
		Developer (DEVELOPER_LEVEL_MESSAGE, "info_smoothvalue entity detected.\n");
		for (i = 0; i < num; i++)
		{
			const char *texname = ((miptex_t*)(g_dtexdata+((dmiptexlump_t*)g_dtexdata)->dataofs[i]))->name;
			for (ep = mapent->epairs; ep; ep = ep->next)
			{
				if (strcasecmp (ep->key, texname))
					continue;
				if (!strcasecmp (ep->key, "origin"))
					continue;
				g_smoothvalues[i] = cos(atof (ep->value) * (Q_PI / 180.0));
				Developer (DEVELOPER_LEVEL_MESSAGE, "info_smoothvalue: %s = %f\n", texname, atof (ep->value));
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x8293b9(%rip), %rax    # 0x851498
movq (%rax), %rax
movslq (%rax), %r13
leaq (,%r13,4), %rdi
callq 0x4410
movq %rax, 0x5512a87(%rip)   # 0x553ab80
testq %r13, %r13
jle 0x2811c
xorl %eax, %eax
movss 0x54d28fc(%rip), %xmm0  # 0x54faa04
movq 0x5512a71(%rip), %rcx   # 0x553ab80
movss %xmm0, (%rcx,%rax,4)
incq %rax
cmpq %rax, %r13
jne 0x28100
leaq 0x2017301(%rip), %rax   # 0x203f424
cmpl $0x0, (%rax)
jle 0x2824b
leaq 0x174fd(%rip), %r12     # 0x3f630
xorl %ecx, %ecx
movq %rcx, 0x8(%rsp)
movq %rcx, %rdi
shlq $0x5, %rdi
addq 0x1fe80(%rip), %rdi     # 0x47fc8
movq %rdi, 0x10(%rsp)
leaq 0x104b7(%rip), %rsi     # 0x3860b
callq 0x7571
movq %rax, %rdi
leaq 0x150d4(%rip), %rsi     # 0x3d237
callq 0x4440
testl %eax, %eax
jne 0x28230
movl $0x3, %edi
leaq 0x150cc(%rip), %rsi     # 0x3d248
xorl %eax, %eax
callq 0xa52e
testl %r13d, %r13d
jle 0x28230
xorl %r14d, %r14d
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rbp
testq %rbp, %rbp
je 0x28224
leaq 0x8292f0(%rip), %rax    # 0x851498
movq (%rax), %rax
movslq 0x4(%rax,%r14,4), %r15
addq %rax, %r15
movq 0x8(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4320
testl %eax, %eax
jne 0x2821b
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4320
testl %eax, %eax
je 0x2821b
movq 0x10(%rbp), %rdi
callq 0x43c0
mulsd 0x134a2(%rip), %xmm0    # 0x3b688
callq 0x4600
cvtsd2ss %xmm0, %xmm0
movq 0x551298a(%rip), %rax   # 0x553ab80
movss %xmm0, (%rax,%r14,4)
movq 0x10(%rbp), %rdi
callq 0x43c0
movl $0x3, %edi
leaq 0x1505a(%rip), %rsi     # 0x3d26b
movq %r15, %rdx
movb $0x1, %al
callq 0xa52e
movq (%rbp), %rbp
testq %rbp, %rbp
jne 0x281b3
incq %r14
cmpq %r13, %r14
jne 0x2818f
movq 0x8(%rsp), %rcx
incq %rcx
leaq 0x20171e5(%rip), %rax   # 0x203f424
movslq (%rax), %rax
cmpq %rax, %rcx
jl 0x28135
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/qrad.cpp
// Function: MakeParents(int, int)
static void     MakeParents(const int nodenum, const int parent)
{
    int             i;
    int             j;
    dnode_t*        node;

    nodeparents[nodenum] = parent;
    node = g_dnodes + nodenum;

    for (i = 0; i < 2; i++)
    {
        j = node->children[i];
        if (j < 0)
        {
            leafparents[-j - 1] = nodenum;
        }
        else
        {
            MakeParents(j, nodenum);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
movl %edi, %eax
leaq 0x54ec5e8(%rip), %rcx   # 0x551ab50
movl %esi, (%rcx,%rax,4)
leaq (%rax,%rax,2), %rax
leaq 0x10c2e8a(%rip), %rcx   # 0x10f1400
leaq (%rcx,%rax,8), %r14
addq $0x4, %r14
xorl %r15d, %r15d
leaq 0x54cc5e8(%rip), %r12   # 0x54fab70
movswl (%r14,%r15,2), %edi
testl %edi, %edi
js 0x2e59a
movl %ebx, %esi
callq 0x2e555
jmp 0x2e5a0
notl %edi
movl %ebx, (%r12,%rdi,4)
incq %r15
cmpq $0x1, %r15
je 0x2e588
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/qrad.cpp
// Function: UpdateEmitterInfo(patch_s*)
static void		UpdateEmitterInfo (patch_t *patch)
{
#if ACCURATEBOUNCE_DEFAULT_SKYLEVEL + 3 > SKYLEVELMAX
#error "please raise SKYLEVELMAX"
#endif
	const vec_t *origin = patch->origin;
	const Winding *winding = patch->winding;
	vec_t radius = ON_EPSILON;
	for (int x = 0; x < winding->m_NumPoints; x++)
	{
		vec3_t delta;
		vec_t dist;
		VectorSubtract (winding->m_Points[x], origin, delta);
		dist = VectorLength (delta);
		if (dist > radius)
		{
			radius = dist;
		}
	}
	int skylevel = ACCURATEBOUNCE_DEFAULT_SKYLEVEL;
	vec_t area = winding->getArea ();
	vec_t size = 0.8f;
	if (area < size * radius * radius) // the shape is too thin
	{
		skylevel++;
		size *= 0.25f;
		if (area < size * radius * radius)
		{
			skylevel++;
			size *= 0.25f;
			if (area < size * radius * radius)
			{
				// stop here
				radius = sqrt (area / size);
				// just decrease the range to limit the use of the new method. because when the area is small, the new method becomes randomized and unstable.
			}
		}
	}
	patch->emitter_range = ACCURATEBOUNCE_THRESHOLD * radius;
	if (g_noemitterrange)
	{
		patch->emitter_range = 0.0;
	}
	patch->emitter_skylevel = skylevel;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x28(%rdi), %r14
cmpl $0x0, 0x8(%r14)
je 0x2eda4
movss 0xcd67(%rip), %xmm4     # 0x3ba84
movl $0x8, %r15d
xorl %r12d, %r12d
xorpd %xmm3, %xmm3
movq 0x10(%r14), %rax
movss (%rax,%r15), %xmm0
subss 0x10(%rbx), %xmm0
movsd -0x8(%rax,%r15), %xmm1
movsd 0x8(%rbx), %xmm2
subps %xmm2, %xmm1
mulps %xmm1, %xmm1
cvtps2pd %xmm1, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
mulss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
addsd %xmm2, %xmm0
ucomisd %xmm3, %xmm0
jb 0x2ed72
sqrtsd %xmm0, %xmm0
jmp 0x2ed87
movss %xmm4, 0xc(%rsp)
callq 0x4240
movss 0xc(%rsp), %xmm4
xorpd %xmm3, %xmm3
cvtsd2ss %xmm0, %xmm0
maxss %xmm4, %xmm0
incq %r12
movl 0x8(%r14), %eax
addq $0xc, %r15
movaps %xmm0, %xmm4
cmpq %rax, %r12
jb 0x2ed2a
jmp 0x2edac
movss 0xccd8(%rip), %xmm0     # 0x3ba84
movss %xmm0, 0xc(%rsp)
movq %r14, %rdi
callq 0xbab6
movss 0xc(%rsp), %xmm2
movss 0xc900(%rip), %xmm1     # 0x3b6c8
mulss %xmm2, %xmm1
mulss %xmm2, %xmm1
movl $0x5, %ebp
ucomiss %xmm0, %xmm1
jbe 0x2ee2f
movss 0xccce(%rip), %xmm1     # 0x3bab0
mulss %xmm2, %xmm1
mulss %xmm2, %xmm1
movl $0x6, %ebp
ucomiss %xmm0, %xmm1
jbe 0x2ee2f
movss 0xdea4(%rip), %xmm1     # 0x3cca0
mulss %xmm2, %xmm1
mulss %xmm2, %xmm1
movl $0x7, %ebp
ucomiss %xmm0, %xmm1
jbe 0x2ee2f
divss 0xde8a(%rip), %xmm0     # 0x3cca0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x2ee27
xorps %xmm2, %xmm2
sqrtss %xmm0, %xmm2
jmp 0x2ee2f
callq 0x45c0
movaps %xmm0, %xmm2
mulss 0xddc1(%rip), %xmm2     # 0x3cbf8
movss %xmm2, 0x1c(%rbx)
cmpb $0x0, 0x54cbd25(%rip)   # 0x54fab68
xorps %xmm0, %xmm0
jne 0x2ee4b
movaps %xmm2, %xmm0
movss %xmm0, 0x1c(%rbx)
movl %ebp, 0x20(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/qradutil.cpp
// Function: PointInLeaf_Worst_r(int, float const*)
dleaf_t*		PointInLeaf_Worst_r(int nodenum, const vec3_t point)
{
	vec_t			dist;
	dnode_t*		node;
	dplane_t*		plane;

	while (nodenum >= 0)
	{
		node = &g_dnodes[nodenum];
		plane = &g_dplanes[node->planenum];
		dist = DotProduct(point, plane->normal) - plane->dist;
		if (dist > HUNT_WALL_EPSILON)
		{
			nodenum = node->children[0];
		}
		else if (dist < -HUNT_WALL_EPSILON)
		{
			nodenum = node->children[1];
		}
		else
		{
			dleaf_t* result[2];
			result[0] = PointInLeaf_Worst_r(node->children[0], point);
			result[1] = PointInLeaf_Worst_r(node->children[1], point);
			if (result[0] == g_dleafs || result[0]->contents == CONTENTS_SOLID)
				return result[0];
			if (result[1] == g_dleafs || result[1]->contents == CONTENTS_SOLID)
				return result[1];
			if (result[0]->contents == CONTENTS_SKY)
				return result[0];
			if (result[1]->contents == CONTENTS_SKY)
				return result[1];
#ifdef HLRAD_WATERBLOCKLIGHT
			if (result[0]->contents == result[1]->contents)
				return result[0];
			return g_dleafs;
#else
			return result[0];
#endif
		}
	}

	return &g_dleafs[-nodenum - 1];
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testl %edi, %edi
js 0x301af
movq %rsi, %rbx
movss (%rsi), %xmm0
movss 0x4(%rsi), %xmm1
movss 0x8(%rsi), %xmm2
leaq 0x10c12c7(%rip), %rax   # 0x10f1400
leaq 0xb012b0(%rip), %rcx    # 0xb313f0
movsd 0xf7e0(%rip), %xmm3     # 0x3f928
movsd 0xf7e0(%rip), %xmm4     # 0x3f930
movl %edi, %edx
leaq (%rdx,%rdx,2), %rdx
leaq (%rax,%rdx,8), %r15
movslq (%r15), %rdx
leaq (%rdx,%rdx,4), %rdx
movss 0x4(%rcx,%rdx,4), %xmm5
mulss %xmm1, %xmm5
movss (%rcx,%rdx,4), %xmm6
mulss %xmm0, %xmm6
addss %xmm5, %xmm6
movss 0x8(%rcx,%rdx,4), %xmm5
mulss %xmm2, %xmm5
addss %xmm6, %xmm5
subss 0xc(%rcx,%rdx,4), %xmm5
cvtss2sd %xmm5, %xmm5
movl $0x4, %edx
ucomisd %xmm3, %xmm5
ja 0x301a6
movl $0x6, %edx
ucomisd %xmm5, %xmm4
jbe 0x301c9
movswl (%r15,%rdx), %edi
testl %edi, %edi
jns 0x30150
notl %edi
leaq (%rdi,%rdi,8), %rax
leaq (%rax,%rax,2), %rax
addq %rdi, %rax
addq 0x17d95(%rip), %rax     # 0x47f58
popq %rbx
popq %r14
popq %r15
retq
movswl 0x4(%r15), %edi
movq %rbx, %rsi
callq 0x30114
movq %rax, %r14
movswl 0x6(%r15), %edi
movq %rbx, %rsi
callq 0x30114
cmpq 0x17d6b(%rip), %r14     # 0x47f58
je 0x301f7
movl (%r14), %ecx
cmpl $-0x2, %ecx
jne 0x301fc
movq %r14, %rax
jmp 0x301c3
cmpq 0x17d55(%rip), %rax     # 0x47f58
je 0x301c3
movl (%rax), %edx
cmpl $-0x2, %edx
je 0x301c3
cmpl $-0x6, %ecx
je 0x301f7
cmpl $-0x6, %edx
je 0x301c3
cmpl %edx, %ecx
je 0x301f7
leaq 0xa2129f(%rip), %r14    # 0xa514c0
jmp 0x301f7
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/qradutil.cpp
// Function: PointInLeaf(float const*)
dleaf_t*        PointInLeaf(const vec3_t point)
{
    int             nodenum;
    vec_t           dist;
    dnode_t*        node;
    dplane_t*       plane;

    nodenum = 0;
    while (nodenum >= 0)
    {
        node = &g_dnodes[nodenum];
        plane = &g_dplanes[node->planenum];
        dist = DotProduct(point, plane->normal) - plane->dist;
        if (dist >= 0.0)
        {
            nodenum = node->children[0];
        }
        else
        {
            nodenum = node->children[1];
        }
    }

    return &g_dleafs[-nodenum - 1];
}

// Assembly:
movss (%rdi), %xmm0
movss 0x4(%rdi), %xmm1
movss 0x8(%rdi), %xmm2
xorl %edx, %edx
leaq 0x10c11bc(%rip), %rax   # 0x10f1400
leaq 0xb011a5(%rip), %rcx    # 0xb313f0
xorps %xmm3, %xmm3
movl %edx, %edx
leaq (%rdx,%rdx,2), %rdx
leaq (%rax,%rdx,8), %rdx
movslq (%rdx), %rsi
leaq (%rsi,%rsi,4), %rsi
movss 0x4(%rcx,%rsi,4), %xmm4
mulss %xmm1, %xmm4
movss (%rcx,%rsi,4), %xmm5
mulss %xmm0, %xmm5
addss %xmm4, %xmm5
movss 0x8(%rcx,%rsi,4), %xmm4
mulss %xmm2, %xmm4
addss %xmm5, %xmm4
subss 0xc(%rcx,%rsi,4), %xmm4
xorl %esi, %esi
ucomiss %xmm3, %xmm4
setb %sil
movswl 0x4(%rdx,%rsi,2), %edx
testl %edx, %edx
jns 0x3024e
notl %edx
leaq (%rdx,%rdx,8), %rax
leaq (%rax,%rax,2), %rax
addq %rdx, %rax
addq 0x17ca8(%rip), %rax     # 0x47f58
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/qradutil.cpp
// Function: getPlaneFromFaceNumber(unsigned int)
const dplane_t* getPlaneFromFaceNumber(const unsigned int faceNumber)
{
    dface_t*        face = &g_dfaces[faceNumber];

    if (face->side)
    {
        return &backplanes[face->planenum];
    }
    else
    {
        return &g_dplanes[face->planenum];
    }
}

// Assembly:
movl %edi, %eax
leaq (%rax,%rax,4), %rax
leaq 0x1b810d5(%rip), %rcx   # 0x1bb1400
cmpw $0x0, 0x2(%rcx,%rax,4)
movzwl (%rcx,%rax,4), %eax
leaq (%rax,%rax,4), %rax
jne 0x30344
leaq 0xb010ae(%rip), %rcx    # 0xb313f0
jmp 0x3034b
leaq 0x552a885(%rip), %rcx   # 0x555abd0
leaq (%rcx,%rax,4), %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/qradutil.cpp
// Function: MakeBackplanes()
void            MakeBackplanes()
{
    int             i;

    for (i = 0; i < g_numplanes; i++)
    {
        backplanes[i].dist = -g_dplanes[i].dist;
        VectorSubtract(vec3_origin, g_dplanes[i].normal, backplanes[i].normal);
    }
}

// Assembly:
leaq 0xb0108d(%rip), %rax    # 0xb313e4
movslq (%rax), %rax
testq %rax, %rax
jle 0x303c4
leaq 0x9a6a(%rip), %rcx      # 0x39dd0
movsd (%rcx), %xmm0
movss 0x8(%rcx), %xmm1
shlq $0x2, %rax
leaq (%rax,%rax,4), %rax
xorl %ecx, %ecx
leaq 0xb01070(%rip), %rdx    # 0xb313f0
movaps 0x7d09(%rip), %xmm2     # 0x38090
leaq 0x552a842(%rip), %rsi   # 0x555abd0
movss 0xc(%rdx,%rcx), %xmm3
xorps %xmm2, %xmm3
movss %xmm3, 0xc(%rcx,%rsi)
movsd (%rdx,%rcx), %xmm3
movaps %xmm0, %xmm4
subps %xmm3, %xmm4
movaps %xmm1, %xmm3
subss 0x8(%rdx,%rcx), %xmm3
movlps %xmm4, (%rcx,%rsi)
movss %xmm3, 0x8(%rcx,%rsi)
addq $0x14, %rcx
cmpq %rcx, %rax
jne 0x3038e
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/qradutil.cpp
// Function: getPlaneFromFace(dface_t const*)
const dplane_t* getPlaneFromFace(const dface_t* const face)
{
    if (!face)
    {
        Error("getPlaneFromFace() face was NULL\n");
    }

    if (face->side)
    {
        return &backplanes[face->planenum];
    }
    else
    {
        return &g_dplanes[face->planenum];
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x303dc
leaq 0xf5c3(%rip), %rdi      # 0x3f998
xorl %eax, %eax
callq 0xa01c
cmpw $0x0, 0x2(%rbx)
movzwl (%rbx), %eax
leaq (%rax,%rax,4), %rax
jne 0x303f3
leaq 0xb00fff(%rip), %rcx    # 0xb313f0
jmp 0x303fa
leaq 0x552a7d6(%rip), %rcx   # 0x555abd0
leaq (%rcx,%rax,4), %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/qradutil.cpp
// Function: getAdjustedPlaneFromFaceNumber(unsigned int, dplane_t*)
void getAdjustedPlaneFromFaceNumber(unsigned int faceNumber, dplane_t* plane)
{
    dface_t*        face = &g_dfaces[faceNumber];
    const vec_t*    face_offset = g_face_offset[faceNumber];

    plane->type = (planetypes)0;
    
    if (face->side)
    {
        vec_t dist;

        VectorCopy(backplanes[face->planenum].normal, plane->normal);
        dist = DotProduct(plane->normal, face_offset);
        plane->dist = backplanes[face->planenum].dist + dist;
    }
    else
    {
        vec_t dist;

        VectorCopy(g_dplanes[face->planenum].normal, plane->normal);
        dist = DotProduct(plane->normal, face_offset);
        plane->dist = g_dplanes[face->planenum].dist + dist;
    }
}

// Assembly:
movl %edi, %ecx
leaq (%rcx,%rcx,4), %rax
leaq 0x1b80ff3(%rip), %rdx   # 0x1bb1400
leaq (%rdx,%rax,4), %rax
leaq (%rcx,%rcx,2), %rcx
shlq $0x2, %rcx
movl $0x0, 0x10(%rsi)
movzwl (%rax), %edx
addq 0x17b4e(%rip), %rcx     # 0x47f78
cmpw $0x0, 0x2(%rax)
je 0x3043e
leaq (%rdx,%rdx,4), %rdx
leaq 0x552a794(%rip), %rdi   # 0x555abd0
jmp 0x30449
leaq (%rdx,%rdx,4), %rdx
leaq 0xb00fa7(%rip), %rdi    # 0xb313f0
movss (%rdi,%rdx,4), %xmm1
movss %xmm1, (%rsi)
movzwl (%rax), %edx
leaq (%rdx,%rdx,4), %rdx
movss 0x4(%rdi,%rdx,4), %xmm2
movss %xmm2, 0x4(%rsi)
movzwl (%rax), %edx
leaq (%rdx,%rdx,4), %rdx
movss 0x8(%rdi,%rdx,4), %xmm0
movss %xmm0, 0x8(%rsi)
mulss 0x4(%rcx), %xmm2
mulss (%rcx), %xmm1
addss %xmm2, %xmm1
mulss 0x8(%rcx), %xmm0
addss %xmm1, %xmm0
movzwl (%rax), %eax
leaq (%rax,%rax,4), %rax
leaq (%rdi,%rax,4), %rax
addq $0xc, %rax
addss (%rax), %xmm0
movss %xmm0, 0xc(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/qradutil.cpp
// Function: ApplyMatrix(matrix_t const&, float const*, float (&) [3])
void ApplyMatrix (const matrix_t &m, const vec3_t in, vec3_t &out)
{
	int i;

	hlassume (&in[0] != &out[0], assume_first);
	VectorCopy (m.v[3], out);
	for (i = 0; i < 3; i++)
	{
		VectorMA (out, in[i], m.v[i], out);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %edi, %edi
cmpq %rdx, %rsi
setne %dil
xorl %r12d, %r12d
xorl %esi, %esi
callq 0xa7c9
movss 0x24(%r15), %xmm0
movss %xmm0, (%rbx)
movss 0x28(%r15), %xmm1
movss %xmm1, 0x4(%rbx)
movss 0x2c(%r15), %xmm2
movss %xmm2, 0x8(%rbx)
addq $0x8, %r15
movss (%r14,%r12,4), %xmm3
mulss -0x8(%r15), %xmm3
addss %xmm3, %xmm0
movss %xmm0, (%rbx)
movss (%r14,%r12,4), %xmm3
mulss -0x4(%r15), %xmm3
addss %xmm3, %xmm1
movss %xmm1, 0x4(%rbx)
movss (%r14,%r12,4), %xmm3
mulss (%r15), %xmm3
addss %xmm3, %xmm2
movss %xmm2, 0x8(%rbx)
incq %r12
addq $0xc, %r15
cmpq $0x3, %r12
jne 0x3098b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/qradutil.cpp
// Function: ApplyMatrixOnPlane(matrix_t const&, float const*, float, float (&) [3], float&)
void ApplyMatrixOnPlane (const matrix_t &m_inverse, const vec3_t in_normal, vec_t in_dist, vec3_t &out_normal, vec_t &out_dist)
	// out_normal is not normalized
{
	int i;
	
	hlassume (&in_normal[0] != &out_normal[0], assume_first);
	for (i = 0; i < 3; i++)
	{
		out_normal[i] = DotProduct (in_normal, m_inverse.v[i]);
	}
	out_dist = - (DotProduct (in_normal, m_inverse.v[3]) - in_dist);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %r12
movss %xmm0, 0xc(%rsp)
movq %rsi, %r15
movq %rdi, %r14
xorl %edi, %edi
cmpq %rdx, %rsi
setne %dil
xorl %r13d, %r13d
xorl %esi, %esi
callq 0xa7c9
leaq 0x8(%r14), %rax
movss 0x4(%r15), %xmm0
mulss -0x4(%rax), %xmm0
movss (%r15), %xmm1
mulss -0x8(%rax), %xmm1
addss %xmm0, %xmm1
movss 0x8(%r15), %xmm0
mulss (%rax), %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%r12,%r13,4)
incq %r13
addq $0xc, %rax
cmpq $0x3, %r13
jne 0x30a17
movss 0x4(%r15), %xmm0
mulss 0x28(%r14), %xmm0
movss (%r15), %xmm1
mulss 0x24(%r14), %xmm1
addss %xmm0, %xmm1
movss 0x8(%r15), %xmm0
mulss 0x2c(%r14), %xmm0
addss %xmm1, %xmm0
subss 0xc(%rsp), %xmm0
xorps 0x7607(%rip), %xmm0     # 0x38090
movss %xmm0, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/qradutil.cpp
// Function: MultiplyMatrix(matrix_t const&, matrix_t const&, matrix_t&)
void MultiplyMatrix (const matrix_t &m_left, const matrix_t &m_right, matrix_t &m)
	// The following two processes are equivalent:
	//  1) ApplyMatrix (m1, v_in, v_temp), ApplyMatrix (m2, v_temp, v_out);
	//  2) MultiplyMatrix (m2, m1, m), ApplyMatrix (m, v_in, v_out);
{
	int i, j;
	const vec_t lastrow[4] = {0, 0, 0, 1};
	
	hlassume (&m != &m_left && &m != &m_right, assume_first);
	for (i = 0; i < 3; i++)
	{
		for (j = 0; j < 4; j++)
		{
			m.v[j][i] = m_left.v[0][i] * m_right.v[j][0]
					  + m_left.v[1][i] * m_right.v[j][1]
					  + m_left.v[2][i] * m_right.v[j][2]
					  + m_left.v[3][i] * lastrow[j];
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq %rdi, %rdx
setne %al
cmpq %rsi, %rdx
setne %cl
andb %al, %cl
movzbl %cl, %edi
xorl %r12d, %r12d
xorl %esi, %esi
callq 0xa7c9
leaq 0xeeb2(%rip), %rax      # 0x3f980
xorl %ecx, %ecx
movq %rax, %rdx
movss 0xc(%r15,%r12,4), %xmm0
mulss 0x4(%r14,%rcx,4), %xmm0
movss (%r15,%r12,4), %xmm1
mulss (%r14,%rcx,4), %xmm1
addss %xmm0, %xmm1
movss 0x18(%r15,%r12,4), %xmm0
mulss 0x8(%r14,%rcx,4), %xmm0
addss %xmm1, %xmm0
movss 0x24(%r15,%r12,4), %xmm1
mulss (%rdx), %xmm1
addss %xmm0, %xmm1
movss %xmm1, (%rbx,%rcx,4)
addq $0x4, %rdx
addq $0x3, %rcx
cmpq $0xc, %rcx
jne 0x30ad3
incq %r12
addq $0x4, %rbx
cmpq $0x3, %r12
jne 0x30ace
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/qradutil.cpp
// Function: MatrixForScale(float const*, float, matrix_t&)
void MatrixForScale (const vec3_t center, vec_t scale, matrix_t &m)
{
	int i;

	for (i = 0; i < 3; i++)
	{
		VectorClear (m.v[i]);
		m.v[i][i] = scale;
	}
	VectorScale (center, 1 - scale, m.v[3]);
}

// Assembly:
leaq 0x8(%rsi), %rax
xorl %ecx, %ecx
movl $0x0, (%rax)
movq $0x0, -0x8(%rax)
movss %xmm0, (%rsi,%rcx)
addq $0xc, %rax
addq $0x10, %rcx
cmpq $0x30, %rcx
jne 0x30b5b
movss 0x75b4(%rip), %xmm1     # 0x38138
subss %xmm0, %xmm1
movss (%rdi), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x24(%rsi)
movss 0x4(%rdi), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x28(%rsi)
mulss 0x8(%rdi), %xmm1
movss %xmm1, 0x2c(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/qradutil.cpp
// Function: TranslateWorldToTex(int, matrix_t&)
void TranslateWorldToTex (int facenum, matrix_t &m)
	// without g_face_offset
{
	dface_t *f;
	texinfo_t *ti;
	const dplane_t *fp;
	int i;

	f = &g_dfaces[facenum];
	ti = &g_texinfo[f->texinfo];
	fp = getPlaneFromFace (f);
	for (i = 0; i < 3; i++)
	{
		m.v[i][0] = ti->vecs[0][i];
		m.v[i][1] = ti->vecs[1][i];
		m.v[i][2] = fp->normal[i];
	}
	m.v[3][0] = ti->vecs[0][3];
	m.v[3][1] = ti->vecs[1][i];
	m.v[3][2] = -fp->dist;
}

// Assembly:
movslq %edi, %rax
leaq (%rax,%rax,4), %rcx
leaq 0x1b807d4(%rip), %rdx   # 0x1bb1400
movswq 0xa(%rdx,%rcx,4), %rax
leaq (%rax,%rax,4), %rax
shlq $0x3, %rax
cmpw $0x0, 0x2(%rdx,%rcx,4)
movzwl (%rdx,%rcx,4), %ecx
leaq (%rcx,%rcx,4), %rcx
jne 0x30c53
leaq 0xb0079f(%rip), %rdx    # 0xb313f0
jmp 0x30c5a
leaq 0x5529f76(%rip), %rdx   # 0x555abd0
addq 0x1730f(%rip), %rax     # 0x47f70
leaq (%rdx,%rcx,4), %rcx
leaq 0x8(%rsi), %rdx
xorl %edi, %edi
movss (%rax,%rdi,4), %xmm0
movss %xmm0, -0x8(%rdx)
movss 0x10(%rax,%rdi,4), %xmm0
movss %xmm0, -0x4(%rdx)
movss (%rcx,%rdi,4), %xmm0
movss %xmm0, (%rdx)
incq %rdi
addq $0xc, %rdx
cmpq $0x3, %rdi
jne 0x30c6b
movss 0xc(%rax), %xmm0
movss %xmm0, 0x24(%rsi)
movss 0x1c(%rax), %xmm0
movss %xmm0, 0x28(%rsi)
movss 0xc(%rcx), %xmm0
xorps 0x73da(%rip), %xmm0     # 0x38090
movss %xmm0, 0x2c(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/sparse.cpp
// Function: CheckVisBitSparse(unsigned int, unsigned int, float (&) [3], unsigned int&)
static bool     CheckVisBitSparse(unsigned x, unsigned y
#ifdef HLRAD_HULLU
								  , vec3_t &transparency_out
								  , unsigned int &next_index
#endif
								  )
{
#ifdef HLRAD_HULLU
    int                offset;
#else
    unsigned        offset;
#endif

#ifdef HLRAD_HULLU
    	VectorFill(transparency_out, 1.0);
#endif

    if (x == y)
    {
        return 1;
    }

#ifdef HLRAD_HULLU
    const unsigned a = x;
    const unsigned b = y;
#endif

    if (x > y)
    {
#ifndef HLRAD_HULLU
        const unsigned a = x;
        const unsigned b = y;
#endif
        x = b;
        y = a;
    }

    if (x > g_num_patches)
    {
        Warning("in CheckVisBit(), x > num_patches");
    }
    if (y > g_num_patches)
    {
        Warning("in CheckVisBit(), y > num_patches");
    }

    if ((offset = IsVisbitInArray(x, y)) != -1)
    {
#ifdef HLRAD_HULLU
    	if(g_customshadow_with_bouncelight)
    	{
    	     GetTransparency(a, b, transparency_out, next_index);
    	}
#endif
        return s_vismatrix[x].row[offset].values & (1 << (y & 7));
    }

	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movsd 0xa41b(%rip), %xmm0     # 0x3cbd0
movsd %xmm0, (%rdx)
movl $0x3f800000, 0x8(%rdx)  # imm = 0x3F800000
movb $0x1, %al
cmpl %esi, %edi
je 0x328bf
movq %rdx, %r14
movl %esi, %ebp
movl %edi, %r15d
movq %rcx, (%rsp)
movl %esi, %r12d
cmoval %edi, %r12d
movl %esi, %ebx
cmovbl %edi, %ebx
leaq 0x54061ff(%rip), %r13   # 0x54389e8
cmpl (%r13), %ebx
jbe 0x327fd
leaq 0xd43b(%rip), %rdi      # 0x3fc31
xorl %eax, %eax
callq 0xa38e
cmpl (%r13), %r12d
jbe 0x32811
leaq 0xd449(%rip), %rdi      # 0x3fc53
xorl %eax, %eax
callq 0xa38e
movq 0x66c82a8(%rip), %rdx   # 0x66faac0
movl %ebx, %r13d
shlq $0x4, %r13
movl 0x8(%rdx,%r13), %ecx
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %ecx, %ecx
je 0x3287b
movl %r12d, %eax
shrl $0x3, %eax
addq %r13, %rdx
decl %ecx
movq (%rdx), %rdx
xorl %edi, %edi
movl $0xffffff, %esi         # imm = 0xFFFFFF
leal (%rdi,%rcx), %r9d
movl %r9d, %r8d
shrl $0x1f, %r8d
addl %r9d, %r8d
sarl %r8d
movslq %r8d, %r9
movl (%rdx,%r9,4), %r9d
andl %esi, %r9d
cmpl %eax, %r9d
jae 0x3286a
incl %r8d
movl %r8d, %edi
jmp 0x32872
jbe 0x32878
decl %r8d
movl %r8d, %ecx
cmpl %ecx, %edi
jle 0x32842
jmp 0x3287b
movl %r8d, %ebx
cmpl $-0x1, %ebx
je 0x328bd
leaq 0x54c81a1(%rip), %rax   # 0x54faa28
cmpb $0x1, (%rax)
jne 0x3289d
movl %r15d, %edi
movl %ebp, %esi
movq %r14, %rdx
movq (%rsp), %rcx
callq 0x35611
movq 0x66c821c(%rip), %rax   # 0x66faac0
movq (%rax,%r13), %rax
movslq %ebx, %rcx
movzbl 0x3(%rax,%rcx,4), %eax
andl $0x7, %r12d
btl %r12d, %eax
setb %al
jmp 0x328bf
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/trace.cpp
// Function: MakeTnode(int)
static void     MakeTnode(const int nodenum)
{
    tnode_t*        t;
    dplane_t*       plane;
    int             i;
    dnode_t*        node;

    t = tnode_p++;

    node = g_dnodes + nodenum;
    plane = g_dplanes + node->planenum;

    t->type = plane->type;
    VectorCopy(plane->normal, t->normal);
#ifdef ZHLT_PLANETYPE_FIX //debug
	if (plane->normal[(plane->type)%3] < 0)
		if (plane->type < 3)
			Warning ("MakeTnode: negative plane");
		else
			Developer (DEVELOPER_LEVEL_MESSAGE, "Warning: MakeTnode: negative plane\n");
#endif
    t->dist = plane->dist;

    for (i = 0; i < 2; i++)
    {
        if (node->children[i] < 0)
            t->children[i] = g_dleafs[-node->children[i] - 1].contents;
        else
        {
            t->children[i] = tnode_p - tnodes;
            MakeTnode(node->children[i]);
        }
    }

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x66c7a28(%rip), %rbx   # 0x66faad0
leaq 0x20(%rbx), %rax
movq %rax, 0x66c7a1d(%rip)   # 0x66faad0
movslq %edi, %rax
leaq (%rax,%rax,2), %r14
leaq 0x10be33f(%rip), %r15   # 0x10f1400
movslq (%r15,%r14,8), %rax
leaq (%rax,%rax,4), %rax
leaq 0xafe320(%rip), %rcx    # 0xb313f0
leaq (%rcx,%rax,4), %r12
movl 0x10(%r12), %eax
movl %eax, (%rbx)
movss (%r12), %xmm0
movss %xmm0, 0x4(%rbx)
movss 0x4(%r12), %xmm0
movss %xmm0, 0x8(%rbx)
movss 0x8(%r12), %xmm0
movss %xmm0, 0xc(%rbx)
movslq 0x10(%r12), %rax
imulq $0x55555556, %rax, %rcx # imm = 0x55555556
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,2), %ecx
movl %eax, %edx
subl %ecx, %edx
movslq %edx, %rcx
xorps %xmm0, %xmm0
ucomiss (%r12,%rcx,4), %xmm0
jbe 0x33153
cmpl $0x2, %eax
jg 0x33140
leaq 0xcc00(%rip), %rdi      # 0x3fd37
xorl %eax, %eax
callq 0xa38e
jmp 0x33153
leaq 0xcc0a(%rip), %rsi      # 0x3fd51
movl $0x3, %edi
xorl %eax, %eax
callq 0xa52e
leaq (%r15,%r14,8), %r14
movss 0xc(%r12), %xmm0
movss %xmm0, 0x10(%rbx)
xorl %r15d, %r15d
leaq 0xa1e353(%rip), %r12    # 0xa514c0
movzwl 0x4(%r14,%r15,2), %eax
testw %ax, %ax
js 0x3319c
movq 0x66c7951(%rip), %rax   # 0x66faad0
subq 0x66c7942(%rip), %rax   # 0x66faac8
shrq $0x5, %rax
movl %eax, 0x14(%rbx,%r15,4)
movswl 0x4(%r14,%r15,2), %edi
callq 0x33099
jmp 0x331b5
notl %eax
movzwl %ax, %eax
leaq (%rax,%rax,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rax, %rcx
movl (%r12,%rcx), %eax
movl %eax, 0x14(%rbx,%r15,4)
incq %r15
cmpq $0x1, %r15
je 0x3316d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/trace.cpp
// Function: MergeOpaqueFaces(int, int)
int MergeOpaqueFaces (int firstface, int numfaces)
{
	int i, j, newnum;
	opaqueface_t *faces = &opaquefaces[firstface];
	for (i = 0; i < numfaces; i++)
	{
		for (j = 0; j < i; j++)
		{
			if (TryMerge (&faces[i], &faces[j]))
			{
				delete faces[j].winding;
				faces[j].winding = NULL;
				j = -1;
				continue;
			}
		}
	}
	for (i = 0, j = 0; i < numfaces; i++)
	{
		if (faces[i].winding)
		{
			faces[j] = faces[i];
			j++;
		}
	}
	newnum = j;
	for (; j < numfaces; j++)
	{
		memset (&faces[j], 0, sizeof(opaqueface_t));
	}
	return newnum;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x66c6e5c(%rip), %rax   # 0x66faad8
movslq %edi, %rcx
movq %rcx, 0x8(%rsp)
leaq (%rcx,%rcx,2), %r13
shlq $0x5, %r13
movq %rax, 0x10(%rsp)
addq %rax, %r13
movl %esi, %ebx
movl %esi, 0x4(%rsp)
testl %esi, %esi
jle 0x33cfc
xorl %r12d, %r12d
testq %r12, %r12
je 0x33cf4
leaq (%r12,%r12,2), %r14
shlq $0x5, %r14
addq %r13, %r14
xorl %ebp, %ebp
movslq %ebp, %rax
leaq (%rax,%rax,2), %r15
shlq $0x5, %r15
addq %r13, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x334e6
testb %al, %al
je 0x33cea
movq (%r15), %rdi
testq %rdi, %rdi
je 0x33cde
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, (%r15)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
incl %ebp
movslq %ebp, %rax
cmpq %rax, %r12
jg 0x33cb3
incq %r12
cmpq %rbx, %r12
jne 0x33ca1
movl 0x4(%rsp), %r8d
testl %r8d, %r8d
jle 0x33d43
shlq $0x5, %rbx
leaq (%rbx,%rbx,2), %rax
xorl %edx, %edx
xorl %r14d, %r14d
cmpq $0x0, (%r13,%rdx)
je 0x33d38
leaq (%rdx,%r13), %rsi
movslq %r14d, %r14
leaq (%r14,%r14,2), %rdi
shlq $0x5, %rdi
addq %r13, %rdi
movl $0xc, %ecx
rep  movsq (%rsi), %es:(%rdi)
incl %r14d
addq $0x60, %rdx
cmpq %rdx, %rax
jne 0x33d13
jmp 0x33d46
xorl %r14d, %r14d
cmpl %r8d, %r14d
jge 0x33d81
movslq %r14d, %rax
movq 0x8(%rsp), %rcx
addq %rax, %rcx
leaq (%rcx,%rcx,2), %rax
shlq $0x5, %rax
movq 0x10(%rsp), %rdi
addq %rax, %rdi
movl %r14d, %eax
notl %eax
addl %r8d, %eax
leaq (%rax,%rax,2), %rdx
shlq $0x5, %rdx
addq $0x60, %rdx
xorl %esi, %esi
callq 0x4190
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/trace.cpp
// Function: DeleteOpaqueNodes()
void DeleteOpaqueNodes ()
{
	int i;
	for (i = 0; i < g_numfaces; i++)
	{
		opaqueface_t *of = &opaquefaces[i];
		if (of->winding)
			delete of->winding;
		if (of->edges)
			free (of->edges);
	}
	free (opaquefaces);
	free (opaquenodes);
	free (opaquemodels);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x1b7d0e5(%rip), %rbx   # 0x1bb13f4
cmpl $0x0, (%rbx)
jle 0x34351
movl $0x20, %r14d
xorl %r15d, %r15d
movq 0x66c67b4(%rip), %r12   # 0x66faad8
movq -0x20(%r12,%r14), %rdi
testq %rdi, %rdi
je 0x34334
movq (%rdi), %rax
callq *0x8(%rax)
movq (%r12,%r14), %rdi
testq %rdi, %rdi
je 0x34342
callq 0x4380
incq %r15
movslq (%rbx), %rax
addq $0x60, %r14
cmpq %rax, %r15
jl 0x3431d
movq 0x66c6780(%rip), %rdi   # 0x66faad8
callq 0x4380
movq 0x66c677c(%rip), %rdi   # 0x66faae0
callq 0x4380
movq 0x66c6778(%rip), %rdi   # 0x66faae8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4380
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/trace.cpp
// Function: CountOpaqueFaces_r(opaquenode_s*)
int CountOpaqueFaces_r (opaquenode_t *node)
{
	int count;
	count = node->numfaces;
	if (node->children[0] >= 0)
	{
		count += CountOpaqueFaces_r (&opaquenodes[node->children[0]]);
	}
	if (node->children[1] >= 0)
	{
		count += CountOpaqueFaces_r (&opaquenodes[node->children[1]]);
	}
	return count;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
xorl %ebx, %ebx
movl 0x20(%r14), %ebp
movslq 0x14(%r14), %rax
testq %rax, %rax
js 0x34ac3
leaq (%rax,%rax,8), %rdi
shlq $0x2, %rdi
addq 0x66c6024(%rip), %rdi   # 0x66faae0
callq 0x34a97
addl %eax, %ebp
movslq 0x18(%r14), %rax
testq %rax, %rax
js 0x34adf
leaq (%rax,%rax,8), %r14
shlq $0x2, %r14
addq 0x66c6005(%rip), %r14   # 0x66faae0
addl %ebp, %ebx
jmp 0x34aa0
addl %ebp, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/trace.cpp
// Function: TestPointOpaque_r(int, bool, float const*)
int TestPointOpaque_r (int nodenum, bool solid, const vec3_t point)
{
	opaquenode_t *thisnode;
	vec_t dist;
	while (1)
	{
		if (nodenum < 0)
		{
			if (solid && g_dleafs[-nodenum-1].contents == CONTENTS_SOLID)
				return 1;
			else
				return 0;
		}
		thisnode = &opaquenodes[nodenum];
		switch (thisnode->type)
		{
		case plane_x:
			dist = point[0] - thisnode->dist;
			break;
		case plane_y:
			dist = point[1] - thisnode->dist;
			break;
		case plane_z:
			dist = point[2] - thisnode->dist;
			break;
		default:
			dist = DotProduct (point, thisnode->normal) - thisnode->dist;
		}
		if (dist > HUNT_WALL_EPSILON)
		{
			nodenum = thisnode->children[0];
		}
		else if (dist < -HUNT_WALL_EPSILON)
		{
			nodenum = thisnode->children[1];
		}
		else
		{
			break;
		}
	}
	{
		int facenum;
		for (facenum = thisnode->firstface; facenum < thisnode->firstface + thisnode->numfaces; facenum++)
		{
			if (TestLineOpaque_face (facenum, point))
			{
				return 1;
			}
		}
	}
	return TestPointOpaque_r (thisnode->children[0], solid, point)
		|| TestPointOpaque_r (thisnode->children[1], solid, point);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movl %esi, %ebx
movsd 0xadfd(%rip), %xmm2     # 0x3f928
movsd 0xadfd(%rip), %xmm3     # 0x3f930
movzbl %bl, %ebp
testl %edi, %edi
js 0x34c30
movq 0x66c5f9b(%rip), %rax   # 0x66faae0
movl %edi, %ecx
leaq (%rcx,%rcx,8), %rcx
leaq (%rax,%rcx,4), %r12
movl (%r12), %ecx
cmpl $0x2, %ecx
je 0x34b70
cmpl $0x1, %ecx
je 0x34b68
testl %ecx, %ecx
jne 0x34b78
movss (%r14), %xmm0
jmp 0x34ba6
movss 0x4(%r14), %xmm0
jmp 0x34ba6
movss 0x8(%r14), %xmm0
jmp 0x34ba6
movss 0x4(%r14), %xmm0
mulss 0x8(%r12), %xmm0
movss (%r14), %xmm1
mulss 0x4(%r12), %xmm1
addss %xmm0, %xmm1
movss 0x8(%r14), %xmm0
mulss 0xc(%r12), %xmm0
addss %xmm1, %xmm0
subss 0x10(%r12), %xmm0
cvtss2sd %xmm0, %xmm0
movl $0x14, %ecx
ucomisd %xmm2, %xmm0
ja 0x34bc7
movl $0x18, %ecx
ucomisd %xmm0, %xmm3
jbe 0x34bd5
movl (%r12,%rcx), %edi
testl %edi, %edi
jns 0x34b45
jmp 0x34c30
cmpl $0x0, 0x20(%r12)
jle 0x34c03
movl 0x1c(%r12), %r15d
movl %r15d, %edi
movq %r14, %rsi
callq 0x34380
testl %eax, %eax
jne 0x34c5e
incl %r15d
movl 0x20(%r12), %eax
addl 0x1c(%r12), %eax
cmpl %eax, %r15d
jl 0x34be2
movl 0x14(%r12), %edi
movl %ebp, %esi
movq %r14, %rdx
callq 0x34b16
testl %eax, %eax
jne 0x34c5e
movl 0x18(%r12), %edi
movsd 0xad05(%rip), %xmm2     # 0x3f928
movsd 0xad05(%rip), %xmm3     # 0x3f930
jmp 0x34b36
testb %bl, %bl
je 0x34c53
notl %edi
leaq (%rdi,%rdi,8), %rax
leaq (%rax,%rax,2), %rcx
addq %rdi, %rcx
leaq 0xa1c878(%rip), %rdx    # 0xa514c0
movl $0x1, %eax
cmpl $-0x2, (%rdx,%rcx)
je 0x34c55
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %eax
jmp 0x34c55
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/common/mathlib.h
// Function: VectorNormalize(float*)
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:
pushq %rbx
movq %rdi, %rbx
movss (%rdi), %xmm0
movss 0x4(%rdi), %xmm1
mulss %xmm1, %xmm1
mulss %xmm0, %xmm0
addss %xmm1, %xmm0
movss 0x8(%rdi), %xmm1
mulss %xmm1, %xmm1
addss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x34ca1
sqrtsd %xmm0, %xmm0
jmp 0x34ca6
callq 0x4240
movsd 0x3462(%rip), %xmm1     # 0x38110
ucomisd %xmm0, %xmm1
jbe 0x34cc7
movl $0x0, 0x8(%rbx)
movq $0x0, (%rbx)
xorps %xmm0, %xmm0
jmp 0x34cf7
cvtps2pd (%rbx), %xmm1
movapd %xmm0, %xmm2
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
divpd %xmm2, %xmm1
cvtpd2ps %xmm1, %xmm1
movlpd %xmm1, (%rbx)
xorps %xmm1, %xmm1
cvtss2sd 0x8(%rbx), %xmm1
divsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm1
movss %xmm1, 0x8(%rbx)
cvtsd2ss %xmm0, %xmm0
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/transparency.cpp
// Function: FreeTransparencyArrays()
void	FreeTransparencyArrays( )
{
	if (s_sorted_list) free(s_sorted_list);
	if (s_trans_list)  free(s_trans_list);
	
	s_trans_list = NULL;
	s_sorted_list = NULL;
	
	s_max_trans_count = s_trans_count = s_sorted_count = 0;
}

// Assembly:
pushq %rax
movq 0x66c5536(%rip), %rdi   # 0x66fab08
testq %rdi, %rdi
je 0x355dc
callq 0x4380
movq 0x66c5535(%rip), %rdi   # 0x66fab18
testq %rdi, %rdi
je 0x355ed
callq 0x4380
xorl %eax, %eax
movq %rax, 0x66c5522(%rip)   # 0x66fab18
movq %rax, 0x66c550b(%rip)   # 0x66fab08
movl %eax, 0x66c54fd(%rip)   # 0x66fab00
movl %eax, 0x66c550b(%rip)   # 0x66fab14
movl %eax, 0x66c5501(%rip)   # 0x66fab10
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/transparency.cpp
// Function: GetTransparency(unsigned int, unsigned int, float (&) [3], unsigned int&)
void GetTransparency(const unsigned p1, const unsigned p2, vec3_t &trans, unsigned int &next_index)
{
	VectorFill( trans, 1.0 );
	
	for( unsigned i = next_index; i < s_sorted_count; i++ )
	{
		if ( s_sorted_list[i].p1 < p1 )
		{
			continue;
		}
		else if ( s_sorted_list[i].p1 == p1 )
		{
			if ( s_sorted_list[i].p2 < p2 )
			{
				continue;
			}
			else if ( s_sorted_list[i].p2 == p2 )
			{
				VectorCopy( s_trans_list[s_sorted_list[i].data_index], trans );
				next_index = i + 1;
			
				return;
			}
			else //if ( s_sorted_list[i].p2 > p2 )
			{
				next_index = i;
			
				return;
			}
		}
		else //if ( s_sorted_list[i].p1 > p1 )
		{
			next_index = i;
			
			return;
		}
	}
	
	next_index = s_sorted_count;
}

// Assembly:
movsd 0x75b7(%rip), %xmm0     # 0x3cbd0
movsd %xmm0, (%rdx)
movl $0x3f800000, 0x8(%rdx)  # imm = 0x3F800000
movl (%rcx), %eax
movl 0x66c54d3(%rip), %r8d   # 0x66fab00
cmpl %r8d, %eax
setb %r9b
jae 0x356b1
movq 0x66c54cb(%rip), %r10   # 0x66fab08
leaq (%rax,%rax,2), %r11
leaq (%r10,%r11,4), %r10
addq $0x8, %r10
cmpl %edi, -0x8(%r10)
jb 0x35657
jne 0x356ab
cmpl %esi, -0x4(%r10)
jae 0x3566c
incq %rax
cmpq %r8, %rax
setb %r9b
addq $0xc, %r10
cmpq %rax, %r8
jne 0x35649
jmp 0x356b1
jne 0x356ab
movq 0x66c54a3(%rip), %rsi   # 0x66fab18
movl (%r10), %edi
leaq (%rdi,%rdi,2), %rdi
movss (%rsi,%rdi,4), %xmm0
movss %xmm0, (%rdx)
movl (%r10), %edi
leaq (%rdi,%rdi,2), %rdi
movss 0x4(%rsi,%rdi,4), %xmm0
movss %xmm0, 0x4(%rdx)
movl (%r10), %edi
leaq (%rdi,%rdi,2), %rdi
movss 0x8(%rsi,%rdi,4), %xmm0
movss %xmm0, 0x8(%rdx)
incl %eax
testb $0x1, %r9b
jne 0x356b4
movl %r8d, %eax
movl %eax, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/transparency.cpp
// Function: AddStyleToStyleArray(unsigned int, unsigned int, int)
void	AddStyleToStyleArray(const unsigned p1, const unsigned p2, const int style)
{
	if (style == -1)
		return;
	//make thread safe
	ThreadLock();
	
	//realloc if needed
	while( s_style_count >= s_max_style_count )
	{
		unsigned int old_max_count = s_max_style_count;
#ifdef HLRAD_TRANSPARENCY_FAST
		s_max_style_count = qmax (64u, (unsigned int)((double)s_max_style_count * 1.41));
#else
		s_max_style_count += STYLE_LIST_GROWTH;
#endif
#ifdef ZHLT_64BIT_FIX
		if (s_max_style_count >= (unsigned int)INT_MAX)
		{
			Error ("AddStyleToStyleArray: array size exceeded INT_MAX");
		}
#endif
		
		s_style_list = (styleList_t *)realloc( s_style_list, sizeof(styleList_t) * s_max_style_count );
#ifdef HLRAD_HLASSUMENOMEMORY
		hlassume (s_style_list != NULL, assume_NoMemory);
#endif
		
#ifdef HLRAD_TRANSPARENCY_FAST
		memset( &s_style_list[old_max_count], 0, sizeof(styleList_t) * (s_max_style_count - old_max_count) );
#else
		memset( &s_style_list[old_max_count], 0, sizeof(styleList_t) * STYLE_LIST_GROWTH );
#endif
	}
	
	s_style_list[s_style_count].p1 = p1;
	s_style_list[s_style_count].p2 = p2;
	s_style_list[s_style_count].style = (char)style;
	
	s_style_count++;
	
	//unlock list
	ThreadUnlock();
}

// Assembly:
cmpl $-0x1, %edx
je 0x357da
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movl %edi, %r14d
callq 0xb411
movl 0x66c5443(%rip), %eax   # 0x66fab20
movl 0x66c5440(%rip), %r12d  # 0x66fab24
cmpl %r12d, %eax
jb 0x357a6
leaq 0xa840(%rip), %r15      # 0x3ff34
movl %r12d, %r13d
xorps %xmm0, %xmm0
cvtsi2sd %r13, %xmm0
mulsd 0xa779(%rip), %xmm0     # 0x3fe80
cvttsd2si %xmm0, %rax
cmpl $0x41, %eax
movl $0x40, %ecx
cmovael %eax, %ecx
movl %ecx, 0x66c5407(%rip)   # 0x66fab24
cmpl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
jb 0x3572e
movq %r15, %rdi
xorl %eax, %eax
callq 0xa01c
movq 0x66c53f3(%rip), %rdi   # 0x66fab28
movl 0x66c53e9(%rip), %eax   # 0x66fab24
shlq $0x2, %rax
leaq (%rax,%rax,2), %rsi
callq 0x4570
movq %rax, 0x66c53d9(%rip)   # 0x66fab28
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa7c9
leaq (,%r13,2), %rdi
addq %r13, %rdi
shlq $0x2, %rdi
addq 0x66c53b0(%rip), %rdi   # 0x66fab28
movl 0x66c53a5(%rip), %r13d  # 0x66fab24
movl %r13d, %eax
subl %r12d, %eax
shlq $0x2, %rax
leaq (%rax,%rax,2), %rdx
xorl %esi, %esi
callq 0x4190
movl 0x66c5386(%rip), %eax   # 0x66fab20
movl %r13d, %r12d
cmpl %r13d, %eax
jae 0x356f4
movq 0x66c537b(%rip), %rcx   # 0x66fab28
movl %eax, %edx
leaq (%rdx,%rdx,2), %rdx
movl %r14d, (%rcx,%rdx,4)
movl %ebp, 0x4(%rcx,%rdx,4)
movb %bl, 0x8(%rcx,%rdx,4)
incl %eax
movl %eax, 0x66c5359(%rip)   # 0x66fab20
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb422
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/transparency.cpp
// Function: CreateFinalStyleArrays(char const*)
void	CreateFinalStyleArrays(const char *print_name)
{
	if( s_style_count == 0 )
	{
		return;
	}
	//need to sorted for fast search function
	qsort( s_style_list, s_style_count, sizeof(styleList_t), SortStyleList );
	
#ifdef ZHLT_64BIT_FIX
	size_t size = s_max_style_count * sizeof(styleList_t);
#else
	unsigned size = s_max_style_count * sizeof(styleList_t);
#endif
	if ( size > 1024 * 1024 )
        	Log("%-20s: %5.1f megs \n", print_name, (double)size / (1024.0 * 1024.0));
        else if ( size > 1024 )
        	Log("%-20s: %5.1f kilos\n", print_name, (double)size / 1024.0);
        else
        	Log("%-20s: %5.1f bytes\n", print_name, (double)size); //--vluzacn
}

// Assembly:
pushq %rbx
movl 0x66c533e(%rip), %esi   # 0x66fab20
testq %rsi, %rsi
je 0x35832
movq %rdi, %rbx
movq 0x66c5337(%rip), %rdi   # 0x66fab28
leaq 0x64(%rip), %rcx        # 0x3585c
movl $0xc, %edx
callq 0x4610
movl 0x66c531c(%rip), %eax   # 0x66fab24
leaq (,%rax,4), %rcx
leaq (%rcx,%rcx,2), %rcx
cvtsi2sd %rcx, %xmm0
cmpq $0x15556, %rax          # imm = 0x15556
jb 0x35834
mulsd 0x40e7(%rip), %xmm0     # 0x39910
leaq 0xa6a3(%rip), %rdi      # 0x3fed3
jmp 0x35851
popq %rbx
retq
cmpl $0x56, %eax
jb 0x3584a
mulsd 0xa647(%rip), %xmm0     # 0x3fe88
leaq 0xa69f(%rip), %rdi      # 0x3fee7
jmp 0x35851
leaq 0xa6aa(%rip), %rdi      # 0x3fefb
movq %rbx, %rsi
movb $0x1, %al
popq %rbx
jmp 0x9d2e
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/vismatrix.cpp
// Function: CheckVisBitVismatrix(unsigned int, unsigned int, float (&) [3], unsigned int&)
static bool     CheckVisBitVismatrix(unsigned p1, unsigned p2
#ifdef HLRAD_HULLU
									 , vec3_t &transparency_out
									 , unsigned int &next_index
#endif
									 )
{
    unsigned        bitpos;

#ifdef HLRAD_HULLU
    const unsigned a = p1;
    const unsigned b = p2;

    VectorFill(transparency_out, 1.0);
#endif

    if (p1 > p2)
    {
#ifndef HLRAD_HULLU
        const unsigned a = p1;
        const unsigned b = p2;
#endif
        p1 = b;
        p2 = a;
    }

    if (p1 > g_num_patches)
    {
        Warning("in CheckVisBit(), p1 > num_patches");
    }
    if (p2 > g_num_patches)
    {
        Warning("in CheckVisBit(), p2 > num_patches");
    }

#ifdef HALFBIT
    bitpos = p1 * g_num_patches - (p1 * (p1 + 1)) / 2 + p2;
#else
    bitpos = p1 * g_num_patches + p2;
#endif

    if (s_vismatrix[bitpos >> 3] & (1 << (bitpos & 7)))
    {
#ifdef HLRAD_HULLU    	
    	if(g_customshadow_with_bouncelight)
    	{
    	    GetTransparency( a, b, transparency_out, next_index );
    	}
#endif
        return true;
    }

    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, (%rsp)
movq %rdx, %r14
movl %esi, %ebp
movl %edi, %r15d
movsd 0x70ba(%rip), %xmm0     # 0x3cbd0
cmpl %esi, %edi
movl %esi, %r12d
cmoval %edi, %r12d
movsd %xmm0, (%rdx)
movl %esi, %r13d
cmovbl %edi, %r13d
movl $0x3f800000, 0x8(%rdx)  # imm = 0x3F800000
leaq 0x5402eb0(%rip), %rbx   # 0x54389e8
cmpl (%rbx), %r13d
jbe 0x35b4b
leaq 0xa478(%rip), %rdi      # 0x3ffbc
xorl %eax, %eax
callq 0xa38e
cmpl (%rbx), %r12d
jbe 0x35b5e
leaq 0xa488(%rip), %rdi      # 0x3ffdf
xorl %eax, %eax
callq 0xa38e
movl (%rbx), %ecx
imull %r13d, %ecx
leal 0x1(%r13), %eax
imull %r13d, %eax
shrl %eax
subl %eax, %ecx
addl %r12d, %ecx
movq 0x66c4fb6(%rip), %rax   # 0x66fab30
movl %ecx, %edx
shrl $0x3, %edx
movzbl (%rax,%rdx), %eax
andb $0x7, %cl
movl $0x1, %ebx
shll %cl, %ebx
andl %eax, %ebx
je 0x35bae
leaq 0x54c4e90(%rip), %rax   # 0x54faa28
cmpb $0x1, (%rax)
jne 0x35bae
movl %r15d, %edi
movl %ebp, %esi
movq %r14, %rdx
movq (%rsp), %rcx
callq 0x35611
testl %ebx, %ebx
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/hlrad/vismatrixutil.cpp
// Function: FindTransferOffsetPatchnum(transfer_index_t*, patch_s const*, unsigned int)
int             FindTransferOffsetPatchnum(transfer_index_t* tIndex, const patch_t* const patch, const unsigned patchnum)
{
    //
    // binary search for match
    //
    int             low = 0;
    int             high = patch->iIndex - 1;
    int             offset;

    while (1)
    {
        offset = (low + high) / 2;

        if ((tIndex[offset].index + tIndex[offset].size) < patchnum)
        {
            low = offset + 1;
        }
        else if (tIndex[offset].index > patchnum)
        {
            high = offset - 1;
        }
        else
        {
            unsigned        x;
            unsigned int    rval = 0;
            transfer_index_t* pIndex = tIndex;

            for (x = 0; x < offset; x++, pIndex++)
            {
                rval += pIndex->size + 1;
            }
            rval += patchnum - tIndex[offset].index;
            return rval;
        }
        if (low > high)
        {
            return -1;
        }
    }
}

// Assembly:
movl 0x38(%rsi), %eax
decl %eax
xorl %ecx, %ecx
leal (%rax,%rcx), %r8d
movl %r8d, %esi
shrl $0x1f, %esi
addl %r8d, %esi
sarl %esi
movslq %esi, %r9
movl (%rdi,%r9,4), %r10d
movl %r10d, %r9d
shrl $0xc, %r9d
andl $0xfff, %r10d           # imm = 0xFFF
addl %r9d, %r10d
cmpl %edx, %r10d
jae 0x361d5
incl %esi
movl %esi, %ecx
jmp 0x361e0
movl %edx, %eax
subl %r9d, %eax
jae 0x361ea
decl %esi
movl %esi, %eax
cmpl %eax, %ecx
jle 0x361a3
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
incl %r8d
xorl %edx, %edx
cmpl $0x3, %r8d
jb 0x3621c
movl %esi, %ecx
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorl %esi, %esi
movl $0xfff, %r8d            # imm = 0xFFF
xorl %edx, %edx
movl (%rdi,%rsi,4), %r9d
andl %r8d, %r9d
addl %r9d, %edx
incl %edx
incq %rsi
cmpl %esi, %ecx
jne 0x36209
addl %edx, %eax
retq