// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x78(%rbp)
movq %rdi, %rax
movq %rax, -0x70(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpl $0x1fffff, -0xc(%rbp)   # imm = 0x1FFFFF
jbe 0x1b0fe
movl -0xc(%rbp), %esi
leaq -0x50(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x1b240
movq -0x80(%rbp), %rdx
leaq 0x6f6fa(%rip), %rsi     # 0x8a78f
leaq -0x30(%rbp), %rdi
callq 0x32f30
jmp 0x1b0a0
movq -0x78(%rbp), %rdi
leaq 0x738eb(%rip), %rdx     # 0x8e996
leaq -0x30(%rbp), %rsi
callq 0x30980
jmp 0x1b0b6
leaq -0x30(%rbp), %rdi
callq 0xf058
leaq -0x50(%rbp), %rdi
callq 0xf058
jmp 0x1b229
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1b0f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xf058
leaq -0x50(%rbp), %rdi
callq 0xf058
jmp 0x1b236
cmpl $0x7f, -0xc(%rbp)
ja 0x1b113
movb $0x0, -0x60(%rbp)
movl -0xc(%rbp), %eax
movb %al, -0x61(%rbp)
jmp 0x1b1e1
cmpl $0x7ff, -0xc(%rbp)      # imm = 0x7FF
ja 0x1b146
movb $0x0, -0x5f(%rbp)
leaq -0xc(%rbp), %rdi
movl $0x6, %esi
callq 0x32f80
orl $0x80, %eax
movb %al, -0x60(%rbp)
movl -0xc(%rbp), %eax
orl $0xc0, %eax
movb %al, -0x61(%rbp)
jmp 0x1b1df
cmpl $0xffff, -0xc(%rbp)     # imm = 0xFFFF
ja 0x1b18c
movb $0x0, -0x5e(%rbp)
leaq -0xc(%rbp), %rdi
movl $0x6, %esi
callq 0x32f80
orl $0x80, %eax
movb %al, -0x5f(%rbp)
leaq -0xc(%rbp), %rdi
movl $0x6, %esi
callq 0x32f80
orl $0x80, %eax
movb %al, -0x60(%rbp)
movl -0xc(%rbp), %eax
orl $0xe0, %eax
movb %al, -0x61(%rbp)
jmp 0x1b1dd
movb $0x0, -0x5d(%rbp)
leaq -0xc(%rbp), %rdi
movl $0x6, %esi
callq 0x32f80
orl $0x80, %eax
movb %al, -0x5e(%rbp)
leaq -0xc(%rbp), %rdi
movl $0x6, %esi
callq 0x32f80
orl $0x80, %eax
movb %al, -0x5f(%rbp)
leaq -0xc(%rbp), %rdi
movl $0x6, %esi
callq 0x32f80
orl $0x80, %eax
movb %al, -0x60(%rbp)
movl -0xc(%rbp), %eax
orl $0xf0, %eax
movb %al, -0x61(%rbp)
jmp 0x1b1df
jmp 0x1b1e1
leaq -0x62(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0xee90
movq -0x78(%rbp), %rdi
movq -0x88(%rbp), %rdx
leaq -0x61(%rbp), %rsi
callq 0x30890
jmp 0x1b207
leaq -0x62(%rbp), %rdi
callq 0xe850
jmp 0x1b229
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x62(%rbp), %rdi
callq 0xe850
jmp 0x1b236
movq -0x70(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0xee80
nop