// File: /workspace/github_c_makefile_star2_O0/JimKent[P]linearSat/lib/options.c
// Function: parseAnOption
static boolean parseAnOption(struct hash *hash, char *arg, struct optionSpec *optionSpecs)
/* Parse a single option argument and add to the hash, validating if
 * optionSpecs is not NULL.  Return TRUE if it's arg is an option argument
 * FALSE if it's not.
 */
{
char *name, *val;
char *eqPtr = strchr(arg, '=');

if (!((eqPtr != NULL) || (arg[0] == '-')))
    return FALSE;  /* not an option */

/* A dash by itself is not an option.   It can mean
 * negative strand for some of the DNA oriented utilities. */
if (arg[0] == '-' && (arg[1] == 0 || isspace(arg[1])))
    return FALSE;

/* We treat this=that as an option only if the '=' happens before any non-alphanumeric
 * characters.  This lets us have URLs and SQL statements in the command line even though
 * they can have equals in them. */
if (eqPtr != NULL)
    {
    char *s, c;
    for (s=arg; s < eqPtr; ++s)
        {
	c = *s;
	if (c != '_' && c != '-' && !isalnum(c))
	    return FALSE;
	}
    }

name = arg;
if (name[0] == '-')
    name++;
if (eqPtr != NULL)
    {
    *eqPtr = '\0';
    val = eqPtr+1;
    }
else
    val = NULL;

if (optionSpecs != NULL)
    validateOption(name, val, optionSpecs);
if (val == NULL)
    val = "on";
if (optionSpecs == NULL)
    hashAdd(hash, name, val);
else
    {
    struct optionSpec *spec = matchingOption(name, optionSpecs);
    if (spec != NULL && (spec->flags & OPTION_MULTI))    /* process multiple instances of option */
        parseMultiOption(hash, name, val, spec);
    else
        hashAdd(hash, name, val);
    }

if (eqPtr != NULL)
    *eqPtr = '=';
return TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movl $0x3d, %esi
callq 0x3250
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x17d05
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x17d05
movl $0x0, -0x4(%rbp)
jmp 0x17ea6
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x17d4b
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
je 0x17d3f
callq 0x3760
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movsbl 0x1(%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x17d4b
movl $0x0, -0x4(%rbp)
jmp 0x17ea6
cmpq $0x0, -0x38(%rbp)
je 0x17db8
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x17db6
movq -0x40(%rbp), %rax
movb (%rax), %al
movb %al, -0x41(%rbp)
movsbl -0x41(%rbp), %eax
cmpl $0x5f, %eax
je 0x17da6
movsbl -0x41(%rbp), %eax
cmpl $0x2d, %eax
je 0x17da6
callq 0x3760
movq (%rax), %rax
movsbl -0x41(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x17da6
movl $0x0, -0x4(%rbp)
jmp 0x17ea6
jmp 0x17da8
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x17d5a
jmp 0x17db8
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x17dd8
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x17df4
movq -0x38(%rbp), %rax
movb $0x0, (%rax)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x17dfc
movq $0x0, -0x30(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x17e14
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x17eb0
cmpq $0x0, -0x30(%rbp)
jne 0x17e26
leaq 0xf224(%rip), %rax      # 0x27046
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x17e40
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x10900
jmp 0x17e91
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x17890
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x17e7e
movq -0x50(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x17e7e
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x50(%rbp), %rcx
callq 0x18150
jmp 0x17e8f
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x10900
jmp 0x17e91
cmpq $0x0, -0x38(%rbp)
je 0x17e9f
movq -0x38(%rbp), %rax
movb $0x3d, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nop