// File: 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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x19102
movq -0x8(%rbp), %rax
imulq $0x18, -0x50(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
imulq $0x18, -0x50(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq -0x8(%rbp), %rcx
imulq $0x18, -0x50(%rbp), %rdx
addq %rdx, %rcx
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
jge 0x190ef
movq -0x8(%rbp), %rax
imulq $0x18, -0x50(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
imulq $0x28, -0x58(%rbp), %rcx
addq %rcx, %rax
movzbl 0x20(%rax), %eax
cmpl $0x1, %eax
jne 0x19048
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
imulq $0x18, -0x50(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
imulq $0x28, -0x58(%rbp), %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x1e, %rax
andq $0x1, %rax
cmpl $0x1, %eax
jne 0x1907c
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
imulq $0x18, -0x50(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
imulq $0x28, -0x58(%rbp), %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x1e, %rax
andq $0x1, %rax
cmpl $0x0, %eax
jne 0x190b0
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
imulq $0x18, -0x50(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
imulq $0x28, -0x58(%rbp), %rcx
addq %rcx, %rax
movzbl 0x21(%rax), %eax
cmpl $0x1, %eax
jne 0x190dc
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x190de
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x19000
jmp 0x190f1
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x18fbc
movq 0x3aaed7(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x20(%rbp), %rcx
leaq 0x368955(%rip), %rsi    # 0x381a6c
leaq 0x368968(%rip), %rdx    # 0x381a86
movb $0x0, %al
callq 0x22a0
movq 0x3aaeb4(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x30(%rbp), %rcx
leaq 0x36895f(%rip), %rsi    # 0x381a99
leaq 0x368945(%rip), %rdx    # 0x381a86
movb $0x0, %al
callq 0x22a0
movq 0x3aae91(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x38(%rbp), %rcx
leaq 0x36895d(%rip), %rsi    # 0x381aba
leaq 0x368922(%rip), %rdx    # 0x381a86
movb $0x0, %al
callq 0x22a0
movq 0x3aae6e(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x40(%rbp), %rcx
leaq 0x368959(%rip), %rsi    # 0x381ad9
leaq 0x3688ff(%rip), %rdx    # 0x381a86
movb $0x0, %al
callq 0x22a0
movq 0x3aae4b(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x20(%rbp), %rcx
subq -0x40(%rbp), %rcx
leaq 0x368952(%rip), %rsi    # 0x381af9
leaq 0x3688d8(%rip), %rdx    # 0x381a86
movb $0x0, %al
callq 0x22a0
movq 0x3aae24(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x48(%rbp), %rcx
leaq 0x368951(%rip), %rsi    # 0x381b1b
leaq 0x3688b5(%rip), %rdx    # 0x381a86
movb $0x0, %al
callq 0x22a0
movq 0x3aae01(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x28(%rbp), %rcx
leaq 0x36895d(%rip), %rsi    # 0x381b4a
leaq 0x368892(%rip), %rdx    # 0x381a86
movb $0x0, %al
callq 0x22a0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)