// File: j-faria[P]kima/src/RVmodel.cpp
// Function: RVmodel::log_likelihood() const
double RVmodel::log_likelihood() const
{
    auto data = Data::get_instance();
    int N = data.N();
    auto y = data.get_y();
    auto sig = data.get_sig();
    auto obsi = data.get_obsi();

    double logL = 0.;

    #if TIMING
    auto begin = std::chrono::high_resolution_clock::now();  // start timing
    #endif

    if(GP)
    {
        /** The following code calculates the log likelihood in the case of a GP model */
        // residual vector (observed y minus model y)
        VectorXd residual(y.size());
        for(size_t i=0; i<y.size(); i++)
            residual(i) = y[i] - mu[i];

        switch (kernel)
        {
            case standard:
            {
                // perform the cholesky decomposition of C
                Eigen::LLT<Eigen::MatrixXd> cholesky = C.llt();
                // get the lower triangular matrix L
                MatrixXd L = cholesky.matrixL();

                double logDeterminant = 0.;
                for(size_t i=0; i<y.size(); i++)
                    logDeterminant += 2.*log(L(i,i));

                VectorXd solution = cholesky.solve(residual);

                // y*solution
                double exponent = 0.;
                for(size_t i=0; i<y.size(); i++)
                    exponent += residual(i)*solution(i);

                logL = -0.5*y.size()*log(2*M_PI)
                        - 0.5*logDeterminant - 0.5*exponent;

                break;
            }

            case celerite:
            {
                logL = -0.5 * (solver.dot_solve(residual) +
                    solver.log_determinant() +
                    y.size()*log(2*M_PI)); 
    
                break;
            }
        
            default:
                break;
        }

    }
    else
    {
        if (studentt){
            // The following code calculates the log likelihood 
            // in the case of a t-Student model
            double var, jit;
            for(size_t i=0; i<N; i++)
            {
                if(multi_instrument)
                {
                    jit = jitters[obsi[i]-1];
                    var = sig[i]*sig[i] + jit*jit;
                }
                else
                    var = sig[i]*sig[i] + extra_sigma*extra_sigma;

                logL += std::lgamma(0.5*(nu + 1.)) - std::lgamma(0.5*nu)
                        - 0.5*log(M_PI*nu) - 0.5*log(var)
                        - 0.5*(nu + 1.)*log(1. + pow(y[i] - mu[i], 2)/var/nu);
            }

        }

        else{
            // The following code calculates the log likelihood
            // in the case of a Gaussian likelihood
            double var, jit;
            for(size_t i=0; i<N; i++)
            {
                if(multi_instrument)
                {
                    jit = jitters[obsi[i]-1];
                    var = sig[i]*sig[i] + jit*jit;
                }
                else
                    var = sig[i]*sig[i] + extra_sigma*extra_sigma;

                logL += - halflog2pi - 0.5*log(var)
                        - 0.5*(pow(y[i] - mu[i], 2)/var);
            }
        }

    }

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

    if(std::isnan(logL) || std::isinf(logL))
    {
        logL = std::numeric_limits<double>::infinity();
    }
    return logL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x440, %rsp            # imm = 0x440
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x298(%rbp)
callq 0xab10
movq %rax, %rsi
leaq -0x110(%rbp), %rdi
movq %rdi, -0x290(%rbp)
callq 0x269d0
movq -0x290(%rbp), %rdi
callq 0x27200
movl %eax, -0x284(%rbp)
jmp 0x233f9
movl -0x284(%rbp), %eax
movl %eax, -0x114(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x27b10
movq %rax, -0x2a0(%rbp)
jmp 0x2341a
movq -0x2a0(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0x17c50
jmp 0x2342f
leaq -0x110(%rbp), %rdi
callq 0x271c0
movq %rax, -0x2a8(%rbp)
jmp 0x23444
movq -0x2a8(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0x17c50
jmp 0x23459
leaq -0x110(%rbp), %rdi
callq 0x271e0
movq %rax, -0x2b0(%rbp)
jmp 0x2346e
movq -0x2b0(%rbp), %rsi
leaq -0x170(%rbp), %rdi
callq 0x27d10
jmp 0x23483
xorps %xmm0, %xmm0
movsd %xmm0, -0x178(%rbp)
leaq 0xa250b(%rip), %rax     # 0xc59a0
testb $0x1, (%rax)
je 0x23a91
leaq -0x140(%rbp), %rdi
callq 0x7c90
movq %rax, -0x190(%rbp)
leaq -0x188(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x27570
jmp 0x234c6
movq $0x0, -0x198(%rbp)
movq -0x198(%rbp), %rax
movq %rax, -0x2b8(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x7c90
movq %rax, %rcx
movq -0x2b8(%rbp), %rax
cmpq %rcx, %rax
jae 0x2360c
movq -0x198(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0xc6a0
movq -0x298(%rbp), %rdi
fldl (%rax)
fstpt -0x2d4(%rbp)
addq $0x380, %rdi            # imm = 0x380
movq -0x198(%rbp), %rsi
callq 0x27e00
fldt -0x2d4(%rbp)
fldt (%rax)
fsubrp %st, %st(1)
fstpl -0x280(%rbp)
movsd -0x280(%rbp), %xmm0
movsd %xmm0, -0x2c8(%rbp)
movq -0x198(%rbp), %rsi
leaq -0x188(%rbp), %rdi
callq 0x275d0
movq %rax, -0x2c0(%rbp)
jmp 0x2356f
movq -0x2c0(%rbp), %rax
movsd -0x2c8(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x198(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x198(%rbp)
jmp 0x234d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x240ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x240e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x240d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x240c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x23a80
movq -0x298(%rbp), %rax
movl 0x1a8(%rax), %eax
movl %eax, -0x2d8(%rbp)
testl %eax, %eax
je 0x23639
jmp 0x23625
movl -0x2d8(%rbp), %eax
subl $0x1, %eax
je 0x23997
jmp 0x23a6d
movq -0x298(%rbp), %rsi
addq $0x398, %rsi            # imm = 0x398
leaq -0x1c0(%rbp), %rdi
callq 0x27e20
jmp 0x23655
leaq -0x1c0(%rbp), %rdi
callq 0x27e60
movq %rax, -0x2e0(%rbp)
jmp 0x2366a
movq -0x2e0(%rbp), %rax
movq %rax, -0x1e0(%rbp)
leaq -0x1d8(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x27ed0
jmp 0x2368d
xorps %xmm0, %xmm0
movsd %xmm0, -0x1e8(%rbp)
movq $0x0, -0x1f0(%rbp)
movq -0x1f0(%rbp), %rax
movq %rax, -0x2e8(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x7c90
movq %rax, %rcx
movq -0x2e8(%rbp), %rax
cmpq %rcx, %rax
jae 0x2375c
movq -0x1f0(%rbp), %rdx
leaq -0x1d8(%rbp), %rdi
movq %rdx, %rsi
callq 0x27220
movq %rax, -0x2f0(%rbp)
jmp 0x236ef
movq -0x2f0(%rbp), %rax
movsd (%rax), %xmm0
callq 0x6430
movsd -0x1e8(%rbp), %xmm1
addsd %xmm0, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x1e8(%rbp)
movq -0x1f0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1f0(%rbp)
jmp 0x236a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x23986
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x2397a
leaq -0x1c0(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x27f10
movq %rdx, -0x300(%rbp)
movq %rax, -0x2f8(%rbp)
jmp 0x2377f
movq -0x300(%rbp), %rax
movq -0x2f8(%rbp), %rcx
movq %rcx, -0x210(%rbp)
movq %rax, -0x208(%rbp)
leaq -0x200(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x27f70
jmp 0x237b0
xorps %xmm0, %xmm0
movsd %xmm0, -0x218(%rbp)
movq $0x0, -0x220(%rbp)
movq -0x220(%rbp), %rax
movq %rax, -0x308(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x7c90
movq %rax, %rcx
movq -0x308(%rbp), %rax
cmpq %rcx, %rax
jae 0x238a3
movq -0x220(%rbp), %rsi
leaq -0x188(%rbp), %rdi
callq 0x275d0
movq %rax, -0x310(%rbp)
jmp 0x2380f
movq -0x310(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x320(%rbp)
movq -0x220(%rbp), %rsi
leaq -0x200(%rbp), %rdi
callq 0x275d0
movq %rax, -0x318(%rbp)
jmp 0x2383e
movsd -0x320(%rbp), %xmm0
movq -0x318(%rbp), %rax
movsd (%rax), %xmm2
movsd -0x218(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x218(%rbp)
movq -0x220(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x220(%rbp)
jmp 0x237c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x278c0
jmp 0x2397a
leaq -0x140(%rbp), %rdi
callq 0x7c90
movq %rax, %xmm1
movaps 0x93755(%rip), %xmm0    # 0xb7010
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0x93759(%rip), %xmm0    # 0xb7020
subpd %xmm0, %xmm1
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm0, %xmm1
movsd 0x9375a(%rip), %xmm0    # 0xb7038
mulsd %xmm1, %xmm0
movsd %xmm0, -0x328(%rbp)
movsd 0x93866(%rip), %xmm0    # 0xb7158
callq 0x6430
movsd -0x328(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd 0x9388e(%rip), %xmm0    # 0xb7198
mulsd -0x1e8(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x218(%rbp), %xmm0
movsd 0x936f7(%rip), %xmm2    # 0xb7038
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x178(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x278c0
leaq -0x1d8(%rbp), %rdi
callq 0x27fb0
leaq -0x1c0(%rbp), %rdi
callq 0x27fd0
jmp 0x23a6f
leaq -0x1d8(%rbp), %rdi
callq 0x27fb0
leaq -0x1c0(%rbp), %rdi
callq 0x27fd0
jmp 0x23a80
movq -0x298(%rbp), %rdi
addq $0x220, %rdi            # imm = 0x220
leaq -0x188(%rbp), %rsi
callq 0x28000
movsd %xmm0, -0x330(%rbp)
jmp 0x239bb
movq -0x298(%rbp), %rdi
addq $0x220, %rdi            # imm = 0x220
callq 0x2af80
movsd %xmm0, -0x338(%rbp)
jmp 0x239d8
movsd -0x338(%rbp), %xmm1
movsd -0x330(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x340(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x7c90
movq %rax, %xmm0
movaps 0x93604(%rip), %xmm1    # 0xb7010
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x93608(%rip), %xmm1    # 0xb7020
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, -0x348(%rbp)
movsd 0x93721(%rip), %xmm0    # 0xb7158
callq 0x6430
movsd -0x348(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x340(%rbp), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x935d9(%rip), %xmm0    # 0xb7038
mulsd %xmm1, %xmm0
movsd %xmm0, -0x178(%rbp)
jmp 0x23a6f
jmp 0x23a6f
leaq -0x188(%rbp), %rdi
callq 0x278c0
jmp 0x24029
leaq -0x188(%rbp), %rdi
callq 0x278c0
jmp 0x240c9
leaq 0xa1f18(%rip), %rax     # 0xc59b0
testb $0x1, (%rax)
je 0x23df2
movq $0x0, -0x238(%rbp)
movq -0x238(%rbp), %rax
movslq -0x114(%rbp), %rcx
cmpq %rcx, %rax
jae 0x23ded
leaq 0xa1ede(%rip), %rax     # 0xc59a8
testb $0x1, (%rax)
je 0x23b7a
movq -0x298(%rbp), %rax
addq $0x140, %rax            # imm = 0x140
movq %rax, -0x358(%rbp)
movq -0x238(%rbp), %rsi
leaq -0x170(%rbp), %rdi
callq 0x16120
movq -0x358(%rbp), %rdi
movl (%rax), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0xa6a0
movsd (%rax), %xmm0
movsd %xmm0, -0x230(%rbp)
movq -0x238(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0xc6a0
movsd (%rax), %xmm0
movsd %xmm0, -0x350(%rbp)
movq -0x238(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0xc6a0
movsd -0x350(%rbp), %xmm0
movsd (%rax), %xmm2
movsd -0x230(%rbp), %xmm1
mulsd -0x230(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x228(%rbp)
jmp 0x23be2
movq -0x238(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0xc6a0
movsd (%rax), %xmm0
movsd %xmm0, -0x360(%rbp)
movq -0x238(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0xc6a0
movsd -0x360(%rbp), %xmm0
movq %rax, %rcx
movq -0x298(%rbp), %rax
movsd (%rcx), %xmm2
movsd 0x198(%rax), %xmm1
mulsd 0x198(%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x228(%rbp)
movq -0x298(%rbp), %rax
movsd 0x1a0(%rax), %xmm0
movsd 0x93437(%rip), %xmm1    # 0xb7030
movsd %xmm1, -0x3a0(%rbp)
addsd %xmm1, %xmm0
movsd 0x9358b(%rip), %xmm1    # 0xb7198
movsd %xmm1, -0x398(%rbp)
mulsd %xmm1, %xmm0
callq 0x63f0
movsd -0x398(%rbp), %xmm1
movq -0x298(%rbp), %rax
movsd %xmm0, -0x3c0(%rbp)
movsd 0x1a0(%rax), %xmm0
mulsd %xmm1, %xmm0
callq 0x63f0
movq -0x298(%rbp), %rax
movaps %xmm0, %xmm1
movsd -0x3c0(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x3b8(%rbp)
movsd 0x1a0(%rax), %xmm0
movsd 0x93a4c(%rip), %xmm1    # 0xb76c0
mulsd %xmm1, %xmm0
callq 0x6430
movsd -0x3b8(%rbp), %xmm1
movsd 0x933ab(%rip), %xmm2    # 0xb7038
movsd %xmm2, -0x3b0(%rbp)
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x3a8(%rbp)
movsd -0x228(%rbp), %xmm0
callq 0x6430
movsd -0x3b0(%rbp), %xmm4
movsd -0x3a8(%rbp), %xmm3
movsd -0x3a0(%rbp), %xmm2
movsd -0x398(%rbp), %xmm1
movq -0x298(%rbp), %rax
mulsd %xmm4, %xmm0
addsd %xmm3, %xmm0
movsd %xmm0, -0x268(%rbp)
fldl -0x268(%rbp)
fstpt -0x390(%rbp)
movsd 0x1a0(%rax), %xmm0
addsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x270(%rbp)
fldl -0x270(%rbp)
fstpt -0x384(%rbp)
movq -0x238(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0xc6a0
movq -0x298(%rbp), %rdi
fldl (%rax)
fstpt -0x378(%rbp)
addq $0x380, %rdi            # imm = 0x380
movq -0x238(%rbp), %rsi
callq 0x27e00
fldt -0x378(%rbp)
fldt (%rax)
fsubrp %st, %st(1)
movq %rsp, %rax
fstpt (%rax)
movl $0x2, %edi
callq 0x2b020
fstpt -0x36c(%rbp)
jmp 0x23d6f
movq -0x298(%rbp), %rax
fldt -0x36c(%rbp)
fldl -0x228(%rbp)
fdivrp %st, %st(1)
fldl 0x1a0(%rax)
fdivrp %st, %st(1)
fld1
faddp %st, %st(1)
movq %rsp, %rax
fstpt (%rax)
callq 0x2aff0
fstpt -0x3cc(%rbp)
jmp 0x23da2
fldt -0x390(%rbp)
fldt -0x384(%rbp)
fldt -0x3cc(%rbp)
fmulp %st, %st(1)
fsubrp %st, %st(1)
fldl -0x178(%rbp)
faddp %st, %st(1)
fstpl -0x278(%rbp)
movsd -0x278(%rbp), %xmm0
movsd %xmm0, -0x178(%rbp)
movq -0x238(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x238(%rbp)
jmp 0x23aac
jmp 0x24027
movq $0x0, -0x250(%rbp)
movq -0x250(%rbp), %rax
movslq -0x114(%rbp), %rcx
cmpq %rcx, %rax
jae 0x24025
leaq 0xa1b8d(%rip), %rax     # 0xc59a8
testb $0x1, (%rax)
je 0x23ecb
movq -0x298(%rbp), %rax
addq $0x140, %rax            # imm = 0x140
movq %rax, -0x3e0(%rbp)
movq -0x250(%rbp), %rsi
leaq -0x170(%rbp), %rdi
callq 0x16120
movq -0x3e0(%rbp), %rdi
movl (%rax), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0xa6a0
movsd (%rax), %xmm0
movsd %xmm0, -0x248(%rbp)
movq -0x250(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0xc6a0
movsd (%rax), %xmm0
movsd %xmm0, -0x3d8(%rbp)
movq -0x250(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0xc6a0
movsd -0x3d8(%rbp), %xmm0
movsd (%rax), %xmm2
movsd -0x248(%rbp), %xmm1
mulsd -0x248(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x240(%rbp)
jmp 0x23f33
movq -0x250(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0xc6a0
movsd (%rax), %xmm0
movsd %xmm0, -0x3e8(%rbp)
movq -0x250(%rbp), %rsi
leaq -0x158(%rbp), %rdi
callq 0xc6a0
movsd -0x3e8(%rbp), %xmm0
movq %rax, %rcx
movq -0x298(%rbp), %rax
movsd (%rcx), %xmm2
movsd 0x198(%rax), %xmm1
mulsd 0x198(%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x240(%rbp)
movsd 0xf6845(%rip), %xmm0    # 0x11a780
movsd %xmm0, -0x418(%rbp)
movsd -0x240(%rbp), %xmm0
callq 0x6430
movsd -0x418(%rbp), %xmm1
movsd 0x930d8(%rip), %xmm2    # 0xb7038
mulsd %xmm2, %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x258(%rbp)
fldl -0x258(%rbp)
fstpt -0x40c(%rbp)
movq -0x250(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0xc6a0
movq -0x298(%rbp), %rdi
fldl (%rax)
fstpt -0x400(%rbp)
addq $0x380, %rdi            # imm = 0x380
movq -0x250(%rbp), %rsi
callq 0x27e00
fldt -0x400(%rbp)
fldt (%rax)
fsubrp %st, %st(1)
movq %rsp, %rax
fstpt (%rax)
movl $0x2, %edi
callq 0x2b020
fstpt -0x3f4(%rbp)
jmp 0x23fd2
fldt -0x40c(%rbp)
fldt -0x3f4(%rbp)
fldl -0x240(%rbp)
fdivrp %st, %st(1)
flds 0x93764(%rip)           # 0xb7750
fmulp %st, %st(1)
faddp %st, %st(1)
fldl -0x178(%rbp)
faddp %st, %st(1)
fstpl -0x260(%rbp)
movsd -0x260(%rbp), %xmm0
movsd %xmm0, -0x178(%rbp)
movq -0x250(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x250(%rbp)
jmp 0x23dfd
jmp 0x24027
jmp 0x24029
movsd -0x178(%rbp), %xmm0
callq 0x2b060
movb %al, -0x419(%rbp)
jmp 0x2403e
movb -0x419(%rbp), %al
testb $0x1, %al
jne 0x2406b
jmp 0x2404a
movsd -0x178(%rbp), %xmm0
callq 0x2b080
movb %al, -0x41a(%rbp)
jmp 0x2405f
movb -0x41a(%rbp), %al
testb $0x1, %al
jne 0x2406b
jmp 0x24078
callq 0xa860
movsd %xmm0, -0x178(%rbp)
movsd -0x178(%rbp), %xmm0
movsd %xmm0, -0x428(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x16260
leaq -0x158(%rbp), %rdi
callq 0x78f0
leaq -0x140(%rbp), %rdi
callq 0x78f0
leaq -0x110(%rbp), %rdi
callq 0x155c0
movsd -0x428(%rbp), %xmm0
addq $0x440, %rsp            # imm = 0x440
popq %rbp
retq
leaq -0x170(%rbp), %rdi
callq 0x16260
leaq -0x158(%rbp), %rdi
callq 0x78f0
leaq -0x140(%rbp), %rdi
callq 0x78f0
leaq -0x110(%rbp), %rdi
callq 0x155c0
movq -0x120(%rbp), %rdi
callq 0x6830
nopw %cs:(%rax,%rax)