#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 *change(char const *, char *, char *);
int /*<<< orphan*/ free(char *);
char *normalize(const char *str) {
  char *tmp = NULL;
  char *tmp2 = NULL;
  tmp = change(str, "/USERID=", "/UID=");
  tmp2 = change(tmp, "/emailAddress=", "/Email=");
  free(tmp);
  tmp = change(tmp2, "/E=", "/Email=");
  free(tmp2);
  return tmp;
}


x86 assembly (clang, -O0):
<normalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
lea    0xebb(%rip),%rdx
call   1040 <change@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xead(%rip),%rsi
lea    0xeb5(%rip),%rdx
call   1040 <change@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
lea    0xea0(%rip),%rsi
lea    0xe91(%rip),%rdx
call   1040 <change@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize>:
push   %r15
push   %r14
push   %rbx
lea    0xed4(%rip),%rsi
lea    0xed6(%rip),%rdx
call   1040 <change@plt>
mov    %rax,%rbx
lea    0xecd(%rip),%rsi
lea    0xed5(%rip),%r14
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <change@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xec0(%rip),%rsi
mov    %r15,%rdi
mov    %r14,%rdx
call   1040 <change@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"/USERID=\00"
@.str.1 = [6 x i8] c"/UID=\00"
@.str.2 = [15 x i8] c"/emailAddress=\00"
@.str.3 = [8 x i8] c"/Email=\00"
@.str.4 = [4 x i8] c"/E=\00"
define i8* @normalize(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
store i8* null, i8** %4
%5 = load i8*, i8** %2
%6 = call i8* @change(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @change(i8* %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
store i8* %8, i8** %4
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
%11 = load i8*, i8** %4
%12 = call i8* @change(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
store i8* %12, i8** %3
%13 = load i8*, i8** %4
%14 = call i32 @free(i8* %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [9 x i8] c"/USERID=\00"
@.str.1 = [6 x i8] c"/UID=\00"
@.str.2 = [15 x i8] c"/emailAddress=\00"
@.str.3 = [8 x i8] c"/Email=\00"
@.str.4 = [4 x i8] c"/E=\00"
define i8* @normalize(i8* %0) {
%2 = tail call i8* @change(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i8* @change(i8* %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @free(i8* %2)
%5 = tail call i8* @change(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @free(i8* %3)
ret i8* %5
}