#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*/ printf(char *, char *);
char *strfilter1(char *, char *);
char *strfilter2(char *, char *);
char *strfilter3(char *, char *);
char *strfilter4(char *, char *);
int main() {
  char string[] = "equation";
  char letters[] = "aeiou";
  char *filtered = strfilter1(string, letters);
  printf("%s\n", filtered);
  char *filtered2 = strfilter2(string, letters);
  printf("%s\n", filtered2);
  char *filtered3 = strfilter3(string, letters);
  printf("%s\n", filtered3);
  char *filtered4 = strfilter4(string, letters);
  printf("%s\n", filtered4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe9a(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xe98(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xe90(%rip),%eax
mov    %eax,-0x13(%rbp)
mov    0xe8a(%rip),%ax
mov    %ax,-0xf(%rbp)
lea    -0xd(%rbp),%rdi
lea    -0x13(%rbp),%rsi
call   1050 <strfilter1@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe6c(%rip),%rdi
call   1040 <printf@plt>
lea    -0xd(%rbp),%rdi
lea    -0x13(%rbp),%rsi
call   1030 <strfilter2@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xe4b(%rip),%rdi
call   1040 <printf@plt>
lea    -0xd(%rbp),%rdi
lea    -0x13(%rbp),%rsi
call   1060 <strfilter3@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rsi
lea    0xe2a(%rip),%rdi
call   1040 <printf@plt>
lea    -0xd(%rbp),%rdi
lea    -0x13(%rbp),%rsi
call   1070 <strfilter4@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xe09(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
movabs $0x6e6f697461757165,%rax
69 6f 6e
mov    %rax,0x10(%rsp)
movb   $0x0,0x18(%rsp)
movw   $0x75,0xc(%rsp)
movl   $0x6f696561,0x8(%rsp)
6f
lea    0x10(%rsp),%r15
lea    0x8(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <strfilter1@plt>
lea    0xe77(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <strfilter2@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <strfilter3@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1070 <strfilter4@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.string = [9 x i8] c"equation\00"
@__const.main.letters = [6 x i8] c"aeiou\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i8]
%3 = alloca [6 x i8]
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %1
%8 = bitcast [9 x i8]* %2 to i8*
%9 = bitcast [6 x i8]* %3 to i8*
%10 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%12 = call i8* @strfilter1(i8* %10, i8* %11)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%16 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%17 = call i8* @strfilter2(i8* %15, i8* %16)
store i8* %17, i8** %5
%18 = load i8*, i8** %5
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%21 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%22 = call i8* @strfilter3(i8* %20, i8* %21)
store i8* %22, i8** %6
%23 = load i8*, i8** %6
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %23)
%25 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%26 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%27 = call i8* @strfilter4(i8* %25, i8* %26)
store i8* %27, i8** %7
%28 = load i8*, i8** %7
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %28)
ret i32 0
}

LLVM IR (-O2):
@__const.main.string = [9 x i8] c"equation\00"
@__const.main.letters = [6 x i8] c"aeiou\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i8* @strfilter1(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i8* @strfilter2(i8* %3, i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i8* @strfilter3(i8* %3, i8* %4)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i8* @strfilter4(i8* %3, i8* %4)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i32 0
}