// File: /workspace/github_c_makefile_star2_O3/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 0x10db14(%rip), %r13    # 0x111170
cmovneq %rdi, %r13
movq %rsi, %rbp
movq %rdx, 0x10(%rsp)
movl (%rdx), %ebx
movq (%rcx), %rax
movq %rax, (%rsp)
testq %rsi, %rsi
movq %rcx, 0x18(%rsp)
je 0x36bf
testl %ebx, %ebx
jle 0x38ef
movq (%rsp), %rax
movq (%rax), %r15
movq %r15, %rdi
movl $0x2f, %esi
callq 0x2120
testq %rax, %rax
je 0x36a8
cmpb $0x0, 0x1(%rax)
je 0x36a8
incq %rax
movq %rax, %r15
movq %r15, 0x10da99(%rip)    # 0x111148
movq %rbp, %rdi
callq 0x3598
movl $0x1, %r14d
jmp 0x36d0
xorl %r14d, %r14d
cmpq $0x0, 0x10daf6(%rip)    # 0x1111c0
je 0x390e
cmpl %ebx, %r14d
jge 0x3888
movq %rbp, 0x20(%rsp)
movq %r13, 0x8(%rsp)
movslq %r14d, %r12
movq (%rsp), %rax
movq (%rax,%r12,8), %r13
cmpb $0x2d, (%r13)
jne 0x3888
movzbl 0x1(%r13), %eax
cmpl $0x2d, %eax
je 0x372d
testl %eax, %eax
je 0x3888
movsbl %al, %esi
movq 0x8(%rsp), %rdi
callq 0x392d
movl 0x10(%rax), %ecx
leaq 0x6aa2(%rip), %rdx      # 0xa1c4
cmpb $0x0, (%rcx,%rdx)
je 0x3759
incq %r13
jmp 0x379f
cmpb $0x0, 0x2(%r13)
je 0x3885
addq $0x2, %r13
movq %r13, %rdi
movl $0x3d, %esi
callq 0x20f0
testq %rax, %rax
je 0x37b5
movq %rax, %rbp
incq %rbp
movb $0x0, (%rax)
jmp 0x37b7
addq $0x2, %r13
movq %r13, %r15
movq 0x8(%rsp), %r13
cmpb $0x0, (%r15)
je 0x386c
movq %rax, %rdi
movq %rbp, %rsi
callq 0x3989
movsbl (%r15), %esi
movq %r13, %rdi
callq 0x392d
movl 0x10(%rax), %ecx
incq %r15
leaq 0x6a31(%rip), %rdx      # 0xa1c4
cmpb $0x1, (%rcx,%rdx)
jne 0x3765
decq %r15
movq %r15, %r13
cmpb $0x0, 0x1(%r13)
je 0x3855
incq %r13
movq %r13, %r15
jmp 0x386c
xorl %ebp, %ebp
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0x37e3
movq 0x8(%rsp), %r15
movq %r13, %rsi
callq 0x2180
testl %eax, %eax
je 0x3801
movq 0x28(%r15), %rdi
addq $0x20, %r15
testq %rdi, %rdi
jne 0x37ca
movq 0x10d96e(%rip), %rsi    # 0x111158
movq %r13, %rdi
callq 0x2180
leaq 0x10d957(%rip), %r15    # 0x111150
testl %eax, %eax
jne 0x38ae
movl 0x10(%r15), %eax
leaq 0x69b8(%rip), %rcx      # 0xa1c4
cmpb $0x1, (%rax,%rcx)
jne 0x3838
testq %rbp, %rbp
jne 0x3843
movq (%rsp), %rax
movq 0x8(%rax,%r12,8), %rbp
testq %rbp, %rbp
je 0x38de
cmpb $0x2d, (%rbp)
je 0x38de
incl %r14d
jmp 0x3843
testq %rbp, %rbp
jne 0x38ca
xorl %ebp, %ebp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x3989
movq 0x20(%rsp), %rbp
jmp 0x3877
movq (%rsp), %rcx
movq 0x8(%rcx,%r12,8), %r15
testq %r15, %r15
je 0x38b7
cmpb $0x2d, (%r15)
je 0x38b7
incl %r14d
movq %rax, %rdi
movq %r15, %rsi
callq 0x3989
incl %r14d
cmpl %ebx, %r14d
jl 0x36e3
jmp 0x3888
incl %r14d
movq 0x10(%rsp), %rax
subl %r14d, (%rax)
movslq %r14d, %rax
shlq $0x3, %rax
movq 0x18(%rsp), %rcx
addq %rax, (%rcx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6acc(%rip), %rdi      # 0xa381
jmp 0x38e5
movsbl (%r13), %esi
leaq 0x6988(%rip), %rdi      # 0xa24b
xorl %eax, %eax
callq 0x343c
leaq 0x69bb(%rip), %rdi      # 0xa28c
movq %r13, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x343c
leaq 0x6986(%rip), %rdi      # 0xa26b
movq %r13, %rsi
xorl %eax, %eax
callq 0x343c
leaq 0x68f1(%rip), %rdi      # 0xa1e7
leaq 0x68f3(%rip), %rsi      # 0xa1f0
leaq 0x68f6(%rip), %rcx      # 0xa1fa
movl $0xe4, %edx
callq 0x2130
leaq 0x6928(%rip), %rdi      # 0xa23d
leaq 0x68d4(%rip), %rsi      # 0xa1f0
leaq 0x68d7(%rip), %rcx      # 0xa1fa
movl $0xe9, %edx
callq 0x2130