// File: /workspace/github_cpp_makefile_star2_O2/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 %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
movq 0x48(%rdi), %rbx
xorl %r14d, %r14d
testq %rbx, %rbx
cmovleq %r14, %rbx
xorl %r15d, %r15d
cmpq %r15, %rbx
je 0x38231
movq 0x58(%rbp), %rcx
testq %r15, %r15
je 0x38171
movl (%rcx,%r14), %eax
cmpl -0x1c(%rcx,%r14), %eax
jle 0x38243
movl 0x8(%rcx,%r14), %edx
cmpl -0x14(%rcx,%r14), %edx
jg 0x38173
jmp 0x38243
movl (%rcx), %eax
movl 0x4(%rcx,%r14), %edx
cmpl %eax, %edx
jle 0x38281
movl 0x8(%rcx,%r14), %edi
movl 0xc(%rcx,%r14), %esi
cmpl %edi, %esi
jle 0x38262
movswl 0x14(%rcx,%r14), %r8d
movl 0x1c(%rcx,%r14), %r9d
cmpl $0x7fff, %r8d           # imm = 0x7FFF
jne 0x381b9
testl %r9d, %r9d
jne 0x381be
xorl %r9d, %r9d
cmpw $0x0, 0x12(%rcx,%r14)
jns 0x381be
jmp 0x38225
testl %r9d, %r9d
je 0x38225
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 0x337ee
popq %rax
popq %rcx
incq %r15
addq $0x20, %r14
jmp 0x3813f
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1ad280(%rip), %rdi    # 0x1e54ca
leaq 0x1ab452(%rip), %rsi    # 0x1e36a3
leaq 0x1ad2e2(%rip), %rcx    # 0x1e553a
movl $0x4346, %edx           # imm = 0x4346
callq 0x2110
leaq 0x1ad366(%rip), %rdi    # 0x1e55cf
leaq 0x1ab433(%rip), %rsi    # 0x1e36a3
leaq 0x1ad2c3(%rip), %rcx    # 0x1e553a
movl $0x4356, %edx           # imm = 0x4356
callq 0x2110
leaq 0x1ad319(%rip), %rdi    # 0x1e55a1
leaq 0x1ab414(%rip), %rsi    # 0x1e36a3
leaq 0x1ad2a4(%rip), %rcx    # 0x1e553a
movl $0x4351, %edx           # imm = 0x4351
callq 0x2110