// File: /workspace/github_cpp_makefile_star2_O1/helchr[P]reMap/main.cpp
// Function: main
int main(int argc, char *argv[])
{

    int opt;
    bool verbose = false;
    bool considerTadRegions = false;
    unsigned int sizeGb = 20;
    size_t numAddressTotal = 1000;
    size_t numAccess = 2000;
    while ((opt = getopt(argc, argv, "vrs:n:a:")) != -1)
    {
        switch (opt)
        {
        case 'v': verbose=true; break;
        case 'r': considerTadRegions = true; break;
        case 's': sizeGb = atoi(optarg); break;
        case 'n': numAddressTotal = atoi(optarg); break;
        case 'a': numAccess = atoi(optarg); break;

        default:
            std::cout <<"Usage: " << argv[0] <<"\n"
                     << "[-v] Verbose output\n"
                     << "[-r] Resolve addressing function assuming multiple TAD regions\n"
                     << "[-s <memPoolSize>]\n"
                     << "[-n <number of samples collected>]\n"
                     << "[-a <number of accesses for one component test>]\n"
                     << "Must be run as root to resolve physical addresses\n"
                     << "Must be pinned to one socket and its local memory\n";
            exit(EXIT_FAILURE);
        }
    }

    unsigned int nodeid;
    unsigned int cpuid;
    auto status = syscall(SYS_getcpu, &cpuid, &nodeid, nullptr);
    if(status == -1)
    {
        cout << "Can not determine node id" << endl;
        return EXIT_FAILURE;
    }
    if(verbose) cout << "Running on socket " << nodeid << endl;

    initPagemap();
    const uint64_t size = sizeGb * 1024 * 1024 * 1024ULL;
    auto space = (uint64_t) allocate(size);
    if(space == 0)
    {
        return EXIT_FAILURE;
    }
    srand(3344);

    std::set<uint64_t> usedAddresses;
    std::map<size_t,std::vector<uint64_t>>channelAddresses;
    std::map<size_t,std::vector<uint64_t>>rankAddresses;
    std::map<size_t,std::vector<uint64_t>>bankAddresses;
    std::map<size_t,std::vector<uint64_t>>bankGroupAddresses;



    cout << "Collecting address samples ..." << endl;
    auto adr=space;
    while(usedAddresses.size() < numAddressTotal)
    {
        adr = getNextAddress(adr,space,size);
        auto physicalAddress = getPhysicalAddr(adr);
        if(verbose) cout << bitset<64>(physicalAddress);
        if(usedAddresses.count(physicalAddress) > 0)
        {
            continue;
        }
        usedAddresses.insert(physicalAddress);
        int identifiedChannel = -1;
        int identifiedRank = -1;
        int identifiedBank = -1;
        int identifiedBankGroup = -1;
        bool found = false;
        for(unsigned int channel = 0; channel < 4 && !found; channel++)
        {
            for(unsigned int rank = 0; rank < 8 && !found; rank++)
            {

                for(unsigned int bank = 0; bank < 16 && !found; bank++)
                {
                    usleep(1);
                    auto fd = setupMeasure(cpuid,channel,rank,bank);
                    startMeasure(fd);
                    access(adr,numAccess);
                    auto count = stopMeasure(fd);
                    if (count >= 0.9*numAccess)
                    {
                        identifiedChannel = channel;
                        identifiedRank = rank;
                        identifiedBank = bank;
                        found = true;
                    }
                }

                for(unsigned int bankGroup = 0; bankGroup < 4; bankGroup++)
                {
                    auto fd = setupMeasure(cpuid,channel,rank,bankGroup,true);
                    startMeasure(fd);
                    access(adr,numAccess);
                    auto count = stopMeasure(fd);
                    if (count >= 0.9*numAccess)
                    {
                        identifiedBankGroup = bankGroup;
                        break;
                    }
                }
            }
        }
        if(found)
        {
            channelAddresses[identifiedChannel].push_back(physicalAddress);
            rankAddresses[identifiedRank].push_back(physicalAddress);
            bankAddresses[identifiedBank].push_back(physicalAddress);
            bankGroupAddresses[identifiedBankGroup].push_back(physicalAddress);
            if(verbose) cout << " Channel " << identifiedChannel << " Rank " << identifiedRank << " Bank " << identifiedBank << " BankGroup" << identifiedBankGroup << endl;
        }
        else
        {
            if(verbose) std::cout  << " No set found" << endl;
        }
    }

    for (size_t i = 0 ;i < 4; i++)
    {
        std::cout << "Caputured " << channelAddresses[i].size() << " addresses on channel " << i << endl;
    }
    for (size_t j = 0 ;j < 8; j++)
    {
        std::cout << "Caputured " << rankAddresses[j].size() << " addresses on rank " << j << endl;
    }
    for(size_t k = 0; k < 16; k++)
    {
        std::cout << "Caputured " << bankAddresses[k].size() << " addresses on bank " << k << endl;
    }
    for(size_t k = 0; k < 4; k++)
    {
        std::cout << "Caputured " << bankGroupAddresses[k].size() << " addresses on bankGroup " << k << endl;
    }
    cout << endl;

    uint64_t andAll = std::numeric_limits<uint64_t>::max();
    uint64_t orAll = 0;
    for(auto a : usedAddresses)
    {
        orAll |= a;
        andAll &= a;
    }
    // bits with value 0 in orAll are 0 in all addresses
    // bits with value 1 in andAll are 1 in all addresses
    std::bitset<64> orAllBits(orAll);
    std::bitset<64> andAllBits(andAll);
    if(verbose) std::cout << "And all bits: " << andAllBits  << endl;
    if(verbose) std::cout << "Or all bits:  " << orAllBits  << endl;
    std::bitset<64> unknownBits = 0;
    for(size_t i = 0; i < 64; i++)
    {
        if(orAllBits[i] == 0 || andAllBits[i] == 1)
        {
            unknownBits[i] = 1;
        }
    }
    if(verbose) std::cout << "Unknown bits: " << unknownBits  << endl;


    uint64_t removeFront = 0;
    for(size_t i = 0; i < 64; i++)
    {
        if(unknownBits[i] == 0)
        {
            removeFront = i;
            break;
        }
    }
    if(verbose) std::cout << "Remove " << removeFront << " from front" << endl;

    uint64_t removeBack = 0;
    for(size_t i = 64; i-- > 0;)
    {
        if(unknownBits[i] == 0)
        {
            removeBack = 63 - i ;
            break;
        }
    }
    if(verbose) std::cout << "Remove " << removeBack << " from back" << endl;
    if(verbose) cout << endl;


    if(considerTadRegions)
    {
        auto tadRegions = SysInfo::getTadRegions(nodeid);
        std::map<size_t,AddressSet> regionControllerAddresses;
        std::map<size_t,std::map<size_t,AddressSet>> regionControllerChannelAddresses;

        //build zones
        for(size_t c = 0; c < channelAddresses.size(); c++)
        {
            auto adrList = channelAddresses.at(c);
            for(auto a : adrList)
            {
                for(auto rIt = tadRegions.begin(); rIt != tadRegions.end(); rIt++)
                {
                    auto limitAddress = rIt->first;
                    auto controllerList = rIt->second;
                    if(a <= limitAddress) //found a region that matches
                    {
                        if(controllerList.size() > 1) // this region has controller interleaving on
                        {
                            auto contr = SysInfo::channelToController(c);
                            regionControllerAddresses[limitAddress][contr].push_back(a);
                        }
                        for(size_t contr = 0; contr < controllerList.size(); contr++)
                        {
                            if(controllerList.at(contr).channelInterleaving > 1)
                            {
                                auto contrRef = SysInfo::channelToController(c);
                                if(contrRef == contr)
                                {
                                    regionControllerChannelAddresses[limitAddress][contr][c].push_back(a);
                                }
                            }
                        }
                        break; // regions are sorted. break after first match
                    }
                }
            }
        }


        cout << "Channels" << endl;
        unsigned int regionIndex = 0;
        size_t lastLimitAddress = 0;
        const size_t REGION_UNIT = 1024*1024;
        for(auto tadRegion : tadRegions)
        {
            auto limitAddress = tadRegion.first;
            cout << "Region " << regionIndex << " from " << lastLimitAddress/REGION_UNIT << "M to " << limitAddress/REGION_UNIT << "M:" << endl;
            auto controllerAddrSetIt = regionControllerAddresses.find(limitAddress);
            if(controllerAddrSetIt != regionControllerAddresses.end() && !controllerAddrSetIt->second.empty() )
            {
                cout << "Controller Interleaving:" << endl;
                prepareSolvePrint(controllerAddrSetIt->second,removeFront,removeBack);
            }
            else
            {
                if(tadRegion.second.size()==0)
                {
                    cout << "No addresses captured in this region" << endl;
                    lastLimitAddress = limitAddress;
                    regionIndex++;
                    continue;
                }
                else if(tadRegion.second.size() == 1)
                {
                    cout << "Single controller" << endl;
                }
            }
            auto controllerChannelAddrSetIt = regionControllerChannelAddresses.find(limitAddress);
            if(controllerChannelAddrSetIt != regionControllerChannelAddresses.end())
            {
                unsigned int contrIndex = 0;
                auto controllerChannelAddrSet = controllerChannelAddrSetIt->second;
                for(auto contr : controllerChannelAddrSet)
                {
                    cout << "Channel interleaving in controller " << contrIndex << ":" << endl;
                    prepareSolvePrint(contr.second,removeFront,removeBack);
                    contrIndex++;
                }
            }
            lastLimitAddress = limitAddress;
            regionIndex++;
        }
        cout << endl;
    }
    else // Assume there is only one TAD region
    {
        cout << "Channels" << endl;
        prepareSolvePrint(channelAddresses,removeFront,removeBack);
        cout << endl;
    }

    cout << "Ranks" << endl;
    auto setNums = getUsedSets(rankAddresses);
    cout << "Used ranks: ";
    for(auto s : setNums)
    {
        cout << s << " ";
    }
    cout << endl;
    prepareSolvePrint(rankAddresses,removeFront,removeBack);
    cout << endl;

    cout << "Banks" << endl;
    prepareSolvePrint(bankAddresses,removeFront,removeBack);
    cout << endl;

    cout << "Bank Groups" << endl;
    prepareSolvePrint(bankGroupAddresses,removeFront,removeBack);
    cout << endl;

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3e8, %rsp            # imm = 0x3E8
movq %rsi, %rbx
movl %edi, %ebp
movl $0x14, %eax
movq %rax, 0x90(%rsp)
movl $0x3e8, %eax            # imm = 0x3E8
movq %rax, 0xc0(%rsp)
movl $0x7d0, %r13d           # imm = 0x7D0
movl $0x0, 0x74(%rsp)
leaq 0x197e9(%rip), %r14     # 0x221ba
movq 0x235a0(%rip), %r15     # 0x2bf78
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movl %eax, %ecx
movl %ecx, %r12d
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x5100
movb $0x1, %cl
cmpl $0x76, %eax
je 0x89e6
movl %r12d, 0x8(%rsp)
cmpl $0x6d, %eax
jle 0x8a22
cmpl $0x6e, %eax
je 0x8a4f
cmpl $0x73, %eax
je 0x8a3d
cmpl $0x72, %eax
jne 0xa2a5
movb $0x1, %al
movl %eax, 0x74(%rsp)
jmp 0x89e0
cmpl $-0x1, %eax
je 0x8a66
cmpl $0x61, %eax
jne 0xa2a5
movq (%r15), %rdi
callq 0x56e0
movslq %eax, %r13
jmp 0x89e0
movq (%r15), %rdi
callq 0x56e0
movq %rax, 0x90(%rsp)
jmp 0x89e0
movq (%r15), %rdi
callq 0x56e0
cltq
movq %rax, 0xc0(%rsp)
jmp 0x89e0
leaq 0x78(%rsp), %rsi
leaq 0x7c(%rsp), %rdx
movl $0x135, %edi            # imm = 0x135
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x5080
cmpq $-0x1, %rax
je 0x9656
testb $0x1, 0x8(%rsp)
je 0x8ae0
movq 0x2351a(%rip), %rbx     # 0x2bfb0
leaq 0x1986d(%rip), %rsi     # 0x2230a
movl $0x12, %edx
movq %rbx, %rdi
callq 0x54c0
movl 0x7c(%rsp), %esi
movq %rbx, %rdi
callq 0x5340
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
callq 0x7e13
movq 0x90(%rsp), %rdi
shll $0x14, %edi
shlq $0xa, %rdi
movq %rdi, 0x90(%rsp)
callq 0x7b53
testq %rax, %rax
je 0x9698
movq %rax, %r15
movl $0xd10, %edi            # imm = 0xD10
callq 0x5430
leaq 0x150(%rsp), %rcx
xorl %eax, %eax
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x180(%rsp), %rcx
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x210(%rsp), %rcx
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x270(%rsp), %rcx
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x240(%rsp), %rcx
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq 0x2340e(%rip), %rbx     # 0x2bfb0
leaq 0x19774(%rip), %rsi     # 0x2231d
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x54c0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x233dc(%rip), %r12     # 0x2bfb0
movq %r12, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0xc0(%rsp), %rax
cmpq %rax, 0x170(%rsp)
jae 0x90e8
movq %r13, %xmm0
punpckldq 0x19419(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x19421(%rip), %xmm0    # 0x22030
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x19425(%rip), %xmm1    # 0x22048
movapd %xmm1, 0x80(%rsp)
movq %r15, %r14
movq %r15, 0xd0(%rsp)
movq %r14, %rdi
movq %r15, %rsi
movq 0x90(%rsp), %rdx
callq 0x8165
movq %rax, %r14
movq %rax, %rdi
callq 0x7e4f
movq %rax, 0x20(%rsp)
testb $0x1, 0x8(%rsp)
je 0x8c79
movq %rax, 0x118(%rsp)
movq %r12, %rdi
leaq 0x118(%rsp), %rsi
callq 0xa6c7
movq 0x158(%rsp), %rcx
leaq 0x150(%rsp), %rax
testq %rcx, %rcx
je 0x8cab
movq 0x20(%rsp), %rdx
xorl %esi, %esi
cmpq %rdx, 0x20(%rcx)
setb %sil
cmovaeq %rcx, %rax
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x8c93
leaq 0x150(%rsp), %rdx
movq %rdx, %rcx
cmpq %rdx, %rax
je 0x8ccb
movq 0x20(%rsp), %rcx
cmpq 0x20(%rax), %rcx
cmovbq %rdx, %rax
movq %rax, %rcx
cmpq %rdx, %rcx
jne 0x90d2
leaq 0x148(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xba8c
xorl %eax, %eax
movl $0xffffffff, 0x18(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x1c(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x58(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movl %ecx, 0x10(%rsp)
testb $0x1, %al
jne 0x8e7b
xorl %r12d, %r12d
movl %eax, 0xc(%rsp)
testb $0x1, %al
jne 0x8dd0
xorl %r15d, %r15d
movl $0x1, %edi
callq 0x5600
movl 0x78(%rsp), %edi
movl 0x10(%rsp), %esi
movl %r12d, %edx
movl %r15d, %ecx
xorl %r8d, %r8d
callq 0x7efa
movl %eax, %ebx
mfence
movl $0x2403, %esi           # imm = 0x2403
movl %eax, %edi
xorl %edx, %edx
xorl %eax, %eax
callq 0x55e0
movl $0x2400, %esi           # imm = 0x2400
movl %ebx, %edi
xorl %edx, %edx
xorl %eax, %eax
callq 0x55e0
testq %r13, %r13
je 0x8d8a
movl $0x1, %eax
clflush (%r14)
lfence
movq (%r14), %rcx
lfence
movl %eax, %ecx
incl %eax
cmpq %rcx, %r13
ja 0x8d74
movl %ebx, %edi
callq 0x80f1
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
ucomisd 0x80(%rsp), %xmm0
jb 0x8dbc
movb $0x1, %al
movl %eax, 0xc(%rsp)
movl %r15d, 0x58(%rsp)
movl %r12d, 0x1c(%rsp)
movl 0x10(%rsp), %eax
movl %eax, 0x18(%rsp)
cmpl $0xe, %r15d
ja 0x8dd0
incl %r15d
testb $0x1, 0xc(%rsp)
je 0x8d25
xorl %r15d, %r15d
movl 0x78(%rsp), %edi
movl 0x10(%rsp), %esi
movl %r12d, %edx
movl %r15d, %ecx
movl $0x1, %r8d
callq 0x7efa
movl %eax, %ebx
mfence
movl $0x2403, %esi           # imm = 0x2403
movl %eax, %edi
xorl %edx, %edx
xorl %eax, %eax
callq 0x55e0
movl $0x2400, %esi           # imm = 0x2400
movl %ebx, %edi
xorl %edx, %edx
xorl %eax, %eax
callq 0x55e0
testq %r13, %r13
je 0x8e31
movl $0x1, %eax
clflush (%r14)
lfence
movq (%r14), %rcx
lfence
movl %eax, %ecx
incl %eax
cmpq %rcx, %r13
ja 0x8e1b
movl %ebx, %edi
callq 0x80f1
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
ucomisd 0x80(%rsp), %xmm0
cmovael %r15d, %ebp
jae 0x8e60
leal 0x1(%r15), %eax
cmpl $0x3, %r15d
movl %eax, %r15d
jb 0x8dd3
cmpl $0x6, %r12d
ja 0x8e77
incl %r12d
movl 0xc(%rsp), %eax
testb $0x1, %al
je 0x8d16
jmp 0x8e7b
movl 0xc(%rsp), %eax
movl 0x10(%rsp), %ecx
cmpl $0x2, %ecx
ja 0x8e8e
incl %ecx
testb $0x1, %al
je 0x8d07
testb $0x1, %al
je 0x8edf
movslq 0x18(%rsp), %rax
movq %rax, 0x118(%rsp)
leaq 0x178(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0xa7ee
movq 0xd0(%rsp), %r15
movq 0x230ed(%rip), %r12     # 0x2bfb0
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x8f2a
movq 0x20(%rsp), %rcx
movq %rcx, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rax)
jmp 0x8f37
testb $0x1, 0x8(%rsp)
movq 0xd0(%rsp), %r15
movq 0x230bd(%rip), %r12     # 0x2bfb0
je 0x90d2
movl $0xd, %edx
movq %r12, %rdi
leaq 0x19457(%rip), %rsi     # 0x2235f
callq 0x54c0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x5440
movq %r12, %rbx
jmp 0x90bf
movq %rax, %rdi
leaq 0x20(%rsp), %rdx
callq 0xb1c4
movslq 0x1c(%rsp), %rax
movq %rax, 0x118(%rsp)
leaq 0x208(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0xa7ee
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x8f75
movq 0x20(%rsp), %rcx
movq %rcx, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rax)
jmp 0x8f82
movq %rax, %rdi
leaq 0x20(%rsp), %rdx
callq 0xb1c4
movslq 0x58(%rsp), %rax
movq %rax, 0x118(%rsp)
leaq 0x268(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0xa7ee
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x8fc0
movq 0x20(%rsp), %rcx
movq %rcx, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rax)
jmp 0x8fcd
movq %rax, %rdi
leaq 0x20(%rsp), %rdx
callq 0xb1c4
movslq %ebp, %rax
movq %rax, 0x118(%rsp)
leaq 0x238(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0xa7ee
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x9009
movq 0x20(%rsp), %rcx
movq %rcx, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rax)
jmp 0x9016
movq %rax, %rdi
leaq 0x20(%rsp), %rdx
callq 0xb1c4
testb $0x1, 0x8(%rsp)
je 0x90d2
movl $0x9, %edx
movq %r12, %rdi
leaq 0x1930c(%rip), %rsi     # 0x2233c
callq 0x54c0
movq %r12, %rdi
movl 0x18(%rsp), %esi
callq 0x5770
movq %rax, %rbx
movl $0x6, %edx
movq %rax, %rdi
leaq 0x192f3(%rip), %rsi     # 0x22346
callq 0x54c0
movq %rbx, %rdi
movl 0x1c(%rsp), %esi
callq 0x5770
movq %rax, %rbx
movl $0x6, %edx
movq %rax, %rdi
leaq 0x192d7(%rip), %rsi     # 0x2234d
callq 0x54c0
movq %rbx, %rdi
movl 0x58(%rsp), %esi
callq 0x5770
movq %rax, %rbx
movl $0xa, %edx
movq %rax, %rdi
leaq 0x192bb(%rip), %rsi     # 0x22354
callq 0x54c0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5770
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0xc0(%rsp), %rax
cmpq %rax, 0x170(%rsp)
jb 0x8c37
leaq 0x20(%rsp), %rbx
movq $0x0, (%rbx)
movq 0x22eb5(%rip), %r14     # 0x2bfb0
leaq 0x1926b(%rip), %r15     # 0x2236d
leaq 0x178(%rsp), %r12
leaq 0x19267(%rip), %r13     # 0x22378
movl $0xa, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x54c0
movq %r12, %rdi
movq %rbx, %rsi
callq 0xa854
movq 0x8(%rax), %rsi
subq (%rax), %rsi
sarq $0x3, %rsi
movq %r14, %rdi
callq 0x5340
movq %rax, %rbp
movl $0x16, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x54c0
movq 0x20(%rsp), %rsi
movq %rbp, %rdi
callq 0x5340
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq %rbp, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0x20(%rsp), %rax
incq %rax
movq %rax, 0x20(%rsp)
cmpq $0x4, %rax
jb 0x9111
leaq 0x20(%rsp), %rbx
movq $0x0, (%rbx)
movq 0x22dfd(%rip), %r14     # 0x2bfb0
leaq 0x191b3(%rip), %r15     # 0x2236d
leaq 0x208(%rsp), %r12
leaq 0x191c6(%rip), %r13     # 0x2238f
movl $0xa, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x54c0
movq %r12, %rdi
movq %rbx, %rsi
callq 0xa854
movq 0x8(%rax), %rsi
subq (%rax), %rsi
sarq $0x3, %rsi
movq %r14, %rdi
callq 0x5340
movq %rax, %rbp
movl $0x13, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x54c0
movq 0x20(%rsp), %rsi
movq %rbp, %rdi
callq 0x5340
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq %rbp, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0x20(%rsp), %rax
incq %rax
movq %rax, 0x20(%rsp)
cmpq $0x8, %rax
jb 0x91c9
leaq 0x20(%rsp), %rbx
movq $0x0, (%rbx)
movq 0x22d45(%rip), %r14     # 0x2bfb0
leaq 0x190fb(%rip), %r15     # 0x2236d
leaq 0x268(%rsp), %r12
leaq 0x19122(%rip), %r13     # 0x223a3
movl $0xa, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x54c0
movq %r12, %rdi
movq %rbx, %rsi
callq 0xa854
movq 0x8(%rax), %rsi
subq (%rax), %rsi
sarq $0x3, %rsi
movq %r14, %rdi
callq 0x5340
movq %rax, %rbp
movl $0x13, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x54c0
movq 0x20(%rsp), %rsi
movq %rbp, %rdi
callq 0x5340
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq %rbp, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0x20(%rsp), %rax
incq %rax
movq %rax, 0x20(%rsp)
cmpq $0x10, %rax
jb 0x9281
leaq 0x20(%rsp), %r14
movq $0x0, (%r14)
movq 0x22c8d(%rip), %rbx     # 0x2bfb0
leaq 0x19043(%rip), %r15     # 0x2236d
leaq 0x238(%rsp), %r12
leaq 0x1907e(%rip), %r13     # 0x223b7
movl $0xa, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x54c0
movq %r12, %rdi
movq %r14, %rsi
callq 0xa854
movq 0x8(%rax), %rsi
subq (%rax), %rsi
sarq $0x3, %rsi
movq %rbx, %rdi
callq 0x5340
movq %rax, %rbp
movl $0x18, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x54c0
movq 0x20(%rsp), %rsi
movq %rbp, %rdi
callq 0x5340
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq %rbp, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0x20(%rsp), %rax
incq %rax
movq %rax, 0x20(%rsp)
cmpq $0x4, %rax
jb 0x9339
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x22bca(%rip), %rdi     # 0x2bfb0
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0x160(%rsp), %rax
leaq 0x150(%rsp), %rcx
movq $-0x1, %rbx
xorl %r14d, %r14d
cmpq %rcx, %rax
je 0x9431
leaq 0x150(%rsp), %r15
movq 0x20(%rax), %rcx
orq %rcx, %r14
andq %rcx, %rbx
movq %rax, %rdi
callq 0x54e0
cmpq %r15, %rax
jne 0x941a
movq %r14, 0x110(%rsp)
movq %rbx, 0x108(%rsp)
testb $0x1, 0x8(%rsp)
je 0x94f8
movq 0x22b5d(%rip), %rdi     # 0x2bfb0
leaq 0x18f76(%rip), %rsi     # 0x223d0
movl $0xe, %edx
callq 0x54c0
movq 0x22b45(%rip), %rdi     # 0x2bfb0
leaq 0x108(%rsp), %rsi
callq 0xa6c7
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0x22b07(%rip), %rdi     # 0x2bfb0
leaq 0x18f2f(%rip), %rsi     # 0x223df
movl $0xe, %edx
callq 0x54c0
movq 0x22aef(%rip), %rdi     # 0x2bfb0
leaq 0x110(%rsp), %rsi
callq 0xa6c7
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq $0x0, 0x98(%rsp)
movq 0x110(%rsp), %rax
movq 0x108(%rsp), %rdx
xorl %ecx, %ecx
xorl %esi, %esi
movl $0x1, %edi
shlq %cl, %rdi
btq %rcx, %rax
jae 0x952e
movq %rdx, %r8
andq %rdi, %r8
je 0x9539
orq %rdi, %rsi
movq %rsi, 0x98(%rsp)
incq %rcx
cmpq $0x40, %rcx
jne 0x9518
testb $0x1, 0x8(%rsp)
je 0x959f
movq 0x22a60(%rip), %rdi     # 0x2bfb0
leaq 0x18c3c(%rip), %rsi     # 0x22193
movl $0xe, %edx
callq 0x54c0
movq 0x22a48(%rip), %rdi     # 0x2bfb0
leaq 0x98(%rsp), %rsi
callq 0xa6c7
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0x98(%rsp), %rax
xorl %ecx, %ecx
btq %rcx, %rax
jae 0x95ba
incq %rcx
cmpq $0x40, %rcx
jne 0x95a9
xorl %ecx, %ecx
movq %rcx, 0x10(%rsp)
testb $0x1, 0x8(%rsp)
je 0x962d
movq 0x229e3(%rip), %rdi     # 0x2bfb0
leaq 0x18e1a(%rip), %rsi     # 0x223ee
movl $0x7, %edx
callq 0x54c0
movq 0x229cb(%rip), %rdi     # 0x2bfb0
movq 0x10(%rsp), %rsi
callq 0x5340
movq %rax, %rbx
leaq 0x18dfd(%rip), %rsi     # 0x223f6
movl $0xb, %edx
movq %rax, %rdi
callq 0x54c0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq $-0x1, %rdx
movl $0x3f, %ecx
movq 0x98(%rsp), %rax
cmpq $0x3f, %rdx
je 0x96a2
incq %rdx
btq %rcx, %rax
leaq -0x1(%rcx), %rcx
jb 0x9641
jmp 0x96a4
movq 0x22953(%rip), %rbx     # 0x2bfb0
leaq 0x18c8c(%rip), %rsi     # 0x222f0
movl $0x19, %edx
movq %rbx, %rdi
callq 0x54c0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
movl $0x1, %eax
jmp 0xa293
xorl %edx, %edx
movq %rdx, 0x80(%rsp)
testb $0x1, 0x8(%rsp)
je 0x974f
movq 0x228f2(%rip), %rdi     # 0x2bfb0
leaq 0x18d29(%rip), %rsi     # 0x223ee
movl $0x7, %edx
callq 0x54c0
movq 0x228da(%rip), %rbx     # 0x2bfb0
movq %rbx, %rdi
movq 0x80(%rsp), %rsi
callq 0x5340
movq %rax, %r14
leaq 0x18d12(%rip), %rsi     # 0x22402
movl $0xa, %edx
movq %rax, %rdi
callq 0x54c0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x2286e(%rip), %rdi     # 0x2bfb0
callq 0x5030
movq %rax, %rdi
callq 0x5350
testb $0x1, 0x74(%rsp)
je 0x9ebd
movl 0x7c(%rsp), %esi
leaq 0x118(%rsp), %rdi
callq 0xe270
leaq 0x1e0(%rsp), %r12
xorl %eax, %eax
movl %eax, (%r12)
movq %rax, 0x8(%r12)
movq %r12, 0x10(%r12)
movq %r12, 0x18(%r12)
movq %rax, 0x20(%r12)
leaq 0x1b0(%rsp), %rcx
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq %rax, 0xa0(%rsp)
cmpq %rax, 0x1a0(%rsp)
je 0x9a24
leaq 0x120(%rsp), %rbx
leaq 0xa0(%rsp), %rsi
leaq 0xd8(%rsp), %rbp
leaq 0x60(%rsp), %r15
leaq 0x178(%rsp), %rdi
callq 0xa8ba
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0xa90a
movq 0x20(%rsp), %r12
movq 0x28(%rsp), %r13
cmpq %r13, %r12
je 0x99dc
movq (%r12), %rax
movq %rax, 0x68(%rsp)
movq 0x130(%rsp), %r14
cmpq %rbx, %r14
je 0x99d3
movq 0x20(%r14), %rax
movq %rax, 0xc8(%rsp)
leaq 0x28(%r14), %rsi
movq %rbp, %rdi
callq 0xa98a
movq 0x68(%rsp), %rax
cmpq 0xc8(%rsp), %rax
jbe 0x987a
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0x9865
movq 0xe8(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
movq %r14, %rdi
callq 0x5360
movq %rax, %r14
cmpq %rbx, %rax
jne 0x9821
jmp 0x99d3
movq 0xe0(%rsp), %rax
subq 0xd8(%rsp), %rax
cmpq $0x11, %rax
jb 0x98f2
movzbl 0xa0(%rsp), %edi
callq 0xe376
movl %eax, %r14d
leaq 0x1d8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0xaa0e
movzbl %r14b, %ecx
movq %rcx, 0x60(%rsp)
movq %rax, %rdi
movq %r15, %rsi
callq 0xa7ee
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x98e5
movq 0x68(%rsp), %rcx
movq %rcx, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rax)
jmp 0x98f2
movq %rax, %rdi
leaq 0x68(%rsp), %rdx
callq 0xb1c4
movq $0x0, 0x60(%rsp)
movq 0xd8(%rsp), %rdi
cmpq %rdi, 0xe0(%rsp)
leaq 0xa0(%rsp), %r14
je 0x99be
xorl %eax, %eax
shlq $0x4, %rax
cmpb $0x2, 0x9(%rdi,%rax)
jb 0x9991
movzbl 0xa0(%rsp), %edi
callq 0xe376
movzbl %al, %eax
cmpq %rax, 0x60(%rsp)
jne 0x9991
leaq 0x1a8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0xaa74
movq %rax, %rdi
movq %r15, %rsi
callq 0xaa0e
movq %rax, %rdi
movq %r14, %rsi
callq 0xa854
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x9984
movq 0x68(%rsp), %rcx
movq %rcx, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rax)
jmp 0x9991
movq %rax, %rdi
leaq 0x68(%rsp), %rdx
callq 0xb1c4
movq 0x60(%rsp), %rax
incq %rax
movq %rax, 0x60(%rsp)
movq 0xd8(%rsp), %rdi
movq 0xe0(%rsp), %rcx
subq %rdi, %rcx
sarq $0x4, %rcx
cmpq %rcx, %rax
jb 0x991b
testq %rdi, %rdi
je 0x99d3
movq 0xe8(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
addq $0x8, %r12
jmp 0x97fe
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
leaq 0x1e0(%rsp), %r12
je 0x99fb
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
movq 0xa0(%rsp), %rax
incq %rax
movq %rax, 0xa0(%rsp)
cmpq 0x1a0(%rsp), %rax
leaq 0xa0(%rsp), %rsi
jb 0x97da
movq 0x22585(%rip), %rbx     # 0x2bfb0
leaq 0x189db(%rip), %rsi     # 0x2240d
movl $0x8, %edx
movq %rbx, %rdi
callq 0x54c0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x22553(%rip), %r15     # 0x2bfb0
movq %r15, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
leaq 0x120(%rsp), %rax
movq 0x10(%rax), %rcx
cmpq %rax, %rcx
je 0x9e66
xorl %ebx, %ebx
leaq 0x3b8(%rsp), %rbp
movl $0x0, 0xc(%rsp)
movq 0x20(%rcx), %rax
movq %rax, 0xa0(%rsp)
movq %rcx, 0x58(%rsp)
leaq 0x28(%rcx), %rsi
leaq 0xa8(%rsp), %rdi
callq 0xa98a
movq 0xa0(%rsp), %r13
movl $0x7, %edx
movq %r15, %rdi
leaq 0x18949(%rip), %rsi     # 0x22416
callq 0x54c0
movl 0xc(%rsp), %esi
movq %r15, %rdi
callq 0x5340
movq %rax, %r14
movl $0x6, %edx
movq %rax, %rdi
leaq 0x1892e(%rip), %rsi     # 0x2241e
callq 0x54c0
shrq $0x14, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5340
movq %rax, %rbx
movl $0x5, %edx
movq %rax, %rdi
leaq 0x1890f(%rip), %rsi     # 0x22425
callq 0x54c0
movq %r13, %rsi
shrq $0x14, %rsi
movq %rbx, %rdi
callq 0x5340
movq %rax, %rbx
movl $0x2, %edx
movq %rax, %rdi
leaq 0x188ef(%rip), %rsi     # 0x2242b
callq 0x54c0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0x1e8(%rsp), %rcx
movq %r12, %rax
testq %rcx, %rcx
je 0x9b92
movq %r12, %rax
xorl %edx, %edx
cmpq %r13, 0x20(%rcx)
setb %dl
cmovaeq %rcx, %rax
movq 0x10(%rcx,%rdx,8), %rcx
testq %rcx, %rcx
jne 0x9b7b
movq %r12, %rbx
cmpq %r12, %rax
je 0x9ba5
cmpq 0x20(%rax), %r13
cmovbq %r12, %rax
movq %rax, %rbx
cmpq %r12, %rbx
je 0x9c2e
cmpq $0x0, 0x50(%rbx)
je 0x9c2e
movl $0x18, %edx
movq %r15, %rdi
leaq 0x1886a(%rip), %rsi     # 0x2242e
callq 0x54c0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq %r15, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
addq $0x28, %rbx
leaq 0x388(%rsp), %rdi
movq %rbx, %rsi
callq 0xab8a
leaq 0x388(%rsp), %rbx
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
movq 0x80(%rsp), %rdx
callq 0x884b
movq %rbx, %rdi
callq 0xaae6
jmp 0x9cc8
movq 0xb0(%rsp), %rax
subq 0xa8(%rsp), %rax
sarq $0x4, %rax
cmpq $0x1, %rax
je 0x9c8d
testq %rax, %rax
jne 0x9cc8
movl $0x24, %edx
movq %r15, %rdi
leaq 0x187eb(%rip), %rsi     # 0x22447
callq 0x54c0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq %r15, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
jmp 0x9e24
movl $0x11, %edx
movq %r15, %rdi
leaq 0x187d0(%rip), %rsi     # 0x2246c
callq 0x54c0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq %r15, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0x1b8(%rsp), %rcx
leaq 0x1b0(%rsp), %rax
testq %rcx, %rcx
je 0x9cf1
xorl %edx, %edx
cmpq %r13, 0x20(%rcx)
setb %dl
cmovaeq %rcx, %rax
movq 0x10(%rcx,%rdx,8), %rcx
jmp 0x9cd8
leaq 0x1b0(%rsp), %rcx
movq %rcx, %rsi
cmpq %rcx, %rax
je 0x9d0c
cmpq 0x20(%rax), %r13
cmovbq %rcx, %rax
movq %rax, %rsi
cmpq %rcx, %rsi
je 0x9e24
addq $0x28, %rsi
leaq 0xd8(%rsp), %rdi
callq 0xad96
movq 0xf0(%rsp), %rbx
leaq 0xe0(%rsp), %rax
cmpq %rax, %rbx
leaq 0x28(%rsp), %r14
je 0x9e0f
xorl %r12d, %r12d
movq 0x20(%rbx), %rax
movq %rax, 0x20(%rsp)
leaq 0x28(%rbx), %rsi
movq %r14, %rdi
callq 0xab8a
movl $0x23, %edx
movq %r15, %rdi
leaq 0x18713(%rip), %rsi     # 0x2247e
callq 0x54c0
movl %r12d, %esi
movq %r15, %rdi
callq 0x5340
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x1869f(%rip), %rsi     # 0x2242c
callq 0x54c0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq %rbp, %rdi
leaq 0x28(%rsp), %rsi
callq 0xab8a
movq %rbp, %rdi
movq 0x10(%rsp), %rsi
movq 0x80(%rsp), %rdx
callq 0x884b
movq %rbp, %rdi
callq 0xaae6
incl %r12d
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0xaae6
movq %rbx, %rdi
callq 0x5360
movq %rax, %rbx
leaq 0xe0(%rsp), %rax
cmpq %rax, %rbx
jne 0x9d47
leaq 0xd8(%rsp), %rdi
callq 0xafe6
leaq 0x1e0(%rsp), %r12
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x9e41
movq 0xb8(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
incl 0xc(%rsp)
movq 0x58(%rsp), %rdi
callq 0x5360
movq %rax, %rcx
movq %r13, %rbx
leaq 0x120(%rsp), %rax
cmpq %rax, %rcx
jne 0x9a94
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x2212c(%rip), %rdi     # 0x2bfb0
callq 0x5030
movq %rax, %rdi
callq 0x5350
leaq 0x1a8(%rsp), %rdi
callq 0xaffa
leaq 0x1d8(%rsp), %rdi
callq 0xafe6
leaq 0x118(%rsp), %rdi
callq 0xb052
jmp 0x9f6d
movq 0x220ec(%rip), %rbx     # 0x2bfb0
leaq 0x18542(%rip), %rsi     # 0x2240d
movl $0x8, %edx
movq %rbx, %rdi
callq 0x54c0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x220ba(%rip), %rbx     # 0x2bfb0
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
leaq 0x358(%rsp), %rdi
leaq 0x178(%rsp), %rsi
callq 0xab8a
leaq 0x358(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x80(%rsp), %rdx
callq 0x884b
leaq 0x358(%rsp), %rdi
callq 0xaae6
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x22050(%rip), %rdi     # 0x2bfb0
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0x2203c(%rip), %rbx     # 0x2bfb0
leaq 0x18527(%rip), %rsi     # 0x224a2
movl $0x5, %edx
movq %rbx, %rdi
callq 0x54c0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x2200a(%rip), %rdi     # 0x2bfb0
callq 0x5030
movq %rax, %rdi
callq 0x5350
leaq 0x328(%rsp), %rdi
leaq 0x208(%rsp), %rsi
callq 0xab8a
leaq 0x20(%rsp), %rdi
leaq 0x328(%rsp), %rsi
callq 0x7d16
leaq 0x328(%rsp), %rdi
callq 0xaae6
movq 0x21fc2(%rip), %rbx     # 0x2bfb0
leaq 0x184b3(%rip), %rsi     # 0x224a8
movl $0xc, %edx
movq %rbx, %rdi
callq 0x54c0
movq 0x20(%rsp), %r12
movq 0x28(%rsp), %r13
cmpq %r13, %r12
je 0xa044
movq 0x21f98(%rip), %r14     # 0x2bfb0
leaq 0x183cd(%rip), %r15     # 0x223ec
movq (%r12), %rsi
movq %r14, %rdi
callq 0x5340
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x54c0
addq $0x8, %r12
cmpq %r13, %r12
jne 0xa01f
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x21f4e(%rip), %rbx     # 0x2bfb0
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
leaq 0x2f8(%rsp), %rdi
leaq 0x208(%rsp), %rsi
callq 0xab8a
leaq 0x2f8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x80(%rsp), %rdx
callq 0x884b
leaq 0x2f8(%rsp), %rdi
callq 0xaae6
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x21ee4(%rip), %rdi     # 0x2bfb0
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0x21ed0(%rip), %rbx     # 0x2bfb0
leaq 0x183ce(%rip), %rsi     # 0x224b5
movl $0x5, %edx
movq %rbx, %rdi
callq 0x54c0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x21e9e(%rip), %rbx     # 0x2bfb0
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
leaq 0x2c8(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0xab8a
leaq 0x2c8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x80(%rsp), %rdx
callq 0x884b
leaq 0x2c8(%rsp), %rdi
callq 0xaae6
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x21e34(%rip), %rdi     # 0x2bfb0
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0x21e20(%rip), %rbx     # 0x2bfb0
leaq 0x18324(%rip), %rsi     # 0x224bb
movl $0xb, %edx
movq %rbx, %rdi
callq 0x54c0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x21dee(%rip), %rbx     # 0x2bfb0
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
leaq 0x298(%rsp), %rdi
leaq 0x238(%rsp), %rsi
callq 0xab8a
leaq 0x298(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x80(%rsp), %rdx
callq 0x884b
leaq 0x298(%rsp), %rdi
callq 0xaae6
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x21d84(%rip), %rdi     # 0x2bfb0
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa250
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
leaq 0x238(%rsp), %rdi
callq 0xaae6
leaq 0x268(%rsp), %rdi
callq 0xaae6
leaq 0x208(%rsp), %rdi
callq 0xaae6
leaq 0x178(%rsp), %rdi
callq 0xaae6
leaq 0x148(%rsp), %rdi
callq 0xb0c8
xorl %eax, %eax
addq $0x3e8, %rsp            # imm = 0x3E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x21d04(%rip), %rdi     # 0x2bfb0
leaq 0x17f10(%rip), %rsi     # 0x221c3
callq 0x5450
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x5450
leaq 0x17f8c(%rip), %rsi     # 0x22256
movq %rax, %rdi
callq 0x5450
leaq 0x17ef2(%rip), %rsi     # 0x221cb
movq %rax, %rdi
callq 0x5450
leaq 0x17ef8(%rip), %rsi     # 0x221e0
movq %rax, %rdi
callq 0x5450
leaq 0x17f29(%rip), %rsi     # 0x22220
movq %rax, %rdi
callq 0x5450
leaq 0x17f2e(%rip), %rsi     # 0x22234
movq %rax, %rdi
callq 0x5450
leaq 0x17f43(%rip), %rsi     # 0x22258
movq %rax, %rdi
callq 0x5450
leaq 0x17f66(%rip), %rsi     # 0x2228a
movq %rax, %rdi
callq 0x5450
leaq 0x17f8a(%rip), %rsi     # 0x222bd
movq %rax, %rdi
callq 0x5450
movl $0x1, %edi
callq 0x5510
movq %rax, %rbx
leaq 0x358(%rsp), %rdi
jmp 0xa391
jmp 0xa504
movq %rax, %rbx
leaq 0x298(%rsp), %rdi
jmp 0xa37c
movq %rax, %rbx
leaq 0x2c8(%rsp), %rdi
jmp 0xa37c
movq %rax, %rbx
leaq 0x2f8(%rsp), %rdi
callq 0xaae6
jmp 0xa412
movq %rax, %rbx
leaq 0x328(%rsp), %rdi
callq 0xaae6
jmp 0xa507
jmp 0xa504
jmp 0xa403
jmp 0xa403
jmp 0xa504
jmp 0xa504
jmp 0xa504
jmp 0xa504
jmp 0xa504
jmp 0xa504
jmp 0xa504
movq %rax, %rbx
leaq 0x388(%rsp), %rdi
callq 0xaae6
jmp 0xa480
jmp 0xa44d
jmp 0xa504
jmp 0xa504
jmp 0xa504
jmp 0xa403
jmp 0xa504
jmp 0xa504
jmp 0xa504
jmp 0xa504
movq %rax, %rbx
jmp 0xa4d3
jmp 0xa40f
jmp 0xa44d
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa507
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
jmp 0xa507
jmp 0xa497
jmp 0xa497
movq %rax, %rbx
leaq 0x3b8(%rsp), %rdi
callq 0xaae6
jmp 0xa469
movq %rax, %rbx
jmp 0xa473
movq %rax, %rbx
jmp 0xa480
jmp 0xa504
jmp 0xa504
jmp 0xa504
jmp 0xa504
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xaae6
leaq 0xd8(%rsp), %rdi
callq 0xafe6
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0xa4d3
movq 0xb8(%rsp), %rsi
jmp 0xa4cb
movq %rax, %rbx
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0xa4bc
movq 0xe8(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
jmp 0xa4bc
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa4d3
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
leaq 0x1a8(%rsp), %rdi
callq 0xaffa
leaq 0x1d8(%rsp), %rdi
callq 0xafe6
leaq 0x118(%rsp), %rdi
callq 0xb052
jmp 0xa507
jmp 0xa504
jmp 0xa504
jmp 0xa504
jmp 0xa504
movq %rax, %rbx
leaq 0x238(%rsp), %rdi
callq 0xaae6
leaq 0x268(%rsp), %rdi
callq 0xaae6
leaq 0x208(%rsp), %rdi
callq 0xaae6
leaq 0x178(%rsp), %rdi
callq 0xaae6
leaq 0x148(%rsp), %rdi
callq 0xb0c8
movq %rbx, %rdi
callq 0x5790