// File: /workspace/github_cpp_makefile_star2_O1/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, -0x8(%rsp)
movq %r8, -0x28(%rsp)
movq 0x40(%rsp), %r10
movq 0x38(%rsp), %r8
movq %rdx, -0x18(%rsp)
testq %rdx, %rdx
sete %al
movq %rcx, -0x10(%rsp)
testq %rcx, %rcx
setle %cl
orb %al, %cl
jne 0x1a038f
testq %r10, %r10
setg -0x29(%rsp)
movq %r10, %r14
negq %r14
leaq 0x10(%r8), %rax
movq %rax, -0x20(%rsp)
xorl %eax, %eax
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
xorl %r12d, %r12d
movb -0x29(%rsp), %bl
testq %r10, %r10
jle 0x1a0376
leaq (%r12,%r12,2), %rdx
movq -0x18(%rsp), %rcx
leaq (%rcx,%rdx,4), %r9
movl 0x1c(%rsi), %r13d
movl 0x4(%r9), %r15d
movl $0x1, %edx
movq -0x20(%rsp), %r11
movb -0x29(%rsp), %bl
testl %r13d, %r13d
je 0x1a034e
movq (%rdi), %r8
movq 0x10(%r8), %r8
movl 0x10(%rsi), %ecx
leaq (%rcx,%rcx,4), %rcx
movl (%r8,%rcx,8), %ecx
andl %ebp, %ecx
movl (%r11), %r8d
notl %r8d
addl %ecx, %r8d
jmp 0x1a0351
movl (%r11), %r8d
cmpl %r15d, %r8d
jb 0x1a035c
cmpl 0x8(%r9), %r8d
jb 0x1a0376
cmpq %r10, %rdx
setl %bl
leaq (%r14,%rdx), %rcx
incq %rcx
incq %rdx
addq $0x18, %r11
cmpq $0x1, %rcx
jne 0x1a032a
movzbl %bl, %ecx
andl $0x1, %ecx
addq %rcx, %rax
incq %r12
cmpq -0x10(%rsp), %r12
jne 0x1a02fe
jmp 0x1a0391
xorl %eax, %eax
movq -0x28(%rsp), %rdx
testq %rdx, %rdx
je 0x1a0494
movl 0x10(%rdx), %ecx
movq %rcx, -0x10(%rsp)
testq %rcx, %rcx
je 0x1a0494
leaq 0xeae79(%rip), %rcx     # 0x28b230
movq 0x18(%rcx), %rcx
movq %rcx, -0x20(%rsp)
movq 0x18(%rdx), %rcx
movq %rcx, -0x18(%rsp)
testq %r10, %r10
setg -0x29(%rsp)
movq %r10, %r14
negq %r14
movq 0x38(%rsp), %rcx
addq $0x10, %rcx
movq %rcx, -0x28(%rsp)
xorl %r12d, %r12d
xorl %r13d, %r13d
movq -0x18(%rsp), %rcx
movq (%rcx,%r12,8), %rdx
movb -0x29(%rsp), %bl
testq %r10, %r10
jle 0x1a0478
movq %rdx, %rcx
shrq $0x21, %rcx
movq -0x20(%rsp), %r8
movq (%r8,%rcx,8), %r15
addq %r13, %r15
movl 0x1c(%rsi), %r8d
movl $0x1, %ecx
movq -0x28(%rsp), %r9
movb -0x29(%rsp), %bl
testl %r8d, %r8d
je 0x1a044e
movq (%rdi), %r11
movq 0x10(%r11), %r11
movl 0x10(%rsi), %ebp
leaq (%rbp,%rbp,4), %rbp
movl (%r11,%rbp,8), %ebp
movl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
andl %r11d, %ebp
movl (%r9), %r11d
notl %r11d
addl %ebp, %r11d
jmp 0x1a0451
movl (%r9), %r11d
movl %r11d, %r11d
cmpq %r11, %r13
ja 0x1a045e
cmpq %r11, %r15
jg 0x1a0478
cmpq %r10, %rcx
setl %bl
leaq (%r14,%rcx), %r11
incq %r11
incq %rcx
addq $0x18, %r9
cmpq $0x1, %r11
jne 0x1a0422
movl %edx, %ecx
addq %rcx, %r13
movzbl %bl, %ecx
andl $0x1, %ecx
addq %rcx, %rax
incq %r12
cmpq -0x10(%rsp), %r12
jne 0x1a03eb
movq -0x8(%rsp), %r15
testq %r15, %r15
je 0x1a0522
testq %r10, %r10
setg %cl
jle 0x1a0519
movl 0x1c(%rsi), %edx
movl 0x4(%r15), %r8d
movq %r10, %r9
negq %r9
movq 0x38(%rsp), %r12
addq $0x10, %r12
movl $0x1, %ebx
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
testl %edx, %edx
je 0x1a04f0
movq (%rdi), %r11
movq 0x10(%r11), %r11
movl 0x10(%rsi), %r14d
leaq (%r14,%r14,4), %r14
movl (%r11,%r14,8), %r14d
andl %ebp, %r14d
movl (%r12), %r11d
notl %r11d
addl %r14d, %r11d
jmp 0x1a04f4
movl (%r12), %r11d
cmpl %r8d, %r11d
jb 0x1a04ff
cmpl 0x8(%r15), %r11d
jb 0x1a0519
cmpq %r10, %rbx
setl %cl
leaq (%r9,%rbx), %r11
incq %r11
incq %rbx
addq $0x18, %r12
cmpq $0x1, %r11
jne 0x1a04ca
movzbl %cl, %ecx
andl $0x1, %ecx
addq %rcx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq