// File: /workspace/github_cpp_makefile_star2_O2/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, 0x20(%rsp)
movq %r9, 0x8(%rsp)
movq %r8, 0x68(%rsp)
movq %rcx, (%rsp)
movl %esi, 0x4c(%rsp)
movq 0x180(%rsp), %rax
movq 0x178(%rsp), %rbx
movq (%rdx), %rcx
movq %rcx, 0x60(%rsp)
andq $0x0, (%rbx)
movabsq $0x100000000, %rsi      # imm = 0x100000000
movq (%rax), %r15
movl 0xc(%rax), %r12d
addq %r12, %r12
addq $0xc, %r15
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x1493e7
movl (%r15), %r14d
movq 0xc(%r15), %rbp
movq (%rbx), %rcx
movq 0x10(%rbx), %rax
cmpq 0x8(%rbx), %rcx
jne 0x1493c2
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%rbx)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movabsq $0x100000000, %rsi      # imm = 0x100000000
movq %rax, 0x10(%rbx)
movq (%rbx), %rcx
shlq $0x21, %r14
addq %rbp, %rbp
andq %rsi, %rbp
orq %r14, %rbp
orq %r13, %rbp
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
movq %rbp, (%rax,%rcx,8)
addq $0x2, %r13
addq $0x28, %r15
jmp 0x14937a
movq 0x188(%rsp), %rax
movq (%rax), %r15
movl 0xc(%rax), %r12d
addq %r12, %r12
addq $0xc, %r15
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x149471
movl (%r15), %r14d
movq 0xc(%r15), %rbp
movq (%rbx), %rcx
movq 0x10(%rbx), %rax
cmpq 0x8(%rbx), %rcx
jne 0x149448
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%rbx)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movabsq $0x100000000, %rsi      # imm = 0x100000000
movq %rax, 0x10(%rbx)
movq (%rbx), %rcx
shlq $0x21, %r14
addq %rbp, %rbp
andq %rsi, %rbp
orq %r14, %rbp
orq %r13, %rbp
orq $0x1, %rbp
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
movq %rbp, (%rax,%rcx,8)
addq $0x2, %r13
addq $0x28, %r15
jmp 0x149400
movq (%rbx), %rax
movq 0x10(%rbx), %rdi
leaq (%rdi,%rax,8), %rsi
callq 0x13d044
xorl %ebp, %ebp
xorl %r13d, %r13d
xorl %ecx, %ecx
movq 0x8(%rsp), %r12
movq (%rsp), %rdi
cmpq 0x10(%r12), %rcx
jae 0x1498e9
movq (%r12), %rax
movq %rcx, 0x10(%rsp)
imulq $0xa8, %rcx, %rcx
movl 0x10(%rax,%rcx), %edx
movl 0x1c(%rax,%rcx), %esi
andl $0x0, 0x30(%rax,%rcx)
movq %rcx, 0x78(%rsp)
leaq (%rax,%rcx), %r11
movq (%rbx), %rax
movq %rdx, 0x38(%rsp)
leaq (%rdx,%rdx), %rcx
movq %rsi, 0x70(%rsp)
orq %rsi, %rcx
cmpq %rax, %r13
cmovaq %r13, %rax
movq %rbp, 0x18(%rsp)
movq %r11, 0x30(%rsp)
cmpq %r13, %rax
je 0x149505
movq 0x10(%rbx), %rdx
movq (%rdx,%r13,8), %r15
movq %r15, %rdx
shrq $0x20, %rdx
cmpq %rcx, %rdx
jae 0x14950d
incq %r13
jmp 0x1494e7
movq %rax, %r13
jmp 0x14978f
jne 0x14978f
andl $0x0, 0x24(%r11)
movl %r15d, %eax
andl $0x1, %eax
movl %r15d, %ecx
shrl %ecx
movq %rax, 0x28(%rsp)
testq %rax, %rax
movq 0x188(%rsp), %rax
cmoveq 0x180(%rsp), %rax
movb $0x0, 0x2c(%r11)
movq (%rax), %rax
imulq $0x28, %rcx, %rcx
movl 0x18(%rax,%rcx), %edx
shrl $0x1e, %edx
andb $0x1, %dl
movb %dl, 0x2e(%r11)
movb 0x21(%rax,%rcx), %dl
movb %dl, 0x2d(%r11)
movq (%rax,%rcx), %rsi
movl %esi, %r8d
movl 0x8(%rax,%rcx), %edx
movl 0x4(%r11), %r9d
movl 0x8(%r11), %r10d
incl %r10d
cmpq %r9, %r8
movq %r9, 0x50(%rsp)
cmovaq %r8, %r9
cmpq %r10, %rdx
movq %r10, 0x58(%rsp)
cmovbq %rdx, %r10
movl $0x0, %edi
subq %r9, %r10
cmovaeq %r10, %rdi
jbe 0x14960d
cvtsi2sd %rdi, %xmm0
movq %rdx, %r9
subq %r8, %r9
movq %r9, %xmm1
punpckldq 0x99cbe(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x99cc6(%rip), %xmm1    # 0x1e3280
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
mulsd 0x20(%rsp), %xmm2
ucomisd %xmm2, %xmm0
jb 0x14960d
movq 0x58(%rsp), %r8
subq 0x50(%rsp), %r8
movq %r8, %xmm1
punpckldq 0x99c87(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x99c8f(%rip), %xmm1    # 0x1e3280
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
mulsd 0x20(%rsp), %xmm2
ucomisd %xmm2, %xmm0
pushq $0x1
popq %r8
jae 0x149610
xorl %r8d, %r8d
movl 0x10(%rax,%rcx), %r10d
movl 0x14(%rax,%rcx), %r9d
movl 0x14(%r11), %r14d
movl 0x18(%r11), %ebp
incl %ebp
cmpq %r14, %r10
movq %r14, 0x40(%rsp)
cmovaq %r10, %r14
cmpq %rbp, %r9
movq %rbp, %r12
cmovbq %r9, %r12
movl $0x0, %r11d
subq %r14, %r12
cmovaeq %r12, %r11
jbe 0x1496b6
cvtsi2sd %r11, %xmm0
movq %r9, %r14
subq %r10, %r14
movq %r14, %xmm1
punpckldq 0x99c0f(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x99c17(%rip), %xmm1    # 0x1e3280
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
mulsd 0x20(%rsp), %xmm2
ucomisd %xmm2, %xmm0
jb 0x1496b6
movq %rbp, %r14
subq 0x40(%rsp), %r14
movq %r14, %xmm1
punpckldq 0x99bda(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x99be2(%rip), %xmm1    # 0x1e3280
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
mulsd 0x20(%rsp), %xmm2
ucomisd %xmm2, %xmm0
jae 0x1496b9
xorl %r8d, %r8d
addl %esi, %edi
subl %edi, %edx
addl %r10d, %r11d
subl %r11d, %r9d
addl %edx, %r9d
movq 0x30(%rsp), %rdx
movl %r9d, 0x30(%rdx)
testq %r8, %r8
movq 0x8(%rsp), %r12
je 0x149854
testb $0x1, %r15b
movq (%rsp), %r14
jne 0x1496f4
addq %rcx, %rax
cmpb $0x1, 0x20(%rax)
jne 0x1496f4
movb $0x0, 0x20(%rax)
movq 0x28(%rsp), %rax
incb %al
movq %rax, 0x28(%rsp)
subq 0x40(%rsp), %rbp
movq %r14, %rdi
movq %rbp, %rsi
callq 0x562fa
movq (%r14), %rdi
movzbl 0x70(%rsp), %ecx
movq 0x40(%rsp), %rsi
movq %rbp, %rdx
movq 0x68(%rsp), %r8
movq 0x38(%rsp), %r9
callq 0x6c9e
movq 0x58(%rsp), %rdx
movq 0x50(%rsp), %rdi
subq %rdi, %rdx
cmpq %rbp, %rdx
jne 0x14985a
movq (%rsp), %r14
movq (%r14), %rsi
addq 0x60(%rsp), %rdi
callq 0x21a0
testl %eax, %eax
movq %r14, %rdi
movq 0x18(%rsp), %rbp
movq 0x10(%rsp), %rcx
movq 0x30(%rsp), %rax
movq 0x28(%rsp), %rdx
jne 0x149872
testb $0x1, %r15b
je 0x149781
movw $0x1, 0x2d(%rax)
movl $0x1, 0x24(%rax)
movb $0x1, %dl
jmp 0x149872
movl 0x4(%r11), %r15d
movl 0x8(%r11), %r14d
incl %r14d
movl 0x14(%r11), %ebp
movl 0x18(%r11), %r12d
incl %r12d
subq %rbp, %r12
movq %rdi, %rbx
movq %r12, %rsi
callq 0x562fa
movq (%rbx), %rdi
movzbl 0x70(%rsp), %ecx
movq %rbp, %rsi
movq %r12, %rdx
movq 0x68(%rsp), %r8
movq 0x38(%rsp), %r9
callq 0x6c9e
subq %r15, %r14
cmpq %r12, %r14
jne 0x149807
movq (%rbx), %rsi
addq 0x60(%rsp), %r15
movq %r15, %rdi
movq %r12, %rdx
callq 0x21a0
testl %eax, %eax
movq 0x18(%rsp), %rbp
je 0x149826
movq 0x8(%rsp), %r12
movq (%rsp), %rdi
movq 0x178(%rsp), %rbx
jmp 0x14981c
movq 0x8(%rsp), %r12
movq %rbx, %rdi
movq 0x178(%rsp), %rbx
movq 0x18(%rsp), %rbp
movq 0x10(%rsp), %rcx
jmp 0x1498e1
movq 0x30(%rsp), %rax
movb $0x0, 0x2e(%rax)
movl $0x1, 0x24(%rax)
movw $0x101, 0x2c(%rax)      # imm = 0x101
movq 0x8(%rsp), %r12
movq (%rsp), %rdi
movq 0x178(%rsp), %rbx
movq 0x10(%rsp), %rcx
jmp 0x149875
movq (%rsp), %rdi
jmp 0x149817
movq (%rsp), %rdi
movq 0x18(%rsp), %rbp
movq 0x10(%rsp), %rcx
movq 0x30(%rsp), %rax
movq 0x28(%rsp), %rdx
movb %dl, 0x2c(%rax)
cmpq %rcx, %rbp
je 0x1498de
movq (%r12), %rax
movq %rax, 0x38(%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 0x38(%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 0x10(%rsp), %rcx
movq (%rsp), %rdi
incq %rbp
incq %rcx
jmp 0x149491
movq %rbp, 0x10(%r12)
movq 0x180(%rsp), %rax
movq (%rax), %rbx
movl 0xc(%rax), %eax
imulq $0x28, %rax, %r12
xorl %r13d, %r13d
xorl %eax, %eax
cmpq %r13, %r12
je 0x149a6d
cmpb $0x0, 0x20(%rbx,%r13)
je 0x149a64
movq 0x8(%rsp), %rbp
movq (%rbp), %r15
movq 0x10(%rbp), %rax
cmpq 0x8(%rbp), %rax
jne 0x149987
imulq $0x150, %rax, %rsi      # imm = 0x150
testq %rax, %rax
movl $0x150, %eax            # imm = 0x150
cmoveq %rax, %rsi
movq %r15, %rdi
callq 0x2370
movq %rax, %r15
movq %rax, (%rbp)
movq 0x8(%rbp), %rax
imulq $0xa8, %rax, %rdi
addq %r15, %rdi
leaq (%rax,%rax), %r14
testq %rax, %rax
pushq $0x2
popq %rcx
cmoveq %rcx, %r14
movq %r14, %rcx
subq %rax, %rcx
imulq $0xa8, %rcx, %rdx
xorl %esi, %esi
callq 0x20e0
movq %r14, 0x8(%rbp)
movq 0x10(%rbp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x10(%rbp)
imulq $0xa8, %rax, %rbp
leaq (%r15,%rbp), %r14
leaq (%r15,%rbp), %rdi
addq $0x38, %rdi
callq 0x11976
leaq (%r15,%rbp), %rdi
addq $0x48, %rdi
callq 0x1197b
addq %rbp, %r15
addq $0x78, %r15
movq %r15, %rdi
callq 0x1197b
movl 0x4c(%rsp), %eax
movl %eax, -0x78(%r15)
movl 0xc(%rbx,%r13), %eax
movl %eax, -0x68(%r15)
andl $0x0, -0x6c(%r15)
movl 0x18(%rbx,%r13), %eax
shrl $0x1f, %eax
movl %eax, -0x5c(%r15)
movq (%rbx,%r13), %rax
movl %eax, %esi
movl %eax, -0x74(%r15)
movl 0x8(%rbx,%r13), %edx
leal -0x1(%rdx), %ecx
movl %ecx, -0x70(%r15)
movl 0x10(%rbx,%r13), %ecx
movl %ecx, -0x64(%r15)
movl 0x14(%rbx,%r13), %r8d
leal -0x1(%r8), %edi
movl %edi, -0x60(%r15)
movl %edx, %edi
subl %eax, %edi
movl %edi, -0x58(%r15)
movl %edi, -0x50(%r15)
andl $0x0, -0x48(%r15)
movb $0x1, -0x4c(%r15)
movl $0x1, -0x54(%r15)
movl 0x18(%rbx,%r13), %eax
shrl $0x1e, %eax
andb $0x1, %al
movb %al, -0x4a(%r15)
movb 0x21(%rbx,%r13), %al
movb %al, -0x4b(%r15)
movq 0x168(%rsp), %r15
movq %r15, %rdi
callq 0x352b9
movq %r14, %rdi
movq %r15, %rsi
callq 0x34955
pushq $0x1
popq %rax
addq $0x28, %r13
jmp 0x149905
movq 0x8(%rsp), %r12
movq 0x10(%r12), %rsi
testq %rax, %rax
je 0x149a8a
movq (%r12), %rdi
callq 0x1188f
movq 0x10(%r12), %rsi
cmpq $0x2, %rsi
jb 0x149bb7
pushq $0x1
popq %rbp
xorl %ebx, %ebx
leaq 0x80(%rsp), %r14
xorl %eax, %eax
cmpq %rsi, %rbp
ja 0x149bb2
je 0x149ace
movq (%r12), %rcx
imulq $0xa8, %rbp, %rdx
movl 0x10(%rcx,%rdx), %edx
imulq $0xa8, %rax, %rdi
cmpl 0x10(%rcx,%rdi), %edx
je 0x149baa
movq %rbp, %rcx
subq %rax, %rcx
cmpq $0x2, %rcx
jb 0x149b43
imulq $0xa8, %rax, %rcx
orq $0x4, %rcx
movq $-0x80000000, %rdi      # imm = 0x80000000
pushq $-0x1
popq %rdx
cmpq %rbp, %rax
jae 0x149b40
movq (%r12), %r9
movl 0x2c(%r9,%rcx), %r8d
negq %r8
cmpq %r8, %rdi
jge 0x149b0d
movq %rax, %rdx
movq %r8, %rdi
jmp 0x149b34
jne 0x149b34
imulq $0xa8, %rdx, %r10
movl 0x8(%r9,%r10), %r11d
subl 0x4(%r9,%r10), %r11d
incl %r11d
movl 0x4(%r9,%rcx), %r10d
subl (%r9,%rcx), %r10d
incl %r10d
cmpl %r10d, %r11d
jb 0x149b05
incq %rax
addq $0xa8, %rcx
jmp 0x149aef
movq %rdx, %rax
cmpq $-0x1, %rax
je 0x149ba7
cmpq %rbx, %rax
je 0x149ba4
movq (%r12), %r15
imulq $0xa8, %rax, %r12
addq %r15, %r12
movl $0xa8, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x2160
imulq $0xa8, %rbx, %r13
addq %r13, %r15
movl $0xa8, %edx
movq %r12, %rdi
movq 0x8(%rsp), %r12
movq %r15, %rsi
callq 0x2160
addq (%r12), %r13
movl $0xa8, %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x2160
movq 0x10(%r12), %rsi
incq %rbx
movq %rbp, %rax
incq %rbp
jmp 0x149aa3
movq %rbx, 0x10(%r12)
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq