// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlbsp/qbsp.cpp
// Function: GetParamsFromEnt(entity_t*)
void            GetParamsFromEnt(entity_t* mapent)
{
    int iTmp;

    Log("\nCompile Settings detected from info_compile_parameters entity\n");

    // verbose(choices) : "Verbose compile messages" : 0 = [ 0 : "Off" 1 : "On" ]
    iTmp = IntForKey(mapent, "verbose");
    if (iTmp == 1)
    {
        g_verbose = true;
    }
    else if (iTmp == 0)
    {
        g_verbose = false;
    }
    Log("%30s [ %-9s ]\n", "Compile Option", "setting");
    Log("%30s [ %-9s ]\n", "Verbose Compile Messages", g_verbose ? "on" : "off");

    // estimate(choices) :"Estimate Compile Times?" : 0 = [ 0: "Yes" 1: "No" ]
    if (IntForKey(mapent, "estimate"))
    {
        g_estimate = true;
    }
    else
    {
        g_estimate = false;
    }
    Log("%30s [ %-9s ]\n", "Estimate Compile Times", g_estimate ? "on" : "off");

	// priority(choices) : "Priority Level" : 0 = [	0 : "Normal" 1 : "High"	-1 : "Low" ]
	if (!strcmp(ValueForKey(mapent, "priority"), "1"))
    {
        g_threadpriority = eThreadPriorityHigh;
        Log("%30s [ %-9s ]\n", "Thread Priority", "high");
    }
    else if (!strcmp(ValueForKey(mapent, "priority"), "-1"))
    {
        g_threadpriority = eThreadPriorityLow;
        Log("%30s [ %-9s ]\n", "Thread Priority", "low");
    }

    /*
    hlbsp(choices) : "HLBSP" : 0 =
    [
       0 : "Off"
       1 : "Normal"
       2 : "Leakonly"
    ]
    */
    iTmp = IntForKey(mapent, "hlbsp");
    if (iTmp == 0)
    {
        Fatal(assume_TOOL_CANCEL,
            "%s flag was not checked in info_compile_parameters entity, execution of %s cancelled", g_Program, g_Program);
        CheckFatal();
    }
    else if (iTmp == 1)
    {
        g_bLeakOnly = false;
    }
    else if (iTmp == 2)
    {
        g_bLeakOnly = true;
    }
    Log("%30s [ %-9s ]\n", "Leakonly Mode", g_bLeakOnly ? "on" : "off");

	iTmp = IntForKey(mapent, "noopt");
	if(iTmp == 0)
	{
		g_noopt = false;
	}
	else
	{
		g_noopt = true;
	}

    /*
    nocliphull(choices) : "Generate clipping hulls" : 0 =
    [
        0 : "Yes"
        1 : "No"
    ]
    */
    iTmp = IntForKey(mapent, "nocliphull");
    if (iTmp == 0)
    {
        g_noclip = false;
    }
    else if (iTmp == 1)
    {
        g_noclip = true;
    }
    Log("%30s [ %-9s ]\n", "Clipping Hull Generation", g_noclip ? "off" : "on");

    //////////////////
    Verbose("\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xcfe2(%rip), %rdi      # 0x214c0
xorl %eax, %eax
callq 0x9bae
leaq 0xd1e1(%rip), %rsi      # 0x216cd
movq %rbx, %rdi
callq 0x75b8
cmpl $0x1, %eax
je 0x14501
testl %eax, %eax
jne 0x1450c
xorl %eax, %eax
jmp 0x14503
movb $0x1, %al
leaq 0x20acefa(%rip), %rcx   # 0x20c1404
movb %al, (%rcx)
leaq 0xcfed(%rip), %r15      # 0x21500
leaq 0xcff5(%rip), %rsi      # 0x2150f
leaq 0xb827(%rip), %rdx      # 0x1fd48
movq %r15, %rdi
xorl %eax, %eax
callq 0x9bae
leaq 0x20aced2(%rip), %rax   # 0x20c1404
leaq 0xd0bc(%rip), %r14      # 0x215f5
cmpb $0x0, (%rax)
leaq 0xcff4(%rip), %r12      # 0x21537
movq %r12, %rdx
cmovneq %r14, %rdx
leaq 0xcfcd(%rip), %rsi      # 0x2151e
movq %r15, %rdi
xorl %eax, %eax
callq 0x9bae
leaq 0xbee5(%rip), %rsi      # 0x20447
movq %rbx, %rdi
callq 0x75b8
testl %eax, %eax
setne 0x16e7d(%rip)           # 0x2b3f0
movq %r12, %rdx
cmovneq %r14, %rdx
leaq 0xcfba(%rip), %rsi      # 0x2153b
movq %r15, %rdi
xorl %eax, %eax
callq 0x9bae
leaq 0xcfc0(%rip), %rsi      # 0x21552
movq %rbx, %rdi
callq 0x7482
cmpb $0x31, (%rax)
jne 0x145a5
cmpb $0x0, 0x1(%rax)
je 0x145d3
leaq 0xcfa6(%rip), %rsi      # 0x21552
movq %rbx, %rdi
callq 0x7482
cmpb $0x2d, (%rax)
jne 0x145fd
cmpb $0x31, 0x1(%rax)
jne 0x145fd
cmpb $0x0, 0x2(%rax)
jne 0x145fd
leaq 0xd123(%rip), %rdx      # 0x216ef
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x145df
leaq 0xd11a(%rip), %rdx      # 0x216f4
movl $0x1, %eax
leaq 0x20b9f7a(%rip), %rcx   # 0x20ce560
movl %eax, (%rcx)
leaq 0xcf11(%rip), %rdi      # 0x21500
leaq 0xcf65(%rip), %rsi      # 0x2155b
xorl %eax, %eax
callq 0x9bae
leaq 0xcf67(%rip), %rsi      # 0x2156b
movq %rbx, %rdi
callq 0x75b8
cmpl $0x2, %eax
je 0x1464a
cmpl $0x1, %eax
je 0x14641
testl %eax, %eax
jne 0x14651
leaq 0x15cdf(%rip), %rax     # 0x2a300
movq (%rax), %rcx
leaq 0xcf46(%rip), %rsi      # 0x21571
movl $0x36, %edi
movq %rcx, %rdx
xorl %eax, %eax
callq 0x9f8b
callq 0x9e87
jmp 0x14651
movb $0x0, 0x20bf3c0(%rip)   # 0x20d3a08
jmp 0x14651
movb $0x1, 0x20bf3b7(%rip)   # 0x20d3a08
cmpb $0x0, 0x20bf3b0(%rip)   # 0x20d3a08
movq %r12, %rdx
cmovneq %r14, %rdx
leaq 0xce9a(%rip), %rdi      # 0x21500
leaq 0xcf59(%rip), %rsi      # 0x215c6
xorl %eax, %eax
callq 0x9bae
leaq 0xd09a(%rip), %rsi      # 0x21715
movq %rbx, %rdi
callq 0x75b8
testl %eax, %eax
setne 0x20bf374(%rip)         # 0x20d3a00
leaq 0xcf41(%rip), %rsi      # 0x215d4
movq %rbx, %rdi
callq 0x75b8
testl %eax, %eax
je 0x146b0
cmpl $0x1, %eax
jne 0x146b9
movb $0x1, 0x20bf35b(%rip)   # 0x20d3a06
movq %r12, %r14
jmp 0x146c4
movb $0x0, 0x20bf34f(%rip)   # 0x20d3a06
jmp 0x146c4
testb $0x1, 0x20bf346(%rip)   # 0x20d3a06
cmovneq %r12, %r14
leaq 0xce35(%rip), %rdi      # 0x21500
leaq 0xcf0d(%rip), %rsi      # 0x215df
movq %r14, %rdx
xorl %eax, %eax
callq 0x9bae
leaq 0xa595(%rip), %rdi      # 0x1ec78
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xa2ef