// File: /workspace/github_c_makefile_star2_O0/hermantb[P]fast_convert/fast_convert.c
// Function: fast_strtou32
uint32_t
fast_strtou32 (const char *str, char **endptr, int base)
{
  uint32_t n;
  unsigned char *cp = (unsigned char *) str;
#define	M(x)	(4294967295u / (x))
  static const uint32_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	R(x)	(4294967295u % (x))
  static const uint32_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

  while (isspace (*cp)) {
    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) {
      uint32_t max = maxp[base];
      uint32_t rem = 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])) {
      uint32_t max = maxp[16];
      uint32_t rem = 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 {
      uint32_t max = maxp[8];
      uint32_t rem = 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)) {
    uint32_t max = maxp[10];
    uint32_t rem = 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 n;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movl %edx, 0x64(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x58(%rsp)
callq 0x1160
movq (%rax), %rax
movq 0x58(%rsp), %rcx
movzbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x668d
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0x665c
movl $0x0, 0x60(%rsp)
movslq 0x64(%rsp), %rax
cmpq $0x0, %rax
je 0x698a
cmpl $0xa, 0x64(%rsp)
jne 0x66bc
movq 0x58(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x31, %eax
jge 0x698a
cmpl $0x8, 0x64(%rsp)
jne 0x66f0
movq 0x58(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x30, %eax
jne 0x66f0
movq 0x58(%rsp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x30, %eax
jl 0x66f0
movq 0x58(%rsp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x37, %eax
jle 0x698a
cmpl $0x10, 0x64(%rsp)
jne 0x6728
movq 0x58(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x30, %eax
jne 0x6728
movq 0x58(%rsp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x78, %eax
je 0x698a
movq 0x58(%rsp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x58, %eax
je 0x698a
cmpl $0x2, 0x64(%rsp)
jl 0x697b
cmpl $0x24, 0x64(%rsp)
jg 0x697b
movslq 0x64(%rsp), %rcx
leaq 0xcdf6(%rip), %rax      # 0x13540
movl (%rax,%rcx,4), %eax
movl %eax, 0x54(%rsp)
movslq 0x64(%rsp), %rcx
leaq 0xce83(%rip), %rax      # 0x135e0
movl (%rax,%rcx,4), %eax
movl %eax, 0x50(%rsp)
cmpl $0xa, 0x64(%rsp)
jg 0x685d
movq 0x58(%rsp), %rax
movb (%rax), %al
movb %al, 0x4f(%rsp)
movl 0x64(%rsp), %eax
addl $0x30, %eax
movb %al, 0x4e(%rsp)
movzbl 0x4f(%rsp), %eax
cmpl $0x30, %eax
jl 0x684e
movzbl 0x4f(%rsp), %eax
movzbl 0x4e(%rsp), %ecx
cmpl %ecx, %eax
jge 0x684e
jmp 0x67a7
movzbl 0x4f(%rsp), %eax
movl %eax, %ecx
leaq 0x1c92b(%rip), %rax     # 0x230e0
movl (%rax,%rcx,4), %eax
movl %eax, 0x48(%rsp)
movl 0x60(%rsp), %eax
cmpl 0x54(%rsp), %eax
setae %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x67f4
movl 0x60(%rsp), %eax
cmpl 0x54(%rsp), %eax
ja 0x67f2
movl 0x60(%rsp), %eax
cmpl 0x54(%rsp), %eax
jne 0x67f4
movl 0x48(%rsp), %eax
cmpl 0x50(%rsp), %eax
jbe 0x67f4
jmp 0x684c
movl 0x60(%rsp), %eax
imull 0x64(%rsp), %eax
addl 0x48(%rsp), %eax
movl %eax, 0x60(%rsp)
movq 0x58(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x58(%rsp)
movb 0x1(%rax), %al
movb %al, 0x4f(%rsp)
movzbl 0x4f(%rsp), %ecx
xorl %eax, %eax
cmpl $0x30, %ecx
movb %al, 0xf(%rsp)
jl 0x6840
movzbl 0x4f(%rsp), %eax
movzbl 0x4e(%rsp), %ecx
cmpl %ecx, %eax
setl %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x67a7
jmp 0x6858
movq 0x70(%rsp), %rax
movq %rax, 0x58(%rsp)
jmp 0x6979
movq 0x58(%rsp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1ca72(%rip), %rax     # 0x232e0
movb (%rax,%rcx), %al
movb %al, 0x47(%rsp)
movl 0x64(%rsp), %eax
addl $0x41, %eax
subl $0xa, %eax
movb %al, 0x46(%rsp)
movzbl 0x47(%rsp), %eax
movl %eax, %ecx
leaq 0x1cbaf(%rip), %rax     # 0x23440
cmpl $0x0, (%rax,%rcx,4)
je 0x696d
movzbl 0x47(%rsp), %eax
movzbl 0x46(%rsp), %ecx
cmpl %ecx, %eax
jge 0x696d
jmp 0x68af
movzbl 0x47(%rsp), %eax
movl %eax, %ecx
leaq 0x1c823(%rip), %rax     # 0x230e0
movl (%rax,%rcx,4), %eax
movl %eax, 0x40(%rsp)
movl 0x60(%rsp), %eax
cmpl 0x54(%rsp), %eax
setae %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x68fc
movl 0x60(%rsp), %eax
cmpl 0x54(%rsp), %eax
ja 0x68fa
movl 0x60(%rsp), %eax
cmpl 0x54(%rsp), %eax
jne 0x68fc
movl 0x40(%rsp), %eax
cmpl 0x50(%rsp), %eax
jbe 0x68fc
jmp 0x696b
movl 0x60(%rsp), %eax
imull 0x64(%rsp), %eax
addl 0x40(%rsp), %eax
movl %eax, 0x60(%rsp)
movq 0x58(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x58(%rsp)
movzbl 0x1(%rax), %eax
movl %eax, %ecx
leaq 0x1c9b5(%rip), %rax     # 0x232e0
movb (%rax,%rcx), %al
movb %al, 0x47(%rsp)
movzbl 0x47(%rsp), %eax
movl %eax, %edx
xorl %eax, %eax
leaq 0x1cafe(%rip), %rcx     # 0x23440
cmpl $0x0, (%rcx,%rdx,4)
movb %al, 0xe(%rsp)
je 0x695f
movzbl 0x47(%rsp), %eax
movzbl 0x46(%rsp), %ecx
cmpl %ecx, %eax
setl %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
testb $0x1, %al
jne 0x68af
jmp 0x6977
movq 0x70(%rsp), %rax
movq %rax, 0x58(%rsp)
jmp 0x6979
jmp 0x6985
movq 0x70(%rsp), %rax
movq %rax, 0x58(%rsp)
jmp 0x6c64
movq 0x58(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x30, %eax
jne 0x6b7c
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x78, %eax
je 0x69c7
movq 0x58(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x58, %eax
jne 0x6ab4
callq 0x1160
movq (%rax), %rax
movq 0x58(%rsp), %rcx
movzbl 0x1(%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
je 0x6ab4
movl 0xcb8d(%rip), %eax      # 0x13580
movl %eax, 0x3c(%rsp)
movl 0xcc23(%rip), %eax      # 0x13620
movl %eax, 0x38(%rsp)
movq 0x58(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x58(%rsp)
movb 0x1(%rax), %al
movb %al, 0x37(%rsp)
movzbl 0x37(%rsp), %eax
movl %eax, %ecx
leaq 0x1c6b9(%rip), %rax     # 0x230e0
movl (%rax,%rcx,4), %eax
movl %eax, 0x30(%rsp)
movl 0x60(%rsp), %eax
cmpl 0x3c(%rsp), %eax
setae %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x6a66
movl 0x60(%rsp), %eax
cmpl 0x3c(%rsp), %eax
ja 0x6a64
movl 0x60(%rsp), %eax
cmpl 0x3c(%rsp), %eax
jne 0x6a66
movl 0x30(%rsp), %eax
cmpl 0x38(%rsp), %eax
jbe 0x6a66
jmp 0x6aaf
movl 0x60(%rsp), %eax
shll $0x4, %eax
addl 0x30(%rsp), %eax
movl %eax, 0x60(%rsp)
movq 0x58(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x58(%rsp)
movb 0x1(%rax), %al
movb %al, 0x37(%rsp)
callq 0x1160
movq (%rax), %rax
movzbl 0x37(%rsp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
jne 0x6a19
jmp 0x6b77
movl 0xcaa6(%rip), %eax      # 0x13560
movl %eax, 0x2c(%rsp)
movl 0xcb3c(%rip), %eax      # 0x13600
movl %eax, 0x28(%rsp)
movq 0x58(%rsp), %rax
movb (%rax), %al
movb %al, 0x27(%rsp)
movzbl 0x27(%rsp), %ecx
xorl %eax, %eax
cmpl $0x30, %ecx
movb %al, 0xd(%rsp)
jl 0x6af2
movzbl 0x27(%rsp), %eax
cmpl $0x37, %eax
setle %al
movb %al, 0xd(%rsp)
movb 0xd(%rsp), %al
testb $0x1, %al
jne 0x6afc
jmp 0x6b75
movzbl 0x27(%rsp), %eax
movl %eax, %ecx
leaq 0x1c5d6(%rip), %rax     # 0x230e0
movl (%rax,%rcx,4), %eax
movl %eax, 0x20(%rsp)
movl 0x60(%rsp), %eax
cmpl 0x2c(%rsp), %eax
setae %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x6b49
movl 0x60(%rsp), %eax
cmpl 0x2c(%rsp), %eax
ja 0x6b47
movl 0x60(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jne 0x6b49
movl 0x20(%rsp), %eax
cmpl 0x28(%rsp), %eax
jbe 0x6b49
jmp 0x6b75
movl 0x60(%rsp), %eax
shll $0x3, %eax
addl 0x20(%rsp), %eax
movl %eax, 0x60(%rsp)
movq 0x58(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x58(%rsp)
movb 0x1(%rax), %al
movb %al, 0x27(%rsp)
jmp 0x6ad3
jmp 0x6b77
jmp 0x6c62
callq 0x1160
movq (%rax), %rax
movq 0x58(%rsp), %rcx
movzbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x6c56
movl 0xc9c1(%rip), %eax      # 0x13568
movl %eax, 0x1c(%rsp)
movl 0xca57(%rip), %eax      # 0x13608
movl %eax, 0x18(%rsp)
movq 0x58(%rsp), %rax
movb (%rax), %al
movb %al, 0x17(%rsp)
movzbl 0x17(%rsp), %eax
movl %eax, %ecx
leaq 0x1c512(%rip), %rax     # 0x230e0
movl (%rax,%rcx,4), %eax
movl %eax, 0x10(%rsp)
movl 0x60(%rsp), %eax
cmpl 0x1c(%rsp), %eax
setae %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0x6c0d
movl 0x60(%rsp), %eax
cmpl 0x1c(%rsp), %eax
ja 0x6c0b
movl 0x60(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jne 0x6c0d
movl 0x10(%rsp), %eax
cmpl 0x18(%rsp), %eax
jbe 0x6c0d
jmp 0x6c54
imull $0xa, 0x60(%rsp), %eax
addl 0x10(%rsp), %eax
movl %eax, 0x60(%rsp)
movq 0x58(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x58(%rsp)
movb 0x1(%rax), %al
movb %al, 0x17(%rsp)
callq 0x1160
movq (%rax), %rax
movzbl 0x17(%rsp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x6bc0
jmp 0x6c60
movq 0x70(%rsp), %rax
movq %rax, 0x58(%rsp)
jmp 0x6c62
jmp 0x6c64
cmpq $0x0, 0x68(%rsp)
je 0x6c79
movq 0x58(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rcx, (%rax)
movl 0x60(%rsp), %eax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)