#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 /*<<< orphan*/ system(char *);
int main() {
  char car;
  int contatore = 0;
  printf("Inserire una serie di caratteri(# per finire)\n");
  do {
    scanf("%c", &car);
    if (car == 'a' || car == 'e' || car == 'i' || car == 'o' || car == 'u')
      contatore++;
  } while (car != '#');
  printf("Il numero delle vocali e' %d", contatore);
  printf("\n");
  system("pause");
  return 0;
}


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   1040 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
je     11a5 <main+0x75>
movsbl -0x5(%rbp),%eax
cmp    $0x65,%eax
je     11a5 <main+0x75>
movsbl -0x5(%rbp),%eax
cmp    $0x69,%eax
je     11a5 <main+0x75>
movsbl -0x5(%rbp),%eax
cmp    $0x6f,%eax
je     11a5 <main+0x75>
movsbl -0x5(%rbp),%eax
cmp    $0x75,%eax
jne    11ae <main+0x7e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11b3 <main+0x83>
movsbl -0x5(%rbp),%eax
cmp    $0x23,%eax
jne    1154 <main+0x24>
mov    -0xc(%rbp),%esi
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe69(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xec7(%rip),%rdi
call   1040 <puts@plt>
xor    %ebx,%ebx
lea    0xe93(%rip),%r14
lea    0x7(%rsp),%r15
mov    $0x495,%r12d
jmp    1184 <main+0x34>
nopw   0x0(%rax,%rax,1)
cmp    $0x23,%al
je     11ac <main+0x5c>
mov    %r14,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
movzbl 0x7(%rsp),%eax
lea    -0x61(%rax),%ecx
ror    %cl
cmp    $0xa,%cl
ja     1180 <main+0x30>
movzbl %cl,%ecx
bt     %rcx,%r12
jae    1180 <main+0x30>
add    $0x1,%ebx
jmp    1180 <main+0x30>
lea    0xe50(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe53(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [47 x i8] c"Inserire una serie di caratteri(# per finire)\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [29 x i8] c"Il numero delle vocali e' %d\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [6 x i8] c"pause\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 ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %30, %0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 97
br i1 %9, label %26, label %10
10: ; preds = %5
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 101
br i1 %13, label %26, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 105
br i1 %17, label %26, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 111
br i1 %21, label %26, label %22
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 117
br i1 %25, label %26, label %29
26: ; preds = %22, %18, %14, %10, %5
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %29
29: ; preds = %26, %22
br label %30
30: ; preds = %29
%31 = load i8, i8* %2
%32 = sext i8 %31 to i32
%33 = icmp ne i32 %32, 35
br i1 %33, label %5, label %34
34: ; preds = %30
%35 = load i32, i32* %3
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %35)
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%38 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [29 x i8] c"Il numero delle vocali e' %d\00"
@.str.4 = [6 x i8] c"pause\00"
@str = [46 x i8] c"Inserire una serie di caratteri(# per finire)\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
br label %3
3: ; preds = %11, %0
%4 = phi i32 [ 0, %0 ], [ %12, %11 ]
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%6 = load i8, i8* %1
%7 = add i8 %6, -97
%8 = call i8 @llvm.fshl.i8(i8 %7, i8 %7, i8 7)
switch i8 %8, label %11 [
i8 10, label %9
i8 7, label %9
i8 4, label %9
i8 2, label %9
i8 0, label %9
]
9: ; preds = %3, %3, %3, %3, %3
%10 = add nsw i32 %4, 1
br label %11
11: ; preds = %3, %9
%12 = phi i32 [ %10, %9 ], [ %4, %3 ]
%13 = icmp eq i8 %6, 35
br i1 %13, label %14, label %3
14: ; preds = %11
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%16 = call i32 @putchar(i32 10)
%17 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}