// File: /workspace/github_c_makefile_star2_O1/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
movq %rcx, %r14
testq %rdi, %rdi
leaq 0x10db05(%rip), %rbx    # 0x111170
cmovneq %rdi, %rbx
movq %rsi, %rbp
movq %rdx, 0x18(%rsp)
movl (%rdx), %ecx
movq (%r14), %rax
movq %rax, 0x8(%rsp)
testq %rsi, %rsi
movl %ecx, 0x4(%rsp)
movq %r14, 0x20(%rsp)
je 0x36d8
testl %ecx, %ecx
jle 0x390e
movq 0x8(%rsp), %rax
movq (%rax), %r15
movq %r15, %rdi
movl $0x2f, %esi
callq 0x2120
testq %rax, %rax
je 0x36bd
cmpb $0x0, 0x1(%rax)
je 0x36bd
incq %rax
movq %rax, %r15
movq %r15, 0x10da84(%rip)    # 0x111148
movq %rbp, %rdi
callq 0x35a0
movl $0x1, %r14d
movl 0x4(%rsp), %ecx
jmp 0x36e9
xorl %r14d, %r14d
cmpq $0x0, 0x10dadd(%rip)    # 0x1111c0
je 0x3952
cmpl %ecx, %r14d
jge 0x38bb
movq %rbp, 0x10(%rsp)
movslq %r14d, %r12
movq 0x8(%rsp), %rax
movq (%rax,%r12,8), %r13
cmpb $0x2d, (%r13)
jne 0x38bb
movzbl 0x1(%r13), %eax
testl %eax, %eax
je 0x3806
cmpl $0x2d, %eax
jne 0x3753
cmpb $0x0, 0x2(%r13)
je 0x3803
addq $0x2, %r13
movq %r13, %rdi
movl $0x3d, %esi
callq 0x20f0
testq %rax, %rax
je 0x380d
movq %rax, %rbp
incq %rbp
movb $0x0, (%rax)
jmp 0x380f
leaq 0x1(%r13), %r15
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3971
movl 0x10(%rax), %ecx
leaq 0x6a58(%rip), %rdx      # 0xa1c4
movb (%rcx,%rdx), %cl
testb %cl, %cl
jne 0x37b6
cmpb $0x0, 0x2(%r13)
je 0x37b6
addq $0x2, %r13
movq %r13, %r15
movq %rax, %rdi
movq %rbp, %rsi
callq 0x39cd
movsbl (%r13), %esi
movq %rbx, %rdi
callq 0x3971
movl 0x10(%rax), %ecx
leaq 0x6a21(%rip), %rdx      # 0xa1c4
movb (%rcx,%rdx), %cl
cmpb $0x1, %cl
je 0x37b6
leaq 0x1(%r15), %r13
cmpb $0x0, 0x1(%r15)
jne 0x377e
leaq 0x1(%r15), %rdx
movb 0x1(%r15), %sil
testb %cl, %cl
je 0x37e8
testb %sil, %sil
jne 0x37f1
movq 0x8(%rsp), %rcx
movq 0x8(%rcx,%r12,8), %rdx
testq %rdx, %rdx
je 0x38fc
cmpb $0x2d, (%rdx)
je 0x38fc
incl %r14d
jmp 0x37f1
testb %sil, %sil
jne 0x38e1
movq %rax, %rdi
movq %rdx, %rsi
callq 0x39cd
movb $0x1, %al
jmp 0x38a7
incl %r14d
xorl %eax, %eax
jmp 0x38ab
xorl %ebp, %ebp
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x3834
movq %rbx, %r15
movq %r13, %rsi
callq 0x2180
testl %eax, %eax
je 0x3852
movq 0x28(%r15), %rdi
addq $0x20, %r15
testq %rdi, %rdi
jne 0x381b
movq 0x10d91d(%rip), %rsi    # 0x111158
movq %r13, %rdi
callq 0x2180
leaq 0x10d906(%rip), %r15    # 0x111150
testl %eax, %eax
jne 0x38f3
movl 0x10(%r15), %eax
leaq 0x6967(%rip), %rcx      # 0xa1c4
cmpb $0x1, (%rax,%rcx)
jne 0x388a
testq %rbp, %rbp
jne 0x3895
movq 0x8(%rsp), %rax
movq 0x8(%rax,%r12,8), %rbp
testq %rbp, %rbp
je 0x3941
cmpb $0x2d, (%rbp)
je 0x3941
incl %r14d
jmp 0x3895
testq %rbp, %rbp
jne 0x392d
xorl %ebp, %ebp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x39cd
movb $0x1, %al
movq 0x10(%rsp), %rbp
movl 0x4(%rsp), %ecx
testb %al, %al
je 0x38bb
incl %r14d
cmpl %ecx, %r14d
jl 0x36f7
movq 0x18(%rsp), %rax
subl %r14d, (%rax)
movslq %r14d, %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
movsbl (%r15), %esi
leaq 0x697f(%rip), %rdi      # 0xa26b
xorl %eax, %eax
callq 0x3444
leaq 0x6ab8(%rip), %rdi      # 0xa3b2
jmp 0x3948
movsbl (%r15), %esi
leaq 0x6944(%rip), %rdi      # 0xa24b
xorl %eax, %eax
callq 0x3444
leaq 0x68d2(%rip), %rdi      # 0xa1e7
leaq 0x68d4(%rip), %rsi      # 0xa1f0
leaq 0x68d7(%rip), %rcx      # 0xa1fa
movl $0xe4, %edx
callq 0x2130
leaq 0x6989(%rip), %rdi      # 0xa2bd
movq %r13, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x3444
leaq 0x6954(%rip), %rdi      # 0xa29c
movq %r13, %rsi
xorl %eax, %eax
callq 0x3444
leaq 0x68e4(%rip), %rdi      # 0xa23d
leaq 0x6890(%rip), %rsi      # 0xa1f0
leaq 0x6893(%rip), %rcx      # 0xa1fa
movl $0xe9, %edx
callq 0x2130