// File: /workspace/github_cpp_makefile_star2_O2/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, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movl (%rcx,%rsi,8), %ecx
movq (%rax,%rcx,8), %r15
movl %r15d, %ebx
shrq $0x20, %r15
cmpq %rbx, %r15
jae 0x1cd27f
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
movq 0x28(%rax), %r13
movq 0x30(%rdi), %rax
movq %rax, (%rsp)
movq %rcx, 0x20(%rsp)
leaq (%rcx,%r15,8), %r12
addq $-0x8, %r12
movq %r15, %rbp
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movq %rdi, 0x8(%rsp)
cmpq %rbx, %rbp
ja 0x1cd270
cmpq %r15, %rbp
jbe 0x1cd1f5
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq %r12, %rsi
pushq $0x2
popq %rdx
movq (%rsp), %rcx
callq 0x1ccf02
cmpq $0x2, %rax
jb 0x1cd261
movq 0x8(%r12), %rax
andq $-0x2, %rax
movq (%r13), %rcx
movq 0x80(%r13), %rdx
movl (%rcx,%rax,2), %eax
incq %rdx
cmpq %rax, %rdx
jae 0x1cd219
movq %r14, %rcx
jmp 0x1cd252
movq %rbp, %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %r14
je 0x1cd252
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq 0x20(%rsp), %rax
leaq (%rax,%r14,8), %rsi
movq %rbp, %rdx
subq %r14, %rdx
incq %rdx
movq (%rsp), %rcx
callq 0x1ccf02
movq %rbp, %rcx
cmpq $0x2, %rax
jb 0x1cd261
incq %rbp
addq $0x8, %r12
movq %rcx, %r14
jmp 0x1cd1ca
movq 0x18(%rsp), %rax
movq 0x10(%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 0x2d6c1(%rip), %rdi     # 0x1fa947
leaq 0x2a24c(%rip), %rsi     # 0x1f74d9
leaq 0x2f304(%rip), %rcx     # 0x1fc598
movl $0x339a, %edx           # imm = 0x339A
callq 0x2110