#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*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main(void) {
  char *str = malloc(12);
  if (str == NULL)
    printf("Não já espaço para alocar");
  else {
    strcpy(str, "nome");
    int tamanho = strlen("nome");
    printf("Nome=[%s] tem [%d] caracters", str, tamanho);
    for (int i = 0; i < tamanho; i++) {
      printf("\nCaracter[%d] = [%c]\n", i, str[i]);
      if (str[i] == 'a' || str[i] == 'e' || str[i] == 'i' || str[i] == 'o' ||
          str[i] == 'u')
        printf("Vogal");
    }
    free(str);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xc,%edi
call   1070 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    118b <main+0x3b>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1282 <main+0x132>
mov    -0x10(%rbp),%rdi
lea    0xe87(%rip),%rsi
call   1040 <strcpy@plt>
lea    0xe7b(%rip),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1279 <main+0x129>
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x61,%eax
je     1258 <main+0x108>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x65,%eax
je     1258 <main+0x108>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x69,%eax
je     1258 <main+0x108>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x6f,%eax
je     1258 <main+0x108>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x75,%eax
jne    1266 <main+0x116>
lea    0xdf6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    126b <main+0x11b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11c6 <main+0x76>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0xc,%edi
call   1070 <malloc@plt>
test   %rax,%rax
je     1206 <main+0xb6>
mov    %rax,%r12
lea    0xea5(%rip),%rbx
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebx
lea    0xe8e(%rip),%rdi
mov    %r12,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <printf@plt>
test   %ebx,%ebx
jle    11fc <main+0xac>
mov    %ebx,%r13d
lea    0xe91(%rip),%r14
mov    $0x495,%ebp
lea    0xe9b(%rip),%r15
xor    %ebx,%ebx
jmp    11c9 <main+0x79>
xchg   %ax,%ax
add    $0x1,%rbx
cmp    %rbx,%r13
je     11fc <main+0xac>
movsbl (%r12,%rbx,1),%edx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl (%r12,%rbx,1),%eax
add    $0x9f,%al
ror    %al
cmp    $0xa,%al
ja     11c0 <main+0x70>
movzbl %al,%eax
bt     %rax,%rbp
jae    11c0 <main+0x70>
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    11c0 <main+0x70>
mov    %r12,%rdi
call   1030 <free@plt>
jmp    1214 <main+0xc4>
lea    0xdf3(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"N\C3\A3o j\C3\A1 espa\C3\A7o para alocar\00"
@.str.1 = [5 x i8] c"nome\00"
@.str.2 = [29 x i8] c"Nome=[%s] tem [%d] caracters\00"
@.str.3 = [22 x i8] c"\0ACaracter[%d] = [%c]\0A\00"
@.str.4 = [6 x i8] c"Vogal\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i8* @malloc(i32 12)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %78
10: ; preds = %0
%11 = load i8*, i8** %2
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 %13, i32* %3
%14 = load i8*, i8** %2
%15 = load i32, i32* %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %14, i32 %15)
store i32 0, i32* %4
br label %17
17: ; preds = %72, %10
%18 = load i32, i32* %4
%19 = load i32, i32* %3
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %75
21: ; preds = %17
%22 = load i32, i32* %4
%23 = load i8*, i8** %2
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %22, i32 %28)
%30 = load i8*, i8** %2
%31 = load i32, i32* %4
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %30, i64 %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 97
br i1 %36, label %69, label %37
37: ; preds = %21
%38 = load i8*, i8** %2
%39 = load i32, i32* %4
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %38, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 101
br i1 %44, label %69, label %45
45: ; preds = %37
%46 = load i8*, i8** %2
%47 = load i32, i32* %4
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8, i8* %46, i64 %48
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp eq i32 %51, 105
br i1 %52, label %69, label %53
53: ; preds = %45
%54 = load i8*, i8** %2
%55 = load i32, i32* %4
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8, i8* %54, i64 %56
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 111
br i1 %60, label %69, label %61
61: ; preds = %53
%62 = load i8*, i8** %2
%63 = load i32, i32* %4
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8, i8* %62, i64 %64
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = icmp eq i32 %67, 117
br i1 %68, label %69, label %71
69: ; preds = %61, %53, %45, %37, %21
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %71
71: ; preds = %69, %61
br label %72
72: ; preds = %71
%73 = load i32, i32* %4
%74 = add nsw i32 %73, 1
store i32 %74, i32* %4
br label %17
75: ; preds = %17
%76 = load i8*, i8** %2
%77 = call i32 @free(i8* %76)
br label %78
78: ; preds = %75, %8
%79 = load i32, i32* %1
ret i32 %79
}

LLVM IR (-O2):
@.str = [29 x i8] c"N\C3\A3o j\C3\A1 espa\C3\A7o para alocar\00"
@.str.1 = [5 x i8] c"nome\00"
@.str.2 = [29 x i8] c"Nome=[%s] tem [%d] caracters\00"
@.str.3 = [22 x i8] c"\0ACaracter[%d] = [%c]\0A\00"
@.str.4 = [6 x i8] c"Vogal\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(12) i8* @malloc(i32 12)
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %29
5: ; preds = %0
%6 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %1, i32 %7)
%9 = icmp sgt i32 %7, 0
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = zext i32 %7 to i64
br label %14
12: ; preds = %26, %5
%13 = tail call i32 @free(i8* %1)
br label %29
14: ; preds = %10, %26
%15 = phi i64 [ 0, %10 ], [ %27, %26 ]
%16 = getelementptr inbounds i8, i8* %1, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = trunc i64 %15 to i32
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %19, i32 %18)
%21 = load i8, i8* %16
%22 = add i8 %21, -97
%23 = tail call i8 @llvm.fshl.i8(i8 %22, i8 %22, i8 7)
switch i8 %23, label %26 [
i8 0, label %24
i8 2, label %24
i8 4, label %24
i8 7, label %24
i8 10, label %24
]
24: ; preds = %14, %14, %14, %14, %14
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %26
26: ; preds = %14, %24
%27 = add nuw nsw i64 %15, 1
%28 = icmp eq i64 %27, %11
br i1 %28, label %12, label %14
29: ; preds = %12, %3
ret i32 0
}