// File: /workspace/github_cpp_makefile_star2_O1/j-faria[P]kima/examples/trends/../../DNest4/code/SamplerImpl.h
// Function: DNest4::Sampler<RVmodel>::Sampler(unsigned int, double, DNest4::Options const&, bool)
Sampler<ModelType>::Sampler(unsigned int num_threads, double compression,
							const Options& options, bool save_to_disk)
:save_to_disk(save_to_disk)
,thin_print(1)
,threads(num_threads, nullptr)
,barrier(nullptr)
,num_threads(num_threads)
,compression(compression)
,options(options)
,particles(options.num_particles*num_threads)
,log_likelihoods(options.num_particles*num_threads)
,level_assignments(options.num_particles*num_threads, 0)
,levels(1, LikelihoodType())
,copies_of_levels(num_threads, levels)
,all_above()
,rngs(num_threads)
,count_saves(0)
,count_mcmc_steps_since_save(0)
,count_mcmc_steps(0)
,above(num_threads)
{
	assert(num_threads >= 1);
	assert(compression > 1.);

    if(options.max_num_levels == 0 && std::abs(compression - exp(1.0)) > 1E-6)
    {
        std::cerr<<"# ERROR: Cannot use -c with max_num_levels=0 (AUTO).";
        std::cerr<<std::endl;
        exit(0);
    }

    // Find best ever particle
    auto indices = argsort(log_likelihoods);
    best_ever_particle = particles[indices.back()];
    best_ever_log_likelihood = log_likelihoods[indices.back()];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %r14
movaps %xmm0, 0x90(%rsp)
movl %esi, %r13d
movq %rdi, %rbx
movb %cl, (%rdi)
movl $0x1, 0x4(%rdi)
addq $0x8, %rdi
movl %esi, %ebp
xorl %r15d, %r15d
leaq 0x20(%rsp), %rdx
movq %r15, (%rdx)
leaq 0x80(%rsp), %rcx
movq %rdi, 0x78(%rsp)
movq %rbp, %rsi
callq 0x35d9c
movq %r15, 0x20(%rbx)
movl %r13d, 0x28(%rbx)
movaps 0x90(%rsp), %xmm0
movsd %xmm0, 0x30(%rbx)
movupd (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x1c(%r14), %xmm2
movupd %xmm0, 0x38(%rbx)
movups %xmm1, 0x48(%rbx)
movups %xmm2, 0x54(%rbx)
leaq 0x68(%rbx), %rdi
leaq 0x78(%rbx), %rax
movq %rax, 0x8(%rsp)
movq %rax, 0x68(%rbx)
movq 0x30(%r14), %rsi
movq 0x38(%r14), %rdx
addq %rsi, %rdx
movq %rdi, 0x10(%rsp)
callq 0xbeb6
leaq 0x88(%rbx), %r12
leaq 0x98(%rbx), %r15
movq %r15, 0x88(%rbx)
movq 0x50(%r14), %rsi
movq 0x58(%r14), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xbeb6
leaq 0xa8(%rbx), %rdi
leaq 0xb8(%rbx), %rax
movq %rax, 0xa8(%rbx)
movq 0x70(%r14), %rsi
movq 0x78(%r14), %rdx
addq %rsi, %rdx
callq 0xbeb6
leaq 0xc8(%rbx), %rdi
movl (%r14), %esi
imull %r13d, %esi
leaq 0x20(%rsp), %rdx
movq %rdi, 0x8(%rsp)
callq 0x35e1a
leaq 0xe0(%rbx), %rdi
movl (%r14), %esi
imull %r13d, %esi
leaq 0x20(%rsp), %rdx
movq %rdi, 0x10(%rsp)
callq 0x35eae
leaq 0xf8(%rbx), %r15
movl (%r14), %esi
imull %r13d, %esi
leaq 0x20(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x80(%rsp), %rcx
movq %r15, %rdi
callq 0x35f3c
leaq 0x110(%rbx), %rdi
movq %rdi, 0x18(%rsp)
movq %r15, 0x70(%rsp)
callq 0x20990
leaq 0x620(%rbx), %r12
movq %r12, %rdi
callq 0x3b570
leaq 0x80(%rsp), %rdi
callq 0x3b570
leaq 0x20(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x3b1e6
leaq 0x630(%rbx), %r15
xorpd %xmm0, %xmm0
movupd %xmm0, (%r15)
movq $0x0, 0x10(%r15)
movl $0x38, %edi
callq 0x6450
movq %rax, 0x630(%rbx)
movq %rax, 0x638(%rbx)
movq %rax, %rdx
addq $0x38, %rdx
movq %rdx, 0x640(%rbx)
leaq 0x20(%rsp), %rcx
movq 0x30(%rcx), %rsi
movq %rsi, 0x30(%rax)
movupd (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movupd %xmm0, (%rax)
movq %rdx, 0x638(%rbx)
leaq 0x648(%rbx), %rdi
movq %rdi, 0x68(%rsp)
movq %rbp, %rsi
movq %r15, %rdx
callq 0x35fba
leaq 0x678(%rbx), %rdi
xorpd %xmm0, %xmm0
movupd %xmm0, 0x660(%rbx)
movq $0x0, 0x670(%rbx)
leaq 0x20(%rsp), %rdx
movq %rdi, 0x60(%rsp)
movq %rbp, %rsi
callq 0x36052
leaq 0x6a0(%rbx), %rdi
xorpd %xmm0, %xmm0
movupd %xmm0, 0x690(%rbx)
leaq 0x20(%rsp), %rdx
movq %rdi, 0x58(%rsp)
movq %rbp, %rsi
callq 0x360e6
testl %r13d, %r13d
movapd 0x90(%rsp), %xmm0
je 0x3593b
ucomisd 0x9794(%rip), %xmm0     # 0x3f030
movq 0x10(%rsp), %r13
jbe 0x3595a
cmpl $0x0, 0x10(%r14)
jne 0x358cc
addsd 0xfa1a(%rip), %xmm0     # 0x452d0
andpd 0x98a2(%rip), %xmm0     # 0x3f160
ucomisd 0xfa12(%rip), %xmm0     # 0x452d8
ja 0x35979
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movq 0x8(%rsp), %r14
callq 0x3616e
movq 0x28(%rsp), %rax
imulq $0x510, -0x8(%rax), %rsi # imm = 0x510
addq (%r14), %rsi
movq 0x18(%rsp), %rdi
callq 0x3621c
movq 0x28(%rsp), %rax
movq -0x8(%rax), %rax
movq (%r13), %rcx
shlq $0x4, %rax
movups (%rcx,%rax), %xmm0
movups %xmm0, (%r12)
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x35929
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x6460
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x11ac2(%rip), %rdi     # 0x47404
leaq 0x11acc(%rip), %rsi     # 0x47415
leaq 0x11ae5(%rip), %rcx     # 0x47435
movl $0x23, %edx
callq 0x62b0
leaq 0x11b39(%rip), %rdi     # 0x4749a
leaq 0x11aad(%rip), %rsi     # 0x47415
leaq 0x11ac6(%rip), %rcx     # 0x47435
movl $0x24, %edx
callq 0x62b0
movq 0x1d668(%rip), %rdi     # 0x52fe8
leaq 0x11b24(%rip), %rsi     # 0x474ab
movl $0x34, %edx
callq 0x64a0
movq 0x1d650(%rip), %rdi     # 0x52fe8
callq 0x61c0
xorl %edi, %edi
callq 0x64e0
jmp 0x359c2
movq %rax, %r14
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x359c5
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x6460
jmp 0x359c5
movq %rax, %r14
movq 0x58(%rsp), %rdi
callq 0x213f2
jmp 0x359d4
movq %rax, %r14
movq 0x60(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x359f5
movq 0x688(%rbx), %rsi
subq %rdi, %rsi
callq 0x6460
jmp 0x359f5
movq %rax, %r14
leaq 0x660(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x35a13
movq 0x670(%rbx), %rsi
subq %rdi, %rsi
callq 0x6460
movq 0x68(%rsp), %rdi
callq 0x21440
movq (%r15), %rdi
testq %rdi, %rdi
je 0x35a9e
movq 0x640(%rbx), %rsi
subq %rdi, %rsi
callq 0x6460
jmp 0x35a9e
movq %rax, %r14
jmp 0x35a1d
jmp 0x35a9b
jmp 0x35a9b
movq %rax, %r14
jmp 0x35aa8
movq %rax, %r14
jmp 0x35ac4
movq %rax, %r14
jmp 0x35ae0
movq %rax, %r14
jmp 0x35aea
movq %rax, %r14
movq (%r12), %rdi
cmpq %r15, %rdi
je 0x35a75
movq (%r15), %rsi
incq %rsi
callq 0x6460
jmp 0x35a75
movq %rax, %r14
movq 0x10(%rsp), %rax
movq (%rax), %rdi
cmpq 0x8(%rsp), %rdi
je 0x35af3
movq 0x8(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x6460
jmp 0x35af3
movq %rax, %r14
jmp 0x35af3
movq %rax, %r14
movq 0x18(%rsp), %rdi
callq 0x2148e
movq 0x70(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x35ac4
movq 0x108(%rbx), %rsi
subq %rdi, %rsi
callq 0x6460
movq 0x10(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x35ae0
movq 0xf0(%rbx), %rsi
subq %rdi, %rsi
callq 0x6460
movq 0x8(%rsp), %rdi
callq 0x21704
leaq 0x38(%rbx), %rdi
callq 0x21748
movq 0x78(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x35b0c
movq 0x18(%rbx), %rsi
subq %rdi, %rsi
callq 0x6460
movq %r14, %rdi
callq 0x6710