// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: specific_ovlp(ma_ug_t const*, ug_opt_t const*, unsigned int, unsigned int)
int64_t specific_ovlp(const ma_ug_t *ug, const ug_opt_t *uopt, const uint32_t v, const uint32_t w)
{
	if(ug->u.a[v>>1].circ || ug->u.a[w>>1].circ) return 0;
	uint32_t rv, rw, i; int32_t r;
	const ma_hit_t_alloc *x = NULL;
	asg_arc_t t; memset(&t, 0, sizeof(t));
	if(v&1) rv = ug->u.a[v>>1].start^1;
	else rv = ug->u.a[v>>1].end^1;
	if(w&1) rw = ug->u.a[v>>1].end;
	else rw = ug->u.a[v>>1].start;
	x = &(uopt->sources[rv>>1]);
	for (i = 0; i < x->length; i++) {
		if(Get_tn(x->buffer[i]) == (rw>>1)) {
			r = ma_hit2arc(&(x->buffer[i]), uopt->coverage_cut[rv>>1].e - uopt->coverage_cut[rv>>1].s, 
			uopt->coverage_cut[rw>>1].e - uopt->coverage_cut[rw>>1].s, uopt->max_hang, asm_opt.max_hang_rate, uopt->min_ovlp, &t);
			if(r < 0) return 0;
			if((t.ul>>32)!=rv || t.v!=rw) return 0;
			return t.ol;
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x10(%rdi), %rax
movl %edx, %edi
shrl %edi
leaq (%rdi,%rdi,4), %rdi
cmpl $0x0, (%rax,%rdi,8)
js 0x1a4f94
movl %ecx, %r8d
shrl %r8d
leaq (%r8,%r8,4), %r8
cmpl $0x0, (%rax,%r8,8)
js 0x1a4f94
testb $0x1, %dl
leaq 0x4(%rax,%rdi,8), %r8
leaq 0x8(%rax,%rdi,8), %rax
movq %r8, %rdx
cmoveq %rax, %rdx
movl (%rdx), %edx
testb $0x1, %cl
cmoveq %r8, %rax
movq 0x8(%rsi), %r9
movl %edx, %ecx
shrl %ecx
leaq (%rcx,%rcx,2), %r8
movl 0xc(%r9,%r8,8), %edi
testq %rdi, %rdi
je 0x1a4f94
xorq $0x1, %rdx
movl (%rax), %ecx
leaq (%r9,%r8,8), %rax
movq (%rax), %rbx
movl %ecx, %r9d
shrl %r9d
shlq $0x3, %rdi
leaq (%rdi,%rdi,4), %rdi
xorl %eax, %eax
xorl %r14d, %r14d
cmpl %r9d, 0xc(%rbx,%r14)
je 0x1a4eb6
addq $0x28, %r14
cmpq %r14, %rdi
jne 0x1a4ea1
jmp 0x1a4f96
movq (%rsi), %rax
movl 0x4(%rax,%r8,4), %edi
movl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
movl (%rax,%r8,4), %r8d
andl %r10d, %r8d
subl %r8d, %edi
leaq (%r9,%r9,2), %r8
movl 0x4(%rax,%r8,4), %r9d
andl (%rax,%r8,4), %r10d
subl %r10d, %r9d
movl 0x40(%rsi), %r12d
movq (%rbx,%r14), %r8
movq 0x18(%rbx,%r14), %rax
movq %rax, -0x8(%rsp)
testl %eax, %eax
js 0x1a4f09
movl 0x10(%rbx,%r14), %ebp
movl 0x14(%rbx,%r14), %r15d
subl %r15d, %r9d
movl %r9d, %r11d
movl %ebp, %r9d
jmp 0x1a4f19
movl 0x10(%rbx,%r14), %ebp
movl 0x14(%rbx,%r14), %r15d
subl %r15d, %r9d
movl %ebp, %r11d
cmpl %r8d, %r9d
movl %r8d, %r10d
cmovll %r9d, %r10d
movl 0x8(%rbx,%r14), %ebx
movl %edi, %r13d
subl %ebx, %r13d
cmpl %r11d, %r13d
movl %r11d, %r14d
cmovll %r13d, %r14d
xorl %eax, %eax
cmpl %r12d, %r10d
jg 0x1a4f96
cmpl %r12d, %r14d
jg 0x1a4f96
leaq 0xf080d(%rip), %rax     # 0x295758
movl %ebx, %r12d
subl %r8d, %r12d
cvtsi2ss %r12, %xmm1
addl %r10d, %r12d
addl %r14d, %r12d
cvtsi2ss %r12, %xmm2
movss 0x158(%rax), %xmm0
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
ja 0x1a4f94
subl %ebp, %r15d
xorps %xmm1, %xmm1
cvtsi2ss %r15, %xmm1
addl %r10d, %r14d
addl %r15d, %r14d
xorps %xmm2, %xmm2
cvtsi2ss %r14, %xmm2
mulss %xmm2, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x1a4fa1
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl %r11d, %r13d
setl %r10b
setg %al
cmpl %r9d, %r8d
setg %r15b
setl %bpl
orb %al, %r15b
xorl %eax, %eax
cmpb $0x1, %r15b
jne 0x1a4f96
orb %r10b, %bpl
je 0x1a4f96
movl 0x44(%rsi), %esi
xorl %eax, %eax
cmpl %esi, %r12d
jl 0x1a4f96
cmpl %esi, %r14d
jl 0x1a4f96
addl %ebx, %r11d
movl %edi, %eax
subl %r11d, %eax
movl %r8d, %esi
subl %r9d, %esi
cmovlel %eax, %esi
testl %esi, %esi
js 0x1a4f94
xorl %eax, %eax
cmpl %r9d, %r8d
setg %r9b
setle %al
cmpl $0x0, -0x8(%rsp)
setns %r10b
subl %esi, %edi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
shrq $0x1f, %r8
andl $-0x2, %r8d
orl %r8d, %eax
movl %ecx, %esi
andl $-0x2, %esi
xorb %r9b, %r10b
movzbl %r10b, %r8d
orl %esi, %r8d
xorl %esi, %esi
cmpl %ecx, %r8d
cmovneq %rsi, %rdi
cmpl %edx, %eax
cmovneq %rsi, %rdi
movq %rdi, %rax
jmp 0x1a4f96