// File: 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
movq %rsp, %rbp
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x28e7d2
cmpq $0x0, -0x20(%rbp)
je 0x28e7d2
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x28e7d0
movq -0x18(%rbp), %rax
imulq $0xc, -0x40(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq 0x18(%rbp), %rax
jge 0x28e7a7
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
je 0x28e757
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x10(%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq 0x10(%rbp), %rcx
imulq $0x18, -0x38(%rbp), %rdx
addq %rdx, %rcx
subl 0x10(%rcx), %eax
subl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x28e769
movq 0x10(%rbp), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %eax
movl %eax, %eax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq -0x70(%rbp), %rcx
movl 0x4(%rcx), %ecx
cmpq %rcx, %rax
jl 0x28e794
movq -0x60(%rbp), %rax
movq -0x70(%rbp), %rcx
movl 0x8(%rcx), %ecx
cmpq %rcx, %rax
jge 0x28e794
jmp 0x28e7a7
jmp 0x28e796
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x28e708
movq -0x38(%rbp), %rax
cmpq 0x18(%rbp), %rax
jge 0x28e7bd
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x28e7bf
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x28e6e2
jmp 0x28e7d2
cmpq $0x0, -0x28(%rbp)
je 0x28e914
movq $0x0, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
jge 0x28e912
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
leaq 0x136abc(%rip), %rcx    # 0x3c52d0
movq 0x18(%rcx), %rcx
movq -0x28(%rbp), %rdx
movq 0x18(%rdx), %rdx
movq -0x40(%rbp), %rsi
movq (%rdx,%rsi,8), %rdx
shrq $0x21, %rdx
addq (%rcx,%rdx,8), %rax
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq 0x18(%rbp), %rax
jge 0x28e8e9
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
je 0x28e8a5
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x10(%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq 0x10(%rbp), %rcx
imulq $0x18, -0x38(%rbp), %rdx
addq %rdx, %rcx
subl 0x10(%rcx), %eax
subl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x28e8b7
movq 0x10(%rbp), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %eax
movl %eax, %eax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x50(%rbp), %rax
jl 0x28e8d6
movq -0x60(%rbp), %rax
cmpq -0x58(%rbp), %rax
jge 0x28e8d6
jmp 0x28e8e9
jmp 0x28e8d8
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x28e856
movq -0x38(%rbp), %rax
cmpq 0x18(%rbp), %rax
jge 0x28e8ff
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x28e901
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x28e7ed
jmp 0x28e914
cmpq $0x0, -0x30(%rbp)
je 0x28e9de
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq 0x18(%rbp), %rax
jge 0x28e9c6
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
je 0x28e976
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x10(%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq 0x10(%rbp), %rcx
imulq $0x18, -0x38(%rbp), %rdx
addq %rdx, %rcx
subl 0x10(%rcx), %eax
subl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x28e988
movq 0x10(%rbp), %rax
imulq $0x18, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movl %eax, %eax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq -0x30(%rbp), %rcx
movl 0x4(%rcx), %ecx
cmpq %rcx, %rax
jl 0x28e9b3
movq -0x60(%rbp), %rax
movq -0x30(%rbp), %rcx
movl 0x8(%rcx), %ecx
cmpq %rcx, %rax
jge 0x28e9b3
jmp 0x28e9c6
jmp 0x28e9b5
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x28e927
movq -0x38(%rbp), %rax
cmpq 0x18(%rbp), %rax
jge 0x28e9dc
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x28e9de
movq -0x68(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)