#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 main() {
  char arr[20], vow[10] = "aeiouAEIOU";
  int i, j, v = 0, c = 0;
  printf("Enter the string\n");
  scanf("%s", arr);
  for (i = 0; i < 20 && arr[i] != 0; i++) {
    for (j = 0; j < 10; j++) {
      if (arr[i] == vow[j]) {
        v++;
      }
    }
    c++;
  }
  printf("vowels are %d\n consonants are %d\n", v, c - v);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x2a(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x22(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1040 <scanf@plt>
movl   $0x0,-0x30(%rbp)
xor    %eax,%eax
cmpl   $0x14,-0x30(%rbp)
mov    %al,-0x3d(%rbp)
jge    1199 <main+0x79>
movslq -0x30(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x3d(%rbp)
mov    -0x3d(%rbp),%al
test   $0x1,%al
jne    11a9 <main+0x89>
jmp    1207 <main+0xe7>
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    11f0 <main+0xd0>
movslq -0x30(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
movslq -0x34(%rbp),%rcx
movsbl -0x2a(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    11dd <main+0xbd>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11e2 <main+0xc2>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11b0 <main+0x90>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1178 <main+0x58>
mov    -0x38(%rbp),%esi
mov    -0x3c(%rbp),%edx
sub    -0x38(%rbp),%edx
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
xor    %edx,%edx
movdqa 0xea7(%rip),%xmm0
xor    %esi,%esi
nopl   0x0(%rax,%rax,1)
movzbl (%rsp,%rdx,1),%eax
test   %al,%al
je     11c9 <main+0x99>
movzbl %al,%ecx
movd   %ecx,%xmm1
punpcklbw %xmm1,%xmm1
pshuflw $0x0,%xmm1,%xmm1
pcmpeqb %xmm0,%xmm1
xor    %r8d,%r8d
cmp    $0x4f,%al
sete   %r8b
xor    %edi,%edi
cmp    $0x55,%al
sete   %dil
pmovmskb %xmm1,%eax
mov    %eax,%ecx
shr    %cl
and    $0x55,%cl
sub    %cl,%al
mov    %eax,%ecx
and    $0x33,%cl
shr    $0x2,%al
and    $0x33,%al
add    %cl,%al
mov    %eax,%ecx
shr    $0x4,%cl
add    %al,%cl
and    $0xf,%cl
movzbl %cl,%eax
add    %r8d,%eax
add    %edi,%eax
add    %eax,%esi
add    $0x1,%rdx
cmp    $0x14,%rdx
jne    1160 <main+0x30>
mov    $0x14,%edx
sub    %esi,%edx
lea    0xe41(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.vow = [10 x i8] c"aeiouAEIOU"
@.str = [18 x i8] c"Enter the string\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [34 x i8] c"vowels are %d\0A consonants are %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [10 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = bitcast [10 x i8]* %3 to i8*
store i32 0, i32* %6
store i32 0, i32* %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %10)
store i32 0, i32* %4
br label %12
12: ; preds = %50, %0
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 20
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %20, 0
br label %22
22: ; preds = %15, %12
%23 = phi i1 [ false, %12 ], [ %21, %15 ]
br i1 %23, label %24, label %53
24: ; preds = %22
store i32 0, i32* %5
br label %25
25: ; preds = %44, %24
%26 = load i32, i32* %5
%27 = icmp slt i32 %26, 10
br i1 %27, label %28, label %47
28: ; preds = %25
%29 = load i32, i32* %4
%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 = load i32, i32* %5
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 %35
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %33, %38
br i1 %39, label %40, label %43
40: ; preds = %28
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %6
br label %43
43: ; preds = %40, %28
br label %44
44: ; preds = %43
%45 = load i32, i32* %5
%46 = add nsw i32 %45, 1
store i32 %46, i32* %5
br label %25
47: ; preds = %25
%48 = load i32, i32* %7
%49 = add nsw i32 %48, 1
store i32 %49, i32* %7
br label %50
50: ; preds = %47
%51 = load i32, i32* %4
%52 = add nsw i32 %51, 1
store i32 %52, i32* %4
br label %12
53: ; preds = %22
%54 = load i32, i32* %6
%55 = load i32, i32* %7
%56 = load i32, i32* %6
%57 = sub nsw i32 %55, %56
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %54, i32 %57)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [34 x i8] c"vowels are %d\0A consonants are %d\0A\00"
@str = [17 x i8] c"Enter the string\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 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)
br label %5
5: ; preds = %0, %11
%6 = phi i64 [ 0, %0 ], [ %25, %11 ]
%7 = phi i32 [ 0, %0 ], [ %24, %11 ]
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 %6
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %27, label %11
11: ; preds = %5
%12 = insertelement <8 x i8> poison, i8 %9, i64 0
%13 = shufflevector <8 x i8> %12, <8 x i8> poison, <8 x i32> zeroinitializer
%14 = icmp eq <8 x i8> %13, <i8 97, i8 101, i8 105, i8 111, i8 117, i8 65, i8 69, i8 73>
%15 = icmp eq i8 %9, 79
%16 = zext i1 %15 to i32
%17 = icmp eq i8 %9, 85
%18 = zext i1 %17 to i32
%19 = bitcast <8 x i1> %14 to i8
%20 = call i8 @llvm.ctpop.i8(i8 %19)
%21 = zext i8 %20 to i32
%22 = add nuw nsw i32 %21, %16
%23 = add nuw nsw i32 %22, %18
%24 = add nuw nsw i32 %23, %7
%25 = add nuw nsw i64 %6, 1
%26 = icmp eq i64 %25, 20
br i1 %26, label %29, label %5
27: ; preds = %5
%28 = trunc i64 %6 to i32
br label %29
29: ; preds = %11, %27
%30 = phi i32 [ %7, %27 ], [ %24, %11 ]
%31 = phi i32 [ %28, %27 ], [ 20, %11 ]
%32 = sub nsw i32 %31, %30
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %30, i32 %32)
ret i32 0
}