// File: j-faria[P]kima/DNest4/code/Options.cpp
// Function: DNest4::Options::load(char const*)
void Options::load(const char* filename)
{
	std::fstream fin(filename, std::ios::in);
	if(!fin)
	{
		std::cerr<<"ERROR: Cannot open file "<<filename<<"."<<std::endl;
		exit(0);
	}

	// Read past comment lines at the top of the file
	while(fin.peek() == '#')
		fin.ignore(1000000, '\n');

	fin>>num_particles;	fin.ignore(1000000, '\n');
	fin>>new_level_interval;	fin.ignore(1000000, '\n');
	fin>>save_interval;	fin.ignore(1000000, '\n');
	fin>>thread_steps;	fin.ignore(1000000, '\n');
	fin>>max_num_levels;	fin.ignore(1000000, '\n');
	fin>>lambda;		fin.ignore(1000000, '\n');
	fin>>beta;		fin.ignore(1000000, '\n');
	fin>>max_num_saves;		fin.ignore(1000000, '\n');
	fin>>sample_file;		fin.ignore(1000000, '\n');
	fin>>sample_info_file;	fin.ignore(1000000, '\n');
	fin>>levels_file;

	if (sample_file.compare("#") == 0) sample_file = "sample.txt";
	if (sample_info_file.compare("#") == 0) sample_info_file = "sample_info.txt";
	if (levels_file.compare("#") == 0) levels_file = "levels.txt";

	fin.close();

	assert(num_particles > 0 && new_level_interval > 0 &&
			thread_steps > 0 && max_num_levels > 0 && lambda > 0. &&
			beta >= 0.);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x238(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x220(%rbp), %rdi
movl $0x8, %edx
callq 0x6680
movq -0x220(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x220(%rbp,%rax), %rdi
callq 0x6230
movb %al, -0x22d(%rbp)
jmp 0xb1ee3
movb -0x22d(%rbp), %al
testb $0x1, %al
jne 0xb1ef2
jmp 0xb1f82
movq 0x680ef(%rip), %rdi     # 0x119fe8
leaq 0x19f03(%rip), %rsi     # 0xcbe03
callq 0x64f0
movq %rax, -0x240(%rbp)
jmp 0xb1f0e
movq -0x240(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x64f0
movq %rax, -0x248(%rbp)
jmp 0xb1f27
movq -0x248(%rbp), %rdi
leaq 0x1a082(%rip), %rsi     # 0xcbfb7
callq 0x64f0
movq %rax, -0x250(%rbp)
jmp 0xb1f43
movq -0x250(%rbp), %rdi
movq 0x67fc7(%rip), %rsi     # 0x119f18
callq 0x6530
jmp 0xb1f58
xorl %edi, %edi
callq 0x65d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x60f0
jmp 0xb233d
jmp 0xb1f84
leaq -0x220(%rbp), %rdi
callq 0x6190
movl %eax, -0x254(%rbp)
jmp 0xb1f98
movl -0x254(%rbp), %eax
cmpl $0x23, %eax
jne 0xb1fbd
leaq -0x220(%rbp), %rdi
movl $0xf4240, %esi          # imm = 0xF4240
movl $0xa, %edx
callq 0x6320
jmp 0xb1fbb
jmp 0xb1f84
movq -0x238(%rbp), %rsi
leaq -0x220(%rbp), %rdi
callq 0x6070
jmp 0xb1fd2
leaq -0x220(%rbp), %rdi
movl $0xf4240, %esi          # imm = 0xF4240
movl $0xa, %edx
callq 0x6320
jmp 0xb1fea
movq -0x238(%rbp), %rsi
addq $0x4, %rsi
leaq -0x220(%rbp), %rdi
callq 0x6070
jmp 0xb2003
leaq -0x220(%rbp), %rdi
movl $0xf4240, %esi          # imm = 0xF4240
movl $0xa, %edx
callq 0x6320
jmp 0xb201b
movq -0x238(%rbp), %rsi
addq $0x8, %rsi
leaq -0x220(%rbp), %rdi
callq 0x6070
jmp 0xb2034
leaq -0x220(%rbp), %rdi
movl $0xf4240, %esi          # imm = 0xF4240
movl $0xa, %edx
callq 0x6320
jmp 0xb204c
movq -0x238(%rbp), %rsi
addq $0xc, %rsi
leaq -0x220(%rbp), %rdi
callq 0x6070
jmp 0xb2065
leaq -0x220(%rbp), %rdi
movl $0xf4240, %esi          # imm = 0xF4240
movl $0xa, %edx
callq 0x6320
jmp 0xb207d
movq -0x238(%rbp), %rsi
addq $0x10, %rsi
leaq -0x220(%rbp), %rdi
callq 0x6070
jmp 0xb2096
leaq -0x220(%rbp), %rdi
movl $0xf4240, %esi          # imm = 0xF4240
movl $0xa, %edx
callq 0x6320
jmp 0xb20ae
movq -0x238(%rbp), %rsi
addq $0x18, %rsi
leaq -0x220(%rbp), %rdi
callq 0x6440
jmp 0xb20c7
leaq -0x220(%rbp), %rdi
movl $0xf4240, %esi          # imm = 0xF4240
movl $0xa, %edx
callq 0x6320
jmp 0xb20df
movq -0x238(%rbp), %rsi
addq $0x20, %rsi
leaq -0x220(%rbp), %rdi
callq 0x6440
jmp 0xb20f8
leaq -0x220(%rbp), %rdi
movl $0xf4240, %esi          # imm = 0xF4240
movl $0xa, %edx
callq 0x6320
jmp 0xb2110
movq -0x238(%rbp), %rsi
addq $0x28, %rsi
leaq -0x220(%rbp), %rdi
callq 0x6070
jmp 0xb2129
leaq -0x220(%rbp), %rdi
movl $0xf4240, %esi          # imm = 0xF4240
movl $0xa, %edx
callq 0x6320
jmp 0xb2141
movq -0x238(%rbp), %rsi
addq $0x30, %rsi
leaq -0x220(%rbp), %rdi
callq 0x6610
jmp 0xb215a
leaq -0x220(%rbp), %rdi
movl $0xf4240, %esi          # imm = 0xF4240
movl $0xa, %edx
callq 0x6320
jmp 0xb2172
movq -0x238(%rbp), %rsi
addq $0x50, %rsi
leaq -0x220(%rbp), %rdi
callq 0x6610
jmp 0xb218b
leaq -0x220(%rbp), %rdi
movl $0xf4240, %esi          # imm = 0xF4240
movl $0xa, %edx
callq 0x6320
jmp 0xb21a3
movq -0x238(%rbp), %rsi
addq $0x70, %rsi
leaq -0x220(%rbp), %rdi
callq 0x6610
jmp 0xb21bc
movq -0x238(%rbp), %rdi
addq $0x30, %rdi
leaq 0x19c4e(%rip), %rsi     # 0xcbe1c
callq 0x6150
cmpl $0x0, %eax
jne 0xb21f3
movq -0x238(%rbp), %rdi
addq $0x30, %rdi
leaq 0x19b0b(%rip), %rsi     # 0xcbcf5
callq 0x6690
jmp 0xb21f1
jmp 0xb21f3
movq -0x238(%rbp), %rdi
addq $0x50, %rdi
leaq 0x19c17(%rip), %rsi     # 0xcbe1c
callq 0x6150
cmpl $0x0, %eax
jne 0xb222a
movq -0x238(%rbp), %rdi
addq $0x50, %rdi
leaq 0x19adf(%rip), %rsi     # 0xcbd00
callq 0x6690
jmp 0xb2228
jmp 0xb222a
movq -0x238(%rbp), %rdi
addq $0x70, %rdi
leaq 0x19be0(%rip), %rsi     # 0xcbe1c
callq 0x6150
cmpl $0x0, %eax
jne 0xb2261
movq -0x238(%rbp), %rdi
addq $0x70, %rdi
leaq 0x19ab8(%rip), %rsi     # 0xcbd10
callq 0x6690
jmp 0xb225f
jmp 0xb2261
leaq -0x220(%rbp), %rdi
callq 0x6060
jmp 0xb226f
movq -0x238(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, (%rcx)
movb %al, -0x255(%rbp)
jbe 0xb22fb
movq -0x238(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x4(%rcx)
movb %al, -0x255(%rbp)
jbe 0xb22fb
movq -0x238(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0xc(%rcx)
movb %al, -0x255(%rbp)
jbe 0xb22fb
movq -0x238(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x10(%rcx)
movb %al, -0x255(%rbp)
jbe 0xb22fb
movq -0x238(%rbp), %rax
movsd 0x18(%rax), %xmm0
xorl %eax, %eax
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movb %al, -0x255(%rbp)
jbe 0xb22fb
movq -0x238(%rbp), %rax
movsd 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
setae %al
movb %al, -0x255(%rbp)
movb -0x255(%rbp), %al
testb $0x1, %al
jne 0xb2307
jmp 0xb2309
jmp 0xb2328
leaq 0x19b0e(%rip), %rdi     # 0xcbe1e
leaq 0x19a63(%rip), %rsi     # 0xcbd7a
movl $0x4c, %edx
leaq 0x19b6e(%rip), %rcx     # 0xcbe91
callq 0x6340
leaq -0x220(%rbp), %rdi
callq 0x60f0
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
movq -0x228(%rbp), %rdi
callq 0x6830
nopl (%rax)