#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*/ alimenta_matriz(int *);
int /*<<< orphan*/ printf(char *, ...);
void main() {
  int vet1[10], vet2[10], vet3[10];
  printf("--Vetor 01--\n");
  alimenta_matriz(vet1);
  printf("--Vetor 02--\n");
  alimenta_matriz(vet2);
  printf("--Vetor Resultante--\n");
  for (int i = 0; i < 10; i++) {
    vet3[i] = vet1[i] * vet2[i];
    printf("[%d] * [%d] = %d\n", vet1[i], vet2[i], vet3[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1040 <alimenta_matriz@plt>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
call   1040 <alimenta_matriz@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x94(%rbp)
cmpl   $0xa,-0x94(%rbp)
jge    11e9 <main+0xc9>
movslq -0x94(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
movslq -0x94(%rbp),%rax
imul   -0x60(%rbp,%rax,4),%ecx
movslq -0x94(%rbp),%rax
mov    %ecx,-0x90(%rbp,%rax,4)
movslq -0x94(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
movslq -0x94(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%edx
movslq -0x94(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%ecx
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1171 <main+0x51>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0x30(%rsp),%rdi
call   1050 <alimenta_matriz@plt>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1050 <alimenta_matriz@plt>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    0x30(%rsp),%esi
mov    (%rsp),%edx
mov    %edx,%ecx
imul   %esi,%ecx
lea    0xe82(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x34(%rsp),%esi
mov    0x4(%rsp),%edx
mov    %edx,%ecx
imul   %esi,%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x38(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %edx,%ecx
imul   %esi,%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x3c(%rsp),%esi
mov    0xc(%rsp),%edx
mov    %edx,%ecx
imul   %esi,%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x40(%rsp),%esi
mov    0x10(%rsp),%edx
mov    %edx,%ecx
imul   %esi,%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x44(%rsp),%esi
mov    0x14(%rsp),%edx
mov    %edx,%ecx
imul   %esi,%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x48(%rsp),%esi
mov    0x18(%rsp),%edx
mov    %edx,%ecx
imul   %esi,%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4c(%rsp),%esi
mov    0x1c(%rsp),%edx
mov    %edx,%ecx
imul   %esi,%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x50(%rsp),%esi
mov    0x20(%rsp),%edx
mov    %edx,%ecx
imul   %esi,%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x54(%rsp),%esi
mov    0x24(%rsp),%edx
mov    %edx,%ecx
imul   %esi,%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"--Vetor 01--\0A\00"
@.str.1 = [14 x i8] c"--Vetor 02--\0A\00"
@.str.2 = [22 x i8] c"--Vetor Resultante--\0A\00"
@.str.3 = [18 x i8] c"[%d] * [%d] = %d\0A\00"
define void @main() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = alloca [10 x i32]
%4 = alloca i32
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @alimenta_matriz(i32* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%10 = call i32 @alimenta_matriz(i32* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %4
br label %12
12: ; preds = %41, %0
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 10
br i1 %14, label %15, label %44
15: ; preds = %12
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = mul nsw i32 %19, %23
%25 = load i32, i32* %4
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %26
store i32 %24, i32* %27
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = load i32, i32* %4
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = load i32, i32* %4
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %31, i32 %35, i32 %39)
br label %41
41: ; preds = %15
%42 = load i32, i32* %4
%43 = add nsw i32 %42, 1
store i32 %43, i32* %4
br label %12
44: ; preds = %12
ret void
}

LLVM IR (-O2):
@.str.3 = [18 x i8] c"[%d] * [%d] = %d\0A\00"
@str = [13 x i8] c"--Vetor 01--\00"
@str.4 = [13 x i8] c"--Vetor 02--\00"
@str.5 = [21 x i8] c"--Vetor Resultante--\00"
define void @main() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @alimenta_matriz(i32* %6)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.4, i64 0, i64 0))
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%10 = call i32 @alimenta_matriz(i32* %9)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.5, i64 0, i64 0))
%12 = load i32, i32* %6
%13 = load i32, i32* %9
%14 = mul nsw i32 %13, %12
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %12, i32 %13, i32 %14)
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%17 = load i32, i32* %16
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
%19 = load i32, i32* %18
%20 = mul nsw i32 %19, %17
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %17, i32 %19, i32 %20)
%22 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%23 = load i32, i32* %22
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 2
%25 = load i32, i32* %24
%26 = mul nsw i32 %25, %23
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %23, i32 %25, i32 %26)
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%29 = load i32, i32* %28
%30 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 3
%31 = load i32, i32* %30
%32 = mul nsw i32 %31, %29
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %29, i32 %31, i32 %32)
%34 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%35 = load i32, i32* %34
%36 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 4
%37 = load i32, i32* %36
%38 = mul nsw i32 %37, %35
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %35, i32 %37, i32 %38)
%40 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%41 = load i32, i32* %40
%42 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
%43 = load i32, i32* %42
%44 = mul nsw i32 %43, %41
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %41, i32 %43, i32 %44)
%46 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%47 = load i32, i32* %46
%48 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 6
%49 = load i32, i32* %48
%50 = mul nsw i32 %49, %47
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %47, i32 %49, i32 %50)
%52 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%53 = load i32, i32* %52
%54 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 7
%55 = load i32, i32* %54
%56 = mul nsw i32 %55, %53
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %53, i32 %55, i32 %56)
%58 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%59 = load i32, i32* %58
%60 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 8
%61 = load i32, i32* %60
%62 = mul nsw i32 %61, %59
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %59, i32 %61, i32 %62)
%64 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%65 = load i32, i32* %64
%66 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
%67 = load i32, i32* %66
%68 = mul nsw i32 %67, %65
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %65, i32 %67, i32 %68)
ret void
}