// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: worker_unique_bridge_check_s(void*, long, int)
static void worker_unique_bridge_check_s(void *data, long i, int tid) // callback for kt_for()
{
    unique_bridge_check_t *uaux = (unique_bridge_check_t *)data;
    uint64_t *integer_seq = uaux->integer_seq, s, e, vk, wk, nse, k;
    uint64_t *gidx = uaux->gidx, *interval = uaux->interval_idx;
    bubble_type *bub = uaux->uidx->bub; usg_t *ng = uaux->ng;

    s = interval[((uint32_t)gidx[i])]>>32; 
    e = ((uint32_t)interval[((uint32_t)gidx[i])]); 
    assert(s < e);
    for (k = s, vk = wk = (uint32_t)-1; k <= e; k++) {
        if(k > s) {
            // nse = get_arc_support(uaux->uidx, (ng->a[integer_seq[k-1]>>1].mm<<1)|(integer_seq[k-1]&1), 
            // (ng->a[integer_seq[k]>>1].mm<<1)|(integer_seq[k]&1));
            nse = get_arc_support_chain(uaux->uidx, integer_seq+k-1, 2, ng);
            if(nse < unique_bridge_occ) {
                // if((!(uaux->is_double_check)) || (!is_consist_ul(uaux->uidx, integer_seq+k-1, 2, ng))) {
                    gidx[i] |= ((uint64_t)0x8000000000000000); return;
                // }
            }
        }
        if(IF_HOM((integer_seq[k]>>1), *bub)) continue;
        // w = (ng->a[integer_seq[k]>>1].mm<<1)|(integer_seq[k]&1);
        wk = k;
        if(vk != (uint32_t)-1) {
            // nse = get_arc_support(uaux->uidx, v, w);
            nse = get_arc_support_chain(uaux->uidx, integer_seq+vk, wk+1-vk, ng);
            if(nse < unique_bridge_occ) {
                // if((!(uaux->is_double_check)) || (!is_consist_ul(uaux->uidx, integer_seq+vk, wk+1-vk, ng))) {
                    gidx[i] |= ((uint64_t)0x8000000000000000); return;
                // }
            }
        }
        vk = wk;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x10(%rdi), %rcx
movq 0x18(%rdi), %rax
movq %rsi, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movl (%rcx,%rsi,8), %ecx
movq (%rax,%rcx,8), %r14
movl %r14d, %esi
shrq $0x20, %r14
cmpq %rsi, %r14
jae 0x21becf
movq (%rdi), %rax
movq 0x8(%rdi), %rbx
movq 0x28(%rax), %r12
movq 0x30(%rdi), %rax
movq %rax, (%rsp)
incq %rsi
leaq -0x8(,%r14,8), %r15
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movq %r14, %rbp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
cmpq %r14, %rbp
jbe 0x21be3f
movq 0x10(%rsp), %rax
movq (%rax), %rdi
leaq (%rbx,%r15), %rsi
movl $0x2, %edx
movq (%rsp), %rcx
callq 0x21badd
movq 0x8(%rsp), %rsi
cmpq $0x2, %rax
jb 0x21beb1
movq (%rbx,%rbp,8), %rax
andq $-0x2, %rax
movq (%r12), %rcx
movq 0x80(%r12), %rdx
movl (%rcx,%rax,2), %eax
incq %rdx
cmpq %rax, %rdx
jae 0x21be63
movq %r13, %rcx
jmp 0x21be9c
movq %rbp, %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %r13
je 0x21be9c
movq 0x10(%rsp), %rax
movq (%rax), %rdi
leaq (%rbx,%r13,8), %rsi
movq %rbp, %rdx
subq %r13, %rdx
incq %rdx
movq (%rsp), %rcx
callq 0x21badd
movq 0x8(%rsp), %rsi
movq %rbp, %rcx
cmpq $0x2, %rax
jb 0x21beb1
incq %rbp
addq $0x8, %r15
movq %rcx, %r13
cmpq %rbp, %rsi
jne 0x21be15
jmp 0x21bec0
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rcx
orb $-0x80, 0x7(%rcx,%rax,8)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2cab2(%rip), %rdi     # 0x248988
leaq 0x2972c(%rip), %rsi     # 0x245609
leaq 0x2e6f5(%rip), %rcx     # 0x24a5d9
movl $0x339a, %edx           # imm = 0x339A
callq 0x2110