// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: debug_u_trans_t(kv_u_trans_t*)
void debug_u_trans_t(kv_u_trans_t *ta)
{
    u_trans_t *a = NULL, *r_a = NULL;
    uint32_t i, k, m, j, st, n, r_n, ovlp;
    for (i = 0; i < ta->n; ++i)
    {
        if(ta->a[i].nw <= 0) fprintf(stderr, "ERROR-1\n");
        if(ta->a[i].qe <= ta->a[i].qs) fprintf(stderr, "ERROR-2\n");
        if(ta->a[i].te <= ta->a[i].ts) fprintf(stderr, "ERROR-3\n");
    }
    for (k = 0; k < ta->idx.n; k++)
    {
        a = u_trans_a(*ta, k);
        n = u_trans_n(*ta, k);
        for (st = 0, i = 1; i <= n; ++i)
        {
            if (i == n || a[i].tn != a[st].tn)
            {
                get_u_trans_spec(ta, a[st].tn, a[st].qn, &r_a, &r_n);

                if(i - st != r_n) 
                {
                    fprintf(stderr, "ERROR-4, i - st: %u, r_n: %u\n", i - st, r_n);
                }
                
                for (m = st; m < i; m++)
                {
                    if(a[m].rev != a[st].rev) fprintf(stderr, "ERROR-5\n");
                    for (j = st; j < i; j++)
                    {
                        if(j == m) continue;

                        ovlp = ((MIN(a[m].qe, a[j].qe) > MAX(a[m].qs, a[j].qs))?
                                        MIN(a[m].qe, a[j].qe) - MAX(a[m].qs, a[j].qs):0);
                        if(ovlp > 0) fprintf(stderr, "ERROR-6\n");

                        ovlp = ((MIN(a[m].te, a[j].te) > MAX(a[m].ts, a[j].ts))?
                                        MIN(a[m].te, a[j].te) - MAX(a[m].ts, a[j].ts):0);
                        if(ovlp > 0) fprintf(stderr, "ERROR-7\n");
                    }

                    for (j = 0; j < r_n; j++)
                    {
                        if(r_a[j].rev != a[m].rev) fprintf(stderr, "ERROR-8\n");
                        if(r_a[j].tn == a[m].qn && r_a[j].qn == a[m].tn && 
                           r_a[j].ts == a[m].qs && r_a[j].te == a[m].qe && 
                           r_a[j].qs == a[m].ts && r_a[j].qe == a[m].te &&
                           r_a[j].nw == a[m].nw)
                        {
                            break;
                        }
                    }
                    if(j >= r_n) fprintf(stderr, "ERROR-9\n");
                    
                }
                st = i;
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq $0x0, 0x18(%rsp)
cmpq $0x0, (%rdi)
je 0xcb856
movl $0x1, %ebx
xorl %eax, %eax
xorpd %xmm0, %xmm0
movq %rdi, %r15
movq 0x10(%rdi), %rcx
leaq (%rax,%rax,2), %r14
shlq $0x4, %r14
ucomisd 0x20(%rcx,%r14), %xmm0
jae 0xcb82c
movq 0x10(%rdi), %rax
movl 0x4(%rax,%r14), %ecx
cmpl (%rax,%r14), %ecx
jbe 0xcb83a
movq 0x10(%rdi), %rax
movl 0x10(%rax,%r14), %ecx
cmpl 0xc(%rax,%r14), %ecx
jbe 0xcb848
movl %ebx, %eax
incl %ebx
cmpq %rax, (%rdi)
ja 0xcb7ed
jmp 0xcb856
callq 0x10d05
xorpd %xmm0, %xmm0
movq %r15, %rdi
jmp 0xcb802
callq 0x10d21
xorpd %xmm0, %xmm0
movq %r15, %rdi
jmp 0xcb811
callq 0x10d3d
xorpd %xmm0, %xmm0
movq %r15, %rdi
jmp 0xcb821
cmpq $0x0, 0x18(%rdi)
je 0xcbafe
leaq 0x8(%rsp), %r13
xorl %eax, %eax
xorl %ecx, %ecx
movq %rdi, 0x38(%rsp)
movq %rcx, 0x30(%rsp)
movq 0x28(%rdi), %rcx
movq (%rcx,%rax,8), %rbp
testl %ebp, %ebp
je 0xcbaea
movq 0x10(%rdi), %rax
movq %rbp, %rcx
shrq $0x20, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
leaq (%rax,%rcx), %rdx
movq %rdx, 0x10(%rsp)
addq %rcx, %rax
addq $0x10, %rax
movq %rax, 0x40(%rsp)
movl $0x1, %ebx
xorl %r12d, %r12d
movq %rbp, 0x48(%rsp)
movl %ebx, %esi
movl %r12d, %r15d
movl %ebx, 0xc(%rsp)
cmpl %ebp, %ebx
je 0xcb8ee
leaq (%rsi,%rsi,2), %rax
shlq $0x4, %rax
movq 0x10(%rsp), %rdx
movl 0x14(%rdx,%rax), %eax
leaq (%r15,%r15,2), %rcx
shlq $0x4, %rcx
cmpl 0x14(%rdx,%rcx), %eax
jne 0xcb8ee
movl 0xc(%rsp), %ebx
jmp 0xcbac1
movq %rsi, 0x28(%rsp)
leaq (%r15,%r15,2), %rcx
shlq $0x4, %rcx
movq 0x10(%rsp), %rax
movl 0x8(%rax,%rcx), %edx
movq %rcx, 0x20(%rsp)
movl 0x14(%rax,%rcx), %esi
movq %rdi, %r14
leaq 0x18(%rsp), %rcx
movq %r13, %r8
callq 0xca79c
movl 0xc(%rsp), %ebx
movl %ebx, %edx
subl %r12d, %edx
movl 0x8(%rsp), %ecx
cmpl %ecx, %edx
jne 0xcbacd
cmpl %r12d, %ebx
movl %ebx, %r12d
movq %r14, %rdi
jbe 0xcbac1
movq 0x10(%rsp), %r12
addq %r12, 0x20(%rsp)
leaq (%r15,%r15,2), %rax
shlq $0x4, %rax
addq 0x40(%rsp), %rax
movq %rax, 0x50(%rsp)
movq %r15, %r14
subq 0x28(%rsp), %r14
xorl %ebp, %ebp
leaq (%r15,%r15,2), %rbx
shlq $0x4, %rbx
movq 0x20(%rsp), %rax
movb 0x28(%rax), %al
xorb 0x28(%r12,%rbx), %al
testb $0x40, %al
jne 0xcba9a
addq %r12, %rbx
movq 0x50(%rsp), %r12
xorl %r13d, %r13d
cmpq %r13, %rbp
je 0xcb9ce
movl (%rbx), %eax
movl 0x4(%rbx), %ecx
movl -0x10(%r12), %edx
movl -0xc(%r12), %esi
cmpl %esi, %ecx
cmovbl %ecx, %esi
cmpl %edx, %eax
cmoval %eax, %edx
cmpl %edx, %esi
ja 0xcb9dc
movl 0xc(%rbx), %eax
movl 0x10(%rbx), %ecx
movl -0x4(%r12), %edx
movl (%r12), %esi
cmpl %esi, %ecx
cmovbl %ecx, %esi
cmpl %edx, %eax
cmoval %eax, %edx
cmpl %edx, %esi
ja 0xcb9e3
decq %r13
addq $0x30, %r12
cmpq %r13, %r14
jne 0xcb98f
jmp 0xcb9ea
callq 0x10d7b
jmp 0xcb9b1
callq 0x10d9d
jmp 0xcb9ce
cmpl $0x0, 0x8(%rsp)
je 0xcba75
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x18(%rsp), %rax
movb 0x28(%rbx), %cl
xorb 0x28(%rax,%r12), %cl
testb $0x40, %cl
jne 0xcba6e
movq 0x18(%rsp), %rax
movl 0x14(%rax,%r12), %ecx
cmpl 0x8(%rbx), %ecx
jne 0xcba5c
movl 0x8(%rax,%r12), %ecx
cmpl 0x14(%rbx), %ecx
jne 0xcba5c
movl 0xc(%rax,%r12), %ecx
cmpl (%rbx), %ecx
jne 0xcba5c
movl 0x10(%rax,%r12), %ecx
cmpl 0x4(%rbx), %ecx
jne 0xcba5c
movl (%rax,%r12), %ecx
cmpl 0xc(%rbx), %ecx
jne 0xcba5c
movl 0x4(%rax,%r12), %ecx
cmpl 0x10(%rbx), %ecx
jne 0xcba5c
movsd 0x20(%rax,%r12), %xmm0
ucomisd 0x20(%rbx), %xmm0
jne 0xcba5c
jnp 0xcba78
incq %r13
movl 0x8(%rsp), %eax
addq $0x30, %r12
cmpq %rax, %r13
jb 0xcb9fb
jmp 0xcba78
callq 0x10dbf
jmp 0xcba0d
xorl %r13d, %r13d
cmpl 0x8(%rsp), %r13d
movq 0x10(%rsp), %r12
movq 0x28(%rsp), %rbx
jae 0xcbaa4
incq %r15
decq %rbp
cmpq %rbx, %r15
jne 0xcb967
jmp 0xcbaab
callq 0x10d59
jmp 0xcb984
callq 0x10de1
jmp 0xcba89
movl 0xc(%rsp), %ebx
movl %ebx, %r12d
movq 0x38(%rsp), %rdi
leaq 0x8(%rsp), %r13
movq 0x48(%rsp), %rbp
incl %ebx
cmpl %ebp, %ebx
jbe 0xcb8b9
jmp 0xcbaea
movq 0x1be50c(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
leaq 0x15f3ae(%rip), %rsi    # 0x22ae8c
xorl %eax, %eax
callq 0x22b0
jmp 0xcb932
movq 0x30(%rsp), %rcx
incl %ecx
movq %rcx, %rax
cmpq %rcx, 0x18(%rdi)
ja 0xcb86f
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq