// File: /workspace/github_cpp_makefile_star2_O1/halfflat[P]tinyopt/test/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(static_cast<unsigned char>(ch))) {
          if (is_attribute &&
              IsNormalizableWhitespace(static_cast<unsigned char>(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 0x4e2e8
cmpq $0x0, 0x8(%r14)
je 0x56627
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 0x564e5
cmpl $0x27, %r13d
je 0x564ff
movl $0x4, %edx
cmpl $0x3e, %r13d
je 0x56527
cmpl $0x3c, %r13d
jne 0x5655f
leaq 0x1de7b(%rip), %rsi     # 0x7435e
jmp 0x56545
cmpl $0x22, %r13d
je 0x56530
cmpl $0x26, %r13d
jne 0x5655f
movl $0x5, %edx
leaq 0x1de6b(%rip), %rsi     # 0x74368
jmp 0x56545
movl $0x6, %edx
leaq 0x1de63(%rip), %rsi     # 0x7436e
testb %bpl, %bpl
jne 0x56545
movb $0x27, 0x10(%rsp)
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0xd600
jmp 0x5654d
leaq 0x1de35(%rip), %rsi     # 0x74363
jmp 0x56545
movl $0x6, %edx
leaq 0x1de39(%rip), %rsi     # 0x74375
testb %bpl, %bpl
je 0x5660d
movq %r15, %rdi
callq 0xd600
incq %rbx
cmpq 0x8(%r14), %rbx
jb 0x564b1
jmp 0x56627
cmpb $0x1f, %al
ja 0x56574
cmpl $0xd, %r13d
ja 0x5654d
movl $0x2600, %ecx           # imm = 0x2600
btl %r13d, %ecx
jae 0x5654d
testb %bpl, %bpl
je 0x565f4
cmpl $0xd, %r13d
ja 0x565f4
movl $0x2600, %ecx           # imm = 0x2600
btl %r13d, %ecx
jae 0x565f4
movl $0x3, %edx
movq %r15, %rdi
leaq 0x1dde3(%rip), %rsi     # 0x7437c
callq 0xd600
movq %r12, %rdi
movl %r13d, %esi
callq 0x50fe4
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r15, %rdi
callq 0xd600
movl $0x1, %edx
movq %r15, %rdi
leaq 0x1d22c(%rip), %rsi     # 0x737f6
callq 0xd600
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x5654d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x5654d
movb %al, 0x10(%rsp)
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0xd600
jmp 0x5654d
movb $0x22, 0x10(%rsp)
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0xd600
jmp 0x5654d
movq 0x8(%rsp), %r14
movq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4e54b
testq %r14, %r14
je 0x5664a
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x56685
jmp 0x56685
jmp 0x56685
jmp 0x56685
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x56688
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x56688
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x56698
movq (%rdi), %rax
callq *0x8(%rax)
movq %rbx, %rdi
callq 0xda70