// File: /workspace/github_cpp_makefile_star2_O3/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 $0x3d8, %rsp            # imm = 0x3D8
movq %rsi, %rbx
movl %edi, %r15d
movl $0x14, %eax
movq %rax, 0x78(%rsp)
movl $0x3e8, %eax            # imm = 0x3E8
movq %rax, 0xb0(%rsp)
movl $0x7d0, %ebp            # imm = 0x7D0
movl $0x0, 0x68(%rsp)
leaq 0x19804(%rip), %r14     # 0x221ba
movq 0x235bb(%rip), %r12     # 0x2bf78
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
movl %eax, %ecx
movl %ecx, %r13d
movl %r15d, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x5100
movb $0x1, %cl
cmpl $0x76, %eax
je 0x89cb
movl %r13d, 0x4(%rsp)
cmpl $0x6d, %eax
jle 0x8a08
cmpl $0x6e, %eax
je 0x8a34
cmpl $0x73, %eax
je 0x8a24
cmpl $0x72, %eax
jne 0xa26d
movb $0x1, %al
movl %eax, 0x68(%rsp)
jmp 0x89c5
cmpl $-0x1, %eax
je 0x8a4c
cmpl $0x61, %eax
jne 0xa26d
movq (%r12), %rdi
callq 0x56e0
movslq %eax, %rbp
jmp 0x89c5
movq (%r12), %rdi
callq 0x56e0
movq %rax, 0x78(%rsp)
jmp 0x89c5
movq (%r12), %rdi
callq 0x56e0
cltq
movq %rax, 0xb0(%rsp)
jmp 0x89c5
leaq 0x70(%rsp), %rsi
leaq 0x74(%rsp), %rdx
movl $0x135, %edi            # imm = 0x135
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x5080
cmpq $-0x1, %rax
je 0x960a
testb $0x1, 0x4(%rsp)
je 0x8ac6
movq 0x23534(%rip), %rbx     # 0x2bfb0
leaq 0x19887(%rip), %rsi     # 0x2230a
movl $0x12, %edx
movq %rbx, %rdi
callq 0x54c0
movl 0x74(%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 0x78(%rsp), %rdi
shll $0x14, %edi
shlq $0xa, %rdi
movq %rdi, 0x78(%rsp)
callq 0x7b53
movq %rax, 0xc0(%rsp)
testq %rax, %rax
je 0x964c
movl $0xd10, %edi            # imm = 0xD10
callq 0x5430
leaq 0x140(%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 0x170(%rsp), %rcx
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x200(%rsp), %rcx
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x260(%rsp), %rcx
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq 0x230(%rsp), %rcx
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq 0x23429(%rip), %rbx     # 0x2bfb0
leaq 0x1978f(%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 0x233f7(%rip), %rdi     # 0x2bfb0
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0xb0(%rsp), %rax
cmpq %rax, 0x160(%rsp)
jae 0x90a1
cvtsi2sd %rbp, %xmm0
mulsd 0x1945f(%rip), %xmm0    # 0x22048
movsd %xmm0, 0x10(%rsp)
leaq 0x108(%rsp), %r15
movq 0xc0(%rsp), %r14
movq %r14, %rdi
movq 0xc0(%rsp), %rsi
movq 0x78(%rsp), %rdx
callq 0x8155
movq %rax, %r14
movq %rax, %rdi
callq 0x7e4f
movq %rax, 0x20(%rsp)
testb $0x1, 0x4(%rsp)
je 0x8c42
movq %rax, 0x108(%rsp)
movq 0x23376(%rip), %rdi     # 0x2bfb0
movq %r15, %rsi
callq 0xa689
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x8c9e
movq 0x20(%rsp), %rax
leaq 0x140(%rsp), %r8
movq %r8, %rcx
movq %rdi, %rdx
movq 0x20(%rdi), %rsi
xorl %edi, %edi
cmpq %rax, %rsi
setb %dil
movq %rdx, %r8
cmovbq %rcx, %r8
movq 0x10(%rdx,%rdi,8), %rdi
testq %rdi, %rdi
jne 0x8c5c
leaq 0x140(%rsp), %rdi
cmpq %rdi, %r8
je 0x8c9e
cmpq %rax, %rsi
cmovbq %rcx, %rdx
cmpq 0x20(%rdx), %rax
jae 0x908b
leaq 0x138(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xba38
xorl %eax, %eax
movl $0xffffffff, 0x18(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x1c(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x6c(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x80(%rsp) # imm = 0xFFFFFFFF
xorl %r13d, %r13d
testb $0x1, %al
jne 0x8e37
xorl %r12d, %r12d
movl %eax, 0x8(%rsp)
testb $0x1, %al
jne 0x8d98
xorl %r15d, %r15d
movl $0x1, %edi
callq 0x5600
movl 0x70(%rsp), %edi
movl %r13d, %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 %rbp, %rbp
je 0x8d56
movl $0x1, %eax
clflush (%r14)
lfence
movq (%r14), %rcx
lfence
movl %eax, %ecx
incl %eax
cmpq %rcx, %rbp
ja 0x8d40
movl %ebx, %edi
callq 0x80e1
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
ucomisd 0x10(%rsp), %xmm0
jae 0x8d83
cmpl $0xe, %r15d
ja 0x8d98
incl %r15d
testb $0x1, 0x8(%rsp)
je 0x8cf2
jmp 0x8d98
movb $0x1, %al
movl %eax, 0x8(%rsp)
movl %r15d, 0x6c(%rsp)
movl %r12d, 0x1c(%rsp)
movl %r13d, 0x18(%rsp)
xorl %r15d, %r15d
movl 0x70(%rsp), %edi
movl %r13d, %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 %rbp, %rbp
je 0x8df8
movl $0x1, %eax
clflush (%r14)
lfence
movq (%r14), %rcx
lfence
movl %eax, %ecx
incl %eax
cmpq %rcx, %rbp
ja 0x8de2
movl %ebx, %edi
callq 0x80e1
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
ucomisd 0x10(%rsp), %xmm0
jae 0x8e1a
incl %r15d
cmpl $0x4, %r15d
jne 0x8d9b
jmp 0x8e22
movl %r15d, 0x80(%rsp)
cmpl $0x6, %r12d
movl 0x8(%rsp), %eax
ja 0x8e37
incl %r12d
testb $0x1, %al
je 0x8ce3
cmpl $0x2, %r13d
ja 0x8e48
incl %r13d
testb $0x1, %al
je 0x8cd8
testb $0x1, %al
je 0x8e92
movslq 0x18(%rsp), %rax
movq %rax, 0x108(%rsp)
leaq 0x168(%rsp), %rdi
leaq 0x108(%rsp), %r15
movq %r15, %rsi
callq 0xa7b0
movl 0x6c(%rsp), %r13d
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x8ee4
movq 0x20(%rsp), %rcx
movq %rcx, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rax)
jmp 0x8ef1
testb $0x1, 0x4(%rsp)
leaq 0x108(%rsp), %r15
je 0x908b
movl $0xd, %edx
movq 0x230ff(%rip), %rdi     # 0x2bfb0
leaq 0x194a7(%rip), %rsi     # 0x2235f
callq 0x54c0
movq 0x230ec(%rip), %rcx     # 0x2bfb0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x5440
movq 0x230d1(%rip), %rbx     # 0x2bfb0
jmp 0x9078
movq %rax, %rdi
leaq 0x20(%rsp), %rdx
callq 0xb184
movslq 0x1c(%rsp), %rax
movq %rax, 0x108(%rsp)
leaq 0x1f8(%rsp), %rdi
movq %r15, %rsi
callq 0xa7b0
movl 0x80(%rsp), %r12d
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x8f32
movq 0x20(%rsp), %rcx
movq %rcx, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rax)
jmp 0x8f3f
movq %rax, %rdi
leaq 0x20(%rsp), %rdx
callq 0xb184
movslq %r13d, %rax
movq %rax, 0x108(%rsp)
leaq 0x258(%rsp), %rdi
movq %r15, %rsi
callq 0xa7b0
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x8f76
movq 0x20(%rsp), %rcx
movq %rcx, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rax)
jmp 0x8f83
movq %rax, %rdi
leaq 0x20(%rsp), %rdx
callq 0xb184
movslq %r12d, %rax
movq %rax, 0x108(%rsp)
leaq 0x228(%rsp), %rdi
movq %r15, %rsi
callq 0xa7b0
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x8fba
movq 0x20(%rsp), %rcx
movq %rcx, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rax)
jmp 0x8fc7
movq %rax, %rdi
leaq 0x20(%rsp), %rdx
callq 0xb184
testb $0x1, 0x4(%rsp)
je 0x908b
movl $0x9, %edx
movq 0x22fd2(%rip), %rdi     # 0x2bfb0
leaq 0x19357(%rip), %rsi     # 0x2233c
callq 0x54c0
movq 0x22fbf(%rip), %rdi     # 0x2bfb0
movl 0x18(%rsp), %esi
callq 0x5770
movq %rax, %rbx
movl $0x6, %edx
movq %rax, %rdi
leaq 0x1933a(%rip), %rsi     # 0x22346
callq 0x54c0
movq %rbx, %rdi
movl 0x1c(%rsp), %esi
callq 0x5770
movq %rax, %rbx
movl $0x6, %edx
movq %rax, %rdi
leaq 0x1931e(%rip), %rsi     # 0x2234d
callq 0x54c0
movq %rbx, %rdi
movl %r13d, %esi
callq 0x5770
movq %rax, %rbx
movl $0xa, %edx
movq %rax, %rdi
leaq 0x19303(%rip), %rsi     # 0x22354
callq 0x54c0
movq %rbx, %rdi
movl %r12d, %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 0xb0(%rsp), %rax
cmpq %rax, 0x160(%rsp)
jb 0x8bff
leaq 0x20(%rsp), %rbx
movq $0x0, (%rbx)
movq 0x22efc(%rip), %r14     # 0x2bfb0
leaq 0x192b2(%rip), %r15     # 0x2236d
leaq 0x168(%rsp), %r12
leaq 0x192ae(%rip), %r13     # 0x22378
movl $0xa, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x54c0
movq %r12, %rdi
movq %rbx, %rsi
callq 0xa816
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 0x90ca
leaq 0x20(%rsp), %rbx
movq $0x0, (%rbx)
movq 0x22e44(%rip), %r14     # 0x2bfb0
leaq 0x191fa(%rip), %r15     # 0x2236d
leaq 0x1f8(%rsp), %r12
leaq 0x1920d(%rip), %r13     # 0x2238f
movl $0xa, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x54c0
movq %r12, %rdi
movq %rbx, %rsi
callq 0xa816
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 0x9182
leaq 0x20(%rsp), %rbx
movq $0x0, (%rbx)
movq 0x22d8c(%rip), %r14     # 0x2bfb0
leaq 0x19142(%rip), %r15     # 0x2236d
leaq 0x258(%rsp), %r12
leaq 0x19169(%rip), %r13     # 0x223a3
movl $0xa, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x54c0
movq %r12, %rdi
movq %rbx, %rsi
callq 0xa816
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 0x923a
leaq 0x20(%rsp), %r14
movq $0x0, (%r14)
movq 0x22cd4(%rip), %rbx     # 0x2bfb0
leaq 0x1908a(%rip), %r15     # 0x2236d
leaq 0x228(%rsp), %r12
leaq 0x190c5(%rip), %r13     # 0x223b7
movl $0xa, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x54c0
movq %r12, %rdi
movq %r14, %rsi
callq 0xa816
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 0x92f2
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x22c11(%rip), %rdi     # 0x2bfb0
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0x150(%rsp), %rax
leaq 0x140(%rsp), %rcx
movq $-0x1, %rbx
xorl %r14d, %r14d
cmpq %rcx, %rax
je 0x93ea
leaq 0x140(%rsp), %r15
movq 0x20(%rax), %rcx
orq %rcx, %r14
andq %rcx, %rbx
movq %rax, %rdi
callq 0x54e0
cmpq %r15, %rax
jne 0x93d3
movq %r14, 0x100(%rsp)
movq %rbx, 0xf8(%rsp)
testb $0x1, 0x4(%rsp)
je 0x94c1
movq 0x22ba4(%rip), %rdi     # 0x2bfb0
leaq 0x18fbd(%rip), %rsi     # 0x223d0
movl $0xe, %edx
callq 0x54c0
movq 0x22b8c(%rip), %rdi     # 0x2bfb0
leaq 0xf8(%rsp), %rsi
callq 0xa689
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 0x22b4e(%rip), %rdi     # 0x2bfb0
leaq 0x18f76(%rip), %rsi     # 0x223df
movl $0xe, %edx
callq 0x54c0
movq 0x22b36(%rip), %rdi     # 0x2bfb0
leaq 0x100(%rsp), %rsi
callq 0xa689
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 0x100(%rsp), %r14
movq 0xf8(%rsp), %rbx
movq $0x0, 0x88(%rsp)
xorl %ecx, %ecx
xorl %eax, %eax
movl $0x1, %edx
shlq %cl, %rdx
btq %rcx, %r14
jae 0x94e7
movq %rbx, %rsi
andq %rdx, %rsi
je 0x94f2
orq %rdx, %rax
movq %rax, 0x88(%rsp)
incq %rcx
cmpq $0x40, %rcx
jne 0x94d1
testb $0x1, 0x4(%rsp)
je 0x9560
movq 0x22aa7(%rip), %rdi     # 0x2bfb0
leaq 0x18c83(%rip), %rsi     # 0x22193
movl $0xe, %edx
callq 0x54c0
movq 0x22a8f(%rip), %rdi     # 0x2bfb0
leaq 0x88(%rsp), %rsi
callq 0xa689
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 0x88(%rsp), %rax
xorl %r13d, %r13d
btq %r13, %rax
jae 0x9575
incq %r13
cmpq $0x40, %r13
jne 0x9563
xorl %r13d, %r13d
testb $0x1, 0x4(%rsp)
je 0x95e9
movq 0x22a2d(%rip), %rdi     # 0x2bfb0
leaq 0x18e64(%rip), %rsi     # 0x223ee
movl $0x7, %edx
callq 0x54c0
movq 0x22a15(%rip), %rdi     # 0x2bfb0
movq %r13, %rsi
callq 0x5340
movq %rax, %rbx
leaq 0x18e49(%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 0x88(%rsp), %rax
movq $-0x1, %rdx
movl $0x3f, %ecx
cmpq $0x3f, %rdx
je 0x9656
incq %rdx
btq %rcx, %rax
leaq -0x1(%rcx), %rcx
jb 0x95f5
jmp 0x9658
movq 0x2299f(%rip), %rbx     # 0x2bfb0
leaq 0x18cd8(%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 0xa25b
xorl %edx, %edx
movq %rdx, 0x8(%rsp)
testb $0x1, 0x4(%rsp)
je 0x96fd
movq 0x22941(%rip), %rdi     # 0x2bfb0
leaq 0x18d78(%rip), %rsi     # 0x223ee
movl $0x7, %edx
callq 0x54c0
movq 0x22929(%rip), %rbx     # 0x2bfb0
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
callq 0x5340
movq %rax, %r14
leaq 0x18d64(%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 0x228c0(%rip), %rdi     # 0x2bfb0
callq 0x5030
movq %rax, %rdi
callq 0x5350
testb $0x1, 0x68(%rsp)
movq %r13, 0x10(%rsp)
je 0x9e94
movl 0x74(%rsp), %esi
leaq 0x108(%rsp), %rdi
callq 0xe1ee
leaq 0x1d0(%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 0x1a0(%rsp), %rcx
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq %rax, 0x90(%rsp)
cmpq %rax, 0x190(%rsp)
je 0x99db
leaq 0x110(%rsp), %r12
leaq 0x90(%rsp), %rsi
leaq 0xc8(%rsp), %rbp
leaq 0x58(%rsp), %r15
leaq 0x168(%rsp), %rdi
callq 0xa87c
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0xa8c6
movq 0x20(%rsp), %r14
movq 0x28(%rsp), %r13
cmpq %r13, %r14
je 0x9998
movq (%r14), %rax
movq %rax, 0x60(%rsp)
movq 0x120(%rsp), %rbx
cmpq %r12, %rbx
je 0x9986
movq 0x20(%rbx), %rax
movq %rax, 0xb8(%rsp)
leaq 0x28(%rbx), %rsi
movq %rbp, %rdi
callq 0xa946
movq 0x60(%rsp), %rax
cmpq 0xb8(%rsp), %rax
jbe 0x9826
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x9811
movq 0xd8(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
movq %rbx, %rdi
callq 0x5360
movq %rax, %rbx
cmpq %r12, %rax
jne 0x97cd
jmp 0x9986
movq 0xc8(%rsp), %rdi
movq 0xd0(%rsp), %rax
movq %rax, %rcx
subq %rdi, %rcx
cmpq $0x11, %rcx
jb 0x98b2
movzbl 0x90(%rsp), %edi
callq 0xe306
movl %eax, %ebx
leaq 0x1c8(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0xa9ca
movzbl %bl, %ecx
movq %rcx, 0x58(%rsp)
movq %rax, %rdi
movq %r15, %rsi
callq 0xa7b0
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x9895
movq 0x60(%rsp), %rcx
movq %rcx, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rax)
jmp 0x98a2
movq %rax, %rdi
leaq 0x60(%rsp), %rdx
callq 0xb184
movq 0xc8(%rsp), %rdi
movq 0xd0(%rsp), %rax
movq $0x0, 0x58(%rsp)
cmpq %rdi, %rax
leaq 0x90(%rsp), %rbx
je 0x9971
xorl %eax, %eax
shlq $0x4, %rax
cmpb $0x2, 0x9(%rdi,%rax)
jb 0x9944
movzbl 0x90(%rsp), %edi
callq 0xe306
movzbl %al, %eax
cmpq %rax, 0x58(%rsp)
jne 0x9944
leaq 0x198(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0xaa30
movq %rax, %rdi
movq %r15, %rsi
callq 0xa9ca
movq %rax, %rdi
movq %rbx, %rsi
callq 0xa816
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x9937
movq 0x60(%rsp), %rcx
movq %rcx, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rax)
jmp 0x9944
movq %rax, %rdi
leaq 0x60(%rsp), %rdx
callq 0xb184
movq 0x58(%rsp), %rax
incq %rax
movq %rax, 0x58(%rsp)
movq 0xc8(%rsp), %rdi
movq 0xd0(%rsp), %rcx
subq %rdi, %rcx
sarq $0x4, %rcx
cmpq %rcx, %rax
jb 0x98ce
testq %rdi, %rdi
je 0x9986
movq 0xd8(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
addq $0x8, %r14
cmpq %r13, %r14
jne 0x97b4
movq 0x20(%rsp), %r14
testq %r14, %r14
movq 0x10(%rsp), %r13
je 0x99b2
movq 0x30(%rsp), %rsi
subq %r14, %rsi
movq %r14, %rdi
callq 0x5470
movq 0x90(%rsp), %rax
incq %rax
movq %rax, 0x90(%rsp)
cmpq 0x190(%rsp), %rax
leaq 0x90(%rsp), %rsi
jb 0x9787
movq 0x225ce(%rip), %rbx     # 0x2bfb0
leaq 0x18a24(%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 0x2259c(%rip), %r15     # 0x2bfb0
movq %r15, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
leaq 0x110(%rsp), %rax
movq 0x10(%rax), %rcx
cmpq %rax, %rcx
je 0x9e3d
xorl %ebx, %ebx
xorl %r12d, %r12d
movq 0x20(%rcx), %rax
movq %rax, 0x90(%rsp)
movq %rcx, 0x80(%rsp)
leaq 0x28(%rcx), %rsi
leaq 0x98(%rsp), %rdi
callq 0xa946
movq 0x90(%rsp), %rbp
movl $0x7, %edx
movq %r15, %rdi
leaq 0x1899c(%rip), %rsi     # 0x22416
callq 0x54c0
movl %r12d, %esi
movq %r15, %rdi
callq 0x5340
movq %rax, %r14
movl $0x6, %edx
movq %rax, %rdi
leaq 0x18982(%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 0x18963(%rip), %rsi     # 0x22425
callq 0x54c0
movq %rbp, %rsi
shrq $0x14, %rsi
movq %rbx, %rdi
callq 0x5340
movq %rax, %rbx
movl $0x2, %edx
movq %rax, %rdi
leaq 0x18943(%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 0x1d8(%rsp), %rsi
testq %rsi, %rsi
je 0x9bea
leaq 0x1d0(%rsp), %rbx
movq %rbx, %rax
movq %rsi, %rcx
movq 0x20(%rsi), %rdx
xorl %esi, %esi
cmpq %rbp, %rdx
setb %sil
movq %rcx, %rbx
cmovbq %rax, %rbx
movq 0x10(%rcx,%rsi,8), %rsi
testq %rsi, %rsi
jne 0x9b2d
leaq 0x1d0(%rsp), %rsi
cmpq %rsi, %rbx
je 0x9bea
cmpq %rbp, %rdx
cmovbq %rax, %rcx
cmpq 0x20(%rcx), %rbp
jb 0x9bea
cmpq $0x0, 0x50(%rbx)
je 0x9bea
movl $0x18, %edx
movq %r15, %rdi
leaq 0x188a9(%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 0x3a8(%rsp), %rdi
movq %rbx, %rsi
callq 0xab44
leaq 0x3a8(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
movq 0x8(%rsp), %rdx
callq 0x883a
movq %rbx, %rdi
callq 0xaaa0
jmp 0x9c84
movq 0xa0(%rsp), %rax
subq 0x98(%rsp), %rax
sarq $0x4, %rax
cmpq $0x1, %rax
je 0x9c49
testq %rax, %rax
jne 0x9c84
movl $0x24, %edx
movq %r15, %rdi
leaq 0x1882f(%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 0x9df9
movl $0x11, %edx
movq %r15, %rdi
leaq 0x18814(%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 0x1a8(%rsp), %rdi
testq %rdi, %rdi
je 0x9df9
leaq 0x1a0(%rsp), %rsi
movq %rsi, %rax
movq %rdi, %rcx
movq 0x20(%rdi), %rdx
xorl %edi, %edi
cmpq %rbp, %rdx
setb %dil
movq %rcx, %rsi
cmovbq %rax, %rsi
movq 0x10(%rcx,%rdi,8), %rdi
testq %rdi, %rdi
jne 0x9c9d
leaq 0x1a0(%rsp), %rdi
cmpq %rdi, %rsi
je 0x9df9
cmpq %rbp, %rdx
cmovbq %rax, %rcx
cmpq 0x20(%rcx), %rbp
jb 0x9df9
addq $0x28, %rsi
leaq 0xc8(%rsp), %rdi
callq 0xad50
movq 0xe0(%rsp), %rbx
leaq 0xd0(%rsp), %rax
cmpq %rax, %rbx
leaq 0x28(%rsp), %r14
je 0x9de7
xorl %r13d, %r13d
movq 0x20(%rbx), %rax
movq %rax, 0x20(%rsp)
leaq 0x28(%rbx), %rsi
movq %r14, %rdi
callq 0xab44
movl $0x23, %edx
movq %r15, %rdi
leaq 0x18745(%rip), %rsi     # 0x2247e
callq 0x54c0
movl %r13d, %esi
movq %r15, %rdi
callq 0x5340
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x186d1(%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
leaq 0x378(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0xab44
leaq 0x378(%rsp), %r14
movq %r14, %rdi
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0x883a
movq %r14, %rdi
callq 0xaaa0
incl %r13d
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0xaaa0
movq %rbx, %rdi
callq 0x5360
movq %rax, %rbx
leaq 0xd0(%rsp), %rax
cmpq %rax, %rbx
jne 0x9d15
leaq 0xc8(%rsp), %rdi
callq 0xafa0
movq 0x10(%rsp), %r13
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x9e16
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
incl %r12d
movq 0x80(%rsp), %rdi
callq 0x5360
movq %rax, %rcx
movq %rbp, %rbx
leaq 0x110(%rsp), %rax
cmpq %rax, %rcx
jne 0x9a3e
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x22155(%rip), %rdi     # 0x2bfb0
callq 0x5030
movq %rax, %rdi
callq 0x5350
leaq 0x198(%rsp), %rdi
callq 0xafb4
leaq 0x1c8(%rsp), %rdi
callq 0xafa0
leaq 0x108(%rsp), %rdi
callq 0xb00c
jmp 0x9f3f
movq 0x22115(%rip), %rbx     # 0x2bfb0
leaq 0x1856b(%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 0x220e3(%rip), %rbx     # 0x2bfb0
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
leaq 0x348(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0xab44
leaq 0x348(%rsp), %rdi
movq %r13, %rsi
movq 0x8(%rsp), %rdx
callq 0x883a
leaq 0x348(%rsp), %rdi
callq 0xaaa0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x2207e(%rip), %rdi     # 0x2bfb0
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0x2206a(%rip), %rbx     # 0x2bfb0
leaq 0x18555(%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 0x22038(%rip), %rdi     # 0x2bfb0
callq 0x5030
movq %rax, %rdi
callq 0x5350
leaq 0x318(%rsp), %rdi
leaq 0x1f8(%rsp), %rsi
callq 0xab44
leaq 0x20(%rsp), %rdi
leaq 0x318(%rsp), %rsi
callq 0x7d16
leaq 0x318(%rsp), %rdi
callq 0xaaa0
movq 0x21ff0(%rip), %rbx     # 0x2bfb0
leaq 0x184e1(%rip), %rsi     # 0x224a8
movl $0xc, %edx
movq %rbx, %rdi
callq 0x54c0
movq 0x20(%rsp), %r12
movq 0x28(%rsp), %r13
cmpq %r13, %r12
je 0xa016
movq 0x21fc6(%rip), %r14     # 0x2bfb0
leaq 0x183fb(%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 0x9ff1
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movq 0x10(%rsp), %r14
movsbl %al, %esi
movq 0x21f77(%rip), %rbx     # 0x2bfb0
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
leaq 0x2e8(%rsp), %rdi
leaq 0x1f8(%rsp), %rsi
callq 0xab44
leaq 0x2e8(%rsp), %rdi
movq %r14, %rsi
movq 0x8(%rsp), %rdx
callq 0x883a
leaq 0x2e8(%rsp), %rdi
callq 0xaaa0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x21f12(%rip), %rdi     # 0x2bfb0
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0x21efe(%rip), %rbx     # 0x2bfb0
leaq 0x183fc(%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 0x21ecc(%rip), %rbx     # 0x2bfb0
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
leaq 0x2b8(%rsp), %rdi
leaq 0x258(%rsp), %rsi
callq 0xab44
leaq 0x2b8(%rsp), %rdi
movq %r14, %rsi
movq 0x8(%rsp), %rdx
callq 0x883a
leaq 0x2b8(%rsp), %rdi
callq 0xaaa0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x21e67(%rip), %rdi     # 0x2bfb0
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0x21e53(%rip), %rbx     # 0x2bfb0
leaq 0x18357(%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 0x21e21(%rip), %rbx     # 0x2bfb0
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5350
leaq 0x288(%rsp), %rdi
leaq 0x228(%rsp), %rsi
callq 0xab44
leaq 0x288(%rsp), %rdi
movq %r14, %rsi
movq 0x8(%rsp), %rdx
callq 0x883a
leaq 0x288(%rsp), %rdi
callq 0xaaa0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5440
movsbl %al, %esi
movq 0x21dbc(%rip), %rdi     # 0x2bfb0
callq 0x5030
movq %rax, %rdi
callq 0x5350
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa218
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
leaq 0x228(%rsp), %rdi
callq 0xaaa0
leaq 0x258(%rsp), %rdi
callq 0xaaa0
leaq 0x1f8(%rsp), %rdi
callq 0xaaa0
leaq 0x168(%rsp), %rdi
callq 0xaaa0
leaq 0x138(%rsp), %rdi
callq 0xb082
xorl %eax, %eax
addq $0x3d8, %rsp            # imm = 0x3D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x21d3c(%rip), %rdi     # 0x2bfb0
leaq 0x17f48(%rip), %rsi     # 0x221c3
callq 0x5450
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x5450
leaq 0x17fc4(%rip), %rsi     # 0x22256
movq %rax, %rdi
callq 0x5450
leaq 0x17f2a(%rip), %rsi     # 0x221cb
movq %rax, %rdi
callq 0x5450
leaq 0x17f30(%rip), %rsi     # 0x221e0
movq %rax, %rdi
callq 0x5450
leaq 0x17f61(%rip), %rsi     # 0x22220
movq %rax, %rdi
callq 0x5450
leaq 0x17f66(%rip), %rsi     # 0x22234
movq %rax, %rdi
callq 0x5450
leaq 0x17f7b(%rip), %rsi     # 0x22258
movq %rax, %rdi
callq 0x5450
leaq 0x17f9e(%rip), %rsi     # 0x2228a
movq %rax, %rdi
callq 0x5450
leaq 0x17fc2(%rip), %rsi     # 0x222bd
movq %rax, %rdi
callq 0x5450
movl $0x1, %edi
callq 0x5510
movq %rax, %rbx
leaq 0x348(%rsp), %rdi
jmp 0xa359
jmp 0xa4c3
movq %rax, %rbx
leaq 0x288(%rsp), %rdi
jmp 0xa344
movq %rax, %rbx
leaq 0x2b8(%rsp), %rdi
jmp 0xa344
movq %rax, %rbx
leaq 0x2e8(%rsp), %rdi
callq 0xaaa0
jmp 0xa3f4
movq %rax, %rbx
leaq 0x318(%rsp), %rdi
callq 0xaaa0
jmp 0xa4c6
jmp 0xa4c3
movq %rax, %rbx
leaq 0x3a8(%rsp), %rdi
callq 0xaaa0
jmp 0xa437
jmp 0xa418
jmp 0xa3c4
jmp 0xa3c4
jmp 0xa4c3
jmp 0xa4c3
jmp 0xa4c3
jmp 0xa4c3
jmp 0xa4c3
jmp 0xa4c3
jmp 0xa4c3
jmp 0xa4c3
jmp 0xa4c3
jmp 0xa4c3
jmp 0xa3c4
jmp 0xa4c3
jmp 0xa4c3
movq %rax, %rbx
jmp 0xa492
jmp 0xa4c3
jmp 0xa3f1
movq %rax, %rbx
leaq 0x378(%rsp), %rdi
callq 0xaaa0
jmp 0xa420
movq %rax, %rbx
jmp 0xa42a
jmp 0xa418
jmp 0xa4c3
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa4c6
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
jmp 0xa4c6
jmp 0xa456
jmp 0xa456
movq %rax, %rbx
jmp 0xa437
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xaaa0
leaq 0xc8(%rsp), %rdi
callq 0xafa0
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0xa492
movq 0xa8(%rsp), %rsi
jmp 0xa48a
jmp 0xa4c3
jmp 0xa4c3
jmp 0xa4c3
jmp 0xa4c3
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0xa47b
movq 0xd8(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
jmp 0xa47b
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa492
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
leaq 0x198(%rsp), %rdi
callq 0xafb4
leaq 0x1c8(%rsp), %rdi
callq 0xafa0
leaq 0x108(%rsp), %rdi
callq 0xb00c
jmp 0xa4c6
jmp 0xa4c3
jmp 0xa4c3
jmp 0xa4c3
jmp 0xa4c3
movq %rax, %rbx
leaq 0x228(%rsp), %rdi
callq 0xaaa0
leaq 0x258(%rsp), %rdi
callq 0xaaa0
leaq 0x1f8(%rsp), %rdi
callq 0xaaa0
leaq 0x168(%rsp), %rdi
callq 0xaaa0
leaq 0x138(%rsp), %rdi
callq 0xb082
movq %rbx, %rdi
callq 0x5790
nop