// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: gen_rphase_dp(haplotype_evdience_alloc*, overlap_region_alloc*, UC_Read*, double, unsigned long, Chain_Data*, asg64_v*, asg64_v*, unsigned long, asg8_v*)
void gen_rphase_dp(haplotype_evdience_alloc* hl, overlap_region_alloc* ol, UC_Read* g_read, double st_rate, uint64_t st_max, Chain_Data *dp, asg64_v *idx, asg64_v *res, uint64_t rid, asg8_v *qv)
{
    if(hl->length <= 0) return;

    uint64_t k, l, i, i0, o, ii, m_snp_stat, m_snp_stat0, m_list /**m_off**/, m1, c0, c1, rev_n, tqual, wqual, hq_cut = 2; uint32_t hq[5], hp[4], is_st; SnpStats *s; haplotype_evdience ev; char mc;
    retrive_bqual(qv, NULL, rid, -1, -1, 0, sc_bn);

    idx->n = 0; 
    kv_resize(uint64_t, *res, ol->length); memset(res->a, -1, sizeof((*(res->a)))*ol->length); res->n = ol->length;
    for (k = 1, l = 0, i = m_snp_stat = m_list = 0; k <= hl->snp_stat.n; ++k) {///filter snps
        if(k == hl->snp_stat.n || hl->snp_stat.a[k].site != hl->snp_stat.a[l].site) {
            for (; i < hl->length && hl->list[i].site != hl->snp_stat.a[l].site; i++);
            assert(i < hl->length && hl->list[i].site == hl->snp_stat.a[l].site);
            for (o = l, m1 = 0; o < k; o++) {
                s = &(hl->snp_stat.a[o]);
                // fprintf(stderr, "+[M::%s]\tsite::%u\tn0::%u\tn1::%u\n", __func__, s->site, s->occ_0, s->occ_1);
                if((s->occ_0 < 2 || s->occ_1 < 2) || (is_st_bs((*s), st_rate, st_max)) || (!(s->occ_0 >= asm_opt.s_hap_cov && s->occ_1 >= asm_opt.infor_cov))) {
                    continue;
                }
                // fprintf(stderr, "-[M::%s]\tsite::%u\tn0::%u\tn1::%u\n", __func__, s->site, s->occ_0, s->occ_1);
                m1++;
            }

            if(m1) {
                hq[0] = hq[1] = hq[2] = hq[3] = hq[4] = 0; hp[0] = hp[1] = hp[2] = hp[3] = ((uint32_t)-1); 
                for (i0 = i, c0 = rev_n = 0; i0 < hl->length && hl->list[i0].site == hl->snp_stat.a[l].site; i0++) {
                    hl->list[i0].site = ((uint32_t)-1);
                    if(hh_tp(hl->list[i0]) == 0) {
                        c0 += 1/**hl->list[i0].cov**/;
                        if((ol->list[hl->list[i0].overlapID].y_pos_strand == 0)) rev_n += 1/**hl->list[i0].cov**/;
                    }
                    if(qv) {
                        if(hh_tp(hl->list[i0]) == 0) {
                            if((hh_bq(hl->list[i0]) > 1) || (hh_wq(hl->list[i0]) > 1)) hq[4]++;
                        } else {
                            hp[seq_nt6_table[(uint8_t)(hl->list[i0].misBase)]] = hl->list[i0].overlapSite;
                            if((hh_bq(hl->list[i0]) > 1) || (hh_wq(hl->list[i0]) > 1)) {
                                hq[seq_nt6_table[(uint8_t)(hl->list[i0].misBase)]]++;
                            }
                        }
                    }
                }
                assert(i0 > i);
                if(qv) {
                    if(hp[0] != ((uint32_t)-1) && hq[0] < hq_cut) {
                        // fprintf(stderr, "-[M::%s]\tsite::%u\tn0::%u\tn1::%u\n", __func__, hl->snp_stat.a[hp[0]].site, hl->snp_stat.a[hp[0]].occ_0, hl->snp_stat.a[hp[0]].occ_1);
                        hl->snp_stat.a[hp[0]].occ_1 = 0;
                    }

                    if(hp[1] != ((uint32_t)-1) && hq[1] < hq_cut) {
                        // fprintf(stderr, "-[M::%s]\tsite::%u\tn0::%u\tn1::%u\n", __func__, hl->snp_stat.a[hp[1]].site, hl->snp_stat.a[hp[1]].occ_0, hl->snp_stat.a[hp[1]].occ_1);
                        hl->snp_stat.a[hp[1]].occ_1 = 0;
                    }

                    if(hp[2] != ((uint32_t)-1) && hq[2] < hq_cut) {
                        // fprintf(stderr, "-[M::%s]\tsite::%u\tn0::%u\tn1::%u\n", __func__, hl->snp_stat.a[hp[2]].site, hl->snp_stat.a[hp[2]].occ_0, hl->snp_stat.a[hp[2]].occ_1);
                        hl->snp_stat.a[hp[2]].occ_1 = 0;
                    }

                    if(hp[3] != ((uint32_t)-1) && hq[3] < hq_cut) {
                        // fprintf(stderr, "-[M::%s]\tsite::%u\tn0::%u\tn1::%u\n", __func__, hl->snp_stat.a[hp[3]].site, hl->snp_stat.a[hp[3]].occ_0, hl->snp_stat.a[hp[3]].occ_1);
                        hl->snp_stat.a[hp[3]].occ_1 = 0;
                    }

                    get_wqual(rid, hl->snp_stat.a[l].site, 0, NULL, qv->a, sc_wn, &tqual, &wqual);
                    if(tqual > 1 || wqual > 1) hq[4]++;
                    // if(hq[4] == 0) {
                    //     fprintf(stderr, "+[M::%s]\tsite::%u\tn0::%u\tn1::%u\n", __func__, hl->snp_stat.a[l].site, hl->snp_stat.a[l].occ_0, hl->snp_stat.a[l].occ_1);
                    // }
                } else {
                    hq[0] = hq[1] = hq[2] = hq[3] = hq[4] = ((uint32_t)-1);
                }

                if((hq[4] >= hq_cut) && (hq[0] >= hq_cut || hq[1] >= hq_cut || hq[2] >= hq_cut || hq[3] >= hq_cut)) {
                    for (o = l, m_snp_stat0 = m_snp_stat; o < k; o++) {
                        s = &(hl->snp_stat.a[o]);
                        if((s->occ_0 < 2 || s->occ_1 < 2) || (is_st_bs((*s), st_rate, st_max)) || (!(s->occ_0 >= asm_opt.s_hap_cov && s->occ_1 >= asm_opt.infor_cov))) {
                            continue;
                        }
                        
                        hl->snp_stat.a[m_snp_stat] = *s; 
                        for (ii = i, c1 = 0; ii < i0; ii++) {
                            if(((hl->list[ii].overlapSite == o) && (hl->list[ii].site == ((uint32_t)-1))) || (hh_tp(hl->list[ii]) == 0)) {
                                hl->list[ii].overlapSite = m_snp_stat;
                                hl->list[ii].site = hl->snp_stat.a[o].site;
                                if(hh_tp(hl->list[ii]) == 1) c1 += 1/**hl->list[ii].cov**/;///not correct if we don't do read correction
                            }
                        }
                        // fprintf(stderr, "-0-[M::%s]\tsite::%u\tc0::%lu\tc1::%lu\n", __func__, s->site, c0, c1);
                        hl->snp_stat.a[m_snp_stat].occ_0 = c0 + 1;
                        hl->snp_stat.a[m_snp_stat].occ_1 = c1;
                        hl->snp_stat.a[m_snp_stat].overlap_num = rev_n + 1;
                        hl->snp_stat.a[m_snp_stat].non_homopolymer_num = m_list;
                        hl->snp_stat.a[m_snp_stat++].score = -1;
                    }

                    for (ii = i, m1 = m_list; ii < i0; ii++) {
                        if((hl->list[ii].site == ((uint32_t)-1))) {
                            hl->list[ii].overlapSite = ((uint32_t)-1);
                            hl->list[ii].site = hl->snp_stat.a[l].site;
                        }
                        fill_incom(res, hl->list[ii].overlapID, hl->list[ii].site, idx->a, idx->n, ol->list[0].x_id);
                        hl->list[m_list++] = hl->list[ii];
                    }
                    radix_sort_haplotype_evdience_id_srt(hl->list + m1, hl->list + m_list);
                    for (ii = m_snp_stat0; ii < m_snp_stat; ii++) {
                        hl->snp_stat.a[ii].homopolymer_num = m_list;
                    }
                    
                    i = i0;

                    kv_push(uint64_t, *idx, hl->snp_stat.a[l].site);
                }
            }

            l = k;
        }
    }
    hl->snp_stat.n = m_snp_stat; hl->length = m_list;
    if(hl->snp_stat.n == 0 || hl->length == 0) return;


    ///fill incomplete values
    if(res->n > ol->length) {
        // fprintf(stderr, "\n[M::%s]\tin_comp::%lu\n", __func__, ((uint64_t)res->n - ol->length));
        for (k = ol->length; k < res->n; k++) {
            ev.misBase = 0;
            ev.overlapID = res->a[k]>>32;
            ev.site = ((uint32_t)res->a[k]);
            ev.overlapSite = ((uint32_t)-1);
            ev.type = 0;
            ev.cov = 1;
            addHaplotypeEvdience(hl, &ev, NULL);
            // fprintf(stderr, "[M::%s]\toid::%u\tsite::%u\n", __func__, ev.overlapID, ev.site);
        }
        radix_sort_haplotype_evdience_srt(hl->list, hl->list + hl->length);

        for (k = 1, l = 0, i = 0; k <= hl->snp_stat.n; ++k) {
            if(k == hl->snp_stat.n || hl->snp_stat.a[k].site != hl->snp_stat.a[l].site) {
                for (; i < hl->length && hl->list[i].site != hl->snp_stat.a[l].site; i++);
                assert(i < hl->length && hl->list[i].site == hl->snp_stat.a[l].site);
                
                m1 = ((uint32_t)-1); mc = 0;
                for (i0 = i, c0 = rev_n = 0; i0 < hl->length && hl->list[i0].site == hl->snp_stat.a[l].site; i0++) {
                    if(hh_tp(hl->list[i0]) == 0) {
                        c0+=1/**hl->list[i0].cov**/;
                        if((ol->list[hl->list[i0].overlapID].y_pos_strand == 0)) rev_n += 1/**hl->list[i0].cov**/;
                        if(hl->list[i0].overlapSite != ((uint32_t)-1)) {
                            m1 = hl->list[i0].overlapSite; mc = hl->list[i0].misBase;
                        }
                    }
                    // if(hl->snp_stat.a[l].site == 6995) {
                    //     fprintf(stderr, "[M::%s]\tsite::%u\tosite::%u\toid::%u\ttp::%u\n", __func__, hl->list[i0].site, hl->list[i0].overlapSite, hl->list[i0].overlapID, hh_tp(hl->list[i0]));
                    // }
                }
                assert(i0 > i);
                assert(m1 != ((uint32_t)-1));
                assert(mc != 0);

                
                for (ii = i, is_st = 1; ii < i0; ii++) {
                    if(hh_tp(hl->list[ii]) == 0) {
                        assert(hl->list[ii].overlapSite == ((uint32_t)-1) || hl->list[ii].overlapSite == m1);
                        hl->list[ii].overlapSite = m1; hl->list[ii].misBase = mc;
                    }
                    if((ii > i) && (hl->list[ii].overlapID <= hl->list[ii-1].overlapID)) {
                        is_st = 0;
                        // fprintf(stderr, "[M::%s]\tid::[%u,%u]\tsite::[%u,%u]\n", __func__, hl->list[ii].overlapID, hl->list[ii-1].overlapID,  hl->list[ii].overlapSite,  hl->list[ii-1].overlapSite);
                    }
                }
                if(is_st == 0) radix_sort_haplotype_evdience_id_srt(hl->list + i, hl->list + i0);
                // assert(is_st == 1);

                

                for (o = l; o < k; o++) {
                    s = &(hl->snp_stat.a[o]);
                    for (ii = i, c1 = 0; ii < i0; ii++) {
                        if((hl->list[ii].overlapSite == o) && (hh_tp(hl->list[ii]) == 1)) c1 += 1/**hl->list[ii].cov**/;///not correct if we don't do read correction
                    }
                    // fprintf(stderr, "-1-[M::%s]\tsite::%u\tc0::%lu\tc1::%lu\n", __func__, s->site, c0, c1);
                    s->occ_0 = c0 + 1;
                    s->occ_1 = c1;
                    s->overlap_num = rev_n + 1;
                    s->non_homopolymer_num = i;
                    s->homopolymer_num = i0;
                }
                
                i = i0;
                l = k;
            }
        }

    }





    // gen_rphase_dp0_multiple_path(hl->snp_stat.a, hl->snp_stat.n, hl->list, dp, idx, res);
    gen_rphase_dp0_single_path(hl->snp_stat.a, hl->snp_stat.n, hl->list, dp, idx, asm_opt.het_cov, asm_opt.hom_cov, asm_opt.polyploidy, 0.7, 6, res, qv->a);

    for (k = 1, l = 0, i = m_snp_stat = m_list = 0; k <= hl->snp_stat.n; ++k) {///filter snps
        if(k == hl->snp_stat.n || hl->snp_stat.a[k].site != hl->snp_stat.a[l].site) {
            for (; i < hl->length && hl->list[i].site != hl->snp_stat.a[l].site; i++);
            assert(i < hl->length && hl->list[i].site == hl->snp_stat.a[l].site);
            for (o = l, m1 = 0; o < k; o++) {
                s = &(hl->snp_stat.a[o]);
                if(s->score == -1) continue;
                m1++;
            }

            if(m1) {
                for (i0 = i, c0 = rev_n = 0; i0 < hl->length && hl->list[i0].site == hl->snp_stat.a[l].site; i0++) {
                    hl->list[i0].site = ((uint32_t)-1);
                    if(hh_tp(hl->list[i0]) == 0) {
                        c0 += 1/**hl->list[i0].cov**/;
                        if((ol->list[hl->list[i0].overlapID].y_pos_strand == 0)) rev_n += 1/**hl->list[i0].cov**/;
                    }
                }
                assert(i0 > i);

                for (o = l, m_snp_stat0 = m_snp_stat; o < k; o++) {
                    s = &(hl->snp_stat.a[o]);
                    if(s->score == -1) continue;
                    
                    hl->snp_stat.a[m_snp_stat] = *s; 
                    for (ii = i, c1 = 0; ii < i0; ii++) {
                        if(((hl->list[ii].overlapSite == o) && (hl->list[ii].site == ((uint32_t)-1))) || (hh_tp(hl->list[ii]) == 0)) {
                            hl->list[ii].overlapSite = m_snp_stat;
                            hl->list[ii].site = hl->snp_stat.a[o].site;
                            if(hh_tp(hl->list[ii]) == 1) c1 += 1/**hl->list[ii].cov**/;///not correct if we don't do read correction
                        }
                    }

                    // if(hl->snp_stat.a[m_snp_stat].site == 4) {
                    //     fprintf(stderr, "[M::%s] occ_0->%lu, occ_1->%lu, site->%u\n", __func__, c0 + 1, c1, hl->snp_stat.a[m_snp_stat].site);
                    // }
                    
                    hl->snp_stat.a[m_snp_stat].occ_0 = c0 + 1;
                    hl->snp_stat.a[m_snp_stat].occ_1 = c1;
                    hl->snp_stat.a[m_snp_stat].overlap_num = rev_n + 1;
                    hl->snp_stat.a[m_snp_stat].non_homopolymer_num = m_list;
                    hl->snp_stat.a[m_snp_stat++].score = -1;
                }

                for (ii = i, m1 = m_list; ii < i0; ii++) {
                    if((hl->list[ii].site == ((uint32_t)-1))) continue;
                    hl->list[m_list++] = hl->list[ii];
                }
                for (ii = m_snp_stat0; ii < m_snp_stat; ii++) {
                    hl->snp_stat.a[ii].homopolymer_num = m_list;
                }
                
                i = i0;
            }

            l = k;
        }
    }
    hl->snp_stat.n = m_snp_stat; hl->length = m_list;
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rcx, 0xa8(%rsp)
movsd %xmm0, 0xa0(%rsp)
cmpl $0x0, 0x10(%rdi)
je 0x55595
movq %r9, %r14
movq %r8, %r15
movq %rsi, %rbx
movq %rdi, %r13
movq 0x110(%rsp), %rdi
movq 0x108(%rsp), %rdx
movq 0x100(%rsp), %r12
subq $0x8, %rsp
xorl %esi, %esi
movq $-0x1, %rcx
movq $-0x1, %r8
xorl %r9d, %r9d
pushq $0x2
callq 0x33933
movq %r12, %r8
addq $0x10, %rsp
movq $0x0, (%r14)
movq 0x10(%rbx), %rdx
cmpq %rdx, 0x8(%r12)
jae 0x54547
decq %rdx
movq %rdx, %rax
shrq %rax
orq %rdx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x10, %rax
orq %rcx, %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%r8)
movq 0x10(%r8), %rdi
leaq 0x8(,%rax,8), %rsi
movq %r8, %r12
callq 0x2370
movq %rax, %rdi
movq %rax, 0x10(%r12)
movq 0x10(%rbx), %rdx
jmp 0x5454e
movq 0x10(%r8), %rdi
movq %r8, %r12
shlq $0x3, %rdx
movl $0xff, %esi
callq 0x20e0
movq %rbx, 0x28(%rsp)
movq 0x10(%rbx), %rax
movq %rax, (%r12)
movq 0x220(%r13), %rax
testq %rax, %rax
je 0x55177
movq %r12, %r11
movq %r15, 0xb0(%rsp)
movq %r14, 0x60(%rsp)
movl $0x1, %ebp
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
xorl %r15d, %r15d
xorl %r12d, %r12d
movq %r13, 0x8(%rsp)
cmpq %rax, %rbp
je 0x545d4
movq 0x218(%r13), %rax
leaq (,%rbp,4), %rcx
addq %rbp, %rcx
movl 0x20(%rax,%rcx,8), %ecx
leaq (%r12,%r12,4), %rdx
cmpl 0x20(%rax,%rdx,8), %ecx
je 0x54e17
movl 0x10(%r13), %ecx
cmpq %rcx, %r15
jae 0x555a7
movq 0x218(%r13), %r9
leaq (%r12,%r12,4), %rax
movq %rax, 0x68(%rsp)
movl 0x20(%r9,%rax,8), %esi
leaq (,%r15,8), %rdi
leaq (%rdi,%rdi,2), %rdx
addq (%r13), %rdx
leaq (%rdi,%rdi,2), %rbx
addq $0xc, %rbx
cmpl %esi, (%rdx)
je 0x54627
incq %r15
addq $0x18, %rdx
addq $0x18, %rbx
cmpq %r15, %rcx
jne 0x5460e
jmp 0x555a7
cmpq %rbp, %r12
jae 0x546ef
leaq 0x241121(%rip), %rax    # 0x295758
movq 0x210(%rax), %rdi
movq 0x218(%rax), %r8
movq 0x68(%rsp), %rax
movq %r9, 0x50(%rsp)
leaq (%r9,%rax,8), %r9
addq $0xc, %r9
xorl %r10d, %r10d
movq %r12, %r11
movq %rbp, 0x70(%rsp)
movl -0x4(%r9), %r13d
cmpq $0x2, %r13
jb 0x546a4
movl (%r9), %r14d
cmpq $0x2, %r14
jb 0x546a4
movq 0xa8(%rsp), %rax
cmpq $-0x1, %rax
je 0x5468f
movl -0x8(%r9), %ebp
addq %rbp, %rax
cmpq %r13, %rax
jae 0x546b2
cmpq %r13, %r8
movq 0x70(%rsp), %rbp
jg 0x546a4
xorl %eax, %eax
cmpq %r14, %rdi
setle %al
addq %rax, %r10
incq %r11
addq $0x28, %r9
cmpq %r11, %rbp
jne 0x54662
jmp 0x546f7
xorps %xmm0, %xmm0
cvtsi2sd %r13, %xmm0
movl %ebp, %eax
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
movapd %xmm0, %xmm2
mulsd 0xa0(%rsp), %xmm2
addsd %xmm1, %xmm2
ucomisd %xmm0, %xmm2
setae %al
cmpq %r13, %r8
setg %bpl
orb %al, %bpl
movq 0x70(%rsp), %rbp
je 0x54699
jmp 0x546a4
movq %rbp, %r12
jmp 0x54e17
testq %r10, %r10
movq 0x28(%rsp), %r10
movq 0x100(%rsp), %r11
movq 0x110(%rsp), %r14
je 0x54e0f
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movl $0x0, 0x40(%rsp)
pcmpeqd %xmm0, %xmm0
movdqa %xmm0, 0x90(%rsp)
cmpq %rcx, %r15
jae 0x55642
pxor %xmm3, %xmm3
movq %r15, %r13
cmpl %esi, (%rdx)
jne 0x547e0
movl $0xffffffff, (%rdx)     # imm = 0xFFFFFFFF
movzbl 0xc(%rdx), %edi
testb $0x1, %dil
jne 0x5478b
movq (%r10), %rax
movl 0x4(%rdx), %r8d
imulq $0xa8, %r8, %r8
xorl %r9d, %r9d
cmpl $0x0, 0x1c(%rax,%r8)
sete %r9b
movd %r9d, %xmm0
movaps 0x1dcd8d(%rip), %xmm1   # 0x231510
movss %xmm0, %xmm1            # xmm1 = xmm0[0],xmm1[1,2,3]
paddd %xmm1, %xmm3
testq %r14, %r14
je 0x547d0
testb $0x1, %dil
jne 0x547a2
testb $0x28, %dil
je 0x547d0
incl 0x40(%rsp)
jmp 0x547d0
movq %r13, %r9
movl 0x8(%rdx), %eax
movzbl 0x14(%rdx), %r8d
leaq 0x240e7c(%rip), %r13    # 0x295630
movzbl (%r13,%r8), %r8d
movl %eax, 0x90(%rsp,%r8,4)
movq %r9, %r13
testb $0x28, %dil
je 0x547d0
incl 0x30(%rsp,%r8,4)
incq %r13
addq $0x18, %rdx
cmpq %rcx, %r13
jb 0x54744
cmpq %r15, %r13
jbe 0x55642
testq %r14, %r14
movq %r13, (%rsp)
je 0x5493e
movl 0x90(%rsp), %ecx
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
cmpq %rdi, %rcx
setne %al
movl 0x30(%rsp), %edx
movl %edx, 0x7c(%rsp)
cmpl $0x2, %edx
setb %dl
andb %al, %dl
cmpb $0x1, %dl
movq 0x50(%rsp), %r8
jne 0x5482f
leaq (%rcx,%rcx,4), %rax
movl $0x0, 0xc(%r8,%rax,8)
movl 0x94(%rsp), %ecx
cmpq %rdi, %rcx
setne %al
movl 0x34(%rsp), %edx
movl %edx, 0x10(%rsp)
cmpl $0x2, %edx
setb %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x5485e
leaq (%rcx,%rcx,4), %rax
movl $0x0, 0xc(%r8,%rax,8)
movl 0x98(%rsp), %ecx
cmpq %rdi, %rcx
setne %al
movl 0x38(%rsp), %r13d
cmpl $0x2, %r13d
setb %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x5488b
leaq (%rcx,%rcx,4), %rax
movl $0x0, 0xc(%r8,%rax,8)
movdqa %xmm3, 0x80(%rsp)
movl 0x9c(%rsp), %ecx
cmpq %rdi, %rcx
setne %al
movl 0x3c(%rsp), %r14d
cmpl $0x2, %r14d
setb %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x548c1
leaq (%rcx,%rcx,4), %rax
movl $0x0, 0xc(%r8,%rax,8)
movq 0x110(%rsp), %rax
movq 0x10(%rax), %r8
movl $0x5, %r9d
movq 0x108(%rsp), %rdi
xorl %edx, %edx
xorl %ecx, %ecx
leaq 0xb8(%rsp), %rax
pushq %rax
leaq 0xc8(%rsp), %rax
pushq %rax
callq 0x54288
addq $0x10, %rsp
cmpq $0x1, 0xc0(%rsp)
movl 0x40(%rsp), %eax
ja 0x54914
cmpq $0x2, 0xb8(%rsp)
jb 0x5491a
incl %eax
movl %eax, 0x40(%rsp)
movq 0x100(%rsp), %r11
movdqa 0x80(%rsp), %xmm3
movl 0x10(%rsp), %ecx
cmpl $0x2, %eax
jb 0x54e0f
movl 0x7c(%rsp), %eax
jmp 0x54966
pcmpeqd %xmm0, %xmm0
movdqa %xmm0, 0x30(%rsp)
movl $0xffffffff, 0x40(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x2, %eax
setae %al
cmpl $0x2, %ecx
setae %cl
orb %al, %cl
cmpl $0x2, %r13d
setae %al
cmpl $0x2, %r14d
setae %dl
orb %al, %dl
orb %cl, %dl
cmpb $0x1, %dl
jne 0x54e0f
movq 0x18(%rsp), %r10
cmpq %rbp, %r12
movq 0x8(%rsp), %r13
movq 0xa8(%rsp), %r14
jae 0x54b1c
psubd 0x1dcb6e(%rip), %xmm3   # 0x231520
movq 0x218(%r13), %rcx
movq 0x18(%rsp), %r10
leaq (%r12,%r12,4), %rax
movl 0x8(%rcx,%rax,8), %edi
cmpq $0x2, %rdi
jb 0x54b10
leaq (%rcx,%rax,8), %rsi
movl 0xc(%rsi), %edx
cmpq $0x2, %rdx
jb 0x54b10
cmpq $-0x1, %r14
je 0x54a0e
movq %r10, 0x10(%rsp)
movl 0x4(%rsi), %r9d
leaq (%r9,%r14), %r10
leaq 0x240d5d(%rip), %r8     # 0x295758
movq 0x218(%r8), %r8
cmpq %rdi, %r10
jae 0x54a26
movq 0x10(%rsp), %r10
jmp 0x54a1c
leaq 0x240d43(%rip), %r8     # 0x295758
movq 0x218(%r8), %r8
cmpq %rdi, %r8
jle 0x54a67
jmp 0x54b10
xorps %xmm0, %xmm0
cvtsi2sd %rdi, %xmm0
movl %r9d, %r9d
xorps %xmm1, %xmm1
cvtsi2sd %r9, %xmm1
movapd %xmm0, %xmm2
mulsd 0xa0(%rsp), %xmm2
addsd %xmm1, %xmm2
ucomisd %xmm0, %xmm2
setae %r9b
cmpq %rdi, %r8
setg %dil
orb %r9b, %dil
movq 0x10(%rsp), %r10
jne 0x54b10
leaq 0x240cea(%rip), %rdi    # 0x295758
cmpq %rdx, 0x210(%rdi)
jg 0x54b10
leaq (%r10,%r10,4), %rdx
movq 0x20(%rsi), %rdi
movq %rdi, 0x20(%rcx,%rdx,8)
movdqu (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movups %xmm1, 0x10(%rcx,%rdx,8)
movdqu %xmm0, (%rcx,%rdx,8)
movq (%r13), %rcx
addq %rbx, %rcx
xorl %esi, %esi
movq %r15, %rdi
movl -0x4(%rcx), %r8d
cmpq %r8, %r12
jne 0x54ab5
cmpl $-0x1, -0xc(%rcx)
je 0x54abf
xorl %r8d, %r8d
testb $0x1, (%rcx)
je 0x54ac7
jmp 0x54ade
movzbl (%rcx), %r8d
andl $0x1, %r8d
movl %r10d, -0x4(%rcx)
movq 0x218(%r13), %r9
movl 0x20(%r9,%rax,8), %r9d
movl %r9d, -0xc(%rcx)
addl %r8d, %esi
incq %rdi
addq $0x18, %rcx
cmpq (%rsp), %rdi
jb 0x54aa6
movq 0x218(%r13), %rcx
movl %esi, 0xc(%rcx,%rdx,8)
movq %xmm3, 0x4(%rcx,%rdx,8)
movq 0x20(%rsp), %rax
movl %eax, 0x18(%rcx,%rdx,8)
incq %r10
movl $0xffffffff, 0x1c(%rcx,%rdx,8) # imm = 0xFFFFFFFF
incq %r12
cmpq %rbp, %r12
jne 0x549be
movq %r10, 0x10(%rsp)
movq 0x20(%rsp), %rbx
movq 0x60(%rsp), %r12
movq %rbx, 0x50(%rsp)
movq (%r13), %rcx
leaq (%r15,%r15,2), %rsi
leaq (%rcx,%rsi,8), %rax
movl (%rax), %r14d
cmpl $-0x1, %r14d
jne 0x54b66
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq 0x218(%r13), %rdx
movq %rsi, %rdi
movq 0x68(%rsp), %rsi
movl 0x20(%rdx,%rsi,8), %r14d
movq %rdi, %rsi
movl %r14d, (%rax)
movl 0x4(%rax), %ebx
movq 0x10(%r11), %rax
movq (%rax,%rbx,8), %rdi
cmpq $-0x1, %rdi
je 0x54c2f
movq %rsi, 0x80(%rsp)
movq (%r12), %rdx
movq 0x10(%r12), %rsi
leaq 0x1(%rdx), %r8
xorl %r9d, %r9d
movq %r8, %r10
movq %r9, %rbp
decq %r8
decq %r9
cmpq %rdi, -0x10(%rsi,%r10,8)
jne 0x54b93
testq %r8, %r8
jle 0x55623
cmpq %rdx, %r8
jge 0x54c1c
movq %rbx, %r13
shlq $0x20, %r13
leaq (%rsi,%rdx,8), %r12
movq (%r11), %rcx
cmpq 0x8(%r11), %rcx
jne 0x54bf7
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r11)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x100(%rsp), %r11
movq %rax, 0x10(%r11)
movq (%r11), %rcx
movq (%r12,%rbp,8), %rdx
orq %r13, %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, (%r11)
movq %rdx, (%rax,%rcx,8)
incq %rbp
jne 0x54bbf
movq 0x8(%rsp), %r13
movq (%r13), %rcx
movq 0x60(%rsp), %r12
movq 0x80(%rsp), %rsi
leaq (%rax,%rbx,8), %rax
movq 0x70(%rsp), %rbp
jmp 0x54c33
leaq (%rax,%rbx,8), %rax
movl %r14d, %edx
movq %rdx, (%rax)
movq 0x50(%rsp), %rbx
leaq (%rbx,%rbx,2), %rax
incq %rbx
movq 0x10(%rcx,%rsi,8), %rdx
movq %rdx, 0x10(%rcx,%rax,8)
movdqu (%rcx,%rsi,8), %xmm0
movdqu %xmm0, (%rcx,%rax,8)
incq %r15
cmpq (%rsp), %r15
jb 0x54b2b
movq (%r13), %rax
movq 0x20(%rsp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
leaq (%rbx,%rbx,2), %rcx
leaq (%rax,%rcx,8), %rsi
callq 0x45897
movq 0x10(%rsp), %rdi
movq %rdi, %rcx
movq 0x18(%rsp), %rsi
subq %rsi, %rcx
movdqa 0x1dc624(%rip), %xmm5   # 0x2312c0
movdqa 0x1dc62c(%rip), %xmm6   # 0x2312d0
movdqa 0x1dc634(%rip), %xmm7   # 0x2312e0
jbe 0x54d99
movq 0x218(%r13), %rdx
leaq 0x3(%rcx), %rax
andq $-0x4, %rax
decq %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq (%rsi,%rsi,4), %rcx
leaq (%rdx,%rcx,8), %rcx
addq $0x8c, %rcx
pxor %xmm7, %xmm0
xorl %edx, %edx
movq %rdx, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
movdqa %xmm1, %xmm2
por %xmm6, %xmm2
pxor %xmm7, %xmm2
movdqa %xmm2, %xmm3
pcmpgtd %xmm0, %xmm3
pcmpeqd %xmm0, %xmm2
pshufd $0xf5, %xmm2, %xmm4     # xmm4 = xmm2[1,1,3,3]
pand %xmm3, %xmm4
pshufd $0xf5, %xmm3, %xmm2     # xmm2 = xmm3[1,1,3,3]
por %xmm4, %xmm2
movd %xmm2, %esi
notl %esi
testb $0x1, %sil
je 0x54d26
movl %ebx, -0x78(%rcx)
pxor 0x1dc7f2(%rip), %xmm2   # 0x231520
pextrw $0x4, %xmm2, %esi
testb $0x1, %sil
je 0x54d3c
movl %ebx, -0x50(%rcx)
por %xmm5, %xmm1
pxor %xmm7, %xmm1
movdqa %xmm1, %xmm2
pcmpgtd %xmm0, %xmm2
pcmpeqd %xmm0, %xmm1
pshufd $0xf5, %xmm1, %xmm3     # xmm3 = xmm1[1,1,3,3]
pand %xmm2, %xmm3
pshufd $0xf5, %xmm2, %xmm1     # xmm1 = xmm2[1,1,3,3]
por %xmm3, %xmm1
pxor 0x1dc7b6(%rip), %xmm1   # 0x231520
pextrw $0x0, %xmm1, %esi
testb $0x1, %sil
je 0x54d78
movl %ebx, -0x28(%rcx)
pextrw $0x4, %xmm1, %esi
testb $0x1, %sil
je 0x54d85
movl %ebx, (%rcx)
addq $0x4, %rdx
addq $0xa0, %rcx
cmpq %rdx, %rax
jne 0x54ce3
movq (%r12), %rcx
movq 0x10(%r12), %rax
cmpq 0x8(%r12), %rcx
jne 0x54dd8
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r12)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x10(%rsp), %rdi
movq %rax, 0x10(%r12)
movq (%r12), %rcx
movq 0x100(%rsp), %r11
movq 0x218(%r13), %rdx
movq 0x68(%rsp), %rsi
movl 0x20(%rdx,%rsi,8), %edx
leaq 0x1(%rcx), %rsi
movq %rsi, (%r12)
movq %rdx, (%rax,%rcx,8)
movq %rbp, %r12
movq %rdi, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq (%rsp), %r15
jmp 0x54e17
movq %rbp, %r12
movq 0x8(%rsp), %r13
incq %rbp
movq 0x220(%r13), %rax
cmpq %rax, %rbp
jbe 0x545ab
movq 0x18(%rsp), %rsi
movq %rsi, 0x220(%r13)
movq 0x20(%rsp), %rdx
movl %edx, 0x10(%r13)
testq %rsi, %rsi
sete %al
testl %edx, %edx
sete %cl
orb %al, %cl
jne 0x55595
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rbx
cmpq %rbx, (%r11)
jbe 0x55188
xorl %ebp, %ebp
movq 0x10(%r11), %rax
movq (%rax,%rbx,8), %r14
leal 0x1(%rdx), %eax
cmpl 0x14(%r13), %eax
jbe 0x54ec2
movl %edx, %eax
shrl %eax
orl %edx, %eax
movl %eax, %ecx
shrl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x4, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x8, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x10, %eax
orl %ecx, %eax
incl %eax
movl %eax, 0x14(%r13)
movq (%r13), %rdi
shlq $0x3, %rax
leaq (%rax,%rax,2), %rsi
callq 0x2370
movq 0x100(%rsp), %r11
movq %rax, (%r13)
movl 0x10(%r13), %edx
jmp 0x54ec6
movq (%r13), %rax
movq %r14, %rcx
shrq $0x20, %rcx
movl %edx, %edx
leaq (%rdx,%rdx,2), %rdx
movl %r14d, (%rax,%rdx,8)
movl %ecx, 0x4(%rax,%rdx,8)
movl $0xffffffff, 0x8(%rax,%rdx,8) # imm = 0xFFFFFFFF
movb %bpl, 0xc(%rax,%rdx,8)
movl $0x1, 0x10(%rax,%rdx,8)
movb %bpl, 0x14(%rax,%rdx,8)
movl 0x10(%r13), %edx
incl %edx
movl %edx, 0x10(%r13)
incq %rbx
cmpq (%r11), %rbx
jb 0x54e66
movq (%r13), %rdi
movl %edx, %eax
leaq (%rax,%rax,2), %rax
leaq (%rdi,%rax,8), %rsi
callq 0x45630
movq 0x220(%r13), %rsi
xorl %r14d, %r14d
testq %rsi, %rsi
je 0x5517e
movl $0x1, %r9d
pcmpeqd %xmm2, %xmm2
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x100(%rsp), %r11
cmpq %rsi, %r9
je 0x54f6b
movq 0x218(%r13), %rax
leaq (%r9,%r9,4), %rcx
movl 0x20(%rax,%rcx,8), %ecx
leaq (%r12,%r12,4), %rdx
cmpl 0x20(%rax,%rdx,8), %ecx
je 0x55162
movq %r9, (%rsp)
movl 0x10(%r13), %r8d
cmpq %r8, %r15
jae 0x555e5
movq (%r13), %rax
movq 0x218(%r13), %rcx
leaq (%r12,%r12,4), %rdx
movl 0x20(%rcx,%rdx,8), %r9d
leaq (,%r15,8), %rdx
leaq (%rdx,%rdx,2), %rcx
leaq (%rax,%rcx), %rdi
addq %rax, %rcx
addq $0x14, %rcx
leaq (%rdx,%rdx,2), %rbx
addq $0xc, %rbx
cmpl %r9d, (%rdi)
je 0x54fcd
incq %r15
addq $0x18, %rdi
addq $0x18, %rcx
addq $0x18, %rbx
cmpq %r15, %r8
jne 0x54faf
jmp 0x555e5
movq %rax, 0x50(%rsp)
cmpq %r8, %r15
jae 0x55661
pxor %xmm3, %xmm3
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %esi, %esi
movq %rdi, %r10
movq %r15, %rbp
cmpl %r9d, (%r10)
jne 0x55060
testb $0x1, 0xc(%r10)
jne 0x55051
movq 0x28(%rsp), %rax
movq (%rax), %r13
movl 0x4(%r10), %eax
movl 0x8(%r10), %r11d
imulq $0xa8, %rax, %rax
xorl %r14d, %r14d
cmpl $0x0, 0x1c(%r13,%rax)
sete %r14b
movd %r14d, %xmm0
movaps 0x1dc4e8(%rip), %xmm1   # 0x231510
movss %xmm0, %xmm1            # xmm1 = xmm0[0],xmm1[1,2,3]
paddd %xmm1, %xmm3
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %r11
je 0x55041
movb 0x14(%r10), %sil
movq %r11, %rdx
movq 0x8(%rsp), %r13
movq 0x100(%rsp), %r11
xorl %r14d, %r14d
incq %rbp
addq $0x18, %r10
cmpq %r8, %rbp
jb 0x54fec
movq %r8, %rbp
cmpq %r15, %rbp
jbe 0x55661
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %rdx
je 0x556be
testb %sil, %sil
je 0x5569f
psubd %xmm2, %xmm3
movl $0x1, %r8d
movq %r15, %r9
testb $0x1, -0x8(%rcx)
jne 0x550b0
movl -0xc(%rcx), %r10d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %r10
je 0x550aa
cmpq %r10, %rdx
jne 0x55604
movl %edx, -0xc(%rcx)
movb %sil, (%rcx)
cmpq %r15, %r9
jbe 0x550bf
movl -0x10(%rcx), %eax
cmpl -0x28(%rcx), %eax
cmovbel %r14d, %r8d
incq %r9
addq $0x18, %rcx
cmpq %rbp, %r9
jb 0x5508d
testl %r8d, %r8d
jne 0x55101
leaq (,%rbp,2), %rax
addq %rbp, %rax
movq 0x50(%rsp), %rcx
leaq (%rcx,%rax,8), %rsi
movdqa %xmm3, 0x50(%rsp)
callq 0x45897
movdqa 0x50(%rsp), %xmm3
pcmpeqd %xmm2, %xmm2
movq 0x100(%rsp), %r11
movq (%rsp), %r9
cmpq %r9, %r12
jae 0x5515c
movq 0x218(%r13), %rax
addq (%r13), %rbx
leaq (%r12,%r12,4), %rcx
leaq (%rax,%rcx,8), %rcx
xorl %edx, %edx
movq %rbx, %rsi
movq %r15, %rdi
movl -0x4(%rsi), %r8d
cmpq %r8, %r12
jne 0x55139
movzbl (%rsi), %r8d
andl $0x1, %r8d
addl %r8d, %edx
incq %rdi
addq $0x18, %rsi
cmpq %rbp, %rdi
jb 0x55125
movl %edx, 0xc(%rcx)
movq %xmm3, 0x4(%rcx)
movl %r15d, 0x18(%rcx)
movl %ebp, 0x14(%rcx)
incq %r12
cmpq %r9, %r12
jne 0x55115
movq %r9, %r12
movq %rbp, %r15
incq %r9
movq 0x220(%r13), %rsi
cmpq %rsi, %r9
jbe 0x54f49
jmp 0x55188
xorl %eax, %eax
jmp 0x55591
xorl %esi, %esi
movq 0x100(%rsp), %r11
movq 0x218(%r13), %rdi
movq (%r13), %rdx
leaq 0x2405be(%rip), %rcx    # 0x295758
movslq 0xd4(%rcx), %r9
movslq 0xd0(%rcx), %rax
movslq 0x1bc(%rcx), %r10
subq $0x8, %rsp
movq 0x1dc3e5(%rip), %xmm0   # 0x2315a0
movq 0xb8(%rsp), %rcx
movq 0x68(%rsp), %r8
movq 0x118(%rsp), %rbx
pushq 0x10(%rbx)
pushq %r11
pushq $0x6
pushq %r10
pushq %rax
callq 0x53961
addq $0x30, %rsp
movq 0x220(%r13), %r8
testq %r8, %r8
je 0x55586
movl $0x1, %ecx
xorl %eax, %eax
pcmpeqd %xmm0, %xmm0
movq $0x0, (%rsp)
xorl %esi, %esi
xorl %edi, %edi
movdqa 0x1dc0ae(%rip), %xmm6   # 0x2312c0
movdqa 0x1dc0b6(%rip), %xmm7   # 0x2312d0
movdqa 0x1dc0bd(%rip), %xmm8   # 0x2312e0
cmpq %r8, %rcx
je 0x55247
movq 0x218(%r13), %r8
leaq (%rcx,%rcx,4), %r9
movl 0x20(%r8,%r9,8), %r9d
leaq (%rdi,%rdi,4), %r10
cmpl 0x20(%r8,%r10,8), %r9d
je 0x5556d
movl 0x10(%r13), %r10d
cmpq %r10, %rsi
jae 0x555c6
movq 0x218(%r13), %rbx
leaq (%rdi,%rdi,4), %r8
movl 0x20(%rbx,%r8,8), %ebp
leaq (,%rsi,8), %r11
leaq (%r11,%r11,2), %r9
movq (%r13), %r14
addq %r9, %r14
leaq (%r11,%r11,2), %r11
addq $0xc, %r11
cmpl %ebp, (%r14)
je 0x5529d
incq %rsi
addq $0x18, %r14
addq $0x18, %r11
addq $0x18, %r9
cmpq %rsi, %r10
jne 0x5527f
jmp 0x555c6
cmpq %rcx, %rdi
jae 0x55560
leaq (%rbx,%r8,8), %r8
addq $0x1c, %r8
xorl %r15d, %r15d
movq %rdi, %r12
xorl %r13d, %r13d
cmpl $-0x1, (%r8)
setne %r13b
addq %r13, %r15
incq %r12
addq $0x28, %r8
cmpq %r12, %rcx
jne 0x552b4
testq %r15, %r15
je 0x55565
cmpq %r10, %rsi
movq 0x8(%rsp), %r13
jae 0x55680
xorpd %xmm1, %xmm1
movq %rsi, %r8
cmpl %ebp, (%r14)
jne 0x55344
movl $0xffffffff, (%r14)     # imm = 0xFFFFFFFF
testb $0x1, 0xc(%r14)
jne 0x55338
movq 0x28(%rsp), %rdx
movq (%rdx), %r15
movl 0x4(%r14), %r12d
imulq $0xa8, %r12, %r12
xorl %r13d, %r13d
cmpl $0x0, 0x1c(%r15,%r12)
sete %r13b
movd %r13d, %xmm2
movq 0x8(%rsp), %r13
movaps 0x1dc1e0(%rip), %xmm3   # 0x231510
movss %xmm2, %xmm3            # xmm3 = xmm2[0],xmm3[1,2,3]
paddd %xmm3, %xmm1
incq %r8
addq $0x18, %r14
cmpq %r10, %r8
jb 0x552ec
cmpq %rsi, %r8
jbe 0x55680
movq (%rsp), %r10
cmpq %rcx, %rdi
jae 0x55425
psubd %xmm0, %xmm1
movq (%rsp), %r10
leaq (%rdi,%rdi,4), %r15
cmpl $-0x1, 0x1c(%rbx,%r15,8)
je 0x55419
leaq (%rbx,%r15,8), %r12
leaq (%r10,%r10,4), %r14
movq %r13, %rdx
movq 0x20(%r12), %r13
movq %r13, 0x20(%rbx,%r14,8)
movups (%r12), %xmm2
movups 0x10(%r12), %xmm3
movups %xmm3, 0x10(%rbx,%r14,8)
movups %xmm2, (%rbx,%r14,8)
movq (%rdx), %rbx
addq %r11, %rbx
xorl %ebp, %ebp
movq %rsi, %r12
movl -0x4(%rbx), %r13d
cmpq %r13, %rdi
jne 0x553b7
cmpl $-0x1, -0xc(%rbx)
je 0x553c1
xorl %r13d, %r13d
testb $0x1, (%rbx)
je 0x553c9
jmp 0x553e4
movzbl (%rbx), %r13d
andl $0x1, %r13d
movl %r10d, -0x4(%rbx)
movq 0x8(%rsp), %rdx
movq 0x218(%rdx), %rdx
movl 0x20(%rdx,%r15,8), %edx
movl %edx, -0xc(%rbx)
addl %r13d, %ebp
incq %r12
addq $0x18, %rbx
cmpq %r8, %r12
jb 0x553a8
movq 0x8(%rsp), %r13
movq 0x218(%r13), %rbx
movl %ebp, 0xc(%rbx,%r14,8)
movq %xmm1, 0x4(%rbx,%r14,8)
movl %eax, 0x18(%rbx,%r14,8)
incq %r10
movl $0xffffffff, 0x1c(%rbx,%r14,8) # imm = 0xFFFFFFFF
incq %rdi
cmpq %rcx, %rdi
jne 0x55362
movq (%r13), %rdi
cmpl $-0x1, (%rdi,%r9)
je 0x5544e
leaq (%rdi,%r9), %rdx
leaq (%rax,%rax,2), %r11
incq %rax
movq 0x10(%rdx), %rbx
movq %rbx, 0x10(%rdi,%r11,8)
movdqu (%rdx), %xmm1
movdqu %xmm1, (%rdi,%r11,8)
incq %rsi
addq $0x18, %r9
cmpq %r8, %rsi
jb 0x55425
movq %r10, %rdi
movq (%rsp), %rsi
subq %rsi, %rdi
jbe 0x55554
movq 0x218(%r13), %rdx
movq %rsi, %r9
leaq 0x3(%rdi), %rsi
andq $-0x4, %rsi
decq %rdi
movq %rdi, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
leaq (%r9,%r9,4), %rdi
leaq (%rdx,%rdi,8), %rdx
addq $0x8c, %rdx
pxor %xmm8, %xmm1
xorl %edi, %edi
movq %rdi, %xmm2
pshufd $0x44, %xmm2, %xmm2     # xmm2 = xmm2[0,1,0,1]
movdqa %xmm2, %xmm3
por %xmm7, %xmm3
pxor %xmm8, %xmm3
movdqa %xmm3, %xmm4
pcmpgtd %xmm1, %xmm4
pcmpeqd %xmm1, %xmm3
pshufd $0xf5, %xmm3, %xmm5     # xmm5 = xmm3[1,1,3,3]
pand %xmm4, %xmm5
pshufd $0xf5, %xmm4, %xmm3     # xmm3 = xmm4[1,1,3,3]
por %xmm5, %xmm3
movd %xmm3, %r9d
notl %r9d
testb $0x1, %r9b
je 0x554e5
movl %eax, -0x78(%rdx)
pxor %xmm0, %xmm3
pextrw $0x4, %xmm3, %r9d
testb $0x1, %r9b
je 0x554f8
movl %eax, -0x50(%rdx)
por %xmm6, %xmm2
pxor %xmm8, %xmm2
movdqa %xmm2, %xmm3
pcmpgtd %xmm1, %xmm3
pcmpeqd %xmm1, %xmm2
pshufd $0xf5, %xmm2, %xmm4     # xmm4 = xmm2[1,1,3,3]
pand %xmm3, %xmm4
pshufd $0xf5, %xmm3, %xmm2     # xmm2 = xmm3[1,1,3,3]
por %xmm4, %xmm2
pxor %xmm0, %xmm2
pextrw $0x0, %xmm2, %r9d
testb $0x1, %r9b
je 0x55532
movl %eax, -0x28(%rdx)
pextrw $0x4, %xmm2, %r9d
testb $0x1, %r9b
je 0x55540
movl %eax, (%rdx)
addq $0x4, %rdi
addq $0xa0, %rdx
cmpq %rdi, %rsi
jne 0x5549f
movq %rcx, %rdi
movq %r8, %rsi
movq %r10, (%rsp)
jmp 0x5556d
movq %rcx, %rdi
jmp 0x5556d
movq %rcx, %rdi
movq 0x8(%rsp), %r13
incq %rcx
movq 0x220(%r13), %r8
cmpq %r8, %rcx
jbe 0x55223
movq (%rsp), %rcx
jmp 0x5558a
xorl %ecx, %ecx
xorl %eax, %eax
movq %rcx, 0x220(%r13)
movl %eax, 0x10(%r13)
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1dc9ad(%rip), %rdi    # 0x231f5b
leaq 0x1dc19e(%rip), %rsi    # 0x231753
leaq 0x1dc9dc(%rip), %rcx    # 0x231f98
movl $0x25bc, %edx           # imm = 0x25BC
callq 0x2110
leaq 0x1dc98e(%rip), %rdi    # 0x231f5b
leaq 0x1dc17f(%rip), %rsi    # 0x231753
leaq 0x1dc9bd(%rip), %rcx    # 0x231f98
movl $0x267d, %edx           # imm = 0x267D
callq 0x2110
leaq 0x1dc96f(%rip), %rdi    # 0x231f5b
leaq 0x1dc160(%rip), %rsi    # 0x231753
leaq 0x1dc99e(%rip), %rcx    # 0x231f98
movl $0x263c, %edx           # imm = 0x263C
callq 0x2110
leaq 0x1dca4d(%rip), %rdi    # 0x232058
leaq 0x1dc141(%rip), %rsi    # 0x231753
leaq 0x1dc97f(%rip), %rcx    # 0x231f98
movl $0x2652, %edx           # imm = 0x2652
callq 0x2110
leaq 0x1e02a9(%rip), %rdi    # 0x2358d3
leaq 0x1dc122(%rip), %rsi    # 0x231753
leaq 0x1e02a2(%rip), %rcx    # 0x2358da
movl $0x2589, %edx           # imm = 0x2589
callq 0x2110
leaq 0x1dc9eb(%rip), %rdi    # 0x232034
leaq 0x1dc103(%rip), %rsi    # 0x231753
leaq 0x1dc941(%rip), %rcx    # 0x231f98
movl $0x25da, %edx           # imm = 0x25DA
callq 0x2110
leaq 0x1dc9cc(%rip), %rdi    # 0x232034
leaq 0x1dc0e4(%rip), %rsi    # 0x231753
leaq 0x1dc922(%rip), %rcx    # 0x231f98
movl $0x264b, %edx           # imm = 0x264B
callq 0x2110
leaq 0x1dc9ad(%rip), %rdi    # 0x232034
leaq 0x1dc0c5(%rip), %rsi    # 0x231753
leaq 0x1dc903(%rip), %rcx    # 0x231f98
movl $0x268c, %edx           # imm = 0x268C
callq 0x2110
leaq 0x1dc9aa(%rip), %rdi    # 0x232050
leaq 0x1dc0a6(%rip), %rsi    # 0x231753
leaq 0x1dc8e4(%rip), %rcx    # 0x231f98
movl $0x264d, %edx           # imm = 0x264D
callq 0x2110
leaq 0x1dc976(%rip), %rdi    # 0x23203b
leaq 0x1dc087(%rip), %rsi    # 0x231753
leaq 0x1dc8c5(%rip), %rcx    # 0x231f98
movl $0x264c, %edx           # imm = 0x264C
callq 0x2110