// File: /workspace/github_cpp_makefile_star2_O1/halfflat[P]tinyopt/test/googletest/googletest/src/gtest-port.cc
// Function: testing::internal::ParseInt32(testing::Message const&, char const*, int*)
bool ParseInt32(const Message& src_text, const char* str, int32_t* value) {
  // Parses the environment variable as a decimal integer.
  char* end = nullptr;
  const long long_value = strtol(str, &end, 10);  // NOLINT

  // Has strtol() consumed all characters in the string?
  if (*end != '\0') {
    // No - an invalid character was encountered.
    Message msg;
    msg << "WARNING: " << src_text
        << " is expected to be a 32-bit integer, but actually"
        << " has value \"" << str << "\".\n";
    printf("%s", msg.GetString().c_str());
    fflush(stdout);
    return false;
  }

  // Is the parsed value in the range of an int32_t?
  const auto result = static_cast<int32_t>(long_value);
  if (long_value == LONG_MAX || long_value == LONG_MIN ||
      // The parsed value overflows as a long.  (strtol() returns
      // LONG_MAX or LONG_MIN when the input overflows.)
      result != long_value
      // The parsed value overflows as an int32_t.
  ) {
    Message msg;
    msg << "WARNING: " << src_text
        << " is expected to be a 32-bit integer, but actually"
        << " has value " << str << ", which overflows.\n";
    printf("%s", msg.GetString().c_str());
    fflush(stdout);
    return false;
  }

  *value = result;
  return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x30(%rsp), %r15
movq $0x0, (%r15)
movq %rsi, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0xd850
movq (%r15), %rcx
cmpb $0x0, (%rcx)
je 0x48d0e
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x4e2e8
movq (%r14), %r14
leaq 0x10(%r14), %r15
leaq 0x2a785(%rip), %rsi     # 0x73410
movl $0x9, %edx
movq %r15, %rdi
callq 0xd600
movq (%r12), %rsi
leaq 0x8(%rsp), %rdi
callq 0x4e54b
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0xd600
leaq 0x18(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x48cd4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xd530
leaq 0x2a73f(%rip), %rsi     # 0x7341a
movl $0x31, %edx
movq %r15, %rdi
callq 0xd600
leaq 0x2a75d(%rip), %rsi     # 0x7344c
movl $0xc, %edx
movq %r15, %rdi
callq 0xd600
testq %rbx, %rbx
je 0x48d20
movq %rbx, %rdi
callq 0xd210
movq %rax, %rdx
jmp 0x48d2c
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x48d5d
movl %eax, (%r14)
movb $0x1, %al
jmp 0x48e7c
movl $0x6, %edx
leaq 0x2af6d(%rip), %rbx     # 0x73c99
movq %r15, %rdi
movq %rbx, %rsi
callq 0xd600
leaq 0x2a71b(%rip), %rsi     # 0x73459
movl $0x3, %edx
movq %r15, %rdi
callq 0xd600
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x4e54b
jmp 0x48e33
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x4e2e8
movq (%r14), %r14
leaq 0x10(%r14), %r15
leaq 0x2a698(%rip), %rsi     # 0x73410
movl $0x9, %edx
movq %r15, %rdi
callq 0xd600
movq (%r12), %rsi
leaq 0x8(%rsp), %rdi
callq 0x4e54b
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0xd600
leaq 0x18(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x48dc1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xd530
leaq 0x2a652(%rip), %rsi     # 0x7341a
movl $0x31, %edx
movq %r15, %rdi
callq 0xd600
leaq 0x2a681(%rip), %rsi     # 0x7345d
movl $0xb, %edx
movq %r15, %rdi
callq 0xd600
testq %rbx, %rbx
je 0x48dfb
movq %rbx, %rdi
callq 0xd210
movq %rax, %rdx
jmp 0x48e07
movl $0x6, %edx
leaq 0x2ae92(%rip), %rbx     # 0x73c99
movq %r15, %rdi
movq %rbx, %rsi
callq 0xd600
leaq 0x2a650(%rip), %rsi     # 0x73469
movl $0x13, %edx
movq %r15, %rdi
callq 0xd600
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x4e54b
movq 0x8(%rsp), %rsi
leaq 0x2bbd4(%rip), %rdi     # 0x74a13
xorl %eax, %eax
callq 0xd080
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x48e5d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xd530
movq 0x4d10c(%rip), %rax     # 0x95f70
movq (%rax), %rdi
callq 0xd650
testq %r14, %r14
je 0x48e7a
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x48eb0
jmp 0x48e8e
jmp 0x48eb0
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x48eb3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x48eb3
jmp 0x48eb0
movq %rax, %rbx
testq %r14, %r14
je 0x48ec1
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movq %rbx, %rdi
callq 0xda70