// File: /workspace/github_cpp_makefile_star2_O2/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 $0xb8, %rsp
movq %rdx, %rbp
movaps %xmm0, 0xa0(%rsp)
movl %esi, %r15d
movq %rdi, %r13
movb %cl, (%rdi)
movl $0x1, 0x4(%rdi)
addq $0x8, %rdi
movl %esi, %ebx
leaq 0x68(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x58(%rsp), %rcx
movq %rdi, 0x50(%rsp)
movq %rbx, %rsi
callq 0x337e0
andq $0x0, 0x20(%r13)
movl %r15d, 0x28(%r13)
movapd 0xa0(%rsp), %xmm0
movsd %xmm0, 0x30(%r13)
leaq 0x38(%r13), %r12
movq %r12, %rdi
movq %rbp, %rsi
callq 0x33836
leaq 0xc8(%r13), %rdi
movl (%rbp), %esi
imull %r15d, %esi
leaq 0x68(%rsp), %rdx
movq %rdi, 0x20(%rsp)
movq %r12, 0x48(%rsp)
callq 0x338ba
leaq 0xe0(%r13), %rdi
movl (%rbp), %esi
imull %r15d, %esi
leaq 0x68(%rsp), %rdx
movq %rdi, 0x18(%rsp)
callq 0x3390c
leaq 0xf8(%r13), %rdi
movl (%rbp), %esi
imull %r15d, %esi
leaq 0x68(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x58(%rsp), %rcx
movq %rdi, 0x40(%rsp)
callq 0x3395e
leaq 0x110(%r13), %rdi
movq %rdi, 0x10(%rsp)
callq 0x20a2c
leaq 0x620(%r13), %r12
movq %r12, %rdi
callq 0x3839c
leaq 0x58(%rsp), %rdi
callq 0x3839c
leaq 0x68(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x3807c
leaq 0x630(%r13), %r14
pushq $0x1
popq %rsi
leaq 0x68(%rsp), %rdx
leaq 0xf(%rsp), %rcx
movq %r14, %rdi
callq 0x339b4
leaq 0x648(%r13), %rdi
leaq 0x68(%rsp), %rcx
movq %rdi, 0x30(%rsp)
movq %rbx, %rsi
movq %r14, 0x38(%rsp)
movq %r14, %rdx
callq 0x33a0a
leaq 0x678(%r13), %rdi
xorpd %xmm0, %xmm0
movupd %xmm0, 0x660(%r13)
andq $0x0, 0x670(%r13)
leaq 0x68(%rsp), %rdx
movq %rdi, 0x28(%rsp)
movq %rbx, %rsi
callq 0x33a60
leaq 0x6a0(%r13), %r14
xorpd %xmm0, %xmm0
movupd %xmm0, 0x690(%r13)
leaq 0x68(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x33ab2
testl %r15d, %r15d
movapd 0xa0(%rsp), %xmm0
je 0x334c5
ucomisd 0x8bfd(%rip), %xmm0     # 0x3c030
jbe 0x334de
cmpl $0x0, 0x10(%rbp)
jne 0x3345d
addsd 0x13b19(%rip), %xmm0    # 0x46f60
andpd 0x8d11(%rip), %xmm0     # 0x3c160
ucomisd 0x13b11(%rip), %xmm0    # 0x46f68
ja 0x334fb
leaq 0x68(%rsp), %rdi
movq 0x18(%rsp), %r15
movq %r15, %rsi
movq 0x20(%rsp), %rbx
movq 0x10(%rsp), %rbp
callq 0x33b03
movq 0x70(%rsp), %rax
imulq $0x510, -0x8(%rax), %rsi # imm = 0x510
addq (%rbx), %rsi
movq %rbp, %rdi
callq 0x33b6a
leaq 0x68(%rsp), %rdi
movq 0x8(%rdi), %rax
movq -0x8(%rax), %rax
movq (%r15), %rcx
shlq $0x4, %rax
movups (%rcx,%rax), %xmm0
movups %xmm0, (%r12)
callq 0x34592
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x182c5(%rip), %rdi     # 0x4b791
leaq 0x182cf(%rip), %rsi     # 0x4b7a2
leaq 0x182e8(%rip), %rcx     # 0x4b7c2
pushq $0x23
jmp 0x334f5
leaq 0x18342(%rip), %rdi     # 0x4b827
leaq 0x182b6(%rip), %rsi     # 0x4b7a2
leaq 0x182cf(%rip), %rcx     # 0x4b7c2
pushq $0x24
popq %rdx
callq 0x62b0
movq 0x30ae6(%rip), %rdi     # 0x63fe8
leaq 0x1832f(%rip), %rsi     # 0x4b838
callq 0x6430
movq 0x30ad3(%rip), %rdi     # 0x63fe8
callq 0x61c0
xorl %edi, %edi
callq 0x64b0
jmp 0x33532
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x34592
jmp 0x33535
movq %rax, %rbx
movq %r14, %rdi
callq 0x2134e
jmp 0x33542
movq %rax, %rbx
movq 0x28(%rsp), %rdi
callq 0x215b4
jmp 0x33551
movq %rax, %rbx
addq $0x660, %r13            # imm = 0x660
movq %r13, %rdi
callq 0x215f4
movq 0x30(%rsp), %rdi
callq 0x21370
movq 0x38(%rsp), %rdi
callq 0x2168a
jmp 0x3359b
movq %rax, %rbx
jmp 0x3356a
jmp 0x33598
jmp 0x33598
movq %rax, %rbx
jmp 0x335a5
movq %rax, %rbx
jmp 0x335af
movq %rax, %rbx
jmp 0x335b9
movq %rax, %rbx
jmp 0x335c3
movq %rax, %rbx
jmp 0x335cd
movq %rax, %rbx
movq 0x10(%rsp), %rdi
callq 0x21392
movq 0x40(%rsp), %rdi
callq 0x216c6
movq 0x18(%rsp), %rdi
callq 0x215f4
movq 0x20(%rsp), %rdi
callq 0x2150c
movq 0x48(%rsp), %rdi
callq 0x2152e
movq 0x50(%rsp), %rdi
callq 0x21762
movq %rbx, %rdi
callq 0x66e0
nop