// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: integer_candidate(ul_resolve_t*, integer_t*, unsigned int, unsigned int)
void integer_candidate(ul_resolve_t *uidx, integer_t *buf, uint32_t qid, uint32_t is_hom)
{
    uint64_t k, z, m_het, m_het_occ, ref_occ, b_n, m; uint32_t vk, vz, is_circle = 0; integer_aln_t *p; ul_chain_t sc;
    ul_str_idx_t *str_idx = &(uidx->pstr); ma_ug_t *ug = uidx->l1_ug; 
    uint64_t *hid_a, hid_n; uc_block_t *xi;
    ul_str_t *str = &(str_idx->str.a[qid]);
    if(str->cn < 2) return; ///directly filter out too short UL
    kv_resize(uint64_t, buf->u, str->cn); buf->u.n = str->cn;
    for (k = m_het = m_het_occ = ref_occ = 0; k < str->cn; k++) {
        xi = &(uidx->idx->a[qid].bb.a[str->a[k]>>32]);
        assert(((xi->hid<<1)+xi->rev)==((uint32_t)str->a[k]));
        buf->u.a[k] = ug_occ_w(xi->ts, xi->te, &(ug->u.a[xi->hid]));
        assert(buf->u.a[k] > 0);
        if((!is_hom) && (!IF_HOM((((uint32_t)str->a[k])>>1), (*uidx->bub)))) {
            m_het++; m_het_occ += buf->u.a[k];///m_het_occ: how many het HiFi reads
        }
        ref_occ += buf->u.a[k];
        // fprintf(stderr, "[M::%s::k->%lu] buf->u.a[k]->%lu, ts->%u, te->%u, pchain->%u\n", __func__, k, buf->u.a[k], xi->ts, xi->te, xi->pchain);
    }
    // if((!is_hom) && (m_het < 2) && (m_het > 0)) return;///if all matched unitigs are hom, is ok
    if(m_het == 0 || m_het_occ == 0) is_hom = 1;
    // print_ul_alignment(ug, &UL_INF, 27512, "inner-0");
    for (k = 0, buf->b.n = 0; k < str->cn; k++) {
        vk = (uint32_t)str->a[k];
        hid_a = str_idx->occ.a + str_idx->idx.a[vk>>1];
        hid_n = str_idx->idx.a[(vk>>1)+1] - str_idx->idx.a[vk>>1];
        for (z = 0; z < hid_n; z++) {
            if((hid_a[z]>>32) == qid) continue;
            if(str_idx->str.a[hid_a[z]>>32].cn < 2) continue;
            vz = (uint32_t)(str_idx->str.a[hid_a[z]>>32].a[(uint32_t)hid_a[z]]);
            assert((vk>>1) == (vz>>1));
            kv_pushp(integer_aln_t, buf->b, &p);
            p->vq = vk; p->tk = (uint32_t)hid_a[z]; 
            if((vk^vz)&1) p->tk = str_idx->str.a[hid_a[z]>>32].cn - p->tk - 1;///rev
            p->tn_rev_qk = (hid_a[z]>>32); p->tn_rev_qk <<= 1; p->tn_rev_qk |= ((vk^vz)&1);
            p->tn_rev_qk <<= 32; p->tn_rev_qk += k; 
            ///set score of this pair
            p->sc = buf->u.a[k];
            xi = &(uidx->idx->a[hid_a[z]>>32].bb.a[(str_idx->str.a[hid_a[z]>>32].a[(uint32_t)hid_a[z]])>>32]);
            assert(((xi->hid<<1)+xi->rev)==vz); m = ug_occ_w(xi->ts, xi->te, &(ug->u.a[xi->hid]));
            if(p->sc > m) p->sc = m;
        }
    }
    // print_ul_alignment(ug, &UL_INF, 27512, "inner-1");
    radix_sort_integer_aln_t_srt(buf->b.a, buf->b.a + buf->b.n); 
    b_n = buf->b.n; buf->sc.n = 0;
    for (k = 1, z = 0; k <= b_n; k++) {
        if(k == b_n || (buf->b.a[z].tn_rev_qk>>32) != (buf->b.a[k].tn_rev_qk>>32)) {
            ///get the chain for <qn, tn>
            if(integer_chain(qid, buf->b.a + z, k - z, z, buf, ug, str_idx, uidx->idx, &sc) && sc.v != (uint32_t)-1) {
                if((buf->sc.n > 0) && ((buf->sc.a[buf->sc.n-1].v>>1) == (sc.v>>1))) {
                    if(buf->sc.a[buf->sc.n-1].sc < sc.sc) {
                        buf->sc.a[buf->sc.n-1] = sc;
                    }
                } else {
                    kv_push(ul_chain_t, buf->sc, sc);
                }
            }
            z = k;
        }
    }
    // print_ul_alignment(ug, &UL_INF, 27512, "inner-2");
    uint64_t *o, o_n, cns_het, cns_het_occ, ref_cns_occ, corrected = 0;
    o_n = integer_chain_dp(uidx->bub, buf, str_idx->str.a, buf->b.a, buf->sc.a, buf->sc.n, qid, is_hom, 2, &corrected);
    assert(o_n <= str->cn); 
    // if(qid == 2062 || qid == 2093) fprintf(stderr,"[M::%s::] o_n::%lu, str->cn::%u, corrected::%lu\n", __func__, o_n, str->cn, corrected);
    if(o_n <= 0) return; 
    if(corrected) return;
    // print_ul_alignment(ug, &UL_INF, 27512, "inner-3");
    
    for (k = cns_het = cns_het_occ = ref_cns_occ = 0, o = buf->o.a; k < o_n; k++) {
        if((!is_hom) && (!IF_HOM((((uint32_t)str->a[o[k]])>>1), (*uidx->bub)))) {
            cns_het++; cns_het_occ += buf->u.a[o[k]];
        }
        ref_cns_occ += buf->u.a[o[k]];     
    }
    buf->o.n = o_n;
    ///1. if the ref read only has hom unitigs, is fine
    ///2. otherwise need to have consenus het untigs
    if(!is_hom) {
        if((cns_het <= 0) || (cns_het_occ <= 0) || (cns_het_occ <= (m_het_occ*0.25))) return;
    } else {
        if(ref_cns_occ <= (ref_occ*0.25)) return;
    }
    // print_ul_alignment(ug, &UL_INF, 27512, "inner-4");
    // fprintf(stderr, "\n");
    // print_integer_seq(ug, str_idx->str.a, qid, 1);
    // print_aln_seq(ug, uidx->idx, qid, 1);
    // if(qid == 2062 || qid == 2093) print_cns_seq(ug, str, o, o_n);
    // print_ul_alignment(ug, &UL_INF, 27512, "inner-5");

    for (k = m = 0; k < buf->sc.n; k++) {
        // fprintf(stderr, "[M::%s::k->%lu] m::%lu\n", __func__, k, m);
        // if(k == 72) {
        //     print_integer_ovlps(ug, str_idx->str.a, buf->b.a, buf->b.n, buf->sc.a+k, 1, qid, o_n);
        // }
        if(refine_integer_ovlps(uidx->idx, uidx->bub, ug, str_idx->str.a, buf->b.a, 
                                                            &(buf->sc.a[k]), qid, buf, o, o_n)) {                                                
            buf->sc.a[m++] = buf->sc.a[k];
        } 
        // else {
        //     print_integer_ovlps(ug, str_idx->str.a, buf->b.a, buf->b.n, buf->sc.a+k, 1, qid, o_n);
        //     fprintf(stderr, "[M::%s::] idx->q_sidx::%u, idx->q_eidx::%u, idx->t_sidx::%u, idx->t_eidx::%u\n******************************************************\n", 
        //         __func__, buf->sc.a[k].q_sidx, buf->sc.a[k].q_eidx, buf->sc.a[k].t_sidx, buf->sc.a[k].t_eidx);
        // }
    }
    buf->sc.n = m;
    if(m <= 0) return;
    // print_ul_alignment(ug, &UL_INF, 27512, "inner-6");
    // if(m != str->cn) print_integer_ovlps(uidx->l1_ug, str_idx->str.a, buf->b.a, buf->b.n, buf->sc.a, buf->sc.n, qid, m);
    poa_cns_chain(&(buf->pg), uidx->idx, ug, str_idx->str.a, buf->sc.a, buf->sc.n, qid, buf, &is_circle);
    if(is_circle) {
        buf->n_circle++;
        return;
    }
    // print_ul_alignment(ug, &UL_INF, 27512, "inner-7");
    // print_res_seq(&(buf->pg), ug, buf->pg.srt_b.res.a, buf->pg.srt_b.res.n);
    // radix_sort_ul_chain_t_srt(buf->sc.a, buf->sc.a + buf->sc.n);
    
    // integer_phase(str_idx->str.a, buf, buf->sc.a, buf->sc.n, buf->b.a, qid);

    // radix_sort_ul_chain_t_srt(buf->sc.a, buf->sc.a + buf->sc.n);
    o = NULL; o_n = 0;
    update_raw_integer_seq(&(buf->pg), ug, buf->pg.srt_b.res.a, buf->pg.srt_b.res.n, uidx->idx, str_idx->str.a, qid, buf, buf->sc.a, buf->sc.n);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %ecx, %r13d
movl $0x0, 0x4c(%rsp)
movq 0x1d0(%rdi), %r15
movq %rdx, 0x50(%rsp)
movl %edx, %r14d
movq %r14, %rcx
shlq $0x5, %rcx
movl 0x18(%r15,%rcx), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl $0x2, %eax
jae 0x1fa5ae
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rdi), %rbp
addq %rcx, %r15
cmpq %rax, 0x98(%rsi)
movq %rsi, 0x8(%rsp)
movq %rdi, 0x10(%rsp)
jae 0x1fa62c
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(%rsi)
movq 0xa0(%rsi), %rdi
leaq 0x8(,%rcx,8), %rsi
callq 0x2370
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rax, 0xa0(%rsi)
movl 0x18(%r15), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq %rax, 0x90(%rsi)
testl $0x7fffffff, 0x18(%r15) # imm = 0x7FFFFFFF
movq %r14, 0x28(%rsp)
movq %r15, 0x20(%rsp)
movq %rbp, 0x38(%rsp)
je 0x1fa77a
movq 0x30(%rdi), %rax
movq 0x48(%rax), %rax
imulq $0x58, %r14, %rcx
movq 0x30(%rax,%rcx), %rbx
movq 0x10(%r15), %r14
xorl %r15d, %r15d
movq $0x0, 0x30(%rsp)
movq $0x0, 0x18(%rsp)
xorl %r12d, %r12d
movq (%r14,%r15,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 0x1fae77
leaq (%rbx,%rcx,4), %rcx
movl 0xc(%rcx), %edi
movl 0x10(%rcx), %esi
leaq (%rax,%rax,4), %rdx
shlq $0x3, %rdx
addq 0x10(%rbp), %rdx
callq 0x1f2d50
movq 0x8(%rsp), %rsi
movq 0xa0(%rsi), %rcx
movq %rax, (%rcx,%r15,8)
testq %rax, %rax
je 0x1fae58
testl %r13d, %r13d
movq 0x10(%rsp), %rdi
jne 0x1fa715
movq 0x28(%rdi), %rcx
movl (%r14,%r15,8), %edx
shrl %edx
movq (%rcx), %r8
movq 0x80(%rcx), %rcx
movl (%r8,%rdx,4), %edx
incq %rcx
cmpq %rdx, %rcx
jb 0x1fa715
incq 0x30(%rsp)
addq %rax, 0x18(%rsp)
addq %rax, %r12
incq %r15
movq 0x20(%rsp), %rax
movl 0x18(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpq %rax, %r15
jb 0x1fa686
cmpq $0x0, 0x30(%rsp)
movq %r12, %xmm0
punpckldq 0x2aafc(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
sete %al
subpd 0x2ab01(%rip), %xmm0    # 0x225250
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x2ad6d(%rip), %xmm1    # 0x2254d0
movapd %xmm1, 0x60(%rsp)
movq 0x28(%rsp), %r14
movq 0x20(%rsp), %r15
movq 0x18(%rsp), %rcx
jmp 0x1fa788
movb $0x1, %al
xorpd %xmm0, %xmm0
movapd %xmm0, 0x60(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x18(%rsp)
testq %rcx, %rcx
movl $0x1, %ecx
cmovel %ecx, %r13d
testb %al, %al
cmovnel %ecx, %r13d
movq %r13, 0x40(%rsp)
movq $0x0, 0x30(%rsi)
testl $0x7fffffff, 0x18(%r15) # imm = 0x7FFFFFFF
je 0x1fa9a3
xorl %ebp, %ebp
movq 0x10(%r15), %rax
movl (%rax,%rbp,8), %ecx
movq 0x1a0(%rdi), %rax
movl %ecx, 0x48(%rsp)
shrl %ecx
movq (%rax,%rcx,8), %rbx
movq %rcx, 0x30(%rsp)
movq 0x8(%rax,%rcx,8), %r15
cmpq %rbx, %r15
je 0x1fa989
movq 0x1b8(%rdi), %r12
movq (%r12,%rbx,8), %rax
movq %rax, %rcx
shrq $0x20, %rcx
cmpq %r14, %rcx
je 0x1fa97d
movq 0x1d0(%rdi), %rdx
shlq $0x5, %rcx
testl $0x7ffffffe, 0x18(%rdx,%rcx) # imm = 0x7FFFFFFE
je 0x1fa97d
addq %rcx, %rdx
movq 0x10(%rdx), %rcx
movl %eax, %eax
movl (%rcx,%rax,8), %r14d
movl %r14d, %eax
shrl %eax
cmpl %eax, 0x30(%rsp)
jne 0x1fae1a
movq 0x38(%rsi), %rax
cmpq %rax, 0x30(%rsi)
jne 0x1fa874
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmoveq %rax, %rcx
movq %rcx, 0x38(%rsi)
movq 0x40(%rsi), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2370
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rax, 0x40(%rsi)
movq 0x30(%rsi), %rax
movq 0x40(%rsi), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x30(%rsi)
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %r13
movl 0x48(%rsp), %edx
movl %edx, 0x4(%r13)
movq (%r12,%rbx,8), %rax
movl %eax, (%r13)
movl %r14d, %ecx
xorl %edx, %ecx
andl $0x1, %ecx
je 0x1fa8d3
movq 0x1d0(%rdi), %rdx
movq %rax, %r8
shrq $0x1b, %r8
andq $-0x20, %r8
movl 0x18(%rdx,%r8), %edx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
andl %r8d, %edx
movl %eax, %r8d
notl %r8d
addl %edx, %r8d
movl %r8d, (%r13)
shrq $0x1f, %rax
andl $-0x2, %eax
orl %ecx, %eax
shlq $0x20, %rax
addq %rbp, %rax
movq %rax, 0x10(%r13)
movq 0xa0(%rsi), %rax
movq (%rax,%rbp,8), %rax
movl %eax, 0x8(%r13)
movq 0x30(%rdi), %rcx
movq 0x1d0(%rdi), %rdx
movq 0x48(%rcx), %rcx
movq (%r12,%rbx,8), %rsi
movl %esi, %edi
shrq $0x20, %rsi
imulq $0x58, %rsi, %r8
movq 0x30(%rcx,%r8), %rcx
shlq $0x5, %rsi
movq 0x10(%rdx,%rsi), %rdx
movl 0x4(%rdx,%rdi,8), %edx
leaq (%rdx,%rdx,8), %rsi
movl (%rcx,%rsi,4), %edx
movl 0x20(%rcx,%rsi,4), %edi
shrl $0x5, %edi
andl $0x1, %edi
leal (%rdi,%rdx,2), %edi
cmpl %r14d, %edi
jne 0x1fae39
movl %eax, %r14d
leaq (%rcx,%rsi,4), %rax
movl 0xc(%rax), %edi
movl 0x10(%rax), %esi
leaq (%rdx,%rdx,4), %rdx
shlq $0x3, %rdx
movq 0x38(%rsp), %rax
addq 0x10(%rax), %rdx
callq 0x1f2d50
cmpq %r14, %rax
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %r14
jae 0x1fa97d
movl %eax, 0x8(%r13)
incq %rbx
cmpq %rbx, %r15
jne 0x1fa7ee
incq %rbp
movq 0x20(%rsp), %r15
movl 0x18(%r15), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpq %rax, %rbp
jb 0x1fa7bc
movq 0x30(%rsi), %rax
movq 0x40(%rsi), %rdi
leaq (%rax,%rax,2), %rax
leaq (%rdi,%rax,8), %rsi
callq 0x1e4585
movq 0x8(%rsp), %r10
movq 0x30(%r10), %rbx
movq $0x0, 0xc0(%r10)
testq %rbx, %rbx
je 0x1fab45
movq 0x10(%rsp), %rax
leaq 0x190(%rax), %r15
movl $0x1, %r12d
movl $0x28, %r13d
xorl %ecx, %ecx
leaq 0x70(%rsp), %rbp
cmpq %r12, %rbx
je 0x1faa14
movq 0x40(%r10), %rax
leaq (%rcx,%rcx,2), %rdx
movq (%rax,%r13), %rsi
xorq 0x10(%rax,%rdx,8), %rsi
shrq $0x20, %rsi
je 0x1fab35
leaq (%rcx,%rcx,2), %rsi
shlq $0x3, %rsi
addq 0x40(%r10), %rsi
movq %r12, %rdx
subq %rcx, %rdx
subq $0x8, %rsp
movq 0x58(%rsp), %rdi
movq %r10, %r8
movq 0x40(%rsp), %r9
pushq %rbp
movq 0x20(%rsp), %rax
pushq 0x30(%rax)
pushq %r15
callq 0x1f436a
movq 0x28(%rsp), %r10
addq $0x20, %rsp
movl 0x78(%rsp), %edx
cmpl $-0x1, %edx
setne %sil
andb %al, %sil
movq %r12, %rcx
cmpb $0x1, %sil
jne 0x1fab35
movq 0xc0(%r10), %rax
testq %rax, %rax
je 0x1faaaa
movq 0xd0(%r10), %rcx
leaq (%rax,%rax,4), %rsi
xorl -0x20(%rcx,%rsi,8), %edx
cmpl $0x1, %edx
ja 0x1faaaa
leaq (%rcx,%rsi,8), %rax
movq -0x18(%rax), %rdx
movq %r12, %rcx
cmpq 0x80(%rsp), %rdx
jae 0x1fab35
addq $-0x28, %rax
jmp 0x1fab0e
movq 0xc8(%r10), %rcx
cmpq %rcx, %rax
jne 0x1faaed
leaq (%rcx,%rcx), %rax
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rax
movq %rax, 0xc8(%r10)
movq 0xd0(%r10), %rdi
shlq $0x3, %rax
leaq (%rax,%rax,4), %rsi
callq 0x2370
movq 0x8(%rsp), %r10
movq %rax, 0xd0(%r10)
movq 0xc0(%r10), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xc0(%r10)
leaq (%rax,%rax,4), %rax
shlq $0x3, %rax
addq 0xd0(%r10), %rax
movq 0x90(%rsp), %rcx
movq %rcx, 0x20(%rax)
movupd 0x70(%rsp), %xmm0
movupd 0x80(%rsp), %xmm1
movupd %xmm1, 0x10(%rax)
movupd %xmm0, (%rax)
movq %r12, %rcx
incq %r12
addq $0x18, %r13
cmpq %rbx, %r12
jbe 0x1fa9f4
leaq 0x58(%rsp), %rax
movq $0x0, (%rax)
movq 0x10(%rsp), %rcx
movq 0x28(%rcx), %rdi
movq 0x1d0(%rcx), %rdx
movq 0xd0(%r10), %r8
movq 0x40(%r10), %rcx
movq 0xc0(%r10), %r9
movq %r10, %rsi
pushq %rax
pushq $0x2
pushq 0x50(%rsp)
pushq %r14
callq 0x1f4a7d
addq $0x20, %rsp
movq %rax, %rbp
movq 0x20(%rsp), %rbx
movl 0x18(%rbx), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpq %rax, %rbp
ja 0x1fae96
testq %rbp, %rbp
movq 0x8(%rsp), %r10
je 0x1fa59c
cmpq $0x0, 0x58(%rsp)
jne 0x1fa59c
movq 0x88(%r10), %r13
movq 0xa0(%r10), %rsi
xorl %ecx, %ecx
xorl %eax, %eax
xorl %edx, %edx
xorl %edi, %edi
cmpl $0x0, 0x40(%rsp)
jne 0x1fac21
movq 0x10(%rsp), %r8
movq 0x28(%r8), %r9
movq 0x10(%rbx), %r10
movq (%r13,%rdi,8), %r8
movl (%r10,%r8,8), %r10d
shrl %r10d
movq (%r9), %r11
movq 0x80(%r9), %r9
movl (%r11,%r10,4), %r10d
incq %r9
cmpq %r10, %r9
jae 0x1fac0e
movq 0x8(%rsp), %r10
jmp 0x1fac21
incq %rdx
movq 0x8(%rsp), %r10
movq 0xa0(%r10), %r9
addq (%r9,%r8,8), %rax
movq (%r13,%rdi,8), %r8
addq (%rsi,%r8,8), %rcx
incq %rdi
cmpq %rdi, %rbp
jne 0x1fabd1
movq %rbp, 0x78(%r10)
cmpl $0x0, 0x40(%rsp)
je 0x1fac70
movq %rcx, %xmm0
punpckldq 0x2a5f6(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x2a5fe(%rip), %xmm0    # 0x225250
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd 0x60(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jae 0x1fa59c
jmp 0x1facd7
testq %rdx, %rdx
je 0x1fa59c
testq %rax, %rax
je 0x1fa59c
movq %rax, %xmm0
movq 0x2a5b1(%rip), %xmm1    # 0x225240
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x2a5b5(%rip), %xmm2    # 0x225250
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movq 0x18(%rsp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
subpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x2a803(%rip), %xmm1    # 0x2254d0
ucomisd %xmm3, %xmm1
jae 0x1fa59c
cmpq $0x0, 0xc0(%r10)
je 0x1fad75
xorl %ebx, %ebx
xorl %r14d, %r14d
xorl %r12d, %r12d
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rsi
movq 0x30(%rax), %rdi
movq 0x1d0(%rax), %rcx
movq 0x40(%r10), %r8
movq 0xd0(%r10), %r9
addq %rbx, %r9
movq 0x38(%rsp), %rdx
pushq %rbp
pushq %r13
pushq %r10
pushq 0x40(%rsp)
movq %r10, %r15
callq 0x1f57e9
addq $0x20, %rsp
testq %rax, %rax
je 0x1fad5c
movq 0xd0(%r15), %rax
leaq (%r12,%r12,4), %rcx
incq %r12
movq 0x20(%rax,%rbx), %rdx
movq %rdx, 0x20(%rax,%rcx,8)
movupd (%rax,%rbx), %xmm0
movupd 0x10(%rax,%rbx), %xmm1
movupd %xmm1, 0x10(%rax,%rcx,8)
movupd %xmm0, (%rax,%rcx,8)
movq %r15, %r10
incq %r14
addq $0x28, %rbx
cmpq 0xc0(%r15), %r14
jb 0x1faced
jmp 0x1fad78
xorl %r12d, %r12d
movq %r12, 0xc0(%r10)
testq %r12, %r12
movq 0x28(%rsp), %rax
je 0x1fa59c
leaq 0xf0(%r10), %rbp
movq 0x10(%rsp), %r15
movq 0x30(%r15), %rsi
movq 0x1d0(%r15), %rcx
movq 0xd0(%r10), %r8
subq $0x8, %rsp
leaq 0x54(%rsp), %rbx
movq %rbp, %rdi
movq %r12, %r9
movq 0x40(%rsp), %r12
movq %r12, %rdx
pushq %rbx
pushq %r10
pushq %rax
movq %r10, %r14
callq 0x1f9346
addq $0x20, %rsp
cmpl $0x0, (%rbx)
je 0x1fade3
incq 0x320(%r14)
jmp 0x1fa59c
movq 0x180(%r14), %rdx
movl 0x170(%r14), %ecx
movq 0x30(%r15), %r8
movq 0x1d0(%r15), %r9
subq $0x10, %rsp
movq %rbp, %rdi
movq %r12, %rsi
pushq %r14
pushq 0x68(%rsp)
callq 0x1fa16f
addq $0x20, %rsp
jmp 0x1fa59c
leaq 0x40459(%rip), %rdi     # 0x23b27a
leaq 0x3e4fd(%rip), %rsi     # 0x239325
leaq 0x403f3(%rip), %rcx     # 0x23b222
movl $0x1953, %edx           # imm = 0x1953
callq 0x2110
leaq 0x4044d(%rip), %rdi     # 0x23b28d
leaq 0x3e4de(%rip), %rsi     # 0x239325
leaq 0x403d4(%rip), %rcx     # 0x23b222
movl $0x195c, %edx           # imm = 0x195C
callq 0x2110
leaq 0x4040b(%rip), %rdi     # 0x23b26a
leaq 0x3e4bf(%rip), %rsi     # 0x239325
leaq 0x403b5(%rip), %rcx     # 0x23b222
movl $0x1941, %edx           # imm = 0x1941
callq 0x2110
leaq 0x40376(%rip), %rdi     # 0x23b1f4
leaq 0x3e4a0(%rip), %rsi     # 0x239325
leaq 0x40396(%rip), %rcx     # 0x23b222
movl $0x193f, %edx           # imm = 0x193F
callq 0x2110
leaq 0x4040b(%rip), %rdi     # 0x23b2a8
leaq 0x3e481(%rip), %rsi     # 0x239325
leaq 0x40377(%rip), %rcx     # 0x23b222
movl $0x1975, %edx           # imm = 0x1975
callq 0x2110