// File: /workspace/github_cpp_makefile_star2_O2/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 $0x68, %rsp
movq %rcx, 0x58(%rsp)
movl %esi, %r15d
cmpl %esi, %edi
je 0x1a7f14
movl %r9d, %ebp
movq %r8, %r12
movq %rdx, %r14
movl %edi, %esi
movq 0xa0(%rsp), %r8
movq (%r8), %rbx
movl %ebx, %eax
movq %rax, 0x10(%rsp)
leaq 0x18(%rsp), %rcx
andq $0x0, (%rcx)
leaq 0x2c(%rsp), %rdx
pushq $-0x1
popq %r9
movq %r14, %rdi
movl %r9d, %r13d
callq 0x1a5520
cmpl $0x7, %eax
je 0x1a7ef7
cmpl %ebp, 0x18(%rsp)
jbe 0x1a7ef7
leaq 0x1c(%rsp), %rcx
leaq 0x2c(%rsp), %rdx
pushq $-0x1
popq %r9
movq %r14, %rdi
movl %r15d, %esi
movq 0xa0(%rsp), %r15
movq %r15, %r8
callq 0x1a5520
cmpl $0x7, %eax
je 0x1a7f0c
movl 0x1c(%rsp), %eax
cmpl %ebp, %eax
jbe 0x1a7f0c
movq 0x10(%rsp), %rcx
leaq (,%rcx,8), %rdx
addq 0x10(%r15), %rdx
movl 0x18(%rsp), %esi
leaq (%rdx,%rsi,8), %r8
cmpl %eax, %esi
jbe 0x1a7f26
movl %esi, %ecx
movq %rdx, 0x20(%rsp)
jmp 0x1a7f32
movq 0xa0(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, (%rax)
movl %r13d, %eax
jmp 0x1a7f17
movq 0x10(%rsp), %rax
movq %rax, (%r15)
pushq $-0x1
popq %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %ecx
movl %esi, %eax
movq %r8, 0x20(%rsp)
movq %rdx, %r8
addl %eax, %ebx
addl %ecx, %ebx
cmpq %rbx, (%r15)
jne 0x1a80c0
movl %ecx, %r9d
xorl %ecx, %ecx
movq 0x20(%rsp), %rdi
cmpq %rcx, %r9
je 0x1a7f62
movq 0x30(%r14), %rdx
movq (%rdi,%rcx,8), %rsi
shrq %rsi
movb $0x1, (%rdx,%rsi)
incq %rcx
jmp 0x1a7f49
movq %r9, 0x40(%rsp)
movl %eax, %eax
movq %rax, 0x50(%rsp)
xorpd %xmm1, %xmm1
xorl %eax, %eax
leaq 0x28(%rsp), %r15
xorpd %xmm2, %xmm2
movq %r8, 0x48(%rsp)
cmpq 0x50(%rsp), %rax
je 0x1a8054
movq %rax, 0x60(%rsp)
movq (%r8,%rax,8), %rax
shrq %rax
movl %eax, %eax
imulq $0x18, %rax, %rbx
addq 0x58(%rsp), %rbx
pushq $0xc
popq %rbp
xorl %r13d, %r13d
movl 0xc(%rbx), %eax
cmpq %rax, %r13
jae 0x1a8042
movq (%rbx), %rax
movl (%rax,%rbp), %esi
movl %esi, 0xc(%rsp)
movq 0x20(%r14), %rax
cmpl $0x0, (%rax,%rsi,8)
js 0x1a7feb
addsd 0x3b2ce(%rip), %xmm2    # 0x1e32a0
movq 0x30(%r14), %rax
movzbl (%rax,%rsi), %eax
cvtsi2sd %eax, %xmm0
addsd %xmm0, %xmm1
incq %r13
addq $0x28, %rbp
jmp 0x1a7faa
movsd %xmm2, 0x30(%rsp)
movsd %xmm1, 0x38(%rsp)
movq %r12, %rdi
leaq 0xc(%rsp), %rdx
movq %r15, %rcx
callq 0x6c2a2
movl 0xc(%rsp), %esi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %rsi
je 0x1a8034
cmpl $0x1, 0x28(%rsp)
movsd 0x38(%rsp), %xmm1
movsd 0x30(%rsp), %xmm2
je 0x1a7fe2
movq 0x20(%r14), %rax
cmpl $0x0, (%rax,%rsi,8)
jns 0x1a7fca
jmp 0x1a7fe2
movsd 0x38(%rsp), %xmm1
movsd 0x30(%rsp), %xmm2
jmp 0x1a7fe2
movq 0x60(%rsp), %rax
incq %rax
movq 0x48(%rsp), %r8
jmp 0x1a7f82
xorl %eax, %eax
movq 0xa0(%rsp), %rsi
movq 0x20(%rsp), %rdi
movq 0x40(%rsp), %r8
cmpq %rax, %r8
je 0x1a8081
movq 0x30(%r14), %rcx
movq (%rdi,%rax,8), %rdx
shrq %rdx
movb $0x0, (%rcx,%rdx)
incq %rax
jmp 0x1a8068
movq 0x10(%rsp), %rax
movq %rax, (%rsi)
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
pushq $-0x1
popq %rax
jne 0x1a809c
jnp 0x1a7f17
xorl %eax, %eax
ucomisd %xmm0, %xmm1
jne 0x1a80aa
jnp 0x1a7f17
divsd %xmm2, %xmm1
xorl %eax, %eax
ucomisd 0x3ab48(%rip), %xmm1    # 0x1e2c00
seta %al
jmp 0x1a7f17
leaq 0x4f69a(%rip), %rdi     # 0x1f7761
leaq 0x4f40b(%rip), %rsi     # 0x1f74d9
leaq 0x4f69f(%rip), %rcx     # 0x1f7774
movl $0x4e5, %edx            # imm = 0x4E5
callq 0x2110