// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: push_direct_scaff_node(usc_t*, asg_t*, ug_opt_t*, unsigned long, unsigned long)
void push_direct_scaff_node(usc_t *psa, asg_t *ng, ug_opt_t *uopt, uint64_t vx, uint64_t wx)
{
    uint64_t uol, dif; int32_t r; asg_arc_t t, *p; ma_hit_t *rc0, *rc1;
    uol = psa->raw_sof - psa->raw_eof;
    assert(uol >= (uint64_t)uopt->min_ovlp);
    r = gen_spec_rc_edge(ng, uopt, vx, wx, &t, &rc0);
    if(r >= 0) {
        if(uol > t.ol) dif = uol - t.ol;
        else dif = t.ol - uol;
        if((dif > (uol*0.05)) || (dif > (t.ol*0.05))) {
            if(dif > 16) r = -1;
        }
    }
    if(r >= 0) {
        r = gen_spec_rc_edge(ng, uopt, wx^1, vx^1, &t, &rc1);
        if(uol > t.ol) dif = uol - t.ol;
        else dif = t.ol - uol;
        if((dif > (uol*0.05)) || (dif > (t.ol*0.05))) {
            if(dif > 16) r = -1;
        }
    }

    if(r >= 0) {
        r = gen_spec_rc_edge(ng, uopt, vx, wx, &t, &rc0); assert(r >= 0);
        p = asg_arc_pushp(ng); *p = t;

        r = gen_spec_rc_edge(ng, uopt, wx^1, vx^1, &t, &rc1); assert(r >= 0);
        p = asg_arc_pushp(ng); *p = t;

        add_ma_hit_t_alloc(&(R_INF.paf[Get_qn((*rc0))]), rc0);
        add_ma_hit_t_alloc(&(R_INF.paf[Get_qn((*rc1))]), rc1);
    } else {
        push_scaff_node(R_INF.paf, vx, wx, psa->raw_sof-psa->raw_eof, ng);

        r = gen_spec_edge(ng, uopt, vx, wx, &t);
        assert(r >= 0); p = asg_arc_pushp(ng); *p = t;
        r = gen_spec_edge(ng, uopt, wx^1, vx^1, &t);
        assert(r >= 0); p = asg_arc_pushp(ng); *p = t;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl 0x10(%rdi), %ebp
subl 0x14(%rdi), %ebp
movslq 0x44(%rdx), %rax
cmpq %rax, %rbp
jb 0x1d3e98
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r13
movq %rsp, %r8
leaq 0x28(%rsp), %r9
movq %rsi, %rdi
movq %rdx, %rsi
movl %r12d, %edx
movl %r15d, %ecx
callq 0x1d3ace
testl %eax, %eax
js 0x1d3c9f
movl 0xc(%rsp), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rbp, %rdx
subq %rax, %rdx
movq %rax, %rcx
subq %rbp, %rcx
cmpl %eax, %ebp
cmovaq %rdx, %rcx
movq %rcx, %xmm1
punpckldq 0xf623(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0xf62b(%rip), %xmm1     # 0x1e3280
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
cvtsi2sd %rbp, %xmm2
mulsd 0xf8aa(%rip), %xmm2     # 0x1e3518
ucomisd %xmm2, %xmm0
jbe 0x1d3c7f
cmpq $0x10, %rcx
ja 0x1d3c9f
jmp 0x1d3d3e
cmpq $0x11, %rcx
jb 0x1d3d3e
cvtsi2sd %eax, %xmm1
mulsd 0xf883(%rip), %xmm1     # 0x1e3518
ucomisd %xmm1, %xmm0
jbe 0x1d3d3e
leaq 0x8058a(%rip), %rax     # 0x254230
movq 0x78(%rax), %rdi
movl 0x10(%r13), %ecx
subl 0x14(%r13), %ecx
movq %r12, %rsi
movq %r15, %rdx
movq %rbx, %r8
callq 0x1d3f33
movq %rsp, %r8
movq %rbx, %rdi
movq %r14, %rsi
movl %r12d, %edx
movl %r15d, %ecx
callq 0x1add8b
testl %eax, %eax
js 0x1d3eb7
movq %rbx, %rdi
callq 0x1ab555
movq %rsp, %r8
movups (%r8), %xmm0
movups %xmm0, (%rax)
movq 0x10(%r8), %rcx
movq %rcx, 0x10(%rax)
xorl $0x1, %r15d
xorl $0x1, %r12d
movq %rbx, %rdi
movq %r14, %rsi
movl %r15d, %edx
movl %r12d, %ecx
callq 0x1add8b
testl %eax, %eax
js 0x1d3ed6
movq %rbx, %rdi
callq 0x1ab555
movups (%rsp), %xmm0
movups %xmm0, (%rax)
movq 0x10(%rsp), %rcx
movq %rcx, 0x10(%rax)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r15d, %edx
xorl $0x1, %edx
movl %r12d, %ecx
xorl $0x1, %ecx
movq %rsp, %r8
leaq 0x20(%rsp), %r9
movq %rbx, %rdi
movq %r14, %rsi
movl %edx, 0x1c(%rsp)
movl %ecx, 0x18(%rsp)
movsd %xmm2, 0x30(%rsp)
callq 0x1d3ace
movq %rsp, %rcx
movl 0xc(%rcx), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq %rbp, %rsi
subq %rdx, %rsi
movq %rdx, %rcx
subq %rbp, %rcx
cmpl %edx, %ebp
cmovaq %rsi, %rcx
movq %rcx, %xmm1
punpckldq 0xf4da(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0xf4e2(%rip), %xmm1     # 0x1e3280
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
ucomisd 0x30(%rsp), %xmm0
jbe 0x1d3dc5
testl %eax, %eax
js 0x1d3c9f
cmpq $0x10, %rcx
jbe 0x1d3def
jmp 0x1d3c9f
cvtsi2sd %edx, %xmm1
mulsd 0xf747(%rip), %xmm1     # 0x1e3518
ucomisd %xmm1, %xmm0
setbe %dl
cmpq $0x11, %rcx
setb %cl
testl %eax, %eax
js 0x1d3c9f
orb %dl, %cl
je 0x1d3c9f
movq %rsp, %r8
leaq 0x28(%rsp), %r9
movq %rbx, %rdi
movq %r14, %rsi
movl %r12d, %edx
movl %r15d, %ecx
callq 0x1d3ace
testl %eax, %eax
js 0x1d3ef5
movq %rbx, %rdi
callq 0x1ab555
movq %rsp, %r8
movups (%r8), %xmm0
movups %xmm0, (%rax)
movq 0x10(%r8), %rcx
movq %rcx, 0x10(%rax)
leaq 0x20(%rsp), %r9
movq %rbx, %rdi
movq %r14, %rsi
movl 0x1c(%rsp), %edx
movl 0x18(%rsp), %ecx
callq 0x1d3ace
testl %eax, %eax
js 0x1d3f14
movq %rbx, %rdi
callq 0x1ab555
movups (%rsp), %xmm0
movups %xmm0, (%rax)
movq 0x10(%rsp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x803c7(%rip), %rbx     # 0x254230
movq 0x28(%rsp), %rsi
movl 0x4(%rsi), %eax
imulq $0x18, %rax, %rdi
addq 0x78(%rbx), %rdi
callq 0x69052
movq 0x20(%rsp), %rsi
movl 0x4(%rsi), %eax
imulq $0x18, %rax, %rdi
addq 0x78(%rbx), %rdi
callq 0x69052
jmp 0x1d3d2f
leaq 0x27c9a(%rip), %rdi     # 0x1fbb39
leaq 0x23633(%rip), %rsi     # 0x1f74d9
leaq 0x27cac(%rip), %rcx     # 0x1fbb59
movl $0x3aaf, %edx           # imm = 0x3AAF
callq 0x2110
leaq 0x11d1c(%rip), %rdi     # 0x1e5bda
leaq 0x23614(%rip), %rsi     # 0x1f74d9
leaq 0x27c8d(%rip), %rcx     # 0x1fbb59
movl $0x3ace, %edx           # imm = 0x3ACE
callq 0x2110
leaq 0x11cfd(%rip), %rdi     # 0x1e5bda
leaq 0x235f5(%rip), %rsi     # 0x1f74d9
leaq 0x27c6e(%rip), %rcx     # 0x1fbb59
movl $0x3ad0, %edx           # imm = 0x3AD0
callq 0x2110
leaq 0x11cde(%rip), %rdi     # 0x1e5bda
leaq 0x235d6(%rip), %rsi     # 0x1f74d9
leaq 0x27c4f(%rip), %rcx     # 0x1fbb59
movl $0x3ac2, %edx           # imm = 0x3AC2
callq 0x2110
leaq 0x11cbf(%rip), %rdi     # 0x1e5bda
leaq 0x235b7(%rip), %rsi     # 0x1f74d9
leaq 0x27c30(%rip), %rcx     # 0x1fbb59
movl $0x3ac5, %edx           # imm = 0x3AC5
callq 0x2110