// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: worker_for_trans_sec_simple_cut(void*, long, int)
static void worker_for_trans_sec_simple_cut(void *data, long i, int tid) // callback for kt_for()
{
    u_trans_clean_t *s = (u_trans_clean_t*)data;
    kv_u_trans_t *ta = s->ta; u_trans_t *a, *za;
    uint32_t id = i, n, k, z, zn; 

    a = u_trans_a(*ta, id); n = u_trans_n(*ta, id);
    for (k = 0; k < n; k++) {
        if((!a[k].del)) continue;
        za = u_trans_a(*ta, a[k].tn); zn = u_trans_n(*ta, a[k].tn);
        for (z = 0; z < zn; z++) {
            if(za[z].tn == id) break;
        }
        assert(z < zn);
        if(za[z].del) { ///both a[k] and za[z] have been deleted
            if(a[k].qn < a[k].tn) a[k].occ = za[z].occ = ((uint32_t)-1);
            continue; 
        }
        ///a[k].del == 1 && za[z].del == 0
        if(za[z].qe-za[z].qs >= 3000000) {
            a[k].occ = za[z].occ = 0;
        } else {
            a[k].occ = za[z].occ = ((uint32_t)-1);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %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 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl %eax, -0x3c(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x28(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x3c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x3c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x40(%rbp), %eax
jae 0x10aec0
movq -0x30(%rbp), %rax
movl -0x44(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
jne 0x10ad16
jmp 0x10aeb2
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x28(%rbp), %rcx
movq 0x28(%rcx), %rcx
movq -0x30(%rbp), %rdx
movl -0x44(%rbp), %esi
imulq $0x30, %rsi, %rsi
addq %rsi, %rdx
movl 0x14(%rdx), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x30(%rbp), %rcx
movl -0x44(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movl 0x14(%rcx), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x4c(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jae 0x10ad9e
movq -0x38(%rbp), %rax
movl -0x48(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
cmpl -0x3c(%rbp), %eax
jne 0x10ad91
jmp 0x10ad9e
jmp 0x10ad93
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x10ad71
movl -0x48(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jae 0x10ada8
jmp 0x10adc7
leaq 0x27f00c(%rip), %rdi    # 0x389dbb
leaq 0x27bb07(%rip), %rsi    # 0x3868bd
movl $0x3ef4, %edx           # imm = 0x3EF4
leaq 0x27f000(%rip), %rcx    # 0x389dc2
callq 0x2130
movq -0x38(%rbp), %rax
movl -0x48(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
je 0x10ae32
movq -0x30(%rbp), %rax
movl -0x44(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq -0x30(%rbp), %rcx
movl -0x44(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x14(%rcx), %eax
jae 0x10ae2d
movq -0x38(%rbp), %rax
movl -0x48(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x18(%rax) # imm = 0xFFFFFFFF
movq -0x30(%rbp), %rax
movl -0x44(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x18(%rax) # imm = 0xFFFFFFFF
jmp 0x10aeb2
movq -0x38(%rbp), %rax
movl -0x48(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0x38(%rbp), %rcx
movl -0x48(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
subl (%rcx), %eax
cmpl $0x2dc6c0, %eax         # imm = 0x2DC6C0
jb 0x10ae86
movq -0x38(%rbp), %rax
movl -0x48(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x18(%rax)
movq -0x30(%rbp), %rax
movl -0x44(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x18(%rax)
jmp 0x10aeb0
movq -0x38(%rbp), %rax
movl -0x48(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x18(%rax) # imm = 0xFFFFFFFF
movq -0x30(%rbp), %rax
movl -0x44(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x18(%rax) # imm = 0xFFFFFFFF
jmp 0x10aeb2
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x10aced
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)