// File: /workspace/github_cpp_makefile_star2_O2/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 $0x68, %rsp
movq %rcx, %rbx
movq 0x20(%rsi), %rax
movl %edi, %ecx
shrl %ecx
cmpl $0x0, (%rax,%rcx,8)
js 0x1aba61
movl %r8d, %ebp
movq %rsi, %r14
movl %edi, %r12d
movl %r9d, 0x48(%rsp)
movq %rdx, 0x50(%rsp)
pushq $0x1
popq %r13
movl %r8d, %eax
movl %eax, %r15d
cmpq %r15, (%rbx)
jbe 0x1ab98d
movq 0x10(%rbx), %rax
imulq $0x18, (%rax,%r15,8), %rax
movq 0x8(%r14), %rcx
orl $0x80000000, 0xc(%rcx,%rax) # imm = 0x80000000
movq 0x8(%r14), %rax
movq 0x10(%rbx), %rcx
imulq $0x18, (%rcx,%r15,8), %rcx
movl 0x4(%rax,%rcx), %edx
movl 0x8(%rax,%rcx), %esi
xorl $0x1, %esi
xorl $0x1, %edx
movq %r14, %rdi
movl %r13d, %ecx
callq 0x1abbde
leal 0x1(%r15), %eax
jmp 0x1ab944
movq 0x28(%r14), %rax
movl %r12d, %ecx
testl $0xfffffffe, (%rax,%rcx,8) # imm = 0xFFFFFFFE
je 0x1aba69
movq %rcx, 0x60(%rsp)
xorl %r13d, %r13d
movq %r14, %rdi
movl %r12d, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1a5422
cmpl $0x2, %eax
jb 0x1abbc4
movslq 0x48(%rsp), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
andq $0x0, 0x38(%rsp)
andl $0x0, 0x30(%rsp)
andl $0x0, 0x28(%rsp)
andq $0x0, 0x20(%rsp)
andl $0x0, 0x8(%rsp)
orl $-0x1, (%rsp)
xorl %r13d, %r13d
pushq $-0x1
popq %r9
movq %r14, %rdi
xorl %esi, %esi
movl %r12d, %edx
movq %r15, %rcx
movq 0x50(%rsp), %r8
callq 0x84a86
testq %rax, %rax
je 0x1abbc4
movq %r15, 0x58(%rsp)
movl %ebp, %eax
movl %eax, %r15d
movq 0x8(%r14), %rax
cmpq %r15, (%rbx)
jbe 0x1aba71
movq 0x10(%rbx), %rcx
imulq $0x18, (%rcx,%r15,8), %rcx
andl $0x7fffffff, 0xc(%rax,%rcx) # imm = 0x7FFFFFFF
movq 0x8(%r14), %rax
movq 0x10(%rbx), %rcx
imulq $0x18, (%rcx,%r15,8), %rcx
movl 0x4(%rax,%rcx), %edx
movl 0x8(%rax,%rcx), %esi
xorl $0x1, %esi
xorl $0x1, %edx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x1abbde
leal 0x1(%r15), %eax
jmp 0x1aba19
xorl %r13d, %r13d
jmp 0x1abbcc
xorl %r13d, %r13d
jmp 0x1abbc4
movq 0x28(%r14), %rcx
movq 0x60(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
movl %ecx, %r15d
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
leaq (%rax,%rcx), %rdx
movq %rdx, 0x48(%rsp)
movl %ebp, %edx
movq %rdx, (%rbx)
leaq (%rax,%rcx), %r13
addq $0xc, %r13
xorl %r12d, %r12d
cmpq %r12, %r15
je 0x1abb32
movl (%r13), %eax
testl %eax, %eax
js 0x1abb26
orl $0x80000000, %eax       # imm = 0x80000000
movl %eax, (%r13)
movl -0x8(%r13), %edx
movl -0x4(%r13), %esi
xorl $0x1, %esi
xorl $0x1, %edx
movq %r14, %rdi
pushq $0x1
popq %rcx
callq 0x1abbde
movq (%rbx), %rcx
movq 0x10(%rbx), %rdi
cmpq 0x8(%rbx), %rcx
jne 0x1abb07
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
pushq $0x2
popq %rax
cmoveq %rax, %rsi
movq %rsi, 0x8(%rbx)
shlq $0x3, %rsi
callq 0x2370
movq %rax, %rdi
movq %rax, 0x10(%rbx)
movq (%rbx), %rcx
movq 0x48(%rsp), %rax
subq 0x8(%r14), %rax
cqto
pushq $0x18
popq %rsi
idivq %rsi
addq %r12, %rax
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
movq %rax, (%rdi,%rcx,8)
incq %r12
addq $0x18, %r13
jmp 0x1abaa2
movq 0x50(%rsp), %r8
movq 0x18(%r8), %rax
movl (%rax), %edx
xorl $0x1, %edx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
andq $0x0, 0x38(%rsp)
andl $0x0, 0x30(%rsp)
andl $0x0, 0x28(%rsp)
andq $0x0, 0x20(%rsp)
andl $0x0, 0x8(%rsp)
orl $-0x1, (%rsp)
pushq $-0x1
popq %r9
movq %r14, %rdi
xorl %esi, %esi
movq 0x58(%rsp), %rcx
callq 0x84a86
xorl %r13d, %r13d
testq %rax, %rax
setne %r13b
jmp 0x1abbc4
movq 0x10(%rbx), %rax
imulq $0x18, (%rax,%r15,8), %rax
movq 0x8(%r14), %rcx
andl $0x7fffffff, 0xc(%rcx,%rax) # imm = 0x7FFFFFFF
movq 0x8(%r14), %rax
movq 0x10(%rbx), %rcx
imulq $0x18, (%rcx,%r15,8), %rcx
movl 0x4(%rax,%rcx), %edx
movl 0x8(%rax,%rcx), %esi
xorl $0x1, %esi
xorl $0x1, %edx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x1abbde
leal 0x1(%r15), %ebp
movl %ebp, %r15d
cmpq %r15, (%rbx)
ja 0x1abb86
movl %r13d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq