// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/unittest/googletest/googletest/src/gtest-internal-inl.h
// Function: bool testing::internal::ParseNaturalNumber<int>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int*)
bool ParseNaturalNumber(const ::std::string& str, Integer* number) {
  // Fail fast if the given string does not begin with a digit;
  // this bypasses strtoXXX's "optional leading whitespace and plus
  // or minus sign" semantics, which are undesirable here.
  if (str.empty() || !IsDigit(str[0])) {
    return false;
  }
  errno = 0;

  char* end;
  // BiggestConvertible is the largest integer type that system-provided
  // string-to-number conversion routines can return.

# if GTEST_OS_WINDOWS && !defined(__GNUC__)

  // MSVC and C++ Builder define __int64 instead of the standard long long.
  typedef unsigned __int64 BiggestConvertible;
  const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10);

# else

  typedef unsigned long long BiggestConvertible;  // NOLINT
  const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10);

# endif  // GTEST_OS_WINDOWS && !defined(__GNUC__)

  const bool parse_success = *end == '\0' && errno == 0;

  // TODO(vladl@google.com): Convert this to compile time assertion when it is
  // available.
  GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed));

  const Integer result = static_cast<Integer>(parsed);
  if (parse_success && static_cast<BiggestConvertible>(result) == parsed) {
    *number = result;
    return true;
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0xede0
testb $0x1, %al
jne 0x38916
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xe880
movsbl (%rax), %edi
callq 0x4d6a0
testb $0x1, %al
jne 0x3891f
movb $0x0, -0x1(%rbp)
jmp 0x38a05
callq 0xe090
movl $0x0, (%rax)
movq -0x10(%rbp), %rdi
callq 0xe2b0
movq %rax, %rdi
leaq -0x20(%rbp), %rsi
movl $0xa, %edx
callq 0xeb20
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x41(%rbp)
jne 0x38967
callq 0xe090
cmpl $0x0, (%rax)
sete %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
andb $0x1, %al
movb %al, -0x29(%rbp)
movl $0x1, %edi
callq 0x13f80
testb $0x1, %al
jne 0x3897f
jmp 0x38981
jmp 0x389db
leaq 0x531d9(%rip), %rdx     # 0x8bb61
leaq -0x30(%rbp), %rdi
movq %rdi, -0x50(%rbp)
movl $0x3, %esi
movl $0x3e1, %ecx            # imm = 0x3E1
callq 0x2dbe0
movq -0x50(%rbp), %rdi
callq 0x305f0
movq %rax, %rdi
leaq 0x539ca(%rip), %rsi     # 0x8c37c
callq 0xe750
jmp 0x389b9
leaq -0x30(%rbp), %rdi
callq 0x2dd20
jmp 0x389db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2dd20
jmp 0x38a10
movq -0x28(%rbp), %rax
movl %eax, -0x40(%rbp)
testb $0x1, -0x29(%rbp)
je 0x38a01
movslq -0x40(%rbp), %rax
cmpq -0x28(%rbp), %rax
jne 0x38a01
movl -0x40(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x38a05
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0xee80
nopl (%rax)