// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/lstrlib.c
// Function: getoption
static KOption getoption (Header *h, const char **fmt, int *size) {
  int opt = *((*fmt)++);
  *size = 0;  /* default */
  switch (opt) {
    case 'b': *size = sizeof(char); return Kint;
    case 'B': *size = sizeof(char); return Kuint;
    case 'h': *size = sizeof(short); return Kint;
    case 'H': *size = sizeof(short); return Kuint;
    case 'l': *size = sizeof(long); return Kint;
    case 'L': *size = sizeof(long); return Kuint;
    case 'j': *size = sizeof(lua_Integer); return Kint;
    case 'J': *size = sizeof(lua_Integer); return Kuint;
    case 'T': *size = sizeof(size_t); return Kuint;
    case 'f': *size = sizeof(float); return Kfloat;
    case 'd': *size = sizeof(double); return Kfloat;
    case 'n': *size = sizeof(lua_Number); return Kfloat;
    case 'i': *size = getnumlimit(h, fmt, sizeof(int)); return Kint;
    case 'I': *size = getnumlimit(h, fmt, sizeof(int)); return Kuint;
    case 's': *size = getnumlimit(h, fmt, sizeof(size_t)); return Kstring;
    case 'c':
      *size = getnum(fmt, -1);
      if (*size == -1)
        luaL_error(h->L, "missing size for format option 'c'");
      return Kchar;
    case 'z': return Kzstr;
    case 'x': *size = 1; return Kpadding;
    case 'X': return Kpaddalign;
    case ' ': break;
    case '<': h->islittle = 1; break;
    case '>': h->islittle = 0; break;
    case '=': h->islittle = nativeendian.little; break;
    case '!': h->maxalign = getnumlimit(h, fmt, MAXALIGN); break;
    default: luaL_error(h->L, "invalid format option '%c'", opt);
  }
  return Knop;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq (%rsi), %rax
leaq 0x1(%rax), %rdx
movq %rdx, (%rsi)
movzbl (%rax), %ecx
movl $0x0, (%rbx)
cmpl $0x53, %ecx
jg 0x1e6d9
leal -0x3c(%rcx), %eax
cmpl $0x10, %eax
ja 0x1e6fc
leaq 0x4cdd(%rip), %rdx      # 0x233a0
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movl $0x1, 0x8(%r14)
jmp 0x1e78b
leal -0x62(%rcx), %edi
cmpl $0x18, %edi
ja 0x1e71d
leaq 0x4cfc(%rip), %r8       # 0x233e4
movslq (%r8,%rdi,4), %rdi
addq %r8, %rdi
jmpq *%rdi
movl $0x8, (%rbx)
jmp 0x1e845
cmpl $0x20, %ecx
je 0x1e78b
cmpl $0x21, %ecx
jne 0x1e777
movq %r14, %rdi
movl $0x8, %edx
callq 0x1e85e
movl %eax, 0xc(%r14)
jmp 0x1e78b
cmpl $0x54, %ecx
je 0x1e731
cmpl $0x58, %ecx
jne 0x1e777
movl $0x7, %ebx
jmp 0x1e854
movl $0x8, (%rbx)
jmp 0x1e76d
movl $0x8, (%rbx)
jmp 0x1e84f
movl $0x0, 0x8(%r14)
jmp 0x1e78b
movq %r14, %rdi
movl $0x4, %edx
callq 0x1e85e
movl %eax, (%rbx)
jmp 0x1e76d
movl $0x1, (%rbx)
jmp 0x1e76d
movl $0x2, (%rbx)
movl $0x1, %ebx
jmp 0x1e854
movsbl %cl, %edx
movq (%r14), %rdi
leaq 0x506a(%rip), %rsi      # 0x237ee
xorl %eax, %eax
callq 0x13f8e
movl $0x8, %ebx
jmp 0x1e854
movl $0x5, %ebx
jmp 0x1e854
movq %r14, %rdi
movl $0x8, %edx
callq 0x1e85e
movl %eax, (%rbx)
movl $0x4, %ebx
jmp 0x1e854
movl $0x2, (%rbx)
jmp 0x1e845
movl $0x1, (%rbx)
movl $0x6, %ebx
jmp 0x1e854
movsbl (%rdx), %edx
addl $-0x3a, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $-0xa, %edx
jb 0x1e80f
addq $0x2, %rax
xorl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
movq %rax, (%rsi)
movsbl -0x1(%rax), %edx
leal (%rdx,%rcx,2), %ecx
addl $-0x30, %ecx
movsbl (%rax), %edx
addl $-0x30, %edx
cmpl $0x9, %edx
ja 0x1e80f
incq %rax
cmpl $0xccccccc, %ecx        # imm = 0xCCCCCCC
jl 0x1e7e9
movl %ecx, (%rbx)
movl $0x3, %ebx
cmpl $-0x1, %ecx
jne 0x1e854
movq (%r14), %rdi
leaq 0x4fa6(%rip), %rsi      # 0x237cb
xorl %eax, %eax
callq 0x13f8e
jmp 0x1e854
movl $0x1, (%rbx)
jmp 0x1e845
movq %r14, %rdi
movl $0x4, %edx
callq 0x1e85e
movl %eax, (%rbx)
xorl %ebx, %ebx
jmp 0x1e854
movl $0x4, (%rbx)
movl $0x2, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq