LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlrad/loadtextures.cpp
// Function: TryOpenWadFiles()
void TryOpenWadFiles ()
{
	if (!g_wadfiles_opened)
	{
		g_wadfiles_opened = true;
#ifdef ZHLT_NOWADDIR
		char filename[_MAX_PATH];
		safe_snprintf(filename, _MAX_PATH, "%s.wa_", g_Mapname);
	   if (q_exists (filename))
	   {
		OpenWadFile (filename, true);
	   }
	   else
	   {
		Warning ("Couldn't open %s", filename);
#endif
		Log ("Opening wad files from directories:\n");
		if (!g_waddirs)
		{
			Warning ("No wad directories have been set.");
		}
		else
		{
			waddir_t *dir;
			for (dir = g_waddirs; dir; dir = dir->next)
			{
				Log ("  %s\n", dir->path);
			}
		}
		const char *value = ValueForKey (&g_entities[0], "wad");
		char path[MAX_VAL];
		int i, j;
		for (i = 0, j = 0; i < strlen(value) + 1; i++)
		{
			if (value[i] == ';' || value[i] == '\0')
			{
				path[j] = '\0';
				if (path[0])
				{
					char name[MAX_VAL];
					ExtractFile (path, name);
					DefaultExtension (name, ".wad");
					OpenWadFile (name);
				}
				j = 0;
			}
			else
			{
				path[j] = value[i];
				j++;
			}
		}
#ifdef ZHLT_NOWADDIR
	   }
#endif
		CheckFatal ();
	}
}

// Assembly:
cmpb $0x0, 0x524fe07(%rip)   # 0x52719c0
jne 0x21d28
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3008, %rsp           # imm = 0x3008
movb $0x1, 0x524fde9(%rip)   # 0x52719c0
leaq 0x16e7a(%rip), %rdx     # 0x38a58
leaq 0x2576b(%rip), %rcx     # 0x47350
leaq 0x1000(%rsp), %rbx
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8817
movq %rbx, %rdi
callq 0x976b
testb %al, %al
je 0x21c1f
leaq 0x1000(%rsp), %rdi
movl $0x1, %esi
callq 0x2185f
jmp 0x21d12
leaq 0x1998e(%rip), %rdi     # 0x3b5b4
leaq 0x1000(%rsp), %rsi
xorl %eax, %eax
callq 0xa2a6
leaq 0x19a3a(%rip), %rdi     # 0x3b676
xorl %eax, %eax
callq 0x9c46
movq 0x524fd66(%rip), %r14   # 0x52719b0
testq %r14, %r14
je 0x21c6e
leaq 0x19a67(%rip), %rbx     # 0x3b6bd
leaq 0x8(%r14), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9c46
movq (%r14), %r14
testq %r14, %r14
jne 0x21c56
jmp 0x21c7c
leaq 0x19a26(%rip), %rdi     # 0x3b69b
xorl %eax, %eax
callq 0xa2a6
leaq 0x201c7ad(%rip), %rdi   # 0x203e430
leaq 0x19a3a(%rip), %rsi     # 0x3b6c4
callq 0x752d
movq %rax, %rbx
movq %rax, %rdi
callq 0x4150
cmpq $-0x1, %rax
je 0x21d12
xorl %r13d, %r13d
movq %rsp, %r14
leaq 0x2000(%rsp), %r15
leaq 0x19a0e(%rip), %r12     # 0x3b6c3
xorl %ebp, %ebp
movzbl (%rbx,%r13), %eax
movslq %ebp, %rbp
cmpl $0x3b, %eax
je 0x21cc8
testl %eax, %eax
jne 0x21cf6
movb $0x0, (%rsp,%rbp)
cmpb $0x0, (%rsp)
je 0x21cfd
movq %r14, %rdi
movq %r15, %rsi
callq 0x85c2
movq %r15, %rdi
movq %r12, %rsi
callq 0x83ad
xorl %ebp, %ebp
movq %r15, %rdi
xorl %esi, %esi
callq 0x2185f
jmp 0x21cff
movb %al, (%rsp,%rbp)
incl %ebp
jmp 0x21cff
xorl %ebp, %ebp
incq %r13
movq %rbx, %rdi
callq 0x4150
incq %rax
cmpq %r13, %rax
ja 0x21cb7
callq 0x9f1f
addq $0x3008, %rsp           # imm = 0x3008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlrad/loadtextures.cpp
// Function: TryCloseWadFiles()
void TryCloseWadFiles ()
{
	if (g_wadfiles_opened)
	{
		g_wadfiles_opened = false;
		wadfile_t *wadfile, *next;
		for (wadfile = g_wadfiles; wadfile; wadfile = next)
		{
			next = wadfile->next;
			free (wadfile->lumpinfos);
			fclose (wadfile->file);
			free (wadfile);
		}
		g_wadfiles = NULL;
	}
}

// Assembly:
cmpb $0x1, 0x524fc90(%rip)   # 0x52719c0
jne 0x21d86
pushq %r14
pushq %rbx
pushq %rax
movb $0x0, 0x524fc83(%rip)   # 0x52719c0
movq 0x524fc74(%rip), %rbx   # 0x52719b8
testq %rbx, %rbx
je 0x21d74
movq (%rbx), %r14
movq 0x1018(%rbx), %rdi
callq 0x4370
movq 0x1008(%rbx), %rdi
callq 0x42d0
movq %rbx, %rdi
callq 0x4370
movq %r14, %rbx
testq %r14, %r14
jne 0x21d49
movq $0x0, 0x524fc39(%rip) # 0x52719b8
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlrad/loadtextures.cpp
// Function: DefaultTexture(radtexture_t*, char const*)
void DefaultTexture (radtexture_t *tex, const char *name)
{
	int i;
	tex->width = 16;
	tex->height = 16;
	strcpy (tex->name, name);
	tex->name[16 - 1] = '\0';
	tex->canvas = (byte *)malloc (tex->width * tex->height);
	hlassume (tex->canvas != NULL, assume_NoMemory);
	for (i = 0; i < 256; i++)
	{
		VectorFill (tex->palette[i], 0x80);
	}
	for (i = 0; i < tex->width * tex->height; i++)
	{
		tex->canvas[i] = 0x00;
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movabsq $0x1000000010, %rax     # imm = 0x1000000010
movq %rax, 0x10(%rdi)
callq 0x42a0
movb $0x0, 0xf(%rbx)
movslq 0x10(%rbx), %rax
movslq 0x14(%rbx), %rdi
imulq %rax, %rdi
callq 0x4400
movq %rax, 0x18(%rbx)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa6ed
leaq 0x20(%rbx), %rdi
movl $0x300, %edx            # imm = 0x300
movl $0x80, %esi
callq 0x4190
movl 0x14(%rbx), %eax
imull 0x10(%rbx), %eax
testl %eax, %eax
jle 0x21e06
xorl %eax, %eax
movq 0x18(%rbx), %rcx
movb $0x0, (%rcx,%rax)
incq %rax
movslq 0x10(%rbx), %rcx
movslq 0x14(%rbx), %rdx
imulq %rcx, %rdx
cmpq %rdx, %rax
jl 0x21dea
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlrad/loadtextures.cpp
// Function: NewTextures_PushTexture(int, void*)
void NewTextures_PushTexture (int size, void *data)
{
	if (g_newtextures_num >= RADTEXTURES_MAX)
	{
		Error ("the number of textures created by hlrad has exceeded its internal limit(%d).", (int)RADTEXTURES_MAX);
	}
	g_newtextures_data[g_newtextures_num] = (byte *)malloc (size);
	hlassume (g_newtextures_data[g_newtextures_num] != NULL, assume_NoMemory);
	memcpy (g_newtextures_data[g_newtextures_num], data, size);
	g_newtextures_size[g_newtextures_num] = size;
	g_newtextures_num++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
movl 0x524f477(%rip), %r15d  # 0x52719c4
cmpl $0x800, %r15d           # imm = 0x800
jl 0x22570
leaq 0x193a0(%rip), %rdi     # 0x3b8fd
movl $0x800, %esi            # imm = 0x800
xorl %eax, %eax
callq 0x9f34
movl 0x524f454(%rip), %r15d  # 0x52719c4
movslq %ebp, %r14
movq %r14, %rdi
callq 0x4400
movslq %r15d, %rcx
leaq 0x524f44b(%rip), %r15   # 0x52719d0
movq %rax, (%r15,%rcx,8)
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa6ed
movslq 0x524f421(%rip), %r12   # 0x52719c4
movq (%r15,%r12,8), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x4240
leaq 0x5253417(%rip), %rax   # 0x52759d0
movl %r14d, (%rax,%r12,4)
leal 0x1(%r12), %eax
movl %eax, 0x524f3fc(%rip)   # 0x52719c4
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlrad/loadtextures.cpp
// Function: GetLightInt(dface_t*, int const*, int, int, float (&) [3])
static void GetLightInt (dface_t *face, const int texsize[2], int ix, int iy, vec3_t &light)
{
	ix = qmax (0, qmin (ix, texsize[0]));
	iy = qmax (0, qmin (iy, texsize[1]));
	VectorClear (light);
	if (face->lightofs < 0)
	{
		return;
	}
	for (int k = 0; k < MAXLIGHTMAPS && face->styles[k] != 255; k++)
	{
		byte *samples = &g_dlightdata[face->lightofs + k * (texsize[0] + 1) * (texsize[1] + 1) * 3];
		if (face->styles[k] == 0)
		{
			VectorAdd (light, &samples[(iy * (texsize[0] + 1) + ix) * 3], light);
		}
	}
}

// Assembly:
movl (%rsi), %eax
cmpl %edx, %eax
cmovll %eax, %edx
xorl %eax, %eax
testl %edx, %edx
cmovlel %eax, %edx
movl 0x4(%rsi), %r9d
cmpl %ecx, %r9d
cmovll %r9d, %ecx
testl %ecx, %ecx
cmovlel %eax, %ecx
movl %eax, 0x8(%r8)
movq $0x0, (%r8)
cmpl $0x0, 0x10(%rdi)
js 0x244d6
pushq %rbp
pushq %r14
pushq %rbx
leaq 0xc(%rdi), %rax
xorps %xmm0, %xmm0
xorl %r9d, %r9d
leaq 0x82c07b(%rip), %r10    # 0x850488
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movzbl (%rax), %r11d
testl %r11d, %r11d
je 0x2442e
cmpl $0xff, %r11d
jne 0x244c1
jmp 0x244d2
movslq 0x10(%rdi), %rbx
movl (%rsi), %ebp
movl 0x4(%rsi), %r11d
incl %ebp
incl %r11d
movl %r9d, %r14d
imull %ebp, %r14d
imull %r11d, %r14d
movslq %r14d, %r11
addq %rbx, %r11
addq (%r10), %r11
imull %ecx, %ebp
addl %edx, %ebp
movslq %ebp, %rbx
leaq (%rbx,%rbx,2), %rbx
movzbl (%r11,%rbx), %ebx
xorps %xmm3, %xmm3
cvtsi2ss %ebx, %xmm3
addss %xmm3, %xmm2
movss %xmm2, (%r8)
movl (%rsi), %ebx
incl %ebx
imull %ecx, %ebx
addl %edx, %ebx
movslq %ebx, %rbx
leaq (%rbx,%rbx,2), %rbx
movzbl 0x1(%r11,%rbx), %ebx
xorps %xmm3, %xmm3
cvtsi2ss %ebx, %xmm3
addss %xmm3, %xmm1
movss %xmm1, 0x4(%r8)
movl (%rsi), %ebx
incl %ebx
imull %ecx, %ebx
addl %edx, %ebx
movslq %ebx, %rbx
leaq (%rbx,%rbx,2), %rbx
movzbl 0x2(%r11,%rbx), %r11d
xorps %xmm3, %xmm3
cvtsi2ss %r11d, %xmm3
addss %xmm3, %xmm0
movss %xmm0, 0x8(%r8)
addq $0x3, %r9
incq %rax
cmpq $0xc, %r9
jne 0x24413
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlrad/loadtextures.cpp
// Function: CQ_MapPoint_r(int*, int*, cq_searchnode_s*, unsigned char const (*) [3], unsigned char const*, int)
static void CQ_MapPoint_r (int *bestdist, int *best,
					cq_searchnode_t *node, const unsigned char (*colors)[CQ_DIM],
					const unsigned char point[CQ_DIM], int searchradius)
{
	while (!node->isleafnode)
	{
		int dist = point[node->planeaxis] - node->planedist;
		if (dist <= -searchradius)
		{
			node = node->childrennode[0];
		}
		else if (dist >= searchradius - 1)
		{
			node = node->childrennode[1];
		}
		else
		{
			CQ_MapPoint_r (bestdist, best, node->childrennode[0], colors, point, searchradius);
			CQ_MapPoint_r (bestdist, best, node->childrennode[1], colors, point, searchradius);
			return;
		}
	}
	int dist = 0;
	for (int k = 0; k < CQ_DIM; k++)
	{
		dist += (colors[node->result][k] - point[k]) * (colors[node->result][k] - point[k]);
	}
	if (dist <= *bestdist)
	{
		if (dist < *bestdist || node->result < *best)
		{
			*bestdist = dist;
			*best = node->result;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r12
movq %rcx, %r13
movq %rdx, %r14
movq %rsi, 0x8(%rsp)
movq %rdi, 0x10(%rsp)
cmpb $0x0, (%rdx)
jne 0x248bc
movl %r9d, %ebp
movl %r9d, %ebx
negl %ebx
leal -0x1(%rbp), %r15d
movslq 0x18(%r14), %rax
movzbl (%r12,%rax), %ecx
subl 0x1c(%r14), %ecx
movl $0x8, %eax
cmpl %ebx, %ecx
jle 0x248b2
movl $0x10, %eax
cmpl %r15d, %ecx
jge 0x248b2
movq 0x8(%r14), %rdx
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rcx
movq %r12, %r8
movl %ebp, %r9d
callq 0x2483e
movq 0x10(%r14), %r14
jmp 0x248b6
movq (%r14,%rax), %r14
cmpb $0x0, (%r14)
je 0x24870
movslq 0x20(%r14), %rax
leaq (%rax,%rax,2), %rcx
addq %rcx, %r13
xorl %edx, %edx
xorl %ecx, %ecx
movzbl (%r13,%rdx), %esi
movzbl (%r12,%rdx), %edi
subl %edi, %esi
imull %esi, %esi
addl %esi, %ecx
incq %rdx
cmpq $0x3, %rdx
jne 0x248cb
movq 0x10(%rsp), %rdx
cmpl (%rdx), %ecx
jg 0x2490c
jl 0x248fa
movq 0x8(%rsp), %rdx
cmpl (%rdx), %eax
jge 0x2490c
movq 0x10(%rsp), %rax
movl %ecx, (%rax)
movl 0x20(%r14), %eax
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlrad/mathutil.cpp
// Function: point_in_winding(Winding const&, dplane_t const&, float const*, float)
bool            point_in_winding(const Winding& w, const dplane_t& plane, const vec_t* const point, vec_t epsilon/* = 0.0*/)
{
	int				numpoints;
	int				x;
	vec3_t			delta;
	vec3_t			normal;
	vec_t			dist;

	numpoints = w.m_NumPoints;

	for (x = 0; x < numpoints; x++)
	{
		VectorSubtract (w.m_Points[(x+ 1) % numpoints], w.m_Points[x], delta);
		CrossProduct (delta, plane.normal, normal);
		dist = DotProduct (point, normal) - DotProduct (w.m_Points[x], normal);

		if (dist < 0.0
			&& (epsilon == 0.0 || dist * dist > epsilon * epsilon * DotProduct (normal, normal)))
		{
			return false;
		}
	}

	return true;
}

// Assembly:
movslq 0x8(%rdi), %rcx
testq %rcx, %rcx
jle 0x24a9d
movq 0x10(%rdi), %rdi
movss 0x8(%rsi), %xmm1
movss (%rsi), %xmm4
movss 0x4(%rsi), %xmm3
movss %xmm0, -0x4(%rsp)
mulss %xmm0, %xmm0
movss (%rdx), %xmm5
movss 0x4(%rdx), %xmm6
movss 0x8(%rdx), %xmm7
leaq 0x8(%rdi), %rdx
movq %rcx, %rsi
negq %rsi
movl $0x1, %r8d
xorl %eax, %eax
xorps %xmm8, %xmm8
movq %rsi, %r9
addq %r8, %r9
movl $0x0, %r9d
cmovneq %r8, %r9
leaq (%r9,%r9,2), %r9
movss (%rdi,%r9,4), %xmm9
movss 0x4(%rdi,%r9,4), %xmm10
movss -0x8(%rdx), %xmm14
movss -0x4(%rdx), %xmm13
subss %xmm14, %xmm9
subss %xmm13, %xmm10
movss 0x8(%rdi,%r9,4), %xmm11
movss (%rdx), %xmm12
subss %xmm12, %xmm11
movaps %xmm3, %xmm15
mulss %xmm11, %xmm15
movaps %xmm4, %xmm2
mulss %xmm10, %xmm2
mulss %xmm1, %xmm10
subss %xmm15, %xmm10
movaps %xmm1, %xmm15
mulss %xmm9, %xmm15
mulss %xmm4, %xmm11
subss %xmm15, %xmm11
mulss %xmm3, %xmm9
subss %xmm2, %xmm9
movaps %xmm11, %xmm2
shufps $0x0, %xmm11, %xmm2     # xmm2 = xmm2[0,0],xmm11[0,0]
movlhps %xmm6, %xmm13           # xmm13 = xmm13[0],xmm6[0]
shufps $0xe2, %xmm6, %xmm13    # xmm13 = xmm13[2,0],xmm6[2,3]
mulps %xmm2, %xmm13
movlhps %xmm5, %xmm14           # xmm14 = xmm14[0],xmm5[0]
shufps $0xe2, %xmm5, %xmm14    # xmm14 = xmm14[2,0],xmm5[2,3]
movaps %xmm10, %xmm2
shufps $0x0, %xmm10, %xmm2     # xmm2 = xmm2[0,0],xmm10[0,0]
mulps %xmm14, %xmm2
addps %xmm13, %xmm2
movlhps %xmm7, %xmm12           # xmm12 = xmm12[0],xmm7[0]
shufps $0xe2, %xmm7, %xmm12    # xmm12 = xmm12[2,0],xmm7[2,3]
movaps %xmm9, %xmm13
shufps $0x0, %xmm9, %xmm13     # xmm13 = xmm13[0,0],xmm9[0,0]
mulps %xmm12, %xmm13
addps %xmm2, %xmm13
movaps %xmm13, %xmm2
shufps $0x55, %xmm13, %xmm2    # xmm2 = xmm2[1,1],xmm13[1,1]
subps %xmm2, %xmm13
ucomiss %xmm13, %xmm8
jbe 0x24a7d
movss -0x4(%rsp), %xmm2
ucomiss %xmm8, %xmm2
jne 0x24a54
jnp 0x24a9f
mulss %xmm13, %xmm13
mulss %xmm11, %xmm11
mulss %xmm10, %xmm10
addss %xmm11, %xmm10
mulss %xmm9, %xmm9
addss %xmm10, %xmm9
mulss %xmm0, %xmm9
ucomiss %xmm9, %xmm13
ja 0x24a9f
cmpq %rcx, %r8
setae %al
addq $0xc, %rdx
leaq (%rsi,%r8), %r9
incq %r9
incq %r8
cmpq $0x1, %r9
jne 0x24969
jmp 0x24a9f
movb $0x1, %al
andb $0x1, %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlrad/mathutil.cpp
// Function: plane_from_points(float const*, float const*, float const*, dplane_t*)
void            plane_from_points(const vec3_t p1, const vec3_t p2, const vec3_t p3, dplane_t* plane)
{
    vec3_t          delta1;
    vec3_t          delta2;
    vec3_t          normal;

    VectorSubtract(p3, p2, delta1);
    VectorSubtract(p1, p2, delta2);
    CrossProduct(delta1, delta2, normal);
    VectorNormalize(normal);
    plane->dist = DotProduct(normal, p1);
    VectorCopy(normal, plane->normal);
}

// Assembly:
movss (%rdx), %xmm5
movss (%rsi), %xmm7
subss %xmm7, %xmm5
movss (%rdi), %xmm0
movss 0x4(%rdi), %xmm2
movss 0x8(%rdi), %xmm1
movsd 0x4(%rdx), %xmm4
movsd 0x4(%rsi), %xmm8
subps %xmm8, %xmm4
movaps %xmm2, %xmm3
subss %xmm8, %xmm3
movaps %xmm1, %xmm6
unpcklps %xmm0, %xmm6            # xmm6 = xmm6[0],xmm0[0],xmm6[1],xmm0[1]
shufps $0xd4, %xmm8, %xmm7     # xmm7 = xmm7[0,1],xmm8[1,3]
shufps $0x52, %xmm8, %xmm7     # xmm7 = xmm7[2,0],xmm8[1,1]
subps %xmm7, %xmm6
movaps %xmm6, %xmm7
shufps $0x0, %xmm6, %xmm7      # xmm7 = xmm7[0,0],xmm6[0,0]
movss %xmm3, %xmm7            # xmm7 = xmm3[0],xmm7[1,2,3]
mulss %xmm5, %xmm3
shufps $0xd4, %xmm4, %xmm5     # xmm5 = xmm5[0,1],xmm4[1,3]
shufps $0x52, %xmm4, %xmm5     # xmm5 = xmm5[2,0],xmm4[1,1]
mulps %xmm5, %xmm7
movaps %xmm4, %xmm5
mulps %xmm6, %xmm5
subps %xmm7, %xmm5
shufps $0x55, %xmm6, %xmm6     # xmm6 = xmm6[1,1,1,1]
mulss %xmm4, %xmm6
subss %xmm6, %xmm3
movaps %xmm5, %xmm4
mulps %xmm5, %xmm4
shufps $0x55, %xmm4, %xmm4     # xmm4 = xmm4[1,1,1,1]
movaps %xmm5, %xmm6
mulss %xmm5, %xmm6
addss %xmm4, %xmm6
movaps %xmm3, %xmm4
mulss %xmm3, %xmm4
addss %xmm6, %xmm4
cvtss2sd %xmm4, %xmm4
xorps %xmm6, %xmm6
sqrtsd %xmm4, %xmm6
movsd 0x11bac(%rip), %xmm4    # 0x37118
ucomisd %xmm6, %xmm4
jbe 0x2557b
xorpd %xmm4, %xmm4
xorps %xmm3, %xmm3
jmp 0x2559a
cvtps2pd %xmm5, %xmm4
movapd %xmm6, %xmm5
unpcklpd %xmm6, %xmm5            # xmm5 = xmm5[0],xmm6[0]
divpd %xmm5, %xmm4
cvtpd2ps %xmm4, %xmm4
cvtss2sd %xmm3, %xmm3
divsd %xmm6, %xmm3
cvtsd2ss %xmm3, %xmm3
movapd %xmm4, %xmm5
shufps $0x55, %xmm4, %xmm5     # xmm5 = xmm5[1,1],xmm4[1,1]
mulss %xmm5, %xmm2
mulss %xmm4, %xmm0
addss %xmm2, %xmm0
mulss %xmm3, %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0xc(%rcx)
movlpd %xmm4, (%rcx)
movss %xmm3, 0x8(%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlrad/mathutil.cpp
// Function: LineSegmentIntersectsBounds_r(float const*, float const*, float const*, float const*, int)
bool LineSegmentIntersectsBounds_r (const vec_t* p1, const vec_t* p2, const vec_t* mins, const vec_t* maxs, int d)
{
	vec_t lmin, lmax;
	const vec_t* tmp;
	vec3_t x1, x2;
	int i;
	d--;
	if (p2[d]<p1[d])
		tmp=p1, p1=p2, p2=tmp;
	if (p2[d]<mins[d] || p1[d]>maxs[d])
		return false;
	if (d==0)
		return true;
	lmin = p1[d]>=mins[d]? 0 : (mins[d]-p1[d])/(p2[d]-p1[d]);
	lmax = p2[d]<=maxs[d]? 1 : (p2[d]-maxs[d])/(p2[d]-p1[d]);
	for (i=0; i<d; ++i)
	{
		x1[i]=(1-lmin)*p1[i]+lmin*p2[i];
		x2[i]=(1-lmax)*p2[i]+lmax*p2[i];
	}
	return LineSegmentIntersectsBounds_r (x1, x2, mins, maxs, d);
}

// Assembly:
movl %r8d, %eax
movslq %r8d, %r8
movss -0x4(%rdi,%r8,4), %xmm0
ucomiss -0x4(%rsi,%r8,4), %xmm0
movq %rsi, %r9
cmovaq %rdi, %r9
cmovaq %rsi, %rdi
movss -0x4(%r9,%r8,4), %xmm0
movss -0x4(%rdx,%r8,4), %xmm1
ucomiss %xmm0, %xmm1
ja 0x2560a
decq %r8
movss (%rdi,%r8,4), %xmm3
movss (%rcx,%r8,4), %xmm2
ucomiss %xmm2, %xmm3
jbe 0x2560d
xorl %eax, %eax
retq
testl %r8d, %r8d
je 0x256c4
subq $0x18, %rsp
cmpl $0x2, %eax
jl 0x256b2
movaps %xmm1, %xmm4
subss %xmm3, %xmm4
movaps %xmm0, %xmm5
subss %xmm3, %xmm5
divss %xmm5, %xmm4
cmpnless %xmm3, %xmm1
andps %xmm4, %xmm1
movaps %xmm0, %xmm3
subss %xmm2, %xmm3
divss %xmm5, %xmm3
cmpnless %xmm2, %xmm0
andps %xmm0, %xmm3
movss 0x11a4c(%rip), %xmm2    # 0x370a4
andnps %xmm2, %xmm0
orps %xmm3, %xmm0
movss 0x11a3e(%rip), %xmm2    # 0x370a4
movaps %xmm2, %xmm3
subss %xmm1, %xmm3
subss %xmm0, %xmm2
movl %r8d, %eax
xorl %esi, %esi
movss (%r9,%rsi,4), %xmm4
movaps %xmm1, %xmm5
mulss %xmm4, %xmm5
movss (%rdi,%rsi,4), %xmm6
mulss %xmm3, %xmm6
addss %xmm5, %xmm6
movss %xmm6, 0xc(%rsp,%rsi,4)
movaps %xmm0, %xmm5
mulss %xmm4, %xmm5
mulss %xmm2, %xmm4
addss %xmm5, %xmm4
movss %xmm4, (%rsp,%rsi,4)
incq %rsi
cmpq %rsi, %rax
jne 0x25676
leaq 0xc(%rsp), %rdi
movq %rsp, %rsi
callq 0x255c5
addq $0x18, %rsp
retq
movb $0x1, %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlrad/nomatrix.cpp
// Function: MakeScalesNoVismatrix()
void            MakeScalesNoVismatrix()
{
    char            transferfile[_MAX_PATH];

    hlassume(g_num_patches < MAX_PATCHES, assume_MAX_PATCHES);

#ifdef ZHLT_DEFAULTEXTENSION_FIX
	safe_snprintf(transferfile, _MAX_PATH, "%s.inc", g_Mapname);
#else
    safe_strncpy(transferfile, g_source, _MAX_PATH);
    StripExtension(transferfile);
    DefaultExtension(transferfile, ".inc");
#endif

    if (!g_incremental || !readtransfers(transferfile, g_num_patches))
    {
        g_CheckVisBit = CheckVisBitNoVismatrix;
#ifndef HLRAD_HULLU
        NamedRunThreadsOn(g_num_patches, g_estimate, MakeScales);
#else
	if(g_rgb_transfers)
		{NamedRunThreadsOn(g_num_patches, g_estimate, MakeRGBScales);}
	else
		{NamedRunThreadsOn(g_num_patches, g_estimate, MakeScales);}
#endif

#ifndef HLRAD_NOSWAP
        // invert the transfers for gather vs scatter
#ifndef HLRAD_HULLU
        NamedRunThreadsOnIndividual(g_num_patches, g_estimate, SwapTransfers);
#else
	if(g_rgb_transfers)
		{NamedRunThreadsOnIndividual(g_num_patches, g_estimate, SwapRGBTransfers);}
	else
		{NamedRunThreadsOnIndividual(g_num_patches, g_estimate, SwapTransfers);}
#endif
#endif /*HLRAD_NOSWAP*/
        if (g_incremental)
        {
            writetransfers(transferfile, g_num_patches);
        }
        else
        {
            unlink(transferfile);
        }
        DumpTransfersMemoryUsage();
#ifdef HLRAD_OPAQUE_STYLE_BOUNCE
		CreateFinalStyleArrays ("dynamic shadow array");
#endif
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
leaq 0x541148a(%rip), %r14   # 0x54379e8
xorl %edi, %edi
cmpl $0xffff0, (%r14)        # imm = 0xFFFF0
setb %dil
movl $0x1b, %esi
callq 0xa6ed
leaq 0x12482(%rip), %rdx     # 0x389fe
leaq 0x20dcd(%rip), %rcx     # 0x47350
movq %rsp, %rdi
movl $0x1000, %esi           # imm = 0x1000
xorl %eax, %eax
callq 0x8817
leaq 0x54d3467(%rip), %r15   # 0x54f9a00
cmpb $0x1, (%r15)
jne 0x265b2
movl (%r14), %esi
movq %rsp, %rdi
callq 0x33e18
testb %al, %al
jne 0x26645
leaq 0x99(%rip), %rax        # 0x26652
leaq 0x66d3578(%rip), %rcx   # 0x66f9b38
movq %rax, (%rcx)
leaq 0x54d345f(%rip), %rax   # 0x54f9a29
leaq 0x1556b(%rip), %rcx     # 0x3bb3c
leaq 0x15573(%rip), %rdi     # 0x3bb4b
cmpb $0x0, (%rax)
cmovneq %rcx, %rdi
leaq 0xeafd(%rip), %rbx      # 0x350e3
cmovneq 0x20992(%rip), %rbx     # 0x46f80
callq 0x9d92
leaq 0x150c5(%rip), %rdi     # 0x3b6bf
movq %rax, %rsi
xorl %eax, %eax
callq 0x9c46
movl (%r14), %edi
leaq 0x21e16(%rip), %rax     # 0x48424
movzbl (%rax), %esi
movq %rbx, %rdx
callq 0xb356
cmpb $0x1, (%r15)
jne 0x2662c
movl (%r14), %esi
movq %rsp, %rdi
callq 0x33c7c
jmp 0x26634
movq %rsp, %rdi
callq 0x4160
callq 0x36392
leaq 0x15517(%rip), %rdi     # 0x3bb57
callq 0x346ee
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlrad/qrad.cpp
// Function: ReadCustomChopValue()
void ReadCustomChopValue()
{
	int num;
	int i, k;
	entity_t *mapent;
	epair_t *ep;

	num = ((dmiptexlump_t *)g_dtexdata)->nummiptex;
	chopscales = (vec_t *)malloc (num * sizeof(vec_t));
	for (i = 0; i < num; i++)
	{
		chopscales[i] = 1.0;
	}
	for (k = 0; k < g_numentities; k++)
	{
		mapent = &g_entities[k];
		if (strcmp(ValueForKey(mapent, "classname"), "info_chopscale"))
			continue;
		Developer (DEVELOPER_LEVEL_MESSAGE, "info_chopscale 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;
				if (atof (ep->value) <= 0)
					continue;
				chopscales[i] = atof (ep->value);
				Developer (DEVELOPER_LEVEL_MESSAGE, "info_chopscale: %s = %f\n", texname, chopscales[i]);
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x82944b(%rip), %rax    # 0x850498
movq (%rax), %rax
movslq (%rax), %rbp
leaq (,%rbp,4), %rdi
callq 0x4400
movq %rax, 0x5512b11(%rip)   # 0x5539b78
testq %rbp, %rbp
jle 0x27084
xorl %eax, %eax
movq 0x5512b03(%rip), %rcx   # 0x5539b78
movl $0x3f800000, (%rcx,%rax,4) # imm = 0x3F800000
incq %rax
cmpq %rax, %rbp
jne 0x2706e
leaq 0x2017399(%rip), %rax   # 0x203e424
cmpl $0x0, (%rax)
jle 0x271ba
leaq 0x17512(%rip), %r12     # 0x3e5ad
xorl %ecx, %ecx
movq %rcx, 0x8(%rsp)
movq %rcx, %rdi
shlq $0x5, %rdi
addq 0x1ff20(%rip), %rdi     # 0x46fd0
movq %rdi, 0x10(%rsp)
leaq 0x10547(%rip), %rsi     # 0x37603
callq 0x752d
movq %rax, %rdi
leaq 0x150a0(%rip), %rsi     # 0x3c16b
callq 0x4430
testl %eax, %eax
jne 0x2719f
movl $0x3, %edi
leaq 0x15096(%rip), %rsi     # 0x3c17a
xorl %eax, %eax
callq 0xa446
testl %ebp, %ebp
jle 0x2719f
xorl %r14d, %r14d
movq 0x10(%rsp), %rax
movq 0x18(%rax), %r13
testq %r13, %r13
je 0x27193
leaq 0x829389(%rip), %rax    # 0x850498
movq (%rax), %rax
movslq 0x4(%rax,%r14,4), %r15
addq %rax, %r15
movq 0x8(%r13), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4310
testl %eax, %eax
je 0x27138
movq (%r13), %r13
testq %r13, %r13
jne 0x2711a
jmp 0x27193
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4310
testl %eax, %eax
je 0x2712d
movq 0x10(%r13), %rdi
callq 0x43b0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x2712d
cvtsd2ss %xmm0, %xmm0
movq 0x5512a13(%rip), %rax   # 0x5539b78
movss %xmm0, (%rax,%r14,4)
movq 0x5512a06(%rip), %rax   # 0x5539b78
xorps %xmm0, %xmm0
cvtss2sd (%rax,%r14,4), %xmm0
movl $0x3, %edi
leaq 0x15014(%rip), %rsi     # 0x3c19b
movq %r15, %rdx
movb $0x1, %al
callq 0xa446
jmp 0x2712d
incq %r14
cmpq %rbp, %r14
jne 0x270f6
movq 0x8(%rsp), %rcx
incq %rcx
leaq 0x2017276(%rip), %rax   # 0x203e424
movslq (%rax), %rax
cmpq %rax, %rcx
jl 0x2709d
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/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 0x829289(%rip), %rax    # 0x850498
movq (%rax), %rax
movslq (%rax), %r13
leaq (,%r13,4), %rdi
callq 0x4400
movq %rax, 0x5512957(%rip)   # 0x5539b80
testq %r13, %r13
jle 0x2724c
movss 0x54d27ce(%rip), %xmm0  # 0x54f9a04
xorl %eax, %eax
movq 0x5512941(%rip), %rcx   # 0x5539b80
movss %xmm0, (%rcx,%rax,4)
incq %rax
cmpq %rax, %r13
jne 0x27238
leaq 0x20171d1(%rip), %rax   # 0x203e424
cmpl $0x0, (%rax)
jle 0x2737b
leaq 0x1734a(%rip), %r12     # 0x3e5ad
xorl %ecx, %ecx
movq %rcx, 0x8(%rsp)
movq %rcx, %rdi
shlq $0x5, %rdi
addq 0x1fd58(%rip), %rdi     # 0x46fd0
movq %rdi, 0x10(%rsp)
leaq 0x1037f(%rip), %rsi     # 0x37603
callq 0x752d
movq %rax, %rdi
leaq 0x14f21(%rip), %rsi     # 0x3c1b4
callq 0x4430
testl %eax, %eax
jne 0x27360
movl $0x3, %edi
leaq 0x14f19(%rip), %rsi     # 0x3c1c5
xorl %eax, %eax
callq 0xa446
testl %r13d, %r13d
jle 0x27360
xorl %r14d, %r14d
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rbp
testq %rbp, %rbp
je 0x27354
leaq 0x8291c0(%rip), %rax    # 0x850498
movq (%rax), %rax
movslq 0x4(%rax,%r14,4), %r15
addq %rax, %r15
movq 0x8(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4310
testl %eax, %eax
jne 0x2734b
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4310
testl %eax, %eax
je 0x2734b
movq 0x10(%rbp), %rdi
callq 0x43b0
mulsd 0x13322(%rip), %xmm0    # 0x3a638
callq 0x45f0
cvtsd2ss %xmm0, %xmm0
movq 0x551285a(%rip), %rax   # 0x5539b80
movss %xmm0, (%rax,%r14,4)
movq 0x10(%rbp), %rdi
callq 0x43b0
movl $0x3, %edi
leaq 0x14ea7(%rip), %rsi     # 0x3c1e8
movq %r15, %rdx
movb $0x1, %al
callq 0xa446
movq (%rbp), %rbp
testq %rbp, %rbp
jne 0x272e3
incq %r14
cmpq %r13, %r14
jne 0x272bf
movq 0x8(%rsp), %rcx
incq %rcx
leaq 0x20170b5(%rip), %rax   # 0x203e424
movslq (%rax), %rax
cmpq %rax, %rcx
jl 0x27265
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/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movl %edi, %ecx
leaq 0x54ec465(%rip), %rax   # 0x5519b50
movl %esi, (%rax,%rcx,4)
movb $0x1, %bpl
xorl %eax, %eax
leaq (%rcx,%rcx,2), %r14
shlq $0x3, %r14
addq 0x198ae(%rip), %r14     # 0x46fb0
leaq 0x54cc467(%rip), %r15   # 0x54f9b70
movswl 0x4(%r14,%rax,2), %edi
testl %edi, %edi
js 0x2d71c
movl %ebx, %esi
callq 0x2d6d9
jmp 0x2d722
notl %edi
movl %ebx, (%r15,%rdi,4)
movl $0x1, %eax
testb $0x1, %bpl
movl $0x0, %ebp
jne 0x2d709
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
movl 0x8(%rdi), %ecx
testq %rcx, %rcx
je 0x2dd7a
movq 0x10(%rdi), %rax
movsd 0x8(%rbx), %xmm0
movss 0x10(%rbx), %xmm1
shlq $0x2, %rcx
leaq (%rcx,%rcx,2), %rcx
movss 0xcd06(%rip), %xmm2     # 0x3aa34
xorl %edx, %edx
movss 0x8(%rax,%rdx), %xmm3
movsd (%rax,%rdx), %xmm4
subps %xmm0, %xmm4
subss %xmm1, %xmm3
mulps %xmm4, %xmm4
cvtps2pd %xmm4, %xmm4
movapd %xmm4, %xmm5
unpckhpd %xmm4, %xmm5            # xmm5 = xmm5[1],xmm4[1]
addsd %xmm4, %xmm5
mulss %xmm3, %xmm3
cvtss2sd %xmm3, %xmm3
addsd %xmm5, %xmm3
sqrtsd %xmm3, %xmm3
cvtsd2ss %xmm3, %xmm3
maxss %xmm2, %xmm3
addq $0xc, %rdx
movaps %xmm3, %xmm2
cmpq %rdx, %rcx
jne 0x2dd30
jmp 0x2dd82
movss 0xccb2(%rip), %xmm3     # 0x3aa34
movss %xmm3, 0x4(%rsp)
callq 0xb942
movss 0x4(%rsp), %xmm2
movss 0xc8e5(%rip), %xmm1     # 0x3a680
mulss %xmm2, %xmm1
mulss %xmm2, %xmm1
movl $0x5, %ebp
ucomiss %xmm0, %xmm1
jbe 0x2de02
movss 0xccab(%rip), %xmm1     # 0x3aa60
mulss %xmm2, %xmm1
mulss %xmm2, %xmm1
movl $0x6, %ebp
ucomiss %xmm0, %xmm1
jbe 0x2de02
movss 0xde11(%rip), %xmm1     # 0x3bbe0
mulss %xmm2, %xmm1
mulss %xmm2, %xmm1
movl $0x7, %ebp
ucomiss %xmm0, %xmm1
jbe 0x2de02
divss 0xddf7(%rip), %xmm0     # 0x3bbe0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x2ddfa
xorps %xmm2, %xmm2
sqrtss %xmm0, %xmm2
jmp 0x2de02
callq 0x45b0
movaps %xmm0, %xmm2
cmpb $0x0, 0x54cbd5f(%rip)   # 0x54f9b68
xorps %xmm0, %xmm0
jne 0x2de19
mulss 0xdd22(%rip), %xmm2     # 0x3bb38
movaps %xmm2, %xmm0
movss %xmm0, 0x1c(%rbx)
movl %ebp, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2f11b
movq %rsi, %rbx
movss (%rsi), %xmm0
movss 0x4(%rsi), %xmm1
movss 0x8(%rsi), %xmm2
leaq 0x10c135b(%rip), %rax   # 0x10f0400
leaq 0xb01344(%rip), %rcx    # 0xb303f0
movsd 0xf7f4(%rip), %xmm3     # 0x3e8a8
movsd 0xf7f4(%rip), %xmm4     # 0x3e8b0
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 0x2f112
movl $0x6, %edx
ucomisd %xmm5, %xmm4
jbe 0x2f135
movswl (%r15,%rdx), %edi
testl %edi, %edi
jns 0x2f0bc
notl %edi
leaq (%rdi,%rdi,8), %rax
leaq (%rax,%rax,2), %rax
addq %rdi, %rax
addq 0x17e29(%rip), %rax     # 0x46f58
popq %rbx
popq %r14
popq %r15
retq
movswl 0x4(%r15), %edi
movq %rbx, %rsi
callq 0x2f080
movq %rax, %r14
movswl 0x6(%r15), %edi
movq %rbx, %rsi
callq 0x2f080
movq %rax, %rcx
leaq 0xa21364(%rip), %rax    # 0xa504c0
cmpq %rax, %r14
je 0x2f12f
movl (%r14), %edx
cmpl $-0x2, %edx
jne 0x2f16e
movq %r14, %rax
jmp 0x2f12f
leaq 0xa2134b(%rip), %rax    # 0xa504c0
cmpq %rax, %rcx
je 0x2f12f
movl (%rcx), %esi
cmpl $-0x2, %esi
jne 0x2f186
movq %rcx, %rax
jmp 0x2f12f
cmpl $-0x6, %edx
je 0x2f169
movq %rcx, %rax
cmpl $-0x6, %esi
je 0x2f12f
cmpl %esi, %edx
je 0x2f169
leaq 0xa21322(%rip), %r14    # 0xa504c0
jmp 0x2f169
// File: /workspace/github_cpp_makefile_star2_O3/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 0x10c123f(%rip), %rax   # 0x10f0400
leaq 0xb01228(%rip), %rcx    # 0xb303f0
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 0x2f1cb
notl %edx
leaq (%rdx,%rdx,8), %rax
leaq (%rax,%rax,2), %rax
addq %rdx, %rax
addq 0x17d2b(%rip), %rax     # 0x46f58
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1b81158(%rip), %rcx   # 0x1bb0400
cmpw $0x0, 0x2(%rcx,%rax,4)
movzwl (%rcx,%rax,4), %eax
leaq (%rax,%rax,4), %rax
jne 0x2f2c1
leaq 0xb01131(%rip), %rcx    # 0xb303f0
jmp 0x2f2c8
leaq 0x552a908(%rip), %rcx   # 0x5559bd0
leaq (%rcx,%rax,4), %rax
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0xb01110(%rip), %rax    # 0xb303e4
movslq (%rax), %rax
testq %rax, %rax
jle 0x2f341
leaq 0x9aed(%rip), %rcx      # 0x38dd0
movsd (%rcx), %xmm0
movss 0x8(%rcx), %xmm1
shlq $0x2, %rax
leaq (%rax,%rax,4), %rax
xorl %ecx, %ecx
leaq 0xb010f3(%rip), %rdx    # 0xb303f0
movaps 0x7d7c(%rip), %xmm2     # 0x37080
leaq 0x552a8c5(%rip), %rsi   # 0x5559bd0
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 0x2f30b
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2f359
leaq 0xf5c6(%rip), %rdi      # 0x3e918
xorl %eax, %eax
callq 0x9f34
cmpw $0x0, 0x2(%rbx)
movzwl (%rbx), %eax
leaq (%rax,%rax,4), %rax
jne 0x2f370
leaq 0xb01082(%rip), %rcx    # 0xb303f0
jmp 0x2f377
leaq 0x552a859(%rip), %rcx   # 0x5559bd0
leaq (%rcx,%rax,4), %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1b81076(%rip), %rdx   # 0x1bb0400
leaq (%rdx,%rax,4), %rax
leaq (%rcx,%rcx,2), %rcx
shlq $0x2, %rcx
movl $0x0, 0x10(%rsi)
movzwl (%rax), %edx
addq 0x17bd1(%rip), %rcx     # 0x46f78
cmpw $0x0, 0x2(%rax)
je 0x2f3bb
leaq (%rdx,%rdx,4), %rdx
leaq 0x552a817(%rip), %rdi   # 0x5559bd0
jmp 0x2f3c6
leaq (%rdx,%rdx,4), %rdx
leaq 0xb0102a(%rip), %rdi    # 0xb303f0
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_O3/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 0xa6ed
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 0x2f8fb
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0xa6ed
leaq 0xeec2(%rip), %rax      # 0x3e900
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 0x2fa43
incq %r12
addq $0x4, %rbx
cmpq $0x3, %r12
jne 0x2fa3e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2facb
movss 0x75b0(%rip), %xmm1     # 0x370a4
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_O3/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 0x1b80864(%rip), %rdx   # 0x1bb0400
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 0x2fbc3
leaq 0xb0082f(%rip), %rdx    # 0xb303f0
jmp 0x2fbca
leaq 0x552a006(%rip), %rdx   # 0x5559bd0
addq 0x1739f(%rip), %rax     # 0x46f70
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 0x2fbdb
movss 0xc(%rax), %xmm0
movss %xmm0, 0x24(%rsi)
movss 0x1c(%rax), %xmm0
movss %xmm0, 0x28(%rsi)
movss 0xc(%rcx), %xmm0
xorps 0x745a(%rip), %xmm0     # 0x37080
movss %xmm0, 0x2c(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0xa3c5(%rip), %xmm0     # 0x3bb10
movsd %xmm0, (%rdx)
movl $0x3f800000, 0x8(%rdx)  # imm = 0x3F800000
movb $0x1, %al
cmpl %esi, %edi
je 0x3181a
movq %rdx, %r14
movl %esi, %ebp
movl %edi, %r15d
movq %rcx, (%rsp)
movl %esi, %r12d
cmoval %edi, %r12d
movl %esi, %r13d
cmovbl %edi, %r13d
leaq 0x5406267(%rip), %rbx   # 0x54379e8
movl (%rbx), %eax
cmpl %eax, %r13d
jbe 0x31798
leaq 0xd422(%rip), %rdi      # 0x3ebb1
xorl %eax, %eax
callq 0xa2a6
movl (%rbx), %eax
cmpl %eax, %r12d
jbe 0x317ab
leaq 0xd42f(%rip), %rdi      # 0x3ebd3
xorl %eax, %eax
callq 0xa2a6
movq 0x66c830e(%rip), %rsi   # 0x66f9ac0
movl %r13d, %r13d
shlq $0x4, %r13
movl 0x8(%rsi,%r13), %edx
xorl %eax, %eax
testl %edx, %edx
je 0x3181a
movl %r12d, %ecx
shrl $0x3, %ecx
addq %r13, %rsi
decl %edx
movq (%rsi), %rsi
leal (%rax,%rdx), %r9d
movl %r9d, %r8d
shrl $0x1f, %r8d
addl %r9d, %r8d
sarl %r8d
movslq %r8d, %rbx
movl (%rsi,%rbx,4), %edi
movl %edi, %r10d
andl $0xffffff, %r10d        # imm = 0xFFFFFF
cmpl %ecx, %r10d
jae 0x31800
incl %r8d
movl %r8d, %eax
jmp 0x31808
jbe 0x3180e
decl %r8d
movl %r8d, %edx
cmpl %edx, %eax
jle 0x317d2
jmp 0x31818
addl $0x3, %r9d
cmpl $0x2, %r9d
jae 0x31829
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x54c81f8(%rip), %rax   # 0x54f9a28
cmpb $0x1, (%rax)
jne 0x31854
movl %r15d, %edi
movl %ebp, %esi
movq %r14, %rdx
movq (%rsp), %rcx
callq 0x34527
movq 0x66c8273(%rip), %rax   # 0x66f9ac0
movq (%rax,%r13), %rax
movl (%rax,%rbx,4), %edi
shrl $0x18, %edi
andl $0x7, %r12d
btl %r12d, %edi
setb %al
jmp 0x3181a