LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/sunpihai-up[P]MulThreadsWordsCounter/WordsCounter-v3.cpp
// Function: main
int main()
{
    size_t cores = std::thread::hardware_concurrency();
    cout << cores << " concurrent threads are supported.\n";

    string path;
    cout << instruct << endl;
    while (cin >> path)
    {
        if (path == "exit" || path == "quit")
        {
            return 0;
        }

        auto start = high_resolution_clock::now();

        // launch threads to process
        std::vector<pthread_t *> threadGroup;
        threadLauncher(threadGroup, cores, path);

        auto stop = high_resolution_clock::now();
        auto duration = duration_cast<milliseconds>(stop - start);
        cout << "Time taken by function: "
             << duration.count() << " milliseconds" << endl;

        cout << endl
             << instruct << endl;
        initVariable();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
callq 0x2260
movl %eax, -0x2c(%rbp)
movl %eax, %esi
movq 0x5062(%rip), %rbx      # 0x7fd0
movq %rbx, %rdi
callq 0x2160
leaq 0x2143(%rip), %rsi      # 0x50c0
movq %rax, %rdi
callq 0x21f0
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x5364(%rip), %rsi      # 0x8300
movq %rbx, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2120
leaq -0x70(%rbp), %r15
leaq -0x50(%rbp), %r13
movq 0x5015(%rip), %r12      # 0x7fd0
movq 0x501e(%rip), %rdi      # 0x7fe0
movq %r15, %rsi
callq 0x2230
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x30a6
movq %r15, %rdi
leaq 0x20fe(%rip), %rsi      # 0x50e4
callq 0x31c9
testb %al, %al
jne 0x30a6
movq %r15, %rdi
leaq 0x2060(%rip), %rsi      # 0x505d
callq 0x31c9
testb %al, %al
jne 0x30a6
callq 0x2060
movq %rax, %r14
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
andq $0x0, -0x40(%rbp)
movq %r13, %rdi
movl -0x2c(%rbp), %esi
movq %r15, %rdx
callq 0x2dcc
callq 0x2060
movq %rax, %rbx
movq %r12, %rdi
leaq 0x20ab(%rip), %rsi      # 0x50e9
callq 0x21f0
movq %rax, %rdi
subq %r14, %rbx
movq %rbx, %rax
cqto
movl $0xf4240, %ecx          # imm = 0xF4240
idivq %rcx
movq %rax, %rsi
callq 0x21e0
movq %rax, %rdi
leaq 0x209a(%rip), %rsi      # 0x5102
callq 0x21f0
movq %rax, %rdi
callq 0x2120
movq %r12, %rdi
callq 0x2120
movq %rax, %rdi
leaq 0x5279(%rip), %rsi      # 0x8300
callq 0x21a0
movq %rax, %rdi
callq 0x2120
callq 0x2f12
movq %r13, %rdi
callq 0x4646
jmp 0x2fbb
leaq -0x70(%rbp), %rdi
callq 0x23b8
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x30c4
jmp 0x30c9
movq %rax, %rbx
jmp 0x30d5
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x4646
leaq -0x70(%rbp), %rdi
callq 0x23b8
movq %rbx, %rdi
callq 0x2360
// File: /workspace/github_cpp_makefile_star2_O2/mooncoincore[P]mooncoin-seeder/bitcoin.cpp
// Function: CNode::PushVersion()
void PushVersion() {
    int64 nTime = time(NULL);
    uint64 nLocalNonce = BITCOIN_SEED_NONCE;
    int64 nLocalServices = 0;
    CAddress me(CService("0.0.0.0"));
    BeginMessage("version");
    int nBestHeight = GetRequireHeight();
    string ver = "/mooncoin-seeder: v0.13.9.0-b257fcdsegwit/";
    vSend << PROTOCOL_VERSION << nLocalServices << nTime << you << me << nLocalNonce << ver << nBestHeight;
    EndMessage();
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %rdi, %rbx
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x33d0
movq %rax, 0x38(%rsp)
movabsq $0x539a019ca550825, %rax # imm = 0x539A019CA550825
movq %rax, 0x30(%rsp)
andq $0x0, 0x28(%rsp)
leaq 0xd45c(%rip), %rsi      # 0x12004
leaq 0x60(%rsp), %r14
movq %r14, %rdi
xorl %edx, %edx
callq 0x8c4a
movzwl 0x10(%r14), %eax
movw %ax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
leaq 0x78(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x9ac4
leaq 0xd42f(%rip), %rsi      # 0x1200c
movq %rbx, %rdi
callq 0x5008
leaq 0x188c4(%rip), %rax     # 0x1d4b0
cmpb $0x0, (%rax)
movl $0x12ebc0, %eax         # imm = 0x12EBC0
cmovnel %r15d, %eax
movl %eax, 0x24(%rsp)
leaq 0xd411(%rip), %rsi      # 0x12014
leaq 0x40(%rsp), %rdi
leaq 0x23(%rsp), %rdx
callq 0x3180
leaq 0x8(%rbx), %rdi
leaq 0xd64b(%rip), %rsi      # 0x12268
callq 0x506e
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
callq 0x5084
leaq 0x38(%rsp), %rsi
movq %rax, %rdi
callq 0x5084
leaq 0xa8(%rbx), %rsi
movq %rax, %rdi
callq 0x509c
leaq 0x78(%rsp), %rsi
movq %rax, %rdi
callq 0x509c
leaq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0x50b6
leaq 0x40(%rsp), %rsi
movq %rax, %rdi
callq 0x50ce
leaq 0x24(%rsp), %rsi
movq %rax, %rdi
callq 0x506e
movq %rbx, %rdi
callq 0x50e2
leaq 0x40(%rsp), %rdi
callq 0x31d0
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x31d0
movq %rbx, %rdi
callq 0x3690
nop
// File: /workspace/github_cpp_makefile_star2_O2/helchr[P]reMap/main.cpp
// Function: allocate(unsigned long)
void* allocate(uint64_t size)
{
    auto sizeGb = size / (1024*1024*1024ULL);
    auto space = tryAllocate1Gb(size);
    auto l = mlock(space,size);
    if(space != (void*) -1 && l == 0)
    {
        std::cout << "Allocated " << sizeGb << "GB using 1GB pages" << endl;
        return space;
    }
    space = tryAllocate2Mb(size);
    l = mlock(space,size);
    if(space != (void*) -1 && l == 0)
    {
        std::cout << "Allocated " << sizeGb << "GB using 2MB pages" << endl;
        return space;
    }
    space = tryAllocate4Kb(size);
    l = mlock(space,size);
    if(space != (void*) -1 && l == 0)
    {
        std::cout << "Allocated " << sizeGb << "GB using 4KB pages" << endl;
        return space;
    }
    std::cout << "Failed to allocate " << sizeGb << "GB" << endl;
    return nullptr;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x796c
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5580
leaq 0x19697(%rip), %r15     # 0x21074
cmpq $-0x1, %r14
je 0x79f0
testl %eax, %eax
jne 0x79f0
leaq 0x19691(%rip), %r12     # 0x2107f
jmp 0x7a68
movq %rbx, %rdi
callq 0x7985
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5580
cmpq $-0x1, %r14
je 0x7a19
testl %eax, %eax
jne 0x7a19
leaq 0x1967b(%rip), %r12     # 0x21092
jmp 0x7a68
movq %rbx, %rdi
callq 0x799e
movq %rax, %r13
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5580
cmpq $-0x1, %r13
setne %cl
testl %eax, %eax
sete %al
leaq 0x19632(%rip), %rdx     # 0x21074
leaq 0x1966f(%rip), %r15     # 0x210b8
xorl %r14d, %r14d
testb %al, %cl
cmovneq %rdx, %r15
leaq 0x1964c(%rip), %rax     # 0x210a5
leaq 0x1966c(%rip), %r12     # 0x210cc
cmovneq %rax, %r12
cmovneq %r13, %r14
shrq $0x1e, %rbx
movq 0x2453d(%rip), %rdi     # 0x2bfb0
movq %r15, %rsi
callq 0x5450
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5330
movq %rax, %rdi
movq %r12, %rsi
callq 0x5450
movq %rax, %rdi
callq 0x5230
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/helchr[P]reMap/main.cpp
// Function: getUsedSets(std::map<unsigned long, std::vector<unsigned long, std::allocator<unsigned long>>, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, std::vector<unsigned long, std::allocator<unsigned long>>>>>)
std::vector<uint64_t> getUsedSets(AddressSet addressSet)
{
    std::vector<uint64_t> usedSets;
    for(auto list : addressSet)
    {
        if(!list.second.empty())
        {
            usedSets.push_back(list.first);
        }
    }
    return usedSets;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq 0x18(%rsi), %r12
addq $0x8, %r14
leaq 0x8(%rsp), %r15
movq %rsp, %r13
cmpq %r14, %r12
je 0x7b12
leaq 0x20(%r12), %rsi
movq %r13, %rdi
callq 0x97ca
movq 0x8(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0x7afd
movq %rbx, %rdi
movq %r13, %rsi
callq 0x97de
movq %r15, %rdi
callq 0xa3b0
movq %r12, %rdi
callq 0x5350
movq %rax, %r12
jmp 0x7ad4
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
movq %r15, %rdi
callq 0xa3b0
jmp 0x7b33
movq %rax, %r14
movq %rbx, %rdi
callq 0xa3b0
movq %r14, %rdi
callq 0x5790
// File: /workspace/github_cpp_makefile_star2_O2/helchr[P]reMap/main.cpp
// Function: getPhysicalAddr(unsigned long)
uint64_t getPhysicalAddr(uint64_t virtualAddr) {
    uint64_t value;
    off_t offset = (virtualAddr / 4096) * sizeof(value);
    int got = pread(g_pagemap_fd, &value, sizeof(value), offset);
    assert(got == 8);

    // Check the "page present" flag.
    assert(value & (1ULL << 63));
    uint64_t frame_num = frameNumberFromPagemap(value);
    return (frame_num * 4096) | (virtualAddr & (4095));
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rdi, %rcx
shrq $0x9, %rcx
andq $-0x8, %rcx
movl 0x248ac(%rip), %edi     # 0x2c450
leaq 0x8(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x5520
cmpl $0x8, %eax
jne 0x7bd6
movq 0x8(%rsp), %rax
testq %rax, %rax
jns 0x7bf3
shlq $0xc, %rax
andl $0xfff, %ebx            # imm = 0xFFF
orq %rax, %rbx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
leaq 0x19533(%rip), %rdi     # 0x21110
leaq 0x19510(%rip), %rsi     # 0x210f4
leaq 0x1952e(%rip), %rcx     # 0x21119
pushq $0x7f
popq %rdx
callq 0x5320
leaq 0x19542(%rip), %rdi     # 0x2113c
leaq 0x194f3(%rip), %rsi     # 0x210f4
leaq 0x19511(%rip), %rcx     # 0x21119
movl $0x82, %edx
callq 0x5320
// File: /workspace/github_cpp_makefile_star2_O2/helchr[P]reMap/main.cpp
// Function: access(unsigned long, unsigned long)
void access(uint64_t addr,size_t numAccess)
{
    volatile uint64_t *p = (volatile uint64_t *) addr;
    for (unsigned int i = 0; i < numAccess; i++)
    {
        _mm_clflush((void*)p);
        _mm_lfence();
        *p;
        _mm_lfence();
    }
}

// Assembly:
xorl %eax, %eax
movl %eax, %ecx
cmpq %rsi, %rcx
jae 0x7c2b
clflush (%rdi)
lfence
movq (%rdi), %rcx
lfence
incl %eax
jmp 0x7c14
retq
// File: /workspace/github_cpp_makefile_star2_O2/helchr[P]reMap/main.cpp
// Function: stopMeasure(int)
long long stopMeasure(int fd)
{
    long long count;
    _mm_mfence();
    ioctl(fd, PERF_EVENT_IOC_DISABLE, 0);
    read(fd, &count, sizeof(long long));
    close(fd);
    return count;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
mfence
movl $0x2401, %esi           # imm = 0x2401
xorl %edx, %edx
xorl %eax, %eax
callq 0x55d0
movq %rsp, %r14
pushq $0x8
popq %rdx
movl %ebx, %edi
movq %r14, %rsi
callq 0x5610
movl %ebx, %edi
callq 0x5860
movq (%r14), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/helchr[P]reMap/main.cpp
// Function: getNextAddress(unsigned long, unsigned long, unsigned long)
uint64_t getNextAddress(uint64_t oldAddr, uint64_t base, uint64_t size)
{
    static const size_t MIN_SHIFT = 6;
    static size_t shift = MIN_SHIFT;
    static uint64_t baseAddr = 0;
    if(shift == MIN_SHIFT)
    {
        baseAddr = oldAddr;
    }
    auto oldPhys = getPhysicalAddr(baseAddr);
    auto addr = baseAddr ^ (1ULL << shift);
    if(addr >= base && addr < base+size)
    {
        volatile uint8_t* p;
        p = (uint8_t*) addr;
        *p;
        auto phys = getPhysicalAddr(addr);
        auto diff = std::bitset<64>(phys) ^ std::bitset<64>(oldPhys);
        if(diff.count() > 1)
        {
            //moved into a new frame
            shift = MIN_SHIFT;
            return getRandomAddress(base,size);
        }
        else
        {
            shift++;
            return addr;
        }
    }
    else
    {
        shift = MIN_SHIFT;
        return getRandomAddress(base,size);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
cmpq $0x6, 0x24603(%rip)     # 0x2c458
jne 0x7e60
movq %rdi, 0x2461a(%rip)     # 0x2c478
jmp 0x7e67
movq 0x24611(%rip), %rdi     # 0x2c478
callq 0x7b8b
movq %rax, %r12
movq 0x24602(%rip), %r15     # 0x2c478
movb 0x245dc(%rip), %al      # 0x2c458
btcq %rax, %r15
cmpq %r14, %r15
setb %al
leaq (%rbx,%r14), %rcx
cmpq %rcx, %r15
setae %cl
orb %al, %cl
jne 0x7eab
movb (%r15), %al
movq %r15, %rdi
callq 0x7b8b
xorq %r12, %rax
leaq -0x1(%rax), %rcx
testq %rcx, %rax
je 0x7ecc
movq $0x6, 0x245a2(%rip) # 0x2c458
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x7e06
incq 0x24585(%rip)           # 0x2c458
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/helchr[P]reMap/main.cpp
// Function: cleanAddresses(std::map<unsigned long, std::vector<unsigned long, std::allocator<unsigned long>>, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, std::vector<unsigned long, std::allocator<unsigned long>>>>>&, unsigned long, unsigned long)
void cleanAddresses(std::map<size_t,std::vector<size_t>>& addresses,
                    uint64_t removeFront, uint64_t removeBack)
{
    auto usableBits = getUsableBits(removeFront,removeBack);
    uint64_t mask = 1;
    mask = mask << usableBits;
    mask = mask - 1ULL;

    for(auto& list : addresses)
    {
        for(auto& a : list.second)
        {
            a >>= removeFront;
            a &= mask;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
leal (%rdx,%rsi), %ecx
negb %cl
pushq $-0x1
popq %r15
shlq %cl, %r15
movq %rdi, %r14
notq %r15
movq 0x18(%rdi), %rax
addq $0x8, %r14
cmpq %r14, %rax
je 0x7f3e
movq 0x28(%rax), %rdx
movq 0x30(%rax), %rsi
cmpq %rsi, %rdx
je 0x7f34
movq (%rdx), %rdi
movl %ebx, %ecx
shrq %cl, %rdi
andq %r15, %rdi
movq %rdi, (%rdx)
addq $0x8, %rdx
jmp 0x7f1b
movq %rax, %rdi
callq 0x5350
jmp 0x7f0e
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/helchr[P]reMap/main.cpp
// Function: calculateAddressingFunction(std::map<unsigned long, std::vector<unsigned long, std::allocator<unsigned long>>, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, std::vector<unsigned long, std::allocator<unsigned long>>>>> const&, unsigned long, unsigned long)
std::vector<Solver::Solution> calculateAddressingFunction(const std::map<size_t,std::vector<size_t>>& addresses, size_t addrFuncBits, size_t usableBits)
{
    std::vector<Solver::Solution> sList;
    for(size_t bit = 0; bit < addrFuncBits; bit++)
    {
        std::vector<uint64_t> matrix;
        Solver s;
        for(auto adrList : addresses)
        {
            uint64_t mask = 1ULL << bit;
            auto bitValue = (adrList.first & mask) >> bit;
            for(auto row : adrList.second)
            {
                auto rowWithResult = (row << 1ULL) | bitValue;
                matrix.push_back(rowWithResult);
            }
        }
        s.solve(matrix,usableBits);
        auto sol = s.getSolution(matrix);
        sList.push_back(sol);
    }
    return sList;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, 0x20(%rsp)
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
movq %rdi, 0x8(%rsp)
movups %xmm0, (%rdi)
movq %rsi, 0x18(%rsp)
leaq 0x8(%rsi), %rax
movq %rax, 0x30(%rsp)
xorl %r13d, %r13d
leaq 0x40(%rsp), %rbx
leaq 0x60(%rsp), %rbp
leaq 0x38(%rsp), %r15
cmpq 0x20(%rsp), %r13
je 0x807a
andq $0x0, 0x50(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movb $0x0, 0x7(%rsp)
movq 0x18(%rsp), %rax
movq 0x18(%rax), %r12
movq %r13, 0x28(%rsp)
cmpq 0x30(%rsp), %r12
je 0x8032
leaq 0x20(%r12), %rsi
movq %rbp, %rdi
callq 0x97ca
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %r14
xorl %ebp, %ebp
btq %r13, %rax
setb %bpl
movq 0x70(%rsp), %r13
cmpq %r13, %r14
je 0x8011
movq (%r14), %rax
leaq (,%rax,2), %rax
addq %rbp, %rax
movq %rax, 0x38(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x97de
addq $0x8, %r14
jmp 0x7fe8
leaq 0x68(%rsp), %rdi
callq 0xa3b0
movq %r12, %rdi
callq 0x54c0
movq %rax, %r12
movq 0x28(%rsp), %r13
leaq 0x60(%rsp), %rbp
jmp 0x7fbb
leaq 0x7(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq 0x10(%rsp), %rdx
callq 0xb852
movq %rbp, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xb90c
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x9820
movq %rbp, %rdi
callq 0x9850
movq %rbx, %rdi
callq 0xa3b0
incq %r13
jmp 0x7f8f
movq 0x8(%rsp), %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x80a4
jmp 0x80a4
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x9850
jmp 0x80b6
movq %rax, %rbx
jmp 0x80b6
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0xa3b0
leaq 0x40(%rsp), %rdi
callq 0xa3b0
movq 0x8(%rsp), %rdi
callq 0x9874
movq %rbx, %rdi
callq 0x5790
// File: /workspace/github_cpp_makefile_star2_O2/helchr[P]reMap/main.cpp
// Function: printSolution(Solver::Solution const&, unsigned long)
void printSolution(const Solver::Solution& s, size_t offset)
{
    if(s.exists)
    {
        std::cout << "Involved bits: ";
        for (auto b : s.involvedBits)
        {
            std::cout << offset + b << " ";
        }
        std::cout << std::endl;
        std::cout << "Uninvolved bits: ";
        for (auto b : s.uninvolvedBits)
        {
            std::cout << offset + b << " ";
        }
        std::cout << std::endl;
        std::cout << "Unknown bits: ";
        for (auto b : s.unknownBits)
        {
            std::cout << offset + b << " ";
        }
        std::cout << std::endl;
    }
    else
    {
        std::cout << "No solution exists" << std::endl;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x1, (%rdi)
jne 0x8139
movq %rsi, %rbx
movq %rdi, %r14
movq 0x23ec1(%rip), %r15     # 0x2bfb0
leaq 0x1909f(%rip), %rsi     # 0x21195
movq %r15, %rdi
callq 0x5450
movq 0x20(%r14), %r13
leaq 0x10(%r14), %rbp
leaq 0x19303(%rip), %r12     # 0x21410
cmpq %rbp, %r13
je 0x8165
movq 0x20(%r13), %rsi
addq %rbx, %rsi
movq %r15, %rdi
callq 0x5340
movq %rax, %rdi
movq %r12, %rsi
callq 0x5450
movq %r13, %rdi
callq 0x54c0
movq %rax, %r13
jmp 0x810d
movq 0x23e70(%rip), %rdi     # 0x2bfb0
leaq 0x1907f(%rip), %rsi     # 0x211c6
callq 0x5450
movq %rax, %r15
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5230
movq 0x23e44(%rip), %r15     # 0x2bfb0
movq %r15, %rdi
callq 0x5230
leaq 0x1902a(%rip), %rsi     # 0x211a5
movq %r15, %rdi
callq 0x5450
movq 0x50(%r14), %r13
leaq 0x40(%r14), %rbp
leaq 0x1927e(%rip), %r12     # 0x21410
cmpq %rbp, %r13
je 0x81be
movq 0x20(%r13), %rsi
addq %rbx, %rsi
movq %r15, %rdi
callq 0x5340
movq %rax, %rdi
movq %r12, %rsi
callq 0x5450
movq %r13, %rdi
callq 0x54c0
movq %rax, %r13
jmp 0x8192
movq %r15, %rdi
callq 0x5230
leaq 0x18fea(%rip), %rsi     # 0x211b7
movq %r15, %rdi
callq 0x5450
movq 0x80(%r14), %r13
addq $0x70, %r14
leaq 0x19229(%rip), %r12     # 0x21410
cmpq %r14, %r13
je 0x814f
movq 0x20(%r13), %rsi
addq %rbx, %rsi
movq %r15, %rdi
callq 0x5340
movq %rax, %rdi
movq %r12, %rsi
callq 0x5450
movq %r13, %rdi
callq 0x54c0
movq %rax, %r13
jmp 0x81e7
// File: /workspace/github_cpp_makefile_star2_O2/helchr[P]reMap/main.cpp
// Function: compactSets(std::map<unsigned long, std::vector<unsigned long, std::allocator<unsigned long>>, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, std::vector<unsigned long, std::allocator<unsigned long>>>>> const&)
std::map<size_t,std::vector<uint64_t>> compactSets(const std::map<size_t,std::vector<uint64_t>>& addresses)
{
    std::map<size_t,std::vector<uint64_t>> newAddresses;
    size_t newIdx = 0;
    for(const auto& adr : addresses)
    {
        if(!adr.second.empty())
        {
            newAddresses.insert(make_pair(newIdx,adr.second));
            newIdx++;
        }
    }
    return newAddresses;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
andl $0x0, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
movq %rsi, %r14
leaq 0x8(%rdi), %rax
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
andq $0x0, 0x28(%rdi)
movq 0x18(%rsi), %r12
addq $0x8, %r14
leaq 0x10(%rsp), %r15
xorl %ebp, %ebp
leaq 0x8(%rsp), %r13
cmpq %r14, %r12
je 0x832f
movq 0x28(%r12), %rax
cmpq 0x30(%r12), %rax
je 0x8322
leaq 0x28(%r12), %rsi
movq %rbp, 0x8(%rsp)
movq %r15, %rdi
callq 0x9ad4
movq %rbx, %rdi
movq %r13, %rsi
callq 0xaaca
movq %r15, %rdi
callq 0xa3b0
incq %rbp
movq %r12, %rdi
callq 0x54c0
movq %rax, %r12
jmp 0x82e9
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %r15, %rdi
callq 0xa3b0
jmp 0x8351
movq %rax, %r14
movq %rbx, %rdi
callq 0x9c64
movq %r14, %rdi
callq 0x5790
// File: /workspace/github_cpp_makefile_star2_O2/helchr[P]reMap/main.cpp
// Function: prepareSolvePrint(std::map<unsigned long, std::vector<unsigned long, std::allocator<unsigned long>>, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, std::vector<unsigned long, std::allocator<unsigned long>>>>>, unsigned long, unsigned long)
void prepareSolvePrint(AddressSet adrs,size_t removeFront, size_t removeBack)
{
    cleanAddresses(adrs,removeFront,removeBack);
    adrs = compactSets(adrs);
    auto expectedBits = static_cast<size_t>(ceil(log2(adrs.size())));
    auto cSol = calculateAddressingFunction(adrs,expectedBits,getUsableBits(removeFront,removeBack));
    printSolutions(cSol,removeFront);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
callq 0x7eec
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x82a7
movq %r14, %rdi
movq %r12, %rsi
callq 0x9cc8
movq %r12, %rdi
callq 0x9c64
movq 0x28(%r14), %rdi
callq 0x9895
callq 0x50a0
cvttsd2si %xmm0, %rax
movq %rax, %rcx
subsd 0x18c85(%rip), %xmm0    # 0x21040
sarq $0x3f, %rcx
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
addq %rbx, %r15
pushq $0x40
popq %rcx
subq %r15, %rcx
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x7f44
movq %rsp, %rdi
movq %r15, %rsi
callq 0x98bc
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x8217
movq %rsp, %rdi
callq 0x9874
leaq 0x18(%rsp), %rdi
callq 0x9874
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x9874
jmp 0x8427
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x9874
movq %rbx, %rdi
callq 0x5790
// File: /workspace/github_cpp_makefile_star2_O2/helchr[P]reMap/solver.cpp
// Function: Solver::getSetBit(std::bitset<64ul>)
size_t Solver::getSetBit(std::bitset<bitSize> bits)
{
    for(size_t i = 0; i < bitSize; i++ )
    {
        if(bits[i] == 1)
        {
            return i;
        }
    }
    return std::numeric_limits<size_t>::max();
}

// Assembly:
xorl %ecx, %ecx
pushq $-0x1
popq %rax
cmpq $0x40, %rcx
je 0xb7b5
btq %rcx, %rsi
jb 0xb7b2
incq %rcx
jmp 0xb7a1
movq %rcx, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/helchr[P]reMap/solver.cpp
// Function: Solver::solve(std::vector<unsigned long, std::allocator<unsigned long>>&, unsigned long)
void Solver::solve(Matrix& matrix, size_t colMax)
{
    for(size_t c = colMax, r = 0; c-- > 1 && r < matrix.size();)
    {
        uint64_t mask = 1ULL << c;
        if((matrix[r] & mask) == 1)
        {
            xorRows(matrix,r,c);
            r++;
        }
        else
        {
            auto rowToSwap = findRowToSwap(matrix,r,c);
            if(rowToSwap == r)
            {
                //move to next column, stay in same row
                continue;
            }
            else
            {
                swapRows(matrix,r,rowToSwap);
                xorRows(matrix,r,c);
                r++;
            }
        }
        if(debug)
        {
            printMatrix(matrix);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, 0x10(%rsp)
xorl %r12d, %r12d
movq %rsi, 0x8(%rsp)
movq (%rbx), %r14
movq 0x8(%rbx), %rbp
subq %r14, %rbp
sarq $0x3, %rbp
movq %r15, %r13
cmpq $0x2, %r13
jb 0xb8fc
cmpq %rbp, %r12
jae 0xb8fc
movq %r13, %r15
decq %r13
pushq $0x1
popq %rax
movl %r13d, %ecx
shlq %cl, %rax
movq (%r14,%r12,8), %rbx
andq %rbx, %rax
cmpq $0x1, %rax
je 0xb8cc
movq 0x8(%rsp), %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0xb71c
cmpq %r12, %rax
je 0xb884
movq (%r14,%rax,8), %rcx
movq %rcx, (%r14,%r12,8)
movq %rbx, (%r14,%rax,8)
decq %r15
movq 0x8(%rsp), %rbx
movq %rbx, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0xb6e0
incq %r12
movq 0x10(%rsp), %rax
cmpb $0x1, (%rax)
jne 0xb873
movq %rbx, %rsi
callq 0xb746
jmp 0xb873
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/helchr[P]reMap/sysinfo.cpp
// Function: SysInfo::readRegister(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int)
unsigned int SysInfo::readRegister(const std::string& path, unsigned int offset)
{
    std::ifstream ifs(path,std::ios::in|std::ios::binary);
    if(!ifs.good())
    {
        throw(std::runtime_error("Can not open file at " + path));
    }
    ifs.ignore(offset);
    if(!ifs.good())
    {
        throw(std::runtime_error("Offset " + std::to_string(offset) + " is not within file " + path));
    }
    unsigned int reg = 0;
    ifs.read((char*)&reg,sizeof(reg));
    return reg;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x290, %rsp            # imm = 0x290
movl %esi, %ebp
movq %rdi, %r14
leaq 0x88(%rsp), %rbx
pushq $0xc
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5710
movq (%rbx), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0xa8(%rsp,%rax)
jne 0xbf9f
movl %ebp, %esi
leaq 0x88(%rsp), %rdi
callq 0x5060
movq 0x88(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0xa8(%rsp,%rax)
jne 0xbfe8
leaq 0x8(%rsp), %rsi
andl $0x0, (%rsi)
leaq 0x88(%rsp), %rdi
pushq $0x4
popq %rdx
callq 0x5540
movl 0x8(%rsp), %ebx
leaq 0x88(%rsp), %rdi
callq 0x5120
movl %ebx, %eax
addq $0x290, %rsp            # imm = 0x290
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x5240
movq %rax, %rbx
leaq 0x1561e(%rip), %rsi     # 0x215cf
leaq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0xcc65
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5720
xorl %ebp, %ebp
movq 0x20019(%rip), %rsi     # 0x2bff0
movq 0x1ffb2(%rip), %rdx     # 0x2bf90
movq %rbx, %rdi
callq 0x5750
jmp 0xc065
pushq $0x10
popq %rdi
callq 0x5240
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
movl %ebp, %esi
callq 0xcd3d
leaq 0x155df(%rip), %rsi     # 0x215e5
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0xcd19
leaq 0x155d1(%rip), %rdx     # 0x215ed
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0xccfa
leaq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
movq %r14, %rdx
callq 0xccdb
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5720
xorl %ebp, %ebp
movq 0x1ff9a(%rip), %rsi     # 0x2bff0
movq 0x1ff33(%rip), %rdx     # 0x2bf90
movq %rbx, %rdi
callq 0x5750
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x5888
jmp 0xc07a
movq %rax, %r14
movb $0x1, %bpl
leaq 0x68(%rsp), %rdi
callq 0x5888
jmp 0xc08c
movq %rax, %r14
movb $0x1, %bpl
leaq 0x48(%rsp), %rdi
callq 0x5888
jmp 0xc09e
movq %rax, %r14
movb $0x1, %bpl
leaq 0x28(%rsp), %rdi
jmp 0xc0af
jmp 0xc0bb
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x5888
testb %bpl, %bpl
jne 0xc0be
jmp 0xc0cd
movq %rax, %r14
movq %rbx, %rdi
callq 0x5380
jmp 0xc0cd
jmp 0xc0ca
movq %rax, %r14
leaq 0x88(%rsp), %rdi
callq 0x5120
movq %r14, %rdi
callq 0x5790
// File: /workspace/github_cpp_makefile_star2_O2/helchr[P]reMap/sysinfo.cpp
// Function: SysInfo::getNumberOfChannels(unsigned int, unsigned int)
unsigned int SysInfo::getNumberOfChannels(unsigned int socket, unsigned int controller)
{
    unsigned int count = 0;
    for(unsigned int i = 0; i < 4; i++)
    {
        std::string path = pciDevPath + socketIds.at(socket) +"/" + controllerIds.at(controller) + "." + channelIds.at(i);
        if(fs::exists(path))
        {
            count++;
        }
    }
    return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %edi, %eax
movq %rax, 0x10(%rsp)
movl %esi, %eax
movq %rax, 0x8(%rsp)
xorl %r15d, %r15d
leaq 0x58(%rsp), %r12
leaq 0x98(%rsp), %rbx
leaq 0x78(%rsp), %r14
xorl %ebp, %ebp
cmpq $0x4, %r15
je 0xc206
leaq 0x20367(%rip), %rdi     # 0x2c490
movq 0x10(%rsp), %rsi
callq 0xcdb4
leaq 0x38(%rsp), %r13
movq %r13, %rdi
leaq 0x203b6(%rip), %rsi     # 0x2c4f8
movq %rax, %rdx
callq 0xcd7c
leaq 0x18(%rsp), %rdi
movq %r13, %rsi
leaq 0x15474(%rip), %rdx     # 0x215cd
callq 0xccfa
leaq 0x20343(%rip), %rdi     # 0x2c4a8
movq 0x8(%rsp), %rsi
callq 0xcdb4
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
movq %rax, %rdx
callq 0xccdb
movq %rbx, %rdi
movq %r12, %rsi
leaq 0x151d2(%rip), %rdx     # 0x2135e
callq 0xccfa
leaq 0x20348(%rip), %rdi     # 0x2c4e0
movq %r15, %rsi
callq 0xcdb4
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0xccdb
movq %rbx, %rdi
callq 0x5888
movq %r12, %rdi
callq 0x5888
leaq 0x18(%rsp), %rdi
callq 0x5888
leaq 0x38(%rsp), %rdi
callq 0x5888
movq %rbx, %rdi
movq %r14, %rsi
callq 0xcdf0
movq %rbx, %rdi
callq 0xcdd5
movl %eax, %r13d
movq %rbx, %rdi
callq 0xd068
movzbl %r13b, %eax
addl %eax, %ebp
movq %r14, %rdi
callq 0x5888
incq %r15
jmp 0xc118
movl %ebp, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xc22f
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0xd068
leaq 0x78(%rsp), %rdi
jmp 0xc26e
movq %rax, %rbx
jmp 0xc269
movq %rax, %rbx
jmp 0xc250
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x5888
leaq 0x58(%rsp), %rdi
callq 0x5888
jmp 0xc25f
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x5888
leaq 0x38(%rsp), %rdi
callq 0x5888
movq %rbx, %rdi
callq 0x5790
nop
// File: /workspace/github_cpp_makefile_star2_O2/helchr[P]reMap/sysinfo.cpp
// Function: SysInfo::getTadRegions(unsigned int)
std::map<size_t,std::vector<SysInfo::TadRegion>> SysInfo::getTadRegions(unsigned int socket)
{
    std::map<size_t,std::vector<TadRegion>> regions; //must be ordered map
    for(unsigned int contr = 0; contr < 2; contr++)
    {
        size_t lastLimit = 0;
        unsigned int i = 0;
        auto reg = readTadRegion(socket,contr,i);
        auto regionLimit = getRegionLimitAddress(reg);
        while(lastLimit != regionLimit)
        {
            TadRegion r;
            r.limitAddress = regionLimit;
            r.socketInterleaving = getSocketInterleaving(reg);
            r.channelInterleaving = getChannelInterleaving(reg);
            regions[regionLimit].push_back(r);
            i++;
            lastLimit = regionLimit;
            reg = readTadRegion(socket,contr,i);
            regionLimit =  getRegionLimitAddress(reg);
        }
    }
    return regions;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x8(%rdi), %rax
andl $0x0, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
andq $0x0, 0x28(%rdi)
xorl %r14d, %r14d
leaq 0x8(%rsp), %r12
cmpl $0x2, %r14d
je 0xcb3b
movl %ebp, %edi
movl %r14d, %esi
xorl %edx, %edx
callq 0xc27c
movl %eax, %ecx
shrl $0xc, %ecx
shlq $0x1a, %rcx
movq %rcx, (%rsp)
pushq $0x1
popq %r13
xorl %r15d, %r15d
cmpq %rcx, %r15
je 0xcb33
movq %rcx, 0x8(%rsp)
movl %eax, %ecx
shrl $0xa, %ecx
andb $0x3, %cl
incb %cl
movb %cl, 0x10(%rsp)
shrl $0x8, %eax
andb $0x3, %al
incb %al
movb %al, 0x11(%rsp)
movq %rbx, %rdi
movq %rsp, %rsi
callq 0xcef4
movq %rax, %rdi
movq %r12, %rsi
callq 0xcf44
movq (%rsp), %r15
movl %ebp, %edi
movl %r14d, %esi
movl %r13d, %edx
callq 0xc27c
movl %eax, %ecx
shrl $0xc, %ecx
shlq $0x1a, %rcx
movq %rcx, (%rsp)
incl %r13d
jmp 0xcad7
incl %r14d
jmp 0xcaad
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xcb4f
movq %rax, %r14
movq %rbx, %rdi
callq 0xa2b8
movq %r14, %rdi
callq 0x5790
// File: /workspace/github_cpp_makefile_star2_O2/helchr[P]reMap/sysinfo.cpp
// Function: SysInfo::getTypeOfImc(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
unsigned int SysInfo::getTypeOfImc(const std::string& path)
{
    std::ifstream ifs(path+"/type");
    unsigned int type;
    ifs >> type;
    return type;
}

// Assembly:
pushq %rbx
subq $0x230, %rsp            # imm = 0x230
movq %rdi, %rsi
leaq 0x14ab0(%rip), %rdx     # 0x2162c
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xce42
leaq 0x28(%rsp), %rdi
pushq $0x8
popq %rdx
movq %rbx, %rsi
callq 0x5710
leaq 0x8(%rsp), %rdi
callq 0x5888
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x5770
movl 0x8(%rsp), %ebx
leaq 0x28(%rsp), %rdi
callq 0x5120
movl %ebx, %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbx
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x5120
jmp 0xcbe7
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5888
movq %rbx, %rdi
callq 0x5790
nop
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH02_VariablesAndBasicTypes/examples/convs.cc
// Function: main
int main()
{
	int i = 42;
	std::cout << i << std::endl; // prints 42
	if (i) // condition will evaluate as true
		i = 0;
	std::cout << i << std::endl; // prints 0

	bool b = 42;            // b is true
	std::cout << b << std::endl; // prints 1

	int j = b;              // j has value 1
	std::cout << j << std::endl; // prints 1

	double pi = 3.14;       // pi has value 3.14
	std::cout << pi << std::endl; // prints 3.14

	j = pi;                 // j has value 3
	std::cout << j << std::endl; // prints 3

	unsigned char c = -1;   // assuming 8-bit chars, c has value 255
	i = c;  // the character with value 255 is an unprintable character
	        // assigns value of c (i.e., 255) to an int
	std::cout << i << std::endl; // prints 255
	
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq 0x2dfe(%rip), %rbx      # 0x3fd8
pushq $0x2a
popq %rsi
movq %rbx, %rdi
callq 0x1080
movq %rax, %rdi
callq 0x1030
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1080
movq %rax, %rdi
callq 0x1030
pushq $0x1
popq %r14
movq %rbx, %rdi
movl %r14d, %esi
callq 0x1070
movq %rax, %rdi
callq 0x1030
movq %rbx, %rdi
movl %r14d, %esi
callq 0x1080
movq %rax, %rdi
callq 0x1030
movsd 0xdd7(%rip), %xmm0      # 0x2008
movq %rbx, %rdi
callq 0x1060
movq %rax, %rdi
callq 0x1030
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x1080
movq %rax, %rdi
callq 0x1030
movq %rbx, %rdi
movl $0xff, %esi
callq 0x1080
movq %rax, %rdi
callq 0x1030
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/SeTriones[P]Anubis/double_linked_list.c
// Function: init_list
double_linked_list* init_list() {
	double_linked_list* ret = (double_linked_list*)malloc(sizeof(double_linked_list));
	if (!ret) {
		return NULL;
	}
	ret->header = NULL;
	ret->tail = ret->header;
	ret->node_cnt = 0;
	return ret;
}

// Assembly:
pushq %rax
pushq $0x18
popq %rdi
callq 0x22a0
testq %rax, %rax
je 0x2524
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
andl $0x0, 0x10(%rax)
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O2/SeTriones[P]Anubis/double_linked_list.c
// Function: destroy_list
void destroy_list(double_linked_list* lst) {
	if (lst == NULL) {
		return;
	}
	node* n = lst->header;
	if (n == NULL) {
		return;
	}
	node* cur;
	while (n) {
		cur = n;
		n = n->next;
		free(cur);
	}
	free(lst);
	return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x253a
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
jne 0x254e
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x10(%rdi), %r14
callq 0x2250
movq %r14, %rdi
testq %rdi, %rdi
jne 0x2542
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/SeTriones[P]Anubis/double_linked_list.c
// Function: rm_node_from_tail
int rm_node_from_tail(double_linked_list* lst, int cnt, uint64_t* keys) {
	node* n = lst->tail;
	node* cur;
	int ret = 0;
	keys = (uint64_t*)malloc(sizeof(uint64_t) * cnt);
	while (n && cnt > 0) {
		cur = n;
		n = n->prev;

		keys[ret] = cur->key;
		free(cur);

		cnt--;
		lst->node_cnt--;
		ret++;
	}
	lst->tail = n;
	if (!n) {
		lst->header = NULL;
	}
	return ret; 
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
xorl %r14d, %r14d
testq %rdi, %rdi
je 0x25f7
leal (%r15,%r14), %eax
testl %eax, %eax
jle 0x25f7
movq 0x8(%rdi), %r12
callq 0x2250
decl 0x10(%rbx)
decl %r14d
movq %r12, %rdi
jmp 0x25d6
negl %r14d
movq %rdi, 0x8(%rbx)
testq %rdi, %rdi
jne 0x2607
andq $0x0, (%rbx)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/SeTriones[P]Anubis/double_linked_list.c
// Function: push_from_header
int push_from_header(double_linked_list* lst, node* n) {
	n->next = lst->header;
	n->prev = NULL;
	if (lst->header) {
		lst->header->prev = n;
	}
	lst->header = n;
	return ++lst->node_cnt;
}

// Assembly:
movq (%rdi), %rax
movq %rax, 0x10(%rsi)
andq $0x0, 0x8(%rsi)
testq %rax, %rax
je 0x262b
movq %rsi, 0x8(%rax)
movq %rsi, (%rdi)
movl 0x10(%rdi), %eax
incl %eax
movl %eax, 0x10(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/SeTriones[P]Anubis/double_linked_list.c
// Function: push_from_tail
int push_from_tail(double_linked_list* lst, node* n) {
	if (lst->tail) {
		lst->tail->next = n;
		n->prev = lst->tail;
		lst->tail = n;
		return ++lst->node_cnt;
	}
	else {
		return push_from_header(lst, n);
	}
}

// Assembly:
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x2616
movq %rsi, 0x10(%rax)
movq %rax, 0x8(%rsi)
movq %rsi, 0x8(%rdi)
movl 0x10(%rdi), %eax
incl %eax
movl %eax, 0x10(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/SeTriones[P]Anubis/acceptor.cpp
// Function: acceptor::acceptor(int, int)
acceptor::acceptor(int _epoll_cnt, int _max_conn) {
	epoll_cnt = _epoll_cnt;
	max_conn = _max_conn;
	_INFO("epoll_cnt=%d,max_conn=%d", epoll_cnt, max_conn);
	listen_port = -1;
	stop_task = 0;
	conn_num = 0;
	wid = 0;
	epoll_fds = new int[epoll_cnt];
	epoll_ready_event_num = new int[epoll_cnt];
	pipe_read_fds = new int[epoll_cnt];
	pipe_write_fds = new int[epoll_cnt];
	add_sum = 2;
	for (int i = 0; i < epoll_cnt; i++) {
		epoll_ready_event_num[i] = 0;
	}
	epoll_mutexes = new pthread_mutex_t[epoll_cnt];
	for (int i = 0; i < epoll_cnt; i++) {
		pthread_mutex_init(&epoll_mutexes[i], NULL);
	}
	epoll_ready_events = new epoll_event*[epoll_cnt];
	for (int i = 0; i < epoll_cnt; i++) {
		epoll_ready_events[i] = new epoll_event[max_conn];
	}
	pthread_mutex_init(&epoll_idx_mutex, NULL);
	incoming_fd_cnt = 0;
	epoll_thread_cnt = 0;
	pthread_mutex_init(&conn_mutex, NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movl %esi, 0x4(%rdi)
movl %edx, (%rdi)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x21d0
leaq 0x30(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2100
leaq 0x392e(%rip), %rdx      # 0x6004
leaq 0x10(%rsp), %r14
pushq $0x12
popq %rsi
movq %r14, %rdi
movq %r15, %rcx
callq 0x2180
movq 0x78e8(%rip), %rax      # 0x9fd8
movq (%rax), %r15
callq 0x21b0
movl (%rbx), %ecx
movl 0x4(%rbx), %r9d
movl %ecx, (%rsp)
leaq 0x390c(%rip), %rsi      # 0x6014
leaq 0x3a6c(%rip), %r8       # 0x617b
xorl %ebp, %ebp
movq %r15, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x22e0
orl $-0x1, 0x8(%rbx)
andq $0x0, 0x18(%rbx)
andl $0x0, 0x20(%rbx)
movslq 0x4(%rbx), %r14
leaq (,%r14,4), %r12
testq %r14, %r14
pushq $-0x1
popq %r13
cmovsq %r13, %r12
movq %r12, %rdi
callq 0x2030
movq %rax, 0x10(%rbx)
movq %r12, %rdi
callq 0x2030
movq %rax, %r15
movq %rax, 0x88(%rbx)
movq %r12, %rdi
callq 0x2030
movq %rax, 0x90(%rbx)
movq %r12, %rdi
callq 0x2030
movq %rax, 0x98(%rbx)
movl $0x2, 0xa8(%rbx)
testl %r14d, %r14d
movl $0x0, %eax
cmovgl %r14d, %eax
cmpq %rbp, %rax
je 0x27a6
andl $0x0, (%r15,%rbp,4)
incq %rbp
jmp 0x2797
pushq $0x28
popq %rcx
movq %r14, %rax
mulq %rcx
cmovoq %r13, %rax
movq %rax, %rdi
callq 0x2030
movq %rax, 0x28(%rbx)
xorl %r12d, %r12d
xorl %ebp, %ebp
movslq %r14d, %r15
cmpq %r15, %rbp
jge 0x27e7
movq 0x28(%rbx), %rdi
addq %r12, %rdi
xorl %esi, %esi
callq 0x2320
incq %rbp
movl 0x4(%rbx), %r14d
addq $0x28, %r12
jmp 0x27c4
leaq (,%r15,8), %rdi
xorl %r12d, %r12d
testl %r15d, %r15d
cmovsq %r13, %rdi
cmovlel %r12d, %r15d
callq 0x2030
movq %rax, 0x80(%rbx)
movslq (%rbx), %rax
pushq $0xc
popq %rcx
mulq %rcx
movq %rax, %r14
cmovoq %r13, %r14
cmpq %r12, %r15
je 0x2836
movq %r14, %rdi
callq 0x2030
movq 0x80(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
jmp 0x2819
leaq 0x58(%rbx), %rdi
xorl %esi, %esi
callq 0x2320
andq $0x0, 0xa0(%rbx)
addq $0x30, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2320
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/SeTriones[P]Anubis/acceptor.cpp
// Function: acceptor::~acceptor()
acceptor::~acceptor() {
	delete[] epoll_fds;
	delete[] epoll_ready_event_num;
	delete[] pipe_read_fds;
	delete[] pipe_write_fds;
	for (int i = 0; i < epoll_cnt; i++) {
		pthread_mutex_destroy(&epoll_mutexes[i]);
	}
	delete[] epoll_mutexes;
	for (int i = 0; i < epoll_cnt; i++) {
		delete[] epoll_ready_events[i];
	}
	delete[] epoll_ready_events;
	pthread_mutex_destroy(&epoll_idx_mutex);
	pthread_mutex_destroy(&conn_mutex);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x287c
callq 0x2270
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0x288d
callq 0x2270
movq 0x90(%rbx), %rdi
testq %rdi, %rdi
je 0x289e
callq 0x2270
movq 0x98(%rbx), %rdi
testq %rdi, %rdi
je 0x28af
callq 0x2270
xorl %r14d, %r14d
xorl %r15d, %r15d
movslq 0x4(%rbx), %rax
movq 0x28(%rbx), %rdi
cmpq %rax, %r15
jge 0x28d3
addq %r14, %rdi
callq 0x2230
incq %r15
addq $0x28, %r14
jmp 0x28b5
testq %rdi, %rdi
je 0x28dd
callq 0x2270
xorl %r14d, %r14d
movslq 0x4(%rbx), %rax
movq 0x80(%rbx), %rdi
cmpq %rax, %r14
jge 0x2903
movq (%rdi,%r14,8), %rdi
testq %rdi, %rdi
je 0x28fe
callq 0x2270
incq %r14
jmp 0x28e0
testq %rdi, %rdi
je 0x290d
callq 0x2270
leaq 0x58(%rbx), %rdi
callq 0x2230
addq $0x30, %rbx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2230
nop
// File: /workspace/github_cpp_makefile_star2_O2/SeTriones[P]Anubis/acceptor.cpp
// Function: acceptor::recycle_fd(int, int)
int acceptor::recycle_fd(int fd, int epoll_idx) {
	if (epoll_idx < 0 || epoll_idx >= epoll_cnt) {
		_ERROR("err epollidx=%d", epoll_idx);
		return -1;
	}
	return add_input_fd(fd, epoll_fds[epoll_idx]);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movl %edx, %ebx
testl %edx, %edx
js 0x2953
cmpl %ebx, 0x4(%rdi)
jle 0x2953
movq 0x10(%rdi), %rax
movl %ebx, %ecx
movl (%rax,%rcx,4), %edx
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x29c8
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x21d0
leaq 0x28(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2100
leaq 0x368d(%rip), %rdx      # 0x6004
leaq 0x10(%rsp), %r14
pushq $0x12
popq %rsi
movq %r14, %rdi
movq %r15, %rcx
callq 0x2180
movq 0x7647(%rip), %rax      # 0x9fd8
movq (%rax), %r15
callq 0x21b0
leaq 0x36a5(%rip), %rsi      # 0x6045
leaq 0x37d4(%rip), %r8       # 0x617b
movq %r15, %rdi
movq %r14, %rdx
movq %rax, %rcx
movl %ebx, %r9d
xorl %eax, %eax
callq 0x22e0
pushq $-0x1
popq %rax
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/SeTriones[P]Anubis/acceptor.cpp
// Function: acceptor::add_input_fd(int, int)
int acceptor::add_input_fd(int fd, int efd) {
	epoll_event event;
	event.events = EPOLLIN | EPOLLET;
	event.data.fd = fd;
	int ret = epoll_ctl(efd, EPOLL_CTL_ADD, fd, &event);
	if (ret < 0) {
		_ERROR("add_input_fd err,fd=%d,errno=%d", fd, errno);
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movl %edx, %edi
movl %esi, %ebx
leaq 0x14(%rsp), %rcx
movl $0x80000001, (%rcx)     # imm = 0x80000001
movl %esi, 0x4(%rcx)
pushq $0x1
popq %rsi
movl %ebx, %edx
callq 0x22d0
movl %eax, %ebp
testl %eax, %eax
js 0x2a05
movl %ebp, %eax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x21d0
leaq 0x38(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2100
leaq 0x35db(%rip), %rdx      # 0x6004
leaq 0x20(%rsp), %r14
pushq $0x12
popq %rsi
movq %r14, %rdi
movq %r15, %rcx
callq 0x2180
movq 0x7595(%rip), %rax      # 0x9fd8
movq (%rax), %r15
callq 0x21b0
movq %rax, %r12
callq 0x2040
movl (%rax), %eax
movl %eax, (%rsp)
leaq 0x363f(%rip), %rsi      # 0x609e
leaq 0x3715(%rip), %r8       # 0x617b
movq %r15, %rdi
movq %r14, %rdx
movq %r12, %rcx
movl %ebx, %r9d
xorl %eax, %eax
callq 0x22e0
jmp 0x29f6
// File: /workspace/github_cpp_makefile_star2_O2/SeTriones[P]Anubis/acceptor.cpp
// Function: acceptor::close_fd(int)
int acceptor::close_fd(int fd) {
	int tmp;
	pthread_mutex_lock(&conn_mutex);
	conn_num--;
	tmp = conn_num;
	pthread_mutex_unlock(&conn_mutex);
	_INFO("close fd=%d, conn_num=%d", fd, tmp);
	return close(fd);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x30(%rdi), %r15
movq %r15, %rdi
callq 0x2310
movl 0x1c(%r14), %ebp
decl %ebp
movl %ebp, 0x1c(%r14)
movq %r15, %rdi
callq 0x2160
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x21d0
leaq 0x30(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2100
leaq 0x3535(%rip), %rdx      # 0x6004
leaq 0x10(%rsp), %r14
pushq $0x12
popq %rsi
movq %r14, %rdi
movq %r15, %rcx
callq 0x2180
movq 0x74ef(%rip), %rax      # 0x9fd8
movq (%rax), %r15
callq 0x21b0
movl %ebp, (%rsp)
leaq 0x3572(%rip), %rsi      # 0x606d
leaq 0x3679(%rip), %r8       # 0x617b
movq %r15, %rdi
movq %r14, %rdx
movq %rax, %rcx
movl %ebx, %r9d
xorl %eax, %eax
callq 0x22e0
movl %ebx, %edi
callq 0x2400
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/SeTriones[P]Anubis/acceptor.cpp
// Function: acceptor::create_listen(int&, unsigned short)
int acceptor::create_listen(int &socket_fd, unsigned short port) {
	sockaddr_in addr;
	memset(&addr, 0, sizeof addr);
	addr.sin_family = AF_INET;
	addr.sin_addr.s_addr = INADDR_ANY;
	addr.sin_port = htons(port);

	if ((socket_fd = socket(PF_INET, SOCK_STREAM, 0)) == -1)
		return -1;
	if (set_socket(socket_fd, O_NONBLOCK))
		return -1;
	if (::bind(socket_fd, (const sockaddr*)&addr, sizeof addr))
		return -1;
	if (listen(socket_fd, max_conn))
		return -1;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
andq $0x0, 0x8(%rsp)
movw $0x2, (%rsp)
andl $0x0, 0x4(%rsp)
movq %rdi, %r14
rolw $0x8, %dx
movw %dx, 0x2(%rsp)
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x2080
movl %eax, (%rbx)
pushq $-0x1
popq %rbp
cmpl $-0x1, %eax
je 0x2b98
movl %eax, %esi
movl $0x800, %edx            # imm = 0x800
callq 0x2ba4
testl %eax, %eax
jne 0x2b98
movl (%rbx), %edi
movq %rsp, %rsi
pushq $0x10
popq %rdx
callq 0x2070
testl %eax, %eax
jne 0x2b98
movl (%rbx), %edi
movl (%r14), %esi
callq 0x2210
xorl %ebp, %ebp
negl %eax
sbbl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/SeTriones[P]Anubis/acceptor.cpp
// Function: acceptor::set_socket(int, int)
int acceptor::set_socket(int fd, int flag) {
	int options;
	options = SOCKET_SND_BUF_SIZE;
	setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &options, sizeof(int));
	options = SOCKET_RCV_BUF_SIZE;
	setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &options, sizeof(int));
	options = 1;
	setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &options, sizeof(int));
	options = fcntl(fd, F_GETFL);
	fcntl(fd, F_SETFL, options | flag);
	int on = 1;
	int ret = -1;
	ret = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *)&on, sizeof(on));
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movl %esi, %ebx
movl $0x100000, %r13d        # imm = 0x100000
leaq 0x4(%rsp), %r12
movl %r13d, (%r12)
pushq $0x1
popq %rbp
pushq $0x7
popq %rdx
pushq $0x4
popq %r14
movl %esi, %edi
movl %ebp, %esi
movq %r12, %rcx
movl %r14d, %r8d
callq 0x23b0
movl %r13d, (%r12)
pushq $0x8
popq %rdx
movl %ebx, %edi
movl %ebp, %esi
movq %r12, %rcx
movl %r14d, %r8d
callq 0x23b0
movl %ebp, (%r12)
pushq $0x2
popq %rdx
movl %ebx, %edi
movl %ebp, %esi
movq %r12, %rcx
movl %r14d, %r8d
callq 0x23b0
pushq $0x3
popq %rsi
movl %ebx, %edi
xorl %eax, %eax
callq 0x2120
movl %eax, (%r12)
orl %eax, %r15d
movl %ebx, %edi
movl %r14d, %esi
movl %r15d, %edx
xorl %eax, %eax
callq 0x2120
movq %rsp, %rcx
movl %ebp, (%rcx)
pushq $0x6
popq %rsi
movl %ebx, %edi
movl %ebp, %edx
movl %r14d, %r8d
callq 0x23b0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop