#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 countChr(char *, char);
int /*<<< orphan*/ gets(char *);
scalar_t__ isVovelInStr(char *);
char mostFrequentVowel(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(int argc, char *argv[]) {
  char ch;
  char buffer[80];
  char *string;
  if (argc > 2) {
    string = argv[1];
    ch = (char)argv[2][0];
    printf("String '%s' symbol '%c'\n", string, ch);
  } else {
    string = buffer;
    puts("Input string:");
    gets(string);
    printf("Input char: ");
    scanf("%c", &ch);
  }
  printf("Symbol '%c' occurs %d time(s) in getting string.\n", ch,
         countChr(string, ch));
  if (isVovelInStr(string))
    printf("Getting string has vovel letter(s).\n");
  else
    printf("Getting string doesn't have vovel letter(s).\n");
  ch = mostFrequentVowel(string);
  if (ch == '\0')
    printf("The most frequent vowel is not.\n");
  else
    printf("The most frequent vowel in a string is '%c'.\n", ch);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    11c7 <main+0x57>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x78(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x78(%rbp),%rsi
movsbl -0x11(%rbp),%edx
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1202 <main+0x92>
lea    -0x70(%rbp),%rax
mov    %rax,-0x78(%rbp)
lea    0xe43(%rip),%rdi
call   1030 <puts@plt>
mov    -0x78(%rbp),%rdi
call   1070 <gets@plt>
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe3b(%rip),%rdi
lea    -0x11(%rbp),%rsi
call   1080 <scanf@plt>
movsbl -0x11(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x78(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1050 <countChr@plt>
mov    -0x7c(%rbp),%esi
mov    %eax,%edx
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x78(%rbp),%rdi
call   1090 <isVovelInStr@plt>
cmp    $0x0,%rax
je     124f <main+0xdf>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    125d <main+0xed>
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x78(%rbp),%rdi
call   1060 <mostFrequentVowel@plt>
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x0,%eax
jne    1289 <main+0x119>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    129b <main+0x12b>
movsbl -0x11(%rbp),%esi
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
cmp    $0x3,%edi
jl     11a5 <main+0x35>
mov    0x8(%rsi),%rbp
mov    0x10(%rsi),%rax
mov    (%rax),%bl
mov    %bl,0xf(%rsp)
movsbl %bl,%r14d
lea    0xe6a(%rip),%rdi
mov    %rbp,%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11e5 <main+0x75>
lea    0x10(%rsp),%rbp
lea    0xe68(%rip),%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
call   1070 <gets@plt>
lea    0xe62(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe61(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1080 <scanf@plt>
mov    0xf(%rsp),%bl
movsbl %bl,%r14d
movsbl %bl,%esi
mov    %rbp,%rdi
call   1050 <countChr@plt>
lea    0xe40(%rip),%rdi
mov    %r14d,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
call   1090 <isVovelInStr@plt>
test   %rax,%rax
lea    0xe82(%rip),%rax
lea    0xec8(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
call   1060 <mostFrequentVowel@plt>
mov    %al,0xf(%rsp)
test   %al,%al
je     1248 <main+0xd8>
movsbl %al,%esi
lea    0xe2a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1254 <main+0xe4>
lea    0xe75(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"String '%s' symbol '%c'\0A\00"
@.str.1 = [14 x i8] c"Input string:\00"
@.str.2 = [13 x i8] c"Input char: \00"
@.str.3 = [3 x i8] c"%c\00"
@.str.4 = [50 x i8] c"Symbol '%c' occurs %d time(s) in getting string.\0A\00"
@.str.5 = [37 x i8] c"Getting string has vovel letter(s).\0A\00"
@.str.6 = [46 x i8] c"Getting string doesn't have vovel letter(s).\0A\00"
@.str.7 = [33 x i8] c"The most frequent vowel is not.\0A\00"
@.str.8 = [46 x i8] c"The most frequent vowel in a string is '%c'.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca [80 x i8]
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 2
br i1 %10, label %11, label %24
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
store i8* %14, i8** %8
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = getelementptr inbounds i8, i8* %17, i64 0
%19 = load i8, i8* %18
store i8 %19, i8* %6
%20 = load i8*, i8** %8
%21 = load i8, i8* %6
%22 = sext i8 %21 to i32
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %20, i32 %22)
br label %31
24: ; preds = %2
%25 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
store i8* %25, i8** %8
%26 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%27 = load i8*, i8** %8
%28 = call i32 @gets(i8* %27)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %6)
br label %31
31: ; preds = %24, %11
%32 = load i8, i8* %6
%33 = sext i8 %32 to i32
%34 = load i8*, i8** %8
%35 = load i8, i8* %6
%36 = call i32 @countChr(i8* %34, i8 signext %35)
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0), i32 %33, i32 %36)
%38 = load i8*, i8** %8
%39 = call i64 @isVovelInStr(i8* %38)
%40 = icmp ne i64 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %31
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
br label %45
43: ; preds = %31
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0))
br label %45
45: ; preds = %43, %41
%46 = load i8*, i8** %8
%47 = call signext i8 @mostFrequentVowel(i8* %46)
store i8 %47, i8* %6
%48 = load i8, i8* %6
%49 = sext i8 %48 to i32
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %45
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
br label %57
53: ; preds = %45
%54 = load i8, i8* %6
%55 = sext i8 %54 to i32
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0), i32 %55)
br label %57
57: ; preds = %53, %51
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"String '%s' symbol '%c'\0A\00"
@.str.1 = [14 x i8] c"Input string:\00"
@.str.2 = [13 x i8] c"Input char: \00"
@.str.3 = [3 x i8] c"%c\00"
@.str.4 = [50 x i8] c"Symbol '%c' occurs %d time(s) in getting string.\0A\00"
@.str.8 = [46 x i8] c"The most frequent vowel in a string is '%c'.\0A\00"
@str = [45 x i8] c"Getting string doesn't have vovel letter(s).\00"
@str.9 = [32 x i8] c"The most frequent vowel is not.\00"
@str.10 = [36 x i8] c"Getting string has vovel letter(s).\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8
%4 = alloca [80 x i8]
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%6 = icmp sgt i32 %0, 2
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
store i8 %12, i8* %3
%13 = sext i8 %12 to i32
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %13)
br label %22
15: ; preds = %2
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @gets(i8* %5)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %3)
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
br label %22
22: ; preds = %15, %7
%23 = phi i32 [ %21, %15 ], [ %13, %7 ]
%24 = phi i8 [ %20, %15 ], [ %12, %7 ]
%25 = phi i8* [ %5, %15 ], [ %9, %7 ]
%26 = call i32 @countChr(i8* %25, i8 signext %24)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0), i32 %23, i32 %26)
%28 = call i64 @isVovelInStr(i8* %25)
%29 = icmp eq i64 %28, 0
%30 = select i1 %29, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @str.10, i64 0, i64 0)
%31 = call i32 @puts(i8* dereferenceable(1) %30)
%32 = call signext i8 @mostFrequentVowel(i8* %25)
store i8 %32, i8* %3
%33 = icmp eq i8 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %22
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.9, i64 0, i64 0))
br label %39
36: ; preds = %22
%37 = sext i8 %32 to i32
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0), i32 %37)
br label %39
39: ; preds = %36, %34
ret i32 0
}