LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/robin_hood/./robin_hood.h
// Function: std::pair<robin_hood::detail::Table<true, 80ul, unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>>::Iter<false>, bool> robin_hood::detail::Table<true, 80ul, unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>>::try_emplace_impl<unsigned int, unsigned int&>(unsigned int&&, unsigned int&)
std::pair<iterator, bool> try_emplace_impl(OtherKey&& key, Args&&... args) {
        ROBIN_HOOD_TRACE(this)
        auto idxAndState = insertKeyPrepareEmptySpot(key);
        switch (idxAndState.second) {
        case InsertionState::key_found:
            break;

        case InsertionState::new_node:
            ::new (static_cast<void*>(&mKeyVals[idxAndState.first])) Node(
                *this, std::piecewise_construct, std::forward_as_tuple(std::forward<OtherKey>(key)),
                std::forward_as_tuple(std::forward<Args>(args)...));
            break;

        case InsertionState::overwrite_node:
            mKeyVals[idxAndState.first] = Node(*this, std::piecewise_construct,
                                               std::forward_as_tuple(std::forward<OtherKey>(key)),
                                               std::forward_as_tuple(std::forward<Args>(args)...));
            break;

        case InsertionState::overflow_error:
            throwOverflowError();
            break;
        }

        return std::make_pair(iterator(mKeyVals + idxAndState.first, mInfo + idxAndState.first),
                              InsertionState::key_found != idxAndState.second);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x16c0
movq %rax, %r15
movl %edx, %ebp
testl %edx, %edx
je 0x1685
cmpl $0x3, %ebp
je 0x166c
cmpl $0x2, %ebp
jne 0x168d
movq 0x8(%r14), %rax
movl (%r13), %ecx
movl %ecx, (%rax,%r15,8)
movl (%r12), %ecx
movl %ecx, 0x4(%rax,%r15,8)
jmp 0x168d
movl (%r13), %eax
movq 0x8(%r14), %rcx
movl (%r12), %edx
shlq $0x20, %rdx
orq %rax, %rdx
movq %rdx, (%rcx,%r15,8)
jmp 0x168d
movq %r14, %rdi
callq 0x180c
movq %r15, %rax
shlq $0x3, %rax
addq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
addq %r15, %rcx
cmpl $0x1, %ebp
movq %rax, (%rbx)
movq %rcx, 0x8(%rbx)
setne 0x10(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/robin_hood/./robin_hood.h
// Function: void robin_hood::detail::Table<true, 80ul, unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>>::keyToIdx<unsigned int&>(unsigned int&, unsigned long*, unsigned int*) const
void keyToIdx(HashKey&& key, size_t* idx, InfoType* info) const {
        // In addition to whatever hash is used, add another mul & shift so we get better hashing.
        // This serves as a bad hash prevention, if the given data is
        // badly mixed.
        auto h = static_cast<uint64_t>(WHash::operator()(key));

        h *= mHashMultiplier;
        h ^= h >> 33U;

        // the lower InitialInfoNumBits are reserved for info.
        *info = mInfoInc + static_cast<InfoType>((h & InfoMask) >> mInfoHashShift);
        *idx = (static_cast<size_t>(h) >> InitialInfoNumBits) & mMask;
    }

// Assembly:
movq %rcx, %rax
movl (%rsi), %ecx
imulq (%rdi), %rcx
movq %rcx, %rsi
shrq $0x21, %rsi
xorq %rcx, %rsi
movl %esi, %r8d
andl $0x1f, %r8d
movb 0x34(%rdi), %cl
shrq %cl, %r8
addl 0x30(%rdi), %r8d
movl %r8d, (%rax)
shrq $0x5, %rsi
andq 0x20(%rdi), %rsi
movq %rsi, (%rdx)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/robin_hood/./robin_hood.h
// Function: robin_hood::detail::Table<true, 80ul, unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>>::increase_size()
bool increase_size() {
        // nothing allocated yet? just allocate InitialNumElements
        if (0 == mMask) {
            initData(InitialNumElements);
            return true;
        }

        auto const maxNumElementsAllowed = calcMaxNumElementsAllowed(mMask + 1);
        if (mNumElements < maxNumElementsAllowed && try_increase_info()) {
            return true;
        }

        ROBIN_HOOD_LOG("mNumElements=" << mNumElements << ", maxNumElementsAllowed="
                                       << maxNumElementsAllowed << ", load="
                                       << (static_cast<double>(mNumElements) * 100.0 /
                                           (static_cast<double>(mMask) + 1)))

        if (mNumElements * 2 < calcMaxNumElementsAllowed(mMask + 1)) {
            // we have to resize, even though there would still be plenty of space left!
            // Try to rehash instead. Delete freed memory so we don't steadyily increase mem in case
            // we have to rehash a few times
            nextHashMultiplier();
            rehashPowerOfTwo(mMask + 1, true);
        } else {
            // we've reached the capacity of the map, so the hash seems to work nice. Keep using it.
            rehashPowerOfTwo((mMask + 1) * 2, false);
        }
        return true;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rcx
testq %rcx, %rcx
je 0x1927
movabsq $0x28f5c28f5c28f5c, %r15 # imm = 0x28F5C28F5C28F5C
leaq 0x1(%rcx), %rsi
pushq $0x64
popq %r14
cmpq %r15, %rsi
ja 0x194e
imulq $0x50, %rsi, %rax
xorl %edx, %edx
divq %r14
movq 0x18(%rbx), %rdi
cmpq %rax, %rdi
jae 0x18fc
movq %rbx, %rdi
callq 0x1a7a
testb %al, %al
jne 0x1946
movq 0x18(%rbx), %rdi
movq 0x20(%rbx), %rcx
leaq 0x1(%rcx), %rsi
addq %rdi, %rdi
cmpq %r15, %rsi
ja 0x195f
imulq $0x50, %rsi, %rax
xorl %edx, %edx
divq %r14
cmpq %rax, %rdi
jae 0x1934
movabsq $-0x3b314601e57a13ac, %rax # imm = 0xC4CEB9FE1A85EC54
addq %rax, (%rbx)
pushq $0x1
popq %rdx
movq %rbx, %rdi
jmp 0x1941
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x19da
jmp 0x1946
leaq 0x2(,%rcx,2), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1b2c
movb $0x1, %al
popq %rbx
popq %r14
popq %r15
retq
movq %rsi, %rax
xorl %edx, %edx
divq %r14
imulq $0x50, %rax, %rax
jmp 0x18db
movq %rsi, %rax
xorl %edx, %edx
divq %r14
imulq $0x50, %rax, %rax
jmp 0x190d
nop
// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/robin_hood/./robin_hood.h
// Function: robin_hood::detail::Table<true, 80ul, unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>>::shiftUp(unsigned long, unsigned long)
void
    shiftUp(size_t startIdx,
            size_t const insertion_idx) noexcept(std::is_nothrow_move_assignable<Node>::value) {
        auto idx = startIdx;
        ::new (static_cast<void*>(mKeyVals + idx)) Node(std::move(mKeyVals[idx - 1]));
        while (--idx != insertion_idx) {
            mKeyVals[idx] = std::move(mKeyVals[idx - 1]);
        }

        idx = startIdx;
        while (idx != insertion_idx) {
            ROBIN_HOOD_COUNT(shiftUp)
            mInfo[idx] = static_cast<uint8_t>(mInfo[idx - 1] + mInfoInc);
            if (ROBIN_HOOD_UNLIKELY(mInfo[idx] + mInfoInc > 0xFF)) {
                mMaxNumElementsAllowed = 0;
            }
            --idx;
        }
    }

// Assembly:
movq 0x8(%rdi), %rax
leaq (%rax,%rsi,8), %r9
leaq (%rax,%rsi,8), %r8
addq $-0x8, %r8
leaq -0x1(%rsi), %rax
movq %rsi, %rcx
movq (%r8), %r8
movq %r8, (%r9)
cmpq %rax, %rdx
je 0x19d4
movq 0x8(%rdi), %r9
leaq (%r9,%rcx,8), %r8
addq $-0x10, %r8
decq %rcx
leaq (%r9,%rcx,8), %r9
decq %rax
jmp 0x1985
movq 0x10(%rdi), %rax
movb -0x1(%rax,%rsi), %cl
addb 0x30(%rdi), %cl
movb %cl, (%rax,%rsi)
movq 0x10(%rdi), %rax
movzbl (%rax,%rsi), %eax
addl 0x30(%rdi), %eax
cmpl $0x100, %eax            # imm = 0x100
jae 0x19cd
decq %rsi
jmp 0x19d4
andq $0x0, 0x28(%rdi)
jmp 0x19c8
cmpq %rsi, %rdx
jne 0x19a8
retq
// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/robin_hood/./robin_hood.h
// Function: robin_hood::detail::Table<true, 80ul, unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>>::initData(unsigned long)
void initData(size_t max_elements) {
        mNumElements = 0;
        mMask = max_elements - 1;
        mMaxNumElementsAllowed = calcMaxNumElementsAllowed(max_elements);

        auto const numElementsWithBuffer = calcNumElementsWithBuffer(max_elements);

        // malloc & zero mInfo. Faster than calloc everything.
        auto const numBytesTotal = calcNumBytesTotal(numElementsWithBuffer);
        ROBIN_HOOD_LOG("std::calloc " << numBytesTotal << " = calcNumBytesTotal("
                                      << numElementsWithBuffer << ")")
        mKeyVals = reinterpret_cast<Node*>(
            detail::assertNotNull<std::bad_alloc>(std::malloc(numBytesTotal)));
        mInfo = reinterpret_cast<uint8_t*>(mKeyVals + numElementsWithBuffer);
        std::memset(mInfo, 0, numBytesTotal - numElementsWithBuffer * sizeof(Node));

        // set sentinel
        mInfo[numElementsWithBuffer] = 1;

        mInfoInc = InitialInfoInc;
        mInfoHashShift = InitialInfoHashShift;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
andq $0x0, 0x18(%rdi)
leaq -0x1(%rsi), %rax
movq %rax, 0x20(%rdi)
movabsq $0x28f5c28f5c28f5c, %rax # imm = 0x28F5C28F5C28F5C
cmpq %rax, %rsi
ja 0x1a68
imulq $0x50, %rsi, %rax
pushq $0x64
popq %rcx
xorl %edx, %edx
divq %rcx
movl $0xff, %ecx
cmpq %rcx, %rax
cmovbq %rax, %rcx
movq %rax, 0x28(%rbx)
leaq (%rcx,%rsi), %r15
leaq (%rcx,%rsi), %r14
addq $0x8, %r14
leaq (%r15,%r15,8), %rdi
addq $0x8, %rdi
callq 0x10c0
movq %rax, %rdi
callq 0x1bf2
movq %rax, 0x8(%rbx)
leaq (%rax,%r15,8), %rdi
movq %rdi, 0x10(%rbx)
xorl %esi, %esi
movq %r14, %rdx
callq 0x1070
movq 0x10(%rbx), %rax
movb $0x1, (%rax,%r15)
movq $0x20, 0x30(%rbx)
popq %rbx
popq %r14
popq %r15
retq
pushq $0x64
popq %rcx
movq %rsi, %rax
xorl %edx, %edx
divq %rcx
imulq $0x50, %rax, %rax
jmp 0x1a0a
nop
// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/robin_hood/./robin_hood.h
// Function: robin_hood::detail::Table<true, 80ul, unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>>::try_increase_info()
bool try_increase_info() {
        ROBIN_HOOD_LOG("mInfoInc=" << mInfoInc << ", numElements=" << mNumElements
                                   << ", maxNumElementsAllowed="
                                   << calcMaxNumElementsAllowed(mMask + 1))
        if (mInfoInc <= 2) {
            // need to be > 2 so that shift works (otherwise undefined behavior!)
            return false;
        }
        // we got space left, try to make info smaller
        mInfoInc = static_cast<uint8_t>(mInfoInc >> 1U);

        // remove one bit of the hash, leaving more space for the distance info.
        // This is extremely fast because we can operate on 8 bytes at once.
        ++mInfoHashShift;
        auto const numElementsWithBuffer = calcNumElementsWithBuffer(mMask + 1);

        for (size_t i = 0; i < numElementsWithBuffer; i += 8) {
            auto val = unaligned_load<uint64_t>(mInfo + i);
            val = (val >> 1U) & UINT64_C(0x7f7f7f7f7f7f7f7f);
            std::memcpy(mInfo + i, &val, sizeof(val));
        }
        // update sentinel, which might have been cleared out!
        mInfo[numElementsWithBuffer] = 1;

        mMaxNumElementsAllowed = calcMaxNumElementsAllowed(mMask + 1);
        return true;
    }

// Assembly:
movl 0x30(%rdi), %esi
cmpl $0x3, %esi
jb 0x1b0c
movabsq $0x28f5c28f5c28f5c, %r9 # imm = 0x28F5C28F5C28F5C
movl %esi, %eax
shrl %eax
movzbl %al, %eax
movl %eax, 0x30(%rdi)
incl 0x34(%rdi)
movq 0x20(%rdi), %rcx
incq %rcx
pushq $0x64
popq %r8
cmpq %r9, %rcx
ja 0x1b13
imulq $0x50, %rcx, %rax
xorl %edx, %edx
divq %r8
movl $0xff, %edx
cmpq %rdx, %rax
cmovbq %rax, %rdx
addq %rcx, %rdx
xorl %eax, %eax
movabsq $0x7f7f7f7f7f7f7f7f, %rcx # imm = 0x7F7F7F7F7F7F7F7F
movq 0x10(%rdi), %r10
cmpq %rdx, %rax
jae 0x1aee
movq (%r10,%rax), %r11
shrq %r11
andq %rcx, %r11
movq %r11, (%r10,%rax)
addq $0x8, %rax
jmp 0x1ad1
movb $0x1, (%r10,%rdx)
movq 0x20(%rdi), %rax
incq %rax
cmpq %r9, %rax
ja 0x1b21
imulq $0x50, %rax, %rax
xorl %edx, %edx
divq %r8
movq %rax, 0x28(%rdi)
cmpl $0x3, %esi
setae %al
retq
movq %rcx, %rax
xorl %edx, %edx
divq %r8
imulq $0x50, %rax, %rax
jmp 0x1ab6
xorl %edx, %edx
divq %r8
imulq $0x50, %rax, %rax
jmp 0x1b08
// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/robin_hood/./robin_hood.h
// Function: robin_hood::detail::Table<true, 80ul, unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>>::rehashPowerOfTwo(unsigned long, bool)
void rehashPowerOfTwo(size_t numBuckets, bool forceFree) {
        ROBIN_HOOD_TRACE(this)

        Node* const oldKeyVals = mKeyVals;
        uint8_t const* const oldInfo = mInfo;

        const size_t oldMaxElementsWithBuffer = calcNumElementsWithBuffer(mMask + 1);

        // resize operation: move stuff
        initData(numBuckets);
        if (oldMaxElementsWithBuffer > 1) {
            for (size_t i = 0; i < oldMaxElementsWithBuffer; ++i) {
                if (oldInfo[i] != 0) {
                    // might throw an exception, which is really bad since we are in the middle of
                    // moving stuff.
                    insert_move(std::move(oldKeyVals[i]));
                    // destroy the node but DON'T destroy the data.
                    oldKeyVals[i].~Node();
                }
            }

            // this check is not necessary as it's guarded by the previous if, but it helps
            // silence g++'s overeager "attempt to free a non-heap object 'map'
            // [-Werror=free-nonheap-object]" warning.
            if (oldKeyVals != reinterpret_cast_no_cast_align_warning<Node*>(&mMask)) {
                // don't destroy old data: put it into the pool instead
                if (forceFree) {
                    std::free(oldKeyVals);
                } else {
                    DataPool::addOrFree(oldKeyVals, calcNumBytesTotal(oldMaxElementsWithBuffer));
                }
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x8(%rdi), %rbx
movq 0x10(%rdi), %r12
movq 0x20(%rdi), %rcx
incq %rcx
movabsq $0x28f5c28f5c28f5c, %rax # imm = 0x28F5C28F5C28F5C
cmpq %rax, %rcx
ja 0x1bde
imulq $0x50, %rcx, %rax
pushq $0x64
popq %rdi
xorl %edx, %edx
divq %rdi
movl $0xff, %r13d
cmpq %r13, %rax
cmovbq %rax, %r13
addq %rcx, %r13
movq %r14, %rdi
callq 0x19da
cmpq $0x2, %r13
jb 0x1bcf
leaq 0x20(%r14), %rax
movq %rax, (%rsp)
xorl %ebp, %ebp
movq %rbx, %r15
cmpq %rbp, %r13
je 0x1bb3
cmpb $0x0, (%r12,%rbp)
je 0x1baa
movq %r14, %rdi
movq %r15, %rsi
callq 0x1c2e
incq %rbp
addq $0x8, %r15
jmp 0x1b93
cmpq (%rsp), %rbx
je 0x1bcf
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10a0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x64
popq %rdi
movq %rcx, %rax
xorl %edx, %edx
divq %rdi
imulq $0x50, %rax, %rax
jmp 0x1b68
// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/robin_hood/./robin_hood.h
// Function: robin_hood::detail::Table<true, 80ul, unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>>::insert_move(robin_hood::detail::Table<true, 80ul, unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>>::DataNode<robin_hood::detail::Table<true, 80ul, unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>>, true>&&)
void insert_move(Node&& keyval) {
        // we don't retry, fail if overflowing
        // don't need to check max num elements
        if (0 == mMaxNumElementsAllowed && !try_increase_info()) {
            throwOverflowError();
        }

        size_t idx{};
        InfoType info{};
        keyToIdx(keyval.getFirst(), &idx, &info);

        // skip forward. Use <= because we are certain that the element is not there.
        while (info <= mInfo[idx]) {
            idx = idx + 1;
            info += mInfoInc;
        }

        // key not found, so we are now exactly where we want to insert it.
        auto const insertion_idx = idx;
        auto const insertion_info = static_cast<uint8_t>(info);
        if (ROBIN_HOOD_UNLIKELY(insertion_info + mInfoInc > 0xFF)) {
            mMaxNumElementsAllowed = 0;
        }

        // find an empty spot
        while (0 != mInfo[idx]) {
            next(&info, &idx);
        }

        auto& l = mKeyVals[insertion_idx];
        if (idx == insertion_idx) {
            ::new (static_cast<void*>(&l)) Node(std::move(keyval));
        } else {
            shiftUp(idx, insertion_idx);
            l = std::move(keyval);
        }

        // put at empty spot
        mInfo[insertion_idx] = insertion_info;

        ++mNumElements;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpq $0x0, 0x28(%rdi)
jne 0x1c5c
movq %rbx, %rdi
callq 0x1a7a
testb %al, %al
jne 0x1c5c
movq %rbx, %rdi
callq 0x180c
leaq 0x8(%rsp), %r15
andq $0x0, (%r15)
leaq 0x4(%rsp), %r12
andl $0x0, (%r12)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x1854
movq 0x10(%rbx), %rax
movl (%r12), %r12d
movq (%r15), %r15
movl 0x30(%rbx), %ecx
movzbl (%rax,%r15), %edx
cmpl %edx, %r12d
ja 0x1caa
incq %r15
movq %r15, 0x8(%rsp)
addl %ecx, %r12d
movl %r12d, 0x4(%rsp)
jmp 0x1c8e
movzbl %r12b, %edx
addl %ecx, %edx
cmpl $0x100, %edx            # imm = 0x100
jae 0x1d10
leal (%rcx,%r12), %edi
xorl %edx, %edx
movq %r15, %rsi
cmpb $0x0, (%rax,%rsi)
je 0x1cda
incq %rsi
movq %rsi, 0x8(%rsp)
movl %edi, 0x4(%rsp)
addl %ecx, %edi
decq %rdx
jmp 0x1cc1
movq 0x8(%rbx), %r13
testq %rdx, %rdx
je 0x1cee
movq %rbx, %rdi
movq %r15, %rdx
callq 0x196e
movq (%r14), %rax
movq %rax, (%r13,%r15,8)
movq 0x10(%rbx), %rax
movb %r12b, (%rax,%r15)
incq 0x18(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
andq $0x0, 0x28(%rbx)
jmp 0x1cb8
nop
// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/robin_hood/./robin_hood.h
// Function: robin_hood::detail::Table<true, 80ul, unsigned int, unsigned int, Hash32, std::equal_to<unsigned int>>::Iter<false>::operator++()
Iter& operator++() noexcept {
            mInfo++;
            mKeyVals++;
            fastForward();
            return *this;
        }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movdqu (%rdi), %xmm0
paddq 0x2c6(%rip), %xmm0      # 0x2020
movdqu %xmm0, (%rdi)
callq 0x1d68
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/henrixh[P]shittydsa/examples/fenwick.cpp
// Function: main
int main(int, char **)
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ul size, ops;
  cin >> size >> ops;

  Fenwick fen {size};

  char op;
  ul index;
  l diff;
  for (ul i {0}; i < ops; ++i) {
    cin >> op;
    if (op == '+') {
      cin >> index >> diff;
      fen.add(index, diff);
    }

    if (op == '?') {
      cin >> index;
      cout << fen.sum(0, index) << "\n";
    }
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
xorl %ebp, %ebp
xorl %edi, %edi
callq 0x1060
movq 0x2d66(%rip), %rbx      # 0x3fe0
movq (%rbx), %rax
movq -0x18(%rax), %rax
andq $0x0, 0xd8(%rbx,%rax)
leaq 0x40(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1080
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x1080
movq (%r14), %rsi
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x1384
leaq 0xf(%rsp), %r15
leaq 0x10(%rsp), %r12
leaq 0xd3c(%rip), %r13       # 0x2004
cmpq 0x20(%rsp), %rbp
jae 0x1354
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1100
movb 0xf(%rsp), %al
cmpb $0x2b, %al
jne 0x1314
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1080
movq %rax, %rdi
leaq 0x18(%rsp), %rsi
callq 0x10f0
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r14, %rdi
callq 0x13be
movb 0xf(%rsp), %al
cmpb $0x3f, %al
jne 0x134c
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1080
movq 0x10(%rsp), %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x13e0
movq 0x2c97(%rip), %rdi      # 0x3fd0
movq %rax, %rsi
callq 0x10b0
movq %rax, %rdi
movq %r13, %rsi
callq 0x10c0
incq %rbp
jmp 0x12c8
leaq 0x28(%rsp), %rdi
callq 0x152e
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x152e
movq %rbx, %rdi
callq 0x1120
// File: /workspace/github_cpp_makefile_star2_O2/henrixh[P]shittydsa/examples/../src/fenwick.h
// Function: Fenwick::cumulative_sum(unsigned long)
l cumulative_sum(ul index) {
    l res {};
    while (index) {
      res += data[index -1];
      index -= lsb(index);
    }
    return res;
  }

// Assembly:
movq (%rdi), %rcx
xorl %eax, %eax
testq %rsi, %rsi
je 0x1610
addq -0x8(%rcx,%rsi,8), %rax
leaq -0x1(%rsi), %rdx
andq %rdx, %rsi
jmp 0x15fd
retq
// File: /workspace/github_cpp_makefile_star2_O2/roberty65[P]bServer/frame/testServer/src/main.cpp
// Function: main
int main(int argc, char **argv)
{
	SYSLOG_INIT("../logs/server.log", LOG_LEVEL_DEBUG, 1048576, 10);	
	
	beyondy::Async::Queue<beyondy::Async::Message> *inQ = new beyondy::Async::Queue<beyondy::Async::Message>(1024);
	beyondy::Async::Queue<beyondy::Async::Message> *outQ = new beyondy::Async::Queue<beyondy::Async::Message>(2048);

	beyondy::Async::Processor *processor = new Echo();
	processor->setSendFunc(async_send_delegator, outQ);
	int retval = processor->onInit();

	beyondy::Async::MtWorker *mtWorker = new beyondy::Async::MtWorker(inQ, processor, 10);
	mtWorker->start();

	beyondy::Async::EventManager *emgr = new beyondy::Async::EventManager(outQ, 1024);

	retval = emgr->addListener("tcp://0.0.0.0:5010", inQ, processor, 100);
	if (retval < 0) {
		SYSLOG_ERROR("addListener failed");
		return 1;
	}
/*
	int cid = emgr->addConnector("inet@localhost:5010/tcp", inQ, processor, 1);
	if (cid < 0) {
		SYSLOG_ERROR("addConnector failed");
		return 2;
	}
**/
	emgr->start();

	// nothing
	processor->onExit();

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl $0x218, %edi            # imm = 0x218
callq 0x2250
movq %rax, %rbx
leaq 0x4a97(%rip), %rsi      # 0x7004
pushq $0x5
popq %rdx
pushq $0xa
popq %r8
movl $0x100000, %ecx         # imm = 0x100000
movq %rax, %rdi
callq 0x5254
leaq 0x9d00(%rip), %r13      # 0xc288
movq %rbx, (%r13)
movl $0xb0, %edi
callq 0x2250
movq %rax, %rbx
movl $0x400, %esi            # imm = 0x400
movq %rax, %rdi
callq 0x26d6
movl $0xb0, %edi
callq 0x2250
movq %rax, %r15
movl $0x800, %esi            # imm = 0x800
movq %rax, %rdi
callq 0x26d6
pushq $0x30
popq %rdi
callq 0x2250
movq %rax, %r14
leaq 0x9626(%rip), %rax      # 0xbbf8
leaq 0x10(%rax), %rcx
movq %rcx, (%r14)
movl $0x77359400, %ecx       # imm = 0x77359400
movq %rcx, 0x18(%r14)
movq %rcx, 0x20(%r14)
leaq 0x1537(%rip), %rcx      # 0x3b24
movq %rcx, 0x8(%r14)
movq %r15, 0x10(%r14)
movq %r14, %rdi
callq *0x30(%rax)
pushq $0x20
popq %rdi
callq 0x2250
movq %rax, %r12
pushq $0xa
popq %rcx
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3950
movq %r12, %rdi
callq 0x3a80
pushq $0x70
popq %rdi
callq 0x2250
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x2dbc
leaq 0x49d6(%rip), %rsi      # 0x7017
pushq $0x64
popq %r8
movq %r12, %rdi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x2f30
testl %eax, %eax
js 0x266c
movq %r12, %rdi
callq 0x3848
movq (%r14), %rax
movq %r14, %rdi
callq *0x28(%rax)
xorl %ebx, %ebx
jmp 0x2689
movq (%r13), %rdi
pushq $0x1
popq %rbx
cmpl $0x2, (%rdi)
jl 0x2689
leaq 0x49ab(%rip), %rdx      # 0x702a
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0x527e
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
pushq $0x70
jmp 0x26a1
movq %rax, %r14
pushq $0x20
popq %rsi
movq %r12, %rdi
jmp 0x26c9
movq %rax, %r14
movl $0xb0, %esi
movq %r15, %rdi
jmp 0x26c9
movq %rax, %r14
movl $0xb0, %esi
jmp 0x26c6
movq %rax, %r14
movl $0x218, %esi            # imm = 0x218
movq %rbx, %rdi
callq 0x2260
movq %r14, %rdi
callq 0x2400
// File: /workspace/github_cpp_makefile_star2_O2/roberty65[P]bServer/frame/testServer/src/../../../serverd/src/Echo.cpp
// Function: Echo::onInit()
int Echo::onInit()
{
	maxInputSize = 50 * 1024 * 1024;
	maxOutputSize = 50 * 1024 * 1024;

	dstFlow = getConnector("dst");
	// TODO: use more general log
	// after compile the frame with -rdynamic, lib can use tis symbols
	// SYSLOG_INIT("../logs/business.log", LOG_LEVEL_DEBUG, 10*1024*1024, 10);
	return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x3200000, %eax        # imm = 0x3200000
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
leaq 0x470e(%rip), %rdi      # 0x705e
callq 0x254c
movl %eax, 0x28(%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/roberty65[P]bServer/frame/testServer/src/../../../serverd/src/Echo.cpp
// Function: Echo::doEcho(beyondy::Async::Message*)
int Echo::doEcho(Message *req)
{
	int takenMs = 0;
	if (req->getWptr() >= (long)(sizeof(struct proto_h16_head) + sizeof(int))) {
		takenMs = *((int *)(req->data() + sizeof(struct proto_h16_head)));	
	}

	SYSLOG_DEBUG("Echo took %dms", takenMs);
	if (takenMs > 0) usleep((long)takenMs*1000);

	Message *rsp = Message::create(req->getWptr(), req->fd, req->flow);
	memcpy(rsp->data(), req->data(), req->getWptr());

	struct proto_h16_head *h = (struct proto_h16_head *)rsp->data();
	h->cmd = h->cmd + 1;

	/* set response size */
	rsp->setWptr(req->getWptr());

	Message::destroy(req);
	if (sendMessage(rsp) < 0) {
		Message::destroy(rsp);
		return -1;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorl %ebp, %ebp
cmpq $0x14, 0x10(%rsi)
jl 0x297a
movq (%r14), %rax
movl 0x10(%rax), %ebp
leaq 0x9907(%rip), %rax      # 0xc288
movq (%rax), %rdi
cmpl $0x5, (%rdi)
jl 0x299c
leaq 0x46d2(%rip), %rdx      # 0x7062
pushq $0x5
popq %rsi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x527e
testl %ebp, %ebp
jle 0x29ab
imull $0x3e8, %ebp, %edi      # imm = 0x3E8
callq 0x2320
movq 0x10(%r14), %rdi
movl 0x24(%r14), %esi
movl 0x28(%r14), %edx
callq 0x54d8
movq %rax, %r15
movq (%rax), %rdi
movq (%r14), %rsi
movq 0x10(%r14), %rdx
callq 0x2200
movq (%r15), %rax
incw 0x4(%rax)
movq 0x10(%r14), %rax
movq %rax, 0x10(%r15)
movq %r14, %rdi
callq 0x552a
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x29ff
movq 0x10(%rbx), %rsi
movq %r15, %rdi
callq *%rax
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jns 0x2a0a
movq %r15, %rdi
callq 0x552a
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/roberty65[P]bServer/frame/testServer/src/../../../serverd/src/Echo.cpp
// Function: Echo::doMore(beyondy::Async::Message*)
int Echo::doMore(Message *req)
{
	int takenMs = 0;
	if (req->getWptr() >= (long)(sizeof(struct proto_h16_head) + sizeof(int))) {
		takenMs = *((int *)(req->data() + sizeof(struct proto_h16_head)));	
	}

	SYSLOG_DEBUG("More took %dms", takenMs);
	if (takenMs > 0) usleep((long)takenMs*1000);

	Message *rsp = Message::create(req->getWptr(), req->fd, req->flow);
	memcpy(rsp->data(), req->data(), req->getWptr());

	struct proto_h16_head *h = (struct proto_h16_head *)rsp->data();
	h->cmd = ECHO_CMD_MORE_RSP;

	/* set response size */
	rsp->setWptr(req->getWptr());

	Message::destroy(req);
	if (sendMessage(rsp) < 0) {
		Message::destroy(rsp);
		return -1;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorl %ebp, %ebp
cmpq $0x14, 0x10(%rsi)
jl 0x2b78
movq (%r14), %rax
movl 0x10(%rax), %ebp
leaq 0x9709(%rip), %rax      # 0xc288
movq (%rax), %rdi
cmpl $0x5, (%rdi)
jl 0x2b9a
leaq 0x456f(%rip), %rdx      # 0x70fd
pushq $0x5
popq %rsi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x527e
testl %ebp, %ebp
jle 0x2ba9
imull $0x3e8, %ebp, %edi      # imm = 0x3E8
callq 0x2320
movq 0x10(%r14), %rdi
movl 0x24(%r14), %esi
movl 0x28(%r14), %edx
callq 0x54d8
movq %rax, %r15
movq (%rax), %rdi
movq (%r14), %rsi
movq 0x10(%r14), %rdx
callq 0x2200
movq (%r15), %rax
movw $0x5, 0x4(%rax)
movq 0x10(%r14), %rax
movq %rax, 0x10(%r15)
movq %r14, %rdi
callq 0x552a
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x2bff
movq 0x10(%rbx), %rsi
movq %r15, %rdi
callq *%rax
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jns 0x2c0a
movq %r15, %rdi
callq 0x552a
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/roberty65[P]bServer/frame/testServer/src/../../../serverd/src/Echo.cpp
// Function: Echo::onMessage(beyondy::Async::Message*)
int Echo::onMessage(beyondy::Async::Message *req)
{
	SYSLOG_DEBUG("Echo got a message from fd=%d flow=%d msize=%d, byte0=%ld,%d, enQ=%ld,%d, deQ=%ld,%ld", \
		req->fd, req->flow, req->getWptr(),
		req->ts_byte_first.tv_sec, req->ts_byte_first.tv_usec,
		req->ts_enqueue.tv_sec, req->ts_enqueue.tv_usec,
		req->ts_dequeue.tv_sec, req->ts_dequeue.tv_usec);
	struct proto_h16_head *h = (struct proto_h16_head *)req->data();
	int retval = 0;

	if (h->cmd == ECHO_CMD_ECHO_REQ) {
		retval = doEcho(req);
	}
	else if (h->cmd == ECHO_CMD_FORWARD_REQ || h->cmd == ECHO_CMD_MORE_RSP) {
		retval = doForward(req);
	}
	else if (h->cmd == ECHO_CMD_MORE_REQ) {
		retval = doMore(req);
	}
	else {
		SYSLOG_DEBUG("Echo uknown cmd=%d", h->cmd);
	}

	return retval;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x965c(%rip), %r15      # 0xc288
movq (%r15), %rdi
cmpl $0x5, (%rdi)
jl 0x2c6a
movl 0x24(%rbx), %ecx
movl 0x28(%rbx), %r8d
movq 0x10(%rbx), %r9
movups 0x30(%rbx), %xmm0
movups 0x40(%rbx), %xmm1
movups 0x50(%rbx), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x44ac(%rip), %rdx      # 0x710c
pushq $0x5
popq %rsi
xorl %eax, %eax
callq 0x527e
movq (%rbx), %rax
movzwl 0x4(%rax), %ecx
cmpq $0x5, %rcx
ja 0x2cc3
leaq 0x43c2(%rip), %rax      # 0x7040
movslq (%rax,%rcx,4), %rdx
addq %rax, %rdx
jmpq *%rdx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2a16
movq %r14, %rdi
movq %rbx, %rsi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x295e
movq %r14, %rdi
movq %rbx, %rsi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2b5c
movq (%r15), %rdi
cmpl $0x5, (%rdi)
jl 0x2cdc
leaq 0x4490(%rip), %rdx      # 0x7162
pushq $0x5
popq %rsi
xorl %eax, %eax
callq 0x527e
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/roberty65[P]bServer/frame/testServer/src/../../../serverd/src/Echo.cpp
// Function: Echo::onSent(beyondy::Async::Message*, int)
int Echo::onSent(Message *msg, int status)
{
	SYSLOG_DEBUG("Echo message from fd=%d flow=%d msize=%d sent status=%d, enQ=%ld,%ld, deQ=%ld,%ld, byte0=%ld,%ld, sent=%ld,%ld", \
		msg->fd, msg->flow, msg->getWptr(), status,
		msg->ts_enqueue.tv_sec, msg->ts_enqueue.tv_usec,
		msg->ts_dequeue.tv_sec, msg->ts_dequeue.tv_usec,
		msg->ts_byte_first.tv_sec, msg->ts_byte_first.tv_usec,
		msg->ts_process_end.tv_sec, msg->ts_process_end.tv_usec);
	Message::destroy(msg);
	return 0;
}

// Assembly:
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
leaq 0x9591(%rip), %rax      # 0xc288
movq (%rax), %rdi
cmpl $0x5, (%rdi)
jl 0x2d42
movl 0x24(%rbx), %ecx
movl 0x28(%rbx), %r8d
movq 0x10(%rbx), %r9
movups 0x40(%rbx), %xmm0
movups 0x50(%rbx), %xmm1
movups 0x30(%rbx), %xmm2
movups 0x60(%rbx), %xmm3
movups %xmm3, 0x38(%rsp)
movups %xmm2, 0x28(%rsp)
movups %xmm1, 0x18(%rsp)
movups %xmm0, 0x8(%rsp)
movl %edx, (%rsp)
leaq 0x443d(%rip), %rdx      # 0x7175
pushq $0x5
popq %rsi
xorl %eax, %eax
callq 0x527e
movq %rbx, %rdi
callq 0x552a
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/sun98[P]Mini-DFS/datanode.cpp
// Function: DataServer::operator()()
void DataServer::operator()()
{
    while (true)
    {
        std::unique_lock<std::mutex> lk(mtx);
        cv.wait(lk, [&]() { return !this->finish; });
        if (cmd == "up")
        {
            size_ += bufSize / 1024.0 / 1024.0;
            put();
        }
        else if (cmd == "down")
            read();
        else if (cmd == "loc")
            locate();
        else if (cmd == "down_id")
            fetch();
        this->finish = true;
        lk.unlock();
        cv.notify_all();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x28(%rdi), %r14
leaq 0x50(%rdi), %r15
leaq 0x80(%rdi), %r12
leaq -0x38(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x4110
cmpb $0x1, 0xb8(%rbx)
jne 0x37e6
movq %r15, %rdi
movq %r13, %rsi
callq 0x30f0
jmp 0x37d0
movq %r12, %rdi
leaq 0x482a(%rip), %rsi      # 0x801a
callq 0x4130
testb %al, %al
je 0x3825
cvtsi2sdl 0xa4(%rbx), %xmm0
movsd 0x47ff(%rip), %xmm1     # 0x8008
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
addsd 0x20(%rbx), %xmm0
movsd %xmm0, 0x20(%rbx)
movq %rbx, %rdi
callq 0x38b2
jmp 0x387a
movq %r12, %rdi
leaq 0x47ee(%rip), %rsi      # 0x801d
callq 0x4130
testb %al, %al
je 0x3842
movq %rbx, %rdi
callq 0x3af8
jmp 0x387a
movq %r12, %rdi
leaq 0x47d6(%rip), %rsi      # 0x8022
callq 0x4130
testb %al, %al
je 0x385f
movq %rbx, %rdi
callq 0x3d2c
jmp 0x387a
movq %r12, %rdi
leaq 0x47bd(%rip), %rsi      # 0x8026
callq 0x4130
testb %al, %al
je 0x387a
movq %rbx, %rdi
callq 0x3e94
movb $0x1, 0xb8(%rbx)
movq %r13, %rdi
callq 0x4140
movq %r15, %rdi
callq 0x3440
movq %r13, %rdi
callq 0x4170
jmp 0x37c5
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x4170
movq %rbx, %rdi
callq 0x3480
// File: /workspace/github_cpp_makefile_star2_O2/sun98[P]Mini-DFS/datanode.cpp
// Function: DataServer::put()
void DataServer::put()
{
    int start = 0;
    std::ofstream os;
    while (start < bufSize)
    {
        int offset = start / chunkSize;
        std::string filePath = name_ + "/" + std::to_string(fid) + " " + std::to_string(offset);
        os.open(filePath);
        if (!os)
            std::cerr << "Failed in creating file in data server: " << filePath << std::endl;
        os.write(&buf[start], std::min(chunkSize, bufSize - start));
        start += chunkSize;
        os.close();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2d8, %rsp            # imm = 0x2D8
movq %rdi, %r14
leaq -0x2f8(%rbp), %rdi
callq 0x3430
xorl %r13d, %r13d
leaq -0x58(%rbp), %rdi
leaq -0xb8(%rbp), %rbx
movq %r14, -0x38(%rbp)
cmpl 0xa4(%r14), %r13d
jge 0x3a65
movl %r13d, -0x2c(%rbp)
movl %r13d, %eax
cltd
idivl 0x897e(%rip)            # 0xc280
movl %eax, %r13d
movq %r14, %rsi
leaq 0x471f(%rip), %rdx      # 0x802e
callq 0x4223
movl 0xa0(%r14), %esi
leaq -0x98(%rbp), %r12
movq %r12, %rdi
callq 0x425b
movq %rbx, %r15
movq %rbx, %rdi
leaq -0x58(%rbp), %rsi
movq %r12, %rdx
callq 0x4189
leaq -0xd8(%rbp), %rdi
movq %r15, %rsi
leaq 0x48f4(%rip), %rdx      # 0x8241
callq 0x41fa
leaq -0xf8(%rbp), %r12
movq %r12, %rdi
movl %r13d, %esi
callq 0x425b
leaq -0x78(%rbp), %r14
movq %r14, %rdi
leaq -0xd8(%rbp), %r13
movq %r13, %rsi
movq %r12, %rdx
callq 0x4189
movq %r12, %rdi
callq 0x3150
movq %r13, %rdi
callq 0x3150
movq %rbx, %rdi
callq 0x3150
leaq -0x98(%rbp), %rdi
callq 0x3150
leaq -0x58(%rbp), %rdi
movq %rdi, %r15
callq 0x3150
leaq -0x2f8(%rbp), %rdi
movq %r14, %rsi
pushq $0x10
popq %rdx
callq 0x3170
movq -0x2f8(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x2d8(%rbp,%rax)
je 0x39fb
movq 0x8615(%rip), %rdi      # 0xbff0
leaq 0x464e(%rip), %rsi      # 0x8030
callq 0x3280
movq %rax, %rdi
leaq -0x78(%rbp), %rsi
callq 0x3250
movq %rax, %rdi
callq 0x3180
movl -0x2c(%rbp), %ecx
movslq %ecx, %rsi
movq -0x38(%rbp), %rax
addq 0xb0(%rax), %rsi
movl 0xa4(%rax), %eax
subl %ecx, %eax
movl 0x8866(%rip), %ecx      # 0xc280
cmpl %ecx, %eax
cmovgel %ecx, %eax
movslq %eax, %rdx
leaq -0x2f8(%rbp), %r12
movq %r12, %rdi
callq 0x3330
movl 0x8848(%rip), %r13d     # 0xc280
movq %r12, %rdi
callq 0x3370
movl -0x2c(%rbp), %eax
addl %r13d, %eax
movl %eax, %r13d
leaq -0x78(%rbp), %rdi
callq 0x3150
movq %r15, %rdi
movq -0x38(%rbp), %r14
leaq -0xb8(%rbp), %rbx
jmp 0x38e7
leaq -0x2f8(%rbp), %rdi
callq 0x33b0
addq $0x2d8, %rsp            # imm = 0x2D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x3ac5
movq %rax, %rbx
jmp 0x3ad1
movq %rax, %rbx
jmp 0x3aad
movq %rax, %rbx
jmp 0x3ab9
jmp 0x3ad7
movq %rax, %rbx
jmp 0x3ae3
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x3150
leaq -0xd8(%rbp), %rdi
callq 0x3150
leaq -0xb8(%rbp), %rdi
callq 0x3150
leaq -0x98(%rbp), %rdi
callq 0x3150
leaq -0x58(%rbp), %rdi
jmp 0x3ade
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x3150
leaq -0x2f8(%rbp), %rdi
callq 0x33b0
movq %rbx, %rdi
callq 0x3480
nop
// File: /workspace/github_cpp_makefile_star2_O2/sun98[P]Mini-DFS/datanode.cpp
// Function: DataServer::read()
void DataServer::read()
{
    int start = 0;
    buf = new char[bufSize];
    while (start < bufSize)
    {
        int offset = start / chunkSize;
        std::string filePath = name_ + "/" + std::to_string(fid) + " " + std::to_string(offset);
        std::ifstream is(filePath);
        // file not found in this server.
        if (!is)
        {
            delete[] buf;
            bufSize = 0;
            break;
        }
        is.read(&buf[start], std::min(chunkSize, bufSize - start));
        start += chunkSize;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2b8, %rsp            # imm = 0x2B8
movq %rdi, %rbx
movl 0xa4(%rdi), %eax
testl %eax, %eax
pushq $-0x1
popq %rcx
cmovnsl %eax, %ecx
movslq %ecx, %rdi
callq 0x3030
movq %rbx, %rsi
movq %rax, 0xb0(%rbx)
xorl %eax, %eax
leaq -0x98(%rbp), %r15
leaq -0xb8(%rbp), %r14
movq %rbx, -0x38(%rbp)
cmpl 0xa4(%rsi), %eax
jge 0x3ca8
movl %eax, -0x2c(%rbp)
cltd
idivl 0x8727(%rip)            # 0xc280
movl %eax, %r13d
leaq -0x58(%rbp), %rbx
movq %r15, %rdi
leaq 0x44c4(%rip), %rdx      # 0x802e
movq %rsi, %r12
callq 0x4223
movl 0xa0(%r12), %esi
movq %rbx, %rdi
callq 0x425b
movq %r14, %rdi
movq %r15, %r12
movq %r15, %rsi
movq %rbx, %rdx
callq 0x4189
leaq -0x2e0(%rbp), %rdi
movq %r14, %rsi
leaq 0x469d(%rip), %rdx      # 0x8241
callq 0x41fa
leaq -0x78(%rbp), %r15
movq %r15, %rdi
movl %r13d, %esi
callq 0x425b
leaq -0xd8(%rbp), %r13
movq %r13, %rdi
leaq -0x2e0(%rbp), %rbx
movq %rbx, %rsi
movq %r15, %rdx
callq 0x4189
movq %r15, %rdi
callq 0x3150
movq %rbx, %rdi
callq 0x3150
movq %r14, %rdi
callq 0x3150
leaq -0x58(%rbp), %rdi
callq 0x3150
movq %r12, %rdi
callq 0x3150
movq %rbx, %rdi
movq %r13, %rsi
pushq $0x8
popq %rdx
callq 0x3400
movq %r13, %r15
movq -0x2e0(%rbp), %rax
movq -0x18(%rax), %rax
movl -0x2c0(%rbp,%rax), %r13d
movq -0x38(%rbp), %rcx
movq 0xb0(%rcx), %rsi
testb $0x5, %r13b
je 0x3c4c
testq %rsi, %rsi
je 0x3c43
movq %rsi, %rdi
callq 0x3310
movq -0x38(%rbp), %rcx
andl $0x0, 0xa4(%rcx)
jmp 0x3c80
movl -0x2c(%rbp), %ebx
movslq %ebx, %rax
addq %rax, %rsi
movl 0xa4(%rcx), %eax
subl %ebx, %eax
movl 0x861d(%rip), %ecx      # 0xc280
cmpl %ecx, %eax
cmovgel %ecx, %eax
movslq %eax, %rdx
leaq -0x2e0(%rbp), %rdi
callq 0x32f0
addl 0x8603(%rip), %ebx      # 0xc280
movl %ebx, -0x2c(%rbp)
leaq -0x2e0(%rbp), %rdi
callq 0x30c0
movq %r15, %rdi
callq 0x3150
testb $0x5, %r13b
movq %r12, %r15
movl -0x2c(%rbp), %eax
movq -0x38(%rbp), %rsi
je 0x3b43
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x2e0(%rbp), %rdi
callq 0x30c0
jmp 0x3cd8
movq %rax, %rbx
jmp 0x3d0f
movq %rax, %rbx
jmp 0x3cf7
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
jmp 0x3d1f
movq %rax, %rbx
jmp 0x3d18
movq %rax, %rbx
jmp 0x3d03
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x3150
leaq -0x2e0(%rbp), %rdi
callq 0x3150
leaq -0xb8(%rbp), %rdi
callq 0x3150
leaq -0x58(%rbp), %rdi
callq 0x3150
leaq -0x98(%rbp), %rdi
callq 0x3150
movq %rbx, %rdi
callq 0x3480
// File: /workspace/github_cpp_makefile_star2_O2/sun98[P]Mini-DFS/datanode.cpp
// Function: DataServer::locate()
void DataServer::locate()
{
    std::string filePath = name_ + "/" + std::to_string(fid) + " " + std::to_string(offset);
    std::ifstream is(filePath);
    if (is)
        bufSize = 1;
    else
        bufSize = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
movq %rdi, %rbx
leaq 0x42ec(%rip), %rdx      # 0x802e
leaq -0x68(%rbp), %rdi
movq %rbx, %rsi
callq 0x4223
movl 0xa0(%rbx), %esi
leaq -0x48(%rbp), %rdi
callq 0x425b
leaq -0x88(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x4189
leaq 0x44c9(%rip), %rdx      # 0x8241
leaq -0x2b0(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x41fa
movl 0xa8(%rbx), %esi
leaq -0x28(%rbp), %rdi
callq 0x425b
leaq -0xa8(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0x4189
leaq -0x28(%rbp), %rdi
callq 0x3150
leaq -0x2b0(%rbp), %rdi
callq 0x3150
leaq -0x88(%rbp), %rdi
callq 0x3150
leaq -0x48(%rbp), %rdi
callq 0x3150
leaq -0x68(%rbp), %rdi
callq 0x3150
leaq -0x2b0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
pushq $0x8
popq %rdx
callq 0x3400
leaq -0x2b0(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
xorl %ecx, %ecx
testb $0x5, -0x290(%rbp,%rax)
sete %cl
movl %ecx, 0xa4(%rbx)
callq 0x30c0
leaq -0xa8(%rbp), %rdi
callq 0x3150
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
jmp 0x3e87
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0x3150
jmp 0x3e53
movq %rax, %rbx
leaq -0x2b0(%rbp), %rdi
callq 0x3150
jmp 0x3e64
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x3150
jmp 0x3e75
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x3150
jmp 0x3e83
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x3150
movq %rbx, %rdi
callq 0x3480
// File: /workspace/github_cpp_makefile_star2_O2/sun98[P]Mini-DFS/datanode.cpp
// Function: DataServer::fetch()
void DataServer::fetch()
{
    buf = new char[chunkSize];
    std::string filePath = name_ + "/" + std::to_string(fid) + " " + std::to_string(offset);
    std::ifstream is(filePath);
    // file not found in this server.
    if (!is)
    {
        delete[] buf;
        bufSize = 0;
    }
    else
    {
        is.read(buf, std::min(chunkSize, bufSize - chunkSize * offset));
        bufSize = is.tellg();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
movq %rdi, %rbx
movl 0x83d7(%rip), %eax      # 0xc280
testl %eax, %eax
pushq $-0x1
popq %rcx
cmovnsl %eax, %ecx
movslq %ecx, %rdi
callq 0x3030
movq %rax, 0xb0(%rbx)
leaq 0x4167(%rip), %rdx      # 0x802e
leaq -0x68(%rbp), %rdi
movq %rbx, %rsi
callq 0x4223
movl 0xa0(%rbx), %esi
leaq -0x48(%rbp), %rdi
callq 0x425b
leaq -0x88(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x4189
leaq 0x4344(%rip), %rdx      # 0x8241
leaq -0x2b0(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x41fa
movl 0xa8(%rbx), %esi
leaq -0x28(%rbp), %rdi
callq 0x425b
leaq -0xa8(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0x4189
leaq -0x28(%rbp), %rdi
callq 0x3150
leaq -0x2b0(%rbp), %rdi
callq 0x3150
leaq -0x88(%rbp), %rdi
callq 0x3150
leaq -0x48(%rbp), %rdi
callq 0x3150
leaq -0x68(%rbp), %rdi
callq 0x3150
leaq -0x2b0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
pushq $0x8
popq %rdx
callq 0x3400
movq -0x2b0(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x290(%rbp,%rax)
movq 0xb0(%rbx), %rsi
je 0x3fb1
testq %rsi, %rsi
je 0x3fa8
movq %rsi, %rdi
callq 0x3310
andl $0x0, 0xa4(%rbx)
jmp 0x3fee
movl 0xa4(%rbx), %eax
movl 0x82c3(%rip), %ecx      # 0xc280
movl 0xa8(%rbx), %edx
imull %ecx, %edx
subl %edx, %eax
cmpl %ecx, %eax
cmovgel %ecx, %eax
movslq %eax, %rdx
leaq -0x2b0(%rbp), %rdi
callq 0x32f0
leaq -0x2b0(%rbp), %rdi
callq 0x3460
movl %eax, 0xa4(%rbx)
leaq -0x2b0(%rbp), %rdi
callq 0x30c0
leaq -0xa8(%rbp), %rdi
callq 0x3150
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %rbp
retq
jmp 0x4012
movq %rax, %rbx
leaq -0x2b0(%rbp), %rdi
callq 0x30c0
jmp 0x4026
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
jmp 0x4074
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0x3150
jmp 0x4040
movq %rax, %rbx
leaq -0x2b0(%rbp), %rdi
callq 0x3150
jmp 0x4051
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x3150
jmp 0x4062
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x3150
jmp 0x4070
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x3150
movq %rbx, %rdi
callq 0x3480
nop
// File: /workspace/github_cpp_makefile_star2_O2/sun98[P]Mini-DFS/filetree.cpp
// Function: FileTree::insert_node(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool)
bool FileTree::insert_node(const std::string &path, const bool isFile)
{
    TreeNode *parent = nullptr;
    bool isFound = find_node(path, &parent);
    if (isFound)
        return false;

    std::vector<std::string> path_folders = split(path, '/');
    TreeNode *newNode = new TreeNode(path, isFile);
    newNode->parent = parent;
    TreeNode *son = parent->firstSon;
    if (!son)
        parent->firstSon = newNode;
    else
    {
        while (son->nextSibling)
            son = son->nextSibling;
        son->nextSibling = newNode;
    }
    while (son)
        son = son->nextSibling;
    son = newNode;
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r15
movb %dl, -0x19(%rbp)
leaq -0x28(%rbp), %rdx
andq $0x0, (%rdx)
callq 0x44ea
movl %eax, %ebx
testb %al, %al
jne 0x44b8
leaq -0x1a(%rbp), %rdx
movb $0x2f, (%rdx)
leaq -0x40(%rbp), %rdi
movq %r15, %rsi
callq 0x4ba4
pushq $0x40
popq %rdi
callq 0x3290
movq %rax, %r14
leaq -0x19(%rbp), %rdx
movq %rax, %rdi
movq %r15, %rsi
callq 0x4642
movq -0x28(%rbp), %rax
movq %rax, 0x28(%r14)
movq 0x30(%rax), %rcx
testq %rcx, %rcx
je 0x44a8
movq %rcx, %rax
movq 0x38(%rcx), %rcx
testq %rcx, %rcx
jne 0x4496
addq $0x38, %rax
jmp 0x44ac
addq $0x30, %rax
movq %r14, (%rax)
leaq -0x40(%rbp), %rdi
callq 0x466c
xorb $0x1, %bl
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x3270
jmp 0x44d8
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x466c
movq %rbx, %rdi
callq 0x3480
nop
// File: /workspace/github_cpp_makefile_star2_O2/sun98[P]Mini-DFS/filetree.cpp
// Function: FileTree::find_node(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, TreeNode**) const
bool FileTree::find_node(const std::string &path, TreeNode **last_node) const
{
    std::vector<std::string> path_folders = split(path, '/');
    TreeNode *node = _root->firstSon;
    *last_node = _root;
    for (const auto &name : path_folders)
    {
        while (node && node->value_ != name)
            node = node->nextSibling;
        if (!node)
            return false;
        *last_node = node;
        node = node->firstSon;
    }
    return true && node->isFile;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rdi, %r14
leaq -0x21(%rbp), %rdx
movb $0x2f, (%rdx)
leaq -0x40(%rbp), %r12
movq %r12, %rdi
callq 0x4ba4
movq (%r14), %rax
movq 0x30(%rax), %r14
movq %rax, (%rbx)
movq (%r12), %r15
movq 0x8(%r12), %r12
cmpq %r12, %r15
je 0x456b
testq %r14, %r14
je 0x4551
movq %r14, %rdi
movq %r15, %rsi
callq 0x4697
testb %al, %al
je 0x4544
movq 0x38(%r14), %r14
jmp 0x452a
movq %r14, (%rbx)
movq 0x30(%r14), %r14
addq $0x20, %r15
jmp 0x4525
xorl %ebx, %ebx
leaq -0x40(%rbp), %rdi
callq 0x466c
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movb 0x20(%r14), %bl
jmp 0x4553
nop