// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: prt_scaf_stats(sec_t*, ma_ug_t*, char const*, unsigned long)
void prt_scaf_stats(sec_t *scp, ma_ug_t *ctg, const char* prefix, uint64_t id)
{
    uint64_t k, tl0, tl1; ma_utg_t *z = NULL; char name[32];
    for (k = tl0 = tl1 = 0; k < scp->n; k++) {
        z = &(ctg->u.a[((uint32_t)scp->a[k])>>1]); tl0 += z->len; tl1 += (scp->a[k]>>32);
    }
    sprintf(name, "%s%.6lu%c", prefix, id + 1, "lc"[scp->is_c]);

    fprintf(stderr, "[M::%s] [M::%s] tot::%lu\tel::%lu\tnl::%lu\tis_c::%lu\t#::%lu\t%s\n", __func__, name, tl0+tl1, tl0, tl1, scp->is_c, (uint64_t)scp->n, ((scp->n>1)?"scf":"ctg"));
    for (k = 0; k < scp->n; k++) {
        z = &(ctg->u.a[((uint32_t)scp->a[k])>>1]);
        fprintf(stderr, "%s%.6u%c(%c)\tlen::%u\tNs::%lu\n", 
        prefix, (((uint32_t)scp->a[k])>>1)+1, "lc"[z->circ], "+-"[(((uint32_t)scp->a[k])&1)], z->len, (scp->a[k]>>32));
    }
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0xc8, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0xefb80
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x30(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0xefb0c
leaq -0x70(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
addq $0x1, %rcx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x295764(%rip), %rax    # 0x385303
movsbl (%rax,%rsi), %r8d
leaq 0x297393(%rip), %rsi    # 0x386f3e
movb $0x0, %al
callq 0x2050
movq 0x2d4427(%rip), %rax    # 0x3c3fe0
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
leaq -0x70(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x38(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x1, 0x8(%rax)
jbe 0xefc26
leaq 0x297378(%rip), %rax    # 0x386f95
movq %rax, -0xb0(%rbp)
jmp 0xefc36
leaq 0x29736c(%rip), %rax    # 0x386f99
movq %rax, -0xb0(%rbp)
jmp 0xefc36
movq -0x78(%rbp), %r10
movq -0x80(%rbp), %r11
movq -0x88(%rbp), %rbx
movq -0x90(%rbp), %r9
movq -0x98(%rbp), %r8
movq -0xa0(%rbp), %rcx
movq -0xa8(%rbp), %rdi
movq -0xb0(%rbp), %rax
leaq 0x2972d9(%rip), %rsi    # 0x386f48
leaq 0x297310(%rip), %rdx    # 0x386f86
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movb $0x0, %al
callq 0x22a0
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0xefd7c
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x30(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq 0x2d4308(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %ecx
shrl %ecx
addl $0x1, %ecx
movq -0x48(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x2955f9(%rip), %rax    # 0x385303
movsbl (%rax,%rsi), %r8d
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x30(%rbp), %rsi
movq (%rax,%rsi,8), %rax
andl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x29316e(%rip), %rax    # 0x382e9b
movsbl (%rax,%rsi), %r9d
movq -0x48(%rbp), %rax
movl (%rax), %r10d
andl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x30(%rbp), %rsi
movq (%rax,%rsi,8), %rax
shrq $0x20, %rax
leaq 0x297242(%rip), %rsi    # 0x386f9d
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x22a0
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0xefc98
addq $0xc8, %rsp
popq %rbx
popq %rbp
retq
nopw %cs:(%rax,%rax)