// File: /workspace/github_c_makefile_star2_O0/hermantb[P]fast_convert/fast_convert.c
// Function: fast_strtos64
int64_t
fast_strtos64 (const char *str, char **endptr, int base)
{
  uint64_t n;
  unsigned int sign = 0;
  unsigned char *cp = (unsigned char *) str;
#define	M(x)	(UINT64_C(9223372036854775807) / (x))
  static const uint64_t maxp[37] = {
    0, 0, M (2), M (3), M (4), M (5), M (6), M (7), M (8), M (9), M (10),
    M (11), M (12), M (13), M (14), M (15), M (16), M (17), M (18),
    M (19), M (20), M (21), M (22), M (23), M (24), M (25), M (26),
    M (27), M (28), M (29), M (30), M (31), M (32), M (33), M (34),
    M (35), M (36)
  };
#undef M
#define	M(x)	(UINT64_C(9223372036854775808) / (x))
  static const uint64_t maxn[37] = {
    0, 0, M (2), M (3), M (4), M (5), M (6), M (7), M (8), M (9), M (10),
    M (11), M (12), M (13), M (14), M (15), M (16), M (17), M (18),
    M (19), M (20), M (21), M (22), M (23), M (24), M (25), M (26),
    M (27), M (28), M (29), M (30), M (31), M (32), M (33), M (34),
    M (35), M (36)
  };
#undef M
#define	R(x)	(UINT64_C(9223372036854775807) % (x))
  static const uint64_t remp[37] = {
    0, 0, R (2), R (3), R (4), R (5), R (6), R (7), R (8), R (9), R (10),
    R (11), R (12), R (13), R (14), R (15), R (16), R (17), R (18),
    R (19), R (20), R (21), R (22), R (23), R (24), R (25), R (26),
    R (27), R (28), R (29), R (30), R (31), R (32), R (33), R (34),
    R (35), R (36)
  };
#undef R
#define	R(x)	(UINT64_C(9223372036854775808) % (x))
  static const uint64_t remn[37] = {
    0, 0, R (2), R (3), R (4), R (5), R (6), R (7), R (8), R (9), R (10),
    R (11), R (12), R (13), R (14), R (15), R (16), R (17), R (18),
    R (19), R (20), R (21), R (22), R (23), R (24), R (25), R (26),
    R (27), R (28), R (29), R (30), R (31), R (32), R (33), R (34),
    R (35), R (36)
  };
#undef R

  while (isspace (*cp)) {
    cp++;
  }
  if (*cp == '+') {
    cp++;
  }
  else if (*cp == '-') {
    sign = 1;
    cp++;
  }
  n = 0;
  if (UNLIKELY (base) &&
      (base != 10 || *cp < '1') &&
      (base != 8 || *cp != '0' || cp[1] < '0' || cp[1] > '7') &&
      (base != 16 || *cp != '0' || (cp[1] != 'x' && cp[1] != 'X'))) {
    if (base >= 2 && base <= 36) {
      uint64_t max = sign ? maxn[base] : maxp[base];
      uint64_t rem = sign ? remn[base] : remp[base];

      if (base <= 10) {
	unsigned char u = *cp;
	unsigned char end = '0' + base;

	if (u >= '0' && u < end) {
	  do {
	    uint32_t v = convert_num[u];

	    if (UNLIKELY (n >= max) && (n > max || (n == max && v > rem))) {
	      break;
	    }
	    n = n * base + v;
	    u = *++cp;
	  } while (u >= '0' && u < end);
	}
	else {
	  cp = (unsigned char *) str;
	}
      }
      else {
	unsigned char u = uppercase[*cp];
	unsigned char end = 'A' + base - 10;

	if (valid_num[u] && u < end) {
	  do {
	    uint32_t v = convert_num[u];

	    if (UNLIKELY (n >= max) && (n > max || (n == max && v > rem))) {
	      break;
	    }
	    n = n * base + v;
	    u = uppercase[*++cp];
	  } while (valid_num[u] && u < end);
	}
	else {
	  cp = (unsigned char *) str;
	}
      }
    }
    else {
      cp = (unsigned char *) str;
    }
  }
  else if (*cp == '0') {
    cp++;
    if ((*cp == 'x' || *cp == 'X') && isxdigit (cp[1])) {
      uint64_t max = sign ? maxn[16] : maxp[16];
      uint64_t rem = sign ? remn[16] : remp[16];
      unsigned char u = *++cp;

      do {
	uint32_t v = convert_num[u];

	if (UNLIKELY (n >= max) && (n > max || (n == max && v > rem))) {
	  break;
	}
	n = n * 16 + v;
	u = *++cp;
      } while (isxdigit (u));
    }
    else {
      uint64_t max = sign ? maxn[8] : maxp[8];
      uint64_t rem = sign ? remn[8] : remp[8];
      unsigned char u = *cp;

      while (u >= '0' && u <= '7') {
	uint32_t v = convert_num[u];

	if (UNLIKELY (n >= max) && (n > max || (n == max && v > rem))) {
	  break;
	}
	n = n * 8 + v;
	u = *++cp;
      }
    }
  }
  else if (isdigit (*cp)) {
    uint64_t max = sign ? maxn[10] : maxp[10];
    uint64_t rem = sign ? remn[10] : remp[10];
    unsigned char u = *cp;

    do {
      uint32_t v = convert_num[u];

      if (UNLIKELY (n >= max) && (n > max || (n == max && v > rem))) {
	break;
      }
      n = n * 10 + v;
      u = *++cp;
    } while (isdigit (u));
  }
  else {
    cp = (unsigned char *) str;
  }
  if (endptr) {
    *endptr = (char *) cp;
  }
  return sign ? -(int64_t) n : (int64_t) n;
}

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xb0(%rsp)
movq %rsi, 0xa8(%rsp)
movl %edx, 0xa4(%rsp)
movl $0x0, 0x94(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x88(%rsp)
callq 0x1160
movq (%rax), %rax
movq 0x88(%rsp), %rcx
movzbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x5d93
movq 0x88(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x88(%rsp)
jmp 0x5d59
movq 0x88(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x2b, %eax
jne 0x5db9
movq 0x88(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x88(%rsp)
jmp 0x5dea
movq 0x88(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x5de8
movl $0x1, 0x94(%rsp)
movq 0x88(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x88(%rsp)
jmp 0x5dea
movq $0x0, 0x98(%rsp)
movslq 0xa4(%rsp), %rax
cmpq $0x0, %rax
je 0x6201
cmpl $0xa, 0xa4(%rsp)
jne 0x5e26
movq 0x88(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x31, %eax
jge 0x6201
cmpl $0x8, 0xa4(%rsp)
jne 0x5e66
movq 0x88(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x30, %eax
jne 0x5e66
movq 0x88(%rsp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x30, %eax
jl 0x5e66
movq 0x88(%rsp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x37, %eax
jle 0x6201
cmpl $0x10, 0xa4(%rsp)
jne 0x5eaa
movq 0x88(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x30, %eax
jne 0x5eaa
movq 0x88(%rsp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x78, %eax
je 0x6201
movq 0x88(%rsp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x58, %eax
je 0x6201
cmpl $0x2, 0xa4(%rsp)
jl 0x61ec
cmpl $0x24, 0xa4(%rsp)
jg 0x61ec
cmpl $0x0, 0x94(%rsp)
je 0x5eea
movslq 0xa4(%rsp), %rcx
leaq 0xd2d1(%rip), %rax      # 0x131b0
movq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
jmp 0x5f02
movslq 0xa4(%rsp), %rcx
leaq 0xd187(%rip), %rax      # 0x13080
movq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x80(%rsp)
cmpl $0x0, 0x94(%rsp)
je 0x5f33
movslq 0xa4(%rsp), %rcx
leaq 0xd4e8(%rip), %rax      # 0x13410
movq (%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
jmp 0x5f4b
movslq 0xa4(%rsp), %rcx
leaq 0xd39e(%rip), %rax      # 0x132e0
movq (%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x78(%rsp)
cmpl $0xa, 0xa4(%rsp)
jg 0x608e
movq 0x88(%rsp), %rax
movb (%rax), %al
movb %al, 0x77(%rsp)
movl 0xa4(%rsp), %eax
addl $0x30, %eax
movb %al, 0x76(%rsp)
movzbl 0x77(%rsp), %eax
cmpl $0x30, %eax
jl 0x6079
movzbl 0x77(%rsp), %eax
movzbl 0x76(%rsp), %ecx
cmpl %ecx, %eax
jge 0x6079
jmp 0x5fa1
movzbl 0x77(%rsp), %eax
movl %eax, %ecx
leaq 0x1d131(%rip), %rax     # 0x230e0
movl (%rax,%rcx,4), %eax
movl %eax, 0x70(%rsp)
movq 0x98(%rsp), %rax
cmpq 0x80(%rsp), %rax
setae %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x6007
movq 0x98(%rsp), %rax
cmpq 0x80(%rsp), %rax
ja 0x6005
movq 0x98(%rsp), %rax
cmpq 0x80(%rsp), %rax
jne 0x6007
movl 0x70(%rsp), %eax
cmpq 0x78(%rsp), %rax
jbe 0x6007
jmp 0x6077
movq 0x98(%rsp), %rax
movslq 0xa4(%rsp), %rcx
imulq %rcx, %rax
movl 0x70(%rsp), %ecx
addq %rcx, %rax
movq %rax, 0x98(%rsp)
movq 0x88(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x88(%rsp)
movb 0x1(%rax), %al
movb %al, 0x77(%rsp)
movzbl 0x77(%rsp), %ecx
xorl %eax, %eax
cmpl $0x30, %ecx
movb %al, 0xf(%rsp)
jl 0x606b
movzbl 0x77(%rsp), %eax
movzbl 0x76(%rsp), %ecx
cmpl %ecx, %eax
setl %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x5fa1
jmp 0x6089
movq 0xb0(%rsp), %rax
movq %rax, 0x88(%rsp)
jmp 0x61ea
movq 0x88(%rsp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1d23e(%rip), %rax     # 0x232e0
movb (%rax,%rcx), %al
movb %al, 0x6f(%rsp)
movl 0xa4(%rsp), %eax
addl $0x41, %eax
subl $0xa, %eax
movb %al, 0x6e(%rsp)
movzbl 0x6f(%rsp), %eax
movl %eax, %ecx
leaq 0x1d378(%rip), %rax     # 0x23440
cmpl $0x0, (%rax,%rcx,4)
je 0x61d8
movzbl 0x6f(%rsp), %eax
movzbl 0x6e(%rsp), %ecx
cmpl %ecx, %eax
jge 0x61d8
jmp 0x60e6
movzbl 0x6f(%rsp), %eax
movl %eax, %ecx
leaq 0x1cfec(%rip), %rax     # 0x230e0
movl (%rax,%rcx,4), %eax
movl %eax, 0x68(%rsp)
movq 0x98(%rsp), %rax
cmpq 0x80(%rsp), %rax
setae %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x614f
movq 0x98(%rsp), %rax
cmpq 0x80(%rsp), %rax
ja 0x614a
movq 0x98(%rsp), %rax
cmpq 0x80(%rsp), %rax
jne 0x614f
movl 0x68(%rsp), %eax
cmpq 0x78(%rsp), %rax
jbe 0x614f
jmp 0x61d6
movq 0x98(%rsp), %rax
movslq 0xa4(%rsp), %rcx
imulq %rcx, %rax
movl 0x68(%rsp), %ecx
addq %rcx, %rax
movq %rax, 0x98(%rsp)
movq 0x88(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x88(%rsp)
movzbl 0x1(%rax), %eax
movl %eax, %ecx
leaq 0x1d14a(%rip), %rax     # 0x232e0
movb (%rax,%rcx), %al
movb %al, 0x6f(%rsp)
movzbl 0x6f(%rsp), %eax
movl %eax, %edx
xorl %eax, %eax
leaq 0x1d293(%rip), %rcx     # 0x23440
cmpl $0x0, (%rcx,%rdx,4)
movb %al, 0xe(%rsp)
je 0x61ca
movzbl 0x6f(%rsp), %eax
movzbl 0x6e(%rsp), %ecx
cmpl %ecx, %eax
setl %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
testb $0x1, %al
jne 0x60e6
jmp 0x61e8
movq 0xb0(%rsp), %rax
movq %rax, 0x88(%rsp)
jmp 0x61ea
jmp 0x61fc
movq 0xb0(%rsp), %rax
movq %rax, 0x88(%rsp)
jmp 0x65e2
movq 0x88(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x30, %eax
jne 0x64a5
movq 0x88(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x78, %eax
je 0x624d
movq 0x88(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x58, %eax
jne 0x638d
callq 0x1160
movq (%rax), %rax
movq 0x88(%rsp), %rcx
movzbl 0x1(%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
je 0x638d
movl 0x94(%rsp), %ecx
movq 0xcfac(%rip), %rax      # 0x13230
cmpl $0x0, %ecx
cmoveq 0xce71(%rip), %rax      # 0x13100
movq %rax, 0x60(%rsp)
movl 0x94(%rsp), %ecx
movq 0xd1ee(%rip), %rax      # 0x13490
cmpl $0x0, %ecx
cmoveq 0xd0b3(%rip), %rax      # 0x13360
movq %rax, 0x58(%rsp)
movq 0x88(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x88(%rsp)
movb 0x1(%rax), %al
movb %al, 0x57(%rsp)
movzbl 0x57(%rsp), %eax
movl %eax, %ecx
leaq 0x1ce02(%rip), %rax     # 0x230e0
movl (%rax,%rcx,4), %eax
movl %eax, 0x50(%rsp)
movq 0x98(%rsp), %rax
cmpq 0x60(%rsp), %rax
setae %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x632d
movq 0x98(%rsp), %rax
cmpq 0x60(%rsp), %rax
ja 0x632b
movq 0x98(%rsp), %rax
cmpq 0x60(%rsp), %rax
jne 0x632d
movl 0x50(%rsp), %eax
cmpq 0x58(%rsp), %rax
jbe 0x632d
jmp 0x6388
movq 0x98(%rsp), %rax
shlq $0x4, %rax
movl 0x50(%rsp), %ecx
addq %rcx, %rax
movq %rax, 0x98(%rsp)
movq 0x88(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x88(%rsp)
movb 0x1(%rax), %al
movb %al, 0x57(%rsp)
callq 0x1160
movq (%rax), %rax
movzbl 0x57(%rsp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
jne 0x62d0
jmp 0x64a0
movl 0x94(%rsp), %ecx
movq 0xce55(%rip), %rax      # 0x131f0
cmpl $0x0, %ecx
cmoveq 0xcd1a(%rip), %rax      # 0x130c0
movq %rax, 0x48(%rsp)
movl 0x94(%rsp), %ecx
movq 0xd097(%rip), %rax      # 0x13450
cmpl $0x0, %ecx
cmoveq 0xcf5c(%rip), %rax      # 0x13320
movq %rax, 0x40(%rsp)
movq 0x88(%rsp), %rax
movb (%rax), %al
movb %al, 0x3f(%rsp)
movzbl 0x3f(%rsp), %ecx
xorl %eax, %eax
cmpl $0x30, %ecx
movb %al, 0xd(%rsp)
jl 0x63f6
movzbl 0x3f(%rsp), %eax
cmpl $0x37, %eax
setle %al
movb %al, 0xd(%rsp)
movb 0xd(%rsp), %al
testb $0x1, %al
jne 0x6403
jmp 0x649e
movzbl 0x3f(%rsp), %eax
movl %eax, %ecx
leaq 0x1cccf(%rip), %rax     # 0x230e0
movl (%rax,%rcx,4), %eax
movl %eax, 0x38(%rsp)
movq 0x98(%rsp), %rax
cmpq 0x48(%rsp), %rax
setae %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x6460
movq 0x98(%rsp), %rax
cmpq 0x48(%rsp), %rax
ja 0x645e
movq 0x98(%rsp), %rax
cmpq 0x48(%rsp), %rax
jne 0x6460
movl 0x38(%rsp), %eax
cmpq 0x40(%rsp), %rax
jbe 0x6460
jmp 0x649e
movq 0x98(%rsp), %rax
shlq $0x3, %rax
movl 0x38(%rsp), %ecx
addq %rcx, %rax
movq %rax, 0x98(%rsp)
movq 0x88(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x88(%rsp)
movb 0x1(%rax), %al
movb %al, 0x3f(%rsp)
jmp 0x63d7
jmp 0x64a0
jmp 0x65e0
callq 0x1160
movq (%rax), %rax
movq 0x88(%rsp), %rcx
movzbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x65ce
movl 0x94(%rsp), %ecx
movq 0xcd25(%rip), %rax      # 0x13200
cmpl $0x0, %ecx
cmoveq 0xcbea(%rip), %rax      # 0x130d0
movq %rax, 0x30(%rsp)
movl 0x94(%rsp), %ecx
movq 0xcf67(%rip), %rax      # 0x13460
cmpl $0x0, %ecx
cmoveq 0xce2c(%rip), %rax      # 0x13330
movq %rax, 0x28(%rsp)
movq 0x88(%rsp), %rax
movb (%rax), %al
movb %al, 0x27(%rsp)
movzbl 0x27(%rsp), %eax
movl %eax, %ecx
leaq 0x1cbbb(%rip), %rax     # 0x230e0
movl (%rax,%rcx,4), %eax
movl %eax, 0x20(%rsp)
movq 0x98(%rsp), %rax
cmpq 0x30(%rsp), %rax
setae %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x6574
movq 0x98(%rsp), %rax
cmpq 0x30(%rsp), %rax
ja 0x6572
movq 0x98(%rsp), %rax
cmpq 0x30(%rsp), %rax
jne 0x6574
movl 0x20(%rsp), %eax
cmpq 0x28(%rsp), %rax
jbe 0x6574
jmp 0x65cc
imulq $0xa, 0x98(%rsp), %rax
movl 0x20(%rsp), %ecx
addq %rcx, %rax
movq %rax, 0x98(%rsp)
movq 0x88(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x88(%rsp)
movb 0x1(%rax), %al
movb %al, 0x27(%rsp)
callq 0x1160
movq (%rax), %rax
movzbl 0x27(%rsp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x6517
jmp 0x65de
movq 0xb0(%rsp), %rax
movq %rax, 0x88(%rsp)
jmp 0x65e0
jmp 0x65e2
cmpq $0x0, 0xa8(%rsp)
je 0x6600
movq 0x88(%rsp), %rcx
movq 0xa8(%rsp), %rax
movq %rcx, (%rax)
cmpl $0x0, 0x94(%rsp)
je 0x661a
xorl %eax, %eax
subq 0x98(%rsp), %rax
movq %rax, (%rsp)
jmp 0x6626
movq 0x98(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
addq $0xb8, %rsp
retq
nopw %cs:(%rax,%rax)