// File: /workspace/github_cpp_makefile_star2_O2/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 0xcd3a(%rip), %rdi      # 0x1f420
xorl %eax, %eax
callq 0x8780
leaq 0xcf39(%rip), %rsi      # 0x1f62d
movq %rbx, %rdi
callq 0x6a4f
cmpl $0x1, %eax
je 0x12709
testl %eax, %eax
jne 0x12714
xorl %eax, %eax
jmp 0x1270b
movb $0x1, %al
leaq 0x20add02(%rip), %rcx   # 0x20c0414
movb %al, (%rcx)
leaq 0xcd45(%rip), %r15      # 0x1f460
leaq 0xcd4d(%rip), %rsi      # 0x1f46f
leaq 0xb57f(%rip), %rdx      # 0x1dca8
movq %r15, %rdi
xorl %eax, %eax
callq 0x8780
leaq 0x20adcda(%rip), %rax   # 0x20c0414
leaq 0xce14(%rip), %r14      # 0x1f555
cmpb $0x0, (%rax)
leaq 0xcd4c(%rip), %r12      # 0x1f497
movq %r12, %rdx
cmovneq %r14, %rdx
leaq 0xcd25(%rip), %rsi      # 0x1f47e
movq %r15, %rdi
xorl %eax, %eax
callq 0x8780
leaq 0xbc2d(%rip), %rsi      # 0x1e397
movq %rbx, %rdi
callq 0x6a4f
testl %eax, %eax
setne 0x17c85(%rip)           # 0x2a400
movq %r12, %rdx
cmovneq %r14, %rdx
leaq 0xcd12(%rip), %rsi      # 0x1f49b
movq %r15, %rdi
xorl %eax, %eax
callq 0x8780
leaq 0xcd18(%rip), %rsi      # 0x1f4b2
movq %rbx, %rdi
callq 0x691b
cmpb $0x31, (%rax)
jne 0x127ad
cmpb $0x0, 0x1(%rax)
je 0x127d8
leaq 0xccfe(%rip), %rsi      # 0x1f4b2
movq %rbx, %rdi
callq 0x691b
cmpb $0x2d, (%rax)
jne 0x12800
cmpb $0x31, 0x1(%rax)
jne 0x12800
cmpb $0x0, 0x2(%rax)
jne 0x12800
leaq 0xce7b(%rip), %rdx      # 0x1f64f
pushq $-0x1
jmp 0x127e1
leaq 0xce75(%rip), %rdx      # 0x1f654
pushq $0x1
popq %rax
leaq 0x20bad87(%rip), %rcx   # 0x20cd570
movl %eax, (%rcx)
leaq 0xcc6e(%rip), %rdi      # 0x1f460
leaq 0xccc2(%rip), %rsi      # 0x1f4bb
xorl %eax, %eax
callq 0x8780
leaq 0xccc4(%rip), %rsi      # 0x1f4cb
movq %rbx, %rdi
callq 0x6a4f
cmpl $0x2, %eax
je 0x1284b
cmpl $0x1, %eax
je 0x12842
testl %eax, %eax
jne 0x12852
leaq 0x16aec(%rip), %rax     # 0x29310
movq (%rax), %rcx
leaq 0xcca3(%rip), %rsi      # 0x1f4d1
pushq $0x36
popq %rdi
movq %rcx, %rdx
xorl %eax, %eax
callq 0x8c14
callq 0x8b0c
jmp 0x12852
movb $0x0, 0x20c01cf(%rip)   # 0x20d2a18
jmp 0x12852
movb $0x1, 0x20c01c6(%rip)   # 0x20d2a18
cmpb $0x0, 0x20c01bf(%rip)   # 0x20d2a18
movq %r12, %rdx
cmovneq %r14, %rdx
leaq 0xcbf9(%rip), %rdi      # 0x1f460
leaq 0xccb8(%rip), %rsi      # 0x1f526
xorl %eax, %eax
callq 0x8780
leaq 0xcdf9(%rip), %rsi      # 0x1f675
movq %rbx, %rdi
callq 0x6a4f
testl %eax, %eax
setne 0x20c0183(%rip)         # 0x20d2a10
leaq 0xcca0(%rip), %rsi      # 0x1f534
movq %rbx, %rdi
callq 0x6a4f
testl %eax, %eax
je 0x128b1
cmpl $0x1, %eax
jne 0x128ba
movb $0x1, 0x20c016a(%rip)   # 0x20d2a16
movq %r12, %r14
jmp 0x128c5
movb $0x0, 0x20c015e(%rip)   # 0x20d2a16
jmp 0x128c5
testb $0x1, 0x20c0155(%rip)   # 0x20d2a16
cmovneq %r12, %r14
leaq 0xcb94(%rip), %rdi      # 0x1f460
leaq 0xcc6c(%rip), %rsi      # 0x1f53f
movq %r14, %rdx
xorl %eax, %eax
callq 0x8780
leaq 0xa2f4(%rip), %rdi      # 0x1cbd8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x8f76