// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/unittest/googletest/googletest/src/gtest.cc
// Function: testing::internal::XmlUnitTestResultPrinter::EscapeXml(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool)
std::string XmlUnitTestResultPrinter::EscapeXml(
    const std::string& str, bool is_attribute) {
  Message m;

  for (size_t i = 0; i < str.size(); ++i) {
    const char ch = str[i];
    switch (ch) {
      case '<':
        m << "&lt;";
        break;
      case '>':
        m << "&gt;";
        break;
      case '&':
        m << "&amp;";
        break;
      case '\'':
        if (is_attribute)
          m << "&apos;";
        else
          m << '\'';
        break;
      case '"':
        if (is_attribute)
          m << "&quot;";
        else
          m << '"';
        break;
      default:
        if (IsValidXmlCharacter(ch)) {
          if (is_attribute && IsNormalizableWhitespace(ch))
            m << "&#x" << String::FormatByte(static_cast<unsigned char>(ch))
              << ";";
          else
            m << ch;
        }
        break;
    }
  }

  return m.GetString();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, 0x10(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x11c8e
xorl %r12d, %r12d
leaq 0x2cddb(%rip), %rbx     # 0x4493d
leaq 0x18(%rsp), %r13
cmpq 0x8(%r14), %r12
jae 0x17cc7
movq (%r14), %rax
movzbl (%rax,%r12), %r15d
cmpl $0x22, %r15d
je 0x17c7d
cmpl $0x26, %r15d
je 0x17bac
cmpl $0x27, %r15d
je 0x17bd6
cmpl $0x3e, %r15d
je 0x17bc1
cmpl $0x3c, %r15d
jne 0x17bf4
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
movq %rbx, %rsi
jmp 0x17c92
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
leaq 0x2cd8b(%rip), %rsi     # 0x44947
jmp 0x17c92
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
leaq 0x2cd71(%rip), %rsi     # 0x44942
jmp 0x17c92
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
testb %bpl, %bpl
je 0x17cb3
leaq 0x2cd5e(%rip), %rsi     # 0x4494d
jmp 0x17c92
cmpb $0x1f, %r15b
jg 0x17c13
cmpl $0xd, %r15d
ja 0x17c97
movl $0x2600, %eax           # imm = 0x2600
btl %r15d, %eax
jae 0x17c97
testb %bpl, %bpl
je 0x17c9f
cmpl $0xd, %r15d
ja 0x17c9f
movl $0x2600, %eax           # imm = 0x2600
btl %r15d, %eax
jae 0x17c9f
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
leaq 0x2cd1e(%rip), %rsi     # 0x4495b
callq 0xd5e0
movq %r13, %rdi
movl %r15d, %esi
callq 0x14782
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
movq %r13, %rsi
callq 0xd520
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
leaq 0x2ccdd(%rip), %rsi     # 0x4494b
callq 0xd5e0
movq %r13, %rdi
callq 0xdd68
jmp 0x17c97
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
testb %bpl, %bpl
je 0x17cbd
leaq 0x2ccc2(%rip), %rsi     # 0x44954
callq 0xd5e0
incq %r12
jmp 0x17b67
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
movsbl %r15b, %esi
callq 0xd750
jmp 0x17c97
pushq $0x27
popq %rsi
callq 0xd750
jmp 0x17c97
pushq $0x22
popq %rsi
callq 0xd750
jmp 0x17c97
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x11e63
leaq 0x8(%rsp), %rdi
callq 0x1f8e0
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x17d0c
jmp 0x17d0c
jmp 0x17d0c
jmp 0x17d0c
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0xdd68
jmp 0x17d0f
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1f8e0
movq %rbx, %rdi
callq 0xdbf0
nop