#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 strlen(char *);
int /*<<< orphan*/ system(char *);
int mmmain() {
  char nome[50];
  char vogais[5] = {'a', 'e', 'i', 'o', 'u'};
  int numero_de_vogais = 0, total_array_string = 0, counter = 0;
  printf("Entre com a string: ");
  scanf("%[^\n]%*c", nome);
  printf("Agora vamos contar as vogais.");
  total_array_string = strlen(nome) - 1;
  for (counter = 0; nome[counter] != '\0'; counter++) {
  }
  printf("\n\nO total de vogais eh: %d\n\n", numero_de_vogais);
  printf("\n\n");
  system("PAUSE");
  return 0;
}


x86 assembly (clang, -O0):
<mmmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0xeb2(%rip),%eax
mov    %eax,-0x45(%rbp)
mov    0xead(%rip),%al
mov    %al,-0x41(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1060 <scanf@plt>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
movslq -0x54(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     11d6 <mmmain+0x96>
jmp    11c8 <mmmain+0x88>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    11b1 <mmmain+0x71>
mov    -0x4c(%rbp),%esi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe62(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmmain>:
push   %rbx
sub    $0x40,%rsp
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xeab(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1070 <scanf@plt>
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xeaa(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
lea    0xeab(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.mmmain.vogais = [5 x i8] c"aeiou"
@.str = [21 x i8] c"Entre com a string: \00"
@.str.1 = [9 x i8] c"%[^\0A]%*c\00"
@.str.2 = [30 x i8] c"Agora vamos contar as vogais.\00"
@.str.3 = [29 x i8] c"\0A\0AO total de vogais eh: %d\0A\0A\00"
@.str.4 = [3 x i8] c"\0A\0A\00"
@.str.5 = [6 x i8] c"PAUSE\00"
define i32 @mmmain() {
%1 = alloca [50 x i8]
%2 = alloca [5 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast [5 x i8]* %2 to i8*
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%11 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
%13 = sub nsw i32 %12, 1
store i32 %13, i32* %4
store i32 0, i32* %5
br label %14
14: ; preds = %22, %0
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %14
br label %22
22: ; preds = %21
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %14
25: ; preds = %14
%26 = load i32, i32* %3
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %26)
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%29 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Entre com a string: \00"
@.str.1 = [9 x i8] c"%[^\0A]%*c\00"
@.str.2 = [30 x i8] c"Agora vamos contar as vogais.\00"
@.str.3 = [29 x i8] c"\0A\0AO total de vogais eh: %d\0A\0A\00"
@.str.5 = [6 x i8] c"PAUSE\00"
@str = [2 x i8] c"\0A\00"
define i32 @mmmain() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @strlen(i8* %2)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 0)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%9 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}