// File: /workspace/github_c_makefile_star2_O0/jflatow[P]jfdb/src/jfdb.c
// Function: prefix_opts
static int prefix_opts(JFT_Stem *prefix, JFT_Symbol **stop, int argc, char **argv) {
  extern char *optarg;
  extern int optind, optopt;
  int opt, ptr, err = 0, omit = 1;

  static struct option options[] = {
    {"null", no_argument, NULL, 'n'},
    {"stop", no_argument, NULL, 's'},
    {"primary", no_argument, NULL, 'p'},
    {"indices", no_argument, NULL, 'i'},
    {}
  };

  // default
  prefix->pre = JFT_SYMBOL_PRIMARY;
  prefix->size = 1;

  while ((opt = getopt_long(argc, argv, "hnspi", options, &ptr)) != -1) {
    switch (opt) {
      case 'h':
        return usage(0);
      case 'n':
        omit = 0;
        break;
      case 's':
        *stop = &null;
        break;
      case 'p':
        prefix->pre = JFT_SYMBOL_PRIMARY;
        prefix->size = 1;
        break;
      case 'i':
        prefix->pre = JFT_SYMBOL_INDICES;
        prefix->size = 1;
        break;
      case ':':
        pwarn("%s: option requires an argument -- %c", argv[0], optopt);
        err++;
        break;
      case '?':
        pwarn("%s: illegal option -- %c", argv[0], optopt);
        err++;
        break;
    }
  }

  read_prefix(prefix, omit, argc - optind, argv + optind);
  return err;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x1, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq $-0x5, (%rax)
movq -0x10(%rbp), %rax
movw $0x1, 0x8(%rax)
movl -0x1c(%rbp), %edi
movq -0x28(%rbp), %rsi
leaq 0x8b08(%rip), %rdx      # 0xa600
leaq 0xc621(%rip), %rcx      # 0xe120
leaq -0x30(%rbp), %r8
callq 0x10c0
movl %eax, -0x2c(%rbp)
cmpl $-0x1, %eax
je 0x1c02
movl -0x2c(%rbp), %eax
addl $-0x3a, %eax
movl %eax, %ecx
movq %rcx, -0x40(%rbp)
subl $0x39, %eax
ja 0x1bfd
movq -0x40(%rbp), %rax
leaq 0x850c(%rip), %rcx      # 0xa040
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %edi, %edi
callq 0x1680
movl %eax, -0x4(%rbp)
jmp 0x1c35
movl $0x0, -0x38(%rbp)
jmp 0x1bfd
movq -0x18(%rbp), %rax
leaq 0xc665(%rip), %rcx      # 0xe1c8
movq %rcx, (%rax)
jmp 0x1bfd
movq -0x10(%rbp), %rax
movq $-0x5, (%rax)
movq -0x10(%rbp), %rax
movw $0x1, 0x8(%rax)
jmp 0x1bfd
movq -0x10(%rbp), %rax
movq $-0x4, (%rax)
movq -0x10(%rbp), %rax
movw $0x1, 0x8(%rax)
jmp 0x1bfd
movq 0xc458(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rdx
movq 0xc42f(%rip), %rax      # 0xdfe0
movl (%rax), %ecx
leaq 0x8a4c(%rip), %rsi      # 0xa606
movb $0x0, %al
callq 0x1140
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1bfd
movq 0xc425(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rdx
movq 0xc3fc(%rip), %rax      # 0xdfe0
movl (%rax), %ecx
leaq 0x8a40(%rip), %rsi      # 0xa62d
movb $0x0, %al
callq 0x1140
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1aea
movq -0x10(%rbp), %rdi
movl -0x38(%rbp), %esi
movl -0x1c(%rbp), %edx
movq 0xc3bd(%rip), %rax      # 0xdfd0
subl (%rax), %edx
movq -0x28(%rbp), %rcx
movq 0xc3b0(%rip), %rax      # 0xdfd0
movslq (%rax), %rax
shlq $0x3, %rax
addq %rax, %rcx
callq 0x2d30
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop