// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/hic.cpp
// Function: get_trans_rate_function_advance(ha_ug_index*, kvec_pe_hit*, hc_links*, bubble_type*, H_partition*, signed char*, mc_gg_status*, trans_idx*)
int get_trans_rate_function_advance(ha_ug_index* idx, kvec_pe_hit* hits, hc_links* link, bubble_type* bub, 
H_partition* hap, int8_t *s, mc_gg_status *sa, trans_idx* dis)
{
    kvec_t(uint64_t) buf;
    kv_init(buf);
    uint64_t beg, end, cnt[2];
    uint64_t k, i, t_d, r_idx, f_idx, med = (uint64_t)-1;
    uint32_t is_s;
    // int beg_status, end_status;

    buf.n = 0;
    for (k = 0; k < hits->a.n; ++k) 
    {
        beg = ((hits->a.a[k].s<<1)>>(64 - idx->uID_bits));
        end = ((hits->a.a[k].e<<1)>>(64 - idx->uID_bits));

        if(IF_HOM(beg, *bub)) continue;
        if(IF_HOM(end, *bub)) continue;
        if(is_hom_hit(hits->a.a[k])) continue;


        t_d = get_hic_distance(&(hits->a.a[k]), link, idx, NULL);
        if(t_d == (uint64_t)-1) continue;
        // if(beg == end)
        // {
        //     t_d = (t_d << 1);
        // }
        // else
        // {
        //     beg_status = (hap? get_phase_status(hap, beg):s[beg]);
        //     if(beg_status != 1 && beg_status != -1) continue;
        //     end_status = (hap? get_phase_status(hap, end):s[end]);
        //     if(end_status != 1 && end_status != -1) continue;
        //     if(beg_status != end_status)
        //     {
        //         t_d = (t_d << 1) + 1; 
        //     }
        //     else
        //     {
        //         t_d = (t_d << 1);
        //     }            
        // }
        is_s = is_same_phase(beg, end, hap, s, sa);
        if(is_s == (uint32_t)-1) continue;
        t_d = (t_d << 1) + 1 - is_s;

        kv_push(uint64_t, buf, t_d); 
    }

    ///might have bias, we may not use right linkage larger than trans rc linkage
    radix_sort_hc64(buf.a, buf.a+buf.n);

    for (k = 0, r_idx = f_idx = (uint64_t)-1; k < buf.n; k++)
    {
        if((buf.a[k]&1) == 0) r_idx = k;
        if((buf.a[k]&1) == 1) f_idx = k;
    }
    buf.n = MIN(r_idx, f_idx);

    
    trans_p_t* p = NULL;
    dis->n = 0;
    uint64_t bin_size = MIN(2250, buf.n>>8), m;
    if(bin_size == 0)
    {
        for (i = 8; i > 0; i--)
        {
            bin_size = buf.n>>i;
            if(bin_size > 0) break;
        }
        if(bin_size == 0) bin_size = buf.n;
    }
    i = 0;
    while (i < buf.n)
    {
        kv_pushp(trans_p_t, *dis, &p);
        p->beg = i;

        cnt[0] = cnt[1] = 0;
        k = MIN(i+bin_size, buf.n);
        for (; i < k; i++)
        {
            cnt[buf.a[i]&1]++;
        }
        p->end = i;
        p->cnt_0 = cnt[0];
        p->cnt_1 = cnt[1];
    }

    i = m = 0; med = (uint64_t)-1;
    while(i < dis->n)
    {
        if(dis->a[i].cnt_0 > 0 && dis->a[i].cnt_1 > 0)
        {
            dis->a[m] = dis->a[i];
            m++;
            i++;
            continue;
        }

        if(med == (uint64_t)-1) med = buf.a[dis->a[i].beg]>>1;
        k = i; cnt[0] = cnt[1] = 0;
        for (; i < dis->n; i++)
        {
            cnt[0] += dis->a[i].cnt_0;
            cnt[1] += dis->a[i].cnt_1;
            if(cnt[0] > 0 && cnt[1] > 0) break;
        }

        if(i < dis->n)
        {
            dis->a[m].cnt_0 = cnt[0];
            dis->a[m].cnt_1 = cnt[1];
            dis->a[m].beg = dis->a[k].beg;
            dis->a[m].end = dis->a[i].end;
            m++;
            i++;
            continue;
        }

        cnt[0] -= dis->a[k].cnt_0;
        cnt[1] -= dis->a[k].cnt_1;
        while (1)
        {
            cnt[0] += dis->a[k].cnt_0;
            cnt[1] += dis->a[k].cnt_1;
            if(cnt[0] > 0 && cnt[1] > 0) break;

            if(k == 0)
            {
                k = (uint64_t)-1;
                break;
            } 
            k--;
        }

        if(k != (uint64_t)-1)
        {
            dis->a[m].cnt_0 = cnt[0];
            dis->a[m].cnt_1 = cnt[1];
            dis->a[m].end = dis->a[i-1].end;
            continue;
        }
        m = 0;
        break;
    }
    dis->n = m;
    if(dis->n == 0)
    {
        kv_destroy(buf);
        return 0;
    } 

    for (i = 0; i < dis->n; i++)
    {
        dis->a[i].beg = buf.a[dis->a[i].beg]>>1;
        dis->a[i].end = (buf.a[dis->a[i].end-1]>>1);
    }

    for (i = 0; i < dis->n - 1; i++)
    {
        dis->a[i].end += ((dis->a[i+1].beg - dis->a[i].end)/2);
        dis->a[i+1].beg = dis->a[i].end;
    }

    // for (i = 0; i < dis->n; i++)
    // {
    //     if(i > 0 && dis->a[i].beg != dis->a[i-1].end) fprintf(stderr, "ERROR: dis->a[i].beg: %lu, dis->a[i-1].end: %lu\n", dis->a[i].beg, dis->a[i-1].end);
    //     fprintf(stderr, "beg: %lu, end: %lu, cnt_0: %lu, cnt_1: %lu, error_rate: %f\n", 
    //     dis->a[i].beg, dis->a[i].end, dis->a[i].cnt_0, dis->a[i].cnt_1, (double)(dis->a[i].cnt_1)/(double)(dis->a[i].cnt_1 + dis->a[i].cnt_0));
    // }
    
    LeastSquare_advance(dis, idx, med);
    // fprintf(stderr, "idx->a: %f, idx->b: %f, idx->frac: %f, med: %lu\n", 
    // (double)idx->a, (double)idx->b, (double)idx->frac, med);

    dis->max = dis->a[dis->n-1].end;


    
    if(idx->a < 0) idx->a = 0;
    if(idx->a == 0)
    {
        idx->b = MAX((((double)(dis->a[dis->n-1].cnt_1))/((double)(dis->a[dis->n-1].cnt_0 + dis->a[dis->n-1].cnt_1))), idx->b);
    }
    if(idx->b < 0 && get_trans(idx, dis->max) < 0)
    {
        idx->b = ((double)(dis->a[dis->n-1].cnt_1))/((double)(dis->a[dis->n-1].cnt_0 + dis->a[dis->n-1].cnt_1));
    } 

    // fprintf(stderr, "idx->a: %f, idx->b: %f, idx->frac: %f, med: %lu\n", 
    // (double)idx->a, (double)idx->b, (double)idx->frac, med);





    buf.n = 0;
    for (k = 0; k < hits->a.n; ++k) 
    {
        beg = ((hits->a.a[k].s<<1)>>(64 - idx->uID_bits));
        end = ((hits->a.a[k].e<<1)>>(64 - idx->uID_bits));

        if(IF_HOM(beg, *bub)) continue;
        if(IF_HOM(end, *bub)) continue;
        if(is_hom_hit(hits->a.a[k])) continue;
        if(beg == end) continue;

        t_d = get_hic_distance(&(hits->a.a[k]), link, idx, NULL);
        if(t_d == (uint64_t)-1) continue;
        kv_push(uint64_t, buf, t_d); 
    }

    ///might have bias, we may not use right linkage larger than trans rc linkage
    radix_sort_hc64(buf.a, buf.a+buf.n);
    if(buf.n == 0)
    {
        dis->med = 0;
    }
    else
    {
        dis->med = ((buf.n&1)?buf.a[buf.n>>1]:((buf.a[buf.n>>1]+buf.a[(buf.n>>1)-1])/2));
    }

    // fprintf(stderr, "dis->med: %lu\n", dis->med);
    
    kv_destroy(buf);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r9, 0x50(%rsp)
movq %r8, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq 0xb8(%rsp), %rbp
movq (%rsi), %r13
testq %r13, %r13
movq %rcx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, (%rsp)
je 0x151e67
movq %rcx, %r8
movq %rdi, %rdx
xorl %r15d, %r15d
xorl %ebx, %ebx
movq $0x0, 0x30(%rsp)
movq $0x0, 0x18(%rsp)
xorl %r14d, %r14d
movq 0x10(%rsi), %rdi
movq (%rdi,%r15), %r12
addq %r12, %r12
xorl %ecx, %ecx
subb 0x18(%rdx), %cl
shrq %cl, %r12
movq 0x8(%rdi,%r15), %rbp
addq %rbp, %rbp
shrq %cl, %rbp
movq (%r8), %rcx
movq 0x80(%r8), %rax
movl (%rcx,%r12,4), %r9d
incq %rax
cmpq %r9, %rax
jb 0x151e12
movl (%rcx,%rbp,4), %ecx
cmpq %rcx, %rax
jb 0x151e12
cmpq $-0x1, 0x10(%rdi,%r15)
je 0x151e12
addq %r15, %rdi
movq 0x40(%rsp), %rsi
xorl %ecx, %ecx
callq 0x14a518
cmpq $-0x1, %rax
je 0x151e04
movq %rax, 0x38(%rsp)
movq %r12, %rdi
movq %rbp, %rsi
movq 0x48(%rsp), %rdx
movq 0x50(%rsp), %rcx
movq 0xb0(%rsp), %r8
callq 0x151bc3
cmpl $-0x1, %eax
je 0x151e04
movl %eax, %ebp
movq 0x30(%rsp), %r12
cmpq 0x18(%rsp), %r12
jne 0x151dd3
leaq (%r12,%r12), %rax
testq %r12, %r12
movl $0x2, %ecx
cmoveq %rcx, %rax
movq %rax, 0x18(%rsp)
leaq (,%rax,8), %rsi
movq %r14, %rdi
callq 0x2370
movq %rax, %r14
movq 0x10(%rsp), %r8
movq 0x8(%rsp), %rsi
movq (%rsp), %rdx
movq 0x38(%rsp), %rax
leaq 0x1(,%rax,2), %rax
movl %ebp, %ecx
subq %rcx, %rax
movq %rax, (%r14,%r12,8)
incq %r12
movq %r12, 0x30(%rsp)
movq (%rsi), %r13
jmp 0x151e12
movq 0x10(%rsp), %r8
movq 0x8(%rsp), %rsi
movq (%rsp), %rdx
incq %rbx
addq $0x20, %r15
cmpq %r13, %rbx
jb 0x151d0d
movq 0x30(%rsp), %rbx
leaq (%r14,%rbx,8), %rsi
movq %r14, %rdi
callq 0x1379f9
testq %rbx, %rbx
je 0x151e8c
movq $-0x1, %r12
xorl %ecx, %ecx
movq $-0x1, %rax
movq 0xb8(%rsp), %rbp
testb $0x1, (%r14,%rcx,8)
cmoveq %rcx, %rax
cmovneq %rcx, %r12
incq %rcx
cmpq %rcx, %rbx
jne 0x151e50
jmp 0x151ea2
movq $0x0, 0x18(%rsp)
xorl %edi, %edi
xorl %esi, %esi
callq 0x1379f9
movq $-0x1, %rax
xorl %r14d, %r14d
movq $-0x1, %r12
jmp 0x151ea2
movq $-0x1, %rax
movq $-0x1, %r12
movq 0xb8(%rsp), %rbp
cmpq %r12, %rax
cmovbq %rax, %r12
movq $0x0, 0x8(%rbp)
movq %r12, %rax
shrq $0x8, %rax
cmpq $0x8ca00, %r12          # imm = 0x8CA00
movl $0x8ca, %ebx            # imm = 0x8CA
cmovbq %rax, %rbx
testq %rbx, %rbx
jne 0x151ee5
movl $0x8, %ecx
movq %r12, %rbx
shrq %cl, %rbx
testq %rbx, %rbx
jne 0x151ee5
decq %rcx
jne 0x151ed2
movq %r12, %rbx
testq %r12, %r12
je 0x152160
movq (%rbp), %rax
xorl %ecx, %ecx
movl $0x2, %r15d
xorpd %xmm1, %xmm1
xorl %r13d, %r13d
cmpq 0x10(%rbp), %rcx
jne 0x151f32
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
cmoveq %r15, %rdx
movq %rdx, 0x10(%rbp)
shlq $0x3, %rdx
leaq (%rdx,%rdx,4), %rsi
movq %rax, %rdi
callq 0x2370
xorpd %xmm1, %xmm1
movq %rax, (%rbp)
movq 0x8(%rbp), %rcx
leaq (%rcx,%rcx,4), %rdx
incq %rcx
movq %rcx, 0x8(%rbp)
leaq (%rbx,%r13), %rsi
cmpq %r12, %rsi
cmovaeq %r12, %rsi
movq %r13, (%rax,%rdx,8)
movapd %xmm1, 0x20(%rsp)
xorpd %xmm0, %xmm0
cmpq %rsi, %r13
jae 0x151f7a
movl (%r14,%r13,8), %edi
andl $0x1, %edi
incq 0x20(%rsp,%rdi,8)
incq %r13
cmpq %r13, %rsi
jne 0x151f5b
movapd 0x20(%rsp), %xmm0
movq %rsi, %r13
jmp 0x151f7d
movq %r13, %rsi
leaq (%rax,%rdx,8), %rdx
movq %rsi, 0x8(%rdx)
movupd %xmm0, 0x18(%rdx)
cmpq %r12, %rsi
jb 0x151f01
testq %rcx, %rcx
je 0x152160
movq $-0x1, %rdx
xorl %eax, %eax
xorpd %xmm0, %xmm0
xorl %edi, %edi
movq (%rbp), %rsi
leaq (%rdi,%rdi,4), %r8
leaq (%rsi,%r8,8), %r9
cmpq $0x0, 0x18(%r9)
je 0x152036
leaq (,%rdi,8), %r8
leaq (%r8,%r8,4), %r10
leaq (,%rax,8), %r8
leaq (%r8,%r8,4), %r8
cmpq $0x0, 0x20(%r9)
je 0x152036
movq 0x20(%r9), %rcx
movq %rcx, 0x20(%rsi,%r8)
movupd (%r9), %xmm1
movupd 0x10(%r9), %xmm2
movupd %xmm2, 0x10(%rsi,%r8)
movupd %xmm1, (%rsi,%r8)
incq %rax
incq %rdi
movq 0x8(%rbp), %rcx
cmpq %rcx, %rdi
jae 0x152183
movq (%rbp), %rsi
leaq (%rdi,%rdi,4), %r9
leaq (%rsi,%r9,8), %r9
leaq 0x28(%r10), %r11
addq $0x28, %r8
cmpq $0x0, 0x40(%rsi,%r10)
movq %r11, %r10
jne 0x151fd6
addq %rsi, %r11
movq %r11, %r9
cmpq $-0x1, %rdx
jne 0x152046
movq (%r9), %rdx
movq (%r14,%rdx,8), %rdx
shrq %rdx
movapd %xmm0, 0x20(%rsp)
cmpq %rcx, %rdi
jae 0x152095
movq %rbp, %r12
leaq (%rdi,%rdi,4), %r8
leaq (%rsi,%r8,8), %rbx
addq $0x20, %rbx
movq %rdi, %r8
xorl %r11d, %r11d
xorl %r10d, %r10d
addq -0x8(%rbx), %r11
setne %bpl
addq (%rbx), %r10
setne %r15b
testb %r15b, %bpl
jne 0x15211d
incq %r8
addq $0x28, %rbx
cmpq %rcx, %r8
jb 0x152069
movq %rcx, %r8
movq %r12, %rbp
jmp 0x15209e
xorl %r10d, %r10d
xorl %r11d, %r11d
movq %rdi, %r8
testq %r11, %r11
setne %r9b
testq %r10, %r10
setne %bl
testb %bl, %r9b
je 0x1520c5
movq %r11, 0x20(%rsp)
movq %r10, 0x28(%rsp)
cmpq $-0x1, %rdi
jne 0x1520ff
jmp 0x152160
leaq (%rdi,%rdi,4), %r9
incq %rdi
leaq (%rsi,%r9,8), %r9
addq $-0x8, %r9
decq %rdi
je 0x152160
addq (%r9), %r10
leaq -0x28(%r9), %rbx
addq -0x8(%r9), %r11
movq %rbx, %r9
je 0x1520d4
movq %rbx, %r9
testq %r10, %r10
je 0x1520d4
movq %r11, 0x20(%rsp)
movq %r10, 0x28(%rsp)
leaq (%rax,%rax,4), %rdi
movq %r11, 0x18(%rsi,%rdi,8)
movq %r10, 0x20(%rsi,%rdi,8)
leaq (%r8,%r8,4), %r9
movq -0x20(%rsi,%r9,8), %r9
movq %r9, 0x8(%rsi,%rdi,8)
jmp 0x15214e
movq %r11, 0x20(%rsp)
movq %r10, 0x28(%rsp)
leaq (%rax,%rax,4), %rdi
movq %r11, 0x18(%rsi,%rdi,8)
movq %r10, 0x20(%rsi,%rdi,8)
movq (%r9), %r9
movq %r9, (%rsi,%rdi,8)
movq -0x18(%rbx), %r9
movq %r9, 0x8(%rsi,%rdi,8)
incq %rax
incq %r8
movq %r12, %rbp
movq %r8, %rdi
cmpq %rcx, %r8
movq (%rsp), %rsi
jb 0x151fab
jmp 0x152187
movq $0x0, 0x8(%rbp)
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x2220
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rsi
movq %rax, 0x8(%rbp)
testq %rax, %rax
je 0x152168
movq (%rbp), %rcx
leaq 0x8(%rcx), %r10
movq %rax, %rdi
movq -0x8(%r10), %r8
movq (%r10), %r9
movq (%r14,%r8,8), %r8
shrq %r8
movq %r8, -0x8(%r10)
movq -0x8(%r14,%r9,8), %r8
shrq %r8
movq %r8, (%r10)
addq $0x28, %r10
decq %rdi
jne 0x15219b
decq %rax
je 0x1521ea
addq $0x28, %rcx
movq -0x20(%rcx), %r8
movq (%rcx), %rdi
subq %r8, %rdi
shrq %rdi
addq %r8, %rdi
movq %rdi, -0x20(%rcx)
movq %rdi, (%rcx)
addq $0x28, %rcx
decq %rax
jne 0x1521ca
movq %rbp, %rdi
callq 0x14a60b
movq (%rsp), %rdx
movq (%rbp), %rax
movq 0x8(%rbp), %rcx
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %rax
movq -0x20(%rax), %rcx
movq %rcx, 0x18(%rbp)
fldt 0x80(%rdx)
fldz
fucomi %st(1), %st
jbe 0x152232
fstp %st(1)
fld %st(0)
fstpt 0x80(%rdx)
fld %st(0)
movq 0x10(%rsp), %r9
movq 0x8(%rsp), %r10
jmp 0x15224c
fxch %st(1)
fucomi %st(1), %st
movq 0x10(%rsp), %r9
movq 0x8(%rsp), %r10
jne 0x1524a4
jp 0x1524a4
movq -0x8(%rax), %rsi
movq %rsi, %xmm0
movq 0xdf023(%rip), %xmm1    # 0x231280
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xdf027(%rip), %xmm2    # 0x231290
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addq -0x10(%rax), %rsi
addsd %xmm0, %xmm3
movq %rsi, %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
divsd %xmm1, %xmm3
movsd %xmm3, 0x70(%rsp)
fldl 0x70(%rsp)
fldt 0x90(%rdx)
fxch %st(1)
fucomi %st(1), %st
fxch %st(1)
fcmovnb %st(1), %st
fstp %st(1)
fld %st(0)
fstpt 0x90(%rdx)
fxch %st(2)
fucompi %st(2), %st
jbe 0x15236c
movq %rcx, 0x68(%rsp)
xorl %esi, %esi
testq %rcx, %rcx
sets %sil
fildll 0x68(%rsp)
leaq 0xe8f59(%rip), %rcx     # 0x23b238
fadds (%rcx,%rsi,4)
fldt 0xa0(%rdx)
fdivrp %st, %st(1)
fmulp %st, %st(1)
faddp %st, %st(1)
fstpl 0x60(%rsp)
xorpd %xmm0, %xmm0
ucomisd 0x60(%rsp), %xmm0
fldz
fldz
fxch %st(1)
jbe 0x15236c
fstp %st(0)
fstp %st(0)
movq -0x8(%rax), %rcx
movq %rcx, %xmm0
movq 0xdef67(%rip), %xmm1    # 0x231280
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xdef6b(%rip), %xmm2    # 0x231290
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
addq -0x10(%rax), %rcx
movq %rcx, %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
divsd %xmm1, %xmm3
movsd %xmm3, 0x58(%rsp)
fldl 0x58(%rsp)
fstpt 0x90(%rdx)
fldz
fldz
fxch %st(1)
fstp %st(0)
fstp %st(0)
movq (%r10), %r15
testq %r15, %r15
je 0x152481
xorl %r13d, %r13d
xorl %ebp, %ebp
xorl %ebx, %ebx
movq 0x10(%r10), %rdi
movq (%rdi,%r13), %rax
addq %rax, %rax
xorl %ecx, %ecx
subb 0x18(%rdx), %cl
shrq %cl, %rax
movq 0x8(%rdi,%r13), %r11
addq %r11, %r11
shrq %cl, %r11
movq (%r9), %rsi
movq 0x80(%r9), %rcx
movl (%rsi,%rax,4), %r8d
incq %rcx
cmpq %r8, %rcx
jb 0x152440
movl (%rsi,%r11,4), %esi
cmpq %rsi, %rcx
jb 0x152440
cmpq $-0x1, 0x10(%rdi,%r13)
je 0x152440
cmpq %r11, %rax
je 0x152440
addq %r13, %rdi
movq 0x40(%rsp), %rsi
xorl %ecx, %ecx
callq 0x14a518
cmpq $-0x1, %rax
je 0x152432
movq %rax, %r12
cmpq 0x18(%rsp), %rbx
jne 0x152418
leaq (%rbx,%rbx), %rax
testq %rbx, %rbx
movl $0x2, %ecx
cmoveq %rcx, %rax
movq %rax, 0x18(%rsp)
leaq (,%rax,8), %rsi
movq %r14, %rdi
callq 0x2370
movq %rax, %r14
movq 0x10(%rsp), %r9
movq 0x8(%rsp), %r10
movq (%rsp), %rdx
movq %r12, (%r14,%rbx,8)
incq %rbx
movq (%r10), %r15
jmp 0x152440
movq 0x10(%rsp), %r9
movq 0x8(%rsp), %r10
movq (%rsp), %rdx
incq %rbp
addq $0x20, %r13
cmpq %r15, %rbp
jb 0x152383
leaq (%r14,%rbx,8), %rsi
movq %r14, %rdi
callq 0x1379f9
testq %rbx, %rbx
je 0x15248c
movl %ebx, %ecx
shrq %rbx
movq (%r14,%rbx,8), %rax
testb $0x1, %cl
movq 0xb8(%rsp), %rcx
jne 0x152496
addq -0x8(%r14,%rbx,8), %rax
shrq %rax
jmp 0x152496
movq %r14, %rdi
movq %r14, %rsi
callq 0x1379f9
xorl %eax, %eax
movq 0xb8(%rsp), %rcx
movq %rax, 0x20(%rcx)
movl $0x1, %ebx
jmp 0x15216a
fldt 0x90(%rdx)
jmp 0x1522bc