// File: /workspace/github_cpp_makefile_star2_O3/halfflat[P]tinyopt/test/googletest/googletest/src/gtest.cc
// Function: testing::internal::ShouldUseColor(bool)
bool ShouldUseColor(bool stdout_is_tty) {
  std::string c = GTEST_FLAG_GET(color);
  const char* const gtest_color = c.c_str();

  if (String::CaseInsensitiveCStringEquals(gtest_color, "auto")) {
#if defined(GTEST_OS_WINDOWS) && !defined(GTEST_OS_WINDOWS_MINGW)
    // On Windows the TERM variable is usually not set, but the
    // console there does support colors.
    return stdout_is_tty;
#else
    // On non-Windows platforms, we rely on the TERM variable.
    const char* const term = posix::GetEnv("TERM");
    const bool term_supports_color =
        term != nullptr && (String::CStringEquals(term, "xterm") ||
                            String::CStringEquals(term, "xterm-color") ||
                            String::CStringEquals(term, "xterm-kitty") ||
                            String::CStringEquals(term, "screen") ||
                            String::CStringEquals(term, "tmux") ||
                            String::CStringEquals(term, "rxvt-unicode") ||
                            String::CStringEquals(term, "linux") ||
                            String::CStringEquals(term, "cygwin") ||
                            String::EndsWithCaseInsensitive(term, "-256color"));
    return stdout_is_tty && term_supports_color;
#endif  // GTEST_OS_WINDOWS
  }

  return String::CaseInsensitiveCStringEquals(gtest_color, "yes") ||
         String::CaseInsensitiveCStringEquals(gtest_color, "true") ||
         String::CaseInsensitiveCStringEquals(gtest_color, "t") ||
         String::CStringEquals(gtest_color, "1");
  // We take "yes", "true", "t", and "1" as meaning "yes".  If the
  // value is neither one of these nor "auto", we treat it as "no" to
  // be conservative.
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edi, %ebx
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x42c54(%rip), %rsi     # 0x948b8
movq 0x42c55(%rip), %rdx     # 0x948c0
addq %rsi, %rdx
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x152da
movq (%r14), %r14
testq %r14, %r14
je 0x51cf4
leaq 0x1f966(%rip), %rsi     # 0x715f0
movq %r14, %rdi
callq 0xd5a0
testl %eax, %eax
je 0x51cfe
leaq 0x1cb76(%rip), %rsi     # 0x6e813
movq %r14, %rdi
callq 0xd5a0
movb $0x1, %bl
testl %eax, %eax
je 0x51e62
leaq 0x1a456(%rip), %rsi     # 0x6c10c
movq %r14, %rdi
callq 0xd5a0
testl %eax, %eax
je 0x51e62
leaq 0x20921(%rip), %rsi     # 0x725ee
movq %r14, %rdi
callq 0xd5a0
testl %eax, %eax
je 0x51e62
cmpb $0x31, (%r14)
jne 0x51e88
cmpb $0x0, 0x1(%r14)
sete %bl
jmp 0x51e62
xorl %ebx, %ebx
xorl %r14d, %r14d
jmp 0x51e67
leaq 0x203cf(%rip), %rdi     # 0x720d4
callq 0xd6d0
testq %rax, %rax
je 0x51e5d
movq %rax, %r15
leaq 0x203bc(%rip), %rsi     # 0x720d9
movq %rax, %rdi
callq 0xd840
movb $0x1, %bpl
testl %eax, %eax
je 0x51e5f
leaq 0x203a8(%rip), %rsi     # 0x720df
movq %r15, %rdi
callq 0xd840
testl %eax, %eax
je 0x51e5f
leaq 0x2039d(%rip), %rsi     # 0x720eb
movq %r15, %rdi
callq 0xd840
testl %eax, %eax
je 0x51e5f
leaq 0x20392(%rip), %rsi     # 0x720f7
movq %r15, %rdi
callq 0xd840
testl %eax, %eax
je 0x51e5f
leaq 0x20382(%rip), %rsi     # 0x720fe
movq %r15, %rdi
callq 0xd840
testl %eax, %eax
je 0x51e5f
leaq 0x20370(%rip), %rsi     # 0x72103
movq %r15, %rdi
callq 0xd840
testl %eax, %eax
je 0x51e5f
leaq 0x20366(%rip), %rsi     # 0x72110
movq %r15, %rdi
callq 0xd840
testl %eax, %eax
je 0x51e5f
leaq 0x20355(%rip), %rsi     # 0x72116
movq %r15, %rdi
callq 0xd840
testl %eax, %eax
je 0x51e5f
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq %r15, %rdi
callq 0xd210
movq %r15, %rdx
addq %rax, %rdx
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x1558a
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x20318(%rip), %rsi     # 0x7211d
leaq 0x2031a(%rip), %rdx     # 0x72126
leaq 0x48(%rsp), %rdi
callq 0x1558a
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %r14
movq %r14, %rsi
callq 0x44958
movl %eax, %ebp
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x51e3f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xd530
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x51e56
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xd530
movq 0x28(%rsp), %r14
jmp 0x51e5f
xorl %ebp, %ebp
andb %bpl, %bl
cmpq %r12, %r14
je 0x51e77
movq 0x38(%rsp), %rsi
incq %rsi
movq %r14, %rdi
callq 0xd530
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0x51e62
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x51eab
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x51eab
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x51ec2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xd530
movq %rbx, %rdi
callq 0xda70