// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Correct.cpp
// Function: gen_backtrace_adv(window_list*, overlap_region*, All_reads*, hpc_t*, ul_idx_t const*, char*, char*, char*, Correct_dumy*, unsigned int, unsigned int)
inline uint32_t gen_backtrace_adv(window_list *p, overlap_region *z, All_reads *rref, hpc_t *hpc_g, const ul_idx_t *uref, 
char *qstr, char *tstr, char *tstr1, Correct_dumy* dumy, uint32_t rev, uint32_t id)
{
    int64_t qs, qe, ql, aln_l, t_pri_l, thres, ts; 
    int r_ts = 0, t_end; int64_t aux_beg, aux_end;
    char *q_string, *t_string; unsigned int error;
    ///there is no problem for x
    qs = p->x_start; qe = p->x_end; ql = qe + 1 - qs;
    thres = p->error_threshold; aln_l = ql + (thres<<1);

    ///y_start is the real y_start
    ///for the window with cigar, y_start has already reduced extra_begin
    ts = p->y_start; aux_beg = p->extra_begin; aux_end = p->extra_end;
    t_pri_l = aln_l - aux_beg - aux_end;

    q_string = qstr + qs; 
    if(rref) {
        fill_subregion(tstr, ts, t_pri_l, rev, rref, id, aux_beg, aux_end); t_string = tstr;
    } else {
        t_string = return_str_seq(tstr, ts, t_pri_l, rev, hpc_g, uref, id, aux_beg, aux_end);
    }
    
    t_end = Reserve_Banded_BPM_PATH(t_string, aln_l, q_string, ql, thres, &error, &r_ts,
        &(dumy->path_length), dumy->matrix_bit, dumy->path, p->error, p->y_end - ts);

    // assert(error != (unsigned int)-1);
    if(error != (unsigned int)-1) {
        /**
        bit_extz_t exz, exz64; init_bit_extz_t(&exz, thres); init_bit_extz_t(&exz64, thres);
        // ed_band_cal_extension_64_0_w(t_string+r_ts, t_end+1-r_ts, q_string, ql, thres, &exz64);
        // ed_band_cal_extension_64_0_w_trace(t_string+r_ts, t_end+1-r_ts, q_string, ql, thres, &exz64);
        // cigar_check(t_string+r_ts, q_string, &(exz64));
        // exz64.err = INT32_MAX;
        // ed_band_cal_extension_64_0_w_trace(t_string+r_ts, t_end+1-r_ts, q_string, ql, thres, &exz64);
        // cigar_check(t_string+r_ts, q_string, &(exz64));

        // ed_band_cal_extension_infi_0_w(t_string+r_ts, t_end+1-r_ts, q_string, ql, thres, NULL, &exz);
        // ed_band_cal_extension_infi_0_w_trace(t_string+r_ts, t_end+1-r_ts, q_string, ql, thres, NULL, &exz);
        // cigar_check(t_string+r_ts, q_string, &exz);
        // exz.err = INT32_MAX;
        // ed_band_cal_extension_infi_0_w_trace(t_string+r_ts, t_end+1-r_ts, q_string, ql, thres, NULL, &exz);
        // cigar_check(t_string+r_ts, q_string, &exz);
        // assert(exz.err <= (int32_t)error && exz.err >= 0); 
        // assert(exz.err == exz64.err && exz.ps == exz64.ps && exz.pe == exz64.pe && exz.ts == exz64.ts && exz.te == exz64.te);
        
        // ed_band_cal_extension_256_0_w(t_string+r_ts, t_end+1-r_ts, q_string, ql, thres, &exz);
        // ed_band_cal_extension_256_0_w_trace(t_string+r_ts, t_end+1-r_ts, q_string, ql, thres, &exz);
        // cigar_check(t_string+r_ts, q_string, &exz);
        // exz.err = INT32_MAX;
        // ed_band_cal_extension_256_0_w_trace(t_string+r_ts, t_end+1-r_ts, q_string, ql, thres, &exz);
        // cigar_check(t_string+r_ts, q_string, &exz);
        // assert(exz.err <= (int32_t)error && exz.err >= 0); 
        // assert(exz.err == exz64.err && exz.ps == exz64.ps && exz.pe == exz64.pe && exz.ts == exz64.ts && exz.te == exz64.te);

        // char *qr, *tr;
        // gen_rev_str(q_string, &qr, ql); gen_rev_str(t_string+r_ts, &tr, t_end+1-r_ts); 

        // ed_band_cal_extension_64_1_w(tr, t_end+1-r_ts, qr, ql, thres, &exz64);
        // ed_band_cal_extension_64_1_w_trace(tr, t_end+1-r_ts, qr, ql, thres, &exz64);
        // cigar_check(tr, qr, &exz64);
        // exz64.err = INT32_MAX;
        // ed_band_cal_extension_64_1_w_trace(tr, t_end+1-r_ts, qr, ql, thres, &exz64);
        // cigar_check(tr, qr, &exz64);
        // assert(exz.err == exz64.err && exz.ps == (exz64.pl-exz64.pe-1) && exz.pe == (exz64.pl-exz64.ps-1) && exz.ts == (exz64.tl-exz64.te-1) && exz.te == (exz64.tl-exz64.ts-1));

        // ed_band_cal_extension_infi_1_w(tr, t_end+1-r_ts, qr, ql, thres, NULL, &exz);
        // ed_band_cal_extension_infi_1_w_trace(tr, t_end+1-r_ts, qr, ql, thres, NULL, &exz);
        // cigar_check(tr, qr, &exz);
        // exz.err = INT32_MAX;
        // ed_band_cal_extension_infi_1_w_trace(tr, t_end+1-r_ts, qr, ql, thres, NULL, &exz);
        // cigar_check(tr, qr, &exz);
        // assert(exz.err == exz64.err && exz.ps == exz64.ps && exz.pe == exz64.pe && exz.ts == exz64.ts && exz.te == exz64.te);

        // ed_band_cal_extension_256_1_w(tr, t_end+1-r_ts, qr, ql, thres, &exz);
        // ed_band_cal_extension_256_1_w_trace(tr, t_end+1-r_ts, qr, ql, thres, &exz);
        // cigar_check(tr, qr, &exz);
        // exz.err = INT32_MAX;
        // ed_band_cal_extension_256_1_w_trace(tr, t_end+1-r_ts, qr, ql, thres, &exz);
        // cigar_check(tr, qr, &exz);
        // assert(exz.err == exz64.err && exz.ps == exz64.ps && exz.pe == exz64.pe && exz.ts == exz64.ts && exz.te == exz64.te);

        // free(qr); free(tr);


        // ed_band_cal_global_64_w(t_string+r_ts, t_end+1-r_ts, q_string, ql, thres, &exz64);
        // ed_band_cal_global_64_w_trace(t_string+r_ts, t_end+1-r_ts, q_string, ql, thres, &exz64);
        // cigar_check(t_string+r_ts, q_string, &(exz64));
        // exz64.err = INT32_MAX;
        // ed_band_cal_global_64_w_trace(t_string+r_ts, t_end+1-r_ts, q_string, ql, thres, &exz64);
        // cigar_check(t_string+r_ts, q_string, &(exz64));

        // ed_band_cal_global_infi_w(t_string+r_ts, t_end+1-r_ts, q_string, ql, thres, NULL, &exz);
        // ed_band_cal_global_infi_w_trace(t_string+r_ts, t_end+1-r_ts, q_string, ql, thres, NULL, &exz);
        // cigar_check(t_string+r_ts, q_string, &exz);
        // exz.err = INT32_MAX;
        // ed_band_cal_global_infi_w_trace(t_string+r_ts, t_end+1-r_ts, q_string, ql, thres, NULL, &exz);
        // cigar_check(t_string+r_ts, q_string, &exz);
        // assert(exz.err <= (int32_t)error && exz.err >= 0); 
        // assert(exz.err == exz64.err && exz.ps == exz64.ps && exz.pe == exz64.pe && exz.ts == exz64.ts && exz.te == exz64.te);

        // ed_band_cal_global_256_w(t_string+r_ts, t_end+1-r_ts, q_string, ql, thres, &exz);
        // ed_band_cal_global_256_w_trace(t_string+r_ts, t_end+1-r_ts, q_string, ql, thres, &exz);
        // cigar_check(t_string+r_ts, q_string, &exz);
        // exz.err = INT32_MAX;
        // ed_band_cal_global_256_w_trace(t_string+r_ts, t_end+1-r_ts, q_string, ql, thres, &exz);
        // cigar_check(t_string+r_ts, q_string, &exz);
        // assert(exz.err <= (int32_t)error && exz.err >= 0); 
        // assert(exz.err == exz64.err && exz.ps == exz64.ps && exz.pe == exz64.pe && exz.ts == exz64.ts && exz.te == exz64.te);

        
        // ed_band_cal_semi_64_w(t_string, aln_l, q_string, ql, thres, &exz64);
        // ed_band_cal_semi_64_w_trace(t_string, aln_l, q_string, ql, thres, &exz64);
        // cigar_check(t_string, q_string, &(exz64));
        // exz64.err = INT32_MAX;
        // ed_band_cal_semi_64_w_trace(t_string, aln_l, q_string, ql, thres, &exz64);
        // cigar_check(t_string, q_string, &(exz64));

        // ed_band_cal_semi_infi_w(t_string, aln_l, q_string, ql, thres, NULL, &exz);
        // ed_band_cal_semi_infi_w_trace(t_string, aln_l, q_string, ql, thres, NULL, &exz);
        // cigar_check(t_string, q_string, &exz);
        // exz.err = INT32_MAX;
        // ed_band_cal_semi_infi_w_trace(t_string, aln_l, q_string, ql, thres, NULL, &exz);
        // cigar_check(t_string, q_string, &exz);
        // assert(exz.err <= (int32_t)error && exz.err >= 0); 
        // assert(exz.err == exz64.err && exz.pe == exz64.pe && exz.ts == exz64.ts && exz.te == exz64.te);

        // ed_band_cal_semi_256_w(t_string, aln_l, q_string, ql, thres, &exz);
        // ed_band_cal_semi_256_w_trace(t_string, aln_l, q_string, ql, thres, &exz);
        // cigar_check(t_string, q_string, &exz);
        // exz.err = INT32_MAX;
        // ed_band_cal_semi_256_w_trace(t_string, aln_l, q_string, ql, thres, &exz);
        // cigar_check(t_string, q_string, &exz);
        // assert(exz.err <= (int32_t)error && exz.err >= 0); 
        // assert(exz.err == exz64.err && exz.pe == exz64.pe && exz.ts == exz64.ts && exz.te == exz64.te);



        ed_band_cal_semi_64_w_absent_diag(t_string+aux_beg, aln_l-aux_beg-aux_end, q_string, ql, 
                                                                                thres, aux_beg, &exz64);
        // ed_band_cal_semi_64_w_absent_diag_trace(t_string+aux_beg, aln_l-aux_beg-aux_end, q_string, ql, 
        //                                                                         thres, aux_beg, &exz64);
        // cigar_check(t_string+aux_beg, q_string, &(exz64));
        // exz64.err = INT32_MAX;
        // ed_band_cal_semi_64_w_absent_diag_trace(t_string+aux_beg, aln_l-aux_beg-aux_end, q_string, ql, 
        //                                                                         thres, aux_beg, &exz64);
        // cigar_check(t_string+aux_beg, q_string, &(exz64));



        ed_band_cal_semi_infi_w_absent_diag(t_string+aux_beg, aln_l-aux_beg-aux_end, q_string, ql, 
                                                                                thres, aux_beg, NULL, &exz);
        ed_band_cal_semi_infi_w_absent_diag_trace(t_string+aux_beg, aln_l-aux_beg-aux_end, q_string, ql, 
                                                                                thres, aux_beg, NULL, &exz);
        cigar_check(t_string+aux_beg, q_string, &(exz));
        exz.err = INT32_MAX;
        ed_band_cal_semi_infi_w_absent_diag_trace(t_string+aux_beg, aln_l-aux_beg-aux_end, q_string, ql, 
                                                                                thres, aux_beg, NULL, &exz);
        cigar_check(t_string+aux_beg, q_string, &(exz));
        assert(exz.err <= (int32_t)error && exz.err >= 0); 
        assert(exz.err == exz64.err && exz.pe == exz64.pe && exz.ts == exz64.ts && exz.te == exz64.te);
        exz64.err = exz.err; exz64.ps = exz.ps; exz64.pe = exz.pe; exz64.ts = exz.ts; exz64.te = exz.te;


        ed_band_cal_semi_256_w_absent_diag(t_string+aux_beg, aln_l-aux_beg-aux_end, q_string, ql, 
                                                                                thres, aux_beg, &exz);
        ed_band_cal_semi_256_w_absent_diag_trace(t_string+aux_beg, aln_l-aux_beg-aux_end, q_string, ql, 
                                                                                thres, aux_beg, &exz);
        cigar_check(t_string+aux_beg, q_string, &(exz));
        exz.err = INT32_MAX;
        ed_band_cal_semi_256_w_absent_diag_trace(t_string+aux_beg, aln_l-aux_beg-aux_end, q_string, ql, 
                                                                                thres, aux_beg, &exz);
        cigar_check(t_string+aux_beg, q_string, &(exz));
        assert(exz.err <= (int32_t)error && exz.err >= 0); 
        assert(exz.err == exz64.err && exz.ps == exz64.ps && exz.pe == exz64.pe && exz.ts == exz64.ts && exz.te == exz64.te);
        // if((!(exz.err == exz64.err && exz.ps == exz64.ps && exz.pe == exz64.pe && exz.ts == exz64.ts && exz.te == exz64.te)) || (exz.err != (int32_t)error)) {
        //     fprintf(stderr, "\n[M::%s::semi] error::%u, ql::%ld, thres::%ld, exz.err::%d, exz64.err::%d, exz.ps::%d, exz64.ps::%d, exz.pe::%d, exz64.pe::%d, exz.ts::%d, exz64.ts::%d, exz.te::%d, exz64.te::%d\n", __func__, 
        //     error, ql, thres, exz.err, exz64.err, exz.ps, exz64.ps, exz.pe, exz64.pe, exz.ts, exz64.ts, exz.te, exz64.te);
        //     fprintf(stderr, "[tstr] %.*s\n", (int32_t)aln_l, t_string);
        //     fprintf(stderr, "[qstr] %.*s\n", (int32_t)ql, q_string);
        // }
        destroy_bit_extz_t(&exz); destroy_bit_extz_t(&exz64);

        // if(exz.err > (int32_t)error && ql == 1) {
        //     fprintf(stderr, "[M::%s::] error::%u, ed_extension::%d, ql::%ld, thres::%ld\n", 
        //     __func__, error, exz.err, ql, thres);
        //     fprintf(stderr, "[tstr] %.*s\n", t_end+1-r_ts, t_string+r_ts);
        //     fprintf(stderr, "[qstr] %.*s\n", (int32_t)ql, q_string);
        // }
        
        // assert(ed_band_cal_global(t_string+r_ts, t_end+1-r_ts, q_string, ql, thres) == 
        //                 ed_band_cal_global_128bit(t_string+r_ts, t_end+1-r_ts, q_string, ql, thres));
        **/
        
        ///this condition is always wrong
        ///in best case, r_ts = threshold, t_end = aln_l - thres - 1
        if (((t_end+1) == aln_l) || (r_ts == 0)) {
            if(recal_boundary(q_string, tstr1, ql, thres, ts, r_ts, t_end,
            aux_beg, aux_end, error, id, aln_l, rev, dumy, rref, hpc_g, uref, 
            &ts, &r_ts, &t_end, &aux_beg, &aux_end, &error)) {
                p->error = error; p->extra_begin = aux_beg; p->extra_end = aux_end;
                t_string = update_des_str(tstr, ts, aln_l-aux_beg-aux_end, rev, rref, hpc_g, uref,
                                                    id, aux_beg, aux_end, hpc_g?NULL:tstr1);
            }
        }

        generate_cigar(dumy->path, dumy->path_length, p, &(z->w_list), &r_ts, &t_end, &error, q_string, ql, t_string);    

        p->y_start = ts + r_ts - aux_beg; 
        p->y_end = ts + t_end - aux_beg;
        p->error = error;         
        return 1;                     
    }
    p->error = -1;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %r8, 0x40(%rsp)
movq %rdx, %r8
movq %rsi, 0x80(%rsp)
movq %rdi, %rbx
movl $0x0, 0x14(%rsp)
movslq (%rdi), %rax
movslq 0x4(%rdi), %rdx
subq %rax, %rdx
movswq 0x16(%rdi), %rsi
movq %rsi, 0x20(%rsp)
leaq (%rdx,%rsi,2), %r13
incq %r13
movslq 0x8(%rdi), %r12
movq %r12, 0x38(%rsp)
movswq 0x10(%rdi), %r14
movq %r14, 0x58(%rsp)
movswq 0x12(%rdi), %rbp
movq %r13, 0x28(%rsp)
subq %r14, %r13
subq %rbp, %r13
movl 0xe0(%rsp), %r10d
addq %rax, %r9
movq %r9, 0x50(%rsp)
movl 0xd8(%rsp), %esi
incq %rdx
movq %rdx, 0x48(%rsp)
movq %rbp, 0x68(%rsp)
movq 0xc0(%rsp), %r15
testq %r8, %r8
movq %r8, 0x60(%rsp)
movq %rcx, 0x70(%rsp)
je 0x8ae1e
movq %rbx, 0x8(%rsp)
movq %r15, %rbx
addq %r14, %r15
movzbl %sil, %ecx
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r10, %r9
callq 0x337f7
movq %rbx, %rdi
movl $0x4e, %esi
movq %r14, %rdx
callq 0x20e0
addq %r13, %r15
movq %r15, %rdi
movl $0x4e, %esi
movq %rbp, %rdx
callq 0x20e0
movq %rbx, %rdi
movq 0x8(%rsp), %rbx
movq 0xd0(%rsp), %rcx
leaq 0x7d70(%rcx), %r14
leaq 0xff0(%rcx), %rax
leaq 0xa14(%rcx), %r13
movswl 0x14(%rbx), %r10d
movl 0xc(%rbx), %r11d
subl 0x38(%rsp), %r11d
leaq 0x14(%rsp), %r15
movzwl 0x20(%rsp), %r8d
leaq 0x10(%rsp), %rbp
movq %rdi, 0x18(%rsp)
movq 0x28(%rsp), %r12
movl %r12d, %esi
movq 0x50(%rsp), %rdx
movq 0x48(%rsp), %rcx
movq %rbp, %r9
pushq %r11
pushq %r10
movq %r13, 0x88(%rsp)
pushq %r13
movq %r14, %r13
movq %r15, %r14
pushq %rax
pushq %r13
pushq %r15
callq 0x8607d
addq $0x30, %rsp
movl %eax, 0x34(%rsp)
movl (%rbp), %r10d
cmpl $-0x1, %r10d
je 0x8ae4b
leal 0x1(%rax), %ecx
movslq %ecx, %rcx
cmpq %rcx, %r12
sete %dl
movl 0x14(%rsp), %ecx
testl %ecx, %ecx
sete %sil
orb %dl, %sil
cmpb $0x1, %sil
jne 0x8b02c
movq 0xc8(%rsp), %rsi
movslq %ecx, %r9
leaq 0x38(%rsp), %rbp
movq (%rbp), %r8
cltq
movq %rax, 0x8(%rsp)
leaq 0x58(%rsp), %r11
leaq 0x68(%rsp), %r15
movl 0xe0(%rsp), %ecx
movl %ecx, %eax
subq $0x8, %rsp
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rdx
movq 0x28(%rsp), %rcx
leaq 0x18(%rsp), %r12
pushq %r12
pushq %r15
pushq %r11
movq %r11, %r12
leaq 0x54(%rsp), %r11
pushq %r11
pushq %r14
pushq %rbp
movq 0x60(%rsp), %rbp
pushq 0x78(%rsp)
movq 0xb0(%rsp), %r14
pushq %r14
pushq 0xa8(%rsp)
pushq 0x120(%rsp)
movl 0x130(%rsp), %r11d
pushq %r11
pushq %rbp
movq %rax, 0x88(%rsp)
pushq %rax
pushq %r10
pushq (%r15)
pushq (%r12)
pushq 0x90(%rsp)
callq 0x9b9c1
addq $0x90, %rsp
testl %eax, %eax
je 0x8b02c
movq %r14, %rcx
movzwl 0x10(%rsp), %eax
movw %ax, 0x14(%rbx)
movq 0x58(%rsp), %r14
movw %r14w, 0x10(%rbx)
movq 0x68(%rsp), %rsi
movw %si, 0x12(%rbx)
xorl %eax, %eax
testq %rcx, %rcx
cmoveq 0xc8(%rsp), %rax
movq %rax, 0x18(%rsp)
testq %rax, %rax
jne 0x8b02c
movq 0x38(%rsp), %r9
subq %r14, %rbp
subq %rsi, %rbp
movq 0x60(%rsp), %r8
testq %r8, %r8
je 0x8af17
movslq %r14d, %r14
movq %rbx, 0x8(%rsp)
movq 0xc0(%rsp), %rbx
leaq (%rbx,%r14), %r15
movl 0xd8(%rsp), %eax
movzbl %al, %ecx
movq %r15, %rdi
movq %rsi, %r12
movq %r9, %rsi
movq %rbp, %rdx
movq 0x20(%rsp), %r9
callq 0x337f7
movq %rbx, %rdi
movl $0x4e, %esi
movq %r14, %rdx
callq 0x20e0
addq %rbp, %r15
movslq %r12d, %rdx
movq %r15, %rdi
movl $0x4e, %esi
callq 0x20e0
movq %rbx, 0x18(%rsp)
movq 0x8(%rsp), %rbx
jmp 0x8b02c
testq %rcx, %rcx
je 0x8ae56
movq (%rcx), %rax
movq 0x10(%rax), %rax
leaq (%r10,%r10,4), %rdx
movq 0x20(%rax,%rdx,8), %rdi
testb %sil, %sil
je 0x8aec3
leaq (%rax,%rdx,8), %rax
movl (%rax), %eax
shrl %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
jmp 0x8aec5
xorl %eax, %eax
movw $0xffff, %cx            # imm = 0xFFFF
jmp 0x8b094
movq %r15, %rdi
movl $0x4e, %esi
movq %r14, %rdx
callq 0x20e0
addq %r15, %r14
movq 0x40(%rsp), %rax
movq (%rax), %rax
movl 0xe0(%rsp), %ecx
leaq (%rcx,%rcx,4), %rdx
shlq $0x3, %rdx
addq 0x10(%rax), %rdx
subq $0x8, %rsp
movl 0xe0(%rsp), %eax
movzbl %al, %ecx
xorl %edi, %edi
movq %r14, %rsi
movq %r12, %r8
movq %r13, %r9
pushq $0x0
callq 0x36b0d
addq $0x10, %rsp
addq %r13, %r14
movq %r14, %rdi
movl $0x4e, %esi
movq %rbp, %rdx
callq 0x20e0
movq %r15, %rdi
jmp 0x8ac06
xorl %eax, %eax
addq %rax, %rdi
movq %rbp, %rax
orq %r14, %rax
je 0x8af0f
movq %rbx, 0x8(%rsp)
movq 0xc0(%rsp), %rbx
movq %rdi, %r15
movq %rbx, %rdi
movl $0x4e, %esi
movq %r14, %rdx
callq 0x20e0
addq %rbx, %r14
addq %r12, %r15
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x2160
addq %r13, %r14
movq %r14, %rdi
jmp 0x8abf1
addq %r12, %rdi
jmp 0x8ac06
testq %rcx, %rcx
movl 0xd8(%rsp), %edx
je 0x8af4f
movq (%rcx), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rcx
leaq (%rcx,%rcx,4), %rcx
movq 0x20(%rax,%rcx,8), %r15
testb %dl, %dl
je 0x8afc6
leaq (%rax,%rcx,8), %rax
movl (%rax), %eax
shrl %eax
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
jmp 0x8afc8
movq 0xc0(%rsp), %r15
movq %r15, %rdi
movq %rsi, %r12
movl $0x4e, %esi
movq %r14, %rdx
movq %r9, 0x28(%rsp)
callq 0x20e0
addq %r15, %r14
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
leaq (%rcx,%rcx,4), %rdx
shlq $0x3, %rdx
addq 0x10(%rax), %rdx
subq $0x8, %rsp
movl 0xe0(%rsp), %eax
movzbl %al, %ecx
xorl %edi, %edi
movq %r14, %rsi
movq 0x30(%rsp), %r8
movq %rbp, %r9
pushq $0x0
callq 0x36b0d
addq $0x10, %rsp
addq %rbp, %r14
movq %r14, %rdi
movl $0x4e, %esi
movq %r12, %rdx
callq 0x20e0
jmp 0x8b027
xorl %eax, %eax
addq %rax, %r15
movq %rsi, %rax
orq %r14, %rax
je 0x8b024
movq %rbp, %r12
movq %rbx, 0x8(%rsp)
movq 0xc0(%rsp), %rbx
movq %rbx, %rdi
movq %rsi, 0x28(%rsp)
movl $0x4e, %esi
movq %r14, %rdx
movq %r9, %rbp
callq 0x20e0
addq %rbx, %r14
addq %rbp, %r15
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2160
addq %r12, %r14
movq %r14, %rdi
movl $0x4e, %esi
movq 0x28(%rsp), %rdx
jmp 0x8ae0a
addq %r9, %r15
movq %r15, 0x18(%rsp)
movl (%r13), %esi
movq 0x80(%rsp), %rcx
addq $0x48, %rcx
leaq 0x14(%rsp), %r14
leaq 0x34(%rsp), %r12
movq 0x78(%rsp), %rdi
movq %rbx, %rdx
movq %r14, %r8
movq %r12, %r9
pushq 0x18(%rsp)
pushq 0x50(%rsp)
pushq 0x60(%rsp)
leaq 0x28(%rsp), %rax
pushq %rax
callq 0x8663c
addq $0x20, %rsp
movl 0x38(%rsp), %eax
movl (%r14), %ecx
addl %eax, %ecx
movl 0x58(%rsp), %edx
subl %edx, %ecx
movl %ecx, 0x8(%rbx)
subl %edx, %eax
addl (%r12), %eax
movl %eax, 0xc(%rbx)
movzwl 0x10(%rsp), %ecx
movl $0x1, %eax
movw %cx, 0x14(%rbx)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq