// File: /workspace/github_c_makefile_star2_O0/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/lobject.c
// Function: lua_strx2number
static lua_Number lua_strx2number (const char *s, char **endptr) {
  lua_Number r = 0.0;
  int e = 0, i = 0;
  int neg = 0;  /* 1 if number is negative */
  *endptr = cast(char *, s);  /* nothing is valid yet */
  while (lisspace(cast_uchar(*s))) s++;  /* skip initial spaces */
  neg = isneg(&s);  /* check signal */
  if (!(*s == '0' && (*(s + 1) == 'x' || *(s + 1) == 'X')))  /* check '0x' */
    return 0.0;  /* invalid format (no '0x') */
  s += 2;  /* skip '0x' */
  r = readhexa(&s, r, &i);  /* read integer part */
  if (*s == '.') {
    s++;  /* skip dot */
    r = readhexa(&s, r, &e);  /* read fractional part */
  }
  if (i == 0 && e == 0)
    return 0.0;  /* invalid format (no digit) */
  e *= -4;  /* each fractional digit divides value by 2^-4 */
  *endptr = cast(char *, s);  /* valid up to here */
  if (*s == 'p' || *s == 'P') {  /* exponent part? */
    int exp1 = 0;
    int neg1;
    s++;  /* skip 'p' */
    neg1 = isneg(&s);  /* signal */
    if (!lisdigit(cast_uchar(*s)))
      goto ret;  /* must have at least one digit */
    while (lisdigit(cast_uchar(*s)))  /* read exponent */
      exp1 = exp1 * 10 + *(s++) - '0';
    if (neg1) exp1 = -exp1;
    e += exp1;
  }
  *endptr = cast(char *, s);  /* valid up to here */
 ret:
  if (neg) r = -r;
  return l_mathop(ldexp)(r, e);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movzbl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x1dd6f(%rip), %rax     # 0x37720
movzbl (%rax,%rcx), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x199cd
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x1999c
leaq 0x28(%rsp), %rdi
callq 0x1a4e0
movl %eax, 0xc(%rsp)
movq 0x28(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0x19a04
movq 0x28(%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x78, %eax
je 0x19a12
movq 0x28(%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x58, %eax
je 0x19a12
xorps %xmm0, %xmm0
movsd %xmm0, 0x30(%rsp)
jmp 0x19bb8
movq 0x28(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x28(%rsp)
movsd 0x18(%rsp), %xmm0
leaq 0x28(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1a540
movsd %xmm0, 0x18(%rsp)
movq 0x28(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x19a71
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
movsd 0x18(%rsp), %xmm0
leaq 0x28(%rsp), %rdi
leaq 0x14(%rsp), %rsi
callq 0x1a540
movsd %xmm0, 0x18(%rsp)
cmpl $0x0, 0x10(%rsp)
jne 0x19a8d
cmpl $0x0, 0x14(%rsp)
jne 0x19a8d
xorps %xmm0, %xmm0
movsd %xmm0, 0x30(%rsp)
jmp 0x19bb8
imull $-0x4, 0x14(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x70, %eax
je 0x19ac1
movq 0x28(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x50, %eax
jne 0x19b6c
movl $0x0, 0x8(%rsp)
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x1a4e0
movl %eax, 0x4(%rsp)
movq 0x28(%rsp), %rax
movzbl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x1dc26(%rip), %rax     # 0x37720
movzbl (%rax,%rcx), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x19b08
jmp 0x19b79
jmp 0x19b0a
movq 0x28(%rsp), %rax
movzbl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x1dc01(%rip), %rax     # 0x37720
movzbl (%rax,%rcx), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x19b4f
imull $0xa, 0x8(%rsp), %eax
movq 0x28(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, 0x28(%rsp)
movsbl (%rcx), %ecx
addl %ecx, %eax
subl $0x30, %eax
movl %eax, 0x8(%rsp)
jmp 0x19b0a
cmpl $0x0, 0x4(%rsp)
je 0x19b60
xorl %eax, %eax
subl 0x8(%rsp), %eax
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
addl 0x14(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
cmpl $0x0, 0xc(%rsp)
je 0x19ba3
movsd 0x18(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x18(%rsp), %xmm0
movl 0x14(%rsp), %edi
callq 0x7080
movsd %xmm0, 0x30(%rsp)
movsd 0x30(%rsp), %xmm0
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)