// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0xddb6(%rip), %rdi      # 0x224e0
xorl %eax, %eax
callq 0x9c96
leaq 0xdfb8(%rip), %rsi      # 0x226f0
movq %rbx, %rdi
callq 0x75ff
cmpl $0x1, %eax
je 0x1474d
testl %eax, %eax
jne 0x14758
xorl %eax, %eax
jmp 0x1474f
movb $0x1, %al
leaq 0x20adcbe(%rip), %rcx   # 0x20c2414
movb %al, (%rcx)
leaq 0xddc1(%rip), %r15      # 0x22520
leaq 0xddc9(%rip), %rsi      # 0x2252f
leaq 0xc5eb(%rip), %rdx      # 0x20d58
movq %r15, %rdi
xorl %eax, %eax
callq 0x9c96
leaq 0x20adc96(%rip), %rax   # 0x20c2414
leaq 0xde93(%rip), %r14      # 0x22618
cmpb $0x0, (%rax)
leaq 0xddc8(%rip), %r12      # 0x22557
movq %r12, %rdx
cmovneq %r14, %rdx
leaq 0xdda1(%rip), %rsi      # 0x2253e
movq %r15, %rdi
xorl %eax, %eax
callq 0x9c96
leaq 0xccb9(%rip), %rsi      # 0x21467
movq %rbx, %rdi
callq 0x75ff
testl %eax, %eax
setne 0x17c41(%rip)           # 0x2c400
movq %r12, %rdx
cmovneq %r14, %rdx
leaq 0xdd8e(%rip), %rsi      # 0x2255b
movq %r15, %rdi
xorl %eax, %eax
callq 0x9c96
leaq 0xdd94(%rip), %rsi      # 0x22572
movq %rbx, %rdi
callq 0x74c9
leaq 0xd335(%rip), %rsi      # 0x21b22
movq %rax, %rdi
callq 0x4420
testl %eax, %eax
je 0x14829
leaq 0xdd72(%rip), %rsi      # 0x22572
movq %rbx, %rdi
callq 0x74c9
leaq 0xdd7c(%rip), %rsi      # 0x2258b
movq %rax, %rdi
callq 0x4420
testl %eax, %eax
jne 0x14853
leaq 0xdef0(%rip), %rdx      # 0x22712
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x14835
leaq 0xdee7(%rip), %rdx      # 0x22717
movl $0x1, %eax
leaq 0x20bad34(%rip), %rcx   # 0x20cf570
movl %eax, (%rcx)
leaq 0xdcdb(%rip), %rdi      # 0x22520
leaq 0xdd2f(%rip), %rsi      # 0x2257b
xorl %eax, %eax
callq 0x9c96
leaq 0xdd34(%rip), %rsi      # 0x2258e
movq %rbx, %rdi
callq 0x75ff
cmpl $0x2, %eax
je 0x148a0
cmpl $0x1, %eax
je 0x14897
testl %eax, %eax
jne 0x148a7
leaq 0x16a99(%rip), %rax     # 0x2b310
movq (%rax), %rcx
leaq 0xdd13(%rip), %rsi      # 0x22594
movl $0x36, %edi
movq %rcx, %rdx
xorl %eax, %eax
callq 0xa073
callq 0x9f6f
jmp 0x148a7
movb $0x0, 0x20c017a(%rip)   # 0x20d4a18
jmp 0x148a7
movb $0x1, 0x20c0171(%rip)   # 0x20d4a18
cmpb $0x0, 0x20c016a(%rip)   # 0x20d4a18
movq %r12, %rdx
cmovneq %r14, %rdx
leaq 0xdc64(%rip), %rdi      # 0x22520
leaq 0xdd26(%rip), %rsi      # 0x225e9
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x9c96
leaq 0xde65(%rip), %rsi      # 0x22738
movq %rbx, %rdi
callq 0x75ff
testl %eax, %eax
setne 0x20c012c(%rip)         # 0x20d4a10
leaq 0xdd0c(%rip), %rsi      # 0x225f7
movq %rbx, %rdi
callq 0x75ff
testl %eax, %eax
je 0x148ff
cmpl $0x1, %eax
jne 0x14906
movb $0x1, %bpl
movb %bpl, 0x20c0110(%rip)   # 0x20d4a16
cmpb $0x0, 0x20c0109(%rip)   # 0x20d4a16
cmovneq %r12, %r14
leaq 0xdc08(%rip), %rdi      # 0x22520
leaq 0xdce3(%rip), %rsi      # 0x22602
movq %r14, %rdx
xorl %eax, %eax
callq 0x9c96
leaq 0xb358(%rip), %rdi      # 0x1fc88
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xa3d7