// File: fjamour[P]icentral/src/_bc.cc
// Function: partial_BBFS_deletion(iter_info_t&, component_t&, unsigned int, std::pair<unsigned int, unsigned int>)
void partial_BBFS_deletion(
        iter_info_t&    iter_info,  // iteration info to be computed
        component_t&    comp,       // component
        node_id_t       s,          // source of the iteration
        edge_t          e           // deleted edge
        )
{
    subgraph_t& g = comp.subgraph;
    
    vector<vector<node_id_t> >&  P = iter_info.P; 
    vector<int>&                 sigma_vec = iter_info.sigma_vec;
    vector<int>&                 dist_vec = iter_info.dist_vec;
    vector<node_id_t>&           S = iter_info.S;
    
    queue<node_id_t>             Q;
    
    //for now everything is computed from scratch, so old values are irrelevant
    iter_info.init_all(g.size());
    // Assumes iter_info is initialized
    
    // IMP: careful bitch, graph_t is not thread safe!
    //g.remove_edge(e.first, e.second);
    sigma_vec[s] = 1;
    dist_vec[s] = 0;
    Q.push(s);
    while(!Q.empty()) {
        node_id_t v_i = Q.front(); Q.pop();
        S.push_back(v_i);
        for(int i = 0; i < g.nodes_vec[v_i].size(); ++i) {
            node_id_t v_n = g.nodes_vec[v_i][i];
            if(v_i == e.first && v_n == e.second || v_i == e.second && v_n == e.first) continue;
            if(dist_vec[v_n] < 0) {
                Q.push(v_n);
                dist_vec[v_n] = dist_vec[v_i] + 1;
            }
            if(dist_vec[v_n] == dist_vec[v_i] + 1) {
                sigma_vec[v_n] = sigma_vec[v_n] + sigma_vec[v_i];
                P[v_n].push_back(v_i);
            }
        }
    }
    //g.insert_edge(e.first, e.second);
}

// Assembly:
subq $0xe8, %rsp
movq %rcx, 0xe0(%rsp)
movq %rdi, 0xd8(%rsp)
movq %rsi, 0xd0(%rsp)
movl %edx, 0xcc(%rsp)
movq 0xd0(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0xd8(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0xd8(%rsp), %rax
addq $0x18, %rax
movq %rax, 0xb0(%rsp)
movq 0xd8(%rsp), %rax
addq $0x30, %rax
movq %rax, 0xa8(%rsp)
movq 0xd8(%rsp), %rax
addq $0x100, %rax            # imm = 0x100
movq %rax, 0xa0(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x10580
movq 0xd8(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xc0(%rsp), %rdi
callq 0x77430
movq %rax, 0x30(%rsp)
jmp 0xd2af
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdi
callq 0x59910
jmp 0xd2c0
movq 0xb0(%rsp), %rdi
movl 0xcc(%rsp), %eax
movl %eax, %esi
callq 0xfc50
movl $0x1, (%rax)
movq 0xa8(%rsp), %rdi
movl 0xcc(%rsp), %eax
movl %eax, %esi
callq 0xfc50
movl $0x0, (%rax)
leaq 0x50(%rsp), %rdi
leaq 0xcc(%rsp), %rsi
callq 0x105b0
jmp 0xd30c
jmp 0xd30e
leaq 0x50(%rsp), %rdi
callq 0x105e0
movb %al, 0x27(%rsp)
jmp 0xd31e
movb 0x27(%rsp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xd32d
jmp 0xd54a
leaq 0x50(%rsp), %rdi
callq 0x10600
movq %rax, 0x18(%rsp)
jmp 0xd33e
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x40(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x10610
jmp 0xd355
movq 0xa0(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xfce0
jmp 0xd369
movl $0x0, 0x3c(%rsp)
movslq 0x3c(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xc0(%rsp), %rdi
movl 0x40(%rsp), %eax
movl %eax, %esi
callq 0x100e0
movq %rax, %rdi
callq 0xfd50
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
jae 0xd545
movq 0xc0(%rsp), %rdi
movl 0x40(%rsp), %eax
movl %eax, %esi
callq 0x100e0
movq %rax, %rdi
movslq 0x3c(%rsp), %rsi
callq 0xfbc0
movl (%rax), %eax
movl %eax, 0x38(%rsp)
movl 0x40(%rsp), %eax
cmpl 0xe0(%rsp), %eax
jne 0xd3e7
movl 0x38(%rsp), %eax
cmpl 0xe4(%rsp), %eax
je 0xd401
movl 0x40(%rsp), %eax
cmpl 0xe4(%rsp), %eax
jne 0xd423
movl 0x38(%rsp), %eax
cmpl 0xe0(%rsp), %eax
jne 0xd423
jmp 0xd535
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x10620
jmp 0xd55c
movq 0xa8(%rsp), %rdi
movl 0x38(%rsp), %eax
movl %eax, %esi
callq 0xfc50
cmpl $0x0, (%rax)
jge 0xd481
leaq 0x50(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x105b0
jmp 0xd44c
movq 0xa8(%rsp), %rdi
movl 0x40(%rsp), %eax
movl %eax, %esi
callq 0xfc50
movl (%rax), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
movq 0xa8(%rsp), %rdi
movl 0x38(%rsp), %eax
movl %eax, %esi
callq 0xfc50
movl 0xc(%rsp), %ecx
movl %ecx, (%rax)
movq 0xa8(%rsp), %rdi
movl 0x38(%rsp), %eax
movl %eax, %esi
callq 0xfc50
movl (%rax), %eax
movl %eax, 0x8(%rsp)
movq 0xa8(%rsp), %rdi
movl 0x40(%rsp), %eax
movl %eax, %esi
callq 0xfc50
movq %rax, %rcx
movl 0x8(%rsp), %eax
movl (%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0xd533
movq 0xb0(%rsp), %rdi
movl 0x38(%rsp), %eax
movl %eax, %esi
callq 0xfc50
movl (%rax), %eax
movl %eax, (%rsp)
movq 0xb0(%rsp), %rdi
movl 0x40(%rsp), %eax
movl %eax, %esi
callq 0xfc50
movq %rax, %rcx
movl (%rsp), %eax
movl (%rcx), %ecx
addl %ecx, %eax
movl %eax, 0x4(%rsp)
movq 0xb0(%rsp), %rdi
movl 0x38(%rsp), %eax
movl %eax, %esi
callq 0xfc50
movl 0x4(%rsp), %ecx
movl %ecx, (%rax)
movq 0xb8(%rsp), %rdi
movl 0x38(%rsp), %eax
movl %eax, %esi
callq 0x100e0
movq %rax, %rdi
leaq 0x40(%rsp), %rsi
callq 0xfce0
jmp 0xd531
jmp 0xd533
jmp 0xd535
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0xd371
jmp 0xd30e
leaq 0x50(%rsp), %rdi
callq 0x10620
addq $0xe8, %rsp
retq
movq 0x48(%rsp), %rdi
callq 0x9cf0
nopw %cs:(%rax,%rax)