// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/ecovlp.cpp
// Function: h_ec_lchain_fast_new(ha_abuf_s*, unsigned int, UC_Read*, UC_Read*, All_reads*, overlap_region_alloc*, Candidates_list*, bit_extz_t*, asg16_v*, asg64_v*, ma_hit_t_alloc*, ma_hit_t_alloc*, double)
void h_ec_lchain_fast_new(ha_abuf_t *ab, uint32_t rid, UC_Read *qu, UC_Read *tu, All_reads *rref, overlap_region_alloc *ol, Candidates_list *cl, bit_extz_t *exz, asg16_v *buf, asg64_v *srt_i, ma_hit_t_alloc *in0, ma_hit_t_alloc *in1, double sh)
{
    // fprintf(stderr, "-0-[M::%s]\tnew_n::%lu\told_n::%u\n", __func__, ol->length, in0->length + in1->length);
    // fprintf(stderr, "-mm-[M::%s]\tchain_cutoff::%u\n", __func__, chain_cutoff);
    uint64_t on = 0, k, i, l, m, m0, tid, trev, is_match, is_usrt = 0; ma_hit_t *oa = NULL, *p = NULL; overlap_region *z = NULL, t; 
    char* rs = qu->seq; uint64_t rl = qu->length; int64_t om; uint64_t aq[2], at[2], bq[2], bt[2], ovlp, os, oe;
    

    
    ///overlap idx
    srt_i->n = 0;
    oa = in0->buffer; on = in0->length; m0 = 0;
    for (k = 0; k < on; k++) {
        // if(oa[k].el) continue;
        m = oa[k].tn; m <<= 1; m |= ((uint64_t)oa[k].rev); m <<= 32; m |= (k<<1); m |= m0;
        kv_push(uint64_t, *srt_i, m);
    }
    oa = in1->buffer; on = in1->length; m0 = 1;
    for (k = 0; k < on; k++) {
        // if(oa[k].el) continue;
        m = oa[k].tn; m <<= 1; m |= ((uint64_t)oa[k].rev); m <<= 32; m |= (k<<1); m |= m0;
        kv_push(uint64_t, *srt_i, m);
    }
    radix_sort_ec64(srt_i->a, srt_i->a + srt_i->n);

    k = 0; i = 0; 
    for (k = m = 0; k < ol->length; k++) {
        z = &(ol->list[k]); tid = z->y_id; trev = z->y_pos_strand;
        z->non_homopolymer_errors = 0;
        for (; (i < srt_i->n) && ((srt_i->a[i]>>32) < ((tid<<1)|trev)); i++);
        if((i < srt_i->n) && ((srt_i->a[i]>>32) == ((tid<<1)|trev))) {
            om = 1; z->shared_seed = 0; z->is_match = 0;
            if(srt_i->a[i]&1) {
                p = &(in1->buffer[((uint32_t)srt_i->a[i])>>1]); is_match = 2;
            } else {
                p = &(in0->buffer[((uint32_t)srt_i->a[i])>>1]); is_match = 1;
            }
            z->strong = p->ml; z->without_large_indel = p->no_l_indel;
            
            aq[0] = (uint32_t)p->qns; aq[1] = p->qe; 
            at[0] = p->ts; at[1] = p->te;

            bq[0] = z->x_pos_s; bq[1] = z->x_pos_e + 1;
            bt[0] = z->y_pos_s; bt[1] = z->y_pos_e + 1;
            
            os = MAX(aq[0], bq[0]); oe = MIN(aq[1], bq[1]);
            ovlp = ((oe>os)? (oe-os):0);
            if(!((ovlp) && (ovlp >= ((aq[1] - aq[0])*sh)) && ((ovlp >= ((bq[1] - bq[0])*sh))))) om = 0;
            z->non_homopolymer_errors += ((aq[1] - aq[0]) - ovlp);

            os = MAX(at[0], bt[0]); oe = MIN(at[1], bt[1]);
            ovlp = ((oe>os)? (oe-os):0);
            if(!((ovlp) && (ovlp >= ((at[1] - at[0])*sh)) && ((ovlp >= ((bt[1] - bt[0])*sh))))) om = 0;
            z->non_homopolymer_errors += ((at[1] - at[0]) - ovlp);

            if(om) {
                if(is_match == 1 && p->el == 1) p->el = 0;
                resize_UC_Read(tu, bt[1] - bt[0]);
                recover_UC_Read_sub_region(tu->seq, bt[0], bt[1] - bt[0], trev, rref, tid);
                if(exact_ec_check(rs, rl, tu->seq, bt[1] - bt[0], bq[0], bq[1], 0, bt[1] - bt[0])) {
                    if(is_match == 2) {
                        z->strong = 0; z->without_large_indel = 1;
                    }
                    is_match = 1; z->shared_seed = 1;
                }
                z->is_match = is_match;
            }
        } else {
            om = 0;
            bq[0] = z->x_pos_s; bq[1] = z->x_pos_e + 1;
            bt[0] = z->y_pos_s; bt[1] = z->y_pos_e + 1;
            resize_UC_Read(tu, bt[1] - bt[0]);
            recover_UC_Read_sub_region(tu->seq, bt[0], bt[1] - bt[0], trev, rref, tid);
            if(exact_ec_check(rs, rl, tu->seq, bt[1] - bt[0], bq[0], bq[1], 0, bt[1] - bt[0])) {
                z->strong = 0; z->without_large_indel = 1;
                z->shared_seed = 1; z->is_match = 1; om = 1;
            }
        }

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


    oa = in0->buffer; on = in0->length;
    for (k = 0; k < on; k++) {
        if(oa[k].el) {
            // z = &(ol->list[ol->length++]);
            kv_pushp_ol(overlap_region, (*ol), &z);
            clear_fake_cigar(&(z->f_cigar));
            clear_window_list_alloc(&(z->w_list));
            clear_window_list_alloc(&(z->boundary_cigars));
            
            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->align_length = z->overlapLen = z->x_pos_e + 1 - z->x_pos_s;
            z->non_homopolymer_errors = 0;

            z->is_match = 1; z->shared_seed = 1;
            z->strong = oa[k].ml; z->without_large_indel = oa[k].no_l_indel;

            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);

            is_usrt = 1;
            // if(oa[k].tn == 1945) 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);
        }
    }

    if(is_usrt) overlap_region_sort_y_id(ol->list, ol->length);

    if(ol->length > 1) {///for duplicated chains
        uint64_t mm_k, s; int64_t mm_sc, sc;
        for (k = 1, l = m = 0; k <= ol->length; k++) {
            if(k == ol->length || ol->list[k].y_id != ol->list[l].y_id) {
                mm_k = l;
                if(k - l > 1) {
                    for (s = l, mm_sc = INT32_MIN, mm_k = ((uint64_t)-1); s < k; s++) {
                        z = &(ol->list[s]);
                        sc = z->non_homopolymer_errors; sc = - sc;
                        if((sc > mm_sc) || ((sc == mm_sc) && ((ol->list[mm_k].x_pos_e+1-ol->list[mm_k].x_pos_s) < (z->x_pos_e+1-z->x_pos_s)))) {
                            mm_sc = sc; mm_k = s;
                        }
                    }
                }
                if(mm_k != ((uint64_t)-1)) {
                    if(mm_k != m) {
                        t = ol->list[mm_k];
                        ol->list[mm_k] = ol->list[m];
                        ol->list[m] = t;
                    }
                    m++;
                }
                l = k;
            }
        }
        ol->length = m;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movsd %xmm0, 0x28(%rsp)
movq %r9, 0x10(%rsp)
movq %r8, 0x60(%rsp)
movq %rcx, 0x18(%rsp)
movl %esi, 0x4c(%rsp)
movq 0x180(%rsp), %rax
movq 0x178(%rsp), %rdi
movabsq $0x100000000, %rbx      # imm = 0x100000000
movq (%rdx), %rcx
movq %rcx, 0x58(%rsp)
movq $0x0, (%rdi)
movl 0xc(%rax), %r14d
testq %r14, %r14
je 0x186cc8
movq (%rax), %r15
addq %r14, %r14
addq $0xc, %r15
xorl %r12d, %r12d
movl (%r15), %r13d
movq 0xc(%r15), %rbp
movq 0x8(%rdi), %rax
cmpq %rax, (%rdi)
jne 0x186c99
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%rdi)
movq 0x10(%rdi), %rdi
shlq $0x3, %rsi
callq 0x2370
movq 0x178(%rsp), %rdi
movq %rax, 0x10(%rdi)
shlq $0x21, %r13
addq %rbp, %rbp
andq %rbx, %rbp
orq %r13, %rbp
orq %r12, %rbp
movq (%rdi), %rax
movq 0x10(%rdi), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rdi)
movq %rbp, (%rcx,%rax,8)
addq $0x2, %r12
addq $0x28, %r15
cmpq %r12, %r14
jne 0x186c5c
movq 0x188(%rsp), %rax
movl 0xc(%rax), %r14d
testq %r14, %r14
je 0x186d56
movq (%rax), %r15
addq %r14, %r14
addq $0xc, %r15
xorl %r12d, %r12d
movl (%r15), %r13d
movq 0xc(%r15), %rbp
movq 0x8(%rdi), %rax
cmpq %rax, (%rdi)
jne 0x186d23
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rsi
movq %rsi, 0x8(%rdi)
movq 0x10(%rdi), %rdi
shlq $0x3, %rsi
callq 0x2370
movq 0x178(%rsp), %rdi
movq %rax, 0x10(%rdi)
shlq $0x21, %r13
addq %rbp, %rbp
andq %rbx, %rbp
orq %r13, %rbp
orq %r12, %rbp
orq $0x1, %rbp
movq (%rdi), %rax
movq 0x10(%rdi), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rdi)
movq %rbp, (%rcx,%rax,8)
addq $0x2, %r12
addq $0x28, %r15
cmpq %r12, %r14
jne 0x186ce6
movq (%rdi), %rax
movq 0x10(%rdi), %rdi
leaq (%rdi,%rax,8), %rsi
callq 0x178fc2
movq 0x10(%rsp), %r12
cmpq $0x0, 0x10(%r12)
je 0x187241
xorl %ebx, %ebx
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x178(%rsp), %r8
movq (%r12), %rax
imulq $0xa8, %rbx, %r12
leaq (%rax,%r12), %r11
movl 0x10(%rax,%r12), %r9d
movl 0x1c(%rax,%r12), %r10d
movl $0x0, 0x30(%rax,%r12)
movq (%r8), %rcx
cmpq %rcx, %r13
setb %sil
movq %rbp, 0x20(%rsp)
movq %r12, 0x78(%rsp)
movq %r11, 0x30(%rsp)
jae 0x1870c4
movq 0x10(%r8), %rdx
leaq (%r9,%r9), %rax
orq %r10, %rax
movl 0x4(%rdx,%r13,8), %edi
cmpq %rax, %rdi
jae 0x186dfd
leaq -0x1(%rcx), %rsi
cmpq %r13, %rsi
je 0x1870c1
movl 0xc(%rdx,%r13,8), %edi
incq %r13
cmpq %rax, %rdi
jb 0x186de0
cmpq %rcx, %r13
setb %sil
testb %sil, %sil
je 0x1870c4
movq 0x10(%r8), %rcx
movq (%rcx,%r13,8), %rdx
movq %rdx, %rcx
shrq $0x20, %rcx
cmpq %rax, %rcx
jne 0x1870c4
movq %r10, 0x40(%rsp)
movq %r9, 0x68(%rsp)
movl $0x0, 0x24(%r11)
movl %edx, %eax
andl $0x1, %eax
movq %rdx, 0x70(%rsp)
movl %edx, %ecx
shrl %ecx
movq %rax, 0x8(%rsp)
testq %rax, %rax
movq 0x188(%rsp), %rax
cmoveq 0x180(%rsp), %rax
movb $0x0, 0x2c(%r11)
movq (%rax), %rax
leaq (%rcx,%rcx,4), %rcx
movl 0x18(%rax,%rcx,8), %edx
shrl $0x1e, %edx
andb $0x1, %dl
movb %dl, 0x2e(%r11)
movb 0x21(%rax,%rcx,8), %dl
movb %dl, 0x2d(%r11)
movq (%rax,%rcx,8), %rdi
movl %edi, %esi
movl 0x8(%rax,%rcx,8), %edx
movl 0x4(%r11), %r8d
movl 0x8(%r11), %ebp
incl %ebp
cmpq %r8, %rsi
movq %r8, 0x50(%rsp)
cmovaq %rsi, %r8
cmpq %rbp, %rdx
movq %rbp, %r9
cmovbq %rdx, %r9
movl $0x0, %r15d
subq %r8, %r9
cmovaeq %r9, %r15
jbe 0x186f24
cvtsi2sd %r15, %xmm0
movq %rdx, %r8
subq %rsi, %r8
movq %r8, %xmm1
punpckldq 0x9e376(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x9e37e(%rip), %xmm1    # 0x225250
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
mulsd 0x28(%rsp), %xmm2
ucomisd %xmm2, %xmm0
jb 0x186f24
movq %rbp, %rsi
subq 0x50(%rsp), %rsi
movq %rsi, %xmm1
punpckldq 0x9e341(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x9e349(%rip), %xmm1    # 0x225250
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
mulsd 0x28(%rsp), %xmm2
movl $0x1, %esi
ucomisd %xmm2, %xmm0
jae 0x186f26
xorl %esi, %esi
movl 0x10(%rax,%rcx,8), %r9d
movl 0x14(%rax,%rcx,8), %r8d
movl 0x14(%r11), %r10d
movl 0x18(%r11), %r14d
incl %r14d
addl %edi, %r15d
subl %r15d, %edx
movl %edx, 0x30(%r11)
cmpq %r10, %r9
movq %r10, 0x38(%rsp)
cmovaq %r9, %r10
cmpq %r14, %r8
movq %r14, %r11
cmovbq %r8, %r11
movl $0x0, %edi
subq %r10, %r11
cmovaeq %r11, %rdi
jbe 0x186fd9
xorps %xmm0, %xmm0
cvtsi2sd %rdi, %xmm0
movq %r8, %r10
subq %r9, %r10
movq %r10, %xmm1
punpckldq 0x9e2bc(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x9e2c4(%rip), %xmm1    # 0x225250
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
mulsd 0x28(%rsp), %xmm2
ucomisd %xmm2, %xmm0
jb 0x186fd9
movq %r14, %r10
subq 0x38(%rsp), %r10
movq %r10, %xmm1
punpckldq 0x9e287(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x9e28f(%rip), %xmm1    # 0x225250
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
mulsd 0x28(%rsp), %xmm2
ucomisd %xmm2, %xmm0
jae 0x186fdb
xorl %esi, %esi
addl %r9d, %edi
subl %edi, %r8d
addl %edx, %r8d
movq 0x30(%rsp), %rdx
movl %r8d, 0x30(%rdx)
testq %rsi, %rsi
movq 0x70(%rsp), %r15
je 0x187198
testb $0x1, %r15b
jne 0x18700f
leaq (%rax,%rcx,8), %rax
cmpb $0x1, 0x20(%rax)
jne 0x18700f
movb $0x0, 0x20(%rax)
subq 0x38(%rsp), %r14
movq 0x18(%rsp), %r12
cmpq %r14, 0x10(%r12)
jge 0x18703a
movq (%r12), %rdi
movq %r14, %rsi
callq 0x2370
movq 0x18(%rsp), %r12
movq %rax, (%r12)
movq %r14, 0x10(%r12)
movq 0x8(%rsp), %rax
incb %al
movq %rax, 0x8(%rsp)
movq (%r12), %rdi
movzbl 0x40(%rsp), %ecx
movq 0x38(%rsp), %rsi
movq %r14, %rdx
movq 0x60(%rsp), %r8
movq 0x68(%rsp), %r9
callq 0x337f7
movq 0x50(%rsp), %rdi
subq %rdi, %rbp
cmpq %r14, %rbp
jne 0x1871a7
movq (%r12), %rsi
addq 0x58(%rsp), %rdi
movq %rbp, %rdx
callq 0x21a0
testl %eax, %eax
movq 0x178(%rsp), %r8
movq 0x20(%rsp), %rbp
movq 0x30(%rsp), %rax
movq 0x8(%rsp), %rcx
jne 0x1871be
testb $0x1, %r15b
je 0x1870b3
movw $0x1, 0x2d(%rax)
movl $0x1, 0x24(%rax)
movb $0x1, %cl
jmp 0x1871be
movq %rcx, %r13
movq 0x18(%rsp), %rcx
movq %rbx, 0x8(%rsp)
movl 0x4(%r11), %ebp
movl 0x8(%r11), %r14d
movl 0x14(%r11), %r12d
movl 0x18(%r11), %r15d
incl %r15d
subq %r12, %r15
cmpq %r15, 0x10(%rcx)
jge 0x187111
movq (%rcx), %rdi
movq %r15, %rsi
movq %r9, %rbx
movq %r10, 0x40(%rsp)
callq 0x2370
movq 0x40(%rsp), %r10
movq %rbx, %r9
movq 0x18(%rsp), %rcx
movq %rax, (%rcx)
movq %r15, 0x10(%rcx)
incl %r14d
movq (%rcx), %rdi
movq %rcx, %rbx
movzbl %r10b, %ecx
movq %r12, %rsi
movq %r15, %rdx
movq 0x60(%rsp), %r8
callq 0x337f7
subq %rbp, %r14
cmpq %r15, %r14
jne 0x18717c
movq (%rbx), %rsi
addq 0x58(%rsp), %rbp
movq %rbp, %rdi
movq %r14, %rdx
callq 0x21a0
testl %eax, %eax
movq 0x10(%rsp), %r12
jne 0x187181
movq 0x30(%rsp), %rax
movb $0x0, 0x2e(%rax)
movl $0x1, 0x24(%rax)
movw $0x101, 0x2c(%rax)      # imm = 0x101
movq 0x178(%rsp), %r8
movq 0x8(%rsp), %rbx
movq 0x20(%rsp), %rbp
jmp 0x1871c6
movq 0x10(%rsp), %r12
movq 0x178(%rsp), %r8
movq 0x8(%rsp), %rbx
movq 0x20(%rsp), %rbp
jmp 0x187231
movq 0x10(%rsp), %r12
movq 0x178(%rsp), %r8
jmp 0x18718e
movq 0x178(%rsp), %r8
movq 0x20(%rsp), %rbp
movq 0x30(%rsp), %rax
movq 0x8(%rsp), %rcx
movb %cl, 0x2c(%rax)
movq 0x10(%rsp), %r12
cmpq %rbx, %rbp
je 0x18722e
movq (%r12), %rax
movq %rax, 0x8(%rsp)
imulq $0xa8, %rbp, %r15
addq %rax, %r15
movl $0xa8, %edx
leaq 0x80(%rsp), %rdi
movq %r15, %rsi
callq 0x2160
movq 0x78(%rsp), %r14
movq 0x8(%rsp), %rsi
addq %r14, %rsi
movl $0xa8, %edx
movq %r15, %rdi
callq 0x2160
addq (%r12), %r14
movl $0xa8, %edx
movq %r14, %rdi
leaq 0x80(%rsp), %rsi
callq 0x2160
movq 0x178(%rsp), %r8
incq %rbp
incq %rbx
cmpq 0x10(%r12), %rbx
jb 0x186d86
jmp 0x187243
xorl %ebp, %ebp
movq %rbp, 0x10(%r12)
movq 0x180(%rsp), %rcx
movl 0xc(%rcx), %eax
testq %rax, %rax
je 0x187406
movq (%rcx), %rbx
shlq $0x3, %rax
leaq (%rax,%rax,4), %r13
xorl %r14d, %r14d
xorl %eax, %eax
cmpb $0x0, 0x20(%rbx,%r14)
je 0x1873e6
movq 0x8(%r12), %rax
cmpq %rax, 0x10(%r12)
jne 0x1872dc
movq (%r12), %rdi
imulq $0x150, %rax, %rsi      # imm = 0x150
testq %rax, %rax
movl $0x150, %eax            # imm = 0x150
cmoveq %rax, %rsi
callq 0x2370
movq %rax, (%r12)
movq 0x8(%r12), %rcx
imulq $0xa8, %rcx, %rdi
addq %rax, %rdi
leaq (%rcx,%rcx), %r15
testq %rcx, %rcx
movl $0x2, %eax
cmoveq %rax, %r15
movq %r15, %rax
subq %rcx, %rax
imulq $0xa8, %rax, %rdx
xorl %esi, %esi
callq 0x20e0
movq %r15, 0x8(%r12)
movq 0x10(%rsp), %rax
movq (%rax), %r12
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
leaq 0x1(%rax), %rcx
movq 0x10(%rsp), %rdx
movq %rcx, 0x10(%rdx)
imulq $0xa8, %rax, %rbp
leaq (%r12,%rbp), %r15
leaq (%r12,%rbp), %rdi
addq $0x38, %rdi
callq 0x3db73
leaq (%r12,%rbp), %rdi
addq $0x48, %rdi
callq 0x3db7b
addq %rbp, %r12
addq $0x78, %r12
movq %r12, %rdi
callq 0x3db7b
movl 0x4c(%rsp), %eax
movl %eax, -0x78(%r12)
movl 0xc(%rbx,%r14), %eax
movl %eax, -0x68(%r12)
xorl %r9d, %r9d
movl %r9d, -0x6c(%r12)
movl 0x18(%rbx,%r14), %eax
shrl $0x1f, %eax
movl %eax, -0x5c(%r12)
movq (%rbx,%r14), %rax
movl %eax, %esi
movl %eax, -0x74(%r12)
movl 0x8(%rbx,%r14), %edx
leal -0x1(%rdx), %ecx
movl %ecx, -0x70(%r12)
movl 0x10(%rbx,%r14), %ecx
movl %ecx, -0x64(%r12)
movl 0x14(%rbx,%r14), %r8d
leal -0x1(%r8), %edi
movl %edi, -0x60(%r12)
movl %edx, %edi
subl %eax, %edi
movl %edi, -0x58(%r12)
movl %edi, -0x50(%r12)
movl %r9d, -0x48(%r12)
movb $0x1, -0x4c(%r12)
movl $0x1, -0x54(%r12)
movl 0x18(%rbx,%r14), %eax
shrl $0x1e, %eax
andb $0x1, %al
movb %al, -0x4a(%r12)
movb 0x21(%rbx,%r14), %al
movb %al, -0x4b(%r12)
movq 0x10(%rsp), %r12
movq 0x168(%rsp), %rbp
movq %rbp, %rdi
callq 0x666da
movq %r15, %rdi
movq %rbp, %rsi
callq 0x65d35
movl $0x1, %eax
addq $0x28, %r14
cmpq %r14, %r13
jne 0x18726c
testq %rax, %rax
je 0x187406
movq (%r12), %rdi
movq 0x10(%r12), %rsi
callq 0x3daa2
cmpq $0x2, 0x10(%r12)
jb 0x187558
movq 0x10(%r12), %rcx
testq %rcx, %rcx
je 0x187551
movl $0x1, %ebx
xorl %eax, %eax
leaq 0x80(%rsp), %r14
xorl %ebp, %ebp
cmpq %rcx, %rbx
je 0x187456
movq (%r12), %rcx
imulq $0xa8, %rbx, %rdx
movl 0x10(%rcx,%rdx), %edx
imulq $0xa8, %rax, %rsi
cmpl 0x10(%rcx,%rsi), %edx
je 0x18753e
movq %rbx, %rcx
subq %rax, %rcx
cmpq $0x2, %rcx
jb 0x1874d9
movq $-0x1, %rcx
cmpq %rax, %rbx
jbe 0x1874dc
movq (%r12), %rdx
imulq $0xa8, %rax, %rcx
leaq (%rdx,%rcx), %rsi
addq $0x4, %rsi
movq $-0x1, %rcx
movq $-0x80000000, %rdi      # imm = 0x80000000
movl 0x2c(%rsi), %r8d
negq %r8
cmpq %r8, %rdi
jge 0x1874a3
movq %rax, %rcx
movq %r8, %rdi
jmp 0x1874c8
jne 0x1874c8
imulq $0xa8, %rcx, %r9
movl 0x8(%rdx,%r9), %r10d
subl 0x4(%rdx,%r9), %r10d
incl %r10d
movl 0x4(%rsi), %r9d
subl (%rsi), %r9d
incl %r9d
cmpl %r9d, %r10d
jb 0x18749b
incq %rax
addq $0xa8, %rsi
cmpq %rax, %rbx
jne 0x18748f
jmp 0x1874dc
movq %rax, %rcx
cmpq $-0x1, %rcx
je 0x18753b
cmpq %rbp, %rcx
je 0x187538
movq (%r12), %r15
imulq $0xa8, %rcx, %r12
addq %r15, %r12
movl $0xa8, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x2160
imulq $0xa8, %rbp, %r13
addq %r13, %r15
movl $0xa8, %edx
movq %r12, %rdi
movq 0x10(%rsp), %r12
movq %r15, %rsi
callq 0x2160
addq (%r12), %r13
movl $0xa8, %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x2160
incq %rbp
movq %rbx, %rax
incq %rbx
movq 0x10(%r12), %rcx
cmpq %rcx, %rbx
jbe 0x187431
jmp 0x187553
xorl %ebp, %ebp
movq %rbp, 0x10(%r12)
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq