#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 *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char string[100];
  int i, j;
  char vowel[6] = {'a', 'e', 'i', 'o', 'u', '\0'};
  printf("Enter string: ");
  scanf("%s", string);
  for (i = 0; i < strlen(string); i++) {
    for (j = 0; j < 5; j++) {
      if (string[i] == vowel[j])
        printf("%c", string[i]);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeb8(%rip),%eax
mov    %eax,-0x7e(%rbp)
mov    0xeb2(%rip),%ax
mov    %ax,-0x7a(%rbp)
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1050 <scanf@plt>
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
mov    %eax,-0x84(%rbp)
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x84(%rbp),%eax
cmp    %ecx,%eax
jge    1205 <main+0xd5>
movl   $0x0,-0x78(%rbp)
cmpl   $0x5,-0x78(%rbp)
jge    11f2 <main+0xc2>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
movslq -0x78(%rbp),%rcx
movsbl -0x7e(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    11df <main+0xaf>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%esi
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11e4 <main+0xb4>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    11a4 <main+0x74>
jmp    11f7 <main+0xc7>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    117b <main+0x4b>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    1207 <main+0xc7>
xor    %ebx,%ebx
mov    %rsp,%r14
jmp    1193 <main+0x53>
xchg   %ax,%ax
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    1207 <main+0xc7>
movzbl (%rsp,%rbx,1),%eax
cmp    $0x61,%al
je     11b0 <main+0x70>
cmp    $0x65,%al
je     11c2 <main+0x82>
cmp    $0x69,%al
je     11d4 <main+0x94>
cmp    $0x6f,%al
je     11e6 <main+0xa6>
cmp    $0x75,%al
jne    1180 <main+0x40>
jmp    11f8 <main+0xb8>
nopl   (%rax)
mov    $0x61,%edi
call   1030 <putchar@plt>
movzbl (%rsp,%rbx,1),%eax
cmp    $0x65,%al
jne    119f <main+0x5f>
mov    $0x65,%edi
call   1030 <putchar@plt>
movzbl (%rsp,%rbx,1),%eax
cmp    $0x69,%al
jne    11a3 <main+0x63>
mov    $0x69,%edi
call   1030 <putchar@plt>
movzbl (%rsp,%rbx,1),%eax
cmp    $0x6f,%al
jne    11a7 <main+0x67>
mov    $0x6f,%edi
call   1030 <putchar@plt>
movzbl (%rsp,%rbx,1),%eax
cmp    $0x75,%al
jne    1180 <main+0x40>
mov    $0x75,%edi
call   1030 <putchar@plt>
jmp    1180 <main+0x40>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.vowel = [6 x i8] c"aeiou\00"
@.str = [15 x i8] c"Enter string: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca [6 x i8]
store i32 0, i32* %1
%6 = bitcast [6 x i8]* %5 to i8*
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
store i32 0, i32* %3
br label %10
10: ; preds = %43, %0
%11 = load i32, i32* %3
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%13 = call i32 @strlen(i8* %12)
%14 = icmp slt i32 %11, %13
br i1 %14, label %15, label %46
15: ; preds = %10
store i32 0, i32* %4
br label %16
16: ; preds = %39, %15
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 5
br i1 %18, label %19, label %42
19: ; preds = %16
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = load i32, i32* %4
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %24, %29
br i1 %30, label %31, label %38
31: ; preds = %19
%32 = load i32, i32* %3
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %31, %19
br label %39
39: ; preds = %38
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %4
br label %16
42: ; preds = %16
br label %43
43: ; preds = %42
%44 = load i32, i32* %3
%45 = add nsw i32 %44, 1
store i32 %45, i32* %3
br label %10
46: ; preds = %10
%47 = load i32, i32* %1
ret i32 %47
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter string: \00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @strlen(i8* %2)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %43
7: ; preds = %0, %38
%8 = phi i64 [ %39, %38 ], [ 0, %0 ]
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 97
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = call i32 @putchar(i32 97)
%14 = load i8, i8* %9
br label %15
15: ; preds = %7, %12
%16 = phi i8 [ %10, %7 ], [ %14, %12 ]
%17 = icmp eq i8 %16, 101
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = call i32 @putchar(i32 101)
%20 = load i8, i8* %9
br label %21
21: ; preds = %18, %15
%22 = phi i8 [ %20, %18 ], [ %16, %15 ]
%23 = icmp eq i8 %22, 105
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = call i32 @putchar(i32 105)
%26 = load i8, i8* %9
br label %27
27: ; preds = %24, %21
%28 = phi i8 [ %26, %24 ], [ %22, %21 ]
%29 = icmp eq i8 %28, 111
br i1 %29, label %30, label %33
30: ; preds = %27
%31 = call i32 @putchar(i32 111)
%32 = load i8, i8* %9
br label %33
33: ; preds = %30, %27
%34 = phi i8 [ %32, %30 ], [ %28, %27 ]
%35 = icmp eq i8 %34, 117
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 @putchar(i32 117)
br label %38
38: ; preds = %36, %33
%39 = add nuw nsw i64 %8, 1
%40 = call i32 @strlen(i8* %2)
%41 = sext i32 %40 to i64
%42 = icmp slt i64 %39, %41
br i1 %42, label %7, label %43
43: ; preds = %38, %0
ret i32 0
}