// File: /workspace/github_cpp_makefile_star2_O2/ridgelab[P]Kmer-SSR/src/Arguments.cpp
// Function: Arguments::processArgs(int, char**)
void Arguments::processArgs(int argc, char* argv[])
{
	// parse arguments
	string alphabet_str = "A,C,G,T";         // -a:
	string min_seq_len_str = "100";            // -l:
	string max_seq_len_str = "500000000";    // -L: // 500,000,000 (500 million)
	string min_nucleotides_str = "16";        // -n:
	string max_nucleotides_str = "10000";    // -N:
	string period_s = "4-8";                 // -p:
	string max_task_queue_size_str = "1000"; // -Q:
	string min_repeats_str = "2";            // -r:
	string max_repeats_str = "1000";         // -R:
	string enumerated_ssrs_str = "";         // -s:
	string threads_str = "1";                // -t:
	
	int c;

	if (argc > 1)
	{
		// search for -v
		while ( (c = getopt(argc,argv,"+:v")) != -1 )
		{
			switch (c)
			{
				case 'v':
					this->version_displayed = true;
					cerr << "Version: " << this->version << endl;
					return;
				case ':': break;
				case '?': break;
				default: break;
			}
		}
		
		optind = 1; // reset optind to search for -h

		// search for -h
		while ( (c = getopt(argc,argv,"+:h")) != -1 )
		{
			switch (c)
			{
				case 'h':
					this->help_displayed = true;
					cerr << this->usage_message << endl << endl << this->help_message << endl << endl;
					return;
				case ':': break;
				case '?': break;
				default: break;
			}
		}

		optind = 1; // reset optind to search for everything else
	
		// search for everything else
		while ( (c = getopt(argc,argv,"a:AbBdegGhi:l:L:n:N:o:p:Q:r:R:s:t:v")) != -1 )
		{
			switch (c)
			{
				case 'a': alphabet_str = optarg; break;
				case 'A': this->allow_non_atomic = true; break;
				case 'b': this->bzipped2_input = true; break;
				case 'B': this->bzipped2_output = true; break;
				case 'd': this->display_progress_bar = false; break;
				case 'e': this->exhaustive = true; break;
				case 'g': this->gzipped_input = true; break;
				case 'G': this->gzipped_output = true; break;
				case 'h': break;
				case 'i': this->input_file_name = optarg; break;
				case 'l': min_seq_len_str = optarg; break;
				case 'L': max_seq_len_str = optarg; break;
				case 'n': min_nucleotides_str = optarg; break;
				case 'N': max_nucleotides_str = optarg; break;
				case 'o': this->output_file_name = optarg; break;
				case 'p': period_s = optarg; break;
				case 'Q': max_task_queue_size_str = optarg; break;
				case 'r': min_repeats_str = optarg; break;
				case 'R': max_repeats_str = optarg; break;
				case 's': enumerated_ssrs_str = optarg; break;
				case 't': threads_str = optarg; break;
				case 'v': break;
				case '?':
					if (optopt == 'c')
					{
						fprintf(stderr,"Option -%c requires an argument. Run with -h for help.\n",optopt);
						this->help_displayed = true;
					}
					else if (isprint(optopt))
					{
						fprintf(stderr,"Unknown option `-%c'. Run with -h for help.\n",optopt);
						this->help_displayed = true;
					}
					else
					{
						fprintf(stderr,"Unknown option character `\\x%x'. Run with -h for help.\n",optopt);
						this->help_displayed = true;
					}
					return;
				default:
					cout << "abort, c: " << (char) c << endl;
					abort();
			}
		}
	}
	else if (argc == 1)
	{
		cerr << "Note: you are receiving input from STDIN and sending output to STDOUT\n" << endl;
	}

	// check for positional parameters (which is an error)
	if (optind < argc)
	{
		string error = "ERROR: You may not supply any positional parameters. Offenders:";

		for (uint32_t i = optind; i < (uint32_t) argc; i++)
		{
			error += " " + string(argv[i]);
		}

		throw error;
	}

	// assign member variables now that we've parsed the arguments
	this->threads = parsePositiveIntegerArgument(threads_str);
	this->addToAlphabet(alphabet_str);
	this->min_sequence_length = parsePositiveIntegerArgument(min_seq_len_str);
	this->max_sequence_length = parsePositiveIntegerArgument(max_seq_len_str);
	this->min_nucleotides = parsePositiveIntegerArgument(min_nucleotides_str);
	this->max_nucleotides = parsePositiveIntegerArgument(max_nucleotides_str);
	this->min_repeats = parsePositiveIntegerArgument(min_repeats_str);
	this->max_repeats = parsePositiveIntegerArgument(max_repeats_str);
	this->max_task_queue_size = parsePositiveIntegerArgument(max_task_queue_size_str);
	this->addToEnumeratedSSRs(enumerated_ssrs_str);
	this->addToPeriods(period_s);

	// adjust arguments for speed reasons
	this->adjustMinSequenceLength();

	// sanity check
	this->sanityCheckArguments();

	this->autoDetectCompressedInput();
	this->autoDetectCompressedOutput();
	this->display_progress_bar = this->input_file_name != "/dev/stdin" ? this->display_progress_bar : false; // if stdin..we can't determine size of data
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x338, %rsp            # imm = 0x338
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r12
leaq 0x3b79(%rip), %rsi      # 0xd26d
leaq 0x178(%rsp), %rdi
leaq 0x158(%rsp), %rdx
callq 0x47b0
leaq 0x3b65(%rip), %rsi      # 0xd275
leaq 0x158(%rsp), %rdi
leaq 0x138(%rsp), %rdx
callq 0x47b0
leaq 0x3b4d(%rip), %rsi      # 0xd279
leaq 0x138(%rsp), %rdi
leaq 0x118(%rsp), %rdx
callq 0x47b0
leaq 0x3b3b(%rip), %rsi      # 0xd283
leaq 0x118(%rsp), %rdi
leaq 0xf8(%rsp), %rdx
callq 0x47b0
leaq 0x3b22(%rip), %rsi      # 0xd286
leaq 0xf8(%rsp), %rdi
leaq 0xd8(%rsp), %rdx
callq 0x47b0
leaq 0x3b0c(%rip), %rsi      # 0xd28c
leaq 0xd8(%rsp), %rdi
leaq 0xb8(%rsp), %rdx
callq 0x47b0
leaq 0x3af4(%rip), %rsi      # 0xd290
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rdx
callq 0x47b0
leaq 0x3c4b(%rip), %rsi      # 0xd403
leaq 0x98(%rsp), %rdi
leaq 0x78(%rsp), %rdx
callq 0x47b0
leaq 0x3abf(%rip), %rsi      # 0xd290
leaq 0x78(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0x47b0
leaq 0x28a5(%rip), %rsi      # 0xc08c
leaq 0x58(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x47b0
leaq 0x3a98(%rip), %rsi      # 0xd295
leaq 0x38(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x47b0
cmpl $0x2, %ebp
movq %r12, (%rsp)
jl 0x9867
leaq 0x3a7b(%rip), %r15      # 0xd297
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x30a0
cmpl $-0x1, %eax
je 0x9890
cmpl $0x76, %eax
jne 0x981c
movb $0x1, 0xcc(%r12)
movq 0xb7ad(%rip), %rdi      # 0x14ff0
leaq 0x3a51(%rip), %rsi      # 0xd29b
callq 0x32d0
movq (%rsp), %rsi
addq $0xd0, %rsi
movq %rax, %rdi
callq 0x32b0
jmp 0x98fa
cmpl $0x1, %ebp
jne 0x9a35
movq 0xb779(%rip), %rdi      # 0x14ff0
leaq 0x3af7(%rip), %rsi      # 0xd375
callq 0x32d0
movq %rax, %rdi
callq 0x3150
jmp 0x9a35
movq 0xb739(%rip), %rbx      # 0x14fd0
movl $0x1, (%rbx)
leaq 0x3a01(%rip), %r15      # 0xd2a5
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x30a0
cmpl $-0x1, %eax
je 0x9907
cmpl $0x68, %eax
jne 0x98a4
movb $0x1, 0x50(%r12)
leaq 0x10(%r12), %rsi
movq 0xb723(%rip), %rdi      # 0x14ff0
callq 0x32b0
movq %rax, %rdi
callq 0x3150
movq %rax, %rdi
callq 0x3150
movq (%rsp), %rsi
addq $0x30, %rsi
movq %rax, %rdi
callq 0x32b0
movq %rax, %rdi
callq 0x3150
movq %rax, %rdi
callq 0x3150
jmp 0x9ce1
movl $0x1, (%rbx)
leaq 0x88(%r12), %rax
movq %rax, 0x30(%rsp)
addq $0x58, %r12
leaq 0x3984(%rip), %r13      # 0xd2a9
leaq 0x29f4(%rip), %rbx      # 0xc320
movl %ebp, %edi
movq %r14, %rsi
movq %r13, %rdx
callq 0x30a0
movl %eax, %r15d
leal -0x3f(%r15), %eax
cmpl $0x37, %eax
ja 0x9a2b
movslq (%rbx,%rax,4), %rax
addq %rbx, %rax
movq %r12, %rdi
jmpq *%rax
movq (%rsp), %rax
movb $0x1, 0x8(%rax)
jmp 0x992c
leaq 0x58(%rsp), %rdi
jmp 0x9a17
leaq 0x118(%rsp), %rdi
jmp 0x9a17
movq (%rsp), %rax
movb $0x1, 0xd(%rax)
jmp 0x992c
movq (%rsp), %rax
movb $0x0, 0xb(%rax)
jmp 0x992c
leaq 0xb8(%rsp), %rdi
jmp 0x9a17
movq (%rsp), %rax
movb $0x1, 0x9(%rax)
jmp 0x992c
leaq 0x98(%rsp), %rdi
jmp 0x9a17
leaq 0xf8(%rsp), %rdi
jmp 0x9a17
leaq 0xd8(%rsp), %rdi
jmp 0x9a17
movq (%rsp), %rax
movb $0x1, 0xc(%rax)
jmp 0x992c
leaq 0x158(%rsp), %rdi
jmp 0x9a17
movq (%rsp), %rax
movb $0x1, 0xa(%rax)
jmp 0x992c
movq (%rsp), %rax
movb $0x1, 0xe(%rax)
jmp 0x992c
leaq 0x138(%rsp), %rdi
jmp 0x9a17
movq 0x30(%rsp), %rdi
jmp 0x9a17
leaq 0x78(%rsp), %rdi
jmp 0x9a17
leaq 0x38(%rsp), %rdi
jmp 0x9a17
leaq 0x178(%rsp), %rdi
movq 0xb582(%rip), %rax      # 0x14fa0
movq (%rax), %rsi
callq 0x35b0
jmp 0x992c
cmpl $-0x1, %r15d
jne 0x9dea
movq 0xb594(%rip), %rbx      # 0x14fd0
cmpl %ebp, (%rbx)
jl 0x9e16
leaq 0x2d8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x33f0
leaq 0x2d8(%rsp), %rsi
callq 0xa2f2
movq (%rsp), %rcx
movl %eax, 0xc8(%rcx)
leaq 0x2d8(%rsp), %rdi
callq 0x35d8
leaq 0x2b8(%rsp), %rdi
leaq 0x178(%rsp), %rsi
callq 0x33f0
leaq 0x2b8(%rsp), %rsi
movq (%rsp), %rdi
callq 0xa342
leaq 0x2b8(%rsp), %rdi
callq 0x35d8
leaq 0x298(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x33f0
leaq 0x298(%rsp), %rsi
callq 0xa2f2
movq (%rsp), %rcx
movl %eax, 0x78(%rcx)
leaq 0x298(%rsp), %rdi
callq 0x35d8
leaq 0x278(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0x33f0
leaq 0x278(%rsp), %rsi
callq 0xa2f2
movq (%rsp), %rcx
movl %eax, 0x7c(%rcx)
leaq 0x278(%rsp), %rdi
callq 0x35d8
leaq 0x258(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x33f0
leaq 0x258(%rsp), %rsi
callq 0xa2f2
movq (%rsp), %rcx
movl %eax, 0x80(%rcx)
leaq 0x258(%rsp), %rdi
callq 0x35d8
leaq 0x238(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x33f0
leaq 0x238(%rsp), %rsi
callq 0xa2f2
movq (%rsp), %rcx
movl %eax, 0x84(%rcx)
leaq 0x238(%rsp), %rdi
callq 0x35d8
leaq 0x218(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x33f0
leaq 0x218(%rsp), %rsi
callq 0xa2f2
movq (%rsp), %rcx
movl %eax, 0xb4(%rcx)
leaq 0x218(%rsp), %rdi
callq 0x35d8
leaq 0x1f8(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x33f0
leaq 0x1f8(%rsp), %rsi
callq 0xa2f2
movq (%rsp), %rcx
movl %eax, 0xb8(%rcx)
leaq 0x1f8(%rsp), %rdi
callq 0x35d8
leaq 0x1d8(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x33f0
leaq 0x1d8(%rsp), %rsi
callq 0xa2f2
movq (%rsp), %rcx
movl %eax, 0xb0(%rcx)
leaq 0x1d8(%rsp), %rdi
callq 0x35d8
leaq 0x1b8(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x33f0
leaq 0x1b8(%rsp), %rsi
movq (%rsp), %rdi
callq 0xa44c
leaq 0x1b8(%rsp), %rdi
callq 0x35d8
leaq 0x198(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x33f0
leaq 0x198(%rsp), %rsi
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0xa5ec
leaq 0x198(%rsp), %rdi
callq 0x35d8
movq %rbx, %rdi
callq 0xa890
movq %rbx, %rdi
callq 0xa8bc
movq (%rsp), %rdi
callq 0xa928
movq (%rsp), %rdi
callq 0xa9fe
movq (%rsp), %rax
leaq 0x58(%rax), %rdi
leaq 0x2562(%rip), %rsi      # 0xc22c
callq 0xad78
movq (%rsp), %rsi
movzbl 0xb(%rsi), %ecx
xorl %edx, %edx
testb %al, %al
cmovnel %ecx, %edx
movb %dl, 0xb(%rsi)
leaq 0x38(%rsp), %rdi
callq 0x35d8
leaq 0x58(%rsp), %rdi
callq 0x35d8
leaq 0x78(%rsp), %rdi
callq 0x35d8
leaq 0x98(%rsp), %rdi
callq 0x35d8
leaq 0xb8(%rsp), %rdi
callq 0x35d8
leaq 0xd8(%rsp), %rdi
callq 0x35d8
leaq 0xf8(%rsp), %rdi
callq 0x35d8
leaq 0x118(%rsp), %rdi
callq 0x35d8
leaq 0x138(%rsp), %rdi
callq 0x35d8
leaq 0x158(%rsp), %rdi
callq 0x35d8
leaq 0x178(%rsp), %rdi
callq 0x35d8
addq $0x338, %rsp            # imm = 0x338
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xb238(%rip), %rax      # 0x14fb8
movl (%rax), %ebp
cmpl $0x63, %ebp
jne 0x9daf
movq 0xb23a(%rip), %rax      # 0x14fc8
movq (%rax), %rdi
leaq 0x3535(%rip), %rsi      # 0xd2cd
pushq $0x63
popq %rdx
xorl %eax, %eax
callq 0x3420
movq (%rsp), %rax
movb $0x1, 0x50(%rax)
jmp 0x9ce1
movl %ebp, %edi
callq 0x3560
movq 0xb20b(%rip), %rcx      # 0x14fc8
movq (%rcx), %rdi
testl %eax, %eax
movq (%rsp), %rbx
jne 0x9dd1
leaq 0x3563(%rip), %rsi      # 0xd332
jmp 0x9dd8
leaq 0x352d(%rip), %rsi      # 0xd305
movl %ebp, %edx
xorl %eax, %eax
callq 0x3420
movb $0x1, 0x50(%rbx)
jmp 0x9ce1
movq 0xb1cf(%rip), %rdi      # 0x14fc0
leaq 0x3572(%rip), %rsi      # 0xd36a
callq 0x32d0
movsbl %r15b, %esi
movq %rax, %rdi
callq 0x3350
movq %rax, %rdi
callq 0x3150
callq 0x31a0
leaq 0x359f(%rip), %rsi      # 0xd3bc
leaq 0x10(%rsp), %rdi
leaq 0x2f8(%rsp), %rdx
callq 0x47b0
movl (%rbx), %r15d
movl %ebp, %r12d
leaq 0x318(%rsp), %rbx
leaq 0x2f8(%rsp), %r13
leaq 0x10(%rsp), %rbp
cmpq %r12, %r15
jae 0x9e92
movq (%r14,%r15,8), %rsi
movq %rbx, %rdi
leaq 0xf(%rsp), %rdx
callq 0x47b0
movq %r13, %rdi
leaq 0x2208(%rip), %rsi      # 0xc072
movq %rbx, %rdx
callq 0xad54
movq %rbp, %rdi
movq %r13, %rsi
callq 0x35c0
movq %r13, %rdi
callq 0x35d8
movq %rbx, %rdi
callq 0x35d8
incq %r15
jmp 0x9e4a
pushq $0x20
popq %rdi
callq 0x3160
leaq 0x10(%rax), %rdx
movq %rdx, (%rax)
leaq 0x20(%rsp), %rcx
movq -0x10(%rcx), %rsi
cmpq %rcx, %rsi
jne 0x9eb7
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
jmp 0x9ec3
movq %rsi, (%rax)
movq 0x20(%rsp), %rdx
movq %rdx, 0x10(%rax)
movq 0x18(%rsp), %rdx
movq %rdx, 0x8(%rax)
movq %rcx, 0x10(%rsp)
andq $0x0, 0x18(%rsp)
movb $0x0, 0x20(%rsp)
leaq 0xae8d(%rip), %rsi      # 0x14d70
movq 0xb0ae(%rip), %rdx      # 0x14f98
movq %rax, %rdi
callq 0x3520
movq %rax, %rbx
leaq 0x2f8(%rsp), %rdi
callq 0x35d8
jmp 0x9f07
movq %rax, %rbx
leaq 0x318(%rsp), %rdi
callq 0x35d8
jmp 0x9f1b
jmp 0x9f18
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x9fba
jmp 0x9ff5
movq %rax, %rbx
leaq 0x198(%rsp), %rdi
jmp 0x9fba
movq %rax, %rbx
leaq 0x1b8(%rsp), %rdi
jmp 0x9fba
movq %rax, %rbx
leaq 0x1d8(%rsp), %rdi
jmp 0x9fba
movq %rax, %rbx
leaq 0x1f8(%rsp), %rdi
jmp 0x9fba
movq %rax, %rbx
leaq 0x218(%rsp), %rdi
jmp 0x9fba
movq %rax, %rbx
leaq 0x238(%rsp), %rdi
jmp 0x9fba
movq %rax, %rbx
leaq 0x258(%rsp), %rdi
jmp 0x9fba
movq %rax, %rbx
leaq 0x278(%rsp), %rdi
jmp 0x9fba
movq %rax, %rbx
leaq 0x298(%rsp), %rdi
jmp 0x9fba
movq %rax, %rbx
leaq 0x2b8(%rsp), %rdi
jmp 0x9fba
movq %rax, %rbx
leaq 0x2d8(%rsp), %rdi
callq 0x35d8
jmp 0x9ff8
movq %rax, %rbx
jmp 0xa002
movq %rax, %rbx
jmp 0xa00c
movq %rax, %rbx
jmp 0xa016
movq %rax, %rbx
jmp 0xa023
movq %rax, %rbx
jmp 0xa030
movq %rax, %rbx
jmp 0xa03d
movq %rax, %rbx
jmp 0xa04a
movq %rax, %rbx
jmp 0xa057
movq %rax, %rbx
jmp 0xa064
movq %rax, %rbx
jmp 0xa071
jmp 0x9ff5
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x35d8
leaq 0x58(%rsp), %rdi
callq 0x35d8
leaq 0x78(%rsp), %rdi
callq 0x35d8
leaq 0x98(%rsp), %rdi
callq 0x35d8
leaq 0xb8(%rsp), %rdi
callq 0x35d8
leaq 0xd8(%rsp), %rdi
callq 0x35d8
leaq 0xf8(%rsp), %rdi
callq 0x35d8
leaq 0x118(%rsp), %rdi
callq 0x35d8
leaq 0x138(%rsp), %rdi
callq 0x35d8
leaq 0x158(%rsp), %rdi
callq 0x35d8
leaq 0x178(%rsp), %rdi
callq 0x35d8
movq %rbx, %rdi
callq 0x3550