// File: FreeSlave[P]vhlt/hlrad/qrad.cpp
// Function: GetParamsFromEnt(entity_t*)
void            GetParamsFromEnt(entity_t* mapent)
{
    int     iTmp;
    float   flTmp;
    char    szTmp[256]; //lightdata
    const char* pszTmp;

    Log("\nCompile Settings detected from info_compile_parameters entity\n");

    // lightdata(string) : "Lighting Data Memory" : "8192"
    iTmp = IntForKey(mapent, "lightdata") * 1024; //lightdata
    if (iTmp > g_max_map_lightdata) //--vluzacn
    {
        g_max_map_lightdata = iTmp;
        sprintf_s(szTmp, "%i", g_max_map_lightdata);
        Log("%30s [ %-9s ]\n", "Lighting Data Memory", szTmp);
    }

    // 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");
    }

    // bounce(integer) : "Number of radiosity bounces" : 0 
    iTmp = IntForKey(mapent, "bounce");
    if (iTmp)
    {
        g_numbounce = abs(iTmp);
        Log("%30s [ %-9s ]\n", "Number of radiosity bounces", ValueForKey(mapent, "bounce"));
    }
    
#ifdef HLRAD_HULLU
    iTmp = IntForKey(mapent, "customshadowwithbounce");
    if (iTmp)
    {  
    	g_customshadow_with_bouncelight = true;
    	Log("%30s [ %-9s ]\n", "Custom Shadow with Bounce Light", ValueForKey(mapent, "customshadowwithbounce"));
    }
    iTmp = IntForKey(mapent, "rgbtransfers");
    if (iTmp)
    {  
    	g_rgb_transfers = true;
    	Log("%30s [ %-9s ]\n", "RGB Transfers", ValueForKey(mapent, "rgbtransfers"));
    }
#endif

    // ambient(string) : "Ambient world light (0.0 to 1.0, R G B)" : "0 0 0" 
    //vec3_t          g_ambient = { DEFAULT_AMBIENT_RED, DEFAULT_AMBIENT_GREEN, DEFAULT_AMBIENT_BLUE };
    pszTmp = ValueForKey(mapent, "ambient");
    if (pszTmp)
    {
        float red = 0, green = 0, blue = 0;
        if (sscanf(pszTmp, "%f %f %f", &red, &green, &blue))
        {
            if (red < 0 || red > 1 || green < 0 || green > 1 || blue < 0 || blue > 1)
            {
                Error("info_compile_parameters: Ambient World Light (ambient) all 3 values must be within the range of 0.0 to 1.0\n"
                      "Parsed values:\n"
                      "    red [ %1.3f ] %s\n"
                      "  green [ %1.3f ] %s\n"
                      "   blue [ %1.3f ] %s\n"
                      , red,    (red   < 0 || red   > 1) ? "OUT OF RANGE" : ""
                      , green,  (green < 0 || green > 1) ? "OUT OF RANGE" : ""
                      , blue,   (blue  < 0 || blue  > 1) ? "OUT OF RANGE" : "" );
            }

            if (red == 0 && green == 0 && blue == 0)
            {} // dont bother setting null values
            else
            {
                g_ambient[0] = red * 128;
                g_ambient[1] = green * 128;
                g_ambient[2] = blue * 128;
                Log("%30s [ %1.3f %1.3f %1.3f ]\n", "Ambient world light (R G B)", red, green, blue);
            }
        }
        else
        {
            Error("info_compile_parameters: Ambient World Light (ambient) has unrecognised value\n"
                  "This keyvalue accepts 3 numeric values from 0.000 to 1.000, use \"0 0 0\" if in doubt");
        }
    }

    // smooth(integer) : "Smoothing threshold (in degrees)" : 0 
    flTmp = FloatForKey(mapent, "smooth");
    if (flTmp)
    {
        /*g_smoothing_threshold = flTmp;*/
		g_smoothing_threshold = cos(g_smoothing_value * (Q_PI / 180.0)); // --vluzacn
        Log("%30s [ %-9s ]\n", "Smoothing threshold", ValueForKey(mapent, "smooth"));
    }

    // dscale(integer) : "Direct Lighting Scale" : 1 
    flTmp = FloatForKey(mapent, "dscale");
    if (flTmp)
    {
        g_direct_scale = flTmp;
        Log("%30s [ %-9s ]\n", "Direct Lighting Scale", ValueForKey(mapent, "dscale"));
    }

    // chop(integer) : "Chop Size" : 64 
    iTmp = IntForKey(mapent, "chop");
    if (iTmp)
    {
        g_chop = iTmp;
        Log("%30s [ %-9s ]\n", "Chop Size", ValueForKey(mapent, "chop"));
    }

    // texchop(integer) : "Texture Light Chop Size" : 32 
    flTmp = FloatForKey(mapent, "texchop");
    if (flTmp)
    {
        g_texchop = flTmp;
        Log("%30s [ %-9s ]\n", "Texture Light Chop Size", ValueForKey(mapent, "texchop"));
    }

    /* 
    hlrad(choices) : "HLRAD" : 0 =
    [
        0 : "Off"
        1 : "Normal"
        2 : "Extra"
    ]
    */
    iTmp = IntForKey(mapent, "hlrad");
    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_extra = false;
    }
    else if (iTmp == 2)
    {
        g_extra = true;
    }
    Log("%30s [ %-9s ]\n", "Extra RAD", g_extra ? "on" : "off");
 
    /*
    sparse(choices) : "Vismatrix Method" : 2 =
    [
        0 : "No Vismatrix"
        1 : "Sparse Vismatrix"
        2 : "Normal"
    ]
    */
    iTmp = IntForKey(mapent, "sparse");
    if (iTmp == 1)
    {
        g_method = eMethodSparseVismatrix;
    }
    else if (iTmp == 0)
    {
        g_method = eMethodNoVismatrix;
    }
    else if (iTmp == 2)
    {
        g_method = eMethodVismatrix;
    }
    Log("%30s [ %-9s ]\n", "Sparse Vismatrix",  g_method == eMethodSparseVismatrix ? "on" : "off");
    Log("%30s [ %-9s ]\n", "NoVismatrix",  g_method == eMethodNoVismatrix ? "on" : "off");

    /*
    circus(choices) : "Circus RAD lighting" : 0 =
    [
        0 : "Off"
        1 : "On"
    ]
    */
    iTmp = IntForKey(mapent, "circus");
    if (iTmp == 0)
    {
        g_circus = false;
    }
    else if (iTmp == 1)
    {
        g_circus = true;
    }

    Log("%30s [ %-9s ]\n", "Circus Lighting Mode", g_circus ? "on" : "off");

    ////////////////////
    Log("\n");
}

// Assembly:
subq $0x168, %rsp            # imm = 0x168
movq %rdi, 0x160(%rsp)
leaq 0x211de(%rip), %rdi     # 0x6ede4
movb $0x0, %al
callq 0xb0d0
movq 0x160(%rsp), %rdi
leaq 0x21a6c(%rip), %rsi     # 0x6f688
callq 0x7f70
shll $0xa, %eax
movl %eax, 0x15c(%rsp)
movl 0x15c(%rsp), %eax
leaq 0x2f70b(%rip), %rcx     # 0x7d344
cmpl (%rcx), %eax
jle 0x4dc83
movl 0x15c(%rsp), %ecx
leaq 0x2f6f9(%rip), %rax     # 0x7d344
movl %ecx, (%rax)
leaq 0x50(%rsp), %rdi
leaq 0x2f6eb(%rip), %rax     # 0x7d344
movl (%rax), %edx
leaq 0x1c445(%rip), %rsi     # 0x6a0a7
movb $0x0, %al
callq 0x40a0
leaq 0x50(%rsp), %rdx
leaq 0x211af(%rip), %rdi     # 0x6ee24
leaq 0x211b7(%rip), %rsi     # 0x6ee33
movb $0x0, %al
callq 0xb0d0
movq 0x160(%rsp), %rdi
leaq 0x217b2(%rip), %rsi     # 0x6f444
callq 0x7f70
movl %eax, 0x15c(%rsp)
cmpl $0x1, 0x15c(%rsp)
jne 0x4dcb4
leaq 0x20a67a5(%rip), %rax   # 0x20f4454
movb $0x1, (%rax)
jmp 0x4dcca
cmpl $0x0, 0x15c(%rsp)
jne 0x4dcc8
leaq 0x20a678f(%rip), %rax   # 0x20f4454
movb $0x0, (%rax)
jmp 0x4dcca
leaq 0x21153(%rip), %rdi     # 0x6ee24
leaq 0x21170(%rip), %rsi     # 0x6ee48
leaq 0x1f184(%rip), %rdx     # 0x6ce63
movb $0x0, %al
callq 0xb0d0
leaq 0x20a6767(%rip), %rax   # 0x20f4454
movb (%rax), %cl
leaq 0x2117a(%rip), %rdx     # 0x6ee70
leaq 0x21157(%rip), %rax     # 0x6ee54
testb $0x1, %cl
cmovneq %rax, %rdx
leaq 0x21119(%rip), %rdi     # 0x6ee24
leaq 0x21145(%rip), %rsi     # 0x6ee57
movb $0x0, %al
callq 0xb0d0
movq 0x160(%rsp), %rdi
leaq 0x1f96f(%rip), %rsi     # 0x6d697
callq 0x7f70
cmpl $0x0, %eax
je 0x4dd3b
movb $0x1, 0x306fb(%rip)     # 0x7e434
jmp 0x4dd42
movb $0x0, 0x306f2(%rip)     # 0x7e434
movb 0x306ec(%rip), %cl      # 0x7e434
leaq 0x21121(%rip), %rdx     # 0x6ee70
leaq 0x210fe(%rip), %rax     # 0x6ee54
testb $0x1, %cl
cmovneq %rax, %rdx
leaq 0x210c0(%rip), %rdi     # 0x6ee24
leaq 0x21109(%rip), %rsi     # 0x6ee74
movb $0x0, %al
callq 0xb0d0
movq 0x160(%rsp), %rdi
leaq 0x2110a(%rip), %rsi     # 0x6ee8b
callq 0x7d50
movq %rax, %rdi
leaq 0x21115(%rip), %rsi     # 0x6eea5
callq 0x4480
cmpl $0x0, %eax
jne 0x4ddc5
leaq 0x20b380f(%rip), %rax   # 0x21015b0
movl $0x1, (%rax)
leaq 0x21076(%rip), %rdi     # 0x6ee24
leaq 0x210df(%rip), %rsi     # 0x6ee94
leaq 0x21882(%rip), %rdx     # 0x6f63e
movb $0x0, %al
callq 0xb0d0
jmp 0x4de18
movq 0x160(%rsp), %rdi
leaq 0x210b7(%rip), %rsi     # 0x6ee8b
callq 0x7d50
movq %rax, %rdi
leaq 0x210c1(%rip), %rsi     # 0x6eea4
callq 0x4480
cmpl $0x0, %eax
jne 0x4de16
leaq 0x20b37bc(%rip), %rax   # 0x21015b0
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
leaq 0x21023(%rip), %rdi     # 0x6ee24
leaq 0x2108c(%rip), %rsi     # 0x6ee94
leaq 0x2182a(%rip), %rdx     # 0x6f639
movb $0x0, %al
callq 0xb0d0
jmp 0x4de18
movq 0x160(%rsp), %rdi
leaq 0x215e0(%rip), %rsi     # 0x6f407
callq 0x7f70
movl %eax, 0x15c(%rsp)
cmpl $0x0, 0x15c(%rsp)
je 0x4de7d
movl 0x15c(%rsp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movl %eax, 0x30583(%rip)     # 0x7e3d4
movq 0x160(%rsp), %rdi
leaq 0x215a7(%rip), %rsi     # 0x6f407
callq 0x7d50
movq %rax, %rdx
leaq 0x20fb5(%rip), %rdi     # 0x6ee24
leaq 0x21031(%rip), %rsi     # 0x6eea7
movb $0x0, %al
callq 0xb0d0
movq 0x160(%rsp), %rdi
leaq 0x21948(%rip), %rsi     # 0x6f7d4
callq 0x7f70
movl %eax, 0x15c(%rsp)
cmpl $0x0, 0x15c(%rsp)
je 0x4ded5
movb $0x1, 0x54e1b9f(%rip)   # 0x552fa48
movq 0x160(%rsp), %rdi
leaq 0x2191c(%rip), %rsi     # 0x6f7d4
callq 0x7d50
movq %rax, %rdx
leaq 0x20f5d(%rip), %rdi     # 0x6ee24
leaq 0x20ff5(%rip), %rsi     # 0x6eec3
movb $0x0, %al
callq 0xb0d0
movq 0x160(%rsp), %rdi
leaq 0x21908(%rip), %rsi     # 0x6f7ec
callq 0x7f70
movl %eax, 0x15c(%rsp)
cmpl $0x0, 0x15c(%rsp)
je 0x4df2d
movb $0x1, 0x54e1b48(%rip)   # 0x552fa49
movq 0x160(%rsp), %rdi
leaq 0x218dc(%rip), %rsi     # 0x6f7ec
callq 0x7d50
movq %rax, %rdx
leaq 0x20f05(%rip), %rdi     # 0x6ee24
leaq 0x20fbd(%rip), %rsi     # 0x6eee3
movb $0x0, %al
callq 0xb0d0
movq 0x160(%rsp), %rdi
leaq 0x21681(%rip), %rsi     # 0x6f5bd
callq 0x7d50
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x48(%rsp)
je 0x4e1d3
xorps %xmm0, %xmm0
movss %xmm0, 0x44(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x40(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x3c(%rsp)
movq 0x48(%rsp), %rdi
leaq 0x21b5b(%rip), %rsi     # 0x6fad4
leaq 0x44(%rsp), %rdx
leaq 0x40(%rsp), %rcx
leaq 0x3c(%rsp), %r8
movb $0x0, %al
callq 0x4300
cmpl $0x0, %eax
je 0x4e1c3
xorps %xmm0, %xmm0
ucomiss 0x44(%rsp), %xmm0
ja 0x4dff3
movss 0x44(%rsp), %xmm0
movss 0x1c09c(%rip), %xmm1    # 0x6a04c
ucomiss %xmm1, %xmm0
ja 0x4dff3
xorps %xmm0, %xmm0
ucomiss 0x40(%rsp), %xmm0
ja 0x4dff3
movss 0x40(%rsp), %xmm0
movss 0x1c07f(%rip), %xmm1    # 0x6a04c
ucomiss %xmm1, %xmm0
ja 0x4dff3
xorps %xmm0, %xmm0
ucomiss 0x3c(%rsp), %xmm0
ja 0x4dff3
movss 0x3c(%rsp), %xmm0
movss 0x1c062(%rip), %xmm1    # 0x6a04c
ucomiss %xmm1, %xmm0
jbe 0x4e11a
movss 0x44(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x30(%rsp)
movb $0x1, %al
xorps %xmm0, %xmm0
ucomiss 0x44(%rsp), %xmm0
movb %al, 0x3b(%rsp)
ja 0x4e02b
movss 0x44(%rsp), %xmm0
movss 0x1c02b(%rip), %xmm1    # 0x6a04c
ucomiss %xmm1, %xmm0
seta %al
movb %al, 0x3b(%rsp)
movb 0x3b(%rsp), %dl
leaq 0x1dcc3(%rip), %rax     # 0x6bcf9
leaq 0x20f6e(%rip), %rcx     # 0x6efab
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, 0x18(%rsp)
movss 0x40(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x20(%rsp)
movb $0x1, %al
xorps %xmm0, %xmm0
ucomiss 0x40(%rsp), %xmm0
movb %al, 0x2f(%rsp)
ja 0x4e081
movss 0x40(%rsp), %xmm0
movss 0x1bfd5(%rip), %xmm1    # 0x6a04c
ucomiss %xmm1, %xmm0
seta %al
movb %al, 0x2f(%rsp)
movb 0x2f(%rsp), %dl
leaq 0x1dc6d(%rip), %rax     # 0x6bcf9
leaq 0x20f18(%rip), %rcx     # 0x6efab
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, (%rsp)
movss 0x3c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movb $0x1, %al
xorps %xmm0, %xmm0
ucomiss 0x3c(%rsp), %xmm0
movb %al, 0x17(%rsp)
ja 0x4e0d6
movss 0x3c(%rsp), %xmm0
movss 0x1bf80(%rip), %xmm1    # 0x6a04c
ucomiss %xmm1, %xmm0
seta %al
movb %al, 0x17(%rsp)
movsd 0x8(%rsp), %xmm2
movq (%rsp), %rdx
movsd 0x20(%rsp), %xmm1
movq 0x18(%rsp), %rsi
movsd 0x30(%rsp), %xmm0
movb 0x17(%rsp), %dil
leaq 0x1dbfc(%rip), %rcx     # 0x6bcf9
leaq 0x20ea7(%rip), %rax     # 0x6efab
testb $0x1, %dil
cmovneq %rax, %rcx
leaq 0x20dde(%rip), %rdi     # 0x6eef1
movb $0x3, %al
callq 0xb580
movss 0x44(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4e14c
jp 0x4e14c
movss 0x40(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4e14c
jp 0x4e14c
movss 0x3c(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4e14c
jp 0x4e14c
jmp 0x4e1c1
movss 0x1fa78(%rip), %xmm0    # 0x6dbcc
mulss 0x44(%rsp), %xmm0
movss %xmm0, 0x54df8a2(%rip)  # 0x552da04
movss 0x1fa62(%rip), %xmm0    # 0x6dbcc
mulss 0x40(%rsp), %xmm0
movss %xmm0, 0x54df890(%rip)  # 0x552da08
movss 0x1fa4c(%rip), %xmm0    # 0x6dbcc
mulss 0x3c(%rsp), %xmm0
movss %xmm0, 0x54df87e(%rip)  # 0x552da0c
movss 0x44(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movss 0x40(%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
movss 0x3c(%rsp), %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x20e05(%rip), %rdi     # 0x6efb8
leaq 0x20e1a(%rip), %rsi     # 0x6efd4
movb $0x3, %al
callq 0xb0d0
jmp 0x4e1d1
leaq 0x20e26(%rip), %rdi     # 0x6eff0
movb $0x0, %al
callq 0xb580
jmp 0x4e1d3
movq 0x160(%rsp), %rdi
leaq 0x21484(%rip), %rsi     # 0x6f666
callq 0x8b40
movss %xmm0, 0x158(%rsp)
movss 0x158(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4e205
jp 0x4e205
jmp 0x4e25a
movss 0x301df(%rip), %xmm0    # 0x7e3ec
cvtss2sd %xmm0, %xmm0
movsd 0x1f627(%rip), %xmm1    # 0x6d840
mulsd %xmm1, %xmm0
callq 0x4620
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x54e17f6(%rip)  # 0x552fa24
movq 0x160(%rsp), %rdi
leaq 0x21429(%rip), %rsi     # 0x6f666
callq 0x7d50
movq %rax, %rdx
leaq 0x20bd8(%rip), %rdi     # 0x6ee24
leaq 0x20e3f(%rip), %rsi     # 0x6f092
movb $0x0, %al
callq 0xb0d0
movq 0x160(%rsp), %rdi
leaq 0x2146f(%rip), %rsi     # 0x6f6d8
callq 0x8b40
movss %xmm0, 0x158(%rsp)
movss 0x158(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4e28c
jp 0x4e28c
jmp 0x4e2c9
movss 0x158(%rsp), %xmm0
movss %xmm0, 0x30133(%rip)    # 0x7e3d0
movq 0x160(%rsp), %rdi
leaq 0x2142c(%rip), %rsi     # 0x6f6d8
callq 0x7d50
movq %rax, %rdx
leaq 0x20b69(%rip), %rdi     # 0x6ee24
leaq 0x20de4(%rip), %rsi     # 0x6f0a6
movb $0x0, %al
callq 0xb0d0
movq 0x160(%rsp), %rdi
leaq 0x211cd(%rip), %rsi     # 0x6f4a5
callq 0x7f70
movl %eax, 0x15c(%rsp)
cmpl $0x0, 0x15c(%rsp)
je 0x4e32b
cvtsi2ssl 0x15c(%rsp), %xmm0
movss %xmm0, 0x30139(%rip)    # 0x7e438
movq 0x160(%rsp), %rdi
leaq 0x21197(%rip), %rsi     # 0x6f4a5
callq 0x7d50
movq %rax, %rdx
leaq 0x20b07(%rip), %rdi     # 0x6ee24
leaq 0x20da6(%rip), %rsi     # 0x6f0ca
movb $0x0, %al
callq 0xb0d0
movq 0x160(%rsp), %rdi
leaq 0x211cf(%rip), %rsi     # 0x6f509
callq 0x8b40
movss %xmm0, 0x158(%rsp)
movss 0x158(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4e35d
jp 0x4e35d
jmp 0x4e39a
movss 0x158(%rsp), %xmm0
movss %xmm0, 0x300ce(%rip)    # 0x7e43c
movq 0x160(%rsp), %rdi
leaq 0x2118c(%rip), %rsi     # 0x6f509
callq 0x7d50
movq %rax, %rdx
leaq 0x20a98(%rip), %rdi     # 0x6ee24
leaq 0x20d29(%rip), %rsi     # 0x6f0bc
movb $0x0, %al
callq 0xb0d0
movq 0x160(%rsp), %rdi
leaq 0x20d2b(%rip), %rsi     # 0x6f0d4
callq 0x7f70
movl %eax, 0x15c(%rsp)
cmpl $0x0, 0x15c(%rsp)
jne 0x4e3ed
leaq 0x2ef8a(%rip), %rax     # 0x7d350
movq (%rax), %rdx
leaq 0x2ef80(%rip), %rax     # 0x7d350
movq (%rax), %rcx
movl $0x36, %edi
leaq 0x20cfb(%rip), %rsi     # 0x6f0da
movb $0x0, %al
callq 0xb6b0
callq 0xb560
jmp 0x4e415
cmpl $0x1, 0x15c(%rsp)
jne 0x4e400
movb $0x0, 0x54e1623(%rip)   # 0x552fa21
jmp 0x4e413
cmpl $0x2, 0x15c(%rsp)
jne 0x4e411
movb $0x1, 0x54e1610(%rip)   # 0x552fa21
jmp 0x4e413
jmp 0x4e415
movb 0x54e1606(%rip), %cl    # 0x552fa21
leaq 0x20a4e(%rip), %rdx     # 0x6ee70
leaq 0x20a2b(%rip), %rax     # 0x6ee54
testb $0x1, %cl
cmovneq %rax, %rdx
leaq 0x209ed(%rip), %rdi     # 0x6ee24
leaq 0x20cf1(%rip), %rsi     # 0x6f12f
movb $0x0, %al
callq 0xb0d0
movq 0x160(%rsp), %rdi
leaq 0x20ce5(%rip), %rsi     # 0x6f139
callq 0x7f70
movl %eax, 0x15c(%rsp)
cmpl $0x1, 0x15c(%rsp)
jne 0x4e476
movl $0x1, 0x2ff54(%rip)     # 0x7e3c8
jmp 0x4e4a4
cmpl $0x0, 0x15c(%rsp)
jne 0x4e48c
movl $0x2, 0x2ff3e(%rip)     # 0x7e3c8
jmp 0x4e4a2
cmpl $0x2, 0x15c(%rsp)
jne 0x4e4a0
movl $0x0, 0x2ff28(%rip)     # 0x7e3c8
jmp 0x4e4a2
jmp 0x4e4a4
movl 0x2ff1e(%rip), %ecx     # 0x7e3c8
leaq 0x209bf(%rip), %rdx     # 0x6ee70
leaq 0x2099c(%rip), %rax     # 0x6ee54
cmpl $0x1, %ecx
cmoveq %rax, %rdx
leaq 0x2095e(%rip), %rdi     # 0x6ee24
leaq 0x20c73(%rip), %rsi     # 0x6f140
movb $0x0, %al
callq 0xb0d0
movl 0x2feee(%rip), %ecx     # 0x7e3c8
leaq 0x2098f(%rip), %rdx     # 0x6ee70
leaq 0x2096c(%rip), %rax     # 0x6ee54
cmpl $0x2, %ecx
cmoveq %rax, %rdx
leaq 0x2092e(%rip), %rdi     # 0x6ee24
leaq 0x20c54(%rip), %rsi     # 0x6f151
movb $0x0, %al
callq 0xb0d0
movq 0x160(%rsp), %rdi
leaq 0x21100(%rip), %rsi     # 0x6f613
callq 0x7f70
movl %eax, 0x15c(%rsp)
cmpl $0x0, 0x15c(%rsp)
jne 0x4e532
movb $0x0, 0x54e14fc(%rip)   # 0x552fa2c
jmp 0x4e545
cmpl $0x1, 0x15c(%rsp)
jne 0x4e543
movb $0x1, 0x54e14e9(%rip)   # 0x552fa2c
jmp 0x4e545
movb 0x54e14e1(%rip), %cl    # 0x552fa2c
leaq 0x2091e(%rip), %rdx     # 0x6ee70
leaq 0x208fb(%rip), %rax     # 0x6ee54
testb $0x1, %cl
cmovneq %rax, %rdx
leaq 0x208bd(%rip), %rdi     # 0x6ee24
leaq 0x20bef(%rip), %rsi     # 0x6f15d
movb $0x0, %al
callq 0xb0d0
leaq 0x1d77c(%rip), %rdi     # 0x6bcf8
movb $0x0, %al
callq 0xb0d0
addq $0x168, %rsp            # imm = 0x168
retq
nopl (%rax,%rax)