// File: /workspace/github_cpp_makefile_star2_O2/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 $0xc8, %rsp
movq %r9, %r14
movq %r8, %rbx
movq %rcx, 0xa0(%rsp)
movl %edx, 0x8(%rsp)
movl %esi, 0xc(%rsp)
movq %rdi, %r13
xorpd %xmm0, %xmm0
movapd %xmm0, 0x40(%rsp)
andq $0x0, 0x50(%rsp)
movapd %xmm0, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
callq 0x18d3c
leaq 0x40(%rsp), %rdi
movq %rax, %rsi
callq 0xafb8
movq %r13, %rdi
callq 0x18d3c
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0xafb8
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
cmpq %rcx, %rax
je 0xa903
orl $-0x1, (%rax)
addq $0x4, %rax
jmp 0xa8f5
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
cmpq %rcx, %rax
je 0xa91b
orl $-0x1, (%rax)
addq $0x4, %rax
jmp 0xa90d
leaq 0x40(%rsp), %rdx
movq %r13, %rdi
movl 0xc(%rsp), %esi
callq 0x19208
leaq 0x20(%rsp), %rdx
movq %r13, %rdi
movl 0x8(%rsp), %esi
callq 0x19208
movq %r14, 0x98(%rsp)
movq %rbx, 0x90(%rsp)
andl $0x0, 0x18(%rsp)
andq $0x0, 0x10(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x70(%rsp)
andq $0x0, 0x80(%rsp)
xorl %r15d, %r15d
xorpd %xmm0, %xmm0
movsd %xmm0, 0x68(%rsp)
leaq 0xa8(%rsp), %rbx
movsd %xmm0, 0x60(%rsp)
xorl %ebp, %ebp
movsd %xmm0, 0x58(%rsp)
xorl %r12d, %r12d
xorl %r14d, %r14d
movq %r13, %rdi
callq 0x18d3c
movl %r14d, %r14d
cmpq %r14, %rax
jbe 0xaa8f
movq %rbx, %rdi
callq 0xb094
movq 0x40(%rsp), %rax
movl (%rax,%r14,4), %r8d
movq 0x20(%rsp), %rax
movl (%rax,%r14,4), %r9d
cmpl %r9d, %r8d
je 0xa9e6
movq 0xa0(%rsp), %rax
movq %rax, (%rsp)
movq %r13, %rdi
movl %r14d, %esi
movl 0xc(%rsp), %edx
movl 0x8(%rsp), %ecx
callq 0x9ada
movq %rbx, %rdi
callq 0xb09c
movq 0x40(%rsp), %rax
movl (%rax,%r14,4), %ecx
movq 0x20(%rsp), %rax
subl (%rax,%r14,4), %ecx
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
cmpl $0x1, %eax
je 0xaa36
testl %eax, %eax
jne 0xaa5e
incl %ebp
movl %ebp, 0x10(%rsp)
movq %rbx, %rdi
callq 0xb0a8
movsd 0x60(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x60(%rsp)
movsd %xmm1, 0x70(%rsp)
jmp 0xaa87
incl %r12d
movl %r12d, 0x14(%rsp)
movq %rbx, %rdi
callq 0xb0a8
movsd 0x58(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x58(%rsp)
movsd %xmm1, 0x78(%rsp)
jmp 0xaa87
incl %r15d
movl %r15d, 0x18(%rsp)
movq %rbx, %rdi
callq 0xb0a8
movsd 0x68(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x68(%rsp)
movsd %xmm1, 0x80(%rsp)
incl %r14d
jmp 0xa994
movq 0x98(%rsp), %rdi
movq (%rdi), %rsi
leaq 0x1c(%rsp), %rcx
leaq 0x10(%rsp), %rdx
callq 0xb0dc
movq 0x90(%rsp), %rdi
movq (%rdi), %rsi
leaq 0x88(%rsp), %rcx
leaq 0x70(%rsp), %rdx
callq 0xb0fc
leaq 0x20(%rsp), %rdi
callq 0x5720
leaq 0x40(%rsp), %rdi
callq 0x5720
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xaaf4
jmp 0xaaf4
jmp 0xaaf4
jmp 0xaaf4
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x5720
leaq 0x40(%rsp), %rdi
callq 0x5720
movq %rbx, %rdi
callq 0x23d0