// File: /workspace/github_cpp_makefile_star2_O2/fjamour[P]icentral/src/experiments.cc
// Function: speedup_info_lbcc(graph_t&, int)
void speedup_info_lbcc(graph_t& graph, int num_edges_to_insert)
{
    printf("==========================================================\n");
    printf("Graph: \t\t\t%s\n", graph.graph_name.c_str());
    printf("Graph # nodes: \t\t%d\n", graph.size());
    printf("Graph # edges: \t\t%d\n", graph.edge_set.size());
//    graph_hash_t g;
//    g.fill_graph(graph);
    vector<graph_hash_t> bcc_vec;
    graph.find_bicon_comp(bcc_vec);
    
    //find the bcc with the largest number of nodes
    int lbcc_i = 0;
    int lbcc_s = bcc_vec[0].size() + bcc_vec[0].edge_set.size();
    if(bcc_vec.size() > 1) {
        for(int i = 1; i < bcc_vec.size(); ++i) {
            if(bcc_vec[i].size() + bcc_vec[i].edge_set.size() > lbcc_s) {
                lbcc_s = bcc_vec[i].size() + bcc_vec[i].edge_set.size();
                lbcc_i = i;
            }
        }
    }
    
    int G_s = graph.size() + graph.edge_set.size();
    printf("\n");
    printf("LBCC # nodes:\t\t%d\n", bcc_vec[lbcc_i].size());
    printf("LBCC # edges:\t\t%d\n", bcc_vec[lbcc_i].edge_set.size());
    printf("\n");
    printf("LBCC size fraction:\t%f\n", (double)lbcc_s/G_s);
    printf("LBCC node fraction:\t%f\n", (double)bcc_vec[lbcc_i].size()/graph.size());
    printf("\n");
    
    vector<edge_t> rand_edge_vec;
    printf("Generating edges...\n");
    for(int i = 0; i < num_edges_to_insert; ++i) {
        edge_t rand_edge;
        node_id_t src, dst;
        do {
            src = rand()%graph.size();
            dst = rand()%graph.size();
            rand_edge.first    = src;
            rand_edge.second   = dst;
        } while(!bcc_vec[lbcc_i].has_edge(rand_edge.first, rand_edge.second) ||
                find(rand_edge_vec.begin(), rand_edge_vec.end(), rand_edge) != rand_edge_vec.end());
        rand_edge_vec.push_back(rand_edge);
    }
    
    printf("\n");
    vector<int> d0_vec, d1_vec, d2_vec;
    vector<double> d0_frac_vec;
    for(int i = 0; i < rand_edge_vec.size(); ++i) {
        node_id_t src, dst;
        src = rand_edge_vec[i].first;
        dst = rand_edge_vec[i].second;
        int d0, d1, d2;
        bcc_vec[lbcc_i].find_pruning_counts_exp(src, dst, d0, d1, d2);
        d0_vec.push_back(d0);
        d1_vec.push_back(d1);
        d2_vec.push_back(d2);
        d0_frac_vec.push_back((double)d0/bcc_vec[lbcc_i].size());
        
        printf("d0:[%*d][%f]   d1:[%*d]    d2:[%*d] -- Edge(%d, %d)\n",
                8,
                d0, (double)d0/bcc_vec[lbcc_i].size(),
                8,
                d1,
                8,
                d2,
                rand_edge_vec[i].first,
                rand_edge_vec[i].second);
    }
    printf("\n");
    
    double min, max, median;
    double mean, stddev;
    simple_stats(d0_frac_vec, mean, stddev, median, min, max);
    printf("\n");
    printf("Mean[%f] Stddev[%f] Median[%f] Min[%f] Max[%f]\n",
        mean, stddev, median, min, max);
    
    
    int lbcc_n                 = bcc_vec[lbcc_i].size();
    int G_n                    = graph.size();
    double iter_frac_median    = 1.0 - median;
    double iter_frac_mean      = 1.0 - mean;
    double iter_frac_min       = 1.0 - min;
    double iter_frac_max       = 1.0 - max;
    double iter_frac_stddev    = 1.0 - stddev;
    
    
    double est_median_speedup = 1.0/(((double)lbcc_n/G_n) * iter_frac_median * ((double)lbcc_s/G_s));
    double est_mean_speedup   = 1.0/(((double)lbcc_n/G_n) * iter_frac_mean * ((double)lbcc_s/G_s));
    double est_min_speedup    = 1.0/(((double)lbcc_n/G_n) * iter_frac_min * ((double)lbcc_s/G_s));
    double est_max_speedup    = 1.0/(((double)lbcc_n/G_n) * iter_frac_max * ((double)lbcc_s/G_s));
    double est_stddev_speedup = 1.0/(((double)lbcc_n/G_n) * iter_frac_stddev * ((double)lbcc_s/G_s));
    
    //estimate of the time it takes to do my long delta iteration
    //to the time it takes the normal iteration
    double long_iter_perc;
    long_iter_perc = 120.0;
    printf("\n");
    printf("Estimate ideal speedups: (delta iter to orig iter [%f])\n",
        long_iter_perc);
    printf("Mean[%f] Stddev[%f] Median[%f] Min[%f] Max[%f]\n",
        est_mean_speedup * (100/long_iter_perc),
        est_stddev_speedup * (100/long_iter_perc),
        est_median_speedup * (100/long_iter_perc),
        est_min_speedup * (100/long_iter_perc),
        est_max_speedup * (100/long_iter_perc));
    
    long_iter_perc = 100.0;
    printf("Estimate ideal speedups: (delta iter to orig iter [%f])\n",
        long_iter_perc);
    printf("Mean[%f] Stddev[%f] Median[%f] Min[%f] Max[%f]\n",
        est_mean_speedup * (100/long_iter_perc),
        est_stddev_speedup * (100/long_iter_perc),
        est_median_speedup * (100/long_iter_perc),
        est_min_speedup * (100/long_iter_perc),
        est_max_speedup * (100/long_iter_perc));
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movl %esi, (%rsp)
movq %rdi, %rbx
leaq 0x13c29(%rip), %rdi     # 0x28b00
callq 0x2360
movq 0x108(%rbx), %rsi
leaq 0x13326(%rip), %rdi     # 0x28210
xorl %eax, %eax
callq 0x2030
movq %rbx, %rdi
callq 0x18d3c
leaq 0x1331e(%rip), %rdi     # 0x2821e
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
movq 0x58(%rbx), %rsi
leaq 0x1331e(%rip), %rdi     # 0x28233
xorl %eax, %eax
callq 0x2030
xorpd %xmm0, %xmm0
leaq 0x20(%rsp), %rsi
movapd %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
movq %rbx, %rdi
callq 0x10aca
movq 0x20(%rsp), %rdi
callq 0x176f6
movq %rax, %r15
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rcx
addl 0x58(%rdi), %r15d
movq %rcx, %rax
subq %rdi, %rax
movl $0x2a8, %r12d           # imm = 0x2A8
cqto
idivq %r12
xorl %r14d, %r14d
cmpq $0x2, %rax
jb 0x14fca
pushq $0x1
popq %r13
movl $0x2a8, %ebp            # imm = 0x2A8
subq %rdi, %rcx
movq %rcx, %rax
cqto
idivq %r12
cmpq %r13, %rax
jbe 0x14fc7
addq %rbp, %rdi
callq 0x176f6
movq 0x20(%rsp), %rdi
addq 0x58(%rdi,%rbp), %rax
movslq %r15d, %rcx
cmpq %rcx, %rax
jbe 0x14fb6
addq %rbp, %rdi
callq 0x176f6
movq %rax, %r15
movq 0x20(%rsp), %rdi
addl 0x58(%rdi,%rbp), %r15d
movl %r13d, %r14d
incq %r13
movq 0x28(%rsp), %rcx
addq $0x2a8, %rbp            # imm = 0x2A8
jmp 0x14f74
movslq %r14d, %r14
movq %rbx, %rdi
callq 0x18d3c
movq %rax, %r12
movq 0x58(%rbx), %r13
pushq $0xa
popq %rdi
callq 0x2300
imulq $0x2a8, %r14, %r14      # imm = 0x2A8
movq 0x20(%rsp), %rdi
addq %r14, %rdi
callq 0x176f6
addl %r12d, %r13d
leaq 0x13a6c(%rip), %rdi     # 0x28a6b
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
movq 0x20(%rsp), %rax
movq 0x58(%rax,%r14), %rsi
leaq 0x13a65(%rip), %rdi     # 0x28a7f
xorl %eax, %eax
callq 0x2030
pushq $0xa
popq %rdi
callq 0x2300
cvtsi2sd %r15d, %xmm0
cvtsi2sd %r13d, %xmm1
divsd %xmm1, %xmm0
leaq 0x1382c(%rip), %rdi     # 0x2886a
movsd %xmm0, 0x38(%rsp)
movb $0x1, %al
callq 0x2030
movq 0x20(%rsp), %rdi
addq %r14, %rdi
callq 0x176f6
movq %rax, %r15
movq %rbx, %rdi
callq 0x18d3c
movq %r15, %xmm1
movq 0x13180(%rip), %xmm3    # 0x281f0
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
movapd 0x13184(%rip), %xmm2    # 0x28200
subpd %xmm2, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
leaq 0x137d2(%rip), %rdi     # 0x28882
movb $0x1, %al
callq 0x2030
pushq $0xa
popq %rdi
callq 0x2300
xorpd %xmm0, %xmm0
leaq 0x50(%rsp), %rax
movapd %xmm0, (%rax)
andq $0x0, 0x10(%rax)
leaq 0x13a14(%rip), %rdi     # 0x28aec
callq 0x2360
xorl %ecx, %ecx
movl (%rsp), %eax
testl %eax, %eax
cmovlel %ecx, %eax
movl %eax, (%rsp)
leaq 0x80(%rsp), %r12
cmpl (%rsp), %ecx
je 0x1519a
movq %rcx, 0x8(%rsp)
andq $0x0, 0x80(%rsp)
callq 0x2070
movl %eax, %r13d
movq %rbx, %rdi
callq 0x18d3c
movq %rax, %rbp
callq 0x2070
movl %eax, %r15d
movq %rbx, %rdi
callq 0x18d3c
movq %rax, %rcx
movslq %r15d, %rsi
movslq %r13d, %rax
xorl %edx, %edx
divq %rbp
movq %rdx, %r8
movq %rsi, %rax
xorl %edx, %edx
divq %rcx
movl %r8d, 0x80(%rsp)
movl %edx, 0x84(%rsp)
movq 0x20(%rsp), %rdi
addq %r14, %rdi
movl %r8d, %esi
callq 0x177f8
testb %al, %al
je 0x15109
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq %r12, %rdx
callq 0x1658d
cmpq 0x58(%rsp), %rax
jne 0x15109
leaq 0x50(%rsp), %rdi
movq %r12, %rsi
callq 0x117e2
movq 0x8(%rsp), %rcx
incl %ecx
jmp 0x150f2
pushq $0xa
popq %rdi
callq 0x2300
xorpd %xmm0, %xmm0
leaq 0x80(%rsp), %rax
andq $0x0, 0x10(%rax)
leaq 0xe0(%rsp), %rcx
andq $0x0, 0x10(%rcx)
movapd %xmm0, (%rax)
movapd %xmm0, (%rcx)
leaq 0xc0(%rsp), %rax
movapd %xmm0, (%rax)
andq $0x0, 0x10(%rax)
leaq 0xa0(%rsp), %rax
movapd %xmm0, (%rax)
andq $0x0, 0x10(%rax)
xorl %r12d, %r12d
leaq 0x18(%rsp), %r13
leaq 0x40(%rsp), %rbp
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
jbe 0x1534d
movl (%rax,%r12,8), %esi
movl 0x4(%rax,%r12,8), %edx
movq 0x20(%rsp), %rdi
addq %r14, %rdi
movq %r13, %rcx
movq %rbp, %r8
leaq 0x10(%rsp), %r9
callq 0x17dec
leaq 0x80(%rsp), %rdi
movq %r13, %rsi
callq 0xf140
leaq 0xe0(%rsp), %rdi
movq %rbp, %rsi
callq 0xf140
leaq 0xc0(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xf140
movl 0x18(%rsp), %r15d
movq 0x20(%rsp), %rdi
addq %r14, %rdi
callq 0x176f6
cvtsi2sd %r15d, %xmm0
movq %rax, %xmm1
punpckldq 0x12f68(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x12f70(%rip), %xmm1    # 0x28200
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movsd %xmm0, 0x48(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x16dca
movl 0x18(%rsp), %r15d
movq 0x20(%rsp), %rdi
addq %r14, %rdi
callq 0x176f6
cvtsi2sd %r15d, %xmm0
movq %rax, %xmm1
punpckldq 0x12f14(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x12f1c(%rip), %xmm1    # 0x28200
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movl 0x40(%rsp), %r8d
movl 0x10(%rsp), %eax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rax
movl (%rax,%r12,8), %r11d
movq %rbp, %r10
movq %r13, %rbp
movl 0x4(%rax,%r12,8), %r13d
subq $0x8, %rsp
leaq 0x13579(%rip), %rdi     # 0x2889a
pushq $0x8
popq %rcx
movl %ecx, %esi
movl %r15d, %edx
movl %ecx, %r9d
movb $0x1, %al
pushq %r13
movq %rbp, %r13
movq %r10, %rbp
pushq %r11
pushq 0x20(%rsp)
callq 0x2030
addq $0x20, %rsp
incq %r12
jmp 0x151f7
pushq $0xa
popq %rdi
callq 0x2300
leaq 0x100(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x163c6
leaq 0x100(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x78(%rsp), %rdx
leaq 0x40(%rsp), %rcx
leaq 0x48(%rsp), %r8
leaq 0x18(%rsp), %r9
callq 0x26ad4
leaq 0x100(%rsp), %rdi
callq 0x5754
pushq $0xa
popq %rdi
callq 0x2300
movsd 0x10(%rsp), %xmm0
movsd 0x78(%rsp), %xmm1
movsd 0x40(%rsp), %xmm2
movq 0x48(%rsp), %xmm3
movsd 0x18(%rsp), %xmm4
leaq 0x13505(%rip), %rdi     # 0x288cf
movb $0x5, %al
callq 0x2030
addq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x176f6
movq %rax, %r14
movq %rbx, %rdi
callq 0x18d3c
movsd 0x12c4f(%rip), %xmm0    # 0x28040
movapd %xmm0, %xmm1
subsd 0x40(%rsp), %xmm1
movapd %xmm0, %xmm2
subsd 0x10(%rsp), %xmm2
movapd %xmm0, %xmm3
subsd 0x48(%rsp), %xmm3
movapd %xmm0, %xmm4
subsd 0x18(%rsp), %xmm4
movapd %xmm0, %xmm5
movapd %xmm0, %xmm7
subsd 0x78(%rsp), %xmm5
cvtsi2sd %r14d, %xmm0
cvtsi2sd %eax, %xmm6
divsd %xmm6, %xmm0
mulsd %xmm0, %xmm1
movsd 0x38(%rsp), %xmm6
mulsd %xmm6, %xmm1
movapd %xmm7, %xmm8
divsd %xmm1, %xmm8
movsd %xmm8, 0x8(%rsp)
mulsd %xmm0, %xmm2
mulsd %xmm6, %xmm2
movapd %xmm7, %xmm1
divsd %xmm2, %xmm1
movsd %xmm1, (%rsp)
mulsd %xmm0, %xmm3
mulsd %xmm6, %xmm3
movapd %xmm7, %xmm1
divsd %xmm3, %xmm1
movsd %xmm1, 0x70(%rsp)
mulsd %xmm0, %xmm4
mulsd %xmm6, %xmm4
movapd %xmm7, %xmm1
divsd %xmm4, %xmm1
movsd %xmm1, 0x68(%rsp)
mulsd %xmm5, %xmm0
mulsd %xmm6, %xmm0
divsd %xmm0, %xmm7
movsd %xmm7, 0x38(%rsp)
pushq $0xa
popq %rdi
callq 0x2300
leaq 0x1344a(%rip), %rbx     # 0x288ff
movsd 0x12d0b(%rip), %xmm0    # 0x281c8
movq %rbx, %rdi
movb $0x1, %al
callq 0x2030
movsd 0x12d01(%rip), %xmm4    # 0x281d0
movsd (%rsp), %xmm0
mulsd %xmm4, %xmm0
movsd 0x38(%rsp), %xmm1
mulsd %xmm4, %xmm1
movsd 0x8(%rsp), %xmm2
mulsd %xmm4, %xmm2
movsd 0x70(%rsp), %xmm3
mulsd %xmm4, %xmm3
mulsd 0x68(%rsp), %xmm4
leaq 0x133cc(%rip), %r14     # 0x288cf
movq %r14, %rdi
movb $0x5, %al
callq 0x2030
movsd 0x12c9b(%rip), %xmm0    # 0x281b0
movq %rbx, %rdi
movb $0x1, %al
callq 0x2030
movq %r14, %rdi
movsd (%rsp), %xmm0
movsd 0x38(%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
movsd 0x70(%rsp), %xmm3
movsd 0x68(%rsp), %xmm4
movb $0x5, %al
callq 0x2030
leaq 0xa0(%rsp), %rdi
callq 0x5754
leaq 0xc0(%rsp), %rdi
callq 0x5720
leaq 0xe0(%rsp), %rdi
callq 0x5720
leaq 0x80(%rsp), %rdi
callq 0x5720
leaq 0x50(%rsp), %rdi
callq 0x16656
leaq 0x20(%rsp), %rdi
callq 0x11800
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x155c7
jmp 0x155c7
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
callq 0x5754
jmp 0x155ca
jmp 0x155c7
jmp 0x155be
jmp 0x155be
jmp 0x155be
movq %rax, %rbx
jmp 0x1560f
jmp 0x15602
jmp 0x155c7
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x5754
leaq 0xc0(%rsp), %rdi
callq 0x5720
leaq 0xe0(%rsp), %rdi
callq 0x5720
leaq 0x80(%rsp), %rdi
callq 0x5720
jmp 0x15605
jmp 0x15602
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x16656
leaq 0x20(%rsp), %rdi
callq 0x11800
movq %rbx, %rdi
callq 0x23d0