// File: /workspace/github_c_makefile_star2_O1/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, 0x30(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x12eee
cmpq $0x0, 0x8(%r14)
je 0x1b095
movq 0x8(%rsp), %r15
addq $0x10, %r15
xorl %ebx, %ebx
leaq 0x10(%rsp), %r12
movq (%r14), %rax
movb (%rax,%rbx), %al
movzbl %al, %r13d
cmpl $0x26, %r13d
jle 0x1af53
cmpl $0x27, %r13d
je 0x1af6d
movl $0x4, %edx
cmpl $0x3e, %r13d
je 0x1af95
cmpl $0x3c, %r13d
jne 0x1afcd
leaq 0x389ec(%rip), %rsi     # 0x5393d
jmp 0x1afb3
cmpl $0x22, %r13d
je 0x1af9e
cmpl $0x26, %r13d
jne 0x1afcd
movl $0x5, %edx
leaq 0x389dc(%rip), %rsi     # 0x53947
jmp 0x1afb3
movl $0x6, %edx
leaq 0x389d4(%rip), %rsi     # 0x5394d
testb %bpl, %bpl
jne 0x1afb3
movb $0x27, 0x10(%rsp)
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0xc700
jmp 0x1afbb
leaq 0x389a6(%rip), %rsi     # 0x53942
jmp 0x1afb3
movl $0x6, %edx
leaq 0x389aa(%rip), %rsi     # 0x53954
testb %bpl, %bpl
je 0x1b07b
movq %r15, %rdi
callq 0xc700
incq %rbx
cmpq 0x8(%r14), %rbx
jb 0x1af1f
jmp 0x1b095
cmpb $0x1f, %al
jg 0x1afe2
cmpl $0xd, %r13d
ja 0x1afbb
movl $0x2600, %ecx           # imm = 0x2600
btl %r13d, %ecx
jae 0x1afbb
testb %bpl, %bpl
je 0x1b062
cmpl $0xd, %r13d
ja 0x1b062
movl $0x2600, %ecx           # imm = 0x2600
btl %r13d, %ecx
jae 0x1b062
movl $0x3, %edx
movq %r15, %rdi
leaq 0x38954(%rip), %rsi     # 0x5395b
callq 0xc700
movq %r12, %rdi
movl %r13d, %esi
callq 0x16538
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r15, %rdi
callq 0xc700
movl $0x1, %edx
movq %r15, %rdi
leaq 0x38913(%rip), %rsi     # 0x5394b
callq 0xc700
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1afbb
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xc600
jmp 0x1afbb
movb %al, 0x10(%rsp)
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0xc700
jmp 0x1afbb
movb $0x22, 0x10(%rsp)
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0xc700
jmp 0x1afbb
movq 0x8(%rsp), %r14
movq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x13163
testq %r14, %r14
je 0x1b0c1
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movq $0x0, 0x8(%rsp)
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1b0fc
jmp 0x1b0fc
jmp 0x1b0fc
jmp 0x1b0fc
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1b0ff
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xc600
jmp 0x1b0ff
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1b118
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x8(%rsp)
movq %rbx, %rdi
callq 0xcbb0