#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
char *xmlescapec(char *, char *, char, char *, int);
char *xmlescape(char *s) {
  char *se = xmlescapec(s, s, '&', "&amp;", 5);
  se = xmlescapec(s, se, '<', "&lt;", 4);
  se = xmlescapec(s, se, '>', "&gt;", 4);
  se = xmlescapec(s, se, '"', "&quot;", 6);
  se = xmlescapec(s, se, '\'', "&apos;", 6);
  return se;
}


x86 assembly (clang, -O0):
<xmlescape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x26,%edx
lea    0xed0(%rip),%rcx
mov    $0x5,%r8d
call   1030 <xmlescapec@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3c,%edx
lea    0xeb3(%rip),%rcx
mov    $0x4,%r8d
call   1030 <xmlescapec@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3e,%edx
lea    0xe95(%rip),%rcx
mov    $0x4,%r8d
call   1030 <xmlescapec@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x22,%edx
lea    0xe77(%rip),%rcx
mov    $0x6,%r8d
call   1030 <xmlescapec@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x27,%edx
lea    0xe5b(%rip),%rcx
mov    $0x6,%r8d
call   1030 <xmlescapec@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlescape>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rcx
mov    %rdi,%rsi
mov    $0x26,%edx
mov    $0x5,%r8d
call   1030 <xmlescapec@plt>
lea    0xed1(%rip),%rcx
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x3c,%edx
mov    $0x4,%r8d
call   1030 <xmlescapec@plt>
lea    0xeb9(%rip),%rcx
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x3e,%edx
mov    $0x4,%r8d
call   1030 <xmlescapec@plt>
lea    0xea1(%rip),%rcx
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x22,%edx
mov    $0x6,%r8d
call   1030 <xmlescapec@plt>
lea    0xe8b(%rip),%rcx
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x27,%edx
mov    $0x6,%r8d
pop    %rbx
jmp    1030 <xmlescapec@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"&amp;\00"
@.str.1 = [5 x i8] c"&lt;\00"
@.str.2 = [5 x i8] c"&gt;\00"
@.str.3 = [7 x i8] c"&quot;\00"
@.str.4 = [7 x i8] c"&apos;\00"
define i8* @xmlescape(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @xmlescapec(i8* %4, i8* %5, i8 signext 38, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
store i8* %6, i8** %3
%7 = load i8*, i8** %2
%8 = load i8*, i8** %3
%9 = call i8* @xmlescapec(i8* %7, i8* %8, i8 signext 60, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
store i8* %9, i8** %3
%10 = load i8*, i8** %2
%11 = load i8*, i8** %3
%12 = call i8* @xmlescapec(i8* %10, i8* %11, i8 signext 62, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
store i8* %12, i8** %3
%13 = load i8*, i8** %2
%14 = load i8*, i8** %3
%15 = call i8* @xmlescapec(i8* %13, i8* %14, i8 signext 34, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 6)
store i8* %15, i8** %3
%16 = load i8*, i8** %2
%17 = load i8*, i8** %3
%18 = call i8* @xmlescapec(i8* %16, i8* %17, i8 signext 39, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 6)
store i8* %18, i8** %3
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
@.str = [6 x i8] c"&amp;\00"
@.str.1 = [5 x i8] c"&lt;\00"
@.str.2 = [5 x i8] c"&gt;\00"
@.str.3 = [7 x i8] c"&quot;\00"
@.str.4 = [7 x i8] c"&apos;\00"
define i8* @xmlescape(i8* %0) {
%2 = tail call i8* @xmlescapec(i8* %0, i8* %0, i8 signext 38, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = tail call i8* @xmlescapec(i8* %0, i8* %2, i8 signext 60, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%4 = tail call i8* @xmlescapec(i8* %0, i8* %3, i8 signext 62, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%5 = tail call i8* @xmlescapec(i8* %0, i8* %4, i8 signext 34, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 6)
%6 = tail call i8* @xmlescapec(i8* %0, i8* %5, i8 signext 39, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 6)
ret i8* %6
}