// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: debug_utg_ct_t(ul_idx_t const*, overlap_region*, utg_ct_t*, long, ma_utg_t*, utg_ct_t*, haplotype_evdience*, long)
int64_t debug_utg_ct_t(const ul_idx_t *uref, overlap_region* o, utg_ct_t *ct_a, int64_t ct_n, ma_utg_t *u, utg_ct_t *z, haplotype_evdience *he_a, int64_t he_n)
{
	int64_t k, i, l, rs, re, ss, m = 0;
	utg_ct_t *p = NULL;
	if(ct_a && ct_n) {
		for (i = 0; i < ct_n; i++) {
			p = &(ct_a[i]);
			for (k = 0; k < he_n; k++) {
				ss = o->y_pos_strand?uref->ug->u.a[o->y_id].len - he_a[k].cov - 1:he_a[k].cov;
				if(ss >= p->s && ss < p->e) break;
			}
			if(k < he_n) m++;
		}
	}
	if(u) {
		for (i = l = 0; i < u->n; i++) {
			rs = l; re = l + Get_READ_LENGTH(R_INF, (u->a[i]>>33));
			l += (uint32_t)u->a[i];
			for (k = 0; k < he_n; k++) {
				ss = o->y_pos_strand?uref->ug->u.a[o->y_id].len - he_a[k].cov - 1:he_a[k].cov;
				if(ss >= rs && ss < re) break;
			}
			if(k < he_n) m++;
		}
	}

	if(z) {
		for (k = 0; k < he_n; k++) {
			ss = o->y_pos_strand?uref->ug->u.a[o->y_id].len - he_a[k].cov - 1:he_a[k].cov;
			if(ss >= z->s && ss < z->e) break;
		}
		if(k < he_n) m++;
	}
	return m;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r9, -0x10(%rsp)
movq %r8, -0x30(%rsp)
movq 0x40(%rsp), %r14
movq 0x38(%rsp), %r10
movq %rdx, -0x20(%rsp)
testq %rdx, %rdx
sete %r8b
movq %rcx, -0x18(%rsp)
testq %rcx, %rcx
setle %r9b
orb %r8b, %r9b
movq %r14, %rbp
jne 0x1a9103
movq %r14, %rbx
negq %rbx
leaq 0x10(%r10), %rax
movq %rax, -0x28(%rsp)
xorl %r11d, %r11d
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
xorl %r15d, %r15d
testq %r14, %r14
jle 0x1a90ed
movq %r11, %rcx
leaq (%r15,%r15,2), %r8
movq -0x20(%rsp), %rax
leaq (%rax,%r8,4), %r9
movl 0x1c(%rsi), %r12d
movl 0x4(%r9), %r13d
movb $0x1, %r14b
movl $0x1, %r8d
movq -0x28(%rsp), %r11
testl %r12d, %r12d
je 0x1a90af
movq (%rdi), %r10
movq 0x10(%r10), %r10
movl 0x10(%rsi), %eax
leaq (%rax,%rax,4), %rax
movl (%r10,%rax,8), %eax
andl %edx, %eax
movl (%r11), %r10d
notl %r10d
addl %eax, %r10d
jmp 0x1a90b2
movl (%r11), %r10d
cmpl %r13d, %r10d
jb 0x1a90bd
cmpl 0x8(%r9), %r10d
jb 0x1a90d8
cmpq %rbp, %r8
setl %r14b
leaq (%rbx,%r8), %rax
incq %rax
incq %r8
addq $0x18, %r11
cmpq $0x1, %rax
jne 0x1a908b
movzbl %r14b, %r8d
andl $0x1, %r8d
movq %rcx, %r11
movq %rbp, %r14
movq 0x38(%rsp), %r10
jmp 0x1a90f0
xorl %r8d, %r8d
addq %r8, %r11
incq %r15
cmpq -0x18(%rsp), %r15
jne 0x1a905c
jmp 0x1a9106
xorl %r11d, %r11d
movq -0x30(%rsp), %rdx
testq %rdx, %rdx
je 0x1a9209
movl 0x10(%rdx), %eax
movq %rax, -0x20(%rsp)
testq %rax, %rax
je 0x1a9209
leaq 0xed104(%rip), %rax     # 0x296230
movq 0x18(%rax), %rax
movq %rax, -0x8(%rsp)
movq 0x18(%rdx), %rax
movq %rax, -0x28(%rsp)
movq %r14, %rbx
negq %rbx
leaq 0x10(%r10), %rax
movq %rax, -0x30(%rsp)
xorl %r15d, %r15d
movl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
xorl %r12d, %r12d
movq -0x28(%rsp), %rax
movq (%rax,%r15,8), %rax
testq %rbp, %rbp
jle 0x1a91f1
movq %rax, -0x18(%rsp)
shrq $0x21, %rax
movq -0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rdx
addq %r12, %rdx
movl 0x1c(%rsi), %r9d
movb $0x1, %r14b
movl $0x1, %r8d
movq -0x30(%rsp), %rcx
testl %r9d, %r9d
je 0x1a91b8
movq (%rdi), %rax
movq 0x10(%rax), %rax
movl 0x10(%rsi), %r10d
leaq (%r10,%r10,4), %r10
movl (%rax,%r10,8), %eax
andl %r13d, %eax
movl (%rcx), %r10d
notl %r10d
addl %eax, %r10d
jmp 0x1a91bb
movl (%rcx), %r10d
movl %r10d, %r10d
cmpq %r10, %r12
ja 0x1a91c8
cmpq %r10, %rdx
jg 0x1a91e3
cmpq %rbp, %r8
setl %r14b
leaq (%rbx,%r8), %rax
incq %rax
incq %r8
addq $0x18, %rcx
cmpq $0x1, %rax
jne 0x1a9192
movzbl %r14b, %ecx
andl $0x1, %ecx
movq -0x18(%rsp), %rax
jmp 0x1a91f3
xorl %ecx, %ecx
addq %rcx, %r11
movl %eax, %eax
addq %rax, %r12
incq %r15
cmpq -0x20(%rsp), %r15
jne 0x1a9159
movq -0x10(%rsp), %r14
testq %r14, %r14
je 0x1a929f
testq %rbp, %rbp
jle 0x1a929a
movq %rbp, %r15
movl 0x1c(%rsi), %ecx
movl 0x4(%r14), %edx
movq %rbp, %r8
negq %r8
movq 0x38(%rsp), %r12
addq $0x10, %r12
movb $0x1, %r9b
movl $0x1, %ebx
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
testl %ecx, %ecx
je 0x1a9267
movq (%rdi), %rax
movq 0x10(%rax), %rax
movl 0x10(%rsi), %r10d
leaq (%r10,%r10,4), %r10
movl (%rax,%r10,8), %eax
andl %ebp, %eax
movl (%r12), %r10d
notl %r10d
addl %eax, %r10d
jmp 0x1a926b
movl (%r12), %r10d
cmpl %edx, %r10d
jb 0x1a9276
cmpl 0x8(%r14), %r10d
jb 0x1a9291
cmpq %r15, %rbx
setl %r9b
leaq (%r8,%rbx), %rax
incq %rax
incq %rbx
addq $0x18, %r12
cmpq $0x1, %rax
jne 0x1a9242
movzbl %r9b, %eax
andl $0x1, %eax
jmp 0x1a929c
xorl %eax, %eax
addq %rax, %r11
movq %r11, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq