// File: chhylp123[P]hifiasm/hic.cpp
// Function: get_Connected_Components(min_cut_t*)
void get_Connected_Components(min_cut_t* x)
{
    double index_time = yak_realtime();
    uint64_t i, j, k = 0, uID, e;
    kvec_t_u64_warp buff;
    kv_init(buff.a);
    while (1)
    {
        for (i = 0; i < x->n; i++)
        {
            uID = x->order.a[i] & x->uID_mode;
            if(x->rGraphVis.a[uID] == 0) break;
        }
        if(i < x->n)
        {
            e = buff.a.n = 0;
            bfs_flow(uID, (uint64_t)-1, x, &buff);
            for (i = 0; i < buff.a.n; i++)
            {
                for (j = 0; j < x->rGraph.a[buff.a.a[i]].n; j++)
                {
                    if(x->rGraph.a[buff.a.a[i]].a[j].del == 0) e++;
                }
            }
            e >>= 1;
            if(buff.a.n > 1)
            {
                fprintf(stderr, "(%lu) Component: # nodes: %lu, # edges: %lu\n", 
                                                                k, (uint64_t)buff.a.n, e);
            }
            k++;
        }
        else
        {
            break;
        }
    }

    kv_destroy(buff.a);
    fprintf(stderr, "[M::%s::%.3f] # Connected Components: %lu\n", 
    __func__, yak_realtime()-index_time, k);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
callq 0x1b7ca0
movsd %xmm0, -0x10(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x148(%rcx), %rax
jae 0x1d8988
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x8(%rbp), %rcx
andq 0x138(%rcx), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0xc0(%rax), %rax
movq -0x30(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x1d8978
jmp 0x1d8988
jmp 0x1d897a
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x1d892e
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x148(%rcx), %rax
jae 0x1d8aa9
movq $0x0, -0x58(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rdx
movq $-0x1, %rsi
leaq -0x58(%rbp), %rcx
callq 0x1d7940
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x58(%rbp), %rax
jae 0x1d8a65
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x48(%rbp), %rdx
movq -0x18(%rbp), %rsi
imulq $0x18, (%rdx,%rsi,8), %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jae 0x1d8a52
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x48(%rbp), %rcx
movq -0x18(%rbp), %rdx
imulq $0x18, (%rcx,%rdx,8), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x20(%rbp), %rcx
addq %rcx, %rax
movb 0x18(%rax), %al
shrb $0x7, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x1d8a42
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x1d8a44
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x1d89e3
jmp 0x1d8a54
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x1d89cd
movq -0x38(%rbp), %rax
shrq %rax
movq %rax, -0x38(%rbp)
cmpq $0x1, -0x58(%rbp)
jbe 0x1d8a9b
movq 0x1eb562(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x28(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq -0x38(%rbp), %r8
leaq 0x1b3c44(%rip), %rsi    # 0x38c6d8
movb $0x0, %al
callq 0x22a0
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x1d8aab
jmp 0x1d8ab0
jmp 0x1d8926
movq -0x48(%rbp), %rdi
callq 0x2210
movq 0x1eb520(%rip), %rax    # 0x3c3fe0
movq (%rax), %rax
movq %rax, -0x60(%rbp)
callq 0x1b7ca0
movq -0x60(%rbp), %rdi
subsd -0x10(%rbp), %xmm0
movq -0x28(%rbp), %rcx
leaq 0x1b3c25(%rip), %rsi    # 0x38c705
leaq 0x1b3c49(%rip), %rdx    # 0x38c730
movb $0x1, %al
callq 0x22a0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)