// File: chhylp123[P]hifiasm/ecovlp.cpp
// Function: h_ec_lchain_re(ha_abuf_s*, unsigned int, char*, unsigned long, UC_Read*, unsigned long, unsigned long, All_reads*, overlap_region_alloc*, Candidates_list*, bit_extz_t*, asg16_v*, double, int, kvec_t_u8_warp*, kvec_t_u64_warp*, st_mt_t*, unsigned int*, unsigned int*, unsigned int, unsigned int, long, double, unsigned int, ma_hit_t_alloc*, ma_hit_t_alloc*)
overlap_region* h_ec_lchain_re(ha_abuf_t *ab, uint32_t rid, char* rs, uint64_t rl, UC_Read *tu, uint64_t mz_w, uint64_t mz_k, All_reads *rref, overlap_region_alloc *ol, Candidates_list *cl, bit_extz_t *exz, asg16_v* buf, double bw_thres, 
								 int apend_be, kvec_t_u8_warp* k_flag, kvec_t_u64_warp* dbg_ct, st_mt_t *sp, uint32_t *high_occ, uint32_t *low_occ, uint32_t is_accurate, uint32_t gen_off, int64_t enable_mcopy, double mcopy_rate, uint32_t mcopy_khit_cut, ma_hit_t_alloc *in0, ma_hit_t_alloc *in1)
{
    // fprintf(stderr, "-mm-[M::%s]\tchain_cutoff::%u\n", __func__, chain_cutoff);
    uint64_t on = 0, k, ol0, wl = (asm_opt.is_ont)?(WINDOW_OHC):(WINDOW_HC), m; ma_hit_t *oa = NULL; overlap_region *z = NULL, *aux_o = NULL, t; Window_Pool w; double err = asm_opt.max_ov_diff_ec;

    int64_t max_skip, max_iter, max_dis, quick_check; double chn_pen_gap, chn_pen_skip; 
	set_lchain_dp_op(is_accurate, mz_k, &max_skip, &max_iter, &max_dis, &chn_pen_gap, &chn_pen_skip, &quick_check);

    init_Window_Pool(&w, rl, wl, (int)(1.0/err));

    on = in0->length + in1->length + 1;
    clear_overlap_region_alloc(ol); 
    clear_Candidates_list(cl); 
    if(on > ol->size) {
        REALLOC(ol->list, on);
        memset(ol->list+ol->size, 0, sizeof(overlap_region)*(on-ol->size));
        ol->size = on;   
    }
    on = in0->length + in1->length; aux_o = &(ol->list[on]);
    ol->length = 0; ol->mapped_overlaps_length = 0; m = 0;
    

    // get the list of anchors
    get_mz1(rs, rl, mz_w, mz_k, 0, !(asm_opt.flag & HA_F_NO_HPC), ab, ha_flt_tab, ha_idx, asm_opt.mz_sample_dist, k_flag, dbg_ct, NULL, -1, asm_opt.dp_min_len, -1, sp, asm_opt.mz_rewin, 0, NULL, 0);

    oa = in0->buffer; on = in0->length;
    for (k = 0; k < on; k++) {
        ol0 = ol->length;
        if(oa[k].el) {
            z = &(ol->list[ol->length++]);
            z->x_id = rid; z->y_id = oa[k].tn;
            z->x_pos_strand = 0; z->y_pos_strand = oa[k].rev;
            z->x_pos_s = (uint32_t)oa[k].qns;
            z->x_pos_e = oa[k].qe - 1;
            z->y_pos_s = oa[k].ts;
            z->y_pos_e = oa[k].te - 1;

            z->is_match = 1;
            z->align_length = z->overlapLen = z->shared_seed = z->x_pos_e + 1 - z->x_pos_s;
            z->non_homopolymer_errors = z->strong = 0;

            set_exact_exz(exz, z->x_pos_s, z->x_pos_e + 1, z->y_pos_s, z->y_pos_e + 1); push_alnw(z, exz);

            // if(oa[k].tn == 15382) fprintf(stderr, "-em-[M::%s]\tqn::%u\ttn::%u\terr::%u\n", __func__, rid, oa[k].tn, ol->list[ol->length-1].non_homopolymer_errors);
        } else {
            if(oa[k].rev) recover_UC_Read_RC(tu, rref, oa[k].tn);
            else recover_UC_Read(tu, rref, oa[k].tn);

            get_pi_ec_chain(ab, rid, rl, oa[k].tn, tu->seq, tu->length, mz_w, mz_k, ol, cl, bw_thres, apend_be, k_flag, dbg_ct, sp, high_occ, low_occ, gen_off, enable_mcopy, mcopy_rate, mcopy_khit_cut, max_skip, max_iter, max_dis, quick_check, chn_pen_gap, chn_pen_skip);
            assert(ol->length - ol0 <= 1);
            if((ol->length > ol0) && (gen_hc_r_alin_re(&(ol->list[ol0]), cl, rs, rl, tu->seq, tu->length, exz, aux_o, asm_opt.max_ov_diff_ec, w.window_length, rid, E_KHIT, 1, buf))) {
                ol->list[ol0].y_pos_strand = oa[k].rev;
                // if(oa[k].tn == 15382) fprintf(stderr, "-mm-[M::%s]\tqn::%u\ttn::%u\terr::%u\n", __func__, rid, oa[k].tn, ol->list[ol->length-1].non_homopolymer_errors);
            } 
        }

        if((ol->length <= ol0) || (ol->list[ol0].is_match != 1)) continue;

        if(m != ol0) {
            t = ol->list[m];
            ol->list[m] = ol->list[ol0];
            ol->list[ol0] = t;
        }

        m++;
    }


    oa = in1->buffer; on = in1->length;
    for (k = 0; k < on; k++) {
        ol0 = ol->length;

        if(oa[k].rev) recover_UC_Read_RC(tu, rref, oa[k].tn);
        else recover_UC_Read(tu, rref, oa[k].tn);

        get_pi_ec_chain(ab, rid, rl, oa[k].tn, tu->seq, tu->length, mz_w, mz_k, ol, cl, bw_thres, apend_be, k_flag, dbg_ct, sp, high_occ, low_occ, gen_off, enable_mcopy, mcopy_rate, mcopy_khit_cut, max_skip, max_iter, max_dis, quick_check, chn_pen_gap, chn_pen_skip);
        assert(ol->length - ol0 <= 1);
        if((ol->length > ol0) && (gen_hc_r_alin_re(&(ol->list[ol0]), cl, rs, rl, tu->seq, tu->length, exz, aux_o, asm_opt.max_ov_diff_ec, w.window_length, rid, E_KHIT, 1, buf))) {
            ol->list[ol0].y_pos_strand = oa[k].rev;
            // if(oa[k].tn == 15382) fprintf(stderr, "-mm-[M::%s]\tqn::%u\ttn::%u\terr::%u\n", __func__, rid, oa[k].tn, ol->list[ol->length-1].non_homopolymer_errors);
        } 

        if((ol->length <= ol0) || (ol->list[ol0].is_match != 1)) continue;

        if(m != ol0) {
            t = ol->list[m];
            ol->list[m] = ol->list[ol0];
            ol->list[ol0] = t;
        }
        
        m++;
    }

    ol->length = m;
    
    // fprintf(stderr, "[M::%s]\tnew_n::%lu\told_n::%u\n", __func__, ol->length, in0->length + in1->length);
    assert(ol->length <= (in0->length + in1->length));


    // dbg_overlap_region_cigar(ol->list, ol->length, rs, rref, tu);


    return aux_o;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2d8, %rsp            # imm = 0x2D8
movq 0x98(%rbp), %rax
movq 0x90(%rbp), %rax
movl 0x88(%rbp), %eax
movq 0x80(%rbp), %rax
movl 0x78(%rbp), %eax
movl 0x70(%rbp), %eax
movq 0x68(%rbp), %rax
movq 0x60(%rbp), %rax
movq 0x58(%rbp), %rax
movq 0x50(%rbp), %rax
movq 0x48(%rbp), %rax
movl 0x40(%rbp), %eax
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)
movl %esi, -0x34(%rbp)
movq %rdx, -0x40(%rbp)
movq %rcx, -0x48(%rbp)
movq %r8, -0x50(%rbp)
movq %r9, -0x58(%rbp)
movsd %xmm0, -0x60(%rbp)
movsd %xmm1, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
leaq 0x167754(%rip), %rax    # 0x3c47f8
movq 0x2a8(%rax), %rdx
movl $0x307, %eax            # imm = 0x307
movl $0x177, %ecx            # imm = 0x177
cmpq $0x0, %rdx
cmovnel %ecx, %eax
cltq
movq %rax, -0x88(%rbp)
movq $0x0, -0x98(%rbp)
movq $0x0, -0xa0(%rbp)
movq $0x0, -0xa8(%rbp)
leaq 0x16770b(%rip), %rax    # 0x3c47f8
movsd 0xc0(%rax), %xmm0
movsd %xmm0, -0x190(%rbp)
movl 0x70(%rbp), %edi
movq 0x10(%rbp), %rax
movl %eax, %esi
leaq -0x198(%rbp), %rdx
leaq -0x1a0(%rbp), %rcx
leaq -0x1a8(%rbp), %r8
leaq -0x1b8(%rbp), %r9
leaq -0x1c0(%rbp), %r10
leaq -0x1b0(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x1aca80
movq -0x48(%rbp), %rsi
movq -0x88(%rbp), %rdx
movsd 0x124eaf(%rip), %xmm0   # 0x382000
divsd -0x190(%rbp), %xmm0
cvttsd2si %xmm0, %eax
movslq %eax, %rcx
leaq -0x188(%rbp), %rdi
callq 0x9f470
movq 0x90(%rbp), %rax
movl 0xc(%rax), %eax
movq 0x98(%rbp), %rcx
addl 0xc(%rcx), %eax
addl $0x1, %eax
movl %eax, %eax
movq %rax, -0x70(%rbp)
movq 0x20(%rbp), %rdi
callq 0x1e120
movq 0x28(%rbp), %rdi
callq 0x23090
movq -0x70(%rbp), %rax
movq 0x20(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jbe 0x25d203
movq 0x20(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x70(%rbp), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x20(%rbp), %rax
movq %rcx, (%rax)
movq 0x20(%rbp), %rax
movq (%rax), %rdi
movq 0x20(%rbp), %rax
imulq $0xa8, 0x8(%rax), %rax
addq %rax, %rdi
movq -0x70(%rbp), %rax
movq 0x20(%rbp), %rcx
subq 0x8(%rcx), %rax
imulq $0xa8, %rax, %rdx
xorl %esi, %esi
callq 0x2100
movq -0x70(%rbp), %rcx
movq 0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x90(%rbp), %rax
movl 0xc(%rax), %eax
movq 0x98(%rbp), %rcx
addl 0xc(%rcx), %eax
movl %eax, %eax
movq %rax, -0x70(%rbp)
movq 0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x70(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
movq 0x20(%rbp), %rax
movq $0x0, 0x10(%rax)
movq 0x20(%rbp), %rax
movq $0x0, 0x18(%rax)
movq $0x0, -0x90(%rbp)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rax
movl %eax, %esi
movq -0x58(%rbp), %rax
movl %eax, %edx
movq 0x10(%rbp), %rax
movl %eax, %ecx
leaq 0x167582(%rip), %rax    # 0x3c47f8
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %r9d
movq -0x30(%rbp), %rax
movq %rax, -0x1d0(%rbp)
leaq 0x168235(%rip), %rax    # 0x3c54d0
movq (%rax), %r13
leaq 0x168233(%rip), %rax    # 0x3c54d8
movq (%rax), %r12
leaq 0x167549(%rip), %rax    # 0x3c47f8
movl 0xa8(%rax), %r15d
movq 0x48(%rbp), %r14
movq 0x50(%rbp), %rbx
leaq 0x167533(%rip), %rax    # 0x3c47f8
movl 0x1f8(%rax), %r11d
movq 0x58(%rbp), %r10
leaq 0x167521(%rip), %rax    # 0x3c47f8
movl 0xa0(%rax), %eax
movl %eax, -0x1c4(%rbp)
xorl %r8d, %r8d
xorl %eax, %eax
movq -0x1d0(%rbp), %rax
movss 0x121d79(%rip), %xmm0   # 0x37f070
movq %rax, (%rsp)
movl -0x1c4(%rbp), %eax
movq %r13, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movl %r15d, 0x18(%rsp)
movq %r14, 0x20(%rsp)
movq %rbx, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movl $0xffffffff, 0x38(%rsp) # imm = 0xFFFFFFFF
movl %r11d, 0x40(%rsp)
movq %r10, 0x48(%rsp)
movl %eax, 0x50(%rsp)
movl $0x0, 0x58(%rsp)
movq $0x0, 0x60(%rsp)
movq $0x0, 0x68(%rsp)
callq 0x1b3940
movq 0x90(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x98(%rbp)
movq 0x90(%rbp), %rax
movl 0xc(%rax), %eax
movq %rax, -0x70(%rbp)
movq $0x0, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpq -0x70(%rbp), %rax
jae 0x25d928
movq 0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x98(%rbp), %rax
imulq $0x28, -0x78(%rbp), %rcx
addq %rcx, %rax
cmpb $0x0, 0x20(%rax)
je 0x25d564
movq 0x20(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rbp), %rdx
movq 0x10(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x10(%rdx)
imulq $0xa8, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movl -0x34(%rbp), %ecx
movq -0xa0(%rbp), %rax
movl %ecx, (%rax)
movq -0x98(%rbp), %rax
imulq $0x28, -0x78(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
movq -0xa0(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0xa0(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x98(%rbp), %rax
imulq $0x28, -0x78(%rbp), %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %ecx
movq -0xa0(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x98(%rbp), %rax
imulq $0x28, -0x78(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, %ecx
movq -0xa0(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x98(%rbp), %rax
imulq $0x28, -0x78(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
subl $0x1, %ecx
movq -0xa0(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x98(%rbp), %rax
imulq $0x28, -0x78(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %ecx
movq -0xa0(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x98(%rbp), %rax
imulq $0x28, -0x78(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %ecx
subl $0x1, %ecx
movq -0xa0(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0xa0(%rbp), %rax
movb $0x1, 0x2c(%rax)
movq -0xa0(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movq -0xa0(%rbp), %rax
subl 0x4(%rax), %ecx
movq -0xa0(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0xa0(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0xa0(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0xa0(%rbp), %rax
movb $0x0, 0x2e(%rax)
movq -0xa0(%rbp), %rax
movl $0x0, 0x30(%rax)
movq 0x30(%rbp), %rdi
movq -0xa0(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, %esi
movq -0xa0(%rbp), %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
movq -0xa0(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, %ecx
movq -0xa0(%rbp), %rax
movl 0x18(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %r8d
callq 0x61ae0
movq -0xa0(%rbp), %rdi
movq 0x30(%rbp), %rsi
callq 0x60af0
jmp 0x25d850
movq -0x98(%rbp), %rax
imulq $0x28, -0x78(%rbp), %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
cmpl $0x0, %eax
je 0x25d5a7
movq -0x50(%rbp), %rdi
movq 0x18(%rbp), %rsi
movq -0x98(%rbp), %rax
imulq $0x28, -0x78(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, %edx
callq 0xa500
jmp 0x25d5c8
movq -0x50(%rbp), %rdi
movq 0x18(%rbp), %rsi
movq -0x98(%rbp), %rax
imulq $0x28, -0x78(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, %edx
callq 0xa380
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %eax
movl %eax, %esi
movq -0x48(%rbp), %rdx
movq -0x98(%rbp), %rax
imulq $0x28, -0x78(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
movq -0x50(%rbp), %rax
movq (%rax), %r8
movq -0x50(%rbp), %rax
movq 0x8(%rax), %r9
movq -0x58(%rbp), %rax
movq %rax, -0x220(%rbp)
movq 0x10(%rbp), %rax
movq %rax, -0x218(%rbp)
movq 0x20(%rbp), %rax
movq %rax, -0x210(%rbp)
movq 0x28(%rbp), %rax
movq %rax, -0x208(%rbp)
movsd -0x60(%rbp), %xmm0
movl 0x40(%rbp), %eax
movl %eax, -0x1fc(%rbp)
movq 0x48(%rbp), %rax
movq %rax, -0x1f8(%rbp)
movq 0x50(%rbp), %rax
movq %rax, -0x1f0(%rbp)
movq 0x58(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movq 0x60(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movq 0x68(%rbp), %r13
movl 0x78(%rbp), %r12d
movq 0x80(%rbp), %r15
movsd -0x68(%rbp), %xmm1
movl 0x88(%rbp), %r14d
movq -0x198(%rbp), %rbx
movq -0x1a0(%rbp), %r11
movq -0x1a8(%rbp), %r10
movq -0x1b0(%rbp), %rax
movq %rax, -0x1d8(%rbp)
movq -0x220(%rbp), %rax
movsd -0x1b8(%rbp), %xmm2
movsd -0x1c0(%rbp), %xmm3
movq %rax, (%rsp)
movq -0x218(%rbp), %rax
movq %rax, 0x8(%rsp)
movq -0x210(%rbp), %rax
movq %rax, 0x10(%rsp)
movq -0x208(%rbp), %rax
movq %rax, 0x18(%rsp)
movl -0x1fc(%rbp), %eax
movl %eax, 0x20(%rsp)
movq -0x1f8(%rbp), %rax
movq %rax, 0x28(%rsp)
movq -0x1f0(%rbp), %rax
movq %rax, 0x30(%rsp)
movq -0x1e8(%rbp), %rax
movq %rax, 0x38(%rsp)
movq -0x1e0(%rbp), %rax
movq %rax, 0x40(%rsp)
movq -0x1d8(%rbp), %rax
movq %r13, 0x48(%rsp)
movl %r12d, 0x50(%rsp)
movq %r15, 0x58(%rsp)
movl %r14d, 0x60(%rsp)
movq %rbx, 0x68(%rsp)
movq %r11, 0x70(%rsp)
movq %r10, 0x78(%rsp)
movq %rax, 0x80(%rsp)
callq 0x1b3b90
movq 0x20(%rbp), %rax
movq 0x10(%rax), %rax
subq -0x80(%rbp), %rax
cmpq $0x1, %rax
ja 0x25d75e
jmp 0x25d77d
leaq 0x131e19(%rip), %rdi    # 0x38f57e
leaq 0x13149f(%rip), %rsi    # 0x38ec0b
movl $0x117a, %edx           # imm = 0x117A
leaq 0x131e1c(%rip), %rcx    # 0x38f594
callq 0x2130
movq 0x20(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x80(%rbp), %rax
jbe 0x25d84e
movq 0x20(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x80(%rbp), %rax
addq %rax, %rdi
movq 0x28(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %rax
movq (%rax), %r8
movq -0x50(%rbp), %rax
movq 0x8(%rax), %r9
movq 0x30(%rbp), %r14
movq -0xa8(%rbp), %rbx
leaq 0x16702a(%rip), %rax    # 0x3c47f8
movsd 0xc0(%rax), %xmm0
movq -0x180(%rbp), %r11
movl -0x34(%rbp), %eax
movl %eax, %r10d
movq 0x38(%rbp), %rax
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq $0x1f, 0x20(%rsp)
movq $0x1, 0x28(%rsp)
movq %rax, 0x30(%rsp)
callq 0x9b8d0
cmpq $0x0, %rax
je 0x25d84e
movq -0x98(%rbp), %rax
imulq $0x28, -0x78(%rbp), %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %ecx
movq 0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x80(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x1c(%rax)
jmp 0x25d850
movq 0x20(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x80(%rbp), %rax
jbe 0x25d879
movq 0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x80(%rbp), %rcx
addq %rcx, %rax
movzbl 0x2c(%rax), %eax
cmpl $0x1, %eax
je 0x25d87e
jmp 0x25d917
movq -0x90(%rbp), %rax
cmpq -0x80(%rbp), %rax
je 0x25d905
movq 0x20(%rbp), %rax
movq (%rax), %rsi
imulq $0xa8, -0x90(%rbp), %rax
addq %rax, %rsi
leaq -0x150(%rbp), %rdi
movl $0xa8, %edx
callq 0x2180
movq 0x20(%rbp), %rax
movq (%rax), %rsi
imulq $0xa8, -0x80(%rbp), %rax
addq %rax, %rsi
movq 0x20(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x90(%rbp), %rax
addq %rax, %rdi
movl $0xa8, %edx
callq 0x2180
movq 0x20(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x80(%rbp), %rax
addq %rax, %rdi
leaq -0x150(%rbp), %rsi
movl $0xa8, %edx
callq 0x2180
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0x25d37f
movq 0x98(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x98(%rbp)
movq 0x98(%rbp), %rax
movl 0xc(%rax), %eax
movq %rax, -0x70(%rbp)
movq $0x0, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpq -0x70(%rbp), %rax
jae 0x25dd2b
movq 0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x98(%rbp), %rax
imulq $0x28, -0x78(%rbp), %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
cmpl $0x0, %eax
je 0x25d9ac
movq -0x50(%rbp), %rdi
movq 0x18(%rbp), %rsi
movq -0x98(%rbp), %rax
imulq $0x28, -0x78(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, %edx
callq 0xa500
jmp 0x25d9cd
movq -0x50(%rbp), %rdi
movq 0x18(%rbp), %rsi
movq -0x98(%rbp), %rax
imulq $0x28, -0x78(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, %edx
callq 0xa380
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %eax
movl %eax, %esi
movq -0x48(%rbp), %rdx
movq -0x98(%rbp), %rax
imulq $0x28, -0x78(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
movq -0x50(%rbp), %rax
movq (%rax), %r8
movq -0x50(%rbp), %rax
movq 0x8(%rax), %r9
movq -0x58(%rbp), %rax
movq %rax, -0x270(%rbp)
movq 0x10(%rbp), %rax
movq %rax, -0x268(%rbp)
movq 0x20(%rbp), %rax
movq %rax, -0x260(%rbp)
movq 0x28(%rbp), %rax
movq %rax, -0x258(%rbp)
movsd -0x60(%rbp), %xmm0
movl 0x40(%rbp), %eax
movl %eax, -0x24c(%rbp)
movq 0x48(%rbp), %rax
movq %rax, -0x248(%rbp)
movq 0x50(%rbp), %rax
movq %rax, -0x240(%rbp)
movq 0x58(%rbp), %rax
movq %rax, -0x238(%rbp)
movq 0x60(%rbp), %rax
movq %rax, -0x230(%rbp)
movq 0x68(%rbp), %r13
movl 0x78(%rbp), %r12d
movq 0x80(%rbp), %r15
movsd -0x68(%rbp), %xmm1
movl 0x88(%rbp), %r14d
movq -0x198(%rbp), %rbx
movq -0x1a0(%rbp), %r11
movq -0x1a8(%rbp), %r10
movq -0x1b0(%rbp), %rax
movq %rax, -0x228(%rbp)
movq -0x270(%rbp), %rax
movsd -0x1b8(%rbp), %xmm2
movsd -0x1c0(%rbp), %xmm3
movq %rax, (%rsp)
movq -0x268(%rbp), %rax
movq %rax, 0x8(%rsp)
movq -0x260(%rbp), %rax
movq %rax, 0x10(%rsp)
movq -0x258(%rbp), %rax
movq %rax, 0x18(%rsp)
movl -0x24c(%rbp), %eax
movl %eax, 0x20(%rsp)
movq -0x248(%rbp), %rax
movq %rax, 0x28(%rsp)
movq -0x240(%rbp), %rax
movq %rax, 0x30(%rsp)
movq -0x238(%rbp), %rax
movq %rax, 0x38(%rsp)
movq -0x230(%rbp), %rax
movq %rax, 0x40(%rsp)
movq -0x228(%rbp), %rax
movq %r13, 0x48(%rsp)
movl %r12d, 0x50(%rsp)
movq %r15, 0x58(%rsp)
movl %r14d, 0x60(%rsp)
movq %rbx, 0x68(%rsp)
movq %r11, 0x70(%rsp)
movq %r10, 0x78(%rsp)
movq %rax, 0x80(%rsp)
callq 0x1b3b90
movq 0x20(%rbp), %rax
movq 0x10(%rax), %rax
subq -0x80(%rbp), %rax
cmpq $0x1, %rax
ja 0x25db63
jmp 0x25db82
leaq 0x131a14(%rip), %rdi    # 0x38f57e
leaq 0x13109a(%rip), %rsi    # 0x38ec0b
movl $0x1195, %edx           # imm = 0x1195
leaq 0x131a17(%rip), %rcx    # 0x38f594
callq 0x2130
movq 0x20(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x80(%rbp), %rax
jbe 0x25dc53
movq 0x20(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x80(%rbp), %rax
addq %rax, %rdi
movq 0x28(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %rax
movq (%rax), %r8
movq -0x50(%rbp), %rax
movq 0x8(%rax), %r9
movq 0x30(%rbp), %r14
movq -0xa8(%rbp), %rbx
leaq 0x166c25(%rip), %rax    # 0x3c47f8
movsd 0xc0(%rax), %xmm0
movq -0x180(%rbp), %r11
movl -0x34(%rbp), %eax
movl %eax, %r10d
movq 0x38(%rbp), %rax
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq $0x1f, 0x20(%rsp)
movq $0x1, 0x28(%rsp)
movq %rax, 0x30(%rsp)
callq 0x9b8d0
cmpq $0x0, %rax
je 0x25dc53
movq -0x98(%rbp), %rax
imulq $0x28, -0x78(%rbp), %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %ecx
movq 0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x80(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x1c(%rax)
movq 0x20(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x80(%rbp), %rax
jbe 0x25dc7c
movq 0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x80(%rbp), %rcx
addq %rcx, %rax
movzbl 0x2c(%rax), %eax
cmpl $0x1, %eax
je 0x25dc81
jmp 0x25dd1a
movq -0x90(%rbp), %rax
cmpq -0x80(%rbp), %rax
je 0x25dd08
movq 0x20(%rbp), %rax
movq (%rax), %rsi
imulq $0xa8, -0x90(%rbp), %rax
addq %rax, %rsi
leaq -0x150(%rbp), %rdi
movl $0xa8, %edx
callq 0x2180
movq 0x20(%rbp), %rax
movq (%rax), %rsi
imulq $0xa8, -0x80(%rbp), %rax
addq %rax, %rsi
movq 0x20(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x90(%rbp), %rax
addq %rax, %rdi
movl $0xa8, %edx
callq 0x2180
movq 0x20(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x80(%rbp), %rax
addq %rax, %rdi
leaq -0x150(%rbp), %rsi
movl $0xa8, %edx
callq 0x2180
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0x25d94f
movq -0x90(%rbp), %rcx
movq 0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x90(%rbp), %rcx
movl 0xc(%rcx), %ecx
movq 0x98(%rbp), %rdx
addl 0xc(%rdx), %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
ja 0x25dd5f
jmp 0x25dd7e
leaq 0x13198e(%rip), %rdi    # 0x38f6f4
leaq 0x130e9e(%rip), %rsi    # 0x38ec0b
movl $0x11a9, %edx           # imm = 0x11A9
leaq 0x13181b(%rip), %rcx    # 0x38f594
callq 0x2130
movq -0xa8(%rbp), %rax
addq $0x2d8, %rsp            # imm = 0x2D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw (%rax,%rax)