LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: ParseImplicitTexinfoFromTexture(int)
int	ParseImplicitTexinfoFromTexture (int miptex)
{
	int texinfo;
	int numtextures = g_texdatasize? ((dmiptexlump_t *)g_dtexdata)->nummiptex: 0;
	int offset;
	int size;
	miptex_t *mt;
	char name[16];
	
	if (miptex < 0 || miptex >= numtextures)
	{
		Warning ("ParseImplicitTexinfoFromTexture: internal error: invalid texture number %d.", miptex);
		return -1;
	}
	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 -1;
	}

	mt = (miptex_t *)&g_dtexdata[offset];
	safe_strncpy (name, mt->name, 16);
	
	if (!(strlen (name) >= 6 && !strncasecmp (&name[1], "_rad", 4) && '0' <= name[5] && name[5] <= '9'))
	{
		return -1;
	}

	texinfo = atoi (&name[5]);
	if (texinfo < 0 || texinfo >= g_numtexinfo)
	{
		Warning ("Invalid index of original texinfo: %d parsed from texture name '%s'.", texinfo, name);
		return -1;
	}

	return texinfo;
}

// Assembly:
movl %edi, %eax
movl 0x82a853(%rip), %ecx    # 0x8314b4
testl %ecx, %ecx
je 0x6c70
movq 0x82a84c(%rip), %rdx    # 0x8314b8
movl (%rdx), %edx
jmp 0x6c72
xorl %edx, %edx
pushq %r14
pushq %rbx
subq $0x18, %rsp
testl %eax, %eax
setns %sil
cmpl %eax, %edx
setg %dil
testb %dil, %sil
je 0x6d25
movq 0x82a823(%rip), %rsi    # 0x8314b8
movl %eax, %eax
movslq 0x4(%rsi,%rax,4), %rax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
js 0x6d3a
leaq 0x4(%rsi), %rdi
subl %eax, %ecx
addq %rax, %rsi
movl %edx, %eax
leaq (%rdi,%rax,4), %rax
cmpq %rax, %rsi
setb %al
cmpl $0x28, %ecx
setl %cl
orb %al, %cl
jne 0x6d3a
movq %rsp, %r14
movl $0x10, %edx
movq %r14, %rdi
callq 0x8ae9
movq %r14, %rdi
callq 0x4180
cmpq $0x6, %rax
jb 0x6d3a
leaq 0x1(%rsp), %rdi
leaq 0x157b2(%rip), %rsi     # 0x1c4a5
movl $0x4, %edx
callq 0x4400
testl %eax, %eax
jne 0x6d3a
movb 0x5(%rsp), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x6d3a
leaq 0x5(%rsp), %rdi
callq 0x44f0
testl %eax, %eax
js 0x6d44
cmpl 0x118a6ed(%rip), %eax   # 0x119140c
jge 0x6d44
movl %eax, %ebx
jmp 0x6d3a
leaq 0x1572d(%rip), %rdi     # 0x1c459
movl %eax, %esi
xorl %eax, %eax
callq 0xa4d6
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x1575f(%rip), %rdi     # 0x1c4aa
movq %rsp, %rdx
movl %eax, %esi
xorl %eax, %eax
callq 0xa4d6
jmp 0x6d3a
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: ParseEpair()
epair_t*        ParseEpair()
{
    epair_t*        e;

    e = (epair_t*)Alloc(sizeof(epair_t));

    if (strlen(g_token) >= MAX_KEY - 1)
        Error("ParseEpair: Key token too long (%i > MAX_KEY)", (int)strlen(g_token));

    e->key = _strdup(g_token);
    GetToken(false);

    if (strlen(g_token) >= MAX_VAL - 1) //MAX_VALUE //vluzacn
        Error("ParseEpar: Value token too long (%i > MAX_VALUE)", (int)strlen(g_token));

    e->value = _strdup(g_token);

    return e;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x18, %edi
callq 0x4974
movq %rax, %rbx
leaq 0x20bc3f5(%rip), %rdi   # 0x20c34a0
callq 0x4180
cmpq $0x7f, %rax
jb 0x70c6
leaq 0x15484(%rip), %rdi     # 0x1c541
movl %eax, %esi
xorl %eax, %eax
callq 0xa164
leaq 0x20bc3d3(%rip), %r14   # 0x20c34a0
movq %r14, %rdi
callq 0x45a0
movq %rax, 0x8(%rbx)
xorl %edi, %edi
callq 0xaf93
movq %r14, %rdi
callq 0x4180
cmpq $0xfff, %rax            # imm = 0xFFF
jb 0x7100
leaq 0x15478(%rip), %rdi     # 0x1c56f
movl %eax, %esi
xorl %eax, %eax
callq 0xa164
leaq 0x20bc399(%rip), %rdi   # 0x20c34a0
callq 0x45a0
movq %rax, 0x10(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: ValueForKey(entity_t const*, char const*)
const char*     ValueForKey(const entity_t* const ent, const char* const key)
{
    epair_t*        ep;

    for (ep = ent->epairs; ep; ep = ep->next)
    {
        if (!strcmp(ep->key, key))
        {
            return ep->value;
        }
    }
    return "";
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
addq $0x20, %r14
leaq 0x16751(%rip), %rbx     # 0x1dca9
movq (%r14), %r14
testq %r14, %r14
je 0x7574
movq 0x8(%r14), %rdi
movq %r15, %rsi
callq 0x4440
testl %eax, %eax
jne 0x7558
movq 0x10(%r14), %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: SetKeyValue(entity_t*, char const*, char const*)
void            SetKeyValue(entity_t* ent, const char* const key, const char* const value)
{
    epair_t*        ep;

#ifdef ZHLT_DELETEKEY
	if (!value[0])
	{
		DeleteKey (ent, key);
		return;
	}
#endif
    for (ep = ent->epairs; ep; ep = ep->next)
    {
        if (!strcmp(ep->key, key))
        {
#ifdef ZHLT_DELETEKEY
			char *value2 = strdup (value);
			Free (ep->value);
			ep->value = value2;
#else
            Free(ep->value);
            ep->value = strdup(value);
#endif
            return;
        }
    }
    ep = (epair_t*)Alloc(sizeof(*ep));
    ep->next = ent->epairs;
    ent->epairs = ep;
    ep->key = strdup(key);
    ep->value = strdup(value);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
cmpb $0x0, (%rdx)
je 0x75d0
movq %rdx, %rbx
addq $0x20, %r15
movq %r15, %r12
movq (%r12), %r12
testq %r12, %r12
je 0x75e6
movq 0x8(%r12), %rdi
movq %r14, %rsi
callq 0x4440
testl %eax, %eax
jne 0x759a
movq %rbx, %rdi
callq 0x45a0
movq %rax, %rbx
movq 0x10(%r12), %rdi
callq 0x4979
movq %rbx, 0x10(%r12)
jmp 0x7617
movq %r15, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x7623
movl $0x18, %edi
callq 0x4974
movq %rax, %r12
movq (%r15), %rax
movq %rax, (%r12)
movq %r12, (%r15)
movq %r14, %rdi
callq 0x45a0
movq %rax, 0x8(%r12)
movq %rbx, %rdi
callq 0x45a0
movq %rax, 0x10(%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: DeleteKey(entity_t*, char const*)
void			DeleteKey(entity_t* ent, const char* const key)
{
	epair_t **pep;
	for (pep = &ent->epairs; *pep; pep = &(*pep)->next)
	{
		if (!strcmp ((*pep)->key, key))
		{
			epair_t *ep = *pep;
			*pep = ep->next;
			Free(ep->key);
			Free(ep->value);
			Free(ep);
			return;
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
addq $0x20, %rbx
movq %rbx, %r15
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x7672
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x4440
testl %eax, %eax
jne 0x7632
movq (%rbx), %rax
movq %rax, (%r15)
movq 0x8(%rbx), %rdi
callq 0x4979
movq 0x10(%rbx), %rdi
callq 0x4979
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x4979
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: anglesforvector(float*, float const*)
int anglesforvector (float angles[3], const float vector[3])
{
	float z = vector[2], r = sqrt (vector[0] * vector[0] + vector[1] * vector[1]);
	float tmp;
	if (sqrt (z*z + r*r) < NORMAL_EPSILON)
	{
		return -1;
	}
	else
	{
		tmp = sqrt (z*z + r*r);
		z /= tmp, r /= tmp;
		if (r < NORMAL_EPSILON)
		{
			if (z < 0)
			{
				angles[0] = -90, angles[1] = 0;
			}
			else
			{
				angles[0] = 90, angles[1] = 0;
			}
		}
		else
		{
			angles[0] = atan (z / r) / Q_PI * 180;
			float x = vector[0], y = vector[1];
			tmp = sqrt (x*x + y*y);
			x /= tmp, y /= tmp;
			if (x < -1 + NORMAL_EPSILON)
			{
				angles[1] = -180;
			}
			else
			{
				if (y >= 0)
				{
					angles[1] = 2 * atan (y / (1+x)) / Q_PI * 180;
				}
				else
				{
					angles[1] = 2 * atan (y / (1+x)) / Q_PI * 180 + 360;
				}
			}
		}
	}
	angles[2] = 0;
	return 0;
}

// Assembly:
movss 0x8(%rsi), %xmm0
movss (%rsi), %xmm1
movss 0x4(%rsi), %xmm2
mulss %xmm2, %xmm2
mulss %xmm1, %xmm1
addss %xmm2, %xmm1
sqrtss %xmm1, %xmm1
movaps %xmm1, %xmm2
mulss %xmm1, %xmm2
movaps %xmm0, %xmm3
mulss %xmm0, %xmm3
addss %xmm2, %xmm3
xorps %xmm2, %xmm2
sqrtss %xmm3, %xmm2
cvtss2sd %xmm2, %xmm4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movsd 0x149f1(%rip), %xmm3    # 0x1c118
ucomisd %xmm4, %xmm3
ja 0x783f
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
divss %xmm2, %xmm0
divss %xmm2, %xmm1
xorps %xmm2, %xmm2
cvtss2sd %xmm1, %xmm2
ucomisd %xmm2, %xmm3
jbe 0x775f
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
jbe 0x77cd
movss 0x1494f(%rip), %xmm0    # 0x1c0ac
jmp 0x77d5
movq %rsi, %r14
divss %xmm1, %xmm0
callq 0x4270
cvtss2sd %xmm0, %xmm0
divsd 0x149a9(%rip), %xmm0    # 0x1c120
mulsd 0x149a9(%rip), %xmm0    # 0x1c128
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rbx)
movss (%r14), %xmm1
movss 0x4(%r14), %xmm4
movaps %xmm4, %xmm0
mulss %xmm4, %xmm0
movaps %xmm1, %xmm2
mulss %xmm1, %xmm2
addss %xmm0, %xmm2
xorps %xmm0, %xmm0
sqrtss %xmm2, %xmm0
divss %xmm0, %xmm1
xorps %xmm2, %xmm2
cvtss2sd %xmm1, %xmm2
movsd 0x14972(%rip), %xmm3    # 0x1c130
ucomisd %xmm2, %xmm3
jbe 0x77da
movl $0xc3340000, 0x4(%rbx)  # imm = 0xC3340000
jmp 0x782f
movss 0x148d3(%rip), %xmm0    # 0x1c0a8
movlps %xmm0, (%rbx)
jmp 0x782f
divss %xmm0, %xmm4
movss %xmm4, 0x4(%rsp)
addss 0x148b8(%rip), %xmm1    # 0x1c0a4
movaps %xmm4, %xmm0
divss %xmm1, %xmm0
callq 0x4270
xorps %xmm1, %xmm1
movss 0x4(%rsp), %xmm2
ucomiss %xmm1, %xmm2
addss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
divsd 0x1490c(%rip), %xmm0    # 0x1c120
mulsd 0x1490c(%rip), %xmm0    # 0x1c128
jae 0x7826
addsd 0x14912(%rip), %xmm0    # 0x1c138
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x4(%rbx)
movl $0x0, 0x8(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: FindTargetEntity(char const*)
entity_t *FindTargetEntity(const char* const target)
{
    int             i;
    const char*     n;

    for (i = 0; i < g_numentities; i++)
    {
        n = ValueForKey(&g_entities[i], "targetname");
        if (!strcmp(n, target))
        {
            return &g_entities[i];
        }
    }

    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, (%rsp)
movslq 0x2017223(%rip), %r12   # 0x201f444
testq %r12, %r12
jle 0x8291
leaq 0x2017223(%rip), %r13   # 0x201f450
leaq 0x1451c(%rip), %r14     # 0x1c750
xorl %ebp, %ebp
leaq (,%rbp,4), %rax
addq %rbp, %rax
leaq (,%rax,8), %r15
addq %r13, %r15
leaq 0x20(,%rax,8), %rbx
addq %r13, %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x8275
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x4440
testl %eax, %eax
jne 0x8257
movq 0x10(%rbx), %rdi
jmp 0x827c
leaq 0x15a2d(%rip), %rdi     # 0x1dca9
movq (%rsp), %rsi
callq 0x4440
testl %eax, %eax
je 0x8294
incq %rbp
cmpq %r12, %rbp
jne 0x8236
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: GetVectorForKey(entity_t const*, char const*, double*)
void            GetVectorForKey(const entity_t* const ent, const char* const key, vec3_t vec)
{
    const char*     k;
    double          v1, v2, v3;

    k = ValueForKey(ent, key);
    // scanf into doubles, then assign, so it is vec_t size independent
    v1 = v2 = v3 = 0;
    sscanf(k, "%lf %lf %lf", &v1, &v2, &v3);
    vec[0] = v1;
    vec[1] = v2;
    vec[2] = v3;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
addq $0x20, %r15
leaq 0x159e2(%rip), %r14     # 0x1dca9
movq (%r15), %r15
testq %r15, %r15
je 0x82e3
movq 0x8(%r15), %rdi
movq %r12, %rsi
callq 0x4440
testl %eax, %eax
jne 0x82c7
movq 0x10(%r15), %r14
xorl %eax, %eax
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
leaq 0x10(%rsp), %r12
movq %rax, (%r12)
leaq 0x18(%rsp), %r13
movq %rax, (%r13)
leaq 0x17d93(%rip), %rsi     # 0x20099
movq %r14, %rdi
movq %r13, %rdx
movq %r12, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x42e0
movsd (%r13), %xmm0
movsd %xmm0, (%rbx)
movsd (%r12), %xmm0
movsd %xmm0, 0x8(%rbx)
movsd (%r15), %xmm0
movsd %xmm0, 0x10(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: dtexdata_init()
void            dtexdata_init()
{
    g_dtexdata = (byte*)AllocBlock(g_max_map_miptex);
    hlassume(g_dtexdata != NULL, assume_NoMemory);
	g_dlightdata = (byte*)AllocBlock(g_max_map_lightdata);
	hlassume(g_dlightdata != NULL, assume_NoMemory);
}

// Assembly:
pushq %rax
movslq 0x1ffe2(%rip), %rdi     # 0x28330
callq 0x492c
movq %rax, 0x82915e(%rip)    # 0x8314b8
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xa91d
movslq 0x1ffc0(%rip), %rdi     # 0x28334
callq 0x492c
movq %rax, 0x829128(%rip)    # 0x8314a8
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
popq %rax
jmp 0xa91d
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: dtexdata_free()
void CDECL      dtexdata_free()
{
    FreeBlock(g_dtexdata);
    g_dtexdata = NULL;
	FreeBlock(g_dlightdata);
	g_dlightdata = NULL;
}

// Assembly:
pushq %rbx
movq 0x82911c(%rip), %rdi    # 0x8314b8
callq 0x4951
xorl %ebx, %ebx
movq %rbx, 0x82910e(%rip)    # 0x8314b8
movq 0x8290f7(%rip), %rdi    # 0x8314a8
callq 0x4951
movq %rbx, 0x8290eb(%rip)    # 0x8314a8
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: EntityForModel(int)
entity_t*       EntityForModel(const int modnum)
{
    int             i;
    const char*     s;
    char            name[16];

    sprintf(name, "*%i", modnum);
    // search the entities for one using modnum
    for (i = 0; i < g_numentities; i++)
    {
        s = ValueForKey(&g_entities[i], "model");
        if (!strcmp(s, name))
        {
            return &g_entities[i];
        }
    }

    return &g_entities[0];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edi, %edx
leaq 0x143dc(%rip), %rsi     # 0x1c7b2
movq %rsp, %rdi
xorl %eax, %eax
callq 0x40c0
movslq 0x201705d(%rip), %r12   # 0x201f444
testq %r12, %r12
jle 0x845c
xorl %r13d, %r13d
leaq 0x201705a(%rip), %rbp   # 0x201f450
leaq 0x17b73(%rip), %r14     # 0x1ff70
leaq (,%r13,4), %rax
addq %r13, %rax
leaq (,%rax,8), %r15
addq %rbp, %r15
leaq 0x20(,%rax,8), %rbx
addq %rbp, %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x843c
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x4440
testl %eax, %eax
jne 0x841e
movq 0x10(%rbx), %rdi
jmp 0x8443
leaq 0x15866(%rip), %rdi     # 0x1dca9
movq %rsp, %rsi
callq 0x4440
testl %eax, %eax
je 0x8463
incq %r13
cmpq %r12, %r13
jne 0x83fd
movq %rbp, %r15
jmp 0x8463
leaq 0x2016fed(%rip), %r15   # 0x201f450
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/cmdlib.cpp
// Function: strupr(char*)
char*           strupr(char* string)
{
    int             i;
    int             len = strlen(string);

    for (i = 0; i < len; i++)
    {
        string[i] = toupper(string[i]);
    }
    return string;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x4180
movq %rax, %r14
testl %r14d, %r14d
jle 0x850b
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
xorl %r15d, %r15d
movsbl (%rbx,%r15), %edi
callq 0x45e0
movb %al, (%rbx,%r15)
incq %r15
cmpq %r15, %r14
jne 0x84f5
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/cmdlib.cpp
// Function: strlwr(char*)
char*           strlwr(char* string)
{
    int             i;
    int             len = strlen(string);

    for (i = 0; i < len; i++)
    {
        string[i] = tolower(string[i]);
    }
    return string;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x4180
movq %rax, %r14
testl %r14d, %r14d
jle 0x8549
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
xorl %r15d, %r15d
movsbl (%rbx,%r15), %edi
callq 0x4480
movb %al, (%rbx,%r15)
incq %r15
cmpq %r15, %r14
jne 0x8533
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/cmdlib.cpp
// Function: stristr(char const*, char const*)
const char*     stristr(const char* const string, const char* const substring)
{
    char*           string_copy;
    char*           substring_copy;
    const char*     match;

    string_copy = _strdup(string);
    _strlwr(string_copy);

    substring_copy = _strdup(substring);
    _strlwr(substring_copy);

    match = strstr(string_copy, substring_copy);
    if (match)
    {
        match = (string + (match - string_copy));
    }

    free(string_copy);
    free(substring_copy);
    return match;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x45a0
movq %rax, %r15
movq %rax, %rdi
callq 0x8514
movq %rbx, %rdi
callq 0x45a0
movq %rax, %rbx
movq %rax, %rdi
callq 0x8514
movq %r15, %rdi
movq %rbx, %rsi
callq 0x40f0
movq %rax, %r12
subq %r15, %rax
addq %r14, %rax
testq %r12, %r12
cmovneq %rax, %r12
movq %r15, %rdi
callq 0x4390
movq %rbx, %rdi
callq 0x4390
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/cmdlib.cpp
// Function: DefaultExtension(char*, char const*)
void DefaultExtension(char* path, const char* extension)
{
	int extension_pos, directory_pos;
	getFilePositions(path,&extension_pos,&directory_pos);
	if(extension_pos == -1)
	{ strcat(path,extension); }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x2e, %esi
callq 0x4340
movl %eax, %ecx
subl %r14d, %ecx
xorl %ebp, %ebp
cmpq $0x1, %rax
sbbl %ebp, %ebp
orl %ecx, %ebp
movq %r14, %rdi
movl $0x2f, %esi
callq 0x4340
movq %rax, %r15
movq %r14, %rdi
movl $0x5c, %esi
callq 0x4340
cmpq %rax, %r15
cmovaq %r15, %rax
movl %eax, %ecx
subl %r14d, %ecx
cmpl %ecx, %ebp
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmovgel %ebp, %ecx
testq %rax, %rax
cmovel %ebp, %ecx
cmpl $-0x1, %ecx
je 0x864c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4570
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/cmdlib.cpp
// Function: StripFilename(char*)
void StripFilename(char* path)
{
	int extension_pos, directory_pos;
	getFilePositions(path,&extension_pos,&directory_pos);
	if(directory_pos == -1)
	{ path[0] = 0; }
	else
	{ path[directory_pos] = 0; }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x2f, %esi
callq 0x4340
movq %rax, %r15
movq %rbx, %rdi
movl $0x5c, %esi
callq 0x4340
movq %rax, %r14
cmpq %rax, %r15
cmovaq %r15, %r14
testq %r14, %r14
je 0x86dc
subl %ebx, %r14d
movq %rbx, %rdi
callq 0x4180
decl %eax
cmpl %r14d, %eax
jne 0x86d0
leal -0x1(%r14), %eax
testl %r14d, %r14d
jle 0x86cd
movl %eax, %r14d
movzbl (%rbx,%r14), %eax
cmpl $0x5c, %eax
je 0x86d0
cmpl $0x2f, %eax
je 0x86d0
leaq -0x1(%r14), %rax
testq %r14, %r14
movq %rax, %r14
jg 0x86b0
jmp 0x86dc
movl %eax, %r14d
cmpl $-0x1, %r14d
je 0x86dc
movslq %r14d, %rax
addq %rax, %rbx
movb $0x0, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/cmdlib.cpp
// Function: StripExtension(char*)
void StripExtension(char* path)
{
	int extension_pos, directory_pos;
	getFilePositions(path,&extension_pos,&directory_pos);
	if(extension_pos != -1)
	{ path[extension_pos] = 0; }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x2e, %esi
callq 0x4340
movl %eax, %ecx
subl %ebx, %ecx
xorl %ebp, %ebp
cmpq $0x1, %rax
sbbl %ebp, %ebp
orl %ecx, %ebp
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x4340
movq %rax, %r14
movq %rbx, %rdi
movl $0x5c, %esi
callq 0x4340
cmpq %rax, %r14
cmovaq %r14, %rax
movl %eax, %ecx
subl %ebx, %ecx
cmpl %ecx, %ebp
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmovgel %ebp, %ecx
testq %rax, %rax
cmovel %ebp, %ecx
cmpl $-0x1, %ecx
je 0x8748
movslq %ecx, %rax
movb $0x0, (%rbx,%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/cmdlib.cpp
// Function: ExtractFilePath(char const*, char*)
void ExtractFilePath(const char* const path, char* dest)
{
	int extension_pos, directory_pos;
	getFilePositions(path,&extension_pos,&directory_pos);
	if(directory_pos != -1)
	{
	    memcpy(dest,path,directory_pos+1); //include directory slash
	    dest[directory_pos+1] = 0;
	}
	else
	{ dest[0] = 0; }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x2f, %esi
callq 0x4340
movq %rax, %r12
movq %r14, %rdi
movl $0x5c, %esi
callq 0x4340
movq %rax, %r15
cmpq %rax, %r12
cmovaq %r12, %r15
testq %r15, %r15
je 0x87e3
subl %r14d, %r15d
movq %r14, %rdi
callq 0x4180
decl %eax
cmpl %r15d, %eax
jne 0x87c2
leal -0x1(%r15), %eax
testl %r15d, %r15d
jle 0x87bf
movl %eax, %r15d
movzbl (%r14,%r15), %eax
cmpl $0x5c, %eax
je 0x87c2
cmpl $0x2f, %eax
je 0x87c2
leaq -0x1(%r15), %rax
testq %r15, %r15
movq %rax, %r15
jg 0x87a2
jmp 0x87e3
movl %eax, %r15d
cmpl $-0x1, %r15d
je 0x87e3
leal 0x1(%r15), %eax
movslq %eax, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4260
movslq %r15d, %rax
addq %rax, %rbx
incq %rbx
movb $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/cmdlib.cpp
// Function: ExtractFile(char const*, char*)
void ExtractFile(const char* const path, char* dest)
{
	int extension_pos, directory_pos;
	getFilePositions(path,&extension_pos,&directory_pos);

	int length = strlen(path);

#ifdef ZHLT_FILE_FUNCTIONS_FIX
	length -= directory_pos + 1;
#else
	if(directory_pos == -1)	{ directory_pos = 0; }
	else { length -= directory_pos + 1; }
#endif

    memcpy(dest,path+directory_pos+1,length); //exclude directory slash
    dest[length] = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x2f, %esi
callq 0x4340
movq %rax, %r12
movq %r14, %rdi
movl $0x5c, %esi
callq 0x4340
movq %rax, %r15
cmpq %rax, %r12
cmovaq %r12, %r15
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %r15, %r15
je 0x8873
subl %r14d, %r15d
movq %r14, %rdi
callq 0x4180
decl %eax
cmpl %r15d, %eax
jne 0x8868
leal -0x1(%r15), %eax
testl %r15d, %r15d
jle 0x8871
movl %eax, %eax
movzbl (%r14,%rax), %ecx
cmpl $0x5c, %ecx
je 0x886d
cmpl $0x2f, %ecx
je 0x886d
leaq -0x1(%rax), %rcx
testq %rax, %rax
movq %rcx, %rax
jg 0x884b
jmp 0x8873
movl %r15d, %ebp
jmp 0x8873
movl %eax, %ebp
jmp 0x8873
movl %eax, %ebp
movq %r14, %rdi
callq 0x4180
movslq %ebp, %rcx
notl %ebp
addl %eax, %ebp
leaq (%r14,%rcx), %rsi
incq %rsi
movslq %ebp, %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4260
movb $0x0, (%rbx,%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/cmdlib.cpp
// Function: ExtractFileBase(char const*, char*)
void ExtractFileBase(const char* const path, char* dest)
{
	int extension_pos, directory_pos;
	getFilePositions(path,&extension_pos,&directory_pos);
	int length = extension_pos == -1 ? strlen(path) : extension_pos;

#ifdef ZHLT_FILE_FUNCTIONS_FIX
	length -= directory_pos + 1;
#else
	if(directory_pos == -1)	{ directory_pos = 0; }
	else { length -= directory_pos + 1; }
#endif

    memcpy(dest,path+directory_pos+1,length); //exclude directory slash
    dest[length] = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x2e, %esi
callq 0x4340
movl %eax, %ecx
subl %r14d, %ecx
xorl %ebp, %ebp
cmpq $0x1, %rax
sbbl %ebp, %ebp
orl %ecx, %ebp
movq %r14, %rdi
movl $0x2f, %esi
callq 0x4340
movq %rax, %r12
movq %r14, %rdi
movl $0x5c, %esi
callq 0x4340
movq %rax, %r15
cmpq %rax, %r12
cmovaq %r12, %r15
testq %r15, %r15
je 0x8946
subl %r14d, %r15d
cmpl %r15d, %ebp
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
cmovgel %ebp, %r12d
movq %r14, %rdi
callq 0x4180
decl %eax
cmpl %r15d, %eax
jne 0x8954
leal -0x1(%r15), %eax
testl %r15d, %r15d
jle 0x8951
movl %eax, %r15d
movzbl (%r14,%r15), %eax
cmpl $0x5c, %eax
je 0x8954
cmpl $0x2f, %eax
je 0x8954
leaq -0x1(%r15), %rax
testq %r15, %r15
movq %rax, %r15
jg 0x8923
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x8954
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl %ebp, %r12d
jmp 0x8954
movl %eax, %r15d
cmpl $-0x1, %r12d
jne 0x8965
movq %r14, %rdi
callq 0x4180
movq %rax, %r12
movslq %r15d, %rax
notl %r15d
addl %r12d, %r15d
leaq (%r14,%rax), %rsi
incq %rsi
movslq %r15d, %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4260
movb $0x0, (%rbx,%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/cmdlib.cpp
// Function: ExtractFileExtension(char const*, char*)
void ExtractFileExtension(const char* const path, char* dest)
{
	int extension_pos, directory_pos;
	getFilePositions(path,&extension_pos,&directory_pos);
	if(extension_pos != -1)
	{
		int length = strlen(path) - extension_pos;
	    memcpy(dest,path+extension_pos,length); //include extension '.'
	    dest[length] = 0;
	}
	else
	{ dest[0] = 0; }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x2e, %esi
callq 0x4340
movl %eax, %ecx
subl %r14d, %ecx
xorl %r12d, %r12d
cmpq $0x1, %rax
sbbl %r12d, %r12d
orl %ecx, %r12d
movq %r14, %rdi
movl $0x2f, %esi
callq 0x4340
movq %rax, %r15
movq %r14, %rdi
movl $0x5c, %esi
callq 0x4340
cmpq %rax, %r15
cmovaq %r15, %rax
movl %eax, %ecx
subl %r14d, %ecx
cmpl %ecx, %r12d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmovgel %r12d, %ebp
testq %rax, %rax
cmovel %r12d, %ebp
cmpl $-0x1, %ebp
je 0x8a1d
movq %r14, %rdi
callq 0x4180
movslq %ebp, %rsi
subl %ebp, %eax
addq %r14, %rsi
movslq %eax, %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4260
addq %r14, %rbx
movb $0x0, (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/cmdlib.cpp
// Function: safe_strncat(char*, char const*, unsigned long)
bool            safe_strncat(char* const dest, const char* const src, const size_t count)
{
    if (count)
    {
        strncat(dest, src, count);

        dest[count - 1] = 0;                               // Ensure it is null terminated
        return true;
    }
    else
    {
        Warning("safe_strncat passed empty count");
        return false;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
testq %rdx, %rdx
je 0x8b1f
movq %rdi, %r14
movq %rbx, %rdx
callq 0x4210
movb $0x0, -0x1(%r14,%rbx)
jmp 0x8b2d
leaq 0x13dc2(%rip), %rdi     # 0x1c8e8
xorl %eax, %eax
callq 0xa4d6
testq %rbx, %rbx
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/cmdlib.cpp
// Function: TerminatedString(char const*, int)
bool            TerminatedString(const char* buffer, const int size)
{
    int             x;

    for (x = 0; x < size; x++, buffer++)
    {
        if ((*buffer) == 0)
        {
            return true;
        }
    }
    return false;
}

// Assembly:
testl %esi, %esi
jle 0x8b62
cmpb $0x0, (%rdi)
je 0x8b65
movl %esi, %eax
movl $0x1, %edx
movq %rdx, %rcx
cmpl %ecx, %eax
je 0x8b5c
leaq 0x1(%rcx), %rdx
cmpb $0x0, (%rdi,%rcx)
jne 0x8b4b
cmpl %esi, %ecx
setl %al
retq
xorl %eax, %eax
retq
movb $0x1, %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/cmdlinecfg.cpp
// Function: pvalid(char const*)
int plen (const char *p)
{
	int l;
	for (l = 0; ; l++)
	{
		if (p[l] == '\0')
			return -1;
		if (p[l] == sepchr)
			return l;
	}
}

// Assembly:
movzbl (%rdi), %eax
testl %eax, %eax
je 0x8b96
cmpl $0xa, %eax
je 0x8b93
incq %rdi
jmp 0x8b82
movb $0x1, %al
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/cmdlinecfg.cpp
// Function: pmatch(char const*, char const*)
bool pmatch (const char *cmdlineparam, const char *param)
{
	int cl, cstart, cend, pl, pstart, pend, k;
	cl = plen (cmdlineparam);
	pl = plen (param);
	if (cl < 0 || pl < 0)
		return false;
	bool anystart = (pl > 0 && param[0] == '*');
	bool anyend = (pl > 0 && param[pl-1] == '*');
	pstart = anystart ? 1 : 0;
	pend = anyend ? pl-1 : pl;
	if (pend < pstart) pend = pstart;
	for (cstart = 0; cstart <= cl; ++cstart)
	{
		for (cend = cl; cend >= cstart; --cend)
		{
			if (cend - cstart == pend - pstart)
			{
				for (k = 0; k < cend - cstart; ++k)
					if (tolower (cmdlineparam[k+cstart]) != tolower (param[k+pstart]))
						break;
				if (k == cend - cstart)
					return true;
			}
			if (!anyend)
				break;
		}
		if (!anystart)
			break;
	}
	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorl %edx, %edx
movzbl (%r14,%rdx), %eax
testl %eax, %eax
je 0x8bc2
cmpl $0xa, %eax
je 0x8bc7
incq %rdx
jmp 0x8baf
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %esi, %esi
movzbl (%rbx,%rsi), %eax
testl %eax, %eax
je 0x8cc1
cmpl $0xa, %eax
je 0x8bdf
incq %rsi
jmp 0x8bc9
movl %edx, %eax
orl %esi, %eax
js 0x8cc1
testq %rsi, %rsi
je 0x8c04
cmpb $0x2a, (%rbx)
sete %al
movl %eax, (%rsp)
movl %esi, %eax
cmpb $0x2a, -0x1(%rbx,%rax)
sete %dil
jmp 0x8c0d
movl $0x0, (%rsp)
xorl %edi, %edi
testl %edx, %edx
js 0x8cc1
movzbl (%rsp), %eax
movzbl %dil, %ecx
subl %ecx, %esi
cmpl %eax, %esi
cmovlel %eax, %esi
subl %eax, %esi
movl %edx, %r15d
incl %edx
movslq %esi, %r13
addq %rax, %rbx
xorl %r8d, %r8d
movq %rdx, 0x10(%rsp)
movq %rsi, 0x18(%rsp)
movl %edi, 0x4(%rsp)
movq %r15, 0x8(%rsp)
movq %r8, 0x20(%rsp)
movq %r15, %rax
subq %r8, %rax
cmpq %r13, %rax
jne 0x8c93
xorl %r12d, %r12d
testl %esi, %esi
jle 0x8c8e
movsbl (%r14,%r12), %edi
callq 0x4480
movl %eax, %ebp
movsbl (%rbx,%r12), %edi
callq 0x4480
cmpl %eax, %ebp
jne 0x8c80
incq %r12
cmpq %r13, %r12
jl 0x8c5e
movq 0x18(%rsp), %rsi
movl 0x4(%rsp), %edi
movq 0x20(%rsp), %r8
cmpl %esi, %r12d
je 0x8cd2
cmpq %r8, %r15
leaq -0x1(%r15), %r15
setg %al
testb %dil, %al
jne 0x8c4c
incq %r8
movq 0x10(%rsp), %rdx
cmpq %rdx, %r8
setne %cl
incq %r14
xorl %eax, %eax
testb %cl, (%rsp)
movq 0x8(%rsp), %r15
jne 0x8c47
jmp 0x8cc3
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
jmp 0x8cc3
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/cmdlinecfg.cpp
// Function: findparams(char*, char*)
char * findparams (char *cmdlineparams, char *params)
{
	char *c1, *c, *p;
	for (c1 = cmdlineparams; pvalid (c1); c1 = pnext (c1))
	{
		for (c = c1, p = params; pvalid (p); c = pnext (c), p = pnext (p))
			if (!pvalid (c) || !pmatch (c, p))
				break;
		if (!pvalid (p))
			return c1;
	}
	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movabsq $0x100000000, %r13      # imm = 0x100000000
movq %rbx, %rax
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0x8e1d
cmpl $0xa, %ecx
je 0x8d3e
incq %rax
jmp 0x8d29
movq %rbx, %r12
movq %r14, %r15
movq %r15, %rax
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0x8ddf
cmpl $0xa, %ecx
je 0x8d5c
incq %rax
jmp 0x8d47
movq %r12, %rax
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0x8ddf
cmpl $0xa, %ecx
je 0x8d70
incq %rax
jmp 0x8d5f
movq %r12, %rdi
movq %r15, %rsi
callq 0x8b99
testb %al, %al
je 0x8ddf
movq %r12, %rcx
xorl %eax, %eax
movzbl (%rcx), %edx
testl %edx, %edx
je 0x8d9e
cmpl $0xa, %edx
je 0x8d98
addq %r13, %rax
incq %rcx
jmp 0x8d84
sarq $0x20, %rax
jmp 0x8da5
movq $-0x1, %rax
addq %rax, %r12
incq %r12
movq %r15, %rcx
xorl %eax, %eax
movzbl (%rcx), %edx
testl %edx, %edx
je 0x8dca
cmpl $0xa, %edx
je 0x8dc4
addq %r13, %rax
incq %rcx
jmp 0x8db0
sarq $0x20, %rax
jmp 0x8dd1
movq $-0x1, %rax
addq %rax, %r15
incq %r15
jmp 0x8d44
incq %r15
movzbl (%r15), %eax
testl %eax, %eax
je 0x8e1f
cmpl $0xa, %eax
jne 0x8ddc
movq %rbx, %rcx
xorl %eax, %eax
movzbl (%rcx), %edx
testl %edx, %edx
je 0x8e0b
cmpl $0xa, %edx
je 0x8e05
addq %r13, %rax
incq %rcx
jmp 0x8df1
sarq $0x20, %rax
jmp 0x8e12
movq $-0x1, %rax
addq %rax, %rbx
incq %rbx
jmp 0x8d26
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/cmdlinecfg.cpp
// Function: delparams(char*, char*)
void delparams (char *cmdline, char *params)
{
	char *c, *p;
	if (!pvalid (params)) //avoid infinite loop
		return;
	while (cmdline = findparams (cmdline, params), cmdline != NULL)
	{
		for (c = cmdline, p = params; pvalid (p); c = pnext (c), p = pnext (p))
			;
		memmove (cmdline, c, strlen (c) + 1);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rsi, %rax
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0x8f62
cmpl $0xa, %ecx
je 0x8ea2
incq %rax
jmp 0x8e8d
movq %rbx, %rsi
callq 0x8d0d
testq %rax, %rax
je 0x8f62
movq %rax, %r14
movabsq $0x100000000, %r12      # imm = 0x100000000
movq %r14, %r15
movq %rbx, %rax
movq %rax, %rcx
movzbl (%rcx), %edx
testl %edx, %edx
je 0x8f34
cmpl $0xa, %edx
je 0x8eda
incq %rcx
jmp 0x8ec9
movq %r15, %rdx
xorl %ecx, %ecx
movzbl (%rdx), %esi
testl %esi, %esi
je 0x8ef9
cmpl $0xa, %esi
je 0x8ef3
addq %r12, %rcx
incq %rdx
jmp 0x8edf
sarq $0x20, %rcx
jmp 0x8f00
movq $-0x1, %rcx
addq %rcx, %r15
incq %r15
movq %rax, %rdx
xorl %ecx, %ecx
movzbl (%rdx), %esi
testl %esi, %esi
je 0x8f25
cmpl $0xa, %esi
je 0x8f1f
addq %r12, %rcx
incq %rdx
jmp 0x8f0b
sarq $0x20, %rcx
jmp 0x8f2c
movq $-0x1, %rcx
addq %rcx, %rax
incq %rax
jmp 0x8ec6
movq %r15, %rdi
callq 0x4180
leaq 0x1(%rax), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x4520
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8d0d
movq %rax, %r14
testq %rax, %rax
jne 0x8ec0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/cmdlinecfg.cpp
// Function: nextword(char const*, char*, unsigned int)
const char * nextword (const char *s, char *token, unsigned int n)
{
	unsigned int i;
	const char *c;
	bool quote, comment, content;
	for (c=s, i=0, quote=false, comment=false, content=false; c[0] != '\0'; c++)
	{
		if (c[0]=='\"')
			quote = !quote;
		if (c[0]=='\n')
			quote = false;
		if (c[0]=='\n')
			comment = false;
		if (!quote && c[0]=='/' && c[1]=='/')
			comment = true;
		if (!comment && !(c[0]=='\n' || isspace (c[0])))
			content = true;
		if (!quote && !comment && content && (c[0]=='\n' || isspace (c[0])))
			break;
		if (content && c[0]!='\"')
			if (i<n-1)
				token[i++] = c[0];
			else
				error = true;
	}
	token[i] = '\0';
	return content? c: NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x10(%rsp)
movq %rdi, %rbx
decl %edx
movl %edx, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
xorl %ebp, %ebp
xorl %ecx, %ecx
xorl %r14d, %r14d
movzbl (%rbx), %r15d
movsbl %r15b, %r12d
cmpl $0x22, %r15d
je 0x925f
testl %r15d, %r15d
je 0x9317
cmpb $0xa, %r15b
setne %al
movzbl %bpl, %r13d
movl $0x0, %edx
cmovel %edx, %r13d
andb %al, %cl
cmpb $0x2f, %r15b
jne 0x927b
testb $0x1, %r13b
jne 0x927b
cmpb $0x2f, 0x1(%rbx)
sete %al
orb %cl, %al
movb $0x1, %al
jne 0x92c6
movl %r15d, %edi
callq 0x4080
testl %eax, %eax
movzbl %r14b, %r14d
movl $0x1, %eax
cmovel %eax, %r14d
testb $0x1, %r14b
jne 0x92b8
jmp 0x92c4
movl %ebp, %eax
andb $0x1, %al
movl %eax, %ebp
xorb $0x1, %bpl
testb %al, %al
sete %r13b
movb $0x1, %al
testb $0x1, %cl
je 0x9287
movl %ebp, %r13d
jmp 0x92f8
movb $0x1, %al
testb %cl, %cl
jne 0x92c6
cmpb $0xa, %r15b
je 0x9305
movl %r12d, %edi
callq 0x4080
testl %eax, %eax
movzbl %r14b, %r14d
movl $0x1, %eax
cmovel %eax, %r14d
xorl %ecx, %ecx
movl $0x0, %eax
testb $0x1, %r13b
movl %ebp, %r13d
jne 0x92c6
testb $0x1, %r14b
je 0x92c4
testb %cl, %cl
jne 0x9321
movl %r12d, %edi
callq 0x4080
testl %eax, %eax
jne 0x9321
xorl %eax, %eax
cmpb $0x22, %r15b
je 0x92f8
testb $0x1, %r14b
je 0x92f8
movl 0x8(%rsp), %ecx
cmpl 0xc(%rsp), %ecx
jae 0x92f1
movl %ecx, %edx
movl %ecx, %ecx
incl %edx
movl %edx, 0x8(%rsp)
movq 0x10(%rsp), %rdx
movb %r15b, (%rdx,%rcx)
jmp 0x92f8
movb $0x1, 0x20b6160(%rip)   # 0x20bf458
incq %rbx
movl %r13d, %ebp
movl %eax, %ecx
jmp 0x91f6
movb $0x1, %cl
xorl %eax, %eax
testb $0x1, %r13b
movl $0x0, %r13d
je 0x92ae
jmp 0x92c6
xorl %eax, %eax
testb $0x1, %r14b
cmoveq %rax, %rbx
movl 0x8(%rsp), %eax
movl %eax, %eax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movq %rbx, %rax
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/common/cmdlinecfg.cpp
// Function: parsearg(int, char**, char*, unsigned int)
void parsearg (int argc, char ** argv, char *cmdline, unsigned int n)
{
	int i;
	strcpy (cmdline, "");
	strcat (cmdline, "<");
	strcat (cmdline, g_Program);
	strcat (cmdline, ">");
	strcat (cmdline, SEPSTR);
	for (i=1; i<argc; ++i)
	{
		if (strlen (cmdline) + strlen (argv[i]) + strlen (SEPSTR) + 1 <= n)
		{
			strcat (cmdline, argv[i]);
			strcat (cmdline, SEPSTR);
		}
		else
			error = true;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, (%rsp)
movl %edi, %r15d
movb $0x0, (%rdx)
movq %rdx, %rdi
callq 0x4180
movw $0x3c, (%rbx,%rax)
leaq 0x1efcf(%rip), %rax     # 0x28340
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x4570
movq %rbx, %rdi
callq 0x4180
movw $0x3e, (%rbx,%rax)
movq %rbx, %rdi
callq 0x4180
movw $0xa, (%rbx,%rax)
cmpl $0x2, %r15d
jl 0x93fb
movl %ebp, %r13d
movl %r15d, %ebp
movl $0x1, %r14d
movq %rbx, %rdi
callq 0x4180
movq %rax, %r12
movq (%rsp), %rax
movq (%rax,%r14,8), %r15
movq %r15, %rdi
callq 0x4180
addq %r12, %rax
addq $0x2, %rax
cmpq %r13, %rax
jbe 0x93da
movb $0x1, 0x20b6080(%rip)   # 0x20bf458
jmp 0x93f3
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4570
movq %rbx, %rdi
callq 0x4180
movw $0xa, (%rbx,%rax)
incq %r14
cmpq %r14, %rbp
jne 0x93aa
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/cmdlinecfg.cpp
// Function: unparsearg(int&, char**&, char*)
void unparsearg (int &argc, char **&argv, char *cmdline)
{
	char *c;
	int i, j;
	i = 0;
	for (c = cmdline; pvalid (c); c = pnext (c))
		i++;
	argc = i;
	argv = (char **)malloc (argc * sizeof (char *));
	if (!argv)
	{
		error = true;
		return;
	}
	for (c = cmdline, i = 0; pvalid (c); c = pnext (c), i++)
	{
		argv[i] = (char *)malloc (plen (c) + 1);
		if (!argv[i])
		{
			error = true;
			return;
		}
		for (j = 0; j < plen (c); j++)
			argv[i][j] = c[j];
		argv[i][j] = '\0';
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
xorl %eax, %eax
movabsq $0x100000000, %r15      # imm = 0x100000000
movq %rdx, %rcx
movq %rcx, %rdx
movzbl (%rdx), %esi
testl %esi, %esi
je 0x946e
cmpl $0xa, %esi
je 0x943b
incq %rdx
jmp 0x942a
incl %eax
movq %rcx, %rsi
xorl %edx, %edx
movzbl (%rsi), %r8d
testl %r8d, %r8d
je 0x945f
cmpl $0xa, %r8d
je 0x9459
addq %r15, %rdx
incq %rsi
jmp 0x9442
sarq $0x20, %rdx
jmp 0x9466
movq $-0x1, %rdx
addq %rdx, %rcx
incq %rcx
jmp 0x9427
movl %eax, (%rdi)
movl %eax, %edi
shlq $0x3, %rdi
callq 0x4420
movq %rax, (%r14)
testq %rax, %rax
je 0x955e
xorl %r12d, %r12d
movq %rbx, %rax
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0x9565
cmpl $0xa, %ecx
je 0x94a2
incq %rax
jmp 0x948d
movq %rbx, %rax
movq %r15, %rdi
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0x94c2
cmpl $0xa, %ecx
je 0x94bc
addq %r15, %rdi
incq %rax
jmp 0x94a8
sarq $0x20, %rdi
jmp 0x94c4
xorl %edi, %edi
callq 0x4420
movq (%r14), %rcx
movq %rax, (%rcx,%r12,8)
movq (%r14), %rax
cmpq $0x0, (%rax,%r12,8)
je 0x955e
xorl %eax, %eax
movq %rbx, %rdx
xorl %ecx, %ecx
movzbl (%rdx), %esi
testl %esi, %esi
je 0x94ff
cmpl $0xa, %esi
je 0x94f9
addq %r15, %rcx
incq %rdx
jmp 0x94e5
sarq $0x20, %rcx
jmp 0x9506
movq $-0x1, %rcx
cmpq %rcx, %rax
jge 0x951d
movb (%rbx,%rax), %cl
movq (%r14), %rdx
movq (%rdx,%r12,8), %rdx
movb %cl, (%rdx,%rax)
incq %rax
jmp 0x94e0
movq (%r14), %rcx
movq (%rcx,%r12,8), %rcx
movl %eax, %eax
movb $0x0, (%rcx,%rax)
movq %rbx, %rcx
xorl %eax, %eax
movzbl (%rcx), %edx
testl %edx, %edx
je 0x9549
cmpl $0xa, %edx
je 0x9543
addq %r15, %rax
incq %rcx
jmp 0x952f
sarq $0x20, %rax
jmp 0x9550
movq $-0x1, %rax
addq %rax, %rbx
incq %rbx
incq %r12
jmp 0x948a
movb $0x1, 0x20b5ef3(%rip)   # 0x20bf458
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/filelib.cpp
// Function: getfiletime(char const*)
time_t          getfiletime(const char* const filename)
{
    time_t          filetime = 0;
    struct stat     filestat;

    if (stat(filename, &filestat) == 0)
        filetime = qmax(filestat.st_mtime, filestat.st_ctime);

    return filetime;
}

// Assembly:
subq $0x98, %rsp
leaq 0x8(%rsp), %rsi
callq 0x42a0
testl %eax, %eax
je 0x980f
xorl %eax, %eax
addq $0x98, %rsp
retq
movq 0x60(%rsp), %rcx
movq 0x70(%rsp), %rax
cmpq %rax, %rcx
cmovgq %rcx, %rax
addq $0x98, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/filelib.cpp
// Function: getfiledata(char const*, char*, int)
long            getfiledata(const char* const filename, char* buffer, const int buffersize)
{
    long            size = 0;
    int             handle;
    time_t            start, end;

    time(&start);

    if ((handle = _open(filename, O_RDONLY)) != -1)
    {
        int             bytesread;

        Log("%-20s Restoring [%-13s - ", "BuildVisMatrix:", filename);
        while ((bytesread = _read(handle, buffer, qmin(32 * 1024, buffersize - size))) > 0)
        {
            size += bytesread;
            buffer += bytesread;
        }
        _close(handle);
        time(&end);
        Log("%10.3fMB] (%d)\n", size / (1024.0 * 1024.0), (int)(end - start));
    }

    if (buffersize != size)
    {
        Warning("Invalid file [%s] found.  File will be rebuilt!\n", filename);
        _unlink(filename);
    }

    return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r12d
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x42b0
movq %rbx, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x4230
cmpl $-0x1, %eax
je 0x9925
movl %eax, %ebp
leaq 0x140bb(%rip), %rdi     # 0x1d948
leaq 0x140ce(%rip), %rsi     # 0x1d962
xorl %r14d, %r14d
movq %rbx, %rdx
xorl %eax, %eax
callq 0x9e76
movslq %r12d, %r12
movl $0x8000, %r13d          # imm = 0x8000
cmpq %r13, %r12
movl $0x8000, %edx           # imm = 0x8000
cmovlq %r12, %rdx
movl %ebp, %edi
movq %r15, %rsi
callq 0x4470
testl %eax, %eax
jle 0x98ed
xorl %r14d, %r14d
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addq %rax, %r14
addq %rax, %r15
movq %r12, %rdx
subq %r14, %rdx
cmpq %r13, %rdx
cmovgeq %r13, %rdx
movl %ebp, %edi
movq %r15, %rsi
callq 0x4470
testl %eax, %eax
jg 0x98c7
movl %ebp, %edi
callq 0x4620
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x42b0
cvtsi2sd %r14, %xmm0
mulsd 0x14032(%rip), %xmm0    # 0x1d940
movl (%r15), %esi
subl 0x8(%rsp), %esi
leaq 0x14056(%rip), %rdi     # 0x1d972
movb $0x1, %al
callq 0x9e76
jmp 0x992b
movslq %r12d, %r12
xorl %r14d, %r14d
cmpq %r12, %r14
je 0x9949
leaq 0x1404b(%rip), %rdi     # 0x1d982
movq %rbx, %rsi
xorl %eax, %eax
callq 0xa4d6
movq %rbx, %rdi
callq 0x4190
movq %r14, %rax
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/common/filelib.cpp
// Function: q_filelength(_IO_FILE*)
int             q_filelength(FILE* f)
{
    int             pos;
    int             end;

    pos = ftell(f);
    fseek(f, 0, SEEK_END);
    end = ftell(f);
    fseek(f, pos, SEEK_SET);

    return end;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x4030
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x4350
movq %rbx, %rdi
callq 0x4030
movq %rax, %r15
movslq %r14d, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4350
movl %r15d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/filelib.cpp
// Function: SafeOpenWrite(char const*)
FILE*           SafeOpenWrite(const char* const filename)
{
    FILE*           f;

    f = fopen(filename, "wb");

    if (!f)
        Error("Error opening %s: %s", filename, strerror(errno));

    return f;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x13fe8(%rip), %rsi     # 0x1d9b6
callq 0x4380
movq %rax, %r14
testq %rax, %rax
jne 0x99fb
callq 0x4060
movl (%rax), %edi
callq 0x4130
leaq 0x127b5(%rip), %rdi     # 0x1c1a3
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xa164
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/filelib.cpp
// Function: SafeOpenRead(char const*)
FILE*           SafeOpenRead(const char* const filename)
{
    FILE*           f;

    f = fopen(filename, "rb");

    if (!f)
        Error("Error opening %s: %s", filename, strerror(errno));

    return f;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x13f9f(%rip), %rsi     # 0x1d9b3
callq 0x4380
movq %rax, %r14
testq %rax, %rax
jne 0x9a41
callq 0x4060
movl (%rax), %edi
callq 0x4130
leaq 0x1276f(%rip), %rdi     # 0x1c1a3
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xa164
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/filelib.cpp
// Function: LoadFile(char const*, char**)
int             LoadFile(const char* const filename, char** bufferptr)
{
    FILE*           f;
    int             length;
    char*           buffer;

    f = SafeOpenRead(filename);
    length = q_filelength(f);
    buffer = (char*)Alloc(length + 1);
    SafeRead(f, buffer, length);
    fclose(f);

    *bufferptr = buffer;
    return length;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
callq 0x9a06
movq %rax, %r14
movq %rax, %rdi
callq 0x995b
movl %eax, %r15d
leal 0x1(%r15), %eax
movslq %eax, %rdi
callq 0x4974
movq %rax, %r12
movq %r14, %rdi
movq %rax, %rsi
movl %r15d, %edx
callq 0x9a4c
movq %r14, %rdi
callq 0x42f0
movq %r12, (%rbx)
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/log.cpp
// Function: CheckForErrorLog()
void            CheckForErrorLog()
{
    if (g_log)
    {
        char            logfilename[_MAX_PATH];

        safe_snprintf(logfilename, _MAX_PATH, "%s.err", g_Mapname);
        if (q_exists(logfilename))
        {
            Log(">> There was a problem compiling the map.\n"
                ">> Check the file %s.log for the cause.\n",
                 g_Mapname);
            exit(1);
        }
    }
}

// Assembly:
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
cmpb $0x1, 0x1f530(%rip)     # 0x29350
jne 0x9e4e
leaq 0x13c74(%rip), %rdx     # 0x1da9d
leaq 0x1e520(%rip), %rcx     # 0x28350
movq %rsp, %rbx
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8a47
movq %rbx, %rdi
callq 0x999b
testb %al, %al
jne 0x9e57
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
retq
leaq 0x13c46(%rip), %rdi     # 0x1daa4
leaq 0x1e4eb(%rip), %rsi     # 0x28350
xorl %eax, %eax
callq 0x9e76
movl $0x1, %edi
callq 0x43a0