// File: chhylp123[P]hifiasm/inter.cpp
// Function: check_ul_ov_t_consist(ul_ov_t*, ul_ov_t*, long, long, double)
uint64_t check_ul_ov_t_consist(ul_ov_t *x, ul_ov_t *y, int64_t ql, int64_t tl, double diff)
{
	if(x->qn == y->qn && x->tn == y->tn && x->rev == y->rev) {
		int64_t xqs, xqe, xts, xte, yqs, yqe, yts, yte, os, oe, ovlp;
		extend_batch(x, ql, tl, &xqs, &xqe, &xts, &xte);
		extend_batch(y, ql, tl, &yqs, &yqe, &yts, &yte);

		os = MAX(xqs, yqs); oe = MIN(xqe, yqe);
		if(oe <= os) return 0;
		ovlp = oe - os;
		if(ovlp <= ((xqe-xqs)*(1-diff))) return 0;
		if(ovlp <= ((yqe-yqs)*(1-diff))) return 0;

		os = MAX(xts, yts); oe = MIN(xte, yte);
		if(oe <= os) return 0;
		if(ovlp <= ((xte-xts)*(1-diff))) return 0;
		if(ovlp <= ((yte-yts)*(1-diff))) return 0;
		return 1;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movsd %xmm0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x2c8cc9
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jne 0x2c8cc9
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
shrl $0x1f, %eax
movq -0x18(%rbp), %rcx
movl 0x18(%rcx), %ecx
shrl $0x1f, %ecx
cmpl %ecx, %eax
jne 0x2c8cc9
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x38(%rbp), %rcx
leaq -0x40(%rbp), %r8
leaq -0x48(%rbp), %r9
leaq -0x50(%rbp), %rax
movq %rax, (%rsp)
callq 0x2c87f0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x58(%rbp), %rcx
leaq -0x60(%rbp), %r8
leaq -0x68(%rbp), %r9
leaq -0x70(%rbp), %rax
movq %rax, (%rsp)
callq 0x2c87f0
movq -0x38(%rbp), %rax
cmpq -0x58(%rbp), %rax
jl 0x2c8b03
movq -0x38(%rbp), %rax
movq %rax, -0x90(%rbp)
jmp 0x2c8b0e
movq -0x58(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x60(%rbp), %rax
jg 0x2c8b30
movq -0x40(%rbp), %rax
movq %rax, -0x98(%rbp)
jmp 0x2c8b3b
movq -0x60(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
cmpq -0x78(%rbp), %rax
jg 0x2c8b5d
movq $0x0, -0x8(%rbp)
jmp 0x2c8cd1
movq -0x80(%rbp), %rax
subq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
cvtsi2sdq -0x88(%rbp), %xmm1
movq -0x40(%rbp), %rax
subq -0x38(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd 0xb9476(%rip), %xmm2    # 0x382000
subsd -0x30(%rbp), %xmm2
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0x2c8ba6
movq $0x0, -0x8(%rbp)
jmp 0x2c8cd1
cvtsi2sdq -0x88(%rbp), %xmm1
movq -0x60(%rbp), %rax
subq -0x58(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd 0xb943c(%rip), %xmm2    # 0x382000
subsd -0x30(%rbp), %xmm2
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0x2c8be0
movq $0x0, -0x8(%rbp)
jmp 0x2c8cd1
movq -0x48(%rbp), %rax
cmpq -0x68(%rbp), %rax
jl 0x2c8bf7
movq -0x48(%rbp), %rax
movq %rax, -0xa0(%rbp)
jmp 0x2c8c02
movq -0x68(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x70(%rbp), %rax
jg 0x2c8c24
movq -0x50(%rbp), %rax
movq %rax, -0xa8(%rbp)
jmp 0x2c8c2f
movq -0x70(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
cmpq -0x78(%rbp), %rax
jg 0x2c8c51
movq $0x0, -0x8(%rbp)
jmp 0x2c8cd1
cvtsi2sdq -0x88(%rbp), %xmm1
movq -0x50(%rbp), %rax
subq -0x48(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd 0xb9391(%rip), %xmm2    # 0x382000
subsd -0x30(%rbp), %xmm2
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0x2c8c88
movq $0x0, -0x8(%rbp)
jmp 0x2c8cd1
cvtsi2sdq -0x88(%rbp), %xmm1
movq -0x70(%rbp), %rax
subq -0x68(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd 0xb935a(%rip), %xmm2    # 0x382000
subsd -0x30(%rbp), %xmm2
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0x2c8cbf
movq $0x0, -0x8(%rbp)
jmp 0x2c8cd1
movq $0x1, -0x8(%rbp)
jmp 0x2c8cd1
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
nop