// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %r14
movq %r8, %r15
movq %rcx, %rbp
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r13
testq %rcx, %rcx
jne 0x179f38
cmpq $0x0, 0x10(%r15)
je 0x17a10a
movq (%rbx), %rax
movq 0x10(%rax), %rax
imulq $0x28, %r13, %rcx
movl 0x10(%rax,%rcx), %edx
cmpq %rdx, 0x8(%r14)
movq %rcx, (%rsp)
jae 0x179fb6
decq %rdx
movq %rdx, %rax
shrq %rax
orq %rdx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x10, %rax
orq %rcx, %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%r14)
movq 0x10(%r14), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x2370
movq %rax, %rdi
movq %rax, 0x10(%r14)
movq (%rbx), %rax
movq 0x10(%rax), %rax
movq (%rsp), %rcx
movl 0x10(%rax,%rcx), %edx
jmp 0x179fba
movq 0x10(%r14), %rdi
movq 0x10(%rbx), %rax
movq (%rax,%r13,8), %rsi
shlq $0x3, %rsi
addq 0x28(%rbx), %rsi
shlq $0x3, %rdx
callq 0x2160
subq $0x1, %rbp
jb 0x17a005
cmpb $0x0, 0x28(%r12)
js 0x179fff
movq 0x10(%r14), %rsi
movq %r13, %rdi
movq %r12, %rdx
movq %rbx, %rcx
pushq $-0x1
popq %r8
movsd 0x69586(%rip), %xmm0    # 0x1e3580
callq 0x8af8f
addq $0x30, %r12
jmp 0x179fd3
pushq $0x1c
popq %r12
xorl %ebp, %ebp
cmpq 0x10(%r15), %rbp
jae 0x17a0d7
movl %r13d, 0x10(%rsp)
movq (%r15), %rax
movl -0xc(%rax,%r12), %ecx
movl %ecx, 0x1c(%rsp)
movb (%rax,%r12), %dl
movb 0x30(%rsp), %sil
shlb $0x6, %dl
andb $0x40, %dl
andb $-0x80, %sil
orb %dl, %sil
orb $0x3, %sil
movb %sil, 0x30(%rsp)
andq $0x0, 0x28(%rsp)
movl -0x18(%rax,%r12), %esi
movl %esi, 0x8(%rsp)
movl -0x14(%rax,%r12), %esi
incl %esi
movl %esi, 0xc(%rsp)
testb %dl, %dl
jne 0x17a075
movl -0x8(%rax,%r12), %ecx
movl %ecx, 0x14(%rsp)
movl -0x4(%rax,%r12), %ecx
incl %ecx
jmp 0x17a0a4
movq (%rbx), %rdx
movq 0x10(%rdx), %rdx
imulq $0x28, %rcx, %rcx
movl (%rdx,%rcx), %esi
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andl %r8d, %esi
movl -0x4(%rax,%r12), %edi
notl %edi
addl %esi, %edi
movl %edi, 0x14(%rsp)
movl (%rdx,%rcx), %ecx
andl %r8d, %ecx
subl -0x8(%rax,%r12), %ecx
movl %ecx, 0x18(%rsp)
movq 0x10(%r14), %rsi
movq %r13, %rdi
leaq 0x8(%rsp), %rdx
movq %rbx, %rcx
pushq $-0x1
popq %r8
movsd 0x694bd(%rip), %xmm0    # 0x1e3580
callq 0x8af8f
incq %rbp
addq $0xa8, %r12
jmp 0x17a00b
movq 0x10(%r14), %rdi
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
movq (%rsp), %rsi
addq 0x10(%rax), %rsi
movq 0x30(%rbx), %rcx
movsd 0x6940a(%rip), %xmm0    # 0x1e3500
callq 0x179e1e
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x17a0fb