#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*/ imprimir_vetor(int *, int);
int /*<<< orphan*/ ler_vetor(int *, int);
int /*<<< orphan*/ printf(char *, ...);
int produto_interno(int *, int *, int);
int main() {
  int vetor_base[] = {1, 2, 6, 3, 5};
  int meu_vetor[5];
  ler_vetor(meu_vetor, 5);
  printf("Vetor lido! Imprimindo...\n");
  imprimir_vetor(meu_vetor, 5);
  printf("Produto interno com vetor-base: %d\n",
         produto_interno(vetor_base, meu_vetor, 5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xea5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
mov    $0x5,%esi
call   1030 <ler_vetor@plt>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x5,%esi
call   1050 <imprimir_vetor@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x5,%edx
call   1060 <produto_interno@plt>
mov    %eax,%esi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    0xeb5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xe9a(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <ler_vetor@plt>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1060 <imprimir_vetor@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1070 <produto_interno@plt>
lea    0xe68(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.vetor_base = [5 x i32] [i32 1, i32 2, i32 6, i32 3, i32 5]
@.str = [27 x i8] c"Vetor lido! Imprimindo...\0A\00"
@.str.1 = [36 x i8] c"Produto interno com vetor-base: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca [5 x i32]
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%6 = call i32 @ler_vetor(i32* %5, i32 5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%9 = call i32 @imprimir_vetor(i32* %8, i32 5)
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%12 = call i32 @produto_interno(i32* %10, i32* %11, i32 5)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.vetor_base = [5 x i32] [i32 1, i32 2, i32 6, i32 3, i32 5]
@.str.1 = [36 x i8] c"Produto interno com vetor-base: %d\0A\00"
@str = [26 x i8] c"Vetor lido! Imprimindo...\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = call i32 @ler_vetor(i32* %5, i32 5)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%8 = call i32 @imprimir_vetor(i32* %5, i32 5)
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%10 = call i32 @produto_interno(i32* %9, i32* %5, i32 5)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}