// File: /workspace/github_cpp_makefile_star2_O3/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 0x335e2
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 0xbf78
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 0xbf78
leaq 0xa8(%rbx), %rdi
leaq 0xb8(%rbx), %rax
movq %rax, 0xa8(%rbx)
movq 0x70(%r14), %rsi
movq 0x78(%r14), %rdx
addq %rsi, %rdx
callq 0xbf78
leaq 0xc8(%rbx), %rdi
movl (%r14), %esi
imull %r13d, %esi
leaq 0x20(%rsp), %rdx
movq %rdi, 0x8(%rsp)
callq 0x33710
leaq 0xe0(%rbx), %rdi
movl (%r14), %esi
imull %r13d, %esi
leaq 0x20(%rsp), %rdx
movq %rdi, 0x10(%rsp)
callq 0x337a4
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 0x33832
leaq 0x110(%rbx), %rdi
movq %rdi, 0x18(%rsp)
movq %r15, 0x70(%rsp)
callq 0x200e0
leaq 0x620(%rbx), %r12
movq %r12, %rdi
callq 0x38fcc
leaq 0x80(%rsp), %rdi
callq 0x38fcc
leaq 0x20(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x38c46
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, %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 0x339ae
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 0x33a46
leaq 0x6a0(%rbx), %rdi
xorpd %xmm0, %xmm0
movupd %xmm0, 0x690(%rbx)
leaq 0x20(%rsp), %rdx
movq %rdi, 0x58(%rsp)
movq %rbp, %rsi
callq 0x33ada
testl %r13d, %r13d
movapd 0x90(%rsp), %xmm0
je 0x33180
ucomisd 0x9f4f(%rip), %xmm0     # 0x3d030
movq 0x10(%rsp), %r13
jbe 0x3319f
cmpl $0x0, 0x10(%r14)
jne 0x33111
addsd 0xf735(%rip), %xmm0     # 0x42830
andpd 0xa05d(%rip), %xmm0     # 0x3d160
ucomisd 0xf72d(%rip), %xmm0     # 0x42838
ja 0x331be
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movq 0x8(%rsp), %r14
callq 0x33b58
movq 0x28(%rsp), %rax
imulq $0x510, -0x8(%rax), %rsi # imm = 0x510
addq (%r14), %rsi
movq 0x18(%rsp), %rdi
callq 0x33c8c
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 0x3316e
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 0x1174d(%rip), %rdi     # 0x448d4
leaq 0x11757(%rip), %rsi     # 0x448e5
leaq 0x11770(%rip), %rcx     # 0x44905
movl $0x23, %edx
callq 0x62b0
leaq 0x117c4(%rip), %rdi     # 0x4496a
leaq 0x11738(%rip), %rsi     # 0x448e5
leaq 0x11751(%rip), %rcx     # 0x44905
movl $0x24, %edx
callq 0x62b0
movq 0x1ce23(%rip), %rdi     # 0x4ffe8
leaq 0x117af(%rip), %rsi     # 0x4497b
movl $0x34, %edx
callq 0x64a0
movq 0x1ce0b(%rip), %rdi     # 0x4ffe8
callq 0x61c0
xorl %edi, %edi
callq 0x64e0
jmp 0x33207
movq %rax, %r14
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x3320a
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x6460
jmp 0x3320a
movq %rax, %r14
movq 0x58(%rsp), %rdi
callq 0x20afc
jmp 0x33219
movq %rax, %r14
movq 0x60(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x3323a
movq 0x688(%rbx), %rsi
subq %rdi, %rsi
callq 0x6460
jmp 0x3323a
movq %rax, %r14
leaq 0x660(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x33258
movq 0x670(%rbx), %rsi
subq %rdi, %rsi
callq 0x6460
movq 0x68(%rsp), %rdi
callq 0x20b50
movq (%r15), %rdi
testq %rdi, %rdi
je 0x332e3
movq 0x640(%rbx), %rsi
subq %rdi, %rsi
callq 0x6460
jmp 0x332e3
movq %rax, %r14
jmp 0x33262
jmp 0x332e0
jmp 0x332e0
movq %rax, %r14
jmp 0x332ed
movq %rax, %r14
jmp 0x33309
movq %rax, %r14
jmp 0x33325
movq %rax, %r14
jmp 0x3332f
movq %rax, %r14
movq (%r12), %rdi
cmpq %r15, %rdi
je 0x332ba
movq (%r15), %rsi
incq %rsi
callq 0x6460
jmp 0x332ba
movq %rax, %r14
movq 0x10(%rsp), %rax
movq (%rax), %rdi
cmpq 0x8(%rsp), %rdi
je 0x33338
movq 0x8(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x6460
jmp 0x33338
movq %rax, %r14
jmp 0x33338
movq %rax, %r14
movq 0x18(%rsp), %rdi
callq 0x20ba4
movq 0x70(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x33309
movq 0x108(%rbx), %rsi
subq %rdi, %rsi
callq 0x6460
movq 0x10(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x33325
movq 0xf0(%rbx), %rsi
subq %rdi, %rsi
callq 0x6460
movq 0x8(%rsp), %rdi
callq 0x20e1a
leaq 0x38(%rbx), %rdi
callq 0x20e64
movq 0x78(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x33351
movq 0x18(%rbx), %rsi
subq %rdi, %rsi
callq 0x6460
movq %r14, %rdi
callq 0x6710
nop