// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %rax
movq %rsi, (%rsp)
testq %rdx, %rdx
jle 0x3b61
movq %rdx, %rsi
xorl %eax, %eax
xorl %r14d, %r14d
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %ebp, %ebp
xorl %ebx, %ebx
xorl %r15d, %r15d
movq %rbx, %rdx
imulq $0x18, %rax, %rcx
movl 0xc(%rdi,%rcx), %r8d
testq %r8, %r8
je 0x3b45
leaq (%rdi,%rcx), %r9
movq (%r9), %r9
imulq $0x28, %r8, %r10
xorl %r11d, %r11d
xorl %ebx, %ebx
cmpb $0x1, 0x20(%r9,%r11)
sete %bl
addq %rbx, %r12
movl 0x18(%r9,%r11), %ebx
shrl $0x1e, %ebx
andl $0x1, %ebx
addq %rbx, %rbp
xorq $0x1, %rbx
addq %rbx, %r13
xorl %ebx, %ebx
cmpb $0x1, 0x21(%r9,%r11)
sete %bl
addq %rbx, %r14
addq $0x28, %r11
cmpq %r11, %r10
jne 0x3b0b
addq %r8, %r15
movq (%rsp), %r8
movl 0xc(%r8,%rcx), %ecx
movq %rdx, %rbx
addq %rcx, %rbx
incq %rax
cmpq %rsi, %rax
jne 0x3aec
jmp 0x3b71
xorl %r15d, %r15d
xorl %ebx, %ebx
xorl %ebp, %ebp
xorl %r13d, %r13d
xorl %r12d, %r12d
xorl %r14d, %r14d
movq 0x286468(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x221180(%rip), %rsi    # 0x224d02
leaq 0x221193(%rip), %rdx    # 0x224d1c
movq %r15, %rcx
xorl %eax, %eax
callq 0x22b0
movq 0x286446(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x22118b(%rip), %rsi    # 0x224d2f
leaq 0x221171(%rip), %rdx    # 0x224d1c
movq %rbp, %rcx
xorl %eax, %eax
callq 0x22b0
movq 0x286424(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x22118a(%rip), %rsi    # 0x224d50
leaq 0x22114f(%rip), %rbp    # 0x224d1c
movq %rbp, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x22b0
movq 0x2863ff(%rip), %r13    # 0x289fe0
movq (%r13), %rdi
leaq 0x221183(%rip), %rsi    # 0x224d6f
movq %rbp, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r13), %rdi
subq %r12, %r15
leaq 0x221188(%rip), %rsi    # 0x224d8f
movq %rbp, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r13), %rdi
leaq 0x221192(%rip), %rsi    # 0x224db1
movq %rbp, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x22b0
movq (%r13), %rdi
leaq 0x2211a9(%rip), %rsi    # 0x224de0
movq %rbp, %rdx
movq %rbx, %rcx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22b0