// File: /workspace/github_cpp_makefile_star2_O3/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 0x1c539b
cmpq $0x0, 0x10(%r15)
je 0x1c5583
movq (%rbx), %rax
movq 0x10(%rax), %rax
leaq (,%r13,4), %rsi
addq %r13, %rsi
movl 0x10(%rax,%rsi,8), %edx
cmpq %rdx, 0x8(%r14)
movq %rsi, (%rsp)
jae 0x1c5420
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,8), %edx
jmp 0x1c5424
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
testq %rbp, %rbp
je 0x1c5474
cmpb $0x0, 0x28(%r12)
js 0x1c546b
movq 0x10(%r14), %rsi
movq %r13, %rdi
movq %r12, %rdx
movq %rbx, %rcx
movq $-0x1, %r8
movsd 0x6c1d2(%rip), %xmm0    # 0x231638
callq 0xc74f4
addq $0x30, %r12
decq %rbp
jne 0x1c5442
cmpq $0x0, 0x10(%r15)
je 0x1c554c
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 0x1c54e4
movl -0x8(%rax,%rbp), %ecx
movl %ecx, 0x14(%rsp)
movl -0x4(%rax,%rbp), %ecx
incl %ecx
jmp 0x1c5511
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 0x6c105(%rip), %xmm0    # 0x231638
callq 0xc74f4
incq %r12
addq $0xa8, %rbp
cmpq 0x10(%r15), %r12
jb 0x1c5487
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 0x6c041(%rip), %xmm0    # 0x2315b0
callq 0x1c527b
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x1c5574