// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: if_false_bub_links(unsigned int, asg_t*, buf_t*, asg64_v*, unsigned int, int)
uint32_t if_false_bub_links(uint32_t v, asg_t *g, buf_t *x, asg64_v *b, uint32_t bs, int32_t check_dist)
{
    uint32_t i, mm = 1;
    if (g->seq[v>>1].del) return 0;
    for (i = bs; i < b->n; i++) {
        g->arc[b->a[i]].del = 1;
        asg_arc_del(g, g->arc[b->a[i]].v^1, (g->arc[b->a[i]].ul>>32)^1, 1);
    }
    if (asg_arc_n(g, v) < 2 || get_arcs(g, v, NULL, 0) < 2) mm = 0;
    
    if(mm) {
        mm = 0;
        if(asg_bub_pop1_primary_trio(g, NULL, v, check_dist, x, (uint32_t)-1, (uint32_t)-1, 0, 
                                                                    NULL, NULL, NULL, 0, 0, NULL)) {

            for (i = bs; i < b->n; i++) {
                g->arc[b->a[i]].del = 0;
                asg_arc_del(g, g->arc[b->a[i]].v^1, (g->arc[b->a[i]].ul>>32)^1, 0);
            }

            asg_arc_t *av = asg_arc_a(g, v); uint32_t nv = asg_arc_n(g, v);
            for (i = 0, b->n = bs; i < nv; i++) {
                if (av[i].del) continue;
                av[i].del = 1; asg_arc_del(g, av[i].v^1, (av[i].ul>>32)^1, 1);
                kv_push(uint64_t, *b, ((uint64_t)(av-g->arc+i)));     
            }

            if(asg_bub_pop1_primary_trio(g, NULL, x->S.a[0]^1, check_dist, x, (uint32_t)-1, (uint32_t)-1, 0, NULL, NULL, NULL, 0, 0, NULL)) {
                mm = 1;
            }
        }
    }
    
    for (i = bs; i < b->n; i++) {
        g->arc[b->a[i]].del = 0;
        asg_arc_del(g, g->arc[b->a[i]].v^1, (g->arc[b->a[i]].ul>>32)^1, 0);
    }

    return mm;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %r14
movq 0x20(%rsi), %rax
movl %edi, %ecx
shrl %ecx
cmpl $0x0, (%rax,%rcx,8)
js 0x1f7361
movl %r8d, %ebx
movq %rsi, %r15
movl %edi, %r12d
movl %r8d, %r13d
movq (%r14), %rcx
cmpq %r13, %rcx
jbe 0x1f6ff2
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %r13, %r8
movl %ebx, %esi
movq 0x8(%r15), %rcx
movq 0x10(%r14), %rdi
movq (%rdi,%r8,8), %rdi
leaq (%rdi,%rdi,2), %rdi
orl $0x80000000, 0xc(%rcx,%rdi,8) # imm = 0x80000000
movq 0x8(%r15), %rdi
movq 0x28(%r15), %r10
movq 0x10(%r14), %rcx
movq (%rcx,%r8,8), %rcx
leaq (%rcx,%rcx,2), %rcx
movl 0x8(%rdi,%rcx,8), %r8d
xorq $0x1, %r8
movq (%r10,%r8,8), %r10
movq %r10, %r8
andq %rax, %r8
je 0x1f6fe1
movl 0x4(%rdi,%rcx,8), %ecx
shrq $0x20, %r10
shlq $0x3, %r8
leaq (%r8,%r8,2), %r8
leaq (%r10,%r10,2), %r10
leaq (%rdi,%r10,8), %rdi
addq $0xc, %rdi
xorl %r10d, %r10d
movl -0x4(%rdi,%r10), %r11d
xorl %ecx, %r11d
cmpl $0x1, %r11d
jne 0x1f6fd8
orb $-0x80, 0x3(%rdi,%r10)
addq $0x18, %r10
cmpq %r10, %r8
jne 0x1f6fc4
incl %esi
movq (%r14), %rcx
movq %rsi, %r8
cmpq %rsi, %rcx
ja 0x1f6f64
movq %rdx, 0x48(%rsp)
movq 0x28(%r15), %rax
movl %r12d, %edx
movq (%rax,%rdx,8), %rax
xorl %ebp, %ebp
testl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
je 0x1f72c9
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
andq %rax, %rsi
je 0x1f72c9
shrq $0x20, %rax
movq 0x8(%r15), %r8
xorl %edi, %edi
movl %eax, %r10d
leaq (%r10,%r10,2), %r10
movl 0xc(%r8,%r10,8), %r10d
notl %r10d
shrl $0x1f, %r10d
addl %r10d, %edi
incq %rax
decq %rsi
jne 0x1f7027
xorl %ebp, %ebp
cmpl $0x2, %edi
jb 0x1f72c9
movq %rdx, 0x40(%rsp)
movslq %r9d, %rcx
xorl %ebp, %ebp
movq %rbp, 0x38(%rsp)
movl %ebp, 0x30(%rsp)
movl %ebp, 0x28(%rsp)
movq %rbp, 0x20(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movl %ebp, 0x8(%rsp)
movl $0xffffffff, (%rsp)     # imm = 0xFFFFFFFF
movq %r15, %rdi
xorl %esi, %esi
movl %r12d, %edx
movq %rcx, 0x50(%rsp)
movq 0x48(%rsp), %r8
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0xc02d6
movq (%r14), %rcx
testq %rax, %rax
je 0x1f72c9
cmpq %r13, %rcx
jbe 0x1f7146
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %r13, %rdx
movl %ebx, %ecx
movq 0x8(%r15), %rsi
movq 0x10(%r14), %rdi
movq (%rdi,%rdx,8), %rdi
leaq (%rdi,%rdi,2), %rdi
andl $0x7fffffff, 0xc(%rsi,%rdi,8) # imm = 0x7FFFFFFF
movq 0x8(%r15), %rsi
movq 0x28(%r15), %rdi
movq 0x10(%r14), %r8
movq (%r8,%rdx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
movl 0x8(%rsi,%rdx,8), %r8d
xorq $0x1, %r8
movq (%rdi,%r8,8), %r8
movq %r8, %rdi
andq %rax, %rdi
je 0x1f7138
movl 0x4(%rsi,%rdx,8), %edx
shrq $0x20, %r8
shlq $0x3, %rdi
leaq (%rdi,%rdi,2), %rdi
leaq (%r8,%r8,2), %r8
leaq (%rsi,%r8,8), %rsi
addq $0xc, %rsi
xorl %r8d, %r8d
movl -0x4(%rsi,%r8), %r9d
xorl %edx, %r9d
cmpl $0x1, %r9d
jne 0x1f712f
andb $0x7f, 0x3(%rsi,%r8)
addq $0x18, %r8
cmpq %r8, %rdi
jne 0x1f711b
incl %ecx
movq %rcx, %rdx
cmpq %rcx, (%r14)
ja 0x1f70bb
movq 0x28(%r15), %rax
movq 0x40(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %r12
shlq $0x3, %r12
addq 0x8(%r15), %r12
movq %r13, (%r14)
testl %eax, %eax
je 0x1f7273
movl %eax, %r8d
xorl %ebp, %ebp
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
movabsq $-0x5555555555555555, %r11 # imm = 0xAAAAAAAAAAAAAAAB
movq %r8, 0x40(%rsp)
leaq (,%rbp,2), %rax
addq %rbp, %rax
movl 0xc(%r12,%rax,8), %ecx
testl %ecx, %ecx
js 0x1f7267
leaq (%r12,%rax,8), %rax
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xc(%rax)
movl 0x8(%rax), %ecx
xorq $0x1, %rcx
movq 0x28(%r15), %rdx
movq (%rdx,%rcx,8), %rdx
movq %rdx, %rcx
andq %r10, %rcx
je 0x1f7201
movl 0x4(%rax), %eax
movq 0x8(%r15), %rsi
shrq $0x20, %rdx
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rdx,%rdx,2), %rdx
leaq (%rsi,%rdx,8), %rdx
addq $0xc, %rdx
xorl %esi, %esi
movl -0x4(%rdx,%rsi), %edi
xorl %eax, %edi
cmpl $0x1, %edi
jne 0x1f71f8
orb $-0x80, 0x3(%rdx,%rsi)
addq $0x18, %rsi
cmpq %rsi, %rcx
jne 0x1f71e8
movq (%r14), %rcx
movq 0x10(%r14), %rax
cmpq 0x8(%r14), %rcx
jne 0x1f724a
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r14)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movabsq $-0x5555555555555555, %r11 # imm = 0xAAAAAAAAAAAAAAAB
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
movq 0x40(%rsp), %r8
movq %rax, 0x10(%r14)
movq (%r14), %rcx
movq %r12, %rdx
subq 0x8(%r15), %rdx
sarq $0x3, %rdx
imulq %r11, %rdx
addq %rbp, %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%r14)
movq %rdx, (%rax,%rcx,8)
incq %rbp
cmpq %r8, %rbp
jne 0x1f718b
movq 0x48(%rsp), %r8
movq 0x18(%r8), %rax
movl (%rax), %edx
xorl $0x1, %edx
xorl %eax, %eax
movq %rax, 0x38(%rsp)
movl %eax, 0x30(%rsp)
movl %eax, 0x28(%rsp)
movq %rax, 0x20(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movl %eax, 0x8(%rsp)
movl $0xffffffff, (%rsp)     # imm = 0xFFFFFFFF
movq %r15, %rdi
xorl %esi, %esi
movq 0x50(%rsp), %rcx
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0xc02d6
xorl %ebp, %ebp
testq %rax, %rax
setne %bpl
movq (%r14), %rcx
cmpq %r13, %rcx
jbe 0x1f7363
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq 0x8(%r15), %rcx
movq 0x10(%r14), %rdx
movq (%rdx,%r13,8), %rdx
leaq (%rdx,%rdx,2), %rdx
andl $0x7fffffff, 0xc(%rcx,%rdx,8) # imm = 0x7FFFFFFF
movq 0x8(%r15), %rdx
movq 0x28(%r15), %rsi
movq 0x10(%r14), %rcx
movq (%rcx,%r13,8), %rcx
leaq (%rcx,%rcx,2), %rcx
movl 0x8(%rdx,%rcx,8), %edi
xorq $0x1, %rdi
movq (%rsi,%rdi,8), %rdi
movq %rdi, %rsi
andq %rax, %rsi
je 0x1f7351
movl 0x4(%rdx,%rcx,8), %ecx
shrq $0x20, %rdi
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rsi
leaq (%rdi,%rdi,2), %rdi
leaq (%rdx,%rdi,8), %rdx
addq $0xc, %rdx
xorl %edi, %edi
movl -0x4(%rdx,%rdi), %r8d
xorl %ecx, %r8d
cmpl $0x1, %r8d
jne 0x1f7348
andb $0x7f, 0x3(%rdx,%rdi)
addq $0x18, %rdi
cmpq %rdi, %rsi
jne 0x1f7335
incl %ebx
movq %rbx, %r13
cmpq %rbx, (%r14)
ja 0x1f72d7
jmp 0x1f7363
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq