LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH10_GenericAlgorithms/examples/rev-iters.cc
// Function: main
int main()
{
    vector<int> vec = {0,1,2,3,4,5,6,7,8,9};
    // reverse iterator of vector from back to front
    for (auto r_iter = vec.crbegin(); // binds r_iter to the last element
              r_iter != vec.crend();  // one before first element
              ++r_iter)          // decrements the iterator one element
        cout << *r_iter << endl; // prints 9, 8, 7, . . . 0
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movups 0xdc6(%rip), %xmm0      # 0x2014
leaq -0x60(%rbp), %rsi
movaps %xmm0, 0x10(%rsi)
movups 0xda7(%rip), %xmm0      # 0x2004
movaps %xmm0, (%rsi)
movabsq $0x900000008, %rax      # imm = 0x900000008
movq %rax, 0x20(%rsi)
leaq -0x30(%rbp), %rbx
pushq $0xa
popq %rdx
leaq -0x11(%rbp), %rcx
movq %rbx, %rdi
callq 0x12d4
movq 0x8(%rbx), %r14
movq 0x2d4c(%rip), %rbx      # 0x3fd8
cmpq -0x30(%rbp), %r14
je 0x12ac
movl -0x4(%r14), %esi
movq %rbx, %rdi
callq 0x10e0
addq $-0x4, %r14
movq %rax, %rdi
callq 0x1060
jmp 0x128c
leaq -0x30(%rbp), %rdi
callq 0x1366
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x1366
movq %rbx, %rdi
callq 0x10f0
// File: /workspace/github_cpp_makefile_star2_O2/kingufl[P]Rmapper/src/KDTree.cpp
// Function: KDNode::KDNode(std::vector<int, std::allocator<int>> const&, unsigned long const&, std::shared_ptr<KDNode> const&, std::shared_ptr<KDNode> const&)
KDNode::KDNode(const point_t &pt, const size_t &idx_, const KDNodePtr &left_,
               const KDNodePtr &right_) {
    x = pt;
    index = idx_;
    left = left_;
    right = right_;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %r12
movq %rdx, %r13
movq %rdi, %rbx
leaq 0x8(%rdi), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x8(%rdi)
andq $0x0, 0x38(%rdi)
movq %r15, %rdi
callq 0x44cc
leaq 0x30(%rbx), %r15
movq (%r13), %rax
movq %rax, (%rbx)
addq $0x20, %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x487e
movq %r15, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x487e
movq %rax, %r14
leaq 0x38(%rbx), %rdi
callq 0x4978
addq $0x28, %rbx
movq %rbx, %rdi
callq 0x4978
movq %r15, %rdi
callq 0x552c
movq %r14, %rdi
callq 0x3380
nop
// File: /workspace/github_cpp_makefile_star2_O2/kingufl[P]Rmapper/src/KDTree.cpp
// Function: KDNode::KDNode(std::pair<std::vector<int, std::allocator<int>>, unsigned long> const&, std::shared_ptr<KDNode> const&, std::shared_ptr<KDNode> const&)
KDNode::KDNode(const pointIndex &pi, const KDNodePtr &left_,
               const KDNodePtr &right_) {
    x = pi.first;
    index = pi.second;
    left = left_;
    right = right_;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x8(%rdi), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x8(%rdi)
andq $0x0, 0x38(%rdi)
movq %r15, %rdi
callq 0x44cc
leaq 0x30(%rbx), %r15
movq 0x18(%r13), %rax
movq %rax, (%rbx)
addq $0x20, %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x487e
movq %r15, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x487e
movq %rax, %r14
leaq 0x38(%rbx), %rdi
callq 0x4978
addq $0x28, %rbx
movq %rbx, %rdi
callq 0x4978
movq %r15, %rdi
callq 0x552c
movq %r14, %rdi
callq 0x3380
nop
// File: /workspace/github_cpp_makefile_star2_O2/kingufl[P]Rmapper/src/KDTree.cpp
// Function: KDTree::KDTree(std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>)
KDTree::KDTree(pointVec point_array) {
    leaf = std::make_shared< KDNode >();
    // iterators
    pointIndexArr arr;
    for (size_t i = 0; i < point_array.size(); i++) {
        arr.push_back(pointIndex(point_array.at(i), i));
    }

    auto begin = arr.begin();
    auto end = arr.end();

    size_t length = arr.size();
    size_t level = 0;  // starting

    root = KDTree::make_tree(begin, end, length, level);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
leaq -0x50(%rbp), %rdi
movq %rbx, -0x30(%rbp)
callq 0x4630
leaq 0x10(%rbx), %rdi
leaq -0x50(%rbp), %r15
movq %r15, %rsi
callq 0x5790
leaq -0x48(%rbp), %rdi
callq 0x4978
leaq -0x70(%rbp), %r12
andq $0x0, 0x10(%r12)
xorps %xmm0, %xmm0
movaps %xmm0, (%r12)
xorl %r13d, %r13d
pushq $0x18
popq %rbx
movq 0x8(%r14), %rax
subq (%r14), %rax
cqto
idivq %rbx
cmpq %rax, %r13
jae 0x3a00
movq %r14, %rdi
movq %r13, %rsi
callq 0x46a4
movq %r15, %rdi
movq %rax, %rsi
callq 0x45ba
movq %r13, -0x38(%rbp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x5916
movq %r15, %rdi
callq 0x552c
incq %r13
jmp 0x39bd
movq -0x70(%rbp), %rax
movq -0x68(%rbp), %rsi
leaq -0x90(%rbp), %rdx
movq %rax, (%rdx)
leaq -0x88(%rbp), %rcx
movq %rsi, (%rcx)
subq %rax, %rsi
sarq $0x5, %rsi
leaq -0x80(%rbp), %r8
movq %rsi, (%r8)
leaq -0x78(%rbp), %r9
andq $0x0, (%r9)
leaq -0x50(%rbp), %rdi
movq -0x30(%rbp), %rbx
movq %rbx, %rsi
callq 0x373e
leaq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0x5790
leaq -0x48(%rbp), %rdi
callq 0x4978
leaq -0x70(%rbp), %rdi
callq 0x46c2
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3a84
movq %rax, %r14
jmp 0x3a90
movq %rax, %r14
leaq -0x50(%rbp), %rdi
callq 0x552c
jmp 0x3a87
movq %rax, %r14
leaq -0x70(%rbp), %rdi
callq 0x46c2
movq -0x30(%rbp), %rbx
leaq 0x18(%rbx), %rdi
callq 0x4978
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x4978
movq %r14, %rdi
callq 0x3380
nop
// File: /workspace/github_cpp_makefile_star2_O2/kingufl[P]Rmapper/src/KDTree.cpp
// Function: KDTree::nearest_(std::vector<int, std::allocator<int>> const&)
KDNodePtr KDTree::nearest_(const point_t &pt) {
    size_t level = 0;
    // KDNodePtr best = branch;
    int branch_dist = dist2(point_t(*root), pt);
    return nearest_(root,          // beginning of tree
                    pt,            // point we are querying
                    level,         // start from level 0
                    root,          // best is the root
                    branch_dist);  // best_dist = branch_dist
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %rbx
andq $0x0, -0x28(%rbp)
movq %rsi, %r15
movq %rdi, %r14
movq (%rsi), %rsi
addq $0x8, %rsi
leaq -0x48(%rbp), %r12
movq %r12, %rdi
callq 0x45ba
movq %r12, %rdi
movq %rbx, %rsi
callq 0x46ed
movl %eax, %r12d
leaq -0x48(%rbp), %rdi
callq 0x552c
leaq -0x2c(%rbp), %rax
movl %r12d, (%rax)
movq %rax, (%rsp)
leaq -0x28(%rbp), %r8
movq %r14, %rdi
movq %r15, %rsi
movq %r15, %rdx
movq %rbx, %rcx
movq %r15, %r9
callq 0x3ab2
movq %r14, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x552c
movq %rbx, %rdi
callq 0x3380
// File: /workspace/github_cpp_makefile_star2_O2/kingufl[P]Rmapper/src/KDTree.cpp
// Function: KDTree::neighborhood_points(std::vector<int, std::allocator<int>> const&, int const&)
pointVec KDTree::neighborhood_points(  //
    const point_t &pt,                 //
    const int &rad) {
    size_t level = 0;
    pointIndexArr nbh = neighborhood_(root, pt, rad, level);
    pointVec nbhp;
    nbhp.resize(nbh.size());
    std::transform(nbh.begin(), nbh.end(), nbhp.begin(),
                   [](pointIndex x) { return x.first; });
    return nbhp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, %r8
movq %rdx, %rcx
movq %rdi, %r15
leaq -0x50(%rbp), %r9
andq $0x0, (%r9)
leaq -0x48(%rbp), %r14
movq %r14, %rdi
movq %rsi, %rdx
callq 0x3efa
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
andq $0x0, 0x10(%r15)
movq 0x8(%r14), %rsi
subq (%r14), %rsi
sarq $0x5, %rsi
movq %r15, %rdi
movq %r15, -0x30(%rbp)
callq 0x47d8
movq -0x48(%rbp), %r14
movq -0x40(%rbp), %rbx
movq (%r15), %r15
leaq -0x70(%rbp), %r12
leaq -0x88(%rbp), %r13
cmpq %rbx, %r14
je 0x43c0
movq %r12, %rdi
movq %r14, %rsi
callq 0x5e4c
movq %r13, %rdi
movq %r12, %rsi
callq 0x45ba
movq %r15, %rdi
movq %r13, %rsi
callq 0x50e8
movq %r13, %rdi
callq 0x552c
movq %r12, %rdi
callq 0x552c
addq $0x20, %r14
addq $0x18, %r15
jmp 0x4380
leaq -0x48(%rbp), %rdi
callq 0x46c2
movq -0x30(%rbp), %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x43de
movq %rax, %r14
jmp 0x43ef
movq %rax, %r14
leaq -0x70(%rbp), %rdi
callq 0x552c
movq -0x30(%rbp), %rdi
callq 0x481a
leaq -0x48(%rbp), %rdi
callq 0x46c2
movq %r14, %rdi
callq 0x3380
nop
// File: /workspace/github_cpp_makefile_star2_O2/kingufl[P]Rmapper/src/KDTree.cpp
// Function: KDTree::neighborhood_indices(std::vector<int, std::allocator<int>> const&, int const&)
indexArr KDTree::neighborhood_indices(  //
    const point_t &pt,                  //
    const int &rad) {
    size_t level = 0;
    pointIndexArr nbh = neighborhood_(root, pt, rad, level);
    indexArr nbhi;
    nbhi.resize(nbh.size());
    std::transform(nbh.begin(), nbh.end(), nbhi.begin(),
                   [](pointIndex x) { return x.second; });
    return nbhi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r8
movq %rdx, %rcx
movq %rdi, %rbx
leaq -0x48(%rbp), %r9
andq $0x0, (%r9)
leaq -0x40(%rbp), %r14
movq %r14, %rdi
movq %rsi, %rdx
callq 0x3efa
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
movq 0x8(%r14), %rsi
subq (%r14), %rsi
sarq $0x5, %rsi
movq %rbx, %rdi
callq 0x4846
movq -0x40(%rbp), %r14
movq -0x38(%rbp), %r12
movq (%rbx), %r13
leaq -0x68(%rbp), %r15
cmpq %r12, %r14
je 0x4492
movq %r15, %rdi
movq %r14, %rsi
callq 0x5e4c
movq -0x50(%rbp), %rax
movq %rax, (%r13)
movq %r15, %rdi
callq 0x552c
addq $0x20, %r14
addq $0x8, %r13
jmp 0x4468
leaq -0x40(%rbp), %rdi
callq 0x46c2
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x44af
movq %rax, %r14
movq %rbx, %rdi
callq 0x60fe
leaq -0x40(%rbp), %rdi
callq 0x46c2
movq %r14, %rdi
callq 0x3380
nop
// File: /workspace/github_cpp_makefile_star2_O2/kingufl[P]Rmapper/src/KDTree.cpp
// Function: sort_on_idx(__gnu_cxx::__normal_iterator<std::pair<std::vector<int, std::allocator<int>>, unsigned long>*, std::vector<std::pair<std::vector<int, std::allocator<int>>, unsigned long>, std::allocator<std::pair<std::vector<int, std::allocator<int>>, unsigned long>>>> const&, __gnu_cxx::__normal_iterator<std::pair<std::vector<int, std::allocator<int>>, unsigned long>*, std::vector<std::pair<std::vector<int, std::allocator<int>>, unsigned long>, std::allocator<std::pair<std::vector<int, std::allocator<int>>, unsigned long>>>> const&, unsigned long)
inline void sort_on_idx(const pointIndexArr::iterator &begin,  //
                        const pointIndexArr::iterator &end,    //
                        size_t idx) {
    comparer comp(idx);
    comp.idx = idx;

    using std::placeholders::_1;
    using std::placeholders::_2;

    std::sort(begin, end, std::bind(&comparer::compare_idx, comp, _1, _2));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq (%rdi), %rdi
movq (%rsi), %rsi
leaq 0x351(%rip), %rcx       # 0x49b2
leaq -0x18(%rbp), %rax
movq %rcx, (%rax)
andq $0x0, 0x8(%rax)
movq %rdx, 0x10(%rax)
movq %rax, %rdx
callq 0x498c
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kingufl[P]Rmapper/src/KDTree.cpp
// Function: dist2(std::vector<int, std::allocator<int>> const&, std::vector<int, std::allocator<int>> const&)
inline int dist2(const point_t &a, const point_t &b) {
    int distc = 0;
    for (size_t i = 0; i < a.size(); i++) {
        int di = a.at(i) - b.at(i);
        distc += di * di;
    }
    return distc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x8(%r14), %rax
subq (%r14), %rax
sarq $0x2, %rax
cmpq %rax, %r15
jae 0x473f
movq %r14, %rdi
movq %r15, %rsi
callq 0x4752
movl (%rax), %r13d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4752
subl (%rax), %r13d
imull %r13d, %r13d
addl %r13d, %r12d
incq %r15
jmp 0x4707
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/kingufl[P]Rmapper/src/KDTree.cpp
// Function: disth(std::vector<int, std::allocator<int>> const&, std::vector<int, std::allocator<int>> const&, int)
inline int disth(const point_t &a, const point_t &b, int rad) {
    int distc = 0;
    for (size_t i = 0; i < a.size(); i++) {
        if(abs(a[i]-b[i])>rad){
            distc++;
            break;
        }
    }

    if(distc==0)
        return 1;
    else
        return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
movq (%rsi), %rsi
xorl %r8d, %r8d
movq %r8, %rdi
cmpq %r8, %rcx
je 0x47ae
movl (%rax,%rdi,4), %r8d
subl (%rsi,%rdi,4), %r8d
movl %r8d, %r9d
negl %r9d
cmovsl %r8d, %r9d
leaq 0x1(%rdi), %r8
cmpl %edx, %r9d
jle 0x478b
xorl %eax, %eax
cmpq %rcx, %rdi
setae %al
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kingufl[P]Rmapper/src/buildgraph.cpp
// Function: kthSmallest(int*, int, int, int)
int kthSmallest(int arr[], int l, int r, int k)
{
    // If k is smaller than number of elements in array
    if (k > 0 && k <= r - l + 1) {
        // Partition the array around last element and get
        // position of pivot element in sorted array
        int pos = partition(arr, l, r);

        // If position is same as k
        if (pos - l == k - 1)
            return arr[pos];
        if (pos - l > k - 1) // If position is more, recur for left subarray
            return kthSmallest(arr, l, pos - 1, k);

        // Else recur for right subarray
        return kthSmallest(arr, pos + 1, r, k - pos + l - 1);
    }

    // If k is more than number of elements in array
    return INT_MAX;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r12d
movl %edx, %r15d
movl %esi, %r14d
movq %rdi, %rbx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
testl %r12d, %r12d
jle 0x635d
leal -0x1(%r12), %r13d
movl %r15d, %eax
subl %r14d, %eax
incl %eax
cmpl %r12d, %eax
jl 0x6351
movq %rbx, %rdi
movl %r14d, %esi
movl %r15d, %edx
callq 0x636c
movl %eax, %ecx
subl %r14d, %ecx
cmpl %r13d, %ecx
je 0x6358
cmpl %r12d, %ecx
jl 0x633e
decl %eax
movl %eax, %r15d
jmp 0x630d
leal 0x1(%rax), %ecx
addl %r12d, %r14d
notl %eax
addl %r14d, %eax
movl %ecx, %r14d
movl %eax, %r12d
jmp 0x62fe
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
jmp 0x635d
cltq
movl (%rbx,%rax,4), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kingufl[P]Rmapper/src/buildgraph.cpp
// Function: partition(int*, int, int)
int partition(int arr[], int l, int r)
{
    int x = arr[r], i = l;
    for (int j = l; j <= r - 1; j++) {
        if (arr[j] <= x) {
            swap(&arr[i], &arr[j]);
            i++;
        }
    }
    swap(&arr[i], &arr[r]);
    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq %edx, %rcx
movl (%rdi,%rcx,4), %edx
movslq %esi, %r8
movslq %esi, %rax
cmpq %rcx, %r8
jge 0x639e
movl (%rdi,%r8,4), %r9d
cmpl %edx, %r9d
jg 0x6399
movl (%rdi,%rax,4), %esi
movl %r9d, (%rdi,%rax,4)
movl %esi, (%rdi,%r8,4)
incl %eax
movl %eax, %esi
incq %r8
jmp 0x6379
movl (%rdi,%rax,4), %edx
movl (%rdi,%rcx,4), %esi
movl %esi, (%rdi,%rax,4)
movl %edx, (%rdi,%rcx,4)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kingufl[P]Rmapper/src/buildgraph.cpp
// Function: uncover_frags(int, int, int, std::vector<int, std::allocator<int>>&)
point_t uncover_frags(int kmer_size, int i_rmap, int q_rmap,vector<int>& rmap){

    point_t retvar((kmer_size)*2);
    int i;
    for(i=0;i<kmer_size;i++){

        retvar[i]=rmap[i_rmap++];
    }

    for(int j=q_rmap+kmer_size;j>q_rmap+kmer_size-(kmer_size);j--){
        retvar[i++]=rmap[j];
    }

    return(retvar);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movl %ecx, %r14d
movl %edx, %r13d
movl %esi, %r12d
movq %rdi, %rbx
leal (%r12,%r12), %eax
movslq %eax, %rsi
leaq -0x29(%rbp), %rdx
callq 0xb714
movq (%rbx), %rcx
xorl %edx, %edx
testl %r12d, %r12d
movl $0x0, %eax
cmovgl %r12d, %eax
movslq %r13d, %rsi
shlq $0x2, %rsi
addq (%r15), %rsi
cmpq %rdx, %rax
je 0x6412
movl (%rsi,%rdx,4), %edi
movl %edi, (%rcx,%rdx,4)
incq %rdx
jmp 0x6402
addl %r14d, %r12d
movq (%r15), %rcx
movslq %r12d, %rdx
movslq %r14d, %rsi
shlq $0x2, %rax
addq (%rbx), %rax
cmpq %rsi, %rdx
jle 0x6438
movl (%rcx,%rdx,4), %edi
movl %edi, (%rax)
decq %rdx
addq $0x4, %rax
jmp 0x6425
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kingufl[P]Rmapper/src/buildgraph.cpp
// Function: extract_one_bilabel(int, int, int, int, std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
bilabel extract_one_bilabel(int index, int kmer_size, int dsize, int start_locus, vector<int>& temp, vector<int>& temp_sum, int orientation, int chromosome, string rmapname,int rmap_id){

    bilabel tembi;
    int locus=start_locus;

    int i=index;
    tembi.kmer_size=kmer_size;
    tembi.rmap_from=rmapname;
    tembi.rmap_id=rmap_id;
    tembi.i_rmap=i;
    tembi.chromosome=chromosome;
    tembi.locus=locus;
    tembi.orientation=orientation;

    int k1_end=i+kmer_size-1;
    int p_rmap=k1_end+1;
    int q_rmap=p_rmap;


    if(i>0)
        tembi.sums[0]=temp_sum[k1_end]-temp_sum[i-1];
    else
        tembi.sums[0]=temp_sum[k1_end];

    while(temp_sum[q_rmap]-temp_sum[k1_end]<dsize){
        q_rmap++;
        if(q_rmap+kmer_size>=temp.size()){
            tembi.kmer_size=-1;
            return(tembi);
        }

    }

    tembi.sums[1]=temp_sum[q_rmap]-temp_sum[k1_end];
    tembi.q_rmap=q_rmap;
    tembi.sums[2]=temp_sum[q_rmap+kmer_size]-temp_sum[q_rmap];

    return(tembi);


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, -0x30(%rbp)
movl %r8d, %r15d
movl %ecx, %r14d
movl %edx, %r12d
movl %esi, %r13d
movq %rdi, %rbx
movq 0x28(%rbp), %rsi
leaq 0x20(%rdi), %rax
movq %rax, 0x10(%rdi)
andq $0x0, 0x18(%rdi)
addq $0x10, %rdi
movb $0x0, 0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rbx)
andq $0x0, 0x58(%rbx)
movl %edx, (%rbx)
callq 0x3130
movl 0x30(%rbp), %eax
movl 0x20(%rbp), %ecx
movl 0x18(%rbp), %edx
movq 0x10(%rbp), %rsi
movl %eax, 0x30(%rbx)
movl %r13d, 0x34(%rbx)
movl %ecx, 0xc(%rbx)
movl %r15d, 0x4(%rbx)
movl %edx, 0x8(%rbx)
leal (%r12,%r13), %eax
movslq %eax, %r9
leaq -0x1(%r9), %rdx
movq (%rsi), %rcx
movl -0x4(%rcx,%r9,4), %esi
testl %r13d, %r13d
jle 0x64d4
movl %r13d, %edi
subl -0x4(%rcx,%rdi,4), %esi
movl %esi, 0x3c(%rbx)
movl (%rcx,%rdx,4), %esi
movq -0x30(%rbp), %rdx
movq 0x8(%rdx), %rdi
subq (%rdx), %rdi
sarq $0x2, %rdi
movslq %r12d, %r8
leaq (%rcx,%r9,4), %rdx
addq %r9, %r8
movl (%rdx), %r9d
subl %esi, %r9d
cmpl %r14d, %r9d
jge 0x6511
addq $0x4, %rdx
incq %r8
incl %eax
cmpq %r8, %rdi
ja 0x64f3
orl $-0x1, (%rbx)
jmp 0x6523
movl %r9d, 0x40(%rbx)
movl %eax, 0x38(%rbx)
movslq %r8d, %rax
movl (%rcx,%rax,4), %eax
subl (%rdx), %eax
movl %eax, 0x44(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0xb766
movq %r14, %rdi
callq 0x3380
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH10_GenericAlgorithms/examples/use-istream-iter.cc
// Function: main
int main() {
	vector<int> vec;
	istream_iterator<int> in_iter(cin);  // read ints from cin
	istream_iterator<int> eof;           // istream ``end'' iterator

	// use in_iter to read cin storing what we read in vec
	while (in_iter != eof)  // while there's valid input to read
		// postfix increment reads the stream and 
		// returns the old value of the iterator
		// we dereference that iterator to get 
		// the previous value read from the stream 
		vec.push_back(*in_iter++);  

	// use an ostream_iterator to print the contents of vec
	ostream_iterator<int> out_iter(cout, " ");
	copy(vec.begin(), vec.end(), out_iter);
	cout << endl;
	
	// alternative way to print contents of vec
	for (auto e : vec)
		*out_iter++ = e;  // the assignment writes this element to cout
	cout << endl;
	
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
andq $0x0, -0x30(%rbp)
movq 0x2d62(%rip), %rsi      # 0x3fe0
leaq -0x70(%rbp), %rdi
callq 0x1362
leaq -0x48(%rbp), %rbx
leaq -0x50(%rbp), %r14
leaq -0x70(%rbp), %r15
leaq -0x40(%rbp), %r12
cmpb $0x0, -0x64(%rbp)
je 0x12b7
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x139a
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1374
jmp 0x1297
movq 0x2d12(%rip), %rax      # 0x3fd0
movq %rax, -0x50(%rbp)
leaq 0xd3b(%rip), %rdi       # 0x2004
movq %rdi, -0x48(%rbp)
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
leaq -0x80(%rbp), %rcx
movq %rax, (%rcx)
movq %rdi, 0x8(%rcx)
leaq -0x60(%rbp), %rdi
callq 0x13c7
movq 0x2ce0(%rip), %rdi      # 0x3fd0
callq 0x1060
movq -0x40(%rbp), %r15
movq -0x38(%rbp), %r12
leaq -0x50(%rbp), %rbx
leaq -0x60(%rbp), %r14
cmpq %r12, %r15
je 0x1321
movl (%r15), %eax
movl %eax, -0x60(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x13fa
addq $0x4, %r15
jmp 0x1305
movq 0x2ca8(%rip), %rdi      # 0x3fd0
callq 0x1060
leaq -0x40(%rbp), %rdi
callq 0x1436
xorl %eax, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x134d
jmp 0x134d
jmp 0x134d
jmp 0x134d
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x1436
movq %rbx, %rdi
callq 0x1110
nop
// File: /workspace/github_cpp_makefile_star2_O2/tonymuu[P]distributed-kv-store/MP1Node.cpp
// Function: MP1Node::MP1Node(Params*, EmulNet*, Log*, Address*)
MP1Node::MP1Node( Params *params, EmulNet *emul, Log *log, Address *address) {
	for( int i = 0; i < 6; i++ ) {
		NULLADDR[i] = 0;
	}
	this->memberNode = new Member;
    this->shouldDeleteMember = true;
	memberNode->inited = false;
	this->emulNet = emul;
	this->log = log;
	this->par = params;
	this->memberNode->addr = *address;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r12
leaq 0x18c7b(%rip), %rax     # 0x1cc28
movq %rax, (%rdi)
pushq $-0x6
popq %rax
testq %rax, %rax
je 0x3fc3
movb $0x0, 0x2f(%r12,%rax)
incq %rax
jmp 0x3fb3
movl $0xe8, %edi
callq 0x32b0
movq %rax, %rbp
movq %rax, %rdi
callq 0x4a8c
movq %rbp, 0x20(%r12)
movb $0x1, 0x28(%r12)
movb $0x0, 0xe(%rbp)
movq %r13, 0x8(%r12)
movq %r14, 0x10(%r12)
movq %r15, 0x18(%r12)
addq $0x8, %rbp
movq %rbp, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xac2e
movq %rax, %rbx
movl $0xe8, %esi
movq %rbp, %rdi
callq 0x32c0
movq %rbx, %rdi
callq 0x3490
nop
// File: /workspace/github_cpp_makefile_star2_O2/tonymuu[P]distributed-kv-store/MP1Node.cpp
// Function: MP1Node::MP1Node(Member*, Params*, EmulNet*, Log*, Address*)
MP1Node::MP1Node(Member* member, Params *params, EmulNet *emul, Log *log, Address *address) {
    for( int i = 0; i < 6; i++ ) {
        NULLADDR[i] = 0;
    }
    this->memberNode = member;
    this->shouldDeleteMember = false;
    this->emulNet = emul;
    this->log = log;
    this->par = params;
    this->memberNode->addr = *address;
}

// Assembly:
leaq 0x18bf5(%rip), %rax     # 0x1cc28
movq %rax, (%rdi)
pushq $-0x6
popq %rax
testq %rax, %rax
je 0x4048
movb $0x0, 0x2f(%rdi,%rax)
incq %rax
jmp 0x4039
movq %rsi, 0x20(%rdi)
movb $0x0, 0x28(%rdi)
movq %rcx, 0x8(%rdi)
movq %r8, 0x10(%rdi)
movq %rdx, 0x18(%rdi)
addq $0x8, %rsi
movq %rsi, %rdi
movq %r9, %rsi
jmp 0xac2e
nop
// File: /workspace/github_cpp_makefile_star2_O2/tonymuu[P]distributed-kv-store/MP1Node.cpp
// Function: MP1Node::nodeStart(char*, short)
void MP1Node::nodeStart(char *servaddrstr, short servport) {
    Address joinaddr;
    joinaddr = getJoinAddress();

    // Self booting routines
    if( initThisNode(&joinaddr) == -1 ) {
#ifdef DEBUGLOG
        log->LOG(&memberNode->addr, "init_thisnode failed. Exit.");
#endif
        exit(1);
    }

    if( !introduceSelfToGroup(&joinaddr) ) {
        finishUpThisNode();
#ifdef DEBUGLOG
        log->LOG(&memberNode->addr, "Unable to join self to group. Exiting.");
#endif
        exit(1);
    }

    return;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %r14
andw $0x0, 0x4(%r14)
andl $0x0, (%r14)
leaq 0x8(%rsp), %rsi
movl $0x1, (%rsi)
andw $0x0, 0x4(%rsi)
movq %r14, %rdi
callq 0xac2e
movq %rbx, %rdi
callq 0x4136
movq %rbx, %rdi
movq %r14, %rsi
callq 0x416c
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tonymuu[P]distributed-kv-store/MP1Node.cpp
// Function: MP1Node::introduceSelfToGroup(Address*)
int MP1Node::introduceSelfToGroup(Address *joinaddr) {
	MessageHdr *msg;
#ifdef DEBUGLOG
    static char s[1024];
#endif

    if ( 0 == strcmp((char *)&(memberNode->addr.addr), (char *)&(joinaddr->addr))) {
        // I am the group booter (first process to join the group). Boot up the group
#ifdef DEBUGLOG
        log->LOG(&memberNode->addr, "Starting up group...");
#endif
        memberNode->inGroup = true;
        // add myself to my memberlist
        int id = 0;
        short port;
        setIdAndPortFromAddress(memberNode->addr, &id, &port);
        MemberListEntry entry = MemberListEntry(id, port, 0, par->getcurrtime());
        memberNode->memberList.push_back(entry);

        // log to debug log about new node join
        log->logNodeAdd(&memberNode->addr, &memberNode->addr);
    }
    else {
        size_t msgsize = sizeof(MessageHdr) + sizeof(joinaddr->addr) + sizeof(long) + 1;
        msg = (MessageHdr *) malloc(msgsize * sizeof(char));

        // create JOINREQ message: format of data is {struct Address myaddr}
        msg->msgType = JOINREQ;
        memcpy((char *)(msg+1), &memberNode->addr.addr, sizeof(memberNode->addr.addr));
        memcpy((char *)(msg+1) + 1 + sizeof(memberNode->addr.addr), &memberNode->heartbeat, sizeof(long));

#ifdef DEBUGLOG
        sprintf(s, "Trying to join...");
        log->LOG(&memberNode->addr, s);
#endif

        // send JOINREQ message to introducer member
        emulNet->ENsend(&memberNode->addr, joinaddr, (char *)msg, msgsize);

        free(msg);
    }

    return 1;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x20(%rdi), %r13
leaq 0x8(%r13), %r15
movq %r15, %rdi
callq 0x33b0
testl %eax, %eax
je 0x420f
pushq $0x13
popq %rdi
callq 0x3390
movq %rax, %r12
andl $0x0, (%rax)
movl (%r15), %eax
movl %eax, 0x4(%r12)
movzwl 0x4(%r15), %eax
movw %ax, 0x8(%r12)
movq 0x18(%r13), %rax
movq %rax, 0xb(%r12)
movups 0xee6e(%rip), %xmm0     # 0x13033
movaps %xmm0, 0x19174(%rip)    # 0x1d340
movw $0x2e, 0x1917b(%rip)    # 0x1d350
leaq 0x19164(%rip), %rdx     # 0x1d340
movq 0x10(%rbx), %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0xa106
movq 0x8(%rbx), %rdi
movq 0x20(%rbx), %rsi
addq $0x8, %rsi
pushq $0x13
popq %r8
movq %r14, %rdx
movq %r12, %rcx
callq 0x6472
movq %r12, %rdi
callq 0x3340
jmp 0x4289
movq 0x10(%rbx), %rdi
leaq 0xee04(%rip), %rdx      # 0x1301e
movq %r15, %rsi
xorl %eax, %eax
callq 0xa106
movq 0x20(%rbx), %rsi
movb $0x1, 0xf(%rsi)
addq $0x8, %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xac20
movl (%r14), %ebp
movswl 0x4(%r14), %r14d
movq 0x18(%rbx), %rdi
callq 0xabe4
movslq %eax, %r8
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movl %ebp, %esi
movl %r14d, %edx
xorl %ecx, %ecx
callq 0xac5e
movq 0x20(%rbx), %rdi
addq $0x28, %rdi
movq %r15, %rsi
callq 0x4b28
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rdx
addq $0x8, %rdx
movq %rdx, %rsi
callq 0xa3aa
pushq $0x1
popq %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tonymuu[P]distributed-kv-store/MP1Node.cpp
// Function: MP1Node::finishUpThisNode()
int MP1Node::finishUpThisNode(){
    memberNode->inited = false;
    memberNode->inGroup = false;
    memberNode->nnb = 0;
    memberNode->heartbeat = 0;
    memberNode->memberList.clear();
    return 0;
}

// Assembly:
movq 0x20(%rdi), %rax
andw $0x0, 0xe(%rax)
andl $0x0, 0x14(%rax)
andq $0x0, 0x18(%rax)
movq 0x28(%rax), %rcx
cmpq %rcx, 0x30(%rax)
je 0x42bc
movq %rcx, 0x30(%rax)
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tonymuu[P]distributed-kv-store/MP1Node.cpp
// Function: MP1Node::recvCallBack(void*, char*, int)
bool MP1Node::recvCallBack(void *env, char *data, int size ) {
    // Get msg header from msg
    MessageHdr header;
    memcpy(&header, data, sizeof(MessageHdr));

    // Perform different functions based on different msg type
    if (header.msgType == JOINREQ) {
        // deserialize msg from memory
        Address addr;
        addr.init();
        long heartbeat = 0;
        memcpy(&addr.addr, data + sizeof(MessageHdr), sizeof(addr.addr));
        memcpy(&heartbeat, data + sizeof(MessageHdr) + sizeof(addr.addr), sizeof(long));

        // add to my memberlist
        int id = 0;
        short port;
        setIdAndPortFromAddress(addr, &id, &port);
        MemberListEntry entry = MemberListEntry(id, port, heartbeat, par->getcurrtime());
        memberNode->memberList.push_back(entry);

        // log to debug log about new node join
        log->logNodeAdd(&memberNode->addr, &addr);

        // send joinrep msg that includes my memberlist
        sendJoinRepMsg(&addr);
    } else if (header.msgType == JOINREP) {
        // Since I received JOINREP, I've made myself known so I'm in the group
        memberNode->inGroup = true;
        // We just joined, so we should use introducer's membership list and clear anything previously stored.
        memberNode->memberList.clear();

        // Now we deserialize the msg and update my member list
        deserializeAndUpdateMemberList(data, size);
    } else if (header.msgType == UPDATEREQ) {
        // update membership list, add any new nodes, log
        deserializeAndUpdateMemberList(data, size);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl (%rdx), %eax
cmpl $0x1, %eax
je 0x4594
testl %eax, %eax
jne 0x45aa
movzwl 0x8(%rdx), %eax
leaq 0x8(%rsp), %r14
movw %ax, 0x4(%r14)
movl 0x4(%rdx), %eax
movl %eax, (%r14)
movq 0xa(%rdx), %r15
movq %rsp, %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0xac20
movl (%r12), %ebp
movswl 0x4(%r12), %r12d
movq 0x18(%rbx), %rdi
callq 0xabe4
movslq %eax, %r8
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movl %ebp, %esi
movl %r12d, %edx
movq %r15, %rcx
callq 0xac5e
movq 0x20(%rbx), %rdi
addq $0x28, %rdi
movq %r13, %rsi
callq 0x4b28
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rsi
addq $0x8, %rsi
movq %r14, %rdx
callq 0xa3aa
movq %rbx, %rdi
movq %r14, %rsi
callq 0x45b8
movq 0x20(%rbx), %rax
movb $0x1, 0xf(%rax)
movq 0x28(%rax), %rsi
cmpq %rsi, 0x30(%rax)
je 0x45aa
movq %rsi, 0x30(%rax)
movq %rbx, %rdi
movq %rdx, %rsi
movl %ecx, %edx
callq 0x463a
nop
// File: /workspace/github_cpp_makefile_star2_O2/tonymuu[P]distributed-kv-store/MP1Node.cpp
// Function: MP1Node::sendJoinRepMsg(Address*)
void MP1Node::sendJoinRepMsg(Address *toAddr) {
    // Create the msg that includes header and my member list entires
    int mleSize = sizeof(int) + sizeof(short) + sizeof(long) + sizeof(long), numEntries = memberNode->memberList.size();
    size_t msgsize = sizeof(MessageHdr) + mleSize * numEntries;

    MessageHdr *msg;
    msg = (MessageHdr *) malloc(msgsize * sizeof(char));
    msg->msgType = JOINREP;

    serializeMemberList(msg);
    // Reply with JOINREP message
    emulNet->ENsend(&memberNode->addr, toAddr, (char *)msg, msgsize);

    free(msg);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x20(%rdi), %rcx
movq 0x30(%rcx), %rax
subq 0x28(%rcx), %rax
pushq $0x18
popq %rcx
cqto
idivq %rcx
movabsq $0x1600000000, %r15     # imm = 0x1600000000
imulq %rax, %r15
sarq $0x20, %r15
addq $0x4, %r15
movq %r15, %rdi
callq 0x3390
movq %rax, %r12
movl $0x1, (%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x47f2
movq 0x8(%r14), %rdi
movq 0x20(%r14), %rsi
addq $0x8, %rsi
movq %rbx, %rdx
movq %r12, %rcx
movl %r15d, %r8d
callq 0x6472
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3340
nop
// File: /workspace/github_cpp_makefile_star2_O2/tonymuu[P]distributed-kv-store/MP1Node.cpp
// Function: MP1Node::serializeMemberList(MP1Node::MessageHdr*)
void MP1Node::serializeMemberList(MessageHdr* msg) {
    int offset = 0;
    int id = 0;
    short port = 0;
    setIdAndPortFromAddress(memberNode->addr, &id, &port);
    long currTime = par->getcurrtime();
    for(auto mle = memberNode->memberList.begin(); mle != memberNode->memberList.end(); ++mle) {
        memcpy((char *)(msg+1) + offset, &mle->id, sizeof(int));
        offset += sizeof(int);

        memcpy((char *)(msg+1) + offset, &mle->port, sizeof(short));
        offset += sizeof(short);

        memcpy((char *)(msg+1) + offset, mle->id == id ? &(memberNode->heartbeat) : &(mle->heartbeat), sizeof(long));
        offset += sizeof(long);

        memcpy((char *)(msg+1) + offset, mle->id == id ? &currTime : &(mle->timestamp), sizeof(long));
        offset += sizeof(long);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x20(%rdi), %rsi
addq $0x8, %rsi
movq %rsp, %r15
movq %r15, %rdi
callq 0xac20
movl (%r15), %ebp
movq 0x18(%r14), %rdi
callq 0xabe4
cltq
movq 0x20(%r14), %r10
movq 0x28(%r10), %rdi
xorl %r9d, %r9d
movabsq $0x400000000, %rcx      # imm = 0x400000000
movabsq $0x600000000, %rdx      # imm = 0x600000000
movabsq $0xe00000000, %rsi      # imm = 0xE00000000
cmpq 0x30(%r10), %rdi
je 0x48c1
movq %r9, %r8
shlq $0x20, %r8
movslq %r9d, %r9
movl (%rdi), %r10d
movl %r10d, 0x4(%rbx,%r9)
leaq (%r8,%rcx), %r9
sarq $0x20, %r9
movzwl 0x4(%rdi), %r10d
movw %r10w, 0x4(%rbx,%r9)
leaq (%r8,%rdx), %r10
sarq $0x20, %r10
movq 0x20(%r14), %r11
addq $0x18, %r11
cmpl %ebp, (%rdi)
leaq 0x8(%rdi), %r9
cmovneq %r9, %r11
movq (%r11), %r11
movq %r11, 0x4(%rbx,%r10)
movq %rax, %r10
cmpl %ebp, (%rdi)
je 0x48a1
movq 0x10(%rdi), %r10
addq %rsi, %r8
sarq $0x20, %r8
movq %r10, 0x4(%rbx,%r8)
addq $0x8, %r8
movq 0x20(%r14), %r10
addq $0x10, %r9
movq %r9, %rdi
movq %r8, %r9
jmp 0x4849
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tonymuu[P]distributed-kv-store/MP1Node.cpp
// Function: MP1Node::createMemberlistMap()
map<int, MemberListEntry*> MP1Node::createMemberlistMap() {
    map<int, MemberListEntry*> map;
    for (auto neighbour = memberNode->memberList.begin(); neighbour != memberNode->memberList.end(); neighbour++) {
        map[neighbour->id] = &*neighbour;
    }
    return map;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
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)
movq %rsi, %r14
movq 0x20(%rsi), %rax
movq 0x28(%rax), %r15
cmpq 0x30(%rax), %r15
je 0x49bd
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4b74
movq %r15, (%rax)
addq $0x18, %r15
movq 0x20(%r14), %rax
jmp 0x499f
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x5340
movq %r14, %rdi
callq 0x3490
nop
// File: /workspace/github_cpp_makefile_star2_O2/tonymuu[P]distributed-kv-store/MP1Node.cpp
// Function: MP1Node::getNodeFromMemberListTable(int)
MemberListEntry* MP1Node::getNodeFromMemberListTable(int id) {
    for(auto mle = memberNode->memberList.begin(); mle != memberNode->memberList.end(); ++mle) {
        if(mle->id == id) {
            return mle.base();
        }
    }
    return nullptr;
}

// Assembly:
movq 0x20(%rdi), %rcx
movq 0x28(%rcx), %rax
movq 0x30(%rcx), %rcx
cmpq %rcx, %rax
je 0x4a39
cmpl %esi, (%rax)
je 0x4a3b
addq $0x18, %rax
jmp 0x4a2a
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/tonymuu[P]distributed-kv-store/./Queue.h
// Function: Queue::enqueue(std::queue<q_elt, std::deque<q_elt, std::allocator<q_elt>>>*, void*, int)
static bool enqueue(queue<q_elt> *queue, void *buffer, int size) {
		q_elt element(buffer, size);
		queue->emplace(element);
		//cout<<endl<<"QUEUE size at this point is: "<<queue->size();
		return true;
	}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xac18
movq %rbx, %rdi
movq %r14, %rsi
callq 0x50de
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tonymuu[P]distributed-kv-store/Application.cpp
// Function: Application::run()
int Application::run()
{
	int i;
	int timeWhenAllNodesHaveJoined = 0;
	// boolean indicating if all nodes have joined
	bool allNodesJoined = false;
	srand(time(NULL));

	// As time runs along
	for( par->globaltime = 0; par->globaltime < TOTAL_RUNNING_TIME; ++par->globaltime ) {
		// Run the membership protocol
		mp1Run();

		// Wait for all nodes to join
		if ( par->allNodesJoined == nodeCount && !allNodesJoined ) {
			timeWhenAllNodesHaveJoined = par->getcurrtime();
			allNodesJoined = true;
		}
		if ( par->getcurrtime() > timeWhenAllNodesHaveJoined + 50 ) {
			// Call the KV store functionalities
			mp2Run();
		}
		// Fail some nodes
		//fail();
	}

	// Clean up
	en->ENcleanup();
	en1->ENcleanup();

	for(i=0;i<=par->EN_GPSZ-1;i++) {
		 mp1[i]->finishUpThisNode();
	}

	return SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x3260
movl %eax, %edi
callq 0x3280
movq 0x58(%rbx), %rax
andl $0x0, 0x28(%rax)
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpl $0x2bb, %r12d           # imm = 0x2BB
jg 0x6abd
movq %rbx, %rdi
callq 0x6ebc
movq 0x58(%rbx), %rdi
movl 0x2c(%rdi), %eax
cmpl 0x17542(%rip), %eax     # 0x1dfc0
setne %al
orb %r15b, %al
testb $0x1, %al
jne 0x6a97
callq 0xabe4
movl %eax, %r14d
movq 0x58(%rbx), %rdi
movb $0x1, %r15b
callq 0xabe4
leal 0x32(%r14), %ecx
cmpl %ecx, %eax
jle 0x6aac
movq %rbx, %rdi
callq 0x707e
movq 0x58(%rbx), %rax
movl 0x28(%rax), %r12d
incl %r12d
movl %r12d, 0x28(%rax)
jmp 0x6a60
movq 0x28(%rbx), %rdi
callq 0x6798
movq 0x30(%rbx), %rdi
callq 0x6798
xorl %r14d, %r14d
movq 0x58(%rbx), %rax
movslq 0x18(%rax), %rax
cmpq %rax, %r14
jge 0x6af1
movq 0x40(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x429c
incq %r14
jmp 0x6ad2
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tonymuu[P]distributed-kv-store/Application.cpp
// Function: Application::~Application()
Application::~Application() {
	delete log;
	delete en;
	delete en1;
	for ( int i = 0; i < par->EN_GPSZ; i++ ) {
        delete members[i];
		delete mp1[i];
		delete mp2[i];
	}
	free(mp1);
	free(mp2);
    free(members);
	delete par;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x15f09(%rip), %rax     # 0x1cce8
movq %rax, (%rdi)
movq 0x38(%rdi), %rdi
testq %rdi, %rdi
je 0x6df1
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x6e00
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x6e0f
movq (%rdi), %rax
callq *0x8(%rax)
xorl %r15d, %r15d
movq 0x58(%rbx), %rax
movslq 0x18(%rax), %rax
cmpq %rax, %r15
jge 0x6e6c
movq 0x50(%rbx), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0x6e32
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0x6e45
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x48(%rbx), %rax
movq (%rax,%r15,8), %r14
testq %r14, %r14
je 0x6e5a
movq %r14, %rdi
callq 0xcd9a
movl $0xf0, %esi
movq %r14, %rdi
callq 0x32c0
incq %r15
jmp 0x6e12
movq 0x40(%rbx), %rdi
callq 0x3340
movq 0x48(%rbx), %rdi
callq 0x3340
movq 0x50(%rbx), %rdi
callq 0x3340
movq 0x58(%rbx), %rdi
pushq $0x38
popq %rsi
callq 0x32c0
addq $0x60, %rbx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x989c
// File: /workspace/github_cpp_makefile_star2_O2/tonymuu[P]distributed-kv-store/Application.cpp
// Function: Application::insertTestKVPairs()
void Application::insertTestKVPairs() {
	int number = 0;

	/*
	 * Init a few test key value pairs
	 */
	initTestKVPairs();

	for ( map<string, string>::iterator it = testKVPairs.begin(); it != testKVPairs.end(); ++it ) {
		// Step 1. Find a node that is alive
		number = findARandomNodeThatIsAlive();

		// Step 2. Issue a create operation
		log->LOG(&mp2[number]->getMemberNode()->addr, "CREATE OPERATION KEY: %s VALUE: %s at time: %d", it->first.c_str(), it->second.c_str(), par->getcurrtime());
		mp2[number]->clientCreate(it->first, it->second);
	}

	cout<<endl<<"Sent " <<testKVPairs.size() <<" create messages to the ring"<<endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
callq 0x9526
movq 0x78(%rbx), %r15
movq %rbx, (%rsp)
leaq 0x68(%rbx), %rax
movq %rax, 0x8(%rsp)
cmpq 0x8(%rsp), %r15
je 0x731a
movq (%rsp), %rbp
movq %rbp, %rdi
callq 0x94fc
movq 0x38(%rbp), %rcx
movq %rcx, 0x10(%rsp)
movq 0x48(%rbp), %rcx
movslq %eax, %r12
movq (%rcx,%r12,8), %rax
movq 0x50(%rax), %r14
addq $0x8, %r14
leaq 0x20(%r15), %rax
movq %rax, 0x18(%rsp)
leaq 0x40(%r15), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%r15), %r13
movq 0x40(%r15), %rbx
movq 0x58(%rbp), %rdi
callq 0xabe4
movq 0x10(%rsp), %rdi
movq %r14, %rsi
leaq 0x28(%rsp), %r14
leaq 0xc08d(%rip), %rdx      # 0x13342
movq %r13, %rcx
movq %rbx, %r8
leaq 0x48(%rsp), %rbx
movl %eax, %r9d
xorl %eax, %eax
callq 0xa106
movq 0x48(%rbp), %rax
movq (%rax,%r12,8), %rbp
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
callq 0x33a0
movq %r14, %rdi
movq 0x20(%rsp), %rsi
callq 0x33a0
movq %rbp, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xd6d8
movq %r14, %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x3120
movq %r15, %rdi
callq 0x31d0
movq %rax, %r15
jmp 0x724b
movq 0x15c9f(%rip), %rdi     # 0x1cfc0
callq 0x3140
leaq 0xc044(%rip), %rsi      # 0x13371
movq %rax, %rdi
callq 0x3290
movq (%rsp), %rcx
movq 0x88(%rcx), %rsi
movq %rax, %rdi
callq 0x31c0
leaq 0xc028(%rip), %rsi      # 0x13377
movq %rax, %rdi
callq 0x3290
movq %rax, %rdi
callq 0x3140
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x7380
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3120
leaq 0x48(%rsp), %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x3490
// File: /workspace/github_cpp_makefile_star2_O2/tonymuu[P]distributed-kv-store/Application.cpp
// Function: Application::findARandomNodeThatIsAlive()
int Application::findARandomNodeThatIsAlive() {
	int number;
	do {
		number = (rand()%par->EN_GPSZ);
	}while (mp2[number]->getMemberNode()->bFailed);
	return number;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x30a0
movq 0x48(%rbx), %rcx
movq 0x58(%rbx), %rsi
cltd
idivl 0x18(%rsi)
movslq %edx, %rax
movq (%rcx,%rax,8), %rax
movq 0x50(%rax), %rax
cmpb $0x0, 0x10(%rax)
jne 0x9500
movl %edx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tonymuu[P]distributed-kv-store/Application.cpp
// Function: Application::initTestKVPairs()
void Application::initTestKVPairs() {
	srand(time(NULL));
	int i;
	string key;
	key.clear();
	testKVPairs.clear();
	int alphanumLen = sizeof(alphanum) - 1;
	while ( testKVPairs.size() != NUMBER_OF_INSERTS ) {
		for ( i = 0; i < KEY_LENGTH; i++ ) {
			key.push_back(alphanum[rand()%alphanumLen]);
		}
		string value = "value" + to_string(rand()%NUMBER_OF_INSERTS);
		testKVPairs[key] = value;
		key.clear();
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
xorl %edi, %edi
callq 0x3260
movl %eax, %edi
callq 0x3280
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rbx, 0x10(%rsp)
leaq 0x60(%rbx), %rdi
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq %rdi, 0x8(%rsp)
callq 0x9a36
leaq 0x38(%rsp), %r15
leaq 0x58(%rsp), %r13
leaq 0x18(%rsp), %rbp
pushq $0x3e
popq %r12
leaq 0xa23d(%rip), %rbx      # 0x137c0
movq 0x10(%rsp), %rax
cmpq $0x64, 0x88(%rax)
je 0x961c
pushq $0x5
popq %r14
subl $0x1, %r14d
jb 0x95ba
callq 0x30a0
cltd
idivl %r12d
movslq %edx, %rax
movsbl (%rax,%rbx), %esi
movq %rbp, %rdi
callq 0x3230
jmp 0x959a
callq 0x30a0
cltd
pushq $0x64
popq %rcx
idivl %ecx
movq %r15, %rdi
movl %edx, %esi
callq 0x9731
movq %r13, %rdi
leaq 0x9d63(%rip), %rsi      # 0x1333c
movq %r15, %rdx
callq 0x970d
movq %r15, %rdi
callq 0x3120
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x978a
movq %rax, %rdi
movq %r13, %rsi
callq 0x3170
andq $0x0, 0x20(%rsp)
movq 0x18(%rsp), %rax
movb $0x0, (%rax)
movq %r13, %rdi
callq 0x3120
jmp 0x9583
leaq 0x18(%rsp), %rdi
callq 0x3120
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9650
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
jmp 0x9649
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3120
jmp 0x9653
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x3490
nop
// File: /workspace/github_cpp_makefile_star2_O2/tonymuu[P]distributed-kv-store/./Member.h
// Function: Address::getAddress[abi:cxx11]() const
string getAddress() const {
		int id = 0;
		short port;
		memcpy(&id, &addr[0], sizeof(int));
		memcpy(&port, &addr[4], sizeof(short));
		return to_string(id) + ":" + to_string(port);
	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
movl (%rsi), %eax
movswl 0x4(%rsi), %ebp
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movl %eax, %esi
callq 0x9731
leaq 0xa5d0(%rip), %rdx      # 0x13c5d
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x997d
movq %rsp, %rdi
movl %ebp, %esi
callq 0x9731
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x9916
movq %rsp, %rdi
callq 0x3120
leaq 0x20(%rsp), %rdi
callq 0x3120
leaq 0x40(%rsp), %rdi
callq 0x3120
movq %rbx, %rax
addq $0x60, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3120
jmp 0x96ec
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3120
jmp 0x96fb
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x3490
// File: /workspace/github_cpp_makefile_star2_O2/tonymuu[P]distributed-kv-store/Log.cpp
// Function: Log::logCreateSuccess(Address*, bool, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Log::logCreateSuccess(Address * address, bool isCoordinator, int transID, string key, string value){
	static char stdstring[1000];
	string str;
	if (isCoordinator)
		str = "coordinator";
	else
		str = "server";
	sprintf(stdstring, "%s: create success at time %d, transID=%d, key=%s, value=%s", str.c_str(), par->getcurrtime(), transID, key.c_str(), value.c_str());
    LOG(address, stdstring);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r15
movq %r8, %r12
movl %ecx, %ebp
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rsi, %rbx
movq %rdi, %r14
movb $0x0, (%rax)
leaq 0x947c(%rip), %rax      # 0x13952
leaq 0x9481(%rip), %rsi      # 0x1395e
testl %edx, %edx
cmovneq %rax, %rsi
leaq 0x8(%rsp), %rdi
callq 0x34d0
movq 0x8(%rsp), %r13
movq 0x8(%r14), %rdi
callq 0xabe4
movq (%r12), %r9
movq (%r15), %rcx
movq %rcx, (%rsp)
leaq 0x1c403(%rip), %r15     # 0x26910
leaq 0x9451(%rip), %rsi      # 0x13965
movq %r15, %rdi
movq %r13, %rdx
movl %eax, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x3070
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0xa106
leaq 0x8(%rsp), %rdi
callq 0x3120
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x3490