// File: /workspace/github_cpp_makefile_star2_O1/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 0x1bb520
cmpq $0x0, 0x10(%r15)
je 0x1bb707
movq (%rbx), %rax
movq 0x10(%rax), %rax
leaq (,%r13,4), %rdx
addq %r13, %rdx
movl 0x10(%rax,%rdx,8), %eax
cmpq %rax, 0x8(%r14)
movq %rdx, (%rsp)
jae 0x1bb595
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0x8(%r14)
movq 0x10(%r14), %rdi
leaq 0x8(,%rcx,8), %rsi
callq 0x2370
movq (%rsp), %rdx
movq %rax, 0x10(%r14)
movq 0x10(%r14), %rdi
movq 0x10(%rbx), %rax
movq (%rax,%r13,8), %rsi
shlq $0x3, %rsi
addq 0x28(%rbx), %rsi
movq (%rbx), %rax
movq 0x10(%rax), %rax
movl 0x10(%rax,%rdx,8), %edx
shlq $0x3, %rdx
callq 0x2160
testq %rbp, %rbp
je 0x1bb5f4
cmpb $0x0, 0x28(%r12)
js 0x1bb5eb
movq 0x10(%r14), %rsi
movq %r13, %rdi
movq %r12, %rdx
movq %rbx, %rcx
movq $-0x1, %r8
movsd 0x69f52(%rip), %xmm0    # 0x225538
callq 0xc6725
addq $0x30, %r12
decq %rbp
jne 0x1bb5c2
cmpq $0x0, 0x10(%r15)
je 0x1bb6d0
movl $0x1c, %ebp
xorl %r12d, %r12d
movl %r13d, 0x10(%rsp)
movq (%r15), %rax
movl -0xc(%rax,%rbp), %ecx
movl %ecx, 0x1c(%rsp)
movb (%rax,%rbp), %dl
movb 0x30(%rsp), %sil
shlb $0x6, %dl
andb $0x40, %dl
andb $-0x80, %sil
orb %dl, %sil
orb $0x3, %sil
movb %sil, 0x30(%rsp)
movq $0x0, 0x28(%rsp)
movl -0x18(%rax,%rbp), %esi
movl %esi, 0x8(%rsp)
movl -0x14(%rax,%rbp), %esi
incl %esi
movl %esi, 0xc(%rsp)
testb %dl, %dl
jne 0x1bb668
movl -0x8(%rax,%rbp), %ecx
movl %ecx, 0x14(%rsp)
movl -0x4(%rax,%rbp), %eax
incl %eax
movl %eax, 0x18(%rsp)
jmp 0x1bb699
movq (%rbx), %rdx
movq 0x10(%rdx), %rdx
leaq (%rcx,%rcx,4), %rcx
movl (%rdx,%rcx,8), %esi
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andl %r8d, %esi
movl -0x4(%rax,%rbp), %edi
notl %edi
addl %esi, %edi
movl %edi, 0x14(%rsp)
movl (%rdx,%rcx,8), %ecx
andl %r8d, %ecx
subl -0x8(%rax,%rbp), %ecx
movl %ecx, 0x18(%rsp)
movq 0x10(%r14), %rsi
movq %r13, %rdi
leaq 0x8(%rsp), %rdx
movq %rbx, %rcx
movq $-0x1, %r8
movsd 0x69e81(%rip), %xmm0    # 0x225538
callq 0xc6725
incq %r12
addq $0xa8, %rbp
cmpq 0x10(%r15), %r12
jb 0x1bb607
movq 0x10(%r14), %rdi
movq (%rsp), %rsi
shlq $0x3, %rsi
movq (%rbx), %rax
addq 0x10(%rax), %rsi
movq 0x8(%rbx), %rdx
movq 0x30(%rbx), %rcx
movsd 0x69dbd(%rip), %xmm0    # 0x2254b0
callq 0x1bb400
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x1bb6f8