// File: /workspace/github_c_makefile_star2_O3/deplinenoise[P]tundra/unittest/googletest/googletest/src/gtest.cc
// Function: testing::internal::CodePointToUtf8[abi:cxx11](unsigned int)
std::string CodePointToUtf8(UInt32 code_point) {
  if (code_point > kMaxCodePoint4) {
    return "(Invalid Unicode 0x" + String::FormatHexInt(code_point) + ")";
  }

  char str[5];  // Big enough for the largest valid code point.
  if (code_point <= kMaxCodePoint1) {
    str[1] = '\0';
    str[0] = static_cast<char>(code_point);                          // 0xxxxxxx
  } else if (code_point <= kMaxCodePoint2) {
    str[2] = '\0';
    str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx
    str[0] = static_cast<char>(0xC0 | code_point);                   // 110xxxxx
  } else if (code_point <= kMaxCodePoint3) {
    str[3] = '\0';
    str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx
    str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx
    str[0] = static_cast<char>(0xE0 | code_point);                   // 1110xxxx
  } else {  // code_point <= kMaxCodePoint4
    str[4] = '\0';
    str[3] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx
    str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx
    str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx
    str[0] = static_cast<char>(0xF0 | code_point);                   // 11110xxx
  }
  return str;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
cmpl $0x200000, %esi         # imm = 0x200000
jb 0x15caa
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x15e52
leaq 0x3c5fe(%rip), %rcx     # 0x5226f
movl $0x13, %r8d
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xc6e0
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x15ce8
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x15cef
cmpl $0x7f, %esi
ja 0x15cbe
movb $0x0, 0x9(%rsp)
movb %sil, 0x8(%rsp)
jmp 0x15dbd
cmpl $0x7ff, %esi            # imm = 0x7FF
ja 0x15d8a
movb $0x0, 0xa(%rsp)
movl %esi, %eax
shrl $0x6, %eax
andb $0x3f, %sil
orb $-0x80, %sil
movb %sil, 0x9(%rsp)
orb $-0x40, %al
jmp 0x15db9
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x406f4(%rip), %rsi     # 0x56406
callq 0xcca0
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x15d39
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x15d3f
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x15d6d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xc600
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x15de4
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xc600
jmp 0x15de4
movl %esi, %ecx
shrl $0x6, %ecx
movl %esi, %edx
andb $0x3f, %dl
orb $-0x80, %dl
movl %esi, %eax
shrl $0xc, %eax
andb $0x3f, %cl
orb $-0x80, %cl
cmpl $0xffff, %esi           # imm = 0xFFFF
ja 0x15def
movb $0x0, 0xb(%rsp)
movb %dl, 0xa(%rsp)
movb %cl, 0x9(%rsp)
orb $-0x20, %al
movb %al, 0x8(%rsp)
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xc260
leaq (%rsp,%rax), %rdx
addq $0x8, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2e9c2
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
movb $0x0, 0xc(%rsp)
movb %dl, 0xb(%rsp)
movb %cl, 0xa(%rsp)
shrl $0x12, %esi
andb $0x3f, %al
orb $-0x80, %al
movb %al, 0x9(%rsp)
orb $-0x10, %sil
jmp 0x15cb4
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x15e2f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xc600
jmp 0x15e2f
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x15e4a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xc600
movq %rbx, %rdi
callq 0xcbb0