// File: /workspace/github_cpp_makefile_star2_O2/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 $0x1b8, %rsp            # imm = 0x1B8
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x55b02(%rip), %rsi     # 0x64580
leaq 0xb0(%rsp), %rdi
callq 0x11aa2
leaq 0x110(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x120ba
leaq 0xb0(%rsp), %rdi
callq 0x12114
movsd %xmm0, 0x18(%rsp)
leaq 0x38555(%rip), %rax     # 0x4700c
cmpb $0x1, (%rax)
jne 0xec81
movq %r14, %rdi
callq 0x38b70
movsd 0x2d6c8(%rip), %xmm1    # 0x3c198
ucomisd %xmm0, %xmm1
jae 0xf036
movq %r14, %rdi
callq 0x38b70
movsd 0x2d6ae(%rip), %xmm1    # 0x3c198
ucomisd %xmm0, %xmm1
jae 0xf0c6
movq %r14, %rdi
callq 0x38b70
movsd 0x2d694(%rip), %xmm1    # 0x3c198
ucomisd %xmm0, %xmm1
jae 0xf255
leaq 0x120(%rbx), %r15
leaq 0x384f3(%rip), %rax     # 0x4700f
movb (%rax), %al
movb %al, (%rsp)
leaq 0x170(%rbx), %rax
movq %rax, 0x18(%rsp)
leaq 0x384e0(%rip), %rax     # 0x47014
movb (%rax), %r13b
movq 0x380(%rbx), %rax
xorl %ebp, %ebp
movq 0x388(%rbx), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
cmpq %rcx, %rbp
jae 0xf33f
movq %rbp, %r12
shlq $0x4, %r12
fldt (%rax,%r12)
fsubl (%r15)
fstpt (%rax,%r12)
testb $0x1, (%rsp)
je 0xebcb
movq 0x18(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0xb0(%rsp), %rax
movsd (%rax,%rbp,8), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x12114
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsp)
movq 0x380(%rbx), %rax
fldt (%rax,%r12)
fsubl 0x58(%rsp)
fstpt (%rax,%r12)
testb $0x1, %r13b
je 0xec21
movq 0x128(%rbx), %rcx
movq 0x130(%rbx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movq 0xf8(%rsp), %rsi
movq 0x380(%rbx), %rax
leaq (%rax,%r12), %rdi
negq %rdx
pushq $0x1
popq %r8
leaq (%rdx,%r8), %r9
cmpq $0x1, %r9
je 0xec21
movslq (%rsi,%rbp,4), %r9
cmpq %r9, %r8
jne 0xec1c
fldt (%rdi)
fsubl -0x8(%rcx,%r8,8)
fstpt (%rdi)
incq %r8
jmp 0xec00
cmpb $0x1, 0x128(%rsp)
jne 0xec79
movslq 0x12c(%rsp), %rcx
movq 0x158(%rbx), %rdx
movq 0x20(%rsp), %rsi
movq 0x380(%rbx), %rax
addq %rax, %r12
xorl %edi, %edi
cmpq %rdi, %rcx
je 0xec79
movsd (%rdx,%rdi,8), %xmm0
movq (%rsi), %r8
mulsd (%r8,%rbp,8), %xmm0
movsd %xmm0, 0x50(%rsp)
fldt (%r12)
fsubl 0x50(%rsp)
fstpt (%r12)
incq %rdi
addq $0x18, %rsi
jmp 0xec4b
incq %rbp
jmp 0xeb40
leaq 0x38385(%rip), %rax     # 0x4700d
cmpb $0x1, (%rax)
jne 0xee52
movq %r14, %rdi
callq 0x38b70
movsd 0x2d4f7(%rip), %xmm1    # 0x3c198
ucomisd %xmm0, %xmm1
jae 0xf05f
movq %r14, %rdi
callq 0x38b70
movsd 0x2d4dd(%rip), %xmm1    # 0x3c198
ucomisd %xmm0, %xmm1
jae 0xf165
movq %r14, %rdi
callq 0x38b70
movsd 0x2d4c3(%rip), %xmm1    # 0x3c198
ucomisd %xmm0, %xmm1
jae 0xf7dc
leaq 0x120(%rbx), %r15
leaq 0x38322(%rip), %rax     # 0x4700f
movb (%rax), %al
movb %al, (%rsp)
leaq 0x170(%rbx), %rax
movq %rax, 0x18(%rsp)
leaq 0x3830f(%rip), %rax     # 0x47014
movb (%rax), %r13b
movq 0x380(%rbx), %rax
xorl %ebp, %ebp
movq 0x388(%rbx), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
cmpq %rcx, %rbp
jae 0xf93b
movq %rbp, %r12
shlq $0x4, %r12
fldt (%rax,%r12)
fsubl (%r15)
fstpt (%rax,%r12)
testb $0x1, (%rsp)
je 0xed9c
movq 0x18(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0xb0(%rsp), %rax
movsd (%rax,%rbp,8), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x12114
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x78(%rsp)
movq 0x380(%rbx), %rax
fldt (%rax,%r12)
fsubl 0x78(%rsp)
fstpt (%rax,%r12)
testb $0x1, %r13b
je 0xedf2
movq 0x128(%rbx), %rcx
movq 0x130(%rbx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movq 0xf8(%rsp), %rsi
movq 0x380(%rbx), %rax
leaq (%rax,%r12), %rdi
negq %rdx
pushq $0x1
popq %r8
leaq (%rdx,%r8), %r9
cmpq $0x1, %r9
je 0xedf2
movslq (%rsi,%rbp,4), %r9
cmpq %r9, %r8
jne 0xeded
fldt (%rdi)
fsubl -0x8(%rcx,%r8,8)
fstpt (%rdi)
incq %r8
jmp 0xedd1
cmpb $0x1, 0x128(%rsp)
jne 0xee4a
movslq 0x12c(%rsp), %rcx
movq 0x158(%rbx), %rdx
movq 0x20(%rsp), %rsi
movq 0x380(%rbx), %rax
addq %rax, %r12
xorl %edi, %edi
cmpq %rdi, %rcx
je 0xee4a
movsd (%rdx,%rdi,8), %xmm0
movq (%rsi), %r8
mulsd (%r8,%rbp,8), %xmm0
movsd %xmm0, 0x70(%rsp)
fldt (%r12)
fsubl 0x70(%rsp)
fstpt (%r12)
incq %rdi
addq $0x18, %rsi
jmp 0xee1c
incq %rbp
jmp 0xed11
movq %r14, %rdi
callq 0x38b70
movsd 0x2d836(%rip), %xmm1    # 0x3c698
ucomisd %xmm0, %xmm1
jae 0xf088
movq %r14, %rdi
callq 0x38b70
movsd 0x2d31c(%rip), %xmm1    # 0x3c198
ucomisd %xmm0, %xmm1
jae 0xf1b2
leaq 0x120(%rbx), %r15
leaq 0x3817b(%rip), %rax     # 0x4700f
movb (%rax), %al
movb %al, (%rsp)
leaq 0x170(%rbx), %rax
movq %rax, 0x48(%rsp)
leaq 0x178(%rbx), %rax
movq %rax, 0x40(%rsp)
leaq 0x180(%rbx), %rax
movq %rax, 0x38(%rsp)
leaq 0x38150(%rip), %rax     # 0x47014
movb (%rax), %r13b
movq 0x380(%rbx), %rax
xorl %r12d, %r12d
movq 0x388(%rbx), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
cmpq %rcx, %r12
jae 0xf201
movq %r12, %rbp
shlq $0x4, %rbp
fldt (%rax,%rbp)
fsubl (%r15)
fstpt (%rax,%rbp)
testb $0x1, (%rsp)
je 0xef7c
movq 0xb0(%rsp), %rax
movsd (%rax,%r12,8), %xmm0
subsd 0x18(%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, 0x8(%rsp)
movsd 0x2d71a(%rip), %xmm1    # 0x3c668
callq 0x66c0
mulsd 0x8(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x98(%rsp)
movq 0x380(%rbx), %rax
fldt (%rax,%rbp)
fsubl 0x98(%rsp)
fstpt (%rax,%rbp)
testb $0x1, %r13b
je 0xefd2
movq 0x128(%rbx), %rcx
movq 0x130(%rbx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movq 0xf8(%rsp), %rsi
movq 0x380(%rbx), %rax
leaq (%rax,%rbp), %rdi
negq %rdx
pushq $0x1
popq %r8
leaq (%rdx,%r8), %r9
cmpq $0x1, %r9
je 0xefd2
movslq (%rsi,%r12,4), %r9
cmpq %r9, %r8
jne 0xefcd
fldt (%rdi)
fsubl -0x8(%rcx,%r8,8)
fstpt (%rdi)
incq %r8
jmp 0xefb1
cmpb $0x1, 0x128(%rsp)
jne 0xf02e
movslq 0x12c(%rsp), %rcx
movq 0x158(%rbx), %rdx
movq 0x20(%rsp), %rsi
movq 0x380(%rbx), %rax
addq %rax, %rbp
xorl %edi, %edi
cmpq %rdi, %rcx
je 0xf02e
movsd (%rdx,%rdi,8), %xmm0
movq (%rsi), %r8
mulsd (%r8,%r12,8), %xmm0
movsd %xmm0, 0x90(%rsp)
fldt (%rbp)
fsubl 0x90(%rsp)
fstpt (%rbp)
incq %rdi
addq $0x18, %rsi
jmp 0xeffc
incq %r12
jmp 0xeed1
leaq 0x8(%rbx), %r15
pushq $0x1
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x12144
movsd %xmm0, (%rsp)
movq %r15, %rdi
callq 0x11d10
movq %rbx, %rdi
callq 0xdb16
jmp 0xf0af
leaq 0x8(%rbx), %r15
pushq $0x1
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x12144
movsd %xmm0, (%rsp)
movq %r15, %rdi
callq 0x11d10
movq %rbx, %rdi
callq 0xdb16
jmp 0xf0af
leaq 0x8(%rbx), %r15
pushq $0x1
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x12144
movsd %xmm0, (%rsp)
movq %r15, %rdi
callq 0x11d10
movq %rbx, %rdi
callq 0xdb16
xorpd %xmm0, %xmm0
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
jmp 0xfbed
movl 0x1a8(%rbx), %eax
cmpl $0x1, %eax
je 0xf67f
testl %eax, %eax
jne 0xfbdc
movq %r14, %rdi
callq 0x38b70
movsd 0x2d58b(%rip), %xmm1    # 0x3c678
ucomisd %xmm0, %xmm1
jae 0xfb35
movq %r14, %rdi
callq 0x38b70
movsd 0x2d599(%rip), %xmm1    # 0x3c6a0
ucomisd %xmm0, %xmm1
jae 0xfbb7
movq %r14, %rdi
callq 0x38b70
movsd 0x2d077(%rip), %xmm1    # 0x3c198
ucomisd %xmm0, %xmm1
jae 0xfbc3
movsd 0x1c8(%rbx), %xmm0
callq 0x63b0
leaq 0x1f0(%rbx), %r15
movsd %xmm0, 0x1f0(%rbx)
movq 0x478(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x39bb6
leaq 0x1c8(%rbx), %r14
jmp 0xfb9a
movq %r14, %rdi
callq 0x38b70
xorl %eax, %eax
movsd 0x2d021(%rip), %xmm1    # 0x3c198
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 0x39bb6
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0xdb16
jmp 0xfbed
leaq 0x37e5b(%rip), %rax     # 0x47014
cmpb $0x1, (%rax)
jne 0xf6c8
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x140(%rbx), %rsi
movq 0x148(%rbx), %rax
subq %rsi, %rax
sarq $0x3, %rax
cmpq %r12, %rax
jbe 0xf6de
movq 0x3c8(%rbx), %rdi
addq %r15, %rsi
movq %r14, %rdx
callq 0x39bb6
incq %r12
addq $0x8, %r15
jmp 0xf1c8
movq 0x3b8(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x39bb6
testb $0x1, %r13b
je 0xf2a4
xorl %r12d, %r12d
movl %r12d, %r12d
movq 0x128(%rbx), %rax
movq 0x130(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
jbe 0xf2a4
movq 0x408(%rbx), %rdi
leaq (%rax,%r12,8), %rsi
movq %r14, %rdx
callq 0x39bb6
incl %r12d
jmp 0xf220
leaq 0x37db8(%rip), %rax     # 0x47014
cmpb $0x1, (%rax)
jne 0xf82b
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x140(%rbx), %rsi
movq 0x148(%rbx), %rax
subq %rsi, %rax
sarq $0x3, %rax
cmpq %r12, %rax
jbe 0xf841
movq 0x3c8(%rbx), %rdi
addq %r15, %rsi
movq %r14, %rdx
callq 0x39bb6
incq %r12
addq $0x8, %r15
jmp 0xf26b
testb $0x1, (%rsp)
je 0xf2fd
leaq 0x37d5f(%rip), %rax     # 0x47010
movl (%rax), %ebp
testl %ebp, %ebp
jle 0xf2fd
movq 0x3d8(%rbx), %rdi
movq 0x48(%rsp), %rsi
movq %r14, %rdx
callq 0x39bb6
cmpl $0x1, %ebp
je 0xf2fd
movq 0x3e8(%rbx), %rdi
movq 0x40(%rsp), %rsi
movq %r14, %rdx
callq 0x39bb6
cmpl $0x3, %ebp
jne 0xf2fd
movq 0x3f8(%rbx), %rdi
movq 0x38(%rsp), %rsi
movq %r14, %rdx
callq 0x39bb6
cmpb $0x1, 0x128(%rsp)
jne 0xf397
xorl %r12d, %r12d
xorl %ebp, %ebp
movslq 0x12c(%rsp), %rax
cmpq %rax, %rbp
jae 0xf397
movq 0x418(%rbx), %rdi
movq 0x158(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x39bb6
incq %rbp
addq $0x8, %r12
jmp 0xf310
movq 0x3b8(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x39bb6
testb $0x1, %r13b
je 0xf4ef
xorl %r12d, %r12d
movl %r12d, %r12d
movq 0x128(%rbx), %rax
movq 0x130(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
jbe 0xf4ef
movq 0x408(%rbx), %rdi
leaq (%rax,%r12,8), %rsi
movq %r14, %rdx
callq 0x39bb6
incl %r12d
jmp 0xf35e
movq 0x380(%rbx), %rax
xorl %r14d, %r14d
movq 0x388(%rbx), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
cmpq %rcx, %r14
jae 0xfb27
movq %r14, %rbp
shlq $0x4, %rbp
fldt (%rax,%rbp)
faddl (%r15)
fstpt (%rax,%rbp)
testb $0x1, (%rsp)
je 0xf44c
movq 0xb0(%rsp), %rax
movsd (%rax,%r14,8), %xmm0
subsd 0x18(%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, 0x8(%rsp)
movsd 0x2d24a(%rip), %xmm1    # 0x3c668
callq 0x66c0
mulsd 0x8(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0xa8(%rsp)
movq 0x380(%rbx), %rax
fldt (%rax,%rbp)
faddl 0xa8(%rsp)
fstpt (%rax,%rbp)
testb $0x1, %r13b
je 0xf492
movq 0x128(%rbx), %rcx
movq 0x130(%rbx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movq 0xf8(%rsp), %rsi
leaq (%rax,%rbp), %rdi
xorl %r8d, %r8d
cmpq %r8, %rdx
je 0xf492
movslq (%rsi,%r14,4), %r9
incq %r8
cmpq %r9, %r8
jne 0xf476
fldt (%rdi)
faddl -0x8(%rcx,%r8,8)
fstpt (%rdi)
jmp 0xf476
cmpb $0x1, 0x128(%rsp)
jne 0xf4e7
movslq 0x12c(%rsp), %rcx
movq 0x158(%rbx), %rdx
movq 0x20(%rsp), %rsi
addq %rax, %rbp
xorl %edi, %edi
cmpq %rdi, %rcx
je 0xf4e7
movsd (%rdx,%rdi,8), %xmm0
movq (%rsi), %r8
mulsd (%r8,%r14,8), %xmm0
movsd %xmm0, 0xa0(%rsp)
fldt (%rbp)
faddl 0xa0(%rsp)
fstpt (%rbp)
incq %rdi
addq $0x18, %rsi
jmp 0xf4b5
incq %r14
jmp 0xf3a1
testb $0x1, (%rsp)
je 0xf509
movq 0x3d8(%rbx), %rdi
movq 0x18(%rsp), %rsi
movq %r14, %rdx
callq 0x39bb6
cmpb $0x1, 0x128(%rsp)
jne 0xf547
xorl %r12d, %r12d
xorl %ebp, %ebp
movslq 0x12c(%rsp), %rax
cmpq %rax, %rbp
jae 0xf547
movq 0x418(%rbx), %rdi
movq 0x158(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x39bb6
incq %rbp
addq $0x8, %r12
jmp 0xf518
movq 0x380(%rbx), %rax
xorl %r14d, %r14d
leaq 0xb0(%rsp), %rbp
movq 0x388(%rbx), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
cmpq %rcx, %r14
jae 0xfb27
movq %r14, %r12
shlq $0x4, %r12
fldt (%rax,%r12)
faddl (%r15)
fstpt (%rax,%r12)
testb $0x1, (%rsp)
je 0xf5e0
movq 0x18(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0xb0(%rsp), %rax
movsd (%rax,%r14,8), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %rbp, %rdi
callq 0x12114
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
movq 0x380(%rbx), %rax
fldt (%rax,%r12)
faddl 0x68(%rsp)
fstpt (%rax,%r12)
testb $0x1, %r13b
je 0xf626
movq 0x128(%rbx), %rcx
movq 0x130(%rbx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movq 0xf8(%rsp), %rsi
leaq (%rax,%r12), %rdi
xorl %r8d, %r8d
cmpq %r8, %rdx
je 0xf626
movslq (%rsi,%r14,4), %r9
incq %r8
cmpq %r9, %r8
jne 0xf60a
fldt (%rdi)
faddl -0x8(%rcx,%r8,8)
fstpt (%rdi)
jmp 0xf60a
cmpb $0x1, 0x128(%rsp)
jne 0xf677
movslq 0x12c(%rsp), %rcx
movq 0x158(%rbx), %rdx
movq 0x20(%rsp), %rsi
addq %rax, %r12
xorl %edi, %edi
cmpq %rdi, %rcx
je 0xf677
movsd (%rdx,%rdi,8), %xmm0
movq (%rsi), %r8
mulsd (%r8,%r14,8), %xmm0
movsd %xmm0, 0x60(%rsp)
fldt (%r12)
faddl 0x60(%rsp)
fstpt (%r12)
incq %rdi
addq $0x18, %rsi
jmp 0xf649
incq %r14
jmp 0xf559
movq %r14, %rdi
callq 0x38b70
movsd 0x2d011(%rip), %xmm1    # 0x3c6a0
ucomisd %xmm0, %xmm1
jae 0xfb65
movq %r14, %rdi
callq 0x38b70
xorl %eax, %eax
movsd 0x2caed(%rip), %xmm1    # 0x3c198
ucomisd %xmm0, %xmm1
setb %al
leaq 0x1b8(,%rax,8), %rsi
shll $0x4, %eax
addq $0x458, %rax            # imm = 0x458
jmp 0xfbcd
movq 0x3c8(%rbx), %rdi
leaq 0x198(%rbx), %rsi
movq %r14, %rdx
callq 0x39bb6
leaq 0x37937(%rip), %rax     # 0x4701c
cmpb $0x1, (%rax)
jne 0xf700
movq 0x500(%rbx), %rdi
leaq 0x1a0(%rbx), %rsi
movq %r14, %rdx
callq 0x39bb6
leaq 0x3790e(%rip), %rax     # 0x47015
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
cmpb $0x1, (%rax)
jne 0xfbed
movq %rbx, %rdi
callq 0xe8d2
leaq 0x378f0(%rip), %rax     # 0x47018
movl (%rax), %r15d
xorl %r12d, %r12d
testl %r15d, %r15d
cmovlel %r12d, %r15d
shlq $0x3, %r15
cmpq %r12, %r15
je 0xf925
movq 0x488(%rbx), %rax
movq (%rax,%r12,2), %rdi
movq 0x308(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x39bb6
movq 0x4a0(%rbx), %rax
movq (%rax,%r12,2), %rdi
movq 0x320(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x39bb6
movq 0x4b8(%rbx), %rax
movq (%rax,%r12,2), %rdi
movq 0x338(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x39bb6
movq 0x4d0(%rbx), %rax
movq (%rax,%r12,2), %rdi
movq 0x350(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x39bb6
movq 0x4e8(%rbx), %rax
movq (%rax,%r12,2), %rdi
movq 0x368(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x39bb6
addq $0x8, %r12
jmp 0xf739
leaq 0x37831(%rip), %rax     # 0x47014
cmpb $0x1, (%rax)
jne 0xfbab
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x140(%rbx), %rsi
movq 0x148(%rbx), %rax
subq %rsi, %rax
sarq $0x3, %rax
cmpq %r12, %rax
jbe 0xfbdc
movq 0x3c8(%rbx), %rdi
addq %r15, %rsi
movq %r14, %rdx
callq 0x39bb6
incq %r12
addq $0x8, %r15
jmp 0xf7f2
movq 0x3c8(%rbx), %rdi
leaq 0x198(%rbx), %rsi
movq %r14, %rdx
callq 0x39bb6
movq %rbx, %rdi
callq 0xdfc2
leaq 0x377c5(%rip), %rax     # 0x47015
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
cmpb $0x1, (%rax)
jne 0xfbed
movq %rbx, %rdi
callq 0xe8d2
leaq 0x377a7(%rip), %rax     # 0x47018
movl (%rax), %r15d
xorl %r12d, %r12d
testl %r15d, %r15d
cmovlel %r12d, %r15d
shlq $0x3, %r15
cmpq %r12, %r15
je 0xf925
movq 0x488(%rbx), %rax
movq (%rax,%r12,2), %rdi
movq 0x308(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x39bb6
movq 0x4a0(%rbx), %rax
movq (%rax,%r12,2), %rdi
movq 0x320(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x39bb6
movq 0x4b8(%rbx), %rax
movq (%rax,%r12,2), %rdi
movq 0x338(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x39bb6
movq 0x4d0(%rbx), %rax
movq (%rax,%r12,2), %rdi
movq 0x350(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x39bb6
movq 0x4e8(%rbx), %rax
movq (%rax,%r12,2), %rdi
movq 0x368(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x39bb6
addq $0x8, %r12
jmp 0xf882
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0xe6b0
jmp 0xfbed
movq 0x3b8(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x39bb6
testb $0x1, %r13b
je 0xf98b
xorl %r12d, %r12d
movl %r12d, %r12d
movq 0x128(%rbx), %rax
movq 0x130(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
jbe 0xf98b
movq 0x408(%rbx), %rdi
leaq (%rax,%r12,8), %rsi
movq %r14, %rdx
callq 0x39bb6
incl %r12d
jmp 0xf956
testb $0x1, (%rsp)
je 0xf9a5
movq 0x3d8(%rbx), %rdi
movq 0x18(%rsp), %rsi
movq %r14, %rdx
callq 0x39bb6
cmpb $0x1, 0x128(%rsp)
jne 0xf9e3
xorl %r12d, %r12d
xorl %ebp, %ebp
movslq 0x12c(%rsp), %rax
cmpq %rax, %rbp
jae 0xf9e3
movq 0x418(%rbx), %rdi
movq 0x158(%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdx
callq 0x39bb6
incq %rbp
addq $0x8, %r12
jmp 0xf9b4
movq 0x380(%rbx), %rax
xorl %r14d, %r14d
leaq 0xb0(%rsp), %rbp
movq 0x388(%rbx), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
cmpq %rcx, %r14
jae 0xfb27
movq %r14, %r12
shlq $0x4, %r12
fldt (%rax,%r12)
faddl (%r15)
fstpt (%rax,%r12)
testb $0x1, (%rsp)
je 0xfa82
movq 0x18(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0xb0(%rsp), %rax
movsd (%rax,%r14,8), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %rbp, %rdi
callq 0x12114
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x88(%rsp)
movq 0x380(%rbx), %rax
fldt (%rax,%r12)
faddl 0x88(%rsp)
fstpt (%rax,%r12)
testb $0x1, %r13b
je 0xfac8
movq 0x128(%rbx), %rcx
movq 0x130(%rbx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movq 0xf8(%rsp), %rsi
leaq (%rax,%r12), %rdi
xorl %r8d, %r8d
cmpq %r8, %rdx
je 0xfac8
movslq (%rsi,%r14,4), %r9
incq %r8
cmpq %r9, %r8
jne 0xfaac
fldt (%rdi)
faddl -0x8(%rcx,%r8,8)
fstpt (%rdi)
jmp 0xfaac
cmpb $0x1, 0x128(%rsp)
jne 0xfb1f
movslq 0x12c(%rsp), %rcx
movq 0x158(%rbx), %rdx
movq 0x20(%rsp), %rsi
addq %rax, %r12
xorl %edi, %edi
cmpq %rdi, %rcx
je 0xfb1f
movsd (%rdx,%rdi,8), %xmm0
movq (%rsi), %r8
mulsd (%r8,%r14,8), %xmm0
movsd %xmm0, 0x80(%rsp)
fldt (%r12)
faddl 0x80(%rsp)
fstpt (%r12)
incq %rdi
addq $0x18, %rsi
jmp 0xfaeb
incq %r14
jmp 0xf9f5
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
jmp 0xfbed
movsd 0x1b0(%rbx), %xmm0
callq 0x63b0
leaq 0x1d8(%rbx), %r15
movsd %xmm0, 0x1d8(%rbx)
movq 0x448(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x39bb6
jmp 0xfb93
movsd 0x1b0(%rbx), %xmm0
callq 0x63b0
leaq 0x1d8(%rbx), %r15
movsd %xmm0, 0x1d8(%rbx)
movq 0x448(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x39bb6
leaq 0x1b0(%rbx), %r14
movsd (%r15), %xmm0
callq 0x6700
movsd %xmm0, (%r14)
jmp 0xfbdc
movl $0x198, %esi            # imm = 0x198
movl $0x3c8, %eax            # imm = 0x3C8
jmp 0xfbcd
movl $0x1b8, %esi            # imm = 0x1B8
movl $0x458, %eax            # imm = 0x458
jmp 0xfbcd
movl $0x1c0, %esi            # imm = 0x1C0
movl $0x468, %eax            # imm = 0x468
movq (%rbx,%rax), %rdi
addq %rbx, %rsi
movq %r14, %rdx
callq 0x39bb6
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0xdfc2
leaq 0x20(%rsp), %rdi
callq 0xb29c
leaq 0xb0(%rsp), %rdi
callq 0xb0be
movsd (%rsp), %xmm0
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xfc3e
jmp 0xfc3e
jmp 0xfc3e
jmp 0xfc3e
jmp 0xfc3e
jmp 0xfc3e
jmp 0xfc3e
jmp 0xfc3e
jmp 0xfc3e
jmp 0xfc3e
jmp 0xfc3e
jmp 0xfc3e
jmp 0xfc3e
movq %rax, %rbx
jmp 0xfc4b
jmp 0xfc3e
jmp 0xfc3e
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xb29c
leaq 0xb0(%rsp), %rdi
callq 0xb0be
movq %rbx, %rdi
callq 0x66e0