// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/hic.cpp
// Function: dfs_bubble(asg_t*, kvec_t_u32_warp*, kvec_t_u32_warp*, unsigned int, unsigned int, unsigned int)
void dfs_bubble(asg_t *g, kvec_t_u32_warp* stack, kvec_t_u32_warp* result, uint32_t v, uint32_t beg, uint32_t sink)
{
    asg_arc_t *acur = NULL;
    uint32_t cur, ncur, i;
    stack->a.n = result->a.n = 0;
    v = v << 1;
    kv_push(uint32_t, stack->a, v);
    while (stack->a.n > 0)
    {
        stack->a.n--;
        cur = stack->a.a[stack->a.n];
        if((v>>1) != (cur>>1)) kv_push(uint32_t, result->a, cur>>1);
        ncur = asg_arc_n(g, cur);
        acur = asg_arc_a(g, cur);
        for (i = 0; i < ncur; i++)
        {
            if(acur[i].del) continue;
            if((acur[i].v>>1) == beg || (acur[i].v>>1) == sink) continue;
            kv_push(uint32_t, stack->a, acur[i].v);
        }
    }
    

    v = v + 1;
    kv_push(uint32_t, stack->a, v);
    while (stack->a.n > 0)
    {
        stack->a.n--;
        cur = stack->a.a[stack->a.n];
        if((v>>1) != (cur>>1)) kv_push(uint32_t, result->a, cur>>1);
        ncur = asg_arc_n(g, cur);
        acur = asg_arc_a(g, cur);
        for (i = 0; i < ncur; i++)
        {
            if(acur[i].del) continue;
            if((acur[i].v>>1) == beg || (acur[i].v>>1) == sink) continue;
            kv_push(uint32_t, stack->a, acur[i].v);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, %ebx
movl %r8d, %ebp
movq %rdx, %r13
movq %rsi, %r12
andq $0x0, (%rdx)
movq %rdi, 0x18(%rsp)
andq $0x0, (%rsi)
movq %rcx, 0x10(%rsp)
leal (%rcx,%rcx), %eax
movl %eax, 0xc(%rsp)
xorl %eax, %eax
cmpq %rax, 0x8(%rsi)
je 0xf7029
movq 0x10(%r12), %rax
xorl %edx, %edx
jmp 0xf7048
movq $0x2, 0x8(%r12)
movq 0x10(%r12), %rdi
pushq $0x8
popq %rsi
callq 0x2370
movq %rax, 0x10(%r12)
movq (%r12), %rdx
leaq 0x1(%rdx), %rcx
movq %rcx, (%r12)
movl 0xc(%rsp), %esi
movl %esi, (%rax,%rdx,4)
movq 0x10(%rsp), %rax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, 0x10(%rsp)
movq %r13, 0x20(%rsp)
testq %rcx, %rcx
je 0xf717b
leaq -0x1(%rcx), %rax
movq %rax, (%r12)
movq 0x10(%r12), %rax
movl -0x4(%rax,%rcx,4), %r14d
movl %r14d, %r15d
shrl %r15d
cmpl %r15d, 0x10(%rsp)
je 0xf70d3
movq (%r13), %rcx
movq 0x10(%r13), %rax
cmpq 0x8(%r13), %rcx
jne 0xf70c7
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r13)
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x10(%r13)
movq (%r13), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%r13)
movl %r15d, (%rax,%rcx,4)
movq 0x18(%rsp), %rcx
movq 0x8(%rcx), %rax
movq 0x28(%rcx), %rcx
movq (%rcx,%r14,8), %rcx
movl %ecx, %edx
shrq $0x20, %rcx
imulq $0x18, %rdx, %r13
imulq $0x18, %rcx, %rcx
leaq (%rax,%rcx), %r15
addq $0x8, %r15
xorl %r14d, %r14d
cmpq %r14, %r13
je 0xf716d
cmpl $0x0, 0x4(%r15,%r14)
js 0xf7167
movl (%r15,%r14), %ecx
movl %ecx, %eax
shrl %eax
cmpl %ebp, %eax
sete %dl
cmpl %ebx, %eax
sete %al
orb %dl, %al
jne 0xf7167
movq (%r12), %rdx
movq 0x10(%r12), %rax
cmpq 0x8(%r12), %rdx
jne 0xf715c
leaq (%rdx,%rdx), %rsi
testq %rdx, %rdx
pushq $0x2
popq %rcx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r12)
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x10(%r12)
movl (%r15,%r14), %ecx
movq (%r12), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, (%r12)
movl %ecx, (%rax,%rdx,4)
addq $0x18, %r14
jmp 0xf70fd
movq (%r12), %rcx
movq 0x20(%rsp), %r13
jmp 0xf706b
orl $0x1, 0xc(%rsp)
cmpq $0x0, 0x8(%r12)
movq 0x10(%r12), %rax
je 0xf7191
xorl %edx, %edx
jmp 0xf71ae
movq $0x2, 0x8(%r12)
pushq $0x8
popq %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x10(%r12)
movq (%r12), %rdx
leaq 0x1(%rdx), %rcx
movq %rcx, (%r12)
movl 0xc(%rsp), %esi
movl %esi, (%rax,%rdx,4)
testq %rcx, %rcx
je 0xf72cd
leaq -0x1(%rcx), %rax
movq %rax, (%r12)
movq 0x10(%r12), %rax
movl -0x4(%rax,%rcx,4), %r14d
movl %r14d, %r15d
shrl %r15d
cmpl %r15d, 0x10(%rsp)
je 0xf7225
movq (%r13), %rcx
movq 0x10(%r13), %rax
cmpq 0x8(%r13), %rcx
jne 0xf7219
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r13)
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x10(%r13)
movq (%r13), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%r13)
movl %r15d, (%rax,%rcx,4)
movq 0x18(%rsp), %rcx
movq 0x8(%rcx), %rax
movq 0x28(%rcx), %rcx
movq (%rcx,%r14,8), %rcx
movl %ecx, %edx
shrq $0x20, %rcx
imulq $0x18, %rdx, %r13
imulq $0x18, %rcx, %rcx
leaq (%rax,%rcx), %r15
addq $0x8, %r15
xorl %r14d, %r14d
cmpq %r14, %r13
je 0xf72bf
cmpl $0x0, 0x4(%r15,%r14)
js 0xf72b9
movl (%r15,%r14), %ecx
movl %ecx, %eax
shrl %eax
cmpl %ebp, %eax
sete %dl
cmpl %ebx, %eax
sete %al
orb %dl, %al
jne 0xf72b9
movq (%r12), %rdx
movq 0x10(%r12), %rax
cmpq 0x8(%r12), %rdx
jne 0xf72ae
leaq (%rdx,%rdx), %rsi
testq %rdx, %rdx
pushq $0x2
popq %rcx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r12)
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x10(%r12)
movl (%r15,%r14), %ecx
movq (%r12), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, (%r12)
movl %ecx, (%rax,%rdx,4)
addq $0x18, %r14
jmp 0xf724f
movq (%r12), %rcx
movq 0x20(%rsp), %r13
jmp 0xf71bd
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq