// File: /workspace/github_cpp_makefile_star2_O2/tap3edit[P]tap3xml/global.cpp
// Function: apply_xml_rules(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string apply_xml_rules(string str)
{
    int pos, i;


    static string repl_items[][2]={
         { "\r\n",              "\n" }
        ,{ "<",                 "%%$tap3edit$%%lt;" }
        ,{ ">",                 "%%$tap3edit$%%gt;" }
        ,{ "'",                 "%%$tap3edit$%%apos;" }
        ,{ "\"",                "%%$tap3edit$%%quot;" }
        ,{ "&",                 "%%$tap3edit$%%amp;" }
        ,{ "%%$tap3edit$%%",    "&" }
    };

    for (i=0;i<7;i++)
    {
        while ((pos=str.find(repl_items[i][0])) != (int)string::npos)
        {
            str.replace(str.find(repl_items[i][0]),repl_items[i][0].size(),repl_items[i][1]);
        }
    }

    return str;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %r14
movb 0xf81f(%rip), %al       # 0x1ab00
testb %al, %al
je 0xb35d
xorl %r13d, %r13d
leaq 0xf651(%rip), %rbp      # 0x1a940
cmpq $0x7, %r13
je 0xb340
movq %r13, %rax
shlq $0x6, %rax
leaq (%rax,%rbp), %rbx
leaq (%rax,%rbp), %r12
addq $0x20, %r12
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x45f0
cmpl $-0x1, %eax
je 0xb33b
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x45f0
movq 0x8(%rbx), %rdx
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rcx
callq 0x4100
jmp 0xb308
incq %r13
jmp 0xb2ef
movq %r14, %rdi
movq %r15, %rsi
callq 0x43b0
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf79c(%rip), %rdi      # 0x1ab00
callq 0x4580
testl %eax, %eax
je 0xb2e5
leaq 0xf5c8(%rip), %rbx      # 0x1a940
leaq 0x768f(%rip), %rsi      # 0x12a0e
leaq 0x17(%rsp), %rdx
movq %rbx, %rdi
callq 0x5caa
leaq 0xf5cd(%rip), %rdi      # 0x1a960
leaq 0x7675(%rip), %rsi      # 0x12a0f
leaq 0x16(%rsp), %rdx
callq 0x5caa
leaq 0xf5d5(%rip), %r12      # 0x1a980
leaq 0x765f(%rip), %rsi      # 0x12a11
leaq 0x15(%rsp), %rdx
movq %r12, %rdi
callq 0x5caa
leaq 0xf5da(%rip), %rdi      # 0x1a9a0
leaq 0x7646(%rip), %rsi      # 0x12a13
leaq 0x14(%rsp), %rdx
callq 0x5caa
leaq 0xf5e2(%rip), %r12      # 0x1a9c0
leaq 0x7b29(%rip), %rsi      # 0x12f0e
leaq 0x13(%rsp), %rdx
movq %r12, %rdi
callq 0x5caa
leaq 0xf5e7(%rip), %rdi      # 0x1a9e0
leaq 0x7625(%rip), %rsi      # 0x12a25
leaq 0x12(%rsp), %rdx
callq 0x5caa
leaq 0xf5ef(%rip), %r12      # 0x1aa00
leaq 0x761f(%rip), %rsi      # 0x12a37
leaq 0x11(%rsp), %rdx
movq %r12, %rdi
callq 0x5caa
leaq 0xf5f4(%rip), %rdi      # 0x1aa20
leaq 0x7606(%rip), %rsi      # 0x12a39
leaq 0x10(%rsp), %rdx
callq 0x5caa
leaq 0xf5fc(%rip), %r12      # 0x1aa40
leaq 0x79ca(%rip), %rsi      # 0x12e15
leaq 0xf(%rsp), %rdx
movq %r12, %rdi
callq 0x5caa
leaq 0xf601(%rip), %rdi      # 0x1aa60
leaq 0x75e7(%rip), %rsi      # 0x12a4d
leaq 0xe(%rsp), %rdx
callq 0x5caa
leaq 0xf609(%rip), %r12      # 0x1aa80
leaq 0x75e3(%rip), %rsi      # 0x12a61
leaq 0xd(%rsp), %rdx
movq %r12, %rdi
callq 0x5caa
leaq 0xf60e(%rip), %rdi      # 0x1aaa0
leaq 0x75ca(%rip), %rsi      # 0x12a63
leaq 0xc(%rsp), %rdx
callq 0x5caa
leaq 0xf616(%rip), %r12      # 0x1aac0
leaq 0x75c5(%rip), %rsi      # 0x12a76
leaq 0xb(%rsp), %rdx
movq %r12, %rdi
callq 0x5caa
leaq 0xf61b(%rip), %rdi      # 0x1aae0
leaq 0x7595(%rip), %rsi      # 0x12a61
leaq 0xa(%rsp), %rdx
callq 0x5caa
leaq -0x6daf(%rip), %rdi     # 0x472e
leaq 0xee24(%rip), %rdx      # 0x1a308
xorl %esi, %esi
callq 0x4240
leaq 0xf60e(%rip), %rdi      # 0x1ab00
callq 0x41b0
jmp 0xb2e5
movq %rax, %r14
leaq 0xf5ba(%rip), %rdi      # 0x1aac0
callq 0x4150
jmp 0xb563
jmp 0xb560
movq %rax, %r14
leaq 0xf567(%rip), %r12      # 0x1aa80
jmp 0xb543
jmp 0xb560
movq %rax, %r14
leaq 0xf519(%rip), %r12      # 0x1aa40
jmp 0xb543
jmp 0xb560
movq %rax, %r14
leaq 0xf4cb(%rip), %r12      # 0x1aa00
jmp 0xb543
jmp 0xb560
movq %rax, %r14
leaq 0xf47d(%rip), %r12      # 0x1a9c0
movq %r12, %rdi
callq 0x4150
jmp 0xb563
jmp 0xb560
movq %rax, %r14
leaq 0xf427(%rip), %rdi      # 0x1a980
callq 0x4150
jmp 0xb563
movq %rax, %r14
addq $-0x20, %r12
movq %r12, %rdi
callq 0x4150
cmpq %rbx, %r12
jne 0xb563
leaq 0xf585(%rip), %rdi      # 0x1ab00
callq 0x41a0
movq %r14, %rdi
callq 0x4560
movq %rax, %r14
leaq 0xf3ae(%rip), %rdi      # 0x1a940
callq 0x4150
jmp 0xb574
movq %rax, %r14
jmp 0xb574