#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 */
int /*<<< orphan*/ modifyString(char *, char *, char *, int /*<<< orphan*/);
char *unescape_tag(char *tag) {
  modifyString(tag, "&amp;amp;", "&amp;", 0);
  modifyString(tag, "&amp;amp;lt;", "&lt;", 0);
  modifyString(tag, "&amp;lt;", "&lt;", 0);
  modifyString(tag, "&amp;amp;gt;", "&gt;", 0);
  modifyString(tag, "&amp;gt;", "&gt;", 0);
  return tag;
}


x86 assembly (clang, -O0):
<unescape_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xedc(%rip),%rdx
xor    %ecx,%ecx
call   1030 <modifyString@plt>
mov    -0x8(%rbp),%rdi
lea    0xed0(%rip),%rsi
lea    0xed6(%rip),%rdx
xor    %ecx,%ecx
call   1030 <modifyString@plt>
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
lea    0xebd(%rip),%rdx
xor    %ecx,%ecx
call   1030 <modifyString@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
lea    0xebf(%rip),%rdx
xor    %ecx,%ecx
call   1030 <modifyString@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
lea    0xea6(%rip),%rdx
xor    %ecx,%ecx
call   1030 <modifyString@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unescape_tag>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%rsi
lea    0xee5(%rip),%rdx
xor    %ecx,%ecx
call   1030 <modifyString@plt>
lea    0xedd(%rip),%rsi
lea    0xee3(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %ecx,%ecx
call   1030 <modifyString@plt>
lea    0xed4(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %ecx,%ecx
call   1030 <modifyString@plt>
lea    0xec9(%rip),%rsi
lea    0xecf(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %ecx,%ecx
call   1030 <modifyString@plt>
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %ecx,%ecx
call   1030 <modifyString@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"&amp;amp;\00"
@.str.1 = [6 x i8] c"&amp;\00"
@.str.2 = [13 x i8] c"&amp;amp;lt;\00"
@.str.3 = [5 x i8] c"&lt;\00"
@.str.4 = [9 x i8] c"&amp;lt;\00"
@.str.5 = [13 x i8] c"&amp;amp;gt;\00"
@.str.6 = [5 x i8] c"&gt;\00"
@.str.7 = [9 x i8] c"&amp;gt;\00"
define i8* @unescape_tag(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @modifyString(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 0)
%5 = load i8*, i8** %2
%6 = call i32 @modifyString(i8* %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 0)
%7 = load i8*, i8** %2
%8 = call i32 @modifyString(i8* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 0)
%9 = load i8*, i8** %2
%10 = call i32 @modifyString(i8* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 0)
%11 = load i8*, i8** %2
%12 = call i32 @modifyString(i8* %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 0)
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [10 x i8] c"&amp;amp;\00"
@.str.1 = [6 x i8] c"&amp;\00"
@.str.2 = [13 x i8] c"&amp;amp;lt;\00"
@.str.3 = [5 x i8] c"&lt;\00"
@.str.4 = [9 x i8] c"&amp;lt;\00"
@.str.5 = [13 x i8] c"&amp;amp;gt;\00"
@.str.6 = [5 x i8] c"&gt;\00"
@.str.7 = [9 x i8] c"&amp;gt;\00"
define i8* @unescape_tag(i8* returned %0) {
%2 = tail call i32 @modifyString(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 @modifyString(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 0)
%4 = tail call i32 @modifyString(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 0)
%5 = tail call i32 @modifyString(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 0)
%6 = tail call i32 @modifyString(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 0)
ret i8* %0
}