// File: /workspace/github_cpp_makefile_star2_O2/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 $0x1e8, %rsp            # imm = 0x1E8
movq %rdx, %rbp
movl %esi, %r15d
movq %rdi, %r14
leaq 0x1412c(%rip), %rsi     # 0x4bc85
leaq 0x60(%rsp), %rdx
callq 0x13fac
leaq 0x20(%r14), %rdi
leaq 0x13ff2(%rip), %rsi     # 0x4bb60
leaq 0x60(%rsp), %rdx
movq %rdi, 0x20(%rsp)
callq 0x13fac
leaq 0x40(%r14), %rdi
leaq 0x4f05(%rip), %rsi      # 0x3ca8d
leaq 0x60(%rsp), %rdx
movq %rdi, 0x30(%rsp)
callq 0x13fac
leaq 0x60(%r14), %rdi
leaq 0x13fc3(%rip), %rsi     # 0x4bb65
leaq 0x60(%rsp), %rdx
movq %rdi, 0x28(%rsp)
callq 0x13fac
movl $0x1, 0x80(%r14)
leaq 0x88(%r14), %rdi
leaq 0x4ec3(%rip), %rsi      # 0x3ca8d
leaq 0x60(%rsp), %rdx
movq %rdi, 0x18(%rsp)
callq 0x13fac
leaq 0x60(%rsp), %rdi
callq 0x6320
movq 0x2c3ce(%rip), %rax     # 0x63fb8
andl $0x0, (%rax)
movq %r14, 0x10(%rsp)
leaq 0x80(%r14), %rax
movq %rax, 0x38(%rsp)
leaq 0x13f73(%rip), %rbx     # 0x4bb78
movq 0x2c334(%rip), %r14     # 0x63f40
leaq 0x40(%rsp), %r13
leaq 0x13f30(%rip), %r12     # 0x4bb48
movl %r15d, %edi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x60d0
leal -0x63(%rax), %ecx
cmpl $0x5, %ecx
jbe 0x37c63
cmpl $0x6f, %eax
je 0x37cb1
cmpl $0x73, %eax
je 0x37cc8
cmpl $0x74, %eax
jne 0x37cf2
movq (%r14), %rsi
leaq 0x70(%rsp), %rdi
callq 0x6430
leaq 0x60(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x6260
jmp 0x37c18
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
movq (%r14), %rsi
movq %r13, %rdi
leaq 0xf(%rsp), %rdx
callq 0x13fac
movq 0x28(%rsp), %rdi
jmp 0x37cdd
movq (%r14), %rsi
movq %r13, %rdi
leaq 0xf(%rsp), %rdx
callq 0x13fac
movq 0x18(%rsp), %rdi
jmp 0x37cdd
movq (%r14), %rsi
movq %r13, %rdi
leaq 0xf(%rsp), %rdx
callq 0x13fac
movq 0x30(%rsp), %rdi
jmp 0x37cdd
movq (%r14), %rsi
movq %r13, %rdi
leaq 0xf(%rsp), %rdx
callq 0x13fac
movq 0x10(%rsp), %rdi
jmp 0x37cdd
movq (%r14), %rsi
movq %r13, %rdi
leaq 0xf(%rsp), %rdx
callq 0x13fac
movq 0x20(%rsp), %rdi
movq %r13, %rsi
callq 0x64c0
movq %r13, %rdi
callq 0x6798
jmp 0x37c18
cmpl $-0x1, %eax
jne 0x37da6
movq 0x2c2a6(%rip), %rax     # 0x63fa8
movslq (%rax), %r14
movslq %r15d, %r12
movq 0x2c289(%rip), %rbx     # 0x63f98
leaq 0x13ebf(%rip), %r15     # 0x4bbd5
movq 0x38(%rsp), %r13
cmpq %r12, %r14
jge 0x37d45
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6430
movq (%rbp,%r14,8), %rsi
movq %rax, %rdi
callq 0x6430
movq %rax, %rdi
callq 0x61c0
incq %r14
jmp 0x37d1b
cmpl $0x0, (%r13)
jg 0x37d8a
movq 0x2c295(%rip), %rdi     # 0x63fe8
leaq 0x13e92(%rip), %rsi     # 0x4bbec
callq 0x6430
movl (%r13), %esi
movq %rax, %rdi
callq 0x66b0
leaq 0x1448d(%rip), %rsi     # 0x4c1ff
movq %rax, %rdi
callq 0x6430
movq %rax, %rdi
callq 0x61c0
movl $0x1, (%r13)
leaq 0x60(%rsp), %rdi
callq 0x6360
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3f, %eax
jne 0x37e39
movq 0x2c232(%rip), %rdi     # 0x63fe8
leaq 0x13dc9(%rip), %rsi     # 0x4bb86
callq 0x6430
movq 0x2c1b7(%rip), %rbx     # 0x63f80
movl (%rbx), %esi
movq %rax, %rdi
callq 0x66b0
leaq 0x13db6(%rip), %rsi     # 0x4bb90
movq %rax, %rdi
callq 0x6430
movq %rax, %rdi
callq 0x61c0
movl (%rbx), %edi
callq 0x66f0
testl %eax, %eax
leaq 0x13dbf(%rip), %rax     # 0x4bbb9
leaq 0x13da6(%rip), %rsi     # 0x4bba7
cmoveq %rax, %rsi
movq 0x2c1dc(%rip), %rdi     # 0x63fe8
callq 0x6430
movl (%rbx), %esi
movq %rax, %rdi
callq 0x66b0
leaq 0x143dd(%rip), %rsi     # 0x4c1ff
movq %rax, %rdi
callq 0x6430
movq %rax, %rdi
callq 0x61c0
xorl %edi, %edi
callq 0x64b0
callq 0x6230
callq 0x37eb4
movq %rax, %rbx
jmp 0x37e7c
movq %rax, %rbx
jmp 0x37e86
movq %rax, %rbx
jmp 0x37e90
movq %rax, %rbx
jmp 0x37e9a
movq %rax, %rbx
jmp 0x37ea4
jmp 0x37e6a
jmp 0x37e6a
jmp 0x37e6a
jmp 0x37e6a
jmp 0x37e6a
jmp 0x37e6a
jmp 0x37e6a
movq %rax, %rbx
movq 0x10(%rsp), %r14
leaq 0x60(%rsp), %rdi
callq 0x6360
movq 0x18(%rsp), %rdi
callq 0x6798
movq 0x28(%rsp), %rdi
callq 0x6798
movq 0x30(%rsp), %rdi
callq 0x6798
movq 0x20(%rsp), %rdi
callq 0x6798
movq %r14, %rdi
callq 0x6798
movq %rbx, %rdi
callq 0x66e0