LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/wangyufei95[P]watchdog_linux/watchdog.cpp
// Function: Supervisor::restart()
bool Supervisor::restart() 
{
  if (restartDelay_) 
  {
    logger()->info("restart is sleeping for %d seconds\n", restartDelay_);
    sleep(restartDelay_);

    // exponential backoff for the next restart
    restartDelay_ = std::min(restartDelay_ << 1, restartDelayLimit_);
  } 
  else 
  {
    restartDelay_ = 1;
	cout<<endl;
  }

  restartCount_++;
  if(restartCount_%3==0)
  {
	  run_mail();
  }
  return program_->restart();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x74(%rdi), %edx
testl %edx, %edx
je 0x6526
leaq 0x1f76(%rip), %rsi      # 0x847a
movq %rbx, %rdi
callq 0x6704
movl 0x74(%rbx), %edi
callq 0x3260
movl 0x74(%rbx), %eax
movl 0x78(%rbx), %ecx
addl %eax, %eax
cmpl %eax, %ecx
cmovll %ecx, %eax
movl %eax, 0x74(%rbx)
jmp 0x655b
movl $0x1, 0x74(%rbx)
movq 0x4a84(%rip), %r14      # 0xafb8
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3380
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3220
movl 0x70(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x70(%rbx)
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
addl $0xd5555555, %eax       # imm = 0xD5555555
cmpl $0x55555554, %eax       # imm = 0x55555554
ja 0x657b
callq 0x52ad
movq 0x28(%rbx), %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x5ad6
// File: /workspace/github_cpp_makefile_star2_O1/wangyufei95[P]watchdog_linux/watchdog.cpp
// Function: void Logger::info<int>(char const*, int)
void info(const char* fmt, Args... args) 
	{
		if (logLevel_ >= 2) 
		{
		  std::string fmt2("%s[%d]: ");
		  fmt2 += fmt;
		  fmt2 += "\n";
		  fprintf(stdout, fmt2.c_str(), basename_.c_str(), getpid(), args...);
		  fflush(stdout);
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0x2, 0x20(%rdi)
jl 0x67ab
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1e0f(%rip), %rsi      # 0x8545
leaq 0x1e10(%rip), %rdx      # 0x854d
leaq -0x48(%rbp), %r12
movq %r12, %rdi
callq 0x6db8
movq %r12, %rdi
movq %r15, %rsi
callq 0x36c0
leaq 0x1a22(%rip), %rsi      # 0x817d
leaq -0x48(%rbp), %rdi
callq 0x36c0
movq 0x4825(%rip), %r13      # 0xaf90
movq (%r13), %r15
movq -0x48(%rbp), %r12
movq (%r14), %r14
callq 0x3550
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movl %eax, %ecx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x3520
movq (%r13), %rdi
callq 0x3430
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x67ab
callq 0x3370
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x67cf
callq 0x3370
movq %rbx, %rdi
callq 0x3630
nop
// File: /workspace/github_cpp_makefile_star2_O1/wangyufei95[P]watchdog_linux/watchdog.cpp
// Function: void Logger::error<char*>(char const*, char*)
void error(const char* fmt, Args... args) 
	{
    	if (logLevel_ >= 1) 
		{
		  std::string fmt2("%s[%d]: ");
		  fmt2 += fmt;
		  fmt2 += "\n";
		  fprintf(stderr, fmt2.c_str(), basename_.c_str(), getpid(), args...);
		  fflush(stderr);
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0x0, 0x20(%rdi)
jg 0x68d2
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
leaq -0x38(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1c5b(%rip), %rsi      # 0x8545
leaq 0x1c5c(%rip), %rdx      # 0x854d
leaq -0x48(%rbp), %r13
movq %r13, %rdi
callq 0x6db8
movq %r13, %rdi
movq %r12, %rsi
callq 0x36c0
leaq 0x186e(%rip), %rsi      # 0x817d
leaq -0x48(%rbp), %rdi
callq 0x36c0
leaq -0x48(%rbp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x3710
jmp 0x68c3
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x693d
callq 0x3370
movq %rbx, %rdi
callq 0x3630
nop
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/common/blockmem.cpp
// Function: FreeBlock(void*)
bool            FreeBlock(void* pointer)
{
    if (!pointer)
    {
        Warning("Freeing a null pointer");
    }
    free(pointer);
    return true;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x4988
leaq 0x176a2(%rip), %rdi     # 0x1c023
xorl %eax, %eax
callq 0xa612
movq %rbx, %rdi
callq 0x43a0
movb $0x1, %al
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: CompressVis(unsigned char const*, unsigned int, unsigned char*, unsigned int)
int             CompressVis(const byte* const src, const unsigned int src_length, byte* dest, unsigned int dest_length)
{
    unsigned int    j;
    byte*           dest_p = dest;
    unsigned int    current_length = 0;

    for (j = 0; j < src_length; j++)
    {
        current_length++;
        hlassume(current_length <= dest_length, assume_COMPRESSVIS_OVERFLOW);

        *dest_p = src[j];
        dest_p++;

        if (src[j])
        {
            continue;
        }

        unsigned char   rep = 1;

        for (j++; j < src_length; j++)
        {
            if (src[j] || rep == 255)
            {
                break;
            }
            else
            {
                rep++;
            }
        }
        current_length++;
        hlassume(current_length <= dest_length, assume_COMPRESSVIS_OVERFLOW);

        *dest_p = rep;
        dest_p++;
        j--;
    }

    return dest_p - dest;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, (%rsp)
movq %rdx, %r12
movq %rdx, 0x8(%rsp)
testl %esi, %esi
je 0x4aae
movl %esi, %r14d
movq %rdi, %r15
leal -0x1(%r14), %eax
movl %eax, 0x4(%rsp)
movl $0x2, %eax
subl %esi, %eax
movq %rax, 0x10(%rsp)
xorl %ebx, %ebx
movq 0x8(%rsp), %r12
xorl %r13d, %r13d
leal 0x1(%rbx), %ebp
xorl %edi, %edi
cmpl (%rsp), %ebp
setbe %dil
movl $0x33, %esi
callq 0xaa4d
movl %r13d, %eax
movb (%r15,%rax), %cl
movb %cl, (%r12)
cmpb $0x0, (%r15,%rax)
je 0x4a2e
incq %r12
jmp 0x4aa0
leal 0x1(%r13), %ecx
movb $0x1, %bpl
cmpl %r14d, %ecx
jae 0x4a7f
movl %ecx, %ecx
cmpb $0x0, (%r15,%rcx)
jne 0x4a7f
movl %r14d, %ebp
subb %r13b, %bpl
leal 0x2(%r13), %ecx
addq %r15, %rcx
addq 0x10(%rsp), %rax
xorl %esi, %esi
movl %eax, %edx
addl %esi, %edx
je 0x4a78
leaq 0x1(%rsi), %rdx
cmpb $0x0, (%rcx,%rsi)
jne 0x4a70
cmpb $-0x3, %sil
movq %rdx, %rsi
jne 0x4a57
leal 0x1(%rdx), %ebp
addl %edx, %r13d
jmp 0x4a7f
movl 0x4(%rsp), %eax
movl %eax, %r13d
addl $0x2, %ebx
xorl %edi, %edi
cmpl (%rsp), %ebx
setbe %dil
movl $0x33, %esi
callq 0xaa4d
movb %bpl, 0x1(%r12)
addq $0x2, %r12
movl %ebx, %ebp
incl %r13d
movl %ebp, %ebx
cmpl %r14d, %r13d
jb 0x4a01
subl 0x8(%rsp), %r12d
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: DecompressVis(unsigned char const*, unsigned char*, unsigned int)
void            DecompressVis(const byte* src, byte* const dest, const unsigned int dest_length)
{
    unsigned int    current_length = 0;
    int             c;
    byte*           out;
    int             row;

#ifdef ZHLT_DecompressVis_FIX
	row = (g_dmodels[0].visleafs + 7) >> 3; // same as the length used by VIS program in CompressVis
	// The wrong size will cause DecompressVis to spend extremely long time once the source pointer runs into the invalid area in g_dvisdata (for example, in BuildFaceLights, some faces could hang for a few seconds), and sometimes to crash.
#else
    row = (g_numleafs + 7) >> 3;
#endif
    out = dest;

    do
    {
#ifdef ZHLT_DecompressVis_FIX
		hlassume (src - g_dvisdata < g_visdatasize, assume_DECOMPRESSVIS_OVERFLOW);
#endif
        if (*src)
        {
            current_length++;
            hlassume(current_length <= dest_length, assume_DECOMPRESSVIS_OVERFLOW);

            *out = *src;
            out++;
            src++;
            continue;
        }
		
#ifdef ZHLT_DecompressVis_FIX
		hlassume (&src[1] - g_dvisdata < g_visdatasize, assume_DECOMPRESSVIS_OVERFLOW);
#endif
        c = src[1];
        src += 2;
        while (c)
        {
            current_length++;
            hlassume(current_length <= dest_length, assume_DECOMPRESSVIS_OVERFLOW);

            *out = 0;
            out++;
            c--;

            if (out - dest >= row)
            {
                return;
            }
        }
    }
    while (out - dest < row);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
movl 0x249f1(%rip), %eax     # 0x294d4
addl $0x7, %eax
sarl $0x3, %eax
movslq %eax, %r12
movq %rsi, %rax
negq %rax
movq %rax, 0x18(%rsp)
xorl %ebp, %ebp
leaq 0x2c9b0(%rip), %rax     # 0x314b0
negq %rax
movq %rax, 0x10(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x8(%rsp), %r15
movq %r15, %rax
leaq 0x2c994(%rip), %rcx     # 0x314b0
subq %rcx, %rax
movslq 0x2c97e(%rip), %rcx     # 0x314a4
xorl %edi, %edi
cmpq %rcx, %rax
setl %dil
movl $0x34, %esi
callq 0xaa4d
cmpb $0x0, (%r15)
je 0x4b73
incl %ebp
xorl %edi, %edi
cmpl %ebx, %ebp
setbe %dil
movl $0x34, %esi
callq 0xaa4d
movb (%r15), %al
movb %al, (%r14)
incq %r14
incq %r15
movq %r15, 0x8(%rsp)
movq %r14, %rax
subq 0x20(%rsp), %rax
cmpq %r12, %rax
jl 0x4b0d
jmp 0x4bd8
movq 0x10(%rsp), %rax
addq %r15, %rax
incq %rax
movslq 0x2c91f(%rip), %rcx     # 0x314a4
xorl %edi, %edi
cmpq %rcx, %rax
setl %dil
movl $0x34, %esi
callq 0xaa4d
movzbl 0x1(%r15), %r13d
addq $0x2, %r15
movq %r15, 0x8(%rsp)
movq 0x18(%rsp), %rax
leaq (%rax,%r14), %r15
subl $0x1, %r13d
jb 0x4b64
incl %ebp
xorl %edi, %edi
cmpl %ebx, %ebp
setbe %dil
movl $0x34, %esi
callq 0xaa4d
movb $0x0, (%r14)
incq %r14
incq %r15
cmpq %r12, %r15
jl 0x4baf
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: AddLump(int, void*, int, dheader_t*, _IO_FILE*)
static void     AddLump(int lumpnum, void* data, int len, dheader_t* header, FILE* bspfile)
{
    lump_t* lump =&header->lumps[lumpnum];
    lump->fileofs = LittleLong(ftell(bspfile));
    lump->filelen = LittleLong(len);
    SafeWrite(bspfile, data, (len + 3) & ~3);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r8, %rbx
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r15
movl %edi, %r12d
movq %r8, %rdi
callq 0x4030
movl %eax, %edi
callq 0x8b70
movl %eax, 0x4(%r14,%r12,8)
movl %ebp, %edi
callq 0x8b70
movl %eax, 0x8(%r14,%r12,8)
addl $0x3, %ebp
andl $-0x4, %ebp
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9bbb
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: CalculatePointVecsProduct(float const volatile*, float const volatile*)
float CalculatePointVecsProduct (const volatile float *point, const volatile float *vecs)
{
	volatile double val;
	volatile double tmp;

	val = (double)point[0] * (double)vecs[0]; // always do one operation at a time and save to memory
	tmp = (double)point[1] * (double)vecs[1];
	val = val + tmp;
	tmp = (double)point[2] * (double)vecs[2];
	val = val + tmp;
	val = val + (double)vecs[3];

	return (float)val;
}

// Assembly:
cvtss2sd (%rdi), %xmm0
cvtss2sd (%rsi), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, -0x10(%rsp)
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rdi), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x4(%rsi), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, -0x8(%rsp)
movsd -0x10(%rsp), %xmm0
addsd -0x8(%rsp), %xmm0
movsd %xmm0, -0x10(%rsp)
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rdi), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x8(%rsi), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, -0x8(%rsp)
movsd -0x10(%rsp), %xmm0
addsd -0x8(%rsp), %xmm0
movsd %xmm0, -0x10(%rsp)
movsd -0x10(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0xc(%rsi), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x10(%rsp)
xorps %xmm0, %xmm0
cvtsd2ss -0x10(%rsp), %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: CalcFaceExtents_test()
bool CalcFaceExtents_test ()
{
	const int numtestcases = 6;
	volatile float testcases[numtestcases][8] = {
		{1, 1, 1, 1, 0.375 * DBL_EPSILON, 0.375 * DBL_EPSILON, -1, 0},
		{1, 1, 1, 0.375 * DBL_EPSILON, 0.375 * DBL_EPSILON, 1, -1, DBL_EPSILON},
		{DBL_EPSILON, DBL_EPSILON, 1, 0.375, 0.375, 1, -1, DBL_EPSILON},
		{1, 1, 1, 1, 1, 0.375 * FLT_EPSILON, -2, 0.375 * FLT_EPSILON},
		{1, 1, 1, 1, 0.375 * FLT_EPSILON, 1, -2, 0.375 * FLT_EPSILON},
		{1, 1, 1, 0.375 * FLT_EPSILON, 1, 1, -2, 0.375 * FLT_EPSILON}};
	bool ok;

	// If the test failed, please check:
	//   1. whether the calculation is performed on FPU
	//   2. whether the register precision is too low
		
	CorrectFPUPrecision ();

	ok = true;
	for (int i = 0; i < 6; i++)
	{
		float val = CalculatePointVecsProduct (&testcases[i][0], &testcases[i][3]);
		if (val != testcases[i][7])
		{
			Warning ("internal error: CalcFaceExtents_test failed on case %d (%.20f != %.20f).", i, val, testcases[i][7]);
			ok = false;
		}
	}
	return ok;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
leaq 0x16c23(%rip), %rsi     # 0x1c830
movq %rsp, %rbx
movl $0xc0, %edx
movq %rbx, %rdi
callq 0x4270
movb $0x1, %bpl
xorl %r14d, %r14d
leaq 0x16538(%rip), %r15     # 0x1c162
leaq 0xc(%rbx), %rsi
movq %rbx, %rdi
callq 0x5b6d
ucomiss 0x1c(%rbx), %xmm0
jne 0x5c3e
jnp 0x5c59
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x1c(%rbx), %xmm1
movq %r15, %rdi
movl %r14d, %esi
movb $0x2, %al
callq 0xa612
xorl %ebp, %ebp
incq %r14
addq $0x20, %rbx
cmpq $0x6, %r14
jne 0x5c2a
andb $0x1, %bpl
movl %ebp, %eax
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: WriteExtentFile(char const*)
void WriteExtentFile (const char *const filename)
{
	FILE *f;
	f = fopen (filename, "w");
	if (!f)
	{
		Error ("Error opening %s: %s", filename, strerror(errno));
	}
	fprintf (f, "%i\n", g_numfaces);
	for (int i = 0; i < g_numfaces; i++)
	{
		int mins[2];
		int maxs[2];
		GetFaceExtents (i, mins, maxs);
		fprintf (f, "%i %i %i %i\n", mins[0], mins[1], maxs[0], maxs[1]);
	}
	fclose (f);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
leaq 0x1b8b5(%rip), %rsi     # 0x2172c
callq 0x4390
movq %rax, %rbx
testq %rax, %rax
jne 0x5ea4
callq 0x4060
movl (%rax), %edi
callq 0x4130
leaq 0x16314(%rip), %rdi     # 0x1c1ab
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xa2a0
movl 0x1b8b57a(%rip), %edx   # 0x1b91424
leaq 0x19227(%rip), %rsi     # 0x1f0d8
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4470
cmpl $0x0, 0x1b8b562(%rip)   # 0x1b91424
jle 0x5f0a
leaq 0x8(%rsp), %r14
movq %rsp, %r15
leaq 0x162ed(%rip), %r12     # 0x1c1c0
xorl %ebp, %ebp
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5c7a
movl 0x8(%rsp), %edx
movl 0xc(%rsp), %ecx
movl (%rsp), %r8d
movl 0x4(%rsp), %r9d
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x4470
incl %ebp
cmpl 0x1b8b51c(%rip), %ebp   # 0x1b91424
jl 0x5ed5
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4300
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: NoWadTextures()
bool NoWadTextures ()
{
	// copied from loadtextures.cpp
	int numtextures = g_texdatasize? ((dmiptexlump_t *)g_dtexdata)->nummiptex: 0;
	for (int i = 0; i < numtextures; i++)
	{
		int offset = ((dmiptexlump_t *)g_dtexdata)->dataofs[i];
		int size = g_texdatasize - offset;
		if (offset < 0 || size < (int)sizeof (miptex_t))
		{
			// missing textures have ofs -1
			continue;
		}
		miptex_t *mt = (miptex_t *)&g_dtexdata[offset];
		if (!mt->offsets[0])
		{
			return false;
		}
	}
	return true;
}

// Assembly:
movl 0x82b0f2(%rip), %ecx    # 0x8314c4
testl %ecx, %ecx
je 0x63e1
movq 0x82b0eb(%rip), %rax    # 0x8314c8
movl (%rax), %esi
jmp 0x63e3
xorl %esi, %esi
testl %esi, %esi
setle %al
jle 0x644f
movq 0x82b0d7(%rip), %rdx    # 0x8314c8
movl %esi, %esi
movq %rsi, %rdi
negq %rdi
movl $0x1, %r8d
movl (%rdx,%r8,4), %r9d
movl %ecx, %r10d
subl %r9d, %r10d
testl %r9d, %r9d
sets %r11b
cmpl $0x28, %r10d
setl %r10b
orb %r11b, %r10b
movl $0x4, %r10d
jne 0x6433
movl %r9d, %r9d
xorl %r10d, %r10d
cmpl $0x0, 0x18(%rdx,%r9)
sete %r10b
testb $0x3, %r10b
jne 0x644f
cmpq %rsi, %r8
setae %al
leaq (%rdi,%r8), %r9
incq %r9
incq %r8
cmpq $0x1, %r9
jne 0x63ff
andb $0x1, %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/common/bspfile.cpp
// Function: GlobUsage(char const*, int, int)
static int      GlobUsage(const char* const szItem, const int itemstorage, const int maxstorage)
{
    float           percentage = maxstorage ? itemstorage * 100.0 / maxstorage : 0.0;

#ifdef ZHLT_MAX_MAP_LEAFS
    Log("%-13s    [variable]   %8i/%-8i (%4.1f%%)\n", szItem, itemstorage, maxstorage, percentage);
#else
    Log("%-12s     [variable]    %7i/%-7i  (%4.1f%%)\n", szItem, itemstorage, maxstorage, percentage);
#endif

    return itemstorage;
}

// Assembly:
pushq %rbx
movl %edx, %ecx
movl %esi, %ebx
movq %rdi, %rsi
testl %edx, %edx
je 0x6cb6
cvtsi2sd %ebx, %xmm0
mulsd 0x1540c(%rip), %xmm0    # 0x1c0b0
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
jmp 0x6cb9
xorps %xmm0, %xmm0
leaq 0x15b3c(%rip), %rdi     # 0x1c7fc
movl %ebx, %edx
movb $0x1, %al
callq 0x9fb2
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x82a7ef(%rip), %ecx    # 0x8314c4
testl %ecx, %ecx
je 0x6ce4
movq 0x82a7e8(%rip), %rdx    # 0x8314c8
movl (%rdx), %edx
jmp 0x6ce6
xorl %edx, %edx
pushq %r14
pushq %rbx
subq $0x18, %rsp
testl %eax, %eax
setns %sil
cmpl %eax, %edx
setg %dil
testb %dil, %sil
je 0x6d99
movq 0x82a7bf(%rip), %rsi    # 0x8314c8
movl %eax, %eax
movslq 0x4(%rsi,%rax,4), %rax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
js 0x6dae
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 0x6dae
movq %rsp, %r14
movl $0x10, %edx
movq %r14, %rdi
callq 0x8c21
movq %r14, %rdi
callq 0x4180
cmpq $0x6, %rax
jb 0x6dae
leaq 0x1(%rsp), %rdi
leaq 0x15746(%rip), %rsi     # 0x1c4ad
movl $0x4, %edx
callq 0x4410
testl %eax, %eax
jne 0x6dae
movb 0x5(%rsp), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x6dae
leaq 0x5(%rsp), %rdi
callq 0x4500
testl %eax, %eax
js 0x6db8
cmpl 0x118a689(%rip), %eax   # 0x119141c
jge 0x6db8
movl %eax, %ebx
jmp 0x6dae
leaq 0x156c1(%rip), %rdi     # 0x1c461
movl %eax, %esi
xorl %eax, %eax
callq 0xa612
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x156f3(%rip), %rdi     # 0x1c4b2
movq %rsp, %rdx
movl %eax, %esi
xorl %eax, %eax
callq 0xa612
jmp 0x6dae
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4994
movq %rax, %rbx
leaq 0x20bc3a8(%rip), %rdi   # 0x20c34b0
callq 0x4180
cmpq $0x7f, %rax
jb 0x7123
leaq 0x1542f(%rip), %rdi     # 0x1c549
movl %eax, %esi
xorl %eax, %eax
callq 0xa2a0
leaq 0x20bc386(%rip), %r14   # 0x20c34b0
movq %r14, %rdi
callq 0x45c0
movq %rax, 0x8(%rbx)
xorl %edi, %edi
callq 0xb0b8
movq %r14, %rdi
callq 0x4180
cmpq $0xfff, %rax            # imm = 0xFFF
jb 0x715d
leaq 0x15423(%rip), %rdi     # 0x1c577
movl %eax, %esi
xorl %eax, %eax
callq 0xa2a0
leaq 0x20bc34c(%rip), %rdi   # 0x20c34b0
callq 0x45c0
movq %rax, 0x10(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1670a(%rip), %rbx     # 0x1dcb9
movq (%r14), %r14
testq %r14, %r14
je 0x75cb
movq 0x8(%r14), %rdi
movq %r15, %rsi
callq 0x4450
testl %eax, %eax
jne 0x75af
movq 0x10(%r14), %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x7627
movq %rdx, %rbx
addq $0x20, %r15
movq %r15, %r12
movq (%r12), %r12
testq %r12, %r12
je 0x763d
movq 0x8(%r12), %rdi
movq %r14, %rsi
callq 0x4450
testl %eax, %eax
jne 0x75f1
movq %rbx, %rdi
callq 0x45c0
movq %rax, %rbx
movq 0x10(%r12), %rdi
callq 0x4999
movq %rbx, 0x10(%r12)
jmp 0x766e
movq %r15, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x767a
movl $0x18, %edi
callq 0x4994
movq %rax, %r12
movq (%r15), %rax
movq %rax, (%r12)
movq %r12, (%r15)
movq %r14, %rdi
callq 0x45c0
movq %rax, 0x8(%r12)
movq %rbx, %rdi
callq 0x45c0
movq %rax, 0x10(%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x76c9
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x4450
testl %eax, %eax
jne 0x7689
movq (%rbx), %rax
movq %rax, (%r15)
movq 0x8(%rbx), %rdi
callq 0x4999
movq 0x10(%rbx), %rdi
callq 0x4999
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x4999
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2017111(%rip), %r12   # 0x201f454
testq %r12, %r12
jle 0x83b3
leaq 0x2017111(%rip), %r13   # 0x201f460
leaq 0x14402(%rip), %r14     # 0x1c758
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 0x8397
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x4450
testl %eax, %eax
jne 0x8379
movq 0x10(%rbx), %rdi
jmp 0x839e
leaq 0x1591b(%rip), %rdi     # 0x1dcb9
movq (%rsp), %rsi
callq 0x4450
testl %eax, %eax
je 0x83b6
incq %rbp
cmpq %r12, %rbp
jne 0x8358
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_O1/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 0x158d0(%rip), %r14     # 0x1dcb9
movq (%r15), %r15
testq %r15, %r15
je 0x8405
movq 0x8(%r15), %rdi
movq %r12, %rsi
callq 0x4450
testl %eax, %eax
jne 0x83e9
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 0x17c51(%rip), %rsi     # 0x20079
movq %r14, %rdi
movq %r13, %rdx
movq %r12, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x42f0
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_O1/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 0x1fed0(%rip), %rdi     # 0x28340
callq 0x494c
movq %rax, 0x82904c(%rip)    # 0x8314c8
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
callq 0xaa4d
movslq 0x1feae(%rip), %rdi     # 0x28344
callq 0x494c
movq %rax, 0x829016(%rip)    # 0x8314b8
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl $0x1, %esi
popq %rax
jmp 0xaa4d
// File: /workspace/github_cpp_makefile_star2_O1/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 0x82900a(%rip), %rdi    # 0x8314c8
callq 0x4971
xorl %ebx, %ebx
movq %rbx, 0x828ffc(%rip)    # 0x8314c8
movq 0x828fe5(%rip), %rdi    # 0x8314b8
callq 0x4971
movq %rbx, 0x828fd9(%rip)    # 0x8314b8
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x142c2(%rip), %rsi     # 0x1c7ba
movq %rsp, %rdi
xorl %eax, %eax
callq 0x40c0
movslq 0x2016f4b(%rip), %r12   # 0x201f454
testq %r12, %r12
jle 0x857e
xorl %r13d, %r13d
leaq 0x2016f48(%rip), %rbp   # 0x201f460
leaq 0x17a31(%rip), %r14     # 0x1ff50
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 0x855e
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x4450
testl %eax, %eax
jne 0x8540
movq 0x10(%rbx), %rdi
jmp 0x8565
leaq 0x15754(%rip), %rdi     # 0x1dcb9
movq %rsp, %rsi
callq 0x4450
testl %eax, %eax
je 0x8585
incq %r13
cmpq %r12, %r13
jne 0x851f
movq %rbp, %r15
jmp 0x8585
leaq 0x2016edb(%rip), %r15   # 0x201f460
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x862b
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
xorl %r15d, %r15d
movsbl (%rbx,%r15), %edi
callq 0x4600
movb %al, (%rbx,%r15)
incq %r15
cmpq %r15, %r14
jne 0x8615
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x8669
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
xorl %r15d, %r15d
movsbl (%rbx,%r15), %edi
callq 0x4490
movb %al, (%rbx,%r15)
incq %r15
cmpq %r15, %r14
jne 0x8653
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x45c0
movq %rax, %r15
movq %rax, %rdi
callq 0x8634
movq %rbx, %rdi
callq 0x45c0
movq %rax, %rbx
movq %rax, %rdi
callq 0x8634
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 0x43a0
movq %rbx, %rdi
callq 0x43a0
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4350
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 0x4350
movq %rax, %r15
movq %r14, %rdi
movl $0x5c, %esi
callq 0x4350
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 0x876c
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 0x4580
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x2f, %esi
callq 0x4350
movq %rax, %r15
movq %rbx, %rdi
movl $0x5c, %esi
callq 0x4350
movq %rax, %r14
cmpq %rax, %r15
cmovaq %r15, %r14
testq %r14, %r14
je 0x87f2
movl %r14d, %ebp
subl %ebx, %ebp
movq %rbx, %rdi
callq 0x4180
decl %eax
cmpl %ebp, %eax
jne 0x87f7
movq %rbx, %rax
notq %rax
addq %r14, %rax
movl %ebp, %ecx
testl %ebp, %ebp
jle 0x87ec
movl %eax, %edx
movzbl (%rbx,%rdx), %edx
cmpl $0x5c, %edx
je 0x87ec
leal -0x1(%rcx), %ebp
decq %rax
cmpl $0x2f, %edx
jne 0x87d0
decl %ecx
movl %ecx, %ebp
jmp 0x87f7
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %eax, %eax
cmpl $-0x1, %ebp
cmovnel %ebp, %eax
cltq
movb $0x0, (%rbx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4350
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 0x4350
movq %rax, %r14
movq %rbx, %rdi
movl $0x5c, %esi
callq 0x4350
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 0x8873
movslq %ecx, %rax
movb $0x0, (%rbx,%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4350
movq %rax, %r12
movq %r14, %rdi
movl $0x5c, %esi
callq 0x4350
movq %rax, %r15
cmpq %rax, %r12
cmovaq %r12, %r15
testq %r15, %r15
je 0x88f4
movl %r15d, %r12d
subl %r14d, %r12d
movq %r14, %rdi
callq 0x4180
decl %eax
cmpl %r12d, %eax
jne 0x88fa
movq %r14, %rax
notq %rax
addq %r15, %rax
movl %r12d, %ecx
testl %r12d, %r12d
jle 0x88ed
movl %eax, %edx
movzbl (%r14,%rdx), %edx
cmpl $0x5c, %edx
je 0x88ed
leal -0x1(%rcx), %r12d
decq %rax
cmpl $0x2f, %edx
jne 0x88cd
decl %ecx
movl %ecx, %r12d
jmp 0x88fa
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
cmpl $-0x1, %r12d
je 0x891c
leal 0x1(%r12), %eax
movslq %eax, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4270
movslq %r12d, %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_O1/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 0x4350
movq %rax, %r12
movq %r14, %rdi
movl $0x5c, %esi
callq 0x4350
movq %rax, %r15
cmpq %rax, %r12
cmovaq %r12, %r15
testq %r15, %r15
je 0x89a2
movl %r15d, %ebp
subl %r14d, %ebp
movq %r14, %rdi
callq 0x4180
decl %eax
cmpl %ebp, %eax
jne 0x89a7
movq %r14, %rax
notq %rax
addq %r15, %rax
movl %ebp, %ecx
testl %ebp, %ebp
jle 0x899c
movl %eax, %edx
movzbl (%r14,%rdx), %edx
cmpl $0x5c, %edx
je 0x899c
leal -0x1(%rcx), %ebp
decq %rax
cmpl $0x2f, %edx
jne 0x897f
decl %ecx
movl %ecx, %ebp
jmp 0x89a7
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
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 0x4270
movb $0x0, (%rbx,%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x2e, %esi
callq 0x4350
movl %eax, %ecx
subl %r14d, %ecx
xorl %r13d, %r13d
cmpq $0x1, %rax
sbbl %r13d, %r13d
orl %ecx, %r13d
movq %r14, %rdi
movl $0x2f, %esi
callq 0x4350
movq %rax, %r15
movq %r14, %rdi
movl $0x5c, %esi
callq 0x4350
movq %rax, %r12
cmpq %rax, %r15
cmovaq %r15, %r12
testq %r12, %r12
je 0x8a7f
movl %r12d, %ebp
subl %r14d, %ebp
cmpl %ebp, %r13d
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
cmovgel %r13d, %r15d
movq %r14, %rdi
callq 0x4180
decl %eax
cmpl %ebp, %eax
jne 0x8a87
movq %r14, %rax
notq %rax
addq %r12, %rax
movl %ebp, %ecx
testl %ebp, %ebp
jle 0x8a79
movl %eax, %edx
movzbl (%r14,%rdx), %edx
cmpl $0x5c, %edx
je 0x8a79
leal -0x1(%rcx), %ebp
decq %rax
cmpl $0x2f, %edx
jne 0x8a5c
decl %ecx
movl %ecx, %ebp
jmp 0x8a87
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %r13d, %r15d
cmpl $-0x1, %r15d
jne 0x8a98
movq %r14, %rdi
callq 0x4180
movq %rax, %r15
movslq %ebp, %rax
notl %ebp
addl %r15d, %ebp
leaq (%r14,%rax), %rsi
incq %rsi
movslq %ebp, %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4270
movb $0x0, (%rbx,%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/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 0x4350
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 0x4350
movq %rax, %r15
movq %r14, %rdi
movl $0x5c, %esi
callq 0x4350
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 0x8b55
movq %r14, %rdi
callq 0x4180
movslq %ebp, %rsi
subl %ebp, %eax
addq %r14, %rsi
movslq %eax, %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4270
addq %r14, %rbx
movb $0x0, (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/FreeSlave[P]vhlt/common/cmdlib.cpp
// Function: safe_snprintf(char*, unsigned long, char const*, ...)
bool CDECL FORMAT_PRINTF(3,4)      safe_snprintf(char* const dest, const size_t count, const char* const args, ...)
{
    size_t          amt;
    va_list         argptr;

    hlassert(count > 0);

    va_start(argptr, args);
    amt = vsnprintf(dest, count, args, argptr);
    va_end(argptr);

    // truncated (bad!, snprintf doesn't null terminate the string when this happens)
    if (amt == count)
    {
        dest[count - 1] = 0;
        return false;
    }

    return true;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rsp), %rsi
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x8bdb
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rcx
movq %rsi, 0x10(%rcx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%rcx)
movq %rbx, %rsi
callq 0x41e0
cltq
cmpq %rbx, %rax
jne 0x8c10
movb $0x0, -0x1(%r14,%rbx)
cmpq %rbx, %rax
setne %al
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x8c57
movq %rdi, %r14
movq %rbx, %rdx
callq 0x4210
movb $0x0, -0x1(%r14,%rbx)
jmp 0x8c65
leaq 0x13c9a(%rip), %rdi     # 0x1c8f8
xorl %eax, %eax
callq 0xa612
testq %rbx, %rbx
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
setg %al
jle 0x8c9c
cmpb $0x0, (%rdi)
je 0x8c9c
movl %esi, %eax
movl $0x1, %edx
movq %rdx, %rcx
cmpl %ecx, %eax
je 0x8c97
leaq 0x1(%rcx), %rdx
cmpb $0x0, (%rdi,%rcx)
jne 0x8c86
cmpl %esi, %ecx
setl %al
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/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 0x8cce
cmpl $0xa, %eax
je 0x8ccb
incq %rdi
jmp 0x8cba
movb $0x1, %al
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %esi, %esi
movzbl (%r14,%rsi), %eax
testl %eax, %eax
je 0x8cfa
cmpl $0xa, %eax
je 0x8cff
incq %rsi
jmp 0x8ce7
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movzbl (%rbx,%rax), %ecx
testl %ecx, %ecx
je 0x8d13
cmpl $0xa, %ecx
je 0x8d18
incq %rax
jmp 0x8d01
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, %ecx
orl %esi, %ecx
js 0x8dfb
testl %eax, %eax
jle 0x8d31
cmpb $0x2a, (%rbx)
sete %cl
movl %ecx, (%rsp)
jmp 0x8d38
movl $0x0, (%rsp)
testl %eax, %eax
jle 0x8d49
movl %eax, %ecx
cmpb $0x2a, -0x1(%rbx,%rcx)
sete %dil
jmp 0x8d4b
xorl %edi, %edi
testl %esi, %esi
js 0x8dfb
movzbl (%rsp), %ecx
movzbl %dil, %edx
subl %edx, %eax
cmpl %ecx, %eax
cmovlel %ecx, %eax
subl %ecx, %eax
movl %esi, %r15d
incl %esi
movslq %eax, %rdx
addq %rcx, %rbx
xorl %ecx, %ecx
movq %rsi, 0x10(%rsp)
movl %edi, 0x4(%rsp)
movq %r15, 0x8(%rsp)
movq %rdx, 0x18(%rsp)
movq %rcx, 0x20(%rsp)
movq %r15, %r12
subq %rcx, %r12
cmpq %rdx, %r12
jne 0x8dd1
xorl %r13d, %r13d
testq %r12, %r12
jle 0x8dcc
movsbl (%r14,%r13), %edi
callq 0x4490
movl %eax, %ebp
movsbl (%rbx,%r13), %edi
callq 0x4490
cmpl %eax, %ebp
jne 0x8dbe
incq %r13
cmpq %r12, %r13
jl 0x8d9c
movl 0x4(%rsp), %edi
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rcx
cmpl %r12d, %r13d
je 0x8dff
cmpq %rcx, %r15
leaq -0x1(%r15), %r15
setg %al
testb %dil, %al
jne 0x8d89
incq %rcx
movq 0x10(%rsp), %rsi
cmpq %rsi, %rcx
setne %al
incq %r14
testb %al, (%rsp)
movq 0x8(%rsp), %r15
jne 0x8d84
xorl %eax, %eax
jmp 0x8e01
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq