// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x411a
leaq 0x11705a(%rip), %rax    # 0x11b170
movq %rax, -0x8(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x417a
cmpl $0x0, -0x24(%rbp)
jle 0x413d
jmp 0x415c
leaq 0xf0a3(%rip), %rdi      # 0x131e7
leaq 0xf0a5(%rip), %rsi      # 0x131f0
movl $0xe4, %edx
leaq 0xf0a3(%rip), %rcx      # 0x131fa
callq 0x2130
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0x4040
movq -0x10(%rbp), %rdi
callq 0x40a0
movl $0x1, -0x34(%rbp)
jmp 0x41ac
cmpq $0x0, 0x11703e(%rip)    # 0x11b1c0
je 0x4186
jmp 0x41a5
leaq 0xf0b0(%rip), %rdi      # 0x1323d
leaq 0xf05c(%rip), %rsi      # 0x131f0
movl $0xe9, %edx
leaq 0xf05a(%rip), %rcx      # 0x131fa
callq 0x2130
movl $0x0, -0x34(%rbp)
jmp 0x41ae
movl -0x34(%rbp), %ecx
xorl %eax, %eax
cmpl -0x24(%rbp), %ecx
movb %al, -0x61(%rbp)
jge 0x41d3
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
sete %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x41df
jmp 0x4436
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpb $0x0, 0x1(%rax)
jne 0x41fe
jmp 0x4436
movq -0x40(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x2d, %eax
je 0x4338
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movsbl (%rax), %esi
callq 0x4460
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %edx
xorl %eax, %eax
leaq 0xef83(%rip), %rcx      # 0x131c4
testb $0x1, (%rcx,%rdx)
movb %al, -0x62(%rbp)
jne 0x425b
movq -0x40(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x62(%rbp)
movb -0x62(%rbp), %al
testb $0x1, %al
jne 0x4264
jmp 0x4293
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4500
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x40(%rbp)
movsbl 0x1(%rax), %esi
callq 0x4460
movq %rax, -0x48(%rbp)
jmp 0x422f
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %ecx
leaq 0xef15(%rip), %rax      # 0x131c4
testb $0x1, (%rax,%rcx)
je 0x4302
movq -0x50(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x4300
movq -0x30(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x34(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x42e9
movq -0x50(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x42fe
movq -0x40(%rbp), %rax
movsbl (%rax), %esi
leaq 0xef54(%rip), %rdi      # 0x1324b
movb $0x0, %al
callq 0x3d00
jmp 0x4300
jmp 0x4326
movq -0x50(%rbp), %rax
cmpb $0x0, (%rax)
je 0x4324
movq -0x40(%rbp), %rax
movsbl (%rax), %esi
movq -0x50(%rbp), %rdx
leaq 0xef4e(%rip), %rdi      # 0x1326b
movb $0x0, %al
callq 0x3d00
jmp 0x4326
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x4500
jmp 0x4424
movq -0x40(%rbp), %rax
cmpb $0x0, 0x2(%rax)
jne 0x4350
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x4436
movq -0x40(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movl $0x3d, %esi
callq 0x20f0
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x4387
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x58(%rbp)
movb $0x0, (%rax)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x4660
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %ecx
leaq 0xee1c(%rip), %rax      # 0x131c4
testb $0x1, (%rax,%rcx)
je 0x43f6
cmpq $0x0, -0x58(%rbp)
jne 0x43f4
movq -0x30(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x34(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x43e0
movq -0x58(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x43f2
movq -0x40(%rbp), %rsi
leaq 0xeeb1(%rip), %rdi      # 0x1329c
movb $0x0, %al
callq 0x3d00
jmp 0x43f4
jmp 0x4415
cmpq $0x0, -0x58(%rbp)
je 0x4413
movq -0x40(%rbp), %rsi
movq -0x58(%rbp), %rdx
leaq 0xeeb1(%rip), %rdi      # 0x132bd
movb $0x0, %al
callq 0x3d00
jmp 0x4415
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x4500
jmp 0x4424
jmp 0x4426
jmp 0x4428
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x41ae
movl -0x34(%rbp), %edx
movq -0x18(%rbp), %rax
movl (%rax), %ecx
subl %edx, %ecx
movl %ecx, (%rax)
movl -0x34(%rbp), %edx
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movslq %edx, %rdx
shlq $0x3, %rdx
addq %rdx, %rcx
movq %rcx, (%rax)
addq $0x70, %rsp
popq %rbp
retq