// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r15
movl %edx, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdi, %rbx
movq $-0x5, (%rdi)
movw $0x1, 0x8(%rdi)
pushq $0x1
popq %rax
movl %eax, 0xc(%rsp)
leaq 0x72f2(%rip), %rbp      # 0x9130
leaq 0x44(%rsp), %r12
leaq 0x4206(%rip), %r13      # 0x6050
xorl %r14d, %r14d
movl 0x8(%rsp), %edi
movq %r15, %rsi
leaq 0x46bf(%rip), %rdx      # 0x651a
movq %rbp, %rcx
movq %r12, %r8
callq 0x10e0
leal -0x68(%rax), %ecx
cmpl $0xb, %ecx
ja 0x1ea7
movslq (%r13,%rcx,4), %rax
addq %r13, %rax
jmpq *%rax
movq $-0x4, (%rbx)
movw $0x1, 0x8(%rbx)
jmp 0x1e4d
movq 0x10(%rsp), %rax
leaq 0x7345(%rip), %rcx      # 0x91d8
movq %rcx, (%rax)
jmp 0x1e4d
movq $-0x5, (%rbx)
movw $0x1, 0x8(%rbx)
jmp 0x1e4d
cmpl $-0x1, %eax
je 0x1f1c
cmpl $0x3a, %eax
je 0x1ee2
cmpl $0x3f, %eax
jne 0x1e4d
movq 0x713b(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
movq (%r15), %rdx
movq 0x7116(%rip), %rax      # 0x8fe0
movl (%rax), %ecx
leaq 0x4674(%rip), %rsi      # 0x6547
jmp 0x1eff
movl $0x0, 0xc(%rsp)
jmp 0x1e4d
movq 0x710f(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
movq (%r15), %rdx
movq 0x70ea(%rip), %rax      # 0x8fe0
movl (%rax), %ecx
leaq 0x4621(%rip), %rsi      # 0x6520
xorl %eax, %eax
callq 0x1160
incl %r14d
jmp 0x1e4d
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x187f
jmp 0x1fd1
movq %rbx, 0x20(%rsp)
movl %r14d, 0x1c(%rsp)
movq 0x70a3(%rip), %rax      # 0x8fd0
movslq (%rax), %rcx
movl 0x8(%rsp), %eax
subl %ecx, %eax
movq %rcx, 0x28(%rsp)
leaq (%r15,%rcx,8), %rcx
movq %rcx, 0x30(%rsp)
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
movq %rax, 0x38(%rsp)
xorl %ebx, %ebx
movq 0x20(%rsp), %rbp
cmpq %rcx, 0x38(%rsp)
je 0x1fa9
movq 0x30(%rsp), %rax
movq (%rax,%rcx,8), %r15
movq %r15, %rdi
movq %rcx, 0x10(%rsp)
callq 0x10c0
movq %rax, %r12
movzwl %bx, %r14d
movq 0x10(%rbp), %rdi
addq %r14, %rdi
movzwl %r12w, %r13d
movq %r15, %rsi
movq %r13, %rdx
callq 0x1170
movq 0x10(%rsp), %rcx
addq 0x10(%rbp), %r13
movb $0x0, (%r14,%r13)
addl %r12d, %ebx
incl %ebx
incq %rcx
jmp 0x1f57
movq 0x28(%rsp), %rax
cmpl %eax, 0x8(%rsp)
setne %al
cmpl $0x0, 0xc(%rsp)
setne %cl
andb %al, %cl
movzbl %cl, %eax
subl %eax, %ebx
movq 0x20(%rsp), %rax
addw %bx, 0x8(%rax)
movl 0x1c(%rsp), %ebx
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq