// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Correct.cpp
// Function: non_trim_error_rate(overlap_region*, All_reads*, ul_idx_t const*, kvec_t_u64_warp const*, Correct_dumy*, UC_Read*, double, long)
inline double non_trim_error_rate(overlap_region *z, All_reads* rref, const ul_idx_t *uref, const kvec_t_u64_warp* v_idx, Correct_dumy* dumy, UC_Read* g_read, double e_rate, int64_t block_s)
{
    int64_t nw, aw = z->w_list.n, k, m, w_id, wn_id, w_s, w_e, idx_e, tErr = 0, tLen = 0, y_s, ex_beg, ex_end, err_thre, p_err_thre;
    int64_t x_len, Window_Len, y_beg_left, y_beg_right;
    unsigned int r_error_left, r_error_right; int32_t r_x_end_left, r_y_end_left, aligned_xLen_left, r_x_end_right, r_y_end_right, aligned_xLen_right;
    nw = get_num_wins(z->x_pos_s, z->x_pos_e+1, block_s);
    assert(nw >= aw && aw > 0);

    for (k = aw-1, idx_e = nw; k >= 0; k--) {
        w_id = get_win_id_by_e(z, z->w_list.a[k].x_end, block_s, &w_s);
        assert(w_s == z->w_list.a[k].x_start && w_id < idx_e && k <= w_id);
        tLen += z->w_list.a[k].x_end + 1 - z->w_list.a[k].x_start;
        tErr += z->w_list.a[k].error;///matched window
        // if(z->y_id == 1) {
        //     fprintf(stderr, "+[M::%s] ws->%d, we->%d, tot_l->%ld, tot_e->%ld\n", 
        //                         __func__, z->w_list.a[k].x_start, z->w_list.a[k].x_end, tLen, tErr);
        // }
        // if(k != w_id) z->w_list.a[w_id] = z->w_list.a[k];
        ///from mapped window w_list.a[k] to the following unmapped windows
        for (m = w_id+1, w_e = z->w_list.a[k].x_end; m < idx_e; m++) {
            w_s = w_e + 1;
            wn_id = get_win_id_by_s(z, w_s, block_s, &w_e);
            assert(wn_id == m); x_len = w_e + 1 - w_s; tLen += x_len;
            ///check if there are some windows that cannot be algined by any overlaps/unitigs
            ///if no, it is likely that the UL read itself has issues
            if(uref && v_idx && z->is_match == 4) {
                if(check_coverage_gap(v_idx->a.a, w_s, w_e, block_s)) {
                    tErr += THRESHOLD_MAX_SIZE;
                    // if(z->y_id == 1) {
                    //     fprintf(stderr, "-[M::%s] ws->%ld, we->%ld, tot_l->%ld, tot_e->%ld\n", __func__, w_s, w_e, tLen, tErr);
                    // }
                    continue;
                } 
            }
            if(!get_init_paras(rref, uref, z, w_s, w_e, e_rate, block_s, &y_s, &ex_beg, &ex_end, &err_thre)) {
                tErr += x_len;
                // if(z->y_id == 1) {
                //     fprintf(stderr, "-[M::%s] ws->%ld, we->%ld, tot_l->%ld, tot_e->%ld\n", __func__, w_s, w_e, tLen, tErr);
                // }
                continue;
            }
            p_err_thre = err_thre;

            if(rref) {
                err_thre = double_error_threshold(err_thre, x_len);
            } else {
                err_thre = double_ul_error_threshold(err_thre, x_len);
            }
            Window_Len = x_len + (err_thre << 1); 
            r_error_left = r_error_right = 0;
            aligned_xLen_left = aligned_xLen_right = 0;
            y_beg_left = y_beg_right = -1;

            if(m == w_id+1) { ///if the previous window is mapped
                y_beg_left = z->w_list.a[k].y_end + 1;///incorrect
            }

            if(m+1 == idx_e && k+1 < aw) { ///if the next window is mapped
                y_beg_right = z->w_list.a[k+1].y_start-x_len;///incorrect
            }

            if(y_beg_left == -1 && y_beg_right == -1) {
                y_beg_left = y_s;
                if(ex_beg >= 0) y_beg_left = y_beg_left + p_err_thre - ex_beg;
                y_beg_right = y_beg_left;
            }

            if(y_beg_left == -1 && y_beg_right != -1) y_beg_left = y_beg_right;
            if(y_beg_right == -1 && y_beg_left != -1) y_beg_right = y_beg_left;

            if(y_beg_left != -1) {///note: this function will change tstr/qstr
                if(rref) {
                    verify_sub_window(rref, dumy, g_read, w_s, x_len, y_beg_left, Window_Len, 
                    z->y_id, z->y_pos_strand, err_thre, 0, &r_error_left, &r_y_end_left, &r_x_end_left, &aligned_xLen_left);
                } else {
                    verify_ul_sub_window(uref, dumy, g_read, w_s, x_len, y_beg_left, Window_Len, 
                    z->y_id, z->y_pos_strand, err_thre, 0, &r_error_left, &r_y_end_left, &r_x_end_left, &aligned_xLen_left);
                }
            }

            if(y_beg_right != -1) {
                if(rref) {
                    verify_sub_window(rref, dumy, g_read, w_s, x_len, y_beg_right, Window_Len, z->y_id, z->y_pos_strand,
                    err_thre, 1, &r_error_right, &r_y_end_right, &r_x_end_right, &aligned_xLen_right);
                } else {
                    verify_ul_sub_window(uref, dumy, g_read, w_s, x_len, y_beg_right, Window_Len, z->y_id, z->y_pos_strand,
                    err_thre, 1, &r_error_right, &r_y_end_right, &r_x_end_right, &aligned_xLen_right);
                }
            }

            ///aligned in both directions
            if(aligned_xLen_left != 0 && aligned_xLen_right != 0) {
                if(aligned_xLen_left + aligned_xLen_right <= x_len) {
                    tErr += r_error_left + r_error_right + (x_len - aligned_xLen_left - aligned_xLen_right);
                } else {
                    float E_rate = (float)(x_len)/(float)(aligned_xLen_left + aligned_xLen_right);
                    tErr += (r_error_left + r_error_right)*E_rate;
                }
            }///not aligned in both directions
            else if(aligned_xLen_left == 0 && aligned_xLen_right == 0) {
                tErr += x_len;
            }///only aligned in left
            else if(aligned_xLen_left != 0) {
                tErr += r_error_left + (x_len - aligned_xLen_left);
            }///only aligned in right
            else if(aligned_xLen_right != 0) {
                tErr += r_error_right + (x_len - aligned_xLen_right);
            }
            // if(z->y_id == 1) {
            //     fprintf(stderr, "*[M::%s] qs->%ld, ts->%ld, tb[0]->%ld, tb[1]->%ld, di[0]->%u, di[1]->%u, al[0]->%d, al[1]->%d, err_thre->%ld\n", __func__, 
            //     w_s, y_s, y_beg_left, y_beg_right, r_error_left, r_error_right, aligned_xLen_left, aligned_xLen_right, err_thre);
            // }
            // if(z->y_id == 1) {
            //     fprintf(stderr, "-[M::%s] ws->%ld, we->%ld, tot_l->%ld, tot_e->%ld\n", __func__, w_s, w_e, tLen, tErr);
            // }
        }
        idx_e = w_id;
    }

    if(idx_e > 0) {
        for (m = 0, w_e = (int64_t)z->x_pos_s-1; m < idx_e; m++) {
            w_s = w_e + 1;
            wn_id = get_win_id_by_s(z, w_s, block_s, &w_e);
            assert(wn_id == m); x_len = w_e + 1 - w_s; tLen += x_len;
            ///check if there are some windows that cannot be algined by any overlaps/unitigs
            ///if no, it is likely that the UL read itself has issues
            if(uref && v_idx && z->is_match == 4) {
                if(check_coverage_gap(v_idx->a.a, w_s, w_e, block_s)) {
                    tErr += THRESHOLD_MAX_SIZE;
                    // if(z->y_id == 1) {
                    //     fprintf(stderr, "-[M::%s] ws->%ld, we->%ld, tot_l->%ld, tot_e->%ld\n", __func__, w_s, w_e, tLen, tErr);
                    // }
                    continue;
                } 
                // else {
                //     if(z->y_id == 575) {
                //         fprintf(stderr, "---[M::%s::] z::y_id->%u, w_s->%ld, w_e->%ld\n", __func__, z->y_id, w_s, w_e);
                //     } 
                // }
            }
            if(!get_init_paras(rref, uref, z, w_s, w_e, e_rate, block_s, &y_s, &ex_beg, &ex_end, &err_thre)) {
                tErr += x_len;
                // if(z->y_id == 1) {
                //     fprintf(stderr, "-[M::%s] ws->%ld, we->%ld, tot_l->%ld, tot_e->%ld\n", __func__, w_s, w_e, tLen, tErr);
                // }
                continue;
            }
            p_err_thre = err_thre;
            if(rref) {
                err_thre = double_error_threshold(err_thre, x_len);
            } else {
                err_thre = double_ul_error_threshold(err_thre, x_len);
            }
            Window_Len = x_len + (err_thre << 1); 
            r_error_left = r_error_right = 0;
            aligned_xLen_left = aligned_xLen_right = 0;
            y_beg_left = y_beg_right = -1;

            ///impossible that the previous window is mapped
            // if(m == w_id+1) { ///if the previous window is mapped
            //     y_beg_left = z->w_list.a[k].y_end + 1;
            // }

            if(m+1 == idx_e && k+1 < aw) { ///if the next window is mapped
                y_beg_right = z->w_list.a[k+1].y_start-x_len;
            }

            if(y_beg_left == -1 && y_beg_right == -1) {
                y_beg_left = y_s;
                if(ex_beg >= 0) y_beg_left = y_beg_left + p_err_thre - ex_beg;
                y_beg_right = y_beg_left;
            }

            if(y_beg_left == -1 && y_beg_right != -1) y_beg_left = y_beg_right;
            if(y_beg_right == -1 && y_beg_left != -1) y_beg_right = y_beg_left;

            if(y_beg_left != -1) {
                if(rref) {
                    verify_sub_window(rref, dumy, g_read, w_s, x_len, y_beg_left, Window_Len, 
                    z->y_id, z->y_pos_strand, err_thre, 0, &r_error_left, &r_y_end_left, &r_x_end_left, &aligned_xLen_left);
                } else {
                    verify_ul_sub_window(uref, dumy, g_read, w_s, x_len, y_beg_left, Window_Len, 
                    z->y_id, z->y_pos_strand, err_thre, 0, &r_error_left, &r_y_end_left, &r_x_end_left, &aligned_xLen_left);
                }
            }

            if(y_beg_right != -1) {
                if(rref) {
                    verify_sub_window(rref, dumy, g_read, w_s, x_len, y_beg_right, Window_Len, z->y_id, z->y_pos_strand,
                    err_thre, 1, &r_error_right, &r_y_end_right, &r_x_end_right, &aligned_xLen_right);
                } else {
                    verify_ul_sub_window(uref, dumy, g_read, w_s, x_len, y_beg_right, Window_Len, z->y_id, z->y_pos_strand,
                    err_thre, 1, &r_error_right, &r_y_end_right, &r_x_end_right, &aligned_xLen_right);
                }
            }

            ///aligned in both directions
            if(aligned_xLen_left != 0 && aligned_xLen_right != 0) {
                if(aligned_xLen_left + aligned_xLen_right <= x_len) {
                    tErr += r_error_left + r_error_right + (x_len - aligned_xLen_left - aligned_xLen_right);
                } else {
                    float E_rate = (float)(x_len)/(float)(aligned_xLen_left + aligned_xLen_right);
                    tErr += (r_error_left + r_error_right)*E_rate;
                }
            }///not aligned in both directions
            else if(aligned_xLen_left == 0 && aligned_xLen_right == 0) {
                tErr += x_len;
            }///only aligned in left
            else if(aligned_xLen_left != 0) {
                tErr += r_error_left + (x_len - aligned_xLen_left);
            }///only aligned in right
            else if(aligned_xLen_right != 0) {
                tErr += r_error_right + (x_len - aligned_xLen_right);
            }
            // if(z->y_id == 1) {
            //     fprintf(stderr, "-[M::%s] ws->%ld, we->%ld, tot_l->%ld, tot_e->%ld\n", __func__, w_s, w_e, tLen, tErr);
            // }
        }
    }
    
    assert(tLen == z->x_pos_e + 1 - z->x_pos_s);
    return (double)(tErr)/(double)(tLen);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movsd %xmm0, 0xf0(%rsp)
movq %r9, 0x90(%rsp)
movq %rcx, 0xb8(%rsp)
movq %rdx, 0x98(%rsp)
movq %rsi, %r14
movq 0x140(%rsp), %r12
movq 0x48(%rdi), %r9
movl 0x4(%rdi), %ecx
movq %rdi, 0x20(%rsp)
movl 0x8(%rdi), %esi
incl %esi
movq %rcx, %rax
xorl %edx, %edx
idivq %r12
subq %rcx, %rdx
addq %rdx, %rsi
movq %rsi, %rax
cqto
idivq %r12
movq %rax, %r10
xorl %eax, %eax
testq %rdx, %rdx
setg %cl
testq %r9, %r9
jle 0x9acaf
movb %cl, %al
addq %rax, %r10
cmpq %r9, %r10
jl 0x9acaf
cmpq $0x0, 0x98(%rsp)
setne %al
cmpq $0x0, 0xb8(%rsp)
setne %cl
andb %al, %cl
movb %cl, 0x58(%rsp)
leaq 0x50(%r8), %rax
movq %rax, 0x38(%rsp)
addq $0x4f, %r8
movq %r8, 0x88(%rsp)
movq %r9, 0xf8(%rsp)
movq %r9, 0xe8(%rsp)
xorl %ebx, %ebx
xorl %r9d, %r9d
movq %r14, 0x40(%rsp)
movq 0xe8(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq -0x1(%rax), %r11
movq 0x20(%rsp), %rdx
movq 0x58(%rdx), %rdi
movq %r11, %rax
shlq $0x5, %rax
movq %rax, 0xc8(%rsp)
movslq 0x4(%rdi,%rax), %rcx
movl 0x4(%rdx), %esi
movq %rsi, %rax
xorl %edx, %edx
idivq %r12
movq %rsi, %r8
subq %rdx, %r8
subq %r8, %rcx
movq %rcx, %rax
cqto
idivq %r12
movq %rax, %rcx
imulq %r12, %rcx
addq %r8, %rcx
cmpq %rsi, %rcx
cmovleq %rsi, %rcx
cmpq %r10, %rax
jge 0x9ac71
movq 0xc8(%rsp), %rdx
movl (%rdi,%rdx), %esi
movslq %esi, %rdx
cmpq %rdx, %rcx
jne 0x9ac71
cmpq %rax, %r11
jg 0x9ac71
movq %r11, 0xe8(%rsp)
addq 0xc8(%rsp), %rdi
movq %rax, %rdx
movslq 0x4(%rdi), %r13
movl %r13d, %ecx
subl %esi, %ecx
incl %ecx
movslq %ecx, %rax
addq %rax, %rbx
movswq 0x14(%rdi), %rax
addq %rax, %r9
movq %rdx, 0x78(%rsp)
leaq 0x1(%rdx), %rax
cmpq %r10, %rax
jge 0x9a09f
movq %rax, 0xd0(%rsp)
movq %rax, %r11
movq %r10, 0x60(%rsp)
movq %r9, 0x80(%rsp)
movq %r13, %rsi
leaq 0x1(%r13), %rbp
movq 0x20(%rsp), %rax
movl 0x8(%rax), %r13d
movl 0x4(%rax), %ecx
movq %rcx, %rax
xorl %edx, %edx
idivq %r12
subq %rdx, %rcx
movq %rbp, %rax
subq %rcx, %rax
cqto
idivq %r12
leaq 0x1(%rax), %rdx
imulq %r12, %rdx
addq %rdx, %rcx
decq %rcx
cmpq %r13, %rcx
cmovlq %rcx, %r13
cmpq %r11, %rax
jne 0x9ac52
movq %r13, %rax
movq %rsi, 0xa0(%rsp)
subq %rsi, %rax
movq %rax, 0x18(%rsp)
cmpb $0x0, 0x58(%rsp)
je 0x9967e
movq 0x20(%rsp), %rax
cmpb $0x4, 0x2c(%rax)
jne 0x9967e
movq 0xb8(%rsp), %rax
movq 0x10(%rax), %rcx
movq %rbp, %rax
xorl %edx, %edx
divq %r12
movq (%rcx,%rax,8), %rdx
movq %rdx, %rax
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
andq %rsi, %rax
je 0x9967e
shrq $0x20, %rdx
leaq (%rcx,%rdx,8), %rcx
xorl %edx, %edx
movq (%rcx,%rdx,8), %rsi
movq %rsi, %rdi
shrq $0x20, %rdi
cmpq %rbp, %rdi
jne 0x99676
movl %esi, %esi
cmpq %r13, %rsi
je 0x998fa
incq %rdx
cmpq %rdx, %rax
jne 0x9965b
movq %r11, 0x48(%rsp)
movq %r14, %rdi
movq 0x98(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq %rbp, %rcx
movq %r13, %r8
movsd 0xf0(%rsp), %xmm0
movq %r12, %r9
leaq 0xb0(%rsp), %rax
pushq %rax
leaq 0x108(%rsp), %rax
pushq %rax
leaq 0xe8(%rsp), %rax
pushq %rax
leaq 0xf8(%rsp), %rax
pushq %rax
callq 0x49ed1
addq $0x20, %rsp
testl %eax, %eax
je 0x9972d
movq 0xb0(%rsp), %rax
testl %eax, %eax
sete %dl
movq 0x18(%rsp), %rdi
cmpl $0x4, %edi
setge %cl
andb %dl, %cl
testq %r14, %r14
movq 0x60(%rsp), %r10
movq 0x48(%rsp), %r11
movq %rbx, 0xa8(%rsp)
je 0x9974c
leal (%rax,%rax), %edx
testb %cl, %cl
movl $0x2, %ecx
cmovnel %ecx, %edx
cmpl $0x20, %edx
movl $0x1f, %r12d
cmovgel %edx, %r12d
cmpl $0x12c, %edi            # imm = 0x12C
cmovll %edx, %r12d
jmp 0x99774
movq 0x80(%rsp), %r9
movq 0x18(%rsp), %rdi
addq %rdi, %r9
movq 0x60(%rsp), %r10
movq 0x48(%rsp), %r11
jmp 0x9a07a
testb %cl, %cl
movl %eax, %r12d
movl $0x1, %ecx
cmovnel %ecx, %r12d
xorps %xmm0, %xmm0
cvtsi2sd %edi, %xmm0
mulsd 0x18bd17(%rip), %xmm0   # 0x225480
cvttsd2si %xmm0, %ecx
cmpl %ecx, %r12d
cmovlel %ecx, %r12d
cmpl $0x1f, %r12d
movl $0x1f, %ecx
cmovgel %ecx, %r12d
movslq %r12d, %r9
movq %r9, 0xb0(%rsp)
movq $-0x1, %rcx
movq $-0x1, %rbx
cmpq 0xd0(%rsp), %r11
jne 0x997bd
movq 0x20(%rsp), %rdx
movq 0x58(%rdx), %rdx
movq 0xc8(%rsp), %rsi
movslq 0xc(%rdx,%rsi), %rbx
incq %rbx
movq 0x70(%rsp), %rdx
cmpq 0xf8(%rsp), %rdx
jge 0x997ef
leaq 0x1(%r11), %rdx
cmpq %r10, %rdx
jne 0x997ef
movq 0x20(%rsp), %rcx
movq 0x58(%rcx), %rcx
movq 0x70(%rsp), %rdx
shlq $0x5, %rdx
movslq 0x8(%rcx,%rdx), %rcx
subq %rdi, %rcx
cmpq $-0x1, %rbx
jne 0x9981e
cmpq $-0x1, %rcx
jne 0x9981e
movq 0xe0(%rsp), %rcx
movq 0xd8(%rsp), %rdx
addq %rcx, %rax
subq %rdx, %rax
testq %rdx, %rdx
cmovsq %rcx, %rax
movq %rax, %rbx
movq %rax, %rcx
cmpq $-0x1, %rcx
movq %rbx, %r8
cmovneq %rcx, %r8
cmpq $-0x1, %rbx
cmovneq %rbx, %r8
cmpq $-0x1, %r8
cmoveq %rcx, %rbx
movq %r9, 0x68(%rsp)
leaq (%rdi,%r9,2), %r9
cmpq $-0x1, %rcx
cmovneq %rcx, %rbx
movl $0x0, %eax
movl $0x0, %esi
cmpq $-0x1, %r8
movq %r9, 0x28(%rsp)
je 0x99ab9
testq %r14, %r14
je 0x998a9
movq 0x20(%rsp), %rax
movl 0x10(%rax), %r9d
movb $0x1, %al
testq %r8, %r8
js 0x998a0
movq 0x18(%r14), %rcx
movq (%rcx,%r9,8), %r14
cmpq %r8, %r14
jle 0x998a0
leal (%r12,%r12), %ecx
movslq %ecx, %rcx
subq %r8, %rcx
addq %r14, %rcx
addq $0x1f, %rcx
movq 0x28(%rsp), %rdx
cmpq %rdx, %rcx
jge 0x99910
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x99953
movq 0x20(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x98(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
leaq (%rcx,%rcx,4), %rcx
movl (%rax,%rcx,8), %r14d
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
movb $0x1, %dl
cmpq %r14, %r8
jae 0x998f0
leal (%r12,%r12), %esi
movslq %esi, %rsi
subq %r8, %rsi
addq %r14, %rsi
addq $0x1f, %rsi
cmpq %r9, %rsi
jge 0x99991
xorl %r9d, %r9d
xorl %esi, %esi
jmp 0x999db
movq 0x80(%rsp), %r9
addq $0x1f, %r9
movq 0x18(%rsp), %rdi
jmp 0x9a07a
subq 0x68(%rsp), %r8
subq %r8, %r14
cmpq %rdx, %r14
cmovgeq %rdx, %r14
movl %edx, %ecx
subl %r14d, %ecx
movl %r8d, %edx
negl %edx
xorl %eax, %eax
testq %r8, %r8
movl $0x0, %esi
cmovgq %r8, %rsi
movslq %edx, %rdx
sarq $0x3f, %r8
movq %r8, %r15
andq %rdx, %r15
andl %r8d, %edx
subq %rdx, %r14
movq %r15, %rdx
movslq %ecx, %rcx
movq %rsi, %r8
testb %al, %al
jne 0x999df
movq 0x20(%rsp), %rax
movl 0x1c(%rax), %eax
movq 0x38(%rsp), %rsi
leaq (%rsi,%rdx), %r15
movq %rcx, 0x30(%rsp)
movzbl %al, %ecx
movq %r15, %rdi
movq %r8, %rsi
movq %rdx, 0x50(%rsp)
movq %r14, %rdx
movq 0x40(%rsp), %r8
callq 0x337f7
jmp 0x99a25
subq 0x68(%rsp), %r8
subq %r8, %r14
cmpq %r9, %r14
cmovgeq %r9, %r14
movl %r9d, %esi
subl %r14d, %esi
movl %r8d, %edi
negl %edi
xorl %edx, %edx
testq %r8, %r8
movl $0x0, %r9d
cmovgq %r8, %r9
movslq %edi, %rdi
sarq $0x3f, %r8
movq %r8, %r15
andq %rdi, %r15
andl %r8d, %edi
subq %rdi, %r14
movq 0x18(%rsp), %rdi
movslq %esi, %rsi
movq %r9, %r8
movq %r15, %r9
testb %dl, %dl
je 0x999eb
xorl %esi, %esi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x99aaf
movq %rsi, 0x30(%rsp)
movq 0x20(%rsp), %rdx
movl 0x1c(%rdx), %esi
leaq (%rax,%rcx,8), %rdx
movq 0x38(%rsp), %rax
leaq (%rax,%r9), %r15
subq $0x8, %rsp
movzbl %sil, %ecx
xorl %edi, %edi
movq %r15, %rsi
movq %r9, 0x58(%rsp)
movq %r14, %r9
pushq $0x0
callq 0x36b0d
addq $0x10, %rsp
movq 0x38(%rsp), %rdi
movl $0x4e, %esi
movq 0x50(%rsp), %rdx
callq 0x20e0
addq %r14, %r15
movq %r15, %rdi
movl $0x4e, %esi
movq 0x30(%rsp), %rdx
callq 0x20e0
movq 0x90(%rsp), %rax
movq (%rax), %rdx
addq %rbp, %rdx
movzwl %r12w, %r8d
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x18(%rsp), %rcx
leaq 0x14(%rsp), %r9
leaq 0x10(%rsp), %rax
pushq %rax
leaq 0x14(%rsp), %rax
pushq %rax
callq 0x9aced
movq 0x28(%rsp), %rdi
movq 0x58(%rsp), %r11
movq 0x70(%rsp), %r10
addq $0x10, %rsp
movl 0x10(%rsp), %esi
incl %esi
cmpl $-0x1, 0xc(%rsp)
movl $0x0, %eax
cmovel %eax, %esi
movl 0x14(%rsp), %eax
movq 0x40(%rsp), %r14
movq 0x28(%rsp), %r9
movl %eax, 0x30(%rsp)
movl $0x0, %eax
cmpq $-0x1, %rbx
movl $0x0, %r8d
je 0x99fcf
testq %r14, %r14
je 0x99b17
movq 0x20(%rsp), %rax
movl 0x10(%rax), %r9d
movb $0x1, %al
testq %rbx, %rbx
js 0x99b0e
movq 0x18(%r14), %rcx
movq (%rcx,%r9,8), %r14
cmpq %rbx, %r14
jle 0x99b0e
addl %r12d, %r12d
movslq %r12d, %rcx
subq %rbx, %rcx
addq %r14, %rcx
addq $0x1f, %rcx
movq 0x28(%rsp), %rdx
cmpq %rdx, %rcx
jge 0x99b78
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x99bbf
movq 0x20(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x98(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
leaq (%rcx,%rcx,4), %rcx
movl (%rax,%rcx,8), %r14d
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
movb $0x1, %dl
cmpq %r14, %rbx
movq %rsi, 0x50(%rsp)
jae 0x99b6d
addl %r12d, %r12d
movslq %r12d, %rsi
subq %rbx, %rsi
addq %r14, %rsi
addq $0x1f, %rsi
cmpq %r9, %rsi
jge 0x99d80
xorl %r15d, %r15d
xorl %r9d, %r9d
jmp 0x99dc5
xorl %r15d, %r15d
xorl %r9d, %r9d
jmp 0x99dca
subq 0x68(%rsp), %rbx
subq %rbx, %r14
cmpq %rdx, %r14
cmovgeq %rdx, %r14
movl %edx, %ecx
subl %r14d, %ecx
movl %ebx, %edx
negl %edx
xorl %eax, %eax
testq %rbx, %rbx
movq %rsi, %r8
movl $0x0, %esi
cmovgq %rbx, %rsi
movslq %edx, %rdx
sarq $0x3f, %rbx
movq %rbx, %r12
andq %rdx, %r12
andl %ebx, %edx
subq %rdx, %r14
movq %r12, %rdx
movslq %ecx, %rcx
movq %rsi, %rbx
movq %r8, %rsi
testb %al, %al
jne 0x99dce
movq %rsi, 0x50(%rsp)
movq 0x20(%rsp), %rax
movl 0x1c(%rax), %eax
movq 0x38(%rsp), %r12
leaq (%r12,%rdx), %r15
movq %rcx, 0xc0(%rsp)
movzbl %al, %ecx
movq %r15, %rdi
movq %rbx, %rsi
movq %rdx, %rbx
movq %r14, %rdx
movq 0x40(%rsp), %r8
callq 0x337f7
movq %r12, %rdi
movl $0x4e, %esi
movq %rbx, %rdx
callq 0x20e0
addq %r14, %r15
movq %r15, %rdi
movl $0x4e, %esi
movq 0xc0(%rsp), %rdx
callq 0x20e0
movq 0x90(%rsp), %rax
movq (%rax), %rbx
movq 0x28(%rsp), %rsi
cmpl $0x2, %esi
jl 0x99c6f
movl %esi, %eax
shrl %eax
movl %esi, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
addq 0x88(%rsp), %rcx
xorl %edx, %edx
movb (%r12,%rdx), %r8b
movb (%rcx), %dil
movb %dil, (%r12,%rdx)
movb %r8b, (%rcx)
incq %rdx
decq %rcx
cmpq %rdx, %rax
jne 0x99c56
addq %rbx, %rbp
cmpl $0x2, 0x18(%rsp)
movq 0x68(%rsp), %r9
jl 0x99cba
movq 0x18(%rsp), %rcx
movl %ecx, %eax
shrl %eax
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
addq 0xa0(%rsp), %rcx
addq %rbx, %rcx
xorl %edx, %edx
movb (%rbp,%rdx), %r8b
movb (%rcx), %dil
movb %dil, (%rbp,%rdx)
movb %r8b, (%rcx)
incq %rdx
decq %rcx
cmpq %rdx, %rax
jne 0x99c9f
movzwl %r9w, %r8d
movq %r12, %rdi
movq %rbp, %rdx
movq 0x18(%rsp), %rcx
leaq 0x14(%rsp), %r9
leaq 0x10(%rsp), %rax
pushq %rax
leaq 0x14(%rsp), %rax
pushq %rax
callq 0x9aced
movq 0x38(%rsp), %r8
addq $0x10, %rsp
cmpl $0x2, %r8d
movq 0x40(%rsp), %r14
jl 0x99d29
movl %r8d, %eax
shrl %eax
movl %r8d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
addq 0x88(%rsp), %rcx
xorl %edx, %edx
movb (%r12,%rdx), %sil
movb (%rcx), %dil
movb %dil, (%r12,%rdx)
movb %sil, (%rcx)
incq %rdx
decq %rcx
cmpq %rdx, %rax
jne 0x99d10
movq 0x18(%rsp), %rdi
cmpl $0x2, %edi
movq 0x60(%rsp), %r10
movq 0x48(%rsp), %r11
jl 0x99f96
movl %edi, %eax
shrl %eax
movl %edi, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movq 0xa0(%rsp), %rdx
addq %rcx, %rdx
addq %rdx, %rbx
xorl %ecx, %ecx
movb (%rbp,%rcx), %dl
movb (%rbx), %sil
movb %sil, (%rbp,%rcx)
movb %dl, (%rbx)
incq %rcx
decq %rbx
cmpq %rcx, %rax
jne 0x99d62
jmp 0x99f96
subq 0x68(%rsp), %rbx
subq %rbx, %r14
cmpq %r9, %r14
cmovgeq %r9, %r14
movl %r9d, %esi
subl %r14d, %esi
movl %ebx, %edi
negl %edi
xorl %edx, %edx
testq %rbx, %rbx
movl $0x0, %r8d
cmovgq %rbx, %r8
movslq %edi, %rdi
sarq $0x3f, %rbx
movq %rbx, %r15
andq %rdi, %r15
andl %ebx, %edi
subq %rdi, %r14
movq 0x18(%rsp), %rdi
movslq %esi, %r9
movq %r8, %rbx
movq 0x50(%rsp), %rsi
testb %dl, %dl
je 0x99de0
xorl %eax, %eax
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movq 0x40(%rsp), %r14
jmp 0x99fcf
movq 0x20(%rsp), %rdx
movl 0x1c(%rdx), %esi
leaq (%rax,%rcx,8), %rdx
movq 0x38(%rsp), %r12
movq %r15, 0xc0(%rsp)
addq %r12, %r15
subq $0x8, %rsp
movzbl %sil, %ecx
xorl %edi, %edi
movq %r15, %rsi
movq %rbx, %r8
movq %r9, %rbx
movq %r14, %r9
pushq $0x0
callq 0x36b0d
addq $0x10, %rsp
movq %r12, %rdi
movl $0x4e, %esi
movq 0xc0(%rsp), %rdx
callq 0x20e0
addq %r14, %r15
movq %r15, %rdi
movl $0x4e, %esi
movq %rbx, %rdx
callq 0x20e0
movq 0x28(%rsp), %rsi
movq 0x90(%rsp), %rax
movq (%rax), %rbx
cmpl $0x2, %esi
jl 0x99e8e
movl %esi, %eax
shrl %eax
movl %esi, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
addq 0x88(%rsp), %rcx
xorl %edx, %edx
movb (%r12,%rdx), %r8b
movb (%rcx), %dil
movb %dil, (%r12,%rdx)
movb %r8b, (%rcx)
incq %rdx
decq %rcx
cmpq %rdx, %rax
jne 0x99e75
addq %rbx, %rbp
cmpl $0x2, 0x18(%rsp)
movq 0x68(%rsp), %r9
jl 0x99ed9
movq 0x18(%rsp), %rcx
movl %ecx, %eax
shrl %eax
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
addq 0xa0(%rsp), %rcx
addq %rbx, %rcx
xorl %edx, %edx
movb (%rbp,%rdx), %r8b
movb (%rcx), %dil
movb %dil, (%rbp,%rdx)
movb %r8b, (%rcx)
incq %rdx
decq %rcx
cmpq %rdx, %rax
jne 0x99ebe
movzwl %r9w, %r8d
movq %r12, %rdi
movq %rbp, %rdx
movq 0x18(%rsp), %rcx
leaq 0x14(%rsp), %r9
leaq 0x10(%rsp), %rax
pushq %rax
leaq 0x14(%rsp), %rax
pushq %rax
callq 0x9aced
movq 0x38(%rsp), %r8
addq $0x10, %rsp
cmpl $0x2, %r8d
movq 0x40(%rsp), %r14
jl 0x99f48
movl %r8d, %eax
shrl %eax
movl %r8d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
addq 0x88(%rsp), %rcx
xorl %edx, %edx
movb (%r12,%rdx), %sil
movb (%rcx), %dil
movb %dil, (%r12,%rdx)
movb %sil, (%rcx)
incq %rdx
decq %rcx
cmpq %rdx, %rax
jne 0x99f2f
movq 0x18(%rsp), %rdi
cmpl $0x2, %edi
movq 0x60(%rsp), %r10
movq 0x48(%rsp), %r11
jl 0x99f96
movl %edi, %eax
shrl %eax
movl %edi, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movq 0xa0(%rsp), %rdx
addq %rcx, %rdx
addq %rdx, %rbx
xorl %ecx, %ecx
movb (%rbp,%rcx), %dl
movb (%rbx), %sil
movb %sil, (%rbp,%rcx)
movb %dl, (%rbx)
incq %rcx
decq %rbx
cmpq %rcx, %rax
jne 0x99f7d
movl 0xc(%rsp), %edx
xorl %eax, %eax
cmpl $-0x1, %edx
je 0x99fc5
movl 0x10(%rsp), %ecx
cmpl $-0x1, %ecx
movq 0x50(%rsp), %rsi
je 0x99fca
subl %edx, %r8d
movl %r8d, 0xc(%rsp)
movl %edi, %eax
subl %ecx, %eax
incl %ecx
movl %eax, 0x10(%rsp)
movl %ecx, %eax
jmp 0x99fca
movq 0x50(%rsp), %rsi
movl 0x14(%rsp), %r8d
testl %esi, %esi
je 0x9a02b
testl %eax, %eax
je 0x9a02b
leal (%rax,%rsi), %ecx
movslq %ecx, %rdx
cmpq %rdx, %rdi
movq 0x140(%rsp), %r12
movq 0xa8(%rsp), %rbx
movq 0x80(%rsp), %r9
jge 0x9a064
xorps %xmm0, %xmm0
cvtsi2ss %rdi, %xmm0
cvtsi2ss %ecx, %xmm1
addl 0x30(%rsp), %r8d
cvtsi2ss %r8, %xmm2
divss %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %r9, %xmm1
mulss %xmm0, %xmm2
addss %xmm2, %xmm1
cvttss2si %xmm1, %r9
jmp 0x9a07a
movl %esi, %ecx
orl %eax, %ecx
movq 0x140(%rsp), %r12
movq 0xa8(%rsp), %rbx
movq 0x80(%rsp), %r9
jne 0x9a04e
addq %rdi, %r9
jmp 0x9a07a
testl %esi, %esi
je 0x9a08b
movl 0x30(%rsp), %eax
movslq %esi, %rcx
addq %rdi, %r9
addq %rax, %r9
subq %rcx, %r9
jmp 0x9a07a
addl 0x30(%rsp), %r8d
movslq %esi, %rcx
cltq
addq %rcx, %rax
addq %rdi, %r9
subq %rax, %r9
addq %r8, %r9
addq %rdi, %rbx
incq %r11
cmpq %r10, %r11
jne 0x995b8
jmp 0x9a09f
testl %eax, %eax
je 0x9a07a
movl %r8d, %ecx
cltq
addq %rdi, %r9
addq %rcx, %r9
subq %rax, %r9
jmp 0x9a07a
movq 0x78(%rsp), %r13
movq %r13, %r10
cmpq $0x2, 0x70(%rsp)
jge 0x994e6
testq %r13, %r13
jle 0x9ac16
movq 0x20(%rsp), %rax
movl 0x4(%rax), %r14d
decq %r14
cmpq $0x0, 0x98(%rsp)
setne %al
cmpq $0x0, 0xb8(%rsp)
setne %cl
andb %al, %cl
movb %cl, 0xa0(%rsp)
xorl %r10d, %r10d
movq %r9, 0x80(%rsp)
movq %r14, %r8
leaq 0x1(%r14), %rbp
movq 0x20(%rsp), %rax
movl 0x8(%rax), %r14d
movl 0x4(%rax), %ecx
movq %rcx, %rax
xorl %edx, %edx
idivq %r12
subq %rdx, %rcx
movq %rbp, %rax
subq %rcx, %rax
cqto
idivq %r12
leaq 0x1(%rax), %rdx
imulq %r12, %rdx
addq %rdx, %rcx
decq %rcx
cmpq %r14, %rcx
cmovlq %rcx, %r14
cmpq %r10, %rax
jne 0x9ac90
movq %r14, %r11
subq %r8, %r11
cmpb $0x0, 0xa0(%rsp)
je 0x9a1a8
movq 0x20(%rsp), %rax
cmpb $0x4, 0x2c(%rax)
jne 0x9a1a8
movq 0xb8(%rsp), %rax
movq 0x10(%rax), %rcx
movq %rbp, %rax
xorl %edx, %edx
divq %r12
movq (%rcx,%rax,8), %rdx
movq %rdx, %rax
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
andq %rsi, %rax
je 0x9a1a8
shrq $0x20, %rdx
leaq (%rcx,%rdx,8), %rcx
xorl %edx, %edx
movq (%rcx,%rdx,8), %rsi
movq %rsi, %rdi
shrq $0x20, %rdi
cmpq %rbp, %rdi
jne 0x9a1a0
movl %esi, %esi
cmpq %r14, %rsi
je 0x9a3f6
incq %rdx
cmpq %rdx, %rax
jne 0x9a185
movq %r8, 0x60(%rsp)
movq %r11, 0x18(%rsp)
movq %r10, 0x48(%rsp)
movq %rbx, 0xa8(%rsp)
movq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq 0x98(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq %rbp, %rcx
movq %r14, %r8
movsd 0xf0(%rsp), %xmm0
movq %r12, %r9
leaq 0xb0(%rsp), %rax
pushq %rax
leaq 0x108(%rsp), %rax
pushq %rax
leaq 0xe8(%rsp), %rax
pushq %rax
leaq 0xf8(%rsp), %rax
pushq %rax
callq 0x49ed1
addq $0x20, %rsp
testl %eax, %eax
je 0x9a263
movq 0xb0(%rsp), %rax
testl %eax, %eax
sete %dl
movq 0x18(%rsp), %r11
cmpl $0x4, %r11d
setge %cl
andb %dl, %cl
testq %rbx, %rbx
movq 0x48(%rsp), %r10
je 0x9a285
leal (%rax,%rax), %edx
testb %cl, %cl
movl $0x2, %ecx
cmovnel %ecx, %edx
cmpl $0x20, %edx
movl $0x1f, %r12d
cmovgel %edx, %r12d
cmpl $0x12c, %r11d           # imm = 0x12C
cmovll %edx, %r12d
jmp 0x9a2ae
movq 0x80(%rsp), %r9
movq 0x18(%rsp), %r11
addq %r11, %r9
movq 0xa8(%rsp), %rbx
movq 0x48(%rsp), %r10
jmp 0x9abf1
testb %cl, %cl
movl %eax, %r12d
movl $0x1, %ecx
cmovnel %ecx, %r12d
xorps %xmm0, %xmm0
cvtsi2sd %r11d, %xmm0
mulsd 0x18b1dd(%rip), %xmm0   # 0x225480
cvttsd2si %xmm0, %ecx
cmpl %ecx, %r12d
cmovlel %ecx, %r12d
cmpl $0x1f, %r12d
movl $0x1f, %ecx
cmovgel %ecx, %r12d
movslq %r12d, %rsi
movq %rsi, 0xb0(%rsp)
leaq 0x1(%r10), %rdx
movq $-0x1, %rbx
movq $-0x1, %rcx
cmpq %r13, %rdx
jne 0x9a2ed
movq 0x20(%rsp), %rcx
movq 0x58(%rcx), %rcx
movslq 0x8(%rcx), %rcx
subq %r11, %rcx
cmpq $-0x1, %rcx
jne 0x9a316
movq 0xe0(%rsp), %rcx
movq 0xd8(%rsp), %rdx
addq %rcx, %rax
subq %rdx, %rax
testq %rdx, %rdx
cmovsq %rcx, %rax
movq %rax, %rbx
movq %rax, %rcx
cmpq $-0x1, %rcx
movq %rbx, %r8
cmovneq %rcx, %r8
cmpq $-0x1, %rbx
cmovneq %rbx, %r8
cmpq $-0x1, %r8
cmoveq %rcx, %rbx
movq %rsi, 0x70(%rsp)
leaq (%r11,%rsi,2), %rdi
cmpq $-0x1, %rcx
cmovneq %rcx, %rbx
movl $0x0, %eax
movl $0x0, %esi
cmpq $-0x1, %r8
movq %rdi, 0x28(%rsp)
je 0x9a644
cmpq $0x0, 0x40(%rsp)
je 0x9a3a5
movq 0x20(%rsp), %rax
movl 0x10(%rax), %r9d
movb $0x1, %sil
testq %r8, %r8
js 0x9a39c
movq 0x40(%rsp), %rcx
movq 0x18(%rcx), %rcx
movq (%rcx,%r9,8), %r13
cmpq %r8, %r13
jle 0x9a39c
leal (%r12,%r12), %ecx
movslq %ecx, %rcx
subq %r8, %rcx
addq %r13, %rcx
addq $0x1f, %rcx
cmpq %rdi, %rcx
jge 0x9a407
xorl %edx, %edx
xorl %eax, %eax
jmp 0x9a455
movq 0x20(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x98(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
leaq (%rcx,%rcx,4), %rcx
movl (%rax,%rcx,8), %r13d
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
movb $0x1, %dl
cmpq %r13, %r8
jae 0x9a3ec
leal (%r12,%r12), %esi
movslq %esi, %rsi
subq %r8, %rsi
addq %r13, %rsi
addq $0x1f, %rsi
cmpq %rdi, %rsi
jge 0x9a52b
xorl %r15d, %r15d
xorl %esi, %esi
jmp 0x9a56c
movq 0x80(%rsp), %r9
addq $0x1f, %r9
jmp 0x9abf1
subq 0x70(%rsp), %r8
subq %r8, %r13
cmpq %rdi, %r13
cmovgeq %rdi, %r13
movq %r9, 0x58(%rsp)
movl %edi, %r9d
subl %r13d, %r9d
movl %r8d, %edx
negl %edx
xorl %esi, %esi
testq %r8, %r8
movl $0x0, %ecx
cmovgq %r8, %rcx
movslq %edx, %rdx
sarq $0x3f, %r8
movq %r8, %rax
andq %rdx, %rax
andl %r8d, %edx
subq %rdx, %r13
movq %rax, %rdx
movslq %r9d, %rax
movq 0x58(%rsp), %r9
movq %rcx, %r8
testb %sil, %sil
je 0x9a466
xorl %esi, %esi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x9a521
movq %rax, 0x58(%rsp)
movq 0x20(%rsp), %rax
movl 0x1c(%rax), %eax
movq 0x38(%rsp), %rcx
leaq (%rcx,%rdx), %r15
movzbl %al, %ecx
movq %r15, %rdi
movq %r8, %rsi
movq %rdx, 0x30(%rsp)
movq %r13, %rdx
movq 0x40(%rsp), %r8
callq 0x337f7
movq 0x38(%rsp), %rdi
movl $0x4e, %esi
movq 0x30(%rsp), %rdx
callq 0x20e0
addq %r13, %r15
movq %r15, %rdi
movl $0x4e, %esi
movq 0x58(%rsp), %rdx
callq 0x20e0
movq 0x90(%rsp), %rax
movq (%rax), %rdx
addq %rbp, %rdx
movzwl %r12w, %r8d
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x18(%rsp), %rcx
leaq 0x14(%rsp), %r9
leaq 0x10(%rsp), %rax
pushq %rax
leaq 0x14(%rsp), %rax
pushq %rax
callq 0x9aced
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %r11
movq 0x58(%rsp), %r10
addq $0x10, %rsp
movl 0x10(%rsp), %esi
incl %esi
cmpl $-0x1, 0xc(%rsp)
movl $0x0, %eax
cmovel %eax, %esi
movl 0x14(%rsp), %eax
movq 0x78(%rsp), %r13
jmp 0x9a644
subq 0x70(%rsp), %r8
subq %r8, %r13
cmpq %rdi, %r13
cmovgeq %rdi, %r13
movl %edi, %esi
subl %r13d, %esi
movl %r8d, %edi
negl %edi
xorl %edx, %edx
testq %r8, %r8
movl $0x0, %r9d
cmovgq %r8, %r9
movslq %edi, %rdi
sarq $0x3f, %r8
movq %r8, %r15
andq %rdi, %r15
andl %r8d, %edi
subq %rdi, %r13
movslq %esi, %rsi
movq %r9, %r8
testb %dl, %dl
je 0x9a57c
xorl %esi, %esi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x9a63a
movq %rsi, 0x58(%rsp)
movq 0x20(%rsp), %rdx
movl 0x1c(%rdx), %esi
leaq (%rax,%rcx,8), %rdx
movq %r15, 0x30(%rsp)
movq 0x38(%rsp), %rax
addq %rax, %r15
subq $0x8, %rsp
movzbl %sil, %ecx
xorl %edi, %edi
movq %r15, %rsi
movq %r13, %r9
pushq $0x0
callq 0x36b0d
addq $0x10, %rsp
movq 0x38(%rsp), %rdi
movl $0x4e, %esi
movq 0x30(%rsp), %rdx
callq 0x20e0
addq %r13, %r15
movq %r15, %rdi
movl $0x4e, %esi
movq 0x58(%rsp), %rdx
callq 0x20e0
movq 0x90(%rsp), %rax
movq (%rax), %rdx
addq %rbp, %rdx
movzwl %r12w, %r8d
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x18(%rsp), %rcx
leaq 0x14(%rsp), %r9
leaq 0x10(%rsp), %rax
pushq %rax
leaq 0x14(%rsp), %rax
pushq %rax
callq 0x9aced
movq 0x28(%rsp), %r11
movq 0x58(%rsp), %r10
addq $0x10, %rsp
movl 0x10(%rsp), %esi
incl %esi
cmpl $-0x1, 0xc(%rsp)
movl $0x0, %eax
cmovel %eax, %esi
movl 0x14(%rsp), %eax
movq 0x78(%rsp), %r13
movq 0x28(%rsp), %rdi
movl %eax, 0x58(%rsp)
movl $0x0, %eax
cmpq $-0x1, %rbx
movl $0x0, %r8d
je 0x9ab46
cmpq $0x0, 0x40(%rsp)
je 0x9a6a5
movq 0x20(%rsp), %rax
movl 0x10(%rax), %r9d
movb $0x1, %al
testq %rbx, %rbx
js 0x9a69c
movq 0x40(%rsp), %rcx
movq 0x18(%rcx), %rcx
movq (%rcx,%r9,8), %r13
cmpq %rbx, %r13
jle 0x9a69c
addl %r12d, %r12d
movslq %r12d, %rcx
subq %rbx, %rcx
addq %r13, %rcx
addq $0x1f, %rcx
cmpq %rdi, %rcx
jge 0x9a704
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x9a74b
movq 0x20(%rsp), %rax
movl 0x10(%rax), %ecx
movq 0x98(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
leaq (%rcx,%rcx,4), %rcx
movl (%rax,%rcx,8), %r13d
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
movb $0x1, %dl
cmpq %r13, %rbx
jae 0x9a6f9
movq %rsi, %r9
addl %r12d, %r12d
movslq %r12d, %rsi
subq %rbx, %rsi
addq %r13, %rsi
addq $0x1f, %rsi
cmpq %rdi, %rsi
jge 0x9a8fc
xorl %r15d, %r15d
xorl %r12d, %r12d
jmp 0x9a93b
xorl %r15d, %r15d
xorl %r12d, %r12d
jmp 0x9a93e
subq 0x70(%rsp), %rbx
subq %rbx, %r13
cmpq %rdi, %r13
cmovgeq %rdi, %r13
movl %edi, %ecx
subl %r13d, %ecx
movl %ebx, %edx
negl %edx
xorl %eax, %eax
testq %rbx, %rbx
movq %rsi, %r8
movl $0x0, %esi
cmovgq %rbx, %rsi
movslq %edx, %rdx
sarq $0x3f, %rbx
movq %rbx, %r12
andq %rdx, %r12
andl %ebx, %edx
subq %rdx, %r13
movq %r12, %rdx
movslq %ecx, %rcx
movq %rsi, %rbx
movq %r8, %rsi
testb %al, %al
jne 0x9a942
movq %rsi, 0x30(%rsp)
movq 0x20(%rsp), %rax
movl 0x1c(%rax), %eax
movq 0x38(%rsp), %r12
leaq (%r12,%rdx), %r15
movq %rcx, 0x68(%rsp)
movzbl %al, %ecx
movq %r15, %rdi
movq %rbx, %rsi
movq %rdx, %rbx
movq %r13, %rdx
movq 0x40(%rsp), %r8
callq 0x337f7
movq %r12, %rdi
movl $0x4e, %esi
movq %rbx, %rdx
callq 0x20e0
addq %r13, %r15
movq %r15, %rdi
movl $0x4e, %esi
movq 0x68(%rsp), %rdx
callq 0x20e0
movq 0x90(%rsp), %rax
movq (%rax), %rbx
cmpl $0x2, 0x28(%rsp)
jl 0x9a7f5
movq 0x28(%rsp), %rcx
movl %ecx, %eax
shrl %eax
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
addq 0x88(%rsp), %rcx
xorl %edx, %edx
movb (%r12,%rdx), %sil
movb (%rcx), %dil
movb %dil, (%r12,%rdx)
movb %sil, (%rcx)
incq %rdx
decq %rcx
cmpq %rdx, %rax
jne 0x9a7dc
addq %rbx, %rbp
movq 0x18(%rsp), %rcx
cmpl $0x2, %ecx
jl 0x9a83a
movl %ecx, %eax
shrl %eax
movl %ecx, %r8d
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
addq 0x60(%rsp), %r8
addq %rbx, %r8
xorl %edx, %edx
movb (%rbp,%rdx), %sil
movb (%r8), %dil
movb %dil, (%rbp,%rdx)
movb %sil, (%r8)
incq %rdx
decq %r8
cmpq %rdx, %rax
jne 0x9a81f
movzwl 0x70(%rsp), %r8d
movq %r12, %rdi
movq 0x28(%rsp), %r15
movl %r15d, %esi
movq %rbp, %rdx
leaq 0x14(%rsp), %r9
leaq 0x10(%rsp), %rax
pushq %rax
leaq 0x14(%rsp), %rax
pushq %rax
callq 0x9aced
addq $0x10, %rsp
cmpl $0x2, %r15d
movq 0x78(%rsp), %r13
jl 0x9a8aa
movq 0x28(%rsp), %rcx
movl %ecx, %eax
shrl %eax
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
addq 0x88(%rsp), %rcx
xorl %edx, %edx
movb (%r12,%rdx), %sil
movb (%rcx), %dil
movb %dil, (%r12,%rdx)
movb %sil, (%rcx)
incq %rdx
decq %rcx
cmpq %rdx, %rax
jne 0x9a891
movq 0x18(%rsp), %r11
cmpl $0x2, %r11d
movq 0x48(%rsp), %r10
movq 0x60(%rsp), %rdx
jl 0x9ab09
movl %r11d, %eax
shrl %eax
movl %r11d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
addq %rcx, %rdx
addq %rdx, %rbx
xorl %ecx, %ecx
movb (%rbp,%rcx), %dl
movb (%rbx), %sil
movb %sil, (%rbp,%rcx)
movb %dl, (%rbx)
incq %rcx
decq %rbx
cmpq %rcx, %rax
jne 0x9a8de
jmp 0x9ab09
subq 0x70(%rsp), %rbx
subq %rbx, %r13
cmpq %rdi, %r13
cmovgeq %rdi, %r13
movl %edi, %esi
subl %r13d, %esi
movl %ebx, %edi
negl %edi
xorl %edx, %edx
testq %rbx, %rbx
movl $0x0, %r8d
cmovgq %rbx, %r8
movslq %edi, %rdi
sarq $0x3f, %rbx
movq %rbx, %r15
andq %rdi, %r15
andl %ebx, %edi
subq %rdi, %r13
movslq %esi, %r12
movq %r8, %rbx
movq %r9, %rsi
testb %dl, %dl
je 0x9a954
xorl %eax, %eax
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movq 0x78(%rsp), %r13
jmp 0x9ab46
movq %rsi, 0x30(%rsp)
movq 0x20(%rsp), %rdx
movl 0x1c(%rdx), %esi
leaq (%rax,%rcx,8), %rdx
movq %r12, 0x68(%rsp)
movq 0x38(%rsp), %r12
movq %r15, 0xd0(%rsp)
addq %r12, %r15
subq $0x8, %rsp
movzbl %sil, %ecx
xorl %edi, %edi
movq %r15, %rsi
movq %rbx, %r8
movq %r13, %r9
pushq $0x0
callq 0x36b0d
addq $0x10, %rsp
movq %r12, %rdi
movl $0x4e, %esi
movq 0xd0(%rsp), %rdx
callq 0x20e0
addq %r13, %r15
movq %r15, %rdi
movl $0x4e, %esi
movq 0x68(%rsp), %rdx
callq 0x20e0
movq 0x90(%rsp), %rax
movq (%rax), %rbx
cmpl $0x2, 0x28(%rsp)
jl 0x9aa0b
movq 0x28(%rsp), %rcx
movl %ecx, %eax
shrl %eax
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
addq 0x88(%rsp), %rcx
xorl %edx, %edx
movb (%r12,%rdx), %sil
movb (%rcx), %dil
movb %dil, (%r12,%rdx)
movb %sil, (%rcx)
incq %rdx
decq %rcx
cmpq %rdx, %rax
jne 0x9a9f2
addq %rbx, %rbp
movq 0x18(%rsp), %rcx
cmpl $0x2, %ecx
jl 0x9aa50
movl %ecx, %eax
shrl %eax
movl %ecx, %r8d
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
addq 0x60(%rsp), %r8
addq %rbx, %r8
xorl %edx, %edx
movb (%rbp,%rdx), %sil
movb (%r8), %dil
movb %dil, (%rbp,%rdx)
movb %sil, (%r8)
incq %rdx
decq %r8
cmpq %rdx, %rax
jne 0x9aa35
movzwl 0x70(%rsp), %r8d
movq %r12, %rdi
movq 0x28(%rsp), %r15
movl %r15d, %esi
movq %rbp, %rdx
leaq 0x14(%rsp), %r9
leaq 0x10(%rsp), %rax
pushq %rax
leaq 0x14(%rsp), %rax
pushq %rax
callq 0x9aced
addq $0x10, %rsp
cmpl $0x2, %r15d
movq 0x78(%rsp), %r13
jl 0x9aac0
movq 0x28(%rsp), %rcx
movl %ecx, %eax
shrl %eax
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
addq 0x88(%rsp), %rcx
xorl %edx, %edx
movb (%r12,%rdx), %sil
movb (%rcx), %dil
movb %dil, (%r12,%rdx)
movb %sil, (%rcx)
incq %rdx
decq %rcx
cmpq %rdx, %rax
jne 0x9aaa7
movq 0x18(%rsp), %r11
cmpl $0x2, %r11d
movq 0x48(%rsp), %r10
movq 0x60(%rsp), %rdx
jl 0x9ab09
movl %r11d, %eax
shrl %eax
movl %r11d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
addq %rcx, %rdx
addq %rdx, %rbx
xorl %ecx, %ecx
movb (%rbp,%rcx), %dl
movb (%rbx), %sil
movb %sil, (%rbp,%rcx)
movb %dl, (%rbx)
incq %rcx
decq %rbx
cmpq %rcx, %rax
jne 0x9aaf0
movl 0xc(%rsp), %edx
xorl %eax, %eax
cmpl $-0x1, %edx
je 0x9ab3c
movl 0x10(%rsp), %ecx
cmpl $-0x1, %ecx
movq 0x30(%rsp), %rsi
je 0x9ab41
movq 0x28(%rsp), %rax
subl %edx, %eax
movl %eax, 0xc(%rsp)
movl %r11d, %eax
subl %ecx, %eax
incl %ecx
movl %eax, 0x10(%rsp)
movl %ecx, %eax
jmp 0x9ab41
movq 0x30(%rsp), %rsi
movl 0x14(%rsp), %r8d
testl %esi, %esi
je 0x9aba2
testl %eax, %eax
je 0x9aba2
leal (%rax,%rsi), %ecx
movslq %ecx, %rdx
cmpq %rdx, %r11
movq 0x140(%rsp), %r12
movq 0xa8(%rsp), %rbx
movq 0x80(%rsp), %r9
jge 0x9abdb
xorps %xmm0, %xmm0
cvtsi2ss %r11, %xmm0
cvtsi2ss %ecx, %xmm1
addl 0x58(%rsp), %r8d
cvtsi2ss %r8, %xmm2
divss %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %r9, %xmm1
mulss %xmm0, %xmm2
addss %xmm2, %xmm1
cvttss2si %xmm1, %r9
jmp 0x9abf1
movl %esi, %ecx
orl %eax, %ecx
movq 0x140(%rsp), %r12
movq 0xa8(%rsp), %rbx
movq 0x80(%rsp), %r9
jne 0x9abc5
addq %r11, %r9
jmp 0x9abf1
testl %esi, %esi
je 0x9ac02
movl 0x58(%rsp), %eax
movslq %esi, %rcx
addq %r11, %r9
addq %rax, %r9
subq %rcx, %r9
jmp 0x9abf1
addl 0x58(%rsp), %r8d
movslq %esi, %rcx
cltq
addq %rcx, %rax
addq %r11, %r9
subq %rax, %r9
addq %r8, %r9
addq %r11, %rbx
incq %r10
cmpq %r13, %r10
jne 0x9a0ec
jmp 0x9ac16
testl %eax, %eax
je 0x9abf1
movl %r8d, %ecx
cltq
addq %r11, %r9
addq %rcx, %r9
subq %rax, %r9
jmp 0x9abf1
movq 0x20(%rsp), %rcx
movl 0x8(%rcx), %eax
subl 0x4(%rcx), %eax
incl %eax
cmpq %rax, %rbx
jne 0x9acce
xorps %xmm0, %xmm0
cvtsi2sd %r9, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %rbx, %xmm1
divsd %xmm1, %xmm0
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18aae8(%rip), %rdi    # 0x225741
leaq 0x18a9e3(%rip), %rsi    # 0x225643
leaq 0x18ec8e(%rip), %rcx    # 0x2298f5
movl $0x44c, %edx            # imm = 0x44C
callq 0x2110
leaq 0x18aa8e(%rip), %rdi    # 0x225706
leaq 0x18a9c4(%rip), %rsi    # 0x225643
leaq 0x18ec6f(%rip), %rcx    # 0x2298f5
movl $0x440, %edx            # imm = 0x440
callq 0x2110
leaq 0x18aaaa(%rip), %rdi    # 0x225741
leaq 0x18a9a5(%rip), %rsi    # 0x225643
leaq 0x18ec50(%rip), %rcx    # 0x2298f5
movl $0x4b1, %edx            # imm = 0x4B1
callq 0x2110
leaq 0x18aa07(%rip), %rdi    # 0x2256bd
leaq 0x18a986(%rip), %rsi    # 0x225643
leaq 0x18ec31(%rip), %rcx    # 0x2298f5
movl $0x43c, %edx            # imm = 0x43C
callq 0x2110
leaq 0x18ecb1(%rip), %rdi    # 0x229986
leaq 0x18a967(%rip), %rsi    # 0x225643
leaq 0x18ec12(%rip), %rcx    # 0x2298f5
movl $0x512, %edx            # imm = 0x512
callq 0x2110