// File: WeihuaZhu[P]hpc_prog2/./gtest/gtest-all.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:
subq $0x98, %rsp
movq %rdi, 0x28(%rsp)
movb %dl, %al
movq %rdi, %rcx
movq %rcx, 0x30(%rsp)
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
andb $0x1, %al
movb %al, 0x87(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x192e0
movq $0x0, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x88(%rsp), %rdi
callq 0xe660
movq %rax, %rcx
movq 0x20(%rsp), %rax
cmpq %rcx, %rax
jae 0x233e9
movq 0x88(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0xeb80
movb (%rax), %al
movb %al, 0x6f(%rsp)
movsbl 0x6f(%rsp), %eax
addl $-0x22, %eax
movl %eax, %ecx
movq %rcx, 0x18(%rsp)
subl $0x1c, %eax
ja 0x23302
movq 0x18(%rsp), %rax
leaq 0x2822a(%rip), %rcx     # 0x4b450
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x2a01e(%rip), %rsi     # 0x4d254
leaq 0x78(%rsp), %rdi
callq 0x36dd0
jmp 0x23242
jmp 0x233d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
jmp 0x23411
leaq 0x29ff8(%rip), %rsi     # 0x4d259
leaq 0x78(%rsp), %rdi
callq 0x36dd0
jmp 0x2326d
jmp 0x233d4
leaq 0x29fe5(%rip), %rsi     # 0x4d25e
leaq 0x78(%rsp), %rdi
callq 0x35620
jmp 0x23285
jmp 0x233d4
testb $0x1, 0x87(%rsp)
je 0x232a9
leaq 0x29fc9(%rip), %rsi     # 0x4d264
leaq 0x78(%rsp), %rdi
callq 0x36e10
jmp 0x232a7
jmp 0x232c1
movb $0x27, 0x5b(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0x5b(%rsp), %rsi
callq 0x36e50
jmp 0x232bf
jmp 0x232c1
jmp 0x233d4
testb $0x1, 0x87(%rsp)
je 0x232e5
leaq 0x29f94(%rip), %rsi     # 0x4d26b
leaq 0x78(%rsp), %rdi
callq 0x36e10
jmp 0x232e3
jmp 0x232fd
movb $0x22, 0x5a(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0x5a(%rsp), %rsi
callq 0x36e50
jmp 0x232fb
jmp 0x232fd
jmp 0x233d4
movsbl 0x6f(%rsp), %edi
callq 0x36e90
movb %al, 0x17(%rsp)
jmp 0x23312
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x2331f
jmp 0x233d2
testb $0x1, 0x87(%rsp)
je 0x233bd
movsbl 0x6f(%rsp), %edi
callq 0x36ed0
movb %al, 0x16(%rsp)
jmp 0x2333d
movb 0x16(%rsp), %al
testb $0x1, %al
jne 0x23347
jmp 0x233bd
leaq 0x29f24(%rip), %rsi     # 0x4d272
leaq 0x78(%rsp), %rdi
callq 0x36f10
movq %rax, 0x8(%rsp)
jmp 0x2335f
movzbl 0x6f(%rsp), %esi
leaq 0x38(%rsp), %rdi
callq 0x1cc20
jmp 0x23370
movq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x32e10
movq %rax, (%rsp)
jmp 0x23385
movq (%rsp), %rdi
leaq 0x29ed2(%rip), %rsi     # 0x4d262
callq 0x32e50
jmp 0x23397
leaq 0x38(%rsp), %rdi
callq 0xf698
jmp 0x233d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
leaq 0x38(%rsp), %rdi
callq 0xf698
jmp 0x23411
leaq 0x78(%rsp), %rdi
leaq 0x6f(%rsp), %rsi
callq 0x36e50
jmp 0x233ce
jmp 0x233d0
jmp 0x233d2
jmp 0x233d4
jmp 0x233d6
movq 0x70(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x70(%rsp)
jmp 0x231c2
movq 0x28(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x196c0
jmp 0x233fa
leaq 0x78(%rsp), %rdi
callq 0x105d0
movq 0x30(%rsp), %rax
addq $0x98, %rsp
retq
leaq 0x78(%rsp), %rdi
callq 0x105d0
movq 0x60(%rsp), %rdi
callq 0xf410
nopw %cs:(%rax,%rax)