#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 */
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int /*<<< orphan*/ __fpurge(int /*<<< orphan*/);
int countVowelsInStr(char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
void countVowelsInStrTD(void) {
  char str[100];
  int noOfVowels;
  printf("Enter a string\n");
  __fpurge(stdin);
  fgets(str, sizeof(str), stdin);
  noOfVowels = countVowelsInStr(str);
  printf("No of vowels in the string = %d\n", noOfVowels);
}


x86 assembly (clang, -O0):
<countVowelsInStrTD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
lea    -0x70(%rbp),%rdi
mov    0x2e76(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1060 <fgets@plt>
lea    -0x70(%rbp),%rdi
call   1040 <countVowelsInStr@plt>
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%esi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countVowelsInStrTD>:
push   %rbx
sub    $0x70,%rsp
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e80(%rip),%rbx
mov    (%rbx),%edi
call   1040 <__fpurge@plt>
mov    (%rbx),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1070 <fgets@plt>
mov    %rbx,%rdi
call   1050 <countVowelsInStr@plt>
lea    0xe70(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter a string\0A\00"
@stdin = global i32 0
@.str.1 = [33 x i8] c"No of vowels in the string = %d\0A\00"
define void @countVowelsInStrTD() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @__fpurge(i32 %4)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %6, i32 100, i32 %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%10 = call i32 @countVowelsInStr(i8* %9)
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@.str.1 = [33 x i8] c"No of vowels in the string = %d\0A\00"
@str = [15 x i8] c"Enter a string\00"
define void @countVowelsInStrTD() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = tail call i32 @__fpurge(i32 %4)
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %2, i32 100, i32 %6)
%8 = call i32 @countVowelsInStr(i8* %2)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret void
}