LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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)
movl $0x50, %edi
callq 0x3250
movabsq $0x100000001, %rcx      # imm = 0x100000001
movq %rcx, 0x8(%rax)
leaq 0x14fbe(%rip), %rcx     # 0x18d18
movq %rcx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
movups %xmm0, 0x28(%rax)
movups %xmm0, 0x38(%rax)
movq $0x0, 0x48(%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, 0x10(%rbx)
movq 0x18(%rbx), %rdi
movq %rax, 0x18(%rbx)
testq %rdi, %rdi
je 0x3d91
callq 0x50cc
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
movq (%r14), %rsi
cmpq %rsi, 0x8(%r14)
je 0x3e16
movq %rbx, -0x30(%rbp)
xorl %r13d, %r13d
leaq -0x70(%rbp), %r15
movabsq $-0x5555555555555555, %rbx # imm = 0xAAAAAAAAAAAAAAAB
xorl %r12d, %r12d
addq %r13, %rsi
movq %r15, %rdi
callq 0x4e96
movq %r12, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
movq %r15, %rsi
callq 0x5daa
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x3dea
callq 0x3230
incq %r12
movq (%r14), %rsi
movq 0x8(%r14), %rax
subq %rsi, %rax
sarq $0x3, %rax
imulq %rbx, %rax
addq $0x18, %r13
cmpq %rax, %r12
jb 0x3dc1
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rax
movq -0x30(%rbp), %rbx
jmp 0x3e1a
xorl %eax, %eax
xorl %esi, %esi
leaq -0x90(%rbp), %rdx
movq %rsi, (%rdx)
leaq -0x88(%rbp), %rcx
movq %rax, (%rcx)
subq %rsi, %rax
sarq $0x5, %rax
leaq -0x80(%rbp), %r8
movq %rax, (%r8)
leaq -0x78(%rbp), %r9
movq $0x0, (%r9)
leaq -0x70(%rbp), %rdi
movq %rbx, %rsi
callq 0x39c2
movaps -0x70(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x70(%rbp)
movq 0x8(%rbx), %rdi
movups %xmm0, (%rbx)
testq %rdi, %rdi
je 0x3e7d
callq 0x50cc
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x3e7d
callq 0x50cc
leaq -0x50(%rbp), %rdi
callq 0x4f16
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, -0x30(%rbp)
jmp 0x3ea4
movq %rbx, -0x30(%rbp)
movq %rax, %r14
jmp 0x3ec3
movq %rax, %r14
jmp 0x3eba
movq %rax, %r14
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x3eba
callq 0x3230
leaq -0x50(%rbp), %rdi
callq 0x4f16
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rdi
testq %rdi, %rdi
je 0x3ed5
callq 0x50cc
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0x3ee7
callq 0x50cc
movq %r14, %rdi
callq 0x33d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq $0x0, -0x28(%rbp)
movq (%rsi), %rsi
addq $0x8, %rsi
leaq -0x48(%rbp), %r12
movq %r12, %rdi
callq 0x4e96
movq (%r12), %rdi
movq 0x8(%r12), %rcx
movq %rcx, %rax
subq %rdi, %rax
je 0x43fc
sarq $0x2, %rax
movq (%r15), %rcx
movq 0x8(%r15), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq $0x1, %rax
adcq $0x0, %rax
leaq -0x1(%rax), %rsi
cmpq %rsi, %rdx
jbe 0x443c
xorl %r12d, %r12d
xorl %edx, %edx
movl (%rdi,%rdx,4), %esi
subl (%rcx,%rdx,4), %esi
imull %esi, %esi
addl %esi, %r12d
incq %rdx
cmpq %rdx, %rax
jne 0x43e6
jmp 0x4404
xorl %r12d, %r12d
testq %rcx, %rcx
je 0x4409
callq 0x3230
leaq -0x2c(%rbp), %rax
movl %r12d, (%rax)
movq %rax, (%rsp)
leaq -0x28(%rbp), %r8
movq %rbx, %rdi
movq %r14, %rsi
movq %r14, %rdx
movq %r15, %rcx
movq %r14, %r9
callq 0x3ef0
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xebdd(%rip), %rdi      # 0x13020
movq %rdx, %rsi
xorl %eax, %eax
callq 0x3330
movq %rax, %rbx
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x445e
callq 0x3230
movq %rbx, %rdi
callq 0x33d0
// File: /workspace/github_cpp_makefile_star2_O3/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
xorl %ebx, %ebx
leaq -0x70(%rbp), %r9
movq %rbx, (%r9)
leaq -0x68(%rbp), %r14
movq %r14, %rdi
movq %rsi, %rdx
callq 0x457c
movq %rbx, 0x10(%r15)
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq 0x8(%r14), %rsi
subq (%r14), %rsi
sarq $0x5, %rsi
movq %r15, -0x30(%rbp)
movq %r15, %rdi
callq 0x4f6a
movq -0x68(%rbp), %r14
movq -0x60(%rbp), %r13
cmpq %r13, %r14
je 0x4c8a
movq -0x30(%rbp), %rax
movq (%rax), %rbx
leaq -0x90(%rbp), %r15
leaq -0x50(%rbp), %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0x4e96
movq 0x18(%r14), %rax
movq %rax, -0x78(%rbp)
movq %r12, %rdi
movq %r15, %rsi
callq 0x4e96
movq (%rbx), %rdi
movq -0x50(%rbp), %rax
movq %rax, (%rbx)
movq -0x48(%rbp), %rax
movq %rax, 0x8(%rbx)
movq -0x40(%rbp), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
testq %rdi, %rdi
je 0x4c6c
callq 0x3230
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x4c6c
callq 0x3230
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x4c7d
callq 0x3230
addq $0x20, %r14
addq $0x18, %rbx
cmpq %r13, %r14
jne 0x4c0d
leaq -0x68(%rbp), %rdi
callq 0x4f16
movq -0x30(%rbp), %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4ca8
movq %rax, %r14
jmp 0x4cc1
movq %rax, %r14
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x4cc1
callq 0x3230
movq -0x30(%rbp), %rdi
callq 0x4fe8
leaq -0x68(%rbp), %rdi
callq 0x4f16
movq %r14, %rdi
callq 0x33d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
xorl %r15d, %r15d
leaq -0x48(%rbp), %r9
movq %r15, (%r9)
leaq -0x40(%rbp), %r14
movq %r14, %rdi
movq %rsi, %rdx
callq 0x457c
movq %r15, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq 0x8(%r14), %rsi
subq (%r14), %rsi
sarq $0x5, %rsi
movq %rbx, %rdi
callq 0x503c
movq -0x40(%rbp), %r14
movq -0x38(%rbp), %r12
cmpq %r12, %r14
je 0x4d72
movq (%rbx), %r13
leaq -0x68(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x4e96
movq 0x18(%r14), %rax
movq %rax, -0x50(%rbp)
movq %rax, (%r13)
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x4d65
callq 0x3230
addq $0x20, %r14
addq $0x8, %r13
cmpq %r12, %r14
jne 0x4d40
leaq -0x40(%rbp), %rdi
callq 0x4f16
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4d8f
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x4d9f
callq 0x3230
leaq -0x40(%rbp), %rdi
callq 0x4f16
movq %r14, %rdi
callq 0x33d0
// File: /workspace/github_cpp_makefile_star2_O3/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:
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
testl %ecx, %ecx
jle 0x6790
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r12d
movl %edx, %r13d
movl %esi, %r15d
movq %rdi, %r14
movl %r13d, %eax
subl %r15d, %eax
incl %eax
cmpl %r12d, %eax
jl 0x6775
leal -0x1(%r12), %ebx
movq %r14, %rdi
movl %r15d, %esi
movl %r13d, %edx
callq 0x6791
movl %eax, %ecx
subl %r15d, %ecx
cmpl %ebx, %ecx
je 0x677c
cmpl %r12d, %ecx
jl 0x6760
decl %eax
movl %eax, %ecx
subl %r15d, %ecx
incl %ecx
movl %eax, %r13d
cmpl %r12d, %ecx
jge 0x6731
jmp 0x6775
leal 0x1(%rax), %ecx
addl %r12d, %r15d
notl %eax
addl %r15d, %eax
movl %eax, %r12d
movl %ecx, %r15d
testl %eax, %eax
jg 0x671f
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
jmp 0x6782
cltq
movl (%r14,%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_O3/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
cmpl %ecx, %esi
jge 0x67c7
movslq %esi, %rax
movl (%rdi,%rax,4), %r8d
cmpl %edx, %r8d
jg 0x67bc
movslq %esi, %rsi
movl (%rdi,%rsi,4), %r9d
movl %r8d, (%rdi,%rsi,4)
movl %r9d, (%rdi,%rax,4)
incl %esi
incq %rax
cmpq %rax, %rcx
jne 0x67a2
movl (%rdi,%rcx,4), %edx
movslq %esi, %rax
movl (%rdi,%rax,4), %esi
movl %edx, (%rdi,%rax,4)
movl %esi, (%rdi,%rcx,4)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0xe492
testl %r12d, %r12d
jle 0x685e
movq (%rbx), %rcx
movslq %r13d, %rdx
movl %r12d, %eax
shlq $0x2, %rdx
addq (%r15), %rdx
xorl %esi, %esi
movl (%rdx,%rsi,4), %edi
movl %edi, (%rcx,%rsi,4)
incq %rsi
cmpq %rsi, %rax
jne 0x6827
testl %r12d, %r12d
jle 0x685e
addl %r14d, %r12d
movq (%r15), %rcx
movslq %r12d, %rdx
movslq %r14d, %rsi
shlq $0x2, %rax
addq (%rbx), %rax
movl (%rcx,%rdx,4), %edi
movl %edi, (%rax)
decq %rdx
addq $0x4, %rax
cmpq %rsi, %rdx
jg 0x684d
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_O3/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
addq $0x10, %rdi
leaq 0x20(%rbx), %rax
movq %rax, 0x10(%rbx)
xorl %eax, %eax
movq %rax, 0x18(%rbx)
movb $0x0, 0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rbx)
movq %rax, 0x58(%rbx)
movl %edx, (%rbx)
callq 0x3110
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 0x68fa
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 0x693a
addq $0x4, %rdx
incq %r8
incl %eax
cmpq %r8, %rdi
ja 0x6919
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
jmp 0x694c
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 0xe528
movq %r14, %rdi
callq 0x33d0
// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
movq 0x2d3d(%rip), %rax      # 0x3fe0
leaq -0x60(%rbp), %rdi
movq %rax, (%rdi)
movb $0x1, 0xc(%rdi)
callq 0x1480
cmpb $0x0, -0x54(%rbp)
je 0x1313
leaq -0x30(%rbp), %rbx
leaq -0x60(%rbp), %r14
leaq -0x50(%rbp), %r15
movq -0x60(%rbp), %rax
movq %rax, -0x38(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x30(%rbp)
movb $0x1, -0x2c(%rbp)
movq %r14, %rdi
callq 0x1480
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0x12f8
movl -0x30(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x48(%rbp)
jmp 0x1303
movq %r15, %rdi
movq %rbx, %rdx
callq 0x14ba
cmpb $0x0, -0x54(%rbp)
jne 0x12c5
movq -0x50(%rbp), %rbx
movq -0x48(%rbp), %r12
jmp 0x1318
xorl %r12d, %r12d
xorl %ebx, %ebx
movq 0x2cb1(%rip), %r14      # 0x3fd0
movq %r14, -0x70(%rbp)
leaq 0xcda(%rip), %rax       # 0x2004
movq %rax, -0x68(%rbp)
movq %r14, -0x38(%rbp)
movq %rax, -0x30(%rbp)
subq %rbx, %r12
sarq $0x2, %r12
testq %r12, %r12
jle 0x1361
incq %r12
leaq -0x38(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1438
addq $0x4, %rbx
decq %r12
cmpq $0x1, %r12
ja 0x1349
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x10b0
movsbl %al, %esi
movq 0x2c51(%rip), %rbx      # 0x3fd0
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
movq -0x50(%rbp), %r12
movq -0x48(%rbp), %r13
cmpq %r13, %r12
je 0x13bf
leaq -0x70(%rbp), %r14
leaq -0x38(%rbp), %r15
movl (%r12), %eax
movl %eax, -0x38(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x1438
addq $0x4, %r12
cmpq %r13, %r12
jne 0x13a4
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10b0
movsbl %al, %esi
movq 0x2bf3(%rip), %rdi      # 0x3fd0
callq 0x1030
movq %rax, %rdi
callq 0x1080
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x13ff
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x10d0
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1418
jmp 0x1418
jmp 0x1418
jmp 0x1418
movq %rax, %rbx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x1430
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x10d0
movq %rbx, %rdi
callq 0x1120
// File: /workspace/github_cpp_makefile_star2_O3/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, %rbp
movq %rsi, %r15
movq %rdi, %r13
leaq 0x1b823(%rip), %rax     # 0x1fc30
movq %rax, (%rdi)
movl $0x0, 0x29(%rdi)
movw $0x0, 0x2d(%rdi)
movl $0xe8, %edi
callq 0x32b0
movq %rax, %r12
movq %rax, %rdi
callq 0x4f6c
movq %r12, 0x20(%r13)
movb $0x1, 0x28(%r13)
movb $0x0, 0xe(%r12)
movq %rbp, 0x8(%r13)
movq %r14, 0x10(%r13)
movq %r15, 0x18(%r13)
addq $0x8, %r12
movq %r12, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc8d2
movq %rax, %rbx
movl $0xe8, %esi
movq %r12, %rdi
callq 0x32c0
movq %rbx, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1b7a7(%rip), %rax     # 0x1fc30
movq %rax, (%rdi)
movl $0x0, 0x29(%rdi)
movw $0x0, 0x2d(%rdi)
movq %rsi, 0x20(%rdi)
movb $0x0, 0x28(%rdi)
movq %rcx, 0x8(%rdi)
movq %r8, 0x10(%rdi)
movq %rdx, 0x18(%rdi)
leaq 0x8(%rsi), %rdi
movq %r9, %rsi
jmp 0xc8d2
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x46d8
movl $0x13, %edi
callq 0x33a0
movq %rax, %r12
movl $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 0x129a2(%rip), %xmm0    # 0x1702e
movaps %xmm0, 0x1bc9d(%rip)    # 0x20330
movw $0x2e, 0x1bca4(%rip)    # 0x20340
leaq 0x1bc8d(%rip), %rdx     # 0x20330
movq 0x10(%rbx), %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0xbbb8
movq 0x8(%rbx), %rdi
movq 0x20(%rbx), %rsi
addq $0x8, %rsi
movq %r14, %rdx
movq %r12, %rcx
movl $0x13, %r8d
callq 0x66d8
movq %r12, %rdi
callq 0x3360
jmp 0x4752
movq 0x10(%rbx), %rdi
leaq 0x12936(%rip), %rdx     # 0x17019
movq %r15, %rsi
xorl %eax, %eax
callq 0xbbb8
movq 0x20(%rbx), %rsi
movb $0x1, 0xf(%rsi)
addq $0x8, %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xc8c4
movl (%r14), %ebp
movswl 0x4(%r14), %r14d
movq 0x18(%rbx), %rdi
callq 0xc87e
movslq %eax, %r8
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movl %ebp, %esi
movl %r14d, %edx
xorl %ecx, %ecx
callq 0xc90e
movq 0x20(%rbx), %rdi
addq $0x28, %rdi
movq %r15, %rsi
callq 0x5010
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rdx
addq $0x8, %rdx
movq %rdx, %rsi
callq 0xbe6c
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4a7e
testl %eax, %eax
jne 0x4a94
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 0xc8c4
movl (%r12), %ebp
movswl 0x4(%r12), %r12d
movq 0x18(%rbx), %rdi
callq 0xc87e
movslq %eax, %r8
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movl %ebp, %esi
movl %r12d, %edx
movq %r15, %rcx
callq 0xc90e
movq 0x20(%rbx), %rdi
addq $0x28, %rdi
movq %r13, %rsi
callq 0x5010
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rsi
addq $0x8, %rsi
movq %r14, %rdx
callq 0xbe6c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4aa2
movq 0x20(%rbx), %rax
movb $0x1, 0xf(%rax)
movq 0x28(%rax), %rsi
cmpq %rsi, 0x30(%rax)
je 0x4a94
movq %rsi, 0x30(%rax)
movq %rbx, %rdi
movq %rdx, %rsi
movl %ecx, %edx
callq 0x4b20
nop
// File: /workspace/github_cpp_makefile_star2_O3/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), %rax
movq 0x30(%rax), %rcx
subq 0x28(%rax), %rcx
shrq $0x3, %rcx
movabsq $-0x5555554e00000000, %r15 # imm = 0xAAAAAAB200000000
imulq %rcx, %r15
sarq $0x20, %r15
addq $0x4, %r15
movq %r15, %rdi
callq 0x33a0
movq %rax, %r12
movl $0x1, (%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x4d0e
movq 0x8(%r14), %rdi
movq 0x20(%r14), %rsi
addq $0x8, %rsi
movq %rbx, %rdx
movq %r12, %rcx
movl %r15d, %r8d
callq 0x66d8
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3360
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xc8c4
movl (%r15), %ebp
movq 0x18(%r14), %rdi
callq 0xc87e
movq 0x20(%r14), %rdx
movq 0x28(%rdx), %rcx
cmpq 0x30(%rdx), %rcx
je 0x4dec
cltq
addq $0x10, %rcx
xorl %r10d, %r10d
movabsq $0x400000000, %rdx      # imm = 0x400000000
movabsq $0x600000000, %rsi      # imm = 0x600000000
movabsq $0xe00000000, %rdi      # imm = 0xE00000000
movq %r10, %r8
shlq $0x20, %r8
movslq %r10d, %r9
movl -0x10(%rcx), %r10d
movl %r10d, 0x4(%rbx,%r9)
leaq (%r8,%rdx), %r9
sarq $0x20, %r9
movzwl -0xc(%rcx), %r10d
movw %r10w, 0x4(%rbx,%r9)
leaq (%r8,%rsi), %r10
sarq $0x20, %r10
movq 0x20(%r14), %r11
addq $0x18, %r11
cmpl %ebp, -0x10(%rcx)
leaq -0x8(%rcx), %r9
cmovneq %r9, %r11
movq (%r11), %r11
movq %r11, 0x4(%rbx,%r10)
movq %rax, %r10
cmpl %ebp, -0x10(%rcx)
je 0x4dc7
movq (%rcx), %r10
addq %rdi, %r8
sarq $0x20, %r8
movq %r10, 0x4(%rbx,%r8)
addq $0x8, %r8
movq 0x20(%r14), %r11
addq $0x18, %rcx
addq $0x10, %r9
movq %r8, %r10
cmpq 0x30(%r11), %r9
jne 0x4d76
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
movl $0x0, 0x8(%rdi)
xorl %ecx, %ecx
movq %rcx, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
movq %rcx, 0x28(%rdi)
movq 0x20(%rsi), %rax
movq 0x28(%rax), %r15
cmpq 0x30(%rax), %r15
je 0x4ee8
movq %rsi, %r14
movq %rbx, %rdi
movq %r15, %rsi
callq 0x503c
movq %r15, (%rax)
addq $0x18, %r15
movq 0x20(%r14), %rax
cmpq 0x30(%rax), %r15
jne 0x4ecc
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x5642
movq %r14, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4f5d
cmpl %esi, (%rax)
je 0x4f5f
addq $0x18, %rax
jmp 0x4f4e
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
movq %rdi, %rbx
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x3250
movl %eax, %edi
callq 0x3270
movq 0x58(%rbx), %rax
movl $0x0, 0x28(%rax)
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x719c
movq 0x58(%rbx), %rdi
movl 0x2c(%rdi), %eax
cmpl 0x1a274(%rip), %eax     # 0x20fb0
setne %al
orb %r15b, %al
testb $0x1, %al
jne 0x6d55
callq 0xc87e
movl %eax, %r14d
movq 0x58(%rbx), %rdi
movb $0x1, %r15b
callq 0xc87e
leal 0x32(%r14), %ecx
cmpl %ecx, %eax
jle 0x6d6a
movq %rbx, %rdi
callq 0x73d6
movq 0x58(%rbx), %rax
movl 0x28(%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x28(%rax)
cmpl $0x2bb, %ecx            # imm = 0x2BB
jl 0x6d27
movq 0x28(%rbx), %rdi
callq 0x6a28
movq 0x30(%rbx), %rdi
callq 0x6a28
movq 0x58(%rbx), %rax
cmpl $0x0, 0x18(%rax)
jle 0x6dbb
xorl %r14d, %r14d
movq 0x40(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x4766
incq %r14
movq 0x58(%rbx), %rax
movslq 0x18(%rax), %rax
cmpq %rax, %r14
jl 0x6d9e
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x18c3b(%rip), %rax     # 0x1fcf0
movq %rax, (%rdi)
movq 0x38(%rdi), %rdi
testq %rdi, %rdi
je 0x70c7
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x70d6
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x70e5
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x58(%rbx), %rax
cmpl $0x0, 0x18(%rax)
jle 0x714a
xorl %r15d, %r15d
movq 0x50(%rbx), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0x7105
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0x7118
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x48(%rbx), %rax
movq (%rax,%r15,8), %r14
testq %r14, %r14
je 0x712d
movq %r14, %rdi
callq 0xe592
movl $0xf0, %esi
movq %r14, %rdi
callq 0x32c0
incq %r15
movq 0x58(%rbx), %rax
movslq 0x18(%rax), %rax
cmpq %rax, %r15
jl 0x70f2
movq 0x40(%rbx), %rdi
callq 0x3360
movq 0x48(%rbx), %rdi
callq 0x3360
movq 0x50(%rbx), %rdi
callq 0x3360
movq 0x58(%rbx), %rdi
movl $0x38, %esi
callq 0x32c0
addq $0x60, %rbx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xb4ee
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x58, %rsp
movq %rdi, %rbx
callq 0xaeea
movq 0x78(%rbx), %r14
leaq 0x68(%rbx), %rax
movq %rax, 0x28(%rsp)
cmpq %rax, %r14
je 0x7706
callq 0x30a0
movq 0x48(%rbx), %rcx
movq 0x58(%rbx), %rdi
cltd
idivl 0x18(%rdi)
movslq %edx, %r15
movq (%rcx,%r15,8), %rax
movq 0x50(%rax), %rbp
cmpb $0x0, 0x10(%rbp)
jne 0x7608
movq 0x38(%rbx), %rax
movq %rax, 0x30(%rsp)
addq $0x8, %rbp
movq 0x20(%r14), %r12
movq 0x40(%r14), %r13
callq 0xc87e
movq 0x30(%rsp), %rdi
movq %rbp, %rsi
leaq 0xfce7(%rip), %rdx      # 0x1733a
movq %r12, %rcx
movq %r13, %r8
movl %eax, %r9d
xorl %eax, %eax
callq 0xbbb8
movq 0x48(%rbx), %rax
movq (%rax,%r15,8), %rbp
leaq 0x18(%rsp), %r15
movq %r15, 0x8(%rsp)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x5a4e
leaq 0x48(%rsp), %r12
movq %r12, 0x38(%rsp)
movq 0x40(%r14), %rsi
movq 0x48(%r14), %rdx
addq %rsi, %rdx
leaq 0x38(%rsp), %r13
movq %r13, %rdi
callq 0x5a4e
movq %rbp, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0xf4e2
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0x76d4
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x32c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x76f0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32c0
movq %r14, %rdi
callq 0x31d0
movq %rax, %r14
cmpq 0x28(%rsp), %rax
jne 0x7608
movq 0x188bb(%rip), %r14     # 0x1ffc8
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31c0
movq %rax, %r14
leaq 0xfc2b(%rip), %rsi      # 0x17369
movl $0x5, %edx
movq %rax, %rdi
callq 0x3310
movq 0x88(%rbx), %rsi
movq %r14, %rdi
callq 0x31b0
movq %rax, %rbx
leaq 0xfc0b(%rip), %rsi      # 0x1736f
movl $0x1c, %edx
movq %rax, %rdi
callq 0x3310
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31c0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x77c6
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0x77c6
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x32c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x77e2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O3/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 0xaec4
movl %edx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x38, %rsp
movq %r9, %r15
movq %r8, %r12
movl %ecx, %ebp
movq %rsi, 0x10(%rsp)
movq %rdi, %r14
leaq 0x28(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq $0x0, -0x8(%rbx)
movb $0x0, (%rbx)
leaq 0xb9b1(%rip), %rax      # 0x17952
leaq 0xb9b6(%rip), %rcx      # 0x1795e
testl %edx, %edx
cmovneq %rax, %rcx
movl %edx, %eax
leaq (%rax,%rax,4), %r8
addq $0x6, %r8
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3440
movq 0x18(%rsp), %r13
movq 0x8(%r14), %rdi
callq 0xc87e
movq (%r12), %r9
movq (%r15), %rcx
movq %rcx, (%rsp)
leaq 0x1d91a(%rip), %r15     # 0x29900
leaq 0xb978(%rip), %rsi      # 0x17965
movq %r15, %rdi
movq %r13, %rdx
movl %eax, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x3080
movq %r14, %rdi
movq 0x10(%rsp), %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0xbbb8
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0xc028
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x32c0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0xc051
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x32c0
movq %r14, %rdi
callq 0x34b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/tonymuu[P]distributed-kv-store/Log.cpp
// Function: Log::logUpdateSuccess(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::logUpdateSuccess(Address * address, bool isCoordinator, int transID, string key, string newValue){
    static char stdstring[1000];
	string str;
	if (isCoordinator)
		str = "coordinator";
	else
		str = "server";
	sprintf(stdstring, "%s: update success at time %d, transID=%d, key=%s, value=%s", str.c_str(), par->getcurrtime(), transID, key.c_str(), newValue.c_str());
    LOG(address, stdstring);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %r15
movq %r8, %r12
movl %ecx, %ebp
movq %rsi, 0x10(%rsp)
movq %rdi, %r14
leaq 0x28(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq $0x0, -0x8(%rbx)
movb $0x0, (%rbx)
leaq 0xb7cd(%rip), %rax      # 0x17952
leaq 0xb7d2(%rip), %rcx      # 0x1795e
testl %edx, %edx
cmovneq %rax, %rcx
movl %edx, %eax
leaq (%rax,%rax,4), %r8
addq $0x6, %r8
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3440
movq 0x18(%rsp), %r13
movq 0x8(%r14), %rdi
callq 0xc87e
movq (%r12), %r9
movq (%r15), %rcx
movq %rcx, (%rsp)
leaq 0x1df16(%rip), %r15     # 0x2a0e0
leaq 0xb80a(%rip), %rsi      # 0x179db
movq %r15, %rdi
movq %r13, %rdx
movl %eax, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x3080
movq %r14, %rdi
movq 0x10(%rsp), %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0xbbb8
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0xc20c
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x32c0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0xc235
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x32c0
movq %r14, %rdi
callq 0x34b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/tonymuu[P]distributed-kv-store/Log.cpp
// Function: Log::logDeleteSuccess(Address*, bool, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Log::logDeleteSuccess(Address * address, bool isCoordinator, int transID, string key){
    static char stdstring[1000];
	string str;
	if (isCoordinator)
		str = "coordinator";
	else
		str = "server";
	sprintf(stdstring, "%s: delete success at time %d, transID=%d, key=%s", str.c_str(), par->getcurrtime(), transID, key.c_str());
    LOG(address, stdstring);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r15
movl %ecx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
leaq 0xb6de(%rip), %rax      # 0x17952
leaq 0xb6e3(%rip), %rcx      # 0x1795e
testl %edx, %edx
cmovneq %rax, %rcx
movl %edx, %eax
leaq (%rax,%rax,4), %r8
addq $0x6, %r8
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3440
movq 0x8(%rsp), %r12
movq 0x8(%r14), %rdi
callq 0xc87e
movq (%r15), %r9
leaq 0x1e21f(%rip), %r15     # 0x2a4d0
leaq 0xb75f(%rip), %rsi      # 0x17a17
movq %r15, %rdi
movq %r12, %rdx
movl %eax, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x3080
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0xbbb8
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0xc2f1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32c0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0xc31a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O3/tonymuu[P]distributed-kv-store/Log.cpp
// Function: Log::logReadFail(Address*, bool, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Log::logReadFail(Address * address, bool isCoordinator, int transID, string key){
    static char stdstring[1000];
	string str;
	if (isCoordinator)
		str = "coordinator";
	else
		str = "server";
	sprintf(stdstring, "%s: read fail at time %d, transID=%d, key=%s", str.c_str(), par->getcurrtime(), transID, key.c_str());
    LOG(address, stdstring);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r15
movl %ecx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
leaq 0xb508(%rip), %rax      # 0x17952
leaq 0xb50d(%rip), %rcx      # 0x1795e
testl %edx, %edx
cmovneq %rax, %rcx
movl %edx, %eax
leaq (%rax,%rax,4), %r8
addq $0x6, %r8
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3440
movq 0x8(%rsp), %r12
movq 0x8(%r14), %rdi
callq 0xc87e
movq (%r15), %r9
leaq 0x1e829(%rip), %r15     # 0x2acb0
leaq 0xb5f4(%rip), %rsi      # 0x17a82
movq %r15, %rdi
movq %r12, %rdx
movl %eax, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x3080
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0xbbb8
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0xc4c7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32c0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0xc4f0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x34b0
// File: /workspace/github_cpp_makefile_star2_O3/tonymuu[P]distributed-kv-store/Log.cpp
// Function: Log::logUpdateFail(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::logUpdateFail(Address * address, bool isCoordinator, int transID, string key, string newValue){
    static char stdstring[1000];
	string str;
	if (isCoordinator)
		str = "coordinator";
	else
		str = "server";
	sprintf(stdstring, "%s: update fail at time %d, transID=%d, key=%s, value=%s", str.c_str(), par->getcurrtime(), transID, key.c_str(), newValue.c_str());
    LOG(address, stdstring);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %r15
movq %r8, %r12
movl %ecx, %ebp
movq %rsi, 0x10(%rsp)
movq %rdi, %r14
leaq 0x28(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq $0x0, -0x8(%rbx)
movb $0x0, (%rbx)
leaq 0xb421(%rip), %rax      # 0x17952
leaq 0xb426(%rip), %rcx      # 0x1795e
testl %edx, %edx
cmovneq %rax, %rcx
movl %edx, %eax
leaq (%rax,%rax,4), %r8
addq $0x6, %r8
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3440
movq 0x18(%rsp), %r13
movq 0x8(%r14), %rdi
callq 0xc87e
movq (%r12), %r9
movq (%r15), %rcx
movq %rcx, (%rsp)
leaq 0x1eb2a(%rip), %r15     # 0x2b0a0
leaq 0xb532(%rip), %rsi      # 0x17aaf
movq %r15, %rdi
movq %r13, %rdx
movl %eax, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x3080
movq %r14, %rdi
movq 0x10(%rsp), %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0xbbb8
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0xc5b8
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x32c0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0xc5e1
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x32c0
movq %r14, %rdi
callq 0x34b0
nop