// File: fjamour[P]icentral/src/_bc.cc
// Function: iCentral_iter(std::vector<double, std::allocator<double>>&, component_t&, unsigned int, std::pair<unsigned int, unsigned int>, iter_info_t&, int, bool, operation_t)
void iCentral_iter(
        vector<double>& dBC_vec,    // delta BC of vertices
        component_t&    comp,       // component could be BCC, MUC, or just a graph
        node_id_t       s,          // source of the iteration
        edge_t          e,          // inserted edge
        iter_info_t&    iter_info,  //TODO to be used later?
        int             dd,
        bool            use_d_1,
        operation_t      op
        )
{
    iter_info.init_all(comp.subgraph.size());
    if(dd > 0) {
        node_id_t tmp = e.first;
        e.first = e.second;
        e.second = tmp;
    }
    dd = abs(dd);
    if(op == INSERTION) {
        //NOTE: the d=1 optimization has a bug, however it was used in
        //      some of the performance results    
        //if(dd == 1 && use_d_1) {
        //    iter_info.init_new(comp.subgraph.size());//initializes the data structures required for BBFS_RBFS_d1
        //    BBFS_RBFS_d1(dBC_vec, iter_info, comp, s, e);
        //} else {
            BBFS(iter_info, comp, s);
            RBFS(dBC_vec, comp, s, iter_info, false, true);
            partial_BBFS_addition(iter_info, comp, s, e);
            RBFS(dBC_vec, comp, s, iter_info, true, false);
        //}
    } else if(op == DELETION) {
            BBFS(iter_info, comp, s);
            RBFS(dBC_vec, comp, s, iter_info, false, true);
            partial_BBFS_deletion(iter_info, comp, s, e);
            RBFS(dBC_vec, comp, s, iter_info, true, false);
    }

}

// Assembly:
subq $0x58, %rsp
movl 0x68(%rsp), %eax
movb 0x60(%rsp), %al
movq %rcx, 0x50(%rsp)
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movl %edx, 0x3c(%rsp)
movq %r8, 0x30(%rsp)
movl %r9d, 0x2c(%rsp)
andb $0x1, %al
movb %al, 0x2b(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rdi
callq 0x77430
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x59910
cmpl $0x0, 0x2c(%rsp)
jle 0xb51f
movl 0x50(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x54(%rsp), %eax
movl %eax, 0x50(%rsp)
movl 0x24(%rsp), %eax
movl %eax, 0x54(%rsp)
movl 0x2c(%rsp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x68(%rsp)
jne 0xb5b1
movq 0x30(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl 0x3c(%rsp), %edx
callq 0xb790
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl 0x3c(%rsp), %edx
movq 0x30(%rsp), %rcx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xba90
movq 0x30(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl 0x3c(%rsp), %edx
movq 0x50(%rsp), %rax
movq %rax, 0x1c(%rsp)
movq 0x1c(%rsp), %rcx
callq 0xc680
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl 0x3c(%rsp), %edx
movq 0x30(%rsp), %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0xba90
jmp 0xb631
cmpl $0x1, 0x68(%rsp)
jne 0xb62f
movq 0x30(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl 0x3c(%rsp), %edx
callq 0xb790
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl 0x3c(%rsp), %edx
movq 0x30(%rsp), %rcx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xba90
movq 0x30(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl 0x3c(%rsp), %edx
movq 0x50(%rsp), %rax
movq %rax, 0x14(%rsp)
movq 0x14(%rsp), %rcx
callq 0xd200
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl 0x3c(%rsp), %edx
movq 0x30(%rsp), %rcx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0xba90
jmp 0xb631
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)