// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
leaq 0x16ba0(%rip), %rdi     # 0x3a640
movb $0x0, %al
callq 0xb060
movq 0x10(%rsp), %rdi
leaq 0x16d9d(%rip), %rsi     # 0x3a850
callq 0x7ef0
movl %eax, 0xc(%rsp)
cmpl $0x1, 0xc(%rsp)
jne 0x23acf
leaq 0x20b994a(%rip), %rax   # 0x20dd414
movb $0x1, (%rax)
jmp 0x23ae2
cmpl $0x0, 0xc(%rsp)
jne 0x23ae0
leaq 0x20b9937(%rip), %rax   # 0x20dd414
movb $0x0, (%rax)
jmp 0x23ae2
leaq 0x16b97(%rip), %rdi     # 0x3a680
leaq 0x16b9f(%rip), %rsi     # 0x3a68f
leaq 0x152d1(%rip), %rdx     # 0x38dc8
movb $0x0, %al
callq 0xb060
leaq 0x20b990f(%rip), %rax   # 0x20dd414
movb (%rax), %cl
leaq 0x16ba9(%rip), %rdx     # 0x3a6b7
leaq 0x16c63(%rip), %rax     # 0x3a778
testb $0x1, %cl
cmovneq %rax, %rdx
leaq 0x16b5d(%rip), %rdi     # 0x3a680
leaq 0x16b74(%rip), %rsi     # 0x3a69e
movb $0x0, %al
callq 0xb060
movq 0x10(%rsp), %rdi
leaq 0x15aaa(%rip), %rsi     # 0x395e7
callq 0x7ef0
cmpl $0x0, %eax
je 0x23b50
movb $0x1, 0x238a2(%rip)     # 0x473f0
jmp 0x23b57
movb $0x0, 0x23899(%rip)     # 0x473f0
movb 0x23893(%rip), %cl      # 0x473f0
leaq 0x16b53(%rip), %rdx     # 0x3a6b7
leaq 0x16c0d(%rip), %rax     # 0x3a778
testb $0x1, %cl
cmovneq %rax, %rdx
leaq 0x16b07(%rip), %rdi     # 0x3a680
leaq 0x16b3b(%rip), %rsi     # 0x3a6bb
movb $0x0, %al
callq 0xb060
movq 0x10(%rsp), %rdi
leaq 0x16b3f(%rip), %rsi     # 0x3a6d2
callq 0x7cd0
movq %rax, %rdi
leaq 0x1611c(%rip), %rsi     # 0x39cbe
callq 0x4400
cmpl $0x0, %eax
jne 0x23bd7
leaq 0x20c69bd(%rip), %rax   # 0x20ea570
movl $0x1, (%rax)
leaq 0x16ac0(%rip), %rdi     # 0x3a680
leaq 0x16b14(%rip), %rsi     # 0x3a6db
leaq 0x16ca9(%rip), %rdx     # 0x3a877
movb $0x0, %al
callq 0xb060
jmp 0x23c27
movq 0x10(%rsp), %rdi
leaq 0x16aef(%rip), %rsi     # 0x3a6d2
callq 0x7cd0
movq %rax, %rdi
leaq 0x16af9(%rip), %rsi     # 0x3a6eb
callq 0x4400
cmpl $0x0, %eax
jne 0x23c25
leaq 0x20c696d(%rip), %rax   # 0x20ea570
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
leaq 0x16a70(%rip), %rdi     # 0x3a680
leaq 0x16ac4(%rip), %rsi     # 0x3a6db
leaq 0x16c54(%rip), %rdx     # 0x3a872
movb $0x0, %al
callq 0xb060
jmp 0x23c27
movq 0x10(%rsp), %rdi
leaq 0x16abb(%rip), %rsi     # 0x3a6ee
callq 0x7ef0
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
jne 0x23c71
leaq 0x226b6(%rip), %rax     # 0x46300
movq (%rax), %rdx
leaq 0x226ac(%rip), %rax     # 0x46300
movq (%rax), %rcx
movl $0x36, %edi
leaq 0x16a91(%rip), %rsi     # 0x3a6f4
movb $0x0, %al
callq 0xb640
callq 0xb4f0
jmp 0x23c93
cmpl $0x1, 0xc(%rsp)
jne 0x23c81
movb $0x0, 0x20cbda9(%rip)   # 0x20efa28
jmp 0x23c91
cmpl $0x2, 0xc(%rsp)
jne 0x23c8f
movb $0x1, 0x20cbd99(%rip)   # 0x20efa28
jmp 0x23c91
jmp 0x23c93
movb 0x20cbd8f(%rip), %cl    # 0x20efa28
leaq 0x16a17(%rip), %rdx     # 0x3a6b7
leaq 0x16ad1(%rip), %rax     # 0x3a778
testb $0x1, %cl
cmovneq %rax, %rdx
leaq 0x169cb(%rip), %rdi     # 0x3a680
leaq 0x16a8d(%rip), %rsi     # 0x3a749
movb $0x0, %al
callq 0xb060
movq 0x10(%rsp), %rdi
leaq 0x16bc9(%rip), %rsi     # 0x3a898
callq 0x7ef0
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
jne 0x23ce8
movb $0x0, 0x20cbd3a(%rip)   # 0x20efa20
jmp 0x23cef
movb $0x1, 0x20cbd31(%rip)   # 0x20efa20
movq 0x10(%rsp), %rdi
leaq 0x16a5c(%rip), %rsi     # 0x3a757
callq 0x7ef0
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
jne 0x23d14
movb $0x0, 0x20cbd14(%rip)   # 0x20efa26
jmp 0x23d24
cmpl $0x1, 0xc(%rsp)
jne 0x23d22
movb $0x1, 0x20cbd04(%rip)   # 0x20efa26
jmp 0x23d24
movb 0x20cbcfc(%rip), %cl    # 0x20efa26
leaq 0x16a47(%rip), %rdx     # 0x3a778
leaq 0x1697f(%rip), %rax     # 0x3a6b7
testb $0x1, %cl
cmovneq %rax, %rdx
leaq 0x1693a(%rip), %rdi     # 0x3a680
leaq 0x16a15(%rip), %rsi     # 0x3a762
movb $0x0, %al
callq 0xb060
leaq 0x13f9d(%rip), %rdi     # 0x37cf8
movb $0x0, %al
callq 0xba90
addq $0x18, %rsp
retq
nopw (%rax,%rax)