// File: /workspace/github_cpp_makefile_star2_O1/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 0x130403
movsd %xmm0, 0x10(%rsp)
testq %r13, %r13
je 0x22d4f
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 0x22d36
leaq 0x167924(%rip), %rsi    # 0x18a67a
movl %r13d, %edi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x1047b4
testq %r13, %r13
jne 0x22d7a
xorl %r15d, %r15d
xorl %ecx, %ecx
xorl %ebx, %ebx
xorl %ebp, %ebp
xorl %r12d, %r12d
xorl %r14d, %r14d
jmp 0x22db3
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 0x22d91
movq %rcx, 0x8(%rsp)
movq 0x267221(%rip), %r13    # 0x289fe0
movq (%r13), %rdi
leaq 0x2105c6(%rip), %rsi    # 0x233390
leaq 0x2105d8(%rip), %rdx    # 0x2333a9
movq %r15, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r13), %rdi
leaq 0x2105d8(%rip), %rsi    # 0x2333be
leaq 0x2105bc(%rip), %rdx    # 0x2333a9
movq %rbx, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r13), %rdi
leaq 0x2105dc(%rip), %rsi    # 0x2333de
leaq 0x2105a0(%rip), %rbx    # 0x2333a9
movq %rbx, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r13), %rdi
leaq 0x2105db(%rip), %rsi    # 0x2333fc
movq %rbx, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r13), %rdi
subq %r12, %r15
leaq 0x2105df(%rip), %rsi    # 0x23341b
movq %rbx, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r13), %rdi
leaq 0x2105e8(%rip), %rsi    # 0x23343c
movq %rbx, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r13), %rdi
leaq 0x2105fe(%rip), %rsi    # 0x23346a
movq %rbx, %rdx
movq %rbx, %r14
movq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r13), %rbx
callq 0x130403
subsd 0x10(%rsp), %xmm0
leaq 0x2105f7(%rip), %rsi    # 0x23348b
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