// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: debug_overlap_region(overlap_region*, char*, UC_Read*, ul_idx_t const*, hpc_t*, All_reads*)
void debug_overlap_region(overlap_region *au, char* qstr, UC_Read *tu, const ul_idx_t *uref, hpc_t *hpc_g, All_reads *rref)
{
    int64_t wn = au->w_list.n, k; bit_extz_t ez;
    for (k = 0; k < wn; k++) {
        assert((k<=0)||((au->w_list.a[k].x_start>au->w_list.a[k-1].x_end)
                                        &&(au->w_list.a[k].y_start>au->w_list.a[k-1].y_end)));
        // if(!((k<=0)||((au->w_list.a[k].x_start>au->w_list.a[k-1].x_end)
        //                                  &&(au->w_list.a[k].y_start>au->w_list.a[k-1].y_end)))) {
        //     if(k > 0) {
        //         fprintf(stderr, "\n[M::%s::(k-1)->%ld] x::[%u, %u], y::[%u, %u]\n", 
        //         __func__, k-1, au->w_list.a[k-1].x_start, au->w_list.a[k-1].x_end, au->w_list.a[k-1].y_start, au->w_list.a[k-1].y_end);
        //         fprintf(stderr, "[M::%s::(k**)->%ld] x::[%u, %u], y::[%u, %u]\n", 
        //         __func__, k, au->w_list.a[k].x_start, au->w_list.a[k].x_end, au->w_list.a[k].y_start, au->w_list.a[k].y_end);
        //     }
            
        // }
        assert(au->w_list.a[k].x_end>au->w_list.a[k].x_start);
        // if(!(au->w_list.a[k].y_end>au->w_list.a[k].y_start)) {
        //     fprintf(stderr, "[M::%s::(k**)->%ld] x::[%u, %u], y::[%u, %u]\n", 
        //         __func__, k, au->w_list.a[k].x_start, au->w_list.a[k].x_end, au->w_list.a[k].y_start, au->w_list.a[k].y_end);
        // }
        assert(au->w_list.a[k].y_end>au->w_list.a[k].y_start);
        if(is_ualn_win(au->w_list.a[k]) || is_est_aln(au->w_list.a[k])) continue;
        ez.cigar.a = au->w_list.c.a + au->w_list.a[k].cidx; 
        ez.cigar.n = ez.cigar.m = au->w_list.a[k].clen;
        ez.ts = au->w_list.a[k].x_start; ez.te = au->w_list.a[k].x_end;
        ez.ps = au->w_list.a[k].y_start; ez.pe = au->w_list.a[k].y_end;
        ez.err = au->w_list.a[k].error;
        ref_cigar_check(qstr, tu, uref, hpc_g, rref, au->y_id, au->y_pos_strand, &ez);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %r9, 0x18(%rsp)
movq %r8, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq 0x48(%rdi), %rbx
testq %rbx, %rbx
jle 0x696c3
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x58(%rbp), %rcx
testq %r15, %r15
je 0x695fd
movl (%rcx,%r14), %eax
cmpl -0x1c(%rcx,%r14), %eax
jle 0x696d5
movl 0x8(%rcx,%r14), %edx
cmpl -0x14(%rcx,%r14), %edx
jg 0x695ff
jmp 0x696d5
movl (%rcx), %eax
movl 0x4(%rcx,%r14), %edx
cmpl %eax, %edx
jle 0x69713
movl 0x8(%rcx,%r14), %edi
movl 0xc(%rcx,%r14), %esi
cmpl %edi, %esi
jle 0x696f4
movswl 0x14(%rcx,%r14), %r8d
movl 0x1c(%rcx,%r14), %r9d
cmpl $0x7fff, %r8d           # imm = 0x7FFF
jne 0x69645
testl %r9d, %r9d
jne 0x6964a
xorl %r9d, %r9d
cmpw $0x0, 0x12(%rcx,%r14)
jns 0x6964a
jmp 0x696b3
testl %r9d, %r9d
je 0x696b3
movl 0x18(%rcx,%r14), %ecx
addq %rcx, %rcx
addq 0x70(%rbp), %rcx
movq %rcx, 0xd8(%rsp)
movl %r9d, %ecx
movq %rcx, 0xd0(%rsp)
movq %rcx, 0xc8(%rsp)
movl %eax, 0x3c(%rsp)
movl %edx, 0x40(%rsp)
movl %edi, 0x30(%rsp)
movl %esi, 0x34(%rsp)
movl %r8d, 0x4c(%rsp)
movl 0x10(%rbp), %r9d
movl 0x1c(%rbp), %eax
movq %r13, %rdi
movq %r12, %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %r8
leaq 0x20(%rsp), %r10
pushq %r10
pushq %rax
callq 0x63f8a
addq $0x10, %rsp
incq %r15
addq $0x20, %r14
cmpq %r15, %rbx
jne 0x695d4
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1c9e9e(%rip), %rdi    # 0x23357a
leaq 0x1c8070(%rip), %rsi    # 0x231753
leaq 0x1c9f00(%rip), %rcx    # 0x2335ea
movl $0x4346, %edx           # imm = 0x4346
callq 0x2110
leaq 0x1c9f84(%rip), %rdi    # 0x23367f
leaq 0x1c8051(%rip), %rsi    # 0x231753
leaq 0x1c9ee1(%rip), %rcx    # 0x2335ea
movl $0x4356, %edx           # imm = 0x4356
callq 0x2110
leaq 0x1c9f37(%rip), %rdi    # 0x233651
leaq 0x1c8032(%rip), %rsi    # 0x231753
leaq 0x1c9ec2(%rip), %rcx    # 0x2335ea
movl $0x4351, %edx           # imm = 0x4351
callq 0x2110