// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: gen_spec_rc_edge(asg_t*, ug_opt_t*, unsigned int, unsigned int, asg_arc_t*, ma_hit_t**)
int32_t gen_spec_rc_edge(asg_t *rg, ug_opt_t *uopt, uint32_t v, uint32_t w, asg_arc_t *t, ma_hit_t **te)
{
    uint32_t k, qn, tn; int32_t r; ma_hit_t_alloc *s = &(uopt->reverse_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; if(te) (*te) = &(s->buffer[k]);
        return 1;
    }
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, -0x8(%rsp)
movq %rsi, -0x30(%rsp)
movq 0x10(%rsi), %rdi
movl %edx, %eax
shrl %eax
leaq (%rax,%rax,2), %rsi
movl 0xc(%rdi,%rsi,8), %r10d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %r10, %r10
je 0x222725
movq %r8, -0x20(%rsp)
movq %r9, -0x18(%rsp)
leaq (%rdi,%rsi,8), %rsi
movq %rsi, -0x28(%rsp)
movq (%rsi), %r11
movl %ecx, %esi
movl %ecx, %ebx
shrl %ebx
leaq 0x7321d(%rip), %rcx     # 0x295758
movss 0x158(%rcx), %xmm0
movl %edx, %eax
movq %rax, -0x10(%rsp)
movl %esi, -0x40(%rsp)
andl $-0x2, %esi
movl %esi, -0x38(%rsp)
shlq $0x3, %r10
leaq (%r10,%r10,4), %rcx
xorl %edx, %edx
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movl %eax, -0x3c(%rsp)
movq %rcx, -0x48(%rsp)
cmpl %ebx, 0xc(%r11,%rdx)
jne 0x22264d
movq 0x18(%r11,%rdx), %r10
movq -0x8(%rsp), %rax
movq 0x20(%rax), %rax
movl (%rax,%rbx,8), %r9d
andl %edi, %r9d
testl %r10d, %r10d
js 0x2225a7
movl 0x10(%r11,%rdx), %ecx
movl 0x14(%r11,%rdx), %r12d
subl %r12d, %r9d
movl %r9d, %r13d
movl %ecx, %r9d
jmp 0x2225b7
movl 0x10(%r11,%rdx), %ecx
movl 0x14(%r11,%rdx), %r12d
subl %r12d, %r9d
movl %ecx, %r13d
movq (%r11,%rdx), %r8
movq %r8, %rsi
shrq $0x20, %rsi
movl (%rax,%rsi,8), %eax
movl %eax, -0x34(%rsp)
andl %edi, %eax
movq -0x30(%rsp), %rsi
movl 0x40(%rsi), %r15d
cmpl %r8d, %r9d
movl %r8d, %esi
cmovll %r9d, %esi
movl 0x8(%r11,%rdx), %ebp
movl %eax, %r14d
subl %ebp, %r14d
cmpl %r13d, %r14d
movl %r13d, %edi
cmovll %r14d, %edi
cmpl %r15d, %esi
jg 0x222643
cmpl %r15d, %edi
jg 0x222643
movl %ebp, %r15d
subl %r8d, %r15d
xorps %xmm1, %xmm1
cvtsi2ss %r15, %xmm1
addl %esi, %r15d
addl %edi, %r15d
xorps %xmm2, %xmm2
cvtsi2ss %r15, %xmm2
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
ja 0x222643
subl %ecx, %r12d
xorps %xmm1, %xmm1
cvtsi2ss %r12, %xmm1
addl %esi, %edi
addl %r12d, %edi
xorps %xmm2, %xmm2
cvtsi2ss %rdi, %xmm2
mulss %xmm0, %xmm2
ucomiss %xmm1, %xmm2
jbe 0x22265f
movq -0x48(%rsp), %rcx
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
addq $0x28, %rdx
cmpq %rdx, %rcx
jne 0x22256d
jmp 0x222720
cmpl %r13d, %r14d
setl %cl
setg %r14b
cmpl %r9d, %r8d
setg %r12b
setl %sil
orb %r14b, %r12b
cmpb $0x1, %r12b
jne 0x222643
orb %cl, %sil
je 0x222643
movq -0x30(%rsp), %rcx
movl 0x44(%rcx), %ecx
cmpl %ecx, %r15d
jl 0x222643
cmpl %ecx, %edi
jl 0x222643
addl %ebp, %r13d
subl %r13d, %eax
movl %r8d, %ebp
subl %r9d, %ebp
cmovlel %eax, %ebp
movl %r10d, %r14d
shrl $0x10, %r14d
andl $0x4000, %r14d          # imm = 0x4000
movl -0x3c(%rsp), %eax
andl $0x3fff, %eax           # imm = 0x3FFF
movzbl 0x21(%r11,%rdx), %r12d
shll $0xf, %r12d
orl %r14d, %eax
orl %r12d, %eax
movl %eax, -0x3c(%rsp)
testl %ebp, %ebp
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
js 0x222716
xorl %eax, %eax
cmpl %r9d, %r8d
setg %cl
setle %al
testl %r10d, %r10d
setns %sil
shrq $0x1f, %r8
andl $-0x2, %r8d
orq %r8, %rax
cmpq -0x10(%rsp), %rax
jne 0x222716
xorb %cl, %sil
movzbl %sil, %ecx
orl -0x38(%rsp), %ecx
cmpl -0x40(%rsp), %ecx
movq -0x48(%rsp), %rcx
jne 0x22264d
jmp 0x222730
movq -0x48(%rsp), %rcx
jmp 0x22264d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
shlq $0x20, %rax
movl %ebp, %ecx
orq %rax, %rcx
movl -0x34(%rsp), %edi
subl %ebp, %edi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
movb 0x20(%r11,%rdx), %al
movq -0x20(%rsp), %rsi
movq %rcx, (%rsi)
movl -0x40(%rsp), %ecx
movl %ecx, 0x8(%rsi)
movl %edi, 0xc(%rsi)
movb %al, 0x12(%rsi)
movzwl %r14w, %eax
orl %r12d, %eax
movw %ax, 0x10(%rsi)
movl $0x1, %eax
movq -0x18(%rsp), %rsi
testq %rsi, %rsi
je 0x222725
movq -0x28(%rsp), %rcx
addq (%rcx), %rdx
movq %rdx, (%rsi)
jmp 0x222725