// File: j-faria[P]kima/src/RVConditionalPrior.cpp
// Function: RVConditionalPrior::RVConditionalPrior()
RVConditionalPrior::RVConditionalPrior()
{
    if (hyperpriors){
        if (!log_muP_prior)
            /** 
             * By default, Cauchy prior centered on log(365 days), scale=1
             * for log(muP), with muP in days
             * truncated to (~-15.1, ~26.9)
            */
            log_muP_prior = make_shared<TruncatedCauchy>(log(365), 1., log(365)-21, log(365)+21);
        // TruncatedCauchy *log_muP_prior = new TruncatedCauchy(log(365), 1., log(365)-21, log(365)+21);

        /**
         * By default, uniform prior for wP
        */
        if (!wP_prior)
            wP_prior = make_shared<Uniform>(0.1, 3);
        // Uniform *wP_prior = new Uniform(0.1, 3.);
    

        /**
         * By default, Cauchy prior centered on log(1), scale=1
         * for log(muK), with muK in m/s
         * truncated to (-21, 21)
         * NOTE: we actually sample on muK itself, just the prior is for log(muK)
        */
        if (!log_muK_prior)
            log_muK_prior = make_shared<TruncatedCauchy>(0., 1., 0.-21, 0.+21);
        // TruncatedCauchy *log_muK_prior = new TruncatedCauchy(0., 1., 0.-21, 0.+21);

        Pprior = make_shared<Laplace>();
        Kprior = make_shared<Exponential>();
    }
    else {
        if (!Pprior)
            Pprior = make_shared<LogUniform>(1., 1e5);
        if (!Kprior)
            Kprior = make_shared<ModifiedLogUniform>(1., 1e3);
    }


    if (!eprior)
        eprior = make_shared<Uniform>(0, 1);
    if (!phiprior)
        phiprior = make_shared<Uniform>(0, 2*M_PI);
    if (!wprior)
        wprior = make_shared<Uniform>(0, 2*M_PI);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0xb6420
movq -0x160(%rbp), %rdi
leaq 0x10e393(%rip), %rax    # 0x119480
addq $0x10, %rax
movq %rax, (%rdi)
addq $0x20, %rdi
movq %rdi, -0x198(%rbp)
callq 0xc030
movq -0x160(%rbp), %rdi
addq $0x30, %rdi
movq %rdi, -0x190(%rbp)
callq 0xc030
movq -0x160(%rbp), %rdi
addq $0x40, %rdi
movq %rdi, -0x188(%rbp)
callq 0xc030
movq -0x160(%rbp), %rdi
addq $0x50, %rdi
movq %rdi, -0x180(%rbp)
callq 0xc030
movq -0x160(%rbp), %rdi
addq $0x60, %rdi
movq %rdi, -0x178(%rbp)
callq 0xc030
movq -0x160(%rbp), %rdi
addq $0x70, %rdi
movq %rdi, -0x170(%rbp)
callq 0xc030
movq -0x160(%rbp), %rdi
addq $0x80, %rdi
movq %rdi, -0x168(%rbp)
callq 0xc030
movq -0x160(%rbp), %rdi
addq $0x90, %rdi
movq %rdi, -0x158(%rbp)
callq 0xc030
leaq 0xba7f0(%rip), %rax     # 0xc59a2
testb $0x1, (%rax)
je 0xb476
movq -0x160(%rbp), %rdi
addq $0x70, %rdi
callq 0xc050
testb $0x1, %al
jne 0xb313
movl $0x16d, %edi            # imm = 0x16D
callq 0xc100
movsd %xmm0, -0x1a0(%rbp)
jmp 0xb1e7
movsd -0x1a0(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x38(%rbp)
movl $0x16d, %edi            # imm = 0x16D
callq 0xc100
movsd %xmm0, -0x1a8(%rbp)
jmp 0xb216
movsd -0x1a8(%rbp), %xmm0
movsd 0xabfb2(%rip), %xmm1    # 0xb71d8
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movl $0x16d, %edi            # imm = 0x16D
callq 0xc100
movsd %xmm0, -0x1b0(%rbp)
jmp 0xb243
movsd -0x1b0(%rbp), %xmm0
movsd 0xabf8d(%rip), %xmm1    # 0xb71e0
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x38(%rbp), %rdx
leaq -0x40(%rbp), %rcx
leaq -0x48(%rbp), %r8
callq 0xc070
jmp 0xb277
movq -0x160(%rbp), %rdi
addq $0x70, %rdi
leaq -0x18(%rbp), %rsi
callq 0xc120
leaq -0x18(%rbp), %rdi
callq 0xc150
jmp 0xb313
movq -0x158(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0xc660
movq -0x168(%rbp), %rdi
callq 0xc660
movq -0x170(%rbp), %rdi
callq 0xc660
movq -0x178(%rbp), %rdi
callq 0xc660
movq -0x180(%rbp), %rdi
callq 0xc660
movq -0x188(%rbp), %rdi
callq 0xc660
movq -0x190(%rbp), %rdi
callq 0xc660
movq -0x198(%rbp), %rdi
callq 0xc660
movq -0x160(%rbp), %rdi
callq 0xb6440
jmp 0xb6ae
movq -0x160(%rbp), %rdi
addq $0x80, %rdi
callq 0xc050
testb $0x1, %al
jne 0xb372
movabsq $0x3fb999999999999a, %rax # imm = 0x3FB999999999999A
movq %rax, -0x60(%rbp)
movl $0x3, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x64(%rbp), %rdx
callq 0xc170
jmp 0xb352
movq -0x160(%rbp), %rdi
addq $0x80, %rdi
leaq -0x58(%rbp), %rsi
callq 0xc1f0
leaq -0x58(%rbp), %rdi
callq 0xc220
movq -0x160(%rbp), %rdi
addq $0x90, %rdi
callq 0xc050
testb $0x1, %al
jne 0xb408
movq $0x0, -0x80(%rbp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x88(%rbp)
movabsq $-0x3fcb000000000000, %rax # imm = 0xC035000000000000
movq %rax, -0x90(%rbp)
movabsq $0x4035000000000000, %rax # imm = 0x4035000000000000
movq %rax, -0x98(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x80(%rbp), %rsi
leaq -0x88(%rbp), %rdx
leaq -0x90(%rbp), %rcx
leaq -0x98(%rbp), %r8
callq 0xc070
jmp 0xb3e8
movq -0x160(%rbp), %rdi
addq $0x90, %rdi
leaq -0x78(%rbp), %rsi
callq 0xc120
leaq -0x78(%rbp), %rdi
callq 0xc150
leaq -0xa8(%rbp), %rdi
callq 0xc240
jmp 0xb416
movq -0x160(%rbp), %rdi
addq $0x20, %rdi
leaq -0xa8(%rbp), %rsi
movq %rsi, -0x1b8(%rbp)
callq 0xc2b0
movq -0x1b8(%rbp), %rdi
callq 0xc2e0
leaq -0xb8(%rbp), %rdi
callq 0xc300
jmp 0xb44e
movq -0x160(%rbp), %rdi
addq $0x30, %rdi
leaq -0xb8(%rbp), %rsi
callq 0xc370
leaq -0xb8(%rbp), %rdi
callq 0xc3a0
jmp 0xb562
movq -0x160(%rbp), %rdi
addq $0x20, %rdi
callq 0xc050
testb $0x1, %al
jne 0xb4eb
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0xd0(%rbp)
movabsq $0x40f86a0000000000, %rax # imm = 0x40F86A0000000000
movq %rax, -0xd8(%rbp)
leaq -0xc8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
leaq -0xd8(%rbp), %rdx
callq 0xc3c0
jmp 0xb4c8
movq -0x160(%rbp), %rdi
addq $0x20, %rdi
leaq -0xc8(%rbp), %rsi
callq 0xc440
leaq -0xc8(%rbp), %rdi
callq 0xc470
movq -0x160(%rbp), %rdi
addq $0x30, %rdi
callq 0xc050
testb $0x1, %al
jne 0xb560
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0xf0(%rbp)
movabsq $0x408f400000000000, %rax # imm = 0x408F400000000000
movq %rax, -0xf8(%rbp)
leaq -0xe8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
leaq -0xf8(%rbp), %rdx
callq 0xc490
jmp 0xb53d
movq -0x160(%rbp), %rdi
addq $0x30, %rdi
leaq -0xe8(%rbp), %rsi
callq 0xc510
leaq -0xe8(%rbp), %rdi
callq 0xc540
jmp 0xb562
movq -0x160(%rbp), %rdi
addq $0x40, %rdi
callq 0xc050
testb $0x1, %al
jne 0xb5c9
movl $0x0, -0x10c(%rbp)
movl $0x1, -0x110(%rbp)
leaq -0x108(%rbp), %rdi
leaq -0x10c(%rbp), %rsi
leaq -0x110(%rbp), %rdx
callq 0xc560
jmp 0xb5a6
movq -0x160(%rbp), %rdi
addq $0x40, %rdi
leaq -0x108(%rbp), %rsi
callq 0xc1f0
leaq -0x108(%rbp), %rdi
callq 0xc220
movq -0x160(%rbp), %rdi
addq $0x50, %rdi
callq 0xc050
testb $0x1, %al
jne 0xb637
movl $0x0, -0x124(%rbp)
movabsq $0x401921fb54442d18, %rax # imm = 0x401921FB54442D18
movq %rax, -0x130(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x124(%rbp), %rsi
leaq -0x130(%rbp), %rdx
callq 0xc5e0
jmp 0xb614
movq -0x160(%rbp), %rdi
addq $0x50, %rdi
leaq -0x120(%rbp), %rsi
callq 0xc1f0
leaq -0x120(%rbp), %rdi
callq 0xc220
movq -0x160(%rbp), %rdi
addq $0x60, %rdi
callq 0xc050
testb $0x1, %al
jne 0xb6a5
movl $0x0, -0x144(%rbp)
movabsq $0x401921fb54442d18, %rax # imm = 0x401921FB54442D18
movq %rax, -0x150(%rbp)
leaq -0x140(%rbp), %rdi
leaq -0x144(%rbp), %rsi
leaq -0x150(%rbp), %rdx
callq 0xc5e0
jmp 0xb682
movq -0x160(%rbp), %rdi
addq $0x60, %rdi
leaq -0x140(%rbp), %rsi
callq 0xc1f0
leaq -0x140(%rbp), %rdi
callq 0xc220
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x6830
nopw (%rax,%rax)