// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: debug_hap_overlaps(hap_overlaps_list*, hap_overlaps_list*)
void debug_hap_overlaps(hap_overlaps_list* all_ovlp, hap_overlaps_list* back_all_ovlp)
{
    hap_overlaps *x = NULL, *y = NULL;
    uint32_t v, i, uId, qn, tn;
    uint32_t types[4];
    types[X2Y] = Y2X; types[Y2X] = X2Y; types[XCY] = YCX; types[YCX] = XCY;
    int index;
    for (v = 0; v < all_ovlp->num; v++)
    {
        uId = v;
        for (i = 0; i < all_ovlp->x[uId].a.n; i++)
        {
            qn = all_ovlp->x[uId].a.a[i].xUid;
            tn = all_ovlp->x[uId].a.a[i].yUid;
            x = &(all_ovlp->x[uId].a.a[i]);
            index = get_specific_hap_overlap(&(all_ovlp->x[tn]), tn, qn);
            if(index == -1)
            {
                fprintf(stderr, "ERROR 0\n");
                continue;
            }

            y = &(all_ovlp->x[tn].a.a[index]);
            if(x->rev != y->rev || types[x->type] != y->type)
            {
                fprintf(stderr, "ERROR 1\n");
                continue;
            }

            if(x->status == REVE_EXIST && y->status != SELF_EXIST)
            {
                fprintf(stderr, "ERROR 2\n");
                continue;
            }

            if(x->status == REVE_EXIST)
            {
                if(x->weight != y->weight) fprintf(stderr, "ERROR 3\n"); 
                if(x->xUid != y->yUid) fprintf(stderr, "ERROR 4\n"); 
                if(x->yUid != y->xUid) fprintf(stderr, "ERROR 5\n"); 
                if(x->x_beg_pos != y->y_beg_pos) fprintf(stderr, "ERROR 6\n"); 
                if(x->x_end_pos != y->y_end_pos) fprintf(stderr, "ERROR 7\n"); 
                if(x->y_beg_pos != y->x_beg_pos) fprintf(stderr, "ERROR 8\n");
                if(x->y_end_pos != y->x_end_pos) fprintf(stderr, "ERROR 9\n");
                if(x->x_beg_id != y->y_beg_id) fprintf(stderr, "ERROR 10\n");
                if(x->x_end_id != y->y_end_id) fprintf(stderr, "ERROR 11\n");
                if(x->y_beg_id != y->x_beg_id) fprintf(stderr, "ERROR 12\n");
                if(x->y_beg_id != y->x_beg_id) fprintf(stderr, "ERROR 13\n");
                if(x->y_end_id != y->x_end_id) fprintf(stderr, "ERROR 14\n");

                index = get_specific_hap_overlap(&(back_all_ovlp->x[qn]), qn, tn);
                if(index != -1)
                {
                    if(back_all_ovlp->x[qn].a.a[index].weight > x->weight) fprintf(stderr, "ERROR 15\n");
                }
            }
           
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, 0x10(%rsp)
movaps 0x120699(%rip), %xmm0   # 0x22d480
movaps %xmm0, 0x20(%rsp)
cmpl $0x0, 0x8(%rdi)
je 0x10d09d
movq %rdi, %r12
xorl %ecx, %ecx
movq (%r12), %rax
movq %rcx, 0x8(%rsp)
leaq (%rcx,%rcx,2), %rdx
cmpq $0x0, (%rax,%rdx,8)
je 0x10d087
xorl %ecx, %ecx
xorl %r13d, %r13d
movq %rdx, 0x18(%rsp)
movq 0x10(%rax,%rdx,8), %rbp
shlq $0x6, %rcx
movl 0x24(%rbp,%rcx), %ebx
movl 0x28(%rbp,%rcx), %r15d
leaq (%r15,%r15,2), %rdx
movq (%rax,%rdx,8), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x10ce73
leaq (%rax,%rdx,8), %r8
movq 0x10(%r8), %r8
xorl %r10d, %r10d
xorl %r9d, %r9d
shlq $0x6, %r10
cmpl %r15d, 0x24(%r8,%r10)
jne 0x10ce63
addq %r8, %r10
cmpl %ebx, 0x28(%r10)
je 0x10ce70
incl %r9d
movq %r9, %r10
cmpq %r9, %rdi
ja 0x10ce4f
jmp 0x10ce73
movl %r9d, %esi
cmpl $-0x1, %esi
je 0x10cfb8
addq %rcx, %rbp
movq 0x10(%rax,%rdx,8), %r14
movslq %esi, %rax
shlq $0x6, %rax
movb (%rbp), %cl
cmpb (%r14,%rax), %cl
jne 0x10cfb1
addq %rax, %r14
movzbl 0x1(%rbp), %eax
movzbl 0x1(%r14), %ecx
cmpl %ecx, 0x20(%rsp,%rax,4)
jne 0x10cfb1
movb 0x2(%rbp), %al
cmpb $0x1, %al
jne 0x10cfe0
cmpb $0x0, 0x2(%r14)
jne 0x10cffe
cmpb $0x1, %al
jne 0x10cfe0
movl 0x2c(%rbp), %eax
cmpl 0x2c(%r14), %eax
jne 0x10d005
movl 0x24(%rbp), %eax
cmpl 0x28(%r14), %eax
jne 0x10d00f
movl 0x28(%rbp), %eax
cmpl 0x24(%r14), %eax
jne 0x10d019
movl 0x4(%rbp), %eax
cmpl 0xc(%r14), %eax
jne 0x10d023
movl 0x8(%rbp), %eax
cmpl 0x10(%r14), %eax
jne 0x10d02d
movl 0xc(%rbp), %eax
cmpl 0x4(%r14), %eax
jne 0x10d037
movl 0x10(%rbp), %eax
cmpl 0x8(%r14), %eax
jne 0x10d041
movl 0x14(%rbp), %eax
cmpl 0x1c(%r14), %eax
jne 0x10d04b
movl 0x18(%rbp), %eax
cmpl 0x20(%r14), %eax
jne 0x10d055
movl 0x1c(%rbp), %eax
cmpl 0x14(%r14), %eax
jne 0x10d05f
movl 0x1c(%rbp), %eax
cmpl 0x14(%r14), %eax
jne 0x10d069
movl 0x20(%rbp), %eax
cmpl 0x18(%r14), %eax
jne 0x10d073
movq 0x10(%rsp), %rax
movq (%rax), %rax
leaq (%rbx,%rbx,2), %rcx
movq (%rax,%rcx,8), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
testq %rsi, %rsi
je 0x10cfc2
leaq (%rax,%rcx,8), %rdi
movq 0x10(%rdi), %rdi
xorl %r9d, %r9d
xorl %r8d, %r8d
shlq $0x6, %r9
cmpl %ebx, 0x24(%rdi,%r9)
jne 0x10cfa4
addq %rdi, %r9
cmpl %r15d, 0x28(%r9)
je 0x10cfbf
incl %r8d
movq %r8, %r9
cmpq %r8, %rsi
ja 0x10cf90
jmp 0x10cfc2
callq 0x13a4b
jmp 0x10cfe0
callq 0x13bef
jmp 0x10cfe0
movl %r8d, %edx
cmpl $-0x1, %edx
je 0x10cfe0
movq 0x10(%rax,%rcx,8), %rax
movslq %edx, %rcx
shlq $0x6, %rcx
movl 0x2c(%rax,%rcx), %eax
cmpl 0x2c(%rbp), %eax
ja 0x10d07d
incl %r13d
movq (%r12), %rax
movq %r13, %rcx
movq 0x18(%rsp), %rdx
cmpq %r13, (%rax,%rdx,8)
ja 0x10ce1d
jmp 0x10d087
callq 0x13a67
jmp 0x10cfe0
callq 0x13a83
jmp 0x10ced9
callq 0x13a9f
jmp 0x10cee6
callq 0x13abb
jmp 0x10cef3
callq 0x13ad7
jmp 0x10cf00
callq 0x13af3
jmp 0x10cf0d
callq 0x13b0f
jmp 0x10cf1a
callq 0x13b2b
jmp 0x10cf27
callq 0x13b47
jmp 0x10cf34
callq 0x13b63
jmp 0x10cf41
callq 0x13b7f
jmp 0x10cf4e
callq 0x13b9b
jmp 0x10cf5b
callq 0x13bb7
jmp 0x10cf68
callq 0x13bd3
jmp 0x10cfe0
movq 0x8(%rsp), %rcx
incq %rcx
movl 0x8(%r12), %eax
cmpq %rax, %rcx
jb 0x10cdfb
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq