// File: /workspace/github_cpp_makefile_star2_O3/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 $0x128, %rsp            # imm = 0x128
movl %esi, 0x18(%rsp)
movq %rdi, %rbx
leaq 0x170d9(%rip), %rdi     # 0x30b40
callq 0x2350
movq 0x108(%rbx), %rsi
leaq 0x167d6(%rip), %rdi     # 0x30250
xorl %eax, %eax
callq 0x2030
movq %rbx, %rdi
callq 0x1dfcc
leaq 0x167ce(%rip), %rdi     # 0x3025e
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
movq 0x58(%rbx), %rsi
leaq 0x167ce(%rip), %rdi     # 0x30273
xorl %eax, %eax
callq 0x2030
xorpd %xmm0, %xmm0
leaq 0x50(%rsp), %rsi
movapd %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %rbx, %rdi
callq 0x146c2
movq 0x50(%rsp), %rdi
callq 0x1c4e0
movq %rax, %r15
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rax
addl 0x58(%rdi), %r15d
subq %rdi, %rax
sarq $0x3, %rax
movabsq $-0x303030303030303, %r12 # imm = 0xFCFCFCFCFCFCFCFD
imulq %r12, %rax
xorl %r14d, %r14d
cmpq $0x2, %rax
jb 0x19b61
movl $0x1, %r13d
movl $0x2a8, %ebp            # imm = 0x2A8
addq %rbp, %rdi
callq 0x1c4e0
movq 0x50(%rsp), %rdi
addq 0x58(%rdi,%rbp), %rax
movslq %r15d, %rcx
cmpq %rcx, %rax
jbe 0x19b3f
addq %rbp, %rdi
callq 0x1c4e0
movq %rax, %r15
movq 0x50(%rsp), %rdi
addl 0x58(%rdi,%rbp), %r15d
movl %r13d, %r14d
incq %r13
movq 0x58(%rsp), %rax
subq %rdi, %rax
sarq $0x3, %rax
imulq %r12, %rax
addq $0x2a8, %rbp            # imm = 0x2A8
cmpq %r13, %rax
ja 0x19b0d
movslq %r14d, %r14
movq %rbx, %rdi
callq 0x1dfcc
movq %rax, %r12
movq 0x58(%rbx), %r13
movl $0xa, %edi
callq 0x22f0
imulq $0x2a8, %r14, %r14      # imm = 0x2A8
movq 0x50(%rsp), %rdi
addq %r14, %rdi
callq 0x1c4e0
addl %r12d, %r13d
leaq 0x16f13(%rip), %rdi     # 0x30aab
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
movq 0x50(%rsp), %rax
movq 0x58(%rax,%r14), %rsi
leaq 0x16f0c(%rip), %rdi     # 0x30abf
xorl %eax, %eax
callq 0x2030
movl $0xa, %edi
callq 0x22f0
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
cvtsi2sd %r13d, %xmm1
divsd %xmm1, %xmm0
leaq 0x16cce(%rip), %rdi     # 0x308aa
movsd %xmm0, 0x90(%rsp)
movb $0x1, %al
callq 0x2030
movq 0x50(%rsp), %rdi
addq %r14, %rdi
callq 0x1c4e0
movq %rax, %r15
movq %rbx, %rdi
callq 0x1dfcc
movq %r15, %xmm1
movq 0x1660f(%rip), %xmm3    # 0x30220
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
movapd 0x16613(%rip), %xmm2    # 0x30230
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 0x16c71(%rip), %rdi     # 0x308c2
movb $0x1, %al
callq 0x2030
movl $0xa, %edi
callq 0x22f0
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0x16eb0(%rip), %rdi     # 0x30b2c
callq 0x2350
cmpl $0x0, 0x18(%rsp)
jle 0x19d4f
xorl %eax, %eax
leaq 0x70(%rsp), %r15
movq %rax, 0x20(%rsp)
movq $0x0, 0x70(%rsp)
callq 0x2070
movl %eax, %r13d
movq %rbx, %rdi
callq 0x1dfcc
movq %rax, %r12
callq 0x2070
movl %eax, %ebp
movq %rbx, %rdi
callq 0x1dfcc
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, 0x70(%rsp)
movl %edx, 0x74(%rsp)
movq 0x50(%rsp), %rdi
addq %r14, %rdi
movl %r8d, %esi
callq 0x1c5fe
testb %al, %al
je 0x19ca1
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq %r15, %rdx
callq 0x1b3f6
movq 0x38(%rsp), %rsi
cmpq %rsi, %rax
jne 0x19ca1
cmpq 0x40(%rsp), %rax
je 0x19d31
movq 0x70(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x38(%rsp)
movq 0x20(%rsp), %rax
jmp 0x19d43
leaq 0x30(%rsp), %rdi
movq %r15, %rdx
callq 0x16d4c
movq 0x20(%rsp), %rax
incl %eax
cmpl 0x18(%rsp), %eax
jne 0x19c93
movl $0xa, %edi
callq 0x22f0
xorl %eax, %eax
movq %rax, 0x80(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x70(%rsp)
movq %rax, 0xf0(%rsp)
movapd %xmm0, 0xe0(%rsp)
movq %rax, 0xd0(%rsp)
movapd %xmm0, 0xc0(%rsp)
movq %rax, 0xb0(%rsp)
movapd %xmm0, 0xa0(%rsp)
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x19f97
xorl %r15d, %r15d
leaq 0x28(%rsp), %r13
movl (%rax,%r15,8), %esi
movl 0x4(%rax,%r15,8), %edx
movq 0x50(%rsp), %rdi
addq %r14, %rdi
leaq 0x8(%rsp), %rcx
leaq 0x10(%rsp), %r8
movq %r13, %r9
callq 0x1cf7e
movq 0x78(%rsp), %rsi
cmpq 0x80(%rsp), %rsi
je 0x19dfb
movl 0x8(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x78(%rsp)
jmp 0x19e0a
leaq 0x70(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x12a6a
movq 0xe8(%rsp), %rsi
cmpq 0xf0(%rsp), %rsi
je 0x19e30
movl 0x10(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xe8(%rsp)
jmp 0x19e42
leaq 0xe0(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x12a6a
movq 0xc8(%rsp), %rsi
cmpq 0xd0(%rsp), %rsi
je 0x19e68
movl 0x28(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xc8(%rsp)
jmp 0x19e78
leaq 0xc0(%rsp), %rdi
movq %r13, %rdx
callq 0x12a6a
movl 0x8(%rsp), %ebp
movq 0x50(%rsp), %rdi
addq %r14, %rdi
callq 0x1c4e0
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movq %rax, %xmm1
punpckldq 0x16383(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1638b(%rip), %xmm1    # 0x30230
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movsd %xmm0, 0x98(%rsp)
movq 0xa8(%rsp), %rsi
cmpq 0xb0(%rsp), %rsi
je 0x19ee2
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0xa8(%rsp)
jmp 0x19ef7
leaq 0xa0(%rsp), %rdi
leaq 0x98(%rsp), %rdx
callq 0x1bc90
movl 0x8(%rsp), %ebp
movq 0x50(%rsp), %rdi
addq %r14, %rdi
callq 0x1c4e0
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movq %rax, %xmm1
punpckldq 0x16304(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1630c(%rip), %xmm1    # 0x30230
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movl 0x10(%rsp), %r8d
movl 0x28(%rsp), %r10d
movq 0x30(%rsp), %rax
movl (%rax,%r15,8), %r11d
movl 0x4(%rax,%r15,8), %r12d
subq $0x8, %rsp
leaq 0x16983(%rip), %rdi     # 0x308da
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 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
ja 0x19db8
movl $0xa, %edi
callq 0x22f0
leaq 0x110(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x1b2b8
leaq 0x110(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x108(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0x98(%rsp), %r8
leaq 0x8(%rsp), %r9
callq 0x2f758
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0x19fff
movq 0x120(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movl $0xa, %edi
callq 0x22f0
movsd 0x28(%rsp), %xmm0
movsd 0x108(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movq 0x98(%rsp), %xmm3
movsd 0x8(%rsp), %xmm4
leaq 0x168db(%rip), %rdi     # 0x3090f
movb $0x5, %al
callq 0x2030
addq 0x50(%rsp), %r14
movq %r14, %rdi
callq 0x1c4e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x1dfcc
movsd 0x15fd5(%rip), %xmm0    # 0x30030
movapd %xmm0, %xmm1
subsd 0x10(%rsp), %xmm1
movapd %xmm0, %xmm2
subsd 0x28(%rsp), %xmm2
movapd %xmm0, %xmm3
subsd 0x98(%rsp), %xmm3
movapd %xmm0, %xmm4
subsd 0x8(%rsp), %xmm4
movapd %xmm0, %xmm5
movapd %xmm0, %xmm7
subsd 0x108(%rsp), %xmm5
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
cvtsi2sd %eax, %xmm6
divsd %xmm6, %xmm0
mulsd %xmm0, %xmm1
movsd 0x90(%rsp), %xmm6
mulsd %xmm6, %xmm1
movapd %xmm7, %xmm8
divsd %xmm1, %xmm8
movsd %xmm8, 0x20(%rsp)
mulsd %xmm0, %xmm2
mulsd %xmm6, %xmm2
movapd %xmm7, %xmm1
divsd %xmm2, %xmm1
movsd %xmm1, 0x18(%rsp)
mulsd %xmm0, %xmm3
mulsd %xmm6, %xmm3
movapd %xmm7, %xmm1
divsd %xmm3, %xmm1
movsd %xmm1, 0x100(%rsp)
mulsd %xmm0, %xmm4
mulsd %xmm6, %xmm4
movapd %xmm7, %xmm1
divsd %xmm4, %xmm1
movsd %xmm1, 0xf8(%rsp)
mulsd %xmm5, %xmm0
mulsd %xmm6, %xmm0
divsd %xmm0, %xmm7
movsd %xmm7, 0x90(%rsp)
movl $0xa, %edi
callq 0x22f0
leaq 0x16808(%rip), %rbx     # 0x3093f
movsd 0x160c1(%rip), %xmm0    # 0x30200
movq %rbx, %rdi
movb $0x1, %al
callq 0x2030
movsd 0x160b7(%rip), %xmm4    # 0x30208
movsd 0x18(%rsp), %xmm0
mulsd %xmm4, %xmm0
movsd 0x90(%rsp), %xmm1
mulsd %xmm4, %xmm1
movsd 0x20(%rsp), %xmm2
mulsd %xmm4, %xmm2
movsd 0x100(%rsp), %xmm3
mulsd %xmm4, %xmm3
mulsd 0xf8(%rsp), %xmm4
leaq 0x16780(%rip), %r14     # 0x3090f
movq %r14, %rdi
movb $0x5, %al
callq 0x2030
movsd 0x16047(%rip), %xmm0    # 0x301e8
movq %rbx, %rdi
movb $0x1, %al
callq 0x2030
movq %r14, %rdi
movsd 0x18(%rsp), %xmm0
movsd 0x90(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
movsd 0x100(%rsp), %xmm3
movsd 0xf8(%rsp), %xmm4
movb $0x5, %al
callq 0x2030
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a1f9
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a216
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a233
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1a24d
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1a264
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0x50(%rsp), %rdi
callq 0x15702
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1a2bd
jmp 0x1a2bd
movq %rax, %rbx
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0x1a2c0
movq 0x120(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
jmp 0x1a2c0
jmp 0x1a2bd
jmp 0x1a2b3
jmp 0x1a2b3
jmp 0x1a2b3
jmp 0x1a335
movq %rax, %rbx
jmp 0x1a34f
jmp 0x1a2bd
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a2dd
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a2fa
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a317
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1a338
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
jmp 0x1a338
jmp 0x1a335
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1a34f
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0x50(%rsp), %rdi
callq 0x15702
movq %rbx, %rdi
callq 0x23b0