// File: chhylp123[P]hifiasm/inter.cpp
// Function: test_het_aln_mmhap(unsigned long, ug_rid_cov_t*, u_trans_t*, unsigned long, overlap_region_alloc*, st_mt_t*)
uint32_t test_het_aln_mmhap(uint64_t uid, ug_rid_cov_t *ccov, u_trans_t *a, uint64_t a_n, overlap_region_alloc* ol, st_mt_t *sp)
{
	uint64_t k; u_trans_t p;
	if(a_n == 0 && ol->length == 0) return 0;
	kv_resize(uint64_t, *sp, ccov->ug->u.a[uid].n);
    memcpy(sp->a, ccov->cov.a+ccov->idx[uid], sizeof((*(sp->a)))*ccov->ug->u.a[uid].n);

	for (k = 0; k < a_n; k++) {
		if(a[k].del) continue;
		append_cov_line_ug_rid_cov_t(uid, sp->a, &(a[k]), ccov, ((uint64_t)-1), -1);
	}
	for (k = 0; k < ol->length; k++) {
		p.qn = uid; p.tn = ol->list[k].y_id; 
		p.rev = ol->list[k].y_pos_strand; p.f = RC_3; p.nw = 0;
		p.qs = ol->list[k].x_pos_s; p.qe = ol->list[k].x_pos_e+1;
		if(p.rev) {
			p.ts = ccov->ug->u.a[p.tn].len - (ol->list[k].y_pos_e+1); 
			p.te = ccov->ug->u.a[p.tn].len - ol->list[k].y_pos_s;
		} else {
			p.ts = ol->list[k].y_pos_s; 
			p.te = ol->list[k].y_pos_e+1;
		}
		append_cov_line_ug_rid_cov_t(uid, sp->a, &p, ccov, ((uint64_t)-1), -1);
	}

	return is_mmhom_node(sp->a, &(ccov->ug->u.a[uid]), ccov->rg, ccov->hom_min, 0.8);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x2beece
movq -0x30(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x2beece
movl $0x0, -0x4(%rbp)
jmp 0x2bf24b
jmp 0x2beed0
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
movq 0x10(%rcx), %rcx
imulq $0x28, -0x10(%rbp), %rdx
addq %rdx, %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
jae 0x2befd2
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, %ecx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rcx
shrq %rcx
movq -0x38(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x2, %rcx
movq -0x38(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x4, %rcx
movq -0x38(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x8, %rcx
movq -0x38(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x10, %rcx
movq -0x38(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x2befd4
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, %edx
shlq $0x3, %rdx
callq 0x2180
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x2bf084
movq -0x20(%rbp), %rax
imulq $0x30, -0x40(%rbp), %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
je 0x2bf046
jmp 0x2bf076
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x20(%rbp), %rdx
imulq $0x30, -0x40(%rbp), %rax
addq %rax, %rdx
movq -0x18(%rbp), %rcx
movq $-0x1, %r8
movsd 0xc3207(%rip), %xmm0    # 0x382278
callq 0x108a40
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x2bf024
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x2bf210
movq -0x10(%rbp), %rax
movl %eax, -0x68(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x5c(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
movb %al, %cl
movb -0x48(%rbp), %al
andb $0x1, %cl
shlb $0x6, %cl
andb $-0x41, %al
orb %cl, %al
movb %al, -0x48(%rbp)
movb -0x48(%rbp), %al
andb $-0x40, %al
orb $0x3, %al
movb %al, -0x48(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x70(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
movb -0x48(%rbp), %al
shrb $0x6, %al
andb $0x1, %al
cmpb $0x0, %al
je 0x2bf1a4
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movl -0x5c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq -0x30(%rbp), %rcx
movq (%rcx), %rcx
imulq $0xa8, -0x40(%rbp), %rdx
addq %rdx, %rcx
movl 0x18(%rcx), %ecx
addl $0x1, %ecx
subl %ecx, %eax
movl %eax, -0x64(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movl -0x5c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq -0x30(%rbp), %rcx
movq (%rcx), %rcx
imulq $0xa8, -0x40(%rbp), %rdx
addq %rdx, %rcx
subl 0x14(%rcx), %eax
movl %eax, -0x60(%rbp)
jmp 0x2bf1d7
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rcx
leaq -0x70(%rbp), %rdx
movq $-0x1, %r8
movsd 0xc307e(%rip), %xmm0    # 0x382278
callq 0x108a40
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x2bf08c
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rsi
imulq $0x28, -0x10(%rbp), %rax
addq %rax, %rsi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rcx
movsd 0xc2fed(%rip), %xmm0    # 0x382230
callq 0x2becc0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)