// File: /workspace/github_cpp_makefile_star2_O1/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 0xcf46(%rip), %rsi      # 0x478f9
leaq 0xcf46(%rip), %rdx      # 0x47900
callq 0x18632
leaq 0x20(%r12), %rdi
leaq 0x30(%r12), %r13
movq %r13, 0x20(%r12)
leaq 0xcdff(%rip), %rsi      # 0x477d4
leaq 0xcdfc(%rip), %rdx      # 0x477d8
movq %rdi, 0x70(%rsp)
callq 0x18632
leaq 0x40(%r12), %rdi
leaq 0x50(%r12), %rax
movq %rax, 0x8(%rsp)
movq %rax, 0x40(%r12)
leaq 0x50a0(%rip), %rdx      # 0x3faa1
movq %rdi, 0x68(%rsp)
movq %rdx, %rsi
callq 0x18632
leaq 0x60(%r12), %rdi
leaq 0x70(%r12), %rax
movq %rax, 0x10(%rsp)
movq %rax, 0x60(%r12)
leaq 0xcdb0(%rip), %rsi      # 0x477d9
leaq 0xcdbb(%rip), %rdx      # 0x477eb
movq %rdi, 0x60(%rsp)
callq 0x18632
movl $0x1, 0x80(%r12)
leaq 0x88(%r12), %rdi
leaq 0x98(%r12), %rax
movq %rax, 0x78(%rsp)
movq %rax, 0x88(%r12)
leaq 0x5037(%rip), %rdx      # 0x3faa1
movq %rdi, 0x58(%rsp)
movq %rdx, %rsi
callq 0x18632
movq %r13, 0x18(%rsp)
movq %r14, 0x20(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x6320
movq %r12, 0x28(%rsp)
leaq 0x80(%r12), %r14
movq 0x18516(%rip), %rax     # 0x52fb8
movl $0x0, (%rax)
leaq 0xcd3d(%rip), %r13      # 0x477ec
movq 0x18492(%rip), %r12     # 0x52f48
leaq 0x38(%rsp), %rbx
movq %r14, 0x30(%rsp)
movl %ebp, %edi
movq %r15, %rsi
movq %r13, %rdx
callq 0x60d0
cmpl $0x6e, %eax
jg 0x3ab09
leal -0x63(%rax), %ecx
cmpl $0x5, %ecx
ja 0x3ac1e
leaq 0xccd7(%rip), %rdx      # 0x477bc
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movq (%r12), %rsi
movq %rbx, %rdi
leaq 0x7(%rsp), %rdx
callq 0x3b18a
movq 0x60(%rsp), %rdi
jmp 0x3abb0
cmpl $0x6f, %eax
je 0x3ab82
cmpl $0x73, %eax
je 0x3ab9a
cmpl $0x74, %eax
jne 0x3ae1c
movq (%r12), %r14
testq %r14, %r14
je 0x3abdd
movq %r14, %rdi
callq 0x61a0
leaq 0x90(%rsp), %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x64a0
movq 0x30(%rsp), %r14
jmp 0x3ac09
movq (%r12), %rsi
movq %rbx, %rdi
leaq 0x7(%rsp), %rdx
callq 0x3b18a
movq 0x68(%rsp), %rdi
jmp 0x3abb0
movq (%r12), %rsi
movq %rbx, %rdi
leaq 0x7(%rsp), %rdx
callq 0x3b18a
movq 0x58(%rsp), %rdi
jmp 0x3abb0
movq (%r12), %rsi
movq %rbx, %rdi
leaq 0x7(%rsp), %rdx
callq 0x3b18a
movq 0x28(%rsp), %rdi
jmp 0x3abb0
movq (%r12), %rsi
movq %rbx, %rdi
leaq 0x7(%rsp), %rdx
callq 0x3b18a
movq 0x70(%rsp), %rdi
movq %rbx, %rsi
callq 0x64f0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x3aac0
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x6460
jmp 0x3aac0
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 0x3aac0
cmpl $-0x1, %eax
jne 0x3ad7a
movq 0x1837a(%rip), %rax     # 0x52fa8
movslq (%rax), %rax
cmpl %eax, %ebp
jle 0x3acd5
leaq (%r15,%rax,8), %r12
subl %eax, %ebp
xorl %r13d, %r13d
movq 0x1834f(%rip), %rbx     # 0x52f98
leaq 0xcbf9(%rip), %r15      # 0x47849
movl $0x16, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64a0
movq (%r12,%r13,8), %r14
testq %r14, %r14
je 0x3ac86
movq %r14, %rdi
callq 0x61a0
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x64a0
movq 0x30(%rsp), %r14
jmp 0x3aca2
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 0x3ac50
cmpl $0x0, (%r14)
jg 0x3ad47
movq 0x18306(%rip), %rdi     # 0x52fe8
leaq 0xcb77(%rip), %rsi      # 0x47860
movl $0x1d, %edx
callq 0x64a0
movl (%r14), %esi
movq 0x182eb(%rip), %rdi     # 0x52fe8
callq 0x66e0
movq %rax, %rbx
leaq 0xd163(%rip), %rsi      # 0x47e6f
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 0x181da(%rip), %rsi     # 0x52f28
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 0x3ae1c
movq 0x1825e(%rip), %rdi     # 0x52fe8
leaq 0xca69(%rip), %rsi      # 0x477fa
movl $0x9, %edx
callq 0x64a0
movq 0x181de(%rip), %r14     # 0x52f80
movl (%r14), %esi
movq 0x1823c(%rip), %rdi     # 0x52fe8
callq 0x66e0
movq %rax, %rbx
leaq 0xca49(%rip), %rsi      # 0x47804
movl $0x16, %edx
movq %rax, %rdi
callq 0x64a0
movq %rbx, %rdi
callq 0x61c0
movl (%r14), %edi
callq 0x6720
testl %eax, %eax
jne 0x3ae26
movq 0x18205(%rip), %rdi     # 0x52fe8
leaq 0xca43(%rip), %rsi      # 0x4782d
movl $0x1b, %edx
callq 0x64a0
movl (%r14), %esi
movq 0x181ea(%rip), %rdi     # 0x52fe8
callq 0x66e0
movq %rax, %rbx
leaq 0xd062(%rip), %rsi      # 0x47e6f
movl $0x1, %edx
movq %rax, %rdi
callq 0x64a0
jmp 0x3ae64
callq 0x6230
callq 0x3af8a
movq 0x181bb(%rip), %rdi     # 0x52fe8
leaq 0xc9e7(%rip), %rsi      # 0x4781b
movl $0x11, %edx
callq 0x64a0
movl (%r14), %esi
movq 0x181a0(%rip), %rdi     # 0x52fe8
callq 0x66e0
movq %rax, %rbx
leaq 0xd018(%rip), %rsi      # 0x47e6f
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 0x3af06
movq %rax, %rbx
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %rbp
jmp 0x3af23
movq %rax, %rbx
movq 0x8(%rsp), %r15
jmp 0x3af3c
movq %rax, %rbx
jmp 0x3af54
movq %rax, %rbx
jmp 0x3af6d
jmp 0x3aec9
jmp 0x3aec9
jmp 0x3aec9
jmp 0x3aec9
jmp 0x3aec9
jmp 0x3aec9
jmp 0x3aec9
movq %rax, %rbx
movq 0x20(%rsp), %r14
movq 0x28(%rsp), %r12
movq 0x18(%rsp), %r13
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %rbp
movq 0x1803c(%rip), %rsi     # 0x52f28
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 0x3af23
movq (%rax), %rsi
incq %rsi
callq 0x6460
movq 0x60(%rsp), %rax
movq (%rax), %rdi
cmpq %rbp, %rdi
je 0x3af3c
movq (%rbp), %rsi
incq %rsi
callq 0x6460
movq 0x68(%rsp), %rax
movq (%rax), %rdi
cmpq %r15, %rdi
je 0x3af54
movq (%r15), %rsi
incq %rsi
callq 0x6460
movq 0x70(%rsp), %rax
movq (%rax), %rdi
cmpq %r13, %rdi
je 0x3af6d
movq (%r13), %rsi
incq %rsi
callq 0x6460
movq (%r12), %rdi
cmpq %r14, %rdi
je 0x3af81
movq (%r14), %rsi
incq %rsi
callq 0x6460
movq %rbx, %rdi
callq 0x6710
nop