// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Assembly.cpp
// Function: ha_print_ovlp_stat(ma_hit_t_alloc*, ma_hit_t_alloc*, long long)
void ha_print_ovlp_stat(ma_hit_t_alloc* paf, ma_hit_t_alloc* rev_paf, long long readNum)
{
	long long forward, reverse, strong, weak, exact, no_l_indel;
	long long i, j;

	no_l_indel = forward = reverse = exact = strong = weak = 0;
	for (i = 0; i < readNum; i++) {
		forward += paf[i].length;
		reverse += rev_paf[i].length;
		for (j = 0; j < paf[i].length; j++) {
			if (paf[i].buffer[j].el == 1) exact++;
			if (paf[i].buffer[j].ml == 1) strong++;
			if (paf[i].buffer[j].ml == 0) weak++;
			if (paf[i].buffer[j].no_l_indel == 1) no_l_indel++;
		}
	}
	fprintf(stderr, "[M::%s] # overlaps: %lld\n", __func__, forward);
	fprintf(stderr, "[M::%s] # strong overlaps: %lld\n", __func__, strong);
	fprintf(stderr, "[M::%s] # weak overlaps: %lld\n", __func__, weak);
	fprintf(stderr, "[M::%s] # exact overlaps: %lld\n", __func__, exact); // this seems not right
	fprintf(stderr, "[M::%s] # inexact overlaps: %lld\n", __func__, forward - exact);
	fprintf(stderr, "[M::%s] # overlaps without large indels: %lld\n", __func__, no_l_indel);
	fprintf(stderr, "[M::%s] # reverse overlaps: %lld\n", __func__, reverse);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x10(%rsp)
xorl %ebx, %ebx
testq %rdx, %rdx
cmovleq %rbx, %rdx
movq $0x0, 0x8(%rsp)
xorl %ebp, %ebp
xorl %r13d, %r13d
xorl %r12d, %r12d
xorl %r15d, %r15d
xorl %eax, %eax
cmpq %rdx, %rax
je 0xea08
movq %rbx, %rsi
imulq $0x18, %rax, %r8
leaq (%rdi,%r8), %r9
movl 0xc(%rdi,%r8), %ecx
movq 0x10(%rsp), %r10
movl 0xc(%r10,%r8), %r8d
imulq $0x28, %rcx, %r10
xorl %r11d, %r11d
cmpq %r11, %r10
je 0xe9f8
movq (%r9), %rbx
xorl %r14d, %r14d
cmpb $0x1, 0x20(%rbx,%r11)
sete %r14b
addq %r14, %r12
movl 0x18(%rbx,%r11), %r14d
shrl $0x1e, %r14d
andl $0x1, %r14d
addq %r14, %rbp
xorq $0x1, %r14
addq %r14, %r13
xorl %r14d, %r14d
cmpb $0x1, 0x21(%rbx,%r11)
sete %r14b
addq %r14, %r15
addq $0x28, %r11
jmp 0xe9b3
addq %rcx, %rsi
movq %rsi, %rbx
addq %r8, 0x8(%rsp)
incq %rax
jmp 0xe98d
movq 0x2445d1(%rip), %r14    # 0x252fe0
movq (%r14), %rdi
leaq 0x1d4319(%rip), %rsi    # 0x1e2d32
leaq 0x1d432c(%rip), %rdx    # 0x1e2d4c
movq %rbx, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r14), %rdi
leaq 0x1d432b(%rip), %rsi    # 0x1e2d5f
leaq 0x1d4311(%rip), %rdx    # 0x1e2d4c
movq %rbp, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r14), %rdi
leaq 0x1d4331(%rip), %rsi    # 0x1e2d80
leaq 0x1d42f6(%rip), %rbp    # 0x1e2d4c
movq %rbp, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r14), %rdi
leaq 0x1d4332(%rip), %rsi    # 0x1e2d9f
movq %rbp, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r14), %rdi
subq %r12, %rbx
leaq 0x1d4338(%rip), %rsi    # 0x1e2dbf
movq %rbp, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r14), %rdi
leaq 0x1d4343(%rip), %rsi    # 0x1e2de1
movq %rbp, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r14), %rdi
leaq 0x1d435b(%rip), %rsi    # 0x1e2e10
movq %rbp, %rdx
movq 0x8(%rsp), %rcx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22b0