// File: fjamour[P]icentral/src/unit_tests.h
// Function: test__Update_BC()
bool test__Update_BC()
{
    bool passed = false;
    printf("Testing [Update_BC] ...\t");
    vector<double> BC_vec;
    graph_t g;
    edge_t e = make_pair(100, 3455);
    
    g.read_graph(string("Erdos02.lcc.net"));
    //fill_test_graph(g);
    
    e = *g.edge_set.begin();
    g.remove_edge(e.first, e.second);
    //printf("(%d, %d)\n", e.first, e.second);
       
    fast_brandes_BC(g, BC_vec);
    Update_BC(BC_vec, g, BCC, e);
    
    g.insert_edge(e.first, e.second);
    vector<double> ref_BC_vec = brandes_bc(g);
    passed = true;
    for(node_id_t v = 0; v < BC_vec.size(); ++v) {
        if(abs((BC_vec[v] - ref_BC_vec[v])) > EPS) {
            passed = false;
            printf("(%d) --\t[%f]\t\t[%f]\n", v, BC_vec[v], ref_BC_vec[v]);
        }
        //printf("(%d) --\t[%f]\t\t[%f]\n", v, BC_vec[v], ref_BC_vec[v]);
    }
    if(passed) {
        printf("PASSED\n");
    } else {
        printf("FAILED\n");
    }
    return passed;
}

// Assembly:
subq $0x208, %rsp            # imm = 0x208
movb $0x0, 0x207(%rsp)
leaq 0x219ec(%rip), %rdi     # 0x7bd42
xorl %eax, %eax
callq 0x9040
leaq 0x1e8(%rsp), %rdi
callq 0xfa00
leaq 0xc0(%rsp), %rdi
callq 0x5eda0
jmp 0x5a379
movl $0x64, 0xa0(%rsp)
movl $0xd7f, 0x9c(%rsp) # imm = 0xD7F
leaq 0xa0(%rsp), %rdi
leaq 0x9c(%rsp), %rsi
callq 0x5f060
movq %rax, 0x38(%rsp)
jmp 0x5a3ab
movq 0x38(%rsp), %rax
movq %rax, 0xa4(%rsp)
leaq 0xac(%rsp), %rdi
leaq 0xa4(%rsp), %rsi
callq 0x5f090
jmp 0x5a3cf
leaq 0x77(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x9d00
movq 0x30(%rsp), %rdx
leaq 0x21920(%rip), %rsi     # 0x7bd0a
leaq 0x78(%rsp), %rdi
callq 0x5ef00
jmp 0x5a3f6
leaq 0xc0(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x56b50
jmp 0x5a40a
leaq 0x78(%rsp), %rdi
callq 0x9410
leaq 0x77(%rsp), %rdi
callq 0x97d0
leaq 0xf0(%rsp), %rdi
callq 0x420d0
movq %rax, 0x68(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x42100
movq %rax, %rsi
leaq 0xac(%rsp), %rdi
callq 0x41e30
jmp 0x5a44c
movl 0xac(%rsp), %esi
movl 0xb0(%rsp), %edx
leaq 0xc0(%rsp), %rdi
callq 0x56850
jmp 0x5a469
leaq 0xc0(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0xa2d0
jmp 0x5a480
movq 0xac(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rcx
leaq 0x1e8(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
movl $0x1, %r8d
xorl %r9d, %r9d
movl %r9d, %edx
callq 0xa4e0
jmp 0x5a4b5
movl 0xac(%rsp), %esi
movl 0xb0(%rsp), %edx
leaq 0xc0(%rsp), %rdi
callq 0x56720
jmp 0x5a4d2
leaq 0x48(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x28720
jmp 0x5a4eb
movb $0x1, 0x207(%rsp)
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
movq %rax, 0x28(%rsp)
leaq 0x1e8(%rsp), %rdi
callq 0xfa10
movq %rax, %rcx
movq 0x28(%rsp), %rax
cmpq %rcx, %rax
jae 0x5a685
movl 0x44(%rsp), %eax
movl %eax, %esi
leaq 0x1e8(%rsp), %rdi
callq 0xfa30
movsd (%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
movl 0x44(%rsp), %eax
movl %eax, %esi
leaq 0x48(%rsp), %rdi
callq 0xfa30
movsd 0x18(%rsp), %xmm0
movsd (%rax), %xmm1
subsd %xmm1, %xmm0
callq 0x5f0c0
movsd %xmm0, 0x20(%rsp)
jmp 0x5a56a
movsd 0x20(%rsp), %xmm0
movsd 0x21760(%rip), %xmm1    # 0x7bcd8
ucomisd %xmm1, %xmm0
jbe 0x5a673
movb $0x0, 0x207(%rsp)
movl 0x44(%rsp), %eax
movl %eax, 0xc(%rsp)
movl %eax, %esi
leaq 0x1e8(%rsp), %rdi
callq 0xfa30
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0x44(%rsp), %eax
movl %eax, %esi
leaq 0x48(%rsp), %rdi
callq 0xfa30
movl 0xc(%rsp), %esi
movsd 0x10(%rsp), %xmm0
movsd (%rax), %xmm1
leaq 0x2178b(%rip), %rdi     # 0x7bd5b
movb $0x2, %al
callq 0x9040
jmp 0x5a5d9
jmp 0x5a673
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0x5a6fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0x5a6f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0x5a644
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x9410
leaq 0x77(%rsp), %rdi
callq 0x97d0
jmp 0x5a6f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
leaq 0x48(%rsp), %rdi
callq 0xfa50
jmp 0x5a6f0
jmp 0x5a675
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0x5a4fb
testb $0x1, 0x207(%rsp)
je 0x5a6a1
leaq 0x21684(%rip), %rdi     # 0x7bd1a
xorl %eax, %eax
callq 0x9040
jmp 0x5a69f
jmp 0x5a6b3
leaq 0x2167a(%rip), %rdi     # 0x7bd22
xorl %eax, %eax
callq 0x9040
jmp 0x5a6b1
jmp 0x5a6b3
movb 0x207(%rsp), %al
movb %al, 0xb(%rsp)
leaq 0x48(%rsp), %rdi
callq 0xfa50
leaq 0xc0(%rsp), %rdi
callq 0x5efc0
leaq 0x1e8(%rsp), %rdi
callq 0xfa50
movb 0xb(%rsp), %al
andb $0x1, %al
addq $0x208, %rsp            # imm = 0x208
retq
leaq 0xc0(%rsp), %rdi
callq 0x5efc0
leaq 0x1e8(%rsp), %rdi
callq 0xfa50
movq 0xb8(%rsp), %rdi
callq 0x9cf0
nopw (%rax,%rax)