// File: /workspace/github_c_makefile_star2_O0/tylerneylon[P]APIsWithLua/lua/lobject.c
// Function: l_str2int
static const char *l_str2int (const char *s, lua_Integer *result) {
  lua_Unsigned a = 0;
  int empty = 1;
  int neg;
  while (lisspace(cast_uchar(*s))) s++;  /* skip initial spaces */
  neg = isneg(&s);
  if (s[0] == '0' &&
      (s[1] == 'x' || s[1] == 'X')) {  /* hex? */
    s += 2;  /* skip '0x' */
    for (; lisxdigit(cast_uchar(*s)); s++) {
      a = a * 16 + luaO_hexavalue(*s);
      empty = 0;
    }
  }
  else {  /* decimal */
    for (; lisdigit(cast_uchar(*s)); s++) {
      int d = *s - '0';
      if (a >= MAXBY10 && (a > MAXBY10 || d > MAXLASTD + neg))  /* overflow? */
        return NULL;  /* do not accept it (as integer) */
      a = a * 10 + d;
      empty = 0;
    }
  }
  while (lisspace(cast_uchar(*s))) s++;  /* skip trailing spaces */
  if (empty || *s != '\0') return NULL;  /* something wrong in the numeral */
  else {
    *result = l_castU2S((neg) ? 0u - a : a);
    return s;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x1, -0x24(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x2511d(%rip), %rax     # 0x35ab0
movzbl (%rax,%rcx), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x109ad
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x1097f
leaq -0x10(%rbp), %rdi
callq 0x11770
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0x10a51
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x78, %eax
je 0x109e3
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x58, %eax
jne 0x10a51
movq -0x10(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x250ad(%rip), %rax     # 0x35ab0
movzbl (%rax,%rcx), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x10a4c
movq -0x20(%rbp), %rax
shlq $0x4, %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %edi
callq 0x10860
movl %eax, %ecx
movq -0x38(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x109ef
jmp 0x10ae4
jmp 0x10a53
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x25049(%rip), %rax     # 0x35ab0
movzbl (%rax,%rcx), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x10ae2
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
movl %eax, -0x2c(%rbp)
movabsq $0xccccccccccccccc, %rax # imm = 0xCCCCCCCCCCCCCCC
cmpq %rax, -0x20(%rbp)
jb 0x10aba
movabsq $0xccccccccccccccc, %rax # imm = 0xCCCCCCCCCCCCCCC
cmpq %rax, -0x20(%rbp)
ja 0x10aad
movl -0x2c(%rbp), %eax
movl -0x28(%rbp), %ecx
addl $0x7, %ecx
cmpl %ecx, %eax
jle 0x10aba
movq $0x0, -0x8(%rbp)
jmp 0x10b5d
imulq $0xa, -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x10a53
jmp 0x10ae4
jmp 0x10ae6
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x24fb6(%rip), %rax     # 0x35ab0
movzbl (%rax,%rcx), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x10b14
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x10ae6
cmpl $0x0, -0x24(%rbp)
jne 0x10b26
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x10b30
movq $0x0, -0x8(%rbp)
jmp 0x10b5d
cmpl $0x0, -0x28(%rbp)
je 0x10b42
xorl %eax, %eax
subq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x10b4a
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)