#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ stdin;
main() {
  char c;
  int cvogal = 0;
  printf("Entre com um caractere: ");
  scanf("%c", &c);
  while (c != '.') {
    switch (c) {
    case 'a':
    case 'e':
    case 'i':
    case 'o':
    case 'u':
      cvogal++;
    }
    printf("Entre com um caractere: ");
    fflush(stdin);
    scanf("%c", &c);
  }
  printf("\nTotal de vogais: %d\n", cvogal);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x2e,%eax
je     1204 <main+0xd4>
movsbl -0x5(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x61,%eax
je     11ca <main+0x9a>
jmp    1186 <main+0x56>
mov    -0x10(%rbp),%eax
sub    $0x65,%eax
je     11ca <main+0x9a>
jmp    1197 <main+0x67>
mov    -0x10(%rbp),%eax
sub    $0x69,%eax
je     11ca <main+0x9a>
jmp    11a8 <main+0x78>
mov    -0x10(%rbp),%eax
sub    $0x6f,%eax
je     11ca <main+0x9a>
jmp    11b9 <main+0x89>
mov    -0x10(%rbp),%eax
sub    $0x75,%eax
jne    11d3 <main+0xa3>
jmp    11ca <main+0x9a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e00(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xe23(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
jmp    1164 <main+0x34>
mov    -0xc(%rbp),%esi
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x7(%rsp),%al
cmp    $0x2e,%al
jne    1185 <main+0x55>
lea    0xeb1(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe74(%rip),%r14
mov    0x2e55(%rip),%r13
lea    0xe7f(%rip),%r15
lea    0x7(%rsp),%r12
mov    $0x495,%ebp
xor    %ebx,%ebx
jmp    11d7 <main+0xa7>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x0(%r13),%edi
call   1040 <fflush@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
movzbl 0x7(%rsp),%eax
cmp    $0x2e,%al
je     1164 <main+0x34>
movsbl %al,%eax
add    $0xffffff9f,%eax
ror    %eax
cmp    $0xa,%eax
ja     11b0 <main+0x80>
bt     %eax,%ebp
jae    11b0 <main+0x80>
add    $0x1,%ebx
jmp    11b0 <main+0x80>

LLVM IR (-O0):
@.str = [25 x i8] c"Entre com um caractere: \00"
@.str.1 = [3 x i8] c"%c\00"
@stdin = global i32 0
@.str.2 = [22 x i8] c"\0ATotal de vogais: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %6
6: ; preds = %16, %0
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 46
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
switch i32 %12, label %16 [
i32 97, label %13
i32 101, label %13
i32 105, label %13
i32 111, label %13
i32 117, label %13
]
13: ; preds = %10, %10, %10, %10, %10
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %16
16: ; preds = %13, %10
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* @stdin
%19 = call i32 @fflush(i32 %18)
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %6
21: ; preds = %6
%22 = load i32, i32* %3
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
@.str = [25 x i8] c"Entre com um caractere: \00"
@.str.1 = [3 x i8] c"%c\00"
@stdin = global i32 0
@.str.2 = [22 x i8] c"\0ATotal de vogais: %d\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 46
br i1 %5, label %22, label %6
6: ; preds = %0, %14
%7 = phi i8 [ %20, %14 ], [ %4, %0 ]
%8 = phi i32 [ %15, %14 ], [ 0, %0 ]
%9 = sext i8 %7 to i32
%10 = add nsw i32 %9, -97
%11 = call i32 @llvm.fshl.i32(i32 %10, i32 %10, i32 31)
switch i32 %11, label %14 [
i32 0, label %12
i32 2, label %12
i32 4, label %12
i32 7, label %12
i32 10, label %12
]
12: ; preds = %6, %6, %6, %6, %6
%13 = add nsw i32 %8, 1
br label %14
14: ; preds = %12, %6
%15 = phi i32 [ %8, %6 ], [ %13, %12 ]
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* @stdin
%18 = call i32 @fflush(i32 %17)
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%20 = load i8, i8* %1
%21 = icmp eq i8 %20, 46
br i1 %21, label %22, label %6
22: ; preds = %14, %0
%23 = phi i32 [ 0, %0 ], [ %15, %14 ]
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %23)
ret i32 0
}