// File: /workspace/github_c_makefile_star2_O0/sheneman[P]clearcut/getopt_long.c
// Function: has_argument_short
static int
has_argument_short(char *arg, const char *shortopts)
{
    int i;
    int open_bracket = 0;
    for (i = 0; shortopts[i]; i++) {
        switch (shortopts[i]) {
        case '[':
            open_bracket++;
            continue;
        case ']':
            if (open_bracket <= 0) {
                fprintf(stderr, "getopt_long() -- unbalanced bracket in short options");
                return -1;
            }
            open_bracket--;
            continue;
        }
        if (open_bracket) continue;
        if (*arg != shortopts[i]) continue;

        switch (shortopts[i+1]) {
        case ':':
            if (shortopts[i+2] != ':') {
                if (arg[1])
                    return 1; /* following string is argument */
                else
                    return 2; /* next argv is argument */
            }
            else {
                /* '::' means optional argument (GNU extention) */
                if (arg[1])
                    return 1;
                else
                    return 0; /* no argument */
            }
        case '[':
            if (arg[1] == '\0')
                return 0;   /* no argument */
            /* my extention */
            for (i++; shortopts[i] && shortopts[i] != ']'; i++) {
                if (arg[1] == shortopts[i])
                    return 3; /* has 1 byte argument */
            }
            if (!shortopts[i]) {
                fprintf(stderr, "getopt_long() -- unbalanced bracket in short options");
                return -1;
            }
            break;
        default:
            return 0;   /* no argument */
        }
    }
    /* Invalid option */
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x9fa9
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x24(%rbp)
subl $0x5b, %eax
je 0x9df0
jmp 0x9de6
movl -0x24(%rbp), %eax
subl $0x5d, %eax
je 0x9dfe
jmp 0x9e36
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x9f9b
cmpl $0x0, -0x20(%rbp)
jg 0x9e28
movq 0x51ed(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x2ccb(%rip), %rsi      # 0xcae0
movb $0x0, %al
callq 0x2150
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x9fb0
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x9f9b
cmpl $0x0, -0x20(%rbp)
je 0x9e41
jmp 0x9f9b
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
movq -0x18(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
je 0x9e5d
jmp 0x9f9b
movq -0x18(%rbp), %rcx
movslq -0x1c(%rbp), %rax
movsbl 0x1(%rax,%rcx), %eax
movl %eax, -0x28(%rbp)
subl $0x3a, %eax
je 0x9e81
jmp 0x9e74
movl -0x28(%rbp), %eax
subl $0x5b, %eax
je 0x9edb
jmp 0x9f90
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3a, %eax
je 0x9eb9
movq -0x10(%rbp), %rax
cmpb $0x0, 0x1(%rax)
je 0x9ead
movl $0x1, -0x4(%rbp)
jmp 0x9fb0
movl $0x2, -0x4(%rbp)
jmp 0x9fb0
movq -0x10(%rbp), %rax
cmpb $0x0, 0x1(%rax)
je 0x9ecf
movl $0x1, -0x4(%rbp)
jmp 0x9fb0
movl $0x0, -0x4(%rbp)
jmp 0x9fb0
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x9ef4
movl $0x0, -0x4(%rbp)
jmp 0x9fb0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x29(%rbp)
je 0x9f28
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x5d, %eax
setne %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x9f31
jmp 0x9f5f
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
movq -0x18(%rbp), %rcx
movslq -0x1c(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jne 0x9f52
movl $0x3, -0x4(%rbp)
jmp 0x9fb0
jmp 0x9f54
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x9efd
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
jne 0x9f8e
movq 0x5084(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x2b62(%rip), %rsi      # 0xcae0
movb $0x0, %al
callq 0x2150
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x9fb0
jmp 0x9f99
movl $0x0, -0x4(%rbp)
jmp 0x9fb0
jmp 0x9f9b
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x9dbe
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)