// File: ambersun1234[P]AVL_Tree/./googletest/googletest/src/gtest.cc
// Function: testing::internal::ColoredPrintf(testing::internal::GTestColor, char const*, ...)
static void ColoredPrintf(GTestColor color, const char* fmt, ...) {
  va_list args;
  va_start(args, fmt);

#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS || \
    GTEST_OS_IOS || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
  const bool use_color = AlwaysFalse();
#else
  static const bool in_color_mode =
      ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0);
  const bool use_color = in_color_mode && (color != COLOR_DEFAULT);
#endif  // GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS
  // The '!= 0' comparison is necessary to satisfy MSVC 7.1.

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

#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && \
    !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT && !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
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
testb %al, %al
je 0x20c8b
movaps %xmm0, -0xc0(%rbp)
movaps %xmm1, -0xb0(%rbp)
movaps %xmm2, -0xa0(%rbp)
movaps %xmm3, -0x90(%rbp)
movaps %xmm4, -0x80(%rbp)
movaps %xmm5, -0x70(%rbp)
movaps %xmm6, -0x60(%rbp)
movaps %xmm7, -0x50(%rbp)
movq %r9, -0xc8(%rbp)
movq %r8, -0xd0(%rbp)
movq %rcx, -0xd8(%rbp)
movq %rdx, -0xe0(%rbp)
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x30(%rbp), %rax
leaq -0xf0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
cmpb $0x0, 0x5be1f(%rip)     # 0x7caf8
jne 0x20d4b
leaq 0x5be16(%rip), %rdi     # 0x7caf8
callq 0x9cb0
cmpl $0x0, %eax
je 0x20d4b
movq 0x5b2a5(%rip), %rax     # 0x7bf98
movq (%rax), %rdi
callq 0x43c50
movl %eax, -0xf4(%rbp)
jmp 0x20d03
movl -0xf4(%rbp), %edi
callq 0x43c30
movl %eax, -0xf8(%rbp)
jmp 0x20d16
movl -0xf8(%rbp), %eax
testl %eax, %eax
setne %al
movzbl %al, %edi
callq 0x20840
movb %al, -0xf9(%rbp)
jmp 0x20d31
movb -0xf9(%rbp), %al
andb $0x1, %al
movb %al, 0x5bdb1(%rip)      # 0x7caf0
leaq 0x5bdb2(%rip), %rdi     # 0x7caf8
callq 0x93d0
xorl %eax, %eax
testb $0x1, 0x5bd9c(%rip)     # 0x7caf0
movb %al, -0xfa(%rbp)
je 0x20d69
cmpl $0x0, -0x4(%rbp)
setne %al
movb %al, -0xfa(%rbp)
movb -0xfa(%rbp), %al
andb $0x1, %al
movb %al, -0x3d(%rbp)
testb $0x1, -0x3d(%rbp)
jne 0x20da7
movq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x9650
leaq -0x30(%rbp), %rax
jmp 0x20ddf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq 0x5bd58(%rip), %rdi     # 0x7caf8
callq 0x93c0
jmp 0x20de8
movl -0x4(%rbp), %edi
callq 0x35be0
movq %rax, %rsi
leaq 0x38b87(%rip), %rdi     # 0x59940
movb $0x0, %al
callq 0x9090
movq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x9650
leaq 0x38b75(%rip), %rdi     # 0x59949
movb $0x0, %al
callq 0x9090
leaq -0x30(%rbp), %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x9c40
nopw %cs:(%rax,%rax)