// File: /workspace/github_c_makefile_star2_O3/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, %r14
movq 0x28(%rdx), %r12
movl $0x7, %ebx
cmpl $0x6c, %edi
jle 0x6433
cmpl $0x77, %edi
jg 0x644c
cmpl $0x6d, %edi
je 0x6495
cmpl $0x6f, %edi
jne 0x64fd
xorl %ebx, %ebx
testq %r14, %r14
je 0x64fd
movsbl (%r14), %r15d
movl %r15d, %edi
callq 0x5070
incq %r14
testl %eax, %eax
jne 0x6358
cmpb $0x24, %r15b
je 0x638e
movzbl %r15b, %eax
cmpl $0x30, %eax
jne 0x64c2
xorl %r15d, %r15d
cmpb $0x78, (%r14)
jne 0x64cc
incq %r14
movsbl (%r14), %r15d
movl %r15d, %edi
callq 0x50d0
cmpl $0x2f, %r15d
sete %cl
je 0x63ab
testl %eax, %eax
je 0x64ea
xorl %ebp, %ebp
movl %r15d, %edx
incq %r14
xorl %r13d, %r13d
testb $0x1, %cl
jne 0x6407
leal -0x30(%r15), %eax
cmpl $0xa, %eax
jb 0x63d9
addb $-0x61, %dl
cmpb $0x5, %dl
ja 0x63d2
addl $-0x57, %r15d
jmp 0x63d6
addl $-0x37, %r15d
movl %r15d, %eax
shll $0x4, %r13d
orl %eax, %r13d
movsbl (%r14), %r15d
movl %r15d, %edi
callq 0x50d0
incq %r14
movl %r15d, %edx
cmpl $0x2f, %r15d
sete %cl
je 0x63b6
movl %r15d, %edx
testl %eax, %eax
jne 0x63b6
jmp 0x64f0
movsbl (%r14), %r15d
movl %r15d, %edi
callq 0x50d0
movl %r15d, %edx
movl %r13d, %ebp
cmpl $0x2f, %r15d
sete %cl
je 0x63b0
xorl %esi, %esi
movl %r15d, %edx
movl %r13d, %ebp
testl %eax, %eax
jne 0x63b0
jmp 0x64f3
testl %edi, %edi
je 0x647f
cmpl $0x65, %edi
je 0x64b3
cmpl $0x6c, %edi
jne 0x64fd
movq %r14, 0x10(%r12)
jmp 0x6491
cmpl $0x78, %edi
je 0x64a4
cmpl $0x1000001, %edi        # imm = 0x1000001
jne 0x64fd
xorl %ebx, %ebx
cmpl $0x0, 0x20(%rdx)
jne 0x64fd
cmpq $0x0, 0x10(%r12)
jne 0x64fd
movq %rdx, %rdi
callq 0x5370
jmp 0x64fd
cmpl $0x0, 0x20(%rdx)
je 0x648d
movq %rdx, %rdi
callq 0x5370
movq %r14, (%r12)
xorl %ebx, %ebx
jmp 0x64fd
xorl %ebx, %ebx
testq %r14, %r14
je 0x64fd
orb $0x20, 0xc(%r12)
jmp 0x64fd
xorl %ebx, %ebx
testq %r14, %r14
je 0x64fd
orb $0x10, 0xc(%r12)
jmp 0x64fd
xorl %ebx, %ebx
testq %r14, %r14
je 0x64fd
orb $0x1, 0xd(%r12)
jmp 0x64fd
addl $-0x30, %r15d
cmpl $0xa, %r15d
jae 0x64ea
xorl %ebp, %ebp
xorl %esi, %esi
leal (%rsi,%rsi,4), %eax
leal (%r15,%rax,2), %esi
movsbl (%r14), %r15d
addl $-0x30, %r15d
incq %r14
cmpl $0xa, %r15d
jb 0x64d0
jmp 0x64f3
xorl %ebp, %ebp
xorl %esi, %esi
jmp 0x64f3
movl %r13d, %esi
shll $0x10, %ebp
orl %esi, %ebp
movl %ebp, 0x8(%r12)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq