// File: /workspace/github_c_makefile_star2_O1/mrkite[P]regs/src/main.cc
// Function: parse_opt(int, char*, argp_state*)
static error_t parse_opt(int key, char *arg, struct argp_state *state) {
  struct arguments *arguments = static_cast<struct arguments *>(state->input);
  switch (key) {
    case 'o':
      if (arg) {
        arguments->org = parseNum(arg);
      }
      break;
    case 'm':
      if (arg) {
        arguments->flags |= IsM8;
      }
      break;
    case 'x':
      if (arg) {
        arguments->flags |= IsX8;
      }
      break;
    case 'e':
      if (arg) {
        arguments->flags |= IsEmu;
      }
      break;
    case 'l':
      arguments->keyword = arg;
      break;
    case ARGP_KEY_ARG:
      if (state->arg_num >= 1) {
        argp_usage(state);
      }
      arguments->filename = arg;
      break;
    case ARGP_KEY_END:
      if (state->arg_num < 1 && !arguments->keyword) {
        argp_usage(state);
      }
      break;
    default:
      return ARGP_ERR_UNKNOWN;
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq 0x28(%rdx), %r14
movl $0x7, %ebx
cmpl $0x6c, %edi
jle 0x6388
cmpl $0x77, %edi
jg 0x63a4
cmpl $0x6d, %edi
je 0x63f1
cmpl $0x6f, %edi
jne 0x6535
xorl %ebx, %ebx
testq %r15, %r15
je 0x6535
movb (%r15), %bpl
movsbl %bpl, %edi
callq 0x5070
incq %r15
testl %eax, %eax
jne 0x6350
cmpb $0x30, %bpl
movq %r14, (%rsp)
jne 0x6430
cmpb $0x78, (%r15)
jne 0x6430
movb $0x1, %al
movl $0x2, %r13d
jmp 0x643e
testl %edi, %edi
je 0x63d9
cmpl $0x65, %edi
je 0x641b
cmpl $0x6c, %edi
jne 0x6535
movq %r15, 0x10(%r14)
jmp 0x63ea
cmpl $0x78, %edi
je 0x6406
cmpl $0x1000001, %edi        # imm = 0x1000001
jne 0x6535
xorl %ebx, %ebx
cmpl $0x0, 0x20(%rdx)
jne 0x6535
cmpq $0x0, 0x10(%r14)
jne 0x6535
movq %rdx, %rdi
callq 0x5370
jmp 0x6535
cmpl $0x0, 0x20(%rdx)
je 0x63e7
movq %rdx, %rdi
callq 0x5370
movq %r15, (%r14)
xorl %ebx, %ebx
jmp 0x6535
xorl %ebx, %ebx
testq %r15, %r15
je 0x6535
orb $0x20, 0xc(%r14)
jmp 0x6535
xorl %ebx, %ebx
testq %r15, %r15
je 0x6535
orb $0x10, 0xc(%r14)
jmp 0x6535
xorl %ebx, %ebx
testq %r15, %r15
je 0x6535
orb $0x1, 0xd(%r14)
jmp 0x6535
xorl %r13d, %r13d
cmpb $0x24, %bpl
sete %r13b
movl %r13d, %eax
movb -0x1(%r15,%r13), %bpl
movsbl %bpl, %r14d
testb %al, %al
je 0x64f0
movl %r14d, %edi
callq 0x50d0
cmpb $0x2f, %r14b
sete %cl
je 0x6468
testl %eax, %eax
je 0x651c
addq %r13, %r15
decq %r15
xorl %r12d, %r12d
incq %r15
xorl %r13d, %r13d
testb $0x1, %cl
jne 0x64c7
leal -0x30(%r14), %eax
cmpl $0xa, %eax
jb 0x649c
addb $-0x61, %bpl
cmpb $0x5, %bpl
ja 0x6495
addl $-0x57, %r14d
jmp 0x6499
addl $-0x37, %r14d
movl %r14d, %eax
shll $0x4, %r13d
orl %eax, %r13d
movsbl (%r15), %r14d
movl %r14d, %edi
callq 0x50d0
incq %r15
movl %r14d, %ebp
cmpl $0x2f, %r14d
sete %cl
je 0x6477
movl %r14d, %ebp
testl %eax, %eax
jne 0x6477
jmp 0x6523
movsbl (%r15), %r14d
movl %r14d, %edi
callq 0x50d0
movl %r14d, %ebp
movl %r13d, %r12d
cmpl $0x2f, %r14d
sete %cl
je 0x6471
xorl %edx, %edx
movl %r14d, %ebp
movl %r13d, %r12d
testl %eax, %eax
jne 0x6471
jmp 0x6526
addl $-0x30, %r14d
cmpl $0x9, %r14d
ja 0x651c
addq %r13, %r15
xorl %r12d, %r12d
xorl %edx, %edx
leal (%rdx,%rdx,4), %eax
leal (%r14,%rax,2), %edx
movsbl (%r15), %r14d
addl $-0x30, %r14d
incq %r15
cmpl $0xa, %r14d
jb 0x6502
jmp 0x6526
xorl %r12d, %r12d
xorl %edx, %edx
jmp 0x6526
movl %r13d, %edx
shll $0x10, %r12d
orl %edx, %r12d
movq (%rsp), %rax
movl %r12d, 0x8(%rax)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq