#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*/ STRCOPY(char *, char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
char tolower(char);
int main() {
  char acStr1[30], acStr2[30], acStr3[30], cChar;
  int i, iFreqA = 0, iFreqE = 0, iFreqI = 0, iFreqO = 0, iFreqU = 0,
         iFreqCons = 0;
  printf("\nEnter string to be copied\n");
  gets(acStr1);
  STRCOPY(acStr1, acStr2);
  printf("\nCopied String is\n");
  puts(acStr2);
  printf("\nEnter string to find letter frequency\n");
  gets(acStr3);
  for (i = 0; acStr3[i] != '\0'; i++) {
    cChar = tolower(acStr3[i]);
    switch (cChar) {
    case 'a':
      iFreqA++;
      break;
    case 'e':
      iFreqE++;
      break;
    case 'i':
      iFreqI++;
      break;
    case 'o':
      iFreqO++;
      break;
    case 'u':
      iFreqU++;
      break;
    case ' ':
      break;
    default:
      iFreqCons++;
    }
  }
  printf("\nFrequency of vowel 'A' is : %d\n", iFreqA);
  printf("\nFrequency of vowel 'E' is : %d\n", iFreqE);
  printf("\nFrequency of vowel 'I' is : %d\n", iFreqI);
  printf("\nFrequency of vowel 'O' is : %d\n", iFreqO);
  printf("\nFrequency of vowel 'U' is : %d\n", iFreqU);
  printf("\nThe no of consonants is : %d\n", iFreqCons);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
movl   $0x0,-0x84(%rbp)
movl   $0x0,-0x88(%rbp)
movl   $0x0,-0x8c(%rbp)
movl   $0x0,-0x90(%rbp)
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1060 <gets@plt>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1040 <STRCOPY@plt>
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <puts@plt>
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1060 <gets@plt>
movl   $0x0,-0x78(%rbp)
movslq -0x78(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     130f <main+0x1bf>
movslq -0x78(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%edi
call   1070 <tolower@plt>
mov    %al,-0x71(%rbp)
movsbl -0x71(%rbp),%eax
mov    %eax,-0x94(%rbp)
sub    $0x20,%eax
je     12e8 <main+0x198>
jmp    122c <main+0xdc>
mov    -0x94(%rbp),%eax
sub    $0x61,%eax
je     1290 <main+0x140>
jmp    1240 <main+0xf0>
mov    -0x94(%rbp),%eax
sub    $0x65,%eax
je     129e <main+0x14e>
jmp    1254 <main+0x104>
mov    -0x94(%rbp),%eax
sub    $0x69,%eax
je     12ac <main+0x15c>
jmp    1268 <main+0x118>
mov    -0x94(%rbp),%eax
sub    $0x6f,%eax
je     12c0 <main+0x170>
jmp    127c <main+0x12c>
mov    -0x94(%rbp),%eax
sub    $0x75,%eax
je     12d4 <main+0x184>
jmp    12ed <main+0x19d>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    12fc <main+0x1ac>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    12fc <main+0x1ac>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    12fc <main+0x1ac>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    12fc <main+0x1ac>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    12fc <main+0x1ac>
jmp    12fc <main+0x1ac>
mov    -0x90(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x90(%rbp)
jmp    1301 <main+0x1b1>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    11f1 <main+0xa1>
mov    -0x7c(%rbp),%esi
lea    0xd3e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x80(%rbp),%esi
lea    0xd4e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x84(%rbp),%esi
lea    0xd5b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x88(%rbp),%esi
lea    0xd68(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8c(%rbp),%esi
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x90(%rbp),%esi
lea    0xd82(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
lea    0xfb3(%rip),%rdi
call   1030 <puts@plt>
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
lea    0x30(%rsp),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1040 <STRCOPY@plt>
lea    0xfa5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
call   1030 <puts@plt>
lea    0xfa3(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%rdi
call   1060 <gets@plt>
mov    0x10(%rsp),%al
test   %al,%al
je     123d <main+0xed>
lea    0x11(%rsp),%r14
xor    %r12d,%r12d
lea    0xe34(%rip),%r15
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
xor    %r13d,%r13d
xor    %ebx,%ebx
xor    %ebp,%ebp
jmp    11fc <main+0xac>
addl   $0x1,0xc(%rsp)
nopw   0x0(%rax,%rax,1)
movzbl (%r14),%eax
add    $0x1,%r14
test   %al,%al
je     1257 <main+0x107>
movsbl %al,%edi
call   1070 <tolower@plt>
movsbl %al,%eax
lea    -0x61(%rax),%ecx
cmp    $0x14,%ecx
ja     1220 <main+0xd0>
movslq (%r15,%rcx,4),%rax
add    %r15,%rax
jmp    *%rax
add    $0x1,%ebp
jmp    11f0 <main+0xa0>
nopl   (%rax)
cmp    $0x20,%eax
je     11f0 <main+0xa0>
add    $0x1,%r12d
jmp    11f0 <main+0xa0>
add    $0x1,%ebx
jmp    11f0 <main+0xa0>
add    $0x1,%r13d
jmp    11f0 <main+0xa0>
addl   $0x1,0x8(%rsp)
jmp    11f0 <main+0xa0>
xor    %ebp,%ebp
xor    %ebx,%ebx
xor    %r13d,%r13d
movl   $0x0,0x8(%rsp)
movl   $0x0,0xc(%rsp)
xor    %r12d,%r12d
lea    0xdf6(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe07(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe18(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe28(%rip),%rdi
mov    0x8(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe37(%rip),%rdi
mov    0xc(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe46(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\0AEnter string to be copied\0A\00"
@.str.1 = [19 x i8] c"\0ACopied String is\0A\00"
@.str.2 = [40 x i8] c"\0AEnter string to find letter frequency\0A\00"
@.str.3 = [33 x i8] c"\0AFrequency of vowel 'A' is : %d\0A\00"
@.str.4 = [33 x i8] c"\0AFrequency of vowel 'E' is : %d\0A\00"
@.str.5 = [33 x i8] c"\0AFrequency of vowel 'I' is : %d\0A\00"
@.str.6 = [33 x i8] c"\0AFrequency of vowel 'O' is : %d\0A\00"
@.str.7 = [33 x i8] c"\0AFrequency of vowel 'U' is : %d\0A\00"
@.str.8 = [31 x i8] c"\0AThe no of consonants is : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
%3 = alloca [30 x i8]
%4 = alloca [30 x i8]
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%14 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%15 = call i32 @gets(i8* %14)
%16 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%17 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%18 = call i32 @STRCOPY(i8* %16, i8* %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%20 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%21 = call i32 @puts(i8* %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%23 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%24 = call i32 @gets(i8* %23)
store i32 0, i32* %6
br label %25
25: ; preds = %60, %0
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %63
32: ; preds = %25
%33 = load i32, i32* %6
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = call signext i8 @tolower(i8 signext %36)
store i8 %37, i8* %5
%38 = load i8, i8* %5
%39 = sext i8 %38 to i32
switch i32 %39, label %56 [
i32 97, label %40
i32 101, label %43
i32 105, label %46
i32 111, label %49
i32 117, label %52
i32 32, label %55
]
40: ; preds = %32
%41 = load i32, i32* %7
%42 = add nsw i32 %41, 1
store i32 %42, i32* %7
br label %59
43: ; preds = %32
%44 = load i32, i32* %8
%45 = add nsw i32 %44, 1
store i32 %45, i32* %8
br label %59
46: ; preds = %32
%47 = load i32, i32* %9
%48 = add nsw i32 %47, 1
store i32 %48, i32* %9
br label %59
49: ; preds = %32
%50 = load i32, i32* %10
%51 = add nsw i32 %50, 1
store i32 %51, i32* %10
br label %59
52: ; preds = %32
%53 = load i32, i32* %11
%54 = add nsw i32 %53, 1
store i32 %54, i32* %11
br label %59
55: ; preds = %32
br label %59
56: ; preds = %32
%57 = load i32, i32* %12
%58 = add nsw i32 %57, 1
store i32 %58, i32* %12
br label %59
59: ; preds = %56, %55, %52, %49, %46, %43, %40
br label %60
60: ; preds = %59
%61 = load i32, i32* %6
%62 = add nsw i32 %61, 1
store i32 %62, i32* %6
br label %25
63: ; preds = %25
%64 = load i32, i32* %7
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %64)
%66 = load i32, i32* %8
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i32 %66)
%68 = load i32, i32* %9
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i32 %68)
%70 = load i32, i32* %10
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i32 %70)
%72 = load i32, i32* %11
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i32 %72)
%74 = load i32, i32* %12
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i32 %74)
ret i32 0
}

LLVM IR (-O2):
@.str.3 = [33 x i8] c"\0AFrequency of vowel 'A' is : %d\0A\00"
@.str.4 = [33 x i8] c"\0AFrequency of vowel 'E' is : %d\0A\00"
@.str.5 = [33 x i8] c"\0AFrequency of vowel 'I' is : %d\0A\00"
@.str.6 = [33 x i8] c"\0AFrequency of vowel 'O' is : %d\0A\00"
@.str.7 = [33 x i8] c"\0AFrequency of vowel 'U' is : %d\0A\00"
@.str.8 = [31 x i8] c"\0AThe no of consonants is : %d\0A\00"
@str = [27 x i8] c"\0AEnter string to be copied\00"
@str.9 = [18 x i8] c"\0ACopied String is\00"
@str.10 = [39 x i8] c"\0AEnter string to find letter frequency\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = alloca [30 x i8]
%3 = alloca [30 x i8]
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%8 = call i32 @gets(i8* %4)
%9 = call i32 @STRCOPY(i8* %4, i8* %5)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.9, i64 0, i64 0))
%11 = call i32 @puts(i8* %5)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.10, i64 0, i64 0))
%13 = call i32 @gets(i8* %6)
%14 = load i8, i8* %6
%15 = icmp eq i8 %14, 0
br i1 %15, label %50, label %16
16: ; preds = %0, %39
%17 = phi i64 [ %46, %39 ], [ 0, %0 ]
%18 = phi i8 [ %48, %39 ], [ %14, %0 ]
%19 = phi i32 [ %45, %39 ], [ 0, %0 ]
%20 = phi i32 [ %44, %39 ], [ 0, %0 ]
%21 = phi i32 [ %43, %39 ], [ 0, %0 ]
%22 = phi i32 [ %42, %39 ], [ 0, %0 ]
%23 = phi i32 [ %41, %39 ], [ 0, %0 ]
%24 = phi i32 [ %40, %39 ], [ 0, %0 ]
%25 = call signext i8 @tolower(i8 signext %18)
%26 = sext i8 %25 to i32
switch i32 %26, label %37 [
i32 97, label %27
i32 101, label %29
i32 105, label %31
i32 111, label %33
i32 117, label %35
i32 32, label %39
]
27: ; preds = %16
%28 = add nsw i32 %24, 1
br label %39
29: ; preds = %16
%30 = add nsw i32 %23, 1
br label %39
31: ; preds = %16
%32 = add nsw i32 %22, 1
br label %39
33: ; preds = %16
%34 = add nsw i32 %21, 1
br label %39
35: ; preds = %16
%36 = add nsw i32 %20, 1
br label %39
37: ; preds = %16
%38 = add nsw i32 %19, 1
br label %39
39: ; preds = %27, %29, %31, %33, %35, %16, %37
%40 = phi i32 [ %24, %37 ], [ %24, %16 ], [ %24, %35 ], [ %24, %33 ], [ %24, %31 ], [ %24, %29 ], [ %28, %27 ]
%41 = phi i32 [ %23, %37 ], [ %23, %16 ], [ %23, %35 ], [ %23, %33 ], [ %23, %31 ], [ %30, %29 ], [ %23, %27 ]
%42 = phi i32 [ %22, %37 ], [ %22, %16 ], [ %22, %35 ], [ %22, %33 ], [ %32, %31 ], [ %22, %29 ], [ %22, %27 ]
%43 = phi i32 [ %21, %37 ], [ %21, %16 ], [ %21, %35 ], [ %34, %33 ], [ %21, %31 ], [ %21, %29 ], [ %21, %27 ]
%44 = phi i32 [ %20, %37 ], [ %20, %16 ], [ %36, %35 ], [ %20, %33 ], [ %20, %31 ], [ %20, %29 ], [ %20, %27 ]
%45 = phi i32 [ %38, %37 ], [ %19, %16 ], [ %19, %35 ], [ %19, %33 ], [ %19, %31 ], [ %19, %29 ], [ %19, %27 ]
%46 = add nuw i64 %17, 1
%47 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 %46
%48 = load i8, i8* %47
%49 = icmp eq i8 %48, 0
br i1 %49, label %50, label %16
50: ; preds = %39, %0
%51 = phi i32 [ 0, %0 ], [ %40, %39 ]
%52 = phi i32 [ 0, %0 ], [ %41, %39 ]
%53 = phi i32 [ 0, %0 ], [ %42, %39 ]
%54 = phi i32 [ 0, %0 ], [ %43, %39 ]
%55 = phi i32 [ 0, %0 ], [ %44, %39 ]
%56 = phi i32 [ 0, %0 ], [ %45, %39 ]
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %51)
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i32 %52)
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i32 %53)
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i32 %54)
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i32 %55)
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0), i32 %56)
ret i32 0
}