// File: j-faria[P]kima/examples/trends/../../DNest4/code/SamplerImpl.h
// Function: DNest4::Sampler<RVmodel>::initialise(unsigned int)
void Sampler<ModelType>::initialise(unsigned int first_seed)
{
	// Reference to an RNG to use
	RNG& rng = rngs[0];

	// Assign memory for storage
	all_above.reserve(2*options.new_level_interval);
	for(auto& a: above)
		a.reserve(2*options.new_level_interval);

	std::cout<<"# Seeding random number generators. First seed = ";
	std::cout<<first_seed<<"."<<std::endl;
	// Seed the RNGs, incrementing the seed each time
	for(RNG& rng: rngs)
		rng.set_seed(first_seed++);

	std::cout<<"# Generating "<<particles.size();
	std::cout<<" particle"<<((particles.size() > 1)?("s"):(""));
	std::cout<<" from the prior..."<<std::flush;
	for(size_t i=0; i<particles.size(); ++i)
	{
		particles[i].from_prior(rng);
		log_likelihoods[i] = LikelihoodType(particles[i].log_likelihood(),
																rng.rand());
	}
	std::cout<<"done."<<std::endl;
	initialise_output_files();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x78(%rbp)
addq $0x678, %rdi            # imm = 0x678
xorl %eax, %eax
movl %eax, %esi
callq 0xa8770
movq %rax, %rcx
movq -0x78(%rbp), %rax
movq %rcx, -0x18(%rbp)
movq %rax, %rdi
addq $0x660, %rdi            # imm = 0x660
movl 0x3c(%rax), %eax
shll %eax
movl %eax, %eax
movl %eax, %esi
callq 0xa8790
movq -0x78(%rbp), %rax
addq $0x6a0, %rax            # imm = 0x6A0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xa8890
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0xa88c0
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xa88f0
testb $0x1, %al
jne 0xa13e8
jmp 0xa1419
leaq -0x28(%rbp), %rdi
callq 0xa8930
movq %rax, %rcx
movq -0x78(%rbp), %rax
movq %rcx, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movl 0x3c(%rax), %eax
shll %eax
movl %eax, %eax
movl %eax, %esi
callq 0xa8790
leaq -0x28(%rbp), %rdi
callq 0xa8950
jmp 0xa13d5
movq 0x78b78(%rip), %rdi     # 0x119f98
leaq 0x2a166(%rip), %rsi     # 0xcb58d
callq 0x64f0
movl -0xc(%rbp), %esi
movq 0x78b62(%rip), %rdi     # 0x119f98
callq 0x6650
movq %rax, %rdi
leaq 0x2ab72(%rip), %rsi     # 0xcbfb7
callq 0x64f0
movq %rax, %rdi
movq 0x78ac4(%rip), %rsi     # 0x119f18
callq 0x6530
movq -0x78(%rbp), %rax
addq $0x678, %rax            # imm = 0x678
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0xa8970
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
callq 0xa89a0
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xa89d0
testb $0x1, %al
jne 0xa1494
jmp 0xa14c0
leaq -0x48(%rbp), %rdi
callq 0xa8a10
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movl -0xc(%rbp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
callq 0xb26c0
leaq -0x48(%rbp), %rdi
callq 0xa8a30
jmp 0xa1481
movq 0x78ad1(%rip), %rdi     # 0x119f98
leaq 0x2a0f1(%rip), %rsi     # 0xcb5bf
callq 0x64f0
movq -0x78(%rbp), %rdi
movq %rax, -0x88(%rbp)
addq $0xc8, %rdi
callq 0xa8a50
movq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x6110
movq 0x78a98(%rip), %rdi     # 0x119f98
leaq 0x2a0c6(%rip), %rsi     # 0xcb5cd
callq 0x64f0
movq -0x78(%rbp), %rdi
movq %rax, -0x80(%rbp)
addq $0xc8, %rdi
callq 0xa8a50
movq -0x80(%rbp), %rdi
movq %rax, %rcx
leaq 0x16563(%rip), %rsi     # 0xb7a91
leaq 0x164b9(%rip), %rax     # 0xb79ee
cmpq $0x1, %rcx
cmovaq %rax, %rsi
callq 0x64f0
movq 0x78a4f(%rip), %rdi     # 0x119f98
leaq 0x2a087(%rip), %rsi     # 0xcb5d7
callq 0x64f0
movq %rax, %rdi
movq 0x78a49(%rip), %rsi     # 0x119fa8
callq 0x6530
movq $0x0, -0x60(%rbp)
movq -0x78(%rbp), %rdi
movq -0x60(%rbp), %rax
movq %rax, -0x90(%rbp)
addq $0xc8, %rdi
callq 0xa8a50
movq %rax, %rcx
movq -0x90(%rbp), %rax
cmpq %rcx, %rax
jae 0xa162f
movq -0x78(%rbp), %rdi
addq $0xc8, %rdi
movq -0x60(%rbp), %rsi
callq 0xa1e50
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x1cd70
movq -0x78(%rbp), %rdi
addq $0xc8, %rdi
movq -0x60(%rbp), %rsi
callq 0xa1e50
movq %rax, %rdi
callq 0x233b0
movsd %xmm0, -0x98(%rbp)
movq -0x18(%rbp), %rdi
callq 0xb26f0
movaps %xmm0, %xmm1
movsd -0x98(%rbp), %xmm0
leaq -0x70(%rbp), %rdi
callq 0xb1910
movq -0x78(%rbp), %rdi
addq $0xe0, %rdi
movq -0x60(%rbp), %rsi
callq 0xa2260
movq -0x70(%rbp), %rcx
movq %rcx, (%rax)
movq -0x68(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0xa156c
movq 0x78962(%rip), %rdi     # 0x119f98
leaq 0x29fad(%rip), %rsi     # 0xcb5ea
callq 0x64f0
movq %rax, %rdi
movq 0x788cc(%rip), %rsi     # 0x119f18
callq 0x6530
movq -0x78(%rbp), %rdi
callq 0xa8a80
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)