// File: /workspace/github_cpp_makefile_star2_O1/fjamour[P]icentral/src/unit_tests.h
// Function: timing__Update_BC_mem_graph(graph_t&, std::vector<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>&, int, int, bool, double)
void timing__Update_BC_mem_graph(
            graph_t&        graph,
            vector<edge_t>& edge_vec,
            int             num_sources,
            int             algo_flag,
            bool            do_brandes = true,
            double          brandes_time = 0.0
        )
{
    timer           tm;
    vector<double>  BC_vec;
    vector<double>  tm_vec;
    vector<double>  speedup_vec;
    
    
    if(do_brandes) {
        tm.start();
        //fast_brandes_BC(graph, BC_vec);
        BC_vec = brandes_bc(graph);
        tm.stop();
        brandes_time = tm.interval();
    }
    
    
    
    vector<iter_info_t> iter_info_vec;
    component_t comp;
    comp.comp_type = GRAPH;
    comp.subgraph.fill_graph(graph);
    for (node_id_t s = 0; s < graph.size(); ++s) {
        iter_info_t iter_info;
        iter_info.init_all(graph.size());
        BBFS(iter_info, comp, s);
        iter_info_vec.push_back(iter_info);
    }
           
    printf("Graph[%s]  V[%d]  E[%d]  Brandes_tm[%.2f]\n",
            graph.graph_name.c_str(),
            graph.size(),
            graph.edge_set.size(),
            brandes_time);
    for(int i = 0; i < edge_vec.size(); ++i) {
        edge_t e = edge_vec[i];
        tm.start();
        Update_BC_mem(BC_vec, graph, GRAPH, e, iter_info_vec);
        tm.stop();
        double e_time = tm.interval();
        tm_vec.push_back(e_time);
        double e_speedup = brandes_time/e_time;
        speedup_vec.push_back(e_speedup);
        
        printf("e(%-6d,%-6d)  tm[%.2f]  sup[%.2f]\n",
                e.first,
                e.second,
                e_time,
                e_speedup);
    }
    
    double tm_mean, tm_stddev, tm_median, tm_min, tm_max;
    double su_mean, su_stddev, su_median, su_min, su_max;
    simple_stats(tm_vec, tm_mean, tm_stddev, tm_median, tm_min, tm_max);
    simple_stats(speedup_vec, su_mean, su_stddev, su_median, su_min, su_max);
    
    printf("Avg.tm[%.2f]  Avg.sup[%.2f]\n\n", tm_mean, su_mean);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x468, %rsp            # imm = 0x468
movsd %xmm0, 0x8(%rsp)
movq %rsi, %r14
movq %rdi, %r15
xorl %eax, %eax
movq %rax, 0x60(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x50(%rsp)
movq %rax, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movq %rax, 0x20(%rsp)
movapd %xmm0, 0x10(%rsp)
testl %r8d, %r8d
je 0x21129
leaq 0xd8(%rsp), %rdi
xorl %esi, %esi
callq 0x2360
leaq 0x230(%rsp), %rdi
movq %r15, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0xaa17
movq 0x50(%rsp), %rdi
movq 0x60(%rsp), %rsi
movaps 0x230(%rsp), %xmm0
movaps %xmm0, 0x50(%rsp)
movq 0x240(%rsp), %rax
movq %rax, 0x60(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x230(%rsp)
movq $0x0, 0x240(%rsp)
testq %rdi, %rdi
je 0x210ba
subq %rdi, %rsi
callq 0x2250
movq 0x230(%rsp), %rdi
testq %rdi, %rdi
je 0x210d7
movq 0x240(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0xe8(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2360
xorps %xmm0, %xmm0
cvtsi2sdq -0x10(%rbx), %xmm0
cvtsi2sdq -0x8(%rbx), %xmm1
movsd 0x100a0(%rip), %xmm2    # 0x311a0
divsd %xmm2, %xmm1
cvtsi2sdq (%rbx), %xmm3
cvtsi2sdq 0x8(%rbx), %xmm4
addsd %xmm0, %xmm1
divsd %xmm2, %xmm4
addsd %xmm3, %xmm4
subsd %xmm1, %xmm4
movsd %xmm4, 0x8(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
leaq 0x230(%rsp), %rdi
callq 0x6220
leaq 0x428(%rsp), %rdi
leaq 0x68(%rsp), %rax
leaq 0xd0(%rsp), %r10
leaq 0xc8(%rsp), %rdx
leaq 0x118(%rsp), %rcx
movq %rsp, %r8
leaq 0xc0(%rsp), %r9
movl $0xa, %esi
pushq %rax
pushq %r10
callq 0x67d6
addq $0x10, %rsp
movq %r14, 0x88(%rsp)
leaq 0x230(%rsp), %rdi
movl $0x2, 0x228(%rdi)
movq %r15, %rsi
callq 0x2f63a
xorl %ebx, %ebx
leaq 0x210(%rsp), %r14
leaq 0x118(%rsp), %r12
leaq 0x230(%rsp), %r13
leaq 0x70(%rsp), %rbp
movq %r15, %rdi
callq 0x1e160
movl %ebx, %ecx
cmpq %rcx, %rax
jbe 0x21245
movq $0x0, 0x200(%rsp)
movl $0x0, 0x208(%rsp)
movl $0xe4, %edx
movq %r12, %rdi
xorl %esi, %esi
callq 0x2110
xorpd %xmm0, %xmm0
movupd %xmm0, (%r14)
movupd %xmm0, 0x10(%r14)
movq %r15, %rdi
callq 0x1e160
movq %r12, %rdi
movq %rax, %rsi
callq 0x1fba8
movq %r12, %rdi
movq %r13, %rsi
movl %ebx, %edx
callq 0x4154
movq %rbp, %rdi
movq %r12, %rsi
callq 0x2437c
movq %r12, %rdi
callq 0x5c8a
incl %ebx
jmp 0x211ca
movq 0x108(%r15), %rbx
movq %r15, %rdi
callq 0x1e160
movq 0x58(%r15), %rcx
leaq 0x10a70(%rip), %rdi     # 0x31ccf
movq %rbx, %rsi
movq %rax, %rdx
movsd 0x8(%rsp), %xmm0
movb $0x1, %al
callq 0x2030
movq 0x88(%rsp), %r14
movq (%r14), %rax
cmpq %rax, 0x8(%r14)
je 0x213cd
xorl %ebx, %ebx
leaq 0x10a6a(%rip), %r12     # 0x31cfa
movl (%rax,%rbx,8), %r13d
movl 0x4(%rax,%rbx,8), %ebp
leaq 0xd8(%rsp), %rdi
xorl %esi, %esi
callq 0x2360
movq %rbp, %rcx
shlq $0x20, %rcx
orq %r13, %rcx
leaq 0x50(%rsp), %rdi
movq %r15, %rsi
movl $0x2, %edx
leaq 0x70(%rsp), %r8
callq 0x7c98
leaq 0xe8(%rsp), %rdi
xorl %esi, %esi
callq 0x2360
xorps %xmm1, %xmm1
cvtsi2sdq 0xd8(%rsp), %xmm1
xorps %xmm2, %xmm2
cvtsi2sdq 0xe0(%rsp), %xmm2
movsd 0xfea7(%rip), %xmm4     # 0x311a0
divsd %xmm4, %xmm2
cvtsi2sdq 0xe8(%rsp), %xmm3
xorps %xmm0, %xmm0
cvtsi2sdq 0xf0(%rsp), %xmm0
addsd %xmm1, %xmm2
divsd %xmm4, %xmm0
addsd %xmm3, %xmm0
subsd %xmm2, %xmm0
movsd %xmm0, 0x118(%rsp)
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x21348
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x38(%rsp)
jmp 0x2135a
leaq 0x30(%rsp), %rdi
leaq 0x118(%rsp), %rdx
callq 0x1b82c
movsd 0x8(%rsp), %xmm0
divsd 0x118(%rsp), %xmm0
movsd %xmm0, (%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x21389
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x21396
leaq 0x10(%rsp), %rdi
movq %rsp, %rdx
callq 0x1b82c
movsd 0x118(%rsp), %xmm0
movsd (%rsp), %xmm1
movq %r12, %rdi
movl %r13d, %esi
movl %ebp, %edx
movb $0x2, %al
callq 0x2030
incq %rbx
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rbx, %rcx
ja 0x21290
leaq 0xa8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x1b35e
leaq 0xa8(%rsp), %rdi
leaq 0x118(%rsp), %rsi
movq %rsp, %rdx
leaq 0xd0(%rsp), %rcx
leaq 0xc8(%rsp), %r8
leaq 0xc0(%rsp), %r9
callq 0x2fae4
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x2142c
movq 0xb8(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0x90(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1b35e
leaq 0x90(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x110(%rsp), %rdx
leaq 0x108(%rsp), %rcx
leaq 0x100(%rsp), %r8
leaq 0xf8(%rsp), %r9
callq 0x2fae4
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x2148d
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movsd 0x118(%rsp), %xmm0
movsd 0x68(%rsp), %xmm1
leaq 0x1087a(%rip), %rdi     # 0x31d1d
movb $0x2, %al
callq 0x2030
leaq 0x428(%rsp), %rdi
callq 0x68e6
leaq 0x230(%rsp), %rdi
callq 0x6460
leaq 0x70(%rsp), %rdi
callq 0x243ac
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x214e5
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x214fc
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x21513
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
addq $0x468, %rsp            # imm = 0x468
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x215b6
movq %rax, %r14
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x21592
movq 0xa0(%rsp), %rsi
jmp 0x2155f
movq %rax, %r14
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x21592
movq 0xb8(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
jmp 0x21592
movq %rax, %r14
jmp 0x2159f
movq %rax, %r14
jmp 0x215ac
jmp 0x2157d
jmp 0x2157d
jmp 0x2157d
jmp 0x2157d
jmp 0x2157d
movq %rax, %r14
jmp 0x21592
movq %rax, %r14
leaq 0x118(%rsp), %rdi
callq 0x5c8a
leaq 0x428(%rsp), %rdi
callq 0x68e6
leaq 0x230(%rsp), %rdi
callq 0x6460
leaq 0x70(%rsp), %rdi
callq 0x243ac
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x215cd
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x215e4
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x215fb
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq %r14, %rdi
callq 0x23b0