// File: /workspace/github_cpp_makefile_star2_O1/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 $0x28, %rsp
movq %rsi, %r12
movq %rdi, %r14
movb 0x107da(%rip), %al      # 0x1db00
testb %al, %al
je 0xd3f8
xorl %ebx, %ebx
leaq 0x10609(%rip), %r15     # 0x1d940
movq %rbx, %r13
shlq $0x6, %r13
movq (%r13,%r15), %rsi
movq 0x8(%r13,%r15), %rcx
movq %r12, %rdi
xorl %edx, %edx
callq 0x4580
cmpl $-0x1, %eax
je 0xd39a
addq %r15, %r13
movq (%r13), %rsi
movq 0x8(%r13), %rcx
movq %r12, %rdi
xorl %edx, %edx
callq 0x4580
movq 0x8(%r13), %rdx
movq 0x20(%r13), %rcx
movq 0x28(%r13), %r8
movq %r12, %rdi
movq %rax, %rsi
callq 0x4320
movq (%r13), %rsi
movq 0x8(%r13), %rcx
movq %r12, %rdi
xorl %edx, %edx
callq 0x4580
cmpl $-0x1, %eax
jne 0xd35a
incq %rbx
cmpq $0x7, %rbx
jne 0xd337
leaq 0x10(%r14), %rcx
movq %rcx, (%r14)
movq (%r12), %rdx
leaq 0x10(%r12), %rax
cmpq %rax, %rdx
je 0xd3c4
movq %rdx, (%r14)
movq (%rax), %rcx
movq %rcx, 0x10(%r14)
jmp 0xd3ca
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x8(%r12), %rcx
movq %rcx, 0x8(%r14)
movq %rax, (%r12)
movq $0x0, 0x8(%r12)
movb $0x0, 0x10(%r12)
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10701(%rip), %rdi     # 0x1db00
callq 0x45b0
testl %eax, %eax
je 0xd32e
leaq 0x1053d(%rip), %rax     # 0x1d950
movq %rax, 0x10526(%rip)     # 0x1d940
leaq 0x1051f(%rip), %r13     # 0x1d940
leaq 0x95e6(%rip), %rsi      # 0x16a0e
leaq 0x95e1(%rip), %rdx      # 0x16a10
movq %r13, %rdi
callq 0x6e3c
leaq 0x10532(%rip), %rax     # 0x1d970
movq %rax, 0x1051b(%rip)     # 0x1d960
leaq 0x10514(%rip), %rdi     # 0x1d960
leaq 0x95bc(%rip), %rsi      # 0x16a0f
leaq 0x95b6(%rip), %rdx      # 0x16a10
movq %rdi, 0x20(%rsp)
callq 0x6e3c
leaq 0x10525(%rip), %rax     # 0x1d990
movq %rax, 0x1050e(%rip)     # 0x1d980
leaq 0x10507(%rip), %r13     # 0x1d980
leaq 0x9591(%rip), %rsi      # 0x16a11
leaq 0x958b(%rip), %rdx      # 0x16a12
movq %r13, %rdi
callq 0x6e3c
leaq 0x1051a(%rip), %rax     # 0x1d9b0
movq %rax, 0x10503(%rip)     # 0x1d9a0
leaq 0x104fc(%rip), %rdi     # 0x1d9a0
leaq 0x9568(%rip), %rsi      # 0x16a13
leaq 0x9572(%rip), %rdx      # 0x16a24
movq %rdi, 0x18(%rsp)
callq 0x6e3c
leaq 0x1050d(%rip), %rax     # 0x1d9d0
movq %rax, 0x104f6(%rip)     # 0x1d9c0
leaq 0x104ef(%rip), %r13     # 0x1d9c0
leaq 0x9a36(%rip), %rsi      # 0x16f0e
leaq 0x9a30(%rip), %rdx      # 0x16f0f
movq %r13, %rdi
callq 0x6e3c
leaq 0x10502(%rip), %rax     # 0x1d9f0
movq %rax, 0x104eb(%rip)     # 0x1d9e0
leaq 0x104e4(%rip), %rdi     # 0x1d9e0
leaq 0x9522(%rip), %rsi      # 0x16a25
leaq 0x952c(%rip), %rdx      # 0x16a36
movq %rdi, 0x10(%rsp)
callq 0x6e3c
leaq 0x104f5(%rip), %rax     # 0x1da10
movq %rax, 0x104de(%rip)     # 0x1da00
leaq 0x104d7(%rip), %r13     # 0x1da00
leaq 0x9507(%rip), %rsi      # 0x16a37
leaq 0x9501(%rip), %rdx      # 0x16a38
movq %r13, %rdi
callq 0x6e3c
leaq 0x104ea(%rip), %rax     # 0x1da30
movq %rax, 0x104d3(%rip)     # 0x1da20
leaq 0x104cc(%rip), %rdi     # 0x1da20
leaq 0x94de(%rip), %rsi      # 0x16a39
leaq 0x94ea(%rip), %rdx      # 0x16a4c
movq %rdi, 0x8(%rsp)
callq 0x6e3c
leaq 0x104dd(%rip), %rax     # 0x1da50
movq %rax, 0x104c6(%rip)     # 0x1da40
leaq 0x104bf(%rip), %r13     # 0x1da40
leaq 0x988d(%rip), %rsi      # 0x16e15
leaq 0x9887(%rip), %rdx      # 0x16e16
movq %r13, %rdi
callq 0x6e3c
leaq 0x104d2(%rip), %rax     # 0x1da70
movq %rax, 0x104bb(%rip)     # 0x1da60
leaq 0x104b4(%rip), %rbp     # 0x1da60
leaq 0x949a(%rip), %rsi      # 0x16a4d
leaq 0x94a6(%rip), %rdx      # 0x16a60
movq %rbp, %rdi
callq 0x6e3c
leaq 0x104c7(%rip), %rax     # 0x1da90
movq %rax, 0x104b0(%rip)     # 0x1da80
leaq 0x104a9(%rip), %r13     # 0x1da80
leaq 0x9483(%rip), %rsi      # 0x16a61
leaq 0x947d(%rip), %rdx      # 0x16a62
movq %r13, %rdi
callq 0x6e3c
leaq 0x104bc(%rip), %rax     # 0x1dab0
movq %rax, 0x104a5(%rip)     # 0x1daa0
leaq 0x1049e(%rip), %rbx     # 0x1daa0
leaq 0x945a(%rip), %rsi      # 0x16a63
leaq 0x9465(%rip), %rdx      # 0x16a75
movq %rbx, %rdi
callq 0x6e3c
leaq 0x104b1(%rip), %rax     # 0x1dad0
movq %rax, 0x1049a(%rip)     # 0x1dac0
leaq 0x10493(%rip), %r13     # 0x1dac0
leaq 0x9442(%rip), %rsi      # 0x16a76
leaq 0x9449(%rip), %rdx      # 0x16a84
movq %r13, %rdi
callq 0x6e3c
leaq 0x104a6(%rip), %rax     # 0x1daf0
movq %rax, 0x1048f(%rip)     # 0x1dae0
leaq 0x10488(%rip), %r15     # 0x1dae0
leaq 0x9402(%rip), %rsi      # 0x16a61
leaq 0x93fc(%rip), %rdx      # 0x16a62
movq %r15, %rdi
callq 0x6e3c
leaq -0x8ae4(%rip), %rdi     # 0x4b91
leaq 0xfc8c(%rip), %rdx      # 0x1d308
xorl %esi, %esi
callq 0x4260
leaq 0x10476(%rip), %rdi     # 0x1db00
callq 0x41b0
jmp 0xd32e
movq %rax, (%rsp)
xorl %eax, %eax
jmp 0xd6a5
movq %rax, (%rsp)
movb $0x1, %al
movq %r13, %r15
movb $0x1, %r12b
testb %al, %al
jne 0xd6f0
addq $-0x10, %r15
leaq 0x10409(%rip), %r13     # 0x1dac0
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0xd6cb
movq (%r15), %rsi
incq %rsi
callq 0x42e0
leaq -0x20(%r15), %rax
addq $-0x10, %r15
cmpq %r13, %r15
movq %rax, %r15
jne 0xd6b7
jmp 0xd6f0
movq %rax, (%rsp)
xorl %r12d, %r12d
jmp 0xd6f0
movq %rax, (%rsp)
movb $0x1, %r12b
movq %r13, %rbx
movb $0x1, %r14b
testb %r12b, %r12b
jne 0xd73c
addq $-0x10, %rbx
leaq 0x1037d(%rip), %r15     # 0x1da80
movq -0x10(%rbx), %rdi
cmpq %rdi, %rbx
je 0xd717
movq (%rbx), %rsi
incq %rsi
callq 0x42e0
leaq -0x20(%rbx), %rax
addq $-0x10, %rbx
cmpq %r15, %rbx
movq %rax, %rbx
jne 0xd703
jmp 0xd73c
movq %rax, (%rsp)
xorl %r14d, %r14d
jmp 0xd73c
movq %rax, (%rsp)
movb $0x1, %r14b
movq %r13, %rbp
movb $0x1, %bl
testb %r14b, %r14b
jne 0xd788
addq $-0x10, %rbp
leaq 0x102f2(%rip), %r14     # 0x1da40
movq -0x10(%rbp), %rdi
cmpq %rdi, %rbp
je 0xd763
movq (%rbp), %rsi
incq %rsi
callq 0x42e0
leaq -0x20(%rbp), %rax
addq $-0x10, %rbp
cmpq %r14, %rbp
movq %rax, %rbp
jne 0xd74e
jmp 0xd788
movq %rax, (%rsp)
xorl %ebx, %ebx
jmp 0xd788
movq %rax, (%rsp)
movb $0x1, %bl
movq %r13, 0x8(%rsp)
movb $0x1, %bpl
testb %bl, %bl
jne 0xd7e7
addq $-0x10, 0x8(%rsp)
leaq 0x10264(%rip), %rbx     # 0x1da00
movq 0x8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rdi, %rax
je 0xd7ba
movq 0x8(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x42e0
movq 0x8(%rsp), %rcx
leaq -0x20(%rcx), %rax
addq $-0x10, %rcx
cmpq %rbx, %rcx
movq %rax, 0x8(%rsp)
jne 0xd79c
jmp 0xd7e7
movq %rax, (%rsp)
xorl %ebp, %ebp
jmp 0xd7e7
movq %rax, (%rsp)
movb $0x1, %bpl
movq %r13, 0x10(%rsp)
movb $0x1, %bl
testb %bpl, %bpl
jne 0xd830
addq $-0x10, 0x10(%rsp)
leaq 0x101c5(%rip), %r14     # 0x1d9c0
movq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rdi, %rax
je 0xd819
movq 0x10(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x42e0
movq 0x10(%rsp), %rcx
leaq -0x20(%rcx), %rax
addq $-0x10, %rcx
cmpq %r14, %rcx
movq %rax, 0x10(%rsp)
jne 0xd7fb
movb $0x1, %bpl
testb %bl, %bl
jne 0xd879
addq $-0x10, 0x18(%rsp)
leaq 0x1013c(%rip), %rbx     # 0x1d980
movq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rdi, %rax
je 0xd862
movq 0x18(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x42e0
movq 0x18(%rsp), %rcx
leaq -0x20(%rcx), %rax
addq $-0x10, %rcx
cmpq %rbx, %rcx
movq %rax, 0x18(%rsp)
jne 0xd844
testb %bpl, %bpl
jne 0xd8c0
addq $-0x10, 0x20(%rsp)
leaq 0x100b5(%rip), %rbx     # 0x1d940
movq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rdi, %rax
je 0xd8a9
movq 0x20(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x42e0
movq 0x20(%rsp), %rcx
leaq -0x20(%rcx), %rax
addq $-0x10, %rcx
cmpq %rbx, %rcx
movq %rax, 0x20(%rsp)
jne 0xd88b
leaq 0x10079(%rip), %rbx     # 0x1d940
cmpq %rbx, %r13
je 0xd8f5
addq $-0x10, %r13
movq -0x10(%r13), %rdi
cmpq %rdi, %r13
je 0xd8e5
movq (%r13), %rsi
incq %rsi
callq 0x42e0
leaq -0x20(%r13), %rax
addq $-0x10, %r13
cmpq %rbx, %r13
movq %rax, %r13
jne 0xd8d0
leaq 0x10204(%rip), %rdi     # 0x1db00
callq 0x41a0
movq (%rsp), %rdi
callq 0x4590
movq %rax, (%rsp)
xorl %ebx, %ebx
jmp 0xd830
movq %rax, (%rsp)
movb $0x1, %bl
movq %r13, 0x18(%rsp)
jmp 0xd830
movq %rax, (%rsp)
xorl %ebp, %ebp
jmp 0xd879
movq %rax, (%rsp)
movb $0x1, %bpl
movq %r13, 0x20(%rsp)
jmp 0xd879