// File: /workspace/github_cpp_makefile_star2_O1/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 $0xe8, %rsp
movq %r9, 0x8(%rsp)
movq %r8, (%rsp)
movq 0x48(%rdi), %rbx
testq %rbx, %rbx
jle 0x69a00
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
xorl %r14d, %r14d
testq %r14, %r14
je 0x6991e
movq 0x58(%rbp), %rax
movl (%rax,%r14), %ecx
cmpl -0x1c(%rax,%r14), %ecx
jle 0x69a12
movl 0x8(%rax,%r14), %ecx
cmpl -0x14(%rax,%r14), %ecx
jle 0x69a12
movq 0x58(%rbp), %rax
movl (%rax,%r14), %ecx
cmpl %ecx, 0x4(%rax,%r14)
jle 0x69a50
movl 0xc(%rax,%r14), %edx
cmpl 0x8(%rax,%r14), %edx
jle 0x69a31
movzwl 0x14(%rax,%r14), %edx
cmpl $0x7fff, %edx           # imm = 0x7FFF
jne 0x6996f
cmpl $0x0, 0x1c(%rax,%r14)
jne 0x69964
cmpw $0x0, 0x12(%rax,%r14)
js 0x699f3
movzwl %dx, %edx
cmpl $0x7fff, %edx           # imm = 0x7FFF
je 0x69977
cmpl $0x0, 0x1c(%rax,%r14)
je 0x699f3
movl 0x18(%rax,%r14), %edx
addq %rdx, %rdx
addq 0x70(%rbp), %rdx
movq %rdx, 0xc8(%rsp)
movl 0x1c(%rax,%r14), %edx
movq %rdx, 0xc0(%rsp)
movq %rdx, 0xb8(%rsp)
movl %ecx, 0x2c(%rsp)
movl 0x4(%rax,%r14), %ecx
movl %ecx, 0x30(%rsp)
movl 0x8(%rax,%r14), %ecx
movl %ecx, 0x20(%rsp)
movl 0xc(%rax,%r14), %ecx
movl %ecx, 0x24(%rsp)
movswl 0x14(%rax,%r14), %eax
movl %eax, 0x3c(%rsp)
movl 0x10(%rbp), %r9d
movl 0x1c(%rbp), %eax
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq (%rsp), %rcx
movq 0x8(%rsp), %r8
leaq 0x10(%rsp), %r10
pushq %r10
pushq %rax
callq 0x6446a
addq $0x10, %rsp
addq $0x20, %r14
decq %rbx
jne 0x698f6
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1bda51(%rip), %rdi    # 0x22746a
leaq 0x1bbc23(%rip), %rsi    # 0x225643
leaq 0x1bdab3(%rip), %rcx    # 0x2274da
movl $0x4346, %edx           # imm = 0x4346
callq 0x2110
leaq 0x1bdb37(%rip), %rdi    # 0x22756f
leaq 0x1bbc04(%rip), %rsi    # 0x225643
leaq 0x1bda94(%rip), %rcx    # 0x2274da
movl $0x4356, %edx           # imm = 0x4356
callq 0x2110
leaq 0x1bdaea(%rip), %rdi    # 0x227541
leaq 0x1bbbe5(%rip), %rsi    # 0x225643
leaq 0x1bda75(%rip), %rcx    # 0x2274da
movl $0x4351, %edx           # imm = 0x4351
callq 0x2110