// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/options.c
// Function: parseAnOption
static boolean parseAnOption(struct hash *hash, char *arg, struct optionSpec *optionSpecs, boolean keepNumbers)
/* 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.  If boolean keepNumbers is set, then return FALSE 
 * when encountering negative ints or floats.
 */
{
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;

if ((keepNumbers) && (arg[0] == '-'))
    {
    int i = 1;
    int num_dec = 0;
    int num_dig = 0;
    int num_other = 0;
    while (i < strlen(arg))
	{
	if (isdigit(arg[i]))
	    num_dig++;
	else if (arg[i] == '.')
	    num_dec++;
	else
	    num_other++;
	i++;
	}
	if ((num_dig > 0) && (num_dec < 2) && (num_other == 0))
	    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 $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq -0x18(%rbp), %rdi
movl $0x3d, %esi
callq 0x6260
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x49e38
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x49e38
movl $0x0, -0x4(%rbp)
jmp 0x4a0ae
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x49e7e
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
je 0x49e72
callq 0x6780
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 0x49e7e
movl $0x0, -0x4(%rbp)
jmp 0x4a0ae
cmpl $0x0, -0x24(%rbp)
je 0x49f53
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x49f53
movl $0x1, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x50(%rbp)
movslq -0x44(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rdi
callq 0x62c0
movq %rax, %rcx
movq -0x70(%rbp), %rax
cmpq %rcx, %rax
jae 0x49f33
callq 0x6780
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movslq -0x44(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x49f01
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x49f28
movq -0x18(%rbp), %rax
movslq -0x44(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2e, %eax
jne 0x49f1d
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x49f26
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x49f28
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x49eb4
cmpl $0x0, -0x4c(%rbp)
jle 0x49f51
cmpl $0x2, -0x48(%rbp)
jge 0x49f51
cmpl $0x0, -0x50(%rbp)
jne 0x49f51
movl $0x0, -0x4(%rbp)
jmp 0x4a0ae
jmp 0x49f53
cmpq $0x0, -0x40(%rbp)
je 0x49fc0
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x49fbe
movq -0x58(%rbp), %rax
movb (%rax), %al
movb %al, -0x59(%rbp)
movsbl -0x59(%rbp), %eax
cmpl $0x5f, %eax
je 0x49fae
movsbl -0x59(%rbp), %eax
cmpl $0x2d, %eax
je 0x49fae
callq 0x6780
movq (%rax), %rax
movsbl -0x59(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x49fae
movl $0x0, -0x4(%rbp)
jmp 0x4a0ae
jmp 0x49fb0
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x49f62
jmp 0x49fc0
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x49fe0
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x49ffc
movq -0x40(%rbp), %rax
movb $0x0, (%rax)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x4a004
movq $0x0, -0x38(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x4a01c
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x4a0c0
cmpq $0x0, -0x38(%rbp)
jne 0x4a02e
leaq 0x8d78e(%rip), %rax     # 0xd77b8
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x4a048
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x39230
jmp 0x4a099
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x499c0
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0x4a086
movq -0x68(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x4a086
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x68(%rbp), %rcx
callq 0x4a340
jmp 0x4a097
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x39230
jmp 0x4a099
cmpq $0x0, -0x40(%rbp)
je 0x4a0a7
movq -0x40(%rbp), %rax
movb $0x3d, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)