// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/ecovlp.cpp
// Function: ha_print_ovlp_stat_1(ec_ovec_buf_t*, unsigned long, unsigned long)
void ha_print_ovlp_stat_1(ec_ovec_buf_t *b, uint64_t n_thre, uint64_t n_a)
{
    double tt0 = yak_realtime_0();
    uint64_t k, forward, reverse, strong, weak, exact, no_l_indel;

    forward = reverse = strong = weak = exact = no_l_indel = 0;

    ///calculate overlaps
    for (k = 0; k < n_thre; ++k) {
        b->a[k].cnt[0] = b->a[k].cnt[1] = b->a[k].cnt[2] = b->a[k].cnt[3] = b->a[k].cnt[4] = b->a[k].cnt[5] = 0;
    }

    kt_for(n_thre, worker_hap_dc_ec_gen, b, n_a);

    for (k = 0; k < n_thre; ++k) {
        forward += b->a[k].cnt[0];
        reverse += b->a[k].cnt[1];
        strong += b->a[k].cnt[2];
        weak += b->a[k].cnt[3];
        exact += b->a[k].cnt[4];
        no_l_indel += b->a[k].cnt[5];
    }

    fprintf(stderr, "[M::%s] # overlaps: %lu\n", __func__, forward);
	fprintf(stderr, "[M::%s] # strong overlaps: %lu\n", __func__, strong);
	fprintf(stderr, "[M::%s] # weak overlaps: %lu\n", __func__, weak);
	fprintf(stderr, "[M::%s] # exact overlaps: %lu\n", __func__, exact); // this seems not right
	fprintf(stderr, "[M::%s] # inexact overlaps: %lu\n", __func__, forward - exact);
	fprintf(stderr, "[M::%s] # overlaps without large indels: %lu\n", __func__, no_l_indel);
	fprintf(stderr, "[M::%s] # reverse overlaps: %lu\n", __func__, reverse);
    fprintf(stderr, "[M::%s] # running time: %.3f\n", __func__, yak_realtime_0()-tt0);

    // fprintf(stderr, "\n[M::%s] # reads->%lu\n", __func__, n_a);
    // fprintf(stderr, "[M::%s] # corrected reads->%lu\n", __func__, rb);
    // fprintf(stderr, "[M::%s] # uncorrected reads->%lu\n", __func__, urb);
    // fprintf(stderr, "[M::%s::%.3f]\n", __func__, yak_realtime_0()-tt0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %rbp
movl $0xc0, %r14d
callq 0xefeb7
movsd %xmm0, 0x10(%rsp)
xorpd %xmm0, %xmm0
movq %r13, %rax
subq $0x1, %rax
jb 0x14c45b
movq (%rbp), %rcx
movupd %xmm0, 0x20(%rcx,%r14)
movupd %xmm0, 0x10(%rcx,%r14)
movupd %xmm0, (%rcx,%r14)
addq $0x5c0, %r14            # imm = 0x5C0
jmp 0x14c434
leaq 0x147(%rip), %rsi       # 0x14c5a9
movl %r13d, %edi
movq %rbp, %rdx
movq %rbx, %rcx
callq 0xc67c0
movl $0xe8, %eax
xorl %r15d, %r15d
xorl %edx, %edx
xorl %r14d, %r14d
xorl %ebx, %ebx
xorl %r12d, %r12d
xorl %esi, %esi
subq $0x1, %r13
jb 0x14c4b3
movq (%rbp), %rcx
addq -0x28(%rcx,%rax), %r15
addq -0x20(%rcx,%rax), %rdx
addq -0x18(%rcx,%rax), %r14
addq -0x10(%rcx,%rax), %rbx
addq -0x8(%rcx,%rax), %r12
addq (%rcx,%rax), %rsi
addq $0x5c0, %rax            # imm = 0x5C0
jmp 0x14c484
movq 0x106b26(%rip), %rbp    # 0x252fe0
movq (%rbp), %rdi
movq %rsi, (%rsp)
leaq 0xa4fd7(%rip), %rsi     # 0x1f14a0
leaq 0xa4fe9(%rip), %r13     # 0x1f14b9
movq %rdx, 0x8(%rsp)
movq %r13, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%rbp), %rdi
leaq 0xa4fe1(%rip), %rsi     # 0x1f14ce
movq %r13, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%rbp), %rdi
leaq 0xa4fe9(%rip), %rsi     # 0x1f14ee
movq %r13, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%rbp), %rdi
leaq 0xa4fef(%rip), %rsi     # 0x1f150c
movq %r13, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%rbp), %rdi
subq %r12, %r15
leaq 0xa4ff3(%rip), %rsi     # 0x1f152b
movq %r13, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%rbp), %rdi
leaq 0xa4ffc(%rip), %rsi     # 0x1f154c
movq %r13, %rdx
movq (%rsp), %rcx
xorl %eax, %eax
callq 0x22b0
movq (%rbp), %rdi
leaq 0xa5011(%rip), %rsi     # 0x1f157a
movq %r13, %rdx
movq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x22b0
movq (%rbp), %rbx
callq 0xefeb7
subsd 0x10(%rsp), %xmm0
leaq 0xa500d(%rip), %rsi     # 0x1f159b
movq %rbx, %rdi
movq %r13, %rdx
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22b0