// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: verify_sub_window(All_reads*, Correct_dumy*, UC_Read*, long long, long long, long long, long long, unsigned long, unsigned long, int, int, unsigned int*, int*, int*, int*)
inline int verify_sub_window(All_reads* R_INF, Correct_dumy* dumy, UC_Read* g_read, 
long long x_beg, long long xLen, long long y_beg, long long yLen, uint64_t y_id, 
uint64_t y_pos_strand, int threshold, int alignment_strand,
unsigned int* get_error, int* get_y_end, int* get_x_end, int* get_aligned_xLen)
{
    (*get_aligned_xLen) = 0;
    (*get_y_end) = -1;
    (*get_x_end) = -1;
    (*get_error) = (unsigned int)-1;

    int extra_begin, extra_end, r_x_end, r_y_end, aligned_xLen;
    long long o_len;
    unsigned int r_error;
    if(!determine_overlap_region(threshold, y_beg, y_id, yLen, 
    Get_READ_LENGTH((*R_INF), y_id), &extra_begin, &extra_end, &y_beg, &o_len))
    {
        return 0;
    }

    fill_subregion(dumy->overlap_region, y_beg, o_len, y_pos_strand, R_INF, 
    y_id, extra_begin, extra_end);

    char* x_string = g_read->seq + x_beg;
    char* y_string = dumy->overlap_region;

    aligned_xLen = 0;

    alignment_extension(y_string, yLen, x_string, xLen, threshold, 
                    alignment_strand, &r_error, &r_y_end, &r_x_end, &aligned_xLen);
    
    (*get_error) = r_error;
    (*get_y_end) = r_y_end;
    (*get_x_end) = r_x_end;
    (*get_aligned_xLen) = aligned_xLen;

    if(aligned_xLen == 0)
    {
        return 0;
    }
    else
    {
        return 1;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %rax
movq %r8, 0x10(%rsp)
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
movq 0xb0(%rsp), %rsi
movq 0xa8(%rsp), %rcx
leaq 0x20(%rsp), %rdx
movq %r9, (%rdx)
andl $0x0, (%rsi)
movq 0xa0(%rsp), %rsi
orl $-0x1, (%rsi)
movq 0x98(%rsp), %rsi
orl $-0x1, (%rcx)
movl 0x88(%rsp), %edi
orl $-0x1, (%rsi)
movq 0x78(%rsp), %rbp
movq 0x70(%rsp), %r13
movq 0x18(%rbx), %rcx
movq (%rcx,%rbp,8), %r8
subq $0x8, %rsp
leaq 0x20(%rsp), %r10
leaq 0x10(%rsp), %r11
leaq 0x14(%rsp), %r9
movq %rax, %rsi
movq %r13, %rcx
pushq %r10
pushq %rdx
pushq %r11
callq 0x1b53a
addq $0x20, %rsp
testl %eax, %eax
je 0x6487b
movq 0x80(%rsp), %rax
addq $0x50, %r15
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
movl 0xc(%rsp), %r10d
movl 0x8(%rsp), %r11d
movzbl %al, %ecx
movq %r15, %rdi
movq %rbx, %r8
movq %rbp, %r9
pushq %r11
pushq %r10
callq 0x1b475
popq %rax
popq %rcx
addq (%r12), %r14
leaq 0x2c(%rsp), %rbx
andl $0x0, (%rbx)
leaq 0x34(%rsp), %r12
leaq 0x30(%rsp), %rbp
leaq 0x28(%rsp), %r13
movl 0x88(%rsp), %eax
movzwl %ax, %r8d
movq %r15, %rdi
movq 0x70(%rsp), %rsi
movq %r14, %rdx
movq 0x10(%rsp), %rcx
movl 0x90(%rsp), %r9d
pushq %rbx
pushq %r12
pushq %rbp
pushq %r13
callq 0x64a0b
addq $0x20, %rsp
movl (%r13), %eax
movq 0x98(%rsp), %rcx
movl %eax, (%rcx)
movl (%rbp), %eax
movq 0xa0(%rsp), %rcx
movl %eax, (%rcx)
movl (%r12), %eax
movq 0xa8(%rsp), %rcx
movl %eax, (%rcx)
movl (%rbx), %ecx
movq 0xb0(%rsp), %rax
movl %ecx, (%rax)
xorl %eax, %eax
testl %ecx, %ecx
setne %al
jmp 0x6487d
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq