// File: /workspace/github_cpp_makefile_star2_O3/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, %r14
movq %rsi, %r13
movq %rdi, %rbx
callq 0x13662b
movsd %xmm0, 0x10(%rsp)
testq %r13, %r13
jne 0x21fce
leaq 0x170f06(%rip), %rsi    # 0x192eb6
xorl %r15d, %r15d
xorl %edi, %edi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x108f2c
xorl %ecx, %ecx
xorl %ebx, %ebx
xorl %ebp, %ebp
xorl %r12d, %r12d
xorl %r14d, %r14d
jmp 0x22044
movl $0xc0, %eax
addq (%rbx), %rax
xorpd %xmm0, %xmm0
movq %r13, %rcx
movupd %xmm0, 0x20(%rax)
movupd %xmm0, 0x10(%rax)
movupd %xmm0, (%rax)
addq $0x5c0, %rax            # imm = 0x5C0
decq %rcx
jne 0x21fdd
leaq 0x170eb9(%rip), %rsi    # 0x192eb6
movl %r13d, %edi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x108f2c
movl $0xe8, %eax
addq (%rbx), %rax
xorl %r14d, %r14d
xorl %r12d, %r12d
xorl %ebp, %ebp
xorl %ebx, %ebx
xorl %ecx, %ecx
xorl %r15d, %r15d
addq -0x28(%rax), %r15
addq -0x20(%rax), %rcx
addq -0x18(%rax), %rbx
addq -0x10(%rax), %rbp
addq -0x8(%rax), %r12
addq (%rax), %r14
addq $0x5c0, %rax            # imm = 0x5C0
decq %r13
jne 0x22022
movq %rcx, 0x8(%rsp)
movq 0x272f90(%rip), %r13    # 0x294fe0
movq (%r13), %rdi
leaq 0x21d585(%rip), %rsi    # 0x23f5e0
leaq 0x21d597(%rip), %rdx    # 0x23f5f9
movq %r15, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r13), %rdi
leaq 0x21d597(%rip), %rsi    # 0x23f60e
leaq 0x21d57b(%rip), %rdx    # 0x23f5f9
movq %rbx, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r13), %rdi
leaq 0x21d59b(%rip), %rsi    # 0x23f62e
leaq 0x21d55f(%rip), %rbx    # 0x23f5f9
movq %rbx, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r13), %rdi
leaq 0x21d59a(%rip), %rsi    # 0x23f64c
movq %rbx, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r13), %rdi
subq %r12, %r15
leaq 0x21d59e(%rip), %rsi    # 0x23f66b
movq %rbx, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r13), %rdi
leaq 0x21d5a7(%rip), %rsi    # 0x23f68c
movq %rbx, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r13), %rdi
leaq 0x21d5bd(%rip), %rsi    # 0x23f6ba
movq %rbx, %rdx
movq %rbx, %r14
movq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r13), %rbx
callq 0x13662b
subsd 0x10(%rsp), %xmm0
leaq 0x21d5b6(%rip), %rsi    # 0x23f6db
movq %rbx, %rdi
movq %r14, %rdx
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22b0