// File: /workspace/github_cpp_makefile_star2_O1/fjamour[P]icentral/src/bcc_scratch.cc
// Function: bcc_scratch_t::bc_iter(unsigned int, std::tr1::unordered_map<unsigned int, double, std::tr1::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, double>>>&)
void bcc_scratch_t::bc_iter(node_id_t s, tr1::unordered_map<node_id_t,double>& bc_map) {
    vector<vector<node_id_t> >&  P = bcc_fast_subgraph.P;
    vector<int>&                 path_cnt_map = bcc_fast_subgraph.path_cnt_vec;
    vector<int>&                 dist_map = bcc_fast_subgraph.dist_vec;
    vector<double>&              pair_dep_map = bcc_fast_subgraph.pair_dep_vec;
    vector<double>&              sigma_t_map = bcc_fast_subgraph.sigma_t_map;
    queue<node_id_t>&            Q = bcc_fast_subgraph.Q;
    stack<node_id_t>             S;

    bcc_fast_subgraph.init_maps();
    path_cnt_map[s] = 1;
    dist_map[s] = 0;

    Q.push(s);
    while (!Q.empty()) {
        node_id_t v_i = Q.front();
        Q.pop();
        S.push(v_i);
        for(int i = 0; i < bcc_fast_subgraph.nodes_vec[v_i].size(); ++i) {
            node_id_t v_n = bcc_fast_subgraph.nodes_vec[v_i][i];
            if (dist_map[v_n] < 0) {
                Q.push(v_n);
                dist_map[v_n] = dist_map[v_i] + 1;
            }
            if (dist_map[v_n] == dist_map[v_i] + 1) {
                path_cnt_map[v_n] = path_cnt_map[v_n] + path_cnt_map[v_i];
                P[v_n].push_back(v_i);
            }
        }
    }
    while (!S.empty()) {
        node_id_t v_n = S.top();
        S.pop();
        if (art_pt_map.find(s) != art_pt_map.end()
                && art_pt_map.find(v_n) != art_pt_map.end()
                && s != v_n) {
            int VG_s, VG_n;
            VG_s = accumulate(art_pt_map[s].begin(), art_pt_map[s].end(), 0);
            VG_n = accumulate(art_pt_map[v_n].begin(), art_pt_map[v_n].end(), 0);
            int c_t = VG_s*VG_n;
            sigma_t_map[v_n] = sigma_t_map[v_n] + c_t;
            
            node_id_t new_v_n = bcc_fast_subgraph.inout_label_map[v_n];
            bc_map[new_v_n] = bc_map[new_v_n] + c_t;
        }
        for (int i = 0; i < P[v_n].size(); ++i) {
            node_id_t v_p = P[v_n][i];
            double sp_sn = ((double) path_cnt_map[v_p] / path_cnt_map[v_n]);
            pair_dep_map[v_p] = pair_dep_map[v_p] + sp_sn * (1 + pair_dep_map[v_n]);
            if (art_pt_map.find(s) != art_pt_map.end()) {
                sigma_t_map[v_p] = sigma_t_map[v_p] + sigma_t_map[v_n] * sp_sn;
                
                node_id_t new_v_p = bcc_fast_subgraph.inout_label_map[v_p];
                bc_map[new_v_p] = bc_map[new_v_p] + sigma_t_map[v_n] * sp_sn;
            }
        }
        if (s != v_n) {
            node_id_t new_v_n = bcc_fast_subgraph.inout_label_map[v_n];
            bc_map[new_v_n] = bc_map[new_v_n] + pair_dep_map[v_n];
        }
        if (art_pt_map.find(s) != art_pt_map.end()) {
            int VG_s = accumulate(art_pt_map[s].begin(), art_pt_map[s].end(), 0);
            
            node_id_t new_v_n = bcc_fast_subgraph.inout_label_map[v_n];
            bc_map[new_v_n] = bc_map[new_v_n] + pair_dep_map[v_n] * VG_s * 2;
        }
    }    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movl %esi, 0x14(%rsp)
leaq 0x2d8(%rdi), %r15
xorpd %xmm0, %xmm0
leaq 0x30(%rsp), %rdi
movapd %xmm0, 0x40(%rdi)
movapd %xmm0, 0x30(%rdi)
movapd %xmm0, 0x20(%rdi)
movapd %xmm0, 0x10(%rdi)
movapd %xmm0, (%rdi)
xorl %esi, %esi
callq 0x6b50
movq %r15, %rdi
callq 0x2ea72
leaq 0x480(%r14), %r12
movl 0x14(%rsp), %eax
movq 0x380(%r14), %rcx
movl $0x1, (%rcx,%rax,4)
movl 0x14(%rsp), %eax
movq 0x3b0(%r14), %rcx
movl $0x0, (%rcx,%rax,4)
movq 0x4b0(%r14), %rax
movq 0x4c0(%r14), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x13d97
movl 0x14(%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x4b0(%r14)
jmp 0x13da4
leaq 0x14(%rsp), %rsi
movq %r12, %rdi
callq 0x7644
movq 0x490(%r14), %rax
cmpq %rax, 0x4b0(%r14)
je 0x13f0e
leaq 0xc(%rsp), %rbp
movl (%rax), %eax
movl %eax, 0xc(%rsp)
movq %r12, %rdi
callq 0xdd72
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x13def
movl 0xc(%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x60(%rsp)
jmp 0x13dfc
leaq 0x30(%rsp), %rdi
movq %rbp, %rsi
callq 0x7644
movl 0xc(%rsp), %eax
movq (%r15), %rcx
leaq (%rax,%rax,2), %rdx
movq (%rcx,%rdx,8), %rax
cmpq %rax, 0x8(%rcx,%rdx,8)
je 0x13efa
xorl %r13d, %r13d
movl (%rax,%r13,4), %eax
movl %eax, 0x10(%rsp)
movq 0x3b0(%r14), %rcx
cmpl $0x0, (%rcx,%rax,4)
jns 0x13e78
movq 0x4b0(%r14), %rcx
movq 0x4c0(%r14), %rdx
addq $-0x4, %rdx
cmpq %rdx, %rcx
je 0x13e54
movl %eax, (%rcx)
addq $0x4, %rcx
movq %rcx, 0x4b0(%r14)
jmp 0x13e61
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x7644
movl 0xc(%rsp), %eax
movq 0x3b0(%r14), %rcx
movl (%rcx,%rax,4), %eax
incl %eax
movl 0x10(%rsp), %edx
movl %eax, (%rcx,%rdx,4)
movl 0x10(%rsp), %eax
movq 0x3b0(%r14), %rdx
movl 0xc(%rsp), %ecx
movl (%rdx,%rcx,4), %esi
incl %esi
cmpl %esi, (%rdx,%rax,4)
jne 0x13ed3
movq 0x380(%r14), %rdx
movl (%rdx,%rcx,4), %ecx
addl %ecx, (%rdx,%rax,4)
movl 0x10(%rsp), %eax
movq 0x368(%r14), %rcx
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x13ecb
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x13ed3
movq %rbp, %rdx
callq 0x6f98
incq %r13
movl 0xc(%rsp), %eax
movq (%r15), %rcx
leaq (%rax,%rax,2), %rdx
movq (%rcx,%rdx,8), %rax
movq 0x8(%rcx,%rdx,8), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r13, %rcx
ja 0x13e19
movq 0x490(%r14), %rax
cmpq %rax, 0x4b0(%r14)
jne 0x13dbd
movq 0x60(%rsp), %rax
cmpq 0x40(%rsp), %rax
je 0x14387
leaq 0x14(%rsp), %r15
leaq 0x10(%rsp), %r12
movq 0x68(%rsp), %rdi
cmpq %rdi, %rax
je 0x13f3f
movl -0x4(%rax), %ecx
addq $-0x4, %rax
movl %ecx, 0xc(%rsp)
jmp 0x13f87
movq 0x78(%rsp), %rax
movq -0x8(%rax), %rax
movl 0x1fc(%rax), %eax
movl %eax, 0xc(%rsp)
movl $0x200, %esi            # imm = 0x200
callq 0x2250
movq 0x78(%rsp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x78(%rsp)
movq -0x8(%rax), %rax
movq %rax, 0x68(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x70(%rsp)
movl $0x1fc, %ecx            # imm = 0x1FC
addq %rcx, %rax
movq %rax, 0x60(%rsp)
movl 0x14(%rsp), %ecx
movq 0x8(%r14), %rdi
movq 0x10(%r14), %r8
movq %rcx, %rax
xorl %edx, %edx
divq %r8
movq (%rdi,%rdx,8), %rax
movl $0x0, %edx
testq %rax, %rax
je 0x13fc2
cmpl (%rax), %ecx
je 0x13fbf
movq 0x20(%rax), %rax
testq %rax, %rax
jne 0x13fae
xorl %edx, %edx
jmp 0x13fc2
movq %rax, %rdx
testq %rdx, %rdx
jne 0x13fcb
movq (%rdi,%r8,8), %rdx
movq (%rdi,%r8,8), %r9
cmpq %r9, %rdx
je 0x140e4
movl 0xc(%rsp), %esi
movq %rsi, %rax
xorl %edx, %edx
divq %r8
movq (%rdi,%rdx,8), %rax
movl $0x0, %edx
testq %rax, %rax
je 0x14006
cmpl (%rax), %esi
je 0x14003
movq 0x20(%rax), %rax
testq %rax, %rax
jne 0x13ff2
xorl %edx, %edx
jmp 0x14006
movq %rax, %rdx
cmpl %esi, %ecx
je 0x140e4
testq %rdx, %rdx
je 0x140e4
cmpq %r9, %rdx
je 0x140e4
movq %r14, %rdi
movq %r15, %rsi
callq 0x6106
movq (%rax), %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0x6106
movq 0x8(%rax), %rax
xorl %ebp, %ebp
cmpq %rax, %r13
je 0x1404e
addl (%r13), %ebp
addq $0x4, %r13
jmp 0x1403f
movq %r14, %rdi
leaq 0xc(%rsp), %rsi
callq 0x6106
movq (%rax), %r13
movq %r14, %rdi
leaq 0xc(%rsp), %rsi
callq 0x6106
movq 0x8(%rax), %rcx
xorl %eax, %eax
cmpq %rcx, %r13
je 0x14080
addl (%r13), %eax
addq $0x4, %r13
jmp 0x14071
imull %ebp, %eax
movl 0xc(%rsp), %ecx
movq 0x410(%r14), %rdx
cvtsi2sd %eax, %xmm1
movsd (%rdx,%rcx,8), %xmm0
movsd %xmm1, 0x18(%rsp)
addsd %xmm1, %xmm0
movsd %xmm0, (%rdx,%rcx,8)
movq 0x320(%r14), %rax
movl (%rax,%rcx,4), %eax
movl %eax, 0x10(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd85a
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd85a
movsd 0x20(%rsp), %xmm0
addsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rax)
movl 0xc(%rsp), %esi
movq 0x368(%r14), %rcx
leaq (%rsi,%rsi,2), %rdx
movq (%rcx,%rdx,8), %rax
cmpq %rax, 0x8(%rcx,%rdx,8)
je 0x1422e
xorl %ebp, %ebp
movl (%rax,%rbp,4), %edi
movq 0x380(%r14), %rax
movq 0x3c8(%r14), %rcx
xorps %xmm1, %xmm1
cvtsi2sdl (%rax,%rdi,4), %xmm1
xorps %xmm0, %xmm0
cvtsi2sdl (%rax,%rsi,4), %xmm0
divsd %xmm0, %xmm1
movsd (%rcx,%rsi,8), %xmm0
addsd 0x1cefa(%rip), %xmm0    # 0x31030
mulsd %xmm1, %xmm0
addsd (%rcx,%rdi,8), %xmm0
movsd %xmm0, (%rcx,%rdi,8)
movl 0x14(%rsp), %ecx
movq 0x8(%r14), %r8
movq 0x10(%r14), %r9
movq %rcx, %rax
xorl %edx, %edx
divq %r9
movq (%r8,%rdx,8), %rax
movl $0x0, %edx
testq %rax, %rax
je 0x1417a
cmpl (%rax), %ecx
je 0x14177
movq 0x20(%rax), %rax
testq %rax, %rax
jne 0x14166
xorl %edx, %edx
jmp 0x1417a
movq %rax, %rdx
testq %rdx, %rdx
jne 0x14183
movq (%r8,%r9,8), %rdx
cmpq (%r8,%r9,8), %rdx
je 0x14203
movq 0x410(%r14), %rax
movsd (%rax,%rsi,8), %xmm0
movsd %xmm1, 0x18(%rsp)
mulsd %xmm1, %xmm0
addsd (%rax,%rdi,8), %xmm0
movsd %xmm0, (%rax,%rdi,8)
movq 0x320(%r14), %rax
movl (%rax,%rdi,4), %eax
movl %eax, 0x10(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd85a
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movl 0xc(%rsp), %eax
movq 0x410(%r14), %rcx
movsd (%rcx,%rax,8), %xmm0
movsd %xmm0, 0x28(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd85a
movsd 0x28(%rsp), %xmm0
mulsd 0x18(%rsp), %xmm0
addsd 0x20(%rsp), %xmm0
movsd %xmm0, (%rax)
incq %rbp
movl 0xc(%rsp), %esi
movq 0x368(%r14), %rcx
leaq (%rsi,%rsi,2), %rdx
movq (%rcx,%rdx,8), %rax
movq 0x8(%rcx,%rdx,8), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rbp, %rcx
ja 0x14104
cmpl %esi, 0x14(%rsp)
je 0x14288
movq 0x320(%r14), %rax
movl (%rax,%rsi,4), %eax
movl %eax, 0x10(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd85a
movsd (%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
movl 0xc(%rsp), %eax
movq 0x3c8(%r14), %rcx
movsd (%rcx,%rax,8), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd85a
movsd 0x18(%rsp), %xmm0
addsd 0x20(%rsp), %xmm0
movsd %xmm0, (%rax)
movl 0x14(%rsp), %ecx
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdi
movq %rcx, %rax
xorl %edx, %edx
divq %rdi
movq (%rsi,%rdx,8), %rax
movl $0x0, %edx
testq %rax, %rax
je 0x142be
cmpl (%rax), %ecx
je 0x142bb
movq 0x20(%rax), %rax
testq %rax, %rax
jne 0x142aa
xorl %edx, %edx
jmp 0x142be
movq %rax, %rdx
testq %rdx, %rdx
jne 0x142c7
movq (%rsi,%rdi,8), %rdx
cmpq (%rsi,%rdi,8), %rdx
je 0x14377
movq %r14, %rdi
movq %r15, %rsi
callq 0x6106
movq (%rax), %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0x6106
movq 0x8(%rax), %rax
cmpq %rax, %r13
je 0x1430b
xorl %ecx, %ecx
addl (%r13), %ecx
addq $0x4, %r13
cmpq %rax, %r13
jne 0x142f5
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
jmp 0x1430f
xorpd %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
movl 0xc(%rsp), %eax
movq 0x320(%r14), %rcx
movl (%rcx,%rax,4), %eax
movl %eax, 0x10(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd85a
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movl 0xc(%rsp), %eax
movq 0x3c8(%r14), %rcx
movsd (%rcx,%rax,8), %xmm0
movsd %xmm0, 0x28(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd85a
movsd 0x28(%rsp), %xmm0
mulsd 0x18(%rsp), %xmm0
addsd %xmm0, %xmm0
addsd 0x20(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x60(%rsp), %rax
cmpq 0x40(%rsp), %rax
jne 0x13f28
leaq 0x30(%rsp), %rdi
callq 0x6998
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x143b3
jmp 0x143b3
jmp 0x143b3
jmp 0x143b3
jmp 0x143b3
jmp 0x143b3
jmp 0x143b3
jmp 0x143b3
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x6998
movq %rbx, %rdi
callq 0x23b0