// File: /workspace/github_cpp_makefile_star2_O1/fjamour[P]icentral/src/qube.cc
// Function: muc_t::compute_bc_inc(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>>>&, unsigned int, unsigned int, int)
void muc_t::compute_bc_inc(tr1_map_t(double)& bc_map,
                        node_id_t src,
                        node_id_t dst,
                        int max_iter)
{
    if(!valid)
        return;

    muc_fast_subgraph.fill_graph(muc_subgraph);
    tmp_conn_vertex_map.clear();
    tmp_subgraph_map.clear();
    for(conn_vert_map_t::iterator it = conn_vertex_map.begin();
            it != conn_vertex_map.end();
            ++it) {
        node_id_t new_v = muc_fast_subgraph.outin_label_map[it->first];
        tmp_conn_vertex_map.insert(make_pair(new_v, it->second));
    }
    for(subgraph_map_t::iterator it = subgraph_map.begin();
            it != subgraph_map.end();
            ++it) {
        node_id_t new_v = muc_fast_subgraph.outin_label_map[it->first];
        tmp_subgraph_map.insert(make_pair(new_v, it->second));
    }
    
    src = muc_fast_subgraph.outin_label_map[src];
    dst = muc_fast_subgraph.outin_label_map[dst];
    
    //bc_map will have for each vertex in the muc it's betweenness centrality
    muc_fast_subgraph.remove_edge(src, dst);
    vector<int> d_src_vec, d_dst_vec;
    muc_fast_subgraph.find_sssp(src, d_src_vec);
    muc_fast_subgraph.find_sssp(dst, d_dst_vec);
    
    //this must be commented in general.. if it's there it makes bc_map contain deltas
    //bcc_subgraph.i_fill_map<double>(bc_map, 0);
    if(max_iter == -1)
        max_iter = muc_fast_subgraph.nodes_vec.size();
    else
        max_iter = min(max_iter, (int)muc_fast_subgraph.nodes_vec.size());
    for(int i = 0; i < max_iter; ++i) {
        node_id_t s = i;
        if(d_src_vec[s] != d_dst_vec[s]) {
            i_iteration(s, 
                    src, 
                    dst, 
                    d_src_vec[s], 
                    d_dst_vec[s], 
                    bc_map);
        }
    }
    muc_fast_subgraph.insert_edge(src, dst);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5b8, %rsp            # imm = 0x5B8
movl %edx, 0x18(%rsp)
movl %ecx, 0x14(%rsp)
cmpb $0x1, 0x30c(%rdi)
jne 0x29d06
movq %rdi, %r14
movl %r8d, 0x1c(%rsp)
movq %rsi, 0x20(%rsp)
addq $0x310, %rdi            # imm = 0x310
leaq 0x60(%r14), %rsi
movq %rdi, 0x28(%rsp)
callq 0x2f4f0
leaq 0x508(%r14), %r13
movq 0x510(%r14), %rsi
movq 0x518(%r14), %rdx
movq %r13, %rdi
callq 0x15c88
xorl %ebx, %ebx
movq %rbx, 0x520(%r14)
leaq 0x538(%r14), %rdi
movq 0x540(%r14), %rsi
movq 0x548(%r14), %rdx
movq %rdi, 0x30(%rsp)
callq 0x2472e
movq %rbx, 0x550(%r14)
movq 0x8(%r14), %r12
movq (%r12), %rbp
testq %rbp, %rbp
jne 0x29a40
movq 0x8(%r12), %rbp
addq $0x8, %r12
jmp 0x29a30
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
cmpq (%rax,%rcx,8), %rbp
je 0x29b1d
leaq 0x370(%r14), %r15
leaq 0x58(%rsp), %rbx
movq %r15, %rdi
movq %rbp, %rsi
callq 0x5d84
movl (%rax), %eax
leaq 0x8(%rbp), %rsi
movl %eax, 0x50(%rsp)
movq %rbx, %rdi
callq 0x61a0
movl 0x50(%rsp), %eax
movl %eax, 0x300(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, 0x308(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x318(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
leaq 0x38(%rsp), %rdi
movq %r13, %rsi
leaq 0x300(%rsp), %rdx
callq 0x1d628
movq 0x308(%rsp), %rdi
testq %rdi, %rdi
je 0x29ae0
movq 0x318(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x29af7
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x20(%rbp), %rbp
testq %rbp, %rbp
jne 0x29b0b
movq 0x8(%r12), %rbp
addq $0x8, %r12
jmp 0x29afb
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
cmpq (%rax,%rcx,8), %rbp
jne 0x29a5e
movq 0x38(%r14), %r12
movq (%r12), %r13
testq %r13, %r13
jne 0x29b35
movq 0x8(%r12), %r13
addq $0x8, %r12
jmp 0x29b25
movq 0x38(%r14), %rax
movq 0x40(%r14), %rcx
cmpq (%rax,%rcx,8), %r13
je 0x29bda
leaq 0x370(%r14), %rbx
leaq 0x58(%rsp), %rbp
leaq 0x308(%rsp), %r15
movq %rbx, %rdi
movq %r13, %rsi
callq 0x5d84
movl (%rax), %eax
leaq 0x8(%r13), %rsi
movl %eax, 0x50(%rsp)
movq %rbp, %rdi
callq 0x163e6
movl 0x50(%rsp), %eax
movl %eax, 0x300(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
callq 0x2d504
leaq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
leaq 0x300(%rsp), %rdx
callq 0x2e744
movq %r15, %rdi
callq 0x15750
movq %rbp, %rdi
callq 0x15750
movq 0x2b0(%r13), %r13
testq %r13, %r13
jne 0x29bcc
movq 0x8(%r12), %r13
addq $0x8, %r12
jmp 0x29bbc
movq 0x38(%r14), %rax
movq 0x40(%r14), %rcx
cmpq (%rax,%rcx,8), %r13
jne 0x29b5b
leaq 0x370(%r14), %r15
leaq 0x18(%rsp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5d84
movl (%rax), %eax
movl %eax, (%rbx)
leaq 0x14(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x5d84
movl (%rax), %edx
movl %edx, (%r12)
movl (%rbx), %esi
movq 0x28(%rsp), %r13
movq %r13, %rdi
callq 0x2ec4c
xorl %eax, %eax
leaq 0x300(%rsp), %rdx
movq %rax, 0x10(%rdx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rdx)
movq %rax, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movl (%rbx), %esi
movq %r13, %rdi
callq 0x2f1e0
movl 0x14(%rsp), %esi
leaq 0x50(%rsp), %rdx
movq %r13, %rdi
callq 0x2f1e0
movq 0x318(%r14), %rax
subq 0x310(%r14), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %ecx # imm = 0xAAAAAAAB
movl 0x1c(%rsp), %edx
cmpl %edx, %ecx
movl %edx, %eax
cmovll %ecx, %eax
cmpl $-0x1, %edx
cmovel %ecx, %eax
testl %eax, %eax
movq 0x20(%rsp), %r12
jle 0x29cc2
movl %eax, %r15d
xorl %ebx, %ebx
movq 0x300(%rsp), %rax
movl (%rax,%rbx,4), %r8d
movq 0x50(%rsp), %rax
movl (%rax,%rbx,4), %r9d
cmpl %r9d, %r8d
je 0x29cba
movl 0x18(%rsp), %edx
movl 0x14(%rsp), %ecx
movq %r12, (%rsp)
movq %r14, %rdi
movl %ebx, %esi
callq 0x29da4
incq %rbx
cmpq %rbx, %r15
jne 0x29c8a
movl 0x18(%rsp), %esi
movl 0x14(%rsp), %edx
movq %r13, %rdi
callq 0x2eb74
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x29ce9
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x300(%rsp), %rdi
testq %rdi, %rdi
je 0x29d06
movq 0x310(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
addq $0x5b8, %rsp            # imm = 0x5B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x29d1a
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x29d34
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x300(%rsp), %rdi
testq %rdi, %rdi
je 0x29d9c
movq 0x310(%rsp), %rsi
jmp 0x29d94
movq %rax, %rbx
jmp 0x29d5b
movq %rax, %rbx
movq %r15, %rdi
callq 0x15750
movq %rbp, %rdi
callq 0x15750
jmp 0x29d9c
movq %rax, %rbx
movq 0x308(%rsp), %rdi
testq %rdi, %rdi
je 0x29d85
movq 0x318(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x29d9c
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq %rbx, %rdi
callq 0x23b0