// File: /workspace/github_cpp_makefile_star2_O3/j-faria[P]kima/DNest4/code/CommandLineOptions.cpp
// Function: DNest4::CommandLineOptions::CommandLineOptions(int, char**)
CommandLineOptions::CommandLineOptions(int argc, char** argv)
:options_file("OPTIONS")
,seed("time")
,data_file("")
,compression("2.7182818284590451")
,num_threads(1)
,config_file("")
{
	// The following code is based on the example given at
	// http://www.gnu.org/software/libc/manual/html_node/Example-of-Getopt.html#Example-of-Getopt

	int c;
	std::stringstream s;

	opterr = 0;
	while((c = getopt(argc, argv, "ho:s:d:c:t:f:")) != -1)
	switch(c)
	{
		case 'h':
			print_help();
			break;
		case 'o':
			options_file = std::string(optarg);
			break;
		case 's':
			seed = std::string(optarg);
			break;
		case 'd':
			data_file = std::string(optarg);
			break;
		case 'c':
			compression = std::string(optarg);
			break;
		case 't':
			s<<optarg;
			s>>num_threads;
			break;
		case 'f':
			config_file = std::string(optarg);
			break;
		case '?':
			std::cerr<<"# Option "<<optopt<<" requires an argument."<<std::endl;
			if(isprint(optopt))
				std::cerr<<"# Unknown option "<<optopt<<"."<<std::endl;
			else
				std::cerr<<"# Unknown option character "<<optopt<<"."<<std::endl;
			exit(0);
		default:
			abort();
           }

	for(int index = optind; index < argc; index++)
		std::cout<<"# Non-option argument "<<argv[index]<<std::endl;

	if(num_threads <= 0)
	{
		std::cerr<<"# Invalid number of threads: "<<num_threads<<"."<<std::endl;
		num_threads = 1;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r12
leaq 0x10(%rdi), %r14
movq %r14, (%rdi)
leaq 0xc9b6(%rip), %rsi      # 0x44dc9
leaq 0xc9b6(%rip), %rdx      # 0x44dd0
callq 0x17f6a
leaq 0x20(%r12), %rdi
leaq 0x30(%r12), %r13
movq %r13, 0x20(%r12)
leaq 0xc86f(%rip), %rsi      # 0x44ca4
leaq 0xc86c(%rip), %rdx      # 0x44ca8
movq %rdi, 0x70(%rsp)
callq 0x17f6a
leaq 0x40(%r12), %rdi
leaq 0x50(%r12), %rax
movq %rax, 0x8(%rsp)
movq %rax, 0x40(%r12)
leaq 0x567c(%rip), %rdx      # 0x3dadd
movq %rdi, 0x68(%rsp)
movq %rdx, %rsi
callq 0x17f6a
leaq 0x60(%r12), %rdi
leaq 0x70(%r12), %rax
movq %rax, 0x10(%rsp)
movq %rax, 0x60(%r12)
leaq 0xc820(%rip), %rsi      # 0x44ca9
leaq 0xc82b(%rip), %rdx      # 0x44cbb
movq %rdi, 0x60(%rsp)
callq 0x17f6a
movl $0x1, 0x80(%r12)
leaq 0x88(%r12), %rdi
leaq 0x98(%r12), %rax
movq %rax, 0x78(%rsp)
movq %rax, 0x88(%r12)
leaq 0x5613(%rip), %rdx      # 0x3dadd
movq %rdi, 0x58(%rsp)
movq %rdx, %rsi
callq 0x17f6a
movq %r13, 0x18(%rsp)
movq %r14, 0x20(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x6320
movq %r12, 0x28(%rsp)
leaq 0x80(%r12), %r14
movq 0x17ab6(%rip), %rax     # 0x4ffb8
movl $0x0, (%rax)
leaq 0xc7ad(%rip), %r13      # 0x44cbc
movq 0x17a32(%rip), %r12     # 0x4ff48
leaq 0x38(%rsp), %rbx
movq %r14, 0x30(%rsp)
movl %ebp, %edi
movq %r15, %rsi
movq %r13, %rdx
callq 0x60d0
cmpl $0x6e, %eax
jg 0x38569
leal -0x63(%rax), %ecx
cmpl $0x5, %ecx
ja 0x3867e
leaq 0xc747(%rip), %rdx      # 0x44c8c
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movq (%r12), %rsi
movq %rbx, %rdi
leaq 0x7(%rsp), %rdx
callq 0x38bea
movq 0x60(%rsp), %rdi
jmp 0x38610
cmpl $0x6f, %eax
je 0x385e2
cmpl $0x73, %eax
je 0x385fa
cmpl $0x74, %eax
jne 0x3887c
movq (%r12), %r14
testq %r14, %r14
je 0x3863d
movq %r14, %rdi
callq 0x61a0
leaq 0x90(%rsp), %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x64a0
movq 0x30(%rsp), %r14
jmp 0x38669
movq (%r12), %rsi
movq %rbx, %rdi
leaq 0x7(%rsp), %rdx
callq 0x38bea
movq 0x68(%rsp), %rdi
jmp 0x38610
movq (%r12), %rsi
movq %rbx, %rdi
leaq 0x7(%rsp), %rdx
callq 0x38bea
movq 0x58(%rsp), %rdi
jmp 0x38610
movq (%r12), %rsi
movq %rbx, %rdi
leaq 0x7(%rsp), %rdx
callq 0x38bea
movq 0x28(%rsp), %rdi
jmp 0x38610
movq (%r12), %rsi
movq %rbx, %rdi
leaq 0x7(%rsp), %rdx
callq 0x38bea
movq 0x70(%rsp), %rdi
movq %rbx, %rsi
callq 0x64f0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x38520
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x6460
jmp 0x38520
movq 0x90(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x90(%rsp), %rcx
leaq (%rcx,%rax), %rdi
movl 0xb0(%rsp,%rax), %esi
orl $0x1, %esi
callq 0x6690
movq 0x30(%rsp), %r14
leaq 0x80(%rsp), %rdi
movq %r14, %rsi
callq 0x6260
jmp 0x38520
cmpl $-0x1, %eax
jne 0x387da
movq 0x1791a(%rip), %rax     # 0x4ffa8
movslq (%rax), %rax
cmpl %eax, %ebp
jle 0x38735
leaq (%r15,%rax,8), %r12
subl %eax, %ebp
xorl %r13d, %r13d
movq 0x178ef(%rip), %rbx     # 0x4ff98
leaq 0xc669(%rip), %r15      # 0x44d19
movl $0x16, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64a0
movq (%r12,%r13,8), %r14
testq %r14, %r14
je 0x386e6
movq %r14, %rdi
callq 0x61a0
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x64a0
movq 0x30(%rsp), %r14
jmp 0x38702
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x6690
movq 0x30(%rsp), %r14
movq (%rbx), %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
incq %r13
cmpl %r13d, %ebp
jne 0x386b0
cmpl $0x0, (%r14)
jg 0x387a7
movq 0x178a6(%rip), %rdi     # 0x4ffe8
leaq 0xc5e7(%rip), %rsi      # 0x44d30
movl $0x1d, %edx
callq 0x64a0
movl (%r14), %esi
movq 0x1788b(%rip), %rdi     # 0x4ffe8
callq 0x66e0
movq %rax, %rbx
leaq 0xcc03(%rip), %rsi      # 0x4536f
movl $0x1, %edx
movq %rax, %rdi
callq 0x64a0
movq (%rbx), %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
movl $0x1, (%r14)
movq 0x1777a(%rip), %rsi     # 0x4ff28
leaq 0x80(%rsp), %rdi
callq 0x6360
leaq 0x100(%rsp), %rdi
callq 0x6130
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3f, %eax
jne 0x3887c
movq 0x177fe(%rip), %rdi     # 0x4ffe8
leaq 0xc4d9(%rip), %rsi      # 0x44cca
movl $0x9, %edx
callq 0x64a0
movq 0x1777e(%rip), %r14     # 0x4ff80
movl (%r14), %esi
movq 0x177dc(%rip), %rdi     # 0x4ffe8
callq 0x66e0
movq %rax, %rbx
leaq 0xc4b9(%rip), %rsi      # 0x44cd4
movl $0x16, %edx
movq %rax, %rdi
callq 0x64a0
movq %rbx, %rdi
callq 0x61c0
movl (%r14), %edi
callq 0x6720
testl %eax, %eax
jne 0x38886
movq 0x177a5(%rip), %rdi     # 0x4ffe8
leaq 0xc4b3(%rip), %rsi      # 0x44cfd
movl $0x1b, %edx
callq 0x64a0
movl (%r14), %esi
movq 0x1778a(%rip), %rdi     # 0x4ffe8
callq 0x66e0
movq %rax, %rbx
leaq 0xcb02(%rip), %rsi      # 0x4536f
movl $0x1, %edx
movq %rax, %rdi
callq 0x64a0
jmp 0x388c4
callq 0x6230
callq 0x389ea
movq 0x1775b(%rip), %rdi     # 0x4ffe8
leaq 0xc457(%rip), %rsi      # 0x44ceb
movl $0x11, %edx
callq 0x64a0
movl (%r14), %esi
movq 0x17740(%rip), %rdi     # 0x4ffe8
callq 0x66e0
movq %rax, %rbx
leaq 0xcab8(%rip), %rsi      # 0x4536f
movl $0x1, %edx
movq %rax, %rdi
callq 0x64a0
movq %rbx, %rdi
callq 0x61c0
xorl %edi, %edi
callq 0x64e0
movq %rax, %rbx
movq 0x20(%rsp), %r14
movq 0x18(%rsp), %r13
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %rbp
jmp 0x38966
movq %rax, %rbx
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %rbp
jmp 0x38983
movq %rax, %rbx
movq 0x8(%rsp), %r15
jmp 0x3899c
movq %rax, %rbx
jmp 0x389b4
movq %rax, %rbx
jmp 0x389cd
jmp 0x38929
jmp 0x38929
jmp 0x38929
jmp 0x38929
jmp 0x38929
jmp 0x38929
jmp 0x38929
movq %rax, %rbx
movq 0x20(%rsp), %r14
movq 0x28(%rsp), %r12
movq 0x18(%rsp), %r13
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %rbp
movq 0x175dc(%rip), %rsi     # 0x4ff28
leaq 0x80(%rsp), %rdi
callq 0x6360
leaq 0x100(%rsp), %rdi
callq 0x6130
movq 0x58(%rsp), %rax
movq (%rax), %rdi
movq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x38983
movq (%rax), %rsi
incq %rsi
callq 0x6460
movq 0x60(%rsp), %rax
movq (%rax), %rdi
cmpq %rbp, %rdi
je 0x3899c
movq (%rbp), %rsi
incq %rsi
callq 0x6460
movq 0x68(%rsp), %rax
movq (%rax), %rdi
cmpq %r15, %rdi
je 0x389b4
movq (%r15), %rsi
incq %rsi
callq 0x6460
movq 0x70(%rsp), %rax
movq (%rax), %rdi
cmpq %r13, %rdi
je 0x389cd
movq (%r13), %rsi
incq %rsi
callq 0x6460
movq (%r12), %rdi
cmpq %r14, %rdi
je 0x389e1
movq (%r14), %rsi
incq %rsi
callq 0x6460
movq %rbx, %rdi
callq 0x6710
nop