// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: bubble_identify_worker(void*, long, int)
static void bubble_identify_worker(void *_data, long eid, int tid)
{
    bub_label_t *buf = (bub_label_t*)_data;
    buf_s_t *b = &(buf->b[tid]);
    uint32_t v = eid, i;
    asg_t *g = buf->g;
    if(g->seq[v>>1].del) return;
    if(asg_arc_n(g, v) < 2 || get_real_length(g, v, NULL) < 2) return;

    if(g->seq_vis[v] != 1 && asg_bub_pop1_label(g, v, buf->bub_dist, b))
    {
        //beg is v, end is b.S.a[0]
        //note b.b include end, does not include beg
        for (i = 0; i < b->b.n; i++)
        {
            if(b->b.a[i]==v || b->b.a[i]==b->S.a[0]) continue;
            g->seq_vis[b->b.a[i]] = 1;
            g->seq_vis[b->b.a[i]^1] = 1;
        }
        g->seq_vis[v] = 1;
        g->seq_vis[b->S.a[0]^1] = 1;
    }

    if(buf->check_cross == 1 && g->seq_vis[v] == 0 && check_if_cross(g, v))
    {
        g->seq_vis[v] = 2;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x2c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xd88f3
jmp 0xd8a4a
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x2c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
cmpl $0x2, %eax
jb 0xd891c
movq -0x38(%rbp), %rdi
movl -0x2c(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x166b50
cmpl $0x2, %eax
jge 0xd8921
jmp 0xd8a4a
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x2c(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x1, %eax
je 0xd8a0c
movq -0x38(%rbp), %rdi
movl -0x2c(%rbp), %esi
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x28(%rbp), %rcx
callq 0x13a640
cmpq $0x0, %rax
je 0xd8a0c
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0xd89e2
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x30(%rbp), %ecx
movl (%rax,%rcx,4), %eax
cmpl -0x2c(%rbp), %eax
je 0xd899c
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x30(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movq -0x28(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpl (%rcx), %eax
jne 0xd899e
jmp 0xd89d7
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x28(%rbp), %rcx
movq 0x30(%rcx), %rcx
movl -0x30(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
movb $0x1, (%rax,%rcx)
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x28(%rbp), %rcx
movq 0x30(%rcx), %rcx
movl -0x30(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movb $0x1, (%rax,%rcx)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xd8962
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x2c(%rbp), %ecx
movb $0x1, (%rax,%rcx)
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x28(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl (%rcx), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movb $0x1, (%rax,%rcx)
movq -0x20(%rbp), %rax
cmpl $0x1, 0x18(%rax)
jne 0xd8a4a
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x2c(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0xd8a4a
movq -0x38(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0xd7cb0
cmpl $0x0, %eax
je 0xd8a4a
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x2c(%rbp), %ecx
movb $0x2, (%rax,%rcx)
addq $0x40, %rsp
popq %rbp
retq