// File: /workspace/github_cpp_makefile_star2_O3/NovaGL[P]HarmonyHubControl/HarmonyHubControl.cpp
// Function: submitCommand(csocket*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int submitCommand(csocket* commandcsocket, std::string& strAuthorizationToken, std::string strCommand, std::string strCommandParameterPrimary, std::string strCommandParameterSecondary,std::string strCommandParameterThird,std::string strCommandParameterFourth ){

  if(commandcsocket== NULL || strAuthorizationToken.length() == 0)
    {
        errorString = "submitCommand : NULL csocket or empty authorization token provided";
        return 1;
    }

    std::string lstrCommand = strCommand;
    if(lstrCommand.length() == 0)
    {
        // No command provided, return query for the current activity
        lstrCommand = "get_current_activity_id";
        return 0;
    }

    std::string strData;

    std::string sendData;
    
    sendData = "<iq type=\"get\" id=\"";
    sendData.append(CONNECTION_ID);
    sendData.append("\"><oa xmlns=\"connect.logitech.com\" mime=\"vnd.logitech.harmony/vnd.logitech.harmony.engine?");

    // Issue the provided command
    if(lstrCommand == "get_current_activity_id" || lstrCommand == "get_current_activity_id_raw")
    {
        sendData.append("getCurrentActivity\" /></iq>");
    }
    if(lstrCommand == "get_config_raw")
    {
        sendData.append("config\"></oa></iq>");        
    }
    else if (lstrCommand == "start_activity" || strCommand == "start_activity_raw")
    {
        sendData.append("startactivity\">activityId=");
        sendData.append(strCommandParameterPrimary.c_str());
        sendData.append(":timestamp=0</oa></iq>");
    }
    else if (lstrCommand == "issue_device_command")
    {
        sendData.append("holdAction\">action={\"type\"::\"IRCommand\",\"deviceId\"::\"");
        sendData.append(strCommandParameterPrimary.c_str());
        sendData.append("\",\"command\"::\"");
        sendData.append(strCommandParameterSecondary.c_str());
        sendData.append("\"}:status=press</oa></iq>");
    }

    commandcsocket->write(sendData.c_str(), static_cast<unsigned int>(sendData.length()));
    
 if (strCommandParameterThird != "") 
   {
        sendData = "<iq type=\"get\" id=\"";
        sendData.append(CONNECTION_ID);
        sendData.append("\"><oa xmlns=\"connect.logitech.com\" mime=\"vnd.logitech.harmony/vnd.logitech.harmony.engine?");

    sendData.append("holdAction\">action={\"type\"::\"IRCommand\",\"deviceId\"::\"");
        sendData.append(strCommandParameterPrimary.c_str());
        sendData.append("\",\"command\"::\"");
        sendData.append(strCommandParameterThird.c_str());
        sendData.append("\"}:status=press</oa></iq>");
    
    commandcsocket->write(sendData.c_str(), sendData.length());
    }

  if (strCommandParameterFourth != "") 
   {
        sendData = "<iq type=\"get\" id=\"";
        sendData.append(CONNECTION_ID);
        sendData.append("\"><oa xmlns=\"connect.logitech.com\" mime=\"vnd.logitech.harmony/vnd.logitech.harmony.engine?");

    sendData.append("holdAction\">action={\"type\"::\"IRCommand\",\"deviceId\"::\"");
        sendData.append(strCommandParameterPrimary.c_str());
        sendData.append("\",\"command\"::\"");
        sendData.append(strCommandParameterFourth.c_str());
        sendData.append("\"}:status=press</oa></iq>");
    
    commandcsocket->write(sendData.c_str(), sendData.length());
    }

    memset(databuffer, 0, 1000000);
    commandcsocket->read(databuffer, 1000000, false);
    strData = databuffer; /* <- Expect: strData  == <iq/> */
    
    std::string iqTag = "<iq/>";
    std::string::size_type pos = strData.find(iqTag);

    if(pos != 0)
    {
        errorString = "submitCommand: Invalid Harmony response";
        return 1;  
    }

    bool bIsDataReadable = false;
    commandcsocket->canRead(&bIsDataReadable, 0.6f);

    if(bIsDataReadable == false && strData == "<iq/>")
    {
        bIsDataReadable = true;
    }

    if(strCommand != "issue_device_command")
    {
        while(bIsDataReadable)
        {
            memset(databuffer, 0, 1000000);
            commandcsocket->read(databuffer, 1000000, false);
            strData.append(databuffer);
            commandcsocket->canRead(&bIsDataReadable, 0.3f);
        }
    }
    
    resultString = strData;

    if(strCommand == "get_current_activity_id" || strCommand == "get_current_activity_id_raw")
    {
         std::string::size_type resultStartPos = resultString.find("result=");
        std::string::size_type resultEndPos = resultString.find("]]>");

        if(resultStartPos != std::string::npos && resultEndPos != std::string::npos)
        {
            resultString = resultString.substr(resultStartPos + 7, resultEndPos - resultStartPos - 7);
	resultString.insert(0, "{\"current activity\":");
            if(strCommand == "get_current_activity_id")
            {

            }
		resultString.append("}");	
		ofstream current("current.json");
		current << ("%s\n\n", resultString.c_str());
        }

    }
    else if(strCommand == "get_config" || strCommand == "get_config_raw")
    {
        commandcsocket->canRead(&bIsDataReadable, 0.3f);

#ifndef _WIN32
        bIsDataReadable = true;
#endif

        while(bIsDataReadable)
        {
            memset(databuffer, 0, 1000000);
            commandcsocket->read(databuffer, 1000000, false);
            strData.append(databuffer);
            commandcsocket->canRead(&bIsDataReadable, 0.3f);
        }
        
        pos = strData.find("![CDATA[{");
        if(pos != std::string::npos)
        {
            size_t endpos = strData.rfind("}]]");
            if (pos != std::string::npos)
            {
                rawConfig = strData.substr(pos + 8, endpos - pos - 7);
            }
            
            resultString = "Logitech Harmony Configuration : \n" + strData.substr(pos + 9);
        }
        if (rawConfig.empty())
        {
            errorString = "Invalid Logitech Harmony Configuration : \n" + strData;
            return 1;
        }
    }
    else if (strCommand == "start_activity" || strCommand == "start_activity_raw")
    {
		
        resultString ="{\"current activity\":" + strCommandParameterPrimary + "}";
        ofstream current("current.json");
        current << ("%s\n\n", resultString.c_str());
    }
	else if (strCommand == "issue_device_command")
	{
		resultString ="";
	}	
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
testq %rdi, %rdi
je 0x539a
cmpq $0x0, 0x8(%rsi)
je 0x539a
movq %r9, %r12
movq %r8, %r13
movq %rcx, %r15
movq %rdx, %rbx
movq %rdi, %r14
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rbp
movq %rbp, %rdi
callq 0x8d32
cmpq $0x0, 0x8(%rbp)
je 0x53c7
leaq 0x38(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x18(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x729c(%rip), %rcx      # 0xc51d
leaq 0x8(%rsp), %rdi
movl $0x13, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x3420
leaq 0x7295(%rip), %rsi      # 0xc531
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x7488(%rip), %rsi      # 0xc735
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x9b49(%rip), %rsi      # 0xee07
leaq 0x48(%rsp), %rdi
callq 0x30f0
testl %eax, %eax
je 0x52e1
leaq 0x9b54(%rip), %rsi      # 0xee27
leaq 0x48(%rsp), %rdi
callq 0x30f0
testl %eax, %eax
jne 0x52f2
leaq 0x74a8(%rip), %rsi      # 0xc790
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x9c35(%rip), %rsi      # 0xef2e
leaq 0x48(%rsp), %rdi
callq 0x30f0
testl %eax, %eax
je 0x5411
leaq 0x74ad(%rip), %rsi      # 0xc7bf
leaq 0x48(%rsp), %rdi
callq 0x30f0
testl %eax, %eax
je 0x53ea
leaq 0x74a3(%rip), %rsi      # 0xc7ce
movq %rbx, %rdi
callq 0x30f0
testl %eax, %eax
je 0x53ea
leaq 0x74d1(%rip), %rsi      # 0xc813
leaq 0x48(%rsp), %rdi
callq 0x30f0
testl %eax, %eax
jne 0x5422
leaq 0x74cd(%rip), %rsi      # 0xc828
leaq 0x8(%rsp), %rdi
callq 0x34f0
movq (%r15), %rsi
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x74e5(%rip), %rsi      # 0xc85e
leaq 0x8(%rsp), %rdi
callq 0x34f0
movq (%r13), %rsi
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x74d5(%rip), %rsi      # 0xc86d
jmp 0x5418
movq 0xef1f(%rip), %rdx      # 0x142c0
leaq 0xef10(%rip), %rdi      # 0x142b8
leaq 0x7343(%rip), %rcx      # 0xc6f2
movl $0x42, %r8d
xorl %esi, %esi
callq 0x3420
movl $0x1, %r14d
jmp 0x56e1
xorl %r14d, %r14d
leaq 0x9a36(%rip), %rcx      # 0xee07
leaq 0x48(%rsp), %rdi
movl $0x17, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x3420
jmp 0x56c5
leaq 0x73f0(%rip), %rsi      # 0xc7e1
leaq 0x8(%rsp), %rdi
callq 0x34f0
movq (%r15), %rsi
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x73ed(%rip), %rsi      # 0xc7fc
jmp 0x5418
leaq 0x7394(%rip), %rsi      # 0xc7ac
leaq 0x8(%rsp), %rdi
callq 0x34f0
movq 0x8(%rsp), %rsi
movl 0x10(%rsp), %edx
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
leaq 0x7b3c(%rip), %rsi      # 0xcf77
movq %r12, %rdi
callq 0x30f0
testl %eax, %eax
je 0x54ea
leaq 0x8(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x70c2(%rip), %rcx      # 0xc51d
movl $0x13, %r8d
xorl %esi, %esi
callq 0x3420
leaq 0x70c2(%rip), %rsi      # 0xc531
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x72b5(%rip), %rsi      # 0xc735
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x7397(%rip), %rsi      # 0xc828
leaq 0x8(%rsp), %rdi
callq 0x34f0
movq (%r15), %rsi
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x73af(%rip), %rsi      # 0xc85e
leaq 0x8(%rsp), %rdi
callq 0x34f0
movq (%r12), %rsi
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x739f(%rip), %rsi      # 0xc86d
leaq 0x8(%rsp), %rdi
callq 0x34f0
movq 0x8(%rsp), %rsi
movl 0x10(%rsp), %edx
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movq 0x2e0(%rsp), %r12
leaq 0x7a7e(%rip), %rsi      # 0xcf77
movq %r12, %rdi
callq 0x30f0
testl %eax, %eax
je 0x55a8
leaq 0x8(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x7004(%rip), %rcx      # 0xc51d
movl $0x13, %r8d
xorl %esi, %esi
callq 0x3420
leaq 0x7004(%rip), %rsi      # 0xc531
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x71f7(%rip), %rsi      # 0xc735
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x72d9(%rip), %rsi      # 0xc828
leaq 0x8(%rsp), %rdi
callq 0x34f0
movq (%r15), %rsi
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x72f1(%rip), %rsi      # 0xc85e
leaq 0x8(%rsp), %rdi
callq 0x34f0
movq (%r12), %rsi
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x72e1(%rip), %rsi      # 0xc86d
leaq 0x8(%rsp), %rdi
callq 0x34f0
movq 0x8(%rsp), %rsi
movl 0x10(%rsp), %edx
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
leaq 0xed91(%rip), %r12      # 0x14340
movl $0xf4240, %edx          # imm = 0xF4240
movq %r12, %rdi
xorl %esi, %esi
callq 0x3190
movq (%r14), %rax
movq %r14, %rdi
movq %r12, %rsi
movl $0xf4240, %edx          # imm = 0xF4240
xorl %ecx, %ecx
callq *(%rax)
leaq 0x28(%rsp), %r12
movq 0x8(%r12), %r13
leaq 0xed5f(%rip), %rbp      # 0x14340
movq %rbp, %rdi
callq 0x3150
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %rbp, %rcx
movq %rax, %r8
callq 0x3420
leaq 0x98(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x6fcf(%rip), %rsi      # 0xc5de
leaq 0x6fcd(%rip), %rdx      # 0xc5e3
leaq 0x88(%rsp), %rdi
callq 0x8dc8
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rcx
leaq 0x28(%rsp), %rdi
xorl %edx, %edx
callq 0x3490
testq %rax, %rax
je 0x56f6
movl $0x1, %r14d
movq 0xec6b(%rip), %rdx      # 0x142c0
leaq 0xec5c(%rip), %rdi      # 0x142b8
leaq 0x7224(%rip), %rcx      # 0xc887
movl $0x27, %r8d
xorl %esi, %esi
callq 0x3420
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x568d
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x56a9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x56c5
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x56e1
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3290
movl %r14d, %eax
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7(%rsp), %rsi
movb $0x0, (%rsi)
movss 0x6902(%rip), %xmm0     # 0xc008
movq %r14, %rdi
callq 0xba60
cmpb $0x0, 0x7(%rsp)
jne 0x572f
leaq 0x6ec2(%rip), %rsi      # 0xc5de
leaq 0x28(%rsp), %rdi
callq 0x30f0
testl %eax, %eax
jne 0x572f
movb $0x1, 0x7(%rsp)
leaq 0x70dd(%rip), %rsi      # 0xc813
movq %rbx, %rdi
callq 0x30f0
testl %eax, %eax
je 0x579b
leaq 0xebf7(%rip), %r12      # 0x14340
leaq 0x28(%rsp), %r13
leaq 0x7(%rsp), %rbp
cmpb $0x1, 0x7(%rsp)
jne 0x579b
movl $0xf4240, %edx          # imm = 0xF4240
movq %r12, %rdi
xorl %esi, %esi
callq 0x3190
movq (%r14), %rax
movq %r14, %rdi
movq %r12, %rsi
movl $0xf4240, %edx          # imm = 0xF4240
xorl %ecx, %ecx
callq *(%rax)
movq %r13, %rdi
movq %r12, %rsi
callq 0x34f0
movq %r14, %rdi
movq %rbp, %rsi
movss 0x6870(%rip), %xmm0     # 0xc004
callq 0xba60
jmp 0x5753
leaq 0xeb36(%rip), %rdi      # 0x142d8
leaq 0x28(%rsp), %rsi
leaq 0x98(%rsp), %r13
callq 0x3180
leaq 0x964c(%rip), %rsi      # 0xee07
movq %rbx, %rdi
callq 0x30f0
testl %eax, %eax
je 0x5870
leaq 0x9655(%rip), %rsi      # 0xee27
movq %rbx, %rdi
callq 0x30f0
testl %eax, %eax
je 0x5870
leaq 0x9732(%rip), %rsi      # 0xef1b
movq %rbx, %rdi
callq 0x30f0
testl %eax, %eax
je 0x59a3
leaq 0x972e(%rip), %rsi      # 0xef2e
movq %rbx, %rdi
callq 0x30f0
testl %eax, %eax
je 0x59a3
leaq 0x6fa8(%rip), %rsi      # 0xc7bf
movq %rbx, %rdi
callq 0x30f0
testl %eax, %eax
je 0x5bf6
leaq 0x6fa0(%rip), %rsi      # 0xc7ce
movq %rbx, %rdi
callq 0x30f0
testl %eax, %eax
je 0x5bf6
leaq 0x6fce(%rip), %rsi      # 0xc813
movq %rbx, %rdi
callq 0x30f0
xorl %r14d, %r14d
testl %eax, %eax
jne 0x5670
leaq 0xea79(%rip), %rdi      # 0x142d8
leaq 0x7711(%rip), %rsi      # 0xcf77
callq 0x3370
jmp 0x5670
leaq 0xea61(%rip), %r12      # 0x142d8
leaq 0x7031(%rip), %rsi      # 0xc8af
xorl %r14d, %r14d
movl $0x7, %ecx
movq %r12, %rdi
xorl %edx, %edx
callq 0x3490
movq %rax, %r15
leaq 0x701d(%rip), %rsi      # 0xc8b7
movl $0x3, %ecx
movq %r12, %rdi
xorl %edx, %edx
callq 0x3490
cmpq $-0x1, %r15
sete %cl
cmpq $-0x1, %rax
sete %dl
orb %cl, %dl
jne 0x5670
subq %r15, %rax
addq $0x7, %r15
addq $-0x7, %rax
leaq 0xea07(%rip), %rsi      # 0x142d8
leaq 0xa8(%rsp), %rdi
movq %r15, %rdx
movq %rax, %rcx
callq 0x32c0
leaq 0xe9ed(%rip), %rdi      # 0x142d8
leaq 0xa8(%rsp), %r14
movq %r14, %rsi
callq 0x3330
movq (%r14), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x591b
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0xe9b6(%rip), %rdi      # 0x142d8
leaq 0x6f92(%rip), %rcx      # 0xc8bb
movl $0x14, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x32f0
leaq 0x94c8(%rip), %rsi      # 0xee07
movq %rbx, %rdi
callq 0x30f0
leaq 0xe98a(%rip), %rdi      # 0x142d8
leaq 0x67a9(%rip), %rsi      # 0xc0fe
callq 0x34f0
leaq 0x6f6f(%rip), %rsi      # 0xc8d0
leaq 0xa8(%rsp), %rdi
movl $0x10, %edx
callq 0x32e0
movq 0xe95e(%rip), %rbx      # 0x142d8
testq %rbx, %rbx
je 0x5b97
movq %rbx, %rdi
callq 0x3150
leaq 0xa8(%rsp), %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x3310
jmp 0x5bb9
leaq 0x7(%rsp), %rsi
movss 0x6654(%rip), %xmm0     # 0xc004
movq %r14, %rdi
callq 0xba60
leaq 0x7(%rsp), %rbx
movb $0x1, (%rbx)
leaq 0xe979(%rip), %r15      # 0x14340
leaq 0x28(%rsp), %r12
cmpb $0x1, 0x7(%rsp)
jne 0x5a14
movl $0xf4240, %edx          # imm = 0xF4240
movq %r15, %rdi
xorl %esi, %esi
callq 0x3190
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
movl $0xf4240, %edx          # imm = 0xF4240
xorl %ecx, %ecx
callq *(%rax)
movq %r12, %rdi
movq %r15, %rsi
callq 0x34f0
movq %r14, %rdi
movq %rbx, %rsi
movss 0x65f7(%rip), %xmm0     # 0xc004
callq 0xba60
jmp 0x59cc
leaq 0x6ec7(%rip), %rsi      # 0xc8e2
xorl %r14d, %r14d
leaq 0x28(%rsp), %rdi
movl $0x9, %ecx
xorl %edx, %edx
callq 0x3490
cmpq $-0x1, %rax
je 0x5b2e
movq %rax, %rbx
leaq 0x6ea9(%rip), %rsi      # 0xc8ec
leaq 0x28(%rsp), %r15
movl $0x3, %ecx
movq %r15, %rdi
movq $-0x1, %rdx
callq 0x3390
leaq 0x8(%rbx), %rdx
subq %rbx, %rax
leaq -0x7(%rax), %rcx
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
callq 0x32c0
leaq 0xe87a(%rip), %rdi      # 0x142f8
leaq 0xa8(%rsp), %r15
movq %r15, %rsi
callq 0x3330
movq (%r15), %rdi
leaq 0xb8(%rsp), %r15
cmpq %r15, %rdi
je 0x5aae
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3290
addq $0x9, %rbx
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movq %rbx, %rdx
movq $-0x1, %rcx
callq 0x32c0
leaq 0x6e26(%rip), %rsi      # 0xc8f8
leaq 0xa8(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x838b
leaq 0xe7ed(%rip), %rdi      # 0x142d8
leaq 0xa8(%rsp), %rbx
movq %rbx, %rsi
callq 0x3330
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x5b13
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5b2e
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3290
cmpq $0x0, 0xe7ca(%rip)      # 0x14300
jne 0x5670
leaq 0x6dad(%rip), %rsi      # 0xc8f0
leaq 0xa8(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x83fb
leaq 0xe75c(%rip), %rdi      # 0x142b8
leaq 0xa8(%rsp), %rbx
movq %rbx, %rsi
callq 0x3330
movq (%rbx), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x5b8c
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3290
movl $0x1, %r14d
jmp 0x5670
movq 0xa8(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%rsp,%rax), %rdi
addq $0xa8, %rdi
movl 0x20(%rdi), %esi
orl $0x1, %esi
callq 0x3470
movq 0xe410(%rip), %rax      # 0x13fd0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0xb0(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0xa8(%rsp,%rcx)
callq 0x3210
leaq 0x1a0(%rsp), %rdi
callq 0x3110
jmp 0x5ced
leaq 0x6cbe(%rip), %rsi      # 0xc8bb
leaq 0x68(%rsp), %rdi
movq %r15, %rdx
callq 0x83fb
leaq 0x64ed(%rip), %rsi      # 0xc0fe
leaq 0x68(%rsp), %rdi
callq 0x34f0
leaq 0xb8(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5c4b
movq %rdx, 0xa8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb8(%rsp)
jmp 0x5c52
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0xa8(%rsp), %rbx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xe660(%rip), %rdi      # 0x142d8
movq %rbx, %rsi
callq 0x3330
movq (%rbx), %rdi
cmpq %r14, %rdi
je 0x5c98
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5cb3
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x6c16(%rip), %rsi      # 0xc8d0
leaq 0xa8(%rsp), %rdi
movl $0x10, %edx
callq 0x32e0
movq 0xe605(%rip), %rsi      # 0x142d8
leaq 0xa8(%rsp), %rdi
callq 0x3260
leaq 0xa8(%rsp), %rdi
callq 0x33f0
xorl %r14d, %r14d
jmp 0x5670
jmp 0x5d4d
jmp 0x5d23
jmp 0x5d4d
jmp 0x5cff
jmp 0x5d4d
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5d50
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x5d50
jmp 0x5d4d
jmp 0x5d4d
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x33f0
jmp 0x5d50
jmp 0x5d4d
jmp 0x5d4d
jmp 0x5d4d
movq %rax, %rbx
jmp 0x5dad
jmp 0x5d4d
jmp 0x5d4d
jmp 0x5d48
jmp 0x5d4d
movq %rax, %rbx
jmp 0x5d75
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x5d75
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x5d91
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x5dad
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x5dc9
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3290
movq %rbx, %rdi
callq 0x34a0