// File: gulamf[P]NRF24LE1Flash/src/HexUtils.cpp
// Function: HexUtils::ParseHexFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
vector<HexRecord> *HexUtils::ParseHexFile(string fileName, string &debugInfo)
{
    ifstream *streamReader;
    uint numHexRecords = 0;
    HexRecord curHexRecord;
    vector<HexRecord> *hexRecords = new vector<HexRecord>();

    try
    {
        streamReader = new ifstream(fileName.c_str());
    }
    catch (...)
    {
        return NULL;
    }

    debugInfo = "";

    if (!streamReader->is_open()) return NULL;

    while (!streamReader->eof())
    {
        char line[4096];
        debugInfo += ToString(numHexRecords + 1) + ") ";
        line[0]=0;
        streamReader->getline(line,4096);
        if(streamReader->eof() && line[0]==0)
            break;
        if(strcmp(line,":00000001FF")==0) {
            int y;
            y++;
        }
        curHexRecord.rawStr =  line;
        debugInfo += curHexRecord.rawStr;
        debugInfo += "\r\n";

        if (curHexRecord.rawStr[0] != ':')
        {
            debugInfo += "\tInvalid Record\r\n";
        }
        else
        {
            debugInfo += "\tValid Record\r\n";
        }

        curHexRecord.len = ParseHex<int>(curHexRecord.rawStr.substr(1, 2));
        debugInfo += "\tLength: 0x" + ToHexString(curHexRecord.len) + "\r\n";

        curHexRecord.address = ParseHex<int>(curHexRecord.rawStr.substr(3, 4));
        debugInfo += "\tAddress: 0x" + ToHexString(curHexRecord.address) + "\r\n";

        curHexRecord.type = ParseHex<int>(curHexRecord.rawStr.substr(7, 2));

        debugInfo += "\tType: 0x" + ToHexString(curHexRecord.type);

        switch (curHexRecord.type)
        {
            case 0:
                debugInfo += " (Data record)\r\n";
                break;
            case 1:
                debugInfo += " (End of file record)\r\n";
                break;
            case 2:
                debugInfo += " (Extended segment address record)\r\n";
                break;
            case 3:
                debugInfo += " (Start segment address record)\r\n";
                break;
            case 4:
                debugInfo += " (Extended linear address record)\r\n";
                break;
            case 5:
                debugInfo += " (Start linear address record)\r\n";
                break;
            default:
                debugInfo += " (Unknown record type)\r\n";
                break;
        }

        if (curHexRecord.len > 0)
        {
            curHexRecord.data = new uint8_t[curHexRecord.len];
            debugInfo += "\tData: 0x";

            for (uint x = 0; x < curHexRecord.len; x++)
            {
                string s = curHexRecord.rawStr.substr(9 + (x * 2), 2);
                uint8_t t = ParseHex<uint8_t>(s);
                curHexRecord.data[x]=t;

                if (curHexRecord.data[x] < 0x10)
                    debugInfo += "0";

                debugInfo += ToHexString(curHexRecord.data[x]);
            }

            debugInfo += "\r\n";
        }
        else
        {
            debugInfo += "\tNo data\r\n";
        }

        curHexRecord.checkSum = ParseHex<int>(curHexRecord.rawStr.substr(9 + (curHexRecord.len * 2), 2));
        debugInfo += "\tRecord checksum: 0x" + ToHexString(curHexRecord.checkSum) + "\r\n";

        curHexRecord.calcSum = 0;

        for (uint x = 1; x < 9 + (curHexRecord.len * 2); x += 2)
        {
            curHexRecord.calcSum += ParseHex<int>(curHexRecord.rawStr.substr(x, 2));
        }

        curHexRecord.calcSum = -curHexRecord.calcSum;
        curHexRecord.calcSum &= 0xFF;

        debugInfo += "\tCalculated checksum: 0x" + ToHexString(curHexRecord.calcSum) + "\r\n";

        if (curHexRecord.calcSum == curHexRecord.checkSum)
        {
            debugInfo += "\tChecksums match\r\n\r\n";
        }
        else
        {
            debugInfo += "\tChecksums do not match\r\n\r\n";
            return NULL;
        }

        hexRecords->push_back(curHexRecord);
        numHexRecords++;
    }

    streamReader->close();

    return hexRecords;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x13e0, %rsp           # imm = 0x13E0
movq %rdi, -0x1390(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x8830
movl $0x18, %edi
callq 0x32b0
movq %rax, -0x1388(%rbp)
jmp 0x7c4d
movq -0x1388(%rbp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
callq 0x8850
movq -0x1388(%rbp), %rax
movq %rax, -0x68(%rbp)
movl $0x208, %edi            # imm = 0x208
callq 0x32b0
movq %rax, -0x1398(%rbp)
jmp 0x7c85
movq -0x1390(%rbp), %rdi
callq 0x3160
movq -0x1398(%rbp), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0x34f0
jmp 0x7ca7
movq -0x1398(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x7d14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x8813
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x7cf0
movq -0x1398(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
movl $0x208, %esi            # imm = 0x208
callq 0x32c0
movq -0x70(%rbp), %rdi
callq 0x3150
movq $0x0, -0x8(%rbp)
movl $0x1, -0x78(%rbp)
callq 0x3480
jmp 0x7d0f
jmp 0x87fd
movq -0x18(%rbp), %rdi
leaq 0x2d78(%rip), %rsi      # 0xaa97
callq 0x33c0
jmp 0x7d26
movq -0x20(%rbp), %rdi
callq 0x3470
movb %al, -0x1399(%rbp)
jmp 0x7d37
movb -0x1399(%rbp), %al
testb $0x1, %al
jne 0x7d57
jmp 0x7d43
movq $0x0, -0x8(%rbp)
movl $0x1, -0x78(%rbp)
jmp 0x87fd
jmp 0x7d59
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3500
movb %al, -0x139a(%rbp)
jmp 0x7d74
movb -0x139a(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x7d85
jmp 0x87e3
movl -0x24(%rbp), %eax
incl %eax
movl %eax, -0x10c4(%rbp)
leaq -0x10c0(%rbp), %rdi
leaq -0x10c4(%rbp), %rsi
callq 0x8870
jmp 0x7da5
leaq 0x2b72(%rip), %rdx      # 0xa91e
leaq -0x10a0(%rbp), %rdi
leaq -0x10c0(%rbp), %rsi
callq 0x7530
jmp 0x7dc1
movq -0x18(%rbp), %rdi
leaq -0x10a0(%rbp), %rsi
callq 0x3390
jmp 0x7dd3
leaq -0x10a0(%rbp), %rdi
callq 0x3568
leaq -0x10c0(%rbp), %rdi
callq 0x3568
movb $0x0, -0x1080(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x1080(%rbp), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x30f0
jmp 0x7e09
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x3500
movb %al, -0x139b(%rbp)
jmp 0x7e24
movb -0x139b(%rbp), %al
testb $0x1, %al
jne 0x7e30
jmp 0x7e78
movsbl -0x1080(%rbp), %eax
cmpl $0x0, %eax
jne 0x7e78
jmp 0x87e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x7e67
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x10a0(%rbp), %rdi
callq 0x3568
leaq -0x10c0(%rbp), %rdi
callq 0x3568
jmp 0x8813
leaq -0x1080(%rbp), %rdi
leaq 0x2a9b(%rip), %rsi      # 0xa921
callq 0x33e0
cmpl $0x0, %eax
jne 0x7e9f
movl -0x10c8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10c8(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x1080(%rbp), %rsi
callq 0x33c0
jmp 0x7eb1
movq -0x18(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x3390
jmp 0x7ec0
movq -0x18(%rbp), %rdi
leaq 0x2bca(%rip), %rsi      # 0xaa95
callq 0x3290
jmp 0x7ed2
xorl %eax, %eax
movl %eax, %esi
leaq -0x60(%rbp), %rdi
callq 0x3540
movq %rax, -0x13a8(%rbp)
jmp 0x7ee8
movq -0x13a8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
je 0x7f0b
movq -0x18(%rbp), %rdi
leaq 0x2a2b(%rip), %rsi      # 0xa92d
callq 0x3290
jmp 0x7f09
jmp 0x7f1f
movq -0x18(%rbp), %rdi
leaq 0x2a29(%rip), %rsi      # 0xa93f
callq 0x3290
jmp 0x7f1d
jmp 0x7f1f
leaq -0x10e8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x1, %edx
movl $0x2, %ecx
callq 0x32e0
jmp 0x7f3b
leaq -0x10e8(%rbp), %rdi
callq 0x8920
movl %eax, -0x13ac(%rbp)
jmp 0x7f4f
movl -0x13ac(%rbp), %eax
movw %ax, -0x40(%rbp)
leaq -0x10e8(%rbp), %rdi
callq 0x3568
movzwl -0x40(%rbp), %esi
leaq -0x1148(%rbp), %rdi
callq 0x9700
jmp 0x7f77
leaq 0x29d1(%rip), %rsi      # 0xa94f
leaq -0x1128(%rbp), %rdi
leaq -0x1148(%rbp), %rdx
callq 0x7590
jmp 0x7f93
leaq 0x2afb(%rip), %rdx      # 0xaa95
leaq -0x1108(%rbp), %rdi
leaq -0x1128(%rbp), %rsi
callq 0x7530
jmp 0x7faf
movq -0x18(%rbp), %rdi
leaq -0x1108(%rbp), %rsi
callq 0x3390
jmp 0x7fc1
leaq -0x1108(%rbp), %rdi
callq 0x3568
leaq -0x1128(%rbp), %rdi
callq 0x3568
leaq -0x1148(%rbp), %rdi
callq 0x3568
leaq -0x1168(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x3, %edx
movl $0x4, %ecx
callq 0x32e0
jmp 0x8001
leaq -0x1168(%rbp), %rdi
callq 0x8920
movl %eax, -0x13b0(%rbp)
jmp 0x8015
movl -0x13b0(%rbp), %eax
movw %ax, -0x3e(%rbp)
leaq -0x1168(%rbp), %rdi
callq 0x3568
movzwl -0x3e(%rbp), %esi
leaq -0x11c8(%rbp), %rdi
callq 0x9700
jmp 0x803d
leaq 0x2917(%rip), %rsi      # 0xa95b
leaq -0x11a8(%rbp), %rdi
leaq -0x11c8(%rbp), %rdx
callq 0x7590
jmp 0x8059
leaq 0x2a35(%rip), %rdx      # 0xaa95
leaq -0x1188(%rbp), %rdi
leaq -0x11a8(%rbp), %rsi
callq 0x7530
jmp 0x8075
movq -0x18(%rbp), %rdi
leaq -0x1188(%rbp), %rsi
callq 0x3390
jmp 0x8087
leaq -0x1188(%rbp), %rdi
callq 0x3568
leaq -0x11a8(%rbp), %rdi
callq 0x3568
leaq -0x11c8(%rbp), %rdi
callq 0x3568
leaq -0x11e8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x7, %edx
movl $0x2, %ecx
callq 0x32e0
jmp 0x80c7
leaq -0x11e8(%rbp), %rdi
callq 0x8920
movl %eax, -0x13b4(%rbp)
jmp 0x80db
movl -0x13b4(%rbp), %eax
movw %ax, -0x3c(%rbp)
leaq -0x11e8(%rbp), %rdi
callq 0x3568
movzwl -0x3c(%rbp), %esi
leaq -0x1228(%rbp), %rdi
callq 0x9700
jmp 0x8103
leaq 0x285e(%rip), %rsi      # 0xa968
leaq -0x1208(%rbp), %rdi
leaq -0x1228(%rbp), %rdx
callq 0x7590
jmp 0x811f
movq -0x18(%rbp), %rdi
leaq -0x1208(%rbp), %rsi
callq 0x3390
jmp 0x8131
leaq -0x1208(%rbp), %rdi
callq 0x3568
leaq -0x1228(%rbp), %rdi
callq 0x3568
movzwl -0x3c(%rbp), %eax
movq %rax, -0x13c0(%rbp)
subq $0x5, %rax
ja 0x831d
movq -0x13c0(%rbp), %rax
leaq 0x2790(%rip), %rcx      # 0xa8fc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x10e8(%rbp), %rdi
callq 0x3568
jmp 0x8813
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x81d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x81c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x1108(%rbp), %rdi
callq 0x3568
leaq -0x1128(%rbp), %rdi
callq 0x3568
leaq -0x1148(%rbp), %rdi
callq 0x3568
jmp 0x8813
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x1168(%rbp), %rdi
callq 0x3568
jmp 0x8813
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x8240
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x8234
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x1188(%rbp), %rdi
callq 0x3568
leaq -0x11a8(%rbp), %rdi
callq 0x3568
leaq -0x11c8(%rbp), %rdi
callq 0x3568
jmp 0x8813
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x11e8(%rbp), %rdi
callq 0x3568
jmp 0x8813
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x8294
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x1208(%rbp), %rdi
callq 0x3568
leaq -0x1228(%rbp), %rdi
callq 0x3568
jmp 0x8813
movq -0x18(%rbp), %rdi
leaq 0x26c2(%rip), %rsi      # 0xa972
callq 0x3290
jmp 0x82b7
jmp 0x8331
movq -0x18(%rbp), %rdi
leaq 0x26bf(%rip), %rsi      # 0xa983
callq 0x3290
jmp 0x82cb
jmp 0x8331
movq -0x18(%rbp), %rdi
leaq 0x26c3(%rip), %rsi      # 0xa99b
callq 0x3290
jmp 0x82df
jmp 0x8331
movq -0x18(%rbp), %rdi
leaq 0x26d4(%rip), %rsi      # 0xa9c0
callq 0x3290
jmp 0x82f3
jmp 0x8331
movq -0x18(%rbp), %rdi
leaq 0x26e2(%rip), %rsi      # 0xa9e2
callq 0x3290
jmp 0x8307
jmp 0x8331
movq -0x18(%rbp), %rdi
leaq 0x26f2(%rip), %rsi      # 0xaa06
callq 0x3290
jmp 0x831b
jmp 0x8331
movq -0x18(%rbp), %rdi
leaq 0x26ff(%rip), %rsi      # 0xaa27
callq 0x3290
jmp 0x832f
jmp 0x8331
movzwl -0x40(%rbp), %eax
cmpl $0x0, %eax
jle 0x84af
movzwl -0x40(%rbp), %eax
movl %eax, %edi
callq 0x3030
movq %rax, -0x13c8(%rbp)
jmp 0x8352
movq -0x13c8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x26d8(%rip), %rsi      # 0xaa40
callq 0x3290
jmp 0x836f
movl $0x0, -0x122c(%rbp)
movl -0x122c(%rbp), %eax
movzwl -0x40(%rbp), %ecx
cmpl %ecx, %eax
jae 0x849b
movl -0x122c(%rbp), %ecx
movl %ecx, %eax
leal 0x9(%rax,%rax), %eax
movl %eax, %edx
leaq -0x1250(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x2, %ecx
callq 0x32e0
jmp 0x83b0
leaq -0x1250(%rbp), %rdi
callq 0x8a20
movb %al, -0x13c9(%rbp)
jmp 0x83c4
movb -0x13c9(%rbp), %al
movb %al, -0x1251(%rbp)
movb -0x1251(%rbp), %dl
movq -0x38(%rbp), %rax
movl -0x122c(%rbp), %ecx
movb %dl, (%rax,%rcx)
movq -0x38(%rbp), %rax
movl -0x122c(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x10, %eax
jge 0x8418
movq -0x18(%rbp), %rdi
leaq 0x1ea0(%rip), %rsi      # 0xa2a1
callq 0x3290
jmp 0x8408
jmp 0x8418
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x848a
movq -0x38(%rbp), %rax
movl -0x122c(%rbp), %ecx
movzbl (%rax,%rcx), %esi
leaq -0x1278(%rbp), %rdi
callq 0x9700
jmp 0x8434
movq -0x18(%rbp), %rdi
leaq -0x1278(%rbp), %rsi
callq 0x3390
jmp 0x8446
leaq -0x1278(%rbp), %rdi
callq 0x3568
leaq -0x1250(%rbp), %rdi
callq 0x3568
movl -0x122c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x122c(%rbp)
jmp 0x8379
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x1278(%rbp), %rdi
callq 0x3568
leaq -0x1250(%rbp), %rdi
callq 0x3568
jmp 0x8813
movq -0x18(%rbp), %rdi
leaq 0x25ef(%rip), %rsi      # 0xaa95
callq 0x3290
jmp 0x84ad
jmp 0x84c3
movq -0x18(%rbp), %rdi
leaq 0x2590(%rip), %rsi      # 0xaa4a
callq 0x3290
jmp 0x84c1
jmp 0x84c3
movzwl -0x40(%rbp), %ecx
movl %ecx, %eax
leal 0x9(%rax,%rax), %eax
movl %eax, %edx
leaq -0x1298(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x2, %ecx
callq 0x32e0
jmp 0x84e6
leaq -0x1298(%rbp), %rdi
callq 0x8920
movl %eax, -0x13d0(%rbp)
jmp 0x84fa
movl -0x13d0(%rbp), %eax
movw %ax, -0x30(%rbp)
leaq -0x1298(%rbp), %rdi
callq 0x3568
movzwl -0x30(%rbp), %esi
leaq -0x12f8(%rbp), %rdi
callq 0x9700
jmp 0x8522
leaq 0x252c(%rip), %rsi      # 0xaa55
leaq -0x12d8(%rbp), %rdi
leaq -0x12f8(%rbp), %rdx
callq 0x7590
jmp 0x853e
leaq 0x2550(%rip), %rdx      # 0xaa95
leaq -0x12b8(%rbp), %rdi
leaq -0x12d8(%rbp), %rsi
callq 0x7530
jmp 0x855a
movq -0x18(%rbp), %rdi
leaq -0x12b8(%rbp), %rsi
callq 0x3390
jmp 0x856c
leaq -0x12b8(%rbp), %rdi
callq 0x3568
leaq -0x12d8(%rbp), %rdi
callq 0x3568
leaq -0x12f8(%rbp), %rdi
callq 0x3568
movw $0x0, -0x2e(%rbp)
movl $0x1, -0x12fc(%rbp)
movl -0x12fc(%rbp), %eax
movzwl -0x40(%rbp), %ecx
shll %ecx
addl $0x9, %ecx
cmpl %ecx, %eax
jae 0x86a2
movl -0x12fc(%rbp), %eax
movl %eax, %edx
leaq -0x1320(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x2, %ecx
callq 0x32e0
jmp 0x85d6
leaq -0x1320(%rbp), %rdi
callq 0x8920
movl %eax, -0x13d4(%rbp)
jmp 0x85ea
movl -0x13d4(%rbp), %ecx
movzwl -0x2e(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x2e(%rbp)
leaq -0x1320(%rbp), %rdi
callq 0x3568
movl -0x12fc(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x12fc(%rbp)
jmp 0x85a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x1298(%rbp), %rdi
callq 0x3568
jmp 0x8813
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x8674
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x8668
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x12b8(%rbp), %rdi
callq 0x3568
leaq -0x12d8(%rbp), %rdi
callq 0x3568
leaq -0x12f8(%rbp), %rdi
callq 0x3568
jmp 0x8813
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x1320(%rbp), %rdi
callq 0x3568
jmp 0x8813
movw -0x2e(%rbp), %ax
negw %ax
movw %ax, -0x2e(%rbp)
movzbl -0x2e(%rbp), %eax
movw %ax, -0x2e(%rbp)
movzwl -0x2e(%rbp), %esi
leaq -0x1380(%rbp), %rdi
callq 0x9700
jmp 0x86c7
leaq 0x239c(%rip), %rsi      # 0xaa6a
leaq -0x1360(%rbp), %rdi
leaq -0x1380(%rbp), %rdx
callq 0x7590
jmp 0x86e3
leaq 0x23ab(%rip), %rdx      # 0xaa95
leaq -0x1340(%rbp), %rdi
leaq -0x1360(%rbp), %rsi
callq 0x7530
jmp 0x86ff
movq -0x18(%rbp), %rdi
leaq -0x1340(%rbp), %rsi
callq 0x3390
jmp 0x8711
leaq -0x1340(%rbp), %rdi
callq 0x3568
leaq -0x1360(%rbp), %rdi
callq 0x3568
leaq -0x1380(%rbp), %rdi
callq 0x3568
movzwl -0x2e(%rbp), %eax
movzwl -0x30(%rbp), %ecx
cmpl %ecx, %eax
jne 0x87a3
movq -0x18(%rbp), %rdi
leaq 0x2337(%rip), %rsi      # 0xaa83
callq 0x3290
jmp 0x8753
jmp 0x87c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x8795
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x8789
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x1340(%rbp), %rdi
callq 0x3568
leaq -0x1360(%rbp), %rdi
callq 0x3568
leaq -0x1380(%rbp), %rdi
callq 0x3568
jmp 0x8813
movq -0x18(%rbp), %rdi
leaq 0x22ea(%rip), %rsi      # 0xaa98
callq 0x3290
jmp 0x87b5
movq $0x0, -0x8(%rbp)
movl $0x1, -0x78(%rbp)
jmp 0x87fd
movq -0x68(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x8b20
jmp 0x87d5
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x7d59
movq -0x20(%rbp), %rdi
callq 0x30a0
jmp 0x87ee
movq -0x68(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x78(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x7750
movq -0x8(%rbp), %rax
addq $0x13e0, %rsp           # imm = 0x13E0
popq %rbp
retq
leaq -0x60(%rbp), %rdi
callq 0x7750
movq -0x70(%rbp), %rdi
callq 0x34c0
nopw %cs:(%rax,%rax)
nop