#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*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *readFile(char *);
int /*<<< orphan*/ replaceChars(char *, char, unsigned char);
int main() {
  char *str = readFile("DreiChinesen.txt");
  printf("%s\n", str);
  replaceChars(str, 'e', 'a');
  replaceChars(str, 'i', 'a');
  replaceChars(str, 'o', 'a');
  replaceChars(str, 'u', 'a');
  printf("%s\n", str);
  replaceChars(str, 'a', 'e');
  printf("%s\n", str);
  replaceChars(str, 'e', 'i');
  printf("%s\n", str);
  replaceChars(str, 'i', 'o');
  printf("%s\n", str);
  replaceChars(str, 'o', 'u');
  printf("%s\n", str);
  free(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1060 <readFile@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x65,%esi
mov    $0x61,%edx
call   1050 <replaceChars@plt>
mov    -0x10(%rbp),%rdi
mov    $0x69,%esi
mov    $0x61,%edx
call   1050 <replaceChars@plt>
mov    -0x10(%rbp),%rdi
mov    $0x6f,%esi
mov    $0x61,%edx
call   1050 <replaceChars@plt>
mov    -0x10(%rbp),%rdi
mov    $0x75,%esi
mov    $0x61,%edx
call   1050 <replaceChars@plt>
mov    -0x10(%rbp),%rsi
lea    0xe4b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x61,%esi
mov    $0x65,%edx
call   1050 <replaceChars@plt>
mov    -0x10(%rbp),%rsi
lea    0xe28(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x65,%esi
mov    $0x69,%edx
call   1050 <replaceChars@plt>
mov    -0x10(%rbp),%rsi
lea    0xe05(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x69,%esi
mov    $0x6f,%edx
call   1050 <replaceChars@plt>
mov    -0x10(%rbp),%rsi
lea    0xde2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x6f,%esi
mov    $0x75,%edx
call   1050 <replaceChars@plt>
mov    -0x10(%rbp),%rsi
lea    0xdbf(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rdi
call   1060 <readFile@plt>
mov    %rax,%rbx
lea    0xeb7(%rip),%r14
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x65,%esi
mov    $0x61,%edx
call   1050 <replaceChars@plt>
mov    %rbx,%rdi
mov    $0x69,%esi
mov    $0x61,%edx
call   1050 <replaceChars@plt>
mov    %rbx,%rdi
mov    $0x6f,%esi
mov    $0x61,%edx
call   1050 <replaceChars@plt>
mov    %rbx,%rdi
mov    $0x75,%esi
mov    $0x61,%edx
call   1050 <replaceChars@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x61,%esi
mov    $0x65,%edx
call   1050 <replaceChars@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x65,%esi
mov    $0x69,%edx
call   1050 <replaceChars@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x69,%esi
mov    $0x6f,%edx
call   1050 <replaceChars@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x6f,%esi
mov    $0x75,%edx
call   1050 <replaceChars@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"DreiChinesen.txt\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @readFile(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @replaceChars(i8* %6, i8 signext 101, i8 zeroext 97)
%8 = load i8*, i8** %2
%9 = call i32 @replaceChars(i8* %8, i8 signext 105, i8 zeroext 97)
%10 = load i8*, i8** %2
%11 = call i32 @replaceChars(i8* %10, i8 signext 111, i8 zeroext 97)
%12 = load i8*, i8** %2
%13 = call i32 @replaceChars(i8* %12, i8 signext 117, i8 zeroext 97)
%14 = load i8*, i8** %2
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = load i8*, i8** %2
%17 = call i32 @replaceChars(i8* %16, i8 signext 97, i8 zeroext 101)
%18 = load i8*, i8** %2
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%20 = load i8*, i8** %2
%21 = call i32 @replaceChars(i8* %20, i8 signext 101, i8 zeroext 105)
%22 = load i8*, i8** %2
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %22)
%24 = load i8*, i8** %2
%25 = call i32 @replaceChars(i8* %24, i8 signext 105, i8 zeroext 111)
%26 = load i8*, i8** %2
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %26)
%28 = load i8*, i8** %2
%29 = call i32 @replaceChars(i8* %28, i8 signext 111, i8 zeroext 117)
%30 = load i8*, i8** %2
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %30)
%32 = load i8*, i8** %2
%33 = call i32 @free(i8* %32)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"DreiChinesen.txt\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @readFile(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%3 = tail call i32 @replaceChars(i8* %1, i8 signext 101, i8 zeroext 97)
%4 = tail call i32 @replaceChars(i8* %1, i8 signext 105, i8 zeroext 97)
%5 = tail call i32 @replaceChars(i8* %1, i8 signext 111, i8 zeroext 97)
%6 = tail call i32 @replaceChars(i8* %1, i8 signext 117, i8 zeroext 97)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%8 = tail call i32 @replaceChars(i8* %1, i8 signext 97, i8 zeroext 101)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%10 = tail call i32 @replaceChars(i8* %1, i8 signext 101, i8 zeroext 105)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%12 = tail call i32 @replaceChars(i8* %1, i8 signext 105, i8 zeroext 111)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%14 = tail call i32 @replaceChars(i8* %1, i8 signext 111, i8 zeroext 117)
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%16 = tail call i32 @free(i8* %1)
ret i32 0
}