// File: /workspace/github_cpp_makefile_star2_O1/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)
movq $0x0, 0x10(%rdi)
movq %rsi, %rdi
movq %rbx, 0x48(%rsp)
callq 0x1e160
movq %rbx, %rdi
movq %rax, %rsi
callq 0x5c58
movq (%rbx), %rdi
movq 0x8(%rbx), %rdx
cmpq %rdx, %rdi
je 0xa3be
subq %rdi, %rdx
addq $-0x8, %rdx
andq $-0x8, %rdx
addq $0x8, %rdx
xorl %esi, %esi
callq 0x2110
leaq 0x70(%rsp), %r12
leaq 0x10(%rsp), %rbp
leaq 0x4(%rsp), %r13
leaq 0xc(%rsp), %r15
xorl %ebx, %ebx
movl %ebx, 0x8(%rsp)
movq %r14, %rdi
callq 0x1e160
movl %ebx, %ecx
cmpq %rcx, %rax
jbe 0xa928
xorpd %xmm0, %xmm0
movapd %xmm0, 0x120(%rsp)
movapd %xmm0, 0x110(%rsp)
movapd %xmm0, 0x100(%rsp)
movapd %xmm0, 0xf0(%rsp)
movapd %xmm0, 0xe0(%rsp)
leaq 0xe0(%rsp), %rdi
xorl %esi, %esi
callq 0x6b50
xorpd %xmm0, %xmm0
movapd %xmm0, 0xc0(%rsp)
xorl %eax, %eax
movq %rax, 0xd0(%rsp)
movq %rax, 0x60(%rsp)
movapd %xmm0, 0x50(%rsp)
movq %rax, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movapd %xmm0, 0xb0(%rsp)
movapd %xmm0, 0xa0(%rsp)
movapd %xmm0, 0x90(%rsp)
movapd %xmm0, 0x80(%rsp)
movapd %xmm0, 0x70(%rsp)
movq %r12, %rdi
xorl %esi, %esi
callq 0x6b50
movq %r14, %rdi
callq 0x1e160
leaq 0xc0(%rsp), %rdi
movq %rax, %rsi
callq 0x5eac
movq %r14, %rdi
callq 0x1e160
leaq 0x50(%rsp), %rdi
movq %rax, %rsi
callq 0xd7da
movq 0x50(%rsp), %rbx
movq 0x58(%rsp), %rdx
cmpq %rdx, %rbx
je 0xa4e1
subq %rbx, %rdx
addq $-0x4, %rdx
andq $-0x4, %rdx
addq $0x4, %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2110
movl 0x8(%rsp), %eax
movl $0x1, (%rbx,%rax,4)
movq %r14, %rdi
callq 0x1e160
leaq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0xd7da
movq 0x30(%rsp), %rbx
movq 0x38(%rsp), %rdx
cmpq %rdx, %rbx
je 0xa52c
subq %rbx, %rdx
addq $-0x4, %rdx
andq $-0x4, %rdx
addq $0x4, %rdx
movq %rbx, %rdi
movl $0xff, %esi
callq 0x2110
movl 0x8(%rsp), %eax
movl $0x0, (%rbx,%rax,4)
movq 0xa0(%rsp), %rax
movq 0xb0(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0xa567
movl 0x8(%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0xa0(%rsp)
jmp 0xa727
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
callq 0x7644
jmp 0xa727
movl (%rax), %ecx
movl %ecx, 0x4(%rsp)
movq 0x90(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0xa596
addq $0x4, %rax
jmp 0xa5d7
movq 0x88(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x2250
movq 0x98(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x98(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x88(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x90(%rsp)
movq %rax, 0x80(%rsp)
movq 0x110(%rsp), %rax
movq 0x120(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0xa60c
movl 0x4(%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x110(%rsp)
jmp 0xa61c
leaq 0xe0(%rsp), %rdi
movq %r13, %rsi
callq 0x7644
movl 0x4(%rsp), %esi
movq %r14, %rdi
callq 0x1ddf8
movq %rbp, %rdi
movq %rax, %rsi
callq 0x61a0
movq 0x10(%rsp), %rdi
cmpq %rdi, 0x18(%rsp)
je 0xa715
xorl %ebx, %ebx
movl (%rdi,%rbx,4), %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rsp), %rcx
cmpl $0x0, (%rcx,%rax,4)
jns 0xa6a0
movq 0xa0(%rsp), %rcx
movq 0xb0(%rsp), %rdx
addq $-0x4, %rdx
cmpq %rdx, %rcx
je 0xa680
movl %eax, (%rcx)
addq $0x4, %rcx
movq %rcx, 0xa0(%rsp)
jmp 0xa68b
movq %r12, %rdi
movq %r15, %rsi
callq 0x7644
movl 0x4(%rsp), %eax
movq 0x30(%rsp), %rcx
movl (%rcx,%rax,4), %eax
incl %eax
movl 0xc(%rsp), %edx
movl %eax, (%rcx,%rdx,4)
movl 0xc(%rsp), %eax
movq 0x30(%rsp), %rdx
movl 0x4(%rsp), %ecx
movl (%rdx,%rcx,4), %esi
incl %esi
cmpl %esi, (%rdx,%rax,4)
jne 0xa6f8
movq 0x50(%rsp), %rdx
movl (%rdx,%rcx,4), %ecx
addl %ecx, (%rdx,%rax,4)
movl 0xc(%rsp), %eax
movq 0xc0(%rsp), %rcx
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0xa6f0
movl 0x4(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0xa6f8
movq %r13, %rdx
callq 0x6f98
incq %rbx
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rax
subq %rdi, %rax
sarq $0x2, %rax
cmpq %rbx, %rax
ja 0xa645
testq %rdi, %rdi
je 0xa727
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x80(%rsp), %rax
cmpq %rax, 0xa0(%rsp)
jne 0xa579
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq %r14, %rdi
callq 0x1e160
movq %rbp, %rdi
movq %rax, %rsi
callq 0x5c58
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rdx
cmpq %rdx, %rdi
je 0xa8a0
subq %rdi, %rdx
addq $-0x8, %rdx
andq $-0x8, %rdx
addq $0x8, %rdx
xorl %esi, %esi
callq 0x2110
jmp 0xa8a0
movq 0x118(%rsp), %rdi
movq %rax, %rcx
cmpq %rdi, %rax
jne 0xa7b5
movq 0x128(%rsp), %rcx
movq -0x8(%rcx), %rcx
movl $0x200, %edx            # imm = 0x200
addq %rdx, %rcx
movl -0x4(%rcx), %ebx
cmpq %rdi, %rax
je 0xa7c3
addq $-0x4, %rax
jmp 0xa802
movl $0x200, %esi            # imm = 0x200
callq 0x2250
movq 0x128(%rsp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x128(%rsp)
movq -0x8(%rax), %rax
movq %rax, 0x118(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x120(%rsp)
addq $0x1fc, %rax            # imm = 0x1FC
movq %rax, 0x110(%rsp)
movq 0xc0(%rsp), %rcx
leaq (%rbx,%rbx,2), %rdx
movq (%rcx,%rdx,8), %rax
movq 0x8(%rcx,%rdx,8), %rcx
subq %rax, %rcx
movsd 0x26806(%rip), %xmm3    # 0x31030
je 0xa87e
sarq $0x2, %rcx
movq 0x50(%rsp), %rdx
xorps %xmm0, %xmm0
cvtsi2sdl (%rdx,%rbx,4), %xmm0
movq 0x10(%rsp), %rsi
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorl %edi, %edi
movl (%rax,%rdi,4), %r8d
xorps %xmm1, %xmm1
cvtsi2sdl (%rdx,%r8,4), %xmm1
divsd %xmm0, %xmm1
movsd (%rsi,%rbx,8), %xmm2
addsd %xmm3, %xmm2
mulsd %xmm1, %xmm2
addsd (%rsi,%r8,8), %xmm2
movsd %xmm2, (%rsi,%r8,8)
incq %rdi
cmpq %rdi, %rcx
jne 0xa84c
cmpl 0x8(%rsp), %ebx
je 0xa8a0
movq 0x10(%rsp), %rax
movsd (%rax,%rbx,8), %xmm0
movq 0x48(%rsp), %rax
movq (%rax), %rax
addsd (%rax,%rbx,8), %xmm0
movsd %xmm0, (%rax,%rbx,8)
movq 0x110(%rsp), %rax
cmpq 0xf0(%rsp), %rax
jne 0xa791
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xa8cd
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq %r12, %rdi
callq 0x6998
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xa8ec
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0xa903
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0xc0(%rsp), %rdi
callq 0x60b8
leaq 0xe0(%rsp), %rdi
callq 0x6998
movl 0x8(%rsp), %ebx
incl %ebx
jmp 0xa3d4
movq 0x48(%rsp), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rcx
subq %rdi, %rcx
je 0xa95f
sarq $0x3, %rcx
xorl %edx, %edx
movsd 0x266f1(%rip), %xmm0    # 0x31038
movsd (%rdi,%rdx,8), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, (%rdi,%rdx,8)
incq %rdx
movl %edx, %esi
cmpq %rsi, %rcx
ja 0xa947
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa97a
movq %rax, %r14
jmp 0xa9ae
jmp 0xa97a
movq %rax, %r14
jmp 0xa9f6
jmp 0xa98a
jmp 0xa985
jmp 0xa985
movq %rax, %r14
jmp 0xa9a4
movq %rax, %r14
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xa9a4
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0x70(%rsp), %rdi
callq 0x6998
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xa9c5
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0xa9dc
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0xc0(%rsp), %rdi
callq 0x60b8
leaq 0xe0(%rsp), %rdi
callq 0x6998
movq 0x48(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0xaa0f
movq 0x10(%rax), %rsi
subq %rdi, %rsi
callq 0x2250
movq %r14, %rdi
callq 0x23b0