// File: chhylp123[P]hifiasm/gfa_ut.cpp
// Function: worker_update_ul_arc_drop(void*, long, int)
static void worker_update_ul_arc_drop(void *data, long i, int tid) // callback for kt_for()
{
    ul_resolve_t *uidx = (ul_resolve_t *)data; integer_t *buf = &(uidx->str_b.buf[tid]);
    ul_str_idx_t *str_idx = &(uidx->pstr); uinfo_srt_warp_t *seq = uidx->uovl.iug_seq;
    uint32_t v = seq->a[i].v, z, vz; uint64_t *hid_a, hid_n; ul_str_t *str;
    int64_t s_n, s, p, p_n = seq->n; uint64_t cutoff = uidx->uovl.iug_cov_thre, occ;

    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 = occ = 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)); 

        if(v == vz) {
            s = ((uint32_t)hid_a[z]) + 1; p = i + 1; 
            if((s < s_n) && (p < p_n) && ((uint32_t)(str->a[s]) == seq->a[p].v)) {
                occ++;
            }
        } else {
            s = ((int32_t)((uint32_t)hid_a[z]))-1; p = i + 1; 
            if((s >= 0) && (p < p_n) && ((uint32_t)(str->a[s]) == (seq->a[p].v^1))) {
                occ++;
            }
        }
        if(occ >= cutoff) break;
    }

    if(occ < cutoff) kv_push(uint64_t, buf->res_dump, i);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %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 0x1d8(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x328, %rcx, %rcx      # imm = 0x328
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq 0x298(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x20(%rbp), %rax
movq 0x2a0(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x30(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x3c(%rbp), %edx
shrl %edx
movl %edx, %edx
movq (%rcx,%rdx,8), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x3c(%rbp), %ecx
shrl %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movq -0x30(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x3c(%rbp), %edx
shrl %edx
movl %edx, %edx
subq (%rcx,%rdx,8), %rax
movq %rax, -0x58(%rbp)
movq $0x0, -0x90(%rbp)
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpq -0x58(%rbp), %rax
jae 0x3709b4
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x50(%rbp), %rcx
movl -0x40(%rbp), %edx
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, -0x68(%rbp)
cmpq $0x2, -0x68(%rbp)
jge 0x37085f
jmp 0x3709a6
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rcx
movl -0x40(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x44(%rbp)
movl -0x3c(%rbp), %eax
shrl %eax
movl -0x44(%rbp), %ecx
shrl %ecx
cmpl %ecx, %eax
jne 0x37088b
jmp 0x3708aa
leaq 0x284ad(%rip), %rdi     # 0x398d3f
leaq 0x25920(%rip), %rsi     # 0x3961b9
movl $0x2924, %edx           # imm = 0x2924
leaq 0x2aae0(%rip), %rcx     # 0x39b385
callq 0x2130
movl -0x3c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jne 0x370921
movq -0x50(%rbp), %rax
movl -0x40(%rbp), %ecx
movq (%rax,%rcx,8), %rax
addl $0x1, %eax
movl %eax, %eax
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rax
cmpq -0x68(%rbp), %rax
jge 0x37091f
movq -0x78(%rbp), %rax
cmpq -0x80(%rbp), %rax
jge 0x37091f
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x70(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x78(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jne 0x37091f
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x370992
movq -0x50(%rbp), %rax
movl -0x40(%rbp), %ecx
movq (%rax,%rcx,8), %rax
subl $0x1, %eax
cltq
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x70(%rbp)
jl 0x370990
movq -0x78(%rbp), %rax
cmpq -0x80(%rbp), %rax
jge 0x370990
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x70(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x78(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0x370990
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x370992
movq -0x90(%rbp), %rax
cmpq -0x88(%rbp), %rax
jb 0x3709a4
jmp 0x3709b4
jmp 0x3709a6
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x370812
movq -0x90(%rbp), %rax
cmpq -0x88(%rbp), %rax
jae 0x370a82
jmp 0x3709ca
movq -0x28(%rbp), %rax
movq 0x300(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x308(%rcx), %rax
jne 0x370a54
movq -0x28(%rbp), %rax
cmpq $0x0, 0x308(%rax)
je 0x370a07
movq -0x28(%rbp), %rax
movq 0x308(%rax), %rax
shlq %rax
movq %rax, -0x98(%rbp)
jmp 0x370a15
movl $0x2, %eax
movq %rax, -0x98(%rbp)
jmp 0x370a15
movq -0x98(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x308(%rax)
movq -0x28(%rbp), %rax
movq 0x310(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x308(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x310(%rax)
movq -0x10(%rbp), %rdx
movq -0x28(%rbp), %rax
movq 0x310(%rax), %rax
movq -0x28(%rbp), %rsi
movq 0x300(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x300(%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x370a82
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax,%rax)