int main() {
  char **vet1 = malloc(3 + 1);
  int *vet2 = malloc(3 * sizeof(int));
  for (int i = 0; i < 3; i++) {
    printf("Nome %d de altura %d\n", i, i);
    vet1[i] = malloc(21);
    scanf("%20s", vet1[i]);
    scanf("%d", &vet2[i]);
  }
  imprime(vet1, vet2);
  for (int i = 0; i < 3; i++)
    free(vet1[i]);
  free(vet1);
  free(vet2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0xc,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    11fe <main+0xae>
mov    -0x1c(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x15,%edi
call   1060 <malloc@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0x18(%rbp),%rsi
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1182 <main+0x32>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1050 <imprime@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    123d <main+0xed>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1214 <main+0xc4>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    $0x4,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    $0xc,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
lea    0xe86(%rip),%r15
mov    %r15,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x15,%edi
call   1060 <malloc@plt>
mov    %rax,(%rbx)
lea    0xe7a(%rip),%r12
mov    %r12,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xe6b(%rip),%r13
mov    %r13,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x15,%edi
call   1060 <malloc@plt>
mov    %rax,0x8(%rbx)
mov    %r12,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0x4(%r14),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    %r15,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x15,%edi
call   1060 <malloc@plt>
mov    %rax,0x10(%rbx)
mov    %r12,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0x8(%r14),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <imprime@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    0x8(%rbx),%rdi
call   1030 <free@plt>
mov    0x10(%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Nome %d de altura %d\0A\00"
@.str.1 = [5 x i8] c"%20s\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8**
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i8* @malloc(i64 4)
%7 = bitcast i8* %6 to i8**
store i8** %7, i8*** %2
%8 = call i8* @malloc(i64 12)
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %3
store i32 0, i32* %4
br label %10
10: ; preds = %33, %0
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 3
br i1 %12, label %13, label %36
13: ; preds = %10
%14 = load i32, i32* %4
%15 = load i32, i32* %4
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15)
%17 = call i8* @malloc(i64 21)
%18 = load i8**, i8*** %2
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
store i8* %17, i8** %21
%22 = load i8**, i8*** %2
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %26)
%28 = load i32*, i32** %3
%29 = load i32, i32* %4
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
%32 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %31)
br label %33
33: ; preds = %13
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %10
36: ; preds = %10
%37 = load i8**, i8*** %2
%38 = load i32*, i32** %3
%39 = call i32 (i8**, i32*, ...) bitcast (i32 (...)* @imprime to i32 (i8**, i32*, ...)*)(i8** %37, i32* %38)
store i32 0, i32* %5
br label %40
40: ; preds = %49, %36
%41 = load i32, i32* %5
%42 = icmp slt i32 %41, 3
br i1 %42, label %43, label %52
43: ; preds = %40
%44 = load i8**, i8*** %2
%45 = load i32, i32* %5
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8*, i8** %44, i64 %46
%48 = load i8*, i8** %47
br label %49
49: ; preds = %43
%50 = load i32, i32* %5
%51 = add nsw i32 %50, 1
store i32 %51, i32* %5
br label %40
52: ; preds = %40
%53 = load i8**, i8*** %2
%54 = bitcast i8** %53 to i8*
%55 = load i32*, i32** %3
%56 = bitcast i32* %55 to i8*
%57 = load i32, i32* %1
ret i32 %57
}

LLVM IR (-O2):
@.str = [22 x i8] c"Nome %d de altura %d\0A\00"
@.str.1 = [5 x i8] c"%20s\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(4) i8* @malloc(i64 4)
%2 = bitcast i8* %1 to i8**
%3 = tail call dereferenceable_or_null(12) i8* @malloc(i64 12)
%4 = bitcast i8* %3 to i32*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
%6 = tail call dereferenceable_or_null(21) i8* @malloc(i64 21)
store i8* %6, i8** %2
%7 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1, i32 1)
%10 = tail call dereferenceable_or_null(21) i8* @malloc(i64 21)
%11 = getelementptr inbounds i8*, i8** %2, i64 1
store i8* %10, i8** %11
%12 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%13 = getelementptr inbounds i32, i32* %4, i64 1
%14 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %13)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 2, i32 2)
%16 = tail call dereferenceable_or_null(21) i8* @malloc(i64 21)
%17 = getelementptr inbounds i8*, i8** %2, i64 2
store i8* %16, i8** %17
%18 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%19 = getelementptr inbounds i32, i32* %4, i64 2
%20 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %19)
%21 = tail call i32 (i8**, i32*, ...) bitcast (i32 (...)* @imprime to i32 (i8**, i32*, ...)*)(i8** %2, i32* %4)
%22 = load i8*, i8** %2
tail call void @free(i8* %22)
%23 = load i8*, i8** %11
tail call void @free(i8* %23)
%24 = load i8*, i8** %17
tail call void @free(i8* %24)
tail call void @free(i8* %1)
tail call void @free(i8* %3)
ret i32 0
}