// File: /workspace/github_cpp_makefile_star2_O3/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, 0xc0(%rsp)
movl %edx, 0x8(%rsp)
movl %esi, 0xc(%rsp)
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 0x1dfcc
leaq 0x40(%rsp), %rdi
movq %rax, %rsi
callq 0xd848
movq %r13, %rdi
callq 0x1dfcc
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0xd848
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rdx
cmpq %rdx, %rdi
je 0xcf44
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 0xcf6c
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 0xc(%rsp), %esi
callq 0x1e698
leaq 0x20(%rsp), %rdx
movq %r13, %rdi
movl 0x8(%rsp), %esi
callq 0x1e698
movq %r14, 0xb8(%rsp)
movq %rbx, 0xb0(%rsp)
xorl %ebp, %ebp
movq %rbp, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
movq %rbp, 0xa0(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x90(%rsp)
xorpd %xmm0, %xmm0
movsd %xmm0, 0x88(%rsp)
leaq 0x58(%rsp), %r14
movsd %xmm0, 0x80(%rsp)
xorl %r12d, %r12d
movsd %xmm0, 0x78(%rsp)
xorl %ebx, %ebx
xorl %r15d, %r15d
movq %r13, %rdi
callq 0x1dfcc
movl %r15d, %r15d
cmpq %r15, %rax
jbe 0xd1b7
movq %r14, %rdi
xorl %esi, %esi
callq 0x2360
movq 0x40(%rsp), %rax
movl (%rax,%r15,4), %r8d
movq 0x20(%rsp), %rax
movl (%rax,%r15,4), %r9d
cmpl %r9d, %r8d
je 0xd03f
movq 0xc0(%rsp), %rax
movq %rax, (%rsp)
movq %r13, %rdi
movl %r15d, %esi
movl 0xc(%rsp), %edx
movl 0x8(%rsp), %ecx
callq 0xbabf
leaq 0x68(%rsp), %rdi
xorl %esi, %esi
callq 0x2360
movq 0x40(%rsp), %rax
movl (%rax,%r15,4), %ecx
movq 0x20(%rsp), %rax
subl (%rax,%r15,4), %ecx
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
cmpl $0x1, %eax
je 0xd0e1
testl %eax, %eax
jne 0xd146
incl %r12d
xorps %xmm0, %xmm0
cvtsi2sdq 0x58(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdq 0x60(%rsp), %xmm1
movl %r12d, 0x10(%rsp)
movsd 0x2310b(%rip), %xmm3    # 0x301a0
divsd %xmm3, %xmm1
xorps %xmm2, %xmm2
cvtsi2sdq 0x68(%rsp), %xmm2
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2sdq 0x70(%rsp), %xmm0
divsd %xmm3, %xmm0
addsd %xmm2, %xmm0
subsd %xmm1, %xmm0
movsd 0x80(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x80(%rsp)
movsd %xmm1, 0x90(%rsp)
jmp 0xd1af
incl %ebx
xorps %xmm0, %xmm0
cvtsi2sdq 0x58(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdq 0x60(%rsp), %xmm1
movl %ebx, 0x14(%rsp)
movsd 0x2309d(%rip), %xmm3    # 0x301a0
divsd %xmm3, %xmm1
xorps %xmm2, %xmm2
cvtsi2sdq 0x68(%rsp), %xmm2
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2sdq 0x70(%rsp), %xmm0
divsd %xmm3, %xmm0
addsd %xmm2, %xmm0
subsd %xmm1, %xmm0
movsd 0x78(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x78(%rsp)
movsd %xmm1, 0x98(%rsp)
jmp 0xd1af
incl %ebp
xorps %xmm0, %xmm0
cvtsi2sdq 0x58(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdq 0x60(%rsp), %xmm1
movl %ebp, 0x18(%rsp)
movsd 0x23038(%rip), %xmm3    # 0x301a0
divsd %xmm3, %xmm1
xorps %xmm2, %xmm2
cvtsi2sdq 0x68(%rsp), %xmm2
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2sdq 0x70(%rsp), %xmm0
divsd %xmm3, %xmm0
addsd %xmm2, %xmm0
subsd %xmm1, %xmm0
movsd 0x88(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x88(%rsp)
movsd %xmm1, 0xa0(%rsp)
incl %r15d
jmp 0xcfeb
movq 0xb8(%rsp), %rdi
movq (%rdi), %rsi
leaq 0x1c(%rsp), %rcx
leaq 0x10(%rsp), %rdx
callq 0xe21a
movq 0xb0(%rsp), %rdi
movq (%rdi), %rsi
leaq 0xa8(%rsp), %rcx
leaq 0x90(%rsp), %rdx
callq 0xe3d6
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xd208
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xd21f
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd239
jmp 0xd239
jmp 0xd239
jmp 0xd239
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xd253
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xd26a
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq %rbx, %rdi
callq 0x23b0