// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: refine_integer_ovlps(all_ul_t*, bubble_type*, ma_ug_t*, ul_str_t*, integer_aln_t*, ul_chain_t*, long, integer_t*, unsigned long*, unsigned long)
int64_t refine_integer_ovlps(all_ul_t *ul_idx, bubble_type *bub, ma_ug_t *ug, ul_str_t *str, integer_aln_t *aln, ul_chain_t *idx, int64_t qid, integer_t *buf, 
uint64_t *cns, uint64_t cns_occ)
{
    if(idx->e<=idx->s) return 0;
    int64_t qk, tk, is_rev, tid, q_end, t_end, z; 
    ul_str_t *q_str, *t_str; uc_block_t *t_b; integer_aln_t *x, *y; 
    tid = aln[idx->s].tn_rev_qk>>33; is_rev = ((aln[idx->s].tn_rev_qk>>32)&1);
    q_str = &(str[qid]); t_str = &(str[tid]); 
    kv_resize(uint64_t, buf->u, buf->u.n + q_str->cn + t_str->cn);
    uint64_t *q_cov_buf = buf->u.a + buf->u.n, *t_cov_buf = buf->u.a + buf->u.n + q_str->cn, k, rg_occ, cn_k, mm;
    memset(q_cov_buf, -1, sizeof((*q_cov_buf))*q_str->cn); memset(t_cov_buf, -1, sizeof((*t_cov_buf))*t_str->cn);
    // if(tid != 392) return 0;
    //beg
    x = &(aln[idx->s]);
    qk = (uint32_t)(x->tn_rev_qk); tk = ((is_rev == 0)? (x->tk):(t_str->cn - x->tk - 1));

    ///direction
    if((qk > 0) && (x->tk > 0)) {
        integer_align_extention(ug, ul_idx, qid, q_str, tid, t_str, is_rev, q_cov_buf, t_cov_buf, x, 1, &q_end, &t_end);
        idx->q_sidx = q_end; idx->t_sidx = ((is_rev == 0)? (t_end):(t_str->cn - t_end - 1));
    } else {
        idx->q_sidx = (uint32_t)(x->tn_rev_qk); idx->t_sidx = x->tk;
    }
    // if(!((idx->q_sidx <= ((uint32_t)(x->tn_rev_qk))) && (idx->t_sidx <= x->tk))) {
    //     fprintf(stderr, "[M::%s] qid::%ld, tid::%ld\n", __func__, qid, tid);
    // }
    assert((idx->q_sidx <= ((uint32_t)(x->tn_rev_qk)))); assert(idx->t_sidx <= x->tk);
    // assert((is_rev && idx->t_sidx >= x->tk) || (is_rev == 0 && idx->t_sidx <= x->tk));

    //end
    x = &(aln[idx->e-1]);
    qk = (uint32_t)(x->tn_rev_qk); tk = ((is_rev == 0)? (x->tk):(t_str->cn - x->tk - 1));
    // if(tid == 316) {
    //     fprintf(stderr, "[end-M::%s::tid->%ld] qk::%ld, tk::%ld, x->tk::%u, t_str->cn::%u\n", 
    //     __func__, tid, qk, tk, x->tk, t_str->cn);
    // }
    ///direction
    if((((uint32_t)qk + 1) < q_str->cn) && ((x->tk + 1) < t_str->cn)) {
        integer_align_extention(ug, ul_idx, qid, q_str, tid, t_str, is_rev, q_cov_buf, t_cov_buf, x, 0, &q_end, &t_end);
        idx->q_eidx = q_end + 1; idx->t_eidx = ((is_rev == 0)? (t_end + 1):(t_str->cn - t_end));
    } else {
        idx->q_eidx = (uint32_t)(x->tn_rev_qk)+1; idx->t_eidx = x->tk+1;
    }

    assert(idx->q_eidx > ((uint32_t)(x->tn_rev_qk))); assert(idx->t_eidx > x->tk);
    // assert((is_rev && idx->t_eidx < x->tk) || (is_rev == 0 && idx->t_eidx > x->tk));

    assert(idx->q_eidx > idx->q_sidx); assert(idx->t_eidx > idx->t_sidx);
    // assert((is_rev && idx->t_eidx < idx->t_sidx) || (is_rev == 0 && idx->t_eidx > idx->t_sidx));
    // if(tid == 284) {
    //     fprintf(stderr, "[M::%s::tid->%ld] idx->q_sidx::%u, idx->q_eidx::%u, idx->t_sidx::%u, idx->t_eidx::%u\n", 
    //     __func__, tid, idx->q_sidx, idx->q_eidx, idx->t_sidx, idx->t_eidx);
    // }

    ///mid
    for (k = idx->s; k < idx->e; k++) {///go through all alignment pairs
        // if(qid == 3113 && tid == 3075) {
        //     fprintf(stderr, "+[M::%s] qid::%ld, tid::%ld, idx->s::%u, idx->e::%u, k::%lu, qk::%u, tk::%u, (idx->v>>1)::%u\n", 
        //     __func__, qid, tid, idx->s, idx->e, k, (uint32_t)(aln[k].tn_rev_qk), aln[k].tk, idx->v>>1);
        // }   
        
        x = &(aln[k]); y = ((k > idx->s)? (&(aln[k-1])):(NULL));
        qk = (uint32_t)(x->tn_rev_qk); 
        q_cov_buf[qk] = buf->u.a[qk]; 

        tk = ((is_rev == 0)? (x->tk):(t_str->cn - x->tk - 1));
        t_b = &(ul_idx->a[tid].bb.a[t_str->a[tk]>>32]);
        assert(((t_b->hid<<1)+t_b->rev)==((uint32_t)t_str->a[tk]));
        t_cov_buf[tk] = ug_occ_w(t_b->ts, t_b->te, &(ug->u.a[t_b->hid]));
    
        q_cov_buf[qk] += ((uint64_t)(0x8000000000000000));
        t_cov_buf[tk] += ((uint64_t)(0x8000000000000000));
        
        if(!y) continue;
        mm = 0;
        if(gap_chain_check(ug, y, x, is_rev, q_str, t_str, ul_idx->a[qid].bb.a, ul_idx->a[tid].bb.a, qid, tid, 0.08, 2000)) {
            mm = ((uint64_t)(0x8000000000000000));
        }
        for (z = ((uint32_t)(y->tn_rev_qk)) + 1; z < qk; z++) {
            q_cov_buf[z] = buf->u.a[z] + mm; 
        }

        z = ((is_rev == 0)? (y->tk):(t_str->cn - x->tk - 1)) + 1;
        tk = ((is_rev == 0)? (x->tk):(t_str->cn - y->tk - 1));
        assert(z <= tk);
        for (; z < tk; z++) {
            t_b = &(ul_idx->a[tid].bb.a[t_str->a[z]>>32]);
            assert(((t_b->hid<<1)+t_b->rev)==((uint32_t)t_str->a[z]));
            t_cov_buf[z] = ug_occ_w(t_b->ts, t_b->te, &(ug->u.a[t_b->hid])) + mm;
        }
    }

    if(cns) {
        int64_t cns_cov_occ = 0, cns_het_occ = 0, match_cns_occ = 0, match_cns_het_occ = 0, hm;
        rg_occ = idx->q_eidx;
        for (k = idx->q_sidx, cn_k = 0; k < rg_occ; k++) {
            assert((q_cov_buf[k]!=(uint64_t)-1) && (q_cov_buf[k] > 0));
            hm = ((q_cov_buf[k]<<1)>>1);
            for (; cn_k < cns_occ; cn_k++) {
                if(cns[cn_k] == k) {
                    cns_cov_occ += hm; 
                    if(q_cov_buf[k]&((uint64_t)(0x8000000000000000))) match_cns_occ += hm; 
                    if(!IF_HOM((((uint32_t)q_str->a[k])>>1), (*bub))) {
                        cns_het_occ += hm;
                        if(q_cov_buf[k]&((uint64_t)(0x8000000000000000))) match_cns_het_occ += hm; 
                    }
                } else if(cns[cn_k] > k) {
                    break;
                }
            }
        }

        if(cns_cov_occ <= 0) return 0;
        if((cns_het_occ > 0) && (match_cns_het_occ <= (cns_het_occ*0.5))) return 0;
        if(match_cns_occ <= (cns_cov_occ*0.5)) return 0;

        k = idx->t_sidx; rg_occ = idx->t_eidx; 
        if(is_rev) {
            k = t_str->cn - idx->t_eidx; rg_occ = t_str->cn - idx->t_sidx;
        }
        cns_cov_occ = match_cns_occ = 0; 
        assert(k < rg_occ);
        for (; k < rg_occ; k++) {
            assert((t_cov_buf[k]!=(uint64_t)-1) && (t_cov_buf[k] > 0));
            hm = ((t_cov_buf[k]<<1)>>1);
            cns_cov_occ += hm; 
            if(t_cov_buf[k]&((uint64_t)(0x8000000000000000))) match_cns_occ += hm; 
        }

        if(cns_cov_occ <= 0 || match_cns_occ <= 0) return 0;
        if(match_cns_occ <= (cns_cov_occ*0.5)) return 0;
    }
    ///not useful for correction
    if((idx->q_sidx + 1 == idx->q_eidx) && (idx->t_sidx + 1 == idx->t_eidx)) {///must matched with at least one cns node
        return 0;
    }

    // /**if(tid == 3074)**/ {
    //     print_integer_ovlps(ug, str, buf->b.a, buf->b.n, idx, 1, qid, buf->o.n);
    //     fprintf(stderr, "[M::%s::tid->%ld] idx->q_sidx::%u, idx->q_eidx::%u, idx->t_sidx::%u, idx->t_eidx::%u\n******************************************************\n", 
    //         __func__, tid, idx->q_sidx, idx->q_eidx, idx->t_sidx, idx->t_eidx);
    // }

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, 0x10(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdi, 0x40(%rsp)
movl (%r9), %eax
cmpl %eax, 0x4(%r9)
jbe 0x20152c
movq %r9, %r15
movq 0xb8(%rsp), %rbx
movq 0xb0(%rsp), %rdx
leaq (%rax,%rax,2), %rax
movq %r8, 0x38(%rsp)
movq 0x10(%r8,%rax,8), %rax
movq %rax, %rdi
shrq $0x21, %rdi
shrq $0x20, %rax
andl $0x1, %eax
movq %rax, 0x18(%rsp)
movq %rdx, %rax
shlq $0x5, %rax
leaq (%rcx,%rax), %rbp
movq %rdi, 0x8(%rsp)
shlq $0x5, %rdi
leaq (%rcx,%rdi), %rdx
movq %rdx, (%rsp)
movq 0x90(%rbx), %rsi
movl 0x18(%rcx,%rax), %edx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andq %r8, %rdx
movl 0x18(%rcx,%rdi), %eax
andq %r8, %rax
addq %rsi, %rax
addq %rdx, %rax
cmpq %rax, 0x98(%rbx)
jae 0x200ec3
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0x98(%rbx)
movq 0xa0(%rbx), %rdi
leaq 0x8(,%rcx,8), %rsi
callq 0x2370
movq %rax, 0xa0(%rbx)
movq 0x90(%rbx), %rsi
movl 0x18(%rbp), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
jmp 0x200eca
movq 0xa0(%rbx), %rax
leaq (%rax,%rsi,8), %rbx
leaq (%rbx,%rdx,8), %r12
shlq $0x3, %rdx
movq %rbx, %rdi
movl $0xff, %esi
callq 0x20e0
movq (%rsp), %r13
movl 0x18(%r13), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
shlq $0x3, %rdx
movq %r12, %rdi
movl $0xff, %esi
callq 0x20e0
movl (%r15), %eax
leaq (%rax,%rax,2), %rax
movq 0x38(%rsp), %r8
leaq (%r8,%rax,8), %r14
movl (%r14), %eax
movl 0x10(%r14), %ecx
testq %rcx, %rcx
sete %dl
testl %eax, %eax
sete %sil
orb %dl, %sil
movq %r12, 0x28(%rsp)
movq %rbx, 0x20(%rsp)
je 0x200f41
movl %ecx, 0x18(%r15)
movl %eax, 0x20(%r15)
jmp 0x200fc8
subq $0x8, %rsp
leaq 0x38(%rsp), %rax
movq %rbx, %r10
leaq 0x78(%rsp), %rbx
movq 0x18(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0xb8(%rsp), %rdx
movq %rbp, %rcx
movq 0x10(%rsp), %r8
movq %r13, %r9
pushq %rax
pushq %rbx
pushq $0x1
pushq %r14
pushq %r12
pushq %r10
movq 0x50(%rsp), %r12
pushq %r12
callq 0x2009a8
addq $0x40, %rsp
movl (%rbx), %ecx
movl %ecx, 0x18(%r15)
testq %r12, %r12
jne 0x200f9b
movq 0x30(%rsp), %rax
jmp 0x200fb0
movl 0x18(%r13), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq 0x30(%rsp), %rax
notq %rax
addq %rdx, %rax
movl %eax, 0x20(%r15)
cmpl 0x10(%r14), %ecx
movq 0x20(%rsp), %rbx
movq 0x38(%rsp), %r8
ja 0x201638
cmpl (%r14), %eax
ja 0x2015df
movl 0x4(%r15), %eax
decl %eax
leaq (%rax,%rax,2), %rax
leaq (%r8,%rax,8), %r14
movl (%r14), %edx
movl 0x10(%r14), %ecx
leal 0x1(%rcx), %r9d
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl 0x18(%rbp), %edi
andl %esi, %edi
incl %edx
cmpl %edi, %r9d
jae 0x20106e
movq (%rsp), %rax
andl 0x18(%rax), %esi
cmpl %esi, %edx
jae 0x20106e
subq $0x8, %rsp
leaq 0x38(%rsp), %rax
movq %rbx, %r10
leaq 0x78(%rsp), %rbx
movq 0x18(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0xb8(%rsp), %rdx
movq %rbp, %rcx
movq 0x10(%rsp), %r8
movq 0x8(%rsp), %r13
movq %r13, %r9
pushq %rax
pushq %rbx
pushq $0x0
pushq %r14
pushq 0x50(%rsp)
pushq %r10
movq 0x50(%rsp), %r12
pushq %r12
callq 0x2009a8
addq $0x40, %rsp
movl (%rbx), %r9d
incl %r9d
movl %r9d, 0x1c(%r15)
testq %r12, %r12
jne 0x201078
movq 0x30(%rsp), %rdx
incq %rdx
jmp 0x201087
movl %r9d, 0x1c(%r15)
movl %edx, 0x24(%r15)
jmp 0x201099
movl 0x18(%r13), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
subq 0x30(%rsp), %rdx
movl %edx, 0x24(%r15)
movl 0x10(%r14), %ecx
movq 0x20(%rsp), %rbx
movq 0x38(%rsp), %r8
cmpl %ecx, %r9d
jbe 0x2015e8
cmpl (%r14), %edx
jbe 0x2015f1
movl 0x18(%r15), %eax
cmpl %eax, %r9d
jbe 0x201610
movq %rbp, 0x48(%rsp)
cmpl 0x20(%r15), %edx
jbe 0x201619
movl (%r15), %r13d
cmpl 0x4(%r15), %r13d
movq %r15, 0x50(%rsp)
movq (%rsp), %rdx
jae 0x20135b
imulq $0x58, 0x8(%rsp), %rax
movq %rax, 0x58(%rsp)
imulq $0x58, 0xb0(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq (,%r13,2), %rax
addq %r13, %rax
leaq (%r8,%rax,8), %rsi
movl (%r15), %ecx
cmpq %rcx, %r13
leaq -0x18(%r8,%rax,8), %rax
movl $0x0, %r15d
cmovaq %rax, %r15
movl 0x28(%rax), %r14d
movq 0xb8(%rsp), %rax
movq 0xa0(%rax), %rax
movq (%rax,%r14,8), %rax
movq %rax, (%rbx,%r14,8)
cmpq $0x0, 0x18(%rsp)
movq %rsi, 0x8(%rsp)
jne 0x201146
movl (%rsi), %eax
jmp 0x201156
movl 0x18(%rdx), %ecx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %ecx
movl (%rsi), %eax
notl %eax
addl %ecx, %eax
movl %eax, %ebp
movq 0x40(%rsp), %rax
movq 0x48(%rax), %r12
movq 0x58(%rsp), %rax
movq 0x30(%r12,%rax), %rbx
movq 0x10(%rdx), %rax
movq (%rax,%rbp,8), %rdx
movq %rdx, %rax
shrq $0x20, %rax
leaq (%rax,%rax,8), %rcx
movl (%rbx,%rcx,4), %eax
movl 0x20(%rbx,%rcx,4), %esi
shrl $0x5, %esi
andl $0x1, %esi
leal (%rsi,%rax,2), %esi
cmpl %edx, %esi
jne 0x201582
leaq (%rbx,%rcx,4), %rcx
movl 0xc(%rcx), %edi
movl 0x10(%rcx), %esi
leaq (%rax,%rax,4), %rdx
shlq $0x3, %rdx
movq 0x10(%rsp), %rax
addq 0x10(%rax), %rdx
callq 0x1fe266
movq 0x28(%rsp), %rcx
movq %rax, (%rcx,%rbp,8)
movq 0x20(%rsp), %rax
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, (%rax,%r14,8)
xorq %rdx, (%rcx,%rbp,8)
testq %r15, %r15
je 0x201330
movq 0x60(%rsp), %rax
movq 0x30(%r12,%rax), %rax
subq $0x30, %rsp
movq %rbx, 0x8(%rsp)
movq %rax, (%rsp)
movq $0x7d0, 0x20(%rsp)      # imm = 0x7D0
movq 0x40(%rsp), %rdi
movq %r15, %rsi
movq 0x38(%rsp), %rbx
movq %rbx, %rdx
movq 0x48(%rsp), %rcx
movq 0x78(%rsp), %r8
movq 0x30(%rsp), %r9
movsd 0x303e2(%rip), %xmm0    # 0x231608
callq 0x200b2a
addq $0x30, %rsp
movq %rax, %r12
testq %rax, %rax
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
cmovneq %rax, %r12
movl 0x10(%r15), %eax
incl %eax
cmpq %r14, %rax
movq 0x20(%rsp), %rsi
jae 0x201275
movq 0xb8(%rsp), %rcx
movq 0xa0(%rcx), %rcx
movq (%rcx,%rax,8), %rdx
addq %r12, %rdx
movq %rdx, (%rsi,%rax,8)
incq %rax
cmpq %rax, %r14
jne 0x201262
movl (%rbx), %eax
cmpq $0x0, 0x18(%rsp)
jne 0x201286
movl (%r15), %ecx
incl %ecx
jmp 0x20129f
movq (%rsp), %rcx
movl 0x18(%rcx), %edx
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %edx
movl %edx, %ecx
subl %eax, %ecx
movl (%r15), %eax
notl %eax
addl %edx, %eax
cmpl %eax, %ecx
ja 0x2015a1
movl %ecx, %r14d
movl %eax, %r15d
cmpl %r15d, %r14d
jae 0x201330
movq 0x40(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x58(%rsp), %rcx
movq 0x30(%rax,%rcx), %rbp
movq (%rsp), %rax
movq 0x10(%rax), %rbx
movq (%rbx,%r14,8), %rdx
movq %rdx, %rax
shrq $0x20, %rax
leaq (%rax,%rax,8), %rcx
movl (%rbp,%rcx,4), %eax
movl 0x20(%rbp,%rcx,4), %esi
shrl $0x5, %esi
andl $0x1, %esi
leal (%rsi,%rax,2), %esi
cmpl %edx, %esi
jne 0x201544
leaq (,%rcx,4), %rcx
addq %rbp, %rcx
movl 0xc(%rcx), %edi
movl 0x10(%rcx), %esi
leaq (%rax,%rax,4), %rdx
shlq $0x3, %rdx
movq 0x10(%rsp), %rax
addq 0x10(%rax), %rdx
callq 0x1fe266
addq %r12, %rax
movq 0x28(%rsp), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
cmpq %r14, %r15
jne 0x2012cd
incq %r13
movq 0x50(%rsp), %r15
movl 0x4(%r15), %eax
cmpq %rax, %r13
movq (%rsp), %rdx
movq 0x20(%rsp), %rbx
movq 0x38(%rsp), %r8
jb 0x2010f6
movl 0x18(%r15), %eax
movl 0x1c(%r15), %r9d
movq 0xc0(%rsp), %rsi
testq %rsi, %rsi
je 0x201519
cmpl %r9d, %eax
jae 0x20152c
movq 0xc8(%rsp), %r10
movl %r9d, 0x10(%rsp)
movl %r9d, %r11d
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
movl %eax, 0x8(%rsp)
movl %eax, %r15d
xorl %r9d, %r9d
decq %rdx
xorl %edi, %edi
xorl %ebx, %ebx
xorl %r8d, %r8d
xorl %r12d, %r12d
movq 0x48(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rcx,%r15,8), %r14
leaq 0x1(%r14), %r13
cmpq $0x1, %r13
jbe 0x201563
cmpq %r10, %r12
jae 0x20141f
movq %r14, %r13
andq %rdx, %r13
sarq $0x3f, %r14
andq %r13, %r14
cmpq %r15, (%rsi,%r12,8)
jne 0x201412
addq %r13, %r8
addq %r14, %rdi
movq 0x10(%rax), %rbp
movl (%rbp,%r15,8), %ebp
shrl %ebp
movq 0x68(%rsp), %rax
movq (%rax), %rcx
movq 0x80(%rax), %rax
movl (%rcx,%rbp,4), %ecx
incq %rax
cmpq %rcx, %rax
jb 0x20140b
addq %r13, %rbx
addq %r14, %r9
movq 0x48(%rsp), %rax
jmp 0x201414
ja 0x20141f
incq %r12
cmpq %r12, %r10
jne 0x2013d4
movq %r10, %r12
incq %r15
cmpq %r11, %r15
jne 0x2013ab
testq %r8, %r8
movq 0x50(%rsp), %r15
jle 0x20152c
testq %rbx, %rbx
jle 0x201456
cvtsi2sd %r9, %xmm0
cvtsi2sd %rbx, %xmm1
mulsd 0x301a4(%rip), %xmm1    # 0x2315f0
ucomisd %xmm0, %xmm1
jae 0x20152c
xorps %xmm0, %xmm0
cvtsi2sd %rdi, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r8, %xmm1
mulsd 0x30182(%rip), %xmm1    # 0x2315f0
ucomisd %xmm0, %xmm1
jae 0x20152c
movl 0x20(%r15), %esi
movl 0x24(%r15), %edi
cmpq $0x0, 0x18(%rsp)
je 0x20149e
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq (%rsp), %rcx
andl 0x18(%rcx), %eax
movl %eax, %ecx
subl %edi, %ecx
subl %esi, %eax
movl %ecx, %esi
movl %eax, %edi
movq 0x28(%rsp), %rcx
cmpl %edi, %esi
jae 0x201657
movl %edi, %r8d
movl %esi, %r9d
xorl %esi, %esi
xorl %edi, %edi
movq (%rcx,%r9,8), %r10
leaq 0x1(%r10), %rax
cmpq $0x1, %rax
jbe 0x2015c0
movq %r10, %rax
andq %rdx, %rax
addq %rax, %rdi
sarq $0x3f, %r10
andq %rax, %r10
addq %r10, %rsi
incq %r9
cmpq %r9, %r8
jne 0x2014b5
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x20152c
xorps %xmm0, %xmm0
cvtsi2sd %rsi, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %rdi, %xmm1
mulsd 0x300e6(%rip), %xmm1    # 0x2315f0
ucomisd %xmm0, %xmm1
movl 0x10(%rsp), %r9d
movl 0x8(%rsp), %eax
jae 0x20152c
incl %eax
cmpl %r9d, %eax
jne 0x20153d
movl 0x20(%r15), %eax
incl %eax
cmpl 0x24(%r15), %eax
jne 0x20153d
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %eax
jmp 0x20152e
leaq 0x454e9(%rip), %rdi     # 0x246a34
leaq 0x440b7(%rip), %rsi     # 0x245609
leaq 0x45380(%rip), %rcx     # 0x2468d9
movl $0x1428, %edx           # imm = 0x1428
callq 0x2110
leaq 0x454fc(%rip), %rdi     # 0x246a66
leaq 0x44098(%rip), %rsi     # 0x245609
leaq 0x45361(%rip), %rcx     # 0x2468d9
movl $0x1431, %edx           # imm = 0x1431
callq 0x2110
leaq 0x45470(%rip), %rdi     # 0x2469f9
leaq 0x44079(%rip), %rsi     # 0x245609
leaq 0x45342(%rip), %rcx     # 0x2468d9
movl $0x1414, %edx           # imm = 0x1414
callq 0x2110
leaq 0x45484(%rip), %rdi     # 0x246a2c
leaq 0x4405a(%rip), %rsi     # 0x245609
leaq 0x45323(%rip), %rcx     # 0x2468d9
movl $0x1425, %edx           # imm = 0x1425
callq 0x2110
leaq 0x454dd(%rip), %rdi     # 0x246aa4
leaq 0x4403b(%rip), %rsi     # 0x245609
leaq 0x45304(%rip), %rcx     # 0x2468d9
movl $0x144c, %edx           # imm = 0x144C
callq 0x2110
leaq 0x4538d(%rip), %rdi     # 0x246973
jmp 0x20163f
leaq 0x45399(%rip), %rdi     # 0x246988
jmp 0x2015f8
leaq 0x453b9(%rip), %rdi     # 0x2469b1
leaq 0x4400a(%rip), %rsi     # 0x245609
leaq 0x452d3(%rip), %rcx     # 0x2468d9
movl $0x13fd, %edx           # imm = 0x13FD
callq 0x2110
leaq 0x453ae(%rip), %rdi     # 0x2469c5
jmp 0x201620
leaq 0x453bf(%rip), %rdi     # 0x2469df
leaq 0x43fe2(%rip), %rsi     # 0x245609
leaq 0x452ab(%rip), %rcx     # 0x2468d9
movl $0x1400, %edx           # imm = 0x1400
callq 0x2110
leaq 0x4526e(%rip), %rdi     # 0x2468ad
leaq 0x43fc3(%rip), %rsi     # 0x245609
leaq 0x4528c(%rip), %rcx     # 0x2468d9
movl $0x13eb, %edx           # imm = 0x13EB
callq 0x2110
leaq 0x4543b(%rip), %rdi     # 0x246a99
leaq 0x43fa4(%rip), %rsi     # 0x245609
leaq 0x4526d(%rip), %rcx     # 0x2468d9
movl $0x144a, %edx           # imm = 0x144A
callq 0x2110