// File: /workspace/github_cpp_makefile_star2_O1/j-faria[P]kima/examples/trends/../../DNest4/code/SamplerImpl.h
// Function: DNest4::Sampler<RVmodel>::save_particle()
void Sampler<ModelType>::save_particle()
{
	++count_saves;
    count_mcmc_steps_since_save = 0;

	if(!save_to_disk)
		return;

	if(count_saves % thin_print == 0)
		std::cout<<"# Saving particle to disk. N = "<<count_saves<<"."<<std::endl;

	// Output file
	std::fstream fout;

	int which = rngs[0].rand_int(particles.size());
	fout.open(options.sample_file, std::ios::out|std::ios::app);
	particles[which].print(fout);
	fout<<std::endl;
	fout.close();

	fout.open(options.sample_info_file, std::ios::out|std::ios::app);
	fout<<std::setprecision(12);

	fout<<level_assignments[which]<<' ';
	fout<<log_likelihoods[which].get_value()<<' ';
	fout<<log_likelihoods[which].get_tiebreaker()<<' ';
	fout<<which<<std::endl;
	fout.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movl 0x690(%rdi), %eax
incl %eax
movl %eax, 0x690(%rdi)
movl $0x0, 0x694(%rdi)
cmpb $0x1, (%rdi)
jne 0x3a130
movq %rdi, %rbx
xorl %edx, %edx
divl 0x4(%rdi)
testl %edx, %edx
jne 0x39fab
movq 0x1904d(%rip), %r14     # 0x52f98
leaq 0xd77b(%rip), %rsi      # 0x476cd
movl $0x1f, %edx
movq %r14, %rdi
callq 0x64a0
movl 0x690(%rbx), %esi
movq %r14, %rdi
callq 0x62f0
movq %rax, %r14
leaq 0xdef8(%rip), %rsi      # 0x47e6f
movl $0x1, %edx
movq %rax, %rdi
callq 0x64a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6430
movsbl %al, %esi
movq %r14, %rdi
callq 0x6030
movq %rax, %rdi
callq 0x6300
leaq 0x8(%rsp), %rdi
callq 0x64c0
movq 0x678(%rbx), %rdi
movq 0xd0(%rbx), %rax
subq 0xc8(%rbx), %rax
shrq $0x4, %rax
imull $0x781948b1, %eax, %esi # imm = 0x781948B1
callq 0x3c1d6
movl %eax, %ebp
leaq 0x68(%rbx), %rsi
leaq 0x8(%rsp), %rdi
movl $0x11, %edx
callq 0x6560
movslq %ebp, %r15
imulq $0x510, %r15, %rdi      # imm = 0x510
addq 0xc8(%rbx), %rdi
leaq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0x11f28
movq 0x18(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6430
movsbl %al, %esi
movq %r14, %rdi
callq 0x6030
movq %rax, %rdi
callq 0x6300
leaq 0x8(%rsp), %rdi
callq 0x6060
leaq 0x88(%rbx), %rsi
leaq 0x8(%rsp), %rdi
movl $0x11, %edx
callq 0x6560
movq 0x18(%rsp), %rax
movq -0x18(%rax), %rax
movq $0xc, 0x20(%rsp,%rax)
movq 0xf8(%rbx), %rax
movl (%rax,%r15,4), %esi
movq %r14, %rdi
callq 0x62f0
leaq 0x7(%rsp), %rsi
movb $0x20, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x64a0
movq 0xe0(%rbx), %rax
shlq $0x4, %r15
movsd (%rax,%r15), %xmm0
movq %r14, %rdi
callq 0x6630
leaq 0x7(%rsp), %rsi
movb $0x20, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x64a0
movq 0xe0(%rbx), %rax
movsd 0x8(%rax,%r15), %xmm0
movq %r14, %rdi
callq 0x6630
leaq 0x7(%rsp), %rsi
movb $0x20, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x64a0
movq %r14, %rdi
movl %ebp, %esi
callq 0x66e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x6430
movsbl %al, %esi
movq %rbx, %rdi
callq 0x6030
movq %rax, %rdi
callq 0x6300
leaq 0x8(%rsp), %rdi
callq 0x6060
leaq 0x8(%rsp), %rdi
callq 0x60c0
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x60c0
movq %rbx, %rdi
callq 0x6710