// File: gjoni[P]iPot/src/Options.cpp
// Function: GetOpts(int, char**, OPTS&)
bool GetOpts(int argc, char *argv[], OPTS &opts) {

	char tmp;
	while ((tmp = getopt(argc, argv, "hs:r:l:t:d:")) != -1) {
		switch (tmp) {
		case 'h': /* help */
			printf("!!! HELP !!!\n");
			return false;
			break;
		case 'r': /* receptor file */
			opts.rec = std::string(optarg);
			break;
		case 'l': /* ligand file */
			opts.lig = std::string(optarg);
			break;
		case 't': /* table file */
			opts.table = std::string(optarg);
			break;
		case 'd': /* distance cutoff */
			opts.dmax = atof(optarg);
			break;
		default:
			return false;
			break;
		}
	}

	if (opts.rec == "") {
		printf("Error: receptor file not specified ('-r')\n");
		return false;
	}

	return true;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x1ac54(%rip), %rdx     # 0x33198
callq 0x30c0
movb %al, -0x19(%rbp)
movsbl %al, %eax
cmpl $-0x1, %eax
je 0x18740
movsbl -0x19(%rbp), %eax
addl $-0x64, %eax
movl %eax, %ecx
movq %rcx, -0xb0(%rbp)
subl $0x10, %eax
ja 0x18735
movq -0xb0(%rbp), %rax
leaq 0x1aa85(%rip), %rcx     # 0x33004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1ac15(%rip), %rdi     # 0x331a4
movb $0x0, %al
callq 0x3070
movb $0x0, -0x1(%rbp)
jmp 0x1876e
movq 0x35a2a(%rip), %rax     # 0x4dfd0
movq (%rax), %rax
movq %rax, -0xc0(%rbp)
leaq -0x41(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x3470
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
leaq -0x40(%rbp), %rdi
callq 0x18790
jmp 0x185d9
movq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x3350
leaq -0x40(%rbp), %rdi
callq 0x3190
leaq -0x41(%rbp), %rdi
callq 0x32e0
jmp 0x1873b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x41(%rbp), %rdi
callq 0x32e0
jmp 0x1877c
movq 0x359b2(%rip), %rax     # 0x4dfd0
movq (%rax), %rax
movq %rax, -0xd0(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x3470
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
leaq -0x78(%rbp), %rdi
callq 0x18790
jmp 0x18651
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
leaq -0x78(%rbp), %rsi
callq 0x3350
leaq -0x78(%rbp), %rdi
callq 0x3190
leaq -0x79(%rbp), %rdi
callq 0x32e0
jmp 0x1873b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x79(%rbp), %rdi
callq 0x32e0
jmp 0x1877c
movq 0x35936(%rip), %rax     # 0x4dfd0
movq (%rax), %rax
movq %rax, -0xe0(%rbp)
leaq -0xa1(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x3470
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
callq 0x18790
jmp 0x186d3
movq -0x18(%rbp), %rdi
addq $0x40, %rdi
leaq -0xa0(%rbp), %rsi
callq 0x3350
leaq -0xa0(%rbp), %rdi
callq 0x3190
leaq -0xa1(%rbp), %rdi
callq 0x32e0
jmp 0x1873b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xa1(%rbp), %rdi
callq 0x32e0
jmp 0x1877c
movq 0x358ae(%rip), %rax     # 0x4dfd0
movq (%rax), %rdi
callq 0x3370
movq -0x18(%rbp), %rax
movsd %xmm0, 0x60(%rax)
jmp 0x1873b
movb $0x0, -0x1(%rbp)
jmp 0x1876e
jmp 0x18536
movq -0x18(%rbp), %rdi
leaq 0x1a922(%rip), %rsi     # 0x3306d
callq 0x18840
testb $0x1, %al
jne 0x18756
jmp 0x1876a
leaq 0x1aa55(%rip), %rdi     # 0x331b2
movb $0x0, %al
callq 0x3070
movb $0x0, -0x1(%rbp)
jmp 0x1876e
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xe0, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x3460
nopw %cs:(%rax,%rax)
nop