// File: /workspace/github_c_makefile_star2_O3/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 0x2310
movq %rax, %r13
movl $0x0, 0xc(%rsp)
testq %rbx, %rbx
je 0x5e57
movb $0x1, %bpl
xorl %eax, %eax
xorl %ecx, %ecx
xorl %edx, %edx
movq %r15, 0x20(%rsp)
movq %rbx, 0x18(%rsp)
cmpb $0x0, (%r12,%rcx)
jne 0x5e45
movq %rdx, 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 0x18b22
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 0x5d65
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 0x5d48
movq 0x18(%r15), %rax
testq %rax, %rax
movq 0x30(%rsp), %rcx
je 0x5daa
movq 0x28(%r15), %rsi
xorl %r15d, %r15d
testb $0x40, 0x23(%rsi)
jne 0x5d9f
movq (%rsi), %rdx
shrq %rdx
cmpb $0x0, (%r13,%rdx)
je 0x5d9f
movq 0x8(%rsi), %rdx
shrq %rdx
cmpb $0x1, (%r13,%rdx)
sbbq $-0x1, %r15
addq $0x30, %rsi
decq %rax
jne 0x5d7a
jmp 0x5dad
xorl %r15d, %r15d
leal 0x1(%rcx), %eax
movl %eax, 0x14(%rsp)
movl (%r14), %r8d
movq 0x28(%rsp), %rbp
movq %rbp, %rdi
leaq 0x19b28(%rip), %rsi     # 0x1f8ee
leaq 0x19b5c(%rip), %rdx     # 0x1f929
xorl %eax, %eax
callq 0x2280
movl 0x10(%rsp), %ecx
movq %rbp, %rdi
leaq 0x19b59(%rip), %rsi     # 0x1f93b
leaq 0x19b40(%rip), %rdx     # 0x1f929
xorl %eax, %eax
callq 0x2280
movq %rbp, %rdi
leaq 0x19ab6(%rip), %rsi     # 0x1f8b0
leaq 0x19b28(%rip), %rdx     # 0x1f929
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2280
movq %rbp, %rdi
leaq 0x19aba(%rip), %rsi     # 0x1f8cf
leaq 0x19b0d(%rip), %rdx     # 0x1f929
movq %r15, %rcx
xorl %eax, %eax
callq 0x2280
movq %r14, %rdi
callq 0x2060
movl 0xc(%rsp), %eax
movl 0x14(%rsp), %ecx
movl %ecx, %edx
movq 0x20(%rsp), %r15
movq 0x18(%rsp), %rbx
movb $0x1, %bpl
incl %eax
movl %eax, 0xc(%rsp)
movq %rax, %rcx
cmpq %rax, %rbx
ja 0x5cef
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