LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: FreeSlave[P]vhlt/hlrad/lerp.cpp
// Function: CreateTriangulations(int)
void CreateTriangulations (int facenum)
{
	try
	{

	facetriangulation_t *facetrian;
	int patchnum;
	const patch_t *patch;
	localtriangulation_t *lt;

	g_facetriangulations[facenum] = new facetriangulation_t;
	facetrian = g_facetriangulations[facenum];

	facetrian->facenum = facenum;

	// Find neighbors
	FindNeighbors (facetrian);

	// Build walls
	BuildWalls (facetrian);

	// Create local triangulation around each patch
	facetrian->localtriangulations.resize (0);
	for (patch = g_face_patches[facenum]; patch; patch = patch->next)
	{
		patchnum = patch - g_patches;
		lt = CreateLocalTriangulation (facetrian, patchnum);
		facetrian->localtriangulations.push_back (lt);
	}

	// Collect used patches
	CollectUsedPatches (facetrian);

	}
	catch (std::bad_alloc)
	{
		hlassume (false, assume_NoMemory);
	}
}

// Assembly:
subq $0x58, %rsp
movl %edi, 0x54(%rsp)
movl $0x68, %edi
callq 0x4320
movq %rax, 0x10(%rsp)
jmp 0x16e49
movq 0x10(%rsp), %rdi
callq 0x1f2b0
movq 0x10(%rsp), %rdx
movslq 0x54(%rsp), %rcx
leaq 0x20eaacc(%rip), %rax   # 0x2101930
movq %rdx, (%rax,%rcx,8)
movslq 0x54(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x48(%rsp)
movl 0x54(%rsp), %ecx
movq 0x48(%rsp), %rax
movl %ecx, (%rax)
movq 0x48(%rsp), %rdi
callq 0x16fe0
jmp 0x16e8d
movq 0x48(%rsp), %rdi
callq 0x17400
jmp 0x16e99
movq 0x48(%rsp), %rdi
addq $0x38, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f300
jmp 0x16ead
movslq 0x54(%rsp), %rcx
leaq 0x5296b47(%rip), %rax   # 0x52ada00
movq (%rax,%rcx,8), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x16f94
movq 0x38(%rsp), %rax
leaq 0x53d6b26(%rip), %rcx   # 0x53eda00
movq (%rcx), %rcx
subq %rcx, %rax
shrq $0x3, %rax
imull $0x96f96f97, %eax, %eax # imm = 0x96F96F97
movl %eax, 0x44(%rsp)
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
callq 0x17990
movq %rax, 0x8(%rsp)
jmp 0x16f03
movq 0x8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x48(%rsp), %rdi
addq $0x38, %rdi
leaq 0x30(%rsp), %rsi
callq 0x1f3a0
jmp 0x16f22
jmp 0x16f24
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x38(%rsp)
jmp 0x16ec2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x16fc3
movq 0x28(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x43f0
movq %rax, %rsi
leaq 0x18(%rsp), %rdi
callq 0x1f260
movq (%rsp), %rdi
callq 0x4140
xorl %edi, %edi
movl $0x1, %esi
callq 0xbf00
jmp 0x16f80
leaq 0x18(%rsp), %rdi
callq 0x4200
callq 0x4580
addq $0x58, %rsp
retq
movq 0x48(%rsp), %rdi
callq 0x18260
jmp 0x16fa0
jmp 0x16f8f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x4200
callq 0x4580
jmp 0x16fc1
jmp 0x16fc3
movq 0x28(%rsp), %rdi
callq 0x45c0
movq %rax, %rdi
callq 0x1f2a0
nopw %cs:(%rax,%rax)
// File: FreeSlave[P]vhlt/hlrad/lerp.cpp
// Function: FreeTriangulations()
void FreeTriangulations ()
{
	try
	{

	int i;
	int j;
	facetriangulation_t *facetrian;

	for (i = 0; i < g_numfaces; i++)
	{
		facetrian = g_facetriangulations[i];

		for (j = 0; j < (int)facetrian->localtriangulations.size (); j++)
		{
			FreeLocalTriangulation (facetrian->localtriangulations[j]);
		}

		delete facetrian;
		g_facetriangulations[i] = NULL;
	}

	}
	catch (std::bad_alloc)
	{
		hlassume (false, assume_NoMemory);
	}
}

// Assembly:
subq $0x48, %rsp
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
leaq 0x1bcdf2d(%rip), %rcx   # 0x1be6404
cmpl (%rcx), %eax
jge 0x18601
movslq 0x44(%rsp), %rcx
leaq 0x20e9445(%rip), %rax   # 0x2101930
movq (%rax,%rcx,8), %rax
movq %rax, 0x38(%rsp)
movl $0x0, 0x40(%rsp)
movl 0x40(%rsp), %eax
movl %eax, 0x1c(%rsp)
movq 0x38(%rsp), %rdi
addq $0x38, %rdi
callq 0x1ef20
movq %rax, %rcx
movl 0x1c(%rsp), %eax
cmpl %ecx, %eax
jge 0x185b4
movq 0x38(%rsp), %rdi
addq $0x38, %rdi
movslq 0x40(%rsp), %rsi
callq 0x1f430
movq (%rax), %rdi
callq 0x18640
jmp 0x1853e
jmp 0x18540
movl 0x40(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x40(%rsp)
jmp 0x184fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x18624
movq 0x30(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x43f0
movq %rax, %rsi
leaq 0x20(%rsp), %rdi
callq 0x1f260
movq 0x10(%rsp), %rdi
callq 0x4140
xorl %edi, %edi
movl $0x1, %esi
callq 0xbf00
jmp 0x185a0
leaq 0x20(%rsp), %rdi
callq 0x4200
callq 0x4580
addq $0x48, %rsp
retq
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x185dd
movq 0x8(%rsp), %rdi
callq 0x1f450
movq 0x8(%rsp), %rdi
movl $0x68, %esi
callq 0x4330
movslq 0x44(%rsp), %rcx
leaq 0x20e9347(%rip), %rax   # 0x2101930
movq $0x0, (%rax,%rcx,8)
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0x184cc
jmp 0x185af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x4200
callq 0x4580
jmp 0x18622
jmp 0x18624
movq 0x30(%rsp), %rdi
callq 0x45c0
movq %rax, %rdi
callq 0x1f2a0
nopw %cs:(%rax,%rax)
// File: FreeSlave[P]vhlt/hlrad/lerp.cpp
// Function: GetAngleDiff(float, float)
static vec_t GetAngleDiff (vec_t angle, vec_t base)
{
	vec_t diff;

	diff = angle - base;
	if (diff < 0)
	{
		diff += 2 * Q_PI;
	}
	return diff;
}

// Assembly:
movss %xmm0, -0x4(%rsp)
movss %xmm1, -0x8(%rsp)
movss -0x4(%rsp), %xmm0
subss -0x8(%rsp), %xmm0
movss %xmm0, -0xc(%rsp)
xorps %xmm0, %xmm0
ucomiss -0xc(%rsp), %xmm0
jbe 0x18968
movss -0xc(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x54eb6(%rip), %xmm1    # 0x6d810
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0xc(%rsp)
movss -0xc(%rsp), %xmm0
retq
nop
// File: FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: DeleteDirectLights()
void            DeleteDirectLights()
{
    int             l;
    directlight_t*  dl;

#ifdef HLRAD_VIS_FIX
	for (l = 0; l < 1 + g_dmodels[0].visleafs; l++)
#else
    for (l = 0; l < g_numleafs; l++)
#endif
    {
        dl = directlights[l];
        while (dl)
        {
            directlights[l] = dl->next;
            free(dl);
            dl = directlights[l];
        }
    }

    // AJM: todo: strip light entities out at this point
	// vluzacn: hlvis and hlrad must not modify entity data, because the following procedures are supposed to produce the same bsp file:
	//  1> hlcsg -> hlbsp -> hlvis -> hlrad  (a normal compile)
	//  2) hlcsg -> hlbsp -> hlvis -> hlrad -> hlcsg -onlyents
	//  3) hlcsg -> hlbsp -> hlvis -> hlrad -> hlcsg -onlyents -> hlrad
}

// Assembly:
subq $0x18, %rsp
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
leaq 0x4cfa9(%rip), %rcx     # 0x7e480
movl 0x34(%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x31546
movslq 0x14(%rsp), %rcx
leaq 0x4f36453(%rip), %rax   # 0x4f67940
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x31537
movq 0x8(%rsp), %rax
movq (%rax), %rdx
movslq 0x14(%rsp), %rcx
leaq 0x4f3642e(%rip), %rax   # 0x4f67940
movq %rdx, (%rax,%rcx,8)
movq 0x8(%rsp), %rdi
callq 0x43a0
movslq 0x14(%rsp), %rcx
leaq 0x4f36414(%rip), %rax   # 0x4f67940
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
jmp 0x314f6
jmp 0x31539
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x314cc
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: MLH_AddFace(mdllight_t*, int)
int MLH_AddFace (mdllight_t *ml, int facenum)
{
	dface_t *f = &g_dfaces[facenum];
	int i, j;
	for (i = 0; i < ml->facecount; i++)
	{
		if (ml->face[i].num == facenum)
		{
			return -1;
		}
	}
	if (ml->facecount >= MLH_MAXFACECOUNT)
	{
		return -1;
	}
	i = ml->facecount;
	ml->facecount++;
	ml->face[i].num = facenum;
	ml->face[i].samplecount = 0;
	for (j = 0; j < ALLSTYLES; j++)
	{
		ml->face[i].style[j].exist = false;
	}
	for (j = 0; j < MAXLIGHTMAPS && f->styles[j] != 255; j++)
	{
		ml->face[i].style[f->styles[j]].exist = true;
		ml->face[i].style[f->styles[j]].seq = j;
	}
	return i;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movl %esi, -0x14(%rsp)
movslq -0x14(%rsp), %rcx
leaq 0x1ba680b(%rip), %rax   # 0x1be6410
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rsp)
movl $0x0, -0x24(%rsp)
movl -0x24(%rsp), %eax
movq -0x10(%rsp), %rcx
cmpl 0xa518(%rcx), %eax
jge 0x3fc66
movq -0x10(%rsp), %rax
addq $0x18, %rax
movslq -0x24(%rsp), %rcx
imulq $0xa50, %rcx, %rcx      # imm = 0xA50
addq %rcx, %rax
movl (%rax), %eax
cmpl -0x14(%rsp), %eax
jne 0x3fc57
movl $0xffffffff, -0x4(%rsp) # imm = 0xFFFFFFFF
jmp 0x3fdcf
jmp 0x3fc59
movl -0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rsp)
jmp 0x3fc19
movq -0x10(%rsp), %rax
cmpl $0x10, 0xa518(%rax)
jl 0x3fc81
movl $0xffffffff, -0x4(%rsp) # imm = 0xFFFFFFFF
jmp 0x3fdcf
movq -0x10(%rsp), %rax
movl 0xa518(%rax), %eax
movl %eax, -0x24(%rsp)
movq -0x10(%rsp), %rax
movl 0xa518(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xa518(%rax)
movl -0x14(%rsp), %ecx
movq -0x10(%rsp), %rax
addq $0x18, %rax
movslq -0x24(%rsp), %rdx
imulq $0xa50, %rdx, %rdx      # imm = 0xA50
addq %rdx, %rax
movl %ecx, (%rax)
movq -0x10(%rsp), %rax
addq $0x18, %rax
movslq -0x24(%rsp), %rcx
imulq $0xa50, %rcx, %rcx      # imm = 0xA50
addq %rcx, %rax
movl $0x0, 0xa48(%rax)
movl $0x0, -0x28(%rsp)
cmpl $0x40, -0x28(%rsp)
jge 0x3fd22
movq -0x10(%rsp), %rax
addq $0x18, %rax
movslq -0x24(%rsp), %rcx
imulq $0xa50, %rcx, %rcx      # imm = 0xA50
addq %rcx, %rax
movslq -0x28(%rsp), %rcx
movb $0x0, 0x4(%rax,%rcx,8)
movl -0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rsp)
jmp 0x3fcec
movl $0x0, -0x28(%rsp)
xorl %eax, %eax
cmpl $0x4, -0x28(%rsp)
movb %al, -0x29(%rsp)
jge 0x3fd52
movq -0x20(%rsp), %rax
movslq -0x28(%rsp), %rcx
movzbl 0xc(%rax,%rcx), %eax
cmpl $0xff, %eax
setne %al
movb %al, -0x29(%rsp)
movb -0x29(%rsp), %al
testb $0x1, %al
jne 0x3fd5c
jmp 0x3fdc7
movq -0x10(%rsp), %rax
addq $0x18, %rax
movslq -0x24(%rsp), %rcx
imulq $0xa50, %rcx, %rcx      # imm = 0xA50
addq %rcx, %rax
movq -0x20(%rsp), %rcx
movslq -0x28(%rsp), %rdx
movzbl 0xc(%rcx,%rdx), %ecx
movb $0x1, 0x4(%rax,%rcx,8)
movl -0x28(%rsp), %edx
movq -0x10(%rsp), %rax
addq $0x18, %rax
movslq -0x24(%rsp), %rcx
imulq $0xa50, %rcx, %rcx      # imm = 0xA50
addq %rcx, %rax
movq -0x20(%rsp), %rcx
movslq -0x28(%rsp), %rsi
movzbl 0xc(%rcx,%rsi), %ecx
movl %edx, 0x8(%rax,%rcx,8)
movl -0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rsp)
jmp 0x3fd2a
movl -0x24(%rsp), %eax
movl %eax, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nopw %cs:(%rax,%rax)
// File: FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: MLH_mdllightCreate(mdllight_t*)
void MLH_mdllightCreate (mdllight_t *ml)
{
	// code from Quake
	float p[3];
	float end[3];
	ml->facecount = 0;
	VectorCopy (ml->origin, ml->floor);
	VectorCopy (ml->origin, p);
	VectorCopy (ml->origin, end);
	end[2] -= 2048;
	MLH_GetSamples_r (ml, 0, p, end);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movl $0x0, 0xa518(%rax)
movq 0x20(%rsp), %rax
movss (%rax), %xmm0
movq 0x20(%rsp), %rax
movss %xmm0, 0xc(%rax)
movq 0x20(%rsp), %rax
movss 0x4(%rax), %xmm0
movq 0x20(%rsp), %rax
movss %xmm0, 0x10(%rax)
movq 0x20(%rsp), %rax
movss 0x8(%rax), %xmm0
movq 0x20(%rsp), %rax
movss %xmm0, 0x14(%rax)
movq 0x20(%rsp), %rax
movss (%rax), %xmm0
movss %xmm0, 0x14(%rsp)
movq 0x20(%rsp), %rax
movss 0x4(%rax), %xmm0
movss %xmm0, 0x18(%rsp)
movq 0x20(%rsp), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, 0x1c(%rsp)
movq 0x20(%rsp), %rax
movss (%rax), %xmm0
movss %xmm0, 0x8(%rsp)
movq 0x20(%rsp), %rax
movss 0x4(%rax), %xmm0
movss %xmm0, 0xc(%rsp)
movq 0x20(%rsp), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x10(%rsp), %xmm0
movss 0x2d449(%rip), %xmm1    # 0x6dbc8
subss %xmm1, %xmm0
movss %xmm0, 0x10(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x14(%rsp), %rdx
leaq 0x8(%rsp), %rcx
xorl %esi, %esi
callq 0x401a0
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: MdlLightHack()
void MdlLightHack ()
{
	int ient;
	entity_t *ent1, *ent2;
	vec3_t origin1, origin2;
	const char *target;
#ifndef HLRAD_MDL_LIGHT_HACK_NEW
    double start, end;
#endif
	int used = 0, countent = 0, countsample = 0, r;
#ifndef HLRAD_MDL_LIGHT_HACK_NEW
    start = I_FloatTime();
#endif
	for (ient = 0; ient < g_numentities; ++ient)
	{
		ent1 = &g_entities[ient];
		target = ValueForKey (ent1, "zhlt_copylight");
		if (!strcmp (target, ""))
			continue;
		used = 1;
		ent2 = FindTargetEntity (target);
		if (ent2 == NULL)
		{
			Warning ("target entity '%s' not found", target);
			continue;
		}
		GetVectorForKey (ent1, "origin", origin1);
		GetVectorForKey (ent2, "origin", origin2);
		r = MLH_CopyLight (origin2, origin1);
		if (r < 0)
			Warning ("can not copy light from (%f,%f,%f)", origin2[0], origin2[1], origin2[2]);
		else
		{
			countent += 1;
			countsample += r;
		}
	}
#ifndef HLRAD_MDL_LIGHT_HACK_NEW
    end = I_FloatTime();
#endif
	if (used)
#ifdef HLRAD_MDL_LIGHT_HACK_NEW
		Log ("Adjust mdl light: modified %d samples for %d entities\n", countsample, countent);
#else
		Log("Mdl Light Hack: %d entities %d samples (%.2f seconds)\n", countent, countsample, end - start);
#endif
}

// Assembly:
subq $0x48, %rsp
movl $0x0, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
leaq 0x20337e5(%rip), %rcx   # 0x2074434
cmpl (%rcx), %eax
jge 0x40d71
movslq 0x44(%rsp), %rcx
leaq 0x20337dd(%rip), %rax   # 0x2074440
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
leaq 0x2d6bb(%rip), %rsi     # 0x6e336
callq 0x7d50
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x2b068(%rip), %rsi     # 0x6bcf9
callq 0x4480
cmpl $0x0, %eax
jne 0x40ca0
jmp 0x40d61
movl $0x1, 0xc(%rsp)
movq 0x10(%rsp), %rdi
callq 0x8b70
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
jne 0x40cd7
movq 0x10(%rsp), %rsi
leaq 0x2d67a(%rip), %rdi     # 0x6e345
movb $0x0, %al
callq 0xb9f0
jmp 0x40d61
movq 0x38(%rsp), %rdi
leaq 0x24(%rsp), %rdx
leaq 0x308cc(%rip), %rsi     # 0x715b4
callq 0x8c10
movq 0x30(%rsp), %rdi
leaq 0x18(%rsp), %rdx
leaq 0x308b6(%rip), %rsi     # 0x715b4
callq 0x8c10
leaq 0x18(%rsp), %rdi
leaq 0x24(%rsp), %rsi
callq 0x407b0
movl %eax, (%rsp)
cmpl $0x0, (%rsp)
jge 0x40d49
movss 0x18(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movss 0x1c(%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
movss 0x20(%rsp), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x2d622(%rip), %rdi     # 0x6e362
movb $0x3, %al
callq 0xb9f0
jmp 0x40d5f
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
movl (%rsp), %eax
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
jmp 0x40d61
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0x40c44
cmpl $0x0, 0xc(%rsp)
je 0x40d8e
movl 0x4(%rsp), %esi
movl 0x8(%rsp), %edx
leaq 0x2d5fe(%rip), %rdi     # 0x6e385
movb $0x0, %al
callq 0xb0d0
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: FreeFacelightDependencyList()
void FreeFacelightDependencyList ()
{
	int i;
	facelightlist_t *item;

	for (i = 0; i < MAX_MAP_FACES; i++)
	{
		while (g_dependentfacelights[i])
		{
			item = g_dependentfacelights[i];
			g_dependentfacelights[i] = item->next;
			free (item);
		}
	}
}

// Assembly:
subq $0x18, %rsp
movl $0x0, 0x14(%rsp)
cmpl $0xffff, 0x14(%rsp)     # imm = 0xFFFF
jge 0x41044
jmp 0x40fe8
movslq 0x14(%rsp), %rcx
leaq 0x51e69bc(%rip), %rax   # 0x52279b0
cmpq $0x0, (%rax,%rcx,8)
je 0x41035
movslq 0x14(%rsp), %rcx
leaq 0x51e69a9(%rip), %rax   # 0x52279b0
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdx
movslq 0x14(%rsp), %rcx
leaq 0x51e698b(%rip), %rax   # 0x52279b0
movq %rdx, (%rax,%rcx,8)
movq 0x8(%rsp), %rdi
callq 0x43a0
jmp 0x40fe8
jmp 0x41037
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x40fdc
addq $0x18, %rsp
retq
nopl (%rax)
// File: FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: ScaleDirectLights()
void ScaleDirectLights ()
{
	int facenum;
	dface_t *f;
	facelight_t *fl;
	int i;
	int k;
	sample_t *samp;

	for (facenum = 0; facenum < g_numfaces; facenum++)
	{
		f = &g_dfaces[facenum];

		if (g_texinfo[f->texinfo].flags & TEX_SPECIAL)
		{
			continue;
		}

		fl = &facelight[facenum];

		for (k = 0; k < MAXLIGHTMAPS && f->styles[k] != 255; k++)
		{
			for (i = 0; i < fl->numsamples; i++)
			{
				samp = &fl->samples[k][i];
				VectorScale (samp->light, g_direct_scale, samp->light);
	#ifdef ZHLT_XASH
				VectorScale (samp->light_direction, g_direct_scale, samp->light_direction);
	#endif
			}
		}
	}
}

// Assembly:
movl $0x0, -0x4(%rsp)
movl -0x4(%rsp), %eax
leaq 0x1ba53a1(%rip), %rcx   # 0x1be6404
cmpl (%rcx), %eax
jge 0x411ca
movslq -0x4(%rsp), %rcx
leaq 0x1ba5399(%rip), %rax   # 0x1be6410
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rsp)
movq -0x10(%rsp), %rax
movswq 0xa(%rax), %rcx
leaq 0x11a536c(%rip), %rax   # 0x11e6400
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x24(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x410ab
jmp 0x411ba
movslq -0x4(%rsp), %rcx
leaq 0x4f66919(%rip), %rax   # 0x4fa79d0
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rsp)
movl $0x0, -0x20(%rsp)
xorl %eax, %eax
cmpl $0x4, -0x20(%rsp)
movb %al, -0x29(%rsp)
jge 0x410f3
movq -0x10(%rsp), %rax
movslq -0x20(%rsp), %rcx
movzbl 0xc(%rax,%rcx), %eax
cmpl $0xff, %eax
setne %al
movb %al, -0x29(%rsp)
movb -0x29(%rsp), %al
testb $0x1, %al
jne 0x41100
jmp 0x411b8
movl $0x0, -0x1c(%rsp)
movl -0x1c(%rsp), %eax
movq -0x18(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x411a6
movq -0x18(%rsp), %rax
movslq -0x20(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rax
movslq -0x1c(%rsp), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rsp)
movq -0x28(%rsp), %rax
movss 0xc(%rax), %xmm0
leaq 0x3d286(%rip), %rax     # 0x7e3d0
mulss (%rax), %xmm0
movq -0x28(%rsp), %rax
movss %xmm0, 0xc(%rax)
movq -0x28(%rsp), %rax
movss 0x10(%rax), %xmm0
leaq 0x3d267(%rip), %rax     # 0x7e3d0
mulss (%rax), %xmm0
movq -0x28(%rsp), %rax
movss %xmm0, 0x10(%rax)
movq -0x28(%rsp), %rax
movss 0x14(%rax), %xmm0
leaq 0x3d248(%rip), %rax     # 0x7e3d0
mulss (%rax), %xmm0
movq -0x28(%rsp), %rax
movss %xmm0, 0x14(%rax)
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
jmp 0x41108
jmp 0x411a8
movl -0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rsp)
jmp 0x410cb
jmp 0x411ba
movl -0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rsp)
jmp 0x41058
retq
nopl (%rax,%rax)
// File: FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: GetTotalLight(patch_s*, int)
vec3_t* GetTotalLight(patch_t* patch, int style
#ifdef ZHLT_XASH
	, const vec3_t *&direction_out
#endif
	)
{
	int i;
	for (i = 0; i < MAXLIGHTMAPS && patch->totalstyle[i] != 255; i++)
	{
		if (patch->totalstyle[i] == style)
		{
#ifdef ZHLT_XASH
			direction_out = &(patch->totallight_direction[i]);
#endif
			return &(patch->totallight[i]);
		}
	}
#ifdef ZHLT_XASH
	direction_out = &totallight_default_direction;
#endif
	return &totallight_default;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movl %esi, -0x14(%rsp)
movl $0x0, -0x18(%rsp)
xorl %eax, %eax
cmpl $0x4, -0x18(%rsp)
movb %al, -0x19(%rsp)
jge 0x4267c
movq -0x10(%rsp), %rax
movslq -0x18(%rsp), %rcx
movzbl 0x88(%rax,%rcx), %eax
cmpl $0xff, %eax
setne %al
movb %al, -0x19(%rsp)
movb -0x19(%rsp), %al
testb $0x1, %al
jne 0x42686
jmp 0x426cb
movq -0x10(%rsp), %rax
movslq -0x18(%rsp), %rcx
movzbl 0x88(%rax,%rcx), %eax
cmpl -0x14(%rsp), %eax
jne 0x426bc
movq -0x10(%rsp), %rax
addq $0x90, %rax
movslq -0x18(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rsp)
jmp 0x426d7
jmp 0x426be
movl -0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rsp)
jmp 0x42651
leaq 0x52652d6(%rip), %rax   # 0x52a79a8
movq %rax, -0x8(%rsp)
movq -0x8(%rsp), %rax
retq
nopl (%rax)
// File: FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: SetSurfFromST(lightinfo_t const*, float*, float, float)
static void     SetSurfFromST(const lightinfo_t* const l, vec_t* surf, const vec_t s, const vec_t t)
{
    const int       facenum = l->surfnum;
    int             j;

    for (j = 0; j < 3; j++)
    {
        surf[j] = l->texorg[j] + l->textoworld[0][j] * s + l->textoworld[1][j] * t;
    }

    // Adjust for origin-based models
    VectorAdd(surf, g_face_offset[facenum], surf);
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movss %xmm0, -0x14(%rsp)
movss %xmm1, -0x18(%rsp)
movq -0x8(%rsp), %rax
movl 0x135c(%rax), %eax
movl %eax, -0x1c(%rsp)
movl $0x0, -0x20(%rsp)
cmpl $0x3, -0x20(%rsp)
jge 0x42ef5
movq -0x8(%rsp), %rax
movslq -0x20(%rsp), %rcx
movss 0xef4(%rax,%rcx,4), %xmm0
movq -0x8(%rsp), %rax
movslq -0x20(%rsp), %rcx
movss 0xf18(%rax,%rcx,4), %xmm1
movss -0x14(%rsp), %xmm2
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movq -0x8(%rsp), %rax
movslq -0x20(%rsp), %rcx
movss 0xf24(%rax,%rcx,4), %xmm0
movss -0x18(%rsp), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq -0x10(%rsp), %rax
movslq -0x20(%rsp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rsp)
jmp 0x42e7d
movq -0x10(%rsp), %rax
movss (%rax), %xmm0
movslq -0x1c(%rsp), %rcx
leaq 0x542ab06(%rip), %rax   # 0x546da10
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addss (%rax), %xmm0
movq -0x10(%rsp), %rax
movss %xmm0, (%rax)
movq -0x10(%rsp), %rax
movss 0x4(%rax), %xmm0
movslq -0x1c(%rsp), %rcx
leaq 0x542aadc(%rip), %rax   # 0x546da10
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addss 0x4(%rax), %xmm0
movq -0x10(%rsp), %rax
movss %xmm0, 0x4(%rax)
movq -0x10(%rsp), %rax
movss 0x8(%rax), %xmm0
movslq -0x1c(%rsp), %rcx
leaq 0x542aab0(%rip), %rax   # 0x546da10
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addss 0x8(%rax), %xmm0
movq -0x10(%rsp), %rax
movss %xmm0, 0x8(%rax)
retq
nopw (%rax,%rax)
// File: FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: DeleteSampleFrag(samplefraginfo_t*)
static void DeleteSampleFrag (samplefraginfo_t *fraginfo)
{
	while (fraginfo->head)
	{
		samplefrag_t *f;

		f = fraginfo->head;
		fraginfo->head = f->next;
		delete f->mywinding;
		delete f->winding;
		free (f->edges);
		free (f);
	}
	free (fraginfo);
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x4301c
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rax
movq 0x160(%rax), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x42fda
movq 0x10(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x18(%rsp), %rax
movq 0x140(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x42ffc
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x18(%rsp), %rax
movq 0x180(%rax), %rdi
callq 0x43a0
movq 0x18(%rsp), %rdi
callq 0x43a0
jmp 0x42f89
movq 0x20(%rsp), %rdi
callq 0x43a0
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: TextureNameFromFace(dface_t const*)
static const char* TextureNameFromFace(const dface_t* const f)
{
    texinfo_t*      tx;
    miptex_t*       mt;
    int             ofs;

    //
    // check for light emited by texture
    //
    tx = &g_texinfo[f->texinfo];

    ofs = ((dmiptexlump_t*)g_dtexdata)->dataofs[tx->miptex];
    mt = (miptex_t*)((byte*) g_dtexdata + ofs);

	return mt->name;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movswq 0xa(%rax), %rcx
leaq 0x11a24da(%rip), %rax   # 0x11e6400
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rsp)
leaq 0x84256f(%rip), %rax    # 0x8864a8
movq (%rax), %rax
movq -0x10(%rsp), %rcx
movslq 0x20(%rcx), %rcx
movl 0x4(%rax,%rcx,4), %eax
movl %eax, -0x1c(%rsp)
leaq 0x842554(%rip), %rax    # 0x8864a8
movq (%rax), %rax
movslq -0x1c(%rsp), %rcx
addq %rcx, %rax
movq %rax, -0x18(%rsp)
movq -0x18(%rsp), %rax
retq
nopw (%rax,%rax)
// File: FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: SetSTFromSurf(lightinfo_t const*, float const*, float&, float&)
static void		SetSTFromSurf(const lightinfo_t* const l, const vec_t* surf, vec_t& s, vec_t& t)
{
    const int       facenum = l->surfnum;
    int             j;

	s = t = 0;
	for (j = 0; j < 3; j++)
	{
		s += (surf[j] - g_face_offset[facenum][j] - l->texorg[j]) * l->worldtotex[0][j];
		t += (surf[j] - g_face_offset[facenum][j] - l->texorg[j]) * l->worldtotex[1][j];
	}
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movq %rcx, -0x20(%rsp)
movq -0x8(%rsp), %rax
movl 0x135c(%rax), %eax
movl %eax, -0x24(%rsp)
movq -0x20(%rsp), %rax
xorps %xmm0, %xmm0
movss %xmm0, (%rax)
movq -0x18(%rsp), %rax
xorps %xmm0, %xmm0
movss %xmm0, (%rax)
movl $0x0, -0x28(%rsp)
cmpl $0x3, -0x28(%rsp)
jge 0x4409c
movq -0x10(%rsp), %rax
movslq -0x28(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movslq -0x24(%rsp), %rcx
leaq 0x5429a37(%rip), %rax   # 0x546da10
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movslq -0x28(%rsp), %rcx
subss (%rax,%rcx,4), %xmm0
movq -0x8(%rsp), %rax
movslq -0x28(%rsp), %rcx
subss 0xef4(%rax,%rcx,4), %xmm0
movq -0x8(%rsp), %rax
movslq -0x28(%rsp), %rcx
movss 0xf00(%rax,%rcx,4), %xmm2
movq -0x18(%rsp), %rax
movss (%rax), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax)
movq -0x10(%rsp), %rax
movslq -0x28(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
movslq -0x24(%rsp), %rcx
leaq 0x54299d0(%rip), %rax   # 0x546da10
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movslq -0x28(%rsp), %rcx
subss (%rax,%rcx,4), %xmm0
movq -0x8(%rsp), %rax
movslq -0x28(%rsp), %rcx
subss 0xef4(%rax,%rcx,4), %xmm0
movq -0x8(%rsp), %rax
movslq -0x28(%rsp), %rcx
movss 0xf0c(%rax,%rcx,4), %xmm2
movq -0x20(%rsp), %rax
movss (%rax), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rax)
movl -0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rsp)
jmp 0x43fb3
retq
nopl (%rax)
// File: FreeSlave[P]vhlt/hlrad/loadtextures.cpp
// Function: AddWadFolder(char const*)
void AddWadFolder (const char *path)
{
	waddir_t *waddir;
	waddir = (waddir_t *)malloc (sizeof (waddir_t));
	hlassume (waddir != NULL, assume_NoMemory);
	{
		waddir_t **pos;
		for (pos = &g_waddirs; *pos; pos = &(*pos)->next)
			;
		waddir->next = *pos;
		*pos = waddir;
	}
	safe_snprintf (waddir->path, _MAX_PATH, "%s", path);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl $0x1008, %edi           # imm = 0x1008
callq 0x4430
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
setne %al
movzbl %al, %edi
andl $0x1, %edi
movl $0x1, %esi
callq 0xbf00
leaq 0x5263838(%rip), %rax   # 0x52a79d0
movq %rax, (%rsp)
movq (%rsp), %rax
cmpq $0x0, (%rax)
je 0x441b5
jmp 0x441a8
movq (%rsp), %rax
movq (%rax), %rax
movq %rax, (%rsp)
jmp 0x4419c
movq (%rsp), %rax
movq (%rax), %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rcx
movq (%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
movq 0x10(%rsp), %rcx
movl $0x1000, %esi           # imm = 0x1000
leaq 0x2a42d(%rip), %rdx     # 0x6e617
movb $0x0, %al
callq 0x94e0
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x18, %rsp
testb $0x1, 0x5263045(%rip)   # 0x52a79e0
je 0x44a08
movb $0x0, 0x526303c(%rip)   # 0x52a79e0
movq 0x526302d(%rip), %rax   # 0x52a79d8
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x449fd
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq 0x1018(%rax), %rdi
callq 0x43a0
movq 0x10(%rsp), %rax
movq 0x1008(%rax), %rdi
callq 0x4310
movq 0x10(%rsp), %rdi
callq 0x43a0
movq 0x8(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x449b0
movq $0x0, 0x5262fd0(%rip) # 0x52a79d8
addq $0x18, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rax
movl $0x10, 0x10(%rax)
movq 0x10(%rsp), %rax
movl $0x10, 0x14(%rax)
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x42e0
movq 0x10(%rsp), %rax
movb $0x0, 0xf(%rax)
movq 0x10(%rsp), %rax
movl 0x10(%rax), %eax
movq 0x10(%rsp), %rcx
imull 0x14(%rcx), %eax
movslq %eax, %rdi
callq 0x4430
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x10(%rsp), %rax
cmpq $0x0, 0x18(%rax)
setne %al
movzbl %al, %edi
andl $0x1, %edi
movl $0x1, %esi
callq 0xbf00
movl $0x0, 0x4(%rsp)
cmpl $0x100, 0x4(%rsp)       # imm = 0x100
jge 0x44af9
movq 0x10(%rsp), %rax
addq $0x20, %rax
movslq 0x4(%rsp), %rcx
imulq $0x3, %rcx, %rcx
addq %rcx, %rax
movb $-0x80, (%rax)
movq 0x10(%rsp), %rax
addq $0x20, %rax
movslq 0x4(%rsp), %rcx
imulq $0x3, %rcx, %rcx
addq %rcx, %rax
movb $-0x80, 0x1(%rax)
movq 0x10(%rsp), %rax
addq $0x20, %rax
movslq 0x4(%rsp), %rcx
imulq $0x3, %rcx, %rcx
addq %rcx, %rax
movb $-0x80, 0x2(%rax)
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x44a98
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
movq 0x10(%rsp), %rcx
movl 0x10(%rcx), %ecx
movq 0x10(%rsp), %rdx
imull 0x14(%rdx), %ecx
cmpl %ecx, %eax
jge 0x44b39
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rax
movslq 0x4(%rsp), %rcx
movb $0x0, (%rax,%rcx)
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x44b01
addq $0x18, %rsp
retq
nop
// File: 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:
subq $0x18, %rsp
movl %edi, 0x14(%rsp)
movq %rsi, 0x8(%rsp)
cmpl $0x800, 0x526223d(%rip) # imm = 0x800
jl 0x457bc
leaq 0x2912b(%rip), %rdi     # 0x6e8db
movl $0x800, %esi            # imm = 0x800
movb $0x0, %al
callq 0xb580
movslq 0x14(%rsp), %rdi
callq 0x4430
movq %rax, %rdx
movslq 0x5262214(%rip), %rcx   # 0x52a79e4
leaq 0x5262219(%rip), %rax   # 0x52a79f0
movq %rdx, (%rax,%rcx,8)
movslq 0x5262202(%rip), %rcx   # 0x52a79e4
leaq 0x5262207(%rip), %rax   # 0x52a79f0
cmpq $0x0, (%rax,%rcx,8)
setne %al
movzbl %al, %edi
andl $0x1, %edi
movl $0x1, %esi
callq 0xbf00
movslq 0x52621dc(%rip), %rcx   # 0x52a79e4
leaq 0x52621e1(%rip), %rax   # 0x52a79f0
movq (%rax,%rcx,8), %rdi
movq 0x8(%rsp), %rsi
movslq 0x14(%rsp), %rdx
callq 0x4280
movl 0x14(%rsp), %edx
movslq 0x52621b7(%rip), %rcx   # 0x52a79e4
leaq 0x52661bc(%rip), %rax   # 0x52ab9f0
movl %edx, (%rax,%rcx,4)
movl 0x52621a7(%rip), %eax   # 0x52a79e4
addl $0x1, %eax
movl %eax, 0x526219e(%rip)   # 0x52a79e4
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: FreeSlave[P]vhlt/hlrad/loadtextures.cpp
// Function: GetValidTextureName(int, char*)
static bool GetValidTextureName (int miptex, char name[16])
{
	int numtextures = g_texdatasize? ((dmiptexlump_t *)g_dtexdata)->nummiptex: 0;
	int offset;
	int size;
	miptex_t *mt;
	
	if (miptex < 0 || miptex >= numtextures)
	{
		return false;
	}
	offset = ((dmiptexlump_t *)g_dtexdata)->dataofs[miptex];
	size = g_texdatasize - offset;
	if (offset < 0 || g_dtexdata + offset < (byte *)&((dmiptexlump_t *)g_dtexdata)->dataofs[numtextures] ||
		size < (int)sizeof (miptex_t))
	{
		return false;
	}

	mt = (miptex_t *)&g_dtexdata[offset];
	safe_strncpy (name, mt->name, 16);

	if (strcmp (name, mt->name))
	{
		return false;
	}
	
	if (strlen (name) >= 5 && !strncasecmp (&name[1], "_rad", 4))
	{
		return false;
	}

	return true;
}

// Assembly:
subq $0x38, %rsp
movl %edi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
leaq 0x83e450(%rip), %rax    # 0x8864a4
cmpl $0x0, (%rax)
je 0x4806b
leaq 0x83e448(%rip), %rax    # 0x8864a8
movq (%rax), %rax
movl (%rax), %eax
movl %eax, 0xc(%rsp)
jmp 0x48073
xorl %eax, %eax
movl %eax, 0xc(%rsp)
jmp 0x48073
movl 0xc(%rsp), %eax
movl %eax, 0x24(%rsp)
cmpl $0x0, 0x30(%rsp)
jl 0x4808c
movl 0x30(%rsp), %eax
cmpl 0x24(%rsp), %eax
jl 0x48096
movb $0x0, 0x37(%rsp)
jmp 0x48188
leaq 0x83e40b(%rip), %rax    # 0x8864a8
movq (%rax), %rax
movslq 0x30(%rsp), %rcx
movl 0x4(%rax,%rcx,4), %eax
movl %eax, 0x20(%rsp)
leaq 0x83e3f0(%rip), %rax    # 0x8864a4
movl (%rax), %eax
subl 0x20(%rsp), %eax
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x20(%rsp)
jl 0x480fd
leaq 0x83e3dc(%rip), %rax    # 0x8864a8
movq (%rax), %rax
movslq 0x20(%rsp), %rcx
addq %rcx, %rax
leaq 0x83e3ca(%rip), %rcx    # 0x8864a8
movq (%rcx), %rcx
addq $0x4, %rcx
movslq 0x24(%rsp), %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jb 0x480fd
cmpl $0x28, 0x1c(%rsp)
jge 0x48107
movb $0x0, 0x37(%rsp)
jmp 0x48188
leaq 0x83e39a(%rip), %rax    # 0x8864a8
movq (%rax), %rax
movslq 0x20(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rdi
movq 0x10(%rsp), %rsi
movl $0x10, %edx
callq 0x95f0
movq 0x28(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x4480
cmpl $0x0, %eax
je 0x4814d
movb $0x0, 0x37(%rsp)
jmp 0x48188
movq 0x28(%rsp), %rdi
callq 0x4170
cmpq $0x5, %rax
jb 0x48183
movq 0x28(%rsp), %rdi
addq $0x1, %rdi
leaq 0x268a4(%rip), %rsi     # 0x6ea11
movl $0x4, %edx
callq 0x4410
cmpl $0x0, %eax
jne 0x48183
movb $0x0, 0x37(%rsp)
jmp 0x48188
movb $0x1, 0x37(%rsp)
movb 0x37(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: FreeSlave[P]vhlt/hlrad/loadtextures.cpp
// Function: CQ_MapPoint(unsigned char const*, unsigned char const (*) [3], int, cq_searchnode_s*)
static int CQ_MapPoint (const unsigned char point[CQ_DIM], const unsigned char (*colors)[CQ_DIM], int numcolors, cq_searchnode_t *searchtree)
{
	if (numcolors <= 0)
	{
		Error ("CQ_MapPoint: internal error");
	}

	cq_searchnode_t *node;
	int bestdist;
	int best;
	int searchradius;

	for (node = searchtree; !node->isleafnode; )
	{
		node = node->childrennode[point[node->planeaxis] >= node->planedist];
	}
	best = node->result;
	bestdist = 0;
	for (int k = 0; k < CQ_DIM; k++)
	{
		bestdist += (colors[best][k] - point[k]) * (colors[best][k] - point[k]);
	}

	searchradius = (int)ceil(sqrt ((double)bestdist) + 0.1);
	CQ_MapPoint_r (&bestdist, &best, searchtree, colors, point, searchradius);
	return best;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl %edx, 0x24(%rsp)
movq %rcx, 0x18(%rsp)
cmpl $0x0, 0x24(%rsp)
jg 0x4905c
leaq 0x25ab1(%rip), %rdi     # 0x6eb06
movb $0x0, %al
callq 0xb580
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movb (%rax), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x49075
jmp 0x490a9
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rcx
movq 0x10(%rsp), %rdx
movslq 0x18(%rdx), %rdx
movzbl (%rcx,%rdx), %ecx
movq 0x10(%rsp), %rdx
cmpl 0x1c(%rdx), %ecx
setge %cl
andb $0x1, %cl
movzbl %cl, %ecx
movq 0x8(%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
jmp 0x49066
movq 0x10(%rsp), %rax
movl 0x20(%rax), %eax
movl %eax, 0x8(%rsp)
movl $0x0, 0xc(%rsp)
movl $0x0, (%rsp)
cmpl $0x3, (%rsp)
jge 0x49130
movq 0x28(%rsp), %rax
movslq 0x8(%rsp), %rcx
imulq $0x3, %rcx, %rcx
addq %rcx, %rax
movslq (%rsp), %rcx
movzbl (%rax,%rcx), %eax
movq 0x30(%rsp), %rcx
movslq (%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
subl %ecx, %eax
movq 0x28(%rsp), %rcx
movslq 0x8(%rsp), %rdx
imulq $0x3, %rdx, %rdx
addq %rdx, %rcx
movslq (%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
movq 0x30(%rsp), %rdx
movslq (%rsp), %rsi
movzbl (%rdx,%rsi), %edx
subl %edx, %ecx
imull %ecx, %eax
addl 0xc(%rsp), %eax
movl %eax, 0xc(%rsp)
movl (%rsp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
jmp 0x490c4
cvtsi2sdl 0xc(%rsp), %xmm0
callq 0x4270
movsd 0x246b5(%rip), %xmm1    # 0x6d7f8
addsd %xmm1, %xmm0
callq 0x4090
cvttsd2si %xmm0, %eax
movl %eax, 0x4(%rsp)
movq 0x18(%rsp), %rdx
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %r8
movl 0x4(%rsp), %r9d
leaq 0xc(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x499c0
movl 0x8(%rsp), %eax
addq $0x38, %rsp
retq
// File: FreeSlave[P]vhlt/hlrad/loadtextures.cpp
// Function: Hash(int, void*)
static unsigned int Hash (int size, void *data)
{
	unsigned int hash = 0;
	for (int i = 0; i < size; i++)
	{
		hash = 31 * hash + ((unsigned char *)data)[i];
	}
	return hash;
}

// Assembly:
movl %edi, -0x4(%rsp)
movq %rsi, -0x10(%rsp)
movl $0x0, -0x14(%rsp)
movl $0x0, -0x18(%rsp)
movl -0x18(%rsp), %eax
cmpl -0x4(%rsp), %eax
jge 0x491c9
imull $0x1f, -0x14(%rsp), %eax
movq -0x10(%rsp), %rcx
movslq -0x18(%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movl %eax, -0x14(%rsp)
movl -0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rsp)
jmp 0x49199
movl -0x14(%rsp), %eax
retq
nop
// File: FreeSlave[P]vhlt/hlrad/loadtextures.cpp
// Function: double CQ_DotProduct<double>(double const*, double const*)
inline T CQ_DotProduct (const T a[CQ_DIM], const T b[CQ_DIM])
{
	T dot = (T)0;
	for (int x = 0; x < CQ_DIM; x++)
	{
		dot += a[x] * b[x];
	}
	return dot;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x18(%rsp)
movl $0x0, -0x1c(%rsp)
cmpl $0x3, -0x1c(%rsp)
jge 0x49de1
movq -0x8(%rsp), %rax
movslq -0x1c(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x10(%rsp), %rax
movslq -0x1c(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x18(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rsp)
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
jmp 0x49d9b
movsd -0x18(%rsp), %xmm0
retq
nopl (%rax,%rax)
// File: FreeSlave[P]vhlt/hlrad/mathutil.cpp
// Function: intersect_linesegment_plane(dplane_t const*, float const*, float const*, float*)
bool			intersect_linesegment_plane(const dplane_t* const plane, const vec_t* const p1, const vec_t* const p2, vec3_t point)
{
	vec_t			part1;
	vec_t			part2;
	int				i;
	part1 = DotProduct (p1, plane->normal) - plane->dist;
	part2 = DotProduct (p2, plane->normal) - plane->dist;
	if (part1 * part2 > 0 || part1 == part2)
		return false;
	for (i=0; i<3; ++i)
		point[i] = (part1 * p2[i] - part2 * p1[i]) / (part1 - part2);
	return true;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
movq %rdx, -0x20(%rsp)
movq %rcx, -0x28(%rsp)
movq -0x18(%rsp), %rax
movss (%rax), %xmm1
movq -0x10(%rsp), %rax
movss (%rax), %xmm2
movq -0x18(%rsp), %rax
movss 0x4(%rax), %xmm0
movq -0x10(%rsp), %rax
mulss 0x4(%rax), %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movq -0x18(%rsp), %rax
movss 0x8(%rax), %xmm0
movq -0x10(%rsp), %rax
movss 0x8(%rax), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq -0x10(%rsp), %rax
subss 0xc(%rax), %xmm0
movss %xmm0, -0x2c(%rsp)
movq -0x20(%rsp), %rax
movss (%rax), %xmm1
movq -0x10(%rsp), %rax
movss (%rax), %xmm2
movq -0x20(%rsp), %rax
movss 0x4(%rax), %xmm0
movq -0x10(%rsp), %rax
mulss 0x4(%rax), %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movq -0x20(%rsp), %rax
movss 0x8(%rax), %xmm0
movq -0x10(%rsp), %rax
movss 0x8(%rax), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq -0x10(%rsp), %rax
subss 0xc(%rax), %xmm0
movss %xmm0, -0x30(%rsp)
movss -0x2c(%rsp), %xmm0
mulss -0x30(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
ja 0x4b57b
movss -0x2c(%rsp), %xmm0
ucomiss -0x30(%rsp), %xmm0
jne 0x4b582
jp 0x4b582
movb $0x0, -0x1(%rsp)
jmp 0x4b601
movl $0x0, -0x34(%rsp)
cmpl $0x3, -0x34(%rsp)
jge 0x4b5fc
movss -0x2c(%rsp), %xmm0
movq -0x20(%rsp), %rax
movslq -0x34(%rsp), %rcx
movss (%rax,%rcx,4), %xmm2
movss -0x30(%rsp), %xmm1
movq -0x18(%rsp), %rax
movslq -0x34(%rsp), %rcx
mulss (%rax,%rcx,4), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss -0x2c(%rsp), %xmm1
subss -0x30(%rsp), %xmm1
divss %xmm1, %xmm0
movq -0x28(%rsp), %rax
movslq -0x34(%rsp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rsp)
jmp 0x4b58a
movb $0x1, -0x1(%rsp)
movb -0x1(%rsp), %al
andb $0x1, %al
retq
nopl (%rax,%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq 0x30(%rsp), %rax
movss (%rax), %xmm0
movq 0x38(%rsp), %rax
subss (%rax), %xmm0
movss %xmm0, 0x1c(%rsp)
movq 0x30(%rsp), %rax
movss 0x4(%rax), %xmm0
movq 0x38(%rsp), %rax
subss 0x4(%rax), %xmm0
movss %xmm0, 0x20(%rsp)
movq 0x30(%rsp), %rax
movss 0x8(%rax), %xmm0
movq 0x38(%rsp), %rax
subss 0x8(%rax), %xmm0
movss %xmm0, 0x24(%rsp)
movq 0x40(%rsp), %rax
movss (%rax), %xmm0
movq 0x38(%rsp), %rax
subss (%rax), %xmm0
movss %xmm0, 0x10(%rsp)
movq 0x40(%rsp), %rax
movss 0x4(%rax), %xmm0
movq 0x38(%rsp), %rax
subss 0x4(%rax), %xmm0
movss %xmm0, 0x14(%rsp)
movq 0x40(%rsp), %rax
movss 0x8(%rax), %xmm0
movq 0x38(%rsp), %rax
subss 0x8(%rax), %xmm0
movss %xmm0, 0x18(%rsp)
movss 0x20(%rsp), %xmm0
movss 0x18(%rsp), %xmm2
movss 0x24(%rsp), %xmm1
mulss 0x14(%rsp), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x4(%rsp)
movss 0x24(%rsp), %xmm0
movss 0x10(%rsp), %xmm2
movss 0x1c(%rsp), %xmm1
mulss 0x18(%rsp), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x8(%rsp)
movss 0x1c(%rsp), %xmm0
movss 0x14(%rsp), %xmm2
movss 0x20(%rsp), %xmm1
mulss 0x10(%rsp), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0xc(%rsp)
leaq 0x4(%rsp), %rdi
callq 0x11980
movss 0x4(%rsp), %xmm1
movq 0x40(%rsp), %rax
movss (%rax), %xmm2
movss 0x8(%rsp), %xmm0
movq 0x40(%rsp), %rax
mulss 0x4(%rax), %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movss 0xc(%rsp), %xmm0
movq 0x40(%rsp), %rax
movss 0x8(%rax), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq 0x28(%rsp), %rax
movss %xmm0, 0xc(%rax)
movss 0x4(%rsp), %xmm0
movq 0x28(%rsp), %rax
movss %xmm0, (%rax)
movss 0x8(%rsp), %xmm0
movq 0x28(%rsp), %rax
movss %xmm0, 0x4(%rax)
movss 0xc(%rsp), %xmm0
movq 0x28(%rsp), %rax
movss %xmm0, 0x8(%rax)
addq $0x48, %rsp
retq
// File: FreeSlave[P]vhlt/hlrad/qrad.cpp
// Function: FreeOpaqueFaceList()
static void     FreeOpaqueFaceList()
{
    unsigned        x;
    opaqueList_t*   opaque = g_opaque_face_list;

    for (x = 0; x < g_opaque_face_count; x++, opaque++)
    {
#ifndef HLRAD_OPAQUE_NODE
        delete opaque->winding;
        opaque->winding = NULL;
#endif
    }
    free(g_opaque_face_list);

    g_opaque_face_list = NULL;
    g_opaque_face_count = 0;
    g_max_opaque_face_count = 0;
}

// Assembly:
subq $0x18, %rsp
movq 0x54dbd4d(%rip), %rax   # 0x552fa68
movq %rax, 0x8(%rsp)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x54dbd3e(%rip), %eax   # 0x552fa70
jae 0x53d51
jmp 0x53d36
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movq 0x8(%rsp), %rax
addq $0x2c, %rax
movq %rax, 0x8(%rsp)
jmp 0x53d28
movq 0x54dbd10(%rip), %rdi   # 0x552fa68
callq 0x43a0
movq $0x0, 0x54dbd00(%rip) # 0x552fa68
movl $0x0, 0x54dbcfe(%rip)   # 0x552fa70
movl $0x0, 0x54dbcf8(%rip)   # 0x552fa74
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: FreeSlave[P]vhlt/hlrad/qrad.cpp
// Function: FreePatches()
static void     FreePatches()
{
    unsigned        x;
    patch_t*        patch = g_patches;

    // AJM EX
    //Log("patches: %i of %i (%2.2lf percent)\n", g_num_patches, MAX_PATCHES, (double)((double)g_num_patches / (double)MAX_PATCHES));

    for (x = 0; x < g_num_patches; x++, patch++)
    {
        delete patch->winding;
    }
    memset(g_patches, 0, sizeof(patch_t) * g_num_patches);
#ifdef HLRAD_MORE_PATCHES
	FreeBlock (g_patches);
	g_patches = NULL;
#endif
}

// Assembly:
subq $0x18, %rsp
movq 0x5399c65(%rip), %rax   # 0x53eda00
movq %rax, 0x8(%rsp)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x5419c56(%rip), %eax   # 0x546da08
jae 0x53df0
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x53dd1
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x53dd3
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
movq 0x8(%rsp), %rax
addq $0x138, %rax            # imm = 0x138
movq %rax, 0x8(%rsp)
jmp 0x53da8
movq 0x5399c09(%rip), %rdi   # 0x53eda00
movl 0x5419c0b(%rip), %eax   # 0x546da08
imulq $0x138, %rax, %rdx      # imm = 0x138
xorl %esi, %esi
callq 0x41b0
movq 0x5399bee(%rip), %rdi   # 0x53eda00
callq 0x47d0
movq $0x0, 0x5399bde(%rip) # 0x53eda00
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x18, %rsp
movl %edi, 0x14(%rsp)
movl %esi, 0x10(%rsp)
movl 0x10(%rsp), %edx
movslq 0x14(%rsp), %rcx
leaq 0x54fbd24(%rip), %rax   # 0x554fb70
movl %edx, (%rax,%rcx,4)
movslq 0x14(%rsp), %rcx
leaq 0x10d25b5(%rip), %rax   # 0x1126410
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, (%rsp)
movl $0x0, 0xc(%rsp)
cmpl $0x2, 0xc(%rsp)
jge 0x53ec6
movq (%rsp), %rax
movslq 0xc(%rsp), %rcx
movswl 0x4(%rax,%rcx,2), %eax
movl %eax, 0x8(%rsp)
cmpl $0x0, 0x8(%rsp)
jge 0x53eaa
movl 0x14(%rsp), %edx
xorl %eax, %eax
subl 0x8(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0x54dbceb(%rip), %rax   # 0x552fb90
movl %edx, (%rax,%rcx,4)
jmp 0x53eb7
movl 0x8(%rsp), %edi
movl 0x14(%rsp), %esi
callq 0x53e30
jmp 0x53eb9
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x53e6e
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: FreeSlave[P]vhlt/hlrad/qrad.cpp
// Function: CheckMaxPatches()
static void     CheckMaxPatches()
{
    switch (g_method)
    {
    case eMethodVismatrix:
        hlassume(g_num_patches < MAX_VISMATRIX_PATCHES, assume_MAX_PATCHES); // should use "<=" instead. --vluzacn
        break;
    case eMethodSparseVismatrix:
        hlassume(g_num_patches < MAX_SPARSE_VISMATRIX_PATCHES, assume_MAX_PATCHES);
        break;
    case eMethodNoVismatrix:
        hlassume(g_num_patches < MAX_PATCHES, assume_MAX_PATCHES);
        break;
    }
}

// Assembly:
pushq %rax
movl 0x296c1(%rip), %eax     # 0x7e3c8
movl %eax, 0x4(%rsp)
testl %eax, %eax
je 0x54d27
jmp 0x54d11
movl 0x4(%rsp), %eax
subl $0x1, %eax
je 0x54d46
jmp 0x54d1c
movl 0x4(%rsp), %eax
subl $0x2, %eax
je 0x54d65
jmp 0x54d82
cmpl $0xffff, 0x5418cd7(%rip) # imm = 0xFFFF
setb %al
movzbl %al, %edi
andl $0x1, %edi
movl $0x1b, %esi
callq 0xbf00
jmp 0x54d82
cmpl $0xffff0, 0x5418cb8(%rip) # imm = 0xFFFF0
setb %al
movzbl %al, %edi
andl $0x1, %edi
movl $0x1b, %esi
callq 0xbf00
jmp 0x54d82
cmpl $0xffff0, 0x5418c99(%rip) # imm = 0xFFFF0
setb %al
movzbl %al, %edi
andl $0x1, %edi
movl $0x1b, %esi
callq 0xbf00
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: FreeSlave[P]vhlt/hlrad/qrad.cpp
// Function: MakeScalesStub()
static void     MakeScalesStub()
{
    switch (g_method)
    {
    case eMethodVismatrix:
        MakeScalesVismatrix();
        break;
    case eMethodSparseVismatrix:
        MakeScalesSparseVismatrix();
        break;
    case eMethodNoVismatrix:
        MakeScalesNoVismatrix();
        break;
    }
}

// Assembly:
pushq %rax
movl 0x29481(%rip), %eax     # 0x7e3c8
movl %eax, 0x4(%rsp)
testl %eax, %eax
je 0x54f67
jmp 0x54f51
movl 0x4(%rsp), %eax
subl $0x1, %eax
je 0x54f6e
jmp 0x54f5c
movl 0x4(%rsp), %eax
subl $0x2, %eax
je 0x54f75
jmp 0x54f7a
callq 0x668f0
jmp 0x54f7a
callq 0x61400
jmp 0x54f7a
callq 0x4d580
popq %rax
retq
nopl (%rax)