// File: /workspace/github_c_makefile_star2_O2/michaelnmmeyer[P]gourgandine/cmd/cmd.c
// Function: parse_options
void parse_options(struct option *options, const char *help,
                   int *argcp, char ***argvp)
{
   if (!options)
      options = &empty_option;

   int argc = *argcp;
   char **argv = *argvp;

   int i;
   if (help) {
      assert(argc > 0);
      set_progname(*argv);
      set_help(help);
      i = 1;
   } else {
      assert(g_help_screen);
      i = 0;
   }

   for ( ; i < argc && argv[i][0] == '-'; i++) {
      char *opt = argv[i];
      if (!opt[1]) {
         break;
      } else if (opt[1] != '-') {
         opt++;
         struct option *option = short_option(options, *opt);
         while (!needs_arg[option->type] && opt[1]) {
            handle_option(option, help);
            option = short_option(options, *++opt);
         }
         char *arg = opt + 1;
         if (needs_arg[option->type]) {
            if (!*arg) {
               arg = argv[++i];
               if (!arg || *arg == '-')
                  die("option -%c requires an argument", *opt);
            }
         } else if (*arg) {
            die("option -%c doesn't accept an argument, have '%s'", *opt, arg);
         }
         handle_option(option, arg);
      } else if (!opt[2]) {
         i++;
         break;
      } else {
         opt += 2;
         char *arg = strchr(opt, '=');
         if (arg)
            *arg++ = '\0';
         struct option *option = long_option(options, opt);
         if (needs_arg[option->type]) {
            if (!arg) {
               arg = argv[++i];
               if (!arg || *arg == '-')
                  die("option --%s requires an argument", opt);
            }
         } else if (arg) {
            die("option --%s doesn't accept an argument, have '%s'", opt, arg);
         }
         handle_option(option, arg);
      }
   }

   *argcp -= i;
   *argvp += i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rdi, %rdi
leaq 0x10dcbe(%rip), %r14    # 0x111170
cmovneq %rdi, %r14
movq %rsi, %r12
movq %rdx, 0x18(%rsp)
movl (%rdx), %ebx
movq %rcx, 0x20(%rsp)
movq (%rcx), %r15
testq %rsi, %rsi
je 0x34ea
testl %ebx, %ebx
jle 0x36de
movq (%r15), %rdi
callq 0x33d2
movq %r12, %rdi
callq 0x33f8
pushq $0x1
popq %rbp
jmp 0x34fa
xorl %ebp, %ebp
cmpq $0x0, 0x10dccc(%rip)    # 0x1111c0
je 0x36fd
movq %r15, 0x10(%rsp)
movl %ebx, 0xc(%rsp)
cmpl %ebx, %ebp
jge 0x3678
movl %ebp, 0x8(%rsp)
movslq %ebp, %rbp
movq (%r15,%rbp,8), %r13
cmpb $0x2d, (%r13)
jne 0x366c
movzbl 0x1(%r13), %eax
cmpl $0x2d, %eax
je 0x356e
testl %eax, %eax
je 0x366c
addq $0x2, %r13
movsbl %al, %esi
movq %r14, %rdi
callq 0x371c
movl 0x10(%rax), %edx
movb (%r13), %cl
leaq 0x5c74(%rip), %rsi      # 0x91c4
cmpb $0x0, (%rdx,%rsi)
jne 0x3598
testb %cl, %cl
je 0x35a0
movq %rax, %rdi
movq %r12, %rsi
callq 0x3771
movb (%r13), %al
incq %r13
jmp 0x3537
cmpb $0x0, 0x2(%r13)
je 0x3672
addq $0x2, %r13
movq %r13, %rdi
pushq $0x3d
popq %rsi
callq 0x20f0
testq %rax, %rax
je 0x35b4
movq %rax, %rbx
incq %rbx
movb $0x0, (%rax)
jmp 0x35b6
testb %cl, %cl
je 0x3652
movq %r13, %rsi
movl 0x8(%rsp), %ebp
movq %rax, %rdi
callq 0x3771
jmp 0x364b
xorl %ebx, %ebx
movq %r14, %r15
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0x35d4
movq %r13, %rsi
callq 0x2180
testl %eax, %eax
je 0x35f2
addq $0x20, %r15
jmp 0x35b9
movq 0x10db7d(%rip), %rsi    # 0x111158
movq %r13, %rdi
callq 0x2180
leaq 0x10db66(%rip), %r15    # 0x111150
testl %eax, %eax
jne 0x369d
movl 0x10(%r15), %eax
leaq 0x5bc7(%rip), %rcx      # 0x91c4
cmpb $0x1, (%rax,%rcx)
jne 0x362c
testq %rbx, %rbx
jne 0x3633
movq 0x10(%rsp), %rax
movq 0x8(%rax,%rbp,8), %rbx
testq %rbx, %rbx
je 0x36cd
cmpb $0x2d, (%rbx)
je 0x36cd
movl 0x8(%rsp), %ebp
incl %ebp
jmp 0x3637
testq %rbx, %rbx
jne 0x36a6
xorl %ebx, %ebx
movl 0x8(%rsp), %ebp
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3771
movl 0xc(%rsp), %ebx
movq 0x10(%rsp), %r15
incl %ebp
jmp 0x3503
movq 0x8(%r15,%rbp,8), %rsi
testq %rsi, %rsi
je 0x36ba
cmpb $0x2d, (%rsi)
je 0x36ba
movl 0x8(%rsp), %ebp
incl %ebp
jmp 0x35a7
movl 0x8(%rsp), %ebp
jmp 0x3678
movl 0x8(%rsp), %ebp
incl %ebp
movq 0x18(%rsp), %rax
subl %ebp, (%rax)
movslq %ebp, %rax
shlq $0x3, %rax
movq 0x20(%rsp), %rcx
addq %rax, (%rcx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5cdd(%rip), %rdi      # 0x9381
jmp 0x36d4
leaq 0x5bdf(%rip), %rdi      # 0x928c
movq %r13, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x317c
movsbl -0x1(%r13), %esi
leaq 0x5b85(%rip), %rdi      # 0x924b
xorl %eax, %eax
callq 0x317c
leaq 0x5b97(%rip), %rdi      # 0x926b
movq %r13, %rsi
xorl %eax, %eax
callq 0x317c
leaq 0x5b02(%rip), %rdi      # 0x91e7
leaq 0x5b04(%rip), %rsi      # 0x91f0
leaq 0x5b07(%rip), %rcx      # 0x91fa
movl $0xe4, %edx
callq 0x2130
leaq 0x5b39(%rip), %rdi      # 0x923d
leaq 0x5ae5(%rip), %rsi      # 0x91f0
leaq 0x5ae8(%rip), %rcx      # 0x91fa
movl $0xe9, %edx
callq 0x2130