// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %r12
movb 0x10b3b(%rip), %al      # 0x1db00
testb %al, %al
je 0xd091
xorl %ebx, %ebx
leaq 0x1096a(%rip), %r14     # 0x1d940
movq %rbx, %r13
shlq $0x6, %r13
movq (%r13,%r14), %rsi
movq 0x8(%r13,%r14), %rcx
movq %r15, %rdi
xorl %edx, %edx
callq 0x4580
cmpl $-0x1, %eax
je 0xd039
addq %r14, %r13
movq (%r13), %rsi
movq 0x8(%r13), %rcx
movq %r15, %rdi
xorl %edx, %edx
callq 0x4580
movq 0x8(%r13), %rdx
movq 0x20(%r13), %rcx
movq 0x28(%r13), %r8
movq %r15, %rdi
movq %rax, %rsi
callq 0x4320
movq (%r13), %rsi
movq 0x8(%r13), %rcx
movq %r15, %rdi
xorl %edx, %edx
callq 0x4580
cmpl $-0x1, %eax
jne 0xcff9
incq %rbx
cmpq $0x7, %rbx
jne 0xcfd6
leaq 0x10(%r12), %rcx
movq %rcx, (%r12)
movq (%r15), %rdx
leaq 0x10(%r15), %rax
cmpq %rax, %rdx
je 0xd065
movq %rdx, (%r12)
movq (%rax), %rcx
movq %rcx, 0x10(%r12)
jmp 0xd06b
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x8(%r15), %rcx
movq %rcx, 0x8(%r12)
movq %rax, (%r15)
movq $0x0, 0x8(%r15)
movb $0x0, 0x10(%r15)
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x10a68(%rip), %rdi     # 0x1db00
callq 0x45b0
testl %eax, %eax
je 0xcfcd
leaq 0x108a4(%rip), %r14     # 0x1d950
movq %r14, 0x1088d(%rip)     # 0x1d940
leaq 0x10886(%rip), %rbx     # 0x1d940
leaq 0x994d(%rip), %rsi      # 0x16a0e
leaq 0x9948(%rip), %rdx      # 0x16a10
movq %rbx, %rdi
callq 0x6c96
leaq 0x10899(%rip), %rax     # 0x1d970
movq %rax, 0x10882(%rip)     # 0x1d960
leaq 0x1087b(%rip), %rdi     # 0x1d960
leaq 0x9923(%rip), %rsi      # 0x16a0f
leaq 0x991d(%rip), %rdx      # 0x16a10
callq 0x6c96
leaq 0x10891(%rip), %r13     # 0x1d990
movq %r13, 0x1087a(%rip)     # 0x1d980
leaq 0x10873(%rip), %r14     # 0x1d980
leaq 0x98fd(%rip), %rsi      # 0x16a11
leaq 0x98f7(%rip), %rdx      # 0x16a12
movq %r14, %rdi
callq 0x6c96
leaq 0x10886(%rip), %rax     # 0x1d9b0
movq %rax, 0x1086f(%rip)     # 0x1d9a0
leaq 0x10868(%rip), %rdi     # 0x1d9a0
leaq 0x98d4(%rip), %rsi      # 0x16a13
leaq 0x98de(%rip), %rdx      # 0x16a24
callq 0x6c96
leaq 0x1087e(%rip), %r13     # 0x1d9d0
movq %r13, 0x10867(%rip)     # 0x1d9c0
leaq 0x10860(%rip), %r14     # 0x1d9c0
leaq 0x9da7(%rip), %rsi      # 0x16f0e
leaq 0x9da1(%rip), %rdx      # 0x16f0f
movq %r14, %rdi
callq 0x6c96
leaq 0x10873(%rip), %rax     # 0x1d9f0
movq %rax, 0x1085c(%rip)     # 0x1d9e0
leaq 0x10855(%rip), %rdi     # 0x1d9e0
leaq 0x9893(%rip), %rsi      # 0x16a25
leaq 0x989d(%rip), %rdx      # 0x16a36
callq 0x6c96
leaq 0x1086b(%rip), %r13     # 0x1da10
movq %r13, 0x10854(%rip)     # 0x1da00
leaq 0x1084d(%rip), %r14     # 0x1da00
leaq 0x987d(%rip), %rsi      # 0x16a37
leaq 0x9877(%rip), %rdx      # 0x16a38
movq %r14, %rdi
callq 0x6c96
leaq 0x10860(%rip), %rax     # 0x1da30
movq %rax, 0x10849(%rip)     # 0x1da20
leaq 0x10842(%rip), %rdi     # 0x1da20
leaq 0x9854(%rip), %rsi      # 0x16a39
leaq 0x9860(%rip), %rdx      # 0x16a4c
callq 0x6c96
leaq 0x10858(%rip), %r13     # 0x1da50
movq %r13, 0x10841(%rip)     # 0x1da40
leaq 0x1083a(%rip), %r14     # 0x1da40
leaq 0x9c08(%rip), %rsi      # 0x16e15
leaq 0x9c02(%rip), %rdx      # 0x16e16
movq %r14, %rdi
callq 0x6c96
leaq 0x1084d(%rip), %rax     # 0x1da70
movq %rax, 0x10836(%rip)     # 0x1da60
leaq 0x1082f(%rip), %rdi     # 0x1da60
leaq 0x9815(%rip), %rsi      # 0x16a4d
leaq 0x9821(%rip), %rdx      # 0x16a60
callq 0x6c96
leaq 0x10845(%rip), %r13     # 0x1da90
movq %r13, 0x1082e(%rip)     # 0x1da80
leaq 0x10827(%rip), %r14     # 0x1da80
leaq 0x9801(%rip), %rsi      # 0x16a61
leaq 0x97fb(%rip), %rdx      # 0x16a62
movq %r14, %rdi
callq 0x6c96
leaq 0x1083a(%rip), %rax     # 0x1dab0
movq %rax, 0x10823(%rip)     # 0x1daa0
leaq 0x1081c(%rip), %rdi     # 0x1daa0
leaq 0x97d8(%rip), %rsi      # 0x16a63
leaq 0x97e3(%rip), %rdx      # 0x16a75
callq 0x6c96
leaq 0x10832(%rip), %r13     # 0x1dad0
movq %r13, 0x1081b(%rip)     # 0x1dac0
leaq 0x10814(%rip), %r14     # 0x1dac0
leaq 0x97c3(%rip), %rsi      # 0x16a76
leaq 0x97ca(%rip), %rdx      # 0x16a84
movq %r14, %rdi
callq 0x6c96
leaq 0x10827(%rip), %rax     # 0x1daf0
movq %rax, 0x10810(%rip)     # 0x1dae0
leaq 0x10809(%rip), %rdi     # 0x1dae0
leaq 0x9783(%rip), %rsi      # 0x16a61
leaq 0x977d(%rip), %rdx      # 0x16a62
callq 0x6c96
leaq -0x890b(%rip), %rdi     # 0x49e6
leaq 0x10010(%rip), %rdx     # 0x1d308
xorl %esi, %esi
callq 0x4260
leaq 0x107fa(%rip), %rdi     # 0x1db00
callq 0x41b0
jmp 0xcfcd
movq %rax, %r15
movq 0x107a6(%rip), %rdi     # 0x1dac0
cmpq %r13, %rdi
je 0xd3a5
callq 0x486b
jmp 0xd3a5
jmp 0xd3a2
movq %rax, %r15
movq 0x1074a(%rip), %rdi     # 0x1da80
cmpq %r13, %rdi
je 0xd3a5
callq 0x485c
jmp 0xd3a5
jmp 0xd3a2
movq %rax, %r15
movq 0x106f2(%rip), %rdi     # 0x1da40
cmpq %r13, %rdi
je 0xd3a5
callq 0x484d
jmp 0xd3a5
jmp 0xd3a2
movq %rax, %r15
movq 0x1069a(%rip), %rdi     # 0x1da00
cmpq %r13, %rdi
je 0xd3a5
callq 0x483e
jmp 0xd3a5
jmp 0xd3a2
movq %rax, %r15
movq 0x10642(%rip), %rdi     # 0x1d9c0
cmpq %r13, %rdi
je 0xd3a5
callq 0x482f
jmp 0xd3a5
jmp 0xd3a2
movq %rax, %r15
movq 0x105ea(%rip), %rdi     # 0x1d980
cmpq %r13, %rdi
je 0xd3a5
callq 0x4820
jmp 0xd3a5
movq %rax, %r15
addq $-0x10, %r14
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0xd3bd
movq (%r14), %rsi
incq %rsi
callq 0x42e0
leaq -0x20(%r14), %rax
addq $-0x10, %r14
cmpq %rbx, %r14
movq %rax, %r14
jne 0xd3a9
leaq 0x1072c(%rip), %rdi     # 0x1db00
callq 0x41a0
movq %r15, %rdi
callq 0x4590
movq %rax, %r15
movq 0x10555(%rip), %rdi     # 0x1d940
cmpq %r14, %rdi
je 0xd3cd
callq 0x4811
jmp 0xd3cd
movq %rax, %r15
jmp 0xd3cd