// File: /workspace/github_cpp_makefile_star2_O1/halfflat[P]tinyopt/test/googletest/googletest/src/gtest.cc
// Function: testing::internal::CodePointToUtf8[abi:cxx11](unsigned int)
std::string CodePointToUtf8(uint32_t code_point) {
  if (code_point > kMaxCodePoint4) {
    return "(Invalid Unicode 0x" + String::FormatHexUInt32(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 0x5084e
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x509f6
leaq 0x23470(%rip), %rcx     # 0x73c85
movl $0x13, %r8d
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xd5e0
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5088c
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x50893
cmpl $0x7f, %esi
ja 0x50862
movb $0x0, 0x9(%rsp)
movb %sil, 0x8(%rsp)
jmp 0x50961
cmpl $0x7ff, %esi            # imm = 0x7FF
ja 0x5092e
movb $0x0, 0xa(%rsp)
movl %esi, %eax
shrl $0x6, %eax
andb $0x3f, %sil
orb $-0x80, %sil
movb %sil, 0x9(%rsp)
orb $-0x40, %al
jmp 0x5095d
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 0x20219(%rip), %rsi     # 0x70acf
callq 0xdb40
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x508dd
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x508e3
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 0x50911
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xd530
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x50988
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x50988
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 0x50993
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 0xd210
leaq (%rsp,%rax), %rdx
addq $0x8, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x15892
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 0x50858
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x509d3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x509d3
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x509ee
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xd530
movq %rbx, %rdi
callq 0xda70