// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: get_init_paras(All_reads*, ul_idx_t const*, overlap_region*, long, long, double, long, long*, long*, long*, long*)
uint32_t get_init_paras(All_reads* rref, const ul_idx_t *uref, overlap_region *z, int64_t x_s, int64_t x_e, double e_rate, int64_t block_s, 
                        int64_t *r_ys, int64_t *r_ex_beg, int64_t *r_ex_end, int64_t *r_err_thre)
{
    int e, ex_beg, ex_end; long long y_s, o_len, Window_Len;
    e = get_init_err_thres(x_e+1-x_s, e_rate, block_s, rref?THRESHOLD:THRESHOLD_MAX_SIZE);
    y_s = (x_s-z->x_pos_s) + z->y_pos_s; y_s += y_start_offset(x_s, &(z->f_cigar));
    Window_Len = (x_e+1-x_s) + (e<<1);

    if(!determine_overlap_region(e, y_s, z->y_id, Window_Len, (rref?(Get_READ_LENGTH((*rref), z->y_id)):(uref->ug->u.a[z->y_id].len)),
    &ex_beg, &ex_end, &y_s, &o_len)) {
        return 0;
    }
    (*r_ys) = y_s; (*r_ex_beg) = ex_beg; (*r_ex_end) = ex_end; (*r_err_thre) = e;
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %rbx
movq %rcx, %r13
movq %rdx, %r12
movq %rsi, 0x8(%rsp)
subq %rcx, %rbx
incq %rbx
xorl %r15d, %r15d
testq %rdi, %rdi
sete %al
cmpq %r9, %rbx
movq %rdi, 0x20(%rsp)
jge 0x495a3
cvtsi2sd %rbx, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
cmpq $0x1f, %rax
movl $0x1f, %ecx
cmovlq %rax, %rcx
testq %rax, %rax
movl $0x1, %r15d
cmovneq %rcx, %r15
cmpq $0x4, %rbx
cmovlq %rcx, %r15
jmp 0x495ae
movb %al, %r15b
shll $0x4, %r15d
orq $0xf, %r15
movl 0x4(%r12), %eax
movq %rax, 0x10(%rsp)
movl 0x14(%r12), %eax
movq %rax, 0x18(%rsp)
leaq 0x38(%r12), %rbp
movl 0x40(%r12), %esi
decl %esi
movq %rbp, %rdi
callq 0x3d110
cltq
movl 0x40(%r12), %r14d
cmpq %r13, %rax
movq %r15, (%rsp)
je 0x4962a
testl %r14d, %r14d
je 0x49708
xorl %r14d, %r14d
movq %rbp, %rdi
movl %r14d, %esi
callq 0x3d110
cltq
cmpq %r13, %rax
jg 0x49613
incq %r14
movl 0x40(%r12), %eax
cmpq %rax, %r14
jb 0x495f2
jmp 0x49621
testq %r14, %r14
je 0x49708
movl 0x40(%r12), %eax
cmpq %rax, %r14
je 0x49708
subq 0x10(%rsp), %r13
movq 0x18(%rsp), %r15
addq %r13, %r15
decl %r14d
movq %rbp, %rdi
movl %r14d, %esi
callq 0x3d11b
movslq %eax, %rcx
addq %r15, %rcx
movl 0x10(%r12), %eax
movq 0x20(%rsp), %rdx
testq %rdx, %rdx
je 0x49664
movq 0x18(%rdx), %rdx
movq (%rdx,%rax,8), %rdx
jmp 0x4967d
movq 0x8(%rsp), %rdx
movq (%rdx), %rdx
movq 0x10(%rdx), %rdx
leaq (%rax,%rax,4), %rax
movl (%rdx,%rax,8), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq (%rsp), %r8
xorl %eax, %eax
testq %rcx, %rcx
js 0x496f9
cmpq %rcx, %rdx
jle 0x496f9
leal (%r8,%r8), %esi
movslq %esi, %rsi
addq %rsi, %rbx
subq %rcx, %rsi
addq %rdx, %rsi
addq $0x1f, %rsi
cmpq %rbx, %rsi
jl 0x496f9
movq 0x78(%rsp), %rax
movq 0x70(%rsp), %rsi
movq 0x68(%rsp), %rdi
movslq %r8d, %r8
subq %r8, %rcx
subq %rcx, %rdx
cmpq %rbx, %rdx
cmovgeq %rbx, %rdx
subl %edx, %ebx
xorl %edx, %edx
testq %rcx, %rcx
cmovgq %rcx, %rdx
movq 0x60(%rsp), %r9
movl %ecx, %r10d
negl %r10d
movslq %r10d, %r10
movq %rdx, (%r9)
sarq $0x3f, %rcx
andq %r10, %rcx
movq %rcx, (%rdi)
movslq %ebx, %rcx
movq %rcx, (%rsi)
movq %r8, (%rax)
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x576c