// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: worker_for_ctg_trans_cc(void*, long, int)
static void worker_for_ctg_trans_cc(void *data, long i, int tid) // callback for kt_for()
{
    kv_u_trans_t *ta = (kv_u_trans_t*)data;
    u_trans_t *a = NULL, *r_a = NULL, *mz, *cz;
    uint32_t n, r_n, id = i, k, l, z;

    a = u_trans_a(*ta, id); n = u_trans_n(*ta, id);
    for (k = 1, l = 0; k <= n; k++) {
        if(k == n || a[l].tn != a[k].tn) {
            if(k > l) {
                get_u_trans_spec(ta, a[l].tn, a[l].qn, &r_a, &r_n);
                assert(r_n > 0);
                if(id > a[l].tn) {
                    l = k; continue;
                }

                mz = cz = NULL; 
                for (z = l; z < k; z++) {
                    cz = &(a[z]); cz->del = 1;
                    if((mz) && (mz->f == 1) && (cz->f != 1)) continue;
                    if((!mz) || ((cz->f == 1) && (mz->f != 1)) || ((cz->f == mz->f) && ((mz->nw < cz->nw) || ((mz->nw == cz->nw) && ((mz->qe - mz->qs) < (cz->qe - cz->qs)))))) {
                        mz = cz; 
                    }
                }
                for (z = 0; z < r_n; z++) {
                    cz = &(r_a[z]); cz->del = 1;
                    if((mz) && (mz->f == 1) && (cz->f != 1)) continue;
                    if((!mz) || ((cz->f == 1) && (mz->f != 1)) || ((cz->f == mz->f) && ((mz->nw < cz->nw) || ((mz->nw == cz->nw) && ((mz->qe - mz->qs) < (cz->qe - cz->qs)))))) {
                        mz = cz; 
                    }
                }

                assert(mz);
                mz->del = 0;
            }
            l = k;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x10(%rsp), %rax
andq $0x0, (%rax)
movq 0x28(%rdi), %rax
movq %rsi, 0x18(%rsp)
movl %esi, %ecx
movq (%rax,%rcx,8), %r12
movq %r12, %rax
shrq $0x20, %rax
imulq $0x30, %rax, %rbp
movq %rdi, 0x20(%rsp)
addq 0x10(%rdi), %rbp
xorl %eax, %eax
pushq $0x1
popq %rsi
cmpl %r12d, %esi
ja 0x9e548
movl %eax, %ebx
movl %esi, %r14d
je 0x9e3b9
imulq $0x30, %rbx, %rcx
movl 0x14(%rbp,%rcx), %ecx
imulq $0x30, %r14, %rdx
cmpl 0x14(%rbp,%rdx), %ecx
je 0x9e541
cmpl %eax, %esi
movl %esi, %eax
jbe 0x9e541
movl %esi, 0x8(%rsp)
imulq $0x30, %rbx, %r13
movl 0x8(%rbp,%r13), %edx
movq %rbp, %r15
movl 0x14(%rbp,%r13), %ebp
movq 0x20(%rsp), %rdi
movl %ebp, %esi
leaq 0x10(%rsp), %rcx
leaq 0xc(%rsp), %r8
callq 0x8feef
movl 0xc(%rsp), %ecx
testl %ecx, %ecx
je 0x9e557
movl 0x8(%rsp), %esi
movl %esi, %eax
cmpl 0x18(%rsp), %ebp
movq %r15, %rbp
jb 0x9e541
addq %rbp, %r13
xorl %eax, %eax
cmpq %r14, %rbx
jae 0x9e494
movb 0x28(%r13), %dl
movl %edx, %esi
orb $-0x80, %sil
movb %sil, 0x28(%r13)
testq %rax, %rax
je 0x9e453
movb 0x28(%rax), %sil
movl %esi, %edi
andb $0x3f, %dil
movl %edx, %r8d
andb $0x3f, %r8b
cmpb $0x1, %dil
jne 0x9e447
cmpb $0x1, %r8b
jne 0x9e456
cmpb $0x1, %r8b
jne 0x9e45f
cmpb $0x1, %dil
je 0x9e45f
movq %r13, %rax
incq %rbx
addq $0x30, %r13
jmp 0x9e412
xorb %dl, %sil
testb $0x3f, %sil
jne 0x9e456
movsd 0x20(%rax), %xmm0
movsd 0x20(%r13), %xmm1
ucomisd %xmm0, %xmm1
ja 0x9e453
ucomisd %xmm1, %xmm0
jne 0x9e456
jp 0x9e456
movl 0x4(%rax), %edx
subl (%rax), %edx
movl 0x4(%r13), %esi
subl (%r13), %esi
cmpl %esi, %edx
jb 0x9e453
jmp 0x9e456
xorl %edx, %edx
xorl %esi, %esi
movl %ecx, %ecx
cmpq %rcx, %rsi
jae 0x9e532
movq 0x10(%rsp), %rcx
movb 0x28(%rcx,%rdx), %dil
movl %edi, %r8d
orb $-0x80, %r8b
movb %r8b, 0x28(%rcx,%rdx)
testq %rax, %rax
je 0x9e4e8
movb 0x28(%rax), %r8b
movl %r8d, %r9d
andb $0x3f, %r9b
movl %edi, %r10d
andb $0x3f, %r10b
cmpb $0x1, %r9b
jne 0x9e4dc
cmpb $0x1, %r10b
jne 0x9e4ee
cmpb $0x1, %r10b
jne 0x9e4fb
cmpb $0x1, %r9b
je 0x9e4fb
addq %rdx, %rcx
movq %rcx, %rax
incq %rsi
movl 0xc(%rsp), %ecx
addq $0x30, %rdx
jmp 0x9e498
xorb %dil, %r8b
testb $0x3f, %r8b
jne 0x9e4ee
movsd 0x20(%rax), %xmm0
movsd 0x20(%rcx,%rdx), %xmm1
ucomisd %xmm0, %xmm1
ja 0x9e4e8
ucomisd %xmm1, %xmm0
jne 0x9e4ee
jp 0x9e4ee
movl 0x4(%rax), %edi
subl (%rax), %edi
movl 0x4(%rcx,%rdx), %r8d
subl (%rcx,%rdx), %r8d
cmpl %r8d, %edi
jb 0x9e4e8
jmp 0x9e4ee
testq %rax, %rax
je 0x9e576
andb $0x7f, 0x28(%rax)
movl 0x8(%rsp), %esi
movl %esi, %eax
incl %esi
jmp 0x9e393
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x14cbb8(%rip), %rdi    # 0x1eb116
leaq 0x14982c(%rip), %rsi    # 0x1e7d91
leaq 0x14cbb2(%rip), %rcx    # 0x1eb11e
movl $0x550a, %edx           # imm = 0x550A
callq 0x2110
leaq 0x14cbd1(%rip), %rdi    # 0x1eb14e
leaq 0x14980d(%rip), %rsi    # 0x1e7d91
leaq 0x14cb93(%rip), %rcx    # 0x1eb11e
movl $0x551f, %edx           # imm = 0x551F
callq 0x2110