// File: /workspace/github_cpp_makefile_star2_O1/fjamour[P]icentral/src/experiments.cc
// Function: count_bcc(graph_t&, int)
void count_bcc(graph_t& graph, int num_edges)
{
    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());
    vector<graph_hash_t> bcc_vec;
    graph.find_bicon_comp(bcc_vec);
    
    vector<int> bcc_sz_vec;
    int num_bcc = 0;
    if(bcc_vec.size() > 1) {
        for(int i = 0; i < bcc_vec.size(); ++i) {
            bcc_sz_vec.push_back(bcc_vec[i].edge_set.size());
            if(bcc_vec[i].edge_set.size() >= num_edges) {
                num_bcc++;
            }
        }
    }
    
    printf("\n");
    if(bcc_sz_vec.size() > 2) {
        sort(bcc_sz_vec.begin(), bcc_sz_vec.end());
        printf("Num edges in LBCC:\t[%d]\n", bcc_sz_vec.back());
        printf("Num edges in 2nd largest BCC:\t[%d]\n",
                bcc_sz_vec[bcc_sz_vec.size()-2]);
    }
    printf("\n");
    double frac_edges_in_lbcc = bcc_sz_vec.back()/(double)graph.edge_set.size();
    printf("Frac edges in LBCC:\t\t[%f]\n", frac_edges_in_lbcc);
    printf("\n");
    printf("Num BCC:\t\t\t[%d]\n", bcc_vec.size());
    printf("Num BCC with # edges >= %d:\t[%d]\n", num_edges, num_bcc);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, 0xc(%rsp)
movq %rdi, %r14
leaq 0x1710a(%rip), %rdi     # 0x31b40
callq 0x2350
movq 0x108(%r14), %rsi
leaq 0x16807(%rip), %rdi     # 0x31250
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x2030
movq %r14, %rdi
callq 0x1e160
leaq 0x167fd(%rip), %rdi     # 0x3125e
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
movq 0x58(%r14), %rsi
leaq 0x167fd(%rip), %rdi     # 0x31273
xorl %eax, %eax
callq 0x2030
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %r14, %rdi
callq 0x147a2
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x38(%rsp), %rax
subq 0x30(%rsp), %rax
sarq $0x3, %rax
movabsq $-0x303030303030303, %r13 # imm = 0xFCFCFCFCFCFCFCFD
imulq %r13, %rax
cmpq $0x2, %rax
jb 0x1ab42
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x1ab42
movslq 0xc(%rsp), %rbx
xorl %r15d, %r15d
movl $0x58, %r12d
xorl %ebp, %ebp
movl (%rax,%r12), %eax
movl %eax, 0x2c(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x1ab08
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x1ab17
leaq 0x10(%rsp), %rdi
leaq 0x2c(%rsp), %rdx
callq 0x1be56
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
cmpq %rbx, (%rax,%r12)
sbbl $-0x1, %ebp
incq %r15
subq %rax, %rcx
sarq $0x3, %rcx
imulq %r13, %rcx
addq $0x2a8, %r12            # imm = 0x2A8
cmpq %r15, %rcx
ja 0x1aae7
movl $0xa, %edi
callq 0x22f0
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r15
movq %r15, %rax
subq %r12, %rax
sarq $0x2, %rax
cmpq $0x3, %rax
jb 0x1abba
cmpq %r15, %r12
je 0x1ab8e
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x1bf31
movq %r12, %rdi
movq %r15, %rsi
callq 0x1c014
movq 0x18(%rsp), %rax
movl -0x4(%rax), %esi
leaq 0x16e4a(%rip), %rdi     # 0x319e7
xorl %eax, %eax
callq 0x2030
movq 0x18(%rsp), %rax
movl -0x8(%rax), %esi
leaq 0x16e4d(%rip), %rdi     # 0x31a00
xorl %eax, %eax
callq 0x2030
movl $0xa, %edi
callq 0x22f0
movq 0x18(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sdl -0x4(%rax), %xmm0
movsd 0x58(%r14), %xmm1
unpcklps 0x16642(%rip), %xmm1    # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1664a(%rip), %xmm1    # 0x31230
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
leaq 0x16e27(%rip), %rdi     # 0x31a24
movb $0x1, %al
callq 0x2030
movl $0xa, %edi
callq 0x22f0
movq 0x38(%rsp), %rsi
subq 0x30(%rsp), %rsi
sarq $0x3, %rsi
imulq %r13, %rsi
leaq 0x16e18(%rip), %rdi     # 0x31a3f
xorl %eax, %eax
callq 0x2030
leaq 0x16e1b(%rip), %rdi     # 0x31a50
movl 0xc(%rsp), %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2030
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1ac59
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0x30(%rsp), %rdi
callq 0x15802
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1ac79
movq %rax, %rbx
jmp 0x1ac93
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1ac93
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0x30(%rsp), %rdi
callq 0x15802
movq %rbx, %rdi
callq 0x23b0