// File: 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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x1, -0x50(%rbp)
movl $0x0, -0x4c(%rbp)
movl $0x3, -0x48(%rbp)
movl $0x2, -0x44(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jae 0x17bfac
movl -0x24(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
movl -0x2c(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jae 0x17bf9c
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x28(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x24(%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x28(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x28(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl -0x28(%rbp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl -0x34(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl -0x34(%rbp), %esi
movl -0x30(%rbp), %edx
callq 0x17a150
movl %eax, -0x54(%rbp)
cmpl $-0x1, -0x54(%rbp)
jne 0x17bc8c
movq 0x24836a(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x20e7c2(%rip), %rsi    # 0x38a442
movb $0x0, %al
callq 0x22a0
jmp 0x17bf8e
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl -0x34(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movslq -0x54(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
movq -0x20(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x17bcda
movq -0x18(%rbp), %rax
movzbl 0x1(%rax), %eax
movl -0x50(%rbp,%rax,4), %eax
movq -0x20(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
cmpl %ecx, %eax
je 0x17bcf7
movq 0x2482ff(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x20b5e6(%rip), %rsi    # 0x3872d1
movb $0x0, %al
callq 0x22a0
jmp 0x17bf8e
movq -0x18(%rbp), %rax
movzbl 0x2(%rax), %eax
cmpl $0x1, %eax
jne 0x17bd2e
movq -0x20(%rbp), %rax
movzbl 0x2(%rax), %eax
cmpl $0x0, %eax
je 0x17bd2e
movq 0x2482c8(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x20e729(%rip), %rsi    # 0x38a44b
movb $0x0, %al
callq 0x22a0
jmp 0x17bf8e
movq -0x18(%rbp), %rax
movzbl 0x2(%rax), %eax
cmpl $0x1, %eax
jne 0x17bf8c
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x2c(%rcx), %eax
je 0x17bd67
movq 0x24828a(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x20e6f4(%rip), %rsi    # 0x38a454
movb $0x0, %al
callq 0x22a0
movq -0x18(%rbp), %rax
movl 0x24(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x28(%rcx), %eax
je 0x17bd8f
movq 0x248262(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x206468(%rip), %rsi    # 0x3821f0
movb $0x0, %al
callq 0x22a0
movq -0x18(%rbp), %rax
movl 0x28(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x24(%rcx), %eax
je 0x17bdb7
movq 0x24823a(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x20e6ad(%rip), %rsi    # 0x38a45d
movb $0x0, %al
callq 0x22a0
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0xc(%rcx), %eax
je 0x17bddf
movq 0x248212(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x20e68e(%rip), %rsi    # 0x38a466
movb $0x0, %al
callq 0x22a0
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x10(%rcx), %eax
je 0x17be07
movq 0x2481ea(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x20e66f(%rip), %rsi    # 0x38a46f
movb $0x0, %al
callq 0x22a0
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x4(%rcx), %eax
je 0x17be2f
movq 0x2481c2(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x20e650(%rip), %rsi    # 0x38a478
movb $0x0, %al
callq 0x22a0
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x8(%rcx), %eax
je 0x17be57
movq 0x24819a(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x20e631(%rip), %rsi    # 0x38a481
movb $0x0, %al
callq 0x22a0
movq -0x18(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
je 0x17be7f
movq 0x248172(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x20e612(%rip), %rsi    # 0x38a48a
movb $0x0, %al
callq 0x22a0
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x20(%rcx), %eax
je 0x17bea7
movq 0x24814a(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x20e5f4(%rip), %rsi    # 0x38a494
movb $0x0, %al
callq 0x22a0
movq -0x18(%rbp), %rax
movl 0x1c(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x14(%rcx), %eax
je 0x17becf
movq 0x248122(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x20e5d6(%rip), %rsi    # 0x38a49e
movb $0x0, %al
callq 0x22a0
movq -0x18(%rbp), %rax
movl 0x1c(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x14(%rcx), %eax
je 0x17bef7
movq 0x2480fa(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x20e5b8(%rip), %rsi    # 0x38a4a8
movb $0x0, %al
callq 0x22a0
movq -0x18(%rbp), %rax
movl 0x20(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x18(%rcx), %eax
je 0x17bf1f
movq 0x2480d2(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x20e59a(%rip), %rsi    # 0x38a4b2
movb $0x0, %al
callq 0x22a0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl -0x30(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl -0x30(%rbp), %esi
movl -0x34(%rbp), %edx
callq 0x17a150
movl %eax, -0x54(%rbp)
cmpl $-0x1, -0x54(%rbp)
je 0x17bf8a
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl -0x30(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movslq -0x54(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x2c(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x2c(%rcx), %eax
jbe 0x17bf88
movq 0x248069(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x20e53b(%rip), %rsi    # 0x38a4bc
movb $0x0, %al
callq 0x22a0
jmp 0x17bf8a
jmp 0x17bf8c
jmp 0x17bf8e
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x17bbc0
jmp 0x17bf9e
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x17bba3
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)