// File: /workspace/github_c_makefile_star2_O1/c-zhou[P]oatk/syncasm.c
// Function: scg_subgraph_stat
void scg_subgraph_stat(scg_t *scg, FILE *fo)
{
    uint32_t i, s, n_vtx;
    uint64_t j, n, n_scm, n_utg, n_arc;
    asmg_t *utg_asmg;
    uint8_t *visited, *flag;
    uint32_t *vtx;

    utg_asmg = scg->utg_asmg;
    n_utg = utg_asmg->n_vtx;

    MYCALLOC(visited, n_utg);
    MYMALLOC(flag, n_utg);
    s = 0;
    for (i = 0; i < n_utg; ++i) {
        if (visited[i])
            continue;
        vtx = asmg_subgraph(utg_asmg, &i, 1, 0, 0, &n_vtx, 0);
        MYBZERO(flag, n_utg);
        n_scm = 0;
        for (j = 0; j < n_vtx; ++j) {
            n_scm += utg_asmg->vtx[vtx[j]].n;
            flag[vtx[j]] = 1;
            visited[vtx[j]] = 1;
        }
        n_arc = 0;
        for (j = 0, n = utg_asmg->n_arc; j < n; ++j)
            if (!utg_asmg->arc[j].del &&
                    flag[utg_asmg->arc[j].v>>1] && 
                    flag[utg_asmg->arc[j].w>>1])
                ++n_arc;
        fprintf(fo, "[M::%s] syncmer graph stats for subgraph %u - seeding u%u\n", __func__, s++, vtx[0]);
        fprintf(fo, "[M::%s] number unitigs  : %u\n", __func__, n_vtx);
        fprintf(fo, "[M::%s] number syncmers : %lu\n", __func__, n_scm);
        fprintf(fo, "[M::%s] number arcs     : %lu\n", __func__, n_arc);
        free(vtx);
    }

    free(visited);
    free(flag);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, 0x28(%rsp)
movq 0x8(%rdi), %r15
movq (%r15), %rbx
movl $0x1, %esi
movq %rbx, %rdi
callq 0x2250
movq %rax, %r12
movq %rbx, %rdi
callq 0x2320
movq %rax, %r13
movl $0x0, 0xc(%rsp)
testq %rbx, %rbx
je 0x5a0d
movb $0x1, %bpl
xorl %eax, %eax
xorl %ecx, %ecx
movq %r15, 0x20(%rsp)
movq %rbx, 0x18(%rsp)
cmpb $0x0, (%r12,%rax)
jne 0x59fa
movq %rcx, 0x30(%rsp)
movl $0x0, (%rsp)
movq %r15, %rdi
leaq 0xc(%rsp), %rsi
movl $0x1, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
leaq 0x10(%rsp), %r9
callq 0x17fe2
movq %rax, %r14
movq %r13, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x21e0
movl 0x10(%rsp), %eax
movl $0x0, %ebx
testq %rax, %rax
je 0x591e
movq 0x10(%r15), %rcx
xorl %edx, %edx
xorl %ebx, %ebx
movl (%r14,%rdx,4), %esi
leaq (%rsi,%rsi,4), %rdi
addq (%rcx,%rdi,8), %rbx
movb %bpl, (%r13,%rsi)
movb %bpl, (%r12,%rsi)
incq %rdx
cmpq %rdx, %rax
jne 0x5901
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x595e
movq 0x28(%r15), %rcx
xorl %r15d, %r15d
testb $0x40, 0x23(%rcx)
jne 0x5953
movq (%rcx), %rdx
shrq %rdx
cmpb $0x0, (%r13,%rdx)
je 0x5953
movq 0x8(%rcx), %rdx
shrq %rdx
cmpb $0x1, (%r13,%rdx)
sbbq $-0x1, %r15
addq $0x30, %rcx
decq %rax
jne 0x592e
jmp 0x5961
xorl %r15d, %r15d
movq 0x30(%rsp), %rcx
leal 0x1(%rcx), %eax
movl %eax, 0x14(%rsp)
movl (%r14), %r8d
movq 0x28(%rsp), %rbp
movq %rbp, %rdi
leaq 0x17f37(%rip), %rsi     # 0x1d8b6
leaq 0x17f6b(%rip), %rdx     # 0x1d8f1
xorl %eax, %eax
callq 0x2290
movl 0x10(%rsp), %ecx
movq %rbp, %rdi
leaq 0x17f68(%rip), %rsi     # 0x1d903
leaq 0x17f4f(%rip), %rdx     # 0x1d8f1
xorl %eax, %eax
callq 0x2290
movq %rbp, %rdi
leaq 0x17ec5(%rip), %rsi     # 0x1d878
leaq 0x17f37(%rip), %rdx     # 0x1d8f1
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2290
movq %rbp, %rdi
leaq 0x17ec9(%rip), %rsi     # 0x1d897
leaq 0x17f1c(%rip), %rdx     # 0x1d8f1
movq %r15, %rcx
xorl %eax, %eax
callq 0x2290
movq %r14, %rdi
callq 0x2060
movl 0x14(%rsp), %eax
movl %eax, %ecx
movq 0x20(%rsp), %r15
movq 0x18(%rsp), %rbx
movb $0x1, %bpl
movl 0xc(%rsp), %eax
incl %eax
movl %eax, 0xc(%rsp)
cmpq %rax, %rbx
ja 0x58a8
movq %r12, %rdi
callq 0x2060
movq %r13, %rdi
callq 0x2060
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq