// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: gen_spec_edge(asg_t*, ug_opt_t*, unsigned int, unsigned int, asg_arc_t*)
int32_t gen_spec_edge(asg_t *rg, ug_opt_t *uopt, uint32_t v, uint32_t w, asg_arc_t *t)
{
    uint32_t k, qn, tn; int32_t r; ma_hit_t_alloc *s = &(uopt->sources[v>>1]); asg_arc_t p;
    for (k = 0; k < s->length; k++) {
        qn = Get_qn(s->buffer[k]); tn = Get_tn(s->buffer[k]);
        if(tn != (w>>1)) continue;
        r = ma_hit2arc(&(s->buffer[k]), rg->seq[qn].len, rg->seq[tn].len, uopt->max_hang, asm_opt.max_hang_rate, uopt->min_ovlp, &p);
        if(r < 0) continue;
        if((p.ul>>32) != v || p.v != w) continue;
        *t = p; t->ou = 0;
        return 1;
    }
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, -0x8(%rsp)
movq %rsi, -0x20(%rsp)
movq 0x8(%rsi), %rdi
movl %edx, %eax
shrl %eax
leaq (%rax,%rax,2), %rsi
movl 0xc(%rdi,%rsi,8), %r11d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r11, %r11
je 0x1f970c
movq %r8, -0x18(%rsp)
leaq (%rdi,%rsi,8), %rsi
movq (%rsi), %r9
movl %ecx, %esi
movl %ecx, %r10d
shrl %r10d
leaq 0x9c232(%rip), %rcx     # 0x295758
movss 0x158(%rcx), %xmm0
movl %edx, %eax
movq %rax, -0x10(%rsp)
movl %esi, -0x30(%rsp)
andl $-0x2, %esi
movl %esi, -0x28(%rsp)
shlq $0x3, %r11
leaq (%r11,%r11,4), %rcx
xorl %edx, %edx
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movl %eax, -0x2c(%rsp)
movq %rcx, -0x38(%rsp)
cmpl %r10d, 0xc(%r9,%rdx)
jne 0x1f9636
movq 0x18(%r9,%rdx), %r13
movq -0x8(%rsp), %rax
movq 0x20(%rax), %rax
movl (%rax,%r10,8), %r11d
andl %edi, %r11d
testl %r13d, %r13d
js 0x1f9592
movl 0x10(%r9,%rdx), %ecx
movl 0x14(%r9,%rdx), %ebp
subl %ebp, %r11d
movl %r11d, %r8d
movl %ecx, %r11d
jmp 0x1f95a2
movl 0x10(%r9,%rdx), %ecx
movl 0x14(%r9,%rdx), %ebp
subl %ebp, %r11d
movl %ecx, %r8d
movq (%r9,%rdx), %r15
movq %r15, %rsi
shrq $0x20, %rsi
movl (%rax,%rsi,8), %eax
movl %eax, -0x24(%rsp)
andl %edi, %eax
movq -0x20(%rsp), %rsi
movl 0x40(%rsi), %r14d
cmpl %r15d, %r11d
movl %r15d, %esi
cmovll %r11d, %esi
movl 0x8(%r9,%rdx), %ebx
movl %eax, %r12d
subl %ebx, %r12d
cmpl %r8d, %r12d
movl %r8d, %edi
cmovll %r12d, %edi
cmpl %r14d, %esi
jg 0x1f962c
cmpl %r14d, %edi
jg 0x1f962c
movl %ebx, %r14d
subl %r15d, %r14d
xorps %xmm1, %xmm1
cvtsi2ss %r14, %xmm1
addl %esi, %r14d
addl %edi, %r14d
xorps %xmm2, %xmm2
cvtsi2ss %r14, %xmm2
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
ja 0x1f962c
subl %ecx, %ebp
xorps %xmm1, %xmm1
cvtsi2ss %rbp, %xmm1
addl %esi, %edi
addl %ebp, %edi
xorps %xmm2, %xmm2
cvtsi2ss %rdi, %xmm2
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
jbe 0x1f9648
movq -0x38(%rsp), %rcx
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
addq $0x28, %rdx
cmpq %rdx, %rcx
jne 0x1f9558
jmp 0x1f9707
cmpl %r8d, %r12d
setl %cl
setg %bpl
cmpl %r11d, %r15d
setg %r12b
setl %sil
orb %bpl, %r12b
cmpb $0x1, %r12b
jne 0x1f962c
orb %cl, %sil
je 0x1f962c
movq -0x20(%rsp), %rcx
movl 0x44(%rcx), %ecx
cmpl %ecx, %r14d
jl 0x1f962c
cmpl %ecx, %edi
jl 0x1f962c
addl %ebx, %r8d
subl %r8d, %eax
movl %r15d, %ebx
subl %r11d, %ebx
cmovlel %eax, %ebx
movl %r13d, %r8d
shrl $0x10, %r8d
andl $0x4000, %r8d           # imm = 0x4000
movl -0x2c(%rsp), %eax
andl $0x3fff, %eax           # imm = 0x3FFF
movzbl 0x21(%r9,%rdx), %ebp
shll $0xf, %ebp
orl %r8d, %eax
orl %ebp, %eax
movl %eax, -0x2c(%rsp)
testl %ebx, %ebx
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
js 0x1f96fd
xorl %eax, %eax
cmpl %r11d, %r15d
setg %cl
setle %al
testl %r13d, %r13d
setns %sil
shrq $0x1f, %r15
andl $-0x2, %r15d
orq %r15, %rax
cmpq -0x10(%rsp), %rax
jne 0x1f96fd
xorb %cl, %sil
movzbl %sil, %ecx
orl -0x28(%rsp), %ecx
cmpl -0x30(%rsp), %ecx
movq -0x38(%rsp), %rcx
jne 0x1f9636
jmp 0x1f9717
movq -0x38(%rsp), %rcx
jmp 0x1f9636
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
shlq $0x20, %rax
movl %ebx, %ecx
orq %rax, %rcx
movl -0x24(%rsp), %esi
subl %ebx, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movb 0x20(%r9,%rdx), %al
movq -0x18(%rsp), %rdx
movq %rcx, (%rdx)
movl -0x30(%rsp), %ecx
movl %ecx, 0x8(%rdx)
movl %esi, 0xc(%rdx)
movb %al, 0x12(%rdx)
movzwl %r8w, %eax
orl %ebp, %eax
movw %ax, 0x10(%rdx)
movl $0x1, %eax
jmp 0x1f970c