// File: 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
movq %rsp, %rbp
subq $0x90, %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 0x28(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq 0x278(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
imulq $0x18, -0x10(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, -0x64(%rbp)
movq -0x40(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x68(%rbp)
movq $0x0, -0x88(%rbp)
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x64(%rbp), %edx
shrl %edx
movl %edx, %edx
movq (%rcx,%rdx,8), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x64(%rbp), %ecx
shrl %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x64(%rbp), %edx
shrl %edx
movl %edx, %edx
subq (%rcx,%rdx,8), %rax
movq %rax, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x50(%rbp), %rax
jae 0x3746e0
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x48(%rbp), %rcx
movq -0x58(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movq %rax, -0x80(%rbp)
cmpq $0x2, -0x80(%rbp)
jge 0x3744a8
jmp 0x3746cf
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x48(%rbp), %rcx
movq -0x58(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x6c(%rbp)
movl -0x64(%rbp), %eax
shrl %eax
movl -0x6c(%rbp), %ecx
shrl %ecx
cmpl %ecx, %eax
jne 0x3744d5
jmp 0x3744f4
leaq 0x24863(%rip), %rdi     # 0x398d3f
leaq 0x21cd6(%rip), %rsi     # 0x3961b9
movl $0x40f7, %edx           # imm = 0x40F7
leaq 0x26ec8(%rip), %rcx     # 0x39b3b7
callq 0x2130
movq -0x48(%rbp), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x78(%rbp)
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x48(%rbp), %rcx
movq -0x58(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
xorl $0x1, %eax
movl %eax, -0x6c(%rbp)
cmpq $0x0, -0x78(%rbp)
jl 0x3745e5
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x78(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %eax
xorl $0x1, %eax
movl %eax, -0x70(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl -0x70(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movq -0x28(%rbp), %rcx
movq 0x80(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jbe 0x374580
jmp 0x3745d4
movl -0x6c(%rbp), %eax
cmpl -0x64(%rbp), %eax
jne 0x3745a4
movl -0x70(%rbp), %eax
cmpl -0x68(%rbp), %eax
jne 0x3745a4
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x3745d2
movl -0x6c(%rbp), %eax
movl -0x64(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3745d0
movl -0x70(%rbp), %eax
movl -0x68(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3745d0
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x3745d2
jmp 0x3745e5
movq -0x78(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0x374532
movq -0x48(%rbp), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x48(%rbp), %rcx
movq -0x58(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x6c(%rbp)
movq -0x78(%rbp), %rax
cmpq -0x80(%rbp), %rax
jge 0x3746cd
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x78(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x70(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl -0x70(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movq -0x28(%rbp), %rcx
movq 0x80(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jbe 0x374668
jmp 0x3746bc
movl -0x6c(%rbp), %eax
cmpl -0x64(%rbp), %eax
jne 0x37468c
movl -0x70(%rbp), %eax
cmpl -0x68(%rbp), %eax
jne 0x37468c
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x3746ba
movl -0x6c(%rbp), %eax
movl -0x64(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3746b8
movl -0x70(%rbp), %eax
movl -0x68(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3746b8
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x3746ba
jmp 0x3746cd
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0x374620
jmp 0x3746cf
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x374459
movq -0x88(%rbp), %rax
movl %eax, %edx
movq -0x40(%rbp), %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, 0xc(%rax)
movq -0x40(%rbp), %rax
movq (%rax), %rcx
shrq $0x20, %rcx
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
movq (%rax), %rcx
shlq $0x20, %rcx
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
subl %ecx, %eax
movl %eax, %eax
movl %eax, %ecx
movq -0x40(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax,%rax)