// File: /workspace/github_cpp_makefile_star2_O1/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 0x4da6
cmpq $0x0, 0x8(%rsi)
je 0x4da6
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 0x87b6
movq 0x8(%rbp), %rdx
testq %rdx, %rdx
je 0x4dd3
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 0x7890(%rip), %rcx      # 0xc51d
leaq 0x8(%rsp), %rdi
movl $0x13, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x3420
leaq 0x7889(%rip), %rsi      # 0xc531
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x7a7c(%rip), %rsi      # 0xc735
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0xa13d(%rip), %rsi      # 0xee07
leaq 0x48(%rsp), %rdi
callq 0x30f0
testl %eax, %eax
je 0x4ced
leaq 0xa148(%rip), %rsi      # 0xee27
leaq 0x48(%rsp), %rdi
callq 0x30f0
testl %eax, %eax
jne 0x4cfe
leaq 0x7a9c(%rip), %rsi      # 0xc790
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0xa229(%rip), %rsi      # 0xef2e
leaq 0x48(%rsp), %rdi
callq 0x30f0
testl %eax, %eax
je 0x4e1b
leaq 0x7aa1(%rip), %rsi      # 0xc7bf
leaq 0x48(%rsp), %rdi
callq 0x30f0
testl %eax, %eax
je 0x4df4
leaq 0x7a97(%rip), %rsi      # 0xc7ce
movq %rbx, %rdi
callq 0x30f0
testl %eax, %eax
je 0x4df4
leaq 0x7ac5(%rip), %rsi      # 0xc813
leaq 0x48(%rsp), %rdi
callq 0x30f0
testl %eax, %eax
jne 0x4e2c
leaq 0x7ac1(%rip), %rsi      # 0xc828
leaq 0x8(%rsp), %rdi
callq 0x34f0
movq (%r15), %rsi
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x7ad9(%rip), %rsi      # 0xc85e
leaq 0x8(%rsp), %rdi
callq 0x34f0
movq (%r13), %rsi
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x7ac9(%rip), %rsi      # 0xc86d
jmp 0x4e22
movq 0xf513(%rip), %rdx      # 0x142c0
leaq 0xf504(%rip), %rdi      # 0x142b8
leaq 0x7937(%rip), %rcx      # 0xc6f2
movl $0x42, %r8d
xorl %esi, %esi
callq 0x3420
movl $0x1, %r14d
jmp 0x50eb
xorl %r14d, %r14d
leaq 0xa02a(%rip), %rcx      # 0xee07
leaq 0x48(%rsp), %rdi
movl $0x17, %r8d
xorl %esi, %esi
callq 0x3420
jmp 0x50cf
leaq 0x79e6(%rip), %rsi      # 0xc7e1
leaq 0x8(%rsp), %rdi
callq 0x34f0
movq (%r15), %rsi
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x79e3(%rip), %rsi      # 0xc7fc
jmp 0x4e22
leaq 0x798a(%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 0x8132(%rip), %rsi      # 0xcf77
movq %r12, %rdi
callq 0x30f0
testl %eax, %eax
je 0x4ef4
leaq 0x8(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x76b8(%rip), %rcx      # 0xc51d
movl $0x13, %r8d
xorl %esi, %esi
callq 0x3420
leaq 0x76b8(%rip), %rsi      # 0xc531
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x78ab(%rip), %rsi      # 0xc735
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x798d(%rip), %rsi      # 0xc828
leaq 0x8(%rsp), %rdi
callq 0x34f0
movq (%r15), %rsi
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x79a5(%rip), %rsi      # 0xc85e
leaq 0x8(%rsp), %rdi
callq 0x34f0
movq (%r12), %rsi
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x7995(%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 0x8074(%rip), %rsi      # 0xcf77
movq %r12, %rdi
callq 0x30f0
testl %eax, %eax
je 0x4fb2
leaq 0x8(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x75fa(%rip), %rcx      # 0xc51d
movl $0x13, %r8d
xorl %esi, %esi
callq 0x3420
leaq 0x75fa(%rip), %rsi      # 0xc531
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x77ed(%rip), %rsi      # 0xc735
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x78cf(%rip), %rsi      # 0xc828
leaq 0x8(%rsp), %rdi
callq 0x34f0
movq (%r15), %rsi
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x78e7(%rip), %rsi      # 0xc85e
leaq 0x8(%rsp), %rdi
callq 0x34f0
movq (%r12), %rsi
leaq 0x8(%rsp), %rdi
callq 0x34f0
leaq 0x78d7(%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 0xf387(%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 0xf355(%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 0x75c5(%rip), %rsi      # 0xc5de
leaq 0x75c3(%rip), %rdx      # 0xc5e3
leaq 0x88(%rsp), %rdi
callq 0x8846
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rcx
leaq 0x28(%rsp), %rdi
xorl %edx, %edx
callq 0x3490
testq %rax, %rax
je 0x5100
movl $0x1, %r14d
movq 0xf261(%rip), %rdx      # 0x142c0
leaq 0xf252(%rip), %rdi      # 0x142b8
leaq 0x781a(%rip), %rcx      # 0xc887
movl $0x27, %r8d
xorl %esi, %esi
callq 0x3420
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x5097
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x50b3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x50cf
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x50eb
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 0x6ef8(%rip), %xmm0     # 0xc008
movq %r14, %rdi
callq 0xbce0
cmpb $0x0, 0x7(%rsp)
jne 0x5139
leaq 0x74b8(%rip), %rsi      # 0xc5de
leaq 0x28(%rsp), %rdi
callq 0x30f0
testl %eax, %eax
jne 0x5139
movb $0x1, 0x7(%rsp)
leaq 0x76d3(%rip), %rsi      # 0xc813
movq %rbx, %rdi
callq 0x30f0
testl %eax, %eax
je 0x51a5
leaq 0xf1ed(%rip), %r12      # 0x14340
leaq 0x28(%rsp), %r13
leaq 0x7(%rsp), %rbp
cmpb $0x1, 0x7(%rsp)
jne 0x51a5
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 0x6e66(%rip), %xmm0     # 0xc004
callq 0xbce0
jmp 0x515d
leaq 0xf12c(%rip), %rdi      # 0x142d8
leaq 0x28(%rsp), %rsi
leaq 0x98(%rsp), %r13
callq 0x3180
leaq 0x9c42(%rip), %rsi      # 0xee07
movq %rbx, %rdi
callq 0x30f0
testl %eax, %eax
je 0x527a
leaq 0x9c4b(%rip), %rsi      # 0xee27
movq %rbx, %rdi
callq 0x30f0
testl %eax, %eax
je 0x527a
leaq 0x9d28(%rip), %rsi      # 0xef1b
movq %rbx, %rdi
callq 0x30f0
testl %eax, %eax
je 0x53ad
leaq 0x9d24(%rip), %rsi      # 0xef2e
movq %rbx, %rdi
callq 0x30f0
testl %eax, %eax
je 0x53ad
leaq 0x759e(%rip), %rsi      # 0xc7bf
movq %rbx, %rdi
callq 0x30f0
testl %eax, %eax
je 0x5600
leaq 0x7596(%rip), %rsi      # 0xc7ce
movq %rbx, %rdi
callq 0x30f0
testl %eax, %eax
je 0x5600
leaq 0x75c4(%rip), %rsi      # 0xc813
movq %rbx, %rdi
callq 0x30f0
xorl %r14d, %r14d
testl %eax, %eax
jne 0x507a
leaq 0xf06f(%rip), %rdi      # 0x142d8
leaq 0x7d07(%rip), %rsi      # 0xcf77
callq 0x3370
jmp 0x507a
leaq 0xf057(%rip), %r12      # 0x142d8
leaq 0x7627(%rip), %rsi      # 0xc8af
xorl %r14d, %r14d
movl $0x7, %ecx
movq %r12, %rdi
xorl %edx, %edx
callq 0x3490
movq %rax, %r15
leaq 0x7613(%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 0x507a
subq %r15, %rax
addq $0x7, %r15
addq $-0x7, %rax
leaq 0xeffd(%rip), %rsi      # 0x142d8
leaq 0xa8(%rsp), %rdi
movq %r15, %rdx
movq %rax, %rcx
callq 0x32c0
leaq 0xefe3(%rip), %rdi      # 0x142d8
leaq 0xa8(%rsp), %r14
movq %r14, %rsi
callq 0x3330
movq (%r14), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x5325
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0xefac(%rip), %rdi      # 0x142d8
leaq 0x7588(%rip), %rcx      # 0xc8bb
movl $0x14, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x32f0
leaq 0x9abe(%rip), %rsi      # 0xee07
movq %rbx, %rdi
callq 0x30f0
leaq 0xef80(%rip), %rdi      # 0x142d8
leaq 0x6d9f(%rip), %rsi      # 0xc0fe
callq 0x34f0
leaq 0x7565(%rip), %rsi      # 0xc8d0
leaq 0xa8(%rsp), %rdi
movl $0x10, %edx
callq 0x32e0
movq 0xef54(%rip), %rbx      # 0x142d8
testq %rbx, %rbx
je 0x55a1
movq %rbx, %rdi
callq 0x3150
leaq 0xa8(%rsp), %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x3310
jmp 0x55c3
leaq 0x7(%rsp), %rsi
movss 0x6c4a(%rip), %xmm0     # 0xc004
movq %r14, %rdi
callq 0xbce0
leaq 0x7(%rsp), %rbx
movb $0x1, (%rbx)
leaq 0xef6f(%rip), %r15      # 0x14340
leaq 0x28(%rsp), %r12
cmpb $0x1, 0x7(%rsp)
jne 0x541e
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 0x6bed(%rip), %xmm0     # 0xc004
callq 0xbce0
jmp 0x53d6
leaq 0x74bd(%rip), %rsi      # 0xc8e2
xorl %r14d, %r14d
leaq 0x28(%rsp), %rdi
movl $0x9, %ecx
xorl %edx, %edx
callq 0x3490
cmpq $-0x1, %rax
je 0x5538
movq %rax, %rbx
leaq 0x749f(%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 0xee70(%rip), %rdi      # 0x142f8
leaq 0xa8(%rsp), %r15
movq %r15, %rsi
callq 0x3330
movq (%r15), %rdi
leaq 0xb8(%rsp), %r15
cmpq %r15, %rdi
je 0x54b8
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 0x741c(%rip), %rsi      # 0xc8f8
leaq 0xa8(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x7e21
leaq 0xede3(%rip), %rdi      # 0x142d8
leaq 0xa8(%rsp), %rbx
movq %rbx, %rsi
callq 0x3330
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x551d
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5538
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3290
cmpq $0x0, 0xedc0(%rip)      # 0x14300
jne 0x507a
leaq 0x73a3(%rip), %rsi      # 0xc8f0
leaq 0xa8(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x7e91
leaq 0xed52(%rip), %rdi      # 0x142b8
leaq 0xa8(%rsp), %rbx
movq %rbx, %rsi
callq 0x3330
movq (%rbx), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x5596
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3290
movl $0x1, %r14d
jmp 0x507a
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 0xea06(%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 0x56f7
leaq 0x72b4(%rip), %rsi      # 0xc8bb
leaq 0x68(%rsp), %rdi
movq %r15, %rdx
callq 0x7e91
leaq 0x6ae3(%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 0x5655
movq %rdx, 0xa8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb8(%rsp)
jmp 0x565c
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 0xec56(%rip), %rdi      # 0x142d8
movq %rbx, %rsi
callq 0x3330
movq (%rbx), %rdi
cmpq %r14, %rdi
je 0x56a2
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x56bd
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x720c(%rip), %rsi      # 0xc8d0
leaq 0xa8(%rsp), %rdi
movl $0x10, %edx
callq 0x32e0
movq 0xebfb(%rip), %rsi      # 0x142d8
leaq 0xa8(%rsp), %rdi
callq 0x3260
leaq 0xa8(%rsp), %rdi
callq 0x33f0
xorl %r14d, %r14d
jmp 0x507a
jmp 0x5757
jmp 0x572d
jmp 0x5757
jmp 0x5709
jmp 0x5757
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x575a
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x575a
jmp 0x5757
jmp 0x5757
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x33f0
jmp 0x575a
jmp 0x5757
jmp 0x5757
jmp 0x5757
movq %rax, %rbx
jmp 0x57b7
jmp 0x5757
jmp 0x5757
jmp 0x5752
jmp 0x5757
movq %rax, %rbx
jmp 0x577f
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x577f
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x579b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x57b7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x57d3
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3290
movq %rbx, %rdi
callq 0x34a0