// File: madpilot[P]mDNSResolver/test/catch.h
// Function: Catch::XmlEncode::encodeTo(std::ostream&) const
void encodeTo( std::ostream& os ) const {

            // Apostrophe escaping not necessary if we always use " to write attributes
            // (see: http://www.w3.org/TR/xml/#syntax)

            for( std::size_t i = 0; i < m_str.size(); ++ i ) {
                char c = m_str[i];
                switch( c ) {
                    case '<':   os << "&lt;"; break;
                    case '&':   os << "&amp;"; break;

                    case '>':
                        // See: http://www.w3.org/TR/xml/#syntax
                        if( i > 2 && m_str[i-1] == ']' && m_str[i-2] == ']' )
                            os << "&gt;";
                        else
                            os << c;
                        break;

                    case '\"':
                        if( m_forWhat == ForAttributes )
                            os << "&quot;";
                        else
                            os << c;
                        break;

                    default:
                        // Escape control chars - based on contribution by @espenalb in PR #465 and
                        // by @mrpi PR #588
                        if ( ( c < '\x09' ) || ( c > '\x0D' && c < '\x20') || c=='\x7F' )
                            os << "&#x" << std::uppercase << std::hex << std::setfill('0') << std::setw(2) << static_cast<int>( c ) << ';';
                        else
                            os << c;
                }
            }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0xc390
movq %rax, %rcx
movq -0x30(%rbp), %rax
cmpq %rcx, %rax
jae 0x50d20
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xc540
movb (%rax), %al
movb %al, -0x19(%rbp)
movsbl -0x19(%rbp), %eax
addl $-0x22, %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x1c, %eax
ja 0x50c52
movq -0x38(%rbp), %rax
leaq 0x33c2c(%rip), %rcx     # 0x847c0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
leaq 0x34d5e(%rip), %rsi     # 0x85906
callq 0xc4b0
jmp 0x50d0d
movq -0x10(%rbp), %rdi
leaq 0x34d4e(%rip), %rsi     # 0x8590b
callq 0xc4b0
jmp 0x50d0d
cmpq $0x2, -0x18(%rbp)
jbe 0x50c12
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
subq $0x1, %rsi
callq 0xc540
movsbl (%rax), %eax
cmpl $0x5d, %eax
jne 0x50c12
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
subq $0x2, %rsi
callq 0xc540
movsbl (%rax), %eax
cmpl $0x5d, %eax
jne 0x50c12
movq -0x10(%rbp), %rdi
leaq 0x34d06(%rip), %rsi     # 0x85911
callq 0xc4b0
jmp 0x50c1f
movq -0x10(%rbp), %rdi
movsbl -0x19(%rbp), %esi
callq 0xc590
jmp 0x50d0d
movq -0x28(%rbp), %rax
cmpl $0x1, 0x20(%rax)
jne 0x50c40
movq -0x10(%rbp), %rdi
leaq 0x34cdd(%rip), %rsi     # 0x85916
callq 0xc4b0
jmp 0x50c4d
movq -0x10(%rbp), %rdi
movsbl -0x19(%rbp), %esi
callq 0xc590
jmp 0x50d0d
movsbl -0x19(%rbp), %eax
cmpl $0x9, %eax
jl 0x50c7a
movsbl -0x19(%rbp), %eax
cmpl $0xd, %eax
jle 0x50c6d
movsbl -0x19(%rbp), %eax
cmpl $0x20, %eax
jl 0x50c7a
movsbl -0x19(%rbp), %eax
cmpl $0x7f, %eax
jne 0x50cfe
movq -0x10(%rbp), %rdi
leaq 0x34c98(%rip), %rsi     # 0x8591d
callq 0xc4b0
movq %rax, %rdi
leaq 0x9c(%rip), %rsi        # 0x50d30
callq 0xc180
movq %rax, %rdi
leaq -0x36d13(%rip), %rsi    # 0x19f90
callq 0xc180
movq %rax, -0x48(%rbp)
movl $0x30, %edi
callq 0x19f70
movq -0x48(%rbp), %rdi
movb %al, -0x1a(%rbp)
movzbl -0x1a(%rbp), %esi
callq 0xc770
movq %rax, -0x40(%rbp)
movl $0x2, %edi
callq 0x19fc0
movq -0x40(%rbp), %rdi
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %esi
callq 0xc570
movq %rax, %rdi
movsbl -0x19(%rbp), %esi
callq 0xc890
movq %rax, %rdi
movl $0x3b, %esi
callq 0xc590
jmp 0x50d0b
movq -0x10(%rbp), %rdi
movsbl -0x19(%rbp), %esi
callq 0xc590
jmp 0x50d0d
jmp 0x50d0f
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x50b40
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)