#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 *, ...);
main() {
  char st[20];
  int i, l, count = 0;
  printf("Enter the length of the string");
  scanf("%d", &l);
  printf("Enter the string");
  scanf("%s", &st);
  for (i = 0; i < l; i++) {
    if (st[i] == 'a' || st[i] == 'e' || st[i] == 'i' || st[i] == 'o' ||
        st[i] == 'u')
      count++;
  }
  printf("The number of vowels in the string is %d", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x2c(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0e(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    11ff <main+0xdf>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x61,%eax
je     11e3 <main+0xc3>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x65,%eax
je     11e3 <main+0xc3>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x69,%eax
je     11e3 <main+0xc3>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x6f,%eax
je     11e3 <main+0xc3>
movslq -0x24(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x75,%eax
jne    11ec <main+0xcc>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11f1 <main+0xd1>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    117d <main+0x5d>
mov    -0x2c(%rbp),%esi
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xed4(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf1d(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
test   %edi,%edi
jle    119d <main+0x7d>
cmp    $0x1,%edi
jne    11b5 <main+0x95>
xor    %ecx,%ecx
xor    %ebx,%ebx
test   $0x1,%dil
je     119d <main+0x7d>
mov    0x10(%rsp,%rcx,1),%al
add    $0x9f,%al
ror    %al
cmp    $0xa,%al
ja     119d <main+0x7d>
movzbl %al,%eax
mov    $0x495,%ecx
bt     %rax,%rcx
jae    119d <main+0x7d>
add    $0x1,%ebx
lea    0xe8f(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret
mov    %edi,%edx
and    $0xfffffffe,%edx
xor    %ecx,%ecx
mov    $0x495,%esi
xor    %ebx,%ebx
jmp    11d9 <main+0xb9>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x2,%rcx
cmp    %rcx,%rdx
je     117a <main+0x5a>
movzbl 0x10(%rsp,%rcx,1),%eax
add    $0x9f,%al
ror    %al
cmp    $0xa,%al
ja     11f2 <main+0xd2>
movzbl %al,%eax
bt     %rax,%rsi
jae    11f2 <main+0xd2>
add    $0x1,%ebx
movzbl 0x11(%rsp,%rcx,1),%eax
add    $0x9f,%al
ror    %al
cmp    $0xa,%al
ja     11d0 <main+0xb0>
movzbl %al,%eax
bt     %rax,%rsi
jae    11d0 <main+0xb0>
add    $0x1,%ebx
jmp    11d0 <main+0xb0>

LLVM IR (-O0):
@.str = [31 x i8] c"Enter the length of the string\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"Enter the string\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [41 x i8] c"The number of vowels in the string is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), [20 x i8]* %2)
store i32 0, i32* %3
br label %10
10: ; preds = %53, %0
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %56
14: ; preds = %10
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 97
br i1 %20, label %49, label %21
21: ; preds = %14
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 101
br i1 %27, label %49, label %28
28: ; preds = %21
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 105
br i1 %34, label %49, label %35
35: ; preds = %28
%36 = load i32, i32* %3
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 111
br i1 %41, label %49, label %42
42: ; preds = %35
%43 = load i32, i32* %3
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %44
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 117
br i1 %48, label %49, label %52
49: ; preds = %42, %35, %28, %21, %14
%50 = load i32, i32* %5
%51 = add nsw i32 %50, 1
store i32 %51, i32* %5
br label %52
52: ; preds = %49, %42
br label %53
53: ; preds = %52
%54 = load i32, i32* %3
%55 = add nsw i32 %54, 1
store i32 %55, i32* %3
br label %10
56: ; preds = %10
%57 = load i32, i32* %5
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i32 %57)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Enter the length of the string\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"Enter the string\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [41 x i8] c"The number of vowels in the string is %d\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), [20 x i8]* %1)
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %53
11: ; preds = %0
%12 = zext i32 %9 to i64
%13 = and i64 %12, 1
%14 = icmp eq i32 %9, 1
br i1 %14, label %41, label %15
15: ; preds = %11
%16 = and i64 %12, 4294967294
br label %17
17: ; preds = %36, %15
%18 = phi i64 [ 0, %15 ], [ %38, %36 ]
%19 = phi i32 [ 0, %15 ], [ %37, %36 ]
%20 = phi i64 [ 0, %15 ], [ %39, %36 ]
%21 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %18
%22 = load i8, i8* %21
%23 = add i8 %22, -97
%24 = call i8 @llvm.fshl.i8(i8 %23, i8 %23, i8 7)
switch i8 %24, label %27 [
i8 0, label %25
i8 2, label %25
i8 4, label %25
i8 7, label %25
i8 10, label %25
]
25: ; preds = %17, %17, %17, %17, %17
%26 = add nsw i32 %19, 1
br label %27
27: ; preds = %17, %25
%28 = phi i32 [ %26, %25 ], [ %19, %17 ]
%29 = or i64 %18, 1
%30 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = add i8 %31, -97
%33 = call i8 @llvm.fshl.i8(i8 %32, i8 %32, i8 7)
switch i8 %33, label %36 [
i8 0, label %34
i8 2, label %34
i8 4, label %34
i8 7, label %34
i8 10, label %34
]
34: ; preds = %27, %27, %27, %27, %27
%35 = add nsw i32 %28, 1
br label %36
36: ; preds = %34, %27
%37 = phi i32 [ %35, %34 ], [ %28, %27 ]
%38 = add nuw nsw i64 %18, 2
%39 = add i64 %20, 2
%40 = icmp eq i64 %39, %16
br i1 %40, label %41, label %17
41: ; preds = %36, %11
%42 = phi i32 [ undef, %11 ], [ %37, %36 ]
%43 = phi i64 [ 0, %11 ], [ %38, %36 ]
%44 = phi i32 [ 0, %11 ], [ %37, %36 ]
%45 = icmp eq i64 %13, 0
br i1 %45, label %53, label %46
46: ; preds = %41
%47 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %43
%48 = load i8, i8* %47
%49 = add i8 %48, -97
%50 = call i8 @llvm.fshl.i8(i8 %49, i8 %49, i8 7)
switch i8 %50, label %53 [
i8 0, label %51
i8 2, label %51
i8 4, label %51
i8 7, label %51
i8 10, label %51
]
51: ; preds = %46, %46, %46, %46, %46
%52 = add nsw i32 %44, 1
br label %53
53: ; preds = %41, %51, %46, %0
%54 = phi i32 [ 0, %0 ], [ %42, %41 ], [ %52, %51 ], [ %44, %46 ]
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i32 %54)
ret i32 0
}