// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: trans_path_check(unsigned int, unsigned int, asg_t*, ma_hit_t_alloc*, R_to_U*, unsigned int, asg64_v*)
uint32_t trans_path_check(uint32_t a, uint32_t b, asg_t *g, ma_hit_t_alloc *rev, R_to_U* rI, 
uint32_t minLen, asg64_v *t)
{
    if(a == b) return -1;
    uint32_t tn = t->n, m, e, l[2] = {0};
    uint64_t *x[2];
    m = follow_limit_path(g, a, &e, &(l[0]), t, (uint32_t)-1);
    if(m == LOOP || l[0] <= minLen) {
        t->n = tn; return -1;
    }

    m = follow_limit_path(g, b, &e, &(l[1]), t, (uint32_t)-1);
    if(m == LOOP || l[1] <= minLen) {
        t->n = tn; return -1;
    }

    x[0] = t->a + tn; x[1] = t->a + tn + l[0];
    if(l[0] > l[1]) {
        x[0] = t->a + tn + l[0]; x[1] = t->a + tn;
        m = l[0]; l[0] = l[1]; l[1] = m;
    }
    assert(l[0]+l[1]+tn==t->n);

    uint32_t i, k, qi, ti, isU; double max_count = 0, min_count = 0;
    for (i = 0; i < l[1]; i++) g->seq_vis[x[1][i]>>1] = 1;
    for (i = 0; i < l[0]; i++) {
        qi = x[0][i]>>1;
        for (k = 0; k < rev[qi].length; k++) {
            ti = Get_tn(rev[qi].buffer[k]);
            if(g->seq[ti].del == 1) {
                get_R_to_U(rI, ti, &ti, &isU);
                if(ti == (uint32_t)-1 || isU == 1 || g->seq[ti].del == 1) continue;
            }
            min_count++; max_count += g->seq_vis[ti];
        }
    }

    for (i = 0; i < l[1]; i++) g->seq_vis[x[1][i]>>1] = 0;
    t->n = tn;

    if(min_count == 0) return -1;
    if(max_count == 0) return 0;
    if((max_count/min_count)>0.3) return 1;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %esi, %r14d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl %esi, %edi
je 0x1f2b8c
movl %r9d, %r13d
movq %r8, %r15
movq %rdx, %rbx
movl %edi, %esi
movq %rcx, 0x20(%rsp)
movq 0x90(%rsp), %r8
movq (%r8), %r12
movl %r12d, %eax
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rcx
movq $0x0, (%rcx)
leaq 0x1c(%rsp), %rdx
movq %rbx, %rdi
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0x1efbd9
cmpl $0x7, %eax
je 0x1f2b72
cmpl %r13d, 0x10(%rsp)
jbe 0x1f2b72
leaq 0x14(%rsp), %rcx
leaq 0x1c(%rsp), %rdx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, %rdi
movl %r14d, %esi
movq 0x90(%rsp), %r14
movq %r14, %r8
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0x1efbd9
cmpl $0x7, %eax
je 0x1f2b84
movl 0x14(%rsp), %eax
cmpl %r13d, %eax
jbe 0x1f2b84
movq 0x8(%rsp), %rcx
leaq (,%rcx,8), %rdx
addq 0x10(%r14), %rdx
movl 0x10(%rsp), %esi
leaq (%rdx,%rsi,8), %r9
cmpl %eax, %esi
jbe 0x1f2b9d
movl %esi, %ecx
movq %rdx, %r8
jmp 0x1f2ba7
movq 0x90(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
jmp 0x1f2b8c
movq 0x8(%rsp), %rax
movq %rax, (%r14)
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %ecx
movl %esi, %eax
movq %r9, %r8
movq %rdx, %r9
addl %eax, %r12d
addl %ecx, %r12d
cmpq %r12, (%r14)
jne 0x1f2d4f
movl %ecx, %r10d
xorl %ecx, %ecx
movq 0x20(%rsp), %rdi
movq 0x30(%rbx), %rdx
movq (%r8,%rcx,8), %rsi
shrq %rsi
movb $0x1, (%rdx,%rsi)
incq %rcx
cmpq %rcx, %r10
jne 0x1f2bc0
movq %r10, 0x38(%rsp)
movq %r8, 0x40(%rsp)
testl %eax, %eax
je 0x1f2cda
movl %eax, %eax
movq %rax, 0x48(%rsp)
xorpd %xmm1, %xmm1
xorl %r14d, %r14d
xorpd %xmm2, %xmm2
movq %r9, 0x50(%rsp)
movq (%r9,%r14,8), %rax
shrq %rax
movl %eax, %eax
leaq (%rax,%rax,2), %rax
cmpl $0x0, 0xc(%rdi,%rax,8)
je 0x1f2cc0
leaq (%rdi,%rax,8), %r13
movl $0xc, %r12d
xorl %ebp, %ebp
movq (%r13), %rax
movl (%rax,%r12), %esi
movl %esi, 0x4(%rsp)
movq 0x20(%rbx), %rax
cmpl $0x0, (%rax,%rsi,8)
js 0x1f2c67
addsd 0x3e6ce(%rip), %xmm1    # 0x231310
movq 0x30(%rbx), %rax
movzbl (%rax,%rsi), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
addsd %xmm0, %xmm2
incq %rbp
movl 0xc(%r13), %eax
addq $0x28, %r12
cmpq %rax, %rbp
jb 0x1f2c24
jmp 0x1f2cc0
movsd %xmm2, 0x28(%rsp)
movsd %xmm1, 0x30(%rsp)
movq %r15, %rdi
leaq 0x4(%rsp), %rdx
leaq 0x18(%rsp), %rcx
callq 0xa3c62
movl 0x4(%rsp), %esi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %rsi
je 0x1f2cb2
cmpl $0x1, 0x18(%rsp)
movsd 0x30(%rsp), %xmm1
movsd 0x28(%rsp), %xmm2
je 0x1f2c55
movq 0x20(%rbx), %rax
cmpl $0x0, (%rax,%rsi,8)
jns 0x1f2c3a
jmp 0x1f2c55
movsd 0x30(%rsp), %xmm1
movsd 0x28(%rsp), %xmm2
jmp 0x1f2c55
incq %r14
cmpq 0x48(%rsp), %r14
movq 0x20(%rsp), %rdi
movq 0x50(%rsp), %r9
jne 0x1f2c00
jmp 0x1f2ce2
xorpd %xmm2, %xmm2
xorpd %xmm1, %xmm1
xorl %eax, %eax
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdi
movq 0x30(%rbx), %rcx
movq (%rsi,%rax,8), %rdx
shrq %rdx
movb $0x0, (%rcx,%rdx)
incq %rax
cmpq %rax, %rdi
jne 0x1f2cee
movq 0x90(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x1f2d2a
jnp 0x1f2b8c
xorl %ebp, %ebp
ucomisd %xmm0, %xmm2
jne 0x1f2d38
jnp 0x1f2b8c
divsd %xmm1, %xmm2
xorl %ebp, %ebp
ucomisd 0x3deda(%rip), %xmm2    # 0x230c20
seta %bpl
jmp 0x1f2b8c
leaq 0x52b3b(%rip), %rdi     # 0x245891
leaq 0x528ac(%rip), %rsi     # 0x245609
leaq 0x52b40(%rip), %rcx     # 0x2458a4
movl $0x4e5, %edx            # imm = 0x4E5
callq 0x2110