// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: worker_renew_integer_bridge(void*, long, int)
static void worker_renew_integer_bridge(void *data, long i, int tid) // callback for kt_for()
{
    ul_resolve_t *uidx = (ul_resolve_t *)data; bubble_type *bub = uidx->bub;
    asg_t *bg = uidx->uovl.bg.bg; ul_str_idx_t *str_idx = &(uidx->pstr);
    asg_arc_t *p = &(bg->arc[i]); uint64_t *hid_a, hid_n, z; ul_str_t *str;
    uint32_t v = p->ul>>32, w = p->v, vz, wz; int64_t s, s_n, occ = 0;

    hid_a = str_idx->occ.a + str_idx->idx.a[v>>1];
    hid_n = str_idx->idx.a[(v>>1)+1] - str_idx->idx.a[v>>1];
    for (z = 0; z < hid_n; z++) {
        str = &(str_idx->str.a[hid_a[z]>>32]); s_n = str->cn;
        if(s_n < 2) continue;
        vz = (uint32_t)(str->a[(uint32_t)hid_a[z]]);
        assert((v>>1) == (vz>>1));
        s = (uint32_t)hid_a[z]; s -= 1; vz = ((uint32_t)(str->a[(uint32_t)hid_a[z]]))^1;
        for (; s >= 0; s--) {
            wz = (uint32_t)(str->a[s]); wz ^= 1;
            if(IF_HOM((wz>>1), *bub)) continue;
            if(vz == v && wz == w) occ++;
            else if(vz == (v^1) && wz == (w^1)) occ++;
            break;
        }

        s = (uint32_t)hid_a[z]; s += 1; vz = (uint32_t)(str->a[(uint32_t)hid_a[z]]);
        for (; s < s_n; s++) {
            wz = (uint32_t)(str->a[s]);
            if(IF_HOM((wz>>1), *bub)) continue;
            if(vz == v && wz == w) occ++;
            else if(vz == (v^1) && wz == (w^1)) occ++;
            break;
        }
    }
    p->ol = occ; p->ul >>= 32; p->ul <<= 32; p->ul += (((uint32_t)-1) - p->ol);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x28(%rdi), %rdx
movq 0x1a0(%rdi), %rax
movq 0x278(%rdi), %rcx
movq 0x8(%rcx), %rcx
imulq $0x18, %rsi, %rsi
leaq (%rcx,%rsi), %r8
movq %r8, 0x18(%rsp)
movq (%rcx,%rsi), %r8
movq %r8, %r9
shrq $0x20, %r9
movq %r9, 0x8(%rsp)
movl 0x8(%rcx,%rsi), %ecx
movl %ecx, 0x4(%rsp)
movq %r8, 0x10(%rsp)
shrq $0x21, %r8
movq (%rax,%r8,8), %rcx
leaq (,%rcx,8), %r11
addq 0x1b8(%rdi), %r11
movq %r8, 0x20(%rsp)
movq 0x8(%rax,%r8,8), %rbx
subq %rcx, %rbx
xorl %r14d, %r14d
xorl %esi, %esi
cmpq %rbx, %r14
je 0x1da190
movq 0x1d0(%rdi), %rcx
movq (%r11,%r14,8), %rax
movq %rax, %r12
shrq $0x1b, %r12
andq $-0x20, %r12
movl 0x18(%rcx,%r12), %r15d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
cmpl $0x2, %r15d
jae 0x1da0c9
incq %r14
jmp 0x1da093
addq %r12, %rcx
movq 0x10(%rcx), %r12
movl %eax, %ecx
movl (%r12,%rcx,8), %ebp
movl %ebp, %eax
shrl %eax
movq %rcx, %r13
cmpl %eax, 0x20(%rsp)
jne 0x1da1d1
testq %r13, %r13
jle 0x1da136
movq -0x8(%r12,%r13,8), %r9
decq %r13
movl %r9d, %eax
shrl %eax
movq (%rdx), %r10
movq 0x80(%rdx), %r8
movl (%r10,%rax,4), %eax
incq %r8
cmpq %rax, %r8
jb 0x1da0e7
movl %ebp, %r13d
xorl 0x8(%rsp), %r13d
xorl 0x4(%rsp), %r9d
cmpl $0x1, %r13d
jne 0x1da12c
cmpl $0x1, %r9d
jne 0x1da12c
incl %esi
jmp 0x1da136
xorl %eax, %eax
orl %r9d, %r13d
sete %al
addl %eax, %esi
incq %rcx
cmpq %r15, %rcx
jae 0x1da0c4
movq (%r12,%rcx,8), %rax
movl %eax, %r8d
shrl %r8d
movq (%rdx), %r9
movq 0x80(%rdx), %r10
movl (%r9,%r8,4), %r8d
incq %r10
incq %rcx
cmpq %r8, %r10
jb 0x1da139
cmpl 0x8(%rsp), %ebp
jne 0x1da174
cmpl %eax, 0x4(%rsp)
jne 0x1da174
incl %esi
jmp 0x1da0c4
xorl 0x8(%rsp), %ebp
xorl $0x1, %ebp
xorl 0x4(%rsp), %eax
xorl $0x1, %eax
xorl %ecx, %ecx
orl %ebp, %eax
sete %cl
addl %ecx, %esi
jmp 0x1da0c4
movl $0x80000000, %eax       # imm = 0x80000000
movq 0x18(%rsp), %rcx
andl 0xc(%rcx), %eax
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
orl %esi, %eax
movl %eax, 0xc(%rcx)
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq 0x10(%rsp), %rdx
andq %rax, %rdx
notl %esi
orq %rdx, %rsi
movq %rsi, (%rcx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1fe36(%rip), %rdi     # 0x1fa00e
leaq 0x1d2fa(%rip), %rsi     # 0x1f74d9
leaq 0x224a8(%rip), %rcx     # 0x1fc68e
movl $0x40f7, %edx           # imm = 0x40F7
callq 0x2110