// File: /workspace/github_cpp_makefile_star2_O3/halfflat[P]tinyopt/test/googletest/googletest/src/gtest.cc
// Function: testing::internal::ColoredPrintf(testing::internal::(anonymous namespace)::GTestColor, char const*, ...)
static void ColoredPrintf(GTestColor color, const char* fmt, ...) {
  va_list args;
  va_start(args, fmt);

  static const bool in_color_mode =
      // We don't condition this on GTEST_HAS_FILE_SYSTEM because we still need
      // to be able to detect terminal I/O regardless.
      ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0);

  const bool use_color = in_color_mode && (color != GTestColor::kDefault);

  if (!use_color) {
    vprintf(fmt, args);
    va_end(args);
    return;
  }

#if defined(GTEST_OS_WINDOWS) && !defined(GTEST_OS_WINDOWS_MOBILE) &&    \
    !defined(GTEST_OS_WINDOWS_PHONE) && !defined(GTEST_OS_WINDOWS_RT) && \
    !defined(GTEST_OS_WINDOWS_MINGW)
  const HANDLE stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);

  // Gets the current text color.
  CONSOLE_SCREEN_BUFFER_INFO buffer_info;
  GetConsoleScreenBufferInfo(stdout_handle, &buffer_info);
  const WORD old_color_attrs = buffer_info.wAttributes;
  const WORD new_color = GetNewColor(color, old_color_attrs);

  // We need to flush the stream buffers into the console before each
  // SetConsoleTextAttribute call lest it affect the text that is already
  // printed but has not yet reached the console.
  fflush(stdout);
  SetConsoleTextAttribute(stdout_handle, new_color);

  vprintf(fmt, args);

  fflush(stdout);
  // Restores the text color.
  SetConsoleTextAttribute(stdout_handle, old_color_attrs);
#else
  printf("\033[0;3%sm", GetAnsiColorCode(color));
  vprintf(fmt, args);
  printf("\033[m");  // Resets the terminal to default.
#endif  // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
  va_end(args);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x5215f
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsi, 0x10(%rsp)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
movb 0x42883(%rip), %al      # 0x94a08
testb %al, %al
je 0x521ec
testl %ebp, %ebp
je 0x521d1
cmpb $0x0, 0x4286c(%rip)     # 0x94a00
je 0x521d1
movslq %ebp, %rax
leaq 0x1ec08(%rip), %rcx     # 0x70da8
movslq -0x4(%rcx,%rax,4), %rsi
addq %rcx, %rsi
leaq 0x20ff1(%rip), %rdi     # 0x731a0
xorl %eax, %eax
callq 0xd080
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xd540
leaq 0x20fe1(%rip), %rdi     # 0x731a9
xorl %eax, %eax
callq 0xd080
jmp 0x521dc
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xd540
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x42815(%rip), %rdi     # 0x94a08
callq 0xdac0
testl %eax, %eax
je 0x52189
movq 0x41d6d(%rip), %rax     # 0x93f70
movq (%rax), %rdi
callq 0xd580
movl %eax, %r14d
callq 0xd070
movq %rax, %r15
movl (%rax), %r12d
movl %r14d, %edi
callq 0xda50
movl %r12d, (%r15)
xorl %edi, %edi
testl %eax, %eax
setne %dil
callq 0x51c43
movb %al, 0x427c9(%rip)      # 0x94a00
leaq 0x427ca(%rip), %rdi     # 0x94a08
callq 0xd320
jmp 0x52189
movq %rax, %rbx
leaq 0x427b6(%rip), %rdi     # 0x94a08
callq 0xd310
movq %rbx, %rdi
callq 0xda70