// File: /workspace/github_cpp_makefile_star2_O2/fjamour[P]icentral/src/bc.cc
// Function: brandes_betweenness_centrality(graph_t&)
vector<double> brandes_betweenness_centrality(graph_t& graph_in)
{
    vector<double> bc_vec;
    bc_vec.resize(graph_in.size());
    fill(bc_vec.begin(), bc_vec.end(), 0.0);
    
    for(node_id_t s = 0; s < graph_in.size(); ++s) {
        stack<node_id_t>                  S;
        vector<vector<node_id_t> >        P;
        vector<int>                     path_cnt_vec;
        vector<int>                     dist_vec;
        queue<node_id_t>                  Q;
        
        P.resize(graph_in.size());
        path_cnt_vec.resize(graph_in.size());
        fill(path_cnt_vec.begin(), path_cnt_vec.end(), 0);
        path_cnt_vec[s] = 1;
        dist_vec.resize(graph_in.size());
        fill(dist_vec.begin(), dist_vec.end(), -1);
        dist_vec[s] = 0;
        
        Q.push(s);
        
        while(!Q.empty()) {
            node_id_t v = Q.front(); Q.pop();
            S.push(v);
            vector<node_id_t> nbr_vec = graph_in.get_nbrs(v);
            for(int nbr_idx = 0; nbr_idx < nbr_vec.size(); ++nbr_idx) {
                node_id_t w = nbr_vec[nbr_idx];
                if(dist_vec[w] < 0) {
                    Q.push(w);
                    dist_vec[w] = dist_vec[v] + 1;
                }
                if(dist_vec[w] == dist_vec[v] + 1) {
                    path_cnt_vec[w] += path_cnt_vec[v];
                    P[w].push_back(v);
                }
            }
        }
        vector<double> pair_dep_vec;
        pair_dep_vec.resize(graph_in.size());
        fill(pair_dep_vec.begin(), pair_dep_vec.end(), 0.0);
        while(!S.empty()) {
            node_id_t w = S.top(); S.pop();
            for(int idx = 0; idx < P[w].size(); ++idx) {
                node_id_t v = P[w][idx];
                pair_dep_vec[v] += (((double)path_cnt_vec[v]/path_cnt_vec[w]) * (1+pair_dep_vec[w]));
            }
            if (w != s) {
                bc_vec[w] += pair_dep_vec[w];
            }
        }
    }
    for(node_id_t i = 0; i < bc_vec.size(); ++i) {
        bc_vec[i] = bc_vec[i]/2;
    }
    return bc_vec;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rsi, %r14
movq %rdi, %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq %rsi, %rdi
movq %rbx, 0x18(%rsp)
callq 0x18d3c
movq %rbx, %rdi
movq %rax, %rsi
callq 0x45f0
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq %rcx, %rax
je 0x8b8a
andq $0x0, (%rax)
addq $0x8, %rax
jmp 0x8b7b
xorl %r15d, %r15d
leaq 0xe8(%rsp), %r12
leaq 0x20(%rsp), %rbp
leaq 0x14(%rsp), %r13
leaq 0x10(%rsp), %rbx
movl %r15d, 0xc(%rsp)
movq %r14, %rdi
callq 0x18d3c
movl %r15d, %ecx
cmpq %rcx, %rax
jbe 0x8ed6
leaq 0x98(%rsp), %rdi
callq 0x766a
xorpd %xmm0, %xmm0
movapd %xmm0, 0x80(%rsp)
andq $0x0, 0x90(%rsp)
movapd %xmm0, 0x60(%rsp)
andq $0x0, 0x70(%rsp)
movapd %xmm0, 0x40(%rsp)
andq $0x0, 0x50(%rsp)
movq %r12, %rdi
callq 0x4a40
movq %r14, %rdi
callq 0x18d3c
leaq 0x80(%rsp), %rdi
movq %rax, %rsi
callq 0x4874
movq %r14, %rdi
callq 0x18d3c
leaq 0x60(%rsp), %rdi
movq %rax, %rsi
callq 0xafb8
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
movq %rax, %rdx
cmpq %rcx, %rdx
je 0x8c48
andl $0x0, (%rdx)
addq $0x4, %rdx
jmp 0x8c3a
movl 0xc(%rsp), %ecx
movl $0x1, (%rax,%rcx,4)
movq %r14, %rdi
callq 0x18d3c
leaq 0x40(%rsp), %rdi
movq %rax, %rsi
callq 0xafb8
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
movq %rax, %rdx
cmpq %rcx, %rdx
je 0x8c83
orl $-0x1, (%rdx)
addq $0x4, %rdx
jmp 0x8c75
movl 0xc(%rsp), %ecx
andl $0x0, (%rax,%rcx,4)
movq %r12, %rdi
leaq 0xc(%rsp), %rsi
callq 0x62da
movq 0xf8(%rsp), %rax
cmpq %rax, 0x118(%rsp)
je 0x8d7c
movl (%rax), %eax
movl %eax, 0x14(%rsp)
movq %r12, %rdi
callq 0x650e
leaq 0x98(%rsp), %rdi
movq %r13, %rsi
callq 0x62da
movl 0x14(%rsp), %esi
movq %r14, %rdi
callq 0x18b4c
movq %rbp, %rdi
movq %rax, %rsi
callq 0x4ba0
xorl %r15d, %r15d
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r15, %rcx
jbe 0x8d6f
movl (%rax,%r15,4), %eax
movl %eax, 0x10(%rsp)
movq 0x40(%rsp), %rcx
movl (%rcx,%rax,4), %edx
testl %edx, %edx
jns 0x8d37
movq %r12, %rdi
movq %rbx, %rsi
callq 0x62da
movl 0x14(%rsp), %eax
movq 0x40(%rsp), %rcx
movl (%rcx,%rax,4), %eax
incl %eax
movl 0x10(%rsp), %edx
movl %eax, (%rcx,%rdx,4)
movl 0x10(%rsp), %eax
movl (%rcx,%rax,4), %edx
movl 0x14(%rsp), %esi
movl (%rcx,%rsi,4), %ecx
incl %ecx
cmpl %ecx, %edx
jne 0x8d67
movq 0x60(%rsp), %rcx
movl (%rcx,%rsi,4), %edx
addl %edx, (%rcx,%rax,4)
movl 0x10(%rsp), %eax
imulq $0x18, %rax, %rdi
addq 0x80(%rsp), %rdi
movq %r13, %rsi
callq 0x478c
incq %r15
jmp 0x8ce6
movq %rbp, %rdi
callq 0x56ec
jmp 0x8c98
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
movq %r14, %rdi
callq 0x18d3c
movq %rbp, %rdi
movq %rax, %rsi
callq 0x45f0
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
cmpq %rcx, %rax
je 0x8e75
andq $0x0, (%rax)
addq $0x8, %rax
jmp 0x8da9
cmpq 0xd0(%rsp), %rax
jne 0x8dda
movq 0xe0(%rsp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movl -0x4(%rax), %r15d
leaq 0x98(%rsp), %rdi
callq 0x85f6
movq 0x80(%rsp), %rcx
imulq $0x18, %r15, %rdx
movq (%rcx,%rdx), %rax
movq 0x8(%rcx,%rdx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
movq 0x60(%rsp), %rdx
movq 0x20(%rsp), %rsi
xorl %edi, %edi
cmpq %rdi, %rcx
je 0x8e4f
movl (%rax,%rdi,4), %r8d
cvtsi2sdl (%rdx,%r8,4), %xmm0
cvtsi2sdl (%rdx,%r15,4), %xmm1
divsd %xmm1, %xmm0
movsd (%rsi,%r15,8), %xmm1
addsd 0x1f206(%rip), %xmm1    # 0x28040
mulsd %xmm0, %xmm1
addsd (%rsi,%r8,8), %xmm1
movsd %xmm1, (%rsi,%r8,8)
incq %rdi
jmp 0x8e13
cmpl 0xc(%rsp), %r15d
je 0x8e75
movq 0x20(%rsp), %rax
movsd (%rax,%r15,8), %xmm0
movq 0x18(%rsp), %rax
movq (%rax), %rax
addsd (%rax,%r15,8), %xmm0
movsd %xmm0, (%rax,%r15,8)
movq 0xc8(%rsp), %rax
cmpq 0xa8(%rsp), %rax
jne 0x8dbc
movq %rbp, %rdi
callq 0x5754
movq %r12, %rdi
callq 0x5280
leaq 0x40(%rsp), %rdi
callq 0x5720
leaq 0x60(%rsp), %rdi
callq 0x5720
leaq 0x80(%rsp), %rdi
callq 0x4a1e
leaq 0x98(%rsp), %rdi
callq 0x5280
movl 0xc(%rsp), %r15d
incl %r15d
jmp 0x8ba4
movq 0x18(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
xorl %edx, %edx
movsd 0x1f13d(%rip), %xmm0    # 0x28030
movl %edx, %edx
cmpq %rdx, %rcx
jbe 0x8f0c
movsd (%rax,%rdx,8), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, (%rax,%rdx,8)
incl %edx
jmp 0x8ef3
movq 0x18(%rsp), %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8f2c
movq %rax, %rbx
jmp 0x8f63
jmp 0x8f2c
movq %rax, %rbx
jmp 0x8f91
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x5754
jmp 0x8f56
jmp 0x8f44
jmp 0x8f44
movq %rax, %rbx
jmp 0x8f56
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x56ec
leaq 0xe8(%rsp), %rdi
callq 0x5280
leaq 0x40(%rsp), %rdi
callq 0x5720
leaq 0x60(%rsp), %rdi
callq 0x5720
leaq 0x80(%rsp), %rdi
callq 0x4a1e
leaq 0x98(%rsp), %rdi
callq 0x5280
movq 0x18(%rsp), %rdi
callq 0x5754
movq %rbx, %rdi
callq 0x23d0