// File: /workspace/github_cpp_makefile_star2_O1/fjamour[P]icentral/src/bc.cc
// Function: incremental_brandes_experimental(graph_t&, unsigned int, unsigned int, std::vector<double, std::allocator<double>>&, std::vector<double, std::allocator<double>>&, std::vector<int, std::allocator<int>>&)
void incremental_brandes_experimental(graph_t& graph_in,
        node_id_t src,
        node_id_t dst,
        vector<double>& bc_vec,
        vector<double>& time_vec,
        vector<int>&    cnt_vec)
{
    vector<int> d_src_vec, d_dst_vec;
    d_src_vec.resize(graph_in.size());
    d_dst_vec.resize(graph_in.size());
    fill(d_src_vec.begin(), d_src_vec.end(), -1);
    fill(d_dst_vec.begin(), d_dst_vec.end(), -1);
    graph_in.find_sssp(src, d_src_vec);
    graph_in.find_sssp(dst, d_dst_vec);
    
    //fill(bc_vec.begin(), bc_vec.end(), 0);
    
    int    cnt_arr[] = {0,0,0};
    double tot_arr[] = {0,0,0};
    for(node_id_t s = 0; s < graph_in.size(); ++s) {
        timer tm;
        tm.start();
        if(d_src_vec[s] != d_dst_vec[s]) { 
            brandes_delta_iter(graph_in,
                    s, 
                    src, 
                    dst, 
                    d_src_vec[s], 
                    d_dst_vec[s], 
                    bc_vec);
        }
        tm.stop();
        int diff = d_src_vec[s] - d_dst_vec[s];
        int abs_diff = abs(diff);
        switch(abs_diff) {
            case 0:
                cnt_arr[0]++;
                tot_arr[0]+=tm.interval();
                break;
            case 1:
                cnt_arr[1]++;
                tot_arr[1]+=tm.interval();
                break;
            default:
                cnt_arr[2]++;
                tot_arr[2]+=tm.interval();
        }
    }
    cnt_vec.insert(cnt_vec.begin(), cnt_arr, cnt_arr+3);
    time_vec.insert(time_vec.begin(), tot_arr, tot_arr+3);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %r9, %r14
movq %r8, %rbx
movq %rcx, 0xb0(%rsp)
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r13
xorpd %xmm0, %xmm0
movapd %xmm0, 0x40(%rsp)
xorl %eax, %eax
movq %rax, 0x50(%rsp)
movq %rax, 0x30(%rsp)
movapd %xmm0, 0x20(%rsp)
callq 0x1e160
leaq 0x40(%rsp), %rdi
movq %rax, %rsi
callq 0xd7da
movq %r13, %rdi
callq 0x1e160
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0xd7da
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rdx
cmpq %rdx, %rdi
je 0xcf41
subq %rdi, %rdx
addq $-0x4, %rdx
andq $-0x4, %rdx
addq $0x4, %rdx
movl $0xff, %esi
callq 0x2110
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rdx
cmpq %rdx, %rdi
je 0xcf69
subq %rdi, %rdx
addq $-0x4, %rdx
andq $-0x4, %rdx
addq $0x4, %rdx
movl $0xff, %esi
callq 0x2110
leaq 0x40(%rsp), %rdx
movq %r13, %rdi
movl %r12d, %esi
callq 0x1e816
leaq 0x20(%rsp), %rdx
movq %r13, %rdi
movl %ebp, %esi
callq 0x1e816
movq %r14, 0xa8(%rsp)
movq %rbx, 0xa0(%rsp)
xorl %ebx, %ebx
movq %rbx, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
movq %rbx, 0x90(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x80(%rsp)
leaq 0x70(%rsp), %r14
leaq 0x60(%rsp), %r15
movq %r13, %rdi
callq 0x1e160
movl %ebx, %ebx
cmpq %rbx, %rax
jbe 0xd15f
movq %r15, %rdi
xorl %esi, %esi
callq 0x2360
movq 0x40(%rsp), %rax
movl (%rax,%rbx,4), %r8d
movq 0x20(%rsp), %rax
movl (%rax,%rbx,4), %r9d
cmpl %r9d, %r8d
je 0xd015
movq 0xb0(%rsp), %rax
movq %rax, (%rsp)
movq %r13, %rdi
movl %ebx, %esi
movl %r12d, %edx
movl %ebp, %ecx
callq 0xbaa0
movq %r14, %rdi
xorl %esi, %esi
callq 0x2360
movq 0x40(%rsp), %rax
movl (%rax,%rbx,4), %ecx
movq 0x20(%rsp), %rax
subl (%rax,%rbx,4), %ecx
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
cmpl $0x1, %eax
je 0xd0a2
testl %eax, %eax
jne 0xd0fe
incl 0x10(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdq 0x60(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdq 0x68(%rsp), %xmm1
movsd 0x2413d(%rip), %xmm3    # 0x311a0
divsd %xmm3, %xmm1
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2sdq 0x70(%rsp), %xmm0
xorps %xmm2, %xmm2
cvtsi2sdq 0x78(%rsp), %xmm2
divsd %xmm3, %xmm2
addsd %xmm0, %xmm2
subsd %xmm1, %xmm2
addsd 0x80(%rsp), %xmm2
movsd %xmm2, 0x80(%rsp)
jmp 0xd158
incl 0x14(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdq 0x60(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdq 0x68(%rsp), %xmm1
movsd 0x240de(%rip), %xmm3    # 0x311a0
divsd %xmm3, %xmm1
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2sdq 0x70(%rsp), %xmm0
xorps %xmm2, %xmm2
cvtsi2sdq 0x78(%rsp), %xmm2
divsd %xmm3, %xmm2
addsd %xmm0, %xmm2
subsd %xmm1, %xmm2
addsd 0x88(%rsp), %xmm2
movsd %xmm2, 0x88(%rsp)
jmp 0xd158
incl 0x18(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdq 0x60(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdq 0x68(%rsp), %xmm1
movsd 0x24082(%rip), %xmm3    # 0x311a0
divsd %xmm3, %xmm1
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2sdq 0x70(%rsp), %xmm0
xorps %xmm2, %xmm2
cvtsi2sdq 0x78(%rsp), %xmm2
divsd %xmm3, %xmm2
addsd %xmm0, %xmm2
subsd %xmm1, %xmm2
addsd 0x90(%rsp), %xmm2
movsd %xmm2, 0x90(%rsp)
incl %ebx
jmp 0xcfc6
movq 0xa8(%rsp), %rdi
movq (%rdi), %rsi
leaq 0x1c(%rsp), %rcx
leaq 0x10(%rsp), %rdx
callq 0xe1ec
movq 0xa0(%rsp), %rdi
movq (%rdi), %rsi
leaq 0x98(%rsp), %rcx
leaq 0x80(%rsp), %rdx
callq 0xe39e
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xd1b0
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xd1c7
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd1e1
jmp 0xd1e1
jmp 0xd1e1
jmp 0xd1e1
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xd1fb
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xd212
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq %rbx, %rdi
callq 0x23b0