// File: /workspace/github_cpp_makefile_star2_O2/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 0x40(%rsp), %r14
movq 0x38(%rsp), %r15
testq %rdx, %rdx
sete %al
testq %rcx, %rcx
sete %r10b
orb %al, %r10b
jne 0x1612fc
movq %r8, -0x18(%rsp)
movq %r9, %r13
xorl %ebx, %ebx
testq %r14, %r14
movq %r14, %rax
movl $0x0, %r14d
cmovgq %rax, %r14
testq %rcx, %rcx
cmovleq %rbx, %rcx
addq $0x10, %r15
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
xorl %eax, %eax
cmpq %rcx, %rbx
je 0x161300
imulq $0xc, %rbx, %r10
addq %rdx, %r10
movq %r15, %r9
xorl %r12d, %r12d
cmpq %r12, %r14
je 0x1612e8
cmpl $0x0, 0x1c(%rsi)
je 0x1612d0
movq (%rdi), %r8
movq 0x10(%r8), %r8
movl 0x10(%rsi), %r11d
imulq $0x28, %r11, %r11
movl (%r8,%r11), %r11d
andl %ebp, %r11d
movl (%r9), %r8d
notl %r8d
addl %r11d, %r8d
jmp 0x1612d3
movl (%r9), %r8d
cmpl 0x4(%r10), %r8d
jb 0x1612df
cmpl 0x8(%r10), %r8d
jb 0x1612e8
incq %r12
addq $0x18, %r9
jmp 0x1612a4
xorl %r8d, %r8d
cmpq 0x40(%rsp), %r12
setl %r8b
addq %r8, %rax
incq %rbx
jmp 0x161292
xorl %eax, %eax
jmp 0x161312
movq %r13, %r9
movq 0x40(%rsp), %r14
movq 0x38(%rsp), %r15
movq -0x18(%rsp), %r8
testq %r8, %r8
je 0x1613f3
movq %r9, -0x10(%rsp)
movl 0x10(%r8), %ecx
movq %rcx, -0x18(%rsp)
leaq 0xf2f00(%rip), %rcx     # 0x254230
xorl %r12d, %r12d
testq %r14, %r14
movl $0x0, %edx
cmovgq %r14, %rdx
movq 0x18(%rcx), %rcx
movq %rcx, -0x8(%rsp)
leaq 0x10(%r15), %r11
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
xorl %r15d, %r15d
cmpq -0x18(%rsp), %r15
je 0x1613e9
movq %r8, %rbx
movq 0x18(%r8), %rcx
movq (%rcx,%r15,8), %rcx
movl %ecx, %r13d
shrq $0x21, %rcx
movq -0x8(%rsp), %r8
movq (%r8,%rcx,8), %r10
addq %r12, %r10
addq %r12, %r13
movq %r11, %r14
xorl %r8d, %r8d
movq %r8, %r9
cmpq %r8, %rdx
je 0x1613cb
cmpl $0x0, 0x1c(%rsi)
je 0x1613b4
movq (%rdi), %rcx
movq 0x10(%rcx), %rcx
movl 0x10(%rsi), %r8d
imulq $0x28, %r8, %r8
movl (%rcx,%r8), %r8d
andl %ebp, %r8d
movl (%r14), %ecx
notl %ecx
addl %r8d, %ecx
jmp 0x1613b7
movl (%r14), %ecx
movl %ecx, %ecx
leaq 0x1(%r9), %r8
addq $0x18, %r14
cmpq %rcx, %r12
ja 0x161386
cmpq %rcx, %r10
jle 0x161386
xorl %ecx, %ecx
movq 0x40(%rsp), %r14
cmpq %r14, %r9
setl %cl
addq %rcx, %rax
incq %r15
movq %r13, %r12
movq %rbx, %r8
jmp 0x161354
movq -0x10(%rsp), %r9
movq 0x38(%rsp), %r15
testq %r9, %r9
je 0x16145f
xorl %ecx, %ecx
testq %r14, %r14
movl $0x0, %edx
cmovgq %r14, %rdx
addq $0x10, %r15
movl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
cmpq %rcx, %rdx
je 0x161454
cmpl $0x0, 0x1c(%rsi)
je 0x16143c
movq (%rdi), %r8
movq 0x10(%r8), %r8
movl 0x10(%rsi), %r10d
imulq $0x28, %r10, %r10
movl (%r8,%r10), %r10d
andl %r11d, %r10d
movl (%r15), %r8d
notl %r8d
addl %r10d, %r8d
jmp 0x16143f
movl (%r15), %r8d
cmpl 0x4(%r9), %r8d
jb 0x16144b
cmpl 0x8(%r9), %r8d
jb 0x161454
incq %rcx
addq $0x18, %r15
jmp 0x161410
xorl %edx, %edx
cmpq %r14, %rcx
setl %dl
addq %rdx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq