// File: /workspace/github_cpp_makefile_star2_O3/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 $0x58, %rsp
movl %esi, 0xc(%rsp)
movq %rdi, %rbx
leaq 0x161c0(%rip), %rdi     # 0x30b40
callq 0x2350
movq 0x108(%rbx), %rsi
leaq 0x158bd(%rip), %rdi     # 0x30250
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x2030
movq %rbx, %rdi
callq 0x1dfcc
leaq 0x158b3(%rip), %rdi     # 0x3025e
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
movq 0x58(%rbx), %rsi
leaq 0x158b3(%rip), %rdi     # 0x30273
xorl %eax, %eax
callq 0x2030
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %rbx, %rdi
callq 0x146c2
movq %rbx, 0x50(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sete %sil
sarq $0x3, %rdx
movabsq $-0x303030303030303, %r13 # imm = 0xFCFCFCFCFCFCFCFD
imulq %r13, %rdx
cmpq $0x2, %rdx
setb %dl
orb %sil, %dl
jne 0x1aa9e
movslq 0xc(%rsp), %rbx
xorl %r14d, %r14d
movl $0x58, %r15d
leaq 0x2c(%rsp), %r12
xorl %ebp, %ebp
movq (%rax,%r15), %rdx
movl %edx, 0x2c(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x1aa60
movl %edx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x1aa7b
leaq 0x10(%rsp), %rdi
movq %r12, %rdx
callq 0x1bd70
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
movq (%rax,%r15), %rdx
cmpq %rbx, %rdx
sbbl $-0x1, %ebp
incq %r14
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
imulq %r13, %rdx
addq $0x2a8, %r15            # imm = 0x2A8
cmpq %r14, %rdx
ja 0x1aa3f
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 0x1ab17
cmpq %r15, %r12
je 0x1aaef
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x1be4b
movq %r12, %rdi
movq %r15, %rsi
callq 0x1bf2e
movq 0x18(%rsp), %r15
movl -0x4(%r15), %esi
leaq 0x15eed(%rip), %rdi     # 0x309e7
xorl %eax, %eax
callq 0x2030
movq 0x18(%rsp), %rax
movl -0x8(%rax), %esi
leaq 0x15ef0(%rip), %rdi     # 0x30a00
xorl %eax, %eax
callq 0x2030
movl $0xa, %edi
callq 0x22f0
movq 0x18(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sdl -0x4(%rax), %xmm0
movq 0x50(%rsp), %rax
movsd 0x58(%rax), %xmm1
unpcklps 0x156e1(%rip), %xmm1    # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x156e9(%rip), %xmm1    # 0x30230
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
leaq 0x15ec6(%rip), %rdi     # 0x30a24
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 0x15eb7(%rip), %rdi     # 0x30a3f
xorl %eax, %eax
callq 0x2030
leaq 0x15eba(%rip), %rdi     # 0x30a50
movl 0xc(%rsp), %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2030
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1abba
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0x30(%rsp), %rdi
callq 0x15702
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1abda
movq %rax, %rbx
jmp 0x1abf4
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1abf4
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2250
leaq 0x30(%rsp), %rdi
callq 0x15702
movq %rbx, %rdi
callq 0x23b0