// File: /workspace/github_cpp_makefile_star2_O1/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, 0x28(%rsp)
movq %rdi, %rbx
leaq 0x18037(%rip), %rdi     # 0x31b40
callq 0x2350
movq 0x108(%rbx), %rsi
leaq 0x17734(%rip), %rdi     # 0x31250
xorl %eax, %eax
callq 0x2030
movq %rbx, %rdi
callq 0x1e160
leaq 0x1772c(%rip), %rdi     # 0x3125e
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
movq 0x58(%rbx), %rsi
leaq 0x1772c(%rip), %rdi     # 0x31273
xorl %eax, %eax
callq 0x2030
xorpd %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movapd %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %rbx, %rdi
callq 0x147a2
movq 0x10(%rsp), %rdi
callq 0x1c62c
movq %rax, %r15
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
addl 0x58(%rax), %r15d
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x303030303030303, %r14 # imm = 0xFCFCFCFCFCFCFCFD
imulq %r14, %rcx
cmpq $0x2, %rcx
jb 0x19c29
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rax
subq %rdi, %rax
sarq $0x3, %rax
imulq %r14, %rax
xorl %r13d, %r13d
cmpq $0x2, %rax
jb 0x19c2c
movl $0x1, %r12d
movl $0x2a8, %ebp            # imm = 0x2A8
addq %rbp, %rdi
callq 0x1c62c
movq 0x10(%rsp), %rdi
addq 0x58(%rdi,%rbp), %rax
movslq %r15d, %rcx
cmpq %rcx, %rax
jbe 0x19c00
addq %rbp, %rdi
callq 0x1c62c
movq %rax, %r15
movq 0x10(%rsp), %rax
addl 0x58(%rax,%rbp), %r15d
movl %r12d, %r13d
incq %r12
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rax
subq %rdi, %rax
sarq $0x3, %rax
imulq %r14, %rax
addq $0x2a8, %rbp            # imm = 0x2A8
cmpq %r12, %rax
ja 0x19bce
movslq %r13d, %r13
jmp 0x19c2c
xorl %r13d, %r13d
movq %rbx, %rdi
callq 0x1e160
movq %rax, %r12
movq 0x58(%rbx), %rbp
movl $0xa, %edi
callq 0x22f0
imulq $0x2a8, %r13, %r14      # imm = 0x2A8
movq 0x10(%rsp), %rdi
addq %r14, %rdi
callq 0x1c62c
addl %r12d, %ebp
leaq 0x17e48(%rip), %rdi     # 0x31aab
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
movq 0x10(%rsp), %rax
movq 0x58(%rax,%r14), %rsi
leaq 0x17e41(%rip), %rdi     # 0x31abf
xorl %eax, %eax
callq 0x2030
movl $0xa, %edi
callq 0x22f0
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
cvtsi2sd %ebp, %xmm1
divsd %xmm1, %xmm0
leaq 0x17c04(%rip), %rdi     # 0x318aa
movsd %xmm0, 0x80(%rsp)
movb $0x1, %al
callq 0x2030
movq 0x10(%rsp), %rdi
addq %r14, %rdi
callq 0x1c62c
movq %rax, %r15
movq %rbx, %rdi
callq 0x1e160
movq %r15, %xmm1
movq 0x17545(%rip), %xmm3    # 0x31220
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
movapd 0x17549(%rip), %xmm2    # 0x31230
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 0x17ba7(%rip), %rdi     # 0x318c2
movb $0x1, %al
callq 0x2030
movl $0xa, %edi
callq 0x22f0
xorpd %xmm0, %xmm0
movapd %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
leaq 0x17de6(%rip), %rdi     # 0x31b2c
callq 0x2350
cmpl $0x0, 0x28(%rsp)
jle 0x19e19
xorl %eax, %eax
leaq 0x60(%rsp), %r15
movq %rax, 0x30(%rsp)
movq $0x0, 0x60(%rsp)
callq 0x2070
movl %eax, %r13d
movq %rbx, %rdi
callq 0x1e160
movq %rax, %r12
callq 0x2070
movl %eax, %ebp
movq %rbx, %rdi
callq 0x1e160
movq %rax, %rcx
movslq %ebp, %rsi
movslq %r13d, %rax
xorl %edx, %edx
divq %r12
movq %rdx, %r8
movq %rsi, %rax
xorl %edx, %edx
divq %rcx
movl %r8d, 0x60(%rsp)
movl %edx, 0x64(%rsp)
movq 0x10(%rsp), %rdi
addq %r14, %rdi
movl %r8d, %esi
callq 0x1c746
testb %al, %al
je 0x19d6b
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq %r15, %rdx
callq 0x1b49c
movq 0x48(%rsp), %rsi
cmpq %rsi, %rax
jne 0x19d6b
cmpq 0x50(%rsp), %rsi
je 0x19dfb
movq 0x60(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x48(%rsp)
movq 0x30(%rsp), %rax
jmp 0x19e0d
leaq 0x40(%rsp), %rdi
movq %r15, %rdx
callq 0x16e08
movq 0x30(%rsp), %rax
incl %eax
cmpl 0x28(%rsp), %eax
jne 0x19d5d
movl $0xa, %edi
callq 0x22f0
xorl %eax, %eax
movq %rax, 0x70(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x60(%rsp)
movq %rax, 0xe0(%rsp)
movapd %xmm0, 0xd0(%rsp)
movq %rax, 0xc0(%rsp)
movapd %xmm0, 0xb0(%rsp)
movq %rax, 0xa0(%rsp)
movapd %xmm0, 0x90(%rsp)
movq 0x40(%rsp), %rax
cmpq %rax, 0x48(%rsp)
je 0x1a054
xorl %r15d, %r15d
leaq 0x38(%rsp), %r13
movl (%rax,%r15,8), %esi
movl 0x4(%rax,%r15,8), %edx
movq 0x10(%rsp), %rdi
addq %r14, %rdi
movq %rsp, %rcx
leaq 0x8(%rsp), %r8
movq %r13, %r9
callq 0x1d0a0
movq 0x68(%rsp), %rsi
cmpq 0x70(%rsp), %rsi
je 0x19ebc
movl (%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x68(%rsp)
jmp 0x19ec9
leaq 0x60(%rsp), %rdi
movq %rsp, %rdx
callq 0x12b22
movq 0xd8(%rsp), %rsi
cmpq 0xe0(%rsp), %rsi
je 0x19eef
movl 0x8(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xd8(%rsp)
jmp 0x19f01
leaq 0xd0(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x12b22
movq 0xb8(%rsp), %rsi
cmpq 0xc0(%rsp), %rsi
je 0x19f27
movl 0x38(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xb8(%rsp)
jmp 0x19f37
leaq 0xb0(%rsp), %rdi
movq %r13, %rdx
callq 0x12b22
movl (%rsp), %ebp
movq 0x10(%rsp), %rdi
addq %r14, %rdi
callq 0x1c62c
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movq %rax, %xmm1
punpckldq 0x172c5(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x172cd(%rip), %xmm1    # 0x31230
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movsd %xmm0, 0x88(%rsp)
movq 0x98(%rsp), %rsi
cmpq 0xa0(%rsp), %rsi
je 0x19fa0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x98(%rsp)
jmp 0x19fb5
leaq 0x90(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x1bd76
movl (%rsp), %ebp
movq 0x10(%rsp), %rdi
addq %r14, %rdi
callq 0x1c62c
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movq %rax, %xmm1
punpckldq 0x17247(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1724f(%rip), %xmm1    # 0x31230
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movl 0x8(%rsp), %r8d
movl 0x38(%rsp), %r10d
movq 0x40(%rsp), %rax
movl (%rax,%r15,8), %r11d
movl 0x4(%rax,%r15,8), %r12d
subq $0x8, %rsp
leaq 0x178c6(%rip), %rdi     # 0x318da
movl $0x8, %esi
movl %ebp, %edx
movl $0x8, %ecx
movl $0x8, %r9d
movb $0x1, %al
pushq %r12
pushq %r11
pushq %r10
callq 0x2030
addq $0x20, %rsp
incq %r15
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
ja 0x19e7f
movl $0xa, %edi
callq 0x22f0
leaq 0x100(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x1b35e
leaq 0x100(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
leaq 0x8(%rsp), %rcx
leaq 0x88(%rsp), %r8
movq %rsp, %r9
callq 0x2fae4
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x1a0ba
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movl $0xa, %edi
callq 0x22f0
movsd 0x38(%rsp), %xmm0
movsd 0xf8(%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
movq 0x88(%rsp), %xmm3
movsd (%rsp), %xmm4
leaq 0x17821(%rip), %rdi     # 0x3190f
movb $0x5, %al
callq 0x2030
addq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x1c62c
movq %rax, %r14
movq %rbx, %rdi
callq 0x1e160
movsd 0x16f1b(%rip), %xmm0    # 0x31030
movapd %xmm0, %xmm1
subsd 0x8(%rsp), %xmm1
movapd %xmm0, %xmm2
subsd 0x38(%rsp), %xmm2
movapd %xmm0, %xmm3
subsd 0x88(%rsp), %xmm3
movapd %xmm0, %xmm4
subsd (%rsp), %xmm4
movapd %xmm0, %xmm5
movapd %xmm0, %xmm7
subsd 0xf8(%rsp), %xmm5
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
cvtsi2sd %eax, %xmm6
divsd %xmm6, %xmm0
mulsd %xmm0, %xmm1
movsd 0x80(%rsp), %xmm6
mulsd %xmm6, %xmm1
movapd %xmm7, %xmm8
divsd %xmm1, %xmm8
movsd %xmm8, 0x30(%rsp)
mulsd %xmm0, %xmm2
mulsd %xmm6, %xmm2
movapd %xmm7, %xmm1
divsd %xmm2, %xmm1
movsd %xmm1, 0x28(%rsp)
mulsd %xmm0, %xmm3
mulsd %xmm6, %xmm3
movapd %xmm7, %xmm1
divsd %xmm3, %xmm1
movsd %xmm1, 0xf0(%rsp)
mulsd %xmm0, %xmm4
mulsd %xmm6, %xmm4
movapd %xmm7, %xmm1
divsd %xmm4, %xmm1
movsd %xmm1, 0xe8(%rsp)
mulsd %xmm5, %xmm0
mulsd %xmm6, %xmm0
divsd %xmm0, %xmm7
movsd %xmm7, 0x80(%rsp)
movl $0xa, %edi
callq 0x22f0
leaq 0x1774f(%rip), %rbx     # 0x3193f
movsd 0x17008(%rip), %xmm0    # 0x31200
movq %rbx, %rdi
movb $0x1, %al
callq 0x2030
movsd 0x16ffe(%rip), %xmm4    # 0x31208
movsd 0x28(%rsp), %xmm0
mulsd %xmm4, %xmm0
movsd 0x80(%rsp), %xmm1
mulsd %xmm4, %xmm1
movsd 0x30(%rsp), %xmm2
mulsd %xmm4, %xmm2
movsd 0xf0(%rsp), %xmm3
mulsd %xmm4, %xmm3
mulsd 0xe8(%rsp), %xmm4
leaq 0x176c7(%rip), %r14     # 0x3190f
movq %r14, %rdi
movb $0x5, %al
callq 0x2030
movsd 0x16f8e(%rip), %xmm0    # 0x311e8
movq %rbx, %rdi
movb $0x1, %al
callq 0x2030
movq %r14, %rdi
movsd 0x28(%rsp), %xmm0
movsd 0x80(%rsp), %xmm1
movsd 0x30(%rsp), %xmm2
movsd 0xf0(%rsp), %xmm3
movsd 0xe8(%rsp), %xmm4
movb $0x5, %al
callq 0x2030
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x1a2b2
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a2cf
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a2ec
movq 0xe0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1a303
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1a31a
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0x10(%rsp), %rdi
callq 0x15802
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1a370
jmp 0x1a370
movq %rax, %rbx
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x1a373
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
jmp 0x1a373
jmp 0x1a370
jmp 0x1a366
jmp 0x1a366
jmp 0x1a366
jmp 0x1a3e5
movq %rax, %rbx
jmp 0x1a3ff
jmp 0x1a370
movq %rax, %rbx
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x1a390
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a3ad
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a3ca
movq 0xe0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1a3e8
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
jmp 0x1a3e8
jmp 0x1a3e5
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1a3ff
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0x10(%rsp), %rdi
callq 0x15802
movq %rbx, %rdi
callq 0x23b0