// File: /workspace/github_cpp_makefile_star2_O3/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, %r15
movq %rdi, 0x28(%rsp)
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
callq 0x4ca86
cmpq $0x0, 0x8(%r15)
movq (%rbx), %rbx
je 0x54cc5
leaq 0x10(%rbx), %r12
xorl %r13d, %r13d
movq (%r15), %rax
movb (%rax,%r13), %al
movzbl %al, %r14d
cmpl $0x26, %r14d
jle 0x54b7b
cmpl $0x27, %r14d
je 0x54b95
movl $0x4, %edx
cmpl $0x3e, %r14d
je 0x54bbf
cmpl $0x3c, %r14d
jne 0x54bf7
leaq 0x1d7f5(%rip), %rsi     # 0x7236e
jmp 0x54bdd
cmpl $0x22, %r14d
je 0x54bc8
cmpl $0x26, %r14d
jne 0x54bf7
movl $0x5, %edx
leaq 0x1d7e5(%rip), %rsi     # 0x72378
jmp 0x54bdd
movl $0x6, %edx
leaq 0x1d7dd(%rip), %rsi     # 0x7237e
testb %bpl, %bpl
jne 0x54bdd
movb $0x27, 0x8(%rsp)
movl $0x1, %edx
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
callq 0xd600
jmp 0x54be5
leaq 0x1d7ad(%rip), %rsi     # 0x72373
jmp 0x54bdd
movl $0x6, %edx
leaq 0x1d7b1(%rip), %rsi     # 0x72385
testb %bpl, %bpl
je 0x54ca9
movq %r12, %rdi
callq 0xd600
incq %r13
cmpq 0x8(%r15), %r13
jb 0x54b46
jmp 0x54cc5
cmpb $0x1f, %al
ja 0x54c0c
cmpl $0xd, %r14d
ja 0x54be5
movl $0x2600, %ecx           # imm = 0x2600
btl %r14d, %ecx
jae 0x54be5
testb %bpl, %bpl
je 0x54c8e
cmpl $0xd, %r14d
ja 0x54c8e
movl $0x2600, %ecx           # imm = 0x2600
btl %r14d, %ecx
jae 0x54c8e
movl $0x3, %edx
movq %r12, %rdi
leaq 0x1d75b(%rip), %rsi     # 0x7238c
callq 0xd600
leaq 0x8(%rsp), %rdi
movl %r14d, %esi
callq 0x4f784
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r12, %rdi
callq 0xd600
movl $0x1, %edx
movq %r12, %rdi
leaq 0x1cba2(%rip), %rsi     # 0x71806
callq 0xd600
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x54be5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x54be5
movb %al, 0x8(%rsp)
movl $0x1, %edx
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
callq 0xd600
jmp 0x54be5
movb $0x22, 0x8(%rsp)
movl $0x1, %edx
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
callq 0xd600
jmp 0x54be5
movq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4ccdd
testq %rbx, %rbx
je 0x54ce3
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movq %r14, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x54d1e
jmp 0x54d1e
jmp 0x54d1e
jmp 0x54d1e
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x54d21
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x54d21
movq %rax, %r14
testq %rbx, %rbx
je 0x54d2f
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movq %r14, %rdi
callq 0xda70
nop