// File: fjamour[P]icentral/src/bcc_delta.cc
// Function: bcc_delta_t::compute_bc(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)
void bcc_delta_t::compute_bc(tr1_map_t(double)& bc_map,
                        node_id_t src,
                        node_id_t dst)
{

    //bc_map will have for each vertex in the muc it's betweenness centrality
    bcc_subgraph.remove_edge(src, dst);
    tr1_map_t(int) d_src_vec, d_dst_vec;
    bcc_subgraph.find_sssp(src, d_src_vec);
    bcc_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);
    
    for(graph_hash_t::nodes_map_t::iterator
                        it =  bcc_subgraph.nodes_map.begin();
                        it != bcc_subgraph.nodes_map.end();
                        ++it) {
        node_id_t s = it->first;
        if(d_src_vec[s] != d_dst_vec[s]) {
            i_iteration(s, 
                    src, 
                    dst, 
                    d_src_vec[s], 
                    d_dst_vec[s], 
                    bc_map);
        }
    }
    bcc_subgraph.insert_edge(src, dst);
}

// Assembly:
subq $0x158, %rsp            # imm = 0x158
movq %rdi, 0x150(%rsp)
movq %rsi, 0x148(%rsp)
movl %edx, 0x144(%rsp)
movl %ecx, 0x140(%rsp)
movq 0x150(%rsp), %rdi
movq %rdi, 0x88(%rsp)
addq $0x30, %rdi
movl 0x144(%rsp), %esi
movl 0x140(%rsp), %edx
callq 0x52580
leaq 0x10d(%rsp), %rdi
movq %rdi, 0x90(%rsp)
callq 0x3af60
movq 0x90(%rsp), %r8
leaq 0x110(%rsp), %rdi
movl $0xa, %esi
leaq 0x10f(%rsp), %rdx
leaq 0x10e(%rsp), %rcx
callq 0x3af70
jmp 0x347dd
leaq 0x10d(%rsp), %rdi
callq 0x326b0
leaq 0xc5(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0x3af60
movq 0x80(%rsp), %r8
leaq 0xc8(%rsp), %rdi
movl $0xa, %esi
leaq 0xc7(%rsp), %rdx
leaq 0xc6(%rsp), %rcx
callq 0x3af70
jmp 0x3482b
leaq 0xc5(%rsp), %rdi
callq 0x326b0
movq 0x88(%rsp), %rdi
addq $0x30, %rdi
movl 0x144(%rsp), %esi
leaq 0x110(%rsp), %rdx
callq 0x53400
jmp 0x3485a
movq 0x88(%rsp), %rdi
addq $0x30, %rdi
movl 0x140(%rsp), %esi
leaq 0xc8(%rsp), %rdx
callq 0x53400
jmp 0x3487c
movq 0x88(%rsp), %rdi
addq $0x30, %rdi
callq 0x2d6b0
movq %rdx, 0x70(%rsp)
movq %rax, 0x78(%rsp)
jmp 0x34899
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
movq %rcx, 0xb0(%rsp)
movq %rax, 0xb8(%rsp)
movq 0x88(%rsp), %rdi
addq $0x30, %rdi
callq 0x2d710
movq %rdx, 0x60(%rsp)
movq %rax, 0x68(%rsp)
jmp 0x348d0
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
movq %rcx, 0xa0(%rsp)
movq %rax, 0xa8(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x2d6f0
movb %al, 0x5f(%rsp)
jmp 0x34905
movb 0x5f(%rsp), %al
testb $0x1, %al
jne 0x34912
jmp 0x34aa6
leaq 0xb0(%rsp), %rdi
callq 0x2d750
movq %rax, 0x50(%rsp)
jmp 0x34926
movq 0x50(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x9c(%rsp)
leaq 0x110(%rsp), %rdi
leaq 0x9c(%rsp), %rsi
callq 0x2d870
movq %rax, 0x48(%rsp)
jmp 0x34950
movq 0x48(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x3c(%rsp)
leaq 0xc8(%rsp), %rdi
leaq 0x9c(%rsp), %rsi
callq 0x2d870
movq %rax, 0x40(%rsp)
jmp 0x34977
movl 0x3c(%rsp), %eax
movq 0x40(%rsp), %rcx
cmpl (%rcx), %eax
je 0x34a90
movl 0x9c(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x144(%rsp), %eax
movl %eax, 0x28(%rsp)
movl 0x140(%rsp), %eax
movl %eax, 0x2c(%rsp)
leaq 0x110(%rsp), %rdi
leaq 0x9c(%rsp), %rsi
callq 0x2d870
movq %rax, 0x30(%rsp)
jmp 0x349c5
movq 0x30(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x14(%rsp)
leaq 0xc8(%rsp), %rdi
leaq 0x9c(%rsp), %rsi
callq 0x2d870
movq %rax, 0x18(%rsp)
jmp 0x349ec
movl 0x14(%rsp), %r8d
movl 0x2c(%rsp), %ecx
movl 0x28(%rsp), %edx
movl 0x24(%rsp), %esi
movq 0x88(%rsp), %rdi
movq 0x18(%rsp), %rax
movl (%rax), %r9d
movq 0x148(%rsp), %r10
movq %rsp, %rax
movq %r10, (%rax)
callq 0x34b10
jmp 0x34a22
jmp 0x34a90
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x100(%rsp)
movl %eax, 0xfc(%rsp)
leaq 0x10d(%rsp), %rdi
callq 0x326b0
jmp 0x34af6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x100(%rsp)
movl %eax, 0xfc(%rsp)
leaq 0xc5(%rsp), %rdi
callq 0x326b0
jmp 0x34ae9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x100(%rsp)
movl %eax, 0xfc(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x3afb0
jmp 0x34ae9
jmp 0x34a92
leaq 0xb0(%rsp), %rdi
callq 0x2d760
jmp 0x34aa1
jmp 0x348b3
movq 0x88(%rsp), %rdi
addq $0x30, %rdi
movl 0x144(%rsp), %esi
movl 0x140(%rsp), %edx
callq 0x52420
jmp 0x34ac7
leaq 0xc8(%rsp), %rdi
callq 0x3afb0
leaq 0x110(%rsp), %rdi
callq 0x3afb0
addq $0x158, %rsp            # imm = 0x158
retq
leaq 0x110(%rsp), %rdi
callq 0x3afb0
movq 0x100(%rsp), %rdi
callq 0x9cf0
nopw %cs:(%rax,%rax)