// File: fjamour[P]icentral/src/bc.cc
// Function: brandes_bc_hash(graph_hash_t&, int)
brandes_bc_hash(graph_hash_t& graph_in, int max_iter)
{
    tr1_map_t(double) bc_vec;
    graph_in.i_fill_map<double>(bc_vec, 0);
    //means do all iterations
    if(max_iter == -1) {
        for(graph_hash_t::nodes_map_t::iterator it = graph_in.nodes_map.begin();
                it != graph_in.nodes_map.end(); 
                ++it) {
            node_id_t s = it->first;
            brandes_iter(graph_in, s, bc_vec);
        }
    } else {
        int cnt = 0;
        for(graph_hash_t::nodes_map_t::iterator it = graph_in.nodes_map.begin();
                it != graph_in.nodes_map.end(); 
                ++it) {
            node_id_t s = it->first;
            ++cnt;
            brandes_iter(graph_in, s, bc_vec);
            if(cnt == max_iter)
                break;
        }
    }
    
    if(max_iter == -1) {
        for(tr1_map_t(double)::iterator it = bc_vec.begin();
                it != bc_vec.end();
                ++it) {
            it->second = it->second/2;
        }
    }
    return bc_vec;    
}

// Assembly:
subq $0x158, %rsp            # imm = 0x158
movq %rdi, 0xb0(%rsp)
movq %rdi, %rax
movq %rax, 0xa8(%rsp)
movq %rdi, 0x150(%rsp)
movq %rsi, 0x148(%rsp)
movl %edx, 0x144(%rsp)
movb $0x0, 0x143(%rsp)
leaq 0x140(%rsp), %rdi
movq %rdi, 0xb8(%rsp)
callq 0x2d1e0
movq 0xb0(%rsp), %rdi
movq 0xb8(%rsp), %r8
movl $0xa, %esi
leaq 0x142(%rsp), %rdx
leaq 0x141(%rsp), %rcx
callq 0x2d1f0
jmp 0x2c5aa
leaq 0x140(%rsp), %rdi
callq 0x2d230
movq 0xb0(%rsp), %rsi
movq 0x148(%rsp), %rdi
xorps %xmm0, %xmm0
callq 0x53d40
jmp 0x2c5d1
cmpl $-0x1, 0x144(%rsp)
jne 0x2c732
movq 0x148(%rsp), %rdi
callq 0x2d6b0
movq %rdx, 0x98(%rsp)
movq %rax, 0xa0(%rsp)
jmp 0x2c5fe
movq 0x98(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq %rcx, 0x120(%rsp)
movq %rax, 0x128(%rsp)
movq 0x148(%rsp), %rdi
callq 0x2d710
movq %rdx, 0x88(%rsp)
movq %rax, 0x90(%rsp)
jmp 0x2c63d
movq 0x88(%rsp), %rax
movq 0x90(%rsp), %rcx
movq %rcx, 0x110(%rsp)
movq %rax, 0x118(%rsp)
leaq 0x120(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x2d6f0
movb %al, 0x87(%rsp)
jmp 0x2c67b
movb 0x87(%rsp), %al
testb $0x1, %al
jne 0x2c68b
jmp 0x2c72d
leaq 0x120(%rsp), %rdi
callq 0x2d750
movq %rax, 0x78(%rsp)
jmp 0x2c69f
movq 0xb0(%rsp), %rdx
movq 0x78(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x10c(%rsp)
movq 0x148(%rsp), %rdi
movl 0x10c(%rsp), %esi
callq 0x2c990
jmp 0x2c6cb
jmp 0x2c6cd
leaq 0x120(%rsp), %rdi
callq 0x2d760
jmp 0x2c6dc
jmp 0x2c61e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
leaq 0x140(%rsp), %rdi
callq 0x2d230
jmp 0x2c974
movq 0xb0(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
callq 0x2d420
jmp 0x2c974
jmp 0x2c842
movl $0x0, 0x108(%rsp)
movq 0x148(%rsp), %rdi
callq 0x2d6b0
movq %rdx, 0x68(%rsp)
movq %rax, 0x70(%rsp)
jmp 0x2c756
movq 0x68(%rsp), %rax
movq 0x70(%rsp), %rcx
movq %rcx, 0xf8(%rsp)
movq %rax, 0x100(%rsp)
movq 0x148(%rsp), %rdi
callq 0x2d710
movq %rdx, 0x58(%rsp)
movq %rax, 0x60(%rsp)
jmp 0x2c789
movq 0x58(%rsp), %rax
movq 0x60(%rsp), %rcx
movq %rcx, 0xe8(%rsp)
movq %rax, 0xf0(%rsp)
leaq 0xf8(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x2d6f0
movb %al, 0x57(%rsp)
jmp 0x2c7be
movb 0x57(%rsp), %al
testb $0x1, %al
jne 0x2c7c8
jmp 0x2c840
leaq 0xf8(%rsp), %rdi
callq 0x2d750
movq %rax, 0x48(%rsp)
jmp 0x2c7dc
movq 0xb0(%rsp), %rdx
movq 0x48(%rsp), %rax
movl (%rax), %eax
movl %eax, 0xe4(%rsp)
movl 0x108(%rsp), %eax
incl %eax
movl %eax, 0x108(%rsp)
movq 0x148(%rsp), %rdi
movl 0xe4(%rsp), %esi
callq 0x2c990
jmp 0x2c818
movl 0x108(%rsp), %eax
cmpl 0x144(%rsp), %eax
jne 0x2c82a
jmp 0x2c840
jmp 0x2c82c
leaq 0xf8(%rsp), %rdi
callq 0x2d760
jmp 0x2c83b
jmp 0x2c770
jmp 0x2c842
cmpl $-0x1, 0x144(%rsp)
jne 0x2c945
movq 0xb0(%rsp), %rdi
callq 0x2d790
movq %rdx, 0x38(%rsp)
movq %rax, 0x40(%rsp)
jmp 0x2c869
movq 0x38(%rsp), %rax
movq 0x40(%rsp), %rcx
movq %rcx, 0xd0(%rsp)
movq %rax, 0xd8(%rsp)
movq 0xb0(%rsp), %rdi
callq 0x2d7f0
movq %rdx, 0x28(%rsp)
movq %rax, 0x30(%rsp)
jmp 0x2c89c
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rcx, 0xc0(%rsp)
movq %rax, 0xc8(%rsp)
leaq 0xd0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x2d7d0
movb %al, 0x27(%rsp)
jmp 0x2c8d1
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x2c8db
jmp 0x2c943
leaq 0xd0(%rsp), %rdi
callq 0x2d830
movq %rax, 0x18(%rsp)
jmp 0x2c8ef
movq 0x18(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd 0x4e93f(%rip), %xmm1    # 0x7b240
mulsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0x2d830
movq %rax, 0x10(%rsp)
jmp 0x2c91f
movq 0x10(%rsp), %rax
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rax)
leaq 0xd0(%rsp), %rdi
callq 0x2d840
jmp 0x2c93e
jmp 0x2c883
jmp 0x2c945
movb $0x1, 0x143(%rsp)
testb $0x1, 0x143(%rsp)
jne 0x2c964
movq 0xb0(%rsp), %rdi
callq 0x2d420
movq 0xa8(%rsp), %rax
addq $0x158, %rsp            # imm = 0x158
retq
movq 0x138(%rsp), %rdi
callq 0x9cf0
nopw %cs:(%rax,%rax)