// File: 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
movq %rsp, %rbp
subq $0x960, %rsp            # imm = 0x960
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x15(%rbp)
movb $0x0, -0x16(%rbp)
movl $0x14, -0x1c(%rbp)
movq $0x3e8, -0x28(%rbp)     # imm = 0x3E8
movq $0x7d0, -0x30(%rbp)     # imm = 0x7D0
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x28c04(%rip), %rdx     # 0x3320a
callq 0x6130
movl %eax, -0x14(%rbp)
cmpl $-0x1, %eax
je 0xa748
movl -0x14(%rbp), %eax
addl $-0x61, %eax
movl %eax, %ecx
movq %rcx, -0x678(%rbp)
subl $0x15, %eax
ja 0xa69f
movq -0x678(%rbp), %rax
leaq 0x28a07(%rip), %rcx     # 0x33040
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x1, -0x15(%rbp)
jmp 0xa743
movb $0x1, -0x16(%rbp)
jmp 0xa743
movq 0x3b915(%rip), %rax     # 0x45f70
movq (%rax), %rdi
callq 0x6870
movl %eax, -0x1c(%rbp)
jmp 0xa743
movq 0x3b8fe(%rip), %rax     # 0x45f70
movq (%rax), %rdi
callq 0x6870
cltq
movq %rax, -0x28(%rbp)
jmp 0xa743
movq 0x3b8e4(%rip), %rax     # 0x45f70
movq (%rax), %rdi
callq 0x6870
cltq
movq %rax, -0x30(%rbp)
jmp 0xa743
movq 0x3b90a(%rip), %rdi     # 0x45fb0
leaq 0x28b66(%rip), %rsi     # 0x33213
callq 0x6570
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x6570
movq %rax, %rdi
leaq 0x28bdb(%rip), %rsi     # 0x332a6
callq 0x6570
movq %rax, %rdi
leaq 0x28b41(%rip), %rsi     # 0x3321b
callq 0x6570
movq %rax, %rdi
leaq 0x28b47(%rip), %rsi     # 0x33230
callq 0x6570
movq %rax, %rdi
leaq 0x28b78(%rip), %rsi     # 0x33270
callq 0x6570
movq %rax, %rdi
leaq 0x28b7d(%rip), %rsi     # 0x33284
callq 0x6570
movq %rax, %rdi
leaq 0x28b92(%rip), %rsi     # 0x332a8
callq 0x6570
movq %rax, %rdi
leaq 0x28bb5(%rip), %rsi     # 0x332da
callq 0x6570
movq %rax, %rdi
leaq 0x28bd9(%rip), %rsi     # 0x3330d
callq 0x6570
movl $0x1, %edi
callq 0x6660
jmp 0xa5f8
movl $0x135, %edi            # imm = 0x135
leaq -0x38(%rbp), %rsi
leaq -0x34(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
movb $0x0, %al
callq 0x6080
movq %rax, -0x40(%rbp)
cmpq $-0x1, -0x40(%rbp)
jne 0xa799
movq 0x3b83e(%rip), %rdi     # 0x45fb0
leaq 0x28bc7(%rip), %rsi     # 0x33340
callq 0x6570
movq %rax, %rdi
movq 0x3b7e0(%rip), %rsi     # 0x45f68
callq 0x65b0
movl $0x1, -0x4(%rbp)
jmp 0xc6eb
testb $0x1, -0x15(%rbp)
je 0xa7cc
movq 0x3b80a(%rip), %rdi     # 0x45fb0
leaq 0x28bad(%rip), %rsi     # 0x3335a
callq 0x6570
movq %rax, %rdi
movl -0x34(%rbp), %esi
callq 0x66f0
movq %rax, %rdi
movq 0x3b7a1(%rip), %rsi     # 0x45f68
callq 0x65b0
callq 0x95e0
movl -0x1c(%rbp), %eax
shll $0xa, %eax
shll $0xa, %eax
movl %eax, %eax
shlq $0xa, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
callq 0x92d0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0xa804
movl $0x1, -0x4(%rbp)
jmp 0xc6eb
movl $0xd10, %edi            # imm = 0xD10
callq 0x6560
leaq -0x80(%rbp), %rdi
callq 0xd190
leaq -0xb0(%rbp), %rdi
callq 0xcf30
leaq -0xe0(%rbp), %rdi
callq 0xcf30
leaq -0x110(%rbp), %rdi
callq 0xcf30
leaq -0x140(%rbp), %rdi
callq 0xcf30
movq 0x3b762(%rip), %rdi     # 0x45fb0
leaq 0x28b18(%rip), %rsi     # 0x3336d
callq 0x6570
movq %rax, -0x680(%rbp)
jmp 0xa863
movq -0x680(%rbp), %rdi
movq 0x3b6f7(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xa878
movq -0x50(%rbp), %rax
movq %rax, -0x158(%rbp)
leaq -0x80(%rbp), %rdi
callq 0xd1b0
cmpq -0x28(%rbp), %rax
jae 0xaecc
movq -0x158(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x9af0
movq %rax, -0x688(%rbp)
jmp 0xa8b3
movq -0x688(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x158(%rbp), %rdi
callq 0x9630
movq %rax, -0x690(%rbp)
jmp 0xa8d6
movq -0x690(%rbp), %rax
movq %rax, -0x160(%rbp)
testb $0x1, -0x15(%rbp)
je 0xa932
movq -0x160(%rbp), %rsi
leaq -0x168(%rbp), %rdi
movq %rdi, -0x698(%rbp)
callq 0xca60
movq -0x698(%rbp), %rsi
movq 0x3b69e(%rip), %rdi     # 0x45fb0
callq 0xd1d0
jmp 0xa919
jmp 0xa932
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x148(%rbp)
movl %eax, -0x14c(%rbp)
jmp 0xc6b0
leaq -0x80(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0xd2d0
movq %rax, -0x6a0(%rbp)
jmp 0xa94b
movq -0x6a0(%rbp), %rax
cmpq $0x0, %rax
jbe 0xa95d
jmp 0xa883
leaq -0x80(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0xd330
movb %dl, -0x6a9(%rbp)
movq %rax, -0x6a8(%rbp)
jmp 0xa97c
movb -0x6a9(%rbp), %al
movq -0x6a8(%rbp), %rcx
movq %rcx, -0x178(%rbp)
movb %al, -0x170(%rbp)
movl $0xffffffff, -0x17c(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x180(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x184(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x188(%rbp) # imm = 0xFFFFFFFF
movb $0x0, -0x189(%rbp)
movl $0x0, -0x190(%rbp)
xorl %eax, %eax
cmpl $0x4, -0x190(%rbp)
movb %al, -0x6aa(%rbp)
jae 0xa9ee
movb -0x189(%rbp), %al
xorb $-0x1, %al
movb %al, -0x6aa(%rbp)
movb -0x6aa(%rbp), %al
testb $0x1, %al
jne 0xa9fd
jmp 0xac84
movl $0x0, -0x194(%rbp)
xorl %eax, %eax
cmpl $0x8, -0x194(%rbp)
movb %al, -0x6ab(%rbp)
jae 0xaa26
movb -0x189(%rbp), %al
xorb $-0x1, %al
movb %al, -0x6ab(%rbp)
movb -0x6ab(%rbp), %al
testb $0x1, %al
jne 0xaa35
jmp 0xac6e
movl $0x0, -0x198(%rbp)
xorl %eax, %eax
cmpl $0x10, -0x198(%rbp)
movb %al, -0x6ac(%rbp)
jae 0xaa5e
movb -0x189(%rbp), %al
xorb $-0x1, %al
movb %al, -0x6ac(%rbp)
movb -0x6ac(%rbp), %al
testb $0x1, %al
jne 0xaa6d
jmp 0xab6a
movl $0x1, %edi
callq 0x6790
jmp 0xaa79
movl -0x38(%rbp), %edi
movl -0x190(%rbp), %esi
movl -0x194(%rbp), %edx
movl -0x198(%rbp), %ecx
xorl %r8d, %r8d
callq 0x9740
movl %eax, -0x6b0(%rbp)
jmp 0xaa9e
movl -0x6b0(%rbp), %eax
movl %eax, -0x19c(%rbp)
movl -0x19c(%rbp), %edi
callq 0x99f0
movq -0x158(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x96f0
movl -0x19c(%rbp), %edi
callq 0x9a30
movq %rax, -0x6b8(%rbp)
jmp 0xaad9
movq -0x6b8(%rbp), %rax
movq %rax, -0x1a8(%rbp)
cvtsi2sdq -0x1a8(%rbp), %xmm0
movaps 0x28529(%rip), %xmm1    # 0x33020
movq -0x30(%rbp), %xmm2
punpckldq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
movapd 0x28528(%rip), %xmm1    # 0x33030
subpd %xmm1, %xmm2
movaps %xmm2, %xmm1
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm1, %xmm2
movsd 0x284f1(%rip), %xmm1    # 0x33010
mulsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0xab54
movl -0x190(%rbp), %eax
movl %eax, -0x17c(%rbp)
movl -0x194(%rbp), %eax
movl %eax, -0x180(%rbp)
movl -0x198(%rbp), %eax
movl %eax, -0x184(%rbp)
movb $0x1, -0x189(%rbp)
jmp 0xab56
movl -0x198(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x198(%rbp)
jmp 0xaa3f
movl $0x0, -0x1ac(%rbp)
cmpl $0x4, -0x1ac(%rbp)
jae 0xac58
movl -0x38(%rbp), %edi
movl -0x190(%rbp), %esi
movl -0x194(%rbp), %edx
movl -0x1ac(%rbp), %ecx
movl $0x1, %r8d
callq 0x9740
movl %eax, -0x6bc(%rbp)
jmp 0xaba9
movl -0x6bc(%rbp), %eax
movl %eax, -0x1b0(%rbp)
movl -0x1b0(%rbp), %edi
callq 0x99f0
movq -0x158(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x96f0
movl -0x1b0(%rbp), %edi
callq 0x9a30
movq %rax, -0x6c8(%rbp)
jmp 0xabe4
movq -0x6c8(%rbp), %rax
movq %rax, -0x1b8(%rbp)
cvtsi2sdq -0x1b8(%rbp), %xmm0
movaps 0x2841e(%rip), %xmm1    # 0x33020
movq -0x30(%rbp), %xmm2
punpckldq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
movapd 0x2841d(%rip), %xmm1    # 0x33030
subpd %xmm1, %xmm2
movaps %xmm2, %xmm1
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm1, %xmm2
movsd 0x283e6(%rip), %xmm1    # 0x33010
mulsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0xac42
movl -0x1ac(%rbp), %eax
movl %eax, -0x188(%rbp)
jmp 0xac58
jmp 0xac44
movl -0x1ac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1ac(%rbp)
jmp 0xab74
jmp 0xac5a
movl -0x194(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x194(%rbp)
jmp 0xaa07
jmp 0xac70
movl -0x190(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x190(%rbp)
jmp 0xa9cf
testb $0x1, -0x189(%rbp)
je 0xae8c
movslq -0x17c(%rbp), %rax
movq %rax, -0x1c0(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0xd380
movq %rax, -0x6d0(%rbp)
jmp 0xacbb
movq -0x6d0(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0xc860
jmp 0xacd0
movslq -0x180(%rbp), %rax
movq %rax, -0x1c8(%rbp)
leaq -0xe0(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0xd380
movq %rax, -0x6d8(%rbp)
jmp 0xacfa
movq -0x6d8(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0xc860
jmp 0xad0f
movslq -0x184(%rbp), %rax
movq %rax, -0x1d0(%rbp)
leaq -0x110(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0xd380
movq %rax, -0x6e0(%rbp)
jmp 0xad39
movq -0x6e0(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0xc860
jmp 0xad4e
movslq -0x188(%rbp), %rax
movq %rax, -0x1d8(%rbp)
leaq -0x140(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0xd380
movq %rax, -0x6e8(%rbp)
jmp 0xad78
movq -0x6e8(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0xc860
jmp 0xad8d
testb $0x1, -0x15(%rbp)
je 0xae8a
movq 0x3b212(%rip), %rdi     # 0x45fb0
leaq 0x285e7(%rip), %rsi     # 0x3338c
callq 0x6570
movq %rax, -0x6f0(%rbp)
jmp 0xadb3
movq -0x6f0(%rbp), %rdi
movl -0x17c(%rbp), %esi
callq 0x6930
movq %rax, -0x6f8(%rbp)
jmp 0xadce
movq -0x6f8(%rbp), %rdi
leaq 0x285ba(%rip), %rsi     # 0x33396
callq 0x6570
movq %rax, -0x700(%rbp)
jmp 0xadea
movq -0x700(%rbp), %rdi
movl -0x180(%rbp), %esi
callq 0x6930
movq %rax, -0x708(%rbp)
jmp 0xae05
movq -0x708(%rbp), %rdi
leaq 0x2858a(%rip), %rsi     # 0x3339d
callq 0x6570
movq %rax, -0x710(%rbp)
jmp 0xae21
movq -0x710(%rbp), %rdi
movl -0x184(%rbp), %esi
callq 0x6930
movq %rax, -0x718(%rbp)
jmp 0xae3c
movq -0x718(%rbp), %rdi
leaq 0x2855a(%rip), %rsi     # 0x333a4
callq 0x6570
movq %rax, -0x720(%rbp)
jmp 0xae58
movq -0x720(%rbp), %rdi
movl -0x188(%rbp), %esi
callq 0x6930
movq %rax, -0x728(%rbp)
jmp 0xae73
movq -0x728(%rbp), %rdi
movq 0x3b0e7(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xae88
jmp 0xae8a
jmp 0xaec7
testb $0x1, -0x15(%rbp)
je 0xaec5
movq 0x3b117(%rip), %rdi     # 0x45fb0
leaq 0x2850f(%rip), %rsi     # 0x333af
callq 0x6570
movq %rax, -0x730(%rbp)
jmp 0xaeae
movq -0x730(%rbp), %rdi
movq 0x3b0ac(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xaec3
jmp 0xaec5
jmp 0xaec7
jmp 0xa883
movq $0x0, -0x1e0(%rbp)
cmpq $0x4, -0x1e0(%rbp)
jae 0xafa7
movq 0x3b0c4(%rip), %rdi     # 0x45fb0
leaq 0x284ca(%rip), %rsi     # 0x333bd
callq 0x6570
movq %rax, -0x738(%rbp)
jmp 0xaf01
leaq -0xb0(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0xd460
movq %rax, -0x740(%rbp)
jmp 0xaf1d
movq -0x740(%rbp), %rdi
callq 0xd540
movq -0x738(%rbp), %rdi
movq %rax, %rsi
callq 0x6150
movq %rax, -0x748(%rbp)
jmp 0xaf41
movq -0x748(%rbp), %rdi
leaq 0x28479(%rip), %rsi     # 0x333c8
callq 0x6570
movq %rax, -0x750(%rbp)
jmp 0xaf5d
movq -0x750(%rbp), %rdi
movq -0x1e0(%rbp), %rsi
callq 0x6150
movq %rax, -0x758(%rbp)
jmp 0xaf79
movq -0x758(%rbp), %rdi
movq 0x3afe1(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xaf8e
jmp 0xaf90
movq -0x1e0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1e0(%rbp)
jmp 0xaed7
movq $0x0, -0x1e8(%rbp)
cmpq $0x8, -0x1e8(%rbp)
jae 0xb082
movq 0x3afe9(%rip), %rdi     # 0x45fb0
leaq 0x283ef(%rip), %rsi     # 0x333bd
callq 0x6570
movq %rax, -0x760(%rbp)
jmp 0xafdc
leaq -0xe0(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0xd460
movq %rax, -0x768(%rbp)
jmp 0xaff8
movq -0x768(%rbp), %rdi
callq 0xd540
movq -0x760(%rbp), %rdi
movq %rax, %rsi
callq 0x6150
movq %rax, -0x770(%rbp)
jmp 0xb01c
movq -0x770(%rbp), %rdi
leaq 0x283b5(%rip), %rsi     # 0x333df
callq 0x6570
movq %rax, -0x778(%rbp)
jmp 0xb038
movq -0x778(%rbp), %rdi
movq -0x1e8(%rbp), %rsi
callq 0x6150
movq %rax, -0x780(%rbp)
jmp 0xb054
movq -0x780(%rbp), %rdi
movq 0x3af06(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xb069
jmp 0xb06b
movq -0x1e8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1e8(%rbp)
jmp 0xafb2
movq $0x0, -0x1f0(%rbp)
cmpq $0x10, -0x1f0(%rbp)
jae 0xb15d
movq 0x3af0e(%rip), %rdi     # 0x45fb0
leaq 0x28314(%rip), %rsi     # 0x333bd
callq 0x6570
movq %rax, -0x788(%rbp)
jmp 0xb0b7
leaq -0x110(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0xd460
movq %rax, -0x790(%rbp)
jmp 0xb0d3
movq -0x790(%rbp), %rdi
callq 0xd540
movq -0x788(%rbp), %rdi
movq %rax, %rsi
callq 0x6150
movq %rax, -0x798(%rbp)
jmp 0xb0f7
movq -0x798(%rbp), %rdi
leaq 0x282ee(%rip), %rsi     # 0x333f3
callq 0x6570
movq %rax, -0x7a0(%rbp)
jmp 0xb113
movq -0x7a0(%rbp), %rdi
movq -0x1f0(%rbp), %rsi
callq 0x6150
movq %rax, -0x7a8(%rbp)
jmp 0xb12f
movq -0x7a8(%rbp), %rdi
movq 0x3ae2b(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xb144
jmp 0xb146
movq -0x1f0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1f0(%rbp)
jmp 0xb08d
movq $0x0, -0x1f8(%rbp)
cmpq $0x4, -0x1f8(%rbp)
jae 0xb238
movq 0x3ae33(%rip), %rdi     # 0x45fb0
leaq 0x28239(%rip), %rsi     # 0x333bd
callq 0x6570
movq %rax, -0x7b0(%rbp)
jmp 0xb192
leaq -0x140(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0xd460
movq %rax, -0x7b8(%rbp)
jmp 0xb1ae
movq -0x7b8(%rbp), %rdi
callq 0xd540
movq -0x7b0(%rbp), %rdi
movq %rax, %rsi
callq 0x6150
movq %rax, -0x7c0(%rbp)
jmp 0xb1d2
movq -0x7c0(%rbp), %rdi
leaq 0x28227(%rip), %rsi     # 0x33407
callq 0x6570
movq %rax, -0x7c8(%rbp)
jmp 0xb1ee
movq -0x7c8(%rbp), %rdi
movq -0x1f8(%rbp), %rsi
callq 0x6150
movq %rax, -0x7d0(%rbp)
jmp 0xb20a
movq -0x7d0(%rbp), %rdi
movq 0x3ad50(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xb21f
jmp 0xb221
movq -0x1f8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1f8(%rbp)
jmp 0xb168
movq 0x3ad71(%rip), %rdi     # 0x45fb0
movq 0x3ad22(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xb24d
callq 0xd560
movq %rax, -0x200(%rbp)
movq $0x0, -0x208(%rbp)
leaq -0x80(%rbp), %rax
movq %rax, -0x210(%rbp)
movq -0x210(%rbp), %rdi
callq 0xcdf0
movq %rax, -0x218(%rbp)
movq -0x210(%rbp), %rdi
callq 0xce20
movq %rax, -0x220(%rbp)
leaq -0x218(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0xce50
testb $0x1, %al
jne 0xb2ae
jmp 0xb2fc
leaq -0x218(%rbp), %rdi
callq 0xce80
movq (%rax), %rax
movq %rax, -0x228(%rbp)
movq -0x228(%rbp), %rax
orq -0x208(%rbp), %rax
movq %rax, -0x208(%rbp)
movq -0x228(%rbp), %rax
andq -0x200(%rbp), %rax
movq %rax, -0x200(%rbp)
leaq -0x218(%rbp), %rdi
callq 0xceb0
jmp 0xb295
movq -0x208(%rbp), %rsi
leaq -0x230(%rbp), %rdi
callq 0xca60
movq -0x200(%rbp), %rsi
leaq -0x238(%rbp), %rdi
callq 0xca60
testb $0x1, -0x15(%rbp)
je 0xb377
movq 0x3ac81(%rip), %rdi     # 0x45fb0
leaq 0x280ea(%rip), %rsi     # 0x33420
callq 0x6570
movq %rax, -0x7d8(%rbp)
jmp 0xb344
movq -0x7d8(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0xd1d0
movq %rax, -0x7e0(%rbp)
jmp 0xb360
movq -0x7e0(%rbp), %rdi
movq 0x3abfa(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xb375
jmp 0xb377
testb $0x1, -0x15(%rbp)
je 0xb3cc
movq 0x3ac2c(%rip), %rdi     # 0x45fb0
leaq 0x280a4(%rip), %rsi     # 0x3342f
callq 0x6570
movq %rax, -0x7e8(%rbp)
jmp 0xb399
movq -0x7e8(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0xd1d0
movq %rax, -0x7f0(%rbp)
jmp 0xb3b5
movq -0x7f0(%rbp), %rdi
movq 0x3aba5(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xb3ca
jmp 0xb3cc
leaq -0x240(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xca60
movq $0x0, -0x248(%rbp)
cmpq $0x40, -0x248(%rbp)
jae 0xb528
movq -0x248(%rbp), %rdx
movb $0x0, -0x269(%rbp)
leaq -0x258(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0xd570
jmp 0xb418
leaq -0x258(%rbp), %rdi
callq 0xd5b0
andb $0x1, %al
movzbl %al, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x7f1(%rbp)
je 0xb476
movq -0x248(%rbp), %rdx
leaq -0x268(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0xd570
jmp 0xb452
movb $0x1, -0x269(%rbp)
leaq -0x268(%rbp), %rdi
callq 0xd5b0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
sete %al
movb %al, -0x7f1(%rbp)
movb -0x7f1(%rbp), %al
movb %al, -0x7f2(%rbp)
testb $0x1, -0x269(%rbp)
jne 0xb48d
jmp 0xb499
leaq -0x268(%rbp), %rdi
callq 0xd5f0
leaq -0x258(%rbp), %rdi
callq 0xd5f0
movb -0x7f2(%rbp), %al
testb $0x1, %al
jne 0xb4b1
jmp 0xb50f
movq -0x248(%rbp), %rdx
leaq -0x280(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0xd570
jmp 0xb4cd
leaq -0x280(%rbp), %rdi
movl $0x1, %esi
callq 0xd600
leaq -0x280(%rbp), %rdi
callq 0xd5f0
jmp 0xb50f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x148(%rbp)
movl %eax, -0x14c(%rbp)
leaq -0x258(%rbp), %rdi
callq 0xd5f0
jmp 0xc6b0
jmp 0xb511
movq -0x248(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x248(%rbp)
jmp 0xb3e7
testb $0x1, -0x15(%rbp)
je 0xb57d
movq 0x3aa7b(%rip), %rdi     # 0x45fb0
leaq 0x27ca7(%rip), %rsi     # 0x331e3
callq 0x6570
movq %rax, -0x800(%rbp)
jmp 0xb54a
movq -0x800(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0xd1d0
movq %rax, -0x808(%rbp)
jmp 0xb566
movq -0x808(%rbp), %rdi
movq 0x3a9f4(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xb57b
jmp 0xb57d
movq $0x0, -0x288(%rbp)
movq $0x0, -0x290(%rbp)
cmpq $0x40, -0x290(%rbp)
jae 0xb60d
movq -0x290(%rbp), %rdx
leaq -0x2a0(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0xd570
jmp 0xb5b9
leaq -0x2a0(%rbp), %rdi
callq 0xd5b0
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x80c(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0xd5f0
movl -0x80c(%rbp), %eax
cmpl $0x0, %eax
jne 0xb5f7
movq -0x290(%rbp), %rax
movq %rax, -0x288(%rbp)
jmp 0xb60d
jmp 0xb5f9
movq -0x290(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x290(%rbp)
jmp 0xb593
testb $0x1, -0x15(%rbp)
je 0xb67e
movq 0x3a996(%rip), %rdi     # 0x45fb0
leaq 0x27e1d(%rip), %rsi     # 0x3343e
callq 0x6570
movq %rax, -0x818(%rbp)
jmp 0xb62f
movq -0x818(%rbp), %rdi
movq -0x288(%rbp), %rsi
callq 0x6150
movq %rax, -0x820(%rbp)
jmp 0xb64b
movq -0x820(%rbp), %rdi
leaq 0x27ded(%rip), %rsi     # 0x33446
callq 0x6570
movq %rax, -0x828(%rbp)
jmp 0xb667
movq -0x828(%rbp), %rdi
movq 0x3a8f3(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xb67c
jmp 0xb67e
movq $0x0, -0x2a8(%rbp)
movq $0x40, -0x2b0(%rbp)
movq -0x2b0(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x2b0(%rbp)
cmpq $0x0, %rax
jbe 0xb710
movq -0x2b0(%rbp), %rdx
leaq -0x2c0(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0xd570
jmp 0xb6cb
leaq -0x2c0(%rbp), %rdi
callq 0xd5b0
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x82c(%rbp)
leaq -0x2c0(%rbp), %rdi
callq 0xd5f0
movl -0x82c(%rbp), %eax
cmpl $0x0, %eax
jne 0xb70e
movl $0x3f, %eax
subq -0x2b0(%rbp), %rax
movq %rax, -0x2a8(%rbp)
jmp 0xb710
jmp 0xb694
testb $0x1, -0x15(%rbp)
je 0xb781
movq 0x3a893(%rip), %rdi     # 0x45fb0
leaq 0x27d1a(%rip), %rsi     # 0x3343e
callq 0x6570
movq %rax, -0x838(%rbp)
jmp 0xb732
movq -0x838(%rbp), %rdi
movq -0x2a8(%rbp), %rsi
callq 0x6150
movq %rax, -0x840(%rbp)
jmp 0xb74e
movq -0x840(%rbp), %rdi
leaq 0x27cf6(%rip), %rsi     # 0x33452
callq 0x6570
movq %rax, -0x848(%rbp)
jmp 0xb76a
movq -0x848(%rbp), %rdi
movq 0x3a7f0(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xb77f
jmp 0xb781
testb $0x1, -0x15(%rbp)
je 0xb79e
movq 0x3a822(%rip), %rdi     # 0x45fb0
movq 0x3a7d3(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xb79c
jmp 0xb79e
testb $0x1, -0x16(%rbp)
je 0xc279
movl -0x34(%rbp), %esi
leaq -0x2f0(%rbp), %rdi
callq 0x1a220
jmp 0xb7b9
leaq -0x320(%rbp), %rdi
callq 0xd670
leaq -0x350(%rbp), %rdi
callq 0xd690
movq $0x0, -0x358(%rbp)
movq -0x358(%rbp), %rax
movq %rax, -0x850(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0xd080
movq %rax, %rcx
movq -0x850(%rbp), %rax
cmpq %rcx, %rax
jae 0xbbc9
leaq -0xb0(%rbp), %rdi
leaq -0x358(%rbp), %rsi
callq 0xd6b0
movq %rax, -0x858(%rbp)
jmp 0xb825
movq -0x858(%rbp), %rsi
leaq -0x370(%rbp), %rdi
callq 0xd750
jmp 0xb83a
leaq -0x370(%rbp), %rax
movq %rax, -0x378(%rbp)
movq -0x378(%rbp), %rdi
callq 0xcad0
movq %rax, -0x380(%rbp)
movq -0x378(%rbp), %rdi
callq 0xcb00
movq %rax, -0x388(%rbp)
leaq -0x380(%rbp), %rdi
leaq -0x388(%rbp), %rsi
callq 0xcb30
testb $0x1, %al
jne 0xb88a
jmp 0xbb95
leaq -0x380(%rbp), %rdi
callq 0xcb70
movq (%rax), %rax
movq %rax, -0x390(%rbp)
leaq -0x2f0(%rbp), %rdi
callq 0xd840
movq %rax, -0x398(%rbp)
leaq -0x2f0(%rbp), %rdi
callq 0xd8a0
movq %rax, -0x3a0(%rbp)
leaq -0x398(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
callq 0xd870
testb $0x1, %al
jne 0xb8e2
jmp 0xbb82
leaq -0x398(%rbp), %rdi
movq %rdi, -0x860(%rbp)
callq 0xd8d0
movq -0x860(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x3a8(%rbp)
callq 0xd8d0
movq %rax, %rsi
addq $0x8, %rsi
leaq -0x3c0(%rbp), %rdi
callq 0xd8f0
jmp 0xb920
movq -0x390(%rbp), %rax
cmpq -0x3a8(%rbp), %rax
ja 0xbb42
leaq -0x3c0(%rbp), %rdi
callq 0xd9e0
cmpq $0x1, %rax
jbe 0xba18
movzbl -0x358(%rbp), %edi
callq 0x1a370
movb %al, -0x861(%rbp)
jmp 0xb95e
movb -0x861(%rbp), %al
movb %al, -0x3c1(%rbp)
leaq -0x320(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
callq 0xda00
movq %rax, -0x870(%rbp)
jmp 0xb986
movq -0x870(%rbp), %rdi
movzbl -0x3c1(%rbp), %eax
movq %rax, -0x3d0(%rbp)
leaq -0x3d0(%rbp), %rsi
callq 0xd380
movq %rax, -0x878(%rbp)
jmp 0xb9b0
movq -0x878(%rbp), %rdi
leaq -0x390(%rbp), %rsi
callq 0xc860
jmp 0xb9c5
jmp 0xba18
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x148(%rbp)
movl %eax, -0x14c(%rbp)
jmp 0xc250
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x148(%rbp)
movl %eax, -0x14c(%rbp)
jmp 0xbbb8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x148(%rbp)
movl %eax, -0x14c(%rbp)
leaq -0x3c0(%rbp), %rdi
callq 0xdc00
jmp 0xbbb8
movq $0x0, -0x3d8(%rbp)
movq -0x3d8(%rbp), %rax
movq %rax, -0x880(%rbp)
leaq -0x3c0(%rbp), %rdi
callq 0xd9e0
movq %rax, %rcx
movq -0x880(%rbp), %rax
cmpq %rcx, %rax
jae 0xbb36
movq -0x3d8(%rbp), %rsi
leaq -0x3c0(%rbp), %rdi
callq 0xdae0
movq %rax, -0x888(%rbp)
jmp 0xba6c
movq -0x888(%rbp), %rax
movzbl 0x9(%rax), %eax
cmpl $0x1, %eax
jle 0xbb1d
movzbl -0x358(%rbp), %edi
callq 0x1a370
movb %al, -0x889(%rbp)
jmp 0xba94
movb -0x889(%rbp), %al
movb %al, -0x3d9(%rbp)
movzbl -0x3d9(%rbp), %eax
cmpq -0x3d8(%rbp), %rax
jne 0xbb1b
leaq -0x350(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
callq 0xdb20
movq %rax, -0x898(%rbp)
jmp 0xbacc
movq -0x898(%rbp), %rdi
leaq -0x3d8(%rbp), %rsi
callq 0xda00
movq %rax, -0x8a0(%rbp)
jmp 0xbae8
movq -0x8a0(%rbp), %rdi
leaq -0x358(%rbp), %rsi
callq 0xd460
movq %rax, -0x8a8(%rbp)
jmp 0xbb04
movq -0x8a8(%rbp), %rdi
leaq -0x390(%rbp), %rsi
callq 0xc860
jmp 0xbb19
jmp 0xbb1b
jmp 0xbb1d
jmp 0xbb1f
movq -0x3d8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x3d8(%rbp)
jmp 0xba23
movl $0x2e, -0x3e0(%rbp)
jmp 0xbb4c
movl $0x0, -0x3e0(%rbp)
leaq -0x3c0(%rbp), %rdi
callq 0xdc00
movl -0x3e0(%rbp), %eax
testl %eax, %eax
je 0xbb66
jmp 0xbb64
jmp 0xbb82
jmp 0xbb68
leaq -0x398(%rbp), %rdi
xorl %esi, %esi
callq 0xdc60
movq %rax, -0x3e8(%rbp)
jmp 0xb8b3
jmp 0xbb84
leaq -0x380(%rbp), %rdi
callq 0xcb90
jmp 0xb86e
leaq -0x370(%rbp), %rdi
callq 0xc920
movq -0x358(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x358(%rbp)
jmp 0xb7dc
leaq -0x370(%rbp), %rdi
callq 0xc920
jmp 0xc250
movq 0x3a3e0(%rip), %rdi     # 0x45fb0
leaq 0x27886(%rip), %rsi     # 0x3345d
callq 0x6570
movq %rax, -0x8b0(%rbp)
jmp 0xbbe5
movq -0x8b0(%rbp), %rdi
movq 0x3a375(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xbbfa
movl $0x0, -0x3ec(%rbp)
movq $0x0, -0x3f8(%rbp)
movq $0x100000, -0x400(%rbp) # imm = 0x100000
leaq -0x2f0(%rbp), %rax
movq %rax, -0x408(%rbp)
movq -0x408(%rbp), %rdi
callq 0xd840
movq %rax, -0x410(%rbp)
movq -0x408(%rbp), %rdi
callq 0xd8a0
movq %rax, -0x418(%rbp)
leaq -0x410(%rbp), %rdi
leaq -0x418(%rbp), %rsi
callq 0xd870
testb $0x1, %al
jne 0xbc6a
jmp 0xc212
leaq -0x410(%rbp), %rdi
callq 0xdca0
movq %rax, %rsi
leaq -0x438(%rbp), %rdi
callq 0xdcc0
jmp 0xbc87
movq -0x438(%rbp), %rax
movq %rax, -0x440(%rbp)
movq 0x3a314(%rip), %rdi     # 0x45fb0
leaq 0x277c3(%rip), %rsi     # 0x33466
callq 0x6570
movq %rax, -0x8b8(%rbp)
jmp 0xbcb1
movq -0x8b8(%rbp), %rdi
movl -0x3ec(%rbp), %esi
callq 0x66f0
movq %rax, -0x8c0(%rbp)
jmp 0xbccc
movq -0x8c0(%rbp), %rdi
leaq 0x27794(%rip), %rsi     # 0x3346e
callq 0x6570
movq %rax, -0x8c8(%rbp)
jmp 0xbce8
movq -0x8c8(%rbp), %rdi
movq -0x3f8(%rbp), %rsi
shrq $0x14, %rsi
callq 0x6150
movq %rax, -0x8d0(%rbp)
jmp 0xbd08
movq -0x8d0(%rbp), %rdi
leaq 0x2775f(%rip), %rsi     # 0x33475
callq 0x6570
movq %rax, -0x8d8(%rbp)
jmp 0xbd24
movq -0x8d8(%rbp), %rdi
movq -0x440(%rbp), %rsi
shrq $0x14, %rsi
callq 0x6150
movq %rax, -0x8e0(%rbp)
jmp 0xbd44
movq -0x8e0(%rbp), %rdi
leaq 0x27729(%rip), %rsi     # 0x3347b
callq 0x6570
movq %rax, -0x8e8(%rbp)
jmp 0xbd60
movq -0x8e8(%rbp), %rdi
movq 0x3a1fa(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xbd75
leaq -0x320(%rbp), %rdi
leaq -0x440(%rbp), %rsi
callq 0xdd00
movq %rax, -0x8f0(%rbp)
jmp 0xbd91
movq -0x8f0(%rbp), %rax
movq %rax, -0x448(%rbp)
leaq -0x320(%rbp), %rdi
callq 0xdd60
movq %rax, -0x450(%rbp)
leaq -0x448(%rbp), %rdi
leaq -0x450(%rbp), %rsi
callq 0xdd30
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x8f1(%rbp)
jne 0xbdd6
jmp 0xbdf6
leaq -0x448(%rbp), %rdi
callq 0xdd90
movq %rax, %rdi
addq $0x8, %rdi
callq 0xddb0
xorb $-0x1, %al
movb %al, -0x8f1(%rbp)
movb -0x8f1(%rbp), %al
testb $0x1, %al
jne 0xbe05
jmp 0xbebe
movq 0x3a1a4(%rip), %rdi     # 0x45fb0
leaq 0x2766b(%rip), %rsi     # 0x3347e
callq 0x6570
movq %rax, -0x900(%rbp)
jmp 0xbe21
movq -0x900(%rbp), %rdi
movq 0x3a139(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xbe36
leaq -0x448(%rbp), %rdi
callq 0xdd90
movq %rax, %rsi
addq $0x8, %rsi
leaq -0x480(%rbp), %rdi
callq 0xddd0
jmp 0xbe57
movq -0x288(%rbp), %rsi
movq -0x2a8(%rbp), %rdx
leaq -0x480(%rbp), %rdi
callq 0xa460
jmp 0xbe73
leaq -0x480(%rbp), %rdi
callq 0xcff0
jmp 0xbf7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x148(%rbp)
movl %eax, -0x14c(%rbp)
jmp 0xc204
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x148(%rbp)
movl %eax, -0x14c(%rbp)
leaq -0x480(%rbp), %rdi
callq 0xcff0
jmp 0xc204
leaq -0x438(%rbp), %rdi
addq $0x8, %rdi
callq 0xd9e0
cmpq $0x0, %rax
jne 0xbf31
movq 0x3a0d5(%rip), %rdi     # 0x45fb0
leaq 0x275b5(%rip), %rsi     # 0x33497
callq 0x6570
movq %rax, -0x908(%rbp)
jmp 0xbef0
movq -0x908(%rbp), %rdi
movq 0x3a06a(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xbf05
movq -0x440(%rbp), %rax
movq %rax, -0x3f8(%rbp)
movl -0x3ec(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3ec(%rbp)
movl $0x35, -0x3e0(%rbp)
jmp 0xc1d7
leaq -0x438(%rbp), %rdi
addq $0x8, %rdi
callq 0xd9e0
cmpq $0x1, %rax
jne 0xbf7a
movq 0x3a062(%rip), %rdi     # 0x45fb0
leaq 0x27567(%rip), %rsi     # 0x334bc
callq 0x6570
movq %rax, -0x910(%rbp)
jmp 0xbf63
movq -0x910(%rbp), %rdi
movq 0x39ff7(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xbf78
jmp 0xbf7a
jmp 0xbf7c
jmp 0xbf7e
leaq -0x350(%rbp), %rdi
leaq -0x440(%rbp), %rsi
callq 0xde00
movq %rax, -0x918(%rbp)
jmp 0xbf9a
movq -0x918(%rbp), %rax
movq %rax, -0x488(%rbp)
leaq -0x350(%rbp), %rdi
callq 0xde60
movq %rax, -0x490(%rbp)
leaq -0x488(%rbp), %rdi
leaq -0x490(%rbp), %rsi
callq 0xde30
testb $0x1, %al
jne 0xbfd7
jmp 0xc1b0
movl $0x0, -0x494(%rbp)
leaq -0x488(%rbp), %rdi
callq 0xde90
movq %rax, %rsi
addq $0x8, %rsi
leaq -0x4c8(%rbp), %rdi
callq 0xdeb0
jmp 0xc002
leaq -0x4c8(%rbp), %rax
movq %rax, -0x4d0(%rbp)
movq -0x4d0(%rbp), %rdi
callq 0xdee0
movq %rax, -0x4d8(%rbp)
movq -0x4d0(%rbp), %rdi
callq 0xdd60
movq %rax, -0x4e0(%rbp)
leaq -0x4d8(%rbp), %rdi
leaq -0x4e0(%rbp), %rsi
callq 0xdd30
testb $0x1, %al
jne 0xc052
jmp 0xc194
leaq -0x4d8(%rbp), %rdi
callq 0xdf10
movq %rax, %rsi
leaq -0x518(%rbp), %rdi
callq 0xdf30
jmp 0xc06f
movq 0x39f3a(%rip), %rdi     # 0x45fb0
leaq 0x27451(%rip), %rsi     # 0x334ce
callq 0x6570
movq %rax, -0x920(%rbp)
jmp 0xc08b
movq -0x920(%rbp), %rdi
movl -0x494(%rbp), %esi
callq 0x66f0
movq %rax, -0x928(%rbp)
jmp 0xc0a6
movq -0x928(%rbp), %rdi
leaq 0x273c8(%rip), %rsi     # 0x3347c
callq 0x6570
movq %rax, -0x930(%rbp)
jmp 0xc0c2
movq -0x930(%rbp), %rdi
movq 0x39e98(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xc0d7
leaq -0x510(%rbp), %rsi
leaq -0x548(%rbp), %rdi
callq 0xddd0
jmp 0xc0ec
movq -0x288(%rbp), %rsi
movq -0x2a8(%rbp), %rdx
leaq -0x548(%rbp), %rdi
callq 0xa460
jmp 0xc108
leaq -0x548(%rbp), %rdi
callq 0xcff0
movl -0x494(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x494(%rbp)
leaq -0x518(%rbp), %rdi
callq 0xdf70
leaq -0x4d8(%rbp), %rdi
callq 0xdf90
jmp 0xc036
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x148(%rbp)
movl %eax, -0x14c(%rbp)
jmp 0xc1a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x148(%rbp)
movl %eax, -0x14c(%rbp)
jmp 0xc186
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x148(%rbp)
movl %eax, -0x14c(%rbp)
leaq -0x548(%rbp), %rdi
callq 0xcff0
leaq -0x518(%rbp), %rdi
callq 0xdf70
jmp 0xc1a2
leaq -0x4c8(%rbp), %rdi
callq 0xdfc0
jmp 0xc1b0
leaq -0x4c8(%rbp), %rdi
callq 0xdfc0
jmp 0xc204
movq -0x440(%rbp), %rax
movq %rax, -0x3f8(%rbp)
movl -0x3ec(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3ec(%rbp)
movl $0x0, -0x3e0(%rbp)
leaq -0x438(%rbp), %rdi
callq 0xdfe0
movl -0x3e0(%rbp), %eax
testl %eax, %eax
je 0xc1f1
jmp 0xc1ef
jmp 0xc1f3
jmp 0xc1f3
leaq -0x410(%rbp), %rdi
callq 0xe000
jmp 0xbc4e
leaq -0x438(%rbp), %rdi
callq 0xdfe0
jmp 0xc250
movq 0x39d97(%rip), %rdi     # 0x45fb0
movq 0x39d48(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xc227
leaq -0x350(%rbp), %rdi
callq 0xe030
leaq -0x320(%rbp), %rdi
callq 0xdfc0
leaq -0x2f0(%rbp), %rdi
callq 0xe050
jmp 0xc321
leaq -0x350(%rbp), %rdi
callq 0xe030
leaq -0x320(%rbp), %rdi
callq 0xdfc0
leaq -0x2f0(%rbp), %rdi
callq 0xe050
jmp 0xc6b0
movq 0x39d30(%rip), %rdi     # 0x45fb0
leaq 0x271d6(%rip), %rsi     # 0x3345d
callq 0x6570
movq %rax, -0x938(%rbp)
jmp 0xc295
movq -0x938(%rbp), %rdi
movq 0x39cc5(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xc2aa
leaq -0x578(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0xddd0
jmp 0xc2bf
movq -0x288(%rbp), %rsi
movq -0x2a8(%rbp), %rdx
leaq -0x578(%rbp), %rdi
callq 0xa460
jmp 0xc2db
leaq -0x578(%rbp), %rdi
callq 0xcff0
movq 0x39cc2(%rip), %rdi     # 0x45fb0
movq 0x39c73(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xc2fc
jmp 0xc321
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x148(%rbp)
movl %eax, -0x14c(%rbp)
leaq -0x578(%rbp), %rdi
callq 0xcff0
jmp 0xc6b0
movq 0x39c88(%rip), %rdi     # 0x45fb0
leaq 0x271c3(%rip), %rsi     # 0x334f2
callq 0x6570
movq %rax, -0x940(%rbp)
jmp 0xc33d
movq -0x940(%rbp), %rdi
movq 0x39c1d(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xc352
leaq -0x5c0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0xddd0
jmp 0xc367
leaq -0x590(%rbp), %rdi
leaq -0x5c0(%rbp), %rsi
callq 0x94b0
jmp 0xc37c
leaq -0x5c0(%rbp), %rdi
callq 0xcff0
movq 0x39c21(%rip), %rdi     # 0x45fb0
leaq 0x27162(%rip), %rsi     # 0x334f8
callq 0x6570
jmp 0xc39d
leaq -0x590(%rbp), %rax
movq %rax, -0x5c8(%rbp)
movq -0x5c8(%rbp), %rdi
callq 0xcad0
movq %rax, -0x5d0(%rbp)
movq -0x5c8(%rbp), %rdi
callq 0xcb00
movq %rax, -0x5d8(%rbp)
leaq -0x5d0(%rbp), %rdi
leaq -0x5d8(%rbp), %rsi
callq 0xcb30
testb $0x1, %al
jne 0xc3ed
jmp 0xc47e
leaq -0x5d0(%rbp), %rdi
callq 0xcb70
movq (%rax), %rax
movq %rax, -0x5e0(%rbp)
movq -0x5e0(%rbp), %rsi
movq 0x39b9f(%rip), %rdi     # 0x45fb0
callq 0x6150
movq %rax, -0x948(%rbp)
jmp 0xc41f
movq -0x948(%rbp), %rdi
leaq 0x2700f(%rip), %rsi     # 0x3343c
callq 0x6570
jmp 0xc434
jmp 0xc436
leaq -0x5d0(%rbp), %rdi
callq 0xcb90
jmp 0xc3d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x148(%rbp)
movl %eax, -0x14c(%rbp)
leaq -0x5c0(%rbp), %rdi
callq 0xcff0
jmp 0xc6b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x148(%rbp)
movl %eax, -0x14c(%rbp)
jmp 0xc6a4
movq 0x39b2b(%rip), %rdi     # 0x45fb0
movq 0x39adc(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xc493
leaq -0x610(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0xddd0
jmp 0xc4a8
movq -0x288(%rbp), %rsi
movq -0x2a8(%rbp), %rdx
leaq -0x610(%rbp), %rdi
callq 0xa460
jmp 0xc4c4
leaq -0x610(%rbp), %rdi
callq 0xcff0
movq 0x39ad9(%rip), %rdi     # 0x45fb0
movq 0x39a8a(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xc4e5
movq 0x39ac4(%rip), %rdi     # 0x45fb0
leaq 0x27012(%rip), %rsi     # 0x33505
callq 0x6570
movq %rax, -0x950(%rbp)
jmp 0xc501
movq -0x950(%rbp), %rdi
movq 0x39a59(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xc516
leaq -0x640(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0xddd0
jmp 0xc52b
movq -0x288(%rbp), %rsi
movq -0x2a8(%rbp), %rdx
leaq -0x640(%rbp), %rdi
callq 0xa460
jmp 0xc547
leaq -0x640(%rbp), %rdi
callq 0xcff0
movq 0x39a56(%rip), %rdi     # 0x45fb0
movq 0x39a07(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xc568
movq 0x39a41(%rip), %rdi     # 0x45fb0
leaq 0x26f95(%rip), %rsi     # 0x3350b
callq 0x6570
movq %rax, -0x958(%rbp)
jmp 0xc584
movq -0x958(%rbp), %rdi
movq 0x399d6(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xc599
leaq -0x670(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0xddd0
jmp 0xc5ae
movq -0x288(%rbp), %rsi
movq -0x2a8(%rbp), %rdx
leaq -0x670(%rbp), %rdi
callq 0xa460
jmp 0xc5ca
leaq -0x670(%rbp), %rdi
callq 0xcff0
movq 0x399d3(%rip), %rdi     # 0x45fb0
movq 0x39984(%rip), %rsi     # 0x45f68
callq 0x65b0
jmp 0xc5eb
movl $0x0, -0x4(%rbp)
movl $0x1, -0x3e0(%rbp)
leaq -0x590(%rbp), %rdi
callq 0xc920
leaq -0x140(%rbp), %rdi
callq 0xcff0
leaq -0x110(%rbp), %rdi
callq 0xcff0
leaq -0xe0(%rbp), %rdi
callq 0xcff0
leaq -0xb0(%rbp), %rdi
callq 0xcff0
leaq -0x80(%rbp), %rdi
callq 0xe070
jmp 0xc6eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x148(%rbp)
movl %eax, -0x14c(%rbp)
leaq -0x610(%rbp), %rdi
callq 0xcff0
jmp 0xc6a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x148(%rbp)
movl %eax, -0x14c(%rbp)
leaq -0x640(%rbp), %rdi
callq 0xcff0
jmp 0xc6a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x148(%rbp)
movl %eax, -0x14c(%rbp)
leaq -0x670(%rbp), %rdi
callq 0xcff0
leaq -0x590(%rbp), %rdi
callq 0xc920
leaq -0x140(%rbp), %rdi
callq 0xcff0
leaq -0x110(%rbp), %rdi
callq 0xcff0
leaq -0xe0(%rbp), %rdi
callq 0xcff0
leaq -0xb0(%rbp), %rdi
callq 0xcff0
leaq -0x80(%rbp), %rdi
callq 0xe070
jmp 0xc6f7
movl -0x4(%rbp), %eax
addq $0x960, %rsp            # imm = 0x960
popq %rbp
retq
movq -0x148(%rbp), %rdi
callq 0x6950
nopw %cs:(%rax,%rax)
nopl (%rax)