// File: /workspace/github_cpp_makefile_star2_O1/j-faria[P]kima/src/RVmodel.cpp
// Function: RVmodel::perturb(DNest4::RNG&)
double RVmodel::perturb(RNG& rng)
{
    #if TIMING
    auto begin = std::chrono::high_resolution_clock::now();  // start timing
    #endif

    auto data = Data::get_instance();
    const vector<double>& t = data.get_t();
    const vector<int>& obsi = data.get_obsi();
    auto actind = data.get_actind();
    double logH = 0.;
    double tmid = data.get_t_middle();

    if(GP)
    {
        if(rng.rand() <= 0.5) // perturb planet parameters
        {
            logH += planets.perturb(rng);
            planets.consolidate_diff();
            calculate_mu();
        }
        else if(rng.rand() <= 0.5) // perturb GP parameters
        {
            switch (kernel)
            {
                case standard:
                {
                    if(rng.rand() <= 0.25)
                    {
                        log_eta1 = log(eta1);
                        log_eta1_prior->perturb(log_eta1, rng);
                        eta1 = exp(log_eta1);
                    }
                    else if(rng.rand() <= 0.33330)
                    {
                        // log_eta2 = log(eta2);
                        // log_eta2_prior->perturb(log_eta2, rng);
                        // eta2 = exp(log_eta2);
                        eta2_prior->perturb(eta2, rng);
                    }
                    else if(rng.rand() <= 0.5)
                    {
                        eta3_prior->perturb(eta3, rng);
                    }
                    else
                    {
                        log_eta4 = log(eta4);
                        log_eta4_prior->perturb(log_eta4, rng);
                        eta4 = exp(log_eta4);
                    }

                    break;
                }

                case celerite:
                {
                    if(rng.rand() <= 0.33330)
                    {
                        log_eta1 = log(eta1);
                        log_eta1_prior->perturb(log_eta1, rng);
                        eta1 = exp(log_eta1);
                    }
                    else if(rng.rand() <= 0.5)
                    {
                        // log_eta2 = log(eta2);
                        // log_eta2_prior->perturb(log_eta2, rng);
                        // eta2 = exp(log_eta2);
                        eta2_prior->perturb(eta2, rng);
                    }
                    else
                    {
                        eta3_prior->perturb(eta3, rng);
                    }
                    break;
                }
                default:
                    break;
            }

            calculate_C();
        }
        else if(rng.rand() <= 0.5) // perturb jitter(s) + known_object
        {
            if(multi_instrument)
            {
                for(int i=0; i<jitters.size(); i++)
                    Jprior->perturb(jitters[i], rng);
            }
            else
            {
                Jprior->perturb(extra_sigma, rng);
            }

            calculate_C(); // recalculate covariance matrix

            if (known_object)
            {
                remove_known_object();

                for (int i=0; i<n_known_object; i++){
                    KO_Pprior[i]->perturb(KO_P[i], rng);
                    KO_Kprior[i]->perturb(KO_K[i], rng);
                    KO_eprior[i]->perturb(KO_e[i], rng);
                    KO_phiprior[i]->perturb(KO_phi[i], rng);
                    KO_wprior[i]->perturb(KO_w[i], rng);
                }

                add_known_object();
            }

        }
        else // perturb other parameters: vsys, slope, offsets
        {
            for(size_t i=0; i<mu.size(); i++)
            {
                mu[i] -= background;
                if(trend) {
                    mu[i] -= slope*(t[i]-data.get_t_middle());
                }
                if(multi_instrument) {
                    for(size_t j=0; j<offsets.size(); j++){
                        if (obsi[i] == j+1) { mu[i] -= offsets[j]; }
                    }
                }

                if(data.indicator_correlations) {
                    for(size_t j = 0; j < data.number_indicators; j++){
                        mu[i] -= betas[j] * actind[j][i];
                    }
                }

            }

            Cprior->perturb(background, rng);

            // propose new instrument offsets
            if (multi_instrument){
                for(unsigned j=0; j<offsets.size(); j++)
                    offsets_prior->perturb(offsets[j], rng);
            }

            // propose new slope
            if(trend) {
                slope_prior->perturb(slope, rng);
            }

            // propose new indicator correlations
            if(data.indicator_correlations){
                for(size_t j = 0; j < data.number_indicators; j++){
                    betaprior->perturb(betas[j], rng);
                }
            }

            for(size_t i=0; i<mu.size(); i++)
            {
                mu[i] += background;
                if(trend) {
                    mu[i] += slope*(t[i]-data.get_t_middle());
                }
                if(multi_instrument) {
                    for(size_t j=0; j<offsets.size(); j++){
                        if (obsi[i] == j+1) { mu[i] += offsets[j]; }
                    }
                }

                if(data.indicator_correlations) {
                    for(size_t j = 0; j < data.number_indicators; j++){
                        mu[i] += betas[j]*actind[j][i];
                    }
                }
                
            }
        }

    }

    else if(MA)
    {
        if(rng.rand() <= 0.5) // perturb planet parameters
        {
            logH += planets.perturb(rng);
            planets.consolidate_diff();
            calculate_mu();
        }
        else if(rng.rand() <= 0.5) // perturb MA parameters
        {
            if(rng.rand() <= 0.5)
                sigmaMA_prior->perturb(sigmaMA, rng);
            else
                tauMA_prior->perturb(tauMA, rng);
            
            calculate_mu();
        }
        else if(rng.rand() <= 0.5) // perturb jitter(s)
        {
            if(multi_instrument)
            {
                for(int i=0; i<jitters.size(); i++)
                    Jprior->perturb(jitters[i], rng);
            }
            else
            {
                Jprior->perturb(extra_sigma, rng);
            }
            calculate_C();
        }
        else // perturb other parameters: vsys, slope, offsets
        {
            for(size_t i=0; i<mu.size(); i++)
            {
                mu[i] -= background;
                if(trend) {
                    mu[i] -= slope*(t[i]-data.get_t_middle());
                }
                if(multi_instrument) {
                    for(size_t j=0; j<offsets.size(); j++){
                        if (obsi[i] == j+1) { mu[i] -= offsets[j]; }
                    }
                }

                if(data.indicator_correlations) {
                    for(size_t j = 0; j < data.number_indicators; j++){
                        mu[i] -= betas[j] * actind[j][i];
                    }
                }

            }

            Cprior->perturb(background, rng);

            // propose new instrument offsets
            if (multi_instrument){
                for(unsigned j=0; j<offsets.size(); j++)
                    offsets_prior->perturb(offsets[j], rng);
            }

            // propose new slope
            if(trend) {
                slope_prior->perturb(slope, rng);
            }

            if(data.indicator_correlations){
                for(size_t j = 0; j < data.number_indicators; j++){
                    betaprior->perturb(betas[j], rng);
                }
            }

            for(size_t i=0; i<mu.size(); i++)
            {
                mu[i] += background;
                if(trend) {
                    mu[i] += slope*(t[i]-data.get_t_middle());
                }
                if(multi_instrument) {
                    for(size_t j=0; j<offsets.size(); j++){
                        if (obsi[i] == j+1) { mu[i] += offsets[j]; }
                    }
                }

                if(data.indicator_correlations) {
                    for(size_t j = 0; j < data.number_indicators; j++){
                        mu[i] += betas[j]*actind[j][i];
                    }
                }
                
            }
        }

    }

    else
    {
        if(rng.rand() <= 0.75) // perturb planet parameters
        {
            logH += planets.perturb(rng);
            planets.consolidate_diff();
            calculate_mu();
        }
        else if(rng.rand() <= 0.5) // perturb jitter(s) + known_object
        {
            if(multi_instrument)
            {
                for(int i=0; i<jitters.size(); i++)
                    Jprior->perturb(jitters[i], rng);
            }
            else
            {
                Jprior->perturb(extra_sigma, rng);
            }

            if (studentt)
                nu_prior->perturb(nu, rng);


            if (known_object)
            {
                remove_known_object();

                for (int i=0; i<n_known_object; i++){
                    KO_Pprior[i]->perturb(KO_P[i], rng);
                    KO_Kprior[i]->perturb(KO_K[i], rng);
                    KO_eprior[i]->perturb(KO_e[i], rng);
                    KO_phiprior[i]->perturb(KO_phi[i], rng);
                    KO_wprior[i]->perturb(KO_w[i], rng);
                }

                add_known_object();
            }
        
        }
        else
        {
            for(size_t i=0; i<mu.size(); i++)
            {
                mu[i] -= background;
                if(trend) {
                    mu[i] -= slope*(t[i]-tmid) + quadr*pow(t[i]-tmid, 2) + cubic*pow(t[i]-tmid, 3);
                }
                if(multi_instrument) {
                    for(size_t j=0; j<offsets.size(); j++){
                        if (obsi[i] == j+1) { mu[i] -= offsets[j]; }
                    }
                }

                if(data.indicator_correlations) {
                    for(size_t j = 0; j < data.number_indicators; j++){
                        mu[i] -= betas[j] * actind[j][i];
                    }
                }
            }

            // propose new vsys
            Cprior->perturb(background, rng);

            // propose new instrument offsets
            if (multi_instrument){
                for(unsigned j=0; j<offsets.size(); j++){
                    offsets_prior->perturb(offsets[j], rng);
                }
            }

            // propose new slope
            if(trend) {
                if (degree >= 1) slope_prior->perturb(slope, rng);
                if (degree >= 2) quadr_prior->perturb(quadr, rng);
                if (degree == 3) cubic_prior->perturb(cubic, rng);
            }

            // propose new indicator correlations
            if(data.indicator_correlations){
                for(size_t j = 0; j < data.number_indicators; j++){
                    betaprior->perturb(betas[j], rng);
                }
            }

            for(size_t i=0; i<mu.size(); i++)
            {
                mu[i] += background;
                if(trend) {
                    mu[i] += slope*(t[i]-tmid) + quadr*pow(t[i]-tmid, 2) + cubic*pow(t[i]-tmid, 3);
                }
                if(multi_instrument) {
                    for(size_t j=0; j<offsets.size(); j++){
                        if (obsi[i] == j+1) { mu[i] += offsets[j]; }
                    }
                }

                if(data.indicator_correlations) {
                    for(size_t j = 0; j < data.number_indicators; j++){
                        mu[i] += betas[j]*actind[j][i];
                    }
                }
            }
        }
    }


    #if TIMING
    auto end = std::chrono::high_resolution_clock::now();
    cout << "Perturb took ";
    cout << std::chrono::duration_cast<std::chrono::nanoseconds>(end-begin).count()*1E-6;
    cout << " ms" << std::endl;
    #endif

    return logH;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x43240(%rip), %rsi     # 0x53400
leaq 0xa0(%rsp), %rdi
callq 0x1560c
leaq 0x100(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x15c4c
leaq 0xa0(%rsp), %rdi
callq 0x15ce6
movsd %xmm0, 0x8(%rsp)
leaq 0x35187(%rip), %rax     # 0x45380
cmpb $0x1, (%rax)
jne 0x1060c
movq %r14, %rdi
callq 0x3c02c
movsd 0x2ef86(%rip), %xmm1    # 0x3f198
ucomisd %xmm0, %xmm1
jae 0x10eb4
movq %r14, %rdi
callq 0x3c02c
movsd 0x2ef6c(%rip), %xmm1    # 0x3f198
ucomisd %xmm0, %xmm1
jae 0x10f4a
movq %r14, %rdi
callq 0x3c02c
movsd 0x2ef52(%rip), %xmm1    # 0x3f198
ucomisd %xmm0, %xmm1
jae 0x11098
movq 0x380(%rbx), %rax
cmpq %rax, 0x388(%rbx)
je 0x103be
leaq 0x35118(%rip), %rcx     # 0x45383
movb (%rcx), %bpl
leaq 0x35113(%rip), %rcx     # 0x45388
movb (%rcx), %r12b
xorl %r13d, %r13d
movq %r13, %r15
shlq $0x4, %r15
fldt (%rax,%r15)
fsubl 0x120(%rbx)
fstpt (%rax,%r15)
testb %bpl, %bpl
je 0x102ef
movsd 0x170(%rbx), %xmm0
movsd %xmm0, (%rsp)
movq 0xa0(%rsp), %rax
movsd (%rax,%r13,8), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x15ce6
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd (%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsp)
movq 0x380(%rbx), %rax
fldt (%rax,%r15)
fsubl 0x58(%rsp)
fstpt (%rax,%r15)
testb $0x1, %r12b
je 0x10343
movq 0x128(%rbx), %rax
movq 0x130(%rbx), %rcx
subq %rax, %rcx
je 0x10343
sarq $0x3, %rcx
movq 0xe8(%rsp), %rdx
movslq (%rdx,%r13,4), %rdx
movq 0x380(%rbx), %rsi
addq %r15, %rsi
cmpq $0x1, %rcx
adcq $0x0, %rcx
decq %rdx
xorl %edi, %edi
cmpq %rdi, %rdx
jne 0x1033b
fldt (%rsi)
fsubl (%rax,%rdi,8)
fstpt (%rsi)
incq %rdi
cmpq %rdi, %rcx
jne 0x1032f
cmpb $0x1, 0x118(%rsp)
jne 0x1039d
movslq 0x11c(%rsp), %rax
testq %rax, %rax
je 0x1039d
movq 0x158(%rbx), %rcx
movq 0x20(%rsp), %rdx
movq 0x380(%rbx), %rdi
leaq (%rdi,%r15), %rsi
fldt (%rdi,%r15)
xorl %edi, %edi
movsd (%rcx,%rdi,8), %xmm0
movq (%rdx), %r8
mulsd (%r8,%r13,8), %xmm0
movsd %xmm0, 0x50(%rsp)
fsubl 0x50(%rsp)
incq %rdi
addq $0x18, %rdx
cmpq %rdi, %rax
jne 0x10377
fstpt (%rsi)
incq %r13
movq 0x380(%rbx), %rax
movq 0x388(%rbx), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
cmpq %rcx, %r13
jb 0x1027b
movq 0x3b8(%rbx), %rdi
leaq 0x120(%rbx), %rsi
movq %rsi, 0x18(%rsp)
movq %r14, %rdx
callq 0x3d1f6
leaq 0x34fa8(%rip), %rax     # 0x45388
movb (%rax), %bpl
cmpb $0x1, %bpl
jne 0x10434
movq 0x128(%rbx), %rax
cmpq %rax, 0x130(%rbx)
je 0x10434
movl $0x1, %r12d
xorl %ecx, %ecx
movq 0x408(%rbx), %rdi
leaq (%rax,%rcx,8), %rsi
movq %r14, %rdx
callq 0x3d1f6
movl %r12d, %ecx
movq 0x128(%rbx), %rax
movq 0x130(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %r12d
cmpq %rcx, %rdx
ja 0x10401
leaq 0x34f48(%rip), %rax     # 0x45383
movb (%rax), %r12b
cmpb $0x1, %r12b
jne 0x1045a
movq 0x3d8(%rbx), %rdi
leaq 0x170(%rbx), %rsi
movq %r14, %rdx
callq 0x3d1f6
cmpb $0x1, 0x118(%rsp)
jne 0x104a1
cmpl $0x0, 0x11c(%rsp)
je 0x104a1
xorl %r13d, %r13d
xorl %r15d, %r15d
movq 0x418(%rbx), %rdi
movq 0x158(%rbx), %rsi
addq %r13, %rsi
movq %r14, %rdx
callq 0x3d1f6
incq %r15
movslq 0x11c(%rsp), %rax
addq $0x8, %r13
cmpq %rax, %r15
jb 0x10474
movq 0x380(%rbx), %rax
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
cmpq %rax, 0x388(%rbx)
je 0x11480
xorl %r13d, %r13d
movq 0x18(%rsp), %r15
movq %r13, %r14
shlq $0x4, %r14
fldt (%rax,%r14)
faddl (%r15)
fstpt (%rax,%r14)
testb %r12b, %r12b
je 0x10539
movsd 0x170(%rbx), %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0xa0(%rsp), %rax
movsd (%rax,%r13,8), %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x15ce6
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rsp)
movq 0x380(%rbx), %rax
fldt (%rax,%r14)
faddl 0x48(%rsp)
fstpt (%rax,%r14)
testb %bpl, %bpl
je 0x1058c
movq 0x128(%rbx), %rax
movq 0x130(%rbx), %rcx
subq %rax, %rcx
je 0x1058c
sarq $0x3, %rcx
movq 0xe8(%rsp), %rdx
movslq (%rdx,%r13,4), %rdx
cmpq $0x1, %rcx
adcq $0x0, %rcx
movq 0x380(%rbx), %rsi
addq %r14, %rsi
decq %rdx
xorl %edi, %edi
cmpq %rdi, %rdx
jne 0x10584
fldt (%rsi)
faddl (%rax,%rdi,8)
fstpt (%rsi)
incq %rdi
cmpq %rdi, %rcx
jne 0x10578
cmpb $0x1, 0x118(%rsp)
jne 0x105e6
movslq 0x11c(%rsp), %rax
testq %rax, %rax
je 0x105e6
movq 0x158(%rbx), %rcx
movq 0x20(%rsp), %rdx
movq 0x380(%rbx), %rdi
leaq (%rdi,%r14), %rsi
fldt (%rdi,%r14)
xorl %edi, %edi
movsd (%rcx,%rdi,8), %xmm0
movq (%rdx), %r8
mulsd (%r8,%r13,8), %xmm0
movsd %xmm0, 0x40(%rsp)
faddl 0x40(%rsp)
incq %rdi
addq $0x18, %rdx
cmpq %rdi, %rax
jne 0x105c0
fstpt (%rsi)
incq %r13
movq 0x380(%rbx), %rax
movq 0x388(%rbx), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
cmpq %rcx, %r13
jb 0x104c6
jmp 0x11480
leaq 0x34d6e(%rip), %rax     # 0x45381
cmpb $0x1, (%rax)
jne 0x10a26
movq %r14, %rdi
callq 0x3c02c
movsd 0x2eb6c(%rip), %xmm1    # 0x3f198
ucomisd %xmm0, %xmm1
jae 0x10edf
movq %r14, %rdi
callq 0x3c02c
movsd 0x2eb52(%rip), %xmm1    # 0x3f198
ucomisd %xmm0, %xmm1
jae 0x10fe9
movq %r14, %rdi
callq 0x3c02c
movsd 0x2eb38(%rip), %xmm1    # 0x3f198
ucomisd %xmm0, %xmm1
jae 0x11259
movq 0x380(%rbx), %rax
cmpq %rax, 0x388(%rbx)
je 0x107d8
leaq 0x34cfe(%rip), %rcx     # 0x45383
movb (%rcx), %bpl
leaq 0x34cf9(%rip), %rcx     # 0x45388
movb (%rcx), %r12b
xorl %r13d, %r13d
movq %r13, %r15
shlq $0x4, %r15
fldt (%rax,%r15)
fsubl 0x120(%rbx)
fstpt (%rax,%r15)
testb %bpl, %bpl
je 0x10709
movsd 0x170(%rbx), %xmm0
movsd %xmm0, (%rsp)
movq 0xa0(%rsp), %rax
movsd (%rax,%r13,8), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x15ce6
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd (%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x78(%rsp)
movq 0x380(%rbx), %rax
fldt (%rax,%r15)
fsubl 0x78(%rsp)
fstpt (%rax,%r15)
testb $0x1, %r12b
je 0x1075d
movq 0x128(%rbx), %rax
movq 0x130(%rbx), %rcx
subq %rax, %rcx
je 0x1075d
sarq $0x3, %rcx
movq 0xe8(%rsp), %rdx
movslq (%rdx,%r13,4), %rdx
movq 0x380(%rbx), %rsi
addq %r15, %rsi
cmpq $0x1, %rcx
adcq $0x0, %rcx
decq %rdx
xorl %edi, %edi
cmpq %rdi, %rdx
jne 0x10755
fldt (%rsi)
fsubl (%rax,%rdi,8)
fstpt (%rsi)
incq %rdi
cmpq %rdi, %rcx
jne 0x10749
cmpb $0x1, 0x118(%rsp)
jne 0x107b7
movslq 0x11c(%rsp), %rax
testq %rax, %rax
je 0x107b7
movq 0x158(%rbx), %rcx
movq 0x20(%rsp), %rdx
movq 0x380(%rbx), %rdi
leaq (%rdi,%r15), %rsi
fldt (%rdi,%r15)
xorl %edi, %edi
movsd (%rcx,%rdi,8), %xmm0
movq (%rdx), %r8
mulsd (%r8,%r13,8), %xmm0
movsd %xmm0, 0x70(%rsp)
fsubl 0x70(%rsp)
incq %rdi
addq $0x18, %rdx
cmpq %rdi, %rax
jne 0x10791
fstpt (%rsi)
incq %r13
movq 0x380(%rbx), %rax
movq 0x388(%rbx), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
cmpq %rcx, %r13
jb 0x10695
movq 0x3b8(%rbx), %rdi
leaq 0x120(%rbx), %rsi
movq %rsi, 0x18(%rsp)
movq %r14, %rdx
callq 0x3d1f6
leaq 0x34b8e(%rip), %rax     # 0x45388
movb (%rax), %bpl
cmpb $0x1, %bpl
jne 0x1084e
movq 0x128(%rbx), %rax
cmpq %rax, 0x130(%rbx)
je 0x1084e
movl $0x1, %r12d
xorl %ecx, %ecx
movq 0x408(%rbx), %rdi
leaq (%rax,%rcx,8), %rsi
movq %r14, %rdx
callq 0x3d1f6
movl %r12d, %ecx
movq 0x128(%rbx), %rax
movq 0x130(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %r12d
cmpq %rcx, %rdx
ja 0x1081b
leaq 0x34b2e(%rip), %rax     # 0x45383
movb (%rax), %r12b
cmpb $0x1, %r12b
jne 0x10874
movq 0x3d8(%rbx), %rdi
leaq 0x170(%rbx), %rsi
movq %r14, %rdx
callq 0x3d1f6
cmpb $0x1, 0x118(%rsp)
jne 0x108bb
cmpl $0x0, 0x11c(%rsp)
je 0x108bb
xorl %r13d, %r13d
xorl %r15d, %r15d
movq 0x418(%rbx), %rdi
movq 0x158(%rbx), %rsi
addq %r13, %rsi
movq %r14, %rdx
callq 0x3d1f6
incq %r15
movslq 0x11c(%rsp), %rax
addq $0x8, %r13
cmpq %rax, %r15
jb 0x1088e
movq 0x380(%rbx), %rax
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
cmpq %rax, 0x388(%rbx)
je 0x11480
xorl %r13d, %r13d
movq 0x18(%rsp), %r15
movq %r13, %r14
shlq $0x4, %r14
fldt (%rax,%r14)
faddl (%r15)
fstpt (%rax,%r14)
testb %r12b, %r12b
je 0x10953
movsd 0x170(%rbx), %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0xa0(%rsp), %rax
movsd (%rax,%r13,8), %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x15ce6
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
movq 0x380(%rbx), %rax
fldt (%rax,%r14)
faddl 0x68(%rsp)
fstpt (%rax,%r14)
testb %bpl, %bpl
je 0x109a6
movq 0x128(%rbx), %rax
movq 0x130(%rbx), %rcx
subq %rax, %rcx
je 0x109a6
sarq $0x3, %rcx
movq 0xe8(%rsp), %rdx
movslq (%rdx,%r13,4), %rdx
cmpq $0x1, %rcx
adcq $0x0, %rcx
movq 0x380(%rbx), %rsi
addq %r14, %rsi
decq %rdx
xorl %edi, %edi
cmpq %rdi, %rdx
jne 0x1099e
fldt (%rsi)
faddl (%rax,%rdi,8)
fstpt (%rsi)
incq %rdi
cmpq %rdi, %rcx
jne 0x10992
cmpb $0x1, 0x118(%rsp)
jne 0x10a00
movslq 0x11c(%rsp), %rax
testq %rax, %rax
je 0x10a00
movq 0x158(%rbx), %rcx
movq 0x20(%rsp), %rdx
movq 0x380(%rbx), %rdi
leaq (%rdi,%r14), %rsi
fldt (%rdi,%r14)
xorl %edi, %edi
movsd (%rcx,%rdi,8), %xmm0
movq (%rdx), %r8
mulsd (%r8,%r13,8), %xmm0
movsd %xmm0, 0x60(%rsp)
faddl 0x60(%rsp)
incq %rdi
addq $0x18, %rdx
cmpq %rdi, %rax
jne 0x109da
fstpt (%rsi)
incq %r13
movq 0x380(%rbx), %rax
movq 0x388(%rbx), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
cmpq %rcx, %r13
jb 0x108e0
jmp 0x11480
movq %r14, %rdi
callq 0x3c02c
movsd 0x2ec92(%rip), %xmm1    # 0x3f6c8
ucomisd %xmm0, %xmm1
jae 0x10f0a
movq %r14, %rdi
callq 0x3c02c
movsd 0x2e748(%rip), %xmm1    # 0x3f198
ucomisd %xmm0, %xmm1
jae 0x11036
movq 0x380(%rbx), %rax
cmpq %rax, 0x388(%rbx)
je 0x10bf1
leaq 0x3490e(%rip), %rcx     # 0x45383
movb (%rcx), %bpl
leaq 0x34909(%rip), %rcx     # 0x45388
movb (%rcx), %r15b
xorl %r12d, %r12d
movq %r12, %r13
shlq $0x4, %r13
fldt (%rax,%r13)
fsubl 0x120(%rbx)
fstpt (%rax,%r13)
testb %bpl, %bpl
je 0x10b1d
movq 0xa0(%rsp), %rax
movsd (%rax,%r12,8), %xmm0
subsd 0x8(%rsp), %xmm0
movapd %xmm0, %xmm1
mulsd %xmm0, %xmm1
mulsd 0x178(%rbx), %xmm1
movsd 0x170(%rbx), %xmm2
mulsd %xmm0, %xmm2
addsd %xmm1, %xmm2
movsd %xmm2, (%rsp)
movsd 0x180(%rbx), %xmm1
movsd %xmm1, 0x10(%rsp)
movsd 0x2ebaa(%rip), %xmm1    # 0x3f698
callq 0x66f0
mulsd 0x10(%rsp), %xmm0
addsd (%rsp), %xmm0
movsd %xmm0, 0x98(%rsp)
movq 0x380(%rbx), %rax
fldt (%rax,%r13)
fsubl 0x98(%rsp)
fstpt (%rax,%r13)
testb %r15b, %r15b
je 0x10b70
movq 0x128(%rbx), %rax
movq 0x130(%rbx), %rcx
subq %rax, %rcx
je 0x10b70
sarq $0x3, %rcx
movq 0xe8(%rsp), %rdx
movslq (%rdx,%r12,4), %rdx
movq 0x380(%rbx), %rsi
addq %r13, %rsi
cmpq $0x1, %rcx
adcq $0x0, %rcx
decq %rdx
xorl %edi, %edi
cmpq %rdi, %rdx
jne 0x10b68
fldt (%rsi)
fsubl (%rax,%rdi,8)
fstpt (%rsi)
incq %rdi
cmpq %rdi, %rcx
jne 0x10b5c
cmpb $0x1, 0x118(%rsp)
jne 0x10bd0
movslq 0x11c(%rsp), %rax
testq %rax, %rax
je 0x10bd0
movq 0x158(%rbx), %rcx
movq 0x20(%rsp), %rdx
movq 0x380(%rbx), %rdi
leaq (%rdi,%r13), %rsi
fldt (%rdi,%r13)
xorl %edi, %edi
movsd (%rcx,%rdi,8), %xmm0
movq (%rdx), %r8
mulsd (%r8,%r12,8), %xmm0
movsd %xmm0, 0x90(%rsp)
fsubl 0x90(%rsp)
incq %rdi
addq $0x18, %rdx
cmpq %rdi, %rax
jne 0x10ba4
fstpt (%rsi)
incq %r12
movq 0x380(%rbx), %rax
movq 0x388(%rbx), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
cmpq %rcx, %r12
jb 0x10a85
movq 0x3b8(%rbx), %rdi
leaq 0x120(%rbx), %rsi
movq %rsi, 0x38(%rsp)
movq %r14, %rdx
callq 0x3d1f6
leaq 0x34775(%rip), %rax     # 0x45388
movb (%rax), %bpl
cmpb $0x1, %bpl
jne 0x10c67
movq 0x128(%rbx), %rax
cmpq %rax, 0x130(%rbx)
je 0x10c67
movl $0x1, %r12d
xorl %ecx, %ecx
movq 0x408(%rbx), %rdi
leaq (%rax,%rcx,8), %rsi
movq %r14, %rdx
callq 0x3d1f6
movl %r12d, %ecx
movq 0x128(%rbx), %rax
movq 0x130(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %r12d
cmpq %rcx, %rdx
ja 0x10c34
leaq 0x34715(%rip), %rax     # 0x45383
movb (%rax), %r12b
cmpb $0x1, %r12b
jne 0x10cd4
leaq 0x34706(%rip), %rax     # 0x45384
movl (%rax), %r13d
testl %r13d, %r13d
jle 0x10c9c
movq 0x3d8(%rbx), %rdi
leaq 0x170(%rbx), %rsi
movq %r14, %rdx
callq 0x3d1f6
cmpl $0x2, %r13d
jl 0x10cb8
movq 0x3e8(%rbx), %rdi
leaq 0x178(%rbx), %rsi
movq %r14, %rdx
callq 0x3d1f6
cmpl $0x3, %r13d
jne 0x10cd4
movq 0x3f8(%rbx), %rdi
leaq 0x180(%rbx), %rsi
movq %r14, %rdx
callq 0x3d1f6
cmpb $0x1, 0x118(%rsp)
jne 0x10d1b
cmpl $0x0, 0x11c(%rsp)
je 0x10d1b
xorl %r13d, %r13d
xorl %r15d, %r15d
movq 0x418(%rbx), %rdi
movq 0x158(%rbx), %rsi
addq %r13, %rsi
movq %r14, %rdx
callq 0x3d1f6
incq %r15
movslq 0x11c(%rsp), %rax
addq $0x8, %r13
cmpq %rax, %r15
jb 0x10cee
movq 0x380(%rbx), %rax
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
cmpq %rax, 0x388(%rbx)
je 0x11480
xorl %r14d, %r14d
movq 0x38(%rsp), %r15
movq %r14, %r13
shlq $0x4, %r13
fldt (%rax,%r13)
faddl (%r15)
fstpt (%rax,%r13)
testb %r12b, %r12b
je 0x10ddb
movq 0xa0(%rsp), %rax
movsd (%rax,%r14,8), %xmm0
subsd 0x8(%rsp), %xmm0
movapd %xmm0, %xmm1
mulsd %xmm0, %xmm1
mulsd 0x178(%rbx), %xmm1
movsd 0x170(%rbx), %xmm2
mulsd %xmm0, %xmm2
addsd %xmm1, %xmm2
movsd %xmm2, 0x10(%rsp)
movsd 0x180(%rbx), %xmm1
movsd %xmm1, 0x18(%rsp)
movsd 0x2e8ed(%rip), %xmm1    # 0x3f698
callq 0x66f0
mulsd 0x18(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
movq 0x380(%rbx), %rax
fldt (%rax,%r13)
faddl 0x88(%rsp)
fstpt (%rax,%r13)
testb %bpl, %bpl
je 0x10e2e
movq 0x128(%rbx), %rax
movq 0x130(%rbx), %rcx
subq %rax, %rcx
je 0x10e2e
sarq $0x3, %rcx
movq 0xe8(%rsp), %rdx
movslq (%rdx,%r14,4), %rdx
cmpq $0x1, %rcx
adcq $0x0, %rcx
movq 0x380(%rbx), %rsi
addq %r13, %rsi
decq %rdx
xorl %edi, %edi
cmpq %rdi, %rdx
jne 0x10e26
fldt (%rsi)
faddl (%rax,%rdi,8)
fstpt (%rsi)
incq %rdi
cmpq %rdi, %rcx
jne 0x10e1a
cmpb $0x1, 0x118(%rsp)
jne 0x10e8e
movslq 0x11c(%rsp), %rax
testq %rax, %rax
je 0x10e8e
movq 0x158(%rbx), %rcx
movq 0x20(%rsp), %rdx
movq 0x380(%rbx), %rdi
leaq (%rdi,%r13), %rsi
fldt (%rdi,%r13)
xorl %edi, %edi
movsd (%rcx,%rdi,8), %xmm0
movq (%rdx), %r8
mulsd (%r8,%r14,8), %xmm0
movsd %xmm0, 0x80(%rsp)
faddl 0x80(%rsp)
incq %rdi
addq $0x18, %rdx
cmpq %rdi, %rax
jne 0x10e62
fstpt (%rsi)
incq %r14
movq 0x380(%rbx), %rax
movq 0x388(%rbx), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
cmpq %rcx, %r14
jb 0x10d40
jmp 0x11480
leaq 0x8(%rbx), %r15
movq %r15, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x15d46
movsd %xmm0, (%rsp)
movq %r15, %rdi
callq 0x158c2
movq %rbx, %rdi
callq 0xedf2
jmp 0x10f33
leaq 0x8(%rbx), %r15
movq %r15, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x15d46
movsd %xmm0, (%rsp)
movq %r15, %rdi
callq 0x158c2
movq %rbx, %rdi
callq 0xedf2
jmp 0x10f33
leaq 0x8(%rbx), %r15
movq %r15, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x15d46
movsd %xmm0, (%rsp)
movq %r15, %rdi
callq 0x158c2
movq %rbx, %rdi
callq 0xedf2
xorpd %xmm0, %xmm0
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
jmp 0x11480
movl 0x1a8(%rbx), %eax
cmpl $0x1, %eax
je 0x110fa
testl %eax, %eax
jne 0x1146f
movq %r14, %rdi
callq 0x3c02c
movsd 0x2e737(%rip), %xmm1    # 0x3f6a8
ucomisd %xmm0, %xmm1
jae 0x113c8
movq %r14, %rdi
callq 0x3c02c
movsd 0x2e745(%rip), %xmm1    # 0x3f6d0
ucomisd %xmm0, %xmm1
jae 0x1144a
movq %r14, %rdi
callq 0x3c02c
movsd 0x2e1f3(%rip), %xmm1    # 0x3f198
ucomisd %xmm0, %xmm1
jae 0x11456
movsd 0x1c8(%rbx), %xmm0
callq 0x63c0
leaq 0x1f0(%rbx), %r15
movsd %xmm0, 0x1f0(%rbx)
movq 0x478(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3d1f6
leaq 0x1c8(%rbx), %r14
jmp 0x1142d
movq %r14, %rdi
callq 0x3c02c
xorl %eax, %eax
movsd 0x2e19d(%rip), %xmm1    # 0x3f198
ucomisd %xmm0, %xmm1
setb %al
leaq (%rbx,%rax,8), %rsi
addq $0x188, %rsi            # imm = 0x188
shll $0x4, %eax
movq 0x428(%rbx,%rax), %rdi
movq %r14, %rdx
callq 0x3d1f6
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0xedf2
jmp 0x11480
leaq 0x3434b(%rip), %rax     # 0x45388
cmpb $0x1, (%rax)
jne 0x11143
movq 0x140(%rbx), %rsi
cmpq %rsi, 0x148(%rbx)
je 0x11159
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x3c8(%rbx), %rdi
addq %r15, %rsi
movq %r14, %rdx
callq 0x3d1f6
incq %r12
movq 0x140(%rbx), %rsi
movq 0x148(%rbx), %rax
subq %rsi, %rax
sarq $0x3, %rax
addq $0x8, %r15
cmpq %r12, %rax
ja 0x11060
jmp 0x11159
leaq 0x342e9(%rip), %rax     # 0x45388
cmpb $0x1, (%rax)
jne 0x112bb
movq 0x140(%rbx), %rsi
cmpq %rsi, 0x148(%rbx)
je 0x112d1
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x3c8(%rbx), %rdi
addq %r15, %rsi
movq %r14, %rdx
callq 0x3d1f6
incq %r12
movq 0x140(%rbx), %rsi
movq 0x148(%rbx), %rax
subq %rsi, %rax
sarq $0x3, %rax
addq $0x8, %r15
cmpq %r12, %rax
ja 0x110c2
jmp 0x112d1
movq %r14, %rdi
callq 0x3c02c
movsd 0x2e5c6(%rip), %xmm1    # 0x3f6d0
ucomisd %xmm0, %xmm1
jae 0x113f8
movq %r14, %rdi
callq 0x3c02c
xorl %eax, %eax
movsd 0x2e072(%rip), %xmm1    # 0x3f198
ucomisd %xmm0, %xmm1
setb %al
leaq 0x1b8(,%rax,8), %rsi
shll $0x4, %eax
addq $0x458, %rax            # imm = 0x458
jmp 0x11460
movq 0x3c8(%rbx), %rdi
leaq 0x198(%rbx), %rsi
movq %r14, %rdx
callq 0x3d1f6
leaq 0x34230(%rip), %rax     # 0x45390
cmpb $0x1, (%rax)
jne 0x1117b
movq 0x500(%rbx), %rdi
leaq 0x1a0(%rbx), %rsi
movq %r14, %rdx
callq 0x3d1f6
leaq 0x34207(%rip), %rax     # 0x45389
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
cmpb $0x1, (%rax)
jne 0x11480
movq %rbx, %rdi
callq 0x10004
leaq 0x341e9(%rip), %rax     # 0x4538c
movslq (%rax), %r15
testq %r15, %r15
jle 0x113b2
shlq $0x3, %r15
xorl %r12d, %r12d
movq 0x488(%rbx), %rax
movq (%rax,%r12,2), %rdi
movq 0x308(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x3d1f6
movq 0x4a0(%rbx), %rax
movq (%rax,%r12,2), %rdi
movq 0x320(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x3d1f6
movq 0x4b8(%rbx), %rax
movq (%rax,%r12,2), %rdi
movq 0x338(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x3d1f6
movq 0x4d0(%rbx), %rax
movq (%rax,%r12,2), %rdi
movq 0x350(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x3d1f6
movq 0x4e8(%rbx), %rax
movq (%rax,%r12,2), %rdi
movq 0x368(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x3d1f6
addq $0x8, %r12
cmpq %r12, %r15
jne 0x111b6
jmp 0x113b2
leaq 0x34128(%rip), %rax     # 0x45388
cmpb $0x1, (%rax)
jne 0x1143e
movq 0x140(%rbx), %rsi
cmpq %rsi, 0x148(%rbx)
je 0x1146f
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x3c8(%rbx), %rdi
addq %r15, %rsi
movq %r14, %rdx
callq 0x3d1f6
incq %r12
movq 0x140(%rbx), %rsi
movq 0x148(%rbx), %rax
subq %rsi, %rax
sarq $0x3, %rax
addq $0x8, %r15
cmpq %r12, %rax
ja 0x11283
jmp 0x1146f
movq 0x3c8(%rbx), %rdi
leaq 0x198(%rbx), %rsi
movq %r14, %rdx
callq 0x3d1f6
movq %rbx, %rdi
callq 0xf34e
leaq 0x340a9(%rip), %rax     # 0x45389
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
cmpb $0x1, (%rax)
jne 0x11480
movq %rbx, %rdi
callq 0x10004
leaq 0x3408b(%rip), %rax     # 0x4538c
movslq (%rax), %r15
testq %r15, %r15
jle 0x113b2
shlq $0x3, %r15
xorl %r12d, %r12d
movq 0x488(%rbx), %rax
movq (%rax,%r12,2), %rdi
movq 0x308(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x3d1f6
movq 0x4a0(%rbx), %rax
movq (%rax,%r12,2), %rdi
movq 0x320(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x3d1f6
movq 0x4b8(%rbx), %rax
movq (%rax,%r12,2), %rdi
movq 0x338(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x3d1f6
movq 0x4d0(%rbx), %rax
movq (%rax,%r12,2), %rdi
movq 0x350(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x3d1f6
movq 0x4e8(%rbx), %rax
movq (%rax,%r12,2), %rdi
movq 0x368(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x3d1f6
addq $0x8, %r12
cmpq %r12, %r15
jne 0x11314
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0xfdd4
jmp 0x11480
movsd 0x1b0(%rbx), %xmm0
callq 0x63c0
leaq 0x1d8(%rbx), %r15
movsd %xmm0, 0x1d8(%rbx)
movq 0x448(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3d1f6
jmp 0x11426
movsd 0x1b0(%rbx), %xmm0
callq 0x63c0
leaq 0x1d8(%rbx), %r15
movsd %xmm0, 0x1d8(%rbx)
movq 0x448(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3d1f6
leaq 0x1b0(%rbx), %r14
movsd (%r15), %xmm0
callq 0x6730
movsd %xmm0, (%r14)
jmp 0x1146f
movl $0x198, %esi            # imm = 0x198
movl $0x3c8, %eax            # imm = 0x3C8
jmp 0x11460
movl $0x1b8, %esi            # imm = 0x1B8
movl $0x458, %eax            # imm = 0x458
jmp 0x11460
movl $0x1c0, %esi            # imm = 0x1C0
movl $0x468, %eax            # imm = 0x468
movq (%rbx,%rax), %rdi
addq %rbx, %rsi
movq %r14, %rdx
callq 0x3d1f6
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0xf34e
leaq 0x20(%rsp), %rdi
callq 0xbacc
leaq 0xa0(%rsp), %rdi
callq 0xb832
movsd (%rsp), %xmm0
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x114d1
jmp 0x114d1
jmp 0x114d1
jmp 0x114d1
jmp 0x114d1
jmp 0x114d1
jmp 0x114d1
jmp 0x114d1
jmp 0x114d1
jmp 0x114d1
jmp 0x114d1
jmp 0x114d1
jmp 0x114d1
movq %rax, %rbx
jmp 0x114de
jmp 0x114d1
jmp 0x114d1
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xbacc
leaq 0xa0(%rsp), %rdi
callq 0xb832
movq %rbx, %rdi
callq 0x6710
nop