// File: chhylp123[P]hifiasm/Correct.cpp
// Function: gen_raln(ul_idx_t const*, char*, UC_Read*, overlap_region*, bit_extz_t*, long, long, long, long, long, long, long, double, unsigned long, rtrace_t*, ul_ov_t*)
void gen_raln(const ul_idx_t *uref, char* qstr, UC_Read *tu, overlap_region *o, bit_extz_t *exz, 
int64_t wsid, int64_t weid, int64_t ts, int64_t te, int64_t ql, int64_t id, int64_t rev, double e_rate, 
uint64_t rid, rtrace_t *tc, ul_ov_t *res)
{
    // fprintf(stderr, "\n[M::%s::] ii::[%ld, %ld), t::[%ld, %ld), ql::%ld, id::%ld\n", 
    //         __func__, wsid, weid, ts, te, ql, id);
    int64_t k, q[2], t[2], c[2], ct[2], cq[2], mode, qwl, twl, aln_e = 0, cur_e, is_aln; 
    bit_extz_t aux; window_list *wa = o->w_list.a; 
    memset(res, 0, sizeof((*res))); 
    res->qs = res->ts = UINT32_MAX; res->qe = res->te = 0;
    memset(tc, 0, sizeof((*tc)));
    tc->c_qs = tc->c_ts = INT32_MAX; tc->c_qe = tc->c_te = -1;
    tc->pfx_e = tc->mid_e = tc->sfx_e = 0;

    q[0] = q[1] = -1; t[0] = ts; t[1] = te;///[q[0], q[1]) && [t[0], t[1])
    for (k = wsid; k < weid; k++) {
        q[1] = wa[k].x_start; t[1] = wa[k].y_start; 
        mode = - 1; cur_e = 0; is_aln = 1;
        // if(rid == 53 && id == 6) {
        //     fprintf(stderr, "0-a[M::%s::k->%ld] q::[%ld, %ld), t::[%ld, %ld)\n", __func__, k, q[0], q[1], t[0], t[1]);
        // }
        //before window; there are gaps before the window that need to be filled
        if(t[0] < t[1] && q[0] < q[1]) {
            if(q[0] < 0) { ///backward extension
                mode = 2;
                adjust_ext_offset_fixed_t(&(q[0]), &(q[1]), &(t[0]), &(t[1]), 0, q[1], t[0], t[1], 0, mode);
            } else {
                mode = 0;
            }
            // if(rid == 53 && id == 6) {
            //     fprintf(stderr, "1-a[M::%s::k->%ld] q::[%ld, %ld), t::[%ld, %ld), mode::%ld\n", 
            //     __func__, k, q[0], q[1], t[0], t[1], mode);
            // }
            qwl = q[1] - q[0]; twl = t[1] - t[0];
            if(qwl || twl) {
                if(qwl == 0 && twl > 0) {
                    cur_e = twl;
                    // tot_e += twl;
                } else if(twl == 0 && qwl > 0) {
                    cur_e = qwl;
                    // tot_e += qwl;
                } else {
                    if(hc_aln_exz_simi_adv(id, rev, uref, NULL, NULL, qstr, tu, q[0], q[1], t[0], t[1], 
                            0, ql, ts, te, mode, exz, ql, e_rate, MAX_CNS_L, MAX_CNS_E, FORCE_CNS_L, -1, NULL, 0)) {
                        cur_e = exz->err; 
                        // tot_e += exz->err; 
                        q[0] = exz->ts; q[1] = exz->te + 1; t[0] = exz->ps; t[1] = exz->pe + 1;
                        // if(rid == 53 && id == 6) {
                        //     fprintf(stderr, "2-a[M::%s::k->%ld] q::[%ld, %ld), t::[%ld, %ld), mode::%ld, cur_e::%ld\n", 
                        //     __func__, k, q[0], q[1], t[0], t[1], mode, cur_e);
                        // }
                    } else {
                        cur_e = gen_err_unaligned(qwl, twl); is_aln = 0;
                        // tot_e += gen_err_unaligned(qwl, twl); 
                        // if(rid == 53 && id == 6) {
                        //     fprintf(stderr, "2-b[M::%s::k->%ld] q::[%ld, %ld), t::[%ld, %ld), mode::%ld, cur_e::%ld\n", 
                        //     __func__, k, q[0], q[1], t[0], t[1], mode, cur_e);
                        // }
                    }
                }
                aln_e += cur_e;
                update_ul_ov_t_coor((*res), q[0], q[1], t[0], t[1]);
                if(k == wsid) tc->pfx_e = cur_e*(is_aln?1:-1);
            }
        } 
        
        ///within window
        q[0] = wa[k].x_start; t[0] = wa[k].y_start;
        q[1] = wa[k].x_end+1; t[1] = wa[k].y_end+1;
        qwl = q[1] - q[0]; twl = t[1] - t[0]; cur_e = 0; is_aln = 1;
        // if(rid == 53 && id == 6) {
        //     fprintf(stderr, "3-a[M::%s::k->%ld] q::[%ld, %ld), t::[%ld, %ld)\n", 
        //     __func__, k, q[0], q[1], t[0], t[1]);
        // }
        if((ts <= t[0]) && (te >= t[1])) {///cover the whole window
            if(!is_ualn_win(wa[k])) cur_e = wa[k].error;
            else cur_e = gen_err_unaligned(qwl, twl); 
            update_trace_idx(tc, k, 0, wa[k].clen, q[0], q[1], t[0], t[1]);
            // if(rid == 53 && id == 6) {
            //     fprintf(stderr, "4-a[M::%s::k->%ld] q::[%ld, %ld), t::[%ld, %ld), cur_e::%ld\n", 
            //     __func__, k, q[0], q[1], t[0], t[1], cur_e);
            // }
        } else {///te < t[1]->cover a part of window
            if(ts > t[0]) {
                t[0] = ts; q[0] = -1;
            }
            if(te < t[1]) {
                t[1] = te; q[1] = -1;
            }

            if((q[0] != -1) && (q[1] != -1)) {
                mode = 0;//global
            } else if((q[0] != -1) && (q[1] == -1)) {
                mode = 1;///forward extension
            } else if((q[0] == -1) && (q[1] != -1)) {
                mode = 2;///backward extension
            } else {
                mode = 3;///no primary hit within [ibeg, iend] 
            }
            // if(rid == 53 && id == 6) {
            //     fprintf(stderr, "5-a[M::%s::k->%ld] q::[%ld, %ld), t::[%ld, %ld), mode::%ld\n", 
            //     __func__, k, q[0], q[1], t[0], t[1], mode);
            // }
            if(!is_ualn_win(wa[k])) {///scan cigar by the coordinates of y/t
                set_bit_extz_t(aux, (*o), k); 
                cur_e = hc_aln_exz_by_exist_cigar_with_p(&aux, mode, t[0], t[1], &(q[0]), &(q[1]), 
                &(c[0]), &(c[1]), &(ct[0]), &(ct[1]), &(cq[0]), &(cq[1]));
                update_trace_idx(tc, k, c[0], c[1], cq[0], cq[1], ct[0], ct[1]);
                // if(rid == 53 && id == 6) {
                //     fprintf(stderr, "6-a[M::%s::k->%ld] q::[%ld, %ld), t::[%ld, %ld), cur_e::%ld, c_q::[%ld, %ld), c_t::[%ld, %ld)\n", 
                //     __func__, k, q[0], q[1], t[0], t[1], cur_e, cq[0], cq[1], ct[0], ct[1]);
                // }
            } else {
                assert(mode == 1 || mode == 2);
                adjust_ext_offset_fixed_t(&(q[0]), &(q[1]), &(t[0]), &(t[1]), q[0], q[1], t[0], t[1], 0, mode);
                qwl = q[1] - q[0]; twl = t[1] - t[0];
                // if(rid == 53 && id == 6) {
                //     fprintf(stderr, "7-a[M::%s::k->%ld] q::[%ld, %ld), t::[%ld, %ld), cur_e::%ld\n", 
                //     __func__, k, q[0], q[1], t[0], t[1], cur_e);
                // }
                if(qwl || twl) {
                    if(qwl == 0 && twl > 0) {
                        cur_e = twl;
                    } else if(twl == 0 && qwl > 0) {
                        cur_e = qwl;
                    } else {
                        if(hc_aln_exz_simi_adv(id, rev, uref, NULL, NULL, qstr, tu, q[0], q[1], t[0], t[1], 
                                0, ql, ts, te, mode, exz, ql, e_rate, MAX_CNS_L, MAX_CNS_E, FORCE_CNS_L, -1, NULL, 0)) {
                            cur_e = exz->err; 
                            q[0] = exz->ts; q[1] = exz->te + 1; t[0] = exz->ps; t[1] = exz->pe + 1;
                            // if(rid == 53 && id == 6) {
                            //     fprintf(stderr, "7-b[M::%s::k->%ld] q::[%ld, %ld), t::[%ld, %ld), cur_e::%ld\n", 
                            //     __func__, k, q[0], q[1], t[0], t[1], cur_e);
                            // }
                        } else {
                            cur_e = gen_err_unaligned(qwl, twl); is_aln = 0;
                            // if(rid == 53 && id == 6) {
                            //     fprintf(stderr, "7-c[M::%s::k->%ld] q::[%ld, %ld), t::[%ld, %ld), cur_e::%ld\n", 
                            //     __func__, k, q[0], q[1], t[0], t[1], cur_e);
                            // }
                        }
                    }
                    tc->sfx_e = cur_e*(is_aln?1:-1);
                }
            }
        }
        aln_e += cur_e;
        update_ul_ov_t_coor((*res), q[0], q[1], t[0], t[1]);

        q[0] = q[1]; t[0] = t[1];
    }
    // if(ts == 8087 && te == 28530 && ql == 127662) {
    //     fprintf(stderr, "8-a[M::%s::k->%ld] q::[%ld, %ld), t::[%ld, %ld), cur_e::%ld, ql::%ld\n", 
    //     __func__, k, q[0], q[1], t[0], t[1], cur_e, ql);
    // }
    if(q[0] >= 0 && q[0] < ql) {///forward extension
        q[1] = ql; t[1] = te; cur_e = 0; mode = 1;///forward extension
        adjust_ext_offset_fixed_t(&(q[0]), &(q[1]), &(t[0]), &(t[1]), q[0], q[1], t[0], t[1], 0, mode);
        qwl = q[1] - q[0]; twl = t[1] - t[0]; is_aln = 1;
        // if(rid == 53 && id == 6) {
        //     fprintf(stderr, "9-a[M::%s::k->%ld] q::[%ld, %ld), t::[%ld, %ld), cur_e::%ld\n", 
        //     __func__, k, q[0], q[1], t[0], t[1], cur_e);
        // }
        if(qwl || twl) {
            if(qwl == 0 && twl > 0) {
                cur_e = twl;
            } else if(twl == 0 && qwl > 0) {
                cur_e = qwl;
            } else {
                if(hc_aln_exz_simi_adv(id, rev, uref, NULL, NULL, qstr, tu, q[0], q[1], t[0], t[1], 
                        0, ql, ts, te, mode, exz, ql, e_rate, MAX_CNS_L, MAX_CNS_E, FORCE_CNS_L, -1, NULL, 0)) {
                    cur_e = exz->err; 
                    q[0] = exz->ts; q[1] = exz->te + 1; t[0] = exz->ps; t[1] = exz->pe + 1;
                    // if(rid == 53 && id == 6) {
                    //     fprintf(stderr, "9-b[M::%s::k->%ld] q::[%ld, %ld), t::[%ld, %ld), cur_e::%ld, thre::%d\n", 
                    //     __func__, k, q[0], q[1], t[0], t[1], cur_e, exz->thre);
                    // }
                } else {
                    cur_e = gen_err_unaligned(qwl, twl); is_aln = 0;
                    // if(rid == 53 && id == 6) {
                    //     fprintf(stderr, "9-c[M::%s::k->%ld] q::[%ld, %ld), t::[%ld, %ld), cur_e::%ld\n", 
                    //     __func__, k, q[0], q[1], t[0], t[1], cur_e);
                    // }
                }
            }
            update_ul_ov_t_coor((*res), q[0], q[1], t[0], t[1]);
            tc->sfx_e = cur_e*(is_aln?1:-1);
        }
        aln_e += cur_e;
    }
    tc->mid_e = aln_e - abs(tc->pfx_e) - abs(tc->sfx_e); 
    if(aln_e <= MAX_SEC_ERR) res->sec = aln_e;
    else res->sec = MAX_SEC_ERR;
    // fprintf(stderr, "10-a[M::%s::k->%ld] q::[%u, %u), t::[%u, %u), tot_e::%u\n\n", 
    //                 __func__, k, res->qs, res->qe, res->ts, res->te, res->sec);


    // aln_e = get_sub_cigar_err(res, tc, uref, qstr, tu, o, exz, e_rate);
    // if(aln_e != (int64_t)res->sec) {
    //     fprintf(stderr, "[M::%s::rid->%lu] tot_e::%u, aln_e::%ld, id::%ld\n", 
    //     __func__, rid, res->sec, aln_e, id);
    //     exit(1);
    // }
    
    // assert(aln_e == get_sub_cigar_err(res, tc, uref, qstr, tu, o, exz, e_rate, 0));
    // assert(aln_e == get_sub_cigar_err(res, tc, uref, qstr, tu, o, exz, e_rate, 1));
    // debug_backtrace_step_err(rid, res, tc, uref, qstr, tu, o, exz, e_rate);
    // if(rid == 42 && res->sec == 706 && res->qs == 63686 && res->qe == 75773 
    //                     && res->ts == 9404 && res->te == 21663) {
    //     debug_backtrace_step_err(rid, res, tc, uref, qstr, tu, o, exz, e_rate);
    // }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x328, %rsp            # imm = 0x328
movq 0x50(%rbp), %rax
movq 0x48(%rbp), %rax
movq 0x40(%rbp), %rax
movq 0x38(%rbp), %rax
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdx, -0x40(%rbp)
movq %rcx, -0x48(%rbp)
movq %r8, -0x50(%rbp)
movq %r9, -0x58(%rbp)
movsd %xmm0, -0x60(%rbp)
movq $0x0, -0xe0(%rbp)
movq -0x48(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x1d0(%rbp)
movq 0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x1c, %edx
callq 0x2100
movq 0x50(%rbp), %rax
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movq 0x50(%rbp), %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movq 0x50(%rbp), %rax
movl $0x0, 0x14(%rax)
movq 0x50(%rbp), %rax
movl $0x0, 0x8(%rax)
movq 0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x34, %edx
callq 0x2100
movq 0x48(%rbp), %rax
movl $0x7fffffff, 0x8(%rax)  # imm = 0x7FFFFFFF
movq 0x48(%rbp), %rax
movl $0x7fffffff, (%rax)     # imm = 0x7FFFFFFF
movq 0x48(%rbp), %rax
movl $0xffffffff, 0xc(%rax)  # imm = 0xFFFFFFFF
movq 0x48(%rbp), %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movq 0x48(%rbp), %rax
movl $0x0, 0x24(%rax)
movq 0x48(%rbp), %rax
movl $0x0, 0x2c(%rax)
movq 0x48(%rbp), %rax
movl $0x0, 0x28(%rax)
movq $-0x1, -0x78(%rbp)
movq $-0x1, -0x80(%rbp)
movq 0x18(%rbp), %rax
movq %rax, -0x90(%rbp)
movq 0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
cmpq 0x10(%rbp), %rax
jge 0x95d0b
movq -0x1d0(%rbp), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq (%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x1d0(%rbp), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq 0x8(%rax), %rax
movq %rax, -0x88(%rbp)
movq $-0x1, -0xc8(%rbp)
movq $0x0, -0xe8(%rbp)
movq $0x1, -0xf0(%rbp)
movq -0x90(%rbp), %rax
cmpq -0x88(%rbp), %rax
jge 0x952bc
movq -0x80(%rbp), %rax
cmpq -0x78(%rbp), %rax
jge 0x952bc
cmpq $0x0, -0x80(%rbp)
jge 0x94eb6
movq $0x2, -0xc8(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x80(%rbp), %rsi
addq $0x8, %rsi
leaq -0x90(%rbp), %rdx
leaq -0x90(%rbp), %rcx
addq $0x8, %rcx
movq -0x78(%rbp), %r9
movq -0x90(%rbp), %r11
movq -0x88(%rbp), %r10
movq -0xc8(%rbp), %rax
xorl %r8d, %r8d
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x5fe20
jmp 0x94ec1
movq $0x0, -0xc8(%rbp)
movq -0x78(%rbp), %rax
subq -0x80(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x88(%rbp), %rax
subq -0x90(%rbp), %rax
movq %rax, -0xd8(%rbp)
cmpq $0x0, -0xd0(%rbp)
jne 0x94efd
cmpq $0x0, -0xd8(%rbp)
je 0x952ba
cmpq $0x0, -0xd0(%rbp)
jne 0x94f24
cmpq $0x0, -0xd8(%rbp)
jle 0x94f24
movq -0xd8(%rbp), %rax
movq %rax, -0xe8(%rbp)
jmp 0x951f4
cmpq $0x0, -0xd8(%rbp)
jne 0x94f4b
cmpq $0x0, -0xd0(%rbp)
jle 0x94f4b
movq -0xd0(%rbp), %rax
movq %rax, -0xe8(%rbp)
jmp 0x951f2
movq 0x30(%rbp), %rdi
movq 0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %r9
movq -0x40(%rbp), %rax
movq -0x80(%rbp), %rcx
movq %rcx, -0x1e8(%rbp)
movq -0x78(%rbp), %rcx
movq %rcx, -0x1e0(%rbp)
movq -0x90(%rbp), %r13
movq -0x88(%rbp), %r12
movq 0x28(%rbp), %r15
movq 0x18(%rbp), %r14
movq 0x20(%rbp), %rbx
movq -0xc8(%rbp), %r11
movq -0x50(%rbp), %r10
movq 0x28(%rbp), %rcx
movq %rcx, -0x1d8(%rbp)
movsd -0x60(%rbp), %xmm0
xorl %ecx, %ecx
movl %ecx, %r8d
movq %r8, %rcx
movq %rax, (%rsp)
movq -0x1e8(%rbp), %rax
movq %rax, 0x8(%rsp)
movq -0x1e0(%rbp), %rax
movq %rax, 0x10(%rsp)
movq -0x1d8(%rbp), %rax
movq %r13, 0x18(%rsp)
movq %r12, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movq %r15, 0x30(%rsp)
movq %r14, 0x38(%rsp)
movq %rbx, 0x40(%rsp)
movq %r11, 0x48(%rsp)
movq %r10, 0x50(%rsp)
movq %rax, 0x58(%rsp)
movq $0xc00, 0x60(%rsp)      # imm = 0xC00
movq $0x3ff, 0x68(%rsp)      # imm = 0x3FF
movq $0x100, 0x70(%rsp)      # imm = 0x100
movq $-0x1, 0x78(%rsp)
movq $0x0, 0x80(%rsp)
movq $0x0, 0x88(%rsp)
callq 0x8e630
cmpq $0x0, %rax
je 0x9509f
movq -0x50(%rbp), %rax
movslq 0x2c(%rax), %rax
movq %rax, -0xe8(%rbp)
movq -0x50(%rbp), %rax
movslq 0x1c(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x50(%rbp), %rax
movl 0x20(%rax), %eax
addl $0x1, %eax
cltq
movq %rax, -0x78(%rbp)
movq -0x50(%rbp), %rax
movslq 0x10(%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x50(%rbp), %rax
movl 0x14(%rax), %eax
addl $0x1, %eax
cltq
movq %rax, -0x88(%rbp)
jmp 0x951f0
cmpq $0x200, -0xd0(%rbp) # imm = 0x200
jg 0x950f3
movq -0xd0(%rbp), %rax
cmpq -0xd8(%rbp), %rax
jl 0x950cc
movq -0xd0(%rbp), %rax
movq %rax, -0x1f0(%rbp)
jmp 0x950da
movq -0xd8(%rbp), %rax
movq %rax, -0x1f0(%rbp)
movq -0x1f0(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x1f8(%rbp)
jmp 0x951d1
movq -0xd0(%rbp), %rax
cmpq -0xd8(%rbp), %rax
jg 0x95113
movq -0xd0(%rbp), %rax
movq %rax, -0x200(%rbp)
jmp 0x95121
movq -0xd8(%rbp), %rax
movq %rax, -0x200(%rbp)
movq -0x200(%rbp), %rax
cvtsi2sd %rax, %xmm0
cvtsi2sdq -0xd0(%rbp), %xmm1
movsd 0x2ed17a(%rip), %xmm2   # 0x3822b8
mulsd %xmm2, %xmm1
movsd 0x2eceb6(%rip), %xmm2   # 0x382000
addsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x95198
movq -0xd0(%rbp), %rax
cmpq -0xd8(%rbp), %rax
jg 0x95174
movq -0xd0(%rbp), %rax
movq %rax, -0x208(%rbp)
jmp 0x95182
movq -0xd8(%rbp), %rax
movq %rax, -0x208(%rbp)
movq -0x208(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x210(%rbp)
jmp 0x951c1
cvtsi2sdq -0xd0(%rbp), %xmm0
movsd 0x2ed10f(%rip), %xmm1   # 0x3822b8
mulsd %xmm1, %xmm0
movsd 0x2ece4b(%rip), %xmm1   # 0x382000
addsd %xmm1, %xmm0
movsd %xmm0, -0x210(%rbp)
movsd -0x210(%rbp), %xmm0
movsd %xmm0, -0x1f8(%rbp)
movsd -0x1f8(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0xe8(%rbp)
movq $0x0, -0xf0(%rbp)
jmp 0x951f2
jmp 0x951f4
movq -0xe8(%rbp), %rax
addq -0xe0(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq 0x50(%rbp), %rax
movl 0x4(%rax), %eax
cmpq -0x80(%rbp), %rax
jle 0x95223
movq -0x80(%rbp), %rax
movl %eax, %ecx
movq 0x50(%rbp), %rax
movl %ecx, 0x4(%rax)
movq 0x50(%rbp), %rax
movl 0x8(%rax), %eax
cmpq -0x78(%rbp), %rax
jge 0x9523d
movq -0x78(%rbp), %rax
movl %eax, %ecx
movq 0x50(%rbp), %rax
movl %ecx, 0x8(%rax)
movq 0x50(%rbp), %rax
movl 0x10(%rax), %eax
cmpq -0x90(%rbp), %rax
jle 0x9525d
movq -0x90(%rbp), %rax
movl %eax, %ecx
movq 0x50(%rbp), %rax
movl %ecx, 0x10(%rax)
movq 0x50(%rbp), %rax
movl 0x14(%rax), %eax
cmpq -0x88(%rbp), %rax
jge 0x9527d
movq -0x88(%rbp), %rax
movl %eax, %ecx
movq 0x50(%rbp), %rax
movl %ecx, 0x14(%rax)
jmp 0x9527f
movq -0x68(%rbp), %rax
cmpq -0x58(%rbp), %rax
jne 0x952b8
movq -0xe8(%rbp), %rax
movq -0xf0(%rbp), %rsi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0x1, %edx
cmpq $0x0, %rsi
cmovnel %edx, %ecx
movslq %ecx, %rcx
imulq %rcx, %rax
movl %eax, %ecx
movq 0x48(%rbp), %rax
movl %ecx, 0x28(%rax)
jmp 0x952ba
jmp 0x952bc
movq -0x1d0(%rbp), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq (%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x1d0(%rbp), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq 0x8(%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x1d0(%rbp), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
addl $0x1, %eax
cltq
movq %rax, -0x78(%rbp)
movq -0x1d0(%rbp), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
addl $0x1, %eax
cltq
movq %rax, -0x88(%rbp)
movq -0x78(%rbp), %rax
subq -0x80(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x88(%rbp), %rax
subq -0x90(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq $0x0, -0xe8(%rbp)
movq $0x1, -0xf0(%rbp)
movq 0x18(%rbp), %rax
cmpq -0x90(%rbp), %rax
jg 0x95590
movq 0x20(%rbp), %rax
cmpq -0x88(%rbp), %rax
jl 0x95590
movq -0x1d0(%rbp), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movswl 0x14(%rax), %eax
cmpl $0x7fff, %eax           # imm = 0x7FFF
jne 0x953dd
movq -0x1d0(%rbp), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x0, 0x1c(%rax)
jne 0x953dd
movq -0x1d0(%rbp), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movswl 0x12(%rax), %eax
cmpl $0x0, %eax
jl 0x95400
movq -0x1d0(%rbp), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movswq 0x14(%rax), %rax
movq %rax, -0xe8(%rbp)
jmp 0x95546
cmpq $0x200, -0xd0(%rbp) # imm = 0x200
jg 0x95454
movq -0xd0(%rbp), %rax
cmpq -0xd8(%rbp), %rax
jl 0x9542d
movq -0xd0(%rbp), %rax
movq %rax, -0x218(%rbp)
jmp 0x9543b
movq -0xd8(%rbp), %rax
movq %rax, -0x218(%rbp)
movq -0x218(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x220(%rbp)
jmp 0x95532
movq -0xd0(%rbp), %rax
cmpq -0xd8(%rbp), %rax
jg 0x95474
movq -0xd0(%rbp), %rax
movq %rax, -0x228(%rbp)
jmp 0x95482
movq -0xd8(%rbp), %rax
movq %rax, -0x228(%rbp)
movq -0x228(%rbp), %rax
cvtsi2sd %rax, %xmm0
cvtsi2sdq -0xd0(%rbp), %xmm1
movsd 0x2ece19(%rip), %xmm2   # 0x3822b8
mulsd %xmm2, %xmm1
movsd 0x2ecb55(%rip), %xmm2   # 0x382000
addsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x954f9
movq -0xd0(%rbp), %rax
cmpq -0xd8(%rbp), %rax
jg 0x954d5
movq -0xd0(%rbp), %rax
movq %rax, -0x230(%rbp)
jmp 0x954e3
movq -0xd8(%rbp), %rax
movq %rax, -0x230(%rbp)
movq -0x230(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x238(%rbp)
jmp 0x95522
cvtsi2sdq -0xd0(%rbp), %xmm0
movsd 0x2ecdae(%rip), %xmm1   # 0x3822b8
mulsd %xmm1, %xmm0
movsd 0x2ecaea(%rip), %xmm1   # 0x382000
addsd %xmm1, %xmm0
movsd %xmm0, -0x238(%rbp)
movsd -0x238(%rbp), %xmm0
movsd %xmm0, -0x220(%rbp)
movsd -0x220(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0xe8(%rbp)
movq 0x48(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x1d0(%rbp), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
movl %eax, %ecx
movq -0x80(%rbp), %r8
movq -0x78(%rbp), %r9
movq -0x90(%rbp), %r10
movq -0x88(%rbp), %rax
xorl %edx, %edx
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xc1fc0
jmp 0x95c59
movq 0x18(%rbp), %rax
cmpq -0x90(%rbp), %rax
jle 0x955b0
movq 0x18(%rbp), %rax
movq %rax, -0x90(%rbp)
movq $-0x1, -0x80(%rbp)
movq 0x20(%rbp), %rax
cmpq -0x88(%rbp), %rax
jge 0x955d0
movq 0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
movq $-0x1, -0x78(%rbp)
cmpq $-0x1, -0x80(%rbp)
je 0x955eb
cmpq $-0x1, -0x78(%rbp)
je 0x955eb
movq $0x0, -0xc8(%rbp)
jmp 0x95630
cmpq $-0x1, -0x80(%rbp)
je 0x95606
cmpq $-0x1, -0x78(%rbp)
jne 0x95606
movq $0x1, -0xc8(%rbp)
jmp 0x9562e
cmpq $-0x1, -0x80(%rbp)
jne 0x95621
cmpq $-0x1, -0x78(%rbp)
je 0x95621
movq $0x2, -0xc8(%rbp)
jmp 0x9562c
movq $0x3, -0xc8(%rbp)
jmp 0x9562e
jmp 0x95630
movq -0x1d0(%rbp), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movswl 0x14(%rax), %eax
cmpl $0x7fff, %eax           # imm = 0x7FFF
jne 0x95684
movq -0x1d0(%rbp), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x0, 0x1c(%rax)
jne 0x95684
movq -0x1d0(%rbp), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movswl 0x12(%rax), %eax
cmpl $0x0, %eax
jl 0x9584a
jmp 0x95686
movq -0x48(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x48(%rbp), %rcx
movq 0x58(%rcx), %rcx
movq -0x68(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movl 0x18(%rcx), %ecx
shlq %rcx
addq %rcx, %rax
movq %rax, -0x110(%rbp)
movq -0x48(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
movq %rax, -0x118(%rbp)
movq %rax, -0x120(%rbp)
movq -0x48(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x1ac(%rbp)
movq -0x48(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x1a8(%rbp)
movq -0x48(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x1b8(%rbp)
movq -0x48(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, -0x1b4(%rbp)
movq -0x48(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movswl 0x14(%rax), %eax
movl %eax, -0x19c(%rbp)
movq -0x48(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x68(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movswl 0x14(%rax), %eax
movl %eax, -0x1a0(%rbp)
movq -0xc8(%rbp), %rsi
movq -0x90(%rbp), %rdx
movq -0x88(%rbp), %rcx
leaq -0x80(%rbp), %r8
leaq -0x80(%rbp), %r9
addq $0x8, %r9
leaq -0xa0(%rbp), %r15
leaq -0xa0(%rbp), %r14
addq $0x8, %r14
leaq -0xb0(%rbp), %rbx
leaq -0xb0(%rbp), %r11
addq $0x8, %r11
leaq -0xc0(%rbp), %r10
leaq -0xc0(%rbp), %rax
addq $0x8, %rax
leaq -0x1c8(%rbp), %rdi
movq %r15, (%rsp)
movq %r14, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movq %r11, 0x18(%rsp)
movq %r10, 0x20(%rsp)
movq %rax, 0x28(%rsp)
callq 0x8f0e0
movq %rax, -0xe8(%rbp)
movq 0x48(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0xa0(%rbp), %rdx
movq -0x98(%rbp), %rcx
movq -0xc0(%rbp), %r8
movq -0xb8(%rbp), %r9
movq -0xb0(%rbp), %r10
movq -0xa8(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xc1fc0
jmp 0x95c57
movb $0x1, %al
cmpq $0x1, -0xc8(%rbp)
movb %al, -0x239(%rbp)
je 0x9586d
cmpq $0x2, -0xc8(%rbp)
sete %al
movb %al, -0x239(%rbp)
movb -0x239(%rbp), %al
testb $0x1, %al
jne 0x95879
jmp 0x9587b
jmp 0x9589a
leaq 0x2f07ec(%rip), %rdi    # 0x38606e
leaq 0x2eca92(%rip), %rsi    # 0x38231b
movl $0x5fcd, %edx           # imm = 0x5FCD
leaq 0x2f07f0(%rip), %rcx    # 0x386085
callq 0x2130
leaq -0x80(%rbp), %rdi
leaq -0x80(%rbp), %rsi
addq $0x8, %rsi
leaq -0x90(%rbp), %rdx
leaq -0x90(%rbp), %rcx
addq $0x8, %rcx
movq -0x80(%rbp), %r8
movq -0x78(%rbp), %r9
movq -0x90(%rbp), %r11
movq -0x88(%rbp), %r10
movq -0xc8(%rbp), %rax
xorl %ebx, %ebx
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x5fe20
movq -0x78(%rbp), %rax
subq -0x80(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x88(%rbp), %rax
subq -0x90(%rbp), %rax
movq %rax, -0xd8(%rbp)
cmpq $0x0, -0xd0(%rbp)
jne 0x9592f
cmpq $0x0, -0xd8(%rbp)
je 0x95c55
cmpq $0x0, -0xd0(%rbp)
jne 0x95956
cmpq $0x0, -0xd8(%rbp)
jle 0x95956
movq -0xd8(%rbp), %rax
movq %rax, -0xe8(%rbp)
jmp 0x95c26
cmpq $0x0, -0xd8(%rbp)
jne 0x9597d
cmpq $0x0, -0xd0(%rbp)
jle 0x9597d
movq -0xd0(%rbp), %rax
movq %rax, -0xe8(%rbp)
jmp 0x95c24
movq 0x30(%rbp), %rdi
movq 0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %r9
movq -0x40(%rbp), %rax
movq -0x80(%rbp), %rcx
movq %rcx, -0x258(%rbp)
movq -0x78(%rbp), %rcx
movq %rcx, -0x250(%rbp)
movq -0x90(%rbp), %r13
movq -0x88(%rbp), %r12
movq 0x28(%rbp), %r15
movq 0x18(%rbp), %r14
movq 0x20(%rbp), %rbx
movq -0xc8(%rbp), %r11
movq -0x50(%rbp), %r10
movq 0x28(%rbp), %rcx
movq %rcx, -0x248(%rbp)
movsd -0x60(%rbp), %xmm0
xorl %ecx, %ecx
movl %ecx, %r8d
movq %r8, %rcx
movq %rax, (%rsp)
movq -0x258(%rbp), %rax
movq %rax, 0x8(%rsp)
movq -0x250(%rbp), %rax
movq %rax, 0x10(%rsp)
movq -0x248(%rbp), %rax
movq %r13, 0x18(%rsp)
movq %r12, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movq %r15, 0x30(%rsp)
movq %r14, 0x38(%rsp)
movq %rbx, 0x40(%rsp)
movq %r11, 0x48(%rsp)
movq %r10, 0x50(%rsp)
movq %rax, 0x58(%rsp)
movq $0xc00, 0x60(%rsp)      # imm = 0xC00
movq $0x3ff, 0x68(%rsp)      # imm = 0x3FF
movq $0x100, 0x70(%rsp)      # imm = 0x100
movq $-0x1, 0x78(%rsp)
movq $0x0, 0x80(%rsp)
movq $0x0, 0x88(%rsp)
callq 0x8e630
cmpq $0x0, %rax
je 0x95ad1
movq -0x50(%rbp), %rax
movslq 0x2c(%rax), %rax
movq %rax, -0xe8(%rbp)
movq -0x50(%rbp), %rax
movslq 0x1c(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x50(%rbp), %rax
movl 0x20(%rax), %eax
addl $0x1, %eax
cltq
movq %rax, -0x78(%rbp)
movq -0x50(%rbp), %rax
movslq 0x10(%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x50(%rbp), %rax
movl 0x14(%rax), %eax
addl $0x1, %eax
cltq
movq %rax, -0x88(%rbp)
jmp 0x95c22
cmpq $0x200, -0xd0(%rbp) # imm = 0x200
jg 0x95b25
movq -0xd0(%rbp), %rax
cmpq -0xd8(%rbp), %rax
jl 0x95afe
movq -0xd0(%rbp), %rax
movq %rax, -0x260(%rbp)
jmp 0x95b0c
movq -0xd8(%rbp), %rax
movq %rax, -0x260(%rbp)
movq -0x260(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x268(%rbp)
jmp 0x95c03
movq -0xd0(%rbp), %rax
cmpq -0xd8(%rbp), %rax
jg 0x95b45
movq -0xd0(%rbp), %rax
movq %rax, -0x270(%rbp)
jmp 0x95b53
movq -0xd8(%rbp), %rax
movq %rax, -0x270(%rbp)
movq -0x270(%rbp), %rax
cvtsi2sd %rax, %xmm0
cvtsi2sdq -0xd0(%rbp), %xmm1
movsd 0x2ec748(%rip), %xmm2   # 0x3822b8
mulsd %xmm2, %xmm1
movsd 0x2ec484(%rip), %xmm2   # 0x382000
addsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x95bca
movq -0xd0(%rbp), %rax
cmpq -0xd8(%rbp), %rax
jg 0x95ba6
movq -0xd0(%rbp), %rax
movq %rax, -0x278(%rbp)
jmp 0x95bb4
movq -0xd8(%rbp), %rax
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x280(%rbp)
jmp 0x95bf3
cvtsi2sdq -0xd0(%rbp), %xmm0
movsd 0x2ec6dd(%rip), %xmm1   # 0x3822b8
mulsd %xmm1, %xmm0
movsd 0x2ec419(%rip), %xmm1   # 0x382000
addsd %xmm1, %xmm0
movsd %xmm0, -0x280(%rbp)
movsd -0x280(%rbp), %xmm0
movsd %xmm0, -0x268(%rbp)
movsd -0x268(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0xe8(%rbp)
movq $0x0, -0xf0(%rbp)
jmp 0x95c24
jmp 0x95c26
movq -0xe8(%rbp), %rax
movq -0xf0(%rbp), %rsi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0x1, %edx
cmpq $0x0, %rsi
cmovnel %edx, %ecx
movslq %ecx, %rcx
imulq %rcx, %rax
movl %eax, %ecx
movq 0x48(%rbp), %rax
movl %ecx, 0x24(%rax)
jmp 0x95c57
jmp 0x95c59
movq -0xe8(%rbp), %rax
addq -0xe0(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq 0x50(%rbp), %rax
movl 0x4(%rax), %eax
cmpq -0x80(%rbp), %rax
jle 0x95c88
movq -0x80(%rbp), %rax
movl %eax, %ecx
movq 0x50(%rbp), %rax
movl %ecx, 0x4(%rax)
movq 0x50(%rbp), %rax
movl 0x8(%rax), %eax
cmpq -0x78(%rbp), %rax
jge 0x95ca2
movq -0x78(%rbp), %rax
movl %eax, %ecx
movq 0x50(%rbp), %rax
movl %ecx, 0x8(%rax)
movq 0x50(%rbp), %rax
movl 0x10(%rax), %eax
cmpq -0x90(%rbp), %rax
jle 0x95cc2
movq -0x90(%rbp), %rax
movl %eax, %ecx
movq 0x50(%rbp), %rax
movl %ecx, 0x10(%rax)
movq 0x50(%rbp), %rax
movl 0x14(%rax), %eax
cmpq -0x88(%rbp), %rax
jge 0x95ce2
movq -0x88(%rbp), %rax
movl %eax, %ecx
movq 0x50(%rbp), %rax
movl %ecx, 0x14(%rax)
jmp 0x95ce4
movq -0x78(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x94dc5
cmpq $0x0, -0x80(%rbp)
jl 0x961a0
movq -0x80(%rbp), %rax
cmpq 0x28(%rbp), %rax
jge 0x961a0
movq 0x28(%rbp), %rax
movq %rax, -0x78(%rbp)
movq 0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
movq $0x0, -0xe8(%rbp)
movq $0x1, -0xc8(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x80(%rbp), %rsi
addq $0x8, %rsi
leaq -0x90(%rbp), %rdx
leaq -0x90(%rbp), %rcx
addq $0x8, %rcx
movq -0x80(%rbp), %r8
movq -0x78(%rbp), %r9
movq -0x90(%rbp), %r11
movq -0x88(%rbp), %r10
movq -0xc8(%rbp), %rax
xorl %ebx, %ebx
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x5fe20
movq -0x78(%rbp), %rax
subq -0x80(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x88(%rbp), %rax
subq -0x90(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq $0x1, -0xf0(%rbp)
cmpq $0x0, -0xd0(%rbp)
jne 0x95ded
cmpq $0x0, -0xd8(%rbp)
je 0x9618b
cmpq $0x0, -0xd0(%rbp)
jne 0x95e14
cmpq $0x0, -0xd8(%rbp)
jle 0x95e14
movq -0xd8(%rbp), %rax
movq %rax, -0xe8(%rbp)
jmp 0x960e4
cmpq $0x0, -0xd8(%rbp)
jne 0x95e3b
cmpq $0x0, -0xd0(%rbp)
jle 0x95e3b
movq -0xd0(%rbp), %rax
movq %rax, -0xe8(%rbp)
jmp 0x960e2
movq 0x30(%rbp), %rdi
movq 0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %r9
movq -0x40(%rbp), %rax
movq -0x80(%rbp), %rcx
movq %rcx, -0x298(%rbp)
movq -0x78(%rbp), %rcx
movq %rcx, -0x290(%rbp)
movq -0x90(%rbp), %r13
movq -0x88(%rbp), %r12
movq 0x28(%rbp), %r15
movq 0x18(%rbp), %r14
movq 0x20(%rbp), %rbx
movq -0xc8(%rbp), %r11
movq -0x50(%rbp), %r10
movq 0x28(%rbp), %rcx
movq %rcx, -0x288(%rbp)
movsd -0x60(%rbp), %xmm0
xorl %ecx, %ecx
movl %ecx, %r8d
movq %r8, %rcx
movq %rax, (%rsp)
movq -0x298(%rbp), %rax
movq %rax, 0x8(%rsp)
movq -0x290(%rbp), %rax
movq %rax, 0x10(%rsp)
movq -0x288(%rbp), %rax
movq %r13, 0x18(%rsp)
movq %r12, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movq %r15, 0x30(%rsp)
movq %r14, 0x38(%rsp)
movq %rbx, 0x40(%rsp)
movq %r11, 0x48(%rsp)
movq %r10, 0x50(%rsp)
movq %rax, 0x58(%rsp)
movq $0xc00, 0x60(%rsp)      # imm = 0xC00
movq $0x3ff, 0x68(%rsp)      # imm = 0x3FF
movq $0x100, 0x70(%rsp)      # imm = 0x100
movq $-0x1, 0x78(%rsp)
movq $0x0, 0x80(%rsp)
movq $0x0, 0x88(%rsp)
callq 0x8e630
cmpq $0x0, %rax
je 0x95f8f
movq -0x50(%rbp), %rax
movslq 0x2c(%rax), %rax
movq %rax, -0xe8(%rbp)
movq -0x50(%rbp), %rax
movslq 0x1c(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x50(%rbp), %rax
movl 0x20(%rax), %eax
addl $0x1, %eax
cltq
movq %rax, -0x78(%rbp)
movq -0x50(%rbp), %rax
movslq 0x10(%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x50(%rbp), %rax
movl 0x14(%rax), %eax
addl $0x1, %eax
cltq
movq %rax, -0x88(%rbp)
jmp 0x960e0
cmpq $0x200, -0xd0(%rbp) # imm = 0x200
jg 0x95fe3
movq -0xd0(%rbp), %rax
cmpq -0xd8(%rbp), %rax
jl 0x95fbc
movq -0xd0(%rbp), %rax
movq %rax, -0x2a0(%rbp)
jmp 0x95fca
movq -0xd8(%rbp), %rax
movq %rax, -0x2a0(%rbp)
movq -0x2a0(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x2a8(%rbp)
jmp 0x960c1
movq -0xd0(%rbp), %rax
cmpq -0xd8(%rbp), %rax
jg 0x96003
movq -0xd0(%rbp), %rax
movq %rax, -0x2b0(%rbp)
jmp 0x96011
movq -0xd8(%rbp), %rax
movq %rax, -0x2b0(%rbp)
movq -0x2b0(%rbp), %rax
cvtsi2sd %rax, %xmm0
cvtsi2sdq -0xd0(%rbp), %xmm1
movsd 0x2ec28a(%rip), %xmm2   # 0x3822b8
mulsd %xmm2, %xmm1
movsd 0x2ebfc6(%rip), %xmm2   # 0x382000
addsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x96088
movq -0xd0(%rbp), %rax
cmpq -0xd8(%rbp), %rax
jg 0x96064
movq -0xd0(%rbp), %rax
movq %rax, -0x2b8(%rbp)
jmp 0x96072
movq -0xd8(%rbp), %rax
movq %rax, -0x2b8(%rbp)
movq -0x2b8(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x2c0(%rbp)
jmp 0x960b1
cvtsi2sdq -0xd0(%rbp), %xmm0
movsd 0x2ec21f(%rip), %xmm1   # 0x3822b8
mulsd %xmm1, %xmm0
movsd 0x2ebf5b(%rip), %xmm1   # 0x382000
addsd %xmm1, %xmm0
movsd %xmm0, -0x2c0(%rbp)
movsd -0x2c0(%rbp), %xmm0
movsd %xmm0, -0x2a8(%rbp)
movsd -0x2a8(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0xe8(%rbp)
movq $0x0, -0xf0(%rbp)
jmp 0x960e2
jmp 0x960e4
jmp 0x960e6
movq 0x50(%rbp), %rax
movl 0x4(%rax), %eax
cmpq -0x80(%rbp), %rax
jle 0x96100
movq -0x80(%rbp), %rax
movl %eax, %ecx
movq 0x50(%rbp), %rax
movl %ecx, 0x4(%rax)
movq 0x50(%rbp), %rax
movl 0x8(%rax), %eax
cmpq -0x78(%rbp), %rax
jge 0x9611a
movq -0x78(%rbp), %rax
movl %eax, %ecx
movq 0x50(%rbp), %rax
movl %ecx, 0x8(%rax)
movq 0x50(%rbp), %rax
movl 0x10(%rax), %eax
cmpq -0x90(%rbp), %rax
jle 0x9613a
movq -0x90(%rbp), %rax
movl %eax, %ecx
movq 0x50(%rbp), %rax
movl %ecx, 0x10(%rax)
movq 0x50(%rbp), %rax
movl 0x14(%rax), %eax
cmpq -0x88(%rbp), %rax
jge 0x9615a
movq -0x88(%rbp), %rax
movl %eax, %ecx
movq 0x50(%rbp), %rax
movl %ecx, 0x14(%rax)
jmp 0x9615c
movq -0xe8(%rbp), %rax
movq -0xf0(%rbp), %rsi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0x1, %edx
cmpq $0x0, %rsi
cmovnel %edx, %ecx
movslq %ecx, %rcx
imulq %rcx, %rax
movl %eax, %ecx
movq 0x48(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0xe8(%rbp), %rax
addq -0xe0(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
movq 0x48(%rbp), %rcx
movl 0x28(%rcx), %ecx
movl %ecx, %edx
negl %edx
cmovnsl %edx, %ecx
movslq %ecx, %rcx
subq %rcx, %rax
movq 0x48(%rbp), %rcx
movl 0x24(%rcx), %ecx
movl %ecx, %edx
negl %edx
cmovnsl %edx, %ecx
movslq %ecx, %rcx
subq %rcx, %rax
movl %eax, %ecx
movq 0x48(%rbp), %rax
movl %ecx, 0x2c(%rax)
cmpq $0x3fffffff, -0xe0(%rbp) # imm = 0x3FFFFFFF
jg 0x96208
movq -0xe0(%rbp), %rax
movl %eax, %edx
movq 0x50(%rbp), %rax
movl 0x18(%rax), %ecx
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
andl $0xc0000000, %ecx       # imm = 0xC0000000
orl %edx, %ecx
movl %ecx, 0x18(%rax)
jmp 0x9621e
movq 0x50(%rbp), %rax
movl 0x18(%rax), %ecx
andl $0xc0000000, %ecx       # imm = 0xC0000000
orl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
movl %ecx, 0x18(%rax)
addq $0x328, %rsp            # imm = 0x328
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq