// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/tovlp.cpp
// Function: chain_trans_d(utg_trans_t*, unsigned int*, unsigned int, unsigned int, unsigned long*, unsigned int*, unsigned int, unsigned int, unsigned long*, ma_ug_t*, unsigned int, double, char const*)
void chain_trans_d(utg_trans_t *o, 
uint32_t *pri_a, uint32_t pri_n, uint32_t pri_beg, uint64_t *i_pri_len, 
uint32_t *aux_a, uint32_t aux_n, uint32_t aux_beg, uint64_t *i_aux_len,
ma_ug_t *ug, uint32_t flag, double score, const char* cmd)
{
    uint32_t i, len, bn;
    uint64_t pri_len, aux_len;
    kvec_asg_arc_t_offset* u_buffer = &(o->u_buffer);
    kvec_t_i32_warp* tailIndex = &(o->tailIndex);
    asg_arc_t_offset *tt = NULL;
    ca_buf_t *tx = NULL;

    if(i_pri_len) pri_len = (*i_pri_len);
    else pri_len = get_utg_chain_length(ug, pri_a, pri_n);
    
    if(i_aux_len) aux_len = (*i_aux_len);
    else aux_len = get_utg_chain_length(ug, aux_a, aux_n);
        
    tt = NULL; o->c_buf.n = 0; o->k_t_b.n = 0;
    if(tailIndex->a.n > 0) tt = &(u_buffer->a.a[tailIndex->a.a[0]]);
    if(!tt || (pri_beg < (tt->Off>>32) && aux_beg < ((uint32_t)tt->Off)))
    {
        kv_pushp(ca_buf_t, o->c_buf, &tx);
        tx->c_x_p = pri_beg; 
        tx->c_y_p = aux_beg;

        for (i = 0; i < tailIndex->a.n; i++)
        {
            tt = &(u_buffer->a.a[tailIndex->a.a[i]]);
            kv_pushp(ca_buf_t, o->c_buf, &tx);

            tx->c_x_p = tt->Off>>32;
            tx->c_y_p = (uint32_t)tt->Off;
        }
    }
    else if(tailIndex->a.n == 1)//1 ele in chain
    {
        kv_pushp(ca_buf_t, o->c_buf, &tx);
        tx->c_x_p = pri_beg; tx->c_y_p = aux_beg;
    }
    else if(tailIndex->a.n > 0)
    {
        uint32_t cx, cy, ax, ay, found = 0;
        for (i = 0; i < tailIndex->a.n; i++)
        {
            cx = cy = ax = ay = (uint32_t)-1;

            cx = u_buffer->a.a[tailIndex->a.a[i]].Off>>32;
            cy = (uint32_t)u_buffer->a.a[tailIndex->a.a[i]].Off;
            if((i + 1) < tailIndex->a.n)
            {
                ax = u_buffer->a.a[tailIndex->a.a[i+1]].Off>>32;
                ay = (uint32_t)u_buffer->a.a[tailIndex->a.a[i+1]].Off;
            }

            kv_pushp(ca_buf_t, o->c_buf, &tx);
            tx->c_x_p = cx; tx->c_y_p = cy;

            if(found) continue;
            if(pri_beg > cx && pri_beg < ax && aux_beg > cy && aux_beg < ay)
            {
                kv_pushp(ca_buf_t, o->c_buf, &tx);
                tx->c_x_p = pri_beg; tx->c_y_p = aux_beg;
                found = 1;
            } 
        }
    }

    
    // fprintf(stderr, "\ncmd-%s\n", cmd);
    // fprintf(stderr, "pri_beg=%u, pri_len=%lu\n", pri_beg, pri_len);
    // fprintf(stderr, "aux_beg=%u, aux_len=%lu\n", aux_beg, aux_len);

    // print_buf_t(ug, pri, "pri");
    // print_buf_t(ug, aux, "aux");


    tx = &(o->c_buf.a[o->c_buf.n-1]);
    len = MIN(pri_len - tx->c_x_p, aux_len - tx->c_y_p);
    if(len > 0)///insert boundary
    {
        kv_pushp(ca_buf_t, o->c_buf, &tx);
        tx->c_x_p = o->c_buf.a[o->c_buf.n-2].c_x_p + len;
        tx->c_y_p = o->c_buf.a[o->c_buf.n-2].c_y_p + len;     
    }

    tx = &(o->c_buf.a[0]);///insert boundary
    if(tx->c_x_p != 0 && tx->c_y_p != 0)///already at boundary
    {
        len = MIN(tx->c_x_p, tx->c_y_p);///offset
        kv_pushp(ca_buf_t, o->c_buf, &tx);
        for (i = 0; (i + 1)< o->c_buf.n; i++)
        {
            o->c_buf.a[o->c_buf.n - i - 1] = o->c_buf.a[o->c_buf.n - i - 2];
        }
        o->c_buf.a[0].c_x_p = o->c_buf.a[1].c_x_p - len;
        o->c_buf.a[0].c_y_p = o->c_buf.a[1].c_y_p - len;
    }

    ///chain is [s, e)
    if(o->c_buf.a[0].c_x_p != 0 && o->c_buf.a[0].c_y_p != 0) fprintf(stderr, "ERROR1\n");
    if(o->c_buf.a[o->c_buf.n-1].c_x_p!= pri_len && 
                                            o->c_buf.a[o->c_buf.n-1].c_y_p!= aux_len)
    {
        fprintf(stderr, "ERROR2\n");
    }

    utg_trans_hit_idx iter;
    utg_thit_t hit, *kh = NULL;
    ////////prx
    reset_utg_trans_hit_idx(&iter, pri_a, pri_n, ug, o, o->c_buf.a[0].c_x_p, o->c_buf.a[o->c_buf.n-1].c_x_p);    
    while(get_utg_trans_hit(&iter, &hit))//get [qs, qe), [qus, que)
    {
        refine_utg_thit_t(&hit, &(o->c_buf)); ///get [ts, te)
        kv_push(utg_thit_t, o->k_t_b, hit);
    }
    bn = o->k_t_b.n;
    
    ////////aux
    reset_utg_trans_hit_idx(&iter, aux_a, aux_n, ug, o, o->c_buf.a[0].c_y_p, o->c_buf.a[o->c_buf.n-1].c_y_p);    
    while(get_utg_trans_hit(&iter, &hit))
    {
        extract_sub_overlaps_utg_thit(hit.qs, hit.qe, hit.qus, hit.que, hit.qn, &(o->k_t_b), bn);
    }

    if(o->k_t_b.n - bn == 0) fprintf(stderr, "ERROR7\n");
    
    // fprintf(stderr, "\n******o->k_t_b.n: %u, bn: %u\n", (uint32_t)o->k_t_b.n, bn);
    // for (i = 0; i < pri_n; i++)
    // {
    //     fprintf(stderr, "p-utg%.6ul\n", (pri_a[i]>>1) + 1);
    // }
    // for (i = 0; i < aux_n; i++)
    // {
    //     fprintf(stderr, "a-utg%.6ul\n", (aux_a[i]>>1) + 1);
    // }

    u_trans_t *kt = NULL;
    double x_score, y_score;
    for (i = bn; i < o->k_t_b.n; i++)
    {
        kh = &(o->k_t_b.a[i]);
        if(kh->que <= kh->qus) continue;
        if(kh->tue <= kh->tus) continue;
        kv_pushp(u_trans_t, o->k_trans, &kt);
        kt->f = flag; kt->rev = ((kh->qn ^ kh->tn) & 1); kt->del = 0; 
        kt->qn = kh->qn>>1; kt->qs = kh->qus; kt->qe = kh->que; ///kt->qo = kh->qn&1;
        kt->tn = kh->tn>>1; kt->ts = kh->tus; kt->te = kh->tue; ///kt->to = kh->tn&1;
        if(score < 0)
        {
            kt->nw = (MIN((kt->qe - kt->qs), (kt->te - kt->ts)))*CHAIN_MATCH;
        } 
        else
        {
            x_score = ((double)(kt->qe-kt->qs)/(double)(o->c_buf.a[o->c_buf.n-1].c_x_p-o->c_buf.a[0].c_x_p))*score;
            y_score = ((double)(kt->te-kt->ts)/(double)(o->c_buf.a[o->c_buf.n-1].c_y_p-o->c_buf.a[0].c_y_p))*score;
            kt->nw = MIN(x_score, y_score);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movdqa %xmm0, 0x70(%rsp)
movq %r9, %r15
movl %ecx, 0xc(%rsp)
movq %rdi, %rbx
movq 0x108(%rsp), %r12
movq 0x100(%rsp), %r14
testq %r8, %r8
movq %rsi, 0x60(%rsp)
movl %edx, 0x2c(%rsp)
je 0x197889
movq (%r8), %rax
jmp 0x197891
movq %r12, %rdi
callq 0x197074
movq %rax, 0x30(%rsp)
movl 0xf0(%rsp), %edx
testq %r14, %r14
je 0x1978a7
movq (%r14), %rax
jmp 0x1978b2
movq %r12, %rdi
movq %r15, %rsi
callq 0x197074
movq %rax, 0x20(%rsp)
movl 0xc(%rsp), %ebp
movl 0xf8(%rsp), %r9d
leaq 0x98(%rbx), %rax
movq %rax, 0x10(%rsp)
xorl %eax, %eax
movq %rax, 0x98(%rbx)
movq %rax, 0x80(%rbx)
movq 0x40(%rbx), %rdx
testq %rdx, %rdx
movq %r15, 0x68(%rsp)
je 0x197920
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0x197920
movq 0x50(%rbx), %rcx
movslq (%rcx), %rcx
leaq (%rcx,%rcx,4), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, %rcx
shrq $0x20, %rcx
cmpl %ebp, %ecx
setbe %cl
cmpl %r9d, %eax
setbe %al
orb %cl, %al
jne 0x197a32
cmpq $0x0, 0xa0(%rbx)
je 0x197935
movq 0xa8(%rbx), %rax
xorl %ecx, %ecx
jmp 0x19796b
movq $0x2, 0xa0(%rbx)
movq 0xa8(%rbx), %rdi
movl $0x38, %esi
callq 0x2370
movl 0xf8(%rsp), %r9d
movq %rax, 0xa8(%rbx)
movq 0x40(%rbx), %rdx
movq 0x98(%rbx), %rcx
leaq 0x1(%rcx), %rsi
movq %rsi, 0x98(%rbx)
leaq (%rcx,%rcx,8), %rdi
leaq (%rdi,%rdi,2), %rdi
addq %rcx, %rdi
movl %ebp, 0x10(%rax,%rdi)
movl %r9d, 0x14(%rax,%rdi)
testq %rdx, %rdx
je 0x197a2a
movl $0x1, %ebp
xorl %edi, %edi
movl $0x2, %r14d
movq 0x30(%rbx), %r15
movq 0x50(%rbx), %rcx
movslq (%rcx,%rdi,4), %r12
cmpq 0xa0(%rbx), %rsi
jne 0x1979ec
leaq (%rsi,%rsi), %rcx
testq %rsi, %rsi
cmoveq %r14, %rcx
movq %rcx, 0xa0(%rbx)
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rsi
addq %rcx, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0xa8(%rbx)
movq 0x40(%rbx), %rdx
movq 0x98(%rbx), %rsi
leaq 0x1(%rsi), %rcx
movq 0x10(%rsp), %rdi
movq %rcx, (%rdi)
leaq (%rsi,%rsi,8), %rdi
leaq (%rdi,%rdi,2), %rdi
addq %rsi, %rdi
leaq (%r12,%r12,4), %rsi
movq 0x18(%r15,%rsi,8), %rsi
rorq $0x20, %rsi
movq %rsi, 0x10(%rax,%rdi)
movl %ebp, %edi
incl %ebp
movq %rcx, %rsi
cmpq %rdi, %rdx
ja 0x1979a0
jmp 0x197c17
movq %rsi, %rcx
jmp 0x197c17
cmpq $0x1, %rdx
jne 0x197a54
cmpq $0x0, 0xa0(%rbx)
je 0x197bc5
movq 0xa8(%rbx), %rax
xorl %edx, %edx
jmp 0x197bf7
xorl %ecx, %ecx
movl $0x1, %esi
xorl %r15d, %r15d
xorl %r14d, %r14d
movq %r15, %rax
movq 0x30(%rbx), %rdi
movq 0x50(%rbx), %r8
movl %esi, %r15d
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
cmpq %r15, %rdx
jbe 0x197a94
movslq (%r8,%r15,4), %rdx
leaq (%rdx,%rdx,4), %rdx
movq 0x18(%rdi,%rdx,8), %r12
movq %r12, %r13
shrq $0x20, %r13
movslq (%r8,%rax,4), %rax
leaq (%rax,%rax,4), %rax
movq 0x18(%rdi,%rax,8), %rbp
movq 0xa8(%rbx), %rax
cmpq 0xa0(%rbx), %rcx
jne 0x197af1
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rdx
movq %rdx, 0xa0(%rbx)
leaq (%rdx,%rdx,8), %rcx
leaq (%rcx,%rcx,2), %rsi
addq %rdx, %rsi
movq %rax, %rdi
callq 0x2370
movl 0xf8(%rsp), %r9d
movq %rax, 0xa8(%rbx)
movq 0x98(%rbx), %rcx
movq %rbp, %rdx
shrq $0x20, %rdx
leaq (%rcx,%rcx,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rcx, %rsi
incq %rcx
movq 0x10(%rsp), %rdi
movq %rcx, (%rdi)
movl %edx, 0x10(%rax,%rsi)
movl %ebp, 0x14(%rax,%rsi)
movl $0x1, %edi
testl %r14d, %r14d
jne 0x197baf
movl 0xc(%rsp), %r14d
cmpl %r14d, %edx
jae 0x197bad
cmpl %r14d, %r13d
jbe 0x197bad
cmpl %r9d, %ebp
jae 0x197bad
cmpl %r9d, %r12d
jbe 0x197bad
cmpq 0xa0(%rbx), %rcx
jne 0x197b8b
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rdx
movq %rdx, 0xa0(%rbx)
leaq (%rdx,%rdx,8), %rcx
leaq (%rcx,%rcx,2), %rsi
addq %rdx, %rsi
movq %rax, %rdi
callq 0x2370
movl $0x1, %edi
movl 0xf8(%rsp), %r9d
movq %rax, 0xa8(%rbx)
movq 0x98(%rbx), %rcx
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
incq %rcx
movq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
movl %r14d, 0x10(%rax,%rdx)
movl %r9d, 0x14(%rax,%rdx)
jmp 0x197baf
xorl %edi, %edi
movq 0x40(%rbx), %rdx
leal 0x1(%r15), %esi
movl %edi, %r14d
cmpq %r15, %rdx
ja 0x197a61
jmp 0x197c17
movq $0x2, 0xa0(%rbx)
movq 0xa8(%rbx), %rdi
movl $0x38, %esi
callq 0x2370
movl 0xf8(%rsp), %r9d
movq %rax, 0xa8(%rbx)
movq 0x98(%rbx), %rdx
leaq 0x1(%rdx), %rcx
movq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
leaq (%rdx,%rdx,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rdx, %rsi
movl %ebp, 0x10(%rax,%rsi)
movl %r9d, 0x14(%rax,%rsi)
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movl -0xc(%rax,%rdx), %esi
movl -0x8(%rax,%rdx), %edx
movq 0x30(%rsp), %r12
movq %r12, %rdi
subq %rsi, %rdi
movq 0x20(%rsp), %r14
subq %rdx, %r14
cmpq %r14, %rdi
cmovbq %rdi, %r14
testl %r14d, %r14d
je 0x197cba
cmpq 0xa0(%rbx), %rcx
jne 0x197c8a
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %ecx
cmovneq %rdx, %rcx
movq %rcx, 0xa0(%rbx)
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rsi
addq %rcx, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0xa8(%rbx)
movq 0x98(%rbx), %rcx
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
incq %rcx
movq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
movq -0xc(%rax,%rdx), %xmm0
movd %r14d, %xmm1
pshufd $0x50, %xmm1, %xmm1     # xmm1 = xmm1[0,0,1,1]
paddd %xmm0, %xmm1
movq %xmm1, 0x10(%rax,%rdx)
movq 0x108(%rsp), %r15
movl 0x10(%rax), %edx
testl %edx, %edx
je 0x197d94
movl 0x14(%rax), %ebp
testl %ebp, %ebp
je 0x197d8a
cmpl %ebp, %edx
cmovbl %edx, %ebp
cmpq 0xa0(%rbx), %rcx
jne 0x197d1e
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %ecx
cmovneq %rdx, %rcx
movq %rcx, 0xa0(%rbx)
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rsi
addq %rcx, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0xa8(%rbx)
movq 0x98(%rbx), %rcx
incq %rcx
movq 0x10(%rsp), %rdx
movq %rcx, (%rdx)
cmpq $0x2, %rcx
jb 0x197d78
xorl %eax, %eax
movq 0xa8(%rbx), %rdx
movl %eax, %esi
subq %rsi, %rcx
leaq (%rcx,%rcx,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rcx, %rsi
movdqu -0x38(%rdx,%rsi), %xmm0
movdqu -0x2c(%rdx,%rsi), %xmm1
movdqu %xmm1, -0x10(%rdx,%rsi)
movdqu %xmm0, -0x1c(%rdx,%rsi)
leal 0x2(%rax), %edx
movq 0x98(%rbx), %rcx
incl %eax
cmpq %rdx, %rcx
ja 0x197d31
movq 0xa8(%rbx), %rax
movl 0x2c(%rax), %edx
movl 0x30(%rax), %esi
subl %ebp, %esi
subl %ebp, %edx
movl %edx, 0x10(%rax)
movl %esi, 0x14(%rax)
je 0x197d94
cmpl $0x0, 0x14(%rax)
jne 0x1981a3
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movl -0xc(%rax,%rdx), %ecx
cmpq %rcx, %r12
je 0x197db9
addq %rax, %rdx
movl -0x8(%rdx), %edx
cmpq %rdx, 0x20(%rsp)
jne 0x198161
leaq 0x80(%rbx), %r14
movl 0x10(%rax), %eax
leaq 0x88(%rsp), %rdi
movq 0x60(%rsp), %rdx
movq %rdx, 0x10(%rdi)
movl 0x2c(%rsp), %edx
movl %edx, 0x18(%rdi)
movq %r15, 0x20(%rdi)
movq %rbx, 0x28(%rdi)
movl %eax, 0x8(%rdi)
movl %ecx, 0xc(%rdi)
movq $0x0, (%rdi)
leaq 0x38(%rsp), %rsi
callq 0x197680
testl %eax, %eax
je 0x197ea8
leaq 0x38(%rsp), %r15
movl $0x2, %r12d
leaq 0x88(%rsp), %r13
movq %r15, %rdi
movq 0x10(%rsp), %rsi
callq 0x19713d
movq 0x80(%rbx), %rcx
movq 0x90(%rbx), %rax
cmpq 0x88(%rbx), %rcx
jne 0x197e69
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
cmoveq %r12, %rdx
movq %rdx, 0x88(%rbx)
shlq $0x3, %rdx
leaq (%rdx,%rdx,4), %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x90(%rbx)
movq 0x80(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%r14)
leaq (%rcx,%rcx,4), %rcx
movq 0x58(%rsp), %rdx
movq %rdx, 0x20(%rax,%rcx,8)
movdqu 0x38(%rsp), %xmm0
movdqu 0x48(%rsp), %xmm1
movdqu %xmm1, 0x10(%rax,%rcx,8)
movdqu %xmm0, (%rax,%rcx,8)
movq %r13, %rdi
movq %r15, %rsi
callq 0x197680
testl %eax, %eax
jne 0x197e15
movq 0x80(%rbx), %r13
movq 0x98(%rbx), %rax
movl %r13d, %ebp
movq 0xa8(%rbx), %rcx
movl 0x14(%rcx), %edx
leaq (%rax,%rax,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rax, %rsi
movl -0x8(%rcx,%rsi), %eax
leaq 0x88(%rsp), %rdi
movq 0x68(%rsp), %rcx
movq %rcx, 0x10(%rdi)
movl 0xf0(%rsp), %ecx
movl %ecx, 0x18(%rdi)
movq 0x108(%rsp), %rcx
movq %rcx, 0x20(%rdi)
movq %rbx, 0x28(%rdi)
movl %edx, 0x8(%rdi)
movl %eax, 0xc(%rdi)
movq $0x0, (%rdi)
leaq 0x38(%rsp), %rsi
callq 0x197680
testl %eax, %eax
je 0x197f55
leaq 0x88(%rsp), %r15
leaq 0x38(%rsp), %r12
movl 0x38(%rsp), %edi
movl 0x3c(%rsp), %esi
movl 0x44(%rsp), %edx
movl 0x48(%rsp), %ecx
movl 0x40(%rsp), %r8d
movl %r13d, (%rsp)
movq %r14, %r9
callq 0x1973f0
movq %r15, %rdi
movq %r12, %rsi
callq 0x197680
testl %eax, %eax
jne 0x197f25
movq (%r14), %rax
cmpq %rbp, %rax
je 0x198139
cmpq %rbp, %rax
jbe 0x198127
movl 0x110(%rsp), %r12d
andb $0x3f, %r12b
movapd 0x70(%rsp), %xmm0
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
movapd %xmm0, 0x10(%rsp)
incl %r13d
movl $0x2, %r15d
xorpd %xmm3, %xmm3
movq 0x90(%rbx), %rax
leaq (,%rbp,4), %rcx
addq %rbp, %rcx
movl 0x10(%rax,%rcx,8), %edx
cmpl 0xc(%rax,%rcx,8), %edx
jbe 0x198118
leaq (%rax,%rcx,8), %rbp
movl 0x24(%rbp), %eax
cmpl 0x20(%rbp), %eax
jbe 0x198118
movq 0xb0(%rbx), %rcx
movq 0xc0(%rbx), %rax
cmpq 0xb8(%rbx), %rcx
jne 0x19800e
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
cmoveq %r15, %rdx
movq %rdx, 0xb8(%rbx)
shlq $0x4, %rdx
leaq (%rdx,%rdx,2), %rsi
movq %rax, %rdi
callq 0x2370
xorpd %xmm3, %xmm3
movq %rax, 0xc0(%rbx)
movq 0xb0(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0xb0(%rbx)
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movb 0x28(%rax,%rcx), %dl
andb $-0x40, %dl
orb %r12b, %dl
movb %dl, 0x28(%rax,%rcx)
movl 0x1c(%rbp), %edx
xorl 0x8(%rbp), %edx
shlb $0x6, %dl
andb $0x40, %dl
orb %r12b, %dl
movb %dl, 0x28(%rax,%rcx)
movl 0x8(%rbp), %edx
shrl %edx
movl %edx, 0x8(%rax,%rcx)
movl 0xc(%rbp), %esi
movl %esi, (%rax,%rcx)
movl 0x10(%rbp), %edx
movl %edx, 0x4(%rax,%rcx)
movl 0x1c(%rbp), %edi
shrl %edi
subl %esi, %edx
ucomisd 0x70(%rsp), %xmm3
movl %edi, 0x14(%rax,%rcx)
movl 0x20(%rbp), %edi
movl %edi, 0xc(%rax,%rcx)
movl 0x24(%rbp), %esi
movl %esi, 0x10(%rax,%rcx)
jbe 0x19808d
subl %edi, %esi
cmpl %esi, %edx
cmovbl %edx, %esi
xorps %xmm0, %xmm0
cvtsi2sd %rsi, %xmm0
jmp 0x198110
movq 0x98(%rbx), %r8
movq 0xa8(%rbx), %r9
leaq (%r8,%r8,8), %r10
leaq (%r10,%r10,2), %r10
addq %r8, %r10
subl %edi, %esi
movd %esi, %xmm0
movd %edx, %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
pxor %xmm4, %xmm4
punpckldq %xmm4, %xmm1    # xmm1 = xmm1[0],xmm4[0],xmm1[1],xmm4[1]
movdqa 0x9dbbc(%rip), %xmm5    # 0x235c80
por %xmm5, %xmm1
subpd %xmm5, %xmm1
movq -0xc(%r9,%r10), %xmm0
movq 0x10(%r9), %xmm2
psubd %xmm2, %xmm0
punpckldq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1]
por %xmm5, %xmm0
subpd %xmm5, %xmm0
divpd %xmm0, %xmm1
mulpd 0x10(%rsp), %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
movapd %xmm1, %xmm0
cmplesd %xmm2, %xmm0
andpd %xmm0, %xmm1
andnpd %xmm2, %xmm0
orpd %xmm1, %xmm0
addq %rcx, %rax
movsd %xmm0, 0x20(%rax)
movl %r13d, %ebp
incl %r13d
cmpq %rbp, (%r14)
ja 0x197f93
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xfcea0(%rip), %rax     # 0x294fe0
movq (%rax), %rcx
leaq 0xa782c(%rip), %rdi     # 0x23f976
movl $0x7, %esi
movl $0x1, %edx
callq 0x2410
movq (%r14), %rax
jmp 0x197f61
movq 0xfce78(%rip), %rax     # 0x294fe0
movq (%rax), %rcx
leaq 0x9e6c2(%rip), %rdi     # 0x236834
movl $0x7, %esi
movl $0x1, %edx
callq 0x2410
movq 0x98(%rbx), %rcx
movq 0xa8(%rbx), %rax
leaq (%rcx,%rcx,8), %rdx
leaq (%rdx,%rdx,2), %rdx
addq %rcx, %rdx
movl -0xc(%rax,%rdx), %ecx
jmp 0x197db9
movq 0xfce36(%rip), %rax     # 0x294fe0
movq (%rax), %rcx
leaq 0x9e678(%rip), %rdi     # 0x23682c
movl $0x7, %esi
movl $0x1, %edx
callq 0x2410
movq 0x98(%rbx), %rcx
movq 0xa8(%rbx), %rax
jmp 0x197d94