// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/hlvis/vis.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");
    }

    /*
    hlvis(choices) : "HLVIS" : 2 = 
    [ 
        0 : "Off"
        1 : "Fast"
        2 : "Normal" 
        3 : "Full"
    ]
    */
    iTmp = IntForKey(mapent, "hlvis");
    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_fastvis = true;
        g_fullvis = false;
    }
    else if (iTmp == 2)
    {
        g_fastvis = false;
        g_fullvis = false;
    }
    else if (iTmp == 3)
    {
        g_fullvis = true;
        g_fastvis = false;
    }
    Log("%30s [ %-9s ]\n", "Fast VIS", g_fastvis ? "on" : "off"); 
    Log("%30s [ %-9s ]\n", "Full VIS", g_fullvis ? "on" : "off" );

    ///////////////////
    Log("\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x66ba(%rip), %rdi      # 0x155f0
xorl %eax, %eax
callq 0x89c6
leaq 0x6866(%rip), %rsi      # 0x157aa
movq %r14, %rdi
callq 0x63e3
cmpl $0x1, %eax
je 0xef59
testl %eax, %eax
jne 0xef64
xorl %eax, %eax
jmp 0xef5b
movb $0x1, %al
leaq 0x2083332(%rip), %rcx   # 0x2092294
movb %al, (%rcx)
leaq 0x66c5(%rip), %r15      # 0x15630
leaq 0x66cd(%rip), %rsi      # 0x1563f
leaq 0x5de3(%rip), %rdx      # 0x14d5c
movq %r15, %rdi
xorl %eax, %eax
callq 0x89c6
leaq 0x208330a(%rip), %rax   # 0x2092294
leaq 0x66ba(%rip), %r12      # 0x1564b
cmpb $0x0, (%rax)
leaq 0x66cc(%rip), %rbx      # 0x15667
movq %rbx, %rdx
cmovneq %r12, %rdx
leaq 0x66a5(%rip), %rsi      # 0x1564e
movq %r15, %rdi
xorl %eax, %eax
callq 0x89c6
leaq 0x64a1(%rip), %rsi      # 0x1545b
movq %r14, %rdi
callq 0x63e3
testl %eax, %eax
setne 0xd2c5(%rip)            # 0x1c290
movq %rbx, %rdx
cmovneq %r12, %rdx
leaq 0x6692(%rip), %rsi      # 0x1566b
movq %r15, %rdi
xorl %eax, %eax
callq 0x89c6
leaq 0x6698(%rip), %rsi      # 0x15682
movq %r14, %rdi
callq 0x62ad
cmpb $0x31, (%rax)
jne 0xeffd
cmpb $0x0, 0x1(%rax)
je 0xf02b
leaq 0x667e(%rip), %rsi      # 0x15682
movq %r14, %rdi
callq 0x62ad
cmpb $0x2d, (%rax)
jne 0xf055
cmpb $0x31, 0x1(%rax)
jne 0xf055
cmpb $0x0, 0x2(%rax)
jne 0xf055
leaq 0x679e(%rip), %rdx      # 0x157c2
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xf037
leaq 0x6795(%rip), %rdx      # 0x157c7
movl $0x1, %eax
leaq 0x20903b2(%rip), %rcx   # 0x209f3f0
movl %eax, (%rcx)
leaq 0x65e9(%rip), %rdi      # 0x15630
leaq 0x663d(%rip), %rsi      # 0x1568b
xorl %eax, %eax
callq 0x89c6
leaq 0x663f(%rip), %rsi      # 0x1569b
movq %r14, %rdi
callq 0x63e3
cmpl $0x3, %eax
ja 0xf0d0
movl %eax, %eax
leaq 0x6526(%rip), %rcx      # 0x15598
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xc1ee(%rip), %rax      # 0x1b270
movq (%rax), %rcx
leaq 0x6615(%rip), %rsi      # 0x156a1
movl $0x36, %edi
movq %rcx, %rdx
xorl %eax, %eax
callq 0x8da3
callq 0x8c9f
jmp 0xf0d0
xorl %eax, %eax
movb %al, 0x20906f6(%rip)    # 0x209f7a0
movb %al, 0x20906f1(%rip)    # 0x209f7a1
jmp 0xf0d0
movb $0x1, 0x20906e8(%rip)   # 0x209f7a1
movb $0x0, 0x20906e0(%rip)   # 0x209f7a0
jmp 0xf0d0
movb $0x1, 0x20906d7(%rip)   # 0x209f7a0
movb $0x0, 0x20906d1(%rip)   # 0x209f7a1
cmpb $0x0, 0x20906c9(%rip)   # 0x209f7a0
movq %rbx, %rdx
cmovneq %r12, %rdx
leaq 0x654b(%rip), %r14      # 0x15630
leaq 0x660a(%rip), %rsi      # 0x156f6
movq %r14, %rdi
xorl %eax, %eax
callq 0x89c6
cmpb $0x0, 0x20906a4(%rip)   # 0x209f7a1
cmovneq %r12, %rbx
leaq 0x65f7(%rip), %rsi      # 0x156ff
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x89c6
leaq 0x4b7c(%rip), %rdi      # 0x13c98
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x89c6