// File: 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
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
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, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movsd %xmm0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x88(%rbp)
movq $0x0, -0x90(%rbp)
movq $0x0, -0x98(%rbp)
movq $0x0, -0xa0(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x150(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x158(%rbp)
movq 0x28(%rbp), %rax
movq $0x0, (%rax)
movq 0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x90(%rbp)
movq 0x30(%rbp), %rax
movl 0xc(%rax), %eax
movq %rax, -0x40(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x262094
movq -0x90(%rbp), %rax
imulq $0x28, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
shlq %rax
movq %rax, -0x60(%rbp)
movq -0x90(%rbp), %rax
imulq $0x28, -0x48(%rbp), %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %eax
orq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %rax
shlq %rax
orq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x68(%rbp), %rax
orq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movq 0x28(%rbp), %rax
movq (%rax), %rax
movq 0x28(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x262060
movq 0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x26201f
movq 0x28(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x1e0(%rbp)
jmp 0x26202d
movl $0x2, %eax
movq %rax, -0x1e0(%rbp)
jmp 0x26202d
movq -0x1e0(%rbp), %rcx
movq 0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x28(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x60(%rbp), %rdx
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x262083
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x261f74
movq 0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x90(%rbp)
movq 0x38(%rbp), %rax
movl 0xc(%rax), %eax
movq %rax, -0x40(%rbp)
movq $0x1, -0x68(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x2621dd
movq -0x90(%rbp), %rax
imulq $0x28, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
shlq %rax
movq %rax, -0x60(%rbp)
movq -0x90(%rbp), %rax
imulq $0x28, -0x48(%rbp), %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x1f, %rax
andq $0x1, %rax
movl %eax, %eax
orq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %rax
shlq %rax
orq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x68(%rbp), %rax
orq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movq 0x28(%rbp), %rax
movq (%rax), %rax
movq 0x28(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x2621a9
movq 0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x262168
movq 0x28(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x1e8(%rbp)
jmp 0x262176
movl $0x2, %eax
movq %rax, -0x1e8(%rbp)
jmp 0x262176
movq -0x1e8(%rbp), %rcx
movq 0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x28(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x60(%rbp), %rdx
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x2621cc
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x2620bd
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rsi
movq 0x28(%rbp), %rax
movq (%rax), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x24aba0
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x262ad1
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x48(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movl 0x10(%rax), %eax
movq %rax, -0x70(%rbp)
movq -0xa0(%rbp), %rax
movl 0x1c(%rax), %eax
movq %rax, -0x78(%rbp)
movq -0xa0(%rbp), %rax
movl $0x0, 0x30(%rax)
movq -0x50(%rbp), %rcx
movq 0x28(%rbp), %rdx
xorl %eax, %eax
cmpq (%rdx), %rcx
movb %al, -0x1e9(%rbp)
jae 0x2622b5
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movq -0x70(%rbp), %rcx
shlq %rcx
orq -0x78(%rbp), %rcx
cmpq %rcx, %rax
setb %al
movb %al, -0x1e9(%rbp)
movb -0x1e9(%rbp), %al
testb $0x1, %al
jne 0x2622c1
jmp 0x2622d1
jmp 0x2622c3
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x262275
movq -0x50(%rbp), %rax
movq 0x28(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x2628f0
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movq -0x70(%rbp), %rcx
shlq %rcx
orq -0x78(%rbp), %rcx
cmpq %rcx, %rax
jne 0x2628f0
movq $0x1, -0x160(%rbp)
movq -0xa0(%rbp), %rax
movl $0x0, 0x24(%rax)
movq -0xa0(%rbp), %rax
movb $0x0, 0x2c(%rax)
movq 0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x26237b
movq 0x38(%rbp), %rax
movq (%rax), %rax
movq 0x28(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x50(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
movq $0x2, -0x80(%rbp)
jmp 0x2623ac
movq 0x30(%rbp), %rax
movq (%rax), %rax
movq 0x28(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x50(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
movq $0x1, -0x80(%rbp)
movq -0x98(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x1e, %rax
andq $0x1, %rax
movb %al, %cl
movq -0xa0(%rbp), %rax
movb %cl, 0x2e(%rax)
movq -0x98(%rbp), %rax
movb 0x21(%rax), %cl
movq -0xa0(%rbp), %rax
movb %cl, 0x2d(%rax)
movq -0x98(%rbp), %rax
movq (%rax), %rax
movl %eax, %eax
movq %rax, -0x170(%rbp)
movq -0x98(%rbp), %rax
movl 0x8(%rax), %eax
movq %rax, -0x168(%rbp)
movq -0x98(%rbp), %rax
movl 0x10(%rax), %eax
movq %rax, -0x180(%rbp)
movq -0x98(%rbp), %rax
movl 0x14(%rax), %eax
movq %rax, -0x178(%rbp)
movq -0xa0(%rbp), %rax
movl 0x4(%rax), %eax
movq %rax, -0x190(%rbp)
movq -0xa0(%rbp), %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movq %rax, -0x188(%rbp)
movq -0xa0(%rbp), %rax
movl 0x14(%rax), %eax
movq %rax, -0x1a0(%rbp)
movq -0xa0(%rbp), %rax
movl 0x18(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movq %rax, -0x198(%rbp)
movq -0x170(%rbp), %rax
cmpq -0x190(%rbp), %rax
jb 0x262493
movq -0x170(%rbp), %rax
movq %rax, -0x1f8(%rbp)
jmp 0x2624a1
movq -0x190(%rbp), %rax
movq %rax, -0x1f8(%rbp)
movq -0x1f8(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq -0x168(%rbp), %rax
cmpq -0x188(%rbp), %rax
ja 0x2624cf
movq -0x168(%rbp), %rax
movq %rax, -0x200(%rbp)
jmp 0x2624dd
movq -0x188(%rbp), %rax
movq %rax, -0x200(%rbp)
movq -0x200(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movq -0x1b8(%rbp), %rax
cmpq -0x1b0(%rbp), %rax
jbe 0x262512
movq -0x1b8(%rbp), %rax
subq -0x1b0(%rbp), %rax
movq %rax, -0x208(%rbp)
jmp 0x26251d
xorl %eax, %eax
movq %rax, -0x208(%rbp)
jmp 0x26251d
movq -0x208(%rbp), %rax
movq %rax, -0x1a8(%rbp)
cmpq $0x0, -0x1a8(%rbp)
je 0x2625f5
movq -0x1a8(%rbp), %xmm0
movaps 0x11fac8(%rip), %xmm3   # 0x382010
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x11facc(%rip), %xmm2   # 0x382020
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0x170(%rbp), %rcx
movq -0x168(%rbp), %rax
subq %rcx, %rax
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
mulsd -0x38(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jb 0x2625f5
movq -0x1a8(%rbp), %xmm0
movaps 0x11fa6a(%rip), %xmm3   # 0x382010
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x11fa6e(%rip), %xmm2   # 0x382020
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0x190(%rbp), %rcx
movq -0x188(%rbp), %rax
subq %rcx, %rax
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
mulsd -0x38(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jae 0x262600
movq $0x0, -0x160(%rbp)
movq -0x168(%rbp), %rdx
subq -0x170(%rbp), %rdx
subq -0x1a8(%rbp), %rdx
movq -0xa0(%rbp), %rax
movl 0x30(%rax), %ecx
addq %rdx, %rcx
movl %ecx, 0x30(%rax)
movq -0x180(%rbp), %rax
cmpq -0x1a0(%rbp), %rax
jb 0x262645
movq -0x180(%rbp), %rax
movq %rax, -0x210(%rbp)
jmp 0x262653
movq -0x1a0(%rbp), %rax
movq %rax, -0x210(%rbp)
movq -0x210(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq -0x178(%rbp), %rax
cmpq -0x198(%rbp), %rax
ja 0x262681
movq -0x178(%rbp), %rax
movq %rax, -0x218(%rbp)
jmp 0x26268f
movq -0x198(%rbp), %rax
movq %rax, -0x218(%rbp)
movq -0x218(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movq -0x1b8(%rbp), %rax
cmpq -0x1b0(%rbp), %rax
jbe 0x2626c4
movq -0x1b8(%rbp), %rax
subq -0x1b0(%rbp), %rax
movq %rax, -0x220(%rbp)
jmp 0x2626cf
xorl %eax, %eax
movq %rax, -0x220(%rbp)
jmp 0x2626cf
movq -0x220(%rbp), %rax
movq %rax, -0x1a8(%rbp)
cmpq $0x0, -0x1a8(%rbp)
je 0x2627a7
movq -0x1a8(%rbp), %xmm0
movaps 0x11f916(%rip), %xmm3   # 0x382010
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x11f91a(%rip), %xmm2   # 0x382020
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0x180(%rbp), %rcx
movq -0x178(%rbp), %rax
subq %rcx, %rax
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
mulsd -0x38(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jb 0x2627a7
movq -0x1a8(%rbp), %xmm0
movaps 0x11f8b8(%rip), %xmm3   # 0x382010
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x11f8bc(%rip), %xmm2   # 0x382020
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0x1a0(%rbp), %rcx
movq -0x198(%rbp), %rax
subq %rcx, %rax
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
mulsd -0x38(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jae 0x2627b2
movq $0x0, -0x160(%rbp)
movq -0x178(%rbp), %rdx
subq -0x180(%rbp), %rdx
subq -0x1a8(%rbp), %rdx
movq -0xa0(%rbp), %rax
movl 0x30(%rax), %ecx
addq %rdx, %rcx
movl %ecx, 0x30(%rax)
cmpq $0x0, -0x160(%rbp)
je 0x2628eb
cmpq $0x1, -0x80(%rbp)
jne 0x262807
movq -0x98(%rbp), %rax
movzbl 0x20(%rax), %eax
cmpl $0x1, %eax
jne 0x262807
movq -0x98(%rbp), %rax
movb $0x0, 0x20(%rax)
movq -0x20(%rbp), %rdi
movq -0x198(%rbp), %rsi
subq -0x1a0(%rbp), %rsi
callq 0xa62c0
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x1a0(%rbp), %rsi
movq -0x198(%rbp), %rdx
subq -0x1a0(%rbp), %rdx
movq -0x78(%rbp), %rax
movq -0x28(%rbp), %r8
movq -0x70(%rbp), %r9
movzbl %al, %ecx
callq 0x9a30
movq -0x150(%rbp), %rdi
movq -0x158(%rbp), %rsi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
movq -0x198(%rbp), %rcx
subq -0x1a0(%rbp), %rcx
movq -0x190(%rbp), %r8
movq -0x188(%rbp), %r9
movq -0x198(%rbp), %rax
subq -0x1a0(%rbp), %rax
xorl %r10d, %r10d
movq $0x0, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x26dcc0
cmpq $0x0, %rax
je 0x2628db
cmpq $0x2, -0x80(%rbp)
jne 0x2628c5
movq -0xa0(%rbp), %rax
movb $0x0, 0x2e(%rax)
movq -0xa0(%rbp), %rax
movb $0x1, 0x2d(%rax)
movq $0x1, -0x80(%rbp)
movq -0xa0(%rbp), %rax
movl $0x1, 0x24(%rax)
movq -0x80(%rbp), %rax
movb %al, %cl
movq -0xa0(%rbp), %rax
movb %cl, 0x2c(%rax)
jmp 0x262a26
movq $0x0, -0x160(%rbp)
movq -0xa0(%rbp), %rax
movl 0x4(%rax), %eax
movq %rax, -0x190(%rbp)
movq -0xa0(%rbp), %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movq %rax, -0x188(%rbp)
movq -0xa0(%rbp), %rax
movl 0x14(%rax), %eax
movq %rax, -0x1a0(%rbp)
movq -0xa0(%rbp), %rax
movl 0x18(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movq %rax, -0x198(%rbp)
movq -0x20(%rbp), %rdi
movq -0x198(%rbp), %rsi
subq -0x1a0(%rbp), %rsi
callq 0xa62c0
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x1a0(%rbp), %rsi
movq -0x198(%rbp), %rdx
subq -0x1a0(%rbp), %rdx
movq -0x78(%rbp), %rax
movq -0x28(%rbp), %r8
movq -0x70(%rbp), %r9
movzbl %al, %ecx
callq 0x9a30
movq -0x150(%rbp), %rdi
movq -0x158(%rbp), %rsi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
movq -0x198(%rbp), %rcx
subq -0x1a0(%rbp), %rcx
movq -0x190(%rbp), %r8
movq -0x188(%rbp), %r9
movq -0x198(%rbp), %rax
subq -0x1a0(%rbp), %rax
xorl %r10d, %r10d
movq $0x0, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x26dcc0
cmpq $0x0, %rax
je 0x262a24
movq -0xa0(%rbp), %rax
movb $0x0, 0x2e(%rax)
movq -0xa0(%rbp), %rax
movb $0x1, 0x2d(%rax)
movq -0xa0(%rbp), %rax
movl $0x1, 0x24(%rax)
movq -0xa0(%rbp), %rax
movb $0x1, 0x2c(%rax)
movq $0x1, -0x160(%rbp)
jmp 0x262a26
cmpq $0x0, -0x160(%rbp)
je 0x262abe
movq -0x60(%rbp), %rax
cmpq -0x48(%rbp), %rax
je 0x262ab2
movq -0x30(%rbp), %rax
movq (%rax), %rsi
imulq $0xa8, -0x60(%rbp), %rax
addq %rax, %rsi
leaq -0x148(%rbp), %rdi
movl $0xa8, %edx
callq 0x2180
movq -0x30(%rbp), %rax
movq (%rax), %rsi
imulq $0xa8, -0x48(%rbp), %rax
addq %rax, %rsi
movq -0x30(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x60(%rbp), %rax
addq %rax, %rdi
movl $0xa8, %edx
callq 0x2180
movq -0x30(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x48(%rbp), %rax
addq %rax, %rdi
leaq -0x148(%rbp), %rsi
movl $0xa8, %edx
callq 0x2180
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x262ac0
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x262220
movq -0x60(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x90(%rbp)
movq 0x30(%rbp), %rax
movl 0xc(%rax), %eax
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x262e7d
movq -0x90(%rbp), %rax
imulq $0x28, -0x48(%rbp), %rcx
addq %rcx, %rax
cmpb $0x0, 0x20(%rax)
je 0x262e6a
jmp 0x262b27
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x262c46
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x228(%rbp)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x262b6a
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x230(%rbp)
jmp 0x262b78
movl $0x2, %eax
movq %rax, -0x230(%rbp)
jmp 0x262b78
movq -0x228(%rbp), %rdi
movq -0x230(%rbp), %rax
imulq $0xa8, %rax, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
imulq $0xa8, 0x8(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x238(%rbp)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x262bd8
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x240(%rbp)
jmp 0x262be6
movl $0x2, %eax
movq %rax, -0x240(%rbp)
jmp 0x262be6
movq -0x238(%rbp), %rdi
movq -0x240(%rbp), %rax
movq -0x30(%rbp), %rcx
subq 0x8(%rcx), %rax
imulq $0xa8, %rax, %rdx
xorl %esi, %esi
callq 0x2100
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x262c29
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x248(%rbp)
jmp 0x262c37
movl $0x2, %eax
movq %rax, -0x248(%rbp)
jmp 0x262c37
movq -0x248(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x30(%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)
movq -0xa0(%rbp), %rdi
addq $0x38, %rdi
callq 0x1e1d0
movq -0xa0(%rbp), %rdi
addq $0x48, %rdi
callq 0x1e1f0
movq -0xa0(%rbp), %rdi
addq $0x78, %rdi
callq 0x1e1f0
movl -0xc(%rbp), %ecx
movq -0xa0(%rbp), %rax
movl %ecx, (%rax)
movq -0x90(%rbp), %rax
imulq $0x28, -0x48(%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 -0x90(%rbp), %rax
imulq $0x28, -0x48(%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 -0x90(%rbp), %rax
imulq $0x28, -0x48(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, %ecx
movq -0xa0(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x90(%rbp), %rax
imulq $0x28, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
subl $0x1, %ecx
movq -0xa0(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x90(%rbp), %rax
imulq $0x28, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %ecx
movq -0xa0(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x90(%rbp), %rax
imulq $0x28, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %ecx
subl $0x1, %ecx
movq -0xa0(%rbp), %rax
movl %ecx, 0x18(%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, 0x20(%rax)
movq -0xa0(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0xa0(%rbp), %rax
movl $0x0, 0x30(%rax)
movq -0xa0(%rbp), %rax
movb $0x1, 0x2c(%rax)
movq -0xa0(%rbp), %rax
movl $0x1, 0x24(%rax)
movq -0x90(%rbp), %rax
imulq $0x28, -0x48(%rbp), %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x1e, %rax
andq $0x1, %rax
movb %al, %cl
movq -0xa0(%rbp), %rax
movb %cl, 0x2e(%rax)
movq -0x90(%rbp), %rax
imulq $0x28, -0x48(%rbp), %rcx
addq %rcx, %rax
movb 0x21(%rax), %cl
movq -0xa0(%rbp), %rax
movb %cl, 0x2d(%rax)
movq 0x18(%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 0x18(%rbp), %rsi
callq 0x60af0
movq $0x1, -0x88(%rbp)
jmp 0x262e6c
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x262afe
cmpq $0x0, -0x88(%rbp)
je 0x262e9b
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x1dfd0
movq -0x30(%rbp), %rax
cmpq $0x1, 0x10(%rax)
jbe 0x26310b
movq $0x1, -0x48(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x48(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq 0x10(%rcx), %rax
ja 0x2630ff
movq -0x48(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq 0x10(%rcx), %rax
je 0x262f12
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x48(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq -0x30(%rbp), %rcx
movq (%rcx), %rcx
imulq $0xa8, -0x58(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
je 0x2630ec
movq -0x58(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq -0x48(%rbp), %rax
subq -0x58(%rbp), %rax
cmpq $0x1, %rax
jbe 0x263043
movq -0x58(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movq $-0x80000000, -0x1d0(%rbp) # imm = 0x80000000
movq $-0x1, -0x1c0(%rbp)
movq -0x1c8(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0x263041
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x1c8(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movl 0x30(%rax), %eax
movq %rax, -0x1d8(%rbp)
xorl %eax, %eax
subq -0x1d8(%rbp), %rax
movq %rax, -0x1d8(%rbp)
movq -0x1d8(%rbp), %rax
cmpq -0x1d0(%rbp), %rax
jg 0x26300c
movq -0x1d8(%rbp), %rax
cmpq -0x1d0(%rbp), %rax
jne 0x263028
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x1c0(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movq -0x30(%rbp), %rcx
movq (%rcx), %rcx
imulq $0xa8, -0x1c0(%rbp), %rdx
addq %rdx, %rcx
subl 0x4(%rcx), %eax
movq -0xa0(%rbp), %rcx
movl 0x8(%rcx), %ecx
addl $0x1, %ecx
movq -0xa0(%rbp), %rdx
subl 0x4(%rdx), %ecx
cmpl %ecx, %eax
jae 0x263028
movq -0x1d8(%rbp), %rax
movq %rax, -0x1d0(%rbp)
movq -0x1c8(%rbp), %rax
movq %rax, -0x1c0(%rbp)
jmp 0x26302a
movq -0x1c8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1c8(%rbp)
jmp 0x262f50
jmp 0x263043
cmpq $-0x1, -0x1c0(%rbp)
je 0x2630e4
movq -0x1c0(%rbp), %rax
cmpq -0x60(%rbp), %rax
je 0x2630d8
movq -0x30(%rbp), %rax
movq (%rax), %rsi
imulq $0xa8, -0x1c0(%rbp), %rax
addq %rax, %rsi
leaq -0x148(%rbp), %rdi
movl $0xa8, %edx
callq 0x2180
movq -0x30(%rbp), %rax
movq (%rax), %rsi
imulq $0xa8, -0x60(%rbp), %rax
addq %rax, %rsi
movq -0x30(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x1c0(%rbp), %rax
addq %rax, %rdi
movl $0xa8, %edx
callq 0x2180
movq -0x30(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x60(%rbp), %rax
addq %rax, %rdi
leaq -0x148(%rbp), %rsi
movl $0xa8, %edx
callq 0x2180
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x2630ee
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x262ec2
movq -0x60(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
nopw %cs:(%rax,%rax)