// File: /workspace/github_cpp_makefile_star2_O2/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, %ebx
movq %rdi, %r14
leaq 0x12f52(%rip), %rdi     # 0x28b00
callq 0x2360
movq 0x108(%r14), %rsi
leaq 0x1264f(%rip), %rdi     # 0x28210
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x2030
movq %r14, %rdi
callq 0x18d3c
leaq 0x12645(%rip), %rdi     # 0x2821e
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
movq 0x58(%r14), %rsi
leaq 0x12645(%rip), %rdi     # 0x28233
xorl %eax, %eax
callq 0x2030
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
movq %r14, %rdi
callq 0x10aca
andq $0x0, 0x20(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rcx
movq %rcx, %rax
subq %rsi, %rax
movl $0x2a8, %edi            # imm = 0x2A8
cqto
idivq %rdi
cmpq $0x2, %rax
jb 0x15ca8
movq %r14, 0x50(%rsp)
movl %ebx, 0x8(%rsp)
movslq %ebx, %rbx
xorl %r14d, %r14d
pushq $0x58
popq %r13
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
xorl %ebp, %ebp
subq %rsi, %rcx
movq %rcx, %rax
cqto
movl $0x2a8, %ecx            # imm = 0x2A8
idivq %rcx
cmpq %r14, %rax
jbe 0x15c9f
movl (%rsi,%r13), %eax
movl %eax, 0xc(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x16ec8
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rcx
cmpq %rbx, (%rsi,%r13)
sbbl $-0x1, %ebp
incq %r14
addq $0x2a8, %r13            # imm = 0x2A8
jmp 0x15c5a
movl 0x8(%rsp), %ebx
movq 0x50(%rsp), %r14
pushq $0xa
popq %rdi
callq 0x2300
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq %rsi, %rax
subq %rdi, %rax
cmpq $0x9, %rax
jb 0x15cf7
callq 0x16fbe
movq 0x18(%rsp), %rax
movl -0x4(%rax), %esi
leaq 0x12ccd(%rip), %rdi     # 0x289a7
xorl %eax, %eax
callq 0x2030
movq 0x18(%rsp), %rax
movl -0x8(%rax), %esi
leaq 0x12cd0(%rip), %rdi     # 0x289c0
xorl %eax, %eax
callq 0x2030
pushq $0xa
popq %r12
movl %r12d, %edi
callq 0x2300
leaq 0x10(%rsp), %r15
movq 0x8(%r15), %rax
cvtsi2sdl -0x4(%rax), %xmm0
movsd 0x58(%r14), %xmm1
unpcklps 0x124d2(%rip), %xmm1    # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x124da(%rip), %xmm1    # 0x28200
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
leaq 0x12ca7(%rip), %rdi     # 0x289e4
movb $0x1, %al
callq 0x2030
movl %r12d, %edi
callq 0x2300
leaq 0x30(%rsp), %r14
movq 0x8(%r14), %rax
subq (%r14), %rax
movl $0x2a8, %ecx            # imm = 0x2A8
cqto
idivq %rcx
leaq 0x12c96(%rip), %rdi     # 0x289ff
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
leaq 0x12c96(%rip), %rdi     # 0x28a10
movl %ebx, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2030
movq %r15, %rdi
callq 0x5720
movq %r14, %rdi
callq 0x11800
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x15dab
movq %rax, %rbx
jmp 0x15db8
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x5720
leaq 0x30(%rsp), %rdi
callq 0x11800
movq %rbx, %rdi
callq 0x23d0