// File: 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
movq %rsp, %rbp
subq $0x3b0, %rsp            # imm = 0x3B0
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x298(%rbp)
movq %rax, -0x2a0(%rbp)
leaq -0x19(%rbp), %rdi
movq %rdi, -0x290(%rbp)
callq 0x6850
movq -0x298(%rbp), %rdi
movq -0x290(%rbp), %rdx
leaq 0x1b238(%rip), %rsi     # 0xcba65
callq 0x2b2b0
jmp 0xb0834
leaq -0x19(%rbp), %rdi
callq 0x6550
movq -0x2a0(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x2b0(%rbp)
leaq -0x2d(%rbp), %rdi
movq %rdi, -0x2a8(%rbp)
callq 0x6850
movq -0x2b0(%rbp), %rdi
movq -0x2a8(%rbp), %rdx
leaq 0x1b0cc(%rip), %rsi     # 0xcb940
callq 0x2b2b0
jmp 0xb087b
leaq -0x2d(%rbp), %rdi
callq 0x6550
movq -0x2a0(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x2c0(%rbp)
leaq -0x2e(%rbp), %rdi
movq %rdi, -0x2b8(%rbp)
callq 0x6850
movq -0x2c0(%rbp), %rdi
movq -0x2b8(%rbp), %rdx
leaq 0x71d6(%rip), %rsi      # 0xb7a91
callq 0x2b2b0
jmp 0xb08c2
leaq -0x2e(%rbp), %rdi
callq 0x6550
movq -0x2a0(%rbp), %rax
addq $0x60, %rax
movq %rax, -0x2d0(%rbp)
leaq -0x2f(%rbp), %rdi
movq %rdi, -0x2c8(%rbp)
callq 0x6850
movq -0x2d0(%rbp), %rdi
movq -0x2c8(%rbp), %rdx
leaq 0x1b043(%rip), %rsi     # 0xcb945
callq 0x2b2b0
jmp 0xb0909
leaq -0x2f(%rbp), %rdi
callq 0x6550
movq -0x2a0(%rbp), %rax
movl $0x1, 0x80(%rax)
addq $0x88, %rax
movq %rax, -0x2e0(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0x2d8(%rbp)
callq 0x6850
movq -0x2e0(%rbp), %rdi
movq -0x2d8(%rbp), %rdx
leaq 0x713c(%rip), %rsi      # 0xb7a91
callq 0x2b2b0
jmp 0xb095c
leaq -0x30(%rbp), %rdi
callq 0x6550
leaq -0x1c0(%rbp), %rdi
callq 0x6390
jmp 0xb0973
movq 0x69646(%rip), %rax     # 0x119fc0
movl $0x0, (%rax)
movl -0xc(%rbp), %edi
movq -0x18(%rbp), %rsi
leaq 0x1afca(%rip), %rdx     # 0xcb958
callq 0x6100
movl %eax, -0x34(%rbp)
cmpl $-0x1, %eax
je 0xb0ef8
movl -0x34(%rbp), %eax
addl $-0x3f, %eax
movl %eax, %ecx
movq %rcx, -0x2e8(%rbp)
subl $0x35, %eax
ja 0xb0eee
movq -0x2e8(%rbp), %rax
leaq 0x1aea3(%rip), %rcx     # 0xcb868
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x19(%rbp), %rdi
callq 0x6550
jmp 0xb106b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x2d(%rbp), %rdi
callq 0x6550
jmp 0xb105f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x2e(%rbp), %rdi
callq 0x6550
jmp 0xb1053
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x2f(%rbp), %rdi
callq 0x6550
jmp 0xb1047
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x6550
jmp 0xb103b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0xb102f
movq -0x2a0(%rbp), %rdi
callq 0xb1080
jmp 0xb0a6f
jmp 0xb0ef3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0xb1023
movq 0x6949c(%rip), %rax     # 0x119f28
movq (%rax), %rax
movq %rax, -0x2f8(%rbp)
leaq -0x1e1(%rbp), %rdi
movq %rdi, -0x2f0(%rbp)
callq 0x6850
movq -0x2f8(%rbp), %rsi
movq -0x2f0(%rbp), %rdx
leaq -0x1e0(%rbp), %rdi
callq 0x2b2b0
jmp 0xb0ac5
movq -0x2a0(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x65e0
leaq -0x1e0(%rbp), %rdi
callq 0x6948
leaq -0x1e1(%rbp), %rdi
callq 0x6550
jmp 0xb0ef3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x1e1(%rbp), %rdi
callq 0x6550
jmp 0xb1023
movq 0x6940f(%rip), %rax     # 0x119f28
movq (%rax), %rax
movq %rax, -0x308(%rbp)
leaq -0x209(%rbp), %rdi
movq %rdi, -0x300(%rbp)
callq 0x6850
movq -0x308(%rbp), %rsi
movq -0x300(%rbp), %rdx
leaq -0x208(%rbp), %rdi
callq 0x2b2b0
jmp 0xb0b52
movq -0x2a0(%rbp), %rdi
addq $0x20, %rdi
leaq -0x208(%rbp), %rsi
callq 0x65e0
leaq -0x208(%rbp), %rdi
callq 0x6948
leaq -0x209(%rbp), %rdi
callq 0x6550
jmp 0xb0ef3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x209(%rbp), %rdi
callq 0x6550
jmp 0xb1023
movq 0x6937e(%rip), %rax     # 0x119f28
movq (%rax), %rax
movq %rax, -0x318(%rbp)
leaq -0x231(%rbp), %rdi
movq %rdi, -0x310(%rbp)
callq 0x6850
movq -0x318(%rbp), %rsi
movq -0x310(%rbp), %rdx
leaq -0x230(%rbp), %rdi
callq 0x2b2b0
jmp 0xb0be3
movq -0x2a0(%rbp), %rdi
addq $0x40, %rdi
leaq -0x230(%rbp), %rsi
callq 0x65e0
leaq -0x230(%rbp), %rdi
callq 0x6948
leaq -0x231(%rbp), %rdi
callq 0x6550
jmp 0xb0ef3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x231(%rbp), %rdi
callq 0x6550
jmp 0xb1023
movq 0x692ed(%rip), %rax     # 0x119f28
movq (%rax), %rax
movq %rax, -0x328(%rbp)
leaq -0x259(%rbp), %rdi
movq %rdi, -0x320(%rbp)
callq 0x6850
movq -0x328(%rbp), %rsi
movq -0x320(%rbp), %rdx
leaq -0x258(%rbp), %rdi
callq 0x2b2b0
jmp 0xb0c74
movq -0x2a0(%rbp), %rdi
addq $0x60, %rdi
leaq -0x258(%rbp), %rsi
callq 0x65e0
leaq -0x258(%rbp), %rdi
callq 0x6948
leaq -0x259(%rbp), %rdi
callq 0x6550
jmp 0xb0ef3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x259(%rbp), %rdi
callq 0x6550
jmp 0xb1023
leaq -0x1b0(%rbp), %rdi
movq 0x69255(%rip), %rax     # 0x119f28
movq (%rax), %rsi
callq 0x64f0
jmp 0xb0cdd
movq -0x2a0(%rbp), %rsi
subq $-0x80, %rsi
leaq -0x1c0(%rbp), %rdi
callq 0x62f0
jmp 0xb0cf6
jmp 0xb0ef3
movq 0x69226(%rip), %rax     # 0x119f28
movq (%rax), %rax
movq %rax, -0x338(%rbp)
leaq -0x281(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x6850
movq -0x338(%rbp), %rsi
movq -0x330(%rbp), %rdx
leaq -0x280(%rbp), %rdi
callq 0x2b2b0
jmp 0xb0d3b
movq -0x2a0(%rbp), %rdi
addq $0x88, %rdi
leaq -0x280(%rbp), %rsi
callq 0x65e0
leaq -0x280(%rbp), %rdi
callq 0x6948
leaq -0x281(%rbp), %rdi
callq 0x6550
jmp 0xb0ef3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x281(%rbp), %rdi
callq 0x6550
jmp 0xb1023
movq 0x69252(%rip), %rdi     # 0x119fe8
leaq 0x1abc9(%rip), %rsi     # 0xcb966
callq 0x64f0
movq %rax, -0x340(%rbp)
jmp 0xb0dab
movq -0x340(%rbp), %rdi
movq 0x691bf(%rip), %rax     # 0x119f78
movl (%rax), %esi
callq 0x6810
movq %rax, -0x348(%rbp)
jmp 0xb0dc9
movq -0x348(%rbp), %rdi
leaq 0x1ab99(%rip), %rsi     # 0xcb970
callq 0x64f0
movq %rax, -0x350(%rbp)
jmp 0xb0de5
movq -0x350(%rbp), %rdi
movq 0x69125(%rip), %rsi     # 0x119f18
callq 0x6530
jmp 0xb0dfa
movq 0x69177(%rip), %rax     # 0x119f78
movl (%rax), %edi
callq 0x6840
cmpl $0x0, %eax
je 0xb0e7a
movq 0x691d4(%rip), %rdi     # 0x119fe8
leaq 0x1ab6c(%rip), %rsi     # 0xcb987
callq 0x64f0
movq %rax, -0x358(%rbp)
jmp 0xb0e29
movq -0x358(%rbp), %rdi
movq 0x69141(%rip), %rax     # 0x119f78
movl (%rax), %esi
callq 0x6810
movq %rax, -0x360(%rbp)
jmp 0xb0e47
movq -0x360(%rbp), %rdi
leaq 0x1b162(%rip), %rsi     # 0xcbfb7
callq 0x64f0
movq %rax, -0x368(%rbp)
jmp 0xb0e63
movq -0x368(%rbp), %rdi
movq 0x690a7(%rip), %rsi     # 0x119f18
callq 0x6530
jmp 0xb0e78
jmp 0xb0ee7
movq 0x69167(%rip), %rdi     # 0x119fe8
leaq 0x1ab11(%rip), %rsi     # 0xcb999
callq 0x64f0
movq %rax, -0x370(%rbp)
jmp 0xb0e96
movq -0x370(%rbp), %rdi
movq 0x690d4(%rip), %rax     # 0x119f78
movl (%rax), %esi
callq 0x6810
movq %rax, -0x378(%rbp)
jmp 0xb0eb4
movq -0x378(%rbp), %rdi
leaq 0x1b0f5(%rip), %rsi     # 0xcbfb7
callq 0x64f0
movq %rax, -0x380(%rbp)
jmp 0xb0ed0
movq -0x380(%rbp), %rdi
movq 0x6903a(%rip), %rsi     # 0x119f18
callq 0x6530
jmp 0xb0ee5
jmp 0xb0ee7
xorl %edi, %edi
callq 0x65d0
callq 0x62a0
jmp 0xb0980
movq 0x690b1(%rip), %rax     # 0x119fb0
movl (%rax), %eax
movl %eax, -0x288(%rbp)
movl -0x288(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0xb0f7a
movq 0x6907f(%rip), %rdi     # 0x119f98
leaq 0x1aa95(%rip), %rsi     # 0xcb9b5
callq 0x64f0
movq %rax, -0x388(%rbp)
jmp 0xb0f2e
movq -0x388(%rbp), %rdi
movq -0x18(%rbp), %rax
movslq -0x288(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x64f0
movq %rax, -0x390(%rbp)
jmp 0xb0f52
movq -0x390(%rbp), %rdi
movq 0x68fb8(%rip), %rsi     # 0x119f18
callq 0x6530
jmp 0xb0f67
jmp 0xb0f69
movl -0x288(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x288(%rbp)
jmp 0xb0f07
movq -0x2a0(%rbp), %rax
cmpl $0x0, 0x80(%rax)
jg 0xb100e
movq 0x69053(%rip), %rdi     # 0x119fe8
leaq 0x1aa30(%rip), %rsi     # 0xcb9cc
callq 0x64f0
movq %rax, -0x398(%rbp)
jmp 0xb0faa
movq -0x398(%rbp), %rdi
movq -0x2a0(%rbp), %rax
movl 0x80(%rax), %esi
callq 0x6810
movq %rax, -0x3a0(%rbp)
jmp 0xb0fcc
movq -0x3a0(%rbp), %rdi
leaq 0x1afdd(%rip), %rsi     # 0xcbfb7
callq 0x64f0
movq %rax, -0x3a8(%rbp)
jmp 0xb0fe8
movq -0x3a8(%rbp), %rdi
movq 0x68f22(%rip), %rsi     # 0x119f18
callq 0x6530
jmp 0xb0ffd
movq -0x2a0(%rbp), %rax
movl $0x1, 0x80(%rax)
leaq -0x1c0(%rbp), %rdi
callq 0x63d0
addq $0x3b0, %rsp            # imm = 0x3B0
popq %rbp
retq
leaq -0x1c0(%rbp), %rdi
callq 0x63d0
movq -0x2e0(%rbp), %rdi
callq 0x6948
movq -0x2d0(%rbp), %rdi
callq 0x6948
movq -0x2c0(%rbp), %rdi
callq 0x6948
movq -0x2b0(%rbp), %rdi
callq 0x6948
movq -0x298(%rbp), %rdi
callq 0x6948
movq -0x28(%rbp), %rdi
callq 0x6830
nopw %cs:(%rax,%rax)