// File: chhylp123[P]hifiasm/gfa_ut.cpp
// Function: label_contain_dup(asg_t*, R_to_U*, unsigned int, asg64_v*, asg64_v*)
void label_contain_dup(asg_t *g, R_to_U* rI, uint32_t v0, asg64_v *b, asg64_v *dump)
{
    asg_arc_t *av; uint32_t nv, v, i;
    if(!is_contain_r((*rI), (v0>>1))) return;
    b->n = 0; kv_push(uint64_t, *b, v0);
    while (b->n) {
        v = kv_pop(*b);
        if(g->seq_vis[v]&1) continue;
        kv_push(uint64_t, *dump, v);
        g->seq_vis[v] |= 1;
        av = asg_arc_a(g, v); 
        nv = asg_arc_n(g, v);
        for (i = 0; i < nv; ++i) {
            if(av[i].del || (g->seq_vis[av[i].v]&1) || (!is_contain_r((*rI), (av[i].v>>1)))) continue;
            kv_push(uint64_t, *b, av[i].v);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl -0x14(%rbp), %eax
shrl %eax
movl %eax, %eax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x31b4ea
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x14(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
cmpl $-0x1, (%rax,%rcx,4)
je 0x31b4ea
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x14(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x31b4ef
jmp 0x31b819
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x31b562
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x31b527
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x48(%rbp)
jmp 0x31b532
movl $0x2, %eax
movq %rax, -0x48(%rbp)
jmp 0x31b532
movq -0x48(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x14(%rbp), %eax
movl %eax, %edx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x31b586
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
je 0x31b819
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $-0x1, %rsi
movq %rsi, (%rdx)
movq -0x8(%rax,%rcx,8), %rax
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x38(%rbp), %ecx
movzbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x31b5ce
jmp 0x31b586
jmp 0x31b5d0
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x31b638
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x31b5fd
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x50(%rbp)
jmp 0x31b608
movl $0x2, %eax
movq %rax, -0x50(%rbp)
jmp 0x31b608
movq -0x50(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x38(%rbp), %eax
movl %eax, %edx
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x28(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x38(%rbp), %ecx
movzbl (%rax,%rcx), %edx
orl $0x1, %edx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x38(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x38(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x34(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jae 0x31b814
movq -0x30(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x31b765
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x30(%rbp), %rcx
movl -0x3c(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
movzbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x31b765
movq -0x30(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
shrl %eax
movl %eax, %eax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x31b765
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x30(%rbp), %rcx
movl -0x3c(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
cmpl $-0x1, (%rax,%rcx,4)
je 0x31b765
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x30(%rbp), %rcx
movl -0x3c(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x31b76a
jmp 0x31b806
jmp 0x31b76c
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x31b7d4
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x31b799
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x58(%rbp)
jmp 0x31b7a4
movl $0x2, %eax
movq %rax, -0x58(%rbp)
jmp 0x31b7a4
movq -0x58(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
movl -0x3c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, %edx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x31b806
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x31b6ae
jmp 0x31b586
addq $0x60, %rsp
popq %rbp
retq
nop