// File: /workspace/github_c_makefile_star2_O2/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, 0x10(%rsp)
movq 0x8(%rdi), %r14
movq (%r14), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2250
movq %rax, %rbp
movq %rbx, %rdi
callq 0x2310
movq %rax, %r13
movb $0x1, %r12b
xorl %eax, %eax
xorl %edx, %edx
movq %rbx, 0x28(%rsp)
movq %rbp, 0x20(%rsp)
movl %eax, 0xc(%rsp)
movl %eax, %ecx
cmpq %rcx, %rbx
jbe 0x4575
cmpb $0x0, (%rbp,%rcx)
jne 0x456e
movq %rdx, 0x30(%rsp)
andl $0x0, (%rsp)
movq %r14, %rdi
leaq 0xc(%rsp), %rsi
pushq $0x1
popq %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
leaq 0x8(%rsp), %r9
callq 0x146fd
movq %rax, %r15
movq %r13, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x21e0
movl 0x8(%rsp), %eax
xorl %ebx, %ebx
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x4491
movq 0x10(%r14), %rdx
movl (%r15,%rcx,4), %esi
imulq $0x28, %rsi, %rdi
addq (%rdx,%rdi), %rbx
movb %r12b, (%r13,%rsi)
movb %r12b, (%rbp,%rsi)
incq %rcx
jmp 0x446d
movq 0x18(%r14), %rax
xorl %edi, %edi
xorl %ebp, %ebp
movq 0x30(%rsp), %rcx
subq $0x1, %rax
jb 0x44d6
movq 0x28(%r14), %rdx
testb $0x40, 0x23(%rdx,%rdi)
jne 0x44d0
movq (%rdx,%rdi), %rsi
shrq %rsi
cmpb $0x0, (%r13,%rsi)
je 0x44d0
movq 0x8(%rdx,%rdi), %rdx
shrq %rdx
cmpb $0x1, (%r13,%rdx)
sbbq $-0x1, %rbp
addq $0x30, %rdi
jmp 0x449e
leal 0x1(%rcx), %eax
movl %eax, 0x1c(%rsp)
movl (%r15), %r8d
movq 0x10(%rsp), %rdi
leaq 0x153ca(%rip), %rsi     # 0x198b6
leaq 0x153fe(%rip), %rdx     # 0x198f1
xorl %eax, %eax
callq 0x2280
movl 0x8(%rsp), %ecx
movq 0x10(%rsp), %rdi
leaq 0x153f9(%rip), %rsi     # 0x19903
leaq 0x153e0(%rip), %rdx     # 0x198f1
xorl %eax, %eax
callq 0x2280
movq 0x10(%rsp), %rdi
leaq 0x15354(%rip), %rsi     # 0x19878
leaq 0x153c6(%rip), %rdx     # 0x198f1
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2280
movq 0x10(%rsp), %rdi
leaq 0x15356(%rip), %rsi     # 0x19897
leaq 0x153a9(%rip), %rdx     # 0x198f1
movq %rbp, %rcx
xorl %eax, %eax
callq 0x2280
movq %r15, %rdi
callq 0x2060
movl 0xc(%rsp), %eax
movl 0x1c(%rsp), %ecx
movl %ecx, %edx
movq 0x28(%rsp), %rbx
movq 0x20(%rsp), %rbp
incl %eax
jmp 0x4418
movq %rbp, %rdi
callq 0x2060
movq %r13, %rdi
callq 0x2060
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq