#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*/ vocales;

/* Variables and functions */
int /*<<< orphan*/ gets(unsigned char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ system(char *);
main() {
  system("title 31_Cascallar_Autrán_Manuel");
  system("color 0A");
  system("cls");
  printf("VOCAIS NUNHA CADEA DE CARACTERES\n");
  printf("================================\n");
  unsigned char v[100];
  printf("Introduce a cadea de caracteres:\n");
  gets(v);
  unsigned char vocales[] = {'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U',
                             160, 130, 161, 162, 163, 181, 144, 214, 224, 233};
  int c, a, i;
  c = 0;
  a = 0;
  i = 0;
  for (i = 0; v[i] != 0; i++) {
    for (a = 0; a < sizeof(vocales); a++) {
      if (v[i] == vocales[a])
        c++;
      {}
    }
  }
  printf("%d\n", c);
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
call   1030 <system@plt>
lea    0xecd(%rip),%rdi
call   1030 <system@plt>
lea    0xeca(%rip),%rdi
call   1030 <system@plt>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeea(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1050 <gets@plt>
mov    0xf00(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0xefa(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    0xef5(%rip),%eax
mov    %eax,-0x80(%rbp)
movl   $0x0,-0x94(%rbp)
movl   $0x0,-0x98(%rbp)
movl   $0x0,-0x9c(%rbp)
movl   $0x0,-0x9c(%rbp)
movslq -0x9c(%rbp),%rax
movzbl -0x70(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     127a <main+0x14a>
movl   $0x0,-0x98(%rbp)
movslq -0x98(%rbp),%rax
cmp    $0x14,%rax
jae    1261 <main+0x131>
movslq -0x9c(%rbp),%rax
movzbl -0x70(%rbp,%rax,1),%eax
movslq -0x98(%rbp),%rcx
movzbl -0x90(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
jne    1248 <main+0x118>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    124d <main+0x11d>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1205 <main+0xd5>
jmp    1266 <main+0x136>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    11e6 <main+0xb6>
mov    -0x94(%rbp),%esi
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe04(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
lea    0xed5(%rip),%rdi
call   1040 <system@plt>
lea    0xeeb(%rip),%rdi
call   1040 <system@plt>
lea    0xee8(%rip),%rdi
call   1040 <system@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
lea    0xf14(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1060 <gets@plt>
mov    (%rsp),%cl
test   %cl,%cl
je     125a <main+0x11a>
lea    0x1(%rsp),%rax
xor    %esi,%esi
movdqa 0xe52(%rip),%xmm0
movdqa 0xe5a(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
movzbl %cl,%ecx
movd   %ecx,%xmm2
punpcklbw %xmm2,%xmm2
pshuflw $0x0,%xmm2,%xmm2
pshufd $0x0,%xmm2,%xmm3
pcmpeqb %xmm0,%xmm3
pmovmskb %xmm3,%ecx
mov    %ecx,%edx
shr    %edx
and    $0x5555,%edx
sub    %edx,%ecx
mov    %ecx,%edx
and    $0x3333,%edx
shr    $0x2,%ecx
and    $0x3333,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shr    $0x4,%edx
add    %ecx,%edx
and    $0xf0f,%edx
mov    %edx,%ecx
shl    $0x8,%ecx
add    %edx,%ecx
movzbl %ch,%edi
pcmpeqb %xmm1,%xmm2
punpcklbw %xmm2,%xmm2
punpcklwd %xmm2,%xmm2
movmskps %xmm2,%edx
mov    %edx,%ecx
shr    %cl
and    $0x5,%cl
sub    %cl,%dl
mov    %edx,%ecx
and    $0x33,%cl
shr    $0x2,%dl
and    $0x33,%dl
add    %cl,%dl
mov    %edx,%ecx
shr    $0x4,%cl
add    %dl,%cl
and    $0xf,%cl
movzbl %cl,%ecx
add    %edi,%ecx
add    %ecx,%esi
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    11c0 <main+0x80>
jmp    125c <main+0x11c>
xor    %esi,%esi
lea    0xdec(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xde2(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"title 31_Cascallar_Autr\C3\A1n_Manuel\00"
@.str.1 = [9 x i8] c"color 0A\00"
@.str.2 = [4 x i8] c"cls\00"
@.str.3 = [34 x i8] c"VOCAIS NUNHA CADEA DE CARACTERES\0A\00"
@.str.4 = [34 x i8] c"================================\0A\00"
@.str.5 = [34 x i8] c"Introduce a cadea de caracteres:\0A\00"
@__const.main.vocales = [20 x i8] c"aeiouAEIOU\A0\82\A1\A2\A3\B5\90\D6\E0\E9"
@.str.6 = [4 x i8] c"%d\0A\00"
@.str.7 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [20 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 @system(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%14 = call i32 @gets(i8* %13)
%15 = bitcast [20 x i8]* %3 to i8*
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %6
br label %16
16: ; preds = %48, %0
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %51
23: ; preds = %16
store i32 0, i32* %5
br label %24
24: ; preds = %44, %23
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = icmp ult i64 %26, 20
br i1 %27, label %28, label %47
28: ; preds = %24
%29 = load i32, i32* %6
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = load i32, i32* %5
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 %35
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = icmp eq i32 %33, %38
br i1 %39, label %40, label %43
40: ; preds = %28
%41 = load i32, i32* %4
%42 = add nsw i32 %41, 1
store i32 %42, i32* %4
br label %43
43: ; preds = %40, %28
br label %44
44: ; preds = %43
%45 = load i32, i32* %5
%46 = add nsw i32 %45, 1
store i32 %46, i32* %5
br label %24
47: ; preds = %24
br label %48
48: ; preds = %47
%49 = load i32, i32* %6
%50 = add nsw i32 %49, 1
store i32 %50, i32* %6
br label %16
51: ; preds = %16
%52 = load i32, i32* %4
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %52)
%54 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%55 = load i32, i32* %1
ret i32 %55
}

LLVM IR (-O2):
@.str = [34 x i8] c"title 31_Cascallar_Autr\C3\A1n_Manuel\00"
@.str.1 = [9 x i8] c"color 0A\00"
@.str.2 = [4 x i8] c"cls\00"
@.str.6 = [4 x i8] c"%d\0A\00"
@.str.7 = [6 x i8] c"pause\00"
@str = [33 x i8] c"VOCAIS NUNHA CADEA DE CARACTERES\00"
@str.8 = [33 x i8] c"================================\00"
@str.9 = [33 x i8] c"Introduce a cadea de caracteres:\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = tail call i32 @system(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.8, i64 0, i64 0))
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.9, i64 0, i64 0))
%9 = call i32 @gets(i8* %7)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %34, label %12
12: ; preds = %0, %12
%13 = phi i64 [ %30, %12 ], [ 0, %0 ]
%14 = phi i8 [ %32, %12 ], [ %10, %0 ]
%15 = phi i32 [ %29, %12 ], [ 0, %0 ]
%16 = insertelement <16 x i8> poison, i8 %14, i64 0
%17 = shufflevector <16 x i8> %16, <16 x i8> poison, <16 x i32> zeroinitializer
%18 = icmp eq <16 x i8> %17, <i8 97, i8 101, i8 105, i8 111, i8 117, i8 65, i8 69, i8 73, i8 79, i8 85, i8 -96, i8 -126, i8 -95, i8 -94, i8 -93, i8 -75>
%19 = insertelement <4 x i8> poison, i8 %14, i64 0
%20 = shufflevector <4 x i8> %19, <4 x i8> poison, <4 x i32> zeroinitializer
%21 = icmp eq <4 x i8> %20, <i8 -112, i8 -42, i8 -32, i8 -23>
%22 = bitcast <16 x i1> %18 to i16
%23 = call i16 @llvm.ctpop.i16(i16 %22)
%24 = zext i16 %23 to i32
%25 = bitcast <4 x i1> %21 to i4
%26 = call i4 @llvm.ctpop.i4(i4 %25)
%27 = zext i4 %26 to i32
%28 = add nuw nsw i32 %24, %27
%29 = add nuw nsw i32 %28, %15
%30 = add nuw i64 %13, 1
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = icmp eq i8 %32, 0
br i1 %33, label %34, label %12
34: ; preds = %12, %0
%35 = phi i32 [ 0, %0 ], [ %29, %12 ]
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %35)
%37 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}