// File: NovaGL[P]HarmonyHubControl/HarmonyHubControl.cpp
// Function: main
int main(int argc, char * argv[])
{

     ifstream myFile("HarmonyHub.AuthorizationToken");
	if (myFile.fail()) {
		ofstream auth("HarmonyHub.AuthorizationToken");
		auth << ("KsRE6VVA3xrhtbqFbh0jWn8YTiweDeB/b94Qeqf3ofWGM79zLSr62XQh8geJxw/V");
	}
	
    if (argc < 2)
    {
	      const char *suffix = "";
	#if _WIN32
        	suffix = ".exe";
	#endif
        printf("Syntax:\n");
        printf("HarmonyHubControl%s [harmony_ip] [command (optional)]\n", suffix);        
	printf("    where command can be any of the following:\n");
        printf("        list_activities\n");
        printf("        list_activities_raw\n");
        printf("        get_current_activity_id\n");
        printf("        get_current_activity_id_raw\n");
        printf("        start_activity [ID]\n");
        printf("        list_devices\n");
        printf("        list_devices_raw\n");
        printf("        list_device_commands [deviceId]\n");
        printf("        list_device_commands_raw [deviceId]\n");
        printf("        issue_device_command [deviceId] [command]\n");
        printf("        get_config\n");
        printf("        get_config_raw\n");
        printf("\n");
        return 0;
    }

    std::string strUserEmail = "guest@x.com";
    std::string strUserPassword = "guest";
    std::string strHarmonyIP = argv[1];
    std::string strCommand;
    std::string strCommandParameterPrimary;
    std::string strCommandParameterSecondary;
    std::string strCommandParameterThird;
    std::string strCommandParameterFourth;
    
    int harmonyPortNumber = HARMONY_COMMUNICATION_PORT;

    // User requested an action to be performed
    if(argc >= 3)
    {
        strCommand = argv[2];
    }
    if(argc>=4)
    {
        strCommandParameterPrimary = argv[3];
    }

    if(argc>=5)
    {
        strCommandParameterSecondary = argv[4];
    }

    if(argc>=6)
    {
        strCommandParameterThird = argv[5];
    }

    if(argc==7)
    {
        strCommandParameterFourth = argv[6];
    }

    bool bQuietMode = false;

    if(strCommand.length())
    {
        if( strCommand.find("_raw") != std::string::npos)
        {
            bQuietMode = true;
        }
    }

    // Read the token
    std::string strAuthorizationToken = ReadAuthorizationTokenFile();

    //printf("\nLogin Authorization Token is: %s\n\n", strAuthorizationToken.c_str());

    bool bAuthorizationComplete = false;

    if(strAuthorizationToken.length() > 0)
    {
        csocket authorizationcsocket;
        if(connectToHarmony(strHarmonyIP, harmonyPortNumber, authorizationcsocket) == 1)
        {
            log("HARMONY COMMUNICATION LOGIN    : FAILURE", false);
            printf("ERROR : %s\n", errorString.c_str());
            return 1;
        }

        if(swapAuthorizationToken(&authorizationcsocket, strAuthorizationToken) == 0)
        {
            // Authorization Token found in the file worked.  
            // Bypass authorization through Logitech's servers.
            log("LOGITECH WEB SERVICE LOGIN     : BYPASSED", bQuietMode);

            bAuthorizationComplete = true;
        }
        
    }

    
    if(bAuthorizationComplete == false)
    {
        // Log into the Logitech Web Service to retrieve the login authorization token
        if(harmonyWebServiceLogin(strUserEmail, strUserPassword, strAuthorizationToken) == 1)
        {
            log("LOGITECH WEB SERVICE LOGIN     : FAILURE", false);
            printf("ERROR : %s\n", errorString.c_str());
            return 1;
        }
        log("LOGITECH WEB SERVICE LOGIN     : SUCCESS", bQuietMode);

        //printf("\nLogin Authorization Token is: %s\n\n", strAuthorizationToken.c_str());

        // Write the Authorization Token to an Authorization Token file to bypass this step
        // on future sessions
        WriteAuthorizationTokenFile(strAuthorizationToken);

        // Log into the harmony hub to convert the login authorization token for a 
        // session authorization token
    
        csocket authorizationcsocket;
        if(connectToHarmony(strHarmonyIP, harmonyPortNumber, authorizationcsocket) == 1)
        {
            log("HARMONY COMMUNICATION LOGIN    : FAILURE", false);
            printf("ERROR : %s\n", errorString.c_str());
            return 1;
        }


        if(swapAuthorizationToken(&authorizationcsocket, strAuthorizationToken) == 1)
        {
            log("HARMONY COMMUNICATION LOGIN    : FAILURE", false);
            printf("ERROR : %s\n", errorString.c_str());
            return 1;
        }
    }

    log("HARMONY COMMUNICATION LOGIN    : SUCCESS", bQuietMode);


    //printf("\nSession Authorization Token is: %s\n\n", strAuthorizationToken.c_str());

    // We've successfully obtained our session authorization token from the harmony hub 
    // using the login authorization token we received earlier from the Logitech web service.
    // Now, disconnect from the harmony and reconnect using the mangled session token 
    // as our username and password to issue a command.


    csocket commandcsocket;
    if(connectToHarmony(strHarmonyIP, harmonyPortNumber, commandcsocket) == 1)
    {
        log("HARMONY COMMAND SUBMISSION     : FAILURE", false);
        printf("ERROR : %s\n", errorString.c_str());
        return 1;
    }

    std::string strUserName = strAuthorizationToken;
    //strUserName.append("@connect.logitech.com/gatorade.");
    std::string strPassword = strAuthorizationToken;
    
    if(startCommunication(&commandcsocket, strUserName, strPassword) == 1)
    {
        errorString = "Communication failure";
        return 1;
    }

    std::string lstrCommand = strCommand;

    if(strCommand == "list_activities"              || 
        strCommand == "list_activities_raw"         || 
        strCommand == "list_devices"                || 
        strCommand == "list_devices_raw"            || 
        strCommand == "list_commands"               || 
        strCommand == "list_device_commands"        || 
        strCommand == "list_device_commands_raw"    || 
        strCommand == "get_config")
    {
        lstrCommand = "get_config_raw";
    }

    if(submitCommand(&commandcsocket, strAuthorizationToken, lstrCommand, strCommandParameterPrimary, strCommandParameterSecondary, strCommandParameterThird, strCommandParameterFourth) == 1)
    {
        log("HARMONY COMMAND SUBMISSION     : FAILURE", false);
        printf("ERROR : %s\n", errorString.c_str());
        return 1;
    }

    log("HARMONY COMMAND SUBMISSION     : SUCCESS", bQuietMode);
    
    if(lstrCommand == "get_config_raw")
    {
        std::map< std::string, std::string> mapActivities;
        std::vector< Device > vecDevices;
        if(parseConfiguration(rawConfig, mapActivities, vecDevices) == 1)
        {
            log("PARSE ACTIVITIES AND DEVICES   : FAILURE", false);
            printf("ERROR : %s\n", errorString.c_str());		
            return 1;
        }

        if(strCommand == "list_activities" || strCommand == "list_activities_raw" )
        {
            resultString = "{";

            if(strCommand == "list_activities")
            {
                resultString = "Activities Available via Harmony : \n\n";
            }
        
            std::map< std::string, std::string>::iterator it = mapActivities.begin();
            std::map< std::string, std::string>::iterator ite = mapActivities.end();
            for(; it != ite; ++it)
            {
                resultString.append("\"");
                resultString.append(it->second);
                resultString.append("\":\"");
                resultString.append(it->first);
                resultString.append("\",");
            }
            resultString = resultString.substr(0, resultString.size() - 1);
            resultString.append("}");
            ofstream activities("activities.json");
            activities << ("%s\n\n", resultString.c_str());
        }

        if( strCommand == "list_devices" || strCommand == "list_devices_raw" )
        {
            
	        resultString ="{";
            if( strCommand == "list_devices" )
            {
                resultString = "Devices Controllable via Harmony : \n\n";
            }

            std::vector< Device >::iterator it = vecDevices.begin();
            std::vector< Device >::iterator ite = vecDevices.end();
            for(; it != ite; ++it)
            {
                resultString.append("\"");
		        resultString.append(it->m_strLabel );
                resultString.append("\":\"");
                resultString.append(it->m_strID );
		        resultString.append("\",");
            }
            resultString=resultString.substr(0, resultString.size()-1);
	        resultString.append("}");
		    ofstream devices("devices.json");
		    devices << ("%s\n\n", resultString.c_str());
        }

        if(strCommand == "list_commands" || strCommand == "list_commands_raw" )
        {
            resultString = "";
            
            if(strCommand == "list_commands")
            {
                resultString = "Devices Controllable via Harmony with Commands : \n\n";
            }
            std::vector< Device >::iterator it = vecDevices.begin();
            std::vector< Device >::iterator ite = vecDevices.end();
            for(; it != ite; ++it)
            {  
                resultString.append(it->toString());
                resultString.append("\n\n\n");
            }
        }

        if(strCommand == "list_device_commands" || strCommand == "list_device_commands_raw")
        {
            resultString = "{";
            
            if(strCommand == "list_device_commands")
            {
                resultString = "Harmony Commands for Device: \n\n";
            }
            
            std::vector< Device >::iterator it = vecDevices.begin();
            std::vector< Device >::iterator ite = vecDevices.end();
            for(; it != ite; ++it)
            {
                if(it->m_strID == strCommandParameterPrimary)
                {
                    if(strCommandParameterSecondary.length())
                    {
                        if(strCommandParameterSecondary == it->m_strID)
                        {
                            resultString.append("\"");    
			    resultString.append(it->toString());                         
                        }
                    }
                    else
                    {
     			  resultString.append("\"");                                 
			  resultString.append(it->toString()); 
                    }
                          resultString=resultString.substr(0, resultString.size()-1);
                          resultString.append("}" );
                    break;
                }
            }
			string filename;	
			filename = strCommandParameterPrimary;
			filename.append(".json"); 
			ofstream myfile( filename.c_str() );
			myfile << ("%s\n\n", resultString.c_str());
        }
        log("PARSE ACTIVITIES AND DEVICES   : SUCCESS", bQuietMode);
		ofstream config("config.json");
		config << rawConfig;
    }
	

    printf("%s\n\n", resultString.c_str());
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x12b0, %rsp           # imm = 0x12B0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0xf9ef(%rip), %rsi      # 0x16a0f
leaq -0x218(%rbp), %rdi
movl $0x8, %edx
callq 0x3620
movq -0x218(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x218(%rbp,%rax), %rdi
callq 0x3030
movb %al, -0x11d1(%rbp)
jmp 0x7051
movb -0x11d1(%rbp), %al
testb $0x1, %al
jne 0x705d
jmp 0x70d4
leaq 0xf9ab(%rip), %rsi      # 0x16a0f
leaq -0x428(%rbp), %rdi
movl $0x10, %edx
callq 0x3400
jmp 0x7077
leaq 0xf9af(%rip), %rsi      # 0x16a2d
leaq -0x428(%rbp), %rdi
callq 0x3360
jmp 0x708c
leaq -0x428(%rbp), %rdi
callq 0x3530
jmp 0x70d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x8b2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x428(%rbp), %rdi
callq 0x3530
jmp 0x8b2f
cmpl $0x2, -0x8(%rbp)
jge 0x7209
leaq 0x10111(%rip), %rax     # 0x171f6
movq %rax, -0x430(%rbp)
leaq 0xf97b(%rip), %rdi      # 0x16a6e
xorl %eax, %eax
callq 0x3060
jmp 0x70fc
movq -0x430(%rbp), %rsi
leaq 0xf96d(%rip), %rdi      # 0x16a77
xorl %eax, %eax
callq 0x3060
jmp 0x7113
leaq 0xf994(%rip), %rdi      # 0x16aae
xorl %eax, %eax
callq 0x3060
jmp 0x7123
leaq 0xf9b4(%rip), %rdi      # 0x16ade
xorl %eax, %eax
callq 0x3060
jmp 0x7133
leaq 0xf9bd(%rip), %rdi      # 0x16af7
xorl %eax, %eax
callq 0x3060
jmp 0x7143
leaq 0xf9ca(%rip), %rdi      # 0x16b14
xorl %eax, %eax
callq 0x3060
jmp 0x7153
leaq 0xf9db(%rip), %rdi      # 0x16b35
xorl %eax, %eax
callq 0x3060
jmp 0x7163
leaq 0xf9f0(%rip), %rdi      # 0x16b5a
xorl %eax, %eax
callq 0x3060
jmp 0x7173
leaq 0xf9fd(%rip), %rdi      # 0x16b77
xorl %eax, %eax
callq 0x3060
jmp 0x7183
leaq 0xfa03(%rip), %rdi      # 0x16b8d
xorl %eax, %eax
callq 0x3060
jmp 0x7193
leaq 0xfa0d(%rip), %rdi      # 0x16ba7
xorl %eax, %eax
callq 0x3060
jmp 0x71a3
leaq 0xfa26(%rip), %rdi      # 0x16bd0
xorl %eax, %eax
callq 0x3060
jmp 0x71b3
leaq 0xfa43(%rip), %rdi      # 0x16bfd
xorl %eax, %eax
callq 0x3060
jmp 0x71c3
leaq 0xfa66(%rip), %rdi      # 0x16c30
xorl %eax, %eax
callq 0x3060
jmp 0x71d3
leaq 0xfa6a(%rip), %rdi      # 0x16c44
xorl %eax, %eax
callq 0x3060
jmp 0x71e3
leaq 0xfd05(%rip), %rdi      # 0x16eef
xorl %eax, %eax
callq 0x3060
jmp 0x71f3
movl $0x0, -0x4(%rbp)
movl $0x1, -0x434(%rbp)
jmp 0x8b17
leaq -0x459(%rbp), %rdi
movq %rdi, -0x11e0(%rbp)
callq 0x35f0
movq -0x11e0(%rbp), %rdx
leaq 0xfa32(%rip), %rsi      # 0x16c5c
leaq -0x458(%rbp), %rdi
callq 0x8b50
jmp 0x7238
leaq -0x459(%rbp), %rdi
callq 0x33f0
leaq -0x481(%rbp), %rdi
movq %rdi, -0x11e8(%rbp)
callq 0x35f0
movq -0x11e8(%rbp), %rdx
leaq 0xf2b1(%rip), %rsi      # 0x16516
leaq -0x480(%rbp), %rdi
callq 0x8b50
jmp 0x7273
leaq -0x481(%rbp), %rdi
callq 0x33f0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x11f8(%rbp)
leaq -0x4a9(%rbp), %rdi
movq %rdi, -0x11f0(%rbp)
callq 0x35f0
movq -0x11f8(%rbp), %rsi
movq -0x11f0(%rbp), %rdx
leaq -0x4a8(%rbp), %rdi
callq 0x8b50
jmp 0x72bd
leaq -0x4a9(%rbp), %rdi
callq 0x33f0
leaq -0x4d0(%rbp), %rdi
callq 0x34e0
leaq -0x4f0(%rbp), %rdi
callq 0x34e0
leaq -0x510(%rbp), %rdi
callq 0x34e0
leaq -0x530(%rbp), %rdi
callq 0x34e0
leaq -0x550(%rbp), %rdi
callq 0x34e0
movl $0x1466, -0x554(%rbp)   # imm = 0x1466
cmpl $0x3, -0x8(%rbp)
jl 0x73b4
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x4d0(%rbp), %rdi
callq 0x34c0
jmp 0x732f
jmp 0x73b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x459(%rbp), %rdi
callq 0x33f0
jmp 0x8b2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x481(%rbp), %rdi
callq 0x33f0
jmp 0x8b09
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x4a9(%rbp), %rdi
callq 0x33f0
jmp 0x8afd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x8ab5
cmpl $0x4, -0x8(%rbp)
jl 0x73d2
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
leaq -0x4f0(%rbp), %rdi
callq 0x34c0
jmp 0x73d0
jmp 0x73d2
cmpl $0x5, -0x8(%rbp)
jl 0x73f0
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
leaq -0x510(%rbp), %rdi
callq 0x34c0
jmp 0x73ee
jmp 0x73f0
cmpl $0x6, -0x8(%rbp)
jl 0x740e
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
leaq -0x530(%rbp), %rdi
callq 0x34c0
jmp 0x740c
jmp 0x740e
cmpl $0x7, -0x8(%rbp)
jne 0x742c
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
leaq -0x550(%rbp), %rdi
callq 0x34c0
jmp 0x742a
jmp 0x742c
movb $0x0, -0x555(%rbp)
leaq -0x4d0(%rbp), %rdi
callq 0x3540
cmpq $0x0, %rax
je 0x746b
leaq -0x4d0(%rbp), %rdi
leaq 0xf3a4(%rip), %rsi      # 0x167f7
xorl %eax, %eax
movl %eax, %edx
callq 0x3670
cmpq $-0x1, %rax
je 0x7469
movb $0x1, -0x555(%rbp)
jmp 0x746b
leaq -0x578(%rbp), %rdi
callq 0x6df0
jmp 0x7479
movb $0x0, -0x579(%rbp)
leaq -0x578(%rbp), %rdi
callq 0x3540
cmpq $0x0, %rax
jbe 0x7606
leaq -0x5d8(%rbp), %rdi
callq 0x14a70
jmp 0x74a4
leaq -0x5f8(%rbp), %rdi
leaq -0x4a8(%rbp), %rsi
callq 0x31d0
jmp 0x74b9
movl -0x554(%rbp), %esi
leaq -0x5f8(%rbp), %rdi
leaq -0x5d8(%rbp), %rdx
callq 0x44b0
movl %eax, -0x11fc(%rbp)
jmp 0x74da
leaq -0x5f8(%rbp), %rdi
callq 0x3698
movl -0x11fc(%rbp), %eax
cmpl $0x1, %eax
jne 0x7588
leaq 0xf76c(%rip), %rdi      # 0x16c68
xorl %esi, %esi
callq 0x38f0
jmp 0x7505
leaq 0x1ae6c(%rip), %rdi     # 0x22378
callq 0x31c0
movq %rax, %rsi
leaq 0xf776(%rip), %rdi      # 0x16c91
xorl %eax, %eax
callq 0x3060
jmp 0x7524
movl $0x1, -0x4(%rbp)
movl $0x1, -0x434(%rbp)
jmp 0x75d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x8aa9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x75f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x5f8(%rbp), %rdi
callq 0x3698
jmp 0x75f5
leaq -0x5d8(%rbp), %rdi
leaq -0x578(%rbp), %rsi
callq 0x4a80
movl %eax, -0x1200(%rbp)
jmp 0x75a3
movl -0x1200(%rbp), %eax
cmpl $0x0, %eax
jne 0x75cd
movzbl -0x555(%rbp), %esi
andl $0x1, %esi
leaq 0xf6de(%rip), %rdi      # 0x16c9d
callq 0x38f0
jmp 0x75c6
movb $0x1, -0x579(%rbp)
movl $0x0, -0x434(%rbp)
leaq -0x5d8(%rbp), %rdi
callq 0x14ad0
movl -0x434(%rbp), %eax
testl %eax, %eax
jne 0x8a3b
jmp 0x75f3
jmp 0x7606
leaq -0x5d8(%rbp), %rdi
callq 0x14ad0
jmp 0x8aa9
movb -0x579(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x78b6
leaq -0x618(%rbp), %rdi
leaq -0x458(%rbp), %rsi
callq 0x31d0
jmp 0x762f
leaq -0x638(%rbp), %rdi
leaq -0x480(%rbp), %rsi
callq 0x31d0
jmp 0x7644
leaq -0x618(%rbp), %rdi
leaq -0x638(%rbp), %rsi
leaq -0x578(%rbp), %rdx
callq 0x3e70
movl %eax, -0x1204(%rbp)
jmp 0x7666
leaq -0x638(%rbp), %rdi
callq 0x3698
leaq -0x618(%rbp), %rdi
callq 0x3698
movl -0x1204(%rbp), %eax
cmpl $0x1, %eax
jne 0x7715
leaq 0xf633(%rip), %rdi      # 0x16cc7
xorl %esi, %esi
callq 0x38f0
jmp 0x769d
leaq 0x1acd4(%rip), %rdi     # 0x22378
callq 0x31c0
movq %rax, %rsi
leaq 0xf5de(%rip), %rdi      # 0x16c91
xorl %eax, %eax
callq 0x3060
jmp 0x76bc
movl $0x1, -0x4(%rbp)
movl $0x1, -0x434(%rbp)
jmp 0x8a3b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x7704
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x638(%rbp), %rdi
callq 0x3698
leaq -0x618(%rbp), %rdi
callq 0x3698
jmp 0x8aa9
movzbl -0x555(%rbp), %esi
andl $0x1, %esi
leaq 0xf5ca(%rip), %rdi      # 0x16cf0
callq 0x38f0
jmp 0x772d
leaq -0x578(%rbp), %rdi
callq 0x6f10
jmp 0x773b
leaq -0x690(%rbp), %rdi
callq 0x14a70
jmp 0x7749
leaq -0x6b0(%rbp), %rdi
leaq -0x4a8(%rbp), %rsi
callq 0x31d0
jmp 0x775e
movl -0x554(%rbp), %esi
leaq -0x6b0(%rbp), %rdi
leaq -0x690(%rbp), %rdx
callq 0x44b0
movl %eax, -0x1208(%rbp)
jmp 0x777f
leaq -0x6b0(%rbp), %rdi
callq 0x3698
movl -0x1208(%rbp), %eax
cmpl $0x1, %eax
jne 0x7815
leaq 0xf4cb(%rip), %rdi      # 0x16c68
xorl %esi, %esi
callq 0x38f0
jmp 0x77a6
leaq 0x1abcb(%rip), %rdi     # 0x22378
callq 0x31c0
movq %rax, %rsi
leaq 0xf4d5(%rip), %rdi      # 0x16c91
xorl %eax, %eax
callq 0x3060
jmp 0x77c5
movl $0x1, -0x4(%rbp)
movl $0x1, -0x434(%rbp)
jmp 0x7887
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x78a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x6b0(%rbp), %rdi
callq 0x3698
jmp 0x78a5
leaq -0x690(%rbp), %rdi
leaq -0x578(%rbp), %rsi
callq 0x4a80
movl %eax, -0x120c(%rbp)
jmp 0x7830
movl -0x120c(%rbp), %eax
cmpl $0x1, %eax
jne 0x787d
leaq 0xf426(%rip), %rdi      # 0x16c68
xorl %esi, %esi
callq 0x38f0
jmp 0x784b
leaq 0x1ab26(%rip), %rdi     # 0x22378
callq 0x31c0
movq %rax, %rsi
leaq 0xf430(%rip), %rdi      # 0x16c91
xorl %eax, %eax
callq 0x3060
jmp 0x786a
movl $0x1, -0x4(%rbp)
movl $0x1, -0x434(%rbp)
jmp 0x7887
movl $0x0, -0x434(%rbp)
leaq -0x690(%rbp), %rdi
callq 0x14ad0
movl -0x434(%rbp), %eax
testl %eax, %eax
jne 0x8a3b
jmp 0x78a3
jmp 0x78b6
leaq -0x690(%rbp), %rdi
callq 0x14ad0
jmp 0x8aa9
movzbl -0x555(%rbp), %esi
andl $0x1, %esi
leaq 0xf452(%rip), %rdi      # 0x16d19
callq 0x38f0
jmp 0x78ce
leaq -0x708(%rbp), %rdi
callq 0x14a70
jmp 0x78dc
leaq -0x728(%rbp), %rdi
leaq -0x4a8(%rbp), %rsi
callq 0x31d0
jmp 0x78f1
movl -0x554(%rbp), %esi
leaq -0x728(%rbp), %rdi
leaq -0x708(%rbp), %rdx
callq 0x44b0
movl %eax, -0x1210(%rbp)
jmp 0x7912
leaq -0x728(%rbp), %rdi
callq 0x3698
movl -0x1210(%rbp), %eax
cmpl $0x1, %eax
jne 0x79a8
leaq 0xf412(%rip), %rdi      # 0x16d42
xorl %esi, %esi
callq 0x38f0
jmp 0x7939
leaq 0x1aa38(%rip), %rdi     # 0x22378
callq 0x31c0
movq %rax, %rsi
leaq 0xf342(%rip), %rdi      # 0x16c91
xorl %eax, %eax
callq 0x3060
jmp 0x7958
movl $0x1, -0x4(%rbp)
movl $0x1, -0x434(%rbp)
jmp 0x8a1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x8a2d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x728(%rbp), %rdi
callq 0x3698
jmp 0x8a2d
leaq -0x748(%rbp), %rdi
leaq -0x578(%rbp), %rsi
callq 0x31d0
jmp 0x79bd
leaq -0x768(%rbp), %rdi
leaq -0x578(%rbp), %rsi
callq 0x31d0
jmp 0x79d2
leaq -0x788(%rbp), %rdi
leaq -0x748(%rbp), %rsi
callq 0x31d0
jmp 0x79e7
leaq -0x7a8(%rbp), %rdi
leaq -0x768(%rbp), %rsi
callq 0x31d0
jmp 0x79fc
leaq -0x708(%rbp), %rdi
leaq -0x788(%rbp), %rsi
leaq -0x7a8(%rbp), %rdx
callq 0x4560
movl %eax, -0x1214(%rbp)
jmp 0x7a1e
leaq -0x7a8(%rbp), %rdi
callq 0x3698
leaq -0x788(%rbp), %rdi
callq 0x3698
movl -0x1214(%rbp), %eax
cmpl $0x1, %eax
jne 0x7ae1
leaq 0x1a92c(%rip), %rdi     # 0x22378
leaq 0xeaec(%rip), %rsi      # 0x1653f
callq 0x34c0
jmp 0x7a5a
movl $0x1, -0x4(%rbp)
movl $0x1, -0x434(%rbp)
jmp 0x89eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x8a11
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x8a05
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x7ad0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x7a8(%rbp), %rdi
callq 0x3698
leaq -0x788(%rbp), %rdi
callq 0x3698
jmp 0x8a05
leaq -0x7c8(%rbp), %rdi
leaq -0x4d0(%rbp), %rsi
callq 0x31d0
jmp 0x7af6
leaq 0xf26e(%rip), %rsi      # 0x16d6b
leaq -0x4d0(%rbp), %rdi
callq 0x8cc0
movb %al, -0x1215(%rbp)
jmp 0x7b11
movb -0x1215(%rbp), %al
testb $0x1, %al
jne 0x7c3e
jmp 0x7b21
leaq 0xf253(%rip), %rsi      # 0x16d7b
leaq -0x4d0(%rbp), %rdi
callq 0x8cc0
movb %al, -0x1216(%rbp)
jmp 0x7b3c
movb -0x1216(%rbp), %al
testb $0x1, %al
jne 0x7c3e
jmp 0x7b4c
leaq 0xf23c(%rip), %rsi      # 0x16d8f
leaq -0x4d0(%rbp), %rdi
callq 0x8cc0
movb %al, -0x1217(%rbp)
jmp 0x7b67
movb -0x1217(%rbp), %al
testb $0x1, %al
jne 0x7c3e
jmp 0x7b77
leaq 0xf21e(%rip), %rsi      # 0x16d9c
leaq -0x4d0(%rbp), %rdi
callq 0x8cc0
movb %al, -0x1218(%rbp)
jmp 0x7b92
movb -0x1218(%rbp), %al
testb $0x1, %al
jne 0x7c3e
jmp 0x7ba2
leaq 0xf204(%rip), %rsi      # 0x16dad
leaq -0x4d0(%rbp), %rdi
callq 0x8cc0
movb %al, -0x1219(%rbp)
jmp 0x7bbd
movb -0x1219(%rbp), %al
testb $0x1, %al
jne 0x7c3e
jmp 0x7bc9
leaq 0xf1eb(%rip), %rsi      # 0x16dbb
leaq -0x4d0(%rbp), %rdi
callq 0x8cc0
movb %al, -0x121a(%rbp)
jmp 0x7be4
movb -0x121a(%rbp), %al
testb $0x1, %al
jne 0x7c3e
jmp 0x7bf0
leaq 0xf1d9(%rip), %rsi      # 0x16dd0
leaq -0x4d0(%rbp), %rdi
callq 0x8cc0
movb %al, -0x121b(%rbp)
jmp 0x7c0b
movb -0x121b(%rbp), %al
testb $0x1, %al
jne 0x7c3e
jmp 0x7c17
leaq 0xed3f(%rip), %rsi      # 0x1695d
leaq -0x4d0(%rbp), %rdi
callq 0x8cc0
movb %al, -0x121c(%rbp)
jmp 0x7c32
movb -0x121c(%rbp), %al
testb $0x1, %al
jne 0x7c3e
jmp 0x7c6c
leaq 0xebd3(%rip), %rsi      # 0x16818
leaq -0x7c8(%rbp), %rdi
callq 0x34c0
jmp 0x7c53
jmp 0x7c6c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x89dd
leaq -0x7e8(%rbp), %rdi
leaq -0x7c8(%rbp), %rsi
callq 0x31d0
jmp 0x7c81
leaq -0x808(%rbp), %rdi
leaq -0x4f0(%rbp), %rsi
callq 0x31d0
jmp 0x7c96
leaq -0x828(%rbp), %rdi
leaq -0x510(%rbp), %rsi
callq 0x31d0
jmp 0x7cab
leaq -0x848(%rbp), %rdi
leaq -0x530(%rbp), %rsi
callq 0x31d0
jmp 0x7cc0
leaq -0x868(%rbp), %rdi
leaq -0x550(%rbp), %rsi
callq 0x31d0
jmp 0x7cd5
movq %rsp, %rax
leaq -0x868(%rbp), %rcx
movq %rcx, (%rax)
leaq -0x708(%rbp), %rdi
leaq -0x578(%rbp), %rsi
leaq -0x7e8(%rbp), %rdx
leaq -0x808(%rbp), %rcx
leaq -0x828(%rbp), %r8
leaq -0x848(%rbp), %r9
callq 0x5060
movl %eax, -0x1220(%rbp)
jmp 0x7d19
leaq -0x868(%rbp), %rdi
callq 0x3698
leaq -0x848(%rbp), %rdi
callq 0x3698
leaq -0x828(%rbp), %rdi
callq 0x3698
leaq -0x808(%rbp), %rdi
callq 0x3698
leaq -0x7e8(%rbp), %rdi
callq 0x3698
movl -0x1220(%rbp), %eax
cmpl $0x1, %eax
jne 0x7e4c
leaq 0xefd7(%rip), %rdi      # 0x16d42
xorl %esi, %esi
callq 0x38f0
jmp 0x7d74
leaq 0x1a5fd(%rip), %rdi     # 0x22378
callq 0x31c0
movq %rax, %rsi
leaq 0xef07(%rip), %rdi      # 0x16c91
xorl %eax, %eax
callq 0x3060
jmp 0x7d93
movl $0x1, -0x4(%rbp)
movl $0x1, -0x434(%rbp)
jmp 0x89cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x7e3b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x7e2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x7e23
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x7e17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x868(%rbp), %rdi
callq 0x3698
leaq -0x848(%rbp), %rdi
callq 0x3698
leaq -0x828(%rbp), %rdi
callq 0x3698
leaq -0x808(%rbp), %rdi
callq 0x3698
leaq -0x7e8(%rbp), %rdi
callq 0x3698
jmp 0x89dd
movzbl -0x555(%rbp), %esi
andl $0x1, %esi
leaq 0xef8c(%rip), %rdi      # 0x16de9
callq 0x38f0
jmp 0x7e64
leaq 0xe9ad(%rip), %rsi      # 0x16818
leaq -0x7c8(%rbp), %rdi
callq 0x8cc0
movb %al, -0x1221(%rbp)
jmp 0x7e7f
movb -0x1221(%rbp), %al
testb $0x1, %al
jne 0x7e8e
jmp 0x899f
leaq -0x898(%rbp), %rdi
movq %rdi, -0x1238(%rbp)
callq 0x9980
leaq -0x8b0(%rbp), %rdi
movq %rdi, -0x1230(%rbp)
callq 0x99a0
movq -0x1238(%rbp), %rsi
movq -0x1230(%rbp), %rdx
leaq 0x1a4ef(%rip), %rdi     # 0x223b8
callq 0x6590
movl %eax, -0x1228(%rbp)
jmp 0x7ed6
movl -0x1228(%rbp), %eax
cmpl $0x1, %eax
jne 0x7f3d
leaq 0xef2a(%rip), %rdi      # 0x16e12
xorl %esi, %esi
callq 0x38f0
jmp 0x7ef1
leaq 0x1a480(%rip), %rdi     # 0x22378
callq 0x31c0
movq %rax, %rsi
leaq 0xed8a(%rip), %rdi      # 0x16c91
xorl %eax, %eax
callq 0x3060
jmp 0x7f10
movl $0x1, -0x4(%rbp)
movl $0x1, -0x434(%rbp)
jmp 0x8941
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x8985
leaq 0xee27(%rip), %rsi      # 0x16d6b
leaq -0x4d0(%rbp), %rdi
callq 0x8cc0
movb %al, -0x1239(%rbp)
jmp 0x7f58
movb -0x1239(%rbp), %al
testb $0x1, %al
jne 0x7f8e
jmp 0x7f64
leaq 0xee10(%rip), %rsi      # 0x16d7b
leaq -0x4d0(%rbp), %rdi
callq 0x8cc0
movb %al, -0x123a(%rbp)
jmp 0x7f7f
movb -0x123a(%rbp), %al
testb $0x1, %al
jne 0x7f8e
jmp 0x818f
leaq 0x1a403(%rip), %rdi     # 0x22398
leaq 0xe9d4(%rip), %rsi      # 0x16970
callq 0x34c0
jmp 0x7fa3
leaq 0xedc1(%rip), %rsi      # 0x16d6b
leaq -0x4d0(%rbp), %rdi
callq 0x8cc0
movb %al, -0x123b(%rbp)
jmp 0x7fbe
movb -0x123b(%rbp), %al
testb $0x1, %al
jne 0x7fca
jmp 0x7fe1
leaq 0x1a3c7(%rip), %rdi     # 0x22398
leaq 0xee63(%rip), %rsi      # 0x16e3b
callq 0x34c0
jmp 0x7fdf
jmp 0x7fe1
leaq -0x898(%rbp), %rdi
callq 0x99c0
movq %rax, -0x8b8(%rbp)
leaq -0x898(%rbp), %rdi
callq 0x99f0
movq %rax, -0x8c0(%rbp)
leaq -0x8b8(%rbp), %rdi
leaq -0x8c0(%rbp), %rsi
callq 0x9a20
testb $0x1, %al
jne 0x8023
jmp 0x80b3
leaq 0x1a36e(%rip), %rdi     # 0x22398
leaq 0xf1a7(%rip), %rsi      # 0x171d8
callq 0x3630
jmp 0x8038
leaq -0x8b8(%rbp), %rdi
callq 0x9a50
movq %rax, %rsi
addq $0x20, %rsi
leaq 0x1a346(%rip), %rdi     # 0x22398
callq 0x3640
jmp 0x8059
leaq 0x1a338(%rip), %rdi     # 0x22398
leaq 0xe0ca(%rip), %rsi      # 0x16131
callq 0x3630
jmp 0x806e
leaq -0x8b8(%rbp), %rdi
callq 0x9a50
movq %rax, %rsi
leaq 0x1a314(%rip), %rdi     # 0x22398
callq 0x3640
jmp 0x808b
leaq 0x1a306(%rip), %rdi     # 0x22398
leaq 0xedc8(%rip), %rsi      # 0x16e61
callq 0x3630
jmp 0x80a0
jmp 0x80a2
leaq -0x8b8(%rbp), %rdi
callq 0x9a70
jmp 0x8007
leaq 0x1a2de(%rip), %rdi     # 0x22398
movq %rdi, -0x1248(%rbp)
callq 0x3290
movq -0x1248(%rbp), %rsi
movq %rax, %rcx
decq %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x8e0(%rbp), %rdi
callq 0x33c0
jmp 0x80e5
leaq 0x1a2ac(%rip), %rdi     # 0x22398
movq %rdi, -0x1250(%rbp)
leaq -0x8e0(%rbp), %rsi
movq %rsi, -0x1258(%rbp)
callq 0x3460
movq -0x1258(%rbp), %rdi
callq 0x3698
movq -0x1250(%rbp), %rdi
leaq 0xe016(%rip), %rsi      # 0x16136
callq 0x3630
jmp 0x8127
leaq 0xed36(%rip), %rsi      # 0x16e64
leaq -0xae0(%rbp), %rdi
movl $0x10, %edx
callq 0x3400
jmp 0x8141
leaq 0x1a250(%rip), %rdi     # 0x22398
callq 0x31c0
movq %rax, %rsi
leaq -0xae0(%rbp), %rdi
callq 0x3360
jmp 0x815e
leaq -0xae0(%rbp), %rdi
callq 0x3530
jmp 0x818f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0xae0(%rbp), %rdi
callq 0x3530
jmp 0x8985
leaq 0xebf9(%rip), %rsi      # 0x16d8f
leaq -0x4d0(%rbp), %rdi
callq 0x8cc0
movb %al, -0x1259(%rbp)
jmp 0x81aa
movb -0x1259(%rbp), %al
testb $0x1, %al
jne 0x81e0
jmp 0x81b6
leaq 0xebdf(%rip), %rsi      # 0x16d9c
leaq -0x4d0(%rbp), %rdi
callq 0x8cc0
movb %al, -0x125a(%rbp)
jmp 0x81d1
movb -0x125a(%rbp), %al
testb $0x1, %al
jne 0x81e0
jmp 0x83e1
leaq 0x1a1b1(%rip), %rdi     # 0x22398
leaq 0xe782(%rip), %rsi      # 0x16970
callq 0x34c0
jmp 0x81f5
leaq 0xeb93(%rip), %rsi      # 0x16d8f
leaq -0x4d0(%rbp), %rdi
callq 0x8cc0
movb %al, -0x125b(%rbp)
jmp 0x8210
movb -0x125b(%rbp), %al
testb $0x1, %al
jne 0x821c
jmp 0x8233
leaq 0x1a175(%rip), %rdi     # 0x22398
leaq 0xec4a(%rip), %rsi      # 0x16e74
callq 0x34c0
jmp 0x8231
jmp 0x8233
leaq -0x8b0(%rbp), %rdi
callq 0x9aa0
movq %rax, -0xae8(%rbp)
leaq -0x8b0(%rbp), %rdi
callq 0x9ad0
movq %rax, -0xaf0(%rbp)
leaq -0xae8(%rbp), %rdi
leaq -0xaf0(%rbp), %rsi
callq 0x9b00
testb $0x1, %al
jne 0x8275
jmp 0x8305
leaq 0x1a11c(%rip), %rdi     # 0x22398
leaq 0xef55(%rip), %rsi      # 0x171d8
callq 0x3630
jmp 0x828a
leaq -0xae8(%rbp), %rdi
callq 0x9b40
movq %rax, %rsi
addq $0x20, %rsi
leaq 0x1a0f4(%rip), %rdi     # 0x22398
callq 0x3640
jmp 0x82ab
leaq 0x1a0e6(%rip), %rdi     # 0x22398
leaq 0xde78(%rip), %rsi      # 0x16131
callq 0x3630
jmp 0x82c0
leaq -0xae8(%rbp), %rdi
callq 0x9b40
movq %rax, %rsi
leaq 0x1a0c2(%rip), %rdi     # 0x22398
callq 0x3640
jmp 0x82dd
leaq 0x1a0b4(%rip), %rdi     # 0x22398
leaq 0xeb76(%rip), %rsi      # 0x16e61
callq 0x3630
jmp 0x82f2
jmp 0x82f4
leaq -0xae8(%rbp), %rdi
callq 0x9b60
jmp 0x8259
leaq 0x1a08c(%rip), %rdi     # 0x22398
movq %rdi, -0x1268(%rbp)
callq 0x3290
movq -0x1268(%rbp), %rsi
movq %rax, %rcx
decq %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0xb10(%rbp), %rdi
callq 0x33c0
jmp 0x8337
leaq 0x1a05a(%rip), %rdi     # 0x22398
movq %rdi, -0x1270(%rbp)
leaq -0xb10(%rbp), %rsi
movq %rsi, -0x1278(%rbp)
callq 0x3460
movq -0x1278(%rbp), %rdi
callq 0x3698
movq -0x1270(%rbp), %rdi
leaq 0xddc4(%rip), %rsi      # 0x16136
callq 0x3630
jmp 0x8379
leaq 0xeb1a(%rip), %rsi      # 0x16e9a
leaq -0xd10(%rbp), %rdi
movl $0x10, %edx
callq 0x3400
jmp 0x8393
leaq 0x19ffe(%rip), %rdi     # 0x22398
callq 0x31c0
movq %rax, %rsi
leaq -0xd10(%rbp), %rdi
callq 0x3360
jmp 0x83b0
leaq -0xd10(%rbp), %rdi
callq 0x3530
jmp 0x83e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0xd10(%rbp), %rdi
callq 0x3530
jmp 0x8985
leaq 0xe9c5(%rip), %rsi      # 0x16dad
leaq -0x4d0(%rbp), %rdi
callq 0x8cc0
movb %al, -0x1279(%rbp)
jmp 0x83fc
movb -0x1279(%rbp), %al
testb $0x1, %al
jne 0x8432
jmp 0x8408
leaq 0xea98(%rip), %rsi      # 0x16ea7
leaq -0x4d0(%rbp), %rdi
callq 0x8cc0
movb %al, -0x127a(%rbp)
jmp 0x8423
movb -0x127a(%rbp), %al
testb $0x1, %al
jne 0x8432
jmp 0x854f
leaq 0x19f5f(%rip), %rdi     # 0x22398
leaq 0xedb6(%rip), %rsi      # 0x171f6
callq 0x34c0
jmp 0x8447
leaq 0xe95f(%rip), %rsi      # 0x16dad
leaq -0x4d0(%rbp), %rdi
callq 0x8cc0
movb %al, -0x127b(%rbp)
jmp 0x8462
movb -0x127b(%rbp), %al
testb $0x1, %al
jne 0x846e
jmp 0x8485
leaq 0x19f23(%rip), %rdi     # 0x22398
leaq 0xea3d(%rip), %rsi      # 0x16eb9
callq 0x34c0
jmp 0x8483
jmp 0x8485
leaq -0x8b0(%rbp), %rdi
callq 0x9aa0
movq %rax, -0xd18(%rbp)
leaq -0x8b0(%rbp), %rdi
callq 0x9ad0
movq %rax, -0xd20(%rbp)
leaq -0xd18(%rbp), %rdi
leaq -0xd20(%rbp), %rsi
callq 0x9b00
testb $0x1, %al
jne 0x84c7
jmp 0x854d
leaq -0xd18(%rbp), %rdi
callq 0x9b40
movq %rax, %rsi
leaq -0xd40(%rbp), %rdi
callq 0x9b80
jmp 0x84e4
leaq 0x19ead(%rip), %rdi     # 0x22398
leaq -0xd40(%rbp), %rsi
callq 0x3640
jmp 0x84f9
leaq -0xd40(%rbp), %rdi
callq 0x3698
leaq 0x19e8c(%rip), %rdi     # 0x22398
leaq 0xe9da(%rip), %rsi      # 0x16eed
callq 0x3630
jmp 0x851a
jmp 0x851c
leaq -0xd18(%rbp), %rdi
callq 0x9b60
jmp 0x84ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0xd40(%rbp), %rdi
callq 0x3698
jmp 0x8985
jmp 0x854f
leaq 0xe865(%rip), %rsi      # 0x16dbb
leaq -0x4d0(%rbp), %rdi
callq 0x8cc0
movb %al, -0x127c(%rbp)
jmp 0x856a
movb -0x127c(%rbp), %al
testb $0x1, %al
jne 0x85a0
jmp 0x8576
leaq 0xe853(%rip), %rsi      # 0x16dd0
leaq -0x4d0(%rbp), %rdi
callq 0x8cc0
movb %al, -0x127d(%rbp)
jmp 0x8591
movb -0x127d(%rbp), %al
testb $0x1, %al
jne 0x85a0
jmp 0x88e4
leaq 0x19df1(%rip), %rdi     # 0x22398
leaq 0xe3c2(%rip), %rsi      # 0x16970
callq 0x34c0
jmp 0x85b5
leaq 0xe7ff(%rip), %rsi      # 0x16dbb
leaq -0x4d0(%rbp), %rdi
callq 0x8cc0
movb %al, -0x127e(%rbp)
jmp 0x85d0
movb -0x127e(%rbp), %al
testb $0x1, %al
jne 0x85dc
jmp 0x85f3
leaq 0x19db5(%rip), %rdi     # 0x22398
leaq 0xe907(%rip), %rsi      # 0x16ef1
callq 0x34c0
jmp 0x85f1
jmp 0x85f3
leaq -0x8b0(%rbp), %rdi
callq 0x9aa0
movq %rax, -0xd48(%rbp)
leaq -0x8b0(%rbp), %rdi
callq 0x9ad0
movq %rax, -0xd50(%rbp)
leaq -0xd48(%rbp), %rdi
leaq -0xd50(%rbp), %rsi
callq 0x9b00
testb $0x1, %al
jne 0x8635
jmp 0x880b
leaq -0xd48(%rbp), %rdi
callq 0x9b40
movq %rax, %rdi
leaq -0x4f0(%rbp), %rsi
callq 0x9dc0
testb $0x1, %al
jne 0x8659
jmp 0x87f8
leaq -0x510(%rbp), %rdi
callq 0x3540
cmpq $0x0, %rax
je 0x870a
leaq -0xd48(%rbp), %rdi
callq 0x9b40
movq %rax, %rsi
leaq -0x510(%rbp), %rdi
callq 0x9dc0
testb $0x1, %al
jne 0x8690
jmp 0x8708
leaq 0x19d01(%rip), %rdi     # 0x22398
leaq 0xeb3a(%rip), %rsi      # 0x171d8
callq 0x3630
jmp 0x86a5
leaq -0xd48(%rbp), %rdi
callq 0x9b40
movq %rax, %rsi
leaq -0xd70(%rbp), %rdi
callq 0x9b80
jmp 0x86c2
leaq 0x19ccf(%rip), %rdi     # 0x22398
leaq -0xd70(%rbp), %rsi
callq 0x3640
jmp 0x86d7
leaq -0xd70(%rbp), %rdi
callq 0x3698
jmp 0x8708
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0xd70(%rbp), %rdi
callq 0x3698
jmp 0x8985
jmp 0x8782
leaq 0x19c87(%rip), %rdi     # 0x22398
leaq 0xeac0(%rip), %rsi      # 0x171d8
callq 0x3630
jmp 0x871f
leaq -0xd48(%rbp), %rdi
callq 0x9b40
movq %rax, %rsi
leaq -0xd90(%rbp), %rdi
callq 0x9b80
jmp 0x873c
leaq 0x19c55(%rip), %rdi     # 0x22398
leaq -0xd90(%rbp), %rsi
callq 0x3640
jmp 0x8751
leaq -0xd90(%rbp), %rdi
callq 0x3698
jmp 0x8782
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0xd90(%rbp), %rdi
callq 0x3698
jmp 0x8985
leaq 0x19c0f(%rip), %rdi     # 0x22398
movq %rdi, -0x1288(%rbp)
callq 0x3290
movq -0x1288(%rbp), %rsi
movq %rax, %rcx
decq %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0xdb0(%rbp), %rdi
callq 0x33c0
jmp 0x87b4
leaq 0x19bdd(%rip), %rdi     # 0x22398
movq %rdi, -0x1290(%rbp)
leaq -0xdb0(%rbp), %rsi
movq %rsi, -0x1298(%rbp)
callq 0x3460
movq -0x1298(%rbp), %rdi
callq 0x3698
movq -0x1290(%rbp), %rdi
leaq 0xd947(%rip), %rsi      # 0x16136
callq 0x3630
jmp 0x87f6
jmp 0x880b
jmp 0x87fa
leaq -0xd48(%rbp), %rdi
callq 0x9b60
jmp 0x8619
leaq -0xdd0(%rbp), %rdi
movq %rdi, -0x12a0(%rbp)
callq 0x34e0
movq -0x12a0(%rbp), %rdi
leaq -0x4f0(%rbp), %rsi
callq 0x3050
jmp 0x8833
leaq 0xe706(%rip), %rsi      # 0x16f40
leaq -0xdd0(%rbp), %rdi
callq 0x3630
jmp 0x8848
leaq -0xdd0(%rbp), %rdi
callq 0x31c0
movq %rax, %rsi
leaq -0xfd0(%rbp), %rdi
movl $0x10, %edx
callq 0x3400
jmp 0x886a
leaq 0x19b27(%rip), %rdi     # 0x22398
callq 0x31c0
movq %rax, %rsi
leaq -0xfd0(%rbp), %rdi
callq 0x3360
jmp 0x8887
leaq -0xfd0(%rbp), %rdi
callq 0x3530
leaq -0xdd0(%rbp), %rdi
callq 0x3698
jmp 0x88e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x88d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0xfd0(%rbp), %rdi
callq 0x3530
leaq -0xdd0(%rbp), %rdi
callq 0x3698
jmp 0x8985
movzbl -0x555(%rbp), %esi
andl $0x1, %esi
leaq 0xe61c(%rip), %rdi      # 0x16f11
callq 0x38f0
jmp 0x88fc
leaq 0xe637(%rip), %rsi      # 0x16f3a
leaq -0x11d0(%rbp), %rdi
movl $0x10, %edx
callq 0x3400
jmp 0x8916
leaq 0x19a9b(%rip), %rsi     # 0x223b8
leaq -0x11d0(%rbp), %rdi
callq 0x3340
jmp 0x892b
leaq -0x11d0(%rbp), %rdi
callq 0x3530
movl $0x0, -0x434(%rbp)
leaq -0x8b0(%rbp), %rdi
callq 0x9e50
leaq -0x898(%rbp), %rdi
callq 0x9eb0
movl -0x434(%rbp), %eax
testl %eax, %eax
jne 0x89cf
jmp 0x8965
jmp 0x899f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x11d0(%rbp), %rdi
callq 0x3530
leaq -0x8b0(%rbp), %rdi
callq 0x9e50
leaq -0x898(%rbp), %rdi
callq 0x9eb0
jmp 0x89dd
leaq 0x199f2(%rip), %rdi     # 0x22398
callq 0x31c0
movq %rax, %rsi
leaq 0xdfa3(%rip), %rdi      # 0x16958
xorl %eax, %eax
callq 0x3060
jmp 0x89be
movl $0x0, -0x4(%rbp)
movl $0x1, -0x434(%rbp)
leaq -0x7c8(%rbp), %rdi
callq 0x3698
jmp 0x89eb
leaq -0x7c8(%rbp), %rdi
callq 0x3698
jmp 0x8a05
leaq -0x768(%rbp), %rdi
callq 0x3698
leaq -0x748(%rbp), %rdi
callq 0x3698
jmp 0x8a1f
leaq -0x768(%rbp), %rdi
callq 0x3698
leaq -0x748(%rbp), %rdi
callq 0x3698
jmp 0x8a2d
leaq -0x708(%rbp), %rdi
callq 0x14ad0
jmp 0x8a3b
leaq -0x708(%rbp), %rdi
callq 0x14ad0
jmp 0x8aa9
leaq -0x578(%rbp), %rdi
callq 0x3698
leaq -0x550(%rbp), %rdi
callq 0x3698
leaq -0x530(%rbp), %rdi
callq 0x3698
leaq -0x510(%rbp), %rdi
callq 0x3698
leaq -0x4f0(%rbp), %rdi
callq 0x3698
leaq -0x4d0(%rbp), %rdi
callq 0x3698
leaq -0x4a8(%rbp), %rdi
callq 0x3698
leaq -0x480(%rbp), %rdi
callq 0x3698
leaq -0x458(%rbp), %rdi
callq 0x3698
jmp 0x8b17
leaq -0x578(%rbp), %rdi
callq 0x3698
leaq -0x550(%rbp), %rdi
callq 0x3698
leaq -0x530(%rbp), %rdi
callq 0x3698
leaq -0x510(%rbp), %rdi
callq 0x3698
leaq -0x4f0(%rbp), %rdi
callq 0x3698
leaq -0x4d0(%rbp), %rdi
callq 0x3698
leaq -0x4a8(%rbp), %rdi
callq 0x3698
leaq -0x480(%rbp), %rdi
callq 0x3698
leaq -0x458(%rbp), %rdi
callq 0x3698
jmp 0x8b2f
leaq -0x218(%rbp), %rdi
callq 0x3150
movl -0x4(%rbp), %eax
addq $0x12b0, %rsp           # imm = 0x12B0
popq %rbp
retq
leaq -0x218(%rbp), %rdi
callq 0x3150
movq -0x220(%rbp), %rdi
callq 0x35e0
nopw (%rax,%rax)